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]="2cf5d522-f85a-0545-2d00-20120d5250ac")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,619273,e=>{"use strict";var t="u"<typeof window||"Deno"in globalThis;function r(e,t){return(t?.queryKeyHashFn||s)(e)}function s(e){return JSON.stringify(e,(e,t)=>o(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function i(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>i(e[r],t[r]))}function n(e,t){if(e===t)return e;let r=a(e)&&a(t);if(r||o(e)&&o(t)){let s=r?e:Object.keys(e),i=s.length,a=r?t:Object.keys(t),o=a.length,u=r?[]:{},l=0;for(let i=0;i<o;i++){let o=r?i:a[i];(!r&&s.includes(o)||r)&&void 0===e[o]&&void 0===t[o]?(u[o]=void 0,l++):(u[o]=n(e[o],t[o]),u[o]===e[o]&&void 0!==e[o]&&l++)}return i===o&&l===i?e:u}return t}function a(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function o(e){if(!u(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!u(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function u(e){return"[object Object]"===Object.prototype.toString.call(e)}var l=Symbol();e.s(["addToEnd",0,function(e,t,r=0){let s=[...e,t];return r&&s.length>r?s.slice(1):s},"addToStart",0,function(e,t,r=0){let s=[t,...e];return r&&s.length>r?s.slice(0,-1):s},"ensureQueryFn",0,function(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==l?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))},"functionalUpdate",0,function(e,t){return"function"==typeof e?e(t):e},"hashKey",0,s,"hashQueryKeyByOptions",0,r,"isServer",0,t,"isValidTimeout",0,function(e){return"number"==typeof e&&e>=0&&e!==1/0},"matchMutation",0,function(e,t){let{exact:r,status:n,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(s(t.options.mutationKey)!==s(o))return!1}else if(!i(t.options.mutationKey,o))return!1}return(!n||t.state.status===n)&&(!a||!!a(t))},"matchQuery",0,function(e,t){let{type:s="all",exact:n,fetchStatus:a,predicate:o,queryKey:u,stale:l}=e;if(u){if(n){if(t.queryHash!==r(u,t.options))return!1}else if(!i(t.queryKey,u))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof l||t.isStale()===l)&&(!a||a===t.state.fetchStatus)&&(!o||!!o(t))},"noop",0,function(){},"partialMatchKey",0,i,"replaceData",0,function(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?n(e,t):t},"replaceEqualDeep",0,n,"resolveEnabled",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 r in e)if(e[r]!==t[r])return!1;return!0},"skipToken",0,l,"sleep",0,function(e){return new Promise(t=>{setTimeout(t,e)})},"timeUntilStale",0,function(e,t){return Math.max(e+(t||0)-Date.now(),0)}])},540143,e=>{"use strict";let t,r,s,i,n,a;var o=(t=[],r=0,s=e=>{e()},i=e=>{e()},n=e=>setTimeout(e,0),{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{i(()=>{e.forEach(e=>{s(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{s(e)})},setNotifyFunction:e=>{s=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{n=e}});e.s(["notifyManager",0,o])},915823,e=>{"use strict";e.s(["Subscribable",0,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(){}}])},175555,e=>{"use strict";var t=e.i(915823),r=e.i(619273),s=new class extends t.Subscribable{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=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();
2this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",0,s])},936553,814448,793803,e=>{"use strict";var t=e.i(175555),r=e.i(915823),s=e.i(619273),i=new class extends r.Subscribable{#s=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!s.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#s!==e&&(this.#s=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#s}};function n(){let e,t,r=new Promise((r,s)=>{e=r,t=s});function s(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},r.reject=e=>{s({status:"rejected",reason:e}),t(e)},r}function a(e){return Math.min(1e3*2**e,3e4)}function o(e){return(e??"online")!=="online"||i.isOnline()}e.s(["onlineManager",0,i],814448),e.s(["pendingThenable",0,n],793803);var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};e.s(["canFetch",0,o,"createRetryer",0,function(e){let r,l=!1,c=0,h=!1,d=n(),p=()=>t.focusManager.isFocused()&&("always"===e.networkMode||i.isOnline())&&e.canRun(),f=()=>o(e.networkMode)&&e.canRun(),y=t=>{h||(h=!0,e.onSuccess?.(t),r?.(),d.resolve(t))},m=t=>{h||(h=!0,e.onError?.(t),r?.(),d.reject(t))},b=()=>new Promise(t=>{r=e=>{(h||p())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,h||e.onContinue?.()}),v=()=>{let t;if(h)return;let r=0===c?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(y).catch(t=>{if(h)return;let r=e.retry??3*!s.isServer,i=e.retryDelay??a,n="function"==typeof i?i(c,t):i,o=!0===r||"number"==typeof r&&c<r||"function"==typeof r&&r(c,t);l||!o?m(t):(c++,e.onFail?.(c,t),(0,s.sleep)(n).then(()=>p()?void 0:b()).then(()=>{l?m(t):v()}))})};return{promise:d,cancel:t=>{h||(m(new u(t)),e.abort?.())},continue:()=>(r?.(),d),cancelRetry:()=>{l=!0},continueRetry:()=>{l=!1},canStart:f,start:()=>(f()?v():b().then(v),d)}},"isCancelledError",0,function(e){return e instanceof u}],936553)},88587,e=>{"use strict";var t=e.i(619273),r=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#i=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t.isServer?1/0:3e5))}clearGcTimeout(){this.#i&&(clearTimeout(this.#i),this.#i=void 0)}};e.s(["Removable",0,r])},912598,e=>{"use strict";var t=e.i(271645),r=e.i(843476),s=t.createContext(void 0);e.s(["QueryClientProvider",0,({client:e,children:i})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(s.Provider,{value:e,children:i})),"useQueryClient",0,e=>{let r=t.useContext(s);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r}])},811076,e=>{"use strict";e.s(["noop",0,function(){},"shouldThrowError",0,function(e,t){return"function"==typeof e?e(...t):!!e}])},286491,e=>{"use strict";var t=e.i(619273),r=e.i(540143),s=e.i(936553),i=e.i(88587),n=class extends i.Removable{#n;#a;#o;#u;#l;#c;#h;constructor(e){super(),this.#h=!1,this.#c=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#o=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#n=function(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"}}(this.options),this.state=e.state??this.#n,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){this.options={...this.#c,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#o.remove(this)}setData(e,r){let s=(0,t.replaceData)(this.state.data,e,this.options);return this.#d({data:s,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),s}setState(e,t){this.#d({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#l?.promise;return this.#l?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#n)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdate
2Count===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e)}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#o.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.#l&&(this.#h?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#o.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#d({type:"invalidate"})}fetch(e,r){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.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,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,i.signal)})},a=()=>{let e=(0,t.ensureQueryFn)(this.options,r),s={client:this.#u,queryKey:this.queryKey,meta:this.meta};return(n(s),this.#h=!1,this.options.persister)?this.options.persister(e,s,this):e(s)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:a};n(o),this.options.behavior?.onFetch(o,this),this.#a=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#d({type:"fetch",meta:o.fetchOptions?.meta});let u=e=>{(0,s.isCancelledError)(e)&&e.silent||this.#d({type:"error",error:e}),(0,s.isCancelledError)(e)||(this.#o.config.onError?.(e,this),this.#o.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#l=(0,s.createRetryer)({initialPromise:r?.initialPromise,fn:o.fetchFn,abort:i.abort.bind(i),onSuccess:e=>{if(void 0===e)return void u(Error(`${this.queryHash} data is undefined`));try{this.setData(e)}catch(e){u(e);return}this.#o.config.onSuccess?.(e,this),this.#o.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:u,onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:()=>{this.#d({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#l.start()}#d(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,...a(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let r=e.error;if((0,s.isCancelledError)(r)&&r.revert&&this.#a)return{...this.#a,fetchStatus:"idle"};return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};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.#o.notify({query:this,type:"updated",action:e})})}};function a(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,s.canFetch)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}e.s(["Query",0,n,"fetchState",0,a])},266027,869230,673664,427001,977805,254440,469637,e=>{"use strict";let t;var r=e.i(175555),s=e.i(540143),i=e.i(286491),n=e.i(915823),a=e.i(793803),o=e.i(619273),u=class extends n.Subscribable{constructor(e,t){super(),this.options=t,this.#u=e,this.#p=null,this.#f=(0,a.pendingThenable)(),this.options.experimental_prefetchInRender||this.#f.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#u;#y=void 0;#m=void 0;#b=void 0;#v;#g;#f;#p;#R;#w;#S;#C;#O;#E;#Q=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#y.addObserver(this),l(this.#y,this.options)?this.#T():this.updateResult(),this.#k())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.#y,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.#y,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#I(),this.#F(),this.#y.removeObserver(this)}setOptions(e){let t=this.options,r=this.#y;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,o.resolveEnabled)(this.options.enabled,this.#y))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#P(),this.#y.setOptions(this.options),t._defaulted&&!(0,o.shallowEqualObjects)(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#y,observer:this});let s=this.hasListeners();s&&h(this.#y,r,this.options,t)&&this.#T(),this.updateResult(),s&&(this.#y!==r||(0,o.resolveEnabled)(this.options.enabled,this.#y)!==(0,o.resolveEnabled)(t.enabled,this.#y)||(0,o.resolveStaleTime)(this.options.staleTime,this.#y)!==(0,o.resolveStaleTime)(t.staleTime,this.#y))&&this.#M();let i=this.#x();s&&(this.#y!==r||(0,o.resolveEnabled)(this.options.enabled,this.#y)!==(0,o.resolveEnabled)(t.enabled,this.#y)||i!==this.#E)&&this.#U(i)}getOptimisticResult(e){var t,r;let s=this.#u.getQueryCache().build(this.#u,e),i=this.createResult(s,e);return t=this,r=i,(0,o.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#b=i,this.#g=this.options,this.#v=this.#y.state),i}getCurrentResult(){return this.#b}trackResult(e,t){let r={};return Object.keys(e).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),t?.(s),e[s])})}),r}trackProp(e){this.#Q.add(e)}getCurrentQuery(){return this.#y}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#u.defaultQueryOptions(e),r=this.#u.getQueryCache().build(this.#u,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#T({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#T(e){this.#P();let t=this.#y.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.noop)),t}#M(){this.#I();let e=(0,o.resolveStaleTime)(this.options.staleTime,this.#y);if(o.isServer||this.#b.isStale||!(0,o.isValidTimeout)(e))return;let t=(0,o.timeUntilStale)(this.#b.dataUpdatedAt,e);this.#C=setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#x(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#y):this.options.refetchInterval)??!1}#U(e){this.#F(),this.#E=e,!o.isServer&&!1!==(0,o.resolveEnabled)(this.options.enabled,this.#y)&&(0,o.isValidTimeout)(this.#E)&&0!==this.#E&&(this.#O=setInterval(()=>
2{(this.options.refetchIntervalInBackground||r.focusManager.isFocused())&&this.#T()},this.#E))}#k(){this.#M(),this.#U(this.#x())}#I(){this.#C&&(clearTimeout(this.#C),this.#C=void 0)}#F(){this.#O&&(clearInterval(this.#O),this.#O=void 0)}createResult(e,t){let r,s=this.#y,n=this.options,u=this.#b,c=this.#v,p=this.#g,f=e!==s?e.state:this.#m,{state:y}=e,m={...y},b=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&l(e,t),o=r&&h(e,s,t,n);(a||o)&&(m={...m,...(0,i.fetchState)(y.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:g,status:R}=m;r=m.data;let w=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===R){let e;u?.isPlaceholderData&&t.placeholderData===p?.placeholderData?(e=u.data,w=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#S?.state.data,this.#S):t.placeholderData,void 0!==e&&(R="success",r=(0,o.replaceData)(u?.data,e,t),b=!0)}if(t.select&&void 0!==r&&!w)if(u&&r===c?.data&&t.select===this.#R)r=this.#w;else try{this.#R=t.select,r=t.select(r),r=(0,o.replaceData)(u?.data,r,t),this.#w=r,this.#p=null}catch(e){this.#p=e}this.#p&&(v=this.#p,r=this.#w,g=Date.now(),R="error");let S="fetching"===m.fetchStatus,C="pending"===R,O="error"===R,E=C&&S,Q=void 0!==r,T={status:R,fetchStatus:m.fetchStatus,isPending:C,isSuccess:"success"===R,isError:O,isInitialLoading:E,isLoading:E,data:r,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:g,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:S,isRefetching:S&&!C,isLoadingError:O&&!Q,isPaused:"paused"===m.fetchStatus,isPlaceholderData:b,isRefetchError:O&&Q,isStale:d(e,t),refetch:this.refetch,promise:this.#f};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===T.status?e.reject(T.error):void 0!==T.data&&e.resolve(T.data)},r=()=>{t(this.#f=T.promise=(0,a.pendingThenable)())},i=this.#f;switch(i.status){case"pending":e.queryHash===s.queryHash&&t(i);break;case"fulfilled":("error"===T.status||T.data!==i.value)&&r();break;case"rejected":("error"!==T.status||T.error!==i.reason)&&r()}}return T}updateResult(){let e=this.#b,t=this.createResult(this.#y,this.options);if(this.#v=this.#y.state,this.#g=this.options,void 0!==this.#v.data&&(this.#S=this.#y),(0,o.shallowEqualObjects)(t,e))return;this.#b=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#Q.size)return!0;let s=new Set(r??this.#Q);return this.options.throwOnError&&s.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&s.has(t))};this.#q({listeners:r()})}#P(){let e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#y)return;let t=this.#y;this.#y=e,this.#m=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#k()}#q(e){s.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#u.getQueryCache().notify({query:this.#y,type:"observerResultsUpdated"})})}};function l(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==(0,o.resolveEnabled)(t.enabled,e)){let s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&d(e,t)}return!1}function h(e,t,r,s){return(e!==t||!1===(0,o.resolveEnabled)(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&d(e,r)}function d(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,o.resolveStaleTime)(t.staleTime,e))}e.s(["QueryObserver",0,u],869230),e.i(247167);var p=e.i(271645),f=e.i(912598);e.i(843476);var y=p.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),m=()=>p.useContext(y);e.s(["useQueryErrorResetBoundary",0,m],673664);var b=e.i(811076),v=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&!t.isReset()&&(e.retryOn
2Mount=!1)},g=e=>{p.useEffect(()=>{e.clearReset()},[e])},R=({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&void 0===e.data||(0,b.shouldThrowError)(r,[e.error,s]));e.s(["ensurePreventErrorBoundaryRetry",0,v,"getHasError",0,R,"useClearResetErrorBoundary",0,g],427001);var w=p.createContext(!1),S=()=>p.useContext(w);w.Provider,e.s(["useIsRestoring",0,S],977805);var C=e=>{let t=e.staleTime;e.suspense&&(e.staleTime="function"==typeof t?(...e)=>Math.max(t(...e),1e3):Math.max(t??1e3,1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))},O=(e,t)=>e.isLoading&&e.isFetching&&!t,E=(e,t)=>e?.suspense&&t.isPending,Q=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function T(e,t,r){let i=(0,f.useQueryClient)(r),n=S(),a=m(),u=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(u),u._optimisticResults=n?"isRestoring":"optimistic",C(u),v(u,a),g(a);let l=!i.getQueryCache().get(u.queryHash),[c]=p.useState(()=>new t(i,u)),h=c.getOptimisticResult(u),d=!n&&!1!==e.subscribed;if(p.useSyncExternalStore(p.useCallback(e=>{let t=d?c.subscribe(s.notifyManager.batchCalls(e)):b.noop;return c.updateResult(),t},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setOptions(u)},[u,c]),E(u,h))throw Q(u,c,a);if(R({result:h,errorResetBoundary:a,throwOnError:u.throwOnError,query:i.getQueryCache().get(u.queryHash),suspense:u.suspense}))throw h.error;if(i.getDefaultOptions().queries?._experimental_afterQuery?.(u,h),u.experimental_prefetchInRender&&!o.isServer&&O(h,n)){let e=l?Q(u,c,a):i.getQueryCache().get(u.queryHash)?.promise;e?.catch(b.noop).finally(()=>{c.updateResult()})}return u.notifyOnChangeProps?h:c.trackResult(h)}e.s(["ensureSuspenseTimers",0,C,"fetchOptimistic",0,Q,"shouldSuspend",0,E,"willFetch",0,O],254440),e.s(["useBaseQuery",0,T],469637),e.s(["useQuery",0,function(e,t){return T(e,u,t)}],266027)},114272,e=>{"use strict";var t=e.i(540143),r=e.i(88587),s=e.i(936553),i=class extends r.Removable{#D;#_;#l;constructor(e){super(),this.mutationId=e.mutationId,this.#_=e.mutationCache,this.#D=[],this.state=e.state||n(),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.#D.includes(e)||(this.#D.push(e),this.clearGcTimeout(),this.#_.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#D=this.#D.filter(t=>t!==e),this.scheduleGc(),this.#_.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#D.length||("pending"===this.state.status?this.scheduleGc():this.#_.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#d({type:"continue"})};this.#l=(0,s.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#_.canRun(this)});let r="pending"===this.state.status,i=!this.#l.canStart();try{if(r)t();else{this.#d({type:"pending",variables:e,isPaused:i}),await this.#_.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#d({type:"pending",context:t,variables:e,isPaused:i})}let s=await this.#l.start();return await this.#_.config.onSuccess?.(s,e,this.state.context,this),await this.options.onSuccess?.(s,e,this.state.context),await this.#_.config.onSettled?.(s,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(s,null,e,this.state.context),this.#d({type:"success",data:s}),s}catch(t){try{throw await this.#_.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#_.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#d({type:"error",error:t})}}finally{this.#_.runNext(this)}}#d(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};
2case"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.#D.forEach(t=>{t.onMutationUpdate(e)}),this.#_.notify({mutation:this,type:"updated",action:e})})}};function n(){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,n])},195399,624464,e=>{"use strict";var t=e.i(266027),r=e.i(271645);e.i(247167);var s=e.i(540143),i=e.i(869230),n=e.i(915823),a=e.i(619273);function o(e,t){return e.filter(e=>!t.includes(e))}var u=class extends n.Subscribable{#u;#j;#A;#L;#D;#K;#G;#H;#B=[];constructor(e,t,r){super(),this.#u=e,this.#L=r,this.#A=[],this.#D=[],this.#j=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#D.forEach(e=>{e.subscribe(t=>{this.#$(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#D.forEach(e=>{e.destroy()})}setQueries(e,t){this.#A=e,this.#L=t,s.notifyManager.batch(()=>{let e=this.#D,t=this.#N(this.#A);this.#B=t,t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let r=t.map(e=>e.observer),s=r.map(e=>e.getCurrentResult()),i=r.some((t,r)=>t!==e[r]);e.length===r.length&&!i||(this.#D=r,this.#j=s,this.hasListeners()&&(o(e,r).forEach(e=>{e.destroy()}),o(r,e).forEach(e=>{e.subscribe(t=>{this.#$(e,t)})}),this.#q()))})}getCurrentResult(){return this.#j}getQueries(){return this.#D.map(e=>e.getCurrentQuery())}getObservers(){return this.#D}getOptimisticResult(e,t){let r=this.#N(e),s=r.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[s,e=>this.#W(e??s,t),()=>this.#z(s,r)]}#z(e,t){return t.map((r,s)=>{let i=e[s];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#W(e,t){return t?(this.#K&&this.#j===this.#H&&t===this.#G||(this.#G=t,this.#H=this.#j,this.#K=(0,a.replaceEqualDeep)(this.#K,t(e))),this.#K):e}#N(e){let t=new Map(this.#D.map(e=>[e.options.queryHash,e])),r=[];return e.forEach(e=>{let s=this.#u.defaultQueryOptions(e),n=t.get(s.queryHash);n?r.push({defaultedQueryOptions:s,observer:n}):r.push({defaultedQueryOptions:s,observer:new i.QueryObserver(this.#u,s)})}),r}#$(e,t){let r=this.#D.indexOf(e);if(-1!==r){var s;let e;this.#j=(s=this.#j,(e=s.slice(0))[r]=t,e),this.#q()}}#q(){if(this.hasListeners()){let e=this.#K,t=this.#z(this.#j,this.#B);e!==this.#W(t,this.#L?.combine)&&s.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(this.#j)})})}}},l=e.i(912598),c=e.i(977805),h=e.i(673664),d=e.i(427001),p=e.i(254440),f=e.i(811076);function y(e,t,r=Date.now()){if("completed"===e||"failed"===e)return!1;let s=t?Date.parse(t):NaN;if(!Number.isFinite(s))return 3e3;let i=Math.max(0,r-s);return i>=18e5?12e4:i>=3e5?3e4:3e3}function m(e){return{queryKey:["recipe-processing-status",e],queryFn:async()=>{let t=await fetch(`/api/user-recipes/${e}/status`);if(!t.ok)throw Error("Failed to fetch processing status");return t.json()},refetchInterval:e=>!e.state.error&&y(e.state.data?.processing_status,e.state.data?.processing_updated_at),retry:1}}e.s(["importStatusRefetchInterval",0,y,"useRecipeProcessingStatus",0,function(e){return(0,t.useQuery)({...m(e),enabled:null!==e})},"useRecipeProcessingStatuses",0,function(e){return function({queries:e,...t}){let n=(0,l.useQueryClient)(void 0),a=(0,c.useIsRestoring)(),o=(0,h.useQueryErrorResetBoundary)(),y=r.useMemo(()=>e.map(e=>{let t=n.defaultQueryOptions(e);return t._optimisticResults=a?"isRestoring":"optimistic",t}),[e,n,a]);y.forEach(e=>{(0,p.ensureSuspenseTimers)(e),(0,d.ensurePreventErrorBoundaryRetry)(e,o)}),(0,d.useClearResetErrorBoundary)(o);let[m]=r.useState(()=>new u(n,y,t)),[b,v,g]=m.getOptimisticResult(y,t.combine),R=!a&&!1!==t.subscribed;r.useSyncExternalStore(r.useCallback(e=>R?m.subscribe(s.notifyManager.batchCalls(e)):f.noop,[m,R]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),r.useEffect(()=>{m.setQueries(y,t)},[y,t,m]);let w=b.some((e,t)=>(0,p.shouldSuspend)(y[t],e))?b.flatMap((e,t)=>{let r=y[t];if(r){let t=new i.QueryObserver(n,r);if((0,p.shouldSuspend)(r,e))return(0,p.fetchOptimistic)(r,t,o);(0,p.willFetch)(e,a)&&(0,p.fetchOptimistic)(r,t,o)}return[]}):[];if(w.length>0)throw Promise.all(w);let S=b.find((e,t)=>{let r=y[t];return r&&(0,d.getHasError)({result:e,errorResetBoundary:o,throwOnError:r.throwOnError,query:n.getQueryCache().get(r.queryHash),suspense:r.suspense})});if(S?.error)throw S.error;return v(g())}({queries:e.map(m)})}],624464);let b=["active-recipe-import"];e.s(["ACTIVE_RECIPE_IMPORT_QUERY_KEY",0,b,"useActiveRecipeImports",0,function(e){return(0,t.useQuery)({queryKey:[...b,e??null],queryFn:async()=>{let e=await fetch("/api/user-recipes/active-import");if(!e.ok)throw Error("Failed to fetch active recipe imports");return(await e.json()).active_imports},enabled:!!e,refetchInterval:e=>{let t=e.state.data;return t?.length?y("processing",t.reduce((e,t)=>
2{let r=t.processing_updated_at;return r&&(!e||Date.parse(r)>Date.parse(e))?r:e},null)):3e4}})}],195399)},536849,e=>{"use strict";function t(e){try{return new URL(e).hostname.toLowerCase()}catch{return null}}let r=["www.","m.","mobile."],s={"youtu.be":"youtube.com","vm.tiktok.com":"tiktok.com","vt.tiktok.com":"tiktok.com","fb.watch":"facebook.com"};function i(e){let t=e.toLowerCase();for(let e of r)if(t.startsWith(e)){t=t.slice(e.length);break}return s[t]??t}let n={"youtube.com":"YouTube","tiktok.com":"TikTok","instagram.com":"Instagram","facebook.com":"Facebook"};e.s(["getFaviconUrl",0,function(e){if(!e)return null;let r=t(e);if(!r)return null;let s=i(r);return`https://www.google.com/s2/favicons?domain=${s}&sz=64`},"getProvenanceLabel",0,function(e){if(!e)return null;let r=t(e);if(!r)return null;let s=i(r);return n[s]??s},"isSafeUrl",0,function(e){if(!e)return!1;try{let t=new URL(e).protocol;return"https:"===t||"http:"===t}catch{return!1}},"isVideoPlatform",0,function(e){if(!e)return!1;let r=t(e);return!!r&&Object.prototype.hasOwnProperty.call(n,i(r))}])},134693,e=>{"use strict";let t={title:null,author:null,image_url:null};function r(e){if("string"!=typeof e)return null;let t=e.trim();return t.length>0?t:null}function s(e){return e?{title:r(e.title),author:r(e.author),image_url:r(e.image_url)}:{...t}}e.s(["hasRecipeImportPreview",0,function(e){let t=s(e);return!!(t.title||t.author||t.image_url)},"mergeRecipeImportPreviews",0,function(...e){return e.reduce((e,t)=>{let r=s(t);return{title:e.title??r.title,author:e.author??r.author,image_url:e.image_url??r.image_url}},s(null))}])},678525,e=>{"use strict";var t=e.i(271645);let r=[{step:"fetch_source",labels:["Gathering the ingredients...","Loading recipe details...","Preparing your import..."]},{step:"preview_metadata",labels:["Finding the recipe details...","Pulling in the preview...","Checking the source..."]},{step:"extraction",labels:["Reading your recipe...","Analyzing ingredients...","Identifying cooking steps...","Parsing measurements...","Understanding the recipe..."]},{step:"validation",labels:["Double-checking everything...","Verifying recipe data...","Making sure nothing's missing..."]},{step:"gap_fill",labels:["Filling in the blanks...","Completing the recipe...","Adding missing details..."]},{step:"save_recipe",labels:["Adding it to your cookbook...","Saving your recipe...","Almost there..."]},{step:"store_metadata",labels:["Filing away the details...","Organizing recipe info..."]},{step:"process_ingredients",labels:["Organizing the pantry...","Matching ingredients...","Categorizing items...","Cataloging your ingredients..."]},{step:"handle_image",labels:["Snapping a photo...","Processing the image...","Making it look delicious..."]},{step:"generate_embeddings",labels:["Tucking it into your collection...","Learning what makes it special...","Making it findable when you need it..."]},{step:"completed",labels:["Bon appetit!"]}];var s=e.i(134693);let i=new Map(r.map(e=>[e.step,e]));e.s(["useWorkflowStream",0,function(n,a,o){let[u,l]=(0,t.useState)(new Map),[c,h]=(0,t.useState)("connecting"),[d,p]=(0,t.useState)(null),f=(0,t.useRef)(0),y=(0,t.useRef)(null),m=(0,t.useRef)(o);m.current=o;let b=(0,t.useCallback)(async()=>{if(!n||!a)return;y.current?.abort();let t=new AbortController;y.current=t;try{let e=await fetch(`/api/user-recipes/${n}/workflow?runId=${a}&startIndex=${f.current}`,{signal:t.signal});if(!e.ok||!e.body){if(410===e.status){let t=null;try{let r=await e.json();t="string"==typeof r.status?r.status:null}catch{}h("completed"===t?"done":"failed"),m.current?.(a)}else h("failed");return}h("processing");let r=e.body.getReader(),i=new TextDecoder,o="";for(;;){let{done:e,value:t}=await r.read();if(e)break;let n=(o+=i.decode(t,{stream:!0})).split("\n");o=n.pop()||"";let u=[],c=!1,d=!1;for(let e of n){let t=e.trim();if(t)try{let e=JSON.parse(t);f.current++,u.push(e),"completed"===e.step&&"completed"===e.status?c=!0:"failed"===e.status&&(d=!0)}catch{}}if(u.length>0){l(e=>{let t=new Map(e);for(let e of u)t.set(e.step,e);return t});let e=u.map(e=>e.preview).filter(s.hasRecipeImportPreview).reduce((e,t)=>
2(0,s.mergeRecipeImportPreviews)(t,e),null);e&&p(t=>(0,s.mergeRecipeImportPreviews)(e,t))}c?(h("done"),m.current?.(a)):d&&h("failed")}t.signal.aborted||h(e=>"processing"===e?"failed":e)}catch(r){if("AbortError"===r.name)return;h("failed");let{captureError:t}=await e.A(827142);t(r,{flow:"recipe-import",operation:"workflow-stream-read",surface:"client",extra:{recipeId:n,workflowRunId:a}})}},[n,a]);(0,t.useEffect)(()=>{if(n&&a)return l(new Map),h("connecting"),p(null),f.current=0,b(),()=>{y.current?.abort()}},[n,a,b]);let v=!!n&&!!a,g=(0,t.useMemo)(()=>{for(let e=r.length-1;e>=0;e--){let t=u.get(r[e].step);if(t&&("running"===t.status||"completed"===t.status))return t}return null},[u]),R=(0,t.useMemo)(()=>{if(v)return Math.round(r.filter(({step:e})=>u.get(e)?.status==="completed").length/r.length*100)},[u,v]),[w,S]=(0,t.useState)(0),C=g?.status==="running"&&g.label===i.get(g.step)?.labels[0]?g.step:null,O=(0,t.useMemo)(()=>C?i.get(C):void 0,[C]),E=(0,t.useRef)(null);return(0,t.useEffect)(()=>{C!==E.current&&(E.current=C,S(0))},[C]),(0,t.useEffect)(()=>{if(!O||O.labels.length<=1)return;let e=setInterval(()=>{S(e=>(e+1)%O.labels.length)},3e3);return()=>clearInterval(e)},[O]),{phase:c,progress:R,displayLabel:(0,t.useMemo)(()=>g?"running"===g.status&&O?O.labels[w%O.labels.length]:g.label:"Cooking up your recipe...",[g,w,O]),preview:d}}],678525)},411754,e=>{"use strict";var t=e.i(278669),r=e.i(656135);let s=new Map,i="foodie:recipe-import-completion:";async function n(e,s){if(function(e){try{let t=`${i}${e}`,r=window.localStorage.getItem(t);if(!r)return!1;let s=Number(r),n=Date.now(),a=Number.isFinite(s)&&s>0&&s<=n&&n-s<=864e5;return a||window.localStorage.removeItem(t),a}catch{return!1}}(e))return"deduplicated";try{await (0,t.track)("Recipe Import Completed",{recipe_id:s.recipeId,workflow_run_id:s.workflowRunId,source_type:s.sourceType,process_attempts:s.processAttempts,had_workflow_stream:!!s.workflowRunId});try{window.localStorage.setItem(`${i}${e}`,String(Date.now()))}catch{}return"tracked"}catch(e){return console.error("Failed to track recipe import completion:",e),(0,r.captureError)(e,{flow:"recipe-import",surface:"client",operation:"import-completion-track",extra:{recipeId:s.recipeId,workflowRunId:s.workflowRunId}}),"failed"}}async function a(e,t){let s="u">typeof navigator?navigator.locks:void 0;if(!s)return n(e,t);try{return await s.request(`${i}${e}`,()=>n(e,t))}catch(s){return console.error("Failed to coordinate recipe import completion:",s),(0,r.captureError)(s,{flow:"recipe-import",surface:"client",operation:"import-completion-lock",extra:{recipeId:t.recipeId,workflowRunId:t.workflowRunId}}),n(e,t)}}e.s(["trackRecipeImportCompleted",0,function({recipeId:e,workflowRunId:t,sourceType:r,processAttempts:i}){let n,o,u=`${e}:${t??"legacy"}`,l=s.get(u);if(l)return l.navigationWait;let c=a(u,{recipeId:e,workflowRunId:t,sourceType:r,processAttempts:i}),h={navigationWait:(o=new Promise(e=>{n=setTimeout(e,1500)}),Promise.race([c.then(()=>void 0),o]).finally(()=>{clearTimeout(n)}))};return s.set(u,h),c.then(e=>{"failed"===e&&s.get(u)===h&&s.delete(u)}),h.navigationWait}])}]); 3 4//# debugId=2cf5d522-f85a-0545-2d00-20120d5250ac
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.