import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../wayfinder'
import backgrounds from './backgrounds'
import images from './images'
/**
* @see \App\Http\Controllers\BrandingAssetController::background
 * @see app/Http/Controllers/BrandingAssetController.php:38
 * @route '/branding/backgrounds/{image}'
 */
export const background = (args: { image: string | number } | [image: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: background.url(args, options),
    method: 'get',
})

background.definition = {
    methods: ["get","head"],
    url: '/branding/backgrounds/{image}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\BrandingAssetController::background
 * @see app/Http/Controllers/BrandingAssetController.php:38
 * @route '/branding/backgrounds/{image}'
 */
background.url = (args: { image: string | number } | [image: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { image: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
                        image: args.image,
                }

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

/**
* @see \App\Http\Controllers\BrandingAssetController::background
 * @see app/Http/Controllers/BrandingAssetController.php:38
 * @route '/branding/backgrounds/{image}'
 */
background.get = (args: { image: string | number } | [image: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: background.url(args, options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\BrandingAssetController::background
 * @see app/Http/Controllers/BrandingAssetController.php:38
 * @route '/branding/backgrounds/{image}'
 */
background.head = (args: { image: string | number } | [image: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: background.url(args, options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\BrandingAssetController::background
 * @see app/Http/Controllers/BrandingAssetController.php:38
 * @route '/branding/backgrounds/{image}'
 */
    const backgroundForm = (args: { image: string | number } | [image: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: background.url(args, options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\BrandingAssetController::background
 * @see app/Http/Controllers/BrandingAssetController.php:38
 * @route '/branding/backgrounds/{image}'
 */
        backgroundForm.get = (args: { image: string | number } | [image: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: background.url(args, options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\BrandingAssetController::background
 * @see app/Http/Controllers/BrandingAssetController.php:38
 * @route '/branding/backgrounds/{image}'
 */
        backgroundForm.head = (args: { image: string | number } | [image: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: background.url(args, {
                        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
                            _method: 'HEAD',
                            ...(options?.query ?? options?.mergeQuery ?? {}),
                        }
                    }),
            method: 'get',
        })
    
    background.form = backgroundForm
/**
* @see \App\Http\Controllers\BrandingAssetController::image
 * @see app/Http/Controllers/BrandingAssetController.php:22
 * @route '/branding/{slot}'
 */
export const image = (args: { slot: string | number } | [slot: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: image.url(args, options),
    method: 'get',
})

image.definition = {
    methods: ["get","head"],
    url: '/branding/{slot}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\BrandingAssetController::image
 * @see app/Http/Controllers/BrandingAssetController.php:22
 * @route '/branding/{slot}'
 */
image.url = (args: { slot: string | number } | [slot: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { slot: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
                        slot: args.slot,
                }

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

/**
* @see \App\Http\Controllers\BrandingAssetController::image
 * @see app/Http/Controllers/BrandingAssetController.php:22
 * @route '/branding/{slot}'
 */
image.get = (args: { slot: string | number } | [slot: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: image.url(args, options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\BrandingAssetController::image
 * @see app/Http/Controllers/BrandingAssetController.php:22
 * @route '/branding/{slot}'
 */
image.head = (args: { slot: string | number } | [slot: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: image.url(args, options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\BrandingAssetController::image
 * @see app/Http/Controllers/BrandingAssetController.php:22
 * @route '/branding/{slot}'
 */
    const imageForm = (args: { slot: string | number } | [slot: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: image.url(args, options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\BrandingAssetController::image
 * @see app/Http/Controllers/BrandingAssetController.php:22
 * @route '/branding/{slot}'
 */
        imageForm.get = (args: { slot: string | number } | [slot: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: image.url(args, options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\BrandingAssetController::image
 * @see app/Http/Controllers/BrandingAssetController.php:22
 * @route '/branding/{slot}'
 */
        imageForm.head = (args: { slot: string | number } | [slot: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: image.url(args, {
                        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
                            _method: 'HEAD',
                            ...(options?.query ?? options?.mergeQuery ?? {}),
                        }
                    }),
            method: 'get',
        })
    
    image.form = imageForm
/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
 * @see app/Http/Controllers/Settings/BrandingController.php:30
 * @route '/settings/branding'
 */
export const edit = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(options),
    method: 'get',
})

edit.definition = {
    methods: ["get","head"],
    url: '/settings/branding',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
 * @see app/Http/Controllers/Settings/BrandingController.php:30
 * @route '/settings/branding'
 */
edit.url = (options?: RouteQueryOptions) => {
    return edit.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
 * @see app/Http/Controllers/Settings/BrandingController.php:30
 * @route '/settings/branding'
 */
edit.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
 * @see app/Http/Controllers/Settings/BrandingController.php:30
 * @route '/settings/branding'
 */
edit.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: edit.url(options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\Settings\BrandingController::edit
 * @see app/Http/Controllers/Settings/BrandingController.php:30
 * @route '/settings/branding'
 */
    const editForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: edit.url(options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\Settings\BrandingController::edit
 * @see app/Http/Controllers/Settings/BrandingController.php:30
 * @route '/settings/branding'
 */
        editForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: edit.url(options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\Settings\BrandingController::edit
 * @see app/Http/Controllers/Settings/BrandingController.php:30
 * @route '/settings/branding'
 */
        editForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: edit.url({
                        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
                            _method: 'HEAD',
                            ...(options?.query ?? options?.mergeQuery ?? {}),
                        }
                    }),
            method: 'get',
        })
    
    edit.form = editForm
/**
* @see \App\Http\Controllers\Settings\BrandingController::update
 * @see app/Http/Controllers/Settings/BrandingController.php:49
 * @route '/settings/branding'
 */
export const update = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: update.url(options),
    method: 'post',
})

update.definition = {
    methods: ["post"],
    url: '/settings/branding',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Settings\BrandingController::update
 * @see app/Http/Controllers/Settings/BrandingController.php:49
 * @route '/settings/branding'
 */
update.url = (options?: RouteQueryOptions) => {
    return update.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Settings\BrandingController::update
 * @see app/Http/Controllers/Settings/BrandingController.php:49
 * @route '/settings/branding'
 */
update.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: update.url(options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\Settings\BrandingController::update
 * @see app/Http/Controllers/Settings/BrandingController.php:49
 * @route '/settings/branding'
 */
    const updateForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: update.url(options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\Settings\BrandingController::update
 * @see app/Http/Controllers/Settings/BrandingController.php:49
 * @route '/settings/branding'
 */
        updateForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: update.url(options),
            method: 'post',
        })
    
    update.form = updateForm
/**
* @see \App\Http\Controllers\Settings\BrandingController::reset
 * @see app/Http/Controllers/Settings/BrandingController.php:110
 * @route '/settings/branding'
 */
export const reset = (options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: reset.url(options),
    method: 'delete',
})

reset.definition = {
    methods: ["delete"],
    url: '/settings/branding',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\Settings\BrandingController::reset
 * @see app/Http/Controllers/Settings/BrandingController.php:110
 * @route '/settings/branding'
 */
reset.url = (options?: RouteQueryOptions) => {
    return reset.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Settings\BrandingController::reset
 * @see app/Http/Controllers/Settings/BrandingController.php:110
 * @route '/settings/branding'
 */
reset.delete = (options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: reset.url(options),
    method: 'delete',
})

    /**
* @see \App\Http\Controllers\Settings\BrandingController::reset
 * @see app/Http/Controllers/Settings/BrandingController.php:110
 * @route '/settings/branding'
 */
    const resetForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: reset.url({
                    [options?.mergeQuery ? 'mergeQuery' : 'query']: {
                        _method: 'DELETE',
                        ...(options?.query ?? options?.mergeQuery ?? {}),
                    }
                }),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\Settings\BrandingController::reset
 * @see app/Http/Controllers/Settings/BrandingController.php:110
 * @route '/settings/branding'
 */
        resetForm.delete = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: reset.url({
                        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
                            _method: 'DELETE',
                            ...(options?.query ?? options?.mergeQuery ?? {}),
                        }
                    }),
            method: 'post',
        })
    
    reset.form = resetForm
const branding = {
    background: Object.assign(background, background),
image: Object.assign(image, image),
edit: Object.assign(edit, edit),
update: Object.assign(update, update),
reset: Object.assign(reset, reset),
backgrounds: Object.assign(backgrounds, backgrounds),
images: Object.assign(images, images),
}

export default branding