import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../wayfinder'
/**
* @see \App\Http\Controllers\ClientZoneController::show
* @see app/Http/Controllers/ClientZoneController.php:446
* @route '/client-zone/quotes/{quoteId}'
*/
export const show = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

show.definition = {
    methods: ["get","head"],
    url: '/client-zone/quotes/{quoteId}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\ClientZoneController::show
* @see app/Http/Controllers/ClientZoneController.php:446
* @route '/client-zone/quotes/{quoteId}'
*/
show.url = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { quoteId: args }
    }

    if (Array.isArray(args)) {
        args = {
            quoteId: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        quoteId: args.quoteId,
    }

    return show.definition.url
            .replace('{quoteId}', parsedArgs.quoteId.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\ClientZoneController::show
* @see app/Http/Controllers/ClientZoneController.php:446
* @route '/client-zone/quotes/{quoteId}'
*/
show.get = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ClientZoneController::show
* @see app/Http/Controllers/ClientZoneController.php:446
* @route '/client-zone/quotes/{quoteId}'
*/
show.head = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: show.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\ClientZoneController::show
* @see app/Http/Controllers/ClientZoneController.php:446
* @route '/client-zone/quotes/{quoteId}'
*/
const showForm = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ClientZoneController::show
* @see app/Http/Controllers/ClientZoneController.php:446
* @route '/client-zone/quotes/{quoteId}'
*/
showForm.get = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ClientZoneController::show
* @see app/Http/Controllers/ClientZoneController.php:446
* @route '/client-zone/quotes/{quoteId}'
*/
showForm.head = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

show.form = showForm

/**
* @see \App\Http\Controllers\ClientZoneController::downloadPdf
* @see app/Http/Controllers/ClientZoneController.php:509
* @route '/client-zone/quotes/{quoteId}/download-pdf'
*/
export const downloadPdf = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: downloadPdf.url(args, options),
    method: 'get',
})

downloadPdf.definition = {
    methods: ["get","head"],
    url: '/client-zone/quotes/{quoteId}/download-pdf',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\ClientZoneController::downloadPdf
* @see app/Http/Controllers/ClientZoneController.php:509
* @route '/client-zone/quotes/{quoteId}/download-pdf'
*/
downloadPdf.url = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { quoteId: args }
    }

    if (Array.isArray(args)) {
        args = {
            quoteId: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        quoteId: args.quoteId,
    }

    return downloadPdf.definition.url
            .replace('{quoteId}', parsedArgs.quoteId.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\ClientZoneController::downloadPdf
* @see app/Http/Controllers/ClientZoneController.php:509
* @route '/client-zone/quotes/{quoteId}/download-pdf'
*/
downloadPdf.get = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: downloadPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ClientZoneController::downloadPdf
* @see app/Http/Controllers/ClientZoneController.php:509
* @route '/client-zone/quotes/{quoteId}/download-pdf'
*/
downloadPdf.head = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: downloadPdf.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\ClientZoneController::downloadPdf
* @see app/Http/Controllers/ClientZoneController.php:509
* @route '/client-zone/quotes/{quoteId}/download-pdf'
*/
const downloadPdfForm = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: downloadPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ClientZoneController::downloadPdf
* @see app/Http/Controllers/ClientZoneController.php:509
* @route '/client-zone/quotes/{quoteId}/download-pdf'
*/
downloadPdfForm.get = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: downloadPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ClientZoneController::downloadPdf
* @see app/Http/Controllers/ClientZoneController.php:509
* @route '/client-zone/quotes/{quoteId}/download-pdf'
*/
downloadPdfForm.head = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: downloadPdf.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

downloadPdf.form = downloadPdfForm

/**
* @see \App\Http\Controllers\ClientZoneController::sign
* @see app/Http/Controllers/ClientZoneController.php:583
* @route '/client-zone/quotes/{quoteId}/sign'
*/
export const sign = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: sign.url(args, options),
    method: 'post',
})

sign.definition = {
    methods: ["post"],
    url: '/client-zone/quotes/{quoteId}/sign',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\ClientZoneController::sign
* @see app/Http/Controllers/ClientZoneController.php:583
* @route '/client-zone/quotes/{quoteId}/sign'
*/
sign.url = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { quoteId: args }
    }

    if (Array.isArray(args)) {
        args = {
            quoteId: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        quoteId: args.quoteId,
    }

    return sign.definition.url
            .replace('{quoteId}', parsedArgs.quoteId.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\ClientZoneController::sign
* @see app/Http/Controllers/ClientZoneController.php:583
* @route '/client-zone/quotes/{quoteId}/sign'
*/
sign.post = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: sign.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\ClientZoneController::sign
* @see app/Http/Controllers/ClientZoneController.php:583
* @route '/client-zone/quotes/{quoteId}/sign'
*/
const signForm = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: sign.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\ClientZoneController::sign
* @see app/Http/Controllers/ClientZoneController.php:583
* @route '/client-zone/quotes/{quoteId}/sign'
*/
signForm.post = (args: { quoteId: string | number } | [quoteId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: sign.url(args, options),
    method: 'post',
})

sign.form = signForm

const quotes = {
    show: Object.assign(show, show),
    downloadPdf: Object.assign(downloadPdf, downloadPdf),
    sign: Object.assign(sign, sign),
}

export default quotes