import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition } from './../../../wayfinder'
/**
* @see \App\Http\Controllers\Admin\LiveChatSettingsController::update
* @see app/Http/Controllers/Admin/LiveChatSettingsController.php:45
* @route '/app/settings/live-chat'
*/
export const update = (options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: update.url(options),
    method: 'patch',
})

update.definition = {
    methods: ["patch"],
    url: '/app/settings/live-chat',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Admin\LiveChatSettingsController::update
* @see app/Http/Controllers/Admin/LiveChatSettingsController.php:45
* @route '/app/settings/live-chat'
*/
update.url = (options?: RouteQueryOptions) => {
    return update.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\LiveChatSettingsController::update
* @see app/Http/Controllers/Admin/LiveChatSettingsController.php:45
* @route '/app/settings/live-chat'
*/
update.patch = (options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: update.url(options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Admin\LiveChatSettingsController::update
* @see app/Http/Controllers/Admin/LiveChatSettingsController.php:45
* @route '/app/settings/live-chat'
*/
const updateForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\LiveChatSettingsController::update
* @see app/Http/Controllers/Admin/LiveChatSettingsController.php:45
* @route '/app/settings/live-chat'
*/
updateForm.patch = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

update.form = updateForm

const liveChat = {
    update: Object.assign(update, update),
}

export default liveChat