1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="315f4935-db7e-2400-b34e-e2ce181d73ab")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,175555,915823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",0,t],915823);var s=new class extends t{#e;#t;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",0,s],175555)},619273,180166,e=>{"use strict";e.i(247167);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},s=new class{#r=t;#i=!1;setTimeoutProvider(e){this.#r=e}setTimeout(e,t){return this.#r.setTimeout(e,t)}clearTimeout(e){this.#r.clearTimeout(e)}setInterval(e,t){return this.#r.setInterval(e,t)}clearInterval(e){this.#r.clearInterval(e)}};e.s(["systemSetTimeoutZero",0,function(e){setTimeout(e,0)},"timeoutManager",0,s],180166);var r="u"<typeof window||"Deno"in globalThis;function i(e,t){return(t?.queryKeyHashFn||o)(e)}function o(e){return JSON.stringify(e,(e,t)=>c(t)?Object.keys(t).sort().reduce((e,s)=>(e[s]=t[s],e),{}):t)}function n(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>n(e[s],t[s]))}var a=Object.prototype.hasOwnProperty;function u(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function c(e){if(!l(e))return!1;let t=e.constructor;if(void 0===t)return!0;let s=t.prototype;return!!l(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function l(e){return"[object Object]"===Object.prototype.toString.call(e)}var h=Symbol();e.s(["addConsumeAwareSignal",0,function(e,t,s){let r,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),i||(i=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e},"addToEnd",0,function(e,t,s=0){let r=[...e,t];return s&&r.length>s?r.slice(1):r},"addToStart",0,function(e,t,s=0){let r=[t,...e];return s&&r.length>s?r.slice(0,-1):r},"ensureQueryFn",0,function(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==h?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))},"functionalUpdate",0,function(e,t){return"function"==typeof e?e(t):e},"hashKey",0,o,"hashQueryKeyByOptions",0,i,"isServer",0,r,"isValidTimeout",0,function(e){return"number"==typeof e&&e>=0&&e!==1/0},"matchMutation",0,function(e,t){let{exact:s,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(o(t.options.mutationKey)!==o(a))return!1}else if(!n(t.options.mutationKey,a))return!1}return(!r||t.state.status===r)&&(!i||!!i(t))},"matchQuery",0,function(e,t){let{type:s="all",exact:r,fetchStatus:o,predicate:a,queryKey:u,stale:c}=e;if(u){if(r){if(t.queryHash!==i(u,t.options))return!1}else if(!n(t.queryKey,u))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof c||t.isStale()===c)&&(!o||o===t.state.fetchStatus)&&(!a||!!a(t))},"noop",0,function(){},"partialMatchKey",0,n,"replaceData",0,function(e,t,s){return"function"==typeof s.structuralSharing?s.structuralSharing(e,t):!1!==s.structuralSharing?function e(t,s,r=0){if(t===s)return t;if(r>500)return s;let i=u(t)&&u(s);
2if(!i&&!(c(t)&&c(s)))return s;let o=(i?t:Object.keys(t)).length,n=i?s:Object.keys(s),l=n.length,h=i?Array(l):{},d=0;for(let u=0;u<l;u++){let c=i?u:n[u],l=t[c],f=s[c];if(l===f){h[c]=l,(i?u<o:a.call(t,c))&&d++;continue}if(null===l||null===f||"object"!=typeof l||"object"!=typeof f){h[c]=f;continue}let p=e(l,f,r+1);h[c]=p,p===l&&d++}return o===l&&d===o?t:h}(e,t):t},"resolveQueryBoolean",0,function(e,t){return"function"==typeof e?e(t):e},"resolveStaleTime",0,function(e,t){return"function"==typeof e?e(t):e},"shallowEqualObjects",0,function(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let s in e)if(e[s]!==t[s])return!1;return!0},"shouldThrowError",0,function(e,t){return"function"==typeof e?e(...t):!!e},"skipToken",0,h,"sleep",0,function(e){return new Promise(t=>{s.setTimeout(t,e)})},"timeUntilStale",0,function(e,t){return Math.max(e+(t||0)-Date.now(),0)}],619273)},273911,e=>{"use strict";let t;var s=e.i(619273),r=(t=()=>s.isServer,{isServer:()=>t(),setIsServer(e){t=e}});e.s(["environmentManager",0,r])},540143,e=>{"use strict";let t,s,r,i,o,n;var a=e.i(180166).systemSetTimeoutZero,u=(t=[],s=0,r=e=>{e()},i=e=>{e()},o=a,{batch:e=>{let n;s++;try{n=e()}finally{let e;--s||(e=t,t=[],e.length&&o(()=>{i(()=>{e.forEach(e=>{r(e)})})}))}return n},batchCalls:e=>(...t)=>{n(()=>{e(...t)})},schedule:n=e=>{s?t.push(e):o(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{o=e}});e.s(["notifyManager",0,u])},814448,793803,e=>{"use strict";var t=e.i(915823),s=new class extends t.Subscribable{#o=!0;#t;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};e.s(["onlineManager",0,s],814448),e.i(619273),e.s(["pendingThenable",0,function(){let e,t,s=new Promise((s,r)=>{e=s,t=r});function r(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},s.reject=e=>{r({status:"rejected",reason:e}),t(e)},s}],793803)},286491,936553,88587,992571,e=>{"use strict";e.i(247167);var t=e.i(619273),s=e.i(540143),r=e.i(175555),i=e.i(814448),o=e.i(793803),n=e.i(273911);function a(e){return Math.min(1e3*2**e,3e4)}function u(e){return(e??"online")!=="online"||i.onlineManager.isOnline()}var c=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function l(e){let s,l=!1,h=0,d=(0,o.pendingThenable)(),f=()=>r.focusManager.isFocused()&&("always"===e.networkMode||i.onlineManager.isOnline())&&e.canRun(),p=()=>u(e.networkMode)&&e.canRun(),y=e=>{"pending"===d.status&&(s?.(),d.resolve(e))},m=e=>{"pending"===d.status&&(s?.(),d.reject(e))},g=()=>new Promise(t=>{s=e=>{("pending"!==d.status||f())&&t(e)},e.onPause?.()}).then(()=>{s=void 0,"pending"===d.status&&e.onContinue?.()}),b=()=>{let s;if("pending"!==d.status)return;let r=0===h?e.initialPromise:void 0;try{s=r??e.fn()}catch(e){s=Promise.reject(e)}Promise.resolve(s).then(y).catch(s=>{if("pending"!==d.status)return;let r=e.retry??3*!n.environmentManager.isServer(),i=e.retryDelay??a,o="function"==typeof i?i(h,s):i,u=!0===r||"number"==typeof r&&h<r||"function"==typeof r&&r(h,s);l||!u?m(s):(h++,e.onFail?.(h,s),(0,t.sleep)(o).then(()=>f()?void 0:g()).then(()=>{l?m(s):b()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let s=new c(t);m(s),e.onCancel?.(s)}},continue:()=>(s?.(),d),cancelRetry:()=>{l=!0},continueRetry:()=>{l=!1},canStart:p,start:()=>(p()?b():g().then(b),d)}}e.s(["CancelledError",0,c,"canFetch",0,u,"createRetryer",0,l],936553);var h=e.i(180166),d=class{#n;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#n=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.environmentManager.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#n&&(h.timeoutManager.clearTimeout(this.#n),this.#n=void 0)}};function f(e){return{onFetch:(s,r)=>
2{let i=s.options,o=s.fetchOptions?.meta?.fetchMore?.direction,n=s.state.data?.pages||[],a=s.state.data?.pageParams||[],u={pages:[],pageParams:[]},c=0,l=async()=>{let r=!1,l=(0,t.ensureQueryFn)(s.options,s.fetchOptions),h=async(e,i,o)=>{let n;if(r)return Promise.reject(s.signal.reason);if(null==i&&e.pages.length)return Promise.resolve(e);let a=(n={client:s.client,queryKey:s.queryKey,pageParam:i,direction:o?"backward":"forward",meta:s.options.meta},(0,t.addConsumeAwareSignal)(n,()=>s.signal,()=>r=!0),n),u=await l(a),{maxPages:c}=s.options,h=o?t.addToStart:t.addToEnd;return{pages:h(e.pages,u,c),pageParams:h(e.pageParams,i,c)}};if(o&&n.length){let e="backward"===o,t={pages:n,pageParams:a},s=(e?y:p)(i,t);u=await h(t,s,e)}else{let t=e??n.length;do{let e=0===c?a[0]??i.initialPageParam:p(i,u);if(c>0&&null==e)break;u=await h(u,e),c++}while(c<t)}return u};s.options.persister?s.fetchFn=()=>s.options.persister?.(l,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},r):s.fetchFn=l}}}function p(e,{pages:t,pageParams:s}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function y(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}e.s(["Removable",0,d],88587),e.s(["hasNextPage",0,function(e,t){return!!t&&null!=p(e,t)},"hasPreviousPage",0,function(e,t){return!!t&&!!e.getPreviousPageParam&&null!=y(e,t)},"infiniteQueryBehavior",0,f],992571);var m=class extends d{#a;#u;#c;#l;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#l=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#u=v(this.options),this.state=e.state??this.#u,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#a}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#a=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=v(this.options);void 0!==e.data&&(this.setState(b(e.data,e.dataUpdatedAt)),this.#u=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,s){let r=(0,t.replaceData)(this.state.data,e,this.options);return this.#y({data:r,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),r}setState(e){this.#y({type:"setState",state:e})}cancel(e){let s=this.#d?.promise;return this.#d?.cancel(e),s?s.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#u}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.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.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.#d&&(this.#p||this.#m()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#m(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#y({type:"invalidate"})}async fetch(e,s){let r;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let i=new AbortController,o=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,i.signal)}
2)},n=()=>{let e,r=(0,t.ensureQueryFn)(this.options,s),i=(o(e={client:this.#h,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(r,i,this):r(i)},a=(o(r={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:n}),r),u="infinite"===this.#a?f(this.options.pages):this.options.behavior;u?.onFetch(a,this),this.#c=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#y({type:"fetch",meta:a.fetchOptions?.meta}),this.#d=l({initialPromise:s?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof c&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),i.abort()},onFail:(e,t)=>{this.#y({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#y({type:"pause"})},onContinue:()=>{this.#y({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof c){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#y({type:"error",error:e}),this.#l.config.onError?.(e,this),this.#l.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#y(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,...g(t.data,this.options),fetchMeta:e.meta??null};case"success":let s={...t,...b(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?s:void 0,s;case"error":let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),s.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function g(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:u(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function b(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function v(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,r=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}e.s(["Query",0,m,"fetchState",0,g],286491)},618566,(e,t,s)=>{t.exports=e.r(976562)},42086,651501,e=>{"use strict";class t extends Error{name="KyError";get isKyError(){return!0}}class s extends t{name="HTTPError";response;request;options;data;constructor(e,t,s){const r=e.status||0===e.status?e.status:"",i=e.statusText??"",o=`${r} ${i}`.trim(),n=o?`status code ${o}`:"an unknown error";super(`Request failed with ${n}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=s}}e.s(["HTTPError",0,s],651501);class r extends t{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}}class i extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}}class o extends t{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new i(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}
2class n extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}}class a extends t{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}}let u=(()=>{let e=!1,t=!1,s="function"==typeof globalThis.Request;if("function"==typeof globalThis.ReadableStream&&s)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(e){if(e instanceof Error&&"unsupported BodyInit type"===e.message)return!1;throw e}return e&&!t})(),c="function"==typeof globalThis.AbortController,l="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,h="function"==typeof globalThis.ReadableStream,d="function"==typeof globalThis.FormData,f=["get","post","put","patch","head","delete"],p={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},y=Symbol("stop");class m{options;constructor(e){this.options=e}}let g=e=>new m(e),b={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},v={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},w=new TextEncoder,S=(e,t,s)=>{let r,i=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),r){i+=r.byteLength;let e=0===t?0:i/t;e>=1&&(e=1-Number.EPSILON),s?.({percent:e,totalBytes:Math.max(t,i),transferredBytes:i},r)}r=e},flush(){r&&(i+=r.byteLength,s?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},r))}}))},T=e=>null!==e&&"object"==typeof e,R=Symbol("replaceOption"),C=e=>T(e)&&!0===e[R]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},O=(...e)=>{for(let t of e)if((!T(t)||Array.isArray(t))&&void 0!==t)throw TypeError("The `options` argument must be an object");return D({},...e)},q=(e={},t={})=>{let s=new globalThis.Headers(e),r=t instanceof globalThis.Headers;for(let[e,i]of new globalThis.Headers(t).entries())r&&"undefined"===i||void 0===i?s.delete(e):s.set(e,i);return s},E=e=>{if(!T(e)||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},P=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),s=e[x];return s&&(t[x]=new Set(s)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:E(e)?{...e}:e},A=(e,t)=>E(e)&&E(t)?Object.fromEntries(Object.entries({...e,...t}).filter(e=>void 0!==e[1])):q(e,t);function j(e,t,s){return Object.hasOwn(t,s)&&void 0===t[s]?[]:D(e[s]??[],t[s]??[])}let k=(e={},t={})=>({init:j(e,t,"init"),beforeRequest:j(e,t,"beforeRequest"),beforeRetry:j(e,t,"beforeRetry"),beforeError:j(e,t,"beforeError"),afterResponse:j(e,t,"afterResponse")}),x=Symbol("deletedParameters"),M=(e,t)=>{let s=new URLSearchParams,r=new Set;for(let i of[e,t])if(void 0!==i)if(i instanceof URLSearchParams){for(let[e,t]of i.entries())s.append(e,t),r.delete(e);let e=i[x];if(e)for(let t of e)s.delete(t),r.add(t)}else if(Array.isArray(i))for(let e of i){if(!Array.isArray(e)||2!==e.length)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(e[0]),String(e[1])),r.delete(String(e[0]))}else if(T(i))for(let[e,t]of Object.entries(i))void 0===t?(s.delete(e),r.add(e)):(s.append(e,String(t)),r.delete(e));else for(let[e,t]of new URLSearchParams(i).entries())s.append(e,t),r.delete(e);return r.size>0&&(s[x]=r),s},D=(...e)=>{let t,s={},r={},i={},o=[];for(let n of e)if(Array.isArray(n))Array.isArray(s)||(s=[]),s=[...s,...n];else if(T(n)){for(let[e,r]of Object.entries(n)){if("signal"===e&&r instanceof globalThis.AbortSignal){o.push(r);continue}let i=C(r),{isReplace:n}=i;if(r=i.value,"context"===e){if(null!=r&&(!T(r)||Array.isArray(r)))throw TypeError("The `context` option must be an object");s={...s,context:null==r?{}:n?{...r}:{...s.context,...r}};continue}
2if("searchParams"===e){t=null==r?void 0:n||void 0===t?r:M(t,r);continue}T(r)&&!n&&e in s&&(r=D(s[e],r)),s={...s,[e]:r}}if(T(n.hooks)){let{value:e,isReplace:t}=C(n.hooks);i=t?k({},e):k(i,e),s.hooks=i}if(T(n.headers)){let{value:e,isReplace:t}=C(n.headers);r=t?P(e):A(r,e),s.headers=r}}return void 0!==t&&(s.searchParams=t),o.length>0&&(1===o.length?s.signal=o[0]:l?s.signal=AbortSignal.any(o):s.signal=o.at(-1)),s},F={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1};async function I(e,t,s,r){return new Promise((i,o)=>{let n=setTimeout(()=>{s&&s.abort(),o(new a(e))},r.timeout);r.fetch(e,t).then(i).catch(o).then(()=>{clearTimeout(n)})})}async function U(e,{signal:t}){return new Promise((s,r)=>{function i(){clearTimeout(o),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));let o=setTimeout(()=>{t?.removeEventListener("abort",i),s()},e)})}let L=Object.prototype.toString,N=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]),_=(e,t)=>e instanceof t||e?.name===t.name,Q=Symbol("timedOutResponseData"),B="The `schema` argument must follow the Standard Schema specification",H=Object.prototype.toString,K=e=>e instanceof globalThis.Request||"[object Request]"===H.call(e),J=e=>e instanceof globalThis.Response||"[object Response]"===H.call(e),z=async(e,t)=>{if("object"!=typeof t&&"function"!=typeof t||null===t)throw TypeError(B);let s=t["~standard"];if("object"!=typeof s||null===s||"function"!=typeof s.validate)throw TypeError(B);let r=await s.validate(e);if(r.issues)throw new n(r.issues);return r.value};class ${static create(e,t){var r,i;let n,a=t.hooks?.init??[],u=a.length>0?(n={...t,json:P(t.json),context:P(t.context),headers:P(t.headers),searchParams:Array.isArray(r=t.searchParams)?r.map(e=>[...e]):P(r)},void 0!==t.retry&&(n.retry="object"!=typeof(i=t.retry)?i:{...i,...i.methods&&{methods:[...i.methods]},...i.statusCodes&&{statusCodes:[...i.statusCodes]},...i.afterStatusCodes&&{afterStatusCodes:[...i.afterStatusCodes]}}),n):t;for(let e of a)e(u);let c=new $(e,u),l=async()=>{if("number"==typeof c.#g.timeout&&c.#g.timeout>0x7fffffff)throw RangeError("The `timeout` option cannot be greater than 2147483647");if("number"==typeof c.#g.totalTimeout&&c.#g.totalTimeout>0x7fffffff)throw RangeError("The `totalTimeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await c.#b(),t=e??await c.#v(async()=>c.#w()),r=void 0!==e||c.#S();for(;;){if(void 0===t)return t;if(J(t))try{t=await c.#T(t)}catch(s){if(!(s instanceof o))throw s;let e=await c.#R(s,async()=>c.#w());if(void 0===e)return e;t=e,r=c.#S();continue}let e=t;if(!e.ok&&"opaque"!==e.type&&("function"==typeof c.#g.throwHttpErrors?c.#g.throwHttpErrors(e.status):c.#g.throwHttpErrors)){let i=new s(e,c.#C(e),c.#O());if(i.data=await c.#q(e),r)throw i;let o=await c.#R(i,async()=>c.#w());if(void 0===o)return o;t=o,r=c.#S();continue}break}if(!J(t))return t;if(c.#E(t),c.#g.onDownloadProgress){if("function"!=typeof c.#g.onDownloadProgress)throw TypeError("The `onDownloadProgress` option must be a function");if(!h)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=t.clone();c.#P(t);var i=c.#g.onDownloadProgress;if(!e.body)return e;let s={status:e.status,statusText:e.statusText,headers:e.headers};if(204===e.status)return new Response(null,s);let r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(S(e.body,r,i),s)}return t},d=(async()=>{try{return await l()}catch(t){if(!(t instanceof Error)||c.#A.has(t))throw t;let e=t;for(let t of c.#g.hooks.beforeError){let s=await t({request:c.request,options:c.#O(),error:e,retryCount:c.#j});s instanceof Error&&(e=s)}throw e}finally{let e=c.#k;c.#x(e?.body??void 0),c.request!==e&&c.#x(c.request.body??void 0)}})();for(let[e,t]of Object.entries(p))("bytes"!==e||"function"==typeof globalThis.Response?.prototype?.bytes)&&(d[e]=async s=>{c.request.headers.set("accept",c.request.headers.get("accept")||t);let r=await d;if("json"!==e)return r[e]();let i=await r.text();if(""===i)return void 0!==s?z(void 0,s):JSON.parse(i);let o=u.parseJson?await u.parseJson(i,{request:c.#C(r),response:r}):JSON.parse(i);return void 0===s?o:z(o,s)});return d}static #M(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#D;#j=0;#F;#g;#k;#I;#A=new WeakSet;#U;#L;#N=!1;#_=new WeakMap;constructor(e,t={}){if(this.#F=e,Object.hasOwn(t,"prefixUrl"))throw Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");
2if(this.#g={...t,headers:q(this.#F.headers,t.headers),hooks:k({},t.hooks),method:(e=>f.includes(e)?e.toUpperCase():e)(t.method??this.#F.method??"GET"),prefix:String(t.prefix||""),retry:((e={})=>{if("number"==typeof e)return{...F,limit:e};if(e.methods&&!Array.isArray(e.methods))throw Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw Error("retry.statusCodes must be an array");let t=Object.fromEntries(Object.entries({...e,methods:e.methods?.map(e=>e.toLowerCase())}).filter(([,e])=>void 0!==e));return{...F,...t}})(t.retry),throwHttpErrors:t.throwHttpErrors??!0,timeout:t.timeout??1e4,totalTimeout:t.totalTimeout??!1,fetch:t.fetch??globalThis.fetch.bind(globalThis),context:t.context??{}},"string"!=typeof this.#F&&!(this.#F instanceof URL||this.#F instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if("string"==typeof this.#F){if(this.#g.prefix){const e=this.#g.prefix.replace(/\/+$/,""),t=this.#F.replace(/^\/+/,"");this.#F=`${e}/${t}`}if(this.#g.baseUrl){let e;try{e=new URL(this.#F)}catch{}e||(this.#F=new URL(this.#F,new Request(this.#g.baseUrl).url))}}c&&l&&(this.#I=this.#g.signal??this.#F.signal,this.#D=new globalThis.AbortController,this.#g.signal=this.#Q()),u&&(this.#g.duplex="half"),void 0!==this.#g.json&&(this.#g.body=this.#g.stringifyJson?.(this.#g.json)??JSON.stringify(this.#g.json),this.#g.headers.set("content-type",this.#g.headers.get("content-type")??"application/json"));const s=t.headers&&new globalThis.Headers(t.headers).has("content-type");if(this.#F instanceof globalThis.Request&&(d&&this.#g.body instanceof globalThis.FormData||this.#g.body instanceof URLSearchParams)&&!s&&this.#g.headers.delete("content-type"),this.request=new globalThis.Request(this.#F,this.#g),(e=>void 0!==e&&(Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[x]?.size:"object"==typeof e?Object.keys(e).length>0:"string"==typeof e?e.trim().length>0:!!e))(this.#g.searchParams)){const e=new URL(this.request.url),t=this.#g.searchParams?.[x];if(t)for(const s of t)e.searchParams.delete(s);if("string"==typeof this.#g.searchParams){const t=this.#g.searchParams.replace(/^\?/,"");""!==t&&(e.search=e.search?`${e.search}&${t}`:`?${t}`)}else for(const[t,s]of new URLSearchParams($.#M(this.#g.searchParams)).entr
2ies())e.searchParams.append(t,s);if(this.#g.searchParams&&"object"==typeof this.#g.searchParams&&!Array.isArray(this.#g.searchParams)&&!(this.#g.searchParams instanceof URLSearchParams))for(const[t,s]of Object.entries(this.#g.searchParams))void 0===s&&e.searchParams.delete(t);this.request=new globalThis.Request(e,this.#g)}if(this.#g.onUploadProgress&&"function"!=typeof this.#g.onUploadProgress)throw TypeError("The `onUploadProgress` option must be a function");this.#L="number"==typeof this.#g.totalTimeout?this.#B():void 0}#H(){let e=this.#g.retry.delay(this.#j+1),t=e;return!0===this.#g.retry.jitter?t=Math.random()*e:"function"==typeof this.#g.retry.jitter&&(!Number.isFinite(t=this.#g.retry.jitter(e))||t<0)&&(t=e),Math.min(this.#g.retry.backoffLimit,t)}async #K(e){if(this.#j>=this.#g.retry.limit)throw e;let t=e instanceof Error?e:new i(e);if(t instanceof o)return t.customDelay??this.#H();if(!this.#g.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#g.retry.shouldRetry){let s=await this.#g.retry.shouldRetry({error:t,retryCount:this.#j+1});if(!1===s)throw e;if(!0===s)return this.#H()}if(_(e,a)){if(!this.#g.retry.retryOnTimeout)throw e;return this.#H()}if(_(e,s)){if(!this.#g.retry.statusCodes.includes(e.response.status))throw e;let t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#g.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);return(Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now()),Number.isFinite(e))?(e=Math.max(0,e),Math.min(this.#g.retry.maxRetryAfter,e)):Math.min(this.#g.retry.maxRetryAfter,this.#H())}if(413===e.response.status)throw e;return this.#H()}if(!_(e,r))throw e;return this.#H()}#E(e){let t=this.#C(e);return this.#g.parseJson&&(e.json=async()=>{let s=await e.text();return""===s?JSON.parse(s):this.#g.parseJson(s,{request:t,response:e})}),e}async #q(e){let t=await this.#J(e,this.#z());if(t===Q)return void this.#$();if(!t)return;if(!this.#W(e.headers.get("content-type")??""))return t;let s=await this.#G(t,e,this.#z(),this.#C(e));return s===Q?void this.#$():s}#z(){let e=!1===this.#g.timeout?1e4:this.#g.timeout,t=this.#X();if(void 0===t)return e;if(t<=0)throw new a(this.request);return Math.min(e,t)}#W(e){let t=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async #J(e,t){let s,{body:r}=e;if(!r)try{return await e.text()}catch{return}try{s=r.getReader()}catch{return}let i=(e=>{let t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),s=t?.[1]??t?.[2];if(s)try{return new TextDecoder(s)}catch{}return new TextDecoder})(e.headers.get("content-type")??""),o=[],n=0,a=(async()=>{try{for(;;){let{done:e,value:t}=await s.read();if(e)break;if((n+=t.byteLength)>0xa00000)return void s.cancel().catch(()=>void 0);o.push(i.decode(t,{stream:!0}))}}catch{return}return o.push(i.decode()),o.join("")})(),u=new Promise(e=>{let s=setTimeout(()=>{e(Q)},t);a.finally(()=>{clearTimeout(s)})}),c=await Promise.race([a,u]);return c===Q&&s.cancel().catch(()=>void 0),c}async #G(e,t,s,r){let i;try{return await Promise.race([Promise.resolve().then(()=>this.#g.parseJson?this.#g.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{i=setTimeout(()=>{e(Q)},s)})])}catch{return}finally{clearTimeout(i)}}#x(e){e&&e.cancel().catch(()=>void 0)}#P(e){this.#x(e.body??void 0)}#Q(){return this.#I?AbortSignal.any([this.#I,this.#D.signal]):this.#D.signal}#$(){let e=this.#X();if(void 0!==e&&e<=0)throw new a(this.request)}async #b(){for(let e of this.#g.hooks.beforeRequest){let t=await e({request:this.request,options:this.#O(),retryCount:0});if(K(t))this.#V(t);else if(J(t))return t}}async #T(e){let t=this.#C(e);for(let s of this.#g.hooks.afterResponse){let r,i=this.#Y(e.clone(),t);this.#E(i);try{r=await s({request:this.request,options:this.#O(),response:i,retryCount:this.#j})}catch(t){throw i!==e&&this.#P(i),this.#P(e),t}if(r instanceof m)throw i!==e&&this.#P(i),this.#P(e),new o(r.options);let n=J(r)?this.#Y(r,t):e;i!==e&&i!==n&&i.body!==n.body&&this.#P(i),e!==n&&e.body!==n.body&&this.#P(e),e=n}return e}async #v(e){try{return await e()}catch(t){return this.#R(t,e)}}async #R(e,t){this.#N=!1;let s=Math.min(await this.#K(e),0x7fffffff),r={signal:this.#I},i=this.#X();if(void 0!==i){if(i<=0)throw new a(this.request);if(s>=i)throw await U(i,r),new a(this.request)}if(await U(s,r),this.#$(),e instanceof o&&e.customRequest){let t=new globalThis.Request(e.customRequest,this.#g.signal?{signal:this.#g.signal}:void 0);this.#V(t)}for(let t of this.#g.hooks.beforeRetry){let s;try{s=await t({request:this.request,options:this.#O(),error:e,retryCount:this.#j+1})}catch(t){throw t instanceof Error&&t!==e&&this.#A.add(t),t}if(K(s)){this.#V(s);break}if(J(s))return this.#N=!0,this.#j++,s;if(s===y)return}return this.#$(),this.#j++,this.#v(t)}#S(){let e=this.#N;return this.#N=!1,e}async #w(){this.#D?.signal.aborted&&(this.#D=new globalThis.AbortController,this.#g.signal=this.#Q(),this.request=new globalThis.Request(this.request,{signal:this.#g.signal}));let e=(e=>{let t={};for(let s in e)Object.hasOwn(e,s)&&(s in v||s in b||(t[s]=e[s]));return t})(this.#g),t=this.#g.retry.limit>0?this.request.clone():void 0,s=this.#Z(this.request,this.#g.body??void 0);this.#k=s,t&&(this.request=t);try{let t=this.#X();if(void 0!==t&&t<=0)throw new a(this.request);let r=!1===this.#g.timeout?t:void 0===t?this.#g.timeout:Math.min(this.#g.timeout,t),i=void 0===r?await this.#g.fetch(s,e):await I(s,e,this.#D,{timeout:r,fetch:this.#g.fetch});return this.#Y(i,s)}catch(e){if(function(e){if(!(e&&"[object Error]"===L.call(e)&&"TypeError"===e.name&&"string"==typeof e.message))return!1;let{message:t,stack:s}=e;return"Load failed"===t?void 0===s||"__sentry_captured__"in e:!!(t.startsWith("error sending request for url")||"Failed to fetch"===t||t.startsWith("Failed to fetch (")&&t.endsWith(")"))||N.has(t)}(e))throw new r(this.request,{cause:e});throw e}}#X(){if(void 0===this.#L)return;let e=this.#B()-this.#L;return Math.max(0,this.#g.totalTimeout-e)}#B(){return globalThis.performance?.now()??Date.now()}#O(){if(!this.#U){let{hooks:e,json:t,parseJson:s,stringifyJson:r,searchParams:i,timeout:o,totalTimeout:n,throwHttpErrors:a,fetch:u,...c}=this.#g;this.#U=Object.freeze(c)}return this.#U}#V(e){this.#U=void 0,this.request=e}#C(e){return this.#_.get(e)??this.request}#Y(e,t){return this.#_.set(e,t),e}#Z(e,t){return this.#g.onUploadProgress&&e.body&&u?((e,t,s)=>{if(!e.body)return e;let r=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[s,r]of e)t+=40,t+=w.encode(`Content-Disposition: form-data; name="${s}"`).byteLength,t+="string"==typeof r?w.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?w.encode(e).byteLength:e instanceof URLSearchParams?w.encode(e.toString()).byteLength:0})(s??e.body);
2return new Request(e,{duplex:"half",body:S(e.body,r,t)})})(e,this.#g.onUploadProgress,t??this.#g.body??void 0):e}}let W=e=>{let t=(t,s)=>$.create(t,O(e,s));for(let s of f)t[s]=(t,r)=>$.create(t,O(e,r,{method:s}));return t.create=e=>W(O(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),W(O(e,t))),t.stop=y,t.retry=g,t},G=W();e.s(["default",0,G],42086)},768834,579473,e=>{"use strict";var t=e.i(271645);let s=e=>{let t,s=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),s.forEach(s=>s(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>n,subscribe:e=>(s.add(e),()=>s.delete(e))},n=t=e(r,i,o);return o},r=e=>e;function i(e,s=r){let o=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>s(e.getState()),[e,s]),t.default.useCallback(()=>s(e.getInitialState()),[e,s]));return t.default.useDebugValue(o),o}let o=e=>{let t=e?s(e):s,r=e=>i(t,e);return Object.assign(r,t),r};e.s(["create",0,e=>e?o(e):o,"useStore",0,i],768834);let n={get url(){return`file://${e.P("node_modules/zustand/esm/middleware.mjs")}`}},a=e=>!!e.dispatchFromDevtools&&"function"==typeof e.dispatch,u=new Map,c=e=>{let t=u.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},l=/.+ (.+) .+/,h=/^([^@]+)@/,d=(e,t)=>{let s;try{s=JSON.parse(e)}catch(e){console.error("[zustand devtools middleware] Could not parse the received json",e)}void 0!==s&&t(s)};e.s(["combine",0,function(e,t){return(...s)=>Object.assign({},e,t(...s))},"devtools",0,(e,t={})=>(s,r,i)=>{let o,{enabled:f,anonymousActionType:p,store:y,...m}=t;try{o=(null!=f?f:(n.env?n.env.MODE:void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(e){}if(!o)return e(s,r,i);let{connection:g,...b}=((e,t,s)=>{if(void 0===e)return{type:"untracked",connection:t.connect(s)};let r=u.get(s.name);if(r)return{type:"tracked",store:e,...r};let i={connection:t.connect(s),stores:{}};return u.set(s.name,i),{type:"tracked",store:e,...i}})(y,o,m),v=!0;i.setState=(e,t,o)=>{let n=s(e,t);if(!v)return n;let a=void 0===o?{type:p||function(e){var t,s,r;if(!e)return;let i=e.split("\n"),o=i.findIndex(e=>e.includes("api.setState"));if(o<0)return;let n=(null==(t=i[o+1])?void 0:t.trim())||"";return(null==(s=l.exec(n))?void 0:s[1])||(null==(r=h.exec(n))?void 0:r[1])}(Error().stack)||"anonymous"}:"string"==typeof o?{type:o}:o;return void 0===y?null==g||g.send(a,r()):null==g||g.send({...a,type:`${y}/${a.type}`},{...c(m.name),[y]:i.getState()}),n},i.devtools={cleanup:()=>{g&&"function"==typeof g.unsubscribe&&g.unsubscribe(),((e,t)=>{if(void 0===t)return;let s=u.get(e);s&&(delete s.stores[t],0===Object.keys(s.stores).length&&u.delete(e))})(m.name,y)}};let w=(...e)=>{let t=v;v=!1,s(...e),v=t},S=e(i.setState,r,i);if("untracked"===b.type?null==g||g.init(S):(b.stores[b.store]=i,null==g||g.init(Object.fromEntries(Object.entries(b.stores).map(([e,t])=>[e,e===b.store?S:t.getState()])))),a(i)){let e=!1,t=i.dispatch;i.dispatch=(...s)=>{(n.env?n.env.MODE:void 0)==="production"||"__setState"!==s[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...s)}}return g.subscribe(e=>{var t;switch(e.type){case"ACTION":if("string"!=typeof e.payload)return void console.error("[zustand devtools middleware] Unsupported action format");return d(e.payload,e=>{if("__setState"===e.type){if(void 0===y)return void w(e.state);1!==Object.keys(e.state).length&&console.error(` 3 [zustand devtools middleware] Unsupported __setState action format. 4 When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), 5 and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } 6 `);let t=e.state[y];return void(null==t||JSON.stringify(i.getState())!==JSON.stringify(t)&&w(t))}a(i)&&i.dispatch(e)});case"DISPATCH":switch(e.payload.type){case"RESET":if(w(S),void 0===y)return null==g?void 0:g.init(i.getState());return null==g?void 0:g.init(c(m.name));
6case"COMMIT":if(void 0===y){null==g||g.init(i.getState());break}return null==g?void 0:g.init(c(m.name));case"ROLLBACK":return d(e.state,e=>{if(void 0===y){w(e),null==g||g.init(i.getState());return}w(e[y]),null==g||g.init(c(m.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return d(e.state,e=>{void 0===y?w(e):JSON.stringify(i.getState())!==JSON.stringify(e[y])&&w(e[y])});case"IMPORT_STATE":{let{nextLiftedState:s}=e.payload,r=null==(t=s.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;void 0===y?w(r):w(r[y]),null==g||g.send(null,s);break}case"PAUSE_RECORDING":return v=!v}return}}),S}],579473)},894706,264885,e=>{"use strict";var t=e.i(722219);e.s(["default",0,t],894706);let s=t.jwt().brand(),r=t.string().brand(),i=t.string().brand();e.s(["AccessTokenSchema",0,s,"CognitoSubSchema",0,i,"RefreshTokenSchema",0,r],264885)},957486,94160,e=>{"use strict";var t=e.i(894706),s=e.i(264885);let r=t.default.object({email:t.default.email(),password:t.default.string()});t.default.object({accessToken:s.AccessTokenSchema,refreshToken:s.RefreshTokenSchema,cognitoSub:s.CognitoSubSchema}).readonly(),e.s(["LoginRequestSchema",0,r],957486);let i=t.default.object({refreshToken:t.default.string()});e.s(["LogoutRequestSchema",0,i],94160)},771084,58785,546350,e=>{"use strict";var t=e.i(662537);e.i(247167);let s={NEXT_PUBLIC_AUTH_API_BASE:"https://app.mixedmartialarts.com/api/",NEXT_PUBLIC_SENTRY_DSN:"https://e094f0de6b6f9654c8795682acd73776@o4504612450205696.ingest.us.sentry.io/4512047652470784",NEXT_PUBLIC_SENTRY_ENVIRONMENT:"production",NEXT_PUBLIC_COOKIEBOT_ID:"641d50f6-d1ed-4fe9-9163-67c4b9534bf5"};function r(){return!1}async function i(e){try{return[await e,void 0]}catch(e){return[void 0,e]}}e.s(["environment",0,s,"isDevelopment",0,r],58785),e.s(["parseSchema",0,function(e,i){if(r())return e.parse(i);let o=e.safeParse(i);return!o.success&&s.NEXT_PUBLIC_SENTRY_ENVIRONMENT&&t.captureException(o.error),i}],771084),e.s(["tryCatch",0,i],546350)},437453,114272,886239,323435,e=>{"use strict";var t=e.i(619273),s=e.i(286491),r=e.i(540143),i=e.i(915823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#ee=new Map}#ee;build(e,r,i){let o=r.queryKey,n=r.queryHash??(0,t.hashQueryKeyByOptions)(o,r),a=this.get(n);return a||(a=new s.Query({client:e,queryKey:o,queryHash:n,options:e.defaultQueryOptions(r),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(a)),a}add(e){this.#ee.has(e.queryHash)||(this.#ee.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#ee.get(e.queryHash);t&&(e.destroy(),t===e&&this.#ee.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#ee.get(e)}getAll(){return[...this.#ee.values()]}find(e){let s={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(s,e))}findAll(e={}){let s=this.getAll();return Object.keys(e).length>0?s.filter(s=>(0,t.matchQuery)(e,s)):s}notify(e){r.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},n=e.i(88587),a=e.i(936553),u=class extends n.Removable{#h;#et;#es;#d;constructor(e){super(),this.#h=e.client,this.mutationId=e.mutationId,this.#es=e.mutationCache,this.#et=[],this.state=e.state||c(),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.#et.includes(e)||(this.#et.push(e),this.clearGcTimeout(),this.#es.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#et=this.#et.filter(t=>t!==e),this.scheduleGc(),this.#es.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#et.length||("pending"===this.state.status?this.scheduleGc():this.#es.remove(this))}continue(){return this.#d?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#y({type:"continue"})},s={client:this.#h,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#d=(0,a.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#y({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#y({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#es.canRun(this)});let r="pending"===this.state.status,i=!this.#d.canStart();try{if(r)t();else{this.#y({type:"pending",variables:e,isPaused:i}),this.#es.config.onMutate&&await this.#es.config.onMutate(e,this,s);let t=await this.options.onMutate?.(e,s);t!==this.state.context&&this.#y({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#d.start();return await this.#es.config.onSuccess?.(o,e,this.state.context,this,s),await this.options.onSuccess?.(o,e,this.state.context,s),await this.#es.config.onSettled?.(o,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(o,null,e,this.state.context,s),this.#y({type:"success",data:o}),o}catch(t){try{await this.#es.config.onError?.(t,e,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,s)}catch(e){Promise.reject(e)}try{await this.#es.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,s)}catch(e){Promise.reject(e)}throw this.#y({type:"error",error:t}),t}finally{this.#es.runNext(this)}}#y(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};
6case"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),r.notifyManager.batch(()=>{this.#et.forEach(t=>{t.onMutationUpdate(e)}),this.#es.notify({mutation:this,type:"updated",action:e})})}};function c(){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,u,"getDefaultState",0,c],114272);var l=i,h=class extends l.Subscribable{constructor(e={}){super(),this.config=e,this.#er=new Set,this.#ei=new Map,this.#eo=0}#er;#ei;#eo;build(e,t,s){let r=new u({client:e,mutationCache:this,mutationId:++this.#eo,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#er.add(e);let t=d(e);if("string"==typeof t){let s=this.#ei.get(t);s?s.push(e):this.#ei.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#er.delete(e)){let t=d(e);if("string"==typeof t){let s=this.#ei.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#ei.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let s=this.#ei.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#ei.get(t)?.find(t=>
6t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){r.notifyManager.batch(()=>{this.#er.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#er.clear(),this.#ei.clear()})}getAll(){return Array.from(this.#er)}find(e){let s={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(s,e))}findAll(e={}){return this.getAll().filter(s=>(0,t.matchMutation)(e,s))}notify(e){r.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return r.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function d(e){return e.options.scope?.id}var f=e.i(175555),p=e.i(814448);let y=new class{#en;#es;#f;#ea;#eu;#ec;#el;#eh;constructor(e={}){this.#en=e.queryCache||new o,this.#es=e.mutationCache||new h,this.#f=e.defaultOptions||{},this.#ea=new Map,this.#eu=new Map,this.#ec=0}mount(){this.#ec++,1===this.#ec&&(this.#el=f.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#en.onFocus())}),this.#eh=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#en.onOnline())}))}unmount(){this.#ec--,0===this.#ec&&(this.#el?.(),this.#el=void 0,this.#eh?.(),this.#eh=void 0)}isFetching(e){return this.#en.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#es.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#en.get(t.queryHash)?.state.data}ensureQueryData(e){let s=this.defaultQueryOptions(e),r=this.#en.build(this,s),i=r.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,t.resolveStaleTime)(s.staleTime,r))&&this.prefetchQuery(s),Promise.resolve(i))}getQueriesData(e){return this.#en.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,s,r){let i=this.defaultQueryOptions({queryKey:e}),o=this.#en.get(i.queryHash),n=o?.state.data,a=(0,t.functionalUpdate)(s,n);if(void 0!==a)return this.#en.build(this,i).setData(a,{...r,manual:!0})}setQueriesData(e,t,s){return r.notifyManager.batch(()=>this.#en.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#en.get(t.queryHash)?.state}removeQueries(e){let t=this.#en;r.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#en;return r.notifyManager.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,s={}){let i={revert:!0,...s};return Promise.all(r.notifyManager.batch(()=>this.#en.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return r.notifyManager.batch(()=>(this.#en.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,s={}){let i={...s,cancelRefetch:s.cancelRefetch??!0};return Promise.all(r.notifyManager.batch(()=>this.#en.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let s=e.fetch(void 0,i);return i.throwOnError||(s=s.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():s}))).then(t.noop)}fetchQuery(e){let s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);let r=this.#en.build(this,s);return r.isStaleByTime((0,t.resolveStaleTime)(s.staleTime,r))?r.fetch(s):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#es.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#en}getMutationCache(){return this.#es}getDefaultOptions(){return this.#f}setDefaultOptions(e){this.#f=e}setQueryDefaults(e,s){this.#ea.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:s})}getQueryDefaults(e){let s=[...this.#ea.values()],r={};
6return s.forEach(s=>{(0,t.partialMatchKey)(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,s){this.#eu.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:s})}getMutationDefaults(e){let s=[...this.#eu.values()],r={};return s.forEach(s=>{(0,t.partialMatchKey)(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let s={...this.#f.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=(0,t.hashQueryKeyByOptions)(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===t.skipToken&&(s.enabled=!1),s}defaultMutationOptions(e){return e?._defaulted?e:{...this.#f.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#en.clear(),this.#es.clear()}};e.s(["queryClient",0,y],437453);var m=e.i(714224);let g={account:e=>["xp",e.subject,"v2",e.epoch],profiles:e=>[...g.account(e),"profiles"],member:(e,t)=>[...g.account(e),"profile",t],summary:(e,t)=>[...g.member(e,t),"summary"],missions:(e,t,s=25)=>[...g.member(e,t),"missions",{limit:s}],history:(e,t,s=25)=>[...g.member(e,t),"history",{limit:s}],author:e=>[...g.account(e),"author"]};function b(e,t){return e.invalidateQueries({queryKey:["xp",t]})}let v=e=>`mma-xp-profile:${e}`;async function w(e,t,s){let r=t(),i=await s(),o=t();return r&&o&&r.subject===o.subject&&r.epoch===o.epoch&&await b(e,r.subject),i}e.s(["chooseProfile",0,function(e,t){return t?e.items.some(e=>e.profileId===t)?t:null:1===e.items.length?e.items[0].profileId:null},"clearAccountQueries",0,function(e){for(let t of["xp","profile"])e.cancelQueries({queryKey:[t]}),e.removeQueries({queryKey:[t]});for(let t of e.getMutationCache().findAll({predicate:e=>e.options.mutationKey?.[0]==="xp"}))e.getMutationCache().remove(t)},"invalidateXp",0,b,"memberQueries",0,function(e,t,s){return{summary:{queryKey:g.summary(t,s),queryFn:({signal:t})=>e.summary(s,t),retry:!1},missions:{queryKey:g.missions(t,s),initialPageParam:null,queryFn:({signal:t,pageParam:r})=>e.missions(s,25,r,t),getNextPageParam:e=>e.nextCursor??void 0,retry:!1},history:{queryKey:g.history(t,s),initialPageParam:null,queryFn:({signal:t,pageParam:r})=>e.history(s,25,r,t),getNextPageParam:e=>e.nextCursor??void 0,retry:!1}}},"readSelection",0,function(e,t){try{return e?.getItem(v(t))??null}catch{return null}},"runConfirmedActivity",0,w,"writeSelection",0,function(e,t,s,r){if(!r.items.some(e=>e.profileId===s))throw new m.XpError("PROFILE_NOT_FOUND",404);try{e?.setItem(v(t),s)}catch{}},"xpKeys",0,g],886239);var S=e.i(768834);e.s(["createSelectors",0,e=>{for(let t of(e.use={},Object.keys(e.getState())))e.use[t]=()=>(0,S.useStore)(e,e=>e[t]);return e}],323435)},288119,e=>{"use strict";new TextEncoder;let t=new TextDecoder;class s extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class r extends s{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class i extends s{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t)}}let o="accessToken",n="refreshToken",a="cognitoSub";function u(){return localStorage.getItem(o)||void 0}function c(){return localStorage.getItem(n)||void 0}function l(){return localStorage.getItem(a)||void 0}e.s(["deleteSession",0,function(){localStorage.removeItem(o),localStorage.removeItem(n),localStorage.removeItem(a)},"getAccessToken",0,u,"getCognitoSub",0,l,"getRefreshToken",0,c,"hasSessionSaved",0,function(){return!!u()&&!!c()&&!!l()},"isJwtExpired",0,function(e){let s=function(e){let s,i;if("string"!=typeof e)throw new r("JWTs must use Compact JWS serialization, JWT must be a string");let{1:o,length:n}=e.split(".");if(5===n)throw new r("Only JWTs using Compact JWS serialization can be decoded");
6if(3!==n)throw new r("Invalid JWT");if(!o)throw new r("JWTs must contain a payload");try{s=function(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:t.decode(e),{alphabet:"base64url"});let s=e;s instanceof Uint8Array&&(s=t.decode(s)),s=s.replace(/-/g,"+").replace(/_/g,"/");try{var r=s;if(Uint8Array.fromBase64)return Uint8Array.fromBase64(r);let e=atob(r),t=new Uint8Array(e.length);for(let s=0;s<e.length;s++)t[s]=e.charCodeAt(s);return t}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}(o)}catch{throw new r("Failed to base64url decode the payload")}try{i=JSON.parse(t.decode(s))}catch{throw new r("Failed to parse the decoded payload as JSON")}if(!function(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(i))throw new r("Invalid JWT Claims Set");return i}(e),i=Math.floor(Date.now()/1e3);return s.exp<=i},"saveSession",0,function(e,t,s){localStorage.setItem(o,e),localStorage.setItem(n,t),localStorage.setItem(a,s)}],288119)},903212,e=>{"use strict";e.s(["useAuthStore",()=>g]);var t=e.i(662537),s=e.i(768834),r=e.i(579473),i=e.i(697621),o=e.i(957486),n=e.i(94160),a=e.i(771084),u=e.i(546350),c=e.i(437453),l=e.i(886239);e.i(659619);var h=e.i(993054),d=e.i(323435),f=e.i(288119);let p=(0,f.hasSessionSaved)();p&&t.setUser({id:(0,f.getCognitoSub)()});let y={sessionEpoch:0,isLoggedIn:p,isLoading:!1,error:void 0,accessToken:p?(0,f.getAccessToken)():void 0,refreshToken:p?(0,f.getRefreshToken)():void 0,cognitoSub:p?(0,f.getCognitoSub)():void 0,startSession:()=>{},endSession:()=>{}},m=(0,s.create)((0,r.devtools)((0,r.combine)(y,(e,s)=>({login:async t=>{e({isLoading:!0});let[r,n]=await (0,u.tryCatch)(i.apiClient.post("auth/login",{json:(0,a.parseSchema)(o.LoginRequestSchema,t)}).json());if(n){let t=n?.response;t?e({isLoading:!1,error:await t.json()}):e({isLoading:!1});return}let{startSession:c}=s();c(r)},startSession:({accessToken:r,refreshToken:i,cognitoSub:o})=>{(0,l.clearAccountQueries)(c.queryClient),(0,h.resetAnalyticsIdentity)(),(0,f.saveSession)(r,i,o),t.setUser({id:o}),e({sessionEpoch:s().sessionEpoch+1,isLoading:!1,isLoggedIn:!0,cognitoSub:o,accessToken:r,refreshToken:i})},endSession:()=>{t.setUser(null),(0,h.resetAnalyticsIdentity)(),(0,l.clearAccountQueries)(c.queryClient),e({sessionEpoch:s().sessionEpoch+1,isLoading:!1,isLoggedIn:!1,cognitoSub:void 0,accessToken:void 0,refreshToken:void 0})},logout:async()=>{e({isLoading:!0}),(0,f.deleteSession)();let t=s().refreshToken;await (0,u.tryCatch)(i.authorizedApiClient.post("auth/logout",{json:(0,a.parseSchema)(n.LogoutRequestSchema,{refreshToken:t})}));let{endSession:r}=s();r()}})))),g=(0,d.createSelectors)(m)},407978,e=>{"use strict";var t=e.i(894706),s=e.i(264885);let r=t.default.object({refreshToken:s.RefreshTokenSchema,cognitoSub:s.CognitoSubSchema});t.default.object({accessToken:s.AccessTokenSchema}).readonly(),e.s(["RefreshTokenRequestSchema",0,r])},697621,e=>{"use strict";e.s(["apiClient",()=>c,"authorizedApiClient",()=>h]);var t=e.i(662537),s=e.i(42086),r=e.i(903212),i=e.i(407978),o=e.i(771084),n=e.i(546350),a=e.i(288119),u=e.i(58785);let c=s.default.create({prefix:u.environment.NEXT_PUBLIC_AUTH_API_BASE,retry:0}),l=new Set(["/api/auth/logout"]),h=c.extend({context:{getAccessToken:()=>r.useAuthStore.getState().accessToken,setAccessToken:e=>{r.useAuthStore.setState(()=>({accessToken:e}))},getRefreshToken:()=>r.useAuthStore.getState().refreshToken,getCognitoSub:()=>r.useAuthStore.getState().cognitoSub,endSession:()=>{r.useAuthStore.getState().endSession(),(0,a.deleteSession)(),(0,t.endSession)()},attempts:{count:0,max:5}},hooks:{beforeRequest:[async({request:e,options:t})=>{let s=t.context,r=s.getAccessToken();if(r){if((0,a.isJwtExpired)(r)){let e=await f(s);if(!e)return new Response(null,{status:401});r=e}e.headers.set("Authorization",`Bearer ${r}`)}}],afterResponse:[async({request:e,options:t,response:s})=>{let r=t.context,i=new URL(e.url);if(!(s.status>=400)){l.has(i.pathname)&&(r.attempts.count=0);return}l.has(i.pathname)?r.attempts.count<r.attempts.max?r.attempts.count++:r.endSession():403===s.status&&d(r)}]}});function d(e){e.endSession(),globalThis.location.pathname="/"}async function f(e){let t=e.getRefreshToken(),s=e.getCognitoSub(),[r,a]=await (0,n.tryCatch)(c.post("auth/refresh-token",{json:(0,o.parseSchema)(i.RefreshTokenRequestSchema,{refreshToken:t,cognitoSub:s})}).json());return a?void d(e):(e.setAccessToken(r.accessToken),r.accessToken)}},386909,175130,280021,682310,e=>{"use strict";
6var t=e.i(697621),s=e.i(894706);let r=s.default.string().min(8).max(256).regex(/^\S*$/,"Must not contain spaces.").regex(/.*[a-z]/,"Must contain at least one lowercase letter.").regex(/.*[A-Z]/,"Must contain at least one uppercase letter.").regex(/.*[0-9]/,"Must contain at least one number.").regex(/.*[\^$*.[\]{}()?"!@#%&/\\,><':;|_~`=+\- ]/,"Must contain at least one special character.");e.s(["PasswordSchema",0,r],175130);let i=s.default.object({email:s.default.email(),code:s.default.string(),newPassword:r});var o=e.i(771084);async function n(e){await t.apiClient.post("auth/confirm-password-reset",{json:(0,o.parseSchema)(i,e)})}let a=s.default.object({email:s.default.email()});async function u(e){await t.apiClient.post("auth/password-reset",{json:(0,o.parseSchema)(a,e)})}var c=e.i(264885);let l=s.default.object({email:s.default.email(),password:r,marketingAgreement:s.default.boolean()}),h=s.default.object({accessToken:c.AccessTokenSchema,refreshToken:c.RefreshTokenSchema,cognitoSub:c.CognitoSubSchema}).readonly();async function d(e){let s=await t.apiClient.post("auth/register",{json:(0,o.parseSchema)(l,e)}),r=await s.json();return(0,o.parseSchema)(h,r)}var f=e.i(903212),p=e.i(651501);function y(e){return e instanceof p.HTTPError}function m(e){if(!y(e))return null;let t=e.data,s=(t?.errors??[]).flatMap(e=>e.errorDetails?.length?e.errorDetails:e.message?[e.message]:[]).map(e=>e.trim()).filter(Boolean);return s.length?s.join("\n"):null}e.s(["isHttpError",0,y],280021),e.s(["extractApiErrorMessage",0,m],682310);var g=e.i(957486),b=e.i(546350);class v extends Error{}async function w(e){if(!y(e))return new v("Something went wrong â please try again.");let t=e.response.status,s=m(e);if(!s){let r=e.data,i=r?.message??"";s=401===t?"Incorrect email or password.":409===t?"An account with that email already exists â try logging in.":429===t?"Too many attempts â wait a moment and try again.":i&&"Please check errors."!==i?i:"Something went wrong â please try again."}return new v(s)}async function S(e,s){let[r,i]=await (0,b.tryCatch)(t.apiClient.post("auth/login",{json:(0,o.parseSchema)(g.LoginRequestSchema,{email:e,password:s})}).json());if(i)throw await w(i);f.useAuthStore.getState().startSession(r)}async function T(e,t,s=!1){let[r,i]=await (0,b.tryCatch)(d({email:e,password:t,marketingAgreement:s}));if(i)throw await w(i);f.useAuthStore.getState().startSession(r)}async function R(e){let[,t]=await (0,b.tryCatch)(u({email:e}));if(t)throw await w(t)}async function C(e,t,s){let[,r]=await (0,b.tryCatch)(n({email:e,code:t,newPassword:s}));if(r)throw await w(r)}e.s(["AuthError",0,v,"confirmNewPassword",0,C,"login",0,S,"register",0,T,"requestPasswordReset",0,R],386909)}]); 7 8//# debugId=315f4935-db7e-2400-b34e-e2ce181d73ab
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.