(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={assign:function(){return u},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return o}};for(var i in s)Object.defineProperty(r,i,{enumerable:!0,get:s[i]});function a(e){let t={};for(let[r,s]of e.entries()){let e=t[r];void 0===e?t[r]=s:Array.isArray(e)?e.push(s):t[r]=[e,s]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[r,s]of Object.entries(e))if(Array.isArray(s))for(let e of s)t.append(r,n(e));else t.set(r,n(s));return t}function u(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,s]of r.entries())e.append(t,s)}return e}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return C},MissingStaticPage:function(){return x},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return y},ST:function(){return m},WEB_VITALS:function(){return a},execOnce:function(){return n},getDisplayName:function(){return h},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return u},isResSent:function(){return d},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return S}};for(var i in s)Object.defineProperty(r,i,{enumerable:!0,get:s[i]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return(...s)=>(r||(r=!0,t=e(...s)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>o.test(e);function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function h(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let s=await e.getInitialProps(t);if(r&&d(r))return s;if(!s)throw Object.defineProperty(Error(`"${h(e)}.getInitialProps()" should resolve to an object. But found "${s}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return s}let y="u">typeof performance,m=y&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class C extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function S(e){return JSON.stringify({message:e.message,stack:e.stack})}},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},18566,(e,t,r)=>{t.exports=e.r(76562)},14272,e=>{"use strict";var t=e.i(40143),r=e.i(88587),s=e.i(36553),i=class extends r.Removable{#e;#t;#r;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||a(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=(0,s.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let i="pending"===this.state.status,a=!this.#s.canStart();try{if(i)t();else{this.#i({type:"pending",variables:e,isPaused:a}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:a})}let s=await this.#s.start();return await this.#r.config.onSuccess?.(s,e,this.state.context,this,r),await this.options.onSuccess?.(s,e,this.state.context,r),await this.#r.config.onSettled?.(s,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(s,null,e,this.state.context,r),this.#i({type:"success",data:s}),s}catch(t){try{await this.#r.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:"error",error:t}),t}finally{this.#r.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}e.s(["Mutation",0,i,"getDefaultState",0,a])},86491,e=>{"use strict";e.i(47167);var t=e.i(19273),r=e.i(40143),s=e.i(36553),i=e.i(88587);function a(e,{pages:t,pageParams:r}){let s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}var n=class extends i.Removable{#a;#n;#o;#u;#e;#s;#l;#c;constructor(e){super(),this.#c=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#e=e.client,this.#u=this.#e.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#n=l(this.options),this.state=e.state??this.#n,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#a}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#l,...e},e?._type&&(this.#a=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=l(this.options);void 0!==e.data&&(this.setState(u(e.data,e.dataUpdatedAt)),this.#n=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,r){let s=(0,t.replaceData)(this.state.data,e,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),s}setState(e){this.#i({type:"setState",state:e})}cancel(e){let r=this.#s?.promise;return this.#s?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#n}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveQueryBoolean)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#c||this.#h()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#h(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,r){var i;let n;if("idle"!==this.state.fetchStatus&&this.#s?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let o=new AbortController,u=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#c=!0,o.signal)})},l=()=>{let e,s=(0,t.ensureQueryFn)(this.options,r),i=(u(e={client:this.#e,queryKey:this.queryKey,meta:this.meta}),e);return(this.#c=!1,this.options.persister)?this.options.persister(s,i,this):s(i)},c=(u(n={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#e,state:this.state,fetchFn:l}),n),h="infinite"===this.#a?(i=this.options.pages,{onFetch:(e,r)=>{let s=e.options,n=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],u=e.state.data?.pageParams||[],l={pages:[],pageParams:[]},c=0,h=async()=>{let r=!1,h=(0,t.ensureQueryFn)(e.options,e.fetchOptions),d=async(s,i,a)=>{let n;if(r)return Promise.reject(e.signal.reason);if(null==i&&s.pages.length)return Promise.resolve(s);let o=(n={client:e.client,queryKey:e.queryKey,pageParam:i,direction:a?"backward":"forward",meta:e.options.meta},(0,t.addConsumeAwareSignal)(n,()=>e.signal,()=>r=!0),n),u=await h(o),{maxPages:l}=e.options,c=a?t.addToStart:t.addToEnd;return{pages:c(s.pages,u,l),pageParams:c(s.pageParams,i,l)}};if(n&&o.length){let e="backward"===n,t={pages:o,pageParams:u},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:a)(s,t);l=await d(t,r,e)}else{let e=i??o.length;do{let e=0===c?u[0]??s.initialPageParam:a(s,l);if(c>0&&null==e)break;l=await d(l,e),c++}while(ce.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=h}}):this.options.behavior;h?.onFetch(c,this),this.#o=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#i({type:"fetch",meta:c.fetchOptions?.meta}),this.#s=(0,s.createRetryer)({initialPromise:r?.initialPromise,fn:c.fetchFn,onCancel:e=>{e instanceof s.CancelledError&&e.revert&&this.setState({...this.#o,fetchStatus:"idle"}),o.abort()},onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{let e=await this.#s.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof s.CancelledError){if(e.silent)return this.#s.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#i({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#i(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...o(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...u(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#o=e.manual?r:void 0,r;case"error":let s=e.error;return{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function o(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,s.canFetch)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function u(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function l(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",0,n,"fetchState",0,o],86491)},66027,e=>{"use strict";let t;var r=e.i(75555),s=e.i(73911),i=e.i(40143),a=e.i(86491),n=e.i(15823),o=e.i(93803),u=e.i(19273),l=e.i(80166),c=class extends n.Subscribable{constructor(e,t){super(),this.options=t,this.#e=e,this.#d=null,this.#f=(0,o.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#e;#p=void 0;#y=void 0;#m=void 0;#g;#b;#f;#d;#v;#x;#C;#S;#w;#O;#R=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#p.addObserver(this),h(this.#p,this.options)?this.#Q():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#p,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#p,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#j(),this.#M(),this.#p.removeObserver(this)}setOptions(e){let t=this.options,r=this.#p;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,u.resolveQueryBoolean)(this.options.enabled,this.#p))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#T(),this.#p.setOptions(this.options),t._defaulted&&!(0,u.shallowEqualObjects)(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#p,observer:this});let s=this.hasListeners();s&&f(this.#p,r,this.options,t)&&this.#Q(),this.updateResult(),s&&(this.#p!==r||(0,u.resolveQueryBoolean)(this.options.enabled,this.#p)!==(0,u.resolveQueryBoolean)(t.enabled,this.#p)||(0,u.resolveStaleTime)(this.options.staleTime,this.#p)!==(0,u.resolveStaleTime)(t.staleTime,this.#p))&&this.#E();let i=this.#q();s&&(this.#p!==r||(0,u.resolveQueryBoolean)(this.options.enabled,this.#p)!==(0,u.resolveQueryBoolean)(t.enabled,this.#p)||i!==this.#O)&&this.#k(i)}getOptimisticResult(e){var t,r;let s=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(s,e);return t=this,r=i,(0,u.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#m=i,this.#b=this.options,this.#g=this.#p.state),i}getCurrentResult(){return this.#m}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#f.status||this.#f.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#R.add(e)}getCurrentQuery(){return this.#p}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#Q({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#m))}#Q(e){this.#T();let t=this.#p.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u.noop)),t}#E(){this.#j();let e=(0,u.resolveStaleTime)(this.options.staleTime,this.#p);if(s.environmentManager.isServer()||this.#m.isStale||!(0,u.isValidTimeout)(e))return;let t=(0,u.timeUntilStale)(this.#m.dataUpdatedAt,e);this.#S=l.timeoutManager.setTimeout(()=>{this.#m.isStale||this.updateResult()},t+1)}#q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#p):this.options.refetchInterval)??!1}#k(e){this.#M(),this.#O=e,!s.environmentManager.isServer()&&!1!==(0,u.resolveQueryBoolean)(this.options.enabled,this.#p)&&(0,u.isValidTimeout)(this.#O)&&0!==this.#O&&(this.#w=l.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||r.focusManager.isFocused())&&this.#Q()},this.#O))}#P(){this.#E(),this.#k(this.#q())}#j(){void 0!==this.#S&&(l.timeoutManager.clearTimeout(this.#S),this.#S=void 0)}#M(){void 0!==this.#w&&(l.timeoutManager.clearInterval(this.#w),this.#w=void 0)}createResult(e,t){let r,s=this.#p,i=this.options,n=this.#m,l=this.#g,c=this.#b,d=e!==s?e.state:this.#y,{state:y}=e,m={...y},g=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&h(e,t),o=r&&f(e,s,t,i);(n||o)&&(m={...m,...(0,a.fetchState)(y.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:x}=m;r=m.data;let C=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===x){let e;n?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=n.data,C=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#C?.state.data,this.#C):t.placeholderData,void 0!==e&&(x="success",r=(0,u.replaceData)(n?.data,e,t),g=!0)}if(t.select&&void 0!==r&&!C)if(n&&r===l?.data&&t.select===this.#v)r=this.#x;else try{this.#v=t.select,r=t.select(r),r=(0,u.replaceData)(n?.data,r,t),this.#x=r,this.#d=null}catch(e){this.#d=e}this.#d&&(b=this.#d,r=this.#x,v=Date.now(),x="error");let S="fetching"===m.fetchStatus,w="pending"===x,O="error"===x,R=w&&S,Q=void 0!==r,P={status:x,fetchStatus:m.fetchStatus,isPending:w,isSuccess:"success"===x,isError:O,isInitialLoading:R,isLoading:R,data:r,dataUpdatedAt:m.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!w,isLoadingError:O&&!Q,isPaused:"paused"===m.fetchStatus,isPlaceholderData:g,isRefetchError:O&&Q,isStale:p(e,t),refetch:this.refetch,promise:this.#f,isEnabled:!1!==(0,u.resolveQueryBoolean)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==P.data,r="error"===P.status&&!t,i=e=>{r?e.reject(P.error):t&&e.resolve(P.data)},a=()=>{i(this.#f=P.promise=(0,o.pendingThenable)())},n=this.#f;switch(n.status){case"pending":e.queryHash===s.queryHash&&i(n);break;case"fulfilled":(r||P.data!==n.value)&&a();break;case"rejected":r&&P.error===n.reason||a()}}return P}updateResult(){let e=this.#m,t=this.createResult(this.#p,this.options);if(this.#g=this.#p.state,this.#b=this.options,void 0!==this.#g.data&&(this.#C=this.#p),(0,u.shallowEqualObjects)(t,e))return;this.#m=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#R.size)return!0;let s=new Set(r??this.#R);return this.options.throwOnError&&s.add("error"),Object.keys(this.#m).some(t=>this.#m[t]!==e[t]&&s.has(t))};this.#F({listeners:r()})}#T(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#p)return;let t=this.#p;this.#p=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#F(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#m)}),this.#e.getQueryCache().notify({query:this.#p,type:"observerResultsUpdated"})})}};function h(e,t){return!1!==(0,u.resolveQueryBoolean)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==(0,u.resolveQueryBoolean)(t.retryOnMount,e))||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,r){if(!1!==(0,u.resolveQueryBoolean)(t.enabled,e)&&"static"!==(0,u.resolveStaleTime)(t.staleTime,e)){let s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&p(e,t)}return!1}function f(e,t,r,s){return(e!==t||!1===(0,u.resolveQueryBoolean)(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&p(e,r)}function p(e,t){return!1!==(0,u.resolveQueryBoolean)(t.enabled,e)&&e.isStaleByTime((0,u.resolveStaleTime)(t.staleTime,e))}e.i(47167);var y=e.i(71645),m=e.i(12598);e.i(43476);var g=y.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),b=y.createContext(!1);b.Provider;var v=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});e.s(["useQuery",0,function(e,t){return function(e,t,r){let a,n=y.useContext(b),o=y.useContext(g),l=(0,m.useQueryClient)(r),c=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let h=l.getQueryCache().get(c.queryHash);if(c._optimisticResults=n?"isRestoring":"optimistic",c.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=c.staleTime;c.staleTime="function"==typeof t?(...r)=>e(t(...r)):e(t),"number"==typeof c.gcTime&&(c.gcTime=Math.max(c.gcTime,1e3))}a=h?.state.error&&"function"==typeof c.throwOnError?(0,u.shouldThrowError)(c.throwOnError,[h.state.error,h]):c.throwOnError,(c.suspense||c.experimental_prefetchInRender||a)&&!o.isReset()&&(c.retryOnMount=!1),y.useEffect(()=>{o.clearReset()},[o]);let d=!l.getQueryCache().get(c.queryHash),[f]=y.useState(()=>new t(l,c)),p=f.getOptimisticResult(c),x=!n&&!1!==e.subscribed;if(y.useSyncExternalStore(y.useCallback(e=>{let t=x?f.subscribe(i.notifyManager.batchCalls(e)):u.noop;return f.updateResult(),t},[f,x]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),y.useEffect(()=>{f.setOptions(c)},[c,f]),c?.suspense&&p.isPending)throw v(c,f,o);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&void 0===e.data||(0,u.shouldThrowError)(r,[e.error,s])))({result:p,errorResetBoundary:o,throwOnError:c.throwOnError,query:h,suspense:c.suspense}))throw p.error;if(l.getDefaultOptions().queries?._experimental_afterQuery?.(c,p),c.experimental_prefetchInRender&&!s.environmentManager.isServer()&&p.isLoading&&p.isFetching&&!n){let e=d?v(c,f,o):h?.promise;e?.catch(u.noop).finally(()=>{f.updateResult()})}return c.notifyOnChangeProps?p:f.trackResult(p)}(e,c,t)}],66027)},59544,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(75157);let i=(0,r.forwardRef)(({className:e,variant:r="primary",...i},a)=>(0,t.jsx)("button",{ref:a,className:(0,s.cn)("inline-flex h-11 items-center justify-center gap-2 rounded-xl px-4 text-sm font-semibold transition active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50","primary"===r&&"bg-primary text-white shadow-glow hover:bg-blue-500","ghost"===r&&"border border-border bg-surface text-slate-100 hover:bg-hover","danger"===r&&"bg-danger text-white hover:bg-red-500",e),...i}));i.displayName="Button",e.s(["Button",0,i])},75254,e=>{"use strict";var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:o="",children:u,iconNode:l,...c},h)=>(0,t.createElement)("svg",{ref:h,...s,width:i,height:i,stroke:e,strokeWidth:n?24*Number(a)/Number(i):a,className:r("lucide",o),...c},[...l.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(u)?u:[u]]));e.s(["default",0,(e,s)=>{let a=(0,t.forwardRef)(({className:a,...n},o)=>(0,t.createElement)(i,{ref:o,iconNode:s,className:r(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,a),...n}));return a.displayName=`${e}`,a}],75254)},5125,e=>{"use strict";let t=(0,e.i(75254).default)("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);e.s(["Car",0,t],5125)},22858,e=>{"use strict";let t=(0,e.i(75254).default)("Fuel",[["line",{x1:"3",x2:"15",y1:"22",y2:"22",key:"xegly4"}],["line",{x1:"4",x2:"14",y1:"9",y2:"9",key:"xcnuvu"}],["path",{d:"M14 22V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18",key:"16j0yd"}],["path",{d:"M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 2 2a2 2 0 0 0 2-2V9.83a2 2 0 0 0-.59-1.42L18 5",key:"7cu91f"}]]);e.s(["Fuel",0,t],22858)},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={formatUrl:function(){return o},formatWithValidation:function(){return l},urlObjectKeys:function(){return u}};for(var i in s)Object.defineProperty(r,i,{enumerable:!0,get:s[i]});let a=e.r(90809)._(e.r(98183)),n=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,s=e.protocol||"",i=e.pathname||"",o=e.hash||"",u=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(l+=":"+e.port)),u&&"object"==typeof u&&(u=String(a.urlQueryToSearchParams(u)));let c=e.search||u&&`?${u}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||n.test(s))&&!1!==l?(l="//"+(l||""),i&&"/"!==i[0]&&(i="/"+i)):l||(l=""),o&&"#"!==o[0]&&(o="#"+o),c&&"?"!==c[0]&&(c="?"+c),i=i.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${s}${l}${i}${c}${o}`}let u=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return o(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let s=e.r(71645);function i(e,t){let r=(0,s.useRef)(null),i=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=a(e,s)),t&&(i.current=a(t,s))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let s=e.r(18967),i=e.r(52817);function a(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={default:function(){return g},useLinkStatus:function(){return v}};for(var i in s)Object.defineProperty(r,i,{enumerable:!0,get:s[i]});let a=e.r(90809),n=e.r(43476),o=a._(e.r(71645)),u=e.r(95057),l=e.r(8372),c=e.r(18581),h=e.r(18967),d=e.r(5550);e.r(33525);let f=e.r(88540),p=e.r(91949),y=e.r(73668),m=e.r(9396);function g(t){var r,s;let i,a,g,[v,x]=(0,o.useOptimistic)(p.IDLE_LINK_STATUS),C=(0,o.useRef)(null),{href:S,as:w,children:O,prefetch:R=null,passHref:Q,replace:P,shallow:j,scroll:M,onClick:T,onMouseEnter:E,onTouchStart:q,legacyBehavior:k=!1,onNavigate:F,transitionTypes:A,ref:I,unstable_dynamicOnHover:D,...N}=t;i=O,k&&("string"==typeof i||"number"==typeof i)&&(i=(0,n.jsx)("a",{children:i}));let _=o.default.useContext(l.AppRouterContext),U=!1!==R,L=!1!==R?null===(s=R)||"auto"===s?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,K="string"==typeof(r=w||S)?r:(0,u.formatUrl)(r);if(k){if(i?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=o.default.Children.only(i)}let B=k?a&&"object"==typeof a&&a.ref:I,$=o.default.useCallback(e=>(null!==_&&(C.current=(0,p.mountLinkInstance)(e,K,_,L,U,x)),()=>{C.current&&((0,p.unmountLinkForCurrentNavigation)(C.current),C.current=null),(0,p.unmountPrefetchableInstance)(e)}),[U,K,_,L,x]),H={ref:(0,c.useMergedRef)($,B),onClick(t){k||"function"!=typeof T||T(t),k&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!_||t.defaultPrevented||function(t,r,s,i,a,n,u){if("u">typeof window){let l,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((l=t.currentTarget.getAttribute("target"))&&"_self"!==l||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,y.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),n){let e=!1;if(n({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:h}=e.r(99781);o.default.startTransition(()=>{h(r,i?"replace":"push",!1===a?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,s.current,u)})}}(t,K,C,P,M,F,A)},onMouseEnter(e){k||"function"!=typeof E||E(e),k&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),_&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){k||"function"!=typeof q||q(e),k&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),_&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,h.isAbsoluteUrl)(K)?H.href=K:k&&!Q&&("a"!==a.type||"href"in a.props)||(H.href=(0,d.addBasePath)(K)),g=k?o.default.cloneElement(a,H):(0,n.jsx)("a",{...N,...H,children:i}),(0,n.jsx)(b.Provider,{value:v,children:g})}e.r(84508);let b=(0,o.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,o.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},49506,e=>{"use strict";var t=e.i(43476),r=e.i(75157);e.s(["AppLogo",0,function({className:e,iconClassName:s,...i}){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:(0,r.cn)("h-5 w-5",e),...i,children:[(0,t.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,t.jsx)("path",{className:s,d:"M5 20a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),(0,t.jsx)("path",{className:s,d:"M15 20a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),(0,t.jsx)("path",{className:s,d:"M5 20h-2v-6l2 -5h9l4 5h1a2 2 0 0 1 2 2v4h-2m-4 0h-6m-6 -6h15m-6 0v-5"}),(0,t.jsx)("path",{className:s,d:"M3 6l9 -4l9 4"})]})}])},10400,e=>{"use strict";e.i(47167);var t=e.i(43476),r=e.i(66027),s=e.i(18566),i=e.i(71645),a=e.i(49506),n=e.i(5125),o=e.i(22858),u=e.i(75254);let l=(0,u.default)("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),c=(0,u.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var h=e.i(22016),d=e.i(75157);let f=[{href:"/",icon:l,label:"Home"},{href:"/fuel/new",icon:o.Fuel,label:"Tanken"},{href:"/vehicles",icon:n.Car,label:"Autos"},{href:"/settings",icon:c,label:"Einstellungen"}];function p(){let e=(0,s.usePathname)();return(0,t.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 z-40 grid h-16 grid-cols-4 border-t border-border bg-surface/95 px-2 backdrop-blur lg:hidden",children:f.map(r=>{let s=r.icon,i=e===r.href;return(0,t.jsxs)(h.default,{href:r.href,className:(0,d.cn)("flex flex-col items-center justify-center gap-1 text-[11px] text-slate-400",i&&"text-primary"),children:[(0,t.jsx)(s,{size:20}),r.label]},`${r.href}-${r.label}`)})})}let y=(0,u.default)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);var m=e.i(12598),g=e.i(59544),b=e.i(61238),v=e.i(92028);function x({className:e,showLabel:r=!0}){let i=(0,s.useRouter)(),a=(0,m.useQueryClient)(),n=(0,v.useAuthStore)(e=>e.logout),o=async()=>{try{await b.api.post("/api/auth/logout")}catch{}n(),a.clear(),i.replace("/login")};return(0,t.jsxs)(g.Button,{variant:"ghost",onClick:o,"aria-label":"Abmelden",title:"Abmelden",className:(0,d.cn)("h-9 rounded-lg border-transparent bg-transparent px-2 text-slate-400 shadow-none hover:border-border hover:bg-surface hover:text-slate-100",e),children:[(0,t.jsx)(y,{size:17}),r?(0,t.jsx)("span",{children:"Abmelden"}):null]})}function C(){return(0,t.jsxs)("header",{className:"sticky top-0 z-30 flex min-h-12 items-center justify-between border-b border-border bg-background/90 px-3 py-1.5 backdrop-blur sm:px-4 lg:hidden",children:[(0,t.jsxs)(h.default,{href:"/",className:"flex min-w-0 items-center gap-2 text-base font-bold text-white",children:[(0,t.jsx)("span",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-xl bg-primary",children:(0,t.jsx)(a.AppLogo,{className:"h-5 w-5"})}),(0,t.jsx)("span",{children:"Karrage"})]}),(0,t.jsx)(x,{showLabel:!1,className:"sm:px-3"})]})}async function S(){let{data:e}=await b.api.get("/api/users/me");return e}let w=[{href:"/",label:"Dashboard",icon:l},{href:"/fuel/new",label:"Tanken",icon:o.Fuel},{href:"/vehicles",label:"Fahrzeuge",icon:n.Car},{href:"/settings",label:"Einstellungen",icon:c}];function O(){let e=(0,s.usePathname)(),i=(0,r.useQuery)({queryKey:["current-user"],queryFn:S,retry:!1});return(0,t.jsxs)("aside",{className:"fixed inset-y-0 left-0 hidden w-60 border-r border-border bg-surface/95 p-5 lg:block",children:[(0,t.jsxs)(h.default,{href:"/",className:"flex items-center gap-3 text-xl font-bold text-white",children:[(0,t.jsx)("span",{className:"grid h-10 w-10 place-items-center rounded-2xl bg-primary",children:(0,t.jsx)(a.AppLogo,{className:"h-6 w-6"})}),"Karrage"]}),(0,t.jsx)("nav",{className:"mt-8 space-y-2",children:w.map(r=>{let s=r.icon,i=e===r.href;return(0,t.jsxs)(h.default,{href:r.href,className:(0,d.cn)("flex items-center gap-3 rounded-xl px-3 py-3 text-sm font-medium text-slate-300 transition hover:bg-hover",i&&"bg-elevated text-white"),children:[(0,t.jsx)(s,{size:18}),r.label]},r.href)})}),(0,t.jsxs)("div",{className:"absolute bottom-5 left-5 right-5 rounded-xl border border-border bg-elevated p-4",children:[(0,t.jsx)("p",{className:"text-xs font-medium uppercase text-slate-500",children:"Angemeldet"}),(0,t.jsx)("p",{className:"mt-1 truncate text-sm font-semibold text-slate-100",title:i.data?.email,children:i.data?.email??"Karrage Nutzer"}),(0,t.jsx)("p",{className:"mt-3 text-xs leading-5 text-slate-400",children:"Alles im Blick. Bereit für die nächste Fahrt."}),(0,t.jsx)(x,{className:"mt-4 w-full justify-start px-0 text-slate-400 hover:bg-transparent hover:text-slate-100"})]})]})}let R=new Set(["/login"]);function Q({title:e,subtitle:r}){return(0,t.jsx)("main",{className:"grid min-h-screen place-items-center px-4",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"mx-auto mb-4 grid h-12 w-12 place-items-center rounded-2xl bg-primary text-white",children:(0,t.jsx)(a.AppLogo,{className:"h-7 w-7"})}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-white",children:e}),(0,t.jsx)("p",{className:"mt-2 text-sm text-slate-400",children:r})]})})}e.s(["AppShell",0,function({children:e}){let a=(0,s.usePathname)(),n=(0,s.useRouter)(),o=(0,s.useSearchParams)(),u=(0,v.useAuthStore)(e=>e.authenticated),l=(0,v.useAuthStore)(e=>e.setAuthenticated),c=R.has(a),h=(0,r.useQuery)({queryKey:["current-user"],queryFn:S,retry:!1});return((0,i.useEffect)(()=>{window.localStorage.removeItem("karrage-auth")},[]),(0,i.useEffect)(()=>{h.isSuccess?l(!0):h.isError&&l(!1)},[h.isError,h.isSuccess,l]),(0,i.useEffect)(()=>{if(null!==u){if(!u&&!c){let e=`${a}${o.toString()?`?${o.toString()}`:""}`;n.replace(`/login?next=${encodeURIComponent(e)}`);return}u&&"/login"===a&&n.replace(o.get("next")||"/")}},[u,c,a,n,o]),null===u||h.isLoading)?(0,t.jsx)(Q,{title:"Karrage",subtitle:"Session wird geladen..."}):u||c?c?(0,t.jsx)("main",{className:"min-h-screen px-4 py-6",children:e}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(O,{}),(0,t.jsxs)("div",{className:"min-h-screen pb-20 lg:ml-60 lg:pb-0",children:[(0,t.jsx)(C,{}),(0,t.jsx)("main",{className:"mx-auto w-full max-w-7xl px-3 py-4 sm:px-4 sm:py-6 lg:px-8",children:e})]}),(0,t.jsx)("div",{className:"fixed bottom-[4.25rem] left-3 z-30 rounded-md border border-border/60 bg-background/70 px-2 py-1 text-[11px] font-medium text-slate-500 backdrop-blur lg:bottom-3 lg:left-3",children:"0.4.4"}),(0,t.jsx)(p,{})]}):(0,t.jsx)(Q,{title:"Karrage",subtitle:"Weiterleitung zum Login..."})}],10400)},39948,e=>{"use strict";var t=e.i(43476),r=e.i(19273),s=e.i(86491),i=e.i(40143),a=e.i(15823),n=class extends a.Subscribable{constructor(e={}){super(),this.config=e,this.#A=new Map}#A;build(e,t,i){let a=t.queryKey,n=t.queryHash??(0,r.hashQueryKeyByOptions)(a,t),o=this.get(n);return o||(o=new s.Query({client:e,queryKey:a,queryHash:n,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(a)}),this.add(o)),o}add(e){this.#A.has(e.queryHash)||(this.#A.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#A.get(e.queryHash);t&&(e.destroy(),t===e&&this.#A.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){i.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#A.get(e)}getAll(){return[...this.#A.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,r.matchQuery)(e,t)):t}notify(e){i.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){i.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){i.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},o=e.i(14272),u=a,l=class extends u.Subscribable{constructor(e={}){super(),this.config=e,this.#I=new Set,this.#D=new Map,this.#N=0}#I;#D;#N;build(e,t,r){let s=new o.Mutation({client:e,mutationCache:this,mutationId:++this.#N,options:e.defaultMutationOptions(t),state:r});return this.add(s),s}add(e){this.#I.add(e);let t=c(e);if("string"==typeof t){let r=this.#D.get(t);r?r.push(e):this.#D.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#I.delete(e)){let t=c(e);if("string"==typeof t){let r=this.#D.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#D.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=c(e);if("string"!=typeof t)return!0;{let r=this.#D.get(t),s=r?.find(e=>"pending"===e.state.status);return!s||s===e}}runNext(e){let t=c(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#D.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){i.notifyManager.batch(()=>{this.#I.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#I.clear(),this.#D.clear()})}getAll(){return Array.from(this.#I)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,r.matchMutation)(e,t))}notify(e){i.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return i.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(r.noop))))}};function c(e){return e.options.scope?.id}var h=e.i(75555),d=e.i(14448),f=class{#_;#r;#l;#U;#L;#K;#B;#$;constructor(e={}){this.#_=e.queryCache||new n,this.#r=e.mutationCache||new l,this.#l=e.defaultOptions||{},this.#U=new Map,this.#L=new Map,this.#K=0}mount(){this.#K++,1===this.#K&&(this.#B=h.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#_.onFocus())}),this.#$=d.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#_.onOnline())}))}unmount(){this.#K--,0===this.#K&&(this.#B?.(),this.#B=void 0,this.#$?.(),this.#$=void 0)}isFetching(e){return this.#_.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#_.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#_.build(this,t),i=s.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,r.resolveStaleTime)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#_.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let i=this.defaultQueryOptions({queryKey:e}),a=this.#_.get(i.queryHash),n=a?.state.data,o=(0,r.functionalUpdate)(t,n);if(void 0!==o)return this.#_.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(e,t,r){return i.notifyManager.batch(()=>this.#_.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#_.get(t.queryHash)?.state}removeQueries(e){let t=this.#_;i.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#_;return i.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(i.notifyManager.batch(()=>this.#_.findAll(e).map(e=>e.cancel(s)))).then(r.noop).catch(r.noop)}invalidateQueries(e,t={}){return i.notifyManager.batch(()=>(this.#_.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(i.notifyManager.batch(()=>this.#_.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(r.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(r.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#_.build(this,t);return s.isStaleByTime((0,r.resolveStaleTime)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(r.noop).catch(r.noop)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(r.noop).catch(r.noop)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return d.onlineManager.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#_}getMutationCache(){return this.#r}getDefaultOptions(){return this.#l}setDefaultOptions(e){this.#l=e}setQueryDefaults(e,t){this.#U.set((0,r.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#U.values()],s={};return t.forEach(t=>{(0,r.partialMatchKey)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#L.set((0,r.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#L.values()],s={};return t.forEach(t=>{(0,r.partialMatchKey)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#l.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,r.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===r.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#l.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#_.clear(),this.#r.clear()}},p=e.i(12598),y=e.i(71645);e.s(["Providers",0,function({children:e}){let[r]=(0,y.useState)(()=>new f({defaultOptions:{queries:{staleTime:3e4,retry:1}}}));return(0,t.jsx)(p.QueryClientProvider,{client:r,children:e})}],39948)}]);