@queuedash/ui 3.12.0 → 3.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -15
- package/dist/main.js +3 -3
- package/dist/main.mjs +14 -11
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Dg=Symbol.for("react.transitional.element"),_g=Symbol.for("react.fragment");function ff(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var o in t)o!=="key"&&(n[o]=t[o])}else n=t;return t=n.ref,{$$typeof:Dg,type:e,key:r,ref:t!==void 0?t:null,props:n}}xa.Fragment=_g;xa.jsx=ff;xa.jsxs=ff;df.exports=xa;var y=df.exports,Xn=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(){}},Fg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},nn,Al,Xd,Lg=(Xd=class{constructor(){G(this,nn,Fg);G(this,Al,!1)}setTimeoutProvider(e){B(this,nn,e)}setTimeout(e,t){return C(this,nn).setTimeout(e,t)}clearTimeout(e){C(this,nn).clearTimeout(e)}setInterval(e,t){return C(this,nn).setInterval(e,t)}clearInterval(e){C(this,nn).clearInterval(e)}},nn=new WeakMap,Al=new WeakMap,Xd),Fn=new Lg;function Ig(e){setTimeout(e,0)}var Un=typeof window>"u"||"Deno"in globalThis;function Le(){}function Ng(e,t){return typeof e=="function"?e(t):e}function _s(e){return typeof e=="number"&&e>=0&&e!==1/0}function hf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gn(e,t){return typeof e=="function"?e(t):e}function ct(e,t){return typeof e=="function"?e(t):e}function Ku(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==Kl(a,t.options))return!1}else if(!Po(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function Bu(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(yn(t.options.mutationKey)!==yn(i))return!1}else if(!Po(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Kl(e,t){return((t==null?void 0:t.queryKeyHashFn)||yn)(e)}function yn(e){return JSON.stringify(e,(t,n)=>Fs(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Po(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Po(e[n],t[n])):!1}var jg=Object.prototype.hasOwnProperty;function Bl(e,t){if(e===t)return e;const n=Hu(e)&&Hu(t);if(!n&&!(Fs(e)&&Fs(t)))return t;const o=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,s=n?new Array(a):{};let l=0;for(let u=0;u<a;u++){const h=n?u:i[u],c=e[h],p=t[h];if(c===p){s[h]=c,(n?u<o:jg.call(e,h))&&l++;continue}if(c===null||p===null||typeof c!="object"||typeof p!="object"){s[h]=p;continue}const f=Bl(c,p);s[h]=f,f===c&&l++}return o===a&&l===o?e:s}function Ro(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Hu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fs(e){if(!Vu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Vu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Vu(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ag(e){return new Promise(t=>{Fn.setTimeout(t,e)})}function Ls(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Bl(e,t):t}function Kg(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Bg(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var tt=Symbol();function pf(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===tt?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gf(e,t){return typeof e=="function"?e(...t):!!e}var In,rn,Cr,Zd,Hg=(Zd=class extends Xn{constructor(){super();G(this,In);G(this,rn);G(this,Cr);B(this,Cr,t=>{if(!Un&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,rn)||this.setEventListener(C(this,Cr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,rn))==null||t.call(this),B(this,rn,void 0))}setEventListener(t){var n;B(this,Cr,t),(n=C(this,rn))==null||n.call(this),B(this,rn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,In)!==t&&(B(this,In,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,In)=="boolean"?C(this,In):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},In=new WeakMap,rn=new WeakMap,Cr=new WeakMap,Zd),Hl=new Hg;function Is(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var Vg=Ig;function zg(){let e=[],t=0,n=s=>{s()},r=s=>{s()},o=Vg;const i=s=>{t?e.push(s):o(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&o(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{i(()=>{s(...l)})},schedule:i,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{o=s}}}var be=zg(),$r,on,Sr,Jd,Ug=(Jd=class extends Xn{constructor(){super();G(this,$r,!0);G(this,on);G(this,Sr);B(this,Sr,t=>{if(!Un&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,on)||this.setEventListener(C(this,Sr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,on))==null||t.call(this),B(this,on,void 0))}setEventListener(t){var n;B(this,Sr,t),(n=C(this,on))==null||n.call(this),B(this,on,t(this.setOnline.bind(this)))}setOnline(t){C(this,$r)!==t&&(B(this,$r,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,$r)}},$r=new WeakMap,on=new WeakMap,Sr=new WeakMap,Jd),Vi=new Ug;function qg(e){return Math.min(1e3*2**e,3e4)}function mf(e){return(e??"online")==="online"?Vi.isOnline():!0}var Ns=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function vf(e){let t=!1,n=0,r;const o=Is(),i=()=>o.status!=="pending",a=m=>{var v;if(!i()){const b=new Ns(m);p(b),(v=e.onCancel)==null||v.call(e,b)}},s=()=>{t=!0},l=()=>{t=!1},u=()=>Hl.isFocused()&&(e.networkMode==="always"||Vi.isOnline())&&e.canRun(),h=()=>mf(e.networkMode)&&e.canRun(),c=m=>{i()||(r==null||r(),o.resolve(m))},p=m=>{i()||(r==null||r(),o.reject(m))},f=()=>new Promise(m=>{var v;r=b=>{(i()||u())&&m(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var m;r=void 0,i()||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(i())return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(c).catch(b=>{var E;if(i())return;const x=e.retry??(Un?0:3),w=e.retryDelay??qg,$=typeof w=="function"?w(n,b):w,k=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!k){p(b);return}n++,(E=e.onFail)==null||E.call(e,n,b),Ag($).then(()=>u()?void 0:f()).then(()=>{t?p(b):g()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(r==null||r(),o),cancelRetry:s,continueRetry:l,canStart:h,start:()=>(h()?g():f().then(g),o)}}var Nn,ef,bf=(ef=class{constructor(){G(this,Nn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_s(this.gcTime)&&B(this,Nn,Fn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Un?1/0:5*60*1e3))}clearGcTimeout(){C(this,Nn)&&(Fn.clearTimeout(C(this,Nn)),B(this,Nn,void 0))}},Nn=new WeakMap,ef),jn,Er,lt,An,Re,Ko,Kn,yt,Kt,tf,Wg=(tf=class extends bf{constructor(t){super();G(this,yt);G(this,jn);G(this,Er);G(this,lt);G(this,An);G(this,Re);G(this,Ko);G(this,Kn);B(this,Kn,!1),B(this,Ko,t.defaultOptions),this.setOptions(t.options),this.observers=[],B(this,An,t.client),B(this,lt,C(this,An).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,B(this,jn,Uu(this.options)),this.state=t.state??C(this,jn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,Re))==null?void 0:t.promise}setOptions(t){if(this.options={...C(this,Ko),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Uu(this.options);n.data!==void 0&&(this.setState(zu(n.data,n.dataUpdatedAt)),B(this,jn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,lt).remove(this)}setData(t,n){const r=Ls(this.state.data,t,this.options);return X(this,yt,Kt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){X(this,yt,Kt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=C(this,Re))==null?void 0:r.promise;return(o=C(this,Re))==null||o.cancel(t),n?n.then(Le).catch(Le):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,jn))}isActive(){return this.observers.some(t=>ct(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tt||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>gn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!hf(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Re))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Re))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,lt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,Re)&&(C(this,Kn)?C(this,Re).cancel({revert:!0}):C(this,Re).cancelRetry()),this.scheduleGc()),C(this,lt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,yt,Kt).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,h,c,p,f,g,m,v,b,x,w;if(this.state.fetchStatus!=="idle"&&((l=C(this,Re))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Re))return C(this,Re).continueRetry(),C(this,Re).promise}if(t&&this.setOptions(t),!this.options.queryFn){const $=this.observers.find(k=>k.options.queryFn);$&&this.setOptions($.options)}const r=new AbortController,o=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(B(this,Kn,!0),r.signal)})},i=()=>{const $=pf(this.options,n),E=(()=>{const R={client:C(this,An),queryKey:this.queryKey,meta:this.meta};return o(R),R})();return B(this,Kn,!1),this.options.persister?this.options.persister($,E,this):$(E)},s=(()=>{const $={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,An),state:this.state,fetchFn:i};return o($),$})();(u=this.options.behavior)==null||u.onFetch(s,this),B(this,Er,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=s.fetchOptions)==null?void 0:h.meta))&&X(this,yt,Kt).call(this,{type:"fetch",meta:(c=s.fetchOptions)==null?void 0:c.meta}),B(this,Re,vf({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,onCancel:$=>{$ instanceof Ns&&$.revert&&this.setState({...C(this,Er),fetchStatus:"idle"}),r.abort()},onFail:($,k)=>{X(this,yt,Kt).call(this,{type:"failed",failureCount:$,error:k})},onPause:()=>{X(this,yt,Kt).call(this,{type:"pause"})},onContinue:()=>{X(this,yt,Kt).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const $=await C(this,Re).start();if($===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData($),(f=(p=C(this,lt).config).onSuccess)==null||f.call(p,$,this),(m=(g=C(this,lt).config).onSettled)==null||m.call(g,$,this.state.error,this),$}catch($){if($ instanceof Ns){if($.silent)return C(this,Re).promise;if($.revert){if(this.state.data===void 0)throw $;return this.state.data}}throw X(this,yt,Kt).call(this,{type:"error",error:$}),(b=(v=C(this,lt).config).onError)==null||b.call(v,$,this),(w=(x=C(this,lt).config).onSettled)==null||w.call(x,this.state.data,$,this),$}finally{this.scheduleGc()}}},jn=new WeakMap,Er=new WeakMap,lt=new WeakMap,An=new WeakMap,Re=new WeakMap,Ko=new WeakMap,Kn=new WeakMap,yt=new WeakSet,Kt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...yf(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...zu(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return B(this,Er,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,lt).notify({query:this,type:"updated",action:t})})},tf);function yf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zu(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Uu(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ve,re,Bo,Ie,Bn,Pr,Ht,an,Ho,Rr,kr,Hn,Vn,sn,Mr,ue,ho,js,As,Ks,Bs,Hs,Vs,zs,xf,nf,Go=(nf=class extends Xn{constructor(t,n){super();G(this,ue);G(this,Ve);G(this,re);G(this,Bo);G(this,Ie);G(this,Bn);G(this,Pr);G(this,Ht);G(this,an);G(this,Ho);G(this,Rr);G(this,kr);G(this,Hn);G(this,Vn);G(this,sn);G(this,Mr,new Set);this.options=n,B(this,Ve,t),B(this,an,null),B(this,Ht,Is()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,re).addObserver(this),qu(C(this,re),this.options)?X(this,ue,ho).call(this):this.updateResult(),X(this,ue,Bs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Us(C(this,re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Us(C(this,re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,ue,Hs).call(this),X(this,ue,Vs).call(this),C(this,re).removeObserver(this)}setOptions(t){const n=this.options,r=C(this,re);if(this.options=C(this,Ve).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ct(this.options.enabled,C(this,re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");X(this,ue,zs).call(this),C(this,re).setOptions(this.options),n._defaulted&&!Ro(this.options,n)&&C(this,Ve).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,re),observer:this});const o=this.hasListeners();o&&Wu(C(this,re),r,this.options,n)&&X(this,ue,ho).call(this),this.updateResult(),o&&(C(this,re)!==r||ct(this.options.enabled,C(this,re))!==ct(n.enabled,C(this,re))||gn(this.options.staleTime,C(this,re))!==gn(n.staleTime,C(this,re)))&&X(this,ue,js).call(this);const i=X(this,ue,As).call(this);o&&(C(this,re)!==r||ct(this.options.enabled,C(this,re))!==ct(n.enabled,C(this,re))||i!==C(this,sn))&&X(this,ue,Ks).call(this,i)}getOptimisticResult(t){const n=C(this,Ve).getQueryCache().build(C(this,Ve),t),r=this.createResult(n,t);return Qg(this,r)&&(B(this,Ie,r),B(this,Pr,this.options),B(this,Bn,C(this,re).state)),r}getCurrentResult(){return C(this,Ie)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&C(this,Ht).status==="pending"&&C(this,Ht).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){C(this,Mr).add(t)}getCurrentQuery(){return C(this,re)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,Ve).defaultQueryOptions(t),r=C(this,Ve).getQueryCache().build(C(this,Ve),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return X(this,ue,ho).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Ie)))}createResult(t,n){var _;const r=C(this,re),o=this.options,i=C(this,Ie),a=C(this,Bn),s=C(this,Pr),u=t!==r?t.state:C(this,Bo),{state:h}=t;let c={...h},p=!1,f;if(n._optimisticResults){const D=this.hasListeners(),P=!D&&qu(t,n),I=D&&Wu(t,r,n,o);(P||I)&&(c={...c,...yf(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:v}=c;f=c.data;let b=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let D;i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData)?(D=i.data,b=!0):D=typeof n.placeholderData=="function"?n.placeholderData((_=C(this,kr))==null?void 0:_.state.data,C(this,kr)):n.placeholderData,D!==void 0&&(v="success",f=Ls(i==null?void 0:i.data,D,n),p=!0)}if(n.select&&f!==void 0&&!b)if(i&&f===(a==null?void 0:a.data)&&n.select===C(this,Ho))f=C(this,Rr);else try{B(this,Ho,n.select),f=n.select(f),f=Ls(i==null?void 0:i.data,f,n),B(this,Rr,f),B(this,an,null)}catch(D){B(this,an,D)}C(this,an)&&(g=C(this,an),f=C(this,Rr),m=Date.now(),v="error");const x=c.fetchStatus==="fetching",w=v==="pending",$=v==="error",k=w&&x,E=f!==void 0,M={status:v,fetchStatus:c.fetchStatus,isPending:w,isSuccess:v==="success",isError:$,isInitialLoading:k,isLoading:k,data:f,dataUpdatedAt:c.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:$&&!E,isPaused:c.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:$&&E,isStale:Vl(t,n),refetch:this.refetch,promise:C(this,Ht),isEnabled:ct(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=N=>{M.status==="error"?N.reject(M.error):M.data!==void 0&&N.resolve(M.data)},P=()=>{const N=B(this,Ht,M.promise=Is());D(N)},I=C(this,Ht);switch(I.status){case"pending":t.queryHash===r.queryHash&&D(I);break;case"fulfilled":(M.status==="error"||M.data!==I.value)&&P();break;case"rejected":(M.status!=="error"||M.error!==I.reason)&&P();break}}return M}updateResult(){const t=C(this,Ie),n=this.createResult(C(this,re),this.options);if(B(this,Bn,C(this,re).state),B(this,Pr,this.options),C(this,Bn).data!==void 0&&B(this,kr,C(this,re)),Ro(n,t))return;B(this,Ie,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!C(this,Mr).size)return!0;const a=new Set(i??C(this,Mr));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,Ie)).some(s=>{const l=s;return C(this,Ie)[l]!==t[l]&&a.has(l)})};X(this,ue,xf).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,ue,Bs).call(this)}},Ve=new WeakMap,re=new WeakMap,Bo=new WeakMap,Ie=new WeakMap,Bn=new WeakMap,Pr=new WeakMap,Ht=new WeakMap,an=new WeakMap,Ho=new WeakMap,Rr=new WeakMap,kr=new WeakMap,Hn=new WeakMap,Vn=new WeakMap,sn=new WeakMap,Mr=new WeakMap,ue=new WeakSet,ho=function(t){X(this,ue,zs).call(this);let n=C(this,re).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Le)),n},js=function(){X(this,ue,Hs).call(this);const t=gn(this.options.staleTime,C(this,re));if(Un||C(this,Ie).isStale||!_s(t))return;const r=hf(C(this,Ie).dataUpdatedAt,t)+1;B(this,Hn,Fn.setTimeout(()=>{C(this,Ie).isStale||this.updateResult()},r))},As=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,re)):this.options.refetchInterval)??!1},Ks=function(t){X(this,ue,Vs).call(this),B(this,sn,t),!(Un||ct(this.options.enabled,C(this,re))===!1||!_s(C(this,sn))||C(this,sn)===0)&&B(this,Vn,Fn.setInterval(()=>{(this.options.refetchIntervalInBackground||Hl.isFocused())&&X(this,ue,ho).call(this)},C(this,sn)))},Bs=function(){X(this,ue,js).call(this),X(this,ue,Ks).call(this,X(this,ue,As).call(this))},Hs=function(){C(this,Hn)&&(Fn.clearTimeout(C(this,Hn)),B(this,Hn,void 0))},Vs=function(){C(this,Vn)&&(Fn.clearInterval(C(this,Vn)),B(this,Vn,void 0))},zs=function(){const t=C(this,Ve).getQueryCache().build(C(this,Ve),this.options);if(t===C(this,re))return;const n=C(this,re);B(this,re,t),B(this,Bo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},xf=function(t){be.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,Ie))}),C(this,Ve).getQueryCache().notify({query:C(this,re),type:"observerResultsUpdated"})})},nf);function Gg(e,t){return ct(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qu(e,t){return Gg(e,t)||e.state.data!==void 0&&Us(e,t,t.refetchOnMount)}function Us(e,t,n){if(ct(t.enabled,e)!==!1&&gn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Vl(e,t)}return!1}function Wu(e,t,n,r){return(e!==t||ct(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Vl(e,n)}function Vl(e,t){return ct(t.enabled,e)!==!1&&e.isStaleByTime(gn(t.staleTime,e))}function Qg(e,t){return!Ro(e.getCurrentResult(),t)}function zi(e){return{onFetch:(t,n)=>{var h,c,p,f,g;const r=t.options,o=(p=(c=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:c.fetchMore)==null?void 0:p.direction,i=((f=t.state.data)==null?void 0:f.pages)||[],a=((g=t.state.data)==null?void 0:g.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},b=pf(t.options,t.fetchOptions),x=async(w,$,k)=>{if(m)return Promise.reject();if($==null&&w.pages.length)return Promise.resolve(w);const R=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:$,direction:k?"backward":"forward",meta:t.options.meta};return v(P),P})(),M=await b(R),{maxPages:_}=t.options,D=k?Bg:Kg;return{pages:D(w.pages,M,_),pageParams:D(w.pageParams,$,_)}};if(o&&i.length){const w=o==="backward",$=w?wf:qs,k={pages:i,pageParams:a},E=$(r,k);s=await x(k,E,w)}else{const w=e??i.length;do{const $=l===0?a[0]??r.initialPageParam:qs(r,s);if(l>0&&$==null)break;s=await x(s,$),l++}while(l<w)}return s};t.options.persister?t.fetchFn=()=>{var m,v;return(v=(m=t.options).persister)==null?void 0:v.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function qs(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wf(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function Yg(e,t){return t?qs(e,t)!=null:!1}function Xg(e,t){return!t||!e.getPreviousPageParam?!1:wf(e,t)!=null}var Cf=class extends Go{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:zi()})}getOptimisticResult(e){return e.behavior=zi(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var g,m;const{state:n}=e,r=super.createResult(e,t),{isFetching:o,isRefetching:i,isError:a,isRefetchError:s}=r,l=(m=(g=n.fetchMeta)==null?void 0:g.fetchMore)==null?void 0:m.direction,u=a&&l==="forward",h=o&&l==="forward",c=a&&l==="backward",p=o&&l==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Yg(t,n.data),hasPreviousPage:Xg(t,n.data),isFetchNextPageError:u,isFetchingNextPage:h,isFetchPreviousPageError:c,isFetchingPreviousPage:p,isRefetchError:s&&!u&&!c,isRefetching:i&&!h&&!p}}},Vo,Tt,Ne,zn,Dt,en,rf,Zg=(rf=class extends bf{constructor(t){super();G(this,Dt);G(this,Vo);G(this,Tt);G(this,Ne);G(this,zn);B(this,Vo,t.client),this.mutationId=t.mutationId,B(this,Ne,t.mutationCache),B(this,Tt,[]),this.state=t.state||$f(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Tt).includes(t)||(C(this,Tt).push(t),this.clearGcTimeout(),C(this,Ne).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){B(this,Tt,C(this,Tt).filter(n=>n!==t)),this.scheduleGc(),C(this,Ne).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Tt).length||(this.state.status==="pending"?this.scheduleGc():C(this,Ne).remove(this))}continue(){var t;return((t=C(this,zn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,s,l,u,h,c,p,f,g,m,v,b,x,w,$,k,E,R,M,_;const n=()=>{X(this,Dt,en).call(this,{type:"continue"})},r={client:C(this,Vo),meta:this.options.meta,mutationKey:this.options.mutationKey};B(this,zn,vf({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(D,P)=>{X(this,Dt,en).call(this,{type:"failed",failureCount:D,error:P})},onPause:()=>{X(this,Dt,en).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Ne).canRun(this)}));const o=this.state.status==="pending",i=!C(this,zn).canStart();try{if(o)n();else{X(this,Dt,en).call(this,{type:"pending",variables:t,isPaused:i}),await((s=(a=C(this,Ne).config).onMutate)==null?void 0:s.call(a,t,this,r));const P=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,r));P!==this.state.context&&X(this,Dt,en).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const D=await C(this,zn).start();return await((c=(h=C(this,Ne).config).onSuccess)==null?void 0:c.call(h,D,t,this.state.context,this,r)),await((f=(p=this.options).onSuccess)==null?void 0:f.call(p,D,t,this.state.context,r)),await((m=(g=C(this,Ne).config).onSettled)==null?void 0:m.call(g,D,null,this.state.variables,this.state.context,this,r)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,D,null,t,this.state.context,r)),X(this,Dt,en).call(this,{type:"success",data:D}),D}catch(D){try{throw await((w=(x=C(this,Ne).config).onError)==null?void 0:w.call(x,D,t,this.state.context,this,r)),await((k=($=this.options).onError)==null?void 0:k.call($,D,t,this.state.context,r)),await((R=(E=C(this,Ne).config).onSettled)==null?void 0:R.call(E,void 0,D,this.state.variables,this.state.context,this,r)),await((_=(M=this.options).onSettled)==null?void 0:_.call(M,void 0,D,t,this.state.context,r)),D}finally{X(this,Dt,en).call(this,{type:"error",error:D})}}finally{C(this,Ne).runNext(this)}}},Vo=new WeakMap,Tt=new WeakMap,Ne=new WeakMap,zn=new WeakMap,Dt=new WeakSet,en=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),be.batch(()=>{C(this,Tt).forEach(r=>{r.onMutationUpdate(t)}),C(this,Ne).notify({mutation:this,type:"updated",action:t})})},rf);function $f(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vt,xt,zo,of,Jg=(of=class extends Xn{constructor(t={}){super();G(this,Vt);G(this,xt);G(this,zo);this.config=t,B(this,Vt,new Set),B(this,xt,new Map),B(this,zo,0)}build(t,n,r){const o=new Zg({client:t,mutationCache:this,mutationId:++ui(this,zo)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){C(this,Vt).add(t);const n=ci(t);if(typeof n=="string"){const r=C(this,xt).get(n);r?r.push(t):C(this,xt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,Vt).delete(t)){const n=ci(t);if(typeof n=="string"){const r=C(this,xt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&C(this,xt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ci(t);if(typeof n=="string"){const r=C(this,xt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=ci(t);if(typeof n=="string"){const o=(r=C(this,xt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){be.batch(()=>{C(this,Vt).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,Vt).clear(),C(this,xt).clear()})}getAll(){return Array.from(C(this,Vt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Bu(n,r))}findAll(t={}){return this.getAll().filter(n=>Bu(t,n))}notify(t){be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return be.batch(()=>Promise.all(t.map(n=>n.continue().catch(Le))))}},Vt=new WeakMap,xt=new WeakMap,zo=new WeakMap,of);function ci(e){var t;return(t=e.options.scope)==null?void 0:t.id}var zt,ln,ze,Ut,Wt,Li,Ws,af,em=(af=class extends Xn{constructor(n,r){super();G(this,Wt);G(this,zt);G(this,ln);G(this,ze);G(this,Ut);B(this,zt,n),this.setOptions(r),this.bindMethods(),X(this,Wt,Li).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=C(this,zt).defaultMutationOptions(n),Ro(this.options,r)||C(this,zt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,ze),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&yn(r.mutationKey)!==yn(this.options.mutationKey)?this.reset():((o=C(this,ze))==null?void 0:o.state.status)==="pending"&&C(this,ze).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,ze))==null||n.removeObserver(this)}onMutationUpdate(n){X(this,Wt,Li).call(this),X(this,Wt,Ws).call(this,n)}getCurrentResult(){return C(this,ln)}reset(){var n;(n=C(this,ze))==null||n.removeObserver(this),B(this,ze,void 0),X(this,Wt,Li).call(this),X(this,Wt,Ws).call(this)}mutate(n,r){var o;return B(this,Ut,r),(o=C(this,ze))==null||o.removeObserver(this),B(this,ze,C(this,zt).getMutationCache().build(C(this,zt),this.options)),C(this,ze).addObserver(this),C(this,ze).execute(n)}},zt=new WeakMap,ln=new WeakMap,ze=new WeakMap,Ut=new WeakMap,Wt=new WeakSet,Li=function(){var r;const n=((r=C(this,ze))==null?void 0:r.state)??$f();B(this,ln,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ws=function(n){be.batch(()=>{var r,o,i,a,s,l,u,h;if(C(this,Ut)&&this.hasListeners()){const c=C(this,ln).variables,p=C(this,ln).context,f={client:C(this,zt),meta:this.options.meta,mutationKey:this.options.mutationKey};(n==null?void 0:n.type)==="success"?((o=(r=C(this,Ut)).onSuccess)==null||o.call(r,n.data,c,p,f),(a=(i=C(this,Ut)).onSettled)==null||a.call(i,n.data,null,c,p,f)):(n==null?void 0:n.type)==="error"&&((l=(s=C(this,Ut)).onError)==null||l.call(s,n.error,c,p,f),(h=(u=C(this,Ut)).onSettled)==null||h.call(u,void 0,n.error,c,p,f))}this.listeners.forEach(c=>{c(C(this,ln))})})},af);function Gu(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function tm(e,t,n){const r=e.slice(0);return r[t]=n,r}var Or,Je,Tr,Dr,ut,un,Uo,qo,Wo,De,Gs,Qs,Ys,Xs,Zs,sf,nm=(sf=class extends Xn{constructor(t,n,r){super();G(this,De);G(this,Or);G(this,Je);G(this,Tr);G(this,Dr);G(this,ut);G(this,un);G(this,Uo);G(this,qo);G(this,Wo,[]);B(this,Or,t),B(this,Dr,r),B(this,Tr,[]),B(this,ut,[]),B(this,Je,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&C(this,ut).forEach(t=>{t.subscribe(n=>{X(this,De,Xs).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,C(this,ut).forEach(t=>{t.destroy()})}setQueries(t,n){B(this,Tr,t),B(this,Dr,n),be.batch(()=>{const r=C(this,ut),o=X(this,De,Ys).call(this,C(this,Tr));B(this,Wo,o),o.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=o.map(c=>c.observer),a=i.map(c=>c.getCurrentResult()),s=r.length!==i.length,l=i.some((c,p)=>c!==r[p]),u=s||l,h=u?!0:a.some((c,p)=>{const f=C(this,Je)[p];return!f||!Ro(c,f)});!u&&!h||(u&&B(this,ut,i),B(this,Je,a),this.hasListeners()&&(u&&(Gu(r,i).forEach(c=>{c.destroy()}),Gu(i,r).forEach(c=>{c.subscribe(p=>{X(this,De,Xs).call(this,c,p)})})),X(this,De,Zs).call(this)))})}getCurrentResult(){return C(this,Je)}getQueries(){return C(this,ut).map(t=>t.getCurrentQuery())}getObservers(){return C(this,ut)}getOptimisticResult(t,n){const r=X(this,De,Ys).call(this,t),o=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[o,i=>X(this,De,Qs).call(this,i??o,n),()=>X(this,De,Gs).call(this,o,r)]}},Or=new WeakMap,Je=new WeakMap,Tr=new WeakMap,Dr=new WeakMap,ut=new WeakMap,un=new WeakMap,Uo=new WeakMap,qo=new WeakMap,Wo=new WeakMap,De=new WeakSet,Gs=function(t,n){return n.map((r,o)=>{const i=t[o];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,a=>{n.forEach(s=>{s.observer.trackProp(a)})})})},Qs=function(t,n){return n?((!C(this,un)||C(this,Je)!==C(this,qo)||n!==C(this,Uo))&&(B(this,Uo,n),B(this,qo,C(this,Je)),B(this,un,Bl(C(this,un),n(t)))),C(this,un)):t},Ys=function(t){const n=new Map(C(this,ut).map(o=>[o.options.queryHash,o])),r=[];return t.forEach(o=>{const i=C(this,Or).defaultQueryOptions(o),a=n.get(i.queryHash);a?r.push({defaultedQueryOptions:i,observer:a}):r.push({defaultedQueryOptions:i,observer:new Go(C(this,Or),i)})}),r},Xs=function(t,n){const r=C(this,ut).indexOf(t);r!==-1&&(B(this,Je,tm(C(this,Je),r,n)),X(this,De,Zs).call(this))},Zs=function(){var t;if(this.hasListeners()){const n=C(this,un),r=X(this,De,Gs).call(this,C(this,Je),C(this,Wo)),o=X(this,De,Qs).call(this,r,(t=C(this,Dr))==null?void 0:t.combine);n!==o&&be.batch(()=>{this.listeners.forEach(i=>{i(C(this,Je))})})}},sf),_t,lf,rm=(lf=class extends Xn{constructor(t={}){super();G(this,_t);this.config=t,B(this,_t,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Kl(o,n);let a=this.get(i);return a||(a=new Wg({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){C(this,_t).has(t.queryHash)||(C(this,_t).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,_t).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,_t).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,_t).get(t)}getAll(){return[...C(this,_t).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ku(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ku(t,r)):n}notify(t){be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){be.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){be.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},_t=new WeakMap,lf),ve,cn,dn,_r,Fr,fn,Lr,Ir,uf,om=(uf=class{constructor(e={}){G(this,ve);G(this,cn);G(this,dn);G(this,_r);G(this,Fr);G(this,fn);G(this,Lr);G(this,Ir);B(this,ve,e.queryCache||new rm),B(this,cn,e.mutationCache||new Jg),B(this,dn,e.defaultOptions||{}),B(this,_r,new Map),B(this,Fr,new Map),B(this,fn,0)}mount(){ui(this,fn)._++,C(this,fn)===1&&(B(this,Lr,Hl.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,ve).onFocus())})),B(this,Ir,Vi.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,ve).onOnline())})))}unmount(){var e,t;ui(this,fn)._--,C(this,fn)===0&&((e=C(this,Lr))==null||e.call(this),B(this,Lr,void 0),(t=C(this,Ir))==null||t.call(this),B(this,Ir,void 0))}isFetching(e){return C(this,ve).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,cn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,ve).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,ve).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(gn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,ve).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=C(this,ve).get(r.queryHash),i=o==null?void 0:o.state.data,a=Ng(t,i);if(a!==void 0)return C(this,ve).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return be.batch(()=>C(this,ve).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,ve).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,ve);be.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,ve);return be.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=be.batch(()=>C(this,ve).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Le).catch(Le)}invalidateQueries(e,t={}){return be.batch(()=>(C(this,ve).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=be.batch(()=>C(this,ve).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Le)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Le)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,ve).build(this,t);return n.isStaleByTime(gn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Le).catch(Le)}fetchInfiniteQuery(e){return e.behavior=zi(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Le).catch(Le)}ensureInfiniteQueryData(e){return e.behavior=zi(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vi.isOnline()?C(this,cn).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,ve)}getMutationCache(){return C(this,cn)}getDefaultOptions(){return C(this,dn)}setDefaultOptions(e){B(this,dn,e)}setQueryDefaults(e,t){C(this,_r).set(yn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,_r).values()],n={};return t.forEach(r=>{Po(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,Fr).set(yn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,Fr).values()],n={};return t.forEach(r=>{Po(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,dn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Kl(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===tt&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,dn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,ve).clear(),C(this,cn).clear()}},ve=new WeakMap,cn=new WeakMap,dn=new WeakMap,_r=new WeakMap,Fr=new WeakMap,fn=new WeakMap,Lr=new WeakMap,Ir=new WeakMap,uf),Sf=S.createContext(void 0),Qo=e=>{const t=S.useContext(Sf);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},im=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(Sf.Provider,{value:e,children:t})),Ef=S.createContext(!1),Pf=()=>S.useContext(Ef);Ef.Provider;function am(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var sm=S.createContext(am()),Rf=()=>S.useContext(sm),kf=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Mf=e=>{S.useEffect(()=>{e.clearReset()},[e])},Of=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||gf(n,[e.error,r])),zl=(e,t)=>t.state.data===void 0,Tf=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Df=(e,t)=>e.isLoading&&e.isFetching&&!t,Js=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ui=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _f({queries:e,...t},n){const r=Qo(n),o=Pf(),i=Rf(),a=S.useMemo(()=>e.map(m=>{const v=r.defaultQueryOptions(m);return v._optimisticResults=o?"isRestoring":"optimistic",v}),[e,r,o]);a.forEach(m=>{Tf(m),kf(m,i)}),Mf(i);const[s]=S.useState(()=>new nm(r,a,t)),[l,u,h]=s.getOptimisticResult(a,t.combine),c=!o&&t.subscribed!==!1;S.useSyncExternalStore(S.useCallback(m=>c?s.subscribe(be.batchCalls(m)):Le,[s,c]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),S.useEffect(()=>{s.setQueries(a,t)},[a,t,s]);const f=l.some((m,v)=>Js(a[v],m))?l.flatMap((m,v)=>{const b=a[v];if(b){const x=new Go(r,b);if(Js(b,m))return Ui(b,x,i);Df(m,o)&&Ui(b,x,i)}return[]}):[];if(f.length>0)throw Promise.all(f);const g=l.find((m,v)=>{const b=a[v];return b&&Of({result:m,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g!=null&&g.error)throw g.error;return u(h())}function wa(e,t,n){var c,p,f,g,m;const r=Pf(),o=Rf(),i=Qo(n),a=i.defaultQueryOptions(e);(p=(c=i.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||p.call(c,a),a._optimisticResults=r?"isRestoring":"optimistic",Tf(a),kf(a,o),Mf(o);const s=!i.getQueryCache().get(a.queryHash),[l]=S.useState(()=>new t(i,a)),u=l.getOptimisticResult(a),h=!r&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(v=>{const b=h?l.subscribe(be.batchCalls(v)):Le;return l.updateResult(),b},[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setOptions(a)},[a,l]),Js(a,u))throw Ui(a,l,o);if(Of({result:u,errorResetBoundary:o,throwOnError:a.throwOnError,query:i.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((g=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||g.call(f,a,u),a.experimental_prefetchInRender&&!Un&&Df(u,r)){const v=s?Ui(a,l,o):(m=i.getQueryCache().get(a.queryHash))==null?void 0:m.promise;v==null||v.catch(Le).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function lm(e,t){return wa(e,Go,t)}function um(e,t){return wa({...e,enabled:!0,suspense:!0,throwOnError:zl,placeholderData:void 0},Go,t)}function cm(e,t){return wa({...e,enabled:!0,suspense:!0,throwOnError:zl},Cf,t)}function dm(e,t){return _f({...e,queries:e.queries.map(n=>({...n,suspense:!0,throwOnError:zl,enabled:!0,placeholderData:void 0}))},t)}function fm(e,t){const n=Qo(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function hm(e,t){const n=Qo(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function pm(e,t){const n=Qo(t),[r]=S.useState(()=>new em(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const o=S.useSyncExternalStore(S.useCallback(a=>r.subscribe(be.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=S.useCallback((a,s)=>{r.mutate(a,s).catch(Le)},[r]);if(o.error&&gf(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}function gm(e,t){return wa(e,Cf,t)}var mm=Object.create,Ff=Object.defineProperty,vm=Object.getOwnPropertyDescriptor,Lf=Object.getOwnPropertyNames,bm=Object.getPrototypeOf,ym=Object.prototype.hasOwnProperty,Lt=(e,t)=>function(){return t||(0,e[Lf(e)[0]])((t={exports:{}}).exports,t),t.exports},xm=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Lf(t),i=0,a=o.length,s;i<a;i++)s=o[i],!ym.call(e,s)&&s!==n&&Ff(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(r=vm(t,s))||r.enumerable});return e},we=(e,t,n)=>(n=e!=null?mm(bm(e)):{},xm(Ff(n,"default",{value:e,enumerable:!0}),e)),If=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(r){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t.exports.__esModule=!0,t.exports.default=t.exports,n(r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),wm=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=If().default;function r(o,i){if(n(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var s=a.call(o,i||"default");if(n(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Cm=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=If().default,r=wm();function o(i){var a=r(i,"string");return n(a)=="symbol"?a:a+""}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}}),Zn=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Cm();function r(o,i,a){return(i=n(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),St=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Zn();function r(i,a){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);a&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),s.push.apply(s,l)}return s}function o(i){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?r(Object(s),!0).forEach(function(l){n(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}});function Ca(e){const t={subscribe(n){let r=null,o=!1,i=!1,a=!1;function s(){if(r===null){a=!0;return}i||(i=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var u;o||(u=n.next)===null||u===void 0||u.call(n,l)},error(l){var u;o||(o=!0,(u=n.error)===null||u===void 0||u.call(n,l),s())},complete(){var l;o||(o=!0,(l=n.complete)===null||l===void 0||l.call(n),s())}}),a&&s(),{unsubscribe:s}},pipe(...n){return n.reduce($m,t)}};return t}function $m(e,t){return t(e)}function Sm(e){const t=new AbortController;return new Promise((r,o)=>{let i=!1;function a(){i||(i=!0,s.unsubscribe())}t.signal.addEventListener("abort",()=>{o(t.signal.reason)});const s=e.subscribe({next(l){i=!0,r(l),a()},error(l){o(l)},complete(){t.abort(),a()}})})}function Em(e){return t=>{let n=0,r=null;const o=[];function i(){r||(r=t.subscribe({next(s){for(const u of o){var l;(l=u.next)===null||l===void 0||l.call(u,s)}},error(s){for(const u of o){var l;(l=u.error)===null||l===void 0||l.call(u,s)}},complete(){for(const l of o){var s;(s=l.complete)===null||s===void 0||s.call(l)}}}))}function a(){if(n===0&&r){const s=r;r=null,s.unsubscribe()}}return Ca(s=>(n++,o.push(s),i(),{unsubscribe(){n--,a();const l=o.findIndex(u=>u===s);l>-1&&o.splice(l,1)}}))}}function Pm(e){let t=e;const n=[],r=a=>{t!==void 0&&a.next(t),n.push(a)},o=a=>{n.splice(n.indexOf(a),1)},i=Ca(a=>(r(a),()=>{o(a)}));return i.next=a=>{if(t!==a){t=a;for(const s of n)s.next(a)}},i.get=()=>t,i}function Rm(e){return Ca(t=>{function n(o=0,i=e.op){const a=e.links[o];if(!a)throw new Error("No more links to execute - did you forget to add an ending link?");return a({op:i,next(l){return n(o+1,l)}})}return n().subscribe(t)})}function qn(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const km=typeof Symbol=="function"&&!!Symbol.asyncIterator;function Nf(e){return km&&qn(e)&&Symbol.asyncIterator in e}var Mm=Object.create,jf=Object.defineProperty,Om=Object.getOwnPropertyDescriptor,Af=Object.getOwnPropertyNames,Tm=Object.getPrototypeOf,Dm=Object.prototype.hasOwnProperty,Yo=(e,t)=>function(){return t||(0,e[Af(e)[0]])((t={exports:{}}).exports,t),t.exports},_m=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Af(t),i=0,a=o.length,s;i<a;i++)s=o[i],!Dm.call(e,s)&&s!==n&&jf(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(r=Om(t,s))||r.enumerable});return e},$a=(e,t,n)=>(n=e!=null?Mm(Tm(e)):{},_m(jf(n,"default",{value:e,enumerable:!0}),e));const Kf=()=>{},Qu=e=>{Object.freeze&&Object.freeze(e)};function Bf(e,t,n){var r;const o=t.join(".");return(r=n[o])!==null&&r!==void 0||(n[o]=new Proxy(Kf,{get(i,a){if(!(typeof a!="string"||a==="then"))return Bf(e,[...t,a],n)},apply(i,a,s){const l=t[t.length-1];let u={args:s,path:t};return l==="call"?u={args:s.length>=2?[s[1]]:[],path:t.slice(0,-1)}:l==="apply"&&(u={args:s.length>=2?s[1]:[],path:t.slice(0,-1)}),Qu(u.args),Qu(u.path),e(u)}})),n[o]}const Sa=e=>Bf(e,[],Object.create(null)),Ul=e=>new Proxy(Kf,{get(t,n){if(n!=="then")return e(n)}});var Hf=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(r){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t.exports.__esModule=!0,t.exports.default=t.exports,n(r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Fm=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Hf().default;function r(o,i){if(n(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var s=a.call(o,i||"default");if(n(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Lm=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Hf().default,r=Fm();function o(i){var a=r(i,"string");return n(a)=="symbol"?a:a+""}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}}),Vf=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Lm();function r(o,i,a){return(i=n(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),ql=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Vf();function r(i,a){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);a&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),s.push.apply(s,l)}return s}function o(i){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?r(Object(s),!0).forEach(function(l){n(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}});$a(ql());$a(Vf());var di=$a(ql());function Im(e,t){if("error"in e){const r=t.deserialize(e.error);return{ok:!1,error:(0,di.default)((0,di.default)({},e),{},{error:r})}}return{ok:!0,result:(0,di.default)((0,di.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Qa=class extends Error{constructor(){super("Unable to transform response from server")}};function Nm(e,t){let n;try{n=Im(e,t)}catch{throw new Qa}if(!n.ok&&(!qn(n.error.error)||typeof n.error.error.code!="number"))throw new Qa;if(n.ok&&!qn(n.result))throw new Qa;return n}$a(ql());var fi=we(Zn()),ar=we(St());function jm(e){return e instanceof qi}function Am(e){return qn(e)&&qn(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Km(e,t){return typeof e=="string"?e:qn(e)&&typeof e.message=="string"?e.message:t}var qi=class Ii extends Error{constructor(t,n){var r,o;const i=n==null?void 0:n.cause;super(t,{cause:i}),(0,fi.default)(this,"cause",void 0),(0,fi.default)(this,"shape",void 0),(0,fi.default)(this,"data",void 0),(0,fi.default)(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=i,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(o=n.result)===null||o===void 0?void 0:o.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ii.prototype)}static from(t,n={}){const r=t;return jm(r)?(n.meta&&(r.meta=(0,ar.default)((0,ar.default)({},r.meta),n.meta)),r):Am(r)?new Ii(r.error.message,(0,ar.default)((0,ar.default)({},n),{},{result:r})):new Ii(Km(r,"Unknown error"),(0,ar.default)((0,ar.default)({},n),{},{cause:r}))}};function Bm(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const Yu=e=>typeof e=="function";function Hm(e){if(e)return e;if(typeof window<"u"&&Yu(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Yu(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var bo=we(St());function Vm(e){return{url:e.url.toString(),fetch:e.fetch,transformer:Bm(e.transformer),methodOverride:e.methodOverride}}function zm(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const Um={query:"GET",mutation:"POST",subscription:"PATCH"};function zf(e){return"input"in e?e.transformer.input.serialize(e.input):zm(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Uf=e=>{const t=e.url.split("?");let r=t[0].replace(/\/$/,"")+"/"+e.path;const o=[];if(t[1]&&o.push(t[1]),"inputs"in e&&o.push("batch=1"),e.type==="query"||e.type==="subscription"){const i=zf(e);i!==void 0&&e.methodOverride!=="POST"&&o.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return o.length&&(r+="?"+o.join("&")),r},qm=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=zf(e);return t!==void 0?JSON.stringify(t):void 0},Wm=e=>Xm((0,bo.default)((0,bo.default)({},e),{},{contentTypeHeader:"application/json",getUrl:Uf,getBody:qm}));var Gm=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Qm=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Gm};async function Ym(e){var t;Qm(e.signal);const n=e.getUrl(e),r=e.getBody(e),o=(t=e.methodOverride)!==null&&t!==void 0?t:Um[e.type],i=await(async()=>{const s=await e.headers();return Symbol.iterator in s?Object.fromEntries(s):s})(),a=(0,bo.default)((0,bo.default)((0,bo.default)({},e.contentTypeHeader&&o!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0),i);return Hm(e.fetch)(n,{method:o,signal:e.signal,body:r,headers:a})}async function Xm(e){const t={},n=await Ym(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}we(St());const Xu=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Zu(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function o(s){const l=[[]];let u=0;for(;;){const p=s[u];if(!p)break;const f=l[l.length-1];if(p.aborted){var h;(h=p.reject)===null||h===void 0||h.call(p,new Error("Aborted")),u++;continue}if(e.validate(f.concat(p).map(m=>m.key))){f.push(p),u++;continue}if(f.length===0){var c;(c=p.reject)===null||c===void 0||c.call(p,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function i(){const s=o(t);r();for(const l of s){if(!l.length)continue;const u={items:l};for(const c of l)c.batch=u;e.fetch(u.items.map(c=>c.key)).then(async c=>{await Promise.all(c.map(async(f,g)=>{const m=u.items[g];try{var v;const x=await Promise.resolve(f);(v=m.resolve)===null||v===void 0||v.call(m,x)}catch(x){var b;(b=m.reject)===null||b===void 0||b.call(m,x)}m.batch=null,m.reject=null,m.resolve=null}));for(const f of u.items){var p;(p=f.reject)===null||p===void 0||p.call(f,new Error("Missing result")),f.batch=null}}).catch(c=>{for(const f of u.items){var p;(p=f.reject)===null||p===void 0||p.call(f,c),f.batch=null}})}}function a(s){var l;const u={aborted:!1,key:s,batch:null,resolve:Xu,reject:Xu},h=new Promise((c,p)=>{var f;u.reject=p,u.resolve=c,(f=t)!==null&&f!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(i)),h}return{load:a}}function Zm(...e){const t=new AbortController,n=e.length;let r=0;const o=()=>{++r===n&&t.abort()};for(const i of e)i!=null&&i.aborted?o():i==null||i.addEventListener("abort",o,{once:!0});return t.signal}var hi=we(St());function Jm(e){var t,n;const r=Vm(e),o=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,i=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const a=h=>({validate(c){if(o===1/0&&i===1/0)return!0;if(c.length>i)return!1;const p=c.map(m=>m.path).join(","),f=c.map(m=>m.input);return Uf((0,hi.default)((0,hi.default)({},r),{},{type:h,path:p,inputs:f,signal:null})).length<=o},async fetch(c){const p=c.map(x=>x.path).join(","),f=c.map(x=>x.input),g=Zm(...c.map(x=>x.signal)),m=await Wm((0,hi.default)((0,hi.default)({},r),{},{path:p,inputs:f,type:h,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:c}):e.headers:{}},signal:g}));return(Array.isArray(m.json)?m.json:c.map(()=>m.json)).map(x=>({meta:m.meta,json:x}))}}),s=Zu(a("query")),l=Zu(a("mutation")),u={query:s,mutation:l};return({op:h})=>Ca(c=>{/* istanbul ignore if -- @preserve */if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const f=u[h.type].load(h);let g;return f.then(m=>{g=m;const v=Nm(m.json,r.transformer.output);if(!v.ok){c.error(qi.from(v.error,{meta:m.meta}));return}c.next({context:m.meta,result:v.result}),c.complete()}).catch(m=>{c.error(qi.from(m,{meta:g==null?void 0:g.meta}))}),()=>{}})}}we(St());const qf=(e,...t)=>typeof e=="function"?e(...t):e;we(Zn());function ev(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}async function tv(e){const t=await qf(e.url);if(!e.connectionParams)return t;const r=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+r}async function nv(e){const t={method:"connectionParams",data:await qf(e)};return JSON.stringify(t)}we(Zn());var Dn=we(Zn());function rv(e){const{promise:t,resolve:n,reject:r}=ev();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function ov(e,{intervalMs:t,pongTimeoutMs:n}){let r,o;function i(){r=setTimeout(()=>{e.send("PING"),o=setTimeout(()=>{e.close()},n)},t)}function a(){clearTimeout(r),i()}function s(){clearTimeout(o),a()}e.addEventListener("open",i),e.addEventListener("message",({data:l})=>{clearTimeout(r),i(),l==="PONG"&&s()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(o)})}var iv=class el{constructor(t){var n;if((0,Dn.default)(this,"id",++el.connectCount),(0,Dn.default)(this,"WebSocketPonyfill",void 0),(0,Dn.default)(this,"urlOptions",void 0),(0,Dn.default)(this,"keepAliveOpts",void 0),(0,Dn.default)(this,"wsObservable",Pm(null)),(0,Dn.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++el.connectCount;const n=tv(t.urlOptions).then(r=>new t.WebSocketPonyfill(r));t.openPromise=n.then(async r=>{t.ws=r,r.addEventListener("message",function({data:o}){o==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&ov(r,t.keepAliveOpts),r.addEventListener("close",()=>{t.ws===r&&(t.ws=null)}),await rv(r),t.urlOptions.connectionParams&&r.send(await nv(t.urlOptions.connectionParams))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var n;(n=t.ws)===null||n===void 0||n.close()}}};(0,Dn.default)(iv,"connectCount",0);we(Zn());we(St());var Ya=we(Zn()),Ju=we(St()),Ea=class{constructor(e){(0,Ya.default)(this,"links",void 0),(0,Ya.default)(this,"runtime",void 0),(0,Ya.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Rm({links:this.links,op:(0,Ju.default)((0,Ju.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Em())}async requestAsPromise(e){var t=this;try{const n=t.$request(e);return(await Sm(n)).result.data}catch(n){throw qi.from(n)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(o){switch(o.result.type){case"state":{var i;(i=n.onConnectionStateChange)===null||i===void 0||i.call(n,o.result);break}case"started":{var a;(a=n.onStarted)===null||a===void 0||a.call(n,{context:o.context});break}case"stopped":{var s;(s=n.onStopped)===null||s===void 0||s.call(n);break}case"data":case void 0:{var l;(l=n.onData)===null||l===void 0||l.call(n,o.result.data);break}}},error(o){var i;(i=n.onError)===null||i===void 0||i.call(n,o)},complete(){var o;(o=n.onComplete)===null||o===void 0||o.call(n)}})}};const Wf=Symbol.for("trpc_untypedClient"),av={query:"query",mutate:"mutation",subscribe:"subscription"},sv=e=>av[e];function Gf(e){const t=Sa(({path:n,args:r})=>{const o=[...n],i=sv(o.pop()),a=o.join(".");return e[i](a,...r)});return Ul(n=>n===Wf?e:t[n])}function lv(e){const t=new Ea(e);return Gf(t)}function Wl(e){return e[Wf]}we(St());we(St());var uv=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(o){var i,a,s,l=2;for(typeof Symbol<"u"&&(a=Symbol.asyncIterator,s=Symbol.iterator);l--;){if(a&&(i=o[a])!=null)return i.call(o);if(s&&(i=o[s])!=null)return new r(i.call(o));a="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function r(o){function i(a){if(Object(a)!==a)return Promise.reject(new TypeError(a+" is not an object."));var s=a.done;return Promise.resolve(a.value).then(function(l){return{value:l,done:s}})}return r=function(s){this.s=s,this.n=s.next},r.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(s){var l=this.s.return;return l===void 0?Promise.resolve({value:s,done:!0}):i(l.apply(this.s,arguments))},throw:function(s){var l=this.s.return;return l===void 0?Promise.reject(s):i(l.apply(this.s,arguments))}},new r(o)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});we(uv());we(St());var cv=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var r=typeof SuppressedError=="function"?SuppressedError:function(s,l){var u=Error();return u.name="SuppressedError",u.error=s,u.suppressed=l,u},o={},i=[];function a(s,l){if(l!=null){if(Object(l)!==l)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(s)var u=l[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(u===void 0&&(u=l[Symbol.dispose||Symbol.for("Symbol.dispose")],s))var h=u;if(typeof u!="function")throw new TypeError("Object is not disposable.");h&&(u=function(){try{h.call(l)}catch(p){return Promise.reject(p)}}),i.push({v:l,d:u,a:s})}else s&&i.push({d:l,a:s});return l}return{e:o,u:a.bind(null,!1),a:a.bind(null,!0),d:function(){var l,u=this.e,h=0;function c(){for(;l=i.pop();)try{if(!l.a&&h===1)return h=0,i.push(l),Promise.resolve().then(c);if(l.d){var f=l.d.call(l.v);if(l.a)return h|=2,Promise.resolve(f).then(c,p)}else h|=1}catch(g){return p(g)}if(h===1)return u!==o?Promise.reject(u):Promise.resolve();if(u!==o)throw u}function p(f){return u=u!==o?new r(f,u):f,c()}return c()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Qf=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(r,o){this.v=r,this.k=o}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),dv=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=Qf();function r(o){return new n(o,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),fv=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=Qf();function r(i){return function(){return new o(i.apply(this,arguments))}}function o(i){var a,s;function l(h,c){try{var p=i[h](c),f=p.value,g=f instanceof n;Promise.resolve(g?f.v:f).then(function(m){if(g){var v=h==="return"?"return":"next";if(!f.k||m.done)return l(v,m);m=i[v](m).value}u(p.done?"return":"normal",m)},function(m){l("throw",m)})}catch(m){u("throw",m)}}function u(h,c){switch(h){case"return":a.resolve({value:c,done:!0});break;case"throw":a.reject(c);break;default:a.resolve({value:c,done:!1})}(a=a.next)?l(a.key,a.arg):s=null}this._invoke=function(h,c){return new Promise(function(p,f){var g={key:h,arg:c,resolve:p,reject:f,next:null};s?s=s.next=g:(a=s=g,l(h,c))})},typeof i.return!="function"&&(this.return=void 0)}o.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(i){return this._invoke("next",i)},o.prototype.throw=function(i){return this._invoke("throw",i)},o.prototype.return=function(i){return this._invoke("return",i)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});we(cv());we(dv());we(fv());we(St());var Nr=function(){return Nr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Nr.apply(this,arguments)};function hv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function pv(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(h){try{u(r.next(h))}catch(c){a(c)}}function l(h){try{u(r.throw(h))}catch(c){a(c)}}function u(h){h.done?i(h.value):o(h.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function gv(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(h){u=[6,h],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Ke(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var mv=Object.create,Yf=Object.defineProperty,vv=Object.getOwnPropertyDescriptor,Xf=Object.getOwnPropertyNames,bv=Object.getPrototypeOf,yv=Object.prototype.hasOwnProperty,$n=(e,t)=>function(){return t||(0,e[Xf(e)[0]])((t={exports:{}}).exports,t),t.exports},xv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Xf(t),i=0,a=o.length,s;i<a;i++)s=o[i],!yv.call(e,s)&&s!==n&&Yf(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(r=vv(t,s))||r.enumerable});return e},Jn=(e,t,n)=>(n=e!=null?mv(bv(e)):{},xv(t||!e||!e.__esModule?Yf(n,"default",{value:e,enumerable:!0}):n,e)),wv=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(r,o){if(r==null)return{};var i={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(o.includes(a))continue;i[a]=r[a]}return i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Cv=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=wv();function r(o,i){if(o==null)return{};var a,s,l=n(o,i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);for(s=0;s<u.length;s++)a=u[s],i.includes(a)||{}.propertyIsEnumerable.call(o,a)&&(l[a]=o[a])}return l}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Zf=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(r){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t.exports.__esModule=!0,t.exports.default=t.exports,n(r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),$v=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Zf().default;function r(o,i){if(n(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var s=a.call(o,i||"default");if(n(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Sv=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Zf().default,r=$v();function o(i){var a=r(i,"string");return n(a)=="symbol"?a:a+""}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ev=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Sv();function r(o,i,a){return(i=n(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Xo=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Ev();function r(i,a){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);a&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),s.push.apply(s,l)}return s}function o(i){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?r(Object(s),!0).forEach(function(l){n(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}}),Pv=Jn(Cv(),1),ec=Jn(Xo(),1);const Rv=["cursor","direction"];function Ot(e,t,n){const r=e.flatMap(o=>o.split("."));if(!t&&(!n||n==="any"))return r.length?[r]:[];if(n==="infinite"&&qn(t)&&("direction"in t||"cursor"in t)){const{cursor:o,direction:i}=t,a=(0,Pv.default)(t,Rv);return[r,{input:a,type:"infinite"}]}return[r,(0,ec.default)((0,ec.default)({},typeof t<"u"&&t!==tt&&{input:t}),n&&n!=="any"&&{type:n})]}function Ni(e){return Ot(e,void 0,"any")}function kv(e){return Sa(({path:t,args:n})=>{var r;const o=[...t],i=o.pop();if(i==="useMutation")return e[i](o,...n);if(i==="_def")return{path:o};const[a,...s]=n,l=(r=s[0])!==null&&r!==void 0?r:{};return e[i](o,a,l)})}var Xa;const Mv=["client","ssrContext","ssrState","abortOnUnmount"],Ov=(Xa=S.createContext)===null||Xa===void 0?void 0:Xa.call(S,null),Tv=e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function Dv(e){return Sa(t=>{const n=[...t.path],r=n.pop(),o=[...t.args],i=o.shift(),a=Tv(r),s=Ot(n,i,a);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,s,o[0]),queryOptions:()=>e.queryOptions(n,s,...o),fetch:()=>e.fetchQuery(s,...o),fetchInfinite:()=>e.fetchInfiniteQuery(s,o[0]),prefetch:()=>e.prefetchQuery(s,...o),prefetchInfinite:()=>e.prefetchInfiniteQuery(s,o[0]),ensureData:()=>e.ensureQueryData(s,...o),invalidate:()=>e.invalidateQueries(s,...o),reset:()=>e.resetQueries(s,...o),refetch:()=>e.refetchQueries(s,...o),cancel:()=>e.cancelQuery(s,...o),setData:()=>{e.setQueryData(s,o[0],o[1])},setQueriesData:()=>e.setQueriesData(s,o[0],o[1],o[2]),setInfiniteData:()=>{e.setInfiniteQueryData(s,o[0],o[1])},getData:()=>e.getQueryData(s),getInfiniteData:()=>e.getInfiniteQueryData(s),setMutationDefaults:()=>e.setMutationDefaults(Ni(n),i),getMutationDefaults:()=>e.getMutationDefaults(Ni(n)),isMutating:()=>e.isMutating({mutationKey:Ni(n)})}[r]()})}function _v(e){const t=Gf(e.client),n=Dv(e);return Ul(r=>{const o=r;return o==="client"?t:Mv.includes(o)?e[o]:n[r]})}var Fv=Jn(Xo(),1);function tc(e){const t=e instanceof Ea?e:Wl(e);return Sa(n=>{const r=n.path,o=r.join("."),[i,a]=n.args;return(0,Fv.default)({queryKey:Ot(r,i,"query"),queryFn:()=>t.query(o,i,a==null?void 0:a.trpc)},a)})}var Za=Jn(Xo(),1);function je(e,t,n){var r;const o=e[0];let i=(r=e[1])===null||r===void 0?void 0:r.input;if(n){var a;i=(0,Za.default)((0,Za.default)((0,Za.default)({},(a=i)!==null&&a!==void 0?a:{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[o.join("."),i,t==null?void 0:t.trpc]}var Lv=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(o){var i,a,s,l=2;for(typeof Symbol<"u"&&(a=Symbol.asyncIterator,s=Symbol.iterator);l--;){if(a&&(i=o[a])!=null)return i.call(o);if(s&&(i=o[s])!=null)return new r(i.call(o));a="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function r(o){function i(a){if(Object(a)!==a)return Promise.reject(new TypeError(a+" is not an object."));var s=a.done;return Promise.resolve(a.value).then(function(l){return{value:l,done:s}})}return r=function(s){this.s=s,this.n=s.next},r.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(s){var l=this.s.return;return l===void 0?Promise.resolve({value:s,done:!0}):i(l.apply(this.s,arguments))},throw:function(s){var l=this.s.return;return l===void 0?Promise.reject(s):i(l.apply(this.s,arguments))}},new r(o)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Iv=Jn(Lv(),1);function tl(e){return{path:e.path.join(".")}}function no(e){const t=tl(e);return S.useMemo(()=>t,[t])}async function Jf(e,t,n){const o=t.getQueryCache().build(t,{queryKey:n});o.setState({data:[],status:"success"});const i=[];var a=!1,s=!1,l;try{for(var u=(0,Iv.default)(e),h;a=!(h=await u.next()).done;a=!1){const c=h.value;i.push(c),o.setState({data:[...i]})}}catch(c){s=!0,l=c}finally{try{a&&u.return!=null&&await u.return()}finally{if(s)throw l}}return i}var ae=Jn(Xo(),1);function Nv(e){const{client:t,queryClient:n}=e,r=t instanceof Ea?t:Wl(t);return{infiniteQueryOptions:(o,i,a)=>{var s,l;const u=((s=i[1])===null||s===void 0?void 0:s.input)===tt,h=async c=>{var p;const f=(0,ae.default)((0,ae.default)({},a),{},{trpc:(0,ae.default)((0,ae.default)({},a==null?void 0:a.trpc),!(a==null||(p=a.trpc)===null||p===void 0)&&p.abortOnUnmount?{signal:c.signal}:{signal:null})});return await r.query(...je(i,f,{direction:c.direction,pageParam:c.pageParam}))};return Object.assign((0,ae.default)((0,ae.default)({},a),{},{initialData:a==null?void 0:a.initialData,queryKey:i,queryFn:u?tt:h,initialPageParam:(l=a==null?void 0:a.initialCursor)!==null&&l!==void 0?l:null}),{trpc:tl({path:o})})},queryOptions:(o,i,a)=>{var s;const l=((s=i[1])===null||s===void 0?void 0:s.input)===tt,u=async h=>{var c;const p=(0,ae.default)((0,ae.default)({},a),{},{trpc:(0,ae.default)((0,ae.default)({},a==null?void 0:a.trpc),!(a==null||(c=a.trpc)===null||c===void 0)&&c.abortOnUnmount?{signal:h.signal}:{signal:null})}),f=await r.query(...je(i,p));return Nf(f)?Jf(f,n,i):f};return Object.assign((0,ae.default)((0,ae.default)({},a),{},{initialData:a==null?void 0:a.initialData,queryKey:i,queryFn:l?tt:u}),{trpc:tl({path:o})})},fetchQuery:(o,i)=>n.fetchQuery((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:()=>r.query(...je(o,i))})),fetchInfiniteQuery:(o,i)=>{var a;return n.fetchInfiniteQuery((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:({pageParam:s,direction:l})=>r.query(...je(o,i,{pageParam:s,direction:l})),initialPageParam:(a=i==null?void 0:i.initialCursor)!==null&&a!==void 0?a:null}))},prefetchQuery:(o,i)=>n.prefetchQuery((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:()=>r.query(...je(o,i))})),prefetchInfiniteQuery:(o,i)=>{var a;return n.prefetchInfiniteQuery((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:({pageParam:s,direction:l})=>r.query(...je(o,i,{pageParam:s,direction:l})),initialPageParam:(a=i==null?void 0:i.initialCursor)!==null&&a!==void 0?a:null}))},ensureQueryData:(o,i)=>n.ensureQueryData((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:()=>r.query(...je(o,i))})),invalidateQueries:(o,i,a)=>n.invalidateQueries((0,ae.default)((0,ae.default)({},i),{},{queryKey:o}),a),resetQueries:(o,i,a)=>n.resetQueries((0,ae.default)((0,ae.default)({},i),{},{queryKey:o}),a),refetchQueries:(o,i,a)=>n.refetchQueries((0,ae.default)((0,ae.default)({},i),{},{queryKey:o}),a),cancelQuery:(o,i)=>n.cancelQueries({queryKey:o},i),setQueryData:(o,i,a)=>n.setQueryData(o,i,a),setQueriesData:(o,i,a,s)=>n.setQueriesData((0,ae.default)((0,ae.default)({},i),{},{queryKey:o}),a,s),getQueryData:o=>n.getQueryData(o),setInfiniteQueryData:(o,i,a)=>n.setQueryData(o,i,a),getInfiniteQueryData:o=>n.getQueryData(o),setMutationDefaults:(o,i)=>{const a=o[0],s=l=>r.mutation(...je([a,{input:l}],e));return n.setMutationDefaults(o,typeof i=="function"?i({canonicalMutationFn:s}):i)},getMutationDefaults:o=>n.getMutationDefaults(o),isMutating:o=>n.isMutating((0,ae.default)((0,ae.default)({},o),{},{exact:!0}))}}var U=Jn(Xo());const nc=(e,t)=>new Proxy(e,{get(r,o){return t(o),r[o]}});function jv(e){var t,n,r;const o=(t=e==null||(n=e.overrides)===null||n===void 0||(n=n.useMutation)===null||n===void 0?void 0:n.onSuccess)!==null&&t!==void 0?t:E=>E.originalFn(),i=(r=e==null?void 0:e.context)!==null&&r!==void 0?r:Ov,a=lv,s=E=>{var R;const{abortOnUnmount:M=!1,queryClient:_,ssrContext:D}=E,[P,I]=S.useState((R=E.ssrState)!==null&&R!==void 0?R:!1),N=E.client instanceof Ea?E.client:Wl(E.client),F=S.useMemo(()=>Nv({client:N,queryClient:_}),[N,_]),j=S.useMemo(()=>(0,U.default)({abortOnUnmount:M,queryClient:_,client:N,ssrContext:D??null,ssrState:P},F),[M,N,F,_,D,P]);return S.useEffect(()=>{I(O=>O?"mounted":!1)},[]),y.jsx(i.Provider,{value:j,children:E.children})};function l(){const E=S.useContext(i);if(!E)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return E}function u(E,R){var M;const{queryClient:_,ssrState:D}=l();return D&&D!=="mounted"&&((M=_.getQueryCache().find({queryKey:E}))===null||M===void 0?void 0:M.state.status)==="error"?(0,U.default)({retryOnMount:!1},R):R}function h(E,R,M){var _,D,P,I,N;const F=l(),{abortOnUnmount:j,client:O,ssrState:T,queryClient:A,prefetchQuery:K}=F,L=Ot(E,R,"query"),H=A.getQueryDefaults(L),z=R===tt;typeof window>"u"&&T==="prepass"&&(M==null||(_=M.trpc)===null||_===void 0?void 0:_.ssr)!==!1&&((D=M==null?void 0:M.enabled)!==null&&D!==void 0?D:H==null?void 0:H.enabled)!==!1&&!z&&!A.getQueryCache().find({queryKey:L})&&K(L,M);const V=u(L,(0,U.default)((0,U.default)({},H),M)),W=(P=(I=M==null||(N=M.trpc)===null||N===void 0?void 0:N.abortOnUnmount)!==null&&I!==void 0?I:e==null?void 0:e.abortOnUnmount)!==null&&P!==void 0?P:j,q=lm((0,U.default)((0,U.default)({},V),{},{queryKey:L,queryFn:z?R:async ne=>{const pe=(0,U.default)((0,U.default)({},V),{},{trpc:(0,U.default)((0,U.default)({},V==null?void 0:V.trpc),W?{signal:ne.signal}:{signal:null})}),ee=await O.query(...je(L,pe));return Nf(ee)?Jf(ee,A,L):ee}}),A);return q.trpc=no({path:E}),q}function c(E,R,M){var _,D,P;const I=l(),N=Ot(E,R,"query"),F=R===tt,j=(_=(D=M==null||(P=M.trpc)===null||P===void 0?void 0:P.abortOnUnmount)!==null&&D!==void 0?D:e==null?void 0:e.abortOnUnmount)!==null&&_!==void 0?_:I.abortOnUnmount;fm((0,U.default)((0,U.default)({},M),{},{queryKey:N,queryFn:F?R:O=>{const T={trpc:(0,U.default)((0,U.default)({},M==null?void 0:M.trpc),j?{signal:O.signal}:{})};return I.client.query(...je(N,T))}}))}function p(E,R,M){var _,D,P;const I=l(),N=Ot(E,R,"query"),F=(_=(D=M==null||(P=M.trpc)===null||P===void 0?void 0:P.abortOnUnmount)!==null&&D!==void 0?D:e==null?void 0:e.abortOnUnmount)!==null&&_!==void 0?_:I.abortOnUnmount,j=um((0,U.default)((0,U.default)({},M),{},{queryKey:N,queryFn:O=>{const T=(0,U.default)((0,U.default)({},M),{},{trpc:(0,U.default)((0,U.default)({},M==null?void 0:M.trpc),F?{signal:O.signal}:{signal:null})});return I.client.query(...je(N,T))}}),I.queryClient);return j.trpc=no({path:E}),[j.data,j]}function f(E,R){const{client:M,queryClient:_}=l(),D=Ni(E),P=_.defaultMutationOptions(_.getMutationDefaults(D)),I=pm((0,U.default)((0,U.default)({},R),{},{mutationKey:D,mutationFn:N=>M.mutation(...je([E,{input:N}],R)),onSuccess(...N){var F,j;return o({originalFn:()=>{var T,A,K;return(T=R==null||(A=R.onSuccess)===null||A===void 0?void 0:A.call(R,...N))!==null&&T!==void 0?T:P==null||(K=P.onSuccess)===null||K===void 0?void 0:K.call(P,...N)},queryClient:_,meta:(F=(j=R==null?void 0:R.meta)!==null&&j!==void 0?j:P==null?void 0:P.meta)!==null&&F!==void 0?F:{}})}}),_);return I.trpc=no({path:E}),I}const g={data:void 0,error:null,status:"idle"},m={data:void 0,error:null,status:"connecting"};/* istanbul ignore next -- @preserve */function v(E,R,M){var _;const D=(_=M==null?void 0:M.enabled)!==null&&_!==void 0?_:R!==tt,P=yn(Ot(E,R,"any")),{client:I}=l(),N=S.useRef(M);S.useEffect(()=>{N.current=M});const[F]=S.useState(new Set([])),j=S.useCallback(z=>{F.add(z)},[F]),O=S.useRef(null),T=S.useCallback(z=>{const V=K.current,W=K.current=z(V);let q=!1;for(const ne of F)if(V[ne]!==W[ne]){q=!0;break}q&&H(nc(W,j))},[j,F]),A=S.useCallback(()=>{var z;if((z=O.current)===null||z===void 0||z.unsubscribe(),!D){T(()=>(0,U.default)((0,U.default)({},g),{},{reset:A}));return}T(()=>(0,U.default)((0,U.default)({},m),{},{reset:A}));const V=I.subscription(E.join("."),R??void 0,{onStarted:()=>{var W,q;(W=(q=N.current).onStarted)===null||W===void 0||W.call(q),T(ne=>(0,U.default)((0,U.default)({},ne),{},{status:"pending",error:null}))},onData:W=>{var q,ne;(q=(ne=N.current).onData)===null||q===void 0||q.call(ne,W),T(pe=>(0,U.default)((0,U.default)({},pe),{},{status:"pending",data:W,error:null}))},onError:W=>{var q,ne;(q=(ne=N.current).onError)===null||q===void 0||q.call(ne,W),T(pe=>(0,U.default)((0,U.default)({},pe),{},{status:"error",error:W}))},onConnectionStateChange:W=>{T(q=>{switch(W.state){case"idle":return(0,U.default)((0,U.default)({},q),{},{status:W.state,error:null,data:void 0});case"connecting":return(0,U.default)((0,U.default)({},q),{},{error:W.error,status:W.state});case"pending":return q}})},onComplete:()=>{var W,q;(W=(q=N.current).onComplete)===null||W===void 0||W.call(q),T(ne=>(0,U.default)((0,U.default)({},ne),{},{status:"idle",error:null,data:void 0}))}});O.current=V},[I,P,D,T]);S.useEffect(()=>(A(),()=>{var z;(z=O.current)===null||z===void 0||z.unsubscribe()}),[A]);const K=S.useRef(D?(0,U.default)((0,U.default)({},m),{},{reset:A}):(0,U.default)((0,U.default)({},g),{},{reset:A})),[L,H]=S.useState(nc(K.current,j));return L}function b(E,R,M){var _,D,P,I,N;const{client:F,ssrState:j,prefetchInfiniteQuery:O,queryClient:T,abortOnUnmount:A}=l(),K=Ot(E,R,"infinite"),L=T.getQueryDefaults(K),H=R===tt;typeof window>"u"&&j==="prepass"&&(M==null||(_=M.trpc)===null||_===void 0?void 0:_.ssr)!==!1&&((D=M==null?void 0:M.enabled)!==null&&D!==void 0?D:L==null?void 0:L.enabled)!==!1&&!H&&!T.getQueryCache().find({queryKey:K})&&O(K,(0,U.default)((0,U.default)({},L),M));const z=u(K,(0,U.default)((0,U.default)({},L),M)),V=(P=M==null||(I=M.trpc)===null||I===void 0?void 0:I.abortOnUnmount)!==null&&P!==void 0?P:A,W=gm((0,U.default)((0,U.default)({},z),{},{initialPageParam:(N=M.initialCursor)!==null&&N!==void 0?N:null,persister:M.persister,queryKey:K,queryFn:H?R:q=>{var ne;const pe=(0,U.default)((0,U.default)({},z),{},{trpc:(0,U.default)((0,U.default)({},z==null?void 0:z.trpc),V?{signal:q.signal}:{signal:null})});return F.query(...je(K,pe,{pageParam:(ne=q.pageParam)!==null&&ne!==void 0?ne:M.initialCursor,direction:q.direction}))}}),T);return W.trpc=no({path:E}),W}function x(E,R,M){var _,D,P;const I=l(),N=Ot(E,R,"infinite"),F=I.queryClient.getQueryDefaults(N),j=R===tt,O=u(N,(0,U.default)((0,U.default)({},F),M)),T=(_=M==null||(D=M.trpc)===null||D===void 0?void 0:D.abortOnUnmount)!==null&&_!==void 0?_:I.abortOnUnmount;hm((0,U.default)((0,U.default)({},M),{},{initialPageParam:(P=M.initialCursor)!==null&&P!==void 0?P:null,queryKey:N,queryFn:j?R:A=>{var K;const L=(0,U.default)((0,U.default)({},O),{},{trpc:(0,U.default)((0,U.default)({},O==null?void 0:O.trpc),T?{signal:A.signal}:{})});return I.client.query(...je(N,L,{pageParam:(K=A.pageParam)!==null&&K!==void 0?K:M.initialCursor,direction:A.direction}))}}))}function w(E,R,M){var _,D,P;const I=l(),N=Ot(E,R,"infinite"),F=I.queryClient.getQueryDefaults(N),j=u(N,(0,U.default)((0,U.default)({},F),M)),O=(_=M==null||(D=M.trpc)===null||D===void 0?void 0:D.abortOnUnmount)!==null&&_!==void 0?_:I.abortOnUnmount,T=cm((0,U.default)((0,U.default)({},M),{},{initialPageParam:(P=M.initialCursor)!==null&&P!==void 0?P:null,queryKey:N,queryFn:A=>{var K;const L=(0,U.default)((0,U.default)({},j),{},{trpc:(0,U.default)((0,U.default)({},j==null?void 0:j.trpc),O?{signal:A.signal}:{})});return I.client.query(...je(N,L,{pageParam:(K=A.pageParam)!==null&&K!==void 0?K:M.initialCursor,direction:A.direction}))}}),I.queryClient);return T.trpc=no({path:E}),[T.data,T]}return{Provider:s,createClient:a,useContext:l,useUtils:l,useQuery:h,usePrefetchQuery:c,useSuspenseQuery:p,useQueries:(E,R)=>{const{ssrState:M,queryClient:_,prefetchQuery:D,client:P}=l(),I=tc(P),N=E(I);if(typeof window>"u"&&M==="prepass")for(const j of N){var F;const O=j;((F=O.trpc)===null||F===void 0?void 0:F.ssr)!==!1&&!_.getQueryCache().find({queryKey:O.queryKey})&&D(O.queryKey,O)}return _f({queries:N.map(j=>(0,U.default)((0,U.default)({},j),{},{queryKey:j.queryKey})),combine:R==null?void 0:R.combine},_)},useSuspenseQueries:E=>{const{queryClient:R,client:M}=l(),_=tc(M),D=E(_),P=dm({queries:D.map(I=>(0,U.default)((0,U.default)({},I),{},{queryFn:I.queryFn,queryKey:I.queryKey}))},R);return[P.map(I=>I.data),P]},useMutation:f,useSubscription:v,useInfiniteQuery:b,usePrefetchInfiniteQuery:x,useSuspenseInfiniteQuery:w}}function Av(e){const t=kv(e);return Ul(n=>n==="useContext"||n==="useUtils"?()=>{const r=e.useUtils();return S.useMemo(()=>_v(r),[r])}:e.hasOwnProperty(n)?e[n]:t[n])}function Kv(e){const t=jv(e);return Av(t)}var le=Kv({overrides:{useMutation:{onSuccess:function(e){return pv(this,void 0,void 0,function(){return gv(this,function(t){switch(t.label){case 0:return[4,e.originalFn()];case 1:return t.sent(),[4,e.queryClient.invalidateQueries()];case 2:return t.sent(),[2]}})})}}}});/**
|
|
9
|
+
*/var Dg=Symbol.for("react.transitional.element"),_g=Symbol.for("react.fragment");function ff(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var o in t)o!=="key"&&(n[o]=t[o])}else n=t;return t=n.ref,{$$typeof:Dg,type:e,key:r,ref:t!==void 0?t:null,props:n}}xa.Fragment=_g;xa.jsx=ff;xa.jsxs=ff;df.exports=xa;var y=df.exports,Xn=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(){}},Fg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},nn,Al,Xd,Lg=(Xd=class{constructor(){G(this,nn,Fg);G(this,Al,!1)}setTimeoutProvider(e){B(this,nn,e)}setTimeout(e,t){return C(this,nn).setTimeout(e,t)}clearTimeout(e){C(this,nn).clearTimeout(e)}setInterval(e,t){return C(this,nn).setInterval(e,t)}clearInterval(e){C(this,nn).clearInterval(e)}},nn=new WeakMap,Al=new WeakMap,Xd),Fn=new Lg;function Ig(e){setTimeout(e,0)}var Un=typeof window>"u"||"Deno"in globalThis;function Le(){}function Ng(e,t){return typeof e=="function"?e(t):e}function _s(e){return typeof e=="number"&&e>=0&&e!==1/0}function hf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gn(e,t){return typeof e=="function"?e(t):e}function ct(e,t){return typeof e=="function"?e(t):e}function Ku(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==Kl(a,t.options))return!1}else if(!Po(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function Bu(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(yn(t.options.mutationKey)!==yn(i))return!1}else if(!Po(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Kl(e,t){return((t==null?void 0:t.queryKeyHashFn)||yn)(e)}function yn(e){return JSON.stringify(e,(t,n)=>Fs(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Po(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Po(e[n],t[n])):!1}var jg=Object.prototype.hasOwnProperty;function Bl(e,t){if(e===t)return e;const n=Hu(e)&&Hu(t);if(!n&&!(Fs(e)&&Fs(t)))return t;const o=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,s=n?new Array(a):{};let l=0;for(let u=0;u<a;u++){const h=n?u:i[u],c=e[h],p=t[h];if(c===p){s[h]=c,(n?u<o:jg.call(e,h))&&l++;continue}if(c===null||p===null||typeof c!="object"||typeof p!="object"){s[h]=p;continue}const f=Bl(c,p);s[h]=f,f===c&&l++}return o===a&&l===o?e:s}function Ro(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Hu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fs(e){if(!Vu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Vu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Vu(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ag(e){return new Promise(t=>{Fn.setTimeout(t,e)})}function Ls(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Bl(e,t):t}function Kg(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Bg(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var tt=Symbol();function pf(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===tt?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gf(e,t){return typeof e=="function"?e(...t):!!e}var In,rn,Cr,Zd,Hg=(Zd=class extends Xn{constructor(){super();G(this,In);G(this,rn);G(this,Cr);B(this,Cr,t=>{if(!Un&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,rn)||this.setEventListener(C(this,Cr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,rn))==null||t.call(this),B(this,rn,void 0))}setEventListener(t){var n;B(this,Cr,t),(n=C(this,rn))==null||n.call(this),B(this,rn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,In)!==t&&(B(this,In,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,In)=="boolean"?C(this,In):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},In=new WeakMap,rn=new WeakMap,Cr=new WeakMap,Zd),Hl=new Hg;function Is(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var Vg=Ig;function zg(){let e=[],t=0,n=s=>{s()},r=s=>{s()},o=Vg;const i=s=>{t?e.push(s):o(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&o(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{i(()=>{s(...l)})},schedule:i,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{o=s}}}var be=zg(),$r,on,Sr,Jd,Ug=(Jd=class extends Xn{constructor(){super();G(this,$r,!0);G(this,on);G(this,Sr);B(this,Sr,t=>{if(!Un&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,on)||this.setEventListener(C(this,Sr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,on))==null||t.call(this),B(this,on,void 0))}setEventListener(t){var n;B(this,Sr,t),(n=C(this,on))==null||n.call(this),B(this,on,t(this.setOnline.bind(this)))}setOnline(t){C(this,$r)!==t&&(B(this,$r,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,$r)}},$r=new WeakMap,on=new WeakMap,Sr=new WeakMap,Jd),Vi=new Ug;function qg(e){return Math.min(1e3*2**e,3e4)}function mf(e){return(e??"online")==="online"?Vi.isOnline():!0}var Ns=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function vf(e){let t=!1,n=0,r;const o=Is(),i=()=>o.status!=="pending",a=m=>{var v;if(!i()){const b=new Ns(m);p(b),(v=e.onCancel)==null||v.call(e,b)}},s=()=>{t=!0},l=()=>{t=!1},u=()=>Hl.isFocused()&&(e.networkMode==="always"||Vi.isOnline())&&e.canRun(),h=()=>mf(e.networkMode)&&e.canRun(),c=m=>{i()||(r==null||r(),o.resolve(m))},p=m=>{i()||(r==null||r(),o.reject(m))},f=()=>new Promise(m=>{var v;r=b=>{(i()||u())&&m(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var m;r=void 0,i()||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(i())return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(c).catch(b=>{var E;if(i())return;const x=e.retry??(Un?0:3),w=e.retryDelay??qg,$=typeof w=="function"?w(n,b):w,k=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!k){p(b);return}n++,(E=e.onFail)==null||E.call(e,n,b),Ag($).then(()=>u()?void 0:f()).then(()=>{t?p(b):g()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(r==null||r(),o),cancelRetry:s,continueRetry:l,canStart:h,start:()=>(h()?g():f().then(g),o)}}var Nn,ef,bf=(ef=class{constructor(){G(this,Nn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_s(this.gcTime)&&B(this,Nn,Fn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Un?1/0:5*60*1e3))}clearGcTimeout(){C(this,Nn)&&(Fn.clearTimeout(C(this,Nn)),B(this,Nn,void 0))}},Nn=new WeakMap,ef),jn,Er,lt,An,Re,Ko,Kn,yt,Kt,tf,Wg=(tf=class extends bf{constructor(t){super();G(this,yt);G(this,jn);G(this,Er);G(this,lt);G(this,An);G(this,Re);G(this,Ko);G(this,Kn);B(this,Kn,!1),B(this,Ko,t.defaultOptions),this.setOptions(t.options),this.observers=[],B(this,An,t.client),B(this,lt,C(this,An).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,B(this,jn,Uu(this.options)),this.state=t.state??C(this,jn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,Re))==null?void 0:t.promise}setOptions(t){if(this.options={...C(this,Ko),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Uu(this.options);n.data!==void 0&&(this.setState(zu(n.data,n.dataUpdatedAt)),B(this,jn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,lt).remove(this)}setData(t,n){const r=Ls(this.state.data,t,this.options);return X(this,yt,Kt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){X(this,yt,Kt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=C(this,Re))==null?void 0:r.promise;return(o=C(this,Re))==null||o.cancel(t),n?n.then(Le).catch(Le):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,jn))}isActive(){return this.observers.some(t=>ct(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tt||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>gn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!hf(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Re))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Re))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,lt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,Re)&&(C(this,Kn)?C(this,Re).cancel({revert:!0}):C(this,Re).cancelRetry()),this.scheduleGc()),C(this,lt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,yt,Kt).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,h,c,p,f,g,m,v,b,x,w;if(this.state.fetchStatus!=="idle"&&((l=C(this,Re))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Re))return C(this,Re).continueRetry(),C(this,Re).promise}if(t&&this.setOptions(t),!this.options.queryFn){const $=this.observers.find(k=>k.options.queryFn);$&&this.setOptions($.options)}const r=new AbortController,o=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(B(this,Kn,!0),r.signal)})},i=()=>{const $=pf(this.options,n),E=(()=>{const R={client:C(this,An),queryKey:this.queryKey,meta:this.meta};return o(R),R})();return B(this,Kn,!1),this.options.persister?this.options.persister($,E,this):$(E)},s=(()=>{const $={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,An),state:this.state,fetchFn:i};return o($),$})();(u=this.options.behavior)==null||u.onFetch(s,this),B(this,Er,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=s.fetchOptions)==null?void 0:h.meta))&&X(this,yt,Kt).call(this,{type:"fetch",meta:(c=s.fetchOptions)==null?void 0:c.meta}),B(this,Re,vf({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,onCancel:$=>{$ instanceof Ns&&$.revert&&this.setState({...C(this,Er),fetchStatus:"idle"}),r.abort()},onFail:($,k)=>{X(this,yt,Kt).call(this,{type:"failed",failureCount:$,error:k})},onPause:()=>{X(this,yt,Kt).call(this,{type:"pause"})},onContinue:()=>{X(this,yt,Kt).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const $=await C(this,Re).start();if($===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData($),(f=(p=C(this,lt).config).onSuccess)==null||f.call(p,$,this),(m=(g=C(this,lt).config).onSettled)==null||m.call(g,$,this.state.error,this),$}catch($){if($ instanceof Ns){if($.silent)return C(this,Re).promise;if($.revert){if(this.state.data===void 0)throw $;return this.state.data}}throw X(this,yt,Kt).call(this,{type:"error",error:$}),(b=(v=C(this,lt).config).onError)==null||b.call(v,$,this),(w=(x=C(this,lt).config).onSettled)==null||w.call(x,this.state.data,$,this),$}finally{this.scheduleGc()}}},jn=new WeakMap,Er=new WeakMap,lt=new WeakMap,An=new WeakMap,Re=new WeakMap,Ko=new WeakMap,Kn=new WeakMap,yt=new WeakSet,Kt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...yf(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...zu(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return B(this,Er,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,lt).notify({query:this,type:"updated",action:t})})},tf);function yf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zu(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Uu(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ve,re,Bo,Ie,Bn,Pr,Ht,an,Ho,Rr,kr,Hn,Vn,sn,Mr,ue,ho,js,As,Ks,Bs,Hs,Vs,zs,xf,nf,Go=(nf=class extends Xn{constructor(t,n){super();G(this,ue);G(this,Ve);G(this,re);G(this,Bo);G(this,Ie);G(this,Bn);G(this,Pr);G(this,Ht);G(this,an);G(this,Ho);G(this,Rr);G(this,kr);G(this,Hn);G(this,Vn);G(this,sn);G(this,Mr,new Set);this.options=n,B(this,Ve,t),B(this,an,null),B(this,Ht,Is()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,re).addObserver(this),qu(C(this,re),this.options)?X(this,ue,ho).call(this):this.updateResult(),X(this,ue,Bs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Us(C(this,re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Us(C(this,re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,ue,Hs).call(this),X(this,ue,Vs).call(this),C(this,re).removeObserver(this)}setOptions(t){const n=this.options,r=C(this,re);if(this.options=C(this,Ve).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ct(this.options.enabled,C(this,re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");X(this,ue,zs).call(this),C(this,re).setOptions(this.options),n._defaulted&&!Ro(this.options,n)&&C(this,Ve).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,re),observer:this});const o=this.hasListeners();o&&Wu(C(this,re),r,this.options,n)&&X(this,ue,ho).call(this),this.updateResult(),o&&(C(this,re)!==r||ct(this.options.enabled,C(this,re))!==ct(n.enabled,C(this,re))||gn(this.options.staleTime,C(this,re))!==gn(n.staleTime,C(this,re)))&&X(this,ue,js).call(this);const i=X(this,ue,As).call(this);o&&(C(this,re)!==r||ct(this.options.enabled,C(this,re))!==ct(n.enabled,C(this,re))||i!==C(this,sn))&&X(this,ue,Ks).call(this,i)}getOptimisticResult(t){const n=C(this,Ve).getQueryCache().build(C(this,Ve),t),r=this.createResult(n,t);return Qg(this,r)&&(B(this,Ie,r),B(this,Pr,this.options),B(this,Bn,C(this,re).state)),r}getCurrentResult(){return C(this,Ie)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&C(this,Ht).status==="pending"&&C(this,Ht).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){C(this,Mr).add(t)}getCurrentQuery(){return C(this,re)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,Ve).defaultQueryOptions(t),r=C(this,Ve).getQueryCache().build(C(this,Ve),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return X(this,ue,ho).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Ie)))}createResult(t,n){var _;const r=C(this,re),o=this.options,i=C(this,Ie),a=C(this,Bn),s=C(this,Pr),u=t!==r?t.state:C(this,Bo),{state:h}=t;let c={...h},p=!1,f;if(n._optimisticResults){const D=this.hasListeners(),P=!D&&qu(t,n),I=D&&Wu(t,r,n,o);(P||I)&&(c={...c,...yf(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:v}=c;f=c.data;let b=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let D;i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData)?(D=i.data,b=!0):D=typeof n.placeholderData=="function"?n.placeholderData((_=C(this,kr))==null?void 0:_.state.data,C(this,kr)):n.placeholderData,D!==void 0&&(v="success",f=Ls(i==null?void 0:i.data,D,n),p=!0)}if(n.select&&f!==void 0&&!b)if(i&&f===(a==null?void 0:a.data)&&n.select===C(this,Ho))f=C(this,Rr);else try{B(this,Ho,n.select),f=n.select(f),f=Ls(i==null?void 0:i.data,f,n),B(this,Rr,f),B(this,an,null)}catch(D){B(this,an,D)}C(this,an)&&(g=C(this,an),f=C(this,Rr),m=Date.now(),v="error");const x=c.fetchStatus==="fetching",w=v==="pending",$=v==="error",k=w&&x,E=f!==void 0,M={status:v,fetchStatus:c.fetchStatus,isPending:w,isSuccess:v==="success",isError:$,isInitialLoading:k,isLoading:k,data:f,dataUpdatedAt:c.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:$&&!E,isPaused:c.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:$&&E,isStale:Vl(t,n),refetch:this.refetch,promise:C(this,Ht),isEnabled:ct(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=N=>{M.status==="error"?N.reject(M.error):M.data!==void 0&&N.resolve(M.data)},P=()=>{const N=B(this,Ht,M.promise=Is());D(N)},I=C(this,Ht);switch(I.status){case"pending":t.queryHash===r.queryHash&&D(I);break;case"fulfilled":(M.status==="error"||M.data!==I.value)&&P();break;case"rejected":(M.status!=="error"||M.error!==I.reason)&&P();break}}return M}updateResult(){const t=C(this,Ie),n=this.createResult(C(this,re),this.options);if(B(this,Bn,C(this,re).state),B(this,Pr,this.options),C(this,Bn).data!==void 0&&B(this,kr,C(this,re)),Ro(n,t))return;B(this,Ie,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!C(this,Mr).size)return!0;const a=new Set(i??C(this,Mr));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,Ie)).some(s=>{const l=s;return C(this,Ie)[l]!==t[l]&&a.has(l)})};X(this,ue,xf).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,ue,Bs).call(this)}},Ve=new WeakMap,re=new WeakMap,Bo=new WeakMap,Ie=new WeakMap,Bn=new WeakMap,Pr=new WeakMap,Ht=new WeakMap,an=new WeakMap,Ho=new WeakMap,Rr=new WeakMap,kr=new WeakMap,Hn=new WeakMap,Vn=new WeakMap,sn=new WeakMap,Mr=new WeakMap,ue=new WeakSet,ho=function(t){X(this,ue,zs).call(this);let n=C(this,re).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Le)),n},js=function(){X(this,ue,Hs).call(this);const t=gn(this.options.staleTime,C(this,re));if(Un||C(this,Ie).isStale||!_s(t))return;const r=hf(C(this,Ie).dataUpdatedAt,t)+1;B(this,Hn,Fn.setTimeout(()=>{C(this,Ie).isStale||this.updateResult()},r))},As=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,re)):this.options.refetchInterval)??!1},Ks=function(t){X(this,ue,Vs).call(this),B(this,sn,t),!(Un||ct(this.options.enabled,C(this,re))===!1||!_s(C(this,sn))||C(this,sn)===0)&&B(this,Vn,Fn.setInterval(()=>{(this.options.refetchIntervalInBackground||Hl.isFocused())&&X(this,ue,ho).call(this)},C(this,sn)))},Bs=function(){X(this,ue,js).call(this),X(this,ue,Ks).call(this,X(this,ue,As).call(this))},Hs=function(){C(this,Hn)&&(Fn.clearTimeout(C(this,Hn)),B(this,Hn,void 0))},Vs=function(){C(this,Vn)&&(Fn.clearInterval(C(this,Vn)),B(this,Vn,void 0))},zs=function(){const t=C(this,Ve).getQueryCache().build(C(this,Ve),this.options);if(t===C(this,re))return;const n=C(this,re);B(this,re,t),B(this,Bo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},xf=function(t){be.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,Ie))}),C(this,Ve).getQueryCache().notify({query:C(this,re),type:"observerResultsUpdated"})})},nf);function Gg(e,t){return ct(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qu(e,t){return Gg(e,t)||e.state.data!==void 0&&Us(e,t,t.refetchOnMount)}function Us(e,t,n){if(ct(t.enabled,e)!==!1&&gn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Vl(e,t)}return!1}function Wu(e,t,n,r){return(e!==t||ct(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Vl(e,n)}function Vl(e,t){return ct(t.enabled,e)!==!1&&e.isStaleByTime(gn(t.staleTime,e))}function Qg(e,t){return!Ro(e.getCurrentResult(),t)}function zi(e){return{onFetch:(t,n)=>{var h,c,p,f,g;const r=t.options,o=(p=(c=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:c.fetchMore)==null?void 0:p.direction,i=((f=t.state.data)==null?void 0:f.pages)||[],a=((g=t.state.data)==null?void 0:g.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},b=pf(t.options,t.fetchOptions),x=async(w,$,k)=>{if(m)return Promise.reject();if($==null&&w.pages.length)return Promise.resolve(w);const R=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:$,direction:k?"backward":"forward",meta:t.options.meta};return v(P),P})(),M=await b(R),{maxPages:_}=t.options,D=k?Bg:Kg;return{pages:D(w.pages,M,_),pageParams:D(w.pageParams,$,_)}};if(o&&i.length){const w=o==="backward",$=w?wf:qs,k={pages:i,pageParams:a},E=$(r,k);s=await x(k,E,w)}else{const w=e??i.length;do{const $=l===0?a[0]??r.initialPageParam:qs(r,s);if(l>0&&$==null)break;s=await x(s,$),l++}while(l<w)}return s};t.options.persister?t.fetchFn=()=>{var m,v;return(v=(m=t.options).persister)==null?void 0:v.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function qs(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wf(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function Yg(e,t){return t?qs(e,t)!=null:!1}function Xg(e,t){return!t||!e.getPreviousPageParam?!1:wf(e,t)!=null}var Cf=class extends Go{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:zi()})}getOptimisticResult(e){return e.behavior=zi(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var g,m;const{state:n}=e,r=super.createResult(e,t),{isFetching:o,isRefetching:i,isError:a,isRefetchError:s}=r,l=(m=(g=n.fetchMeta)==null?void 0:g.fetchMore)==null?void 0:m.direction,u=a&&l==="forward",h=o&&l==="forward",c=a&&l==="backward",p=o&&l==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Yg(t,n.data),hasPreviousPage:Xg(t,n.data),isFetchNextPageError:u,isFetchingNextPage:h,isFetchPreviousPageError:c,isFetchingPreviousPage:p,isRefetchError:s&&!u&&!c,isRefetching:i&&!h&&!p}}},Vo,Tt,Ne,zn,Dt,en,rf,Zg=(rf=class extends bf{constructor(t){super();G(this,Dt);G(this,Vo);G(this,Tt);G(this,Ne);G(this,zn);B(this,Vo,t.client),this.mutationId=t.mutationId,B(this,Ne,t.mutationCache),B(this,Tt,[]),this.state=t.state||$f(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Tt).includes(t)||(C(this,Tt).push(t),this.clearGcTimeout(),C(this,Ne).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){B(this,Tt,C(this,Tt).filter(n=>n!==t)),this.scheduleGc(),C(this,Ne).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Tt).length||(this.state.status==="pending"?this.scheduleGc():C(this,Ne).remove(this))}continue(){var t;return((t=C(this,zn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,s,l,u,h,c,p,f,g,m,v,b,x,w,$,k,E,R,M,_;const n=()=>{X(this,Dt,en).call(this,{type:"continue"})},r={client:C(this,Vo),meta:this.options.meta,mutationKey:this.options.mutationKey};B(this,zn,vf({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(D,P)=>{X(this,Dt,en).call(this,{type:"failed",failureCount:D,error:P})},onPause:()=>{X(this,Dt,en).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Ne).canRun(this)}));const o=this.state.status==="pending",i=!C(this,zn).canStart();try{if(o)n();else{X(this,Dt,en).call(this,{type:"pending",variables:t,isPaused:i}),await((s=(a=C(this,Ne).config).onMutate)==null?void 0:s.call(a,t,this,r));const P=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,r));P!==this.state.context&&X(this,Dt,en).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const D=await C(this,zn).start();return await((c=(h=C(this,Ne).config).onSuccess)==null?void 0:c.call(h,D,t,this.state.context,this,r)),await((f=(p=this.options).onSuccess)==null?void 0:f.call(p,D,t,this.state.context,r)),await((m=(g=C(this,Ne).config).onSettled)==null?void 0:m.call(g,D,null,this.state.variables,this.state.context,this,r)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,D,null,t,this.state.context,r)),X(this,Dt,en).call(this,{type:"success",data:D}),D}catch(D){try{throw await((w=(x=C(this,Ne).config).onError)==null?void 0:w.call(x,D,t,this.state.context,this,r)),await((k=($=this.options).onError)==null?void 0:k.call($,D,t,this.state.context,r)),await((R=(E=C(this,Ne).config).onSettled)==null?void 0:R.call(E,void 0,D,this.state.variables,this.state.context,this,r)),await((_=(M=this.options).onSettled)==null?void 0:_.call(M,void 0,D,t,this.state.context,r)),D}finally{X(this,Dt,en).call(this,{type:"error",error:D})}}finally{C(this,Ne).runNext(this)}}},Vo=new WeakMap,Tt=new WeakMap,Ne=new WeakMap,zn=new WeakMap,Dt=new WeakSet,en=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),be.batch(()=>{C(this,Tt).forEach(r=>{r.onMutationUpdate(t)}),C(this,Ne).notify({mutation:this,type:"updated",action:t})})},rf);function $f(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vt,xt,zo,of,Jg=(of=class extends Xn{constructor(t={}){super();G(this,Vt);G(this,xt);G(this,zo);this.config=t,B(this,Vt,new Set),B(this,xt,new Map),B(this,zo,0)}build(t,n,r){const o=new Zg({client:t,mutationCache:this,mutationId:++ui(this,zo)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){C(this,Vt).add(t);const n=ci(t);if(typeof n=="string"){const r=C(this,xt).get(n);r?r.push(t):C(this,xt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,Vt).delete(t)){const n=ci(t);if(typeof n=="string"){const r=C(this,xt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&C(this,xt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ci(t);if(typeof n=="string"){const r=C(this,xt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=ci(t);if(typeof n=="string"){const o=(r=C(this,xt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){be.batch(()=>{C(this,Vt).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,Vt).clear(),C(this,xt).clear()})}getAll(){return Array.from(C(this,Vt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Bu(n,r))}findAll(t={}){return this.getAll().filter(n=>Bu(t,n))}notify(t){be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return be.batch(()=>Promise.all(t.map(n=>n.continue().catch(Le))))}},Vt=new WeakMap,xt=new WeakMap,zo=new WeakMap,of);function ci(e){var t;return(t=e.options.scope)==null?void 0:t.id}var zt,ln,ze,Ut,Wt,Li,Ws,af,em=(af=class extends Xn{constructor(n,r){super();G(this,Wt);G(this,zt);G(this,ln);G(this,ze);G(this,Ut);B(this,zt,n),this.setOptions(r),this.bindMethods(),X(this,Wt,Li).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=C(this,zt).defaultMutationOptions(n),Ro(this.options,r)||C(this,zt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,ze),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&yn(r.mutationKey)!==yn(this.options.mutationKey)?this.reset():((o=C(this,ze))==null?void 0:o.state.status)==="pending"&&C(this,ze).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,ze))==null||n.removeObserver(this)}onMutationUpdate(n){X(this,Wt,Li).call(this),X(this,Wt,Ws).call(this,n)}getCurrentResult(){return C(this,ln)}reset(){var n;(n=C(this,ze))==null||n.removeObserver(this),B(this,ze,void 0),X(this,Wt,Li).call(this),X(this,Wt,Ws).call(this)}mutate(n,r){var o;return B(this,Ut,r),(o=C(this,ze))==null||o.removeObserver(this),B(this,ze,C(this,zt).getMutationCache().build(C(this,zt),this.options)),C(this,ze).addObserver(this),C(this,ze).execute(n)}},zt=new WeakMap,ln=new WeakMap,ze=new WeakMap,Ut=new WeakMap,Wt=new WeakSet,Li=function(){var r;const n=((r=C(this,ze))==null?void 0:r.state)??$f();B(this,ln,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ws=function(n){be.batch(()=>{var r,o,i,a,s,l,u,h;if(C(this,Ut)&&this.hasListeners()){const c=C(this,ln).variables,p=C(this,ln).context,f={client:C(this,zt),meta:this.options.meta,mutationKey:this.options.mutationKey};(n==null?void 0:n.type)==="success"?((o=(r=C(this,Ut)).onSuccess)==null||o.call(r,n.data,c,p,f),(a=(i=C(this,Ut)).onSettled)==null||a.call(i,n.data,null,c,p,f)):(n==null?void 0:n.type)==="error"&&((l=(s=C(this,Ut)).onError)==null||l.call(s,n.error,c,p,f),(h=(u=C(this,Ut)).onSettled)==null||h.call(u,void 0,n.error,c,p,f))}this.listeners.forEach(c=>{c(C(this,ln))})})},af);function Gu(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function tm(e,t,n){const r=e.slice(0);return r[t]=n,r}var Or,Je,Tr,Dr,ut,un,Uo,qo,Wo,De,Gs,Qs,Ys,Xs,Zs,sf,nm=(sf=class extends Xn{constructor(t,n,r){super();G(this,De);G(this,Or);G(this,Je);G(this,Tr);G(this,Dr);G(this,ut);G(this,un);G(this,Uo);G(this,qo);G(this,Wo,[]);B(this,Or,t),B(this,Dr,r),B(this,Tr,[]),B(this,ut,[]),B(this,Je,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&C(this,ut).forEach(t=>{t.subscribe(n=>{X(this,De,Xs).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,C(this,ut).forEach(t=>{t.destroy()})}setQueries(t,n){B(this,Tr,t),B(this,Dr,n),be.batch(()=>{const r=C(this,ut),o=X(this,De,Ys).call(this,C(this,Tr));B(this,Wo,o),o.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=o.map(c=>c.observer),a=i.map(c=>c.getCurrentResult()),s=r.length!==i.length,l=i.some((c,p)=>c!==r[p]),u=s||l,h=u?!0:a.some((c,p)=>{const f=C(this,Je)[p];return!f||!Ro(c,f)});!u&&!h||(u&&B(this,ut,i),B(this,Je,a),this.hasListeners()&&(u&&(Gu(r,i).forEach(c=>{c.destroy()}),Gu(i,r).forEach(c=>{c.subscribe(p=>{X(this,De,Xs).call(this,c,p)})})),X(this,De,Zs).call(this)))})}getCurrentResult(){return C(this,Je)}getQueries(){return C(this,ut).map(t=>t.getCurrentQuery())}getObservers(){return C(this,ut)}getOptimisticResult(t,n){const r=X(this,De,Ys).call(this,t),o=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[o,i=>X(this,De,Qs).call(this,i??o,n),()=>X(this,De,Gs).call(this,o,r)]}},Or=new WeakMap,Je=new WeakMap,Tr=new WeakMap,Dr=new WeakMap,ut=new WeakMap,un=new WeakMap,Uo=new WeakMap,qo=new WeakMap,Wo=new WeakMap,De=new WeakSet,Gs=function(t,n){return n.map((r,o)=>{const i=t[o];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,a=>{n.forEach(s=>{s.observer.trackProp(a)})})})},Qs=function(t,n){return n?((!C(this,un)||C(this,Je)!==C(this,qo)||n!==C(this,Uo))&&(B(this,Uo,n),B(this,qo,C(this,Je)),B(this,un,Bl(C(this,un),n(t)))),C(this,un)):t},Ys=function(t){const n=new Map;C(this,ut).forEach(o=>{const i=o.options.queryHash;if(!i)return;const a=n.get(i);a?a.push(o):n.set(i,[o])});const r=[];return t.forEach(o=>{var l;const i=C(this,Or).defaultQueryOptions(o),s=((l=n.get(i.queryHash))==null?void 0:l.shift())??new Go(C(this,Or),i);r.push({defaultedQueryOptions:i,observer:s})}),r},Xs=function(t,n){const r=C(this,ut).indexOf(t);r!==-1&&(B(this,Je,tm(C(this,Je),r,n)),X(this,De,Zs).call(this))},Zs=function(){var t;if(this.hasListeners()){const n=C(this,un),r=X(this,De,Gs).call(this,C(this,Je),C(this,Wo)),o=X(this,De,Qs).call(this,r,(t=C(this,Dr))==null?void 0:t.combine);n!==o&&be.batch(()=>{this.listeners.forEach(i=>{i(C(this,Je))})})}},sf),_t,lf,rm=(lf=class extends Xn{constructor(t={}){super();G(this,_t);this.config=t,B(this,_t,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Kl(o,n);let a=this.get(i);return a||(a=new Wg({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){C(this,_t).has(t.queryHash)||(C(this,_t).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,_t).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,_t).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,_t).get(t)}getAll(){return[...C(this,_t).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ku(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ku(t,r)):n}notify(t){be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){be.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){be.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},_t=new WeakMap,lf),ve,cn,dn,_r,Fr,fn,Lr,Ir,uf,om=(uf=class{constructor(e={}){G(this,ve);G(this,cn);G(this,dn);G(this,_r);G(this,Fr);G(this,fn);G(this,Lr);G(this,Ir);B(this,ve,e.queryCache||new rm),B(this,cn,e.mutationCache||new Jg),B(this,dn,e.defaultOptions||{}),B(this,_r,new Map),B(this,Fr,new Map),B(this,fn,0)}mount(){ui(this,fn)._++,C(this,fn)===1&&(B(this,Lr,Hl.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,ve).onFocus())})),B(this,Ir,Vi.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,ve).onOnline())})))}unmount(){var e,t;ui(this,fn)._--,C(this,fn)===0&&((e=C(this,Lr))==null||e.call(this),B(this,Lr,void 0),(t=C(this,Ir))==null||t.call(this),B(this,Ir,void 0))}isFetching(e){return C(this,ve).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,cn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,ve).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,ve).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(gn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,ve).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=C(this,ve).get(r.queryHash),i=o==null?void 0:o.state.data,a=Ng(t,i);if(a!==void 0)return C(this,ve).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return be.batch(()=>C(this,ve).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,ve).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,ve);be.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,ve);return be.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=be.batch(()=>C(this,ve).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Le).catch(Le)}invalidateQueries(e,t={}){return be.batch(()=>(C(this,ve).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=be.batch(()=>C(this,ve).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Le)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Le)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,ve).build(this,t);return n.isStaleByTime(gn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Le).catch(Le)}fetchInfiniteQuery(e){return e.behavior=zi(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Le).catch(Le)}ensureInfiniteQueryData(e){return e.behavior=zi(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vi.isOnline()?C(this,cn).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,ve)}getMutationCache(){return C(this,cn)}getDefaultOptions(){return C(this,dn)}setDefaultOptions(e){B(this,dn,e)}setQueryDefaults(e,t){C(this,_r).set(yn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,_r).values()],n={};return t.forEach(r=>{Po(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,Fr).set(yn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,Fr).values()],n={};return t.forEach(r=>{Po(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,dn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Kl(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===tt&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,dn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,ve).clear(),C(this,cn).clear()}},ve=new WeakMap,cn=new WeakMap,dn=new WeakMap,_r=new WeakMap,Fr=new WeakMap,fn=new WeakMap,Lr=new WeakMap,Ir=new WeakMap,uf),Sf=S.createContext(void 0),Qo=e=>{const t=S.useContext(Sf);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},im=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(Sf.Provider,{value:e,children:t})),Ef=S.createContext(!1),Pf=()=>S.useContext(Ef);Ef.Provider;function am(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var sm=S.createContext(am()),Rf=()=>S.useContext(sm),kf=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Mf=e=>{S.useEffect(()=>{e.clearReset()},[e])},Of=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||gf(n,[e.error,r])),zl=(e,t)=>t.state.data===void 0,Tf=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Df=(e,t)=>e.isLoading&&e.isFetching&&!t,Js=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ui=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _f({queries:e,...t},n){const r=Qo(n),o=Pf(),i=Rf(),a=S.useMemo(()=>e.map(m=>{const v=r.defaultQueryOptions(m);return v._optimisticResults=o?"isRestoring":"optimistic",v}),[e,r,o]);a.forEach(m=>{Tf(m),kf(m,i)}),Mf(i);const[s]=S.useState(()=>new nm(r,a,t)),[l,u,h]=s.getOptimisticResult(a,t.combine),c=!o&&t.subscribed!==!1;S.useSyncExternalStore(S.useCallback(m=>c?s.subscribe(be.batchCalls(m)):Le,[s,c]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),S.useEffect(()=>{s.setQueries(a,t)},[a,t,s]);const f=l.some((m,v)=>Js(a[v],m))?l.flatMap((m,v)=>{const b=a[v];if(b){const x=new Go(r,b);if(Js(b,m))return Ui(b,x,i);Df(m,o)&&Ui(b,x,i)}return[]}):[];if(f.length>0)throw Promise.all(f);const g=l.find((m,v)=>{const b=a[v];return b&&Of({result:m,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g!=null&&g.error)throw g.error;return u(h())}function wa(e,t,n){var c,p,f,g,m;const r=Pf(),o=Rf(),i=Qo(n),a=i.defaultQueryOptions(e);(p=(c=i.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||p.call(c,a),a._optimisticResults=r?"isRestoring":"optimistic",Tf(a),kf(a,o),Mf(o);const s=!i.getQueryCache().get(a.queryHash),[l]=S.useState(()=>new t(i,a)),u=l.getOptimisticResult(a),h=!r&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(v=>{const b=h?l.subscribe(be.batchCalls(v)):Le;return l.updateResult(),b},[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setOptions(a)},[a,l]),Js(a,u))throw Ui(a,l,o);if(Of({result:u,errorResetBoundary:o,throwOnError:a.throwOnError,query:i.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((g=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||g.call(f,a,u),a.experimental_prefetchInRender&&!Un&&Df(u,r)){const v=s?Ui(a,l,o):(m=i.getQueryCache().get(a.queryHash))==null?void 0:m.promise;v==null||v.catch(Le).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function lm(e,t){return wa(e,Go,t)}function um(e,t){return wa({...e,enabled:!0,suspense:!0,throwOnError:zl,placeholderData:void 0},Go,t)}function cm(e,t){return wa({...e,enabled:!0,suspense:!0,throwOnError:zl},Cf,t)}function dm(e,t){return _f({...e,queries:e.queries.map(n=>({...n,suspense:!0,throwOnError:zl,enabled:!0,placeholderData:void 0}))},t)}function fm(e,t){const n=Qo(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function hm(e,t){const n=Qo(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function pm(e,t){const n=Qo(t),[r]=S.useState(()=>new em(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const o=S.useSyncExternalStore(S.useCallback(a=>r.subscribe(be.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=S.useCallback((a,s)=>{r.mutate(a,s).catch(Le)},[r]);if(o.error&&gf(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}function gm(e,t){return wa(e,Cf,t)}var mm=Object.create,Ff=Object.defineProperty,vm=Object.getOwnPropertyDescriptor,Lf=Object.getOwnPropertyNames,bm=Object.getPrototypeOf,ym=Object.prototype.hasOwnProperty,Lt=(e,t)=>function(){return t||(0,e[Lf(e)[0]])((t={exports:{}}).exports,t),t.exports},xm=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Lf(t),i=0,a=o.length,s;i<a;i++)s=o[i],!ym.call(e,s)&&s!==n&&Ff(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(r=vm(t,s))||r.enumerable});return e},we=(e,t,n)=>(n=e!=null?mm(bm(e)):{},xm(Ff(n,"default",{value:e,enumerable:!0}),e)),If=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(r){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t.exports.__esModule=!0,t.exports.default=t.exports,n(r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),wm=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=If().default;function r(o,i){if(n(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var s=a.call(o,i||"default");if(n(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Cm=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=If().default,r=wm();function o(i){var a=r(i,"string");return n(a)=="symbol"?a:a+""}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}}),Zn=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Cm();function r(o,i,a){return(i=n(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),St=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Zn();function r(i,a){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);a&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),s.push.apply(s,l)}return s}function o(i){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?r(Object(s),!0).forEach(function(l){n(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}});function Ca(e){const t={subscribe(n){let r=null,o=!1,i=!1,a=!1;function s(){if(r===null){a=!0;return}i||(i=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var u;o||(u=n.next)===null||u===void 0||u.call(n,l)},error(l){var u;o||(o=!0,(u=n.error)===null||u===void 0||u.call(n,l),s())},complete(){var l;o||(o=!0,(l=n.complete)===null||l===void 0||l.call(n),s())}}),a&&s(),{unsubscribe:s}},pipe(...n){return n.reduce($m,t)}};return t}function $m(e,t){return t(e)}function Sm(e){const t=new AbortController;return new Promise((r,o)=>{let i=!1;function a(){i||(i=!0,s.unsubscribe())}t.signal.addEventListener("abort",()=>{o(t.signal.reason)});const s=e.subscribe({next(l){i=!0,r(l),a()},error(l){o(l)},complete(){t.abort(),a()}})})}function Em(e){return t=>{let n=0,r=null;const o=[];function i(){r||(r=t.subscribe({next(s){for(const u of o){var l;(l=u.next)===null||l===void 0||l.call(u,s)}},error(s){for(const u of o){var l;(l=u.error)===null||l===void 0||l.call(u,s)}},complete(){for(const l of o){var s;(s=l.complete)===null||s===void 0||s.call(l)}}}))}function a(){if(n===0&&r){const s=r;r=null,s.unsubscribe()}}return Ca(s=>(n++,o.push(s),i(),{unsubscribe(){n--,a();const l=o.findIndex(u=>u===s);l>-1&&o.splice(l,1)}}))}}function Pm(e){let t=e;const n=[],r=a=>{t!==void 0&&a.next(t),n.push(a)},o=a=>{n.splice(n.indexOf(a),1)},i=Ca(a=>(r(a),()=>{o(a)}));return i.next=a=>{if(t!==a){t=a;for(const s of n)s.next(a)}},i.get=()=>t,i}function Rm(e){return Ca(t=>{function n(o=0,i=e.op){const a=e.links[o];if(!a)throw new Error("No more links to execute - did you forget to add an ending link?");return a({op:i,next(l){return n(o+1,l)}})}return n().subscribe(t)})}function qn(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const km=typeof Symbol=="function"&&!!Symbol.asyncIterator;function Nf(e){return km&&qn(e)&&Symbol.asyncIterator in e}var Mm=Object.create,jf=Object.defineProperty,Om=Object.getOwnPropertyDescriptor,Af=Object.getOwnPropertyNames,Tm=Object.getPrototypeOf,Dm=Object.prototype.hasOwnProperty,Yo=(e,t)=>function(){return t||(0,e[Af(e)[0]])((t={exports:{}}).exports,t),t.exports},_m=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Af(t),i=0,a=o.length,s;i<a;i++)s=o[i],!Dm.call(e,s)&&s!==n&&jf(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(r=Om(t,s))||r.enumerable});return e},$a=(e,t,n)=>(n=e!=null?Mm(Tm(e)):{},_m(jf(n,"default",{value:e,enumerable:!0}),e));const Kf=()=>{},Qu=e=>{Object.freeze&&Object.freeze(e)};function Bf(e,t,n){var r;const o=t.join(".");return(r=n[o])!==null&&r!==void 0||(n[o]=new Proxy(Kf,{get(i,a){if(!(typeof a!="string"||a==="then"))return Bf(e,[...t,a],n)},apply(i,a,s){const l=t[t.length-1];let u={args:s,path:t};return l==="call"?u={args:s.length>=2?[s[1]]:[],path:t.slice(0,-1)}:l==="apply"&&(u={args:s.length>=2?s[1]:[],path:t.slice(0,-1)}),Qu(u.args),Qu(u.path),e(u)}})),n[o]}const Sa=e=>Bf(e,[],Object.create(null)),Ul=e=>new Proxy(Kf,{get(t,n){if(n!=="then")return e(n)}});var Hf=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(r){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t.exports.__esModule=!0,t.exports.default=t.exports,n(r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Fm=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Hf().default;function r(o,i){if(n(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var s=a.call(o,i||"default");if(n(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Lm=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Hf().default,r=Fm();function o(i){var a=r(i,"string");return n(a)=="symbol"?a:a+""}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}}),Vf=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Lm();function r(o,i,a){return(i=n(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),ql=Yo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Vf();function r(i,a){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);a&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),s.push.apply(s,l)}return s}function o(i){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?r(Object(s),!0).forEach(function(l){n(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}});$a(ql());$a(Vf());var di=$a(ql());function Im(e,t){if("error"in e){const r=t.deserialize(e.error);return{ok:!1,error:(0,di.default)((0,di.default)({},e),{},{error:r})}}return{ok:!0,result:(0,di.default)((0,di.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Qa=class extends Error{constructor(){super("Unable to transform response from server")}};function Nm(e,t){let n;try{n=Im(e,t)}catch{throw new Qa}if(!n.ok&&(!qn(n.error.error)||typeof n.error.error.code!="number"))throw new Qa;if(n.ok&&!qn(n.result))throw new Qa;return n}$a(ql());var fi=we(Zn()),ar=we(St());function jm(e){return e instanceof qi}function Am(e){return qn(e)&&qn(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Km(e,t){return typeof e=="string"?e:qn(e)&&typeof e.message=="string"?e.message:t}var qi=class Ii extends Error{constructor(t,n){var r,o;const i=n==null?void 0:n.cause;super(t,{cause:i}),(0,fi.default)(this,"cause",void 0),(0,fi.default)(this,"shape",void 0),(0,fi.default)(this,"data",void 0),(0,fi.default)(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=i,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(o=n.result)===null||o===void 0?void 0:o.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ii.prototype)}static from(t,n={}){const r=t;return jm(r)?(n.meta&&(r.meta=(0,ar.default)((0,ar.default)({},r.meta),n.meta)),r):Am(r)?new Ii(r.error.message,(0,ar.default)((0,ar.default)({},n),{},{result:r})):new Ii(Km(r,"Unknown error"),(0,ar.default)((0,ar.default)({},n),{},{cause:r}))}};function Bm(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const Yu=e=>typeof e=="function";function Hm(e){if(e)return e;if(typeof window<"u"&&Yu(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Yu(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var bo=we(St());function Vm(e){return{url:e.url.toString(),fetch:e.fetch,transformer:Bm(e.transformer),methodOverride:e.methodOverride}}function zm(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const Um={query:"GET",mutation:"POST",subscription:"PATCH"};function zf(e){return"input"in e?e.transformer.input.serialize(e.input):zm(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Uf=e=>{const t=e.url.split("?");let r=t[0].replace(/\/$/,"")+"/"+e.path;const o=[];if(t[1]&&o.push(t[1]),"inputs"in e&&o.push("batch=1"),e.type==="query"||e.type==="subscription"){const i=zf(e);i!==void 0&&e.methodOverride!=="POST"&&o.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return o.length&&(r+="?"+o.join("&")),r},qm=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=zf(e);return t!==void 0?JSON.stringify(t):void 0},Wm=e=>Xm((0,bo.default)((0,bo.default)({},e),{},{contentTypeHeader:"application/json",getUrl:Uf,getBody:qm}));var Gm=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Qm=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Gm};async function Ym(e){var t;Qm(e.signal);const n=e.getUrl(e),r=e.getBody(e),o=(t=e.methodOverride)!==null&&t!==void 0?t:Um[e.type],i=await(async()=>{const s=await e.headers();return Symbol.iterator in s?Object.fromEntries(s):s})(),a=(0,bo.default)((0,bo.default)((0,bo.default)({},e.contentTypeHeader&&o!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0),i);return Hm(e.fetch)(n,{method:o,signal:e.signal,body:r,headers:a})}async function Xm(e){const t={},n=await Ym(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}we(St());const Xu=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Zu(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function o(s){const l=[[]];let u=0;for(;;){const p=s[u];if(!p)break;const f=l[l.length-1];if(p.aborted){var h;(h=p.reject)===null||h===void 0||h.call(p,new Error("Aborted")),u++;continue}if(e.validate(f.concat(p).map(m=>m.key))){f.push(p),u++;continue}if(f.length===0){var c;(c=p.reject)===null||c===void 0||c.call(p,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function i(){const s=o(t);r();for(const l of s){if(!l.length)continue;const u={items:l};for(const c of l)c.batch=u;e.fetch(u.items.map(c=>c.key)).then(async c=>{await Promise.all(c.map(async(f,g)=>{const m=u.items[g];try{var v;const x=await Promise.resolve(f);(v=m.resolve)===null||v===void 0||v.call(m,x)}catch(x){var b;(b=m.reject)===null||b===void 0||b.call(m,x)}m.batch=null,m.reject=null,m.resolve=null}));for(const f of u.items){var p;(p=f.reject)===null||p===void 0||p.call(f,new Error("Missing result")),f.batch=null}}).catch(c=>{for(const f of u.items){var p;(p=f.reject)===null||p===void 0||p.call(f,c),f.batch=null}})}}function a(s){var l;const u={aborted:!1,key:s,batch:null,resolve:Xu,reject:Xu},h=new Promise((c,p)=>{var f;u.reject=p,u.resolve=c,(f=t)!==null&&f!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(i)),h}return{load:a}}function Zm(...e){const t=new AbortController,n=e.length;let r=0;const o=()=>{++r===n&&t.abort()};for(const i of e)i!=null&&i.aborted?o():i==null||i.addEventListener("abort",o,{once:!0});return t.signal}var hi=we(St());function Jm(e){var t,n;const r=Vm(e),o=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,i=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const a=h=>({validate(c){if(o===1/0&&i===1/0)return!0;if(c.length>i)return!1;const p=c.map(m=>m.path).join(","),f=c.map(m=>m.input);return Uf((0,hi.default)((0,hi.default)({},r),{},{type:h,path:p,inputs:f,signal:null})).length<=o},async fetch(c){const p=c.map(x=>x.path).join(","),f=c.map(x=>x.input),g=Zm(...c.map(x=>x.signal)),m=await Wm((0,hi.default)((0,hi.default)({},r),{},{path:p,inputs:f,type:h,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:c}):e.headers:{}},signal:g}));return(Array.isArray(m.json)?m.json:c.map(()=>m.json)).map(x=>({meta:m.meta,json:x}))}}),s=Zu(a("query")),l=Zu(a("mutation")),u={query:s,mutation:l};return({op:h})=>Ca(c=>{/* istanbul ignore if -- @preserve */if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const f=u[h.type].load(h);let g;return f.then(m=>{g=m;const v=Nm(m.json,r.transformer.output);if(!v.ok){c.error(qi.from(v.error,{meta:m.meta}));return}c.next({context:m.meta,result:v.result}),c.complete()}).catch(m=>{c.error(qi.from(m,{meta:g==null?void 0:g.meta}))}),()=>{}})}}we(St());const qf=(e,...t)=>typeof e=="function"?e(...t):e;we(Zn());function ev(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}async function tv(e){const t=await qf(e.url);if(!e.connectionParams)return t;const r=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+r}async function nv(e){const t={method:"connectionParams",data:await qf(e)};return JSON.stringify(t)}we(Zn());var Dn=we(Zn());function rv(e){const{promise:t,resolve:n,reject:r}=ev();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function ov(e,{intervalMs:t,pongTimeoutMs:n}){let r,o;function i(){r=setTimeout(()=>{e.send("PING"),o=setTimeout(()=>{e.close()},n)},t)}function a(){clearTimeout(r),i()}function s(){clearTimeout(o),a()}e.addEventListener("open",i),e.addEventListener("message",({data:l})=>{clearTimeout(r),i(),l==="PONG"&&s()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(o)})}var iv=class el{constructor(t){var n;if((0,Dn.default)(this,"id",++el.connectCount),(0,Dn.default)(this,"WebSocketPonyfill",void 0),(0,Dn.default)(this,"urlOptions",void 0),(0,Dn.default)(this,"keepAliveOpts",void 0),(0,Dn.default)(this,"wsObservable",Pm(null)),(0,Dn.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++el.connectCount;const n=tv(t.urlOptions).then(r=>new t.WebSocketPonyfill(r));t.openPromise=n.then(async r=>{t.ws=r,r.addEventListener("message",function({data:o}){o==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&ov(r,t.keepAliveOpts),r.addEventListener("close",()=>{t.ws===r&&(t.ws=null)}),await rv(r),t.urlOptions.connectionParams&&r.send(await nv(t.urlOptions.connectionParams))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var n;(n=t.ws)===null||n===void 0||n.close()}}};(0,Dn.default)(iv,"connectCount",0);we(Zn());we(St());var Ya=we(Zn()),Ju=we(St()),Ea=class{constructor(e){(0,Ya.default)(this,"links",void 0),(0,Ya.default)(this,"runtime",void 0),(0,Ya.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Rm({links:this.links,op:(0,Ju.default)((0,Ju.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Em())}async requestAsPromise(e){var t=this;try{const n=t.$request(e);return(await Sm(n)).result.data}catch(n){throw qi.from(n)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(o){switch(o.result.type){case"state":{var i;(i=n.onConnectionStateChange)===null||i===void 0||i.call(n,o.result);break}case"started":{var a;(a=n.onStarted)===null||a===void 0||a.call(n,{context:o.context});break}case"stopped":{var s;(s=n.onStopped)===null||s===void 0||s.call(n);break}case"data":case void 0:{var l;(l=n.onData)===null||l===void 0||l.call(n,o.result.data);break}}},error(o){var i;(i=n.onError)===null||i===void 0||i.call(n,o)},complete(){var o;(o=n.onComplete)===null||o===void 0||o.call(n)}})}};const Wf=Symbol.for("trpc_untypedClient"),av={query:"query",mutate:"mutation",subscribe:"subscription"},sv=e=>av[e];function Gf(e){const t=Sa(({path:n,args:r})=>{const o=[...n],i=sv(o.pop()),a=o.join(".");return e[i](a,...r)});return Ul(n=>n===Wf?e:t[n])}function lv(e){const t=new Ea(e);return Gf(t)}function Wl(e){return e[Wf]}we(St());we(St());var uv=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(o){var i,a,s,l=2;for(typeof Symbol<"u"&&(a=Symbol.asyncIterator,s=Symbol.iterator);l--;){if(a&&(i=o[a])!=null)return i.call(o);if(s&&(i=o[s])!=null)return new r(i.call(o));a="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function r(o){function i(a){if(Object(a)!==a)return Promise.reject(new TypeError(a+" is not an object."));var s=a.done;return Promise.resolve(a.value).then(function(l){return{value:l,done:s}})}return r=function(s){this.s=s,this.n=s.next},r.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(s){var l=this.s.return;return l===void 0?Promise.resolve({value:s,done:!0}):i(l.apply(this.s,arguments))},throw:function(s){var l=this.s.return;return l===void 0?Promise.reject(s):i(l.apply(this.s,arguments))}},new r(o)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});we(uv());we(St());var cv=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var r=typeof SuppressedError=="function"?SuppressedError:function(s,l){var u=Error();return u.name="SuppressedError",u.error=s,u.suppressed=l,u},o={},i=[];function a(s,l){if(l!=null){if(Object(l)!==l)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(s)var u=l[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(u===void 0&&(u=l[Symbol.dispose||Symbol.for("Symbol.dispose")],s))var h=u;if(typeof u!="function")throw new TypeError("Object is not disposable.");h&&(u=function(){try{h.call(l)}catch(p){return Promise.reject(p)}}),i.push({v:l,d:u,a:s})}else s&&i.push({d:l,a:s});return l}return{e:o,u:a.bind(null,!1),a:a.bind(null,!0),d:function(){var l,u=this.e,h=0;function c(){for(;l=i.pop();)try{if(!l.a&&h===1)return h=0,i.push(l),Promise.resolve().then(c);if(l.d){var f=l.d.call(l.v);if(l.a)return h|=2,Promise.resolve(f).then(c,p)}else h|=1}catch(g){return p(g)}if(h===1)return u!==o?Promise.reject(u):Promise.resolve();if(u!==o)throw u}function p(f){return u=u!==o?new r(f,u):f,c()}return c()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Qf=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(r,o){this.v=r,this.k=o}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),dv=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=Qf();function r(o){return new n(o,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),fv=Lt({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=Qf();function r(i){return function(){return new o(i.apply(this,arguments))}}function o(i){var a,s;function l(h,c){try{var p=i[h](c),f=p.value,g=f instanceof n;Promise.resolve(g?f.v:f).then(function(m){if(g){var v=h==="return"?"return":"next";if(!f.k||m.done)return l(v,m);m=i[v](m).value}u(p.done?"return":"normal",m)},function(m){l("throw",m)})}catch(m){u("throw",m)}}function u(h,c){switch(h){case"return":a.resolve({value:c,done:!0});break;case"throw":a.reject(c);break;default:a.resolve({value:c,done:!1})}(a=a.next)?l(a.key,a.arg):s=null}this._invoke=function(h,c){return new Promise(function(p,f){var g={key:h,arg:c,resolve:p,reject:f,next:null};s?s=s.next=g:(a=s=g,l(h,c))})},typeof i.return!="function"&&(this.return=void 0)}o.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(i){return this._invoke("next",i)},o.prototype.throw=function(i){return this._invoke("throw",i)},o.prototype.return=function(i){return this._invoke("return",i)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});we(cv());we(dv());we(fv());we(St());var Nr=function(){return Nr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Nr.apply(this,arguments)};function hv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function pv(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(h){try{u(r.next(h))}catch(c){a(c)}}function l(h){try{u(r.throw(h))}catch(c){a(c)}}function u(h){h.done?i(h.value):o(h.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function gv(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(h){u=[6,h],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Ke(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var mv=Object.create,Yf=Object.defineProperty,vv=Object.getOwnPropertyDescriptor,Xf=Object.getOwnPropertyNames,bv=Object.getPrototypeOf,yv=Object.prototype.hasOwnProperty,$n=(e,t)=>function(){return t||(0,e[Xf(e)[0]])((t={exports:{}}).exports,t),t.exports},xv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Xf(t),i=0,a=o.length,s;i<a;i++)s=o[i],!yv.call(e,s)&&s!==n&&Yf(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(r=vv(t,s))||r.enumerable});return e},Jn=(e,t,n)=>(n=e!=null?mv(bv(e)):{},xv(t||!e||!e.__esModule?Yf(n,"default",{value:e,enumerable:!0}):n,e)),wv=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(r,o){if(r==null)return{};var i={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(o.includes(a))continue;i[a]=r[a]}return i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Cv=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=wv();function r(o,i){if(o==null)return{};var a,s,l=n(o,i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);for(s=0;s<u.length;s++)a=u[s],i.includes(a)||{}.propertyIsEnumerable.call(o,a)&&(l[a]=o[a])}return l}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Zf=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(r){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t.exports.__esModule=!0,t.exports.default=t.exports,n(r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),$v=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Zf().default;function r(o,i){if(n(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var s=a.call(o,i||"default");if(n(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Sv=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Zf().default,r=$v();function o(i){var a=r(i,"string");return n(a)=="symbol"?a:a+""}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ev=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Sv();function r(o,i,a){return(i=n(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Xo=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Ev();function r(i,a){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);a&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),s.push.apply(s,l)}return s}function o(i){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?r(Object(s),!0).forEach(function(l){n(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}}),Pv=Jn(Cv(),1),ec=Jn(Xo(),1);const Rv=["cursor","direction"];function Ot(e,t,n){const r=e.flatMap(o=>o.split("."));if(!t&&(!n||n==="any"))return r.length?[r]:[];if(n==="infinite"&&qn(t)&&("direction"in t||"cursor"in t)){const{cursor:o,direction:i}=t,a=(0,Pv.default)(t,Rv);return[r,{input:a,type:"infinite"}]}return[r,(0,ec.default)((0,ec.default)({},typeof t<"u"&&t!==tt&&{input:t}),n&&n!=="any"&&{type:n})]}function Ni(e){return Ot(e,void 0,"any")}function kv(e){return Sa(({path:t,args:n})=>{var r;const o=[...t],i=o.pop();if(i==="useMutation")return e[i](o,...n);if(i==="_def")return{path:o};const[a,...s]=n,l=(r=s[0])!==null&&r!==void 0?r:{};return e[i](o,a,l)})}var Xa;const Mv=["client","ssrContext","ssrState","abortOnUnmount"],Ov=(Xa=S.createContext)===null||Xa===void 0?void 0:Xa.call(S,null),Tv=e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function Dv(e){return Sa(t=>{const n=[...t.path],r=n.pop(),o=[...t.args],i=o.shift(),a=Tv(r),s=Ot(n,i,a);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,s,o[0]),queryOptions:()=>e.queryOptions(n,s,...o),fetch:()=>e.fetchQuery(s,...o),fetchInfinite:()=>e.fetchInfiniteQuery(s,o[0]),prefetch:()=>e.prefetchQuery(s,...o),prefetchInfinite:()=>e.prefetchInfiniteQuery(s,o[0]),ensureData:()=>e.ensureQueryData(s,...o),invalidate:()=>e.invalidateQueries(s,...o),reset:()=>e.resetQueries(s,...o),refetch:()=>e.refetchQueries(s,...o),cancel:()=>e.cancelQuery(s,...o),setData:()=>{e.setQueryData(s,o[0],o[1])},setQueriesData:()=>e.setQueriesData(s,o[0],o[1],o[2]),setInfiniteData:()=>{e.setInfiniteQueryData(s,o[0],o[1])},getData:()=>e.getQueryData(s),getInfiniteData:()=>e.getInfiniteQueryData(s),setMutationDefaults:()=>e.setMutationDefaults(Ni(n),i),getMutationDefaults:()=>e.getMutationDefaults(Ni(n)),isMutating:()=>e.isMutating({mutationKey:Ni(n)})}[r]()})}function _v(e){const t=Gf(e.client),n=Dv(e);return Ul(r=>{const o=r;return o==="client"?t:Mv.includes(o)?e[o]:n[r]})}var Fv=Jn(Xo(),1);function tc(e){const t=e instanceof Ea?e:Wl(e);return Sa(n=>{const r=n.path,o=r.join("."),[i,a]=n.args;return(0,Fv.default)({queryKey:Ot(r,i,"query"),queryFn:()=>t.query(o,i,a==null?void 0:a.trpc)},a)})}var Za=Jn(Xo(),1);function je(e,t,n){var r;const o=e[0];let i=(r=e[1])===null||r===void 0?void 0:r.input;if(n){var a;i=(0,Za.default)((0,Za.default)((0,Za.default)({},(a=i)!==null&&a!==void 0?a:{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[o.join("."),i,t==null?void 0:t.trpc]}var Lv=$n({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(o){var i,a,s,l=2;for(typeof Symbol<"u"&&(a=Symbol.asyncIterator,s=Symbol.iterator);l--;){if(a&&(i=o[a])!=null)return i.call(o);if(s&&(i=o[s])!=null)return new r(i.call(o));a="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function r(o){function i(a){if(Object(a)!==a)return Promise.reject(new TypeError(a+" is not an object."));var s=a.done;return Promise.resolve(a.value).then(function(l){return{value:l,done:s}})}return r=function(s){this.s=s,this.n=s.next},r.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(s){var l=this.s.return;return l===void 0?Promise.resolve({value:s,done:!0}):i(l.apply(this.s,arguments))},throw:function(s){var l=this.s.return;return l===void 0?Promise.reject(s):i(l.apply(this.s,arguments))}},new r(o)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Iv=Jn(Lv(),1);function tl(e){return{path:e.path.join(".")}}function no(e){const t=tl(e);return S.useMemo(()=>t,[t])}async function Jf(e,t,n){const o=t.getQueryCache().build(t,{queryKey:n});o.setState({data:[],status:"success"});const i=[];var a=!1,s=!1,l;try{for(var u=(0,Iv.default)(e),h;a=!(h=await u.next()).done;a=!1){const c=h.value;i.push(c),o.setState({data:[...i]})}}catch(c){s=!0,l=c}finally{try{a&&u.return!=null&&await u.return()}finally{if(s)throw l}}return i}var ae=Jn(Xo(),1);function Nv(e){const{client:t,queryClient:n}=e,r=t instanceof Ea?t:Wl(t);return{infiniteQueryOptions:(o,i,a)=>{var s,l;const u=((s=i[1])===null||s===void 0?void 0:s.input)===tt,h=async c=>{var p;const f=(0,ae.default)((0,ae.default)({},a),{},{trpc:(0,ae.default)((0,ae.default)({},a==null?void 0:a.trpc),!(a==null||(p=a.trpc)===null||p===void 0)&&p.abortOnUnmount?{signal:c.signal}:{signal:null})});return await r.query(...je(i,f,{direction:c.direction,pageParam:c.pageParam}))};return Object.assign((0,ae.default)((0,ae.default)({},a),{},{initialData:a==null?void 0:a.initialData,queryKey:i,queryFn:u?tt:h,initialPageParam:(l=a==null?void 0:a.initialCursor)!==null&&l!==void 0?l:null}),{trpc:tl({path:o})})},queryOptions:(o,i,a)=>{var s;const l=((s=i[1])===null||s===void 0?void 0:s.input)===tt,u=async h=>{var c;const p=(0,ae.default)((0,ae.default)({},a),{},{trpc:(0,ae.default)((0,ae.default)({},a==null?void 0:a.trpc),!(a==null||(c=a.trpc)===null||c===void 0)&&c.abortOnUnmount?{signal:h.signal}:{signal:null})}),f=await r.query(...je(i,p));return Nf(f)?Jf(f,n,i):f};return Object.assign((0,ae.default)((0,ae.default)({},a),{},{initialData:a==null?void 0:a.initialData,queryKey:i,queryFn:l?tt:u}),{trpc:tl({path:o})})},fetchQuery:(o,i)=>n.fetchQuery((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:()=>r.query(...je(o,i))})),fetchInfiniteQuery:(o,i)=>{var a;return n.fetchInfiniteQuery((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:({pageParam:s,direction:l})=>r.query(...je(o,i,{pageParam:s,direction:l})),initialPageParam:(a=i==null?void 0:i.initialCursor)!==null&&a!==void 0?a:null}))},prefetchQuery:(o,i)=>n.prefetchQuery((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:()=>r.query(...je(o,i))})),prefetchInfiniteQuery:(o,i)=>{var a;return n.prefetchInfiniteQuery((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:({pageParam:s,direction:l})=>r.query(...je(o,i,{pageParam:s,direction:l})),initialPageParam:(a=i==null?void 0:i.initialCursor)!==null&&a!==void 0?a:null}))},ensureQueryData:(o,i)=>n.ensureQueryData((0,ae.default)((0,ae.default)({},i),{},{queryKey:o,queryFn:()=>r.query(...je(o,i))})),invalidateQueries:(o,i,a)=>n.invalidateQueries((0,ae.default)((0,ae.default)({},i),{},{queryKey:o}),a),resetQueries:(o,i,a)=>n.resetQueries((0,ae.default)((0,ae.default)({},i),{},{queryKey:o}),a),refetchQueries:(o,i,a)=>n.refetchQueries((0,ae.default)((0,ae.default)({},i),{},{queryKey:o}),a),cancelQuery:(o,i)=>n.cancelQueries({queryKey:o},i),setQueryData:(o,i,a)=>n.setQueryData(o,i,a),setQueriesData:(o,i,a,s)=>n.setQueriesData((0,ae.default)((0,ae.default)({},i),{},{queryKey:o}),a,s),getQueryData:o=>n.getQueryData(o),setInfiniteQueryData:(o,i,a)=>n.setQueryData(o,i,a),getInfiniteQueryData:o=>n.getQueryData(o),setMutationDefaults:(o,i)=>{const a=o[0],s=l=>r.mutation(...je([a,{input:l}],e));return n.setMutationDefaults(o,typeof i=="function"?i({canonicalMutationFn:s}):i)},getMutationDefaults:o=>n.getMutationDefaults(o),isMutating:o=>n.isMutating((0,ae.default)((0,ae.default)({},o),{},{exact:!0}))}}var U=Jn(Xo());const nc=(e,t)=>new Proxy(e,{get(r,o){return t(o),r[o]}});function jv(e){var t,n,r;const o=(t=e==null||(n=e.overrides)===null||n===void 0||(n=n.useMutation)===null||n===void 0?void 0:n.onSuccess)!==null&&t!==void 0?t:E=>E.originalFn(),i=(r=e==null?void 0:e.context)!==null&&r!==void 0?r:Ov,a=lv,s=E=>{var R;const{abortOnUnmount:M=!1,queryClient:_,ssrContext:D}=E,[P,I]=S.useState((R=E.ssrState)!==null&&R!==void 0?R:!1),N=E.client instanceof Ea?E.client:Wl(E.client),F=S.useMemo(()=>Nv({client:N,queryClient:_}),[N,_]),j=S.useMemo(()=>(0,U.default)({abortOnUnmount:M,queryClient:_,client:N,ssrContext:D??null,ssrState:P},F),[M,N,F,_,D,P]);return S.useEffect(()=>{I(O=>O?"mounted":!1)},[]),y.jsx(i.Provider,{value:j,children:E.children})};function l(){const E=S.useContext(i);if(!E)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return E}function u(E,R){var M;const{queryClient:_,ssrState:D}=l();return D&&D!=="mounted"&&((M=_.getQueryCache().find({queryKey:E}))===null||M===void 0?void 0:M.state.status)==="error"?(0,U.default)({retryOnMount:!1},R):R}function h(E,R,M){var _,D,P,I,N;const F=l(),{abortOnUnmount:j,client:O,ssrState:T,queryClient:A,prefetchQuery:K}=F,L=Ot(E,R,"query"),H=A.getQueryDefaults(L),z=R===tt;typeof window>"u"&&T==="prepass"&&(M==null||(_=M.trpc)===null||_===void 0?void 0:_.ssr)!==!1&&((D=M==null?void 0:M.enabled)!==null&&D!==void 0?D:H==null?void 0:H.enabled)!==!1&&!z&&!A.getQueryCache().find({queryKey:L})&&K(L,M);const V=u(L,(0,U.default)((0,U.default)({},H),M)),W=(P=(I=M==null||(N=M.trpc)===null||N===void 0?void 0:N.abortOnUnmount)!==null&&I!==void 0?I:e==null?void 0:e.abortOnUnmount)!==null&&P!==void 0?P:j,q=lm((0,U.default)((0,U.default)({},V),{},{queryKey:L,queryFn:z?R:async ne=>{const pe=(0,U.default)((0,U.default)({},V),{},{trpc:(0,U.default)((0,U.default)({},V==null?void 0:V.trpc),W?{signal:ne.signal}:{signal:null})}),ee=await O.query(...je(L,pe));return Nf(ee)?Jf(ee,A,L):ee}}),A);return q.trpc=no({path:E}),q}function c(E,R,M){var _,D,P;const I=l(),N=Ot(E,R,"query"),F=R===tt,j=(_=(D=M==null||(P=M.trpc)===null||P===void 0?void 0:P.abortOnUnmount)!==null&&D!==void 0?D:e==null?void 0:e.abortOnUnmount)!==null&&_!==void 0?_:I.abortOnUnmount;fm((0,U.default)((0,U.default)({},M),{},{queryKey:N,queryFn:F?R:O=>{const T={trpc:(0,U.default)((0,U.default)({},M==null?void 0:M.trpc),j?{signal:O.signal}:{})};return I.client.query(...je(N,T))}}))}function p(E,R,M){var _,D,P;const I=l(),N=Ot(E,R,"query"),F=(_=(D=M==null||(P=M.trpc)===null||P===void 0?void 0:P.abortOnUnmount)!==null&&D!==void 0?D:e==null?void 0:e.abortOnUnmount)!==null&&_!==void 0?_:I.abortOnUnmount,j=um((0,U.default)((0,U.default)({},M),{},{queryKey:N,queryFn:O=>{const T=(0,U.default)((0,U.default)({},M),{},{trpc:(0,U.default)((0,U.default)({},M==null?void 0:M.trpc),F?{signal:O.signal}:{signal:null})});return I.client.query(...je(N,T))}}),I.queryClient);return j.trpc=no({path:E}),[j.data,j]}function f(E,R){const{client:M,queryClient:_}=l(),D=Ni(E),P=_.defaultMutationOptions(_.getMutationDefaults(D)),I=pm((0,U.default)((0,U.default)({},R),{},{mutationKey:D,mutationFn:N=>M.mutation(...je([E,{input:N}],R)),onSuccess(...N){var F,j;return o({originalFn:()=>{var T,A,K;return(T=R==null||(A=R.onSuccess)===null||A===void 0?void 0:A.call(R,...N))!==null&&T!==void 0?T:P==null||(K=P.onSuccess)===null||K===void 0?void 0:K.call(P,...N)},queryClient:_,meta:(F=(j=R==null?void 0:R.meta)!==null&&j!==void 0?j:P==null?void 0:P.meta)!==null&&F!==void 0?F:{}})}}),_);return I.trpc=no({path:E}),I}const g={data:void 0,error:null,status:"idle"},m={data:void 0,error:null,status:"connecting"};/* istanbul ignore next -- @preserve */function v(E,R,M){var _;const D=(_=M==null?void 0:M.enabled)!==null&&_!==void 0?_:R!==tt,P=yn(Ot(E,R,"any")),{client:I}=l(),N=S.useRef(M);S.useEffect(()=>{N.current=M});const[F]=S.useState(new Set([])),j=S.useCallback(z=>{F.add(z)},[F]),O=S.useRef(null),T=S.useCallback(z=>{const V=K.current,W=K.current=z(V);let q=!1;for(const ne of F)if(V[ne]!==W[ne]){q=!0;break}q&&H(nc(W,j))},[j,F]),A=S.useCallback(()=>{var z;if((z=O.current)===null||z===void 0||z.unsubscribe(),!D){T(()=>(0,U.default)((0,U.default)({},g),{},{reset:A}));return}T(()=>(0,U.default)((0,U.default)({},m),{},{reset:A}));const V=I.subscription(E.join("."),R??void 0,{onStarted:()=>{var W,q;(W=(q=N.current).onStarted)===null||W===void 0||W.call(q),T(ne=>(0,U.default)((0,U.default)({},ne),{},{status:"pending",error:null}))},onData:W=>{var q,ne;(q=(ne=N.current).onData)===null||q===void 0||q.call(ne,W),T(pe=>(0,U.default)((0,U.default)({},pe),{},{status:"pending",data:W,error:null}))},onError:W=>{var q,ne;(q=(ne=N.current).onError)===null||q===void 0||q.call(ne,W),T(pe=>(0,U.default)((0,U.default)({},pe),{},{status:"error",error:W}))},onConnectionStateChange:W=>{T(q=>{switch(W.state){case"idle":return(0,U.default)((0,U.default)({},q),{},{status:W.state,error:null,data:void 0});case"connecting":return(0,U.default)((0,U.default)({},q),{},{error:W.error,status:W.state});case"pending":return q}})},onComplete:()=>{var W,q;(W=(q=N.current).onComplete)===null||W===void 0||W.call(q),T(ne=>(0,U.default)((0,U.default)({},ne),{},{status:"idle",error:null,data:void 0}))}});O.current=V},[I,P,D,T]);S.useEffect(()=>(A(),()=>{var z;(z=O.current)===null||z===void 0||z.unsubscribe()}),[A]);const K=S.useRef(D?(0,U.default)((0,U.default)({},m),{},{reset:A}):(0,U.default)((0,U.default)({},g),{},{reset:A})),[L,H]=S.useState(nc(K.current,j));return L}function b(E,R,M){var _,D,P,I,N;const{client:F,ssrState:j,prefetchInfiniteQuery:O,queryClient:T,abortOnUnmount:A}=l(),K=Ot(E,R,"infinite"),L=T.getQueryDefaults(K),H=R===tt;typeof window>"u"&&j==="prepass"&&(M==null||(_=M.trpc)===null||_===void 0?void 0:_.ssr)!==!1&&((D=M==null?void 0:M.enabled)!==null&&D!==void 0?D:L==null?void 0:L.enabled)!==!1&&!H&&!T.getQueryCache().find({queryKey:K})&&O(K,(0,U.default)((0,U.default)({},L),M));const z=u(K,(0,U.default)((0,U.default)({},L),M)),V=(P=M==null||(I=M.trpc)===null||I===void 0?void 0:I.abortOnUnmount)!==null&&P!==void 0?P:A,W=gm((0,U.default)((0,U.default)({},z),{},{initialPageParam:(N=M.initialCursor)!==null&&N!==void 0?N:null,persister:M.persister,queryKey:K,queryFn:H?R:q=>{var ne;const pe=(0,U.default)((0,U.default)({},z),{},{trpc:(0,U.default)((0,U.default)({},z==null?void 0:z.trpc),V?{signal:q.signal}:{signal:null})});return F.query(...je(K,pe,{pageParam:(ne=q.pageParam)!==null&&ne!==void 0?ne:M.initialCursor,direction:q.direction}))}}),T);return W.trpc=no({path:E}),W}function x(E,R,M){var _,D,P;const I=l(),N=Ot(E,R,"infinite"),F=I.queryClient.getQueryDefaults(N),j=R===tt,O=u(N,(0,U.default)((0,U.default)({},F),M)),T=(_=M==null||(D=M.trpc)===null||D===void 0?void 0:D.abortOnUnmount)!==null&&_!==void 0?_:I.abortOnUnmount;hm((0,U.default)((0,U.default)({},M),{},{initialPageParam:(P=M.initialCursor)!==null&&P!==void 0?P:null,queryKey:N,queryFn:j?R:A=>{var K;const L=(0,U.default)((0,U.default)({},O),{},{trpc:(0,U.default)((0,U.default)({},O==null?void 0:O.trpc),T?{signal:A.signal}:{})});return I.client.query(...je(N,L,{pageParam:(K=A.pageParam)!==null&&K!==void 0?K:M.initialCursor,direction:A.direction}))}}))}function w(E,R,M){var _,D,P;const I=l(),N=Ot(E,R,"infinite"),F=I.queryClient.getQueryDefaults(N),j=u(N,(0,U.default)((0,U.default)({},F),M)),O=(_=M==null||(D=M.trpc)===null||D===void 0?void 0:D.abortOnUnmount)!==null&&_!==void 0?_:I.abortOnUnmount,T=cm((0,U.default)((0,U.default)({},M),{},{initialPageParam:(P=M.initialCursor)!==null&&P!==void 0?P:null,queryKey:N,queryFn:A=>{var K;const L=(0,U.default)((0,U.default)({},j),{},{trpc:(0,U.default)((0,U.default)({},j==null?void 0:j.trpc),O?{signal:A.signal}:{})});return I.client.query(...je(N,L,{pageParam:(K=A.pageParam)!==null&&K!==void 0?K:M.initialCursor,direction:A.direction}))}}),I.queryClient);return T.trpc=no({path:E}),[T.data,T]}return{Provider:s,createClient:a,useContext:l,useUtils:l,useQuery:h,usePrefetchQuery:c,useSuspenseQuery:p,useQueries:(E,R)=>{const{ssrState:M,queryClient:_,prefetchQuery:D,client:P}=l(),I=tc(P),N=E(I);if(typeof window>"u"&&M==="prepass")for(const j of N){var F;const O=j;((F=O.trpc)===null||F===void 0?void 0:F.ssr)!==!1&&!_.getQueryCache().find({queryKey:O.queryKey})&&D(O.queryKey,O)}return _f({queries:N.map(j=>(0,U.default)((0,U.default)({},j),{},{queryKey:j.queryKey})),combine:R==null?void 0:R.combine},_)},useSuspenseQueries:E=>{const{queryClient:R,client:M}=l(),_=tc(M),D=E(_),P=dm({queries:D.map(I=>(0,U.default)((0,U.default)({},I),{},{queryFn:I.queryFn,queryKey:I.queryKey}))},R);return[P.map(I=>I.data),P]},useMutation:f,useSubscription:v,useInfiniteQuery:b,usePrefetchInfiniteQuery:x,useSuspenseInfiniteQuery:w}}function Av(e){const t=kv(e);return Ul(n=>n==="useContext"||n==="useUtils"?()=>{const r=e.useUtils();return S.useMemo(()=>_v(r),[r])}:e.hasOwnProperty(n)?e[n]:t[n])}function Kv(e){const t=jv(e);return Av(t)}var le=Kv({overrides:{useMutation:{onSuccess:function(e){return pv(this,void 0,void 0,function(){return gv(this,function(t){switch(t.label){case 0:return[4,e.originalFn()];case 1:return t.sent(),[4,e.queryClient.invalidateQueries()];case 2:return t.sent(),[2]}})})}}}});/**
|
|
10
10
|
* react-router v7.9.6
|
|
11
11
|
*
|
|
12
12
|
* Copyright (c) Remix Software Inc.
|
|
@@ -60,7 +60,7 @@ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}
|
|
|
60
60
|
*/function aa(e,t){return e?s8(e)?S.createElement(e,t):e:null}function s8(e){return l8(e)||typeof e=="function"||u8(e)}function l8(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function u8(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function v1(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=S.useState(()=>({current:a8(t)})),[r,o]=S.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:a=>{o(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const b1=6048e5,c8=864e5,id=6e4,ad=525600,mr=43200,sa=1440,sd=Symbol.for("constructDateFrom");function Qt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&sd in e?e[sd](t):e instanceof Date?new e.constructor(t):new Date(t)}function Oe(e,t){return Qt(t||e,e)}let d8={};function eo(){return d8}function Lo(e,t){var s,l,u,h;const n=eo(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,o=Oe(e,t==null?void 0:t.in),i=o.getDay(),a=(i<r?7:0)+i-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function la(e,t){return Lo(e,{...t,weekStartsOn:1})}function y1(e,t){const n=Oe(e,t==null?void 0:t.in),r=n.getFullYear(),o=Qt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=la(o),a=Qt(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const s=la(a);return n.getTime()>=i.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Br(e){const t=Oe(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ni(e,...t){const n=Qt.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function ld(e,t){const n=Oe(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function f8(e,t,n){const[r,o]=ni(n==null?void 0:n.in,e,t),i=ld(r),a=ld(o),s=+i-Br(i),l=+a-Br(a);return Math.round((s-l)/c8)}function h8(e,t){const n=y1(e,t),r=Qt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),la(r)}function $o(e,t){const n=+Oe(e)-+Oe(t);return n<0?-1:n>0?1:n}function p8(e){return Qt(e,Date.now())}function g8(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function m8(e){return!(!g8(e)&&typeof e!="number"||isNaN(+Oe(e)))}function v8(e,t,n){const[r,o]=ni(n==null?void 0:n.in,e,t),i=r.getFullYear()-o.getFullYear(),a=r.getMonth()-o.getMonth();return i*12+a}function x1(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function b8(e,t){return+Oe(e)-+Oe(t)}function y8(e,t){const n=Oe(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function x8(e,t){const n=Oe(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function w8(e,t){const n=Oe(e,t==null?void 0:t.in);return+y8(n,t)==+x8(n,t)}function C8(e,t,n){const[r,o,i]=ni(n==null?void 0:n.in,e,e,t),a=$o(o,i),s=Math.abs(v8(o,i));if(s<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-a*s);let l=$o(o,i)===-a;w8(r)&&s===1&&$o(r,i)===1&&(l=!1);const u=a*(s-+l);return u===0?0:u}function $8(e,t,n){const r=b8(e,t)/1e3;return x1(n==null?void 0:n.roundingMethod)(r)}function S8(e,t){const n=Oe(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const E8={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},P8=(e,t,n)=>{let r;const o=E8[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Cs(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const R8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},k8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},M8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},O8={date:Cs({formats:R8,defaultWidth:"full"}),time:Cs({formats:k8,defaultWidth:"full"}),dateTime:Cs({formats:M8,defaultWidth:"full"})},T8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},D8=(e,t,n,r)=>T8[e];function so(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):a;o=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[s]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const _8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},F8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},L8={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},I8={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},N8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},j8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},A8=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},K8={ordinalNumber:A8,era:so({values:_8,defaultWidth:"wide"}),quarter:so({values:F8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:so({values:L8,defaultWidth:"wide"}),day:so({values:I8,defaultWidth:"wide"}),dayPeriod:so({values:N8,defaultWidth:"wide",formattingValues:j8,defaultFormattingWidth:"wide"})};function lo(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?H8(s,c=>c.test(a)):B8(s,c=>c.test(a));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const h=t.slice(a.length);return{value:u,rest:h}}}function B8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function H8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function V8(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(o.length);return{value:a,rest:s}}}const z8=/^(\d+)(th|st|nd|rd)?/i,U8=/\d+/i,q8={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},W8={any:[/^b/i,/^(a|c)/i]},G8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Q8={any:[/1/i,/2/i,/3/i,/4/i]},Y8={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},X8={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Z8={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},J8={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},e7={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},t7={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},n7={ordinalNumber:V8({matchPattern:z8,parsePattern:U8,valueCallback:e=>parseInt(e,10)}),era:lo({matchPatterns:q8,defaultMatchWidth:"wide",parsePatterns:W8,defaultParseWidth:"any"}),quarter:lo({matchPatterns:G8,defaultMatchWidth:"wide",parsePatterns:Q8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:lo({matchPatterns:Y8,defaultMatchWidth:"wide",parsePatterns:X8,defaultParseWidth:"any"}),day:lo({matchPatterns:Z8,defaultMatchWidth:"wide",parsePatterns:J8,defaultParseWidth:"any"}),dayPeriod:lo({matchPatterns:e7,defaultMatchWidth:"any",parsePatterns:t7,defaultParseWidth:"any"})},$u={code:"en-US",formatDistance:P8,formatLong:O8,formatRelative:D8,localize:K8,match:n7,options:{weekStartsOn:0,firstWeekContainsDate:1}};function r7(e,t){const n=Oe(e,t==null?void 0:t.in);return f8(n,S8(n))+1}function o7(e,t){const n=Oe(e,t==null?void 0:t.in),r=+la(n)-+h8(n);return Math.round(r/b1)+1}function w1(e,t){var h,c,p,f;const n=Oe(e,t==null?void 0:t.in),r=n.getFullYear(),o=eo(),i=(t==null?void 0:t.firstWeekContainsDate)??((c=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((f=(p=o.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??1,a=Qt((t==null?void 0:t.in)||e,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const s=Lo(a,t),l=Qt((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const u=Lo(l,t);return+n>=+s?r+1:+n>=+u?r:r-1}function i7(e,t){var s,l,u,h;const n=eo(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,o=w1(e,t),i=Qt((t==null?void 0:t.in)||e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Lo(i,t)}function a7(e,t){const n=Oe(e,t==null?void 0:t.in),r=+Lo(n,t)-+i7(n,t);return Math.round(r/b1)+1}function ce(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Jt={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ce(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ce(n+1,2)},d(e,t){return ce(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ce(e.getHours()%12||12,t.length)},H(e,t){return ce(e.getHours(),t.length)},m(e,t){return ce(e.getMinutes(),t.length)},s(e,t){return ce(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return ce(o,t.length)}},lr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ud={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Jt.y(e,t)},Y:function(e,t,n,r){const o=w1(e,r),i=o>0?o:1-o;if(t==="YY"){const a=i%100;return ce(a,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):ce(i,t.length)},R:function(e,t){const n=y1(e);return ce(n,t.length)},u:function(e,t){const n=e.getFullYear();return ce(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ce(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ce(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Jt.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ce(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=a7(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):ce(o,t.length)},I:function(e,t,n){const r=o7(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ce(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Jt.d(e,t)},D:function(e,t,n){const r=r7(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ce(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ce(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ce(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return ce(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=lr.noon:r===0?o=lr.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=lr.evening:r>=12?o=lr.afternoon:r>=4?o=lr.morning:o=lr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Jt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Jt.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ce(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ce(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Jt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Jt.s(e,t)},S:function(e,t){return Jt.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return dd(r);case"XXXX":case"XX":return _n(r);case"XXXXX":case"XXX":default:return _n(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return dd(r);case"xxxx":case"xx":return _n(r);case"xxxxx":case"xxx":default:return _n(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cd(r,":");case"OOOO":default:return"GMT"+_n(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cd(r,":");case"zzzz":default:return"GMT"+_n(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ce(r,t.length)},T:function(e,t,n){return ce(+e,t.length)}};function cd(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+ce(i,2)}function dd(e,t){return e%60===0?(e>0?"-":"+")+ce(Math.abs(e)/60,2):_n(e,t)}function _n(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=ce(Math.trunc(r/60),2),i=ce(r%60,2);return n+o+t+i}const fd=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},C1=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},s7=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return fd(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",fd(r,t)).replace("{{time}}",C1(o,t))},l7={p:C1,P:s7},u7=/^D+$/,c7=/^Y+$/,d7=["D","DD","YY","YYYY"];function f7(e){return u7.test(e)}function h7(e){return c7.test(e)}function p7(e,t,n){const r=g7(e,t,n);if(console.warn(r),d7.includes(e))throw new RangeError(r)}function g7(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const m7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,v7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,b7=/^'([^]*?)'?$/,y7=/''/g,x7=/[a-zA-Z]/;function $1(e,t,n){var h,c,p,f;const r=eo(),o=r.locale??$u,i=r.firstWeekContainsDate??((c=(h=r.locale)==null?void 0:h.options)==null?void 0:c.firstWeekContainsDate)??1,a=r.weekStartsOn??((f=(p=r.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,s=Oe(e,n==null?void 0:n.in);if(!m8(s))throw new RangeError("Invalid time value");let l=t.match(v7).map(g=>{const m=g[0];if(m==="p"||m==="P"){const v=l7[m];return v(g,o.formatLong)}return g}).join("").match(m7).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const m=g[0];if(m==="'")return{isToken:!1,value:w7(g)};if(ud[m])return{isToken:!0,value:g};if(m.match(x7))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:g}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const u={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return l.map(g=>{if(!g.isToken)return g.value;const m=g.value;(h7(m)||f7(m))&&p7(m,t,String(e));const v=ud[m[0]];return v(s,m,o.localize,u)}).join("")}function w7(e){const t=e.match(b7);return t?t[1].replace(y7,"'"):e}function C7(e,t,n){const r=eo(),o=(n==null?void 0:n.locale)??r.locale??$u,i=2520,a=$o(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:a}),[l,u]=ni(n==null?void 0:n.in,...a>0?[t,e]:[e,t]),h=$8(u,l),c=(Br(u)-Br(l))/1e3,p=Math.round((h-c)/60);let f;if(p<2)return p===0?o.formatDistance("lessThanXMinutes",1,s):o.formatDistance("xMinutes",p,s);if(p<45)return o.formatDistance("xMinutes",p,s);if(p<90)return o.formatDistance("aboutXHours",1,s);if(p<sa){const g=Math.round(p/60);return o.formatDistance("aboutXHours",g,s)}else{if(p<i)return o.formatDistance("xDays",1,s);if(p<mr){const g=Math.round(p/sa);return o.formatDistance("xDays",g,s)}else if(p<mr*2)return f=Math.round(p/mr),o.formatDistance("aboutXMonths",f,s)}if(f=C8(u,l),f<12){const g=Math.round(p/mr);return o.formatDistance("xMonths",g,s)}else{const g=f%12,m=Math.trunc(f/12);return g<3?o.formatDistance("aboutXYears",m,s):g<9?o.formatDistance("overXYears",m,s):o.formatDistance("almostXYears",m+1,s)}}function $7(e,t,n){const r=eo(),o=(n==null?void 0:n.locale)??r.locale??$u,i=$o(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i}),[s,l]=ni(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),u=x1((n==null?void 0:n.roundingMethod)??"round"),h=l.getTime()-s.getTime(),c=h/id,p=Br(l)-Br(s),f=(h-p)/id,g=n==null?void 0:n.unit;let m;if(g?m=g:c<1?m="second":c<60?m="minute":c<sa?m="hour":f<mr?m="day":f<ad?m="month":m="year",m==="second"){const v=u(h/1e3);return o.formatDistance("xSeconds",v,a)}else if(m==="minute"){const v=u(c);return o.formatDistance("xMinutes",v,a)}else if(m==="hour"){const v=u(c/60);return o.formatDistance("xHours",v,a)}else if(m==="day"){const v=u(f/sa);return o.formatDistance("xDays",v,a)}else if(m==="month"){const v=u(f/mr);return v===12&&g!=="month"?o.formatDistance("xYears",1,a):o.formatDistance("xMonths",v,a)}else{const v=u(f/ad);return o.formatDistance("xYears",v,a)}}function S1(e,t){return C7(e,p8(e),t)}var Tl=new Map,Ei=new WeakMap,hd=0,S7=void 0;function E7(e){return e?(Ei.has(e)||(hd+=1,Ei.set(e,hd.toString())),Ei.get(e)):"0"}function P7(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?E7(e.root):e[t]}`).toString()}function R7(e){const t=P7(e);let n=Tl.get(t);if(!n){const r=new Map;let o;const i=new IntersectionObserver(a=>{a.forEach(s=>{var l;const u=s.isIntersecting&&o.some(h=>s.intersectionRatio>=h);e.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=u),(l=r.get(s.target))==null||l.forEach(h=>{h(u,s)})})},e);o=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:i,elements:r},Tl.set(t,n)}return n}function k7(e,t,n={},r=S7){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const l=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:o,observer:i,elements:a}=R7(n),s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),i.observe(e),function(){s.splice(s.indexOf(t),1),s.length===0&&(a.delete(e),i.unobserve(e)),a.size===0&&(i.disconnect(),Tl.delete(o))}}function M7({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:o,triggerOnce:i,skip:a,initialInView:s,fallbackInView:l,onChange:u}={}){var h;const[c,p]=S.useState(null),f=S.useRef(u),[g,m]=S.useState({inView:!!s,entry:void 0});f.current=u,S.useEffect(()=>{if(a||!c)return;let w;return w=k7(c,($,k)=>{m({inView:$,entry:k}),f.current&&f.current($,k),k.isIntersecting&&i&&w&&(w(),w=void 0)},{root:o,rootMargin:r,threshold:e,trackVisibility:n,delay:t},l),()=>{w&&w()}},[Array.isArray(e)?e.toString():e,c,o,r,i,a,n,l,t]);const v=(h=g.entry)==null?void 0:h.target,b=S.useRef(void 0);!c&&v&&!i&&!a&&b.current!==v&&(b.current=v,m({inView:!!s,entry:void 0}));const x=[p,g.inView,g.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}var E1=function(e){var t=e.isLastRow,n=e.children,r=e.isSelected,o=e.onClick,i=e.layoutVariant;return y.jsx("div",{onClick:function(a){return o(a)},"aria-label":"button",className:"group grid w-full cursor-pointer p-2 transition-colors duration-150 active:bg-slate-50/25 dark:active:bg-slate-800/25 ".concat(t?"border-b border-slate-200 dark:border-slate-700":""," ").concat(i==="job"?"grid-cols-[auto,350px,576px,1fr]":"grid-cols-[auto,350px,1fr,1fr]"," ").concat(r?"bg-slate-200/50 dark:bg-slate-800/50":"hover:bg-slate-50/50 dark:hover:bg-slate-900"),children:n})},Dl=30,Io=2e3,_l=2,P1=function(){return y.jsxs("div",{children:[y.jsx("div",{className:"rounded-t-md border-b border-slate-200 bg-slate-50 p-2 text-left text-sm font-semibold dark:border-slate-700 dark:bg-slate-800",children:y.jsx("span",{className:"opacity-0",children:"Placeholder"})}),Ke([],new Array(Dl),!0).map(function(e,t){return y.jsx("div",{className:Ar("p-2",Dl!==t+1?"border-b border-slate-200 dark:border-slate-700":""),children:y.jsx(Mo,{className:"h-6 w-full"})},t)})]})};function pd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function R1(...e){return t=>{let n=!1;const r=e.map(o=>{const i=pd(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():pd(e[o],null)}}}}function Su(...e){return S.useCallback(R1(...e),e)}function O7(e,t=[]){let n=[];function r(i,a){const s=S.createContext(a),l=n.length;n=[...n,a];const u=c=>{var b;const{scope:p,children:f,...g}=c,m=((b=p==null?void 0:p[e])==null?void 0:b[l])||s,v=S.useMemo(()=>g,Object.values(g));return y.jsx(m.Provider,{value:v,children:f})};u.displayName=i+"Provider";function h(c,p){var m;const f=((m=p==null?void 0:p[e])==null?void 0:m[l])||s,g=S.useContext(f);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${i}\``)}return[u,h]}const o=()=>{const i=n.map(a=>S.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,T7(o,...t)]}function T7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...s,...c}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function gd(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var ua=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},D7=S[" useInsertionEffect ".trim().toString()]||ua;function _7({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=F7({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:o;{const h=S.useRef(e!==void 0);S.useEffect(()=>{const c=h.current;c!==s&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=s},[s,r])}const u=S.useCallback(h=>{var c;if(s){const p=L7(h)?h(e):h;p!==e&&((c=a.current)==null||c.call(a,p))}else i(h)},[s,e,i,a]);return[l,u]}function F7({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),o=S.useRef(n),i=S.useRef(t);return D7(()=>{i.current=t},[t]),S.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function L7(e){return typeof e=="function"}function I7(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function N7(e){const[t,n]=S.useState(void 0);return ua(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function j7(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var k1=e=>{const{present:t,children:n}=e,r=A7(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=Su(r.ref,K7(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};k1.displayName="Presence";function A7(e){const[t,n]=S.useState(),r=S.useRef(null),o=S.useRef(e),i=S.useRef("none"),a=e?"mounted":"unmounted",[s,l]=j7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=Pi(r.current);i.current=s==="mounted"?u:"none"},[s]),ua(()=>{const u=r.current,h=o.current;if(h!==e){const p=i.current,f=Pi(u);e?l("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(h&&p!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ua(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,c=f=>{const m=Pi(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=f=>{f.target===t&&(i.current=Pi(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:S.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Pi(e){return(e==null?void 0:e.animationName)||"none"}function K7(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function B7(e){const t=H7(e),n=S.forwardRef((r,o)=>{const{children:i,...a}=r,s=S.Children.toArray(i),l=s.find(z7);if(l){const u=l.props.children,h=s.map(c=>c===l?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:c);return y.jsx(t,{...a,ref:o,children:S.isValidElement(u)?S.cloneElement(u,void 0,h):null})}return y.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function H7(e){const t=S.forwardRef((n,r)=>{const{children:o,...i}=n;if(S.isValidElement(o)){const a=q7(o),s=U7(i,o.props);return o.type!==S.Fragment&&(s.ref=r?R1(r,a):a),S.cloneElement(o,s)}return S.Children.count(o)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var V7=Symbol("radix.slottable");function z7(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===V7}function U7(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const l=i(...s);return o(...s),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function q7(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var W7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Eu=W7.reduce((e,t)=>{const n=B7(`Primitive.${t}`),r=S.forwardRef((o,i)=>{const{asChild:a,...s}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(l,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Va="Checkbox",[G7]=O7(Va),[Q7,Pu]=G7(Va);function Y7(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:s,onCheckedChange:l,required:u,value:h="on",internal_do_not_use_render:c}=e,[p,f]=_7({prop:n,defaultProp:o??!1,onChange:l,caller:Va}),[g,m]=S.useState(null),[v,b]=S.useState(null),x=S.useRef(!1),w=g?!!a||!!g.closest("form"):!0,$={checked:p,disabled:i,setChecked:f,control:g,setControl:m,name:s,form:a,value:h,hasConsumerStoppedPropagationRef:x,required:u,defaultChecked:mn(o)?!1:o,isFormControl:w,bubbleInput:v,setBubbleInput:b};return y.jsx(Q7,{scope:t,...$,children:X7(c)?c($):r})}var M1="CheckboxTrigger",O1=S.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:i,value:a,disabled:s,checked:l,required:u,setControl:h,setChecked:c,hasConsumerStoppedPropagationRef:p,isFormControl:f,bubbleInput:g}=Pu(M1,e),m=Su(o,h),v=S.useRef(l);return S.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const x=()=>c(v.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[i,c]),y.jsx(Eu.button,{type:"button",role:"checkbox","aria-checked":mn(l)?"mixed":l,"aria-required":u,"data-state":I1(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:m,onKeyDown:gd(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:gd(n,b=>{c(x=>mn(x)?!0:!x),g&&f&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})});O1.displayName=M1;var T1=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l,onCheckedChange:u,form:h,...c}=e;return y.jsx(Y7,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:u,name:r,form:h,value:l,internal_do_not_use_render:({isFormControl:p})=>y.jsxs(y.Fragment,{children:[y.jsx(O1,{...c,ref:t,__scopeCheckbox:n}),p&&y.jsx(L1,{__scopeCheckbox:n})]})})});T1.displayName=Va;var D1="CheckboxIndicator",_1=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Pu(D1,n);return y.jsx(k1,{present:r||mn(i.checked)||i.checked===!0,children:y.jsx(Eu.span,{"data-state":I1(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});_1.displayName=D1;var F1="CheckboxBubbleInput",L1=S.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:a,required:s,disabled:l,name:u,value:h,form:c,bubbleInput:p,setBubbleInput:f}=Pu(F1,e),g=Su(n,f),m=I7(i),v=N7(r);S.useEffect(()=>{const x=p;if(!x)return;const w=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(w,"checked").set,E=!o.current;if(m!==i&&k){const R=new Event("click",{bubbles:E});x.indeterminate=mn(i),k.call(x,mn(i)?!1:i),x.dispatchEvent(R)}},[p,m,i,o]);const b=S.useRef(mn(i)?!1:i);return y.jsx(Eu.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??b.current,required:s,disabled:l,name:u,value:h,form:c,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});L1.displayName=F1;function X7(e){return typeof e=="function"}function mn(e){return e==="indeterminate"}function I1(e){return mn(e)?"indeterminate":e?"checked":"unchecked"}var ca=function(e){var t=e.className,n=hv(e,["className"]);return y.jsx(T1,{className:Ar("flex size-4 cursor-pointer rounded-sm border shadow-sm",t,{"border-slate-300 hover:border-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:hover:border-slate-400 dark:hover:bg-slate-800":!n.checked,"border-brand-500 bg-brand-500 text-brand-50 hover:border-brand-600 hover:bg-brand-600":n.checked===!0,"border-slate-500 text-slate-500 hover:border-slate-700 hover:bg-slate-100 dark:border-slate-400 dark:text-slate-400 dark:hover:border-slate-300 dark:hover:bg-slate-800":n.checked==="indeterminate"}),onClick:function(r){return r.stopPropagation()},...n,children:y.jsxs(_1,{className:"flex size-full items-center justify-center",children:[n.checked==="indeterminate"&&y.jsx(M2,{height:12,width:12}),n.checked===!0&&y.jsx(v2,{height:12,width:12})]})})},uo=function(e){var t=e.label,n=e.icon;return y.jsxs("div",{className:"flex cursor-default items-center justify-center space-x-1.5 rounded-md bg-slate-100 px-2 py-0.5 text-sm text-slate-900 transition duration-150 ease-in-out dark:bg-slate-800 dark:text-slate-300",children:[n,y.jsx("span",{children:t})]})},Ru=function(e){var t=e.children,n=e.message;return y.jsxs(m3,{children:[y.jsx(pu,{children:t}),y.jsx(v3,{offset:6,className:"rounded-md bg-white px-2 py-1 text-sm text-slate-900 shadow-md dark:bg-slate-800 dark:text-slate-100",children:n})]})},N1={exports:{}},j1={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},A1={exports:{}},Z7=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},J7=Z7,ex=Array.prototype.concat,tx=Array.prototype.slice,md=A1.exports=function(t){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];J7(i)?n=ex.call(n,tx.call(i)):n.push(i)}return n};md.wrap=function(e){return function(){return e(md(arguments))}};var nx=A1.exports,So=j1,ri=nx,K1=Object.hasOwnProperty,B1=Object.create(null);for(var $s in So)K1.call(So,$s)&&(B1[So[$s]]=$s);var ot=N1.exports={to:{},get:{}};ot.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case"hsl":n=ot.get.hsl(e),r="hsl";break;case"hwb":n=ot.get.hwb(e),r="hwb";break;default:n=ot.get.rgb(e),r="rgb";break}return n?{model:r,value:n}:null};ot.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^(\w+)$/,a=[0,0,0,1],s,l,u;if(s=e.match(n)){for(u=s[2],s=s[1],l=0;l<3;l++){var h=l*2;a[l]=parseInt(s.slice(h,h+2),16)}u&&(a[3]=parseInt(u,16)/255)}else if(s=e.match(t)){for(s=s[1],u=s[3],l=0;l<3;l++)a[l]=parseInt(s[l]+s[l],16);u&&(a[3]=parseInt(u+u,16)/255)}else if(s=e.match(r)){for(l=0;l<3;l++)a[l]=parseInt(s[l+1],0);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else if(s=e.match(o)){for(l=0;l<3;l++)a[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else return(s=e.match(i))?s[1]==="transparent"?[0,0,0,0]:K1.call(So,s[1])?(a=So[s[1]],a[3]=1,a):null:null;for(l=0;l<3;l++)a[l]=vn(a[l],0,255);return a[3]=vn(a[3],0,1),a};ot.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,i=vn(parseFloat(n[2]),0,100),a=vn(parseFloat(n[3]),0,100),s=vn(isNaN(r)?1:r,0,1);return[o,i,a,s]}return null};ot.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,i=vn(parseFloat(n[2]),0,100),a=vn(parseFloat(n[3]),0,100),s=vn(isNaN(r)?1:r,0,1);return[o,i,a,s]}return null};ot.to.hex=function(){var e=ri(arguments);return"#"+Ri(e[0])+Ri(e[1])+Ri(e[2])+(e[3]<1?Ri(Math.round(e[3]*255)):"")};ot.to.rgb=function(){var e=ri(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};ot.to.rgb.percent=function(){var e=ri(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};ot.to.hsl=function(){var e=ri(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};ot.to.hwb=function(){var e=ri(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};ot.to.keyword=function(e){return B1[e.slice(0,3)]};function vn(e,t,n){return Math.min(Math.max(t,e),n)}function Ri(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var rx=N1.exports;const No=j1,H1={};for(const e of Object.keys(No))H1[No[e]]=e;const Q={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var V1=Q;for(const e of Object.keys(Q)){if(!("channels"in Q[e]))throw new Error("missing channels property: "+e);if(!("labels"in Q[e]))throw new Error("missing channel labels property: "+e);if(Q[e].labels.length!==Q[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=Q[e];delete Q[e].channels,delete Q[e].labels,Object.defineProperty(Q[e],"channels",{value:t}),Object.defineProperty(Q[e],"labels",{value:n})}Q.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=i-o;let s,l;i===o?s=0:t===i?s=(n-r)/a:n===i?s=2+(r-t)/a:r===i&&(s=4+(t-n)/a),s=Math.min(s*60,360),s<0&&(s+=360);const u=(o+i)/2;return i===o?l=0:u<=.5?l=a/(i+o):l=a/(2-i-o),[s,l*100,u*100]};Q.rgb.hsv=function(e){let t,n,r,o,i;const a=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(a,s,l),h=u-Math.min(a,s,l),c=function(p){return(u-p)/6/h+1/2};return h===0?(o=0,i=0):(i=h/u,t=c(a),n=c(s),r=c(l),a===u?o=r-n:s===u?o=1/3+t-r:l===u&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,i*100,u*100]};Q.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=Q.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,i*100,r*100]};Q.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),i=(1-t-o)/(1-o)||0,a=(1-n-o)/(1-o)||0,s=(1-r-o)/(1-o)||0;return[i*100,a*100,s*100,o*100]};function ox(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Q.rgb.keyword=function(e){const t=H1[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(No)){const i=No[o],a=ox(e,i);a<n&&(n=a,r=o)}return r};Q.keyword.rgb=function(e){return No[e]};Q.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,i=t*.2126+n*.7152+r*.0722,a=t*.0193+n*.1192+r*.9505;return[o*100,i*100,a*100]};Q.rgb.lab=function(e){const t=Q.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const i=116*r-16,a=500*(n-r),s=200*(r-o);return[i,a,s]};Q.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,i,a;if(n===0)return a=r*255,[a,a,a];r<.5?o=r*(1+n):o=r+n-r*n;const s=2*r-o,l=[0,0,0];for(let u=0;u<3;u++)i=t+1/3*-(u-1),i<0&&i++,i>1&&i--,6*i<1?a=s+(o-s)*6*i:2*i<1?a=o:3*i<2?a=s+(o-s)*(2/3-i)*6:a=s,l[u]=a*255;return l};Q.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const i=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=i<=1?i:2-i;const a=(r+n)/2,s=r===0?2*o/(i+o):2*n/(r+n);return[t,s*100,a*100]};Q.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,i=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*i),l=255*r*(1-n*(1-i));switch(r*=255,o){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}};Q.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let i,a;a=(2-n)*r;const s=(2-n)*o;return i=n*o,i/=s<=1?s:2-s,i=i||0,a/=2,[t,i*100,a*100]};Q.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let i;o>1&&(n/=o,r/=o);const a=Math.floor(6*t),s=1-r;i=6*t-a,a&1&&(i=1-i);const l=n+i*(s-n);let u,h,c;switch(a){default:case 6:case 0:u=s,h=l,c=n;break;case 1:u=l,h=s,c=n;break;case 2:u=n,h=s,c=l;break;case 3:u=n,h=l,c=s;break;case 4:u=l,h=n,c=s;break;case 5:u=s,h=n,c=l;break}return[u*255,h*255,c*255]};Q.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,i=1-Math.min(1,t*(1-o)+o),a=1-Math.min(1,n*(1-o)+o),s=1-Math.min(1,r*(1-o)+o);return[i*255,a*255,s*255]};Q.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,i,a;return o=t*3.2406+n*-1.5372+r*-.4986,i=t*-.9689+n*1.8758+r*.0415,a=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),[o*255,i*255,a*255]};Q.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,i=500*(t-n),a=200*(n-r);return[o,i,a]};Q.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,i,a;i=(t+16)/116,o=n/500+i,a=i-r/200;const s=i**3,l=o**3,u=a**3;return i=s>.008856?s:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,a=u>.008856?u:(a-16/116)/7.787,o*=95.047,i*=100,a*=108.883,[o,i,a]};Q.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const a=Math.sqrt(n*n+r*r);return[t,a,o]};Q.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,i=n*Math.cos(o),a=n*Math.sin(o);return[t,i,a]};Q.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let i=t===null?Q.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let a=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return i===2&&(a+=60),a};Q.hsv.ansi16=function(e){return Q.rgb.ansi16(Q.hsv.rgb(e),e[2])};Q.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};Q.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,i=(t>>2&1)*n*255;return[r,o,i]};Q.ansi256.rgb=function(e){if(e>=232){const i=(e-232)*10+8;return[i,i,i]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};Q.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};Q.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),o=r>>16&255,i=r>>8&255,a=r&255;return[o,i,a]};Q.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),i=Math.min(Math.min(t,n),r),a=o-i;let s,l;return a<1?s=i/(1-a):s=0,a<=0?l=0:o===t?l=(n-r)/a%6:o===n?l=2+(r-t)/a:l=4+(t-n)/a,l/=6,l%=1,[l*360,a*100,s*100]};Q.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};Q.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};Q.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],i=t%1*6,a=i%1,s=1-a;let l=0;switch(Math.floor(i)){case 0:o[0]=1,o[1]=a,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=a;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=a,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return l=(1-n)*r,[(n*o[0]+l)*255,(n*o[1]+l)*255,(n*o[2]+l)*255]};Q.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};Q.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};Q.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};Q.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let i=0;return o<1&&(i=(r-o)/(1-o)),[e[0],o*100,i*100]};Q.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Q.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Q.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Q.gray.hsl=function(e){return[0,0,e[0]]};Q.gray.hsv=Q.gray.hsl;Q.gray.hwb=function(e){return[0,100,e[0]]};Q.gray.cmyk=function(e){return[0,0,0,e[0]]};Q.gray.lab=function(e){return[e[0],0,0]};Q.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};Q.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const da=V1;function ix(){const e={},t=Object.keys(da);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function ax(e){const t=ix(),n=[e];for(t[e].distance=0;n.length;){const r=n.pop(),o=Object.keys(da[r]);for(let i=o.length,a=0;a<i;a++){const s=o[a],l=t[s];l.distance===-1&&(l.distance=t[r].distance+1,l.parent=r,n.unshift(s))}}return t}function sx(e,t){return function(n){return t(e(n))}}function lx(e,t){const n=[t[e].parent,e];let r=da[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)n.unshift(t[o].parent),r=sx(da[t[o].parent][o],r),o=t[o].parent;return r.conversion=n,r}var ux=function(e){const t=ax(e),n={},r=Object.keys(t);for(let o=r.length,i=0;i<o;i++){const a=r[i];t[a].parent!==null&&(n[a]=lx(a,t))}return n};const Fl=V1,cx=ux,fr={},dx=Object.keys(Fl);function fx(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function hx(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let i=o.length,a=0;a<i;a++)o[a]=Math.round(o[a]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}dx.forEach(e=>{fr[e]={},Object.defineProperty(fr[e],"channels",{value:Fl[e].channels}),Object.defineProperty(fr[e],"labels",{value:Fl[e].labels});const t=cx(e);Object.keys(t).forEach(r=>{const o=t[r];fr[e][r]=hx(o),fr[e][r].raw=fx(o)})});var px=fr;const hr=rx,nt=px,z1=["keyword","gray","hex"],Ll={};for(const e of Object.keys(nt))Ll[[...nt[e].labels].sort().join("")]=e;const fa={};function ke(e,t){if(!(this instanceof ke))return new ke(e,t);if(t&&t in z1&&(t=null),t&&!(t in nt))throw new Error("Unknown model: "+t);let n,r;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof ke)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const o=hr.get(e);if(o===null)throw new Error("Unable to parse color from string: "+e);this.model=o.model,r=nt[this.model].channels,this.color=o.value.slice(0,r),this.valpha=typeof o.value[r]=="number"?o.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=nt[this.model].channels;const o=Array.prototype.slice.call(e,0,r);this.color=Il(o,r),this.valpha=typeof e[r]=="number"?e[r]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const o=Object.keys(e);"alpha"in e&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const i=o.sort().join("");if(!(i in Ll))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Ll[i];const{labels:a}=nt[this.model],s=[];for(n=0;n<a.length;n++)s.push(e[a[n]]);this.color=Il(s)}if(fa[this.model])for(r=nt[this.model].channels,n=0;n<r;n++){const o=fa[this.model][n];o&&(this.color[n]=o(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ke.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in hr.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);const n=t.valpha===1?t.color:[...t.color,this.valpha];return hr.to[t.model](n)},percentString(e){const t=this.rgb().round(typeof e=="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return hr.to.rgb.percent(n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=nt[this.model],{labels:n}=nt[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new ke([...this.color.map(mx(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new ke([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:me("rgb",0,$e(255)),green:me("rgb",1,$e(255)),blue:me("rgb",2,$e(255)),hue:me(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:me("hsl",1,$e(100)),lightness:me("hsl",2,$e(100)),saturationv:me("hsv",1,$e(100)),value:me("hsv",2,$e(100)),chroma:me("hcg",1,$e(100)),gray:me("hcg",2,$e(100)),white:me("hwb",1,$e(100)),wblack:me("hwb",2,$e(100)),cyan:me("cmyk",0,$e(100)),magenta:me("cmyk",1,$e(100)),yellow:me("cmyk",2,$e(100)),black:me("cmyk",3,$e(100)),x:me("xyz",0,$e(95.047)),y:me("xyz",1,$e(100)),z:me("xyz",2,$e(108.833)),l:me("lab",0,$e(100)),a:me("lab",1),b:me("lab",2),keyword(e){return e!==void 0?new ke(e):nt[this.model].keyword(this.color)},hex(e){return e!==void 0?new ke(e):hr.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new ke(e);const t=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),hr.to.hex(t)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const o=r/255;t[n]=o<=.04045?o/12.92:((o+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return ke.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),o=t===void 0?.5:t,i=2*o-1,a=n.alpha()-r.alpha(),s=((i*a===-1?i:(i+a)/(1+i*a))+1)/2,l=1-s;return ke.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue(),n.alpha()*o+r.alpha()*(1-o))}};for(const e of Object.keys(nt)){if(z1.includes(e))continue;const{channels:t}=nt[e];ke.prototype[e]=function(...n){return this.model===e?new ke(this):n.length>0?new ke(n,e):new ke([...vx(nt[this.model][e].raw(this.color)),this.valpha],e)},ke[e]=function(...n){let r=n[0];return typeof r=="number"&&(r=Il(n,t)),new ke(r,e)}}function gx(e,t){return Number(e.toFixed(t))}function mx(e){return function(t){return gx(t,e)}}function me(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(fa[r]||(fa[r]=[]))[t]=n;return e=e[0],function(r){let o;return r!==void 0?(n&&(r=n(r)),o=this[e](),o.color[t]=r,o):(o=this[e]().color[t],n&&(o=n(o)),o)}}function $e(e){return function(t){return Math.max(0,Math.min(e,t))}}function vx(e){return Array.isArray(e)?e:[e]}function Il(e,t){for(let n=0;n<t;n++)typeof e[n]!="number"&&(e[n]=0);return e}var bx=ke;const vd=cf(bx);var yx=typeof global=="object"&&global&&global.Object===Object&&global,xx=typeof self=="object"&&self&&self.Object===Object&&self,nr=yx||xx||Function("return this")(),ha=nr.Symbol,U1=Object.prototype,wx=U1.hasOwnProperty,Cx=U1.toString,co=ha?ha.toStringTag:void 0;function $x(e){var t=wx.call(e,co),n=e[co];try{e[co]=void 0;var r=!0}catch{}var o=Cx.call(e);return r&&(t?e[co]=n:delete e[co]),o}var Sx=Object.prototype,Ex=Sx.toString;function Px(e){return Ex.call(e)}var Rx="[object Null]",kx="[object Undefined]",bd=ha?ha.toStringTag:void 0;function q1(e){return e==null?e===void 0?kx:Rx:bd&&bd in Object(e)?$x(e):Px(e)}function W1(e){return e!=null&&typeof e=="object"}var Mx="[object Symbol]";function Ox(e){return typeof e=="symbol"||W1(e)&&q1(e)==Mx}var Tx=Array.isArray,Dx=/\s/;function _x(e){for(var t=e.length;t--&&Dx.test(e.charAt(t)););return t}var Fx=/^\s+/;function Lx(e){return e&&e.slice(0,_x(e)+1).replace(Fx,"")}function Hr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var yd=NaN,Ix=/^[-+]0x[0-9a-f]+$/i,Nx=/^0b[01]+$/i,jx=/^0o[0-7]+$/i,Ax=parseInt;function Kx(e){if(typeof e=="number")return e;if(Ox(e))return yd;if(Hr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Hr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Lx(e);var n=Nx.test(e);return n||jx.test(e)?Ax(e.slice(2),n?2:8):Ix.test(e)?yd:+e}var xd=1/0,Bx=17976931348623157e292;function Hx(e){if(!e)return e===0?e:0;if(e=Kx(e),e===xd||e===-xd){var t=e<0?-1:1;return t*Bx}return e===e?e:0}function wd(e){var t=Hx(e),n=t%1;return t===t?n?t-n:t:0}function G1(e){return e}var Vx="[object AsyncFunction]",zx="[object Function]",Ux="[object GeneratorFunction]",qx="[object Proxy]";function Wx(e){if(!Hr(e))return!1;var t=q1(e);return t==zx||t==Ux||t==Vx||t==qx}var Ss=nr["__core-js_shared__"],Cd=function(){var e=/[^.]+$/.exec(Ss&&Ss.keys&&Ss.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Gx(e){return!!Cd&&Cd in e}var Qx=Function.prototype,Yx=Qx.toString;function Xx(e){if(e!=null){try{return Yx.call(e)}catch{}try{return e+""}catch{}}return""}var Zx=/[\\^$.*+?()[\]{}|]/g,Jx=/^\[object .+?Constructor\]$/,e6=Function.prototype,t6=Object.prototype,n6=e6.toString,r6=t6.hasOwnProperty,o6=RegExp("^"+n6.call(r6).replace(Zx,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function i6(e){if(!Hr(e)||Gx(e))return!1;var t=Wx(e)?o6:Jx;return t.test(Xx(e))}function a6(e,t){return e==null?void 0:e[t]}function Q1(e,t){var n=a6(e,t);return i6(n)?n:void 0}var $d=Q1(nr,"WeakMap"),pa=$d&&new $d,Y1=pa?function(e,t){return pa.set(e,t),e}:G1,Sd=Object.create,ku=function(){function e(){}return function(t){if(!Hr(t))return{};if(Sd)return Sd(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function jo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=ku(e.prototype),r=e.apply(n,t);return Hr(r)?r:n}}var s6=1;function l6(e,t,n){var r=t&s6,o=jo(e);function i(){var a=this&&this!==nr&&this instanceof i?o:e;return a.apply(r?n:this,arguments)}return i}function X1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var u6=Math.max;function Z1(e,t,n,r){for(var o=-1,i=e.length,a=n.length,s=-1,l=t.length,u=u6(i-a,0),h=Array(l+u),c=!r;++s<l;)h[s]=t[s];for(;++o<a;)(c||o<i)&&(h[n[o]]=e[o]);for(;u--;)h[s++]=e[o++];return h}var c6=Math.max;function J1(e,t,n,r){for(var o=-1,i=e.length,a=-1,s=n.length,l=-1,u=t.length,h=c6(i-s,0),c=Array(h+u),p=!r;++o<h;)c[o]=e[o];for(var f=o;++l<u;)c[f+l]=t[l];for(;++a<s;)(p||o<i)&&(c[f+n[a]]=e[o++]);return c}function d6(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}function Mu(){}var f6=4294967295;function Vr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f6,this.__views__=[]}Vr.prototype=ku(Mu.prototype);Vr.prototype.constructor=Vr;function h6(){}var eg=pa?function(e){return pa.get(e)}:h6,Ed={},p6=Object.prototype,g6=p6.hasOwnProperty;function m6(e){for(var t=e.name+"",n=Ed[t],r=g6.call(Ed,t)?n.length:0;r--;){var o=n[r],i=o.func;if(i==null||i==e)return o.name}return t}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}zr.prototype=ku(Mu.prototype);zr.prototype.constructor=zr;function tg(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function v6(e){if(e instanceof Vr)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=tg(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var b6=Object.prototype,y6=b6.hasOwnProperty;function ga(e){if(W1(e)&&!Tx(e)&&!(e instanceof Vr)){if(e instanceof zr)return e;if(y6.call(e,"__wrapped__"))return v6(e)}return new zr(e)}ga.prototype=Mu.prototype;ga.prototype.constructor=ga;function x6(e){var t=m6(e),n=ga[t];if(typeof n!="function"||!(t in Vr.prototype))return!1;if(e===n)return!0;var r=eg(n);return!!r&&e===r[0]}var w6=800,C6=16,$6=Date.now;function ng(e){var t=0,n=0;return function(){var r=$6(),o=C6-(r-n);if(n=r,o>0){if(++t>=w6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var rg=ng(Y1),S6=/\{\n\/\* \[wrapped with (.+)\] \*/,E6=/,? & /;function P6(e){var t=e.match(S6);return t?t[1].split(E6):[]}var R6=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function k6(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(R6,`{
|
|
61
61
|
/* [wrapped with `+t+`] */
|
|
62
62
|
`)}function M6(e){return function(){return e}}var Pd=function(){try{var e=Q1(Object,"defineProperty");return e({},"",{}),e}catch{}}(),O6=Pd?function(e,t){return Pd(e,"toString",{configurable:!0,enumerable:!1,value:M6(t),writable:!0})}:G1,T6=ng(O6);function D6(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function _6(e,t,n,r){for(var o=e.length,i=n+-1;++i<o;)if(t(e[i],i,e))return i;return-1}function F6(e){return e!==e}function L6(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}function I6(e,t,n){return t===t?L6(e,t,n):_6(e,F6,n)}function N6(e,t){var n=e==null?0:e.length;return!!n&&I6(e,t,0)>-1}var j6=1,A6=2,K6=8,B6=16,H6=32,V6=64,z6=128,U6=256,q6=512,W6=[["ary",z6],["bind",j6],["bindKey",A6],["curry",K6],["curryRight",B6],["flip",q6],["partial",H6],["partialRight",V6],["rearg",U6]];function G6(e,t){return D6(W6,function(n){var r="_."+n[0];t&n[1]&&!N6(e,r)&&e.push(r)}),e.sort()}function og(e,t,n){var r=t+"";return T6(e,k6(r,G6(P6(r),n)))}var Q6=4,Y6=8,Rd=32,kd=64;function ig(e,t,n,r,o,i,a,s,l,u){var h=t&Y6,c=h?a:void 0,p=h?void 0:a,f=h?i:void 0,g=h?void 0:i;t|=h?Rd:kd,t&=~(h?kd:Rd),t&Q6||(t&=-4);var m=[e,t,o,f,c,g,p,s,l,u],v=n.apply(void 0,m);return x6(e)&&rg(v,m),v.placeholder=r,og(v,e,t)}function ag(e){var t=e;return t.placeholder}var X6=9007199254740991,Z6=/^(?:0|[1-9]\d*)$/;function J6(e,t){var n=typeof e;return t=t??X6,!!t&&(n=="number"||n!="symbol"&&Z6.test(e))&&e>-1&&e%1==0&&e<t}var ew=Math.min;function tw(e,t){for(var n=e.length,r=ew(t.length,n),o=tg(e);r--;){var i=t[r];e[r]=J6(i,n)?o[i]:void 0}return e}var Md="__lodash_placeholder__";function ma(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n];(a===t||a===Md)&&(e[n]=Md,i[o++]=n)}return i}var nw=1,rw=2,ow=8,iw=16,aw=128,sw=512;function Ou(e,t,n,r,o,i,a,s,l,u){var h=t&aw,c=t&nw,p=t&rw,f=t&(ow|iw),g=t&sw,m=p?void 0:jo(e);function v(){for(var b=arguments.length,x=Array(b),w=b;w--;)x[w]=arguments[w];if(f)var $=ag(v),k=d6(x,$);if(r&&(x=Z1(x,r,o,f)),i&&(x=J1(x,i,a,f)),b-=k,f&&b<u){var E=ma(x,$);return ig(e,t,Ou,v.placeholder,n,x,E,s,l,u-b)}var R=c?n:this,M=p?R[e]:e;return b=x.length,s?x=tw(x,s):g&&b>1&&x.reverse(),h&&l<b&&(x.length=l),this&&this!==nr&&this instanceof v&&(M=m||jo(M)),M.apply(R,x)}return v}function lw(e,t,n){var r=jo(e);function o(){for(var i=arguments.length,a=Array(i),s=i,l=ag(o);s--;)a[s]=arguments[s];var u=i<3&&a[0]!==l&&a[i-1]!==l?[]:ma(a,l);if(i-=u.length,i<n)return ig(e,t,Ou,o.placeholder,void 0,a,u,void 0,void 0,n-i);var h=this&&this!==nr&&this instanceof o?r:e;return X1(h,this,a)}return o}var uw=1;function cw(e,t,n,r){var o=t&uw,i=jo(e);function a(){for(var s=-1,l=arguments.length,u=-1,h=r.length,c=Array(h+l),p=this&&this!==nr&&this instanceof a?i:e;++u<h;)c[u]=r[u];for(;l--;)c[u++]=arguments[++s];return X1(p,o?n:this,c)}return a}var Od="__lodash_placeholder__",Es=1,dw=2,fw=4,Td=8,fo=128,Dd=256,hw=Math.min;function pw(e,t){var n=e[1],r=t[1],o=n|r,i=o<(Es|dw|fo),a=r==fo&&n==Td||r==fo&&n==Dd&&e[7].length<=t[8]||r==(fo|Dd)&&t[7].length<=t[8]&&n==Td;if(!(i||a))return e;r&Es&&(e[2]=t[2],o|=n&Es?0:fw);var s=t[3];if(s){var l=e[3];e[3]=l?Z1(l,s,t[4]):s,e[4]=l?ma(e[3],Od):t[4]}return s=t[5],s&&(l=e[5],e[5]=l?J1(l,s,t[6]):s,e[6]=l?ma(e[5],Od):t[6]),s=t[7],s&&(e[7]=s),r&fo&&(e[8]=e[8]==null?t[8]:hw(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=o,e}var gw="Expected a function",_d=1,mw=2,Fd=8,Ld=16,Id=32,vw=64,Nd=Math.max;function bw(e,t,n,r,o,i,a,s){var l=t&mw;if(!l&&typeof e!="function")throw new TypeError(gw);var u=r?r.length:0;if(u||(t&=-97,r=o=void 0),a=a===void 0?a:Nd(wd(a),0),s=s===void 0?s:wd(s),u-=o?o.length:0,t&vw){var h=r,c=o;r=o=void 0}var p=l?void 0:eg(e),f=[e,t,n,r,o,h,c,i,a,s];if(p&&pw(f,p),e=f[0],t=f[1],n=f[2],r=f[3],o=f[4],s=f[9]=f[9]===void 0?l?0:e.length:Nd(f[9]-u,0),!s&&t&(Fd|Ld)&&(t&=-25),!t||t==_d)var g=l6(e,t,n);else t==Fd||t==Ld?g=lw(e,t,s):(t==Id||t==(_d|Id))&&!o.length?g=cw(e,t,n,r):g=Ou.apply(void 0,f);var m=p?Y1:rg;return og(m(g,f),e,t)}var yw=8;function va(e,t,n){t=n?void 0:t;var r=bw(e,yw,void 0,void 0,void 0,void 0,void 0,t);return r.placeholder=va.placeholder,r}va.placeholder={};function xw(e){const t=e[0],n=e[1],r=e[2];let o,i,a;return o=t*1+n*0+r*1.13983,i=t*1+n*-.39465+r*-.5806,a=t*1+n*2.02311+r*0,o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),[o*255,i*255,a*255]}function ww(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=t*.299+n*.587+r*.114,i=t*-.14713+n*-.28886+r*.436,a=t*.615+n*-.51499+r*-.10001;return[o,i,a]}const Cw={scheme:"threezerotwofour",author:"jan t. sott (http://github.com/idleberg)",base00:"#090300",base01:"#3a3432",base02:"#4a4543",base03:"#5c5855",base04:"#807d7c",base05:"#a5a2a2",base06:"#d6d5d4",base07:"#f7f7f7",base08:"#db2d20",base09:"#e8bbd0",base0A:"#fded02",base0B:"#01a252",base0C:"#b5e4f4",base0D:"#01a0e4",base0E:"#a16a94",base0F:"#cdab53"},$w={scheme:"apathy",author:"jannik siebert (https://github.com/janniks)",base00:"#031A16",base01:"#0B342D",base02:"#184E45",base03:"#2B685E",base04:"#5F9C92",base05:"#81B5AC",base06:"#A7CEC8",base07:"#D2E7E4",base08:"#3E9688",base09:"#3E7996",base0A:"#3E4C96",base0B:"#883E96",base0C:"#963E4C",base0D:"#96883E",base0E:"#4C963E",base0F:"#3E965B"},Sw={scheme:"ashes",author:"jannik siebert (https://github.com/janniks)",base00:"#1C2023",base01:"#393F45",base02:"#565E65",base03:"#747C84",base04:"#ADB3BA",base05:"#C7CCD1",base06:"#DFE2E5",base07:"#F3F4F5",base08:"#C7AE95",base09:"#C7C795",base0A:"#AEC795",base0B:"#95C7AE",base0C:"#95AEC7",base0D:"#AE95C7",base0E:"#C795AE",base0F:"#C79595"},Ew={scheme:"atelier dune",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)",base00:"#20201d",base01:"#292824",base02:"#6e6b5e",base03:"#7d7a68",base04:"#999580",base05:"#a6a28c",base06:"#e8e4cf",base07:"#fefbec",base08:"#d73737",base09:"#b65611",base0A:"#cfb017",base0B:"#60ac39",base0C:"#1fad83",base0D:"#6684e1",base0E:"#b854d4",base0F:"#d43552"},Pw={scheme:"atelier forest",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)",base00:"#1b1918",base01:"#2c2421",base02:"#68615e",base03:"#766e6b",base04:"#9c9491",base05:"#a8a19f",base06:"#e6e2e0",base07:"#f1efee",base08:"#f22c40",base09:"#df5320",base0A:"#d5911a",base0B:"#5ab738",base0C:"#00ad9c",base0D:"#407ee7",base0E:"#6666ea",base0F:"#c33ff3"},Rw={scheme:"atelier heath",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath)",base00:"#1b181b",base01:"#292329",base02:"#695d69",base03:"#776977",base04:"#9e8f9e",base05:"#ab9bab",base06:"#d8cad8",base07:"#f7f3f7",base08:"#ca402b",base09:"#a65926",base0A:"#bb8a35",base0B:"#379a37",base0C:"#159393",base0D:"#516aec",base0E:"#7b59c0",base0F:"#cc33cc"},kw={scheme:"atelier lakeside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/)",base00:"#161b1d",base01:"#1f292e",base02:"#516d7b",base03:"#5a7b8c",base04:"#7195a8",base05:"#7ea2b4",base06:"#c1e4f6",base07:"#ebf8ff",base08:"#d22d72",base09:"#935c25",base0A:"#8a8a0f",base0B:"#568c3b",base0C:"#2d8f6f",base0D:"#257fad",base0E:"#5d5db1",base0F:"#b72dd2"},Mw={scheme:"atelier seaside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)",base00:"#131513",base01:"#242924",base02:"#5e6e5e",base03:"#687d68",base04:"#809980",base05:"#8ca68c",base06:"#cfe8cf",base07:"#f0fff0",base08:"#e6193c",base09:"#87711d",base0A:"#c3c322",base0B:"#29a329",base0C:"#1999b3",base0D:"#3d62f5",base0E:"#ad2bee",base0F:"#e619c3"},Ow={scheme:"bespin",author:"jan t. sott",base00:"#28211c",base01:"#36312e",base02:"#5e5d5c",base03:"#666666",base04:"#797977",base05:"#8a8986",base06:"#9d9b97",base07:"#baae9e",base08:"#cf6a4c",base09:"#cf7d34",base0A:"#f9ee98",base0B:"#54be0d",base0C:"#afc4db",base0D:"#5ea6ea",base0E:"#9b859d",base0F:"#937121"},Tw={scheme:"brewer",author:"timothée poisot (http://github.com/tpoisot)",base00:"#0c0d0e",base01:"#2e2f30",base02:"#515253",base03:"#737475",base04:"#959697",base05:"#b7b8b9",base06:"#dadbdc",base07:"#fcfdfe",base08:"#e31a1c",base09:"#e6550d",base0A:"#dca060",base0B:"#31a354",base0C:"#80b1d3",base0D:"#3182bd",base0E:"#756bb1",base0F:"#b15928"},Dw={scheme:"bright",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#303030",base02:"#505050",base03:"#b0b0b0",base04:"#d0d0d0",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ffffff",base08:"#fb0120",base09:"#fc6d24",base0A:"#fda331",base0B:"#a1c659",base0C:"#76c7b7",base0D:"#6fb3d2",base0E:"#d381c3",base0F:"#be643c"},_w={scheme:"chalk",author:"chris kempson (http://chriskempson.com)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#eda987",base0A:"#ddb26f",base0B:"#acc267",base0C:"#12cfc0",base0D:"#6fc2ef",base0E:"#e1a3ee",base0F:"#deaf8f"},Fw={scheme:"codeschool",author:"brettof86",base00:"#232c31",base01:"#1c3657",base02:"#2a343a",base03:"#3f4944",base04:"#84898c",base05:"#9ea7a6",base06:"#a7cfa3",base07:"#b5d8f6",base08:"#2a5491",base09:"#43820d",base0A:"#a03b1e",base0B:"#237986",base0C:"#b02f30",base0D:"#484d79",base0E:"#c59820",base0F:"#c98344"},Lw={scheme:"colors",author:"mrmrs (http://clrs.cc)",base00:"#111111",base01:"#333333",base02:"#555555",base03:"#777777",base04:"#999999",base05:"#bbbbbb",base06:"#dddddd",base07:"#ffffff",base08:"#ff4136",base09:"#ff851b",base0A:"#ffdc00",base0B:"#2ecc40",base0C:"#7fdbff",base0D:"#0074d9",base0E:"#b10dc9",base0F:"#85144b"},Iw={scheme:"default",author:"chris kempson (http://chriskempson.com)",base00:"#181818",base01:"#282828",base02:"#383838",base03:"#585858",base04:"#b8b8b8",base05:"#d8d8d8",base06:"#e8e8e8",base07:"#f8f8f8",base08:"#ab4642",base09:"#dc9656",base0A:"#f7ca88",base0B:"#a1b56c",base0C:"#86c1b9",base0D:"#7cafc2",base0E:"#ba8baf",base0F:"#a16946"},Nw={scheme:"eighties",author:"chris kempson (http://chriskempson.com)",base00:"#2d2d2d",base01:"#393939",base02:"#515151",base03:"#747369",base04:"#a09f93",base05:"#d3d0c8",base06:"#e8e6df",base07:"#f2f0ec",base08:"#f2777a",base09:"#f99157",base0A:"#ffcc66",base0B:"#99cc99",base0C:"#66cccc",base0D:"#6699cc",base0E:"#cc99cc",base0F:"#d27b53"},jw={scheme:"embers",author:"jannik siebert (https://github.com/janniks)",base00:"#16130F",base01:"#2C2620",base02:"#433B32",base03:"#5A5047",base04:"#8A8075",base05:"#A39A90",base06:"#BEB6AE",base07:"#DBD6D1",base08:"#826D57",base09:"#828257",base0A:"#6D8257",base0B:"#57826D",base0C:"#576D82",base0D:"#6D5782",base0E:"#82576D",base0F:"#825757"},Aw={scheme:"flat",author:"chris kempson (http://chriskempson.com)",base00:"#2C3E50",base01:"#34495E",base02:"#7F8C8D",base03:"#95A5A6",base04:"#BDC3C7",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ECF0F1",base08:"#E74C3C",base09:"#E67E22",base0A:"#F1C40F",base0B:"#2ECC71",base0C:"#1ABC9C",base0D:"#3498DB",base0E:"#9B59B6",base0F:"#be643c"},Kw={scheme:"google",author:"seth wright (http://sethawright.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#CC342B",base09:"#F96A38",base0A:"#FBA922",base0B:"#198844",base0C:"#3971ED",base0D:"#3971ED",base0E:"#A36AC7",base0F:"#3971ED"},Bw={scheme:"grayscale",author:"alexandre gavioli (https://github.com/alexx2/)",base00:"#101010",base01:"#252525",base02:"#464646",base03:"#525252",base04:"#ababab",base05:"#b9b9b9",base06:"#e3e3e3",base07:"#f7f7f7",base08:"#7c7c7c",base09:"#999999",base0A:"#a0a0a0",base0B:"#8e8e8e",base0C:"#868686",base0D:"#686868",base0E:"#747474",base0F:"#5e5e5e"},Hw={scheme:"green screen",author:"chris kempson (http://chriskempson.com)",base00:"#001100",base01:"#003300",base02:"#005500",base03:"#007700",base04:"#009900",base05:"#00bb00",base06:"#00dd00",base07:"#00ff00",base08:"#007700",base09:"#009900",base0A:"#007700",base0B:"#00bb00",base0C:"#005500",base0D:"#009900",base0E:"#00bb00",base0F:"#005500"},Vw={scheme:"harmonic16",author:"jannik siebert (https://github.com/janniks)",base00:"#0b1c2c",base01:"#223b54",base02:"#405c79",base03:"#627e99",base04:"#aabcce",base05:"#cbd6e2",base06:"#e5ebf1",base07:"#f7f9fb",base08:"#bf8b56",base09:"#bfbf56",base0A:"#8bbf56",base0B:"#56bf8b",base0C:"#568bbf",base0D:"#8b56bf",base0E:"#bf568b",base0F:"#bf5656"},zw={scheme:"hopscotch",author:"jan t. sott",base00:"#322931",base01:"#433b42",base02:"#5c545b",base03:"#797379",base04:"#989498",base05:"#b9b5b8",base06:"#d5d3d5",base07:"#ffffff",base08:"#dd464c",base09:"#fd8b19",base0A:"#fdcc59",base0B:"#8fc13e",base0C:"#149b93",base0D:"#1290bf",base0E:"#c85e7c",base0F:"#b33508"},Uw={scheme:"isotope",author:"jan t. sott",base00:"#000000",base01:"#404040",base02:"#606060",base03:"#808080",base04:"#c0c0c0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#ff0000",base09:"#ff9900",base0A:"#ff0099",base0B:"#33ff00",base0C:"#00ffff",base0D:"#0066ff",base0E:"#cc00ff",base0F:"#3300ff"},qw={scheme:"marrakesh",author:"alexandre gavioli (http://github.com/alexx2/)",base00:"#201602",base01:"#302e00",base02:"#5f5b17",base03:"#6c6823",base04:"#86813b",base05:"#948e48",base06:"#ccc37a",base07:"#faf0a5",base08:"#c35359",base09:"#b36144",base0A:"#a88339",base0B:"#18974e",base0C:"#75a738",base0D:"#477ca1",base0E:"#8868b3",base0F:"#b3588e"},Ww={scheme:"mocha",author:"chris kempson (http://chriskempson.com)",base00:"#3B3228",base01:"#534636",base02:"#645240",base03:"#7e705a",base04:"#b8afad",base05:"#d0c8c6",base06:"#e9e1dd",base07:"#f5eeeb",base08:"#cb6077",base09:"#d28b71",base0A:"#f4bc87",base0B:"#beb55b",base0C:"#7bbda4",base0D:"#8ab3b5",base0E:"#a89bb9",base0F:"#bb9584"},Gw={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"},Qw={scheme:"nicinabox",author:"nicinabox (http://github.com/nicinabox)",base00:"#2A2F3A",base01:"#3C444F",base02:"#4F5A65",base03:"#BEBEBE",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#FFFFFF",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#FC6D24",base0A:"#ddb26f",base0B:"#A1C659",base0C:"#12cfc0",base0D:"#6FB3D2",base0E:"#D381C3",base0F:"#deaf8f"},Yw={scheme:"ocean",author:"chris kempson (http://chriskempson.com)",base00:"#2b303b",base01:"#343d46",base02:"#4f5b66",base03:"#65737e",base04:"#a7adba",base05:"#c0c5ce",base06:"#dfe1e8",base07:"#eff1f5",base08:"#bf616a",base09:"#d08770",base0A:"#ebcb8b",base0B:"#a3be8c",base0C:"#96b5b4",base0D:"#8fa1b3",base0E:"#b48ead",base0F:"#ab7967"},Xw={scheme:"paraiso",author:"jan t. sott",base00:"#2f1e2e",base01:"#41323f",base02:"#4f424c",base03:"#776e71",base04:"#8d8687",base05:"#a39e9b",base06:"#b9b6b0",base07:"#e7e9db",base08:"#ef6155",base09:"#f99b15",base0A:"#fec418",base0B:"#48b685",base0C:"#5bc4bf",base0D:"#06b6ef",base0E:"#815ba4",base0F:"#e96ba8"},Zw={scheme:"pop",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#eb008a",base09:"#f29333",base0A:"#f8ca12",base0B:"#37b349",base0C:"#00aabb",base0D:"#0e5a94",base0E:"#b31e8d",base0F:"#7a2d00"},Jw={scheme:"railscasts",author:"ryan bates (http://railscasts.com)",base00:"#2b2b2b",base01:"#272935",base02:"#3a4055",base03:"#5a647e",base04:"#d4cfc9",base05:"#e6e1dc",base06:"#f4f1ed",base07:"#f9f7f3",base08:"#da4939",base09:"#cc7833",base0A:"#ffc66d",base0B:"#a5c261",base0C:"#519f50",base0D:"#6d9cbe",base0E:"#b6b3eb",base0F:"#bc9458"},eC={scheme:"shapeshifter",author:"tyler benziger (http://tybenz.com)",base00:"#000000",base01:"#040404",base02:"#102015",base03:"#343434",base04:"#555555",base05:"#ababab",base06:"#e0e0e0",base07:"#f9f9f9",base08:"#e92f2f",base09:"#e09448",base0A:"#dddd13",base0B:"#0ed839",base0C:"#23edda",base0D:"#3b48e3",base0E:"#f996e2",base0F:"#69542d"},tC={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},nC={scheme:"summerfruit",author:"christopher corley (http://cscorley.github.io/)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#B0B0B0",base05:"#D0D0D0",base06:"#E0E0E0",base07:"#FFFFFF",base08:"#FF0086",base09:"#FD8900",base0A:"#ABA800",base0B:"#00C918",base0C:"#1faaaa",base0D:"#3777E6",base0E:"#AD00A1",base0F:"#cc6633"},rC={scheme:"tomorrow",author:"chris kempson (http://chriskempson.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#cc6666",base09:"#de935f",base0A:"#f0c674",base0B:"#b5bd68",base0C:"#8abeb7",base0D:"#81a2be",base0E:"#b294bb",base0F:"#a3685a"},oC={scheme:"london tube",author:"jan t. sott",base00:"#231f20",base01:"#1c3f95",base02:"#5a5758",base03:"#737171",base04:"#959ca1",base05:"#d9d8d8",base06:"#e7e7e8",base07:"#ffffff",base08:"#ee2e24",base09:"#f386a1",base0A:"#ffd204",base0B:"#00853e",base0C:"#85cebc",base0D:"#009ddc",base0E:"#98005d",base0F:"#b06110"},iC={scheme:"twilight",author:"david hart (http://hart-dev.com)",base00:"#1e1e1e",base01:"#323537",base02:"#464b50",base03:"#5f5a60",base04:"#838184",base05:"#a7a7a7",base06:"#c3c3c3",base07:"#ffffff",base08:"#cf6a4c",base09:"#cda869",base0A:"#f9ee98",base0B:"#8f9d6a",base0C:"#afc4db",base0D:"#7587a6",base0E:"#9b859d",base0F:"#9b703f"},sg={threezerotwofour:Cw,apathy:$w,ashes:Sw,atelierDune:Ew,atelierForest:Pw,atelierHeath:Rw,atelierLakeside:kw,atelierSeaside:Mw,bespin:Ow,brewer:Tw,bright:Dw,chalk:_w,codeschool:Fw,colors:Lw,default:Iw,eighties:Nw,embers:jw,flat:Aw,google:Kw,grayscale:Bw,greenscreen:Hw,harmonic:Vw,hopscotch:zw,isotope:Uw,marrakesh:qw,mocha:Ww,monokai:Gw,nicinabox:Qw,ocean:Yw,paraiso:Xw,pop:Zw,railscasts:Jw,shapeshifter:eC,solarized:tC,summerfruit:nC,tomorrow:rC,tube:oC,twilight:iC},lg=sg.default,jd=Object.keys(lg),aC=e=>e<.25?1:e<.5?.9-e:1.1-e,sC=e=>{const t=vd(e),[n,r,o]=ww(t.array()),i=[aC(n),r,o],a=xw(i);return vd.rgb(a).hex()},ur=e=>t=>({className:[t.className,e.className].filter(Boolean).join(" "),style:{...t.style||{},...e.style||{}}}),lC=(e,t)=>{if(e===void 0)return t;if(t===void 0)return e;const n=typeof e,r=typeof t;switch(n){case"string":switch(r){case"string":return[t,e].filter(Boolean).join(" ");case"object":return ur({className:e,style:t});case"function":return(o,...i)=>ur({className:e})(t(o,...i))}break;case"object":switch(r){case"string":return ur({className:t,style:e});case"object":return{...t,...e};case"function":return(o,...i)=>ur({style:e})(t(o,...i))}break;case"function":switch(r){case"string":return(o,...i)=>e(ur(o)({className:t}),...i);case"object":return(o,...i)=>e(ur(o)({style:t}),...i);case"function":return(o,...i)=>e(t(o,...i),...i)}}},uC=(e,t)=>{const n=Object.keys(t);for(const r in e)n.indexOf(r)===-1&&n.push(r);return n.reduce((r,o)=>(r[o]=lC(e[o],t[o]),r),{})},cC=(e,t,...n)=>{if(t===null)return e;Array.isArray(t)||(t=[t]);const o=t.map(i=>e[i]).filter(Boolean).reduce((i,a)=>(typeof a=="string"?i.className=[i.className,a].filter(Boolean).join(" "):typeof a=="object"?i.style={...i.style,...a}:typeof a=="function"&&(i={...i,...a(i,...n)}),i),{className:"",style:{}});return o.className||delete o.className,Object.keys(o.style).length===0&&delete o.style,o},Nl=e=>Object.keys(e).reduce((t,n)=>(t[n]=/^base/.test(n)?sC(e[n]):n==="scheme"?e[n]+":inverted":e[n],t),{}),dC=va((e,t={},n={},...r)=>{const{defaultBase16:o=lg,base16Themes:i=null}=t,a=fC(n,i);a&&(n={...a,...n});const s=jd.reduce((c,p)=>(c[p]=n[p]||o[p],c),{}),l=Object.keys(n).reduce((c,p)=>(jd.indexOf(p)===-1&&(c[p]=n[p]),c),{}),u=e(s),h=uC(l,u);return va(cC,2)(h,...r)},3),ug=e=>!!e.extend,fC=(e,t)=>{if(e&&ug(e)&&e.extend&&(e=e.extend),typeof e=="string"){const[n,r]=e.split(":");t?e=t[n]:e=sg[n],r==="inverted"&&(e=Nl(e))}return e&&Object.prototype.hasOwnProperty.call(e,"base00")?e:void 0},hC=e=>typeof e=="string"?`${e}:inverted`:e&&ug(e)&&e.extend?typeof e.extend=="string"?{...e,extend:`${e.extend}:inverted`}:{...e,extend:Nl(e.extend)}:e&&Nl(e);function pC(e){const t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&typeof e[Symbol.iterator]=="function"?"Iterable":t==="Custom"&&e.constructor!==Object&&e instanceof Object?"Object":t}function cg({styling:e,arrowStyle:t="single",expanded:n,nodeType:r,onClick:o}){return d.createElement("div",{...e("arrowContainer",t),onClick:o},d.createElement("div",{...e(["arrow","arrowSign"],r,n,t)},"▶",t==="double"&&d.createElement("div",{...e(["arrowSign","arrowSignInner"])},"▶")))}function gC(e,t){return e==="Object"?Object.keys(t).length:e==="Array"?t.length:1/0}function mC(e){return typeof e.set=="function"}function vC(e,t,n,r=0,o=1/0){let i;if(e==="Object"){let a=Object.getOwnPropertyNames(t);n&&a.sort(n===!0?void 0:n),a=a.slice(r,o+1),i={entries:a.map(s=>({key:s,value:t[s]}))}}else if(e==="Array")i={entries:t.slice(r,o+1).map((a,s)=>({key:s+r,value:a}))};else{let a=0;const s=[];let l=!0;const u=mC(t);for(const h of t){if(a>o){l=!1;break}r<=a&&(u&&Array.isArray(h)?typeof h[0]=="string"||typeof h[0]=="number"?s.push({key:h[0],value:h[1]}):s.push({key:`[entry ${a}]`,value:{"[key]":h[0],"[value]":h[1]}}):s.push({key:a,value:h})),a++}i={hasMore:!l,entries:s}}return i}function Ps(e,t,n){const r=[];for(;t-e>n*n;)n=n*n;for(let o=e;o<=t;o+=n)r.push({from:o,to:Math.min(t,o+n-1)});return r}function bC(e,t,n,r,o=0,i=1/0){const a=vC.bind(null,e,t,n);if(!r)return a().entries;const s=i<1/0,l=Math.min(i-o,gC(e,t));if(e!=="Iterable"){if(l<=r||r<7)return a(o,i).entries}else if(l<=r&&!s)return a(o,i).entries;let u;if(e==="Iterable"){const{hasMore:h,entries:c}=a(o,o+r-1);u=h?[...c,...Ps(o+r,o+2*r-1,r)]:c}else u=s?Ps(o,i,r):[...a(0,r-5).entries,...Ps(r-4,l-5,r),...a(l-4,l-1).entries];return u}function yC(e){const{styling:t,from:n,to:r,renderChildNodes:o,nodeType:i}=e,[a,s]=d.useState(!1),l=d.useCallback(()=>{s(!a)},[a]);return a?d.createElement("div",{...t("itemRange",a)},o(e,n,r)):d.createElement("div",{...t("itemRange",a),onClick:l},d.createElement(cg,{nodeType:i,styling:t,expanded:!1,onClick:l,arrowStyle:"double"}),`${n} ... ${r}`)}function xC(e){return e.to!==void 0}function dg(e,t,n){const{nodeType:r,data:o,collectionLimit:i,circularCache:a,keyPath:s,postprocessValue:l,sortObjectKeys:u}=e,h=[];return bC(r,o,u,i,t,n).forEach(c=>{if(xC(c))h.push(d.createElement(yC,{...e,key:`ItemRange--${c.from}-${c.to}`,from:c.from,to:c.to,renderChildNodes:dg}));else{const{key:p,value:f}=c,g=a.includes(f);h.push(d.createElement(fg,{...e,postprocessValue:l,collectionLimit:i,key:`Node--${p}`,keyPath:[p,...s],value:l(f),circularCache:[...a,f],isCircular:g,hideRoot:!1}))}}),h}function Tu(e){const{circularCache:t=[],collectionLimit:n,createItemString:r,data:o,expandable:i,getItemString:a,hideRoot:s,isCircular:l,keyPath:u,labelRenderer:h,level:c=0,nodeType:p,nodeTypeIndicator:f,shouldExpandNodeInitially:g,styling:m}=e,[v,b]=d.useState(l?!1:g(u,o,c)),x=d.useCallback(()=>{i&&b(!v)},[i,v]),w=v||s&&c===0?dg({...e,circularCache:t,level:c+1}):null,$=d.createElement("span",{...m("nestedNodeItemType",v)},f),k=a(p,o,$,r(o,n),u),E=[u,p,v,i];return s?d.createElement("li",{...m("rootNode",...E)},d.createElement("ul",{...m("rootNodeChildren",...E)},w)):d.createElement("li",{...m("nestedNode",...E)},i&&d.createElement(cg,{styling:m,nodeType:p,expanded:v,onClick:x}),d.createElement("label",{...m(["label","nestedNodeLabel"],...E),onClick:x},h(...E)),d.createElement("span",{...m("nestedNodeItemString",...E),onClick:x},k),d.createElement("ul",{...m("nestedNodeChildren",...E)},w))}function wC(e){const t=Object.getOwnPropertyNames(e).length;return`${t} ${t!==1?"keys":"key"}`}function CC({data:e,...t}){return d.createElement(Tu,{...t,data:e,nodeType:"Object",nodeTypeIndicator:t.nodeType==="Error"?"Error()":"{}",createItemString:wC,expandable:Object.getOwnPropertyNames(e).length>0})}function $C(e){return`${e.length} ${e.length!==1?"items":"item"}`}function SC({data:e,...t}){return d.createElement(Tu,{...t,data:e,nodeType:"Array",nodeTypeIndicator:"[]",createItemString:$C,expandable:e.length>0})}function EC(e,t){let n=0,r=!1;if(Number.isSafeInteger(e.size))n=e.size;else for(const o of e){if(t&&n+1>t){r=!0;break}n+=1}return`${r?">":""}${n} ${n!==1?"entries":"entry"}`}function PC(e){return d.createElement(Tu,{...e,nodeType:"Iterable",nodeTypeIndicator:"()",createItemString:EC,expandable:!0})}function At({nodeType:e,styling:t,labelRenderer:n,keyPath:r,valueRenderer:o,value:i,valueGetter:a=s=>s}){return d.createElement("li",{...t("value",e,r)},d.createElement("label",{...t(["label","valueLabel"],e,r)},n(r,e,!1,!1)),d.createElement("span",{...t("valueText",e,r)},o(a(i),i,...r)))}function fg({getItemString:e,keyPath:t,labelRenderer:n,styling:r,value:o,valueRenderer:i,isCustomNode:a,...s}){const l=a(o)?"Custom":pC(o),u={getItemString:e,key:t[0],keyPath:t,labelRenderer:n,nodeType:l,styling:r,value:o,valueRenderer:i},h={...s,...u,data:o,isCustomNode:a};switch(l){case"Object":case"Error":case"WeakMap":case"WeakSet":return d.createElement(CC,{...h});case"Array":return d.createElement(SC,{...h});case"Iterable":case"Map":case"Set":return d.createElement(PC,{...h});case"String":return d.createElement(At,{...u,valueGetter:c=>`"${c}"`});case"Number":return d.createElement(At,{...u});case"Boolean":return d.createElement(At,{...u,valueGetter:c=>c?"true":"false"});case"Date":return d.createElement(At,{...u,valueGetter:c=>c.toISOString()});case"Null":return d.createElement(At,{...u,valueGetter:()=>"null"});case"Undefined":return d.createElement(At,{...u,valueGetter:()=>"undefined"});case"Function":case"Symbol":return d.createElement(At,{...u,valueGetter:c=>c.toString()});case"Custom":return d.createElement(At,{...u});default:return d.createElement(At,{...u,valueGetter:()=>`<${l}>`})}}const RC={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},kC=e=>({BACKGROUND_COLOR:e.base00,TEXT_COLOR:e.base07,STRING_COLOR:e.base0B,DATE_COLOR:e.base0B,NUMBER_COLOR:e.base09,BOOLEAN_COLOR:e.base09,NULL_COLOR:e.base08,UNDEFINED_COLOR:e.base08,FUNCTION_COLOR:e.base08,SYMBOL_COLOR:e.base08,LABEL_COLOR:e.base0D,ARROW_COLOR:e.base0D,ITEM_STRING_COLOR:e.base0B,ITEM_STRING_EXPANDED_COLOR:e.base03}),MC=e=>({String:e.STRING_COLOR,Date:e.DATE_COLOR,Number:e.NUMBER_COLOR,Boolean:e.BOOLEAN_COLOR,Null:e.NULL_COLOR,Undefined:e.UNDEFINED_COLOR,Function:e.FUNCTION_COLOR,Symbol:e.SYMBOL_COLOR}),OC=e=>{const t=kC(e);return{tree:{border:0,padding:0,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"0.125em",marginRight:0,listStyle:"none",MozUserSelect:"none",WebkitUserSelect:"none",backgroundColor:t.BACKGROUND_COLOR},value:({style:n},r,o)=>({style:{...n,paddingTop:"0.25em",paddingRight:0,marginLeft:"0.875em",WebkitUserSelect:"text",MozUserSelect:"text",wordWrap:"break-word",paddingLeft:o.length>1?"2.125em":"1.25em",textIndent:"-0.5em",wordBreak:"break-all"}}),label:{display:"inline-block",color:t.LABEL_COLOR},valueLabel:{margin:"0 0.5em 0 0"},valueText:({style:n},r)=>({style:{...n,color:MC(t)[r]}}),itemRange:(n,r)=>({style:{paddingTop:r?0:"0.25em",cursor:"pointer",color:t.LABEL_COLOR}}),arrow:({style:n},r,o)=>({style:{...n,marginLeft:0,transition:"150ms",WebkitTransition:"150ms",MozTransition:"150ms",WebkitTransform:o?"rotateZ(90deg)":"rotateZ(0deg)",MozTransform:o?"rotateZ(90deg)":"rotateZ(0deg)",transform:o?"rotateZ(90deg)":"rotateZ(0deg)",transformOrigin:"45% 50%",WebkitTransformOrigin:"45% 50%",MozTransformOrigin:"45% 50%",position:"relative",lineHeight:"1.1em",fontSize:"0.75em"}}),arrowContainer:({style:n},r)=>({style:{...n,display:"inline-block",paddingRight:"0.5em",paddingLeft:r==="double"?"1em":0,cursor:"pointer"}}),arrowSign:{color:t.ARROW_COLOR},arrowSignInner:{position:"absolute",top:0,left:"-0.4em"},nestedNode:({style:n},r,o,i,a)=>({style:{...n,position:"relative",paddingTop:"0.25em",marginLeft:r.length>1?"0.875em":0,paddingLeft:a?0:"1.125em"}}),rootNode:{padding:0,margin:0},nestedNodeLabel:({style:n},r,o,i,a)=>({style:{...n,margin:0,padding:0,WebkitUserSelect:a?"inherit":"text",MozUserSelect:a?"inherit":"text",cursor:a?"pointer":"default"}}),nestedNodeItemString:({style:n},r,o,i)=>({style:{...n,paddingLeft:"0.5em",cursor:"default",color:i?t.ITEM_STRING_EXPANDED_COLOR:t.ITEM_STRING_COLOR}}),nestedNodeItemType:{marginLeft:"0.3em",marginRight:"0.3em"},nestedNodeChildren:({style:n},r,o)=>({style:{...n,padding:0,margin:0,listStyle:"none",display:o?"block":"none"}}),rootNodeChildren:{padding:0,margin:0,listStyle:"none"}}},TC=dC(OC,{defaultBase16:RC}),Ad=e=>e,DC=(e,t,n)=>n===0,_C=(e,t,n,r)=>d.createElement("span",null,n," ",r),FC=([e])=>d.createElement("span",null,e,":"),LC=()=>!1;function ba({data:e,theme:t,invertTheme:n,keyPath:r=["root"],labelRenderer:o=FC,valueRenderer:i=Ad,shouldExpandNodeInitially:a=DC,hideRoot:s=!1,getItemString:l=_C,postprocessValue:u=Ad,isCustomNode:h=LC,collectionLimit:c=50,sortObjectKeys:p=!1}){const f=d.useMemo(()=>TC(n?hC(t):t),[t,n]);return d.createElement("ul",{...f("tree")},d.createElement(fg,{keyPath:s?[]:r,value:u(e),isCustomNode:h,styling:f,labelRenderer:o,valueRenderer:i,shouldExpandNodeInitially:a,hideRoot:s,getItemString:l,postprocessValue:u,collectionLimit:c,sortObjectKeys:p}))}var za=function(e){var t=e.actions;return y.jsxs(Z4,{children:[y.jsx(pu,{className:"flex size-7 items-center justify-center rounded-md bg-slate-50 text-slate-900 outline-none transition duration-150 ease-in-out hover:bg-slate-100 focus:bg-slate-100 radix-state-open:bg-slate-100 dark:bg-slate-800 dark:text-slate-100 dark:hover:bg-slate-700 dark:focus:bg-slate-700 dark:radix-state-open:bg-slate-700","aria-label":"Action menu",children:y.jsx(D2,{width:18,height:18})}),y.jsx(Q4,{placement:"bottom left",className:"space-y-0.5 rounded-md border border-slate-200 bg-white/95 p-1 shadow-lg backdrop-blur-md dark:border-slate-700 dark:bg-slate-800/95",offset:5,children:y.jsx(t3,{children:t.map(function(n){return y.jsxs(i3,{className:"flex cursor-default items-center space-x-1.5 rounded-md py-1.5 pl-1.5 pr-8 text-sm font-medium text-slate-900 outline-none transition duration-150 ease-in-out focus:bg-slate-100 dark:text-slate-100 dark:focus:bg-slate-700",onAction:n.onSelect,children:[n.icon,y.jsx("span",{children:n.label})]},n.label)})})})]})},IC=function(e){var t=e.job,n=e.queueName,r=e.queue,o=e.onRemove,i=le.job.retry.useMutation(),a=i.mutate,s=i.isSuccess,l=le.job.discard.useMutation(),u=l.mutate,h=l.isSuccess,c=le.job.rerun.useMutation(),p=c.mutate,f=c.isSuccess,g=le.job.remove.useMutation(),m=g.mutate,v=g.isSuccess;d.useEffect(function(){(s||h||f||v)&&(o==null||o())},[s,h,f,v,o]);var b={queueName:n,jobId:t.id},x=(r==null?void 0:r.supports.retry)!==!1,w=Ke(Ke(Ke([],t.failedReason&&x?[{label:"Retry",onSelect:function(){a(b)},icon:y.jsx(jr,{})}]:[],!0),t.finishedAt?[{label:"Rerun",onSelect:function(){p(b)},icon:y.jsx(jr,{})}]:[{label:"Discard",onSelect:function(){u(b)},icon:y.jsx(j2,{})}],!0),[{label:"Remove",onSelect:function(){m(b)},icon:y.jsx(Gr,{})}],!1);return y.jsx(za,{actions:w})},Cn=function(e){var t=e.colorScheme,n=t===void 0?"slate":t,r=e.variant,o=r===void 0?"outline":r,i=e.size,a=i===void 0?"md":i,s=e.icon,l=e.label,u=e.isLoading,h=e.onClick,c=e.disabled;return y.jsxs("button",{onClick:h,disabled:u||c,className:Ar("flex items-center space-x-1 rounded-md border text-sm font-medium transition-colors duration-150",{"py-0.5":a==="sm","py-1":a==="md","py-1.5":a==="lg"},[a==="sm"&&s?"pl-1.5 pr-2.5":"px-2.5",a==="md"&&s?"pl-2 pr-3":"px-3",a==="lg"&&s?"pl-2.5 pr-4":"px-4"],{"cursor-not-allowed opacity-50":u||c,"border-yellow-900 text-yellow-900 hover:bg-yellow-50 focus:bg-yellow-50 dark:border-yellow-400 dark:text-yellow-400 dark:hover:bg-yellow-950/30 dark:focus:bg-yellow-950/30":n==="yellow"&&o==="outline","border-slate-900 text-slate-900 hover:bg-slate-50 focus:bg-slate-50 dark:border-slate-400 dark:text-slate-300 dark:hover:bg-slate-800 dark:focus:bg-slate-800":n==="slate"&&o==="outline","border-red-900 text-red-900 hover:bg-red-50 focus:bg-red-50 dark:border-red-400 dark:text-red-400 dark:hover:bg-red-950/30 dark:focus:bg-red-950/30":n==="red"&&o==="outline","border-yellow-800 bg-yellow-800 text-yellow-50 hover:border-yellow-900 hover:bg-yellow-900 focus:border-yellow-900 focus:bg-yellow-900 dark:border-yellow-600 dark:bg-yellow-600 dark:hover:border-yellow-500 dark:hover:bg-yellow-500 dark:focus:border-yellow-500 dark:focus:bg-yellow-500":n==="yellow"&&o==="filled","border-slate-800 bg-slate-800 text-slate-50 hover:border-slate-900 hover:bg-slate-900 focus:border-slate-900 focus:bg-slate-900 dark:border-slate-600 dark:bg-slate-600 dark:hover:border-slate-500 dark:hover:bg-slate-500 dark:focus:border-slate-500 dark:focus:bg-slate-500":n==="slate"&&o==="filled","border-red-800 bg-red-800 text-red-50 hover:border-red-900 hover:bg-red-900 focus:border-red-900 focus:bg-red-900 dark:border-red-600 dark:bg-red-600 dark:hover:border-red-500 dark:hover:bg-red-500 dark:focus:border-red-500 dark:focus:bg-red-500":n==="red"&&o==="filled"}),children:[u?y.jsx("div",{className:"flex w-4 justify-center",children:y.jsx(eu,{width:10,height:10,className:"animate-spin"})}):s?y.jsx("div",{className:"flex w-4 justify-center",children:s}):null,y.jsx("span",{children:l})]})},NC=function(e){var t=e.job,n=e.queueName,r=e.onDismiss,o=le.queue.byName.useQuery({queueName:n}),i=le.job.retry.useMutation().mutate,a=le.job.logs.useQuery({jobId:t.id,queueName:n}).data;return y.jsx(Ba,{isOpen:!0,isDismissable:!0,onOpenChange:function(s){s||r()},className:"fixed inset-0 bg-black/20 dark:bg-black/40",children:y.jsx(Aa,{className:"fixed left-1/2 top-1/2 max-h-[85vh] w-full max-w-xl -translate-x-1/2 -translate-y-1/2 overflow-y-scroll rounded-lg bg-white p-4 shadow-xl dark:bg-slate-900",children:function(s){var l,u,h=s.close;return y.jsxs(y.Fragment,{children:[y.jsx("button",{className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-full text-slate-500 transition duration-150 ease-in-out hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800","aria-label":"Close",onClick:function(){r(),h()},children:y.jsx(Jl,{})}),y.jsxs("div",{className:"flex items-center space-x-4",children:[y.jsxs(Ka,{className:"mb-1 flex items-center space-x-2",children:[y.jsx("span",{className:"text-xl font-semibold text-slate-900 dark:text-slate-100",children:t.name}),y.jsxs("span",{className:"rounded-md text-slate-500 dark:text-slate-400",children:["#",t.id]})]}),y.jsx(IC,{queueName:n,job:t,queue:(l=o.data)!==null&&l!==void 0?l:void 0,onRemove:r})]}),y.jsxs("div",{children:[t.failedReason?y.jsxs("div",{className:"space-y-2 border-b border-b-slate-200 py-4 dark:border-b-slate-700",children:[y.jsx("p",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Error"}),y.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:t.failedReason}),y.jsx(Cn,{label:"Retry",size:"sm",icon:y.jsx(jr,{width:14}),onClick:function(){i({queueName:n,jobId:t.id}),r()}})]}):null,y.jsxs("div",{className:"space-y-2 border-b border-b-slate-200 py-4 dark:border-b-slate-700",children:[y.jsx("p",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Options"}),y.jsx("div",{className:"data-json-renderer [&>ul]:max-h-[400px]",children:y.jsx(ba,{data:t.opts,theme:"monokai"})})]}),y.jsxs("div",{className:"space-y-2 pt-4",children:[y.jsx("p",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Data"}),y.jsx("div",{className:"data-json-renderer [&>ul]:max-h-[400px]",children:y.jsx(ba,{data:t.data,theme:"monokai"})})]}),!((u=o.data)===null||u===void 0)&&u.supports.logs&&(a!=null&&a.length)?y.jsxs("div",{className:"mt-4 space-y-2 border-t border-t-slate-200 pt-4 dark:border-t-slate-700",children:[y.jsx("p",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Logs"}),y.jsx("div",{className:"space-y-1",children:a==null?void 0:a.map(function(c,p){return y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx("div",{className:"h-4 w-1 rounded-sm bg-slate-300 dark:bg-slate-600"}),y.jsx("p",{className:"font-mono text-sm text-slate-900 dark:text-slate-100",children:c})]},p)})})]}):null]})]})}})})},ki=a1(),jC=[ki.display({id:"select",header:function(e){var t=e.table;return y.jsx(ca,{checked:t.getIsSomeRowsSelected()?"indeterminate":t.getIsAllRowsSelected(),onCheckedChange:function(){t.toggleAllRowsSelected()}})},cell:function(e){var t=e.row,n=e.table;return y.jsx(ca,{className:n.getIsSomeRowsSelected()||n.getIsAllRowsSelected()?"":"opacity-0 transition group-hover:opacity-100",checked:t.getIsSomeSelected()?"indeterminate":t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})}}),ki.accessor("name",{cell:function(e){return y.jsxs("div",{className:"flex w-full items-center space-x-2",children:[y.jsx("span",{className:"max-w-fit grow basis-full truncate text-slate-900 dark:text-slate-200",children:e.cell.row.original.name}),y.jsxs("span",{className:"max-w-[20%] shrink truncate text-sm text-slate-500 dark:text-slate-400",children:["#",e.cell.row.original.id]})]})},header:"Name"}),ki.display({id:"lifecycle",header:function(){return"Lifecycle"},cell:function(e){var t=e.row.original,n=t.createdAt,r=t.processedAt,o=t.finishedAt,i=t.status,a=t.retriedAt;return y.jsxs("div",{className:"flex items-center space-x-3",children:[y.jsx(Rs,{date:new Date(n),variant:"added"}),i==="waiting"?y.jsx(Kd,{}):null,r?y.jsxs(y.Fragment,{children:[y.jsx(Bd,{date:new Date(r),baseDate:new Date(n)}),y.jsx(Rs,{date:new Date(r),variant:a?"retried":"processing"})]}):null,i==="active"?y.jsx(Kd,{}):null,o&&r?y.jsxs(y.Fragment,{children:[y.jsx(Bd,{date:new Date(o),baseDate:new Date(r)}),y.jsx(Rs,{date:new Date(o),variant:i==="failed"?"failed":"completed"})]}):null]})}}),ki.display({id:"options",header:"Options",cell:function(e){var t,n=e.row.original.opts;return y.jsxs("div",{className:"flex items-center space-x-2",children:[n.priority?y.jsx(uo,{icon:y.jsx(F2,{width:12,height:12}),label:n.priority}):null,n.attempts&&n.attempts>1?y.jsx(uo,{icon:y.jsx(jr,{width:12,height:12}),label:n.attempts}):null,n.lifo?y.jsx(uo,{icon:y.jsx(r5,{width:12,height:12}),label:"LIFO"}):null,n.delay?y.jsx(uo,{icon:y.jsx(K2,{width:12,height:12}),label:n.delay}):null,!((t=n.repeat)===null||t===void 0)&&t.count?y.jsx(uo,{icon:y.jsx(H2,{width:12,height:12}),label:n.repeat.count}):null]})}})],AC=function(e){var t=e.jobs,n=e.totalJobs,r=e.onBottomInView,o=e.isLoading,i=e.isFetchingNextPage,a=e.queueName,s=e.status,l=d.useState({}),u=l[0],h=l[1],c=M7({threshold:0,onChange:function(k){k&&r()}}).ref,p=v1({data:t,columns:jC,getCoreRowModel:m1(),state:{rowSelection:u},onRowSelectionChange:h}),f=t.length===0,g=t.length/(n||0)*100,m=d.useState(null),v=m[0],b=m[1],x=le.job.retry.useMutation().mutate,w=le.job.rerun.useMutation().mutate,$=le.job.bulkRemove.useMutation().mutate;return d.useEffect(function(){p.resetRowSelection()},[s]),y.jsxs("div",{children:[v?y.jsx(NC,{queueName:a,job:v,onDismiss:function(){return b(null)}}):null,y.jsx("div",{className:"rounded-md border border-slate-200 shadow-sm dark:border-slate-700",children:o?y.jsx(P1,{}):y.jsxs("div",{children:[p.getHeaderGroups().map(function(k,E){return y.jsx("div",{className:"sticky top-0 grid grid-cols-[auto,350px,576px,1fr] rounded-t-md border-b border-slate-200 bg-slate-100/50 p-2 backdrop-blur-md dark:border-slate-700 dark:bg-slate-900/50",children:k.headers.map(function(R){return y.jsx("div",{className:"flex h-full items-center text-sm font-semibold text-slate-700 dark:text-slate-300 ".concat(E!==0?"pr-10":"pr-3"),children:R.isPlaceholder?null:aa(R.column.columnDef.header,R.getContext())},R.id)})},k.id)}),p.getRowModel().rows.map(function(k,E){return y.jsx(E1,{isLastRow:p.getRowModel().rows.length!==E+1,isSelected:k.getIsSelected(),onClick:function(){return b(k.original)},layoutVariant:"job",children:k.getVisibleCells().map(function(R,M){return y.jsx("div",{className:"flex h-full items-center ".concat(M!==0?"pr-10":"pr-3"),children:aa(R.column.columnDef.cell,R.getContext())},R.id)})},k.id)}),!o&&f?y.jsx("div",{className:"flex items-center justify-center py-10",children:y.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:"No jobs found"})}):null]})}),!o&&f?null:y.jsx("div",{ref:c,className:"my-3 flex justify-center",children:y.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[y.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:["You've viewed ",t.length," of ",n," jobs"]}),y.jsx(s3,{value:g,children:function(k){var E=k.percentage;return y.jsx(y.Fragment,{children:y.jsx("div",{style:{transform:"translateZ(0)"},className:"relative h-0.5 w-[144px] overflow-hidden rounded-sm bg-slate-200 dark:bg-slate-700",children:y.jsx("div",{className:"size-full bg-cyan-500 transition duration-300 ease-in-out",style:{transform:"translateX(-".concat(100-E,"%)")}})})})}}),i?y.jsx(eu,{className:"animate-spin text-slate-300 dark:text-slate-600"}):null]})}),p.getSelectedRowModel().rows.length>0?y.jsx("div",{className:"pointer-events-none sticky bottom-0 flex w-full items-center justify-center pb-5",children:y.jsxs("div",{className:"pointer-events-auto flex items-center space-x-3 rounded-lg border-slate-100 bg-white/90 px-3 py-2 text-sm shadow-lg backdrop-blur dark:border-slate-700 dark:bg-slate-900/90",children:[y.jsxs("p",{className:"text-slate-900 dark:text-slate-100",children:[p.getSelectedRowModel().rows.length," selected"]}),s==="completed"||s==="failed"?y.jsx(Cn,{label:s==="failed"?"Retry":"Rerun",icon:y.jsx(jr,{}),size:"sm",onClick:function(){p.getSelectedRowModel().rows.forEach(function(k){s==="failed"?x({queueName:a,jobId:k.original.id}):w({queueName:a,jobId:k.original.id})}),p.resetRowSelection()}}):null,y.jsx(Cn,{label:"Delete",colorScheme:"red",icon:y.jsx(Gr,{}),size:"sm",onClick:function(){$({queueName:a,jobIds:p.getSelectedRowModel().rows.map(function(k){return k.original.id})}),p.resetRowSelection()}})]})}):null]})},Rs=function(e){var t=e.variant,n=e.date,r={added:"Added to queue",completed:"Completed",failed:"Failed",processing:"Processed",retried:"Retried"};return y.jsx(Ru,{message:"".concat(r[t]," ").concat(S1(n)," ago"),children:y.jsxs("div",{className:"flex items-center space-x-1.5",children:[t==="added"&&y.jsx(C0,{width:14,height:14,className:"rounded-full bg-cyan-50 text-cyan-900 dark:bg-cyan-950 dark:text-cyan-400"}),t==="processing"&&y.jsx(x2,{width:14,height:14,className:"rounded-full bg-slate-50 text-slate-900 dark:bg-slate-800 dark:text-slate-300"}),t==="retried"&&y.jsx(jr,{width:14,height:14,className:"rounded-full bg-amber-50 text-amber-900 dark:bg-amber-950 dark:text-amber-400"}),t==="completed"&&y.jsx(b0,{width:14,height:14,className:"rounded-full bg-green-50 text-green-900 dark:bg-green-950 dark:text-green-400"}),t==="failed"&&y.jsx(y0,{width:14,height:14,className:"rounded-full bg-red-50 text-red-900 dark:bg-red-950 dark:text-red-400"}),y.jsx("p",{className:"text-slate-900 dark:text-slate-200",children:$1(n,"".concat(t==="added"?"MM/dd ":"","HH:mm:ss"))})]})})},Kd=function(){return y.jsxs("div",{className:"flex items-center space-x-1.5",children:[y.jsx(al,{width:14,height:14,className:"text-slate-300 dark:text-slate-600"}),y.jsx(eu,{width:14,height:14,className:"animate-spin text-slate-300 dark:text-slate-600"})]})},Bd=function(e){var t=e.date,n=e.baseDate;return y.jsxs("div",{className:"flex items-center space-x-1.5",children:[y.jsx(al,{width:14,height:14,className:"text-slate-300 dark:text-slate-600"}),y.jsx("p",{className:"w-7 rounded-sm text-center text-xs text-slate-500 dark:text-slate-400",children:$7(t,n,{locale:{formatDistance:function(r,o){return r==="xSeconds"?"".concat(o,"s"):r==="xMinutes"?"".concat(o,"m"):r==="xHours"?"".concat(o,"h"):r==="xDays"?"".concat(o,"d"):r==="xMonths"?"".concat(o,"mo"):r==="xYears"?"".concat(o,"y"):""}}})}),y.jsx(al,{width:14,height:14,className:"text-slate-300 dark:text-slate-600"})]})},KC=function(e){var t=e.title,n=e.description,r=e.action,o=e.children;return y.jsxs(n1,{children:[y.jsx(pu,{children:o}),y.jsx(Ba,{isDismissable:!0,className:"fixed inset-0 bg-black/20 dark:bg-black/40",children:y.jsx(Aa,{role:"alertdialog",className:"fixed left-1/2 top-1/2 w-full max-w-md -translate-x-1/2 -translate-y-1/2 overflow-y-scroll rounded-lg bg-white p-4 shadow-xl dark:bg-slate-900",children:function(i){var a=i.close;return y.jsxs(y.Fragment,{children:[y.jsx(Ka,{className:"mb-3 text-xl font-semibold text-slate-900 dark:text-slate-100",children:t}),y.jsx("p",{className:"mb-6 text-slate-600 dark:text-slate-400",children:n}),y.jsxs("div",{className:"flex justify-end space-x-3",children:[y.jsx(Cn,{onClick:a,label:"Cancel"}),r]})]})}})})]})};function BC(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const HC=e=>{switch(e){case"success":return UC;case"info":return WC;case"warning":return qC;case"error":return GC;default:return null}},VC=Array(12).fill(0),zC=({visible:e,className:t})=>d.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},d.createElement("div",{className:"sonner-spinner"},VC.map((n,r)=>d.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),UC=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},d.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),qC=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},d.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),WC=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},d.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),GC=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},d.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),QC=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},d.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),YC=()=>{const[e,t]=d.useState(document.hidden);return d.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let jl=1;class XC{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:jl++,a=this.toasts.find(l=>l.id===i),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:s,title:r}):l):this.addToast({title:r,...o,dismissible:s,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,a;const s=o.then(async u=>{if(a=["resolve",u],d.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(JC(u)&&!u.ok){i=!1;const c=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,g=typeof c=="object"&&!d.isValidElement(c)?c:{message:c};this.create({id:r,type:"error",description:p,...g})}else if(u instanceof Error){i=!1;const c=typeof n.error=="function"?await n.error(u):n.error,p=typeof n.description=="function"?await n.description(u):n.description,g=typeof c=="object"&&!d.isValidElement(c)?c:{message:c};this.create({id:r,type:"error",description:p,...g})}else if(n.success!==void 0){i=!1;const c=typeof n.success=="function"?await n.success(u):n.success,p=typeof n.description=="function"?await n.description(u):n.description,g=typeof c=="object"&&!d.isValidElement(c)?c:{message:c};this.create({id:r,type:"success",description:p,...g})}}).catch(async u=>{if(a=["reject",u],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(u):n.error,c=typeof n.description=="function"?await n.description(u):n.description,f=typeof h=="object"&&!d.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:c,...f})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((u,h)=>s.then(()=>a[0]==="reject"?h(a[1]):u(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||jl++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const qe=new XC,ZC=(e,t)=>{const n=(t==null?void 0:t.id)||jl++;return qe.addToast({title:e,...t,id:n}),n},JC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",e$=ZC,t$=()=>qe.toasts,n$=()=>qe.getActiveToasts(),pr=Object.assign(e$,{success:qe.success,info:qe.info,warning:qe.warning,error:qe.error,custom:qe.custom,message:qe.message,promise:qe.promise,dismiss:qe.dismiss,loading:qe.loading},{getHistory:t$,getToasts:n$});BC("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Mi(e){return e.label!==void 0}const r$=3,o$="24px",i$="16px",Hd=4e3,a$=356,s$=14,l$=45,u$=200;function Mt(...e){return e.filter(Boolean).join(" ")}function c$(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const d$=e=>{var t,n,r,o,i,a,s,l,u;const{invert:h,toast:c,unstyled:p,interacting:f,setHeights:g,visibleToasts:m,heights:v,index:b,toasts:x,expanded:w,removeToast:$,defaultRichColors:k,closeButton:E,style:R,cancelButtonStyle:M,actionButtonStyle:_,className:D="",descriptionClassName:P="",duration:I,position:N,gap:F,expandByDefault:j,classNames:O,icons:T,closeButtonAriaLabel:A="Close toast"}=e,[K,L]=d.useState(null),[H,z]=d.useState(null),[V,W]=d.useState(!1),[q,ne]=d.useState(!1),[pe,ee]=d.useState(!1),[Be,Et]=d.useState(!1),[Pt,Y]=d.useState(!1),[mt,Qe]=d.useState(0),[Rn,ii]=d.useState(0),ie=d.useRef(c.duration||I||Hd),Xt=d.useRef(null),Ye=d.useRef(null),to=b===0,Cg=b+1<=m,Xe=c.type,rr=c.dismissible!==!1,$g=c.className||"",Sg=c.descriptionClassName||"",ai=d.useMemo(()=>v.findIndex(te=>te.toastId===c.id)||0,[v,c.id]),Eg=d.useMemo(()=>{var te;return(te=c.closeButton)!=null?te:E},[c.closeButton,E]),Du=d.useMemo(()=>c.duration||I||Hd,[c.duration,I]),qa=d.useRef(0),or=d.useRef(0),_u=d.useRef(0),ir=d.useRef(null),[Pg,Rg]=N.split("-"),Fu=d.useMemo(()=>v.reduce((te,Ee,_e)=>_e>=ai?te:te+Ee.height,0),[v,ai]),Lu=YC(),kg=c.invert||h,Wa=Xe==="loading";or.current=d.useMemo(()=>ai*F+Fu,[ai,Fu]),d.useEffect(()=>{ie.current=Du},[Du]),d.useEffect(()=>{W(!0)},[]),d.useEffect(()=>{const te=Ye.current;if(te){const Ee=te.getBoundingClientRect().height;return ii(Ee),g(_e=>[{toastId:c.id,height:Ee,position:c.position},..._e]),()=>g(_e=>_e.filter(Ze=>Ze.toastId!==c.id))}},[g,c.id]),d.useLayoutEffect(()=>{if(!V)return;const te=Ye.current,Ee=te.style.height;te.style.height="auto";const _e=te.getBoundingClientRect().height;te.style.height=Ee,ii(_e),g(Ze=>Ze.find(Te=>Te.toastId===c.id)?Ze.map(Te=>Te.toastId===c.id?{...Te,height:_e}:Te):[{toastId:c.id,height:_e,position:c.position},...Ze])},[V,c.title,c.description,g,c.id,c.jsx,c.action,c.cancel]);const Zt=d.useCallback(()=>{ne(!0),Qe(or.current),g(te=>te.filter(Ee=>Ee.toastId!==c.id)),setTimeout(()=>{$(c)},u$)},[c,$,g,or]);d.useEffect(()=>{if(c.promise&&Xe==="loading"||c.duration===1/0||c.type==="loading")return;let te;return w||f||Lu?(()=>{if(_u.current<qa.current){const Ze=new Date().getTime()-qa.current;ie.current=ie.current-Ze}_u.current=new Date().getTime()})():(()=>{ie.current!==1/0&&(qa.current=new Date().getTime(),te=setTimeout(()=>{c.onAutoClose==null||c.onAutoClose.call(c,c),Zt()},ie.current))})(),()=>clearTimeout(te)},[w,f,c,Xe,Lu,Zt]),d.useEffect(()=>{c.delete&&(Zt(),c.onDismiss==null||c.onDismiss.call(c,c))},[Zt,c.delete]);function Mg(){var te;if(T!=null&&T.loading){var Ee;return d.createElement("div",{className:Mt(O==null?void 0:O.loader,c==null||(Ee=c.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":Xe==="loading"},T.loading)}return d.createElement(zC,{className:Mt(O==null?void 0:O.loader,c==null||(te=c.classNames)==null?void 0:te.loader),visible:Xe==="loading"})}const Og=c.icon||(T==null?void 0:T[Xe])||HC(Xe);var Iu,Nu;return d.createElement("li",{tabIndex:0,ref:Ye,className:Mt(D,$g,O==null?void 0:O.toast,c==null||(t=c.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[Xe],c==null||(n=c.classNames)==null?void 0:n[Xe]),"data-sonner-toast":"","data-rich-colors":(Iu=c.richColors)!=null?Iu:k,"data-styled":!(c.jsx||c.unstyled||p),"data-mounted":V,"data-promise":!!c.promise,"data-swiped":Pt,"data-removed":q,"data-visible":Cg,"data-y-position":Pg,"data-x-position":Rg,"data-index":b,"data-front":to,"data-swiping":pe,"data-dismissible":rr,"data-type":Xe,"data-invert":kg,"data-swipe-out":Be,"data-swipe-direction":H,"data-expanded":!!(w||j&&V),"data-testid":c.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${q?mt:or.current}px`,"--initial-height":j?"auto":`${Rn}px`,...R,...c.style},onDragEnd:()=>{ee(!1),L(null),ir.current=null},onPointerDown:te=>{te.button!==2&&(Wa||!rr||(Xt.current=new Date,Qe(or.current),te.target.setPointerCapture(te.pointerId),te.target.tagName!=="BUTTON"&&(ee(!0),ir.current={x:te.clientX,y:te.clientY})))},onPointerUp:()=>{var te,Ee,_e;if(Be||!rr)return;ir.current=null;const Ze=Number(((te=Ye.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),si=Number(((Ee=Ye.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Te=new Date().getTime()-((_e=Xt.current)==null?void 0:_e.getTime()),st=K==="x"?Ze:si,li=Math.abs(st)/Te;if(Math.abs(st)>=l$||li>.11){Qe(or.current),c.onDismiss==null||c.onDismiss.call(c,c),z(K==="x"?Ze>0?"right":"left":si>0?"down":"up"),Zt(),Et(!0);return}else{var vt,bt;(vt=Ye.current)==null||vt.style.setProperty("--swipe-amount-x","0px"),(bt=Ye.current)==null||bt.style.setProperty("--swipe-amount-y","0px")}Y(!1),ee(!1),L(null)},onPointerMove:te=>{var Ee,_e,Ze;if(!ir.current||!rr||((Ee=window.getSelection())==null?void 0:Ee.toString().length)>0)return;const Te=te.clientY-ir.current.y,st=te.clientX-ir.current.x;var li;const vt=(li=e.swipeDirections)!=null?li:c$(N);!K&&(Math.abs(st)>1||Math.abs(Te)>1)&&L(Math.abs(st)>Math.abs(Te)?"x":"y");let bt={x:0,y:0};const ju=kn=>1/(1.5+Math.abs(kn)/20);if(K==="y"){if(vt.includes("top")||vt.includes("bottom"))if(vt.includes("top")&&Te<0||vt.includes("bottom")&&Te>0)bt.y=Te;else{const kn=Te*ju(Te);bt.y=Math.abs(kn)<Math.abs(Te)?kn:Te}}else if(K==="x"&&(vt.includes("left")||vt.includes("right")))if(vt.includes("left")&&st<0||vt.includes("right")&&st>0)bt.x=st;else{const kn=st*ju(st);bt.x=Math.abs(kn)<Math.abs(st)?kn:st}(Math.abs(bt.x)>0||Math.abs(bt.y)>0)&&Y(!0),(_e=Ye.current)==null||_e.style.setProperty("--swipe-amount-x",`${bt.x}px`),(Ze=Ye.current)==null||Ze.style.setProperty("--swipe-amount-y",`${bt.y}px`)}},Eg&&!c.jsx&&Xe!=="loading"?d.createElement("button",{"aria-label":A,"data-disabled":Wa,"data-close-button":!0,onClick:Wa||!rr?()=>{}:()=>{Zt(),c.onDismiss==null||c.onDismiss.call(c,c)},className:Mt(O==null?void 0:O.closeButton,c==null||(r=c.classNames)==null?void 0:r.closeButton)},(Nu=T==null?void 0:T.close)!=null?Nu:QC):null,(Xe||c.icon||c.promise)&&c.icon!==null&&((T==null?void 0:T[Xe])!==null||c.icon)?d.createElement("div",{"data-icon":"",className:Mt(O==null?void 0:O.icon,c==null||(o=c.classNames)==null?void 0:o.icon)},c.promise||c.type==="loading"&&!c.icon?c.icon||Mg():null,c.type!=="loading"?Og:null):null,d.createElement("div",{"data-content":"",className:Mt(O==null?void 0:O.content,c==null||(i=c.classNames)==null?void 0:i.content)},d.createElement("div",{"data-title":"",className:Mt(O==null?void 0:O.title,c==null||(a=c.classNames)==null?void 0:a.title)},c.jsx?c.jsx:typeof c.title=="function"?c.title():c.title),c.description?d.createElement("div",{"data-description":"",className:Mt(P,Sg,O==null?void 0:O.description,c==null||(s=c.classNames)==null?void 0:s.description)},typeof c.description=="function"?c.description():c.description):null),d.isValidElement(c.cancel)?c.cancel:c.cancel&&Mi(c.cancel)?d.createElement("button",{"data-button":!0,"data-cancel":!0,style:c.cancelButtonStyle||M,onClick:te=>{Mi(c.cancel)&&rr&&(c.cancel.onClick==null||c.cancel.onClick.call(c.cancel,te),Zt())},className:Mt(O==null?void 0:O.cancelButton,c==null||(l=c.classNames)==null?void 0:l.cancelButton)},c.cancel.label):null,d.isValidElement(c.action)?c.action:c.action&&Mi(c.action)?d.createElement("button",{"data-button":!0,"data-action":!0,style:c.actionButtonStyle||_,onClick:te=>{Mi(c.action)&&(c.action.onClick==null||c.action.onClick.call(c.action,te),!te.defaultPrevented&&Zt())},className:Mt(O==null?void 0:O.actionButton,c==null||(u=c.classNames)==null?void 0:u.actionButton)},c.action.label):null)};function Vd(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function f$(e,t){const n={};return[e,t].forEach((r,o)=>{const i=o===1,a=i?"--mobile-offset":"--offset",s=i?i$:o$;function l(u){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${a}-${u}`]=s:n[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(s)}),n}const h$=d.forwardRef(function(t,n){const{id:r,invert:o,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:s,closeButton:l,className:u,offset:h,mobileOffset:c,theme:p="light",richColors:f,duration:g,style:m,visibleToasts:v=r$,toastOptions:b,dir:x=Vd(),gap:w=s$,icons:$,containerAriaLabel:k="Notifications"}=t,[E,R]=d.useState([]),M=d.useMemo(()=>r?E.filter(V=>V.toasterId===r):E.filter(V=>!V.toasterId),[E,r]),_=d.useMemo(()=>Array.from(new Set([i].concat(M.filter(V=>V.position).map(V=>V.position)))),[M,i]),[D,P]=d.useState([]),[I,N]=d.useState(!1),[F,j]=d.useState(!1),[O,T]=d.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=d.useRef(null),K=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=d.useRef(null),H=d.useRef(!1),z=d.useCallback(V=>{R(W=>{var q;return(q=W.find(ne=>ne.id===V.id))!=null&&q.delete||qe.dismiss(V.id),W.filter(({id:ne})=>ne!==V.id)})},[]);return d.useEffect(()=>qe.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{R(W=>W.map(q=>q.id===V.id?{...q,delete:!0}:q))});return}setTimeout(()=>{Ur.flushSync(()=>{R(W=>{const q=W.findIndex(ne=>ne.id===V.id);return q!==-1?[...W.slice(0,q),{...W[q],...V},...W.slice(q+1)]:[V,...W]})})})}),[E]),d.useEffect(()=>{if(p!=="system"){T(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?T("dark"):T("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:W})=>{T(W?"dark":"light")})}catch{V.addListener(({matches:q})=>{try{T(q?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),d.useEffect(()=>{E.length<=1&&N(!1)},[E]),d.useEffect(()=>{const V=W=>{var q;if(a.every(ee=>W[ee]||W.code===ee)){var pe;N(!0),(pe=A.current)==null||pe.focus()}W.code==="Escape"&&(document.activeElement===A.current||(q=A.current)!=null&&q.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[a]),d.useEffect(()=>{if(A.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,H.current=!1)}},[A.current]),d.createElement("section",{ref:n,"aria-label":`${k} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((V,W)=>{var q;const[ne,pe]=V.split("-");return M.length?d.createElement("ol",{key:V,dir:x==="auto"?Vd():x,tabIndex:-1,ref:A,className:u,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":ne,"data-x-position":pe,style:{"--front-toast-height":`${((q=D[0])==null?void 0:q.height)||0}px`,"--width":`${a$}px`,"--gap":`${w}px`,...m,...f$(h,c)},onBlur:ee=>{H.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(H.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||H.current||(H.current=!0,L.current=ee.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{F||N(!1)},onDragEnd:()=>N(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||j(!0)},onPointerUp:()=>j(!1)},M.filter(ee=>!ee.position&&W===0||ee.position===V).map((ee,Be)=>{var Et,Pt;return d.createElement(d$,{key:ee.id,icons:$,index:Be,toast:ee,defaultRichColors:f,duration:(Et=b==null?void 0:b.duration)!=null?Et:g,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:o,visibleToasts:v,closeButton:(Pt=b==null?void 0:b.closeButton)!=null?Pt:l,interacting:F,position:V,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:z,toasts:M.filter(Y=>Y.position==ee.position),heights:D.filter(Y=>Y.position==ee.position),setHeights:P,expandByDefault:s,gap:w,expanded:I,swipeDirections:t.swipeDirections})})):null}))});var p$=function(e){var t=e.showCleanAllButton,n=e.queueName,r=e.status,o=e.queue,i=le.queue.clean.useMutation({onSuccess:function(){pr.success("All ".concat(r," jobs have been removed"))}}),a=i.mutate,s=i.status,l=Ke(Ke(Ke(Ke(Ke([{name:"Completed",status:"completed"},{name:"Failed",status:"failed"},{name:"Active",status:"active"}],o!=null&&o.supports.priorities?[{name:"Prioritized",status:"prioritized"}]:[],!0),[{name:"Waiting",status:"waiting"}],!1),o!=null&&o.supports.flows?[{name:"Waiting Children",status:"waiting-children"}]:[],!0),[{name:"Delayed",status:"delayed"}],!1),o!=null&&o.supports.pause?[{name:"Paused",status:"paused"}]:[],!0);return y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("div",{className:"flex items-center space-x-3",children:l.map(function(u){var h=u.status===r;return y.jsxs(ka,{to:"?status=".concat(u.status),className:Ar("flex items-center space-x-2 rounded-md px-3 py-1 font-medium transition duration-150 ease-in-out",{"text-slate-500 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-800":!h,"bg-green-50 text-green-900 dark:bg-green-900 dark:text-green-50":h&&u.status==="completed","bg-red-50 text-red-900 dark:bg-red-900 dark:text-red-100":h&&u.status==="failed","bg-cyan-50 text-cyan-900 dark:bg-cyan-900 dark:text-cyan-50":h&&u.status==="active","bg-purple-50 text-purple-900 dark:bg-purple-900 dark:text-purple-50":h&&u.status==="prioritized","bg-amber-50 text-amber-900 dark:bg-amber-900 dark:text-amber-50":h&&u.status==="waiting","bg-orange-50 text-orange-900 dark:bg-orange-900 dark:text-orange-50":h&&u.status==="waiting-children","bg-indigo-50 text-indigo-900 dark:bg-indigo-900 dark:text-indigo-50":h&&u.status==="delayed","bg-stone-50 text-stone-900 dark:bg-stone-900 dark:text-stone-50":h&&u.status==="paused"}),children:[y.jsx("span",{children:u.name}),o!=null&&o.counts[u.status]?y.jsx("span",{className:Ar("rounded-md px-1.5 py-0.5 text-xs font-semibold",{"bg-slate-400 text-slate-50 dark:bg-slate-600 dark:text-slate-100":!h,"bg-green-600 text-green-50 dark:bg-green-700 dark:text-green-100":h&&u.status==="completed","bg-red-600 text-red-50 dark:bg-red-700 dark:text-red-100":h&&u.status==="failed","bg-cyan-600 text-cyan-50 dark:bg-cyan-700 dark:text-cyan-100":h&&u.status==="active","bg-purple-600 text-purple-50 dark:bg-purple-700 dark:text-purple-100":h&&u.status==="prioritized","bg-amber-600 text-amber-50 dark:bg-amber-700 dark:text-amber-100":h&&u.status==="waiting","bg-orange-600 text-orange-50 dark:bg-orange-700 dark:text-orange-100":h&&u.status==="waiting-children","bg-indigo-600 text-indigo-50 dark:bg-indigo-700 dark:text-indigo-100":h&&u.status==="delayed","bg-stone-600 text-stone-50 dark:bg-stone-700 dark:text-stone-100":h&&u.status==="paused"}),children:o.counts[u.status]}):null]},u.name)})}),t&&r!=="waiting-children"&&(o!=null&&o.supports.clean)?y.jsx(KC,{title:"Are you absolutely sure?",description:"This action cannot be undone. This will permanently remove all ".concat(r," jobs from the queue."),action:y.jsx(Cn,{variant:"filled",colorScheme:"red",label:"Yes, remove jobs",onClick:function(){return a({queueName:n,status:r})}}),children:y.jsx(Cn,{colorScheme:"yellow",icon:y.jsx(Gr,{}),label:"Clean all",size:"sm",isLoading:s==="pending"})}):null]})};function zd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g$(e){if(Array.isArray(e))return e}function m$(e,t,n){return(t=$$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v$(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(h){u=!0,o=h}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}function b$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
63
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function qd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ud(Object(n),!0).forEach(function(r){m$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ud(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y$(e,t){if(e==null)return{};var n,r,o=x$(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function x$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function w$(e,t){return g$(e)||v$(e,t)||S$(e,t)||b$()}function C$(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $$(e){var t=C$(e,"string");return typeof t=="symbol"?t:t+""}function S$(e,t){if(e){if(typeof e=="string")return zd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zd(e,t):void 0}}function E$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Gd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wd(Object(n),!0).forEach(function(r){E$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function vo(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return t.apply(n,[].concat(o,s))}}}function ya(e){return{}.toString.call(e).includes("Object")}function R$(e){return!Object.keys(e).length}function Ao(e){return typeof e=="function"}function k$(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function M$(e,t){return ya(t)||bn("changeType"),Object.keys(t).some(function(n){return!k$(e,n)})&&bn("changeField"),t}function O$(e){Ao(e)||bn("selectorType")}function T$(e){Ao(e)||ya(e)||bn("handlerType"),ya(e)&&Object.values(e).some(function(t){return!Ao(t)})&&bn("handlersType")}function D$(e){e||bn("initialIsRequired"),ya(e)||bn("initialType"),R$(e)&&bn("initialContent")}function _$(e,t){throw new Error(e[t]||e.default)}var F$={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},bn=vo(_$)(F$),Oi={changes:M$,selector:O$,handler:T$,initial:D$};function L$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Oi.initial(e),Oi.handler(t);var n={current:e},r=vo(j$)(n,t),o=vo(N$)(n),i=vo(Oi.changes)(e),a=vo(I$)(n);function s(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(h){return h};return Oi.selector(u),u(n.current)}function l(u){P$(r,o,i,a)(u)}return[s,l]}function I$(e,t){return Ao(t)?t(e.current):t}function N$(e,t){return e.current=Gd(Gd({},e.current),t),t}function j$(e,t,n){return Ao(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var A$={create:L$},K$={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.
|
|
63
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function qd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ud(Object(n),!0).forEach(function(r){m$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ud(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y$(e,t){if(e==null)return{};var n,r,o=x$(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function x$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function w$(e,t){return g$(e)||v$(e,t)||S$(e,t)||b$()}function C$(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $$(e){var t=C$(e,"string");return typeof t=="symbol"?t:t+""}function S$(e,t){if(e){if(typeof e=="string")return zd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zd(e,t):void 0}}function E$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Gd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wd(Object(n),!0).forEach(function(r){E$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function vo(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return t.apply(n,[].concat(o,s))}}}function ya(e){return{}.toString.call(e).includes("Object")}function R$(e){return!Object.keys(e).length}function Ao(e){return typeof e=="function"}function k$(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function M$(e,t){return ya(t)||bn("changeType"),Object.keys(t).some(function(n){return!k$(e,n)})&&bn("changeField"),t}function O$(e){Ao(e)||bn("selectorType")}function T$(e){Ao(e)||ya(e)||bn("handlerType"),ya(e)&&Object.values(e).some(function(t){return!Ao(t)})&&bn("handlersType")}function D$(e){e||bn("initialIsRequired"),ya(e)||bn("initialType"),R$(e)&&bn("initialContent")}function _$(e,t){throw new Error(e[t]||e.default)}var F$={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},bn=vo(_$)(F$),Oi={changes:M$,selector:O$,handler:T$,initial:D$};function L$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Oi.initial(e),Oi.handler(t);var n={current:e},r=vo(j$)(n,t),o=vo(N$)(n),i=vo(Oi.changes)(e),a=vo(I$)(n);function s(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(h){return h};return Oi.selector(u),u(n.current)}function l(u){P$(r,o,i,a)(u)}return[s,l]}function I$(e,t){return Ao(t)?t(e.current):t}function N$(e,t){return e.current=Gd(Gd({},e.current),t),t}function j$(e,t,n){return Ao(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var A$={create:L$},K$={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function B$(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return t.apply(n,[].concat(o,s))}}}function H$(e){return{}.toString.call(e).includes("Object")}function V$(e){return e||Qd("configIsRequired"),H$(e)||Qd("configType"),e.urls?(z$(),{paths:{vs:e.urls.monacoBase}}):e}function z$(){console.warn(hg.deprecation)}function U$(e,t){throw new Error(e[t]||e.default)}var hg={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
64
64
|
You are using deprecated way of configuration.
|
|
65
65
|
|
|
66
66
|
Instead of using
|
|
@@ -69,4 +69,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
69
69
|
monaco.config({ paths: { vs: '...' } })
|
|
70
70
|
|
|
71
71
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
72
|
-
`},Qd=B$(U$)(hg),q$={config:V$},W$=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,a){return a(i)},o)}};function pg(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],pg(e[n],t[n]))}),qd(qd({},e),t)}var G$={type:"cancelation",msg:"operation is manually canceled"};function ks(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(G$):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Q$=["monaco"],Y$=A$.create({config:K$,isInitialized:!1,resolve:null,reject:null,monaco:null}),gg=w$(Y$,2),oi=gg[0],Ua=gg[1];function X$(e){var t=q$.config(e),n=t.monaco,r=y$(t,Q$);Ua(function(o){return{config:pg(o.config,r),monaco:n}})}function Z$(){var e=oi(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Ua({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),ks(Ms);if(window.monaco&&window.monaco.editor)return mg(window.monaco),e.resolve(window.monaco),ks(Ms);W$(J$,tS)(nS)}return ks(Ms)}function J$(e){return document.body.appendChild(e)}function eS(e){var t=document.createElement("script");return e&&(t.src=e),t}function tS(e){var t=oi(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=eS("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function nS(){var e=oi(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;mg(r),e.resolve(r)},function(n){e.reject(n)})}function mg(e){oi().monaco||Ua({monaco:e})}function rS(){return oi(function(e){var t=e.monaco;return t})}var Ms=new Promise(function(e,t){return Ua({resolve:e,reject:t})}),vg={config:X$,init:Z$,__getMonacoInstance:rS},oS={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Os=oS,iS={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},aS=iS;function sS({children:e}){return d.createElement("div",{style:aS.container},e)}var lS=sS,uS=lS;function cS({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:a}){return d.createElement("section",{style:{...Os.wrapper,width:e,height:t},...a},!n&&d.createElement(uS,null,r),d.createElement("div",{ref:o,style:{...Os.fullWidth,...!n&&Os.hide},className:i}))}var dS=cS,bg=d.memo(dS);function fS(e){d.useEffect(e,[])}var yg=fS;function hS(e,t,n=!0){let r=d.useRef(!0);d.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var et=hS;function Eo(){}function vr(e,t,n,r){return pS(e,r)||gS(e,t,n,r)}function pS(e,t){return e.editor.getModel(xg(e,t))}function gS(e,t,n,r){return e.editor.createModel(t,n,r?xg(e,r):void 0)}function xg(e,t){return e.Uri.parse(t)}function mS({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:a,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:h="Loading...",options:c={},height:p="100%",width:f="100%",className:g,wrapperProps:m={},beforeMount:v=Eo,onMount:b=Eo}){let[x,w]=d.useState(!1),[$,k]=d.useState(!0),E=d.useRef(null),R=d.useRef(null),M=d.useRef(null),_=d.useRef(b),D=d.useRef(v),P=d.useRef(!1);yg(()=>{let j=vg.init();return j.then(O=>(R.current=O)&&k(!1)).catch(O=>(O==null?void 0:O.type)!=="cancelation"&&console.error("Monaco initialization: error:",O)),()=>E.current?F():j.cancel()}),et(()=>{if(E.current&&R.current){let j=E.current.getOriginalEditor(),O=vr(R.current,e||"",r||n||"text",i||"");O!==j.getModel()&&j.setModel(O)}},[i],x),et(()=>{if(E.current&&R.current){let j=E.current.getModifiedEditor(),O=vr(R.current,t||"",o||n||"text",a||"");O!==j.getModel()&&j.setModel(O)}},[a],x),et(()=>{let j=E.current.getModifiedEditor();j.getOption(R.current.editor.EditorOption.readOnly)?j.setValue(t||""):t!==j.getValue()&&(j.executeEdits("",[{range:j.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),j.pushUndoStop())},[t],x),et(()=>{var j,O;(O=(j=E.current)==null?void 0:j.getModel())==null||O.original.setValue(e||"")},[e],x),et(()=>{let{original:j,modified:O}=E.current.getModel();R.current.editor.setModelLanguage(j,r||n||"text"),R.current.editor.setModelLanguage(O,o||n||"text")},[n,r,o],x),et(()=>{var j;(j=R.current)==null||j.editor.setTheme(u)},[u],x),et(()=>{var j;(j=E.current)==null||j.updateOptions(c)},[c],x);let I=d.useCallback(()=>{var T;if(!R.current)return;D.current(R.current);let j=vr(R.current,e||"",r||n||"text",i||""),O=vr(R.current,t||"",o||n||"text",a||"");(T=E.current)==null||T.setModel({original:j,modified:O})},[n,t,o,e,r,i,a]),N=d.useCallback(()=>{var j;!P.current&&M.current&&(E.current=R.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...c}),I(),(j=R.current)==null||j.editor.setTheme(u),w(!0),P.current=!0)},[c,u,I]);d.useEffect(()=>{x&&_.current(E.current,R.current)},[x]),d.useEffect(()=>{!$&&!x&&N()},[$,x,N]);function F(){var O,T,A,K;let j=(O=E.current)==null?void 0:O.getModel();s||((T=j==null?void 0:j.original)==null||T.dispose()),l||((A=j==null?void 0:j.modified)==null||A.dispose()),(K=E.current)==null||K.dispose()}return d.createElement(bg,{width:f,height:p,isEditorReady:x,loading:h,_ref:M,className:g,wrapperProps:m})}var vS=mS;d.memo(vS);function bS(e){let t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var yS=bS,Ti=new Map;function xS({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:a="light",line:s,loading:l="Loading...",options:u={},overrideServices:h={},saveViewState:c=!0,keepCurrentModel:p=!1,width:f="100%",height:g="100%",className:m,wrapperProps:v={},beforeMount:b=Eo,onMount:x=Eo,onChange:w,onValidate:$=Eo}){let[k,E]=d.useState(!1),[R,M]=d.useState(!0),_=d.useRef(null),D=d.useRef(null),P=d.useRef(null),I=d.useRef(x),N=d.useRef(b),F=d.useRef(),j=d.useRef(r),O=yS(i),T=d.useRef(!1),A=d.useRef(!1);yg(()=>{let H=vg.init();return H.then(z=>(_.current=z)&&M(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>D.current?L():H.cancel()}),et(()=>{var z,V,W,q;let H=vr(_.current,e||r||"",t||o||"",i||n||"");H!==((z=D.current)==null?void 0:z.getModel())&&(c&&Ti.set(O,(V=D.current)==null?void 0:V.saveViewState()),(W=D.current)==null||W.setModel(H),c&&((q=D.current)==null||q.restoreViewState(Ti.get(i))))},[i],k),et(()=>{var H;(H=D.current)==null||H.updateOptions(u)},[u],k),et(()=>{!D.current||r===void 0||(D.current.getOption(_.current.editor.EditorOption.readOnly)?D.current.setValue(r):r!==D.current.getValue()&&(A.current=!0,D.current.executeEdits("",[{range:D.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),D.current.pushUndoStop(),A.current=!1))},[r],k),et(()=>{var z,V;let H=(z=D.current)==null?void 0:z.getModel();H&&o&&((V=_.current)==null||V.editor.setModelLanguage(H,o))},[o],k),et(()=>{var H;s!==void 0&&((H=D.current)==null||H.revealLine(s))},[s],k),et(()=>{var H;(H=_.current)==null||H.editor.setTheme(a)},[a],k);let K=d.useCallback(()=>{var H;if(!(!P.current||!_.current)&&!T.current){N.current(_.current);let z=i||n,V=vr(_.current,r||e||"",t||o||"",z||"");D.current=(H=_.current)==null?void 0:H.editor.create(P.current,{model:V,automaticLayout:!0,...u},h),c&&D.current.restoreViewState(Ti.get(z)),_.current.editor.setTheme(a),s!==void 0&&D.current.revealLine(s),E(!0),T.current=!0}},[e,t,n,r,o,i,u,h,c,a,s]);d.useEffect(()=>{k&&I.current(D.current,_.current)},[k]),d.useEffect(()=>{!R&&!k&&K()},[R,k,K]),j.current=r,d.useEffect(()=>{var H,z;k&&w&&((H=F.current)==null||H.dispose(),F.current=(z=D.current)==null?void 0:z.onDidChangeModelContent(V=>{A.current||w(D.current.getValue(),V)}))},[k,w]),d.useEffect(()=>{if(k){let H=_.current.editor.onDidChangeMarkers(z=>{var W;let V=(W=D.current.getModel())==null?void 0:W.uri;if(V&&z.find(q=>q.path===V.path)){let q=_.current.editor.getModelMarkers({resource:V});$==null||$(q)}});return()=>{H==null||H.dispose()}}return()=>{}},[k,$]);function L(){var H,z;(H=F.current)==null||H.dispose(),p?c&&Ti.set(i,D.current.saveViewState()):(z=D.current.getModel())==null||z.dispose(),D.current.dispose()}return d.createElement(bg,{width:f,height:g,isEditorReady:k,loading:l,_ref:P,className:m,wrapperProps:v})}var wS=xS,CS=d.memo(wS),$S=CS,Ts=function(e){var t=e.value,n=e.onChange,r=d.useRef(null),o=function(){var a,s;(s=(a=r.current)===null||a===void 0?void 0:a.getAction("editor.action.formatDocument"))===null||s===void 0||s.run()},i=function(a){var s=String.fromCharCode(a.which).toLowerCase();(a.ctrlKey||a.metaKey)&&s==="s"&&(a.preventDefault(),o())};return y.jsx("div",{onKeyDown:i,onBlur:o,className:"mb-6 border border-slate-200",children:y.jsx($S,{height:"300px",language:"json",className:"rounded-md",options:{minimap:{enabled:!1},formatOnPaste:!0,formatOnType:!0,padding:{top:8,bottom:8},tabSize:2},defaultValue:t,onChange:function(a){a&&n(a)},onMount:function(a,s){r.current=a,s.editor.defineTheme("solarized-light",{base:"vs",inherit:!0,rules:[{background:"ffffff",token:""},{foreground:"6a737d",token:"comment"},{foreground:"6a737d",token:"punctuation.definition.comment"},{foreground:"6a737d",token:"string.comment"},{foreground:"005cc5",token:"constant"},{foreground:"005cc5",token:"entity.name.constant"},{foreground:"005cc5",token:"variable.other.constant"},{foreground:"005cc5",token:"variable.language"},{foreground:"6f42c1",token:"entity"},{foreground:"6f42c1",token:"entity.name"},{foreground:"24292e",token:"variable.parameter.function"},{foreground:"22863a",token:"entity.name.tag"},{foreground:"d73a49",token:"keyword"},{foreground:"d73a49",token:"storage"},{foreground:"d73a49",token:"storage.type"},{foreground:"24292e",token:"storage.modifier.package"},{foreground:"24292e",token:"storage.modifier.import"},{foreground:"24292e",token:"storage.type.java"},{foreground:"032f62",token:"string"},{foreground:"032f62",token:"punctuation.definition.string"},{foreground:"032f62",token:"string punctuation.section.embedded source"},{foreground:"005cc5",token:"support"},{foreground:"005cc5",token:"meta.property-name"},{foreground:"e36209",token:"variable"},{foreground:"24292e",token:"variable.other"},{foreground:"b31d28",fontStyle:"bold italic underline",token:"invalid.broken"},{foreground:"b31d28",fontStyle:"bold italic underline",token:"invalid.deprecated"},{foreground:"fafbfc",background:"b31d28",fontStyle:"italic underline",token:"invalid.illegal"},{foreground:"fafbfc",background:"d73a49",fontStyle:"italic underline",token:"carriage-return"},{foreground:"b31d28",fontStyle:"bold italic underline",token:"invalid.unimplemented"},{foreground:"b31d28",token:"message.error"},{foreground:"24292e",token:"string source"},{foreground:"005cc5",token:"string variable"},{foreground:"032f62",token:"source.regexp"},{foreground:"032f62",token:"string.regexp"},{foreground:"032f62",token:"string.regexp.character-class"},{foreground:"032f62",token:"string.regexp constant.character.escape"},{foreground:"032f62",token:"string.regexp source.ruby.embedded"},{foreground:"032f62",token:"string.regexp string.regexp.arbitrary-repitition"},{foreground:"22863a",fontStyle:"bold",token:"string.regexp constant.character.escape"},{foreground:"005cc5",token:"support.constant"},{foreground:"005cc5",token:"support.variable"},{foreground:"005cc5",token:"meta.module-reference"},{foreground:"735c0f",token:"markup.list"},{foreground:"005cc5",fontStyle:"bold",token:"markup.heading"},{foreground:"005cc5",fontStyle:"bold",token:"markup.heading entity.name"},{foreground:"22863a",token:"markup.quote"},{foreground:"24292e",fontStyle:"italic",token:"markup.italic"},{foreground:"24292e",fontStyle:"bold",token:"markup.bold"},{foreground:"005cc5",token:"markup.raw"},{foreground:"b31d28",background:"ffeef0",token:"markup.deleted"},{foreground:"b31d28",background:"ffeef0",token:"meta.diff.header.from-file"},{foreground:"b31d28",background:"ffeef0",token:"punctuation.definition.deleted"},{foreground:"22863a",background:"f0fff4",token:"markup.inserted"},{foreground:"22863a",background:"f0fff4",token:"meta.diff.header.to-file"},{foreground:"22863a",background:"f0fff4",token:"punctuation.definition.inserted"},{foreground:"e36209",background:"ffebda",token:"markup.changed"},{foreground:"e36209",background:"ffebda",token:"punctuation.definition.changed"},{foreground:"f6f8fa",background:"005cc5",token:"markup.ignored"},{foreground:"f6f8fa",background:"005cc5",token:"markup.untracked"},{foreground:"6f42c1",fontStyle:"bold",token:"meta.diff.range"},{foreground:"005cc5",token:"meta.diff.header"},{foreground:"005cc5",fontStyle:"bold",token:"meta.separator"},{foreground:"005cc5",token:"meta.output"},{foreground:"586069",token:"brackethighlighter.tag"},{foreground:"586069",token:"brackethighlighter.curly"},{foreground:"586069",token:"brackethighlighter.round"},{foreground:"586069",token:"brackethighlighter.square"},{foreground:"586069",token:"brackethighlighter.angle"},{foreground:"586069",token:"brackethighlighter.quote"},{foreground:"b31d28",token:"brackethighlighter.unmatched"},{foreground:"b31d28",token:"sublimelinter.mark.error"},{foreground:"e36209",token:"sublimelinter.mark.warning"},{foreground:"959da5",token:"sublimelinter.gutter-mark"},{foreground:"032f62",fontStyle:"underline",token:"constant.other.reference.link"},{foreground:"032f62",fontStyle:"underline",token:"string.other.link"}],colors:{"editor.foreground":"#24292e","editor.background":"#ffffff","editor.selectionBackground":"#c8c8fa","editor.inactiveSelectionBackground":"#fafbfc","editor.lineHighlightBackground":"#fafbfc","editorCursor.foreground":"#24292e","editorWhitespace.foreground":"#959da5","editorIndentGuide.background":"#959da5","editorIndentGuide.activeBackground":"#24292e","editor.selectionHighlightBorder":"#fafbfc"}}),s.editor.setTheme("solarized-light")}})})},Yd=function(e){var t=e.queue,n=e.onDismiss,r=e.variant,o=r===void 0?"job":r,i=le.queue.addJob.useMutation({onSuccess:function(){pr.success("New job has been added"),n()},onError:function(E){pr.error(E.message)}}),a=i.mutate,s=i.status,l=le.queue.addJobScheduler.useMutation({onSuccess:function(){pr.success("New job scheduler has been added"),n()},onError:function(E){pr.error(E.message)}}),u=l.mutate,h=l.status,c=d.useState("{}"),p=c[0],f=c[1],g=d.useState(JSON.stringify({name:"",data:{},opts:{}},null,2)),m=g[0],v=g[1],b=d.useState(JSON.stringify({pattern:"0 0 * * *",tz:Intl.DateTimeFormat().resolvedOptions().timeZone},null,2)),x=b[0],w=b[1],$=o==="job",k=$?s:h;return y.jsx(n1,{isOpen:!0,onOpenChange:function(E){E||n()},children:y.jsx(Ba,{isDismissable:!0,className:"fixed inset-0 bg-black/20 dark:bg-black/40",children:y.jsx(Aa,{className:"fixed left-1/2 top-1/2 max-h-[85vh] w-full max-w-xl -translate-x-1/2 -translate-y-1/2 overflow-y-scroll rounded-lg bg-white p-4 shadow-xl dark:bg-slate-900",children:function(E){var R=E.close;return y.jsxs(y.Fragment,{children:[y.jsx("button",{className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-full text-slate-500 transition duration-150 ease-in-out hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800","aria-label":"Close",onClick:function(){R(),n()},children:y.jsx(Jl,{})}),y.jsx("div",{className:"flex items-center space-x-4",children:y.jsxs(Ka,{className:"mb-1 text-xl font-semibold text-slate-900 dark:text-slate-100",children:["Add ",$?"job":"scheduler"," to"," ",t.displayName.toLocaleLowerCase()]})}),$?y.jsx(Ts,{value:p,onChange:f}):y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Template"}),y.jsx(Ts,{value:m,onChange:v})]}),y.jsxs("div",{children:[y.jsx("label",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Options"}),y.jsx(Ts,{value:x,onChange:w})]})]}),y.jsx("div",{children:y.jsx(Cn,{label:$?"Add job":"Add scheduler",variant:"filled",disabled:k==="pending",onClick:function(){try{if($){var M=JSON.parse(p);a({queueName:t.name,data:M})}else{var _=JSON.parse(m),D=JSON.parse(x);u({queueName:t.name,template:_,opts:D})}}catch{pr.error("Invalid JSON")}}})})]})}})})})},SS=function(e){var t=e.queue,n=le.queue.pause.useMutation().mutate,r=le.queue.resume.useMutation().mutate,o=le.queue.empty.useMutation().mutate,i=d.useState(!1),a=i[0],s=i[1],l=d.useState(!1),u=l[0],h=l[1],c={queueName:t.name},p=Ke(Ke(Ke(Ke([],t.supports.pause&&t.supports.resume?[{label:t.paused?"Resume":"Pause",onSelect:function(){t.paused?r(c):n(c)},icon:t.paused?y.jsx(w0,{}):y.jsx(x0,{})}]:[],!0),[{label:"Add job",onSelect:function(){s(!0)},icon:y.jsx(uc,{})}],!1),t.supports.schedulers?[{label:"Add scheduler",onSelect:function(){h(!0)},icon:y.jsx(uc,{})}]:[],!0),t.supports.empty?[{label:"Empty",onSelect:function(){o(c)},icon:y.jsx(Gr,{})}]:[],!0);return y.jsxs(y.Fragment,{children:[y.jsx(za,{actions:p}),a?y.jsx(Yd,{queue:t,variant:"job",onDismiss:function(){return s(!1)}}):null,u?y.jsx(Yd,{queue:t,variant:"scheduler",onDismiss:function(){return h(!1)}}):null]})},wg={exports:{}};(function(e,t){(function(r,o){e.exports=o()})(globalThis,()=>(()=>{var n={949:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CronParser=void 0;var u=l(515),h=function(){function c(p,f,g){f===void 0&&(f=!0),g===void 0&&(g=!1),this.expression=p,this.dayOfWeekStartIndexZero=f,this.monthStartIndexZero=g}return c.prototype.parse=function(){var p,f,g=(p=this.expression)!==null&&p!==void 0?p:"";if(g==="@reboot")return f=["@reboot","","","","","",""],f;if(g.startsWith("@")){var m=this.parseSpecial(this.expression);f=this.extractParts(m)}else f=this.extractParts(this.expression);return this.normalize(f),this.validate(f),f},c.prototype.parseSpecial=function(p){var f={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},g=f[p];if(!g)throw new Error("Unknown special expression.");return g},c.prototype.extractParts=function(p){if(!this.expression)throw new Error("cron expression is empty");for(var f=p.trim().split(/[ ]+/),g=0;g<f.length;g++)if(f[g].includes(",")){var m=f[g].split(",").map(function(b){return b.trim()}).filter(function(b){return b!==""}).map(function(b){return isNaN(Number(b))?b:Number(b)}).filter(function(b){return b!==null&&b!==""});m.length===0&&m.push("*"),m.sort(function(b,x){return b!==null&&x!==null?b-x:0}),f[g]=m.map(function(b){return b!==null?b.toString():""}).join(",")}if(f.length<5)throw new Error("Expression has only ".concat(f.length," part").concat(f.length==1?"":"s",". At least 5 parts are required."));if(f.length==5)f.unshift(""),f.push("");else if(f.length==6){var v=/\d{4}$/.test(f[5])||f[4]=="?"||f[2]=="?";v?f.unshift(""):f.push("")}else if(f.length>7)throw new Error("Expression has ".concat(f.length," parts; too many!"));return f},c.prototype.normalize=function(p){var f=this;if(p[3]=p[3].replace("?","*"),p[5]=p[5].replace("?","*"),p[2]=p[2].replace("?","*"),p[0].indexOf("0/")==0&&(p[0]=p[0].replace("0/","*/")),p[1].indexOf("0/")==0&&(p[1]=p[1].replace("0/","*/")),p[2].indexOf("0/")==0&&(p[2]=p[2].replace("0/","*/")),p[3].indexOf("1/")==0&&(p[3]=p[3].replace("1/","*/")),p[4].indexOf("1/")==0&&(p[4]=p[4].replace("1/","*/")),p[6].indexOf("1/")==0&&(p[6]=p[6].replace("1/","*/")),p[5]=p[5].replace(/(^\d)|([^#/\s]\d)/g,function(k){var E=k.replace(/\D/,""),R=E;return f.dayOfWeekStartIndexZero?E=="7"&&(R="0"):R=(parseInt(E)-1).toString(),k.replace(E,R)}),p[5]=="L"&&(p[5]="6"),p[3]=="?"&&(p[3]="*"),p[3].indexOf("W")>-1&&(p[3].indexOf(",")>-1||p[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var g={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var m in g)p[5]=p[5].replace(new RegExp(m,"gi"),g[m].toString());p[4]=p[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(k){var E=k.replace(/\D/,""),R=E;return f.monthStartIndexZero&&(R=(parseInt(E)+1).toString()),k.replace(E,R)});var v={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var b in v)p[4]=p[4].replace(new RegExp(b,"gi"),v[b].toString());p[0]=="0"&&(p[0]=""),!/\*|\-|\,|\//.test(p[2])&&(/\*|\//.test(p[1])||/\*|\//.test(p[0]))&&(p[2]+="-".concat(p[2]));for(var x=0;x<p.length;x++)if(p[x].indexOf(",")!=-1&&(p[x]=p[x].split(",").filter(function(k){return k!==""}).join(",")||"*"),p[x]=="*/1"&&(p[x]="*"),p[x].indexOf("/")>-1&&!/^\*|\-|\,/.test(p[x])){var w=null;switch(x){case 4:w="12";break;case 5:w="6";break;case 6:w="9999";break;default:w=null;break}if(w!==null){var $=p[x].split("/");p[x]="".concat($[0],"-").concat(w,"/").concat($[1])}}},c.prototype.validate=function(p){var f="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(p[0],f),this.validateOnlyExpectedCharactersFound(p[1],f),this.validateOnlyExpectedCharactersFound(p[2],f),this.validateOnlyExpectedCharactersFound(p[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(p[4],f),this.validateOnlyExpectedCharactersFound(p[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(p[6],f),this.validateAnyRanges(p)},c.prototype.validateAnyRanges=function(p){u.default.secondRange(p[0]),u.default.minuteRange(p[1]),u.default.hourRange(p[2]),u.default.dayOfMonthRange(p[3]),u.default.monthRange(p[4],this.monthStartIndexZero),u.default.dayOfWeekRange(p[5],this.dayOfWeekStartIndexZero)},c.prototype.validateOnlyExpectedCharactersFound=function(p,f){var g=p.match(new RegExp("[^".concat(f,"]+"),"gi"));if(g&&g.length)throw new Error("Expression contains invalid values: '".concat(g.toString(),"'"))},c}();s.CronParser=h},333:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExpressionDescriptor=void 0;var u=l(823),h=l(949),c=function(){function p(f,g){if(this.expression=f,this.options=g,this.expressionParts=new Array(5),!this.options.locale&&p.defaultLocale&&(this.options.locale=p.defaultLocale),!p.locales[this.options.locale]){var m=Object.keys(p.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(m,"'.")),this.options.locale=m}this.i18n=p.locales[this.options.locale],g.use24HourTimeFormat===void 0&&(g.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return p.toString=function(f,g){var m=g===void 0?{}:g,v=m.throwExceptionOnParseError,b=v===void 0?!0:v,x=m.verbose,w=x===void 0?!1:x,$=m.dayOfWeekStartIndexZero,k=$===void 0?!0:$,E=m.monthStartIndexZero,R=E===void 0?!1:E,M=m.use24HourTimeFormat,_=m.locale,D=_===void 0?null:_,P={throwExceptionOnParseError:b,verbose:w,dayOfWeekStartIndexZero:k,monthStartIndexZero:R,use24HourTimeFormat:M,locale:D};P.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var I=new p(f,P);return I.getFullDescription()},p.initialize=function(f,g){g===void 0&&(g="en"),p.specialCharacters=["/","-",",","*"],p.defaultLocale=g,f.load(p.locales)},p.prototype.getFullDescription=function(){var f,g,m="";try{var v=new h.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=v.parse(),this.expressionParts[0]==="@reboot")return((g=(f=this.i18n).atReboot)===null||g===void 0?void 0:g.call(f))||"Run once, at startup";var b=this.getTimeOfDayDescription(),x=this.getDayOfMonthDescription(),w=this.getMonthDescription(),$=this.getDayOfWeekDescription(),k=this.getYearDescription();m+=b+x+$+w+k,m=this.transformVerbosity(m,!!this.options.verbose),m=m.charAt(0).toLocaleUpperCase()+m.substr(1)}catch(E){if(!this.options.throwExceptionOnParseError)m=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(E)}return m},p.prototype.getTimeOfDayDescription=function(){var f=this.expressionParts[0],g=this.expressionParts[1],m=this.expressionParts[2],v="";if(!u.StringUtilities.containsAny(g,p.specialCharacters)&&!u.StringUtilities.containsAny(m,p.specialCharacters)&&!u.StringUtilities.containsAny(f,p.specialCharacters))v+=this.i18n.atSpace()+this.formatTime(m,g,f);else if(!f&&g.indexOf("-")>-1&&!(g.indexOf(",")>-1)&&!(g.indexOf("/")>-1)&&!u.StringUtilities.containsAny(m,p.specialCharacters)){var b=g.split("-");v+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(m,b[0],""),this.formatTime(m,b[1],""))}else if(!f&&m.indexOf(",")>-1&&m.indexOf("-")==-1&&m.indexOf("/")==-1&&!u.StringUtilities.containsAny(g,p.specialCharacters)){var x=m.split(",");v+=this.i18n.at();for(var w=0;w<x.length;w++)v+=" ",v+=this.formatTime(x[w],g,""),w<x.length-2&&(v+=","),w==x.length-2&&(v+=this.i18n.spaceAnd())}else{var $=this.getSecondsDescription(),k=this.getMinutesDescription(),E=this.getHoursDescription();if(v+=$,v&&k&&(v+=", "),v+=k,k===E)return v;v&&E&&(v+=", "),v+=E}return v},p.prototype.getSecondsDescription=function(){var f=this,g=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(m){return m},function(m){return u.StringUtilities.format(f.i18n.everyX0Seconds(m),m)},function(m){return f.i18n.secondsX0ThroughX1PastTheMinute()},function(m){return m=="0"?"":parseInt(m)<20?f.i18n.atX0SecondsPastTheMinute(m):f.i18n.atX0SecondsPastTheMinuteGt20()||f.i18n.atX0SecondsPastTheMinute(m)});return g},p.prototype.getMinutesDescription=function(){var f=this,g=this.expressionParts[0],m=this.expressionParts[2],v=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(b){return b},function(b){return u.StringUtilities.format(f.i18n.everyX0Minutes(b),b)},function(b){return f.i18n.minutesX0ThroughX1PastTheHour()},function(b){try{return b=="0"&&m.indexOf("/")==-1&&g==""?f.i18n.everyHour():parseInt(b)<20?f.i18n.atX0MinutesPastTheHour(b):f.i18n.atX0MinutesPastTheHourGt20()||f.i18n.atX0MinutesPastTheHour(b)}catch{return f.i18n.atX0MinutesPastTheHour(b)}});return v},p.prototype.getHoursDescription=function(){var f=this,g=this.expressionParts[2],m=0,v=[];g.split("/")[0].split(",").forEach(function(w){var $=w.split("-");$.length===2&&v.push({value:$[1],index:m+1}),m+=$.length});var b=0,x=this.getSegmentDescription(g,this.i18n.everyHour(),function(w){var $=v.find(function(E){return E.value===w&&E.index===b}),k=$&&f.expressionParts[1]!=="0";return b++,k?f.formatTime(w,"59",""):f.formatTime(w,"0","")},function(w){return u.StringUtilities.format(f.i18n.everyX0Hours(w),w)},function(w){return f.i18n.betweenX0AndX1()},function(w){return f.i18n.atX0()});return x},p.prototype.getDayOfWeekDescription=function(){var f=this,g=this.i18n.daysOfTheWeek(),m=null;return this.expressionParts[5]=="*"?m="":m=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(v,b){var x=v;v.indexOf("#")>-1?x=v.substring(0,v.indexOf("#")):v.indexOf("L")>-1&&(x=x.replace("L",""));var w=parseInt(x),$=f.i18n.daysOfTheWeekInCase?f.i18n.daysOfTheWeekInCase(b)[w]:g[w];if(v.indexOf("#")>-1){var k=null,E=v.substring(v.indexOf("#")+1),R=v.substring(0,v.indexOf("#"));switch(E){case"1":k=f.i18n.first(R);break;case"2":k=f.i18n.second(R);break;case"3":k=f.i18n.third(R);break;case"4":k=f.i18n.fourth(R);break;case"5":k=f.i18n.fifth(R);break}$=k+" "+$}return $},function(v){return parseInt(v)==1?"":u.StringUtilities.format(f.i18n.commaEveryX0DaysOfTheWeek(v),v)},function(v){var b=v.substring(0,v.indexOf("-")),x=f.expressionParts[3]!="*";return x?f.i18n.commaAndX0ThroughX1(b):f.i18n.commaX0ThroughX1(b)},function(v){var b=null;if(v.indexOf("#")>-1){var x=v.substring(v.indexOf("#")+1),w=v.substring(0,v.indexOf("#"));b=f.i18n.commaOnThe(x,w).trim()+f.i18n.spaceX0OfTheMonth()}else if(v.indexOf("L")>-1)b=f.i18n.commaOnTheLastX0OfTheMonth(v.replace("L",""));else{var $=f.expressionParts[3]!="*";b=$?f.i18n.commaAndOnX0():f.i18n.commaOnlyOnX0(v)}return b}),m},p.prototype.getMonthDescription=function(){var f=this,g=this.i18n.monthsOfTheYear(),m=this.getSegmentDescription(this.expressionParts[4],"",function(v,b){return b&&f.i18n.monthsOfTheYearInCase?f.i18n.monthsOfTheYearInCase(b)[parseInt(v)-1]:g[parseInt(v)-1]},function(v){return parseInt(v)==1?"":u.StringUtilities.format(f.i18n.commaEveryX0Months(v),v)},function(v){return f.i18n.commaMonthX0ThroughMonthX1()||f.i18n.commaX0ThroughX1()},function(v){return f.i18n.commaOnlyInMonthX0?f.i18n.commaOnlyInMonthX0():f.i18n.commaOnlyInX0()});return m},p.prototype.getDayOfMonthDescription=function(){var f=this,g=null,m=this.expressionParts[3];switch(m){case"L":g=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":g=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var v=m.match(/(\d{1,2}W)|(W\d{1,2})/);if(v){var b=parseInt(v[0].replace("W","")),x=b==1?this.i18n.firstWeekday():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),b.toString());g=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),x);break}else{var w=m.match(/L-(\d{1,2})/);if(w){var $=w[1];g=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth($),$);break}else{if(m=="*"&&this.expressionParts[5]!="*")return"";g=this.getSegmentDescription(m,this.i18n.commaEveryDay(),function(k){return k=="L"?f.i18n.lastDay():f.i18n.dayX0?u.StringUtilities.format(f.i18n.dayX0(),k):k},function(k){return k=="1"?f.i18n.commaEveryDay():f.i18n.commaEveryX0Days(k)},function(k){return f.i18n.commaBetweenDayX0AndX1OfTheMonth(k)},function(k){return f.i18n.commaOnDayX0OfTheMonth(k)})}break}}return g},p.prototype.getYearDescription=function(){var f=this,g=this.getSegmentDescription(this.expressionParts[6],"",function(m){return/^\d+$/.test(m)?new Date(parseInt(m),1).getFullYear().toString():m},function(m){return u.StringUtilities.format(f.i18n.commaEveryX0Years(m),m)},function(m){return f.i18n.commaYearX0ThroughYearX1()||f.i18n.commaX0ThroughX1()},function(m){return f.i18n.commaOnlyInYearX0?f.i18n.commaOnlyInYearX0():f.i18n.commaOnlyInX0()});return g},p.prototype.getSegmentDescription=function(f,g,m,v,b,x){var w=null,$=f.indexOf("/")>-1,k=f.indexOf("-")>-1,E=f.indexOf(",")>-1;if(!f)w="";else if(f==="*")w=g;else if(!$&&!k&&!E)w=u.StringUtilities.format(x(f),m(f));else if(E){for(var R=f.split(","),M="",_=0;_<R.length;_++)if(_>0&&R.length>2&&(M+=",",_<R.length-1&&(M+=" ")),_>0&&R.length>1&&(_==R.length-1||R.length==2)&&(M+="".concat(this.i18n.spaceAnd()," ")),R[_].indexOf("/")>-1||R[_].indexOf("-")>-1){var D=R[_].indexOf("-")>-1&&R[_].indexOf("/")==-1,P=this.getSegmentDescription(R[_],g,m,v,D?this.i18n.commaX0ThroughX1:b,x);D&&(P=P.replace(", ","")),M+=P}else $?M+=this.getSegmentDescription(R[_],g,m,v,b,x):M+=m(R[_]);$?w=M:w=u.StringUtilities.format(x(f),M)}else if($){var R=f.split("/");if(w=u.StringUtilities.format(v(R[1]),R[1]),R[0].indexOf("-")>-1){var I=this.generateRangeSegmentDescription(R[0],b,m);I.indexOf(", ")!=0&&(w+=", "),w+=I}else if(R[0].indexOf("*")==-1){var N=u.StringUtilities.format(x(R[0]),m(R[0]));N=N.replace(", ",""),w+=u.StringUtilities.format(this.i18n.commaStartingX0(),N)}}else k&&(w=this.generateRangeSegmentDescription(f,b,m));return w},p.prototype.generateRangeSegmentDescription=function(f,g,m){var v="",b=f.split("-"),x=m(b[0],1),w=m(b[1],2),$=g(f);return v+=u.StringUtilities.format($,x,w),v},p.prototype.formatTime=function(f,g,m){var v=0,b=0,x=parseInt(f)+v,w=parseInt(g)+b;w>=60?(w-=60,x+=1):w<0&&(w+=60,x-=1),x>=24?x=x-24:x<0&&(x=24+x);var $="",k=!1;this.options.use24HourTimeFormat||(k=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),$=k?"".concat(this.getPeriod(x)," "):" ".concat(this.getPeriod(x)),x>12&&(x-=12),x===0&&(x=12));var E="";return m&&(E=":".concat(("00"+m).substring(m.length))),"".concat(k?$:"").concat(("00"+x.toString()).substring(x.toString().length),":").concat(("00"+w.toString()).substring(w.toString().length)).concat(E).concat(k?"":$)},p.prototype.transformVerbosity=function(f,g){if(!g&&(f=f.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),f=f.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),f=f.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),f=f.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var m=0,v=Object.entries(this.i18n.conciseVerbosityReplacements());m<v.length;m++){var b=v[m],x=b[0],w=b[1];f=f.replace(new RegExp(x,"g"),w)}return f},p.prototype.getPeriod=function(f){return f>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},p.locales={},p}();s.ExpressionDescriptor=c},747:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.enLocaleLoader=void 0;var u=l(486),h=function(){function c(){}return c.prototype.load=function(p){p.en=new u.en},c}();s.enLocaleLoader=h},486:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.en=void 0;var l=function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u}();s.en=l},515:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0});function l(h,c){if(!h)throw new Error(c)}var u=function(){function h(){}return h.secondRange=function(c){for(var p=c.split(","),f=0;f<p.length;f++)if(!isNaN(parseInt(p[f],10))){var g=parseInt(p[f],10);l(g>=0&&g<=59,"seconds part must be >= 0 and <= 59")}},h.minuteRange=function(c){for(var p=c.split(","),f=0;f<p.length;f++)if(!isNaN(parseInt(p[f],10))){var g=parseInt(p[f],10);l(g>=0&&g<=59,"minutes part must be >= 0 and <= 59")}},h.hourRange=function(c){for(var p=c.split(","),f=0;f<p.length;f++)if(!isNaN(parseInt(p[f],10))){var g=parseInt(p[f],10);l(g>=0&&g<=23,"hours part must be >= 0 and <= 23")}},h.dayOfMonthRange=function(c){for(var p=c.split(","),f=0;f<p.length;f++)if(!isNaN(parseInt(p[f],10))){var g=parseInt(p[f],10);l(g>=1&&g<=31,"DOM part must be >= 1 and <= 31")}},h.monthRange=function(c,p){for(var f=c.split(","),g=0;g<f.length;g++)if(!isNaN(parseInt(f[g],10))){var m=parseInt(f[g],10);l(m>=1&&m<=12,p?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},h.dayOfWeekRange=function(c,p){for(var f=c.split(","),g=0;g<f.length;g++)if(!isNaN(parseInt(f[g],10))){var m=parseInt(f[g],10);l(m>=0&&m<=6,p?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},h}();s.default=u},823:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.StringUtilities=void 0;var l=function(){function u(){}return u.format=function(h){for(var c=[],p=1;p<arguments.length;p++)c[p-1]=arguments[p];return h.replace(/%s/g,function(f){return c.shift()})},u.containsAny=function(h,c){return c.some(function(p){return h.indexOf(p)>-1})},u}();s.StringUtilities=l}},r={};function o(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,o),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.toString=void 0;var s=o(333),l=o(747);s.ExpressionDescriptor.initialize(new l.enLocaleLoader),a.default=s.ExpressionDescriptor;var u=s.ExpressionDescriptor.toString;a.toString=u})(),i})())})(wg);var ES=wg.exports;const PS=cf(ES);var RS=function(e){var t=e.scheduler,n=e.queueName,r=e.onRemove,o=le.scheduler.remove.useMutation(),i=o.mutate,a=o.isSuccess;return d.useEffect(function(){a&&(r==null||r())},[a,r]),y.jsx(za,{actions:[{label:"Remove",onSelect:function(){i({queueName:n,jobSchedulerId:t.key})},icon:y.jsx(Gr,{})}]})},kS=function(e){var t=e.scheduler,n=e.queueName,r=e.onDismiss,o=t.template,i=Nr({},t);return delete i.template,y.jsx(Ba,{isOpen:!0,isDismissable:!0,onOpenChange:function(a){a||r()},className:"fixed inset-0 bg-black/20 dark:bg-black/40",children:y.jsx(Aa,{className:"fixed left-1/2 top-1/2 max-h-[85vh] w-full max-w-xl -translate-x-1/2 -translate-y-1/2 overflow-y-scroll rounded-lg bg-white p-4 shadow-xl dark:bg-slate-900",children:function(a){var s=a.close;return y.jsxs(y.Fragment,{children:[y.jsx("button",{className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-full text-slate-500 transition duration-150 ease-in-out hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800","aria-label":"Close",onClick:function(){r(),s()},children:y.jsx(Jl,{})}),y.jsxs("div",{className:"flex items-center space-x-4",children:[y.jsxs(Ka,{className:"mb-1 flex items-center space-x-2",children:[y.jsx("span",{className:"text-xl font-semibold text-slate-900 dark:text-slate-100",children:t.name}),y.jsxs("span",{className:"rounded-md text-slate-500 dark:text-slate-400",children:["#",t.id]})]}),y.jsx(RS,{queueName:n,scheduler:t,onRemove:r})]}),y.jsxs("div",{children:[y.jsxs("div",{className:"space-y-2 border-b border-b-slate-200 py-4 dark:border-b-slate-700",children:[y.jsx("p",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Options"}),y.jsx("div",{className:"data-json-renderer [&>ul]:max-h-[400px]",children:y.jsx(ba,{data:i,theme:"monokai"})})]}),y.jsxs("div",{className:"space-y-2 pt-4",children:[y.jsx("p",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Template"}),y.jsx("div",{className:"data-json-renderer [&>ul]:max-h-[400px]",children:y.jsx(ba,{data:o,theme:"monokai"})})]})]})]})}})})},Di=a1();function MS(e,t){t===void 0&&(t=new Date);var n=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"short"}),r=n.formatToParts(t),o=r.find(function(i){return i.type==="timeZoneName"});return(o==null?void 0:o.value)||""}var OS=function(e){return[Di.display({id:"select",header:function(t){var n=t.table;return y.jsx(ca,{checked:n.getIsSomeRowsSelected()?"indeterminate":n.getIsAllRowsSelected(),onCheckedChange:function(){n.toggleAllRowsSelected()}})},cell:function(t){var n=t.row,r=t.table;return y.jsx(ca,{className:r.getIsSomeRowsSelected()||r.getIsAllRowsSelected()?"":"opacity-0 transition group-hover:opacity-100",checked:n.getIsSomeSelected()?"indeterminate":n.getIsSelected(),onCheckedChange:function(o){n.getToggleSelectedHandler()(o),e(n.index)}})}}),Di.accessor("name",{cell:function(t){return y.jsx("div",{className:"flex w-full items-center space-x-2",children:y.jsx("span",{className:"max-w-fit grow basis-full truncate text-slate-900 dark:text-slate-200",children:t.cell.row.original.name})})},header:"Scheduler"}),Di.accessor("pattern",{cell:function(t){return y.jsxs("span",{className:"grow basis-full truncate text-slate-900 dark:text-slate-200",children:[t.cell.row.original.pattern?PS.toString(t.cell.row.original.pattern,{verbose:!0}):t.cell.row.original.every?"Every ".concat(t.cell.row.original.every):""," ",t.cell.row.original.tz?"(".concat(MS(t.cell.row.original.tz),")"):""]})},header:"Pattern"}),Di.accessor("next",{cell:function(t){return t.cell.row.original.next?y.jsx(Ru,{message:$1(new Date(t.cell.row.original.next),"dd MMM yyyy HH:mm:ss zzz"),children:y.jsx("div",{className:"flex items-center space-x-1.5",children:y.jsxs("p",{className:"text-slate-900 dark:text-slate-200",children:["In ",S1(new Date(t.cell.row.original.next))," ",y.jsxs("span",{className:"text-sm text-slate-700 dark:text-slate-400",children:["(",t.cell.row.original.iterationCount," run",t.cell.row.original.iterationCount===1?"":"s"," total)"]})]})})}):y.jsx("p",{className:"text-slate-900 dark:text-slate-200",children:"No next run"})},header:"Next Run"})]},TS=function(e){var t=e.queueName,n=d.useState({}),r=n[0],o=n[1],i=d.useRef(null),a=le.scheduler.list.useQuery({queueName:t}),s=a.data,l=a.isLoading,u=(s==null?void 0:s.length)===0,h=function(x){i.current=x},c=OS(h),p=v1({data:s||[],columns:c,getCoreRowModel:m1(),state:{rowSelection:r},onRowSelectionChange:o}),f=d.useState(null),g=f[0],m=f[1],v=le.scheduler.bulkRemove.useMutation().mutate,b=function(x,w){if(x.shiftKey&&i.current!==null){x.preventDefault();for(var $=Math.min(i.current,w),k=Math.max(i.current,w),E=Nr({},r),R=$;R<=k;R++)E[R]=!0;o(E)}else m(p.getRowModel().rows[w].original),i.current=w};return!l&&u?null:y.jsxs("div",{children:[g?y.jsx(kS,{scheduler:g,queueName:t,onDismiss:function(){return m(null)}}):null,y.jsx("div",{className:"rounded-md border border-slate-200 shadow-sm dark:border-slate-700",children:l?y.jsx(P1,{}):y.jsxs("div",{children:[p.getHeaderGroups().map(function(x,w){return y.jsx("div",{className:"sticky top-0 grid grid-cols-[auto,350px,1fr,1fr] rounded-t-md border-b border-slate-200 bg-slate-100/50 p-2 backdrop-blur-md dark:border-slate-700 dark:bg-slate-900/50",children:x.headers.map(function($){return y.jsx("div",{className:"flex h-full items-center text-sm font-semibold text-slate-700 dark:text-slate-300 ".concat(w!==0?"pr-10":"pr-3"),children:$.isPlaceholder?null:aa($.column.columnDef.header,$.getContext())},$.id)})},x.id)}),p.getRowModel().rows.map(function(x,w){return y.jsx(E1,{isLastRow:p.getRowModel().rows.length!==w+1,isSelected:x.getIsSelected(),onClick:function($){return b($,w)},layoutVariant:"scheduler",children:x.getVisibleCells().map(function($,k){return y.jsx("div",{className:"flex h-full items-center ".concat(k!==0?"pr-10":"pr-3"),children:aa($.column.columnDef.cell,$.getContext())},$.id)})},x.id)})]})}),p.getSelectedRowModel().rows.length>0?y.jsx("div",{className:"pointer-events-none sticky bottom-0 flex w-full items-center justify-center pb-5",children:y.jsxs("div",{className:"pointer-events-auto flex items-center space-x-3 rounded-lg border-slate-100 bg-white/90 px-3 py-2 text-sm shadow-lg backdrop-blur dark:border-slate-700 dark:bg-slate-900/90",children:[y.jsxs("p",{className:"text-slate-900 dark:text-slate-100",children:[p.getSelectedRowModel().rows.length," selected"]}),y.jsx(Cn,{label:"Delete",colorScheme:"red",icon:y.jsx(Gr,{}),size:"sm",onClick:function(){v({queueName:t,jobSchedulerIds:p.getSelectedRowModel().rows.map(function(x){return x.original.key})}),p.resetRowSelection()}})]})}):null]})},_i=function(e){var t=e.label,n=e.value,r=e.trend,o=e.variant,i=o===void 0?"completed":o,a=i==="completed"?r!=null&&r.isPositive?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400":r!=null&&r.isPositive?"text-red-600 dark:text-red-400":"text-green-600 dark:text-green-400";return y.jsxs("div",{className:"group flex flex-col space-y-2 rounded-xl border border-slate-200/80 bg-white/80 px-4 py-3 backdrop-blur-sm transition-all duration-200 hover:border-slate-300 hover:shadow-sm dark:border-slate-700/50 dark:bg-slate-900/50 dark:hover:border-slate-600",children:[y.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t}),y.jsxs("div",{className:"flex items-baseline space-x-2",children:[y.jsx("p",{className:"font-mono text-2xl font-semibold tabular-nums leading-none text-slate-900 dark:text-slate-50",children:typeof n=="number"?n.toLocaleString():n}),r&&y.jsxs("div",{className:"flex items-center space-x-0.5 font-mono text-xs font-medium ".concat(a),children:[r.isPositive?y.jsx(g2,{width:11,height:11}):y.jsx(h2,{width:11,height:11}),y.jsxs("span",{children:[Math.abs(r.value),"%"]})]})]})]})},cr={"1m":{label:"Last minute",minutes:1},"1h":{label:"Last hour",minutes:60},"24h":{label:"Last 24 hours",minutes:1440},"7d":{label:"Last 7 days",minutes:10080}},DS=function(e){var t=e.queueName,n=d.useState("1h"),r=n[0],o=n[1],i=le.queue.metrics.useQuery({queueName:t,type:"completed",start:0,end:cr[r].minutes},{enabled:!!t,refetchInterval:Io}),a=i.data,s=i.isLoading,l=le.queue.metrics.useQuery({queueName:t,type:"failed",start:0,end:cr[r].minutes},{enabled:!!t,refetchInterval:Io}),u=l.data,h=l.isLoading,c=s||h,p=function(b,x){if(x===0)return null;var w=(b-x)/x*100;return{value:Math.round(Math.abs(w)),isPositive:w>0}},f=a&&p(a.count,a.meta.prevCount),g=u&&p(u.count,u.meta.prevCount),m=a?(a.count/cr[r].minutes).toFixed(1):"0";u&&(u.count/cr[r].minutes).toFixed(1);var v=a&&u?a.count+u.count>0?(a.count/(a.count+u.count)*100).toFixed(1):"100":"0";return y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("h2",{className:"text-lg font-semibold tracking-tight text-slate-900 dark:text-slate-50",children:"Metrics"}),y.jsx("div",{className:"flex items-center space-x-0.5 rounded-lg border border-slate-200/80 bg-white/80 p-0.5 backdrop-blur-sm dark:border-slate-700/50 dark:bg-slate-900/50",children:Object.keys(cr).map(function(b){return y.jsx("button",{onClick:function(){return o(b)},className:"rounded-md px-2.5 py-1 text-xs font-medium transition-all duration-150 ".concat(r===b?"bg-slate-100 text-slate-900 shadow-sm dark:bg-slate-800 dark:text-slate-100":"text-slate-600 hover:bg-slate-50 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/50 dark:hover:text-slate-100"),children:cr[b].label},b)})})]}),c?y.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:Ke([],Array(4),!0).map(function(b,x){return y.jsx(Mo,{className:"h-[88px] rounded-xl"},x)})}):y.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[y.jsx(_i,{label:"Completed",value:(a==null?void 0:a.count)||0,trend:f||void 0,variant:"completed"}),y.jsx(_i,{label:"Failed",value:(u==null?void 0:u.count)||0,trend:g||void 0,variant:"failed"}),y.jsx(_i,{label:"Success Rate",value:"".concat(v,"%")}),y.jsx(_i,{label:"Throughput",value:"".concat(m,"/min")})]})]})},Ds=new Intl.NumberFormat("en-US").format,_S=function(){var e,t,n,r,o,i=vb().id,a=i,s=a2()[0],l=d.useState("completed"),u=l[0],h=l[1],c=le.job.list.useInfiniteQuery({queueName:a,limit:Dl,status:u},{getNextPageParam:function($){return $.nextCursor},enabled:!!a,refetchInterval:Io,retry:_l}),p=c.data,f=c.fetchNextPage,g=c.isLoading,m=c.isError,v=c.isFetchingNextPage,b=c.hasNextPage;d.useEffect(function(){var $=s.get("status");$&&h($),!$&&u&&h("completed")},[s,u]);var x=le.queue.byName.useQuery({queueName:a},{enabled:!!a,refetchInterval:Io,retry:_l}),w=(e=p==null?void 0:p.pages.map(function($){return $.jobs}).flat())!==null&&e!==void 0?e:[];return y.jsx(i1,{children:x.data===null?y.jsx(El,{message:"No queue found"}):m?y.jsx(El,{message:"Could not fetch jobs"}):y.jsxs("div",{children:[y.jsx("div",{className:"mb-2 flex justify-between",children:y.jsxs("div",{className:"flex items-center space-x-4",children:[y.jsx("h1",{className:"text-2xl font-bold text-slate-900 dark:text-slate-50",children:x.data?x.data.displayName:y.jsx(Mo,{className:"h-8 w-52 rounded-md"})}),y.jsxs("div",{className:"flex items-center space-x-2",children:[x.data?y.jsx(SS,{queue:x.data}):null,!((t=x.data)===null||t===void 0)&&t.paused?y.jsx("div",{className:"flex h-7 cursor-default items-center justify-center space-x-1.5 rounded-md bg-yellow-50 px-2 text-sm font-medium text-yellow-900 transition duration-150 ease-in-out dark:bg-yellow-950/30 dark:text-yellow-400",children:y.jsx("span",{children:"Paused"})}):null]})]})}),y.jsx("div",{className:"mb-5",children:y.jsx("div",{className:"flex items-center space-x-2",children:x.data?y.jsxs(y.Fragment,{children:[y.jsxs("p",{className:"text-slate-600 dark:text-slate-400",children:[y.jsxs("span",{className:"text-green-800 dark:text-green-400",children:[Ds(x.data.client.connectedClients)," ","connected"]})," ","and"," ",y.jsxs("span",{className:"text-red-800 dark:text-red-400",children:[Ds(x.data.client.blockedClients)," ","blocked"]})," ","out of"," ",y.jsxs("span",{className:"text-slate-900 dark:text-slate-100",children:[Ds(x.data.client.maxClients)," max clients"]})]}),y.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"·"}),y.jsxs("p",{className:"text-slate-600 dark:text-slate-400",children:[x.data.client.usedMemoryHuman," /"," ",x.data.client.totalMemoryHuman," (",(x.data.client.usedMemoryPercentage*100).toFixed(2),"%)"]}),y.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"·"}),y.jsxs("p",{className:"text-slate-600 dark:text-slate-400",children:["Redis v",x.data.client.version]})]}):y.jsx(Mo,{className:"h-6 w-80"})})}),y.jsxs("div",{className:"space-y-8",children:[!((n=x.data)===null||n===void 0)&&n.supports.metrics?y.jsx(DS,{queueName:a}):null,!((r=x.data)===null||r===void 0)&&r.supports.schedulers?y.jsx(TS,{queueName:a}):null,y.jsxs("div",{className:"space-y-4",children:[y.jsx(p$,{showCleanAllButton:w.length>0,queueName:a,status:u,queue:x.data}),y.jsx(AC,{onBottomInView:function(){v||!b||f()},status:u,totalJobs:((o=p==null?void 0:p.pages.at(-1))===null||o===void 0?void 0:o.totalCount)||0,jobs:w.map(function($){return Nr(Nr({},$),{status:u})}),isLoading:g,isFetchingNextPage:v,queueName:a})]})]})]})})},Fi=function(e){var t=e.count,n=e.variant,r={active:"text-cyan-600 dark:text-cyan-400",completed:"text-green-600 dark:text-green-400",failed:"text-red-600 dark:text-red-400",waiting:"text-amber-600 dark:text-amber-400"},o={active:y.jsx(C0,{width:16,height:16}),completed:y.jsx(b0,{width:16,height:16}),failed:y.jsx(y0,{width:16,height:16}),waiting:y.jsx(z2,{width:16,height:16})};return y.jsx("div",{children:y.jsx(Ru,{message:n.charAt(0).toUpperCase()+n.slice(1),children:y.jsxs("div",{className:"flex items-center space-x-1 text-sm ".concat(r[n]),children:[y.jsx("p",{className:"text-lg",children:t}),o[n]]})})})},FS=function(e){var t=e.queueName,n=le.queue.byName.useQuery({queueName:t},{refetchInterval:Io,retry:_l});return n.data?y.jsxs(ka,{to:"../".concat(n.data.name),className:"group flex items-center justify-between transition",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx("p",{className:"py-3 text-lg font-medium text-slate-900 transition group-hover:text-brand-900 dark:text-slate-200 dark:group-hover:text-brand-100",children:n.data.displayName}),y.jsx("div",{children:n.data.paused?y.jsx("div",{className:"flex h-7 items-center justify-center space-x-1.5 rounded-md bg-yellow-50 px-2 text-sm font-medium text-yellow-900 transition duration-150 ease-in-out dark:bg-yellow-950/30 dark:text-yellow-400",children:y.jsx("span",{children:"Paused"})}):null})]}),y.jsxs("div",{className:"flex space-x-5",children:[y.jsx(Fi,{count:n.data.counts.completed,variant:"completed"}),y.jsx(Fi,{count:n.data.counts.failed,variant:"failed"}),y.jsx(Fi,{count:n.data.counts.active,variant:"active"}),y.jsx(Fi,{count:n.data.counts.waiting,variant:"waiting"})]})]}):null},LS=function(){var e=le.queue.list.useQuery().data,t=le.queue.pauseAll.useMutation().mutate,n=le.queue.resumeAll.useMutation().mutate;return y.jsx(i1,{children:y.jsxs("div",{className:"xl:max-w-2xl",children:[y.jsxs("div",{className:"flex justify-between",children:[y.jsx("h1",{className:"mb-6 text-2xl font-bold text-slate-900 dark:text-slate-50",children:"Queues"}),y.jsx("div",{children:y.jsx(za,{actions:[{label:"Resume all",icon:y.jsx(w0,{}),onSelect:function(){return n()}},{label:"Pause all",icon:y.jsx(x0,{}),onSelect:function(){return t()}}]})})]}),y.jsx("div",{children:e==null?void 0:e.map(function(r,o){return y.jsx("div",{className:(e==null?void 0:e.length)-1!==o?"border-b border-slate-100 dark:border-slate-700":"",children:y.jsx(FS,{queueName:r.name},r.name)},r.name)})})]})})},IS=function(e){var t=e.apiUrl,n=e.basename,r=d.useState(!1),o=r[0],i=r[1],a=d.useState(function(){return new om})[0],s=d.useState(function(){return le.createClient({links:[Jm({url:t})]})})[0];return d.useEffect(function(){var l=JSON.parse(localStorage.getItem("user-preferences")||"null");l?l.theme==="dark"||l.theme==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),i(!0)},[]),o?y.jsx(le.Provider,{client:s,queryClient:a,children:y.jsxs(im,{client:a,children:[y.jsx(h$,{}),y.jsx(n2,{basename:n,children:y.jsxs(Db,{children:[y.jsx(rl,{path:"/",element:y.jsx(LS,{})}),y.jsx(rl,{path:"/:id",element:y.jsx(_S,{})})]})})]})}):null};exports.QueueDashApp=IS;
|
|
72
|
+
`},Qd=B$(U$)(hg),q$={config:V$},W$=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,a){return a(i)},o)}};function pg(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],pg(e[n],t[n]))}),qd(qd({},e),t)}var G$={type:"cancelation",msg:"operation is manually canceled"};function ks(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(G$):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Q$=["monaco"],Y$=A$.create({config:K$,isInitialized:!1,resolve:null,reject:null,monaco:null}),gg=w$(Y$,2),oi=gg[0],Ua=gg[1];function X$(e){var t=q$.config(e),n=t.monaco,r=y$(t,Q$);Ua(function(o){return{config:pg(o.config,r),monaco:n}})}function Z$(){var e=oi(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Ua({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),ks(Ms);if(window.monaco&&window.monaco.editor)return mg(window.monaco),e.resolve(window.monaco),ks(Ms);W$(J$,tS)(nS)}return ks(Ms)}function J$(e){return document.body.appendChild(e)}function eS(e){var t=document.createElement("script");return e&&(t.src=e),t}function tS(e){var t=oi(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=eS("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function nS(){var e=oi(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;mg(r),e.resolve(r)},function(n){e.reject(n)})}function mg(e){oi().monaco||Ua({monaco:e})}function rS(){return oi(function(e){var t=e.monaco;return t})}var Ms=new Promise(function(e,t){return Ua({resolve:e,reject:t})}),vg={config:X$,init:Z$,__getMonacoInstance:rS},oS={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Os=oS,iS={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},aS=iS;function sS({children:e}){return d.createElement("div",{style:aS.container},e)}var lS=sS,uS=lS;function cS({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:a}){return d.createElement("section",{style:{...Os.wrapper,width:e,height:t},...a},!n&&d.createElement(uS,null,r),d.createElement("div",{ref:o,style:{...Os.fullWidth,...!n&&Os.hide},className:i}))}var dS=cS,bg=d.memo(dS);function fS(e){d.useEffect(e,[])}var yg=fS;function hS(e,t,n=!0){let r=d.useRef(!0);d.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var et=hS;function Eo(){}function vr(e,t,n,r){return pS(e,r)||gS(e,t,n,r)}function pS(e,t){return e.editor.getModel(xg(e,t))}function gS(e,t,n,r){return e.editor.createModel(t,n,r?xg(e,r):void 0)}function xg(e,t){return e.Uri.parse(t)}function mS({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:a,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:h="Loading...",options:c={},height:p="100%",width:f="100%",className:g,wrapperProps:m={},beforeMount:v=Eo,onMount:b=Eo}){let[x,w]=d.useState(!1),[$,k]=d.useState(!0),E=d.useRef(null),R=d.useRef(null),M=d.useRef(null),_=d.useRef(b),D=d.useRef(v),P=d.useRef(!1);yg(()=>{let j=vg.init();return j.then(O=>(R.current=O)&&k(!1)).catch(O=>(O==null?void 0:O.type)!=="cancelation"&&console.error("Monaco initialization: error:",O)),()=>E.current?F():j.cancel()}),et(()=>{if(E.current&&R.current){let j=E.current.getOriginalEditor(),O=vr(R.current,e||"",r||n||"text",i||"");O!==j.getModel()&&j.setModel(O)}},[i],x),et(()=>{if(E.current&&R.current){let j=E.current.getModifiedEditor(),O=vr(R.current,t||"",o||n||"text",a||"");O!==j.getModel()&&j.setModel(O)}},[a],x),et(()=>{let j=E.current.getModifiedEditor();j.getOption(R.current.editor.EditorOption.readOnly)?j.setValue(t||""):t!==j.getValue()&&(j.executeEdits("",[{range:j.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),j.pushUndoStop())},[t],x),et(()=>{var j,O;(O=(j=E.current)==null?void 0:j.getModel())==null||O.original.setValue(e||"")},[e],x),et(()=>{let{original:j,modified:O}=E.current.getModel();R.current.editor.setModelLanguage(j,r||n||"text"),R.current.editor.setModelLanguage(O,o||n||"text")},[n,r,o],x),et(()=>{var j;(j=R.current)==null||j.editor.setTheme(u)},[u],x),et(()=>{var j;(j=E.current)==null||j.updateOptions(c)},[c],x);let I=d.useCallback(()=>{var T;if(!R.current)return;D.current(R.current);let j=vr(R.current,e||"",r||n||"text",i||""),O=vr(R.current,t||"",o||n||"text",a||"");(T=E.current)==null||T.setModel({original:j,modified:O})},[n,t,o,e,r,i,a]),N=d.useCallback(()=>{var j;!P.current&&M.current&&(E.current=R.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...c}),I(),(j=R.current)==null||j.editor.setTheme(u),w(!0),P.current=!0)},[c,u,I]);d.useEffect(()=>{x&&_.current(E.current,R.current)},[x]),d.useEffect(()=>{!$&&!x&&N()},[$,x,N]);function F(){var O,T,A,K;let j=(O=E.current)==null?void 0:O.getModel();s||((T=j==null?void 0:j.original)==null||T.dispose()),l||((A=j==null?void 0:j.modified)==null||A.dispose()),(K=E.current)==null||K.dispose()}return d.createElement(bg,{width:f,height:p,isEditorReady:x,loading:h,_ref:M,className:g,wrapperProps:m})}var vS=mS;d.memo(vS);function bS(e){let t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var yS=bS,Ti=new Map;function xS({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:a="light",line:s,loading:l="Loading...",options:u={},overrideServices:h={},saveViewState:c=!0,keepCurrentModel:p=!1,width:f="100%",height:g="100%",className:m,wrapperProps:v={},beforeMount:b=Eo,onMount:x=Eo,onChange:w,onValidate:$=Eo}){let[k,E]=d.useState(!1),[R,M]=d.useState(!0),_=d.useRef(null),D=d.useRef(null),P=d.useRef(null),I=d.useRef(x),N=d.useRef(b),F=d.useRef(),j=d.useRef(r),O=yS(i),T=d.useRef(!1),A=d.useRef(!1);yg(()=>{let H=vg.init();return H.then(z=>(_.current=z)&&M(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>D.current?L():H.cancel()}),et(()=>{var z,V,W,q;let H=vr(_.current,e||r||"",t||o||"",i||n||"");H!==((z=D.current)==null?void 0:z.getModel())&&(c&&Ti.set(O,(V=D.current)==null?void 0:V.saveViewState()),(W=D.current)==null||W.setModel(H),c&&((q=D.current)==null||q.restoreViewState(Ti.get(i))))},[i],k),et(()=>{var H;(H=D.current)==null||H.updateOptions(u)},[u],k),et(()=>{!D.current||r===void 0||(D.current.getOption(_.current.editor.EditorOption.readOnly)?D.current.setValue(r):r!==D.current.getValue()&&(A.current=!0,D.current.executeEdits("",[{range:D.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),D.current.pushUndoStop(),A.current=!1))},[r],k),et(()=>{var z,V;let H=(z=D.current)==null?void 0:z.getModel();H&&o&&((V=_.current)==null||V.editor.setModelLanguage(H,o))},[o],k),et(()=>{var H;s!==void 0&&((H=D.current)==null||H.revealLine(s))},[s],k),et(()=>{var H;(H=_.current)==null||H.editor.setTheme(a)},[a],k);let K=d.useCallback(()=>{var H;if(!(!P.current||!_.current)&&!T.current){N.current(_.current);let z=i||n,V=vr(_.current,r||e||"",t||o||"",z||"");D.current=(H=_.current)==null?void 0:H.editor.create(P.current,{model:V,automaticLayout:!0,...u},h),c&&D.current.restoreViewState(Ti.get(z)),_.current.editor.setTheme(a),s!==void 0&&D.current.revealLine(s),E(!0),T.current=!0}},[e,t,n,r,o,i,u,h,c,a,s]);d.useEffect(()=>{k&&I.current(D.current,_.current)},[k]),d.useEffect(()=>{!R&&!k&&K()},[R,k,K]),j.current=r,d.useEffect(()=>{var H,z;k&&w&&((H=F.current)==null||H.dispose(),F.current=(z=D.current)==null?void 0:z.onDidChangeModelContent(V=>{A.current||w(D.current.getValue(),V)}))},[k,w]),d.useEffect(()=>{if(k){let H=_.current.editor.onDidChangeMarkers(z=>{var W;let V=(W=D.current.getModel())==null?void 0:W.uri;if(V&&z.find(q=>q.path===V.path)){let q=_.current.editor.getModelMarkers({resource:V});$==null||$(q)}});return()=>{H==null||H.dispose()}}return()=>{}},[k,$]);function L(){var H,z;(H=F.current)==null||H.dispose(),p?c&&Ti.set(i,D.current.saveViewState()):(z=D.current.getModel())==null||z.dispose(),D.current.dispose()}return d.createElement(bg,{width:f,height:g,isEditorReady:k,loading:l,_ref:P,className:m,wrapperProps:v})}var wS=xS,CS=d.memo(wS),$S=CS,Ts=function(e){var t=e.value,n=e.onChange,r=d.useRef(null),o=function(){var a,s;(s=(a=r.current)===null||a===void 0?void 0:a.getAction("editor.action.formatDocument"))===null||s===void 0||s.run()},i=function(a){var s=String.fromCharCode(a.which).toLowerCase();(a.ctrlKey||a.metaKey)&&s==="s"&&(a.preventDefault(),o())};return y.jsx("div",{onKeyDown:i,onBlur:o,className:"mb-6 border border-slate-200",children:y.jsx($S,{height:"300px",language:"json",className:"rounded-md",options:{minimap:{enabled:!1},formatOnPaste:!0,formatOnType:!0,padding:{top:8,bottom:8},tabSize:2},defaultValue:t,onChange:function(a){a&&n(a)},onMount:function(a,s){r.current=a,s.editor.defineTheme("solarized-light",{base:"vs",inherit:!0,rules:[{background:"ffffff",token:""},{foreground:"6a737d",token:"comment"},{foreground:"6a737d",token:"punctuation.definition.comment"},{foreground:"6a737d",token:"string.comment"},{foreground:"005cc5",token:"constant"},{foreground:"005cc5",token:"entity.name.constant"},{foreground:"005cc5",token:"variable.other.constant"},{foreground:"005cc5",token:"variable.language"},{foreground:"6f42c1",token:"entity"},{foreground:"6f42c1",token:"entity.name"},{foreground:"24292e",token:"variable.parameter.function"},{foreground:"22863a",token:"entity.name.tag"},{foreground:"d73a49",token:"keyword"},{foreground:"d73a49",token:"storage"},{foreground:"d73a49",token:"storage.type"},{foreground:"24292e",token:"storage.modifier.package"},{foreground:"24292e",token:"storage.modifier.import"},{foreground:"24292e",token:"storage.type.java"},{foreground:"032f62",token:"string"},{foreground:"032f62",token:"punctuation.definition.string"},{foreground:"032f62",token:"string punctuation.section.embedded source"},{foreground:"005cc5",token:"support"},{foreground:"005cc5",token:"meta.property-name"},{foreground:"e36209",token:"variable"},{foreground:"24292e",token:"variable.other"},{foreground:"b31d28",fontStyle:"bold italic underline",token:"invalid.broken"},{foreground:"b31d28",fontStyle:"bold italic underline",token:"invalid.deprecated"},{foreground:"fafbfc",background:"b31d28",fontStyle:"italic underline",token:"invalid.illegal"},{foreground:"fafbfc",background:"d73a49",fontStyle:"italic underline",token:"carriage-return"},{foreground:"b31d28",fontStyle:"bold italic underline",token:"invalid.unimplemented"},{foreground:"b31d28",token:"message.error"},{foreground:"24292e",token:"string source"},{foreground:"005cc5",token:"string variable"},{foreground:"032f62",token:"source.regexp"},{foreground:"032f62",token:"string.regexp"},{foreground:"032f62",token:"string.regexp.character-class"},{foreground:"032f62",token:"string.regexp constant.character.escape"},{foreground:"032f62",token:"string.regexp source.ruby.embedded"},{foreground:"032f62",token:"string.regexp string.regexp.arbitrary-repitition"},{foreground:"22863a",fontStyle:"bold",token:"string.regexp constant.character.escape"},{foreground:"005cc5",token:"support.constant"},{foreground:"005cc5",token:"support.variable"},{foreground:"005cc5",token:"meta.module-reference"},{foreground:"735c0f",token:"markup.list"},{foreground:"005cc5",fontStyle:"bold",token:"markup.heading"},{foreground:"005cc5",fontStyle:"bold",token:"markup.heading entity.name"},{foreground:"22863a",token:"markup.quote"},{foreground:"24292e",fontStyle:"italic",token:"markup.italic"},{foreground:"24292e",fontStyle:"bold",token:"markup.bold"},{foreground:"005cc5",token:"markup.raw"},{foreground:"b31d28",background:"ffeef0",token:"markup.deleted"},{foreground:"b31d28",background:"ffeef0",token:"meta.diff.header.from-file"},{foreground:"b31d28",background:"ffeef0",token:"punctuation.definition.deleted"},{foreground:"22863a",background:"f0fff4",token:"markup.inserted"},{foreground:"22863a",background:"f0fff4",token:"meta.diff.header.to-file"},{foreground:"22863a",background:"f0fff4",token:"punctuation.definition.inserted"},{foreground:"e36209",background:"ffebda",token:"markup.changed"},{foreground:"e36209",background:"ffebda",token:"punctuation.definition.changed"},{foreground:"f6f8fa",background:"005cc5",token:"markup.ignored"},{foreground:"f6f8fa",background:"005cc5",token:"markup.untracked"},{foreground:"6f42c1",fontStyle:"bold",token:"meta.diff.range"},{foreground:"005cc5",token:"meta.diff.header"},{foreground:"005cc5",fontStyle:"bold",token:"meta.separator"},{foreground:"005cc5",token:"meta.output"},{foreground:"586069",token:"brackethighlighter.tag"},{foreground:"586069",token:"brackethighlighter.curly"},{foreground:"586069",token:"brackethighlighter.round"},{foreground:"586069",token:"brackethighlighter.square"},{foreground:"586069",token:"brackethighlighter.angle"},{foreground:"586069",token:"brackethighlighter.quote"},{foreground:"b31d28",token:"brackethighlighter.unmatched"},{foreground:"b31d28",token:"sublimelinter.mark.error"},{foreground:"e36209",token:"sublimelinter.mark.warning"},{foreground:"959da5",token:"sublimelinter.gutter-mark"},{foreground:"032f62",fontStyle:"underline",token:"constant.other.reference.link"},{foreground:"032f62",fontStyle:"underline",token:"string.other.link"}],colors:{"editor.foreground":"#24292e","editor.background":"#ffffff","editor.selectionBackground":"#c8c8fa","editor.inactiveSelectionBackground":"#fafbfc","editor.lineHighlightBackground":"#fafbfc","editorCursor.foreground":"#24292e","editorWhitespace.foreground":"#959da5","editorIndentGuide.background":"#959da5","editorIndentGuide.activeBackground":"#24292e","editor.selectionHighlightBorder":"#fafbfc"}}),s.editor.setTheme("solarized-light")}})})},Yd=function(e){var t=e.queue,n=e.onDismiss,r=e.variant,o=r===void 0?"job":r,i=le.queue.addJob.useMutation({onSuccess:function(){pr.success("New job has been added"),n()},onError:function(E){pr.error(E.message)}}),a=i.mutate,s=i.status,l=le.queue.addJobScheduler.useMutation({onSuccess:function(){pr.success("New job scheduler has been added"),n()},onError:function(E){pr.error(E.message)}}),u=l.mutate,h=l.status,c=d.useState("{}"),p=c[0],f=c[1],g=d.useState(JSON.stringify({name:"",data:{},opts:{}},null,2)),m=g[0],v=g[1],b=d.useState(JSON.stringify({pattern:"0 0 * * *",tz:Intl.DateTimeFormat().resolvedOptions().timeZone},null,2)),x=b[0],w=b[1],$=o==="job",k=$?s:h;return y.jsx(n1,{isOpen:!0,onOpenChange:function(E){E||n()},children:y.jsx(Ba,{isDismissable:!0,className:"fixed inset-0 bg-black/20 dark:bg-black/40",children:y.jsx(Aa,{className:"fixed left-1/2 top-1/2 max-h-[85vh] w-full max-w-xl -translate-x-1/2 -translate-y-1/2 overflow-y-scroll rounded-lg bg-white p-4 shadow-xl dark:bg-slate-900",children:function(E){var R=E.close;return y.jsxs(y.Fragment,{children:[y.jsx("button",{className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-full text-slate-500 transition duration-150 ease-in-out hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800","aria-label":"Close",onClick:function(){R(),n()},children:y.jsx(Jl,{})}),y.jsx("div",{className:"flex items-center space-x-4",children:y.jsxs(Ka,{className:"mb-1 text-xl font-semibold text-slate-900 dark:text-slate-100",children:["Add ",$?"job":"scheduler"," to"," ",t.displayName.toLocaleLowerCase()]})}),$?y.jsx(Ts,{value:p,onChange:f}):y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Template"}),y.jsx(Ts,{value:m,onChange:v})]}),y.jsxs("div",{children:[y.jsx("label",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Options"}),y.jsx(Ts,{value:x,onChange:w})]})]}),y.jsx("div",{children:y.jsx(Cn,{label:$?"Add job":"Add scheduler",variant:"filled",disabled:k==="pending",onClick:function(){try{if($){var M=JSON.parse(p);a({queueName:t.name,data:M})}else{var _=JSON.parse(m),D=JSON.parse(x);u({queueName:t.name,template:_,opts:D})}}catch{pr.error("Invalid JSON")}}})})]})}})})})},SS=function(e){var t=e.queue,n=le.queue.pause.useMutation().mutate,r=le.queue.resume.useMutation().mutate,o=le.queue.empty.useMutation().mutate,i=d.useState(!1),a=i[0],s=i[1],l=d.useState(!1),u=l[0],h=l[1],c={queueName:t.name},p=Ke(Ke(Ke(Ke([],t.supports.pause&&t.supports.resume?[{label:t.paused?"Resume":"Pause",onSelect:function(){t.paused?r(c):n(c)},icon:t.paused?y.jsx(w0,{}):y.jsx(x0,{})}]:[],!0),[{label:"Add job",onSelect:function(){s(!0)},icon:y.jsx(uc,{})}],!1),t.supports.schedulers?[{label:"Add scheduler",onSelect:function(){h(!0)},icon:y.jsx(uc,{})}]:[],!0),t.supports.empty?[{label:"Empty",onSelect:function(){o(c)},icon:y.jsx(Gr,{})}]:[],!0);return y.jsxs(y.Fragment,{children:[y.jsx(za,{actions:p}),a?y.jsx(Yd,{queue:t,variant:"job",onDismiss:function(){return s(!1)}}):null,u?y.jsx(Yd,{queue:t,variant:"scheduler",onDismiss:function(){return h(!1)}}):null]})},wg={exports:{}};(function(e,t){(function(r,o){e.exports=o()})(globalThis,()=>(()=>{var n={949:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CronParser=void 0;var u=l(515),h=function(){function c(p,f,g){f===void 0&&(f=!0),g===void 0&&(g=!1),this.expression=p,this.dayOfWeekStartIndexZero=f,this.monthStartIndexZero=g}return c.prototype.parse=function(){var p,f,g=(p=this.expression)!==null&&p!==void 0?p:"";if(g==="@reboot")return f=["@reboot","","","","","",""],f;if(g.startsWith("@")){var m=this.parseSpecial(this.expression);f=this.extractParts(m)}else f=this.extractParts(this.expression);return this.normalize(f),this.validate(f),f},c.prototype.parseSpecial=function(p){var f={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},g=f[p];if(!g)throw new Error("Unknown special expression.");return g},c.prototype.extractParts=function(p){if(!this.expression)throw new Error("cron expression is empty");for(var f=p.trim().split(/[ ]+/),g=0;g<f.length;g++)if(f[g].includes(",")){var m=f[g].split(",").map(function(b){return b.trim()}).filter(function(b){return b!==""}).map(function(b){return isNaN(Number(b))?b:Number(b)}).filter(function(b){return b!==null&&b!==""});m.length===0&&m.push("*"),m.sort(function(b,x){return b!==null&&x!==null?b-x:0}),f[g]=m.map(function(b){return b!==null?b.toString():""}).join(",")}if(f.length<5)throw new Error("Expression has only ".concat(f.length," part").concat(f.length==1?"":"s",". At least 5 parts are required."));if(f.length==5)f.unshift(""),f.push("");else if(f.length==6){var v=/\d{4}$/.test(f[5])||f[4]=="?"||f[2]=="?";v?f.unshift(""):f.push("")}else if(f.length>7)throw new Error("Expression has ".concat(f.length," parts; too many!"));return f},c.prototype.normalize=function(p){var f=this;if(p[3]=p[3].replace("?","*"),p[5]=p[5].replace("?","*"),p[2]=p[2].replace("?","*"),p[0].indexOf("0/")==0&&(p[0]=p[0].replace("0/","*/")),p[1].indexOf("0/")==0&&(p[1]=p[1].replace("0/","*/")),p[2].indexOf("0/")==0&&(p[2]=p[2].replace("0/","*/")),p[3].indexOf("1/")==0&&(p[3]=p[3].replace("1/","*/")),p[4].indexOf("1/")==0&&(p[4]=p[4].replace("1/","*/")),p[6].indexOf("1/")==0&&(p[6]=p[6].replace("1/","*/")),p[5]=p[5].replace(/(^\d)|([^#/\s]\d)/g,function(k){var E=k.replace(/\D/,""),R=E;return f.dayOfWeekStartIndexZero?E=="7"&&(R="0"):R=(parseInt(E)-1).toString(),k.replace(E,R)}),p[5]=="L"&&(p[5]="6"),p[3]=="?"&&(p[3]="*"),p[3].indexOf("W")>-1&&(p[3].indexOf(",")>-1||p[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var g={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var m in g)p[5]=p[5].replace(new RegExp(m,"gi"),g[m].toString());p[4]=p[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(k){var E=k.replace(/\D/,""),R=E;return f.monthStartIndexZero&&(R=(parseInt(E)+1).toString()),k.replace(E,R)});var v={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var b in v)p[4]=p[4].replace(new RegExp(b,"gi"),v[b].toString());p[0]=="0"&&(p[0]=""),!/\*|\-|\,|\//.test(p[2])&&(/\*|\//.test(p[1])||/\*|\//.test(p[0]))&&(p[2]+="-".concat(p[2]));for(var x=0;x<p.length;x++)if(p[x].indexOf(",")!=-1&&(p[x]=p[x].split(",").filter(function(k){return k!==""}).join(",")||"*"),p[x]=="*/1"&&(p[x]="*"),p[x].indexOf("/")>-1&&!/^\*|\-|\,/.test(p[x])){var w=null;switch(x){case 4:w="12";break;case 5:w="6";break;case 6:w="9999";break;default:w=null;break}if(w!==null){var $=p[x].split("/");p[x]="".concat($[0],"-").concat(w,"/").concat($[1])}}},c.prototype.validate=function(p){var f="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(p[0],f),this.validateOnlyExpectedCharactersFound(p[1],f),this.validateOnlyExpectedCharactersFound(p[2],f),this.validateOnlyExpectedCharactersFound(p[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(p[4],f),this.validateOnlyExpectedCharactersFound(p[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(p[6],f),this.validateAnyRanges(p)},c.prototype.validateAnyRanges=function(p){u.default.secondRange(p[0]),u.default.minuteRange(p[1]),u.default.hourRange(p[2]),u.default.dayOfMonthRange(p[3]),u.default.monthRange(p[4],this.monthStartIndexZero),u.default.dayOfWeekRange(p[5],this.dayOfWeekStartIndexZero)},c.prototype.validateOnlyExpectedCharactersFound=function(p,f){var g=p.match(new RegExp("[^".concat(f,"]+"),"gi"));if(g&&g.length)throw new Error("Expression contains invalid values: '".concat(g.toString(),"'"))},c}();s.CronParser=h},333:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExpressionDescriptor=void 0;var u=l(823),h=l(949),c=function(){function p(f,g){if(this.expression=f,this.options=g,this.expressionParts=new Array(5),!this.options.locale&&p.defaultLocale&&(this.options.locale=p.defaultLocale),!p.locales[this.options.locale]){var m=Object.keys(p.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(m,"'.")),this.options.locale=m}this.i18n=p.locales[this.options.locale],g.use24HourTimeFormat===void 0&&(g.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return p.toString=function(f,g){var m=g===void 0?{}:g,v=m.throwExceptionOnParseError,b=v===void 0?!0:v,x=m.verbose,w=x===void 0?!1:x,$=m.dayOfWeekStartIndexZero,k=$===void 0?!0:$,E=m.monthStartIndexZero,R=E===void 0?!1:E,M=m.use24HourTimeFormat,_=m.locale,D=_===void 0?null:_,P={throwExceptionOnParseError:b,verbose:w,dayOfWeekStartIndexZero:k,monthStartIndexZero:R,use24HourTimeFormat:M,locale:D};P.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var I=new p(f,P);return I.getFullDescription()},p.initialize=function(f,g){g===void 0&&(g="en"),p.specialCharacters=["/","-",",","*"],p.defaultLocale=g,f.load(p.locales)},p.prototype.getFullDescription=function(){var f,g,m="";try{var v=new h.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=v.parse(),this.expressionParts[0]==="@reboot")return((g=(f=this.i18n).atReboot)===null||g===void 0?void 0:g.call(f))||"Run once, at startup";var b=this.getTimeOfDayDescription(),x=this.getDayOfMonthDescription(),w=this.getMonthDescription(),$=this.getDayOfWeekDescription(),k=this.getYearDescription();m+=b+x+$+w+k,m=this.transformVerbosity(m,!!this.options.verbose),m=m.charAt(0).toLocaleUpperCase()+m.substr(1)}catch(E){if(!this.options.throwExceptionOnParseError)m=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(E)}return m},p.prototype.getTimeOfDayDescription=function(){var f=this.expressionParts[0],g=this.expressionParts[1],m=this.expressionParts[2],v="";if(!u.StringUtilities.containsAny(g,p.specialCharacters)&&!u.StringUtilities.containsAny(m,p.specialCharacters)&&!u.StringUtilities.containsAny(f,p.specialCharacters))v+=this.i18n.atSpace()+this.formatTime(m,g,f);else if(!f&&g.indexOf("-")>-1&&!(g.indexOf(",")>-1)&&!(g.indexOf("/")>-1)&&!u.StringUtilities.containsAny(m,p.specialCharacters)){var b=g.split("-");v+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(m,b[0],""),this.formatTime(m,b[1],""))}else if(!f&&m.indexOf(",")>-1&&m.indexOf("-")==-1&&m.indexOf("/")==-1&&!u.StringUtilities.containsAny(g,p.specialCharacters)){var x=m.split(",");v+=this.i18n.at();for(var w=0;w<x.length;w++)v+=" ",v+=this.formatTime(x[w],g,""),w<x.length-2&&(v+=","),w==x.length-2&&(v+=this.i18n.spaceAnd())}else{var $=this.getSecondsDescription(),k=this.getMinutesDescription(),E=this.getHoursDescription();if(v+=$,v&&k&&(v+=", "),v+=k,k===E)return v;v&&E&&(v+=", "),v+=E}return v},p.prototype.getSecondsDescription=function(){var f=this,g=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(m){return m},function(m){return u.StringUtilities.format(f.i18n.everyX0Seconds(m),m)},function(m){return f.i18n.secondsX0ThroughX1PastTheMinute()},function(m){return m=="0"?"":parseInt(m)<20?f.i18n.atX0SecondsPastTheMinute(m):f.i18n.atX0SecondsPastTheMinuteGt20()||f.i18n.atX0SecondsPastTheMinute(m)});return g},p.prototype.getMinutesDescription=function(){var f=this,g=this.expressionParts[0],m=this.expressionParts[2],v=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(b){return b},function(b){return u.StringUtilities.format(f.i18n.everyX0Minutes(b),b)},function(b){return f.i18n.minutesX0ThroughX1PastTheHour()},function(b){try{return b=="0"&&m.indexOf("/")==-1&&g==""?f.i18n.everyHour():parseInt(b)<20?f.i18n.atX0MinutesPastTheHour(b):f.i18n.atX0MinutesPastTheHourGt20()||f.i18n.atX0MinutesPastTheHour(b)}catch{return f.i18n.atX0MinutesPastTheHour(b)}});return v},p.prototype.getHoursDescription=function(){var f=this,g=this.expressionParts[2],m=0,v=[];g.split("/")[0].split(",").forEach(function(w){var $=w.split("-");$.length===2&&v.push({value:$[1],index:m+1}),m+=$.length});var b=0,x=this.getSegmentDescription(g,this.i18n.everyHour(),function(w){var $=v.find(function(E){return E.value===w&&E.index===b}),k=$&&f.expressionParts[1]!=="0";return b++,k?f.formatTime(w,"59",""):f.formatTime(w,"0","")},function(w){return u.StringUtilities.format(f.i18n.everyX0Hours(w),w)},function(w){return f.i18n.betweenX0AndX1()},function(w){return f.i18n.atX0()});return x},p.prototype.getDayOfWeekDescription=function(){var f=this,g=this.i18n.daysOfTheWeek(),m=null;return this.expressionParts[5]=="*"?m="":m=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(v,b){var x=v;v.indexOf("#")>-1?x=v.substring(0,v.indexOf("#")):v.indexOf("L")>-1&&(x=x.replace("L",""));var w=parseInt(x),$=f.i18n.daysOfTheWeekInCase?f.i18n.daysOfTheWeekInCase(b)[w]:g[w];if(v.indexOf("#")>-1){var k=null,E=v.substring(v.indexOf("#")+1),R=v.substring(0,v.indexOf("#"));switch(E){case"1":k=f.i18n.first(R);break;case"2":k=f.i18n.second(R);break;case"3":k=f.i18n.third(R);break;case"4":k=f.i18n.fourth(R);break;case"5":k=f.i18n.fifth(R);break}$=k+" "+$}return $},function(v){return parseInt(v)==1?"":u.StringUtilities.format(f.i18n.commaEveryX0DaysOfTheWeek(v),v)},function(v){var b=v.substring(0,v.indexOf("-")),x=f.expressionParts[3]!="*";return x?f.i18n.commaAndX0ThroughX1(b):f.i18n.commaX0ThroughX1(b)},function(v){var b=null;if(v.indexOf("#")>-1){var x=v.substring(v.indexOf("#")+1),w=v.substring(0,v.indexOf("#"));b=f.i18n.commaOnThe(x,w).trim()+f.i18n.spaceX0OfTheMonth()}else if(v.indexOf("L")>-1)b=f.i18n.commaOnTheLastX0OfTheMonth(v.replace("L",""));else{var $=f.expressionParts[3]!="*";b=$?f.i18n.commaAndOnX0():f.i18n.commaOnlyOnX0(v)}return b}),m},p.prototype.getMonthDescription=function(){var f=this,g=this.i18n.monthsOfTheYear(),m=this.getSegmentDescription(this.expressionParts[4],"",function(v,b){return b&&f.i18n.monthsOfTheYearInCase?f.i18n.monthsOfTheYearInCase(b)[parseInt(v)-1]:g[parseInt(v)-1]},function(v){return parseInt(v)==1?"":u.StringUtilities.format(f.i18n.commaEveryX0Months(v),v)},function(v){return f.i18n.commaMonthX0ThroughMonthX1()||f.i18n.commaX0ThroughX1()},function(v){return f.i18n.commaOnlyInMonthX0?f.i18n.commaOnlyInMonthX0():f.i18n.commaOnlyInX0()});return m},p.prototype.getDayOfMonthDescription=function(){var f=this,g=null,m=this.expressionParts[3];switch(m){case"L":g=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":g=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var v=m.match(/(\d{1,2}W)|(W\d{1,2})/);if(v){var b=parseInt(v[0].replace("W","")),x=b==1?this.i18n.firstWeekday():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),b.toString());g=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),x);break}else{var w=m.match(/L-(\d{1,2})/);if(w){var $=w[1];g=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth($),$);break}else{if(m=="*"&&this.expressionParts[5]!="*")return"";g=this.getSegmentDescription(m,this.i18n.commaEveryDay(),function(k){return k=="L"?f.i18n.lastDay():f.i18n.dayX0?u.StringUtilities.format(f.i18n.dayX0(),k):k},function(k){return k=="1"?f.i18n.commaEveryDay():f.i18n.commaEveryX0Days(k)},function(k){return f.i18n.commaBetweenDayX0AndX1OfTheMonth(k)},function(k){return f.i18n.commaOnDayX0OfTheMonth(k)})}break}}return g},p.prototype.getYearDescription=function(){var f=this,g=this.getSegmentDescription(this.expressionParts[6],"",function(m){return/^\d+$/.test(m)?new Date(parseInt(m),1).getFullYear().toString():m},function(m){return u.StringUtilities.format(f.i18n.commaEveryX0Years(m),m)},function(m){return f.i18n.commaYearX0ThroughYearX1()||f.i18n.commaX0ThroughX1()},function(m){return f.i18n.commaOnlyInYearX0?f.i18n.commaOnlyInYearX0():f.i18n.commaOnlyInX0()});return g},p.prototype.getSegmentDescription=function(f,g,m,v,b,x){var w=null,$=f.indexOf("/")>-1,k=f.indexOf("-")>-1,E=f.indexOf(",")>-1;if(!f)w="";else if(f==="*")w=g;else if(!$&&!k&&!E)w=u.StringUtilities.format(x(f),m(f));else if(E){for(var R=f.split(","),M="",_=0;_<R.length;_++)if(_>0&&R.length>2&&(M+=",",_<R.length-1&&(M+=" ")),_>0&&R.length>1&&(_==R.length-1||R.length==2)&&(M+="".concat(this.i18n.spaceAnd()," ")),R[_].indexOf("/")>-1||R[_].indexOf("-")>-1){var D=R[_].indexOf("-")>-1&&R[_].indexOf("/")==-1,P=this.getSegmentDescription(R[_],g,m,v,D?this.i18n.commaX0ThroughX1:b,x);D&&(P=P.replace(", ","")),M+=P}else $?M+=this.getSegmentDescription(R[_],g,m,v,b,x):M+=m(R[_]);$?w=M:w=u.StringUtilities.format(x(f),M)}else if($){var R=f.split("/");if(w=u.StringUtilities.format(v(R[1]),R[1]),R[0].indexOf("-")>-1){var I=this.generateRangeSegmentDescription(R[0],b,m);I.indexOf(", ")!=0&&(w+=", "),w+=I}else if(R[0].indexOf("*")==-1){var N=u.StringUtilities.format(x(R[0]),m(R[0]));N=N.replace(", ",""),w+=u.StringUtilities.format(this.i18n.commaStartingX0(),N)}}else k&&(w=this.generateRangeSegmentDescription(f,b,m));return w},p.prototype.generateRangeSegmentDescription=function(f,g,m){var v="",b=f.split("-"),x=m(b[0],1),w=m(b[1],2),$=g(f);return v+=u.StringUtilities.format($,x,w),v},p.prototype.formatTime=function(f,g,m){var v=0,b=0,x=parseInt(f)+v,w=parseInt(g)+b;w>=60?(w-=60,x+=1):w<0&&(w+=60,x-=1),x>=24?x=x-24:x<0&&(x=24+x);var $="",k=!1;this.options.use24HourTimeFormat||(k=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),$=k?"".concat(this.getPeriod(x)," "):" ".concat(this.getPeriod(x)),x>12&&(x-=12),x===0&&(x=12));var E="";return m&&(E=":".concat(("00"+m).substring(m.length))),"".concat(k?$:"").concat(("00"+x.toString()).substring(x.toString().length),":").concat(("00"+w.toString()).substring(w.toString().length)).concat(E).concat(k?"":$)},p.prototype.transformVerbosity=function(f,g){if(!g&&(f=f.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),f=f.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),f=f.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),f=f.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var m=0,v=Object.entries(this.i18n.conciseVerbosityReplacements());m<v.length;m++){var b=v[m],x=b[0],w=b[1];f=f.replace(new RegExp(x,"g"),w)}return f},p.prototype.getPeriod=function(f){return f>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},p.locales={},p}();s.ExpressionDescriptor=c},747:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.enLocaleLoader=void 0;var u=l(486),h=function(){function c(){}return c.prototype.load=function(p){p.en=new u.en},c}();s.enLocaleLoader=h},486:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.en=void 0;var l=function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u}();s.en=l},515:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0});function l(h,c){if(!h)throw new Error(c)}var u=function(){function h(){}return h.secondRange=function(c){for(var p=c.split(","),f=0;f<p.length;f++)if(!isNaN(parseInt(p[f],10))){var g=parseInt(p[f],10);l(g>=0&&g<=59,"seconds part must be >= 0 and <= 59")}},h.minuteRange=function(c){for(var p=c.split(","),f=0;f<p.length;f++)if(!isNaN(parseInt(p[f],10))){var g=parseInt(p[f],10);l(g>=0&&g<=59,"minutes part must be >= 0 and <= 59")}},h.hourRange=function(c){for(var p=c.split(","),f=0;f<p.length;f++)if(!isNaN(parseInt(p[f],10))){var g=parseInt(p[f],10);l(g>=0&&g<=23,"hours part must be >= 0 and <= 23")}},h.dayOfMonthRange=function(c){for(var p=c.split(","),f=0;f<p.length;f++)if(!isNaN(parseInt(p[f],10))){var g=parseInt(p[f],10);l(g>=1&&g<=31,"DOM part must be >= 1 and <= 31")}},h.monthRange=function(c,p){for(var f=c.split(","),g=0;g<f.length;g++)if(!isNaN(parseInt(f[g],10))){var m=parseInt(f[g],10);l(m>=1&&m<=12,p?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},h.dayOfWeekRange=function(c,p){for(var f=c.split(","),g=0;g<f.length;g++)if(!isNaN(parseInt(f[g],10))){var m=parseInt(f[g],10);l(m>=0&&m<=6,p?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},h}();s.default=u},823:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.StringUtilities=void 0;var l=function(){function u(){}return u.format=function(h){for(var c=[],p=1;p<arguments.length;p++)c[p-1]=arguments[p];return h.replace(/%s/g,function(f){return c.shift()})},u.containsAny=function(h,c){return c.some(function(p){return h.indexOf(p)>-1})},u}();s.StringUtilities=l}},r={};function o(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,o),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.toString=void 0;var s=o(333),l=o(747);s.ExpressionDescriptor.initialize(new l.enLocaleLoader),a.default=s.ExpressionDescriptor;var u=s.ExpressionDescriptor.toString;a.toString=u})(),i})())})(wg);var ES=wg.exports;const PS=cf(ES);var RS=function(e){var t=e.scheduler,n=e.queueName,r=e.onRemove,o=le.scheduler.remove.useMutation(),i=o.mutate,a=o.isSuccess;return d.useEffect(function(){a&&(r==null||r())},[a,r]),y.jsx(za,{actions:[{label:"Remove",onSelect:function(){i({queueName:n,jobSchedulerId:t.key})},icon:y.jsx(Gr,{})}]})},kS=function(e){var t=e.scheduler,n=e.queueName,r=e.onDismiss,o=t.template,i=Nr({},t);return delete i.template,y.jsx(Ba,{isOpen:!0,isDismissable:!0,onOpenChange:function(a){a||r()},className:"fixed inset-0 bg-black/20 dark:bg-black/40",children:y.jsx(Aa,{className:"fixed left-1/2 top-1/2 max-h-[85vh] w-full max-w-xl -translate-x-1/2 -translate-y-1/2 overflow-y-scroll rounded-lg bg-white p-4 shadow-xl dark:bg-slate-900",children:function(a){var s=a.close;return y.jsxs(y.Fragment,{children:[y.jsx("button",{className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-full text-slate-500 transition duration-150 ease-in-out hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800","aria-label":"Close",onClick:function(){r(),s()},children:y.jsx(Jl,{})}),y.jsxs("div",{className:"flex items-center space-x-4",children:[y.jsxs(Ka,{className:"mb-1 flex items-center space-x-2",children:[y.jsx("span",{className:"text-xl font-semibold text-slate-900 dark:text-slate-100",children:t.name}),y.jsxs("span",{className:"rounded-md text-slate-500 dark:text-slate-400",children:["#",t.id]})]}),y.jsx(RS,{queueName:n,scheduler:t,onRemove:r})]}),y.jsxs("div",{children:[y.jsxs("div",{className:"space-y-2 border-b border-b-slate-200 py-4 dark:border-b-slate-700",children:[y.jsx("p",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Options"}),y.jsx("div",{className:"data-json-renderer [&>ul]:max-h-[400px]",children:y.jsx(ba,{data:i,theme:"monokai"})})]}),y.jsxs("div",{className:"space-y-2 pt-4",children:[y.jsx("p",{className:"text-xs font-semibold uppercase text-slate-600 dark:text-slate-400",children:"Template"}),y.jsx("div",{className:"data-json-renderer [&>ul]:max-h-[400px]",children:y.jsx(ba,{data:o,theme:"monokai"})})]})]})]})}})})},Di=a1();function MS(e,t){t===void 0&&(t=new Date);var n=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"short"}),r=n.formatToParts(t),o=r.find(function(i){return i.type==="timeZoneName"});return(o==null?void 0:o.value)||""}var OS=function(e){return[Di.display({id:"select",header:function(t){var n=t.table;return y.jsx(ca,{checked:n.getIsSomeRowsSelected()?"indeterminate":n.getIsAllRowsSelected(),onCheckedChange:function(){n.toggleAllRowsSelected()}})},cell:function(t){var n=t.row,r=t.table;return y.jsx(ca,{className:r.getIsSomeRowsSelected()||r.getIsAllRowsSelected()?"":"opacity-0 transition group-hover:opacity-100",checked:n.getIsSomeSelected()?"indeterminate":n.getIsSelected(),onCheckedChange:function(o){n.getToggleSelectedHandler()(o),e(n.index)}})}}),Di.accessor("name",{cell:function(t){return y.jsx("div",{className:"flex w-full items-center space-x-2",children:y.jsx("span",{className:"max-w-fit grow basis-full truncate text-slate-900 dark:text-slate-200",children:t.cell.row.original.name})})},header:"Scheduler"}),Di.accessor("pattern",{cell:function(t){return y.jsxs("span",{className:"grow basis-full truncate text-slate-900 dark:text-slate-200",children:[t.cell.row.original.pattern?PS.toString(t.cell.row.original.pattern,{verbose:!0}):t.cell.row.original.every?"Every ".concat(t.cell.row.original.every):""," ",t.cell.row.original.tz?"(".concat(MS(t.cell.row.original.tz),")"):""]})},header:"Pattern"}),Di.accessor("next",{cell:function(t){return t.cell.row.original.next?y.jsx(Ru,{message:$1(new Date(t.cell.row.original.next),"dd MMM yyyy HH:mm:ss zzz"),children:y.jsx("div",{className:"flex items-center space-x-1.5",children:y.jsxs("p",{className:"text-slate-900 dark:text-slate-200",children:["In ",S1(new Date(t.cell.row.original.next))," ",y.jsxs("span",{className:"text-sm text-slate-700 dark:text-slate-400",children:["(",t.cell.row.original.iterationCount," run",t.cell.row.original.iterationCount===1?"":"s"," total)"]})]})})}):y.jsx("p",{className:"text-slate-900 dark:text-slate-200",children:"No next run"})},header:"Next Run"})]},TS=function(e){var t=e.queueName,n=d.useState({}),r=n[0],o=n[1],i=d.useRef(null),a=le.scheduler.list.useQuery({queueName:t}),s=a.data,l=a.isLoading,u=(s==null?void 0:s.length)===0,h=function(x){i.current=x},c=OS(h),p=v1({data:s||[],columns:c,getCoreRowModel:m1(),state:{rowSelection:r},onRowSelectionChange:o}),f=d.useState(null),g=f[0],m=f[1],v=le.scheduler.bulkRemove.useMutation().mutate,b=function(x,w){if(x.shiftKey&&i.current!==null){x.preventDefault();for(var $=Math.min(i.current,w),k=Math.max(i.current,w),E=Nr({},r),R=$;R<=k;R++)E[R]=!0;o(E)}else m(p.getRowModel().rows[w].original),i.current=w};return!l&&u?null:y.jsxs("div",{children:[g?y.jsx(kS,{scheduler:g,queueName:t,onDismiss:function(){return m(null)}}):null,y.jsx("div",{className:"rounded-md border border-slate-200 shadow-sm dark:border-slate-700",children:l?y.jsx(P1,{}):y.jsxs("div",{children:[p.getHeaderGroups().map(function(x,w){return y.jsx("div",{className:"sticky top-0 grid grid-cols-[auto,350px,1fr,1fr] rounded-t-md border-b border-slate-200 bg-slate-100/50 p-2 backdrop-blur-md dark:border-slate-700 dark:bg-slate-900/50",children:x.headers.map(function($){return y.jsx("div",{className:"flex h-full items-center text-sm font-semibold text-slate-700 dark:text-slate-300 ".concat(w!==0?"pr-10":"pr-3"),children:$.isPlaceholder?null:aa($.column.columnDef.header,$.getContext())},$.id)})},x.id)}),p.getRowModel().rows.map(function(x,w){return y.jsx(E1,{isLastRow:p.getRowModel().rows.length!==w+1,isSelected:x.getIsSelected(),onClick:function($){return b($,w)},layoutVariant:"scheduler",children:x.getVisibleCells().map(function($,k){return y.jsx("div",{className:"flex h-full items-center ".concat(k!==0?"pr-10":"pr-3"),children:aa($.column.columnDef.cell,$.getContext())},$.id)})},x.id)})]})}),p.getSelectedRowModel().rows.length>0?y.jsx("div",{className:"pointer-events-none sticky bottom-0 flex w-full items-center justify-center pb-5",children:y.jsxs("div",{className:"pointer-events-auto flex items-center space-x-3 rounded-lg border-slate-100 bg-white/90 px-3 py-2 text-sm shadow-lg backdrop-blur dark:border-slate-700 dark:bg-slate-900/90",children:[y.jsxs("p",{className:"text-slate-900 dark:text-slate-100",children:[p.getSelectedRowModel().rows.length," selected"]}),y.jsx(Cn,{label:"Delete",colorScheme:"red",icon:y.jsx(Gr,{}),size:"sm",onClick:function(){v({queueName:t,jobSchedulerIds:p.getSelectedRowModel().rows.map(function(x){return x.original.key})}),p.resetRowSelection()}})]})}):null]})},_i=function(e){var t=e.label,n=e.value,r=e.trend,o=e.variant,i=o===void 0?"completed":o,a=i==="completed"?r!=null&&r.isPositive?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400":r!=null&&r.isPositive?"text-red-600 dark:text-red-400":"text-green-600 dark:text-green-400";return y.jsxs("div",{className:"group flex flex-col space-y-2 rounded-xl border border-slate-200/80 bg-white/80 px-4 py-3 backdrop-blur-sm transition-all duration-200 hover:border-slate-300 hover:shadow-sm dark:border-slate-700/50 dark:bg-slate-900/50 dark:hover:border-slate-600",children:[y.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t}),y.jsxs("div",{className:"flex items-baseline space-x-2",children:[y.jsx("p",{className:"font-mono text-2xl font-semibold tabular-nums leading-none text-slate-900 dark:text-slate-50",children:typeof n=="number"?n.toLocaleString():n}),r&&y.jsxs("div",{className:"flex items-center space-x-0.5 font-mono text-xs font-medium ".concat(a),children:[r.isPositive?y.jsx(g2,{width:11,height:11}):y.jsx(h2,{width:11,height:11}),y.jsxs("span",{children:[Math.abs(r.value),"%"]})]})]})]})},cr={"1m":{label:"Last minute",minutes:1},"1h":{label:"Last hour",minutes:60},"24h":{label:"Last 24 hours",minutes:1440},"7d":{label:"Last 7 days",minutes:10080}},DS=function(e){var t=e.queueName,n=d.useState("1h"),r=n[0],o=n[1],i=le.queue.metrics.useQuery({queueName:t,type:"completed",start:0,end:cr[r].minutes},{enabled:!!t,refetchInterval:Io}),a=i.data,s=i.isLoading,l=le.queue.metrics.useQuery({queueName:t,type:"failed",start:0,end:cr[r].minutes},{enabled:!!t,refetchInterval:Io}),u=l.data,h=l.isLoading,c=s||h,p=function(b,x){if(x===0)return null;var w=(b-x)/x*100;return{value:Math.round(Math.abs(w)),isPositive:w>0}},f=a&&p(a.count,a.meta.prevCount),g=u&&p(u.count,u.meta.prevCount),m=a?(a.count/cr[r].minutes).toFixed(1):"0";u&&(u.count/cr[r].minutes).toFixed(1);var v=a&&u?a.count+u.count>0?(a.count/(a.count+u.count)*100).toFixed(1):"100":"0";return y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("h2",{className:"text-lg font-semibold tracking-tight text-slate-900 dark:text-slate-50",children:"Metrics"}),y.jsx("div",{className:"flex items-center space-x-0.5 rounded-lg border border-slate-200/80 bg-white/80 p-0.5 backdrop-blur-sm dark:border-slate-700/50 dark:bg-slate-900/50",children:Object.keys(cr).map(function(b){return y.jsx("button",{onClick:function(){return o(b)},className:"rounded-md px-2.5 py-1 text-xs font-medium transition-all duration-150 ".concat(r===b?"bg-slate-100 text-slate-900 shadow-sm dark:bg-slate-800 dark:text-slate-100":"text-slate-600 hover:bg-slate-50 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/50 dark:hover:text-slate-100"),children:cr[b].label},b)})})]}),c?y.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:Ke([],Array(4),!0).map(function(b,x){return y.jsx(Mo,{className:"h-[88px] rounded-xl"},x)})}):y.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[y.jsx(_i,{label:"Completed",value:(a==null?void 0:a.count)||0,trend:f||void 0,variant:"completed"}),y.jsx(_i,{label:"Failed",value:(u==null?void 0:u.count)||0,trend:g||void 0,variant:"failed"}),y.jsx(_i,{label:"Success Rate",value:"".concat(v,"%")}),y.jsx(_i,{label:"Throughput",value:"".concat(m,"/min")})]})]})},Ds=new Intl.NumberFormat("en-US").format,_S=function(){var e,t,n,r,o,i=vb().id,a=i,s=a2()[0],l=d.useState("completed"),u=l[0],h=l[1],c=le.job.list.useInfiniteQuery({queueName:a,limit:Dl,status:u},{getNextPageParam:function($){return $.nextCursor},enabled:!!a,refetchInterval:Io,retry:_l}),p=c.data,f=c.fetchNextPage,g=c.isLoading,m=c.isError,v=c.isFetchingNextPage,b=c.hasNextPage;d.useEffect(function(){var $=s.get("status");$&&h($),!$&&u&&h("completed")},[s,u]);var x=le.queue.byName.useQuery({queueName:a},{enabled:!!a,refetchInterval:Io,retry:_l}),w=(e=p==null?void 0:p.pages.map(function($){return $.jobs}).flat())!==null&&e!==void 0?e:[];return y.jsx(i1,{children:x.data===null?y.jsx(El,{message:"No queue found"}):m?y.jsx(El,{message:"Could not fetch jobs"}):y.jsxs("div",{children:[y.jsx("div",{className:"mb-2 flex justify-between",children:y.jsxs("div",{className:"flex items-center space-x-4",children:[y.jsx("h1",{className:"text-2xl font-bold text-slate-900 dark:text-slate-50",children:x.data?x.data.displayName:y.jsx(Mo,{className:"h-8 w-52 rounded-md"})}),y.jsxs("div",{className:"flex items-center space-x-2",children:[x.data?y.jsx(SS,{queue:x.data}):null,!((t=x.data)===null||t===void 0)&&t.paused?y.jsx("div",{className:"flex h-7 cursor-default items-center justify-center space-x-1.5 rounded-md bg-yellow-50 px-2 text-sm font-medium text-yellow-900 transition duration-150 ease-in-out dark:bg-yellow-950/30 dark:text-yellow-400",children:y.jsx("span",{children:"Paused"})}):null]})]})}),y.jsx("div",{className:"mb-5",children:y.jsx("div",{className:"flex items-center space-x-2",children:x.data?y.jsxs(y.Fragment,{children:[y.jsxs("p",{className:"text-slate-600 dark:text-slate-400",children:[y.jsxs("span",{className:"text-green-800 dark:text-green-400",children:[Ds(x.data.client.connectedClients)," ","connected"]})," ","and"," ",y.jsxs("span",{className:"text-red-800 dark:text-red-400",children:[Ds(x.data.client.blockedClients)," ","blocked"]})," ","out of"," ",y.jsxs("span",{className:"text-slate-900 dark:text-slate-100",children:[Ds(x.data.client.maxClients)," max clients"]})]}),y.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"·"}),y.jsxs("p",{className:"text-slate-600 dark:text-slate-400",children:[x.data.client.usedMemoryHuman," /"," ",x.data.client.totalMemoryHuman," (",(x.data.client.usedMemoryPercentage*100).toFixed(2),"%)"]}),y.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"·"}),y.jsxs("p",{className:"text-slate-600 dark:text-slate-400",children:["Redis v",x.data.client.version]})]}):y.jsx(Mo,{className:"h-6 w-80"})})}),y.jsxs("div",{className:"space-y-8",children:[!((n=x.data)===null||n===void 0)&&n.supports.metrics?y.jsx(DS,{queueName:a}):null,!((r=x.data)===null||r===void 0)&&r.supports.schedulers?y.jsx(TS,{queueName:a}):null,y.jsxs("div",{className:"space-y-4",children:[y.jsx(p$,{showCleanAllButton:w.length>0,queueName:a,status:u,queue:x.data}),y.jsx(AC,{onBottomInView:function(){v||!b||f()},status:u,totalJobs:((o=p==null?void 0:p.pages.at(-1))===null||o===void 0?void 0:o.totalCount)||0,jobs:w.map(function($){return Nr(Nr({},$),{status:u})}),isLoading:g,isFetchingNextPage:v,queueName:a})]})]})]})})},Fi=function(e){var t=e.count,n=e.variant,r={active:"text-cyan-600 dark:text-cyan-400",completed:"text-green-600 dark:text-green-400",failed:"text-red-600 dark:text-red-400",waiting:"text-amber-600 dark:text-amber-400"},o={active:y.jsx(C0,{width:16,height:16}),completed:y.jsx(b0,{width:16,height:16}),failed:y.jsx(y0,{width:16,height:16}),waiting:y.jsx(z2,{width:16,height:16})};return y.jsx("div",{children:y.jsx(Ru,{message:n.charAt(0).toUpperCase()+n.slice(1),children:y.jsxs("div",{className:"flex items-center space-x-1 text-sm ".concat(r[n]),children:[y.jsx("p",{className:"text-lg",children:t}),o[n]]})})})},FS=function(e){var t=e.queueName,n=le.queue.byName.useQuery({queueName:t},{refetchInterval:Io,retry:_l});return n.data?y.jsxs(ka,{to:"../".concat(n.data.name),className:"group flex items-center justify-between transition",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx("p",{className:"py-3 text-lg font-medium text-slate-900 transition group-hover:text-brand-900 dark:text-slate-200 dark:group-hover:text-brand-100",children:n.data.displayName}),y.jsx("div",{children:n.data.paused?y.jsx("div",{className:"flex h-7 items-center justify-center space-x-1.5 rounded-md bg-yellow-50 px-2 text-sm font-medium text-yellow-900 transition duration-150 ease-in-out dark:bg-yellow-950/30 dark:text-yellow-400",children:y.jsx("span",{children:"Paused"})}):null})]}),y.jsxs("div",{className:"flex space-x-5",children:[y.jsx(Fi,{count:n.data.counts.completed,variant:"completed"}),y.jsx(Fi,{count:n.data.counts.failed,variant:"failed"}),y.jsx(Fi,{count:n.data.counts.active,variant:"active"}),y.jsx(Fi,{count:n.data.counts.waiting,variant:"waiting"})]})]}):null},LS=function(){var e=le.queue.list.useQuery().data,t=le.queue.pauseAll.useMutation().mutate,n=le.queue.resumeAll.useMutation().mutate;return y.jsx(i1,{children:y.jsxs("div",{className:"xl:max-w-2xl",children:[y.jsxs("div",{className:"flex justify-between",children:[y.jsx("h1",{className:"mb-6 text-2xl font-bold text-slate-900 dark:text-slate-50",children:"Queues"}),y.jsx("div",{children:y.jsx(za,{actions:[{label:"Resume all",icon:y.jsx(w0,{}),onSelect:function(){return n()}},{label:"Pause all",icon:y.jsx(x0,{}),onSelect:function(){return t()}}]})})]}),y.jsx("div",{children:e==null?void 0:e.map(function(r,o){return y.jsx("div",{className:(e==null?void 0:e.length)-1!==o?"border-b border-slate-100 dark:border-slate-700":"",children:y.jsx(FS,{queueName:r.name},r.name)},r.name)})})]})})},IS=function(e){var t=e.apiUrl,n=e.basename,r=d.useState(!1),o=r[0],i=r[1],a=d.useState(function(){return new om})[0],s=d.useState(function(){return le.createClient({links:[Jm({url:t})]})})[0];return d.useEffect(function(){var l=JSON.parse(localStorage.getItem("user-preferences")||"null");l?l.theme==="dark"||l.theme==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),i(!0)},[]),o?y.jsx(le.Provider,{client:s,queryClient:a,children:y.jsxs(im,{client:a,children:[y.jsx(h$,{}),y.jsx(n2,{basename:n,children:y.jsxs(Db,{children:[y.jsx(rl,{path:"/",element:y.jsx(LS,{})}),y.jsx(rl,{path:"/:id",element:y.jsx(_S,{})})]})})]})}):null};exports.QueueDashApp=IS;
|