import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../wayfinder'
/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
const PublicQuoteController = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: PublicQuoteController.url(args, options),
    method: 'get',
})

PublicQuoteController.definition = {
    methods: ["get","head"],
    url: '/cotizacion/{token}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
PublicQuoteController.url = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { token: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        token: args.token,
    }

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

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
PublicQuoteController.get = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: PublicQuoteController.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
PublicQuoteController.head = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: PublicQuoteController.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
const PublicQuoteControllerForm = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: PublicQuoteController.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
PublicQuoteControllerForm.get = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: PublicQuoteController.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\PublicQuoteController::__invoke
* @see app/Http/Controllers/PublicQuoteController.php:13
* @route '/cotizacion/{token}'
*/
PublicQuoteControllerForm.head = (args: { token: string | number } | [token: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: PublicQuoteController.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

PublicQuoteController.form = PublicQuoteControllerForm

export default PublicQuoteController