@qratilabs/qrati-connect 2.15.0 → 2.16.0
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/CHANGELOG.md +9 -0
- package/element/{CWJf7mNz.js → BI8RhPVM.js} +1 -1
- package/element/{BeBNT9RQ.js → BhtZwJ7r.js} +1 -1
- package/element/{CMtkKIjI.js → BvDw8z0o.js} +1 -1
- package/element/{Bez3GA8y.js → CEsBzi55.js} +1 -1
- package/element/{BPD6evHs.js → CwqB3rqe.js} +1 -1
- package/element/{CNGkJRCP.js → Cy3iV9XH.js} +1 -1
- package/element/{FXirOp_Y.js → D0tOl2TC.js} +1 -1
- package/element/{BHwNoqYe.js → DAitYRY4.js} +1 -1
- package/element/{BQBx6JI7.js → Dlyq91q9.js} +1 -1
- package/element/{Bu-H5iRE.js → DuIwDwan.js} +1 -1
- package/element/{19c52mJB.js → MZuQhFbV.js} +1 -1
- package/element/{BU70X6zI.js → VGPc4EeK.js} +1 -1
- package/element/{t1REK11Z.js → jL1IhEDX.js} +3 -3
- package/element/web.es.js +3 -3
- package/package.json +1 -1
- package/react/{DCz37sa7.js → B8OuOa1d.js} +1 -1
- package/react/{CDiSbuj_.js → BG6d9dt3.js} +1 -1
- package/react/{CcGfpCV3.js → BiTDkR5y.js} +1 -1
- package/react/{CHSr2RxR.js → BkeCKRKb.js} +1 -1
- package/react/{BMzYiAN3.js → BlGHB1od.js} +1 -1
- package/react/{Cgm2azyl.js → BltPktiy.js} +1 -1
- package/react/{DvzgEfqA.js → C77XJYNh.js} +1 -1
- package/react/{DqVfSNOG.js → CPM5coLp.js} +1 -1
- package/react/CSHWW4FM.js +1 -0
- package/react/{B5em30k0.js → CY68wh8z.js} +1 -1
- package/react/{BJvO-E_0.js → CYntO9YI.js} +1 -1
- package/react/{TRIgeGAL.js → CZ9RIEEO.js} +1 -1
- package/react/{B100IxcO.js → D1CJDHfi.js} +1 -1
- package/react/{B1c5Cjsd.js → D9p5klRz.js} +1 -1
- package/react/{BB-zGb6J.js → DCS0HdZa.js} +1 -1
- package/react/{CX_Vz15p.js → DF_cfEUO.js} +1 -1
- package/react/DQVgvgo2.js +6 -0
- package/react/{D_KoEU5i.js → DVJkpJ9-.js} +1 -1
- package/react/{BlSQ-ODL.js → DXEzKDRE.js} +1 -1
- package/react/{DQWXCdfm.js → DZhlx4rT.js} +1 -1
- package/react/{DPezSfU3.js → D_47D6ly.js} +1 -1
- package/react/{eCa9bk8E.js → O7eIZSmq.js} +1 -1
- package/react/{BmbdEikc.js → P53QlFG0.js} +1 -1
- package/react/index.cjs +1 -1
- package/react/index.mjs +3 -3
- package/react/{EJU6024p.js → k7mNnMH1.js} +1 -1
- package/react/{CojsvC2N.js → vcPA0j_c.js} +3 -3
- package/react/{CB5M-zWX.js → yWdl62rI.js} +1 -1
- package/umd/web.umd.js +1 -1
- package/react/BsUU5VBO.js +0 -6
- package/react/JLXrD6OW.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,D as t,E as r,M as n,N as s,O as o,P as i,S as a,T as c,_ as l,b as u,f as h,g as d,h as p,k as f,p as y,v as m,y as g}from"./BsUU5VBO.js";import*as v from"react";import{jsx as w}from"react/jsx-runtime";var b=class{constructor(){this.listeners=/* @__PURE__ */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(){}},_=new class extends b{#e;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},E={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},R=new class{#n=E;#s=!1;setTimeoutProvider(e){"production"!==process.env.NODE_ENV&&this.#s&&e!==this.#n&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#n,provider:e}),this.#n=e,"production"!==process.env.NODE_ENV&&(this.#s=!1)}setTimeout(e,t){return"production"!==process.env.NODE_ENV&&(this.#s=!0),this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return"production"!==process.env.NODE_ENV&&(this.#s=!0),this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},S="undefined"==typeof window||"Deno"in globalThis;function T(){}function O(e,t){return"function"==typeof e?e(t):e}function A(e){return"number"==typeof e&&e>=0&&e!==1/0}function I(e,t){return Math.max(e+(t||0)-Date.now(),0)}function C(e,t){return"function"==typeof e?e(t):e}function N(e,t){return"function"==typeof e?e(t):e}function P(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i)if(n){if(t.queryHash!==x(i,t.options))return!1}else if(!L(t.queryKey,i))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function D(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(q(t.options.mutationKey)!==q(o))return!1}else if(!L(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function x(e,t){return(t?.queryKeyHashFn||q)(e)}function q(e){return JSON.stringify(e,(e,t)=>j(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function L(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>L(e[r],t[r]))}var U=Object.prototype.hasOwnProperty;function k(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=F(e)&&F(t);if(!(n||j(e)&&j(t)))return t;const s=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),i=o.length,a=n?new Array(i):{};let c=0;for(let l=0;l<i;l++){const i=n?l:o[l],u=e[i],h=t[i];if(u===h){a[i]=u,(n?l<s:U.call(e,i))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[i]=h;continue}const d=k(u,h,r+1);a[i]=d,d===u&&c++}return s===i&&c===s?e:a}function M(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function F(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function j(e){if(!V(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!V(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function V(e){return"[object Object]"===Object.prototype.toString.call(e)}function $(e,t,r){if("function"==typeof r.structuralSharing)return r.structuralSharing(e,t);if(!1!==r.structuralSharing){if("production"!==process.env.NODE_ENV)try{return k(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return k(e,t)}return t}function G(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Q(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var H=/* @__PURE__ */Symbol();function W(e,t){return"production"!==process.env.NODE_ENV&&e.queryFn===H&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==H?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function z(e,t){return"function"==typeof e?e(...t):!!e}function B(e,t,r){let n,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),s||(s=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}var Z=/* @__PURE__ */(()=>{let e=()=>S;return{isServer:()=>e(),setIsServer(t){e=t}}})();function K(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}var J=function(e){setTimeout(e,0)},Y=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},s=J;const o=n=>{t?e.push(n):s(()=>{r(n)})};return{batch:o=>{let i;t++;try{i=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&s(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{s=e}}}(),X=new class extends b{#o=!0;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};function ee(e){return Math.min(1e3*2**e,3e4)}function te(e){return"online"!==(e??"online")||X.isOnline()}var re=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ne(e){let t,r=!1,n=0;const s=K(),o=()=>"pending"!==s.status,i=()=>_.isFocused()&&("always"===e.networkMode||X.isOnline())&&e.canRun(),a=()=>te(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),s.resolve(e))},l=e=>{o()||(t?.(),s.reject(e))},u=()=>new Promise(r=>{t=e=>{(o()||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let t;const s=0===n?e.initialPromise:void 0;try{t=s??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(o())return;const s=e.retry??(Z.isServer()?0:3),a=e.retryDelay??ee,c="function"==typeof a?a(n,t):a,d=!0===s||"number"==typeof s&&n<s||"function"==typeof s&&s(n,t);var p;!r&&d?(n++,e.onFail?.(n,t),(p=c,new Promise(e=>{R.setTimeout(e,p)})).then(()=>i()?void 0:u()).then(()=>{r?l(t):h()})):l(t)})};return{promise:s,status:()=>s.status,cancel:t=>{if(!o()){const r=new re(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),s),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?h():u().then(h),s)}}var se=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),A(this.gcTime)&&(this.#i=R.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Z.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#i&&(R.clearTimeout(this.#i),this.#i=void 0)}},oe=class extends se{#a;#c;#l;#u;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#l=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=ce(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=ce(this.options);void 0!==e.data&&(this.setState(ae(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,t){const r=$(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#h?.promise;return this.#h?.cancel(e),t?t.then(T).catch(T):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#a}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==N(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===H||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===C(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!I(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p||this.#y()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#h?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}"production"!==process.env.NODE_ENV&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},s=()=>{const e=W(this.options,t),r=(()=>{const e={client:this.#u,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:s};return n(e),e})();this.options.behavior?.onFetch(o,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#f({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=ne({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof re&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const e=await this.#h.start();if(void 0===e)throw"production"!==process.env.NODE_ENV&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(i){if(i instanceof re){if(i.silent)return this.#h.promise;if(i.revert){if(void 0===this.state.data)throw i;return this.state.data}}throw this.#f({type:"error",error:i}),this.#l.config.onError?.(i,this),this.#l.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...ie(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ae(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?r:void 0,r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),Y.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function ie(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:te(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ae(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ce(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var le=class extends b{constructor(e,t){super(),this.options=t,this.#u=e,this.#m=null,this.#g=K(),this.bindMethods(),this.setOptions(t)}#u;#v=void 0;#w=void 0;#b=void 0;#_;#E;#g;#m;#R;#S;#T;#O;#A;#I;#C=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#v.addObserver(this),ue(this.#v,this.options)?this.#N():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return he(this.#v,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return he(this.#v,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#D(),this.#x(),this.#v.removeObserver(this)}setOptions(e){const t=this.options,r=this.#v;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof N(this.options.enabled,this.#v))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#v.setOptions(this.options),t._defaulted&&!M(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#v,observer:this});const n=this.hasListeners();n&&de(this.#v,r,this.options,t)&&this.#N(),this.updateResult(),!n||this.#v===r&&N(this.options.enabled,this.#v)===N(t.enabled,this.#v)&&C(this.options.staleTime,this.#v)===C(t.staleTime,this.#v)||this.#L();const s=this.#U();!n||this.#v===r&&N(this.options.enabled,this.#v)===N(t.enabled,this.#v)&&s===this.#I||this.#k(s)}getOptimisticResult(e){const t=this.#u.getQueryCache().build(this.#u,e),r=this.createResult(t,e);var n;return n=r,M(this.getCurrentResult(),n)||(this.#b=r,this.#E=this.options,this.#_=this.#v.state),r}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#g.status||this.#g.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#C.add(e)}getCurrentQuery(){return this.#v}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#u.defaultQueryOptions(e),r=this.#u.getQueryCache().build(this.#u,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#N({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#N(e){this.#q();let t=this.#v.fetch(this.options,e);return e?.throwOnError||(t=t.catch(T)),t}#L(){this.#D();const e=C(this.options.staleTime,this.#v);if(Z.isServer()||this.#b.isStale||!A(e))return;const t=I(this.#b.dataUpdatedAt,e)+1;this.#O=R.setTimeout(()=>{this.#b.isStale||this.updateResult()},t)}#U(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#v):this.options.refetchInterval)??!1}#k(e){this.#x(),this.#I=e,!Z.isServer()&&!1!==N(this.options.enabled,this.#v)&&A(this.#I)&&0!==this.#I&&(this.#A=R.setInterval(()=>{(this.options.refetchIntervalInBackground||_.isFocused())&&this.#N()},this.#I))}#P(){this.#L(),this.#k(this.#U())}#D(){void 0!==this.#O&&(R.clearTimeout(this.#O),this.#O=void 0)}#x(){void 0!==this.#A&&(R.clearInterval(this.#A),this.#A=void 0)}createResult(e,t){const r=this.#v,n=this.options,s=this.#b,o=this.#_,i=this.#E,a=e!==r?e.state:this.#w,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const s=this.hasListeners(),o=!s&&ue(e,t),i=s&&de(e,r,t,n);(o||i)&&(u={...u,...ie(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:f}=u;l=u.data;let y=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===f){let e;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=s.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#T?.state.data,this.#T):t.placeholderData,void 0!==e&&(f="success",l=$(s?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!y)if(s&&l===o?.data&&t.select===this.#R)l=this.#S;else try{this.#R=t.select,l=t.select(l),l=$(s?.data,l,t),this.#S=l,this.#m=null}catch(E){this.#m=E}this.#m&&(d=this.#m,l=this.#S,p=Date.now(),f="error");const m="fetching"===u.fetchStatus,g="pending"===f,v="error"===f,w=g&&m,b=void 0!==l,_={status:f,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===f,isError:v,isInitialLoading:w,isLoading:w,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:v&&!b,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:v&&b,isStale:pe(e,t),refetch:this.refetch,promise:this.#g,isEnabled:!1!==N(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==_.data,n="error"===_.status&&!t,s=e=>{n?e.reject(_.error):t&&e.resolve(_.data)},o=()=>{s(this.#g=_.promise=K())},i=this.#g;switch(i.status){case"pending":e.queryHash===r.queryHash&&s(i);break;case"fulfilled":(n||_.data!==i.value)&&o();break;case"rejected":n&&_.error===i.reason||o()}}return _}updateResult(){const e=this.#b,t=this.createResult(this.#v,this.options);this.#_=this.#v.state,this.#E=this.options,void 0!==this.#_.data&&(this.#T=this.#v),M(t,e)||(this.#b=t,this.#M({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#C.size)return!0;const n=new Set(r??this.#C);return this.options.throwOnError&&n.add("error"),Object.keys(this.#b).some(t=>{const r=t;return this.#b[r]!==e[r]&&n.has(r)})})()}))}#q(){const e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#v)return;const t=this.#v;this.#v=e,this.#w=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#M(e){Y.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#u.getQueryCache().notify({query:this.#v,type:"observerResultsUpdated"})})}};function ue(e,t){return function(e,t){return!1!==N(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&he(e,t,t.refetchOnMount)}function he(e,t,r){if(!1!==N(t.enabled,e)&&"static"!==C(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&pe(e,t)}return!1}function de(e,t,r,n){return(e!==t||!1===N(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&pe(e,r)}function pe(e,t){return!1!==N(t.enabled,e)&&e.isStaleByTime(C(t.staleTime,e))}var fe=v.createContext(void 0),ye=e=>{const t=v.useContext(fe);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},me=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */w(fe.Provider,{value:e,children:t})),ge=v.createContext(!1);ge.Provider;var ve=v.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),we=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function be(e,t,r){if("production"!==process.env.NODE_ENV&&("object"!=typeof e||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=v.useContext(ge),s=v.useContext(ve),o=ye(r),i=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=o.getQueryCache().get(i.queryHash);"production"!==process.env.NODE_ENV&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=n?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),n=e.staleTime;e.staleTime="function"==typeof n?(...e)=>r(n(...e)):r(n),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(i),((e,t,r)=>{const n=r?.state.error&&"function"==typeof e.throwOnError?z(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))})(i,s,a),(e=>{v.useEffect(()=>{e.clearReset()},[e])})(s);const c=!o.getQueryCache().get(i.queryHash),[l]=v.useState(()=>new t(o,i)),u=l.getOptimisticResult(i),h=!n&&!1!==e.subscribed;if(v.useSyncExternalStore(v.useCallback(e=>{const t=h?l.subscribe(Y.batchCalls(e)):T;return l.updateResult(),t},[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(i)},[i,l]),((e,t)=>e?.suspense&&t.isPending)(i,u))throw we(i,l,s);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&void 0===e.data||z(r,[e.error,n])))({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw u.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(i,u),i.experimental_prefetchInRender&&!Z.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(u,n)&&(c?we(i,l,s):a?.promise)?.catch(T).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?u:l.trackResult(u)}function _e(e,t){return be(e,le,t)}function Ee(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function Re(e,t){this.props=e,this.context=t}(Re.prototype=new t).isPureReactComponent=!0,Re.prototype.shouldComponentUpdate=function(e,t){return Ee(this.props,e)||Ee(this.state,t)};var Se=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Se&&Se(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Te=i.__e;i.__e=function(e,t,r,n){if(e.then)for(var s,o=t;o=o.__;)if((s=o.__c)&&s.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),s.__c(e,t);Te(e,t,r,n)};var Oe=i.unmount;function Ae(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Ae(e,t,r)})),e}function Ie(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ie(e,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Ce(){this.__u=0,this.o=null,this.__b=null}function Ne(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Pe(e){var t,r,n,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),n=!0},function(e){r=e,n=!0}),r)throw r;if(!n)throw t;return o?s(o,i):null}return i.displayName="Lazy",i.__f=!0,i}function De(){this.i=null,this.l=null}i.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Oe&&Oe(e)},(Ce.prototype=new t).__c=function(e,t){var r=t.__c,n=this;n.o??=[],n.o.push(r);var s=Ne(n.__v),o=!1,i=function(){o||n.__z||(o=!0,r.__R=null,s?s(c):c())};r.__R=i;var a=r.__P;r.__P=null;var c=function(){if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=Ie(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.o.pop();)t.__P=a,t.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(i,i)},Ce.prototype.componentWillUnmount=function(){this.o=[]},Ce.prototype.render=function(t,r){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Ae(this.__b,n,o.__O=o.__P)}this.__b=null}var i=r.__a&&s(e,null,t.fallback);return i&&(i.__u&=-33),[s(e,null,r.__a?null:t.children),i]};var xe=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function qe(e){return this.getChildContext=function(){return e.context},e.children}function Le(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){f(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var n=t.__v;null!==n&&!n.__m&&null!==n.__;)n=n.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:n.__m},contains:function(){return!0},namespaceURI:r.namespaceURI,insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}f(s(qe,{context:t.context},e.__v),t.v)}function Ue(e,t){var r=s(Le,{__v:e,h:t});return r.containerInfo=t,r}(De.prototype=new t).__a=function(e){var t=this,r=Ne(t.__v),n=t.l.get(e);return n[0]++,function(s){var o=function(){t.props.revealOrder?(n.push(s),xe(t,e,n)):s()};r?r(o):o()}},De.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */new Map;var t=o(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},De.prototype.componentDidUpdate=De.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){xe(e,r,t)})};var ke="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Me=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Fe=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,je=/[A-Z0-9]/g,Ve="undefined"!=typeof document,$e=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};t.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(t.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ge=i.event;i.event=function(e){return Ge&&(e=Ge(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Qe={configurable:!0,get:function(){return this.class}},He=i.vnode;i.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={},s=-1==r.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||Ve&&"children"===i&&"noscript"===r||"class"===i||"className"===i)){var c=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===c&&"no"===a?a=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?i="ondblclick":"onchange"!==c||"input"!==r&&"textarea"!==r||$e(t.type)?"onfocus"===c?i="onfocusin":"onblur"===c?i="onfocusout":Fe.test(i)&&(i=c):c=i="oninput":s&&Me.test(i)?i=i.replace(je,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===c&&n[i=c]&&(i="oninputCapture"),n[i]=a}}"select"==r&&(n.multiple&&Array.isArray(n.value)&&(n.value=o(t.children).forEach(function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)})),null!=n.defaultValue&&(n.value=o(t.children).forEach(function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value}))),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",Qe)):t.className&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=ke,He&&He(e)};var We=i.__r;i.__r=function(e){We&&We(e),e.__c};var ze=i.diffed;i.diffed=function(e){ze&&ze(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};var Be=class extends Error{response;request;options;constructor(e,t,r){const n=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${n?`status code ${n}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},Ze=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},Ke=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new Ze(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},Je=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,n="function"==typeof globalThis.Request;if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(s){if(s instanceof Error&&"unsupported BodyInit type"===s.message)return!1;throw s}return e&&!t})(),Ye="function"==typeof globalThis.AbortController,Xe="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,et="function"==typeof globalThis.ReadableStream,tt="function"==typeof globalThis.FormData,rt=["get","post","put","patch","head","delete"],nt={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},st=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,ot=Symbol("stop"),it=class{options;constructor(e){this.options=e}},at=e=>new it(e),ct={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},lt={next:!0},ut={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},ht=(e,t,r)=>{let n,s=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),n){s+=n.byteLength;let e=0===t?0:s/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,s),transferredBytes:s},n)}n=e},flush(){n&&(s+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,s),transferredBytes:s},n))}}))},dt=e=>null!==e&&"object"==typeof e,pt=(...e)=>{for(const t of e)if((!dt(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return vt({},...e)},ft=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,s=new globalThis.Headers(t);for(const[o,i]of s.entries())n&&"undefined"===i||void 0===i?r.delete(o):r.set(o,i);return r};function yt(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:vt(e[r]??[],t[r]??[])}var mt=(e={},t={})=>({beforeRequest:yt(e,t,"beforeRequest"),beforeRetry:yt(e,t,"beforeRetry"),afterResponse:yt(e,t,"afterResponse"),beforeError:yt(e,t,"beforeError")}),gt=(e,t)=>{const r=new URLSearchParams;for(const n of[e,t])if(void 0!==n)if(n instanceof URLSearchParams)for(const[e,t]of n.entries())r.append(e,t);else if(Array.isArray(n))for(const e of n){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(dt(n))for(const[e,t]of Object.entries(n))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(n);for(const[t,n]of e.entries())r.append(t,n)}return r},vt=(...e)=>{let t,r={},n={},s={};const o=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(dt(i)){for(let[e,n]of Object.entries(i))if("signal"===e&&n instanceof globalThis.AbortSignal)o.push(n);else if("context"!==e)"searchParams"!==e?(dt(n)&&e in r&&(n=vt(r[e],n)),r={...r,[e]:n}):t=null==n?void 0:void 0===t?n:gt(t,n);else{if(null!=n&&(!dt(n)||Array.isArray(n)))throw new TypeError("The `context` option must be an object");r={...r,context:null==n?{}:{...r.context,...n}}}dt(i.hooks)&&(s=mt(s,i.hooks),r.hooks=s),dt(i.headers)&&(n=ft(n,i.headers),r.headers=n)}return void 0!==t&&(r.searchParams=t),o.length>0&&(1===o.length?r.signal=o[0]:r.signal=Xe?AbortSignal.any(o):o.at(-1)),r},wt=e=>rt.includes(e)?e.toUpperCase():e,bt={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},_t=(e={})=>{if("number"==typeof e)return{...bt,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...bt,...t}},Et=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Rt=class e{static create(t,r){const n=new e(t,r),s=n.#F(async()=>{if("number"==typeof n.#j.timeout&&n.#j.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await n.#V();for(const r of n.#j.hooks.afterResponse){const s=n.#$(e.clone());let o;try{o=await r(n.request,n.#G(),s,{retryCount:n.#Q})}catch(t){throw n.#H(s),n.#H(e),t}if(o instanceof it)throw n.#H(s),n.#H(e),new Ke(o.options);const i=o instanceof globalThis.Response?o:e;s!==i&&n.#H(s),e!==i&&n.#H(e),e=i}if(n.#$(e),!e.ok&&("function"==typeof n.#j.throwHttpErrors?n.#j.throwHttpErrors(e.status):n.#j.throwHttpErrors)){let t=new Be(e,n.request,n.#G());for(const e of n.#j.hooks.beforeError)t=await e(t,{retryCount:n.#Q});throw t}if(n.#j.onDownloadProgress){if("function"!=typeof n.#j.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!et)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return n.#H(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(ht(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,n.#j.onDownloadProgress)}return e}).finally(()=>{const e=n.#W;n.#z(e?.body??void 0),n.#z(n.request.body??void 0)});for(const[e,o]of Object.entries(nt))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(s[e]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||o);const t=await s;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return s}static#B(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#Z;#Q=0;#K;#j;#W;#J;#Y;constructor(t,r={}){if(this.#K=t,this.#j={...r,headers:ft(this.#K.headers,r.headers),hooks:mt({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:wt(r.method??this.#K.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:_t(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#K&&!(this.#K instanceof URL||this.#K instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#j.prefixUrl&&"string"==typeof this.#K){if(this.#K.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#j.prefixUrl.endsWith("/")||(this.#j.prefixUrl+="/"),this.#K=this.#j.prefixUrl+this.#K}Ye&&Xe&&(this.#J=this.#j.signal??this.#K.signal,this.#Z=new globalThis.AbortController,this.#j.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal),Je&&(this.#j.duplex="half"),void 0!==this.#j.json&&(this.#j.body=this.#j.stringifyJson?.(this.#j.json)??JSON.stringify(this.#j.json),this.#j.headers.set("content-type",this.#j.headers.get("content-type")??"application/json"));const n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#K instanceof globalThis.Request&&(tt&&this.#j.body instanceof globalThis.FormData||this.#j.body instanceof URLSearchParams)&&!n&&this.#j.headers.delete("content-type"),this.request=new globalThis.Request(this.#K,this.#j),void 0!==(s=this.#j.searchParams)&&(Array.isArray(s)?s.length>0:s instanceof URLSearchParams?s.size>0:"object"==typeof s?Object.keys(s).length>0:"string"==typeof s?s.trim().length>0:Boolean(s))){const t="?"+("string"==typeof this.#j.searchParams?this.#j.searchParams.replace(/^\?/,""):new URLSearchParams(e.#B(this.#j.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#j)}var s;if(this.#j.onUploadProgress){if("function"!=typeof this.#j.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!Je)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#X(this.request,this.#j.body??void 0)}}#ee(){const e=this.#j.retry.delay(this.#Q);let t=e;!0===this.#j.retry.jitter?t=Math.random()*e:"function"==typeof this.#j.retry.jitter&&(t=this.#j.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#j.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#te(e){if(this.#Q++,this.#Q>this.#j.retry.limit)throw e;const t=e instanceof Error?e:new Ze(e);if(t instanceof Ke)return t.customDelay??this.#ee();if(!this.#j.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#j.retry.shouldRetry){const r=await this.#j.retry.shouldRetry({error:t,retryCount:this.#Q});if(!1===r)throw e;if(!0===r)return this.#ee()}if(function(e){return e instanceof Et||e?.name===Et.name}(e)&&!this.#j.retry.retryOnTimeout)throw e;if(function(e){return e instanceof Be||e?.name===Be.name}(e)){if(!this.#j.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#j.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#j.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#ee()}#$(e){return this.#j.parseJson&&(e.json=async()=>this.#j.parseJson(await e.text())),e}#z(e){e&&e.cancel().catch(()=>{})}#H(e){this.#z(e.body??void 0)}async#F(e){try{return await e()}catch(t){const r=Math.min(await this.#te(t),2147483647);if(this.#Q<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,n)=>{function s(){clearTimeout(o),n(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",s,{once:!0}));const o=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e)})}(r,this.#J?{signal:this.#J}:{}),t instanceof Ke&&t.customRequest){const e=this.#j.signal?new globalThis.Request(t.customRequest,{signal:this.#j.signal}):new globalThis.Request(t.customRequest);this.#re(e)}for(const e of this.#j.hooks.beforeRetry){const r=await e({request:this.request,options:this.#G(),error:t,retryCount:this.#Q});if(r instanceof globalThis.Request){this.#re(r);break}if(r instanceof globalThis.Response)return r;if(r===ot)return}return this.#F(e)}}async#V(){this.#Z?.signal.aborted&&(this.#Z=new globalThis.AbortController,this.#j.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal,this.request=new globalThis.Request(this.request,{signal:this.#j.signal}));for(const t of this.#j.hooks.beforeRequest){const e=await t(this.request,this.#G(),{retryCount:this.#Q});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#re(e);break}}const e=((e,t)=>{const r={};for(const n in t)Object.hasOwn(t,n)&&(n in ut||n in ct||n in e&&!(n in lt)||(r[n]=t[n]));return r})(this.request,this.#j);return this.#W=this.request,this.request=this.#W.clone(),!1===this.#j.timeout?this.#j.fetch(this.#W,e):async function(e,t,r,n){return new Promise((s,o)=>{const i=setTimeout(()=>{r&&r.abort(),o(new Et(e))},n.timeout);n.fetch(e,t).then(s).catch(o).then(()=>{clearTimeout(i)})})}(this.#W,e,this.#Z,this.#j)}#G(){if(!this.#Y){const{hooks:e,...t}=this.#j;this.#Y=Object.freeze(t)}return this.#Y}#re(e){this.#Y=void 0,this.request=this.#X(e)}#X(e,t){return this.#j.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const n=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=st,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof n?(new TextEncoder).encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:ht(e.body,n,t)})})(e,this.#j.onUploadProgress,t??this.#j.body??void 0):e}},St=e=>{const t=(t,r)=>Rt.create(t,pt(e,r));for(const r of rt)t[r]=(t,n)=>Rt.create(t,pt(e,n,{method:r}));return t.create=e=>St(pt(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),St(pt(e,t))),t.stop=ot,t.retry=at,t},Tt=St(),Ot={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`},At={ORGANIZATION_SETTINGS:e=>`https://qrati.com/org/${e}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:e=>`https://qrati.com/org/${e}/settings/integration`,ORGANIZATION_DASHBOARD:e=>`https://qrati.com/org/${e}/dashboard`,ORGANIZATION_ADMINS:e=>`https://qrati.com/org/${e}/admins`,EVENT_SETTINGS_BASIC_DETAILS:e=>`https://qrati.com/event/${e}/settings`,EVENT_REVIEW_CONTENTS:e=>`https://qrati.com/event/${e}/review-contents`,EVENT_DEEP_SEARCH:e=>`https://qrati.com/event/${e}/deep-search`,EVENT_GENERATE_ARTICLE:e=>`https://qrati.com/event/${e}/generate-article`,EVENT_ACCESS_REQUESTS:e=>`https://qrati.com/event/${e}/access-requests`,EVENT_SHOT_INSPECTOR:e=>`https://qrati.com/event/${e}/shot-inspector`,EVENT_CURATION_DETAILS:e=>`https://qrati.com/event/${e}/curation-details`},It={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Ct="https://qrati.com/api/connect",Nt={INITIALIZE_SESSION:`${Ct}/session/initialize`,REGISTER:`${Ct}/auth/register`,LOGIN:`${Ct}/auth/login`,LOGOUT:`${Ct}/auth/logout`,UPDATE_SESSION:`${Ct}/session/update`,ACCEPT_TERMS:`${Ct}/auth/accept-terms`,EXTERNAL_LOGIN:`${Ct}/auth/external-login`,PUBLIC_EVENTS:`${Ct}/event/public-events`,SEARCH_EVENTS:`${Ct}/event/search`,FOLDER_DETAILS:`${Ct}/folder/details`,NESTED_FOLDERS:`${Ct}/folder/nested-folders`,GET_EVENT_POINTS:`${Ct}/event/points`,ELIGIBLE_TO_CURATE:`${Ct}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${Ct}/content/for-curation`,CURATE_CONTENT:`${Ct}/content/curate`,GET_LEADERBOARD:`${Ct}/event/leaderboard`,GET_UPLOAD_COUNT:`${Ct}/event/upload-count`,SINGLE_UPLOAD:`${Ct}/content/single-upload`,UPDATE_REACTION:`${Ct}/content/update-reaction`,EVENT_DATA:`${Ct}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${Ct}/event/update-layout`,GET_EVENT_STATISTICS:`${Ct}/event/statistics`,GET_CONTENTS:`${Ct}/content/for-gallery`,SEARCH_CONTENTS:`${Ct}/content/search`,GET_CONTENTS_COUNT:`${Ct}/content/count`,UPDATE_AD_ANALYTICS:`${Ct}/event/update-ad-analytics`,UPDATE_GAM_ANALYTICS:`${Ct}/event/update-gam-analytics`,INCREMENT_EVENT_VIEW:`${Ct}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${Ct}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${Ct}/auth/verify-password-reset-code`,RESET_PASSWORD:`${Ct}/auth/reset-password`,REPORT_ERROR:`${Ct}/session/report-error`},Pt={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},Dt={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},xt={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},qt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},Lt={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},Ut={WAITING:"Waiting",UPLOADING:"Uploading",RETRYING:"Retrying",DONE:"Done",FAILED:"Failed",ERROR:"Error"},kt=1048576,Mt={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},Ft={WAITING:"Waiting",PROCESSING:"Processing",DONE:"Done"},jt={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},Vt={CONTEST:"CONTEST",REACTION:"REACTION"},$t={GRID:"grid",SINGLE:"single"},Gt={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},Qt={[Gt.POPULAR]:{label:"Popular",sortField:"score"},[Gt.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[Gt.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},Ht="map-view-state",Wt=Gt.UPLOAD_TIME,zt={ASC:"asc",DESC:"desc"},Bt={[zt.ASC]:{label:"Ascending",sortOrder:""},[zt.DESC]:{label:"Descending",sortOrder:"-"}},Zt=zt.DESC,Kt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},Jt={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},Yt={[Jt.LINK]:"material-symbols:open-in-new-rounded",[Jt.EMAIL]:"material-symbols:alternate-email-rounded",[Jt.PHONE]:"material-symbols:call-outline",[Jt.SMS]:"material-symbols:sms-outline-rounded",[Jt.WHATSAPP]:"logos:whatsapp-icon",[Jt.MESSENGER]:"logos:messenger"},Xt={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},er={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`};function tr({title:e,children:t}){/* @__PURE__ */
|
|
1
|
+
import{A as e,D as t,E as r,M as n,N as s,O as o,P as i,S as a,T as c,_ as l,b as u,f as h,g as d,h as p,k as f,p as y,v as m,y as g}from"./DQVgvgo2.js";import*as v from"react";import{jsx as w}from"react/jsx-runtime";var b=class{constructor(){this.listeners=/* @__PURE__ */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(){}},_=new class extends b{#e;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},E={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},R=new class{#n=E;#s=!1;setTimeoutProvider(e){"production"!==process.env.NODE_ENV&&this.#s&&e!==this.#n&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#n,provider:e}),this.#n=e,"production"!==process.env.NODE_ENV&&(this.#s=!1)}setTimeout(e,t){return"production"!==process.env.NODE_ENV&&(this.#s=!0),this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return"production"!==process.env.NODE_ENV&&(this.#s=!0),this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},S="undefined"==typeof window||"Deno"in globalThis;function T(){}function O(e,t){return"function"==typeof e?e(t):e}function A(e){return"number"==typeof e&&e>=0&&e!==1/0}function I(e,t){return Math.max(e+(t||0)-Date.now(),0)}function C(e,t){return"function"==typeof e?e(t):e}function N(e,t){return"function"==typeof e?e(t):e}function P(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i)if(n){if(t.queryHash!==x(i,t.options))return!1}else if(!L(t.queryKey,i))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function D(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(q(t.options.mutationKey)!==q(o))return!1}else if(!L(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function x(e,t){return(t?.queryKeyHashFn||q)(e)}function q(e){return JSON.stringify(e,(e,t)=>j(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function L(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>L(e[r],t[r]))}var U=Object.prototype.hasOwnProperty;function k(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=F(e)&&F(t);if(!(n||j(e)&&j(t)))return t;const s=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),i=o.length,a=n?new Array(i):{};let c=0;for(let l=0;l<i;l++){const i=n?l:o[l],u=e[i],h=t[i];if(u===h){a[i]=u,(n?l<s:U.call(e,i))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[i]=h;continue}const d=k(u,h,r+1);a[i]=d,d===u&&c++}return s===i&&c===s?e:a}function M(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function F(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function j(e){if(!$(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!$(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function $(e){return"[object Object]"===Object.prototype.toString.call(e)}function V(e,t,r){if("function"==typeof r.structuralSharing)return r.structuralSharing(e,t);if(!1!==r.structuralSharing){if("production"!==process.env.NODE_ENV)try{return k(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return k(e,t)}return t}function G(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Q(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var H=/* @__PURE__ */Symbol();function W(e,t){return"production"!==process.env.NODE_ENV&&e.queryFn===H&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==H?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function z(e,t){return"function"==typeof e?e(...t):!!e}function B(e,t,r){let n,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),s||(s=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}var Z=/* @__PURE__ */(()=>{let e=()=>S;return{isServer:()=>e(),setIsServer(t){e=t}}})();function K(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}var J=function(e){setTimeout(e,0)},Y=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},s=J;const o=n=>{t?e.push(n):s(()=>{r(n)})};return{batch:o=>{let i;t++;try{i=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&s(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{s=e}}}(),X=new class extends b{#o=!0;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};function ee(e){return Math.min(1e3*2**e,3e4)}function te(e){return"online"!==(e??"online")||X.isOnline()}var re=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ne(e){let t,r=!1,n=0;const s=K(),o=()=>"pending"!==s.status,i=()=>_.isFocused()&&("always"===e.networkMode||X.isOnline())&&e.canRun(),a=()=>te(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),s.resolve(e))},l=e=>{o()||(t?.(),s.reject(e))},u=()=>new Promise(r=>{t=e=>{(o()||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let t;const s=0===n?e.initialPromise:void 0;try{t=s??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(o())return;const s=e.retry??(Z.isServer()?0:3),a=e.retryDelay??ee,c="function"==typeof a?a(n,t):a,d=!0===s||"number"==typeof s&&n<s||"function"==typeof s&&s(n,t);var p;!r&&d?(n++,e.onFail?.(n,t),(p=c,new Promise(e=>{R.setTimeout(e,p)})).then(()=>i()?void 0:u()).then(()=>{r?l(t):h()})):l(t)})};return{promise:s,status:()=>s.status,cancel:t=>{if(!o()){const r=new re(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),s),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?h():u().then(h),s)}}var se=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),A(this.gcTime)&&(this.#i=R.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Z.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#i&&(R.clearTimeout(this.#i),this.#i=void 0)}},oe=class extends se{#a;#c;#l;#u;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#l=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=ce(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=ce(this.options);void 0!==e.data&&(this.setState(ae(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,t){const r=V(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#h?.promise;return this.#h?.cancel(e),t?t.then(T).catch(T):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#a}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==N(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===H||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===C(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!I(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p||this.#y()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#h?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}"production"!==process.env.NODE_ENV&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},s=()=>{const e=W(this.options,t),r=(()=>{const e={client:this.#u,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:s};return n(e),e})();this.options.behavior?.onFetch(o,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#f({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=ne({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof re&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const e=await this.#h.start();if(void 0===e)throw"production"!==process.env.NODE_ENV&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(i){if(i instanceof re){if(i.silent)return this.#h.promise;if(i.revert){if(void 0===this.state.data)throw i;return this.state.data}}throw this.#f({type:"error",error:i}),this.#l.config.onError?.(i,this),this.#l.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...ie(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ae(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?r:void 0,r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),Y.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function ie(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:te(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ae(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ce(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var le=class extends b{constructor(e,t){super(),this.options=t,this.#u=e,this.#m=null,this.#g=K(),this.bindMethods(),this.setOptions(t)}#u;#v=void 0;#w=void 0;#b=void 0;#_;#E;#g;#m;#R;#S;#T;#O;#A;#I;#C=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#v.addObserver(this),ue(this.#v,this.options)?this.#N():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return he(this.#v,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return he(this.#v,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#D(),this.#x(),this.#v.removeObserver(this)}setOptions(e){const t=this.options,r=this.#v;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof N(this.options.enabled,this.#v))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#v.setOptions(this.options),t._defaulted&&!M(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#v,observer:this});const n=this.hasListeners();n&&de(this.#v,r,this.options,t)&&this.#N(),this.updateResult(),!n||this.#v===r&&N(this.options.enabled,this.#v)===N(t.enabled,this.#v)&&C(this.options.staleTime,this.#v)===C(t.staleTime,this.#v)||this.#L();const s=this.#U();!n||this.#v===r&&N(this.options.enabled,this.#v)===N(t.enabled,this.#v)&&s===this.#I||this.#k(s)}getOptimisticResult(e){const t=this.#u.getQueryCache().build(this.#u,e),r=this.createResult(t,e);var n;return n=r,M(this.getCurrentResult(),n)||(this.#b=r,this.#E=this.options,this.#_=this.#v.state),r}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#g.status||this.#g.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#C.add(e)}getCurrentQuery(){return this.#v}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#u.defaultQueryOptions(e),r=this.#u.getQueryCache().build(this.#u,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#N({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#N(e){this.#q();let t=this.#v.fetch(this.options,e);return e?.throwOnError||(t=t.catch(T)),t}#L(){this.#D();const e=C(this.options.staleTime,this.#v);if(Z.isServer()||this.#b.isStale||!A(e))return;const t=I(this.#b.dataUpdatedAt,e)+1;this.#O=R.setTimeout(()=>{this.#b.isStale||this.updateResult()},t)}#U(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#v):this.options.refetchInterval)??!1}#k(e){this.#x(),this.#I=e,!Z.isServer()&&!1!==N(this.options.enabled,this.#v)&&A(this.#I)&&0!==this.#I&&(this.#A=R.setInterval(()=>{(this.options.refetchIntervalInBackground||_.isFocused())&&this.#N()},this.#I))}#P(){this.#L(),this.#k(this.#U())}#D(){void 0!==this.#O&&(R.clearTimeout(this.#O),this.#O=void 0)}#x(){void 0!==this.#A&&(R.clearInterval(this.#A),this.#A=void 0)}createResult(e,t){const r=this.#v,n=this.options,s=this.#b,o=this.#_,i=this.#E,a=e!==r?e.state:this.#w,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const s=this.hasListeners(),o=!s&&ue(e,t),i=s&&de(e,r,t,n);(o||i)&&(u={...u,...ie(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:f}=u;l=u.data;let y=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===f){let e;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=s.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#T?.state.data,this.#T):t.placeholderData,void 0!==e&&(f="success",l=V(s?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!y)if(s&&l===o?.data&&t.select===this.#R)l=this.#S;else try{this.#R=t.select,l=t.select(l),l=V(s?.data,l,t),this.#S=l,this.#m=null}catch(E){this.#m=E}this.#m&&(d=this.#m,l=this.#S,p=Date.now(),f="error");const m="fetching"===u.fetchStatus,g="pending"===f,v="error"===f,w=g&&m,b=void 0!==l,_={status:f,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===f,isError:v,isInitialLoading:w,isLoading:w,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:v&&!b,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:v&&b,isStale:pe(e,t),refetch:this.refetch,promise:this.#g,isEnabled:!1!==N(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==_.data,n="error"===_.status&&!t,s=e=>{n?e.reject(_.error):t&&e.resolve(_.data)},o=()=>{s(this.#g=_.promise=K())},i=this.#g;switch(i.status){case"pending":e.queryHash===r.queryHash&&s(i);break;case"fulfilled":(n||_.data!==i.value)&&o();break;case"rejected":n&&_.error===i.reason||o()}}return _}updateResult(){const e=this.#b,t=this.createResult(this.#v,this.options);this.#_=this.#v.state,this.#E=this.options,void 0!==this.#_.data&&(this.#T=this.#v),M(t,e)||(this.#b=t,this.#M({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#C.size)return!0;const n=new Set(r??this.#C);return this.options.throwOnError&&n.add("error"),Object.keys(this.#b).some(t=>{const r=t;return this.#b[r]!==e[r]&&n.has(r)})})()}))}#q(){const e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#v)return;const t=this.#v;this.#v=e,this.#w=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#M(e){Y.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#u.getQueryCache().notify({query:this.#v,type:"observerResultsUpdated"})})}};function ue(e,t){return function(e,t){return!1!==N(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&he(e,t,t.refetchOnMount)}function he(e,t,r){if(!1!==N(t.enabled,e)&&"static"!==C(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&pe(e,t)}return!1}function de(e,t,r,n){return(e!==t||!1===N(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&pe(e,r)}function pe(e,t){return!1!==N(t.enabled,e)&&e.isStaleByTime(C(t.staleTime,e))}var fe=v.createContext(void 0),ye=e=>{const t=v.useContext(fe);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},me=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */w(fe.Provider,{value:e,children:t})),ge=v.createContext(!1);ge.Provider;var ve=v.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),we=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function be(e,t,r){if("production"!==process.env.NODE_ENV&&("object"!=typeof e||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=v.useContext(ge),s=v.useContext(ve),o=ye(r),i=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=o.getQueryCache().get(i.queryHash);"production"!==process.env.NODE_ENV&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=n?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),n=e.staleTime;e.staleTime="function"==typeof n?(...e)=>r(n(...e)):r(n),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(i),((e,t,r)=>{const n=r?.state.error&&"function"==typeof e.throwOnError?z(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))})(i,s,a),(e=>{v.useEffect(()=>{e.clearReset()},[e])})(s);const c=!o.getQueryCache().get(i.queryHash),[l]=v.useState(()=>new t(o,i)),u=l.getOptimisticResult(i),h=!n&&!1!==e.subscribed;if(v.useSyncExternalStore(v.useCallback(e=>{const t=h?l.subscribe(Y.batchCalls(e)):T;return l.updateResult(),t},[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(i)},[i,l]),((e,t)=>e?.suspense&&t.isPending)(i,u))throw we(i,l,s);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&void 0===e.data||z(r,[e.error,n])))({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw u.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(i,u),i.experimental_prefetchInRender&&!Z.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(u,n)&&(c?we(i,l,s):a?.promise)?.catch(T).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?u:l.trackResult(u)}function _e(e,t){return be(e,le,t)}function Ee(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function Re(e,t){this.props=e,this.context=t}(Re.prototype=new t).isPureReactComponent=!0,Re.prototype.shouldComponentUpdate=function(e,t){return Ee(this.props,e)||Ee(this.state,t)};var Se=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Se&&Se(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Te=i.__e;i.__e=function(e,t,r,n){if(e.then)for(var s,o=t;o=o.__;)if((s=o.__c)&&s.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),s.__c(e,t);Te(e,t,r,n)};var Oe=i.unmount;function Ae(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Ae(e,t,r)})),e}function Ie(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ie(e,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Ce(){this.__u=0,this.o=null,this.__b=null}function Ne(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Pe(e){var t,r,n,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),n=!0},function(e){r=e,n=!0}),r)throw r;if(!n)throw t;return o?s(o,i):null}return i.displayName="Lazy",i.__f=!0,i}function De(){this.i=null,this.l=null}i.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Oe&&Oe(e)},(Ce.prototype=new t).__c=function(e,t){var r=t.__c,n=this;n.o??=[],n.o.push(r);var s=Ne(n.__v),o=!1,i=function(){o||n.__z||(o=!0,r.__R=null,s?s(c):c())};r.__R=i;var a=r.__P;r.__P=null;var c=function(){if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=Ie(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.o.pop();)t.__P=a,t.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(i,i)},Ce.prototype.componentWillUnmount=function(){this.o=[]},Ce.prototype.render=function(t,r){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Ae(this.__b,n,o.__O=o.__P)}this.__b=null}var i=r.__a&&s(e,null,t.fallback);return i&&(i.__u&=-33),[s(e,null,r.__a?null:t.children),i]};var xe=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function qe(e){return this.getChildContext=function(){return e.context},e.children}function Le(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){f(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var n=t.__v;null!==n&&!n.__m&&null!==n.__;)n=n.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:n.__m},contains:function(){return!0},namespaceURI:r.namespaceURI,insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}f(s(qe,{context:t.context},e.__v),t.v)}function Ue(e,t){var r=s(Le,{__v:e,h:t});return r.containerInfo=t,r}(De.prototype=new t).__a=function(e){var t=this,r=Ne(t.__v),n=t.l.get(e);return n[0]++,function(s){var o=function(){t.props.revealOrder?(n.push(s),xe(t,e,n)):s()};r?r(o):o()}},De.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */new Map;var t=o(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},De.prototype.componentDidUpdate=De.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){xe(e,r,t)})};var ke="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Me=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Fe=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,je=/[A-Z0-9]/g,$e="undefined"!=typeof document,Ve=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};t.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(t.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ge=i.event;i.event=function(e){return Ge&&(e=Ge(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Qe={configurable:!0,get:function(){return this.class}},He=i.vnode;i.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={},s=-1==r.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||$e&&"children"===i&&"noscript"===r||"class"===i||"className"===i)){var c=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===c&&"no"===a?a=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?i="ondblclick":"onchange"!==c||"input"!==r&&"textarea"!==r||Ve(t.type)?"onfocus"===c?i="onfocusin":"onblur"===c?i="onfocusout":Fe.test(i)&&(i=c):c=i="oninput":s&&Me.test(i)?i=i.replace(je,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===c&&n[i=c]&&(i="oninputCapture"),n[i]=a}}"select"==r&&(n.multiple&&Array.isArray(n.value)&&(n.value=o(t.children).forEach(function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)})),null!=n.defaultValue&&(n.value=o(t.children).forEach(function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value}))),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",Qe)):t.className&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=ke,He&&He(e)};var We=i.__r;i.__r=function(e){We&&We(e),e.__c};var ze=i.diffed;i.diffed=function(e){ze&&ze(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};var Be=class extends Error{response;request;options;constructor(e,t,r){const n=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${n?`status code ${n}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},Ze=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},Ke=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new Ze(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},Je=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,n="function"==typeof globalThis.Request;if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(s){if(s instanceof Error&&"unsupported BodyInit type"===s.message)return!1;throw s}return e&&!t})(),Ye="function"==typeof globalThis.AbortController,Xe="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,et="function"==typeof globalThis.ReadableStream,tt="function"==typeof globalThis.FormData,rt=["get","post","put","patch","head","delete"],nt={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},st=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,ot=Symbol("stop"),it=class{options;constructor(e){this.options=e}},at=e=>new it(e),ct={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},lt={next:!0},ut={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},ht=(e,t,r)=>{let n,s=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),n){s+=n.byteLength;let e=0===t?0:s/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,s),transferredBytes:s},n)}n=e},flush(){n&&(s+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,s),transferredBytes:s},n))}}))},dt=e=>null!==e&&"object"==typeof e,pt=(...e)=>{for(const t of e)if((!dt(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return vt({},...e)},ft=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,s=new globalThis.Headers(t);for(const[o,i]of s.entries())n&&"undefined"===i||void 0===i?r.delete(o):r.set(o,i);return r};function yt(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:vt(e[r]??[],t[r]??[])}var mt=(e={},t={})=>({beforeRequest:yt(e,t,"beforeRequest"),beforeRetry:yt(e,t,"beforeRetry"),afterResponse:yt(e,t,"afterResponse"),beforeError:yt(e,t,"beforeError")}),gt=(e,t)=>{const r=new URLSearchParams;for(const n of[e,t])if(void 0!==n)if(n instanceof URLSearchParams)for(const[e,t]of n.entries())r.append(e,t);else if(Array.isArray(n))for(const e of n){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(dt(n))for(const[e,t]of Object.entries(n))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(n);for(const[t,n]of e.entries())r.append(t,n)}return r},vt=(...e)=>{let t,r={},n={},s={};const o=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(dt(i)){for(let[e,n]of Object.entries(i))if("signal"===e&&n instanceof globalThis.AbortSignal)o.push(n);else if("context"!==e)"searchParams"!==e?(dt(n)&&e in r&&(n=vt(r[e],n)),r={...r,[e]:n}):t=null==n?void 0:void 0===t?n:gt(t,n);else{if(null!=n&&(!dt(n)||Array.isArray(n)))throw new TypeError("The `context` option must be an object");r={...r,context:null==n?{}:{...r.context,...n}}}dt(i.hooks)&&(s=mt(s,i.hooks),r.hooks=s),dt(i.headers)&&(n=ft(n,i.headers),r.headers=n)}return void 0!==t&&(r.searchParams=t),o.length>0&&(1===o.length?r.signal=o[0]:r.signal=Xe?AbortSignal.any(o):o.at(-1)),r},wt=e=>rt.includes(e)?e.toUpperCase():e,bt={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},_t=(e={})=>{if("number"==typeof e)return{...bt,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...bt,...t}},Et=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Rt=class e{static create(t,r){const n=new e(t,r),s=n.#F(async()=>{if("number"==typeof n.#j.timeout&&n.#j.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await n.#$();for(const r of n.#j.hooks.afterResponse){const s=n.#V(e.clone());let o;try{o=await r(n.request,n.#G(),s,{retryCount:n.#Q})}catch(t){throw n.#H(s),n.#H(e),t}if(o instanceof it)throw n.#H(s),n.#H(e),new Ke(o.options);const i=o instanceof globalThis.Response?o:e;s!==i&&n.#H(s),e!==i&&n.#H(e),e=i}if(n.#V(e),!e.ok&&("function"==typeof n.#j.throwHttpErrors?n.#j.throwHttpErrors(e.status):n.#j.throwHttpErrors)){let t=new Be(e,n.request,n.#G());for(const e of n.#j.hooks.beforeError)t=await e(t,{retryCount:n.#Q});throw t}if(n.#j.onDownloadProgress){if("function"!=typeof n.#j.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!et)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return n.#H(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(ht(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,n.#j.onDownloadProgress)}return e}).finally(()=>{const e=n.#W;n.#z(e?.body??void 0),n.#z(n.request.body??void 0)});for(const[e,o]of Object.entries(nt))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(s[e]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||o);const t=await s;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return s}static#B(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#Z;#Q=0;#K;#j;#W;#J;#Y;constructor(t,r={}){if(this.#K=t,this.#j={...r,headers:ft(this.#K.headers,r.headers),hooks:mt({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:wt(r.method??this.#K.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:_t(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#K&&!(this.#K instanceof URL||this.#K instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#j.prefixUrl&&"string"==typeof this.#K){if(this.#K.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#j.prefixUrl.endsWith("/")||(this.#j.prefixUrl+="/"),this.#K=this.#j.prefixUrl+this.#K}Ye&&Xe&&(this.#J=this.#j.signal??this.#K.signal,this.#Z=new globalThis.AbortController,this.#j.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal),Je&&(this.#j.duplex="half"),void 0!==this.#j.json&&(this.#j.body=this.#j.stringifyJson?.(this.#j.json)??JSON.stringify(this.#j.json),this.#j.headers.set("content-type",this.#j.headers.get("content-type")??"application/json"));const n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#K instanceof globalThis.Request&&(tt&&this.#j.body instanceof globalThis.FormData||this.#j.body instanceof URLSearchParams)&&!n&&this.#j.headers.delete("content-type"),this.request=new globalThis.Request(this.#K,this.#j),void 0!==(s=this.#j.searchParams)&&(Array.isArray(s)?s.length>0:s instanceof URLSearchParams?s.size>0:"object"==typeof s?Object.keys(s).length>0:"string"==typeof s?s.trim().length>0:Boolean(s))){const t="?"+("string"==typeof this.#j.searchParams?this.#j.searchParams.replace(/^\?/,""):new URLSearchParams(e.#B(this.#j.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#j)}var s;if(this.#j.onUploadProgress){if("function"!=typeof this.#j.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!Je)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#X(this.request,this.#j.body??void 0)}}#ee(){const e=this.#j.retry.delay(this.#Q);let t=e;!0===this.#j.retry.jitter?t=Math.random()*e:"function"==typeof this.#j.retry.jitter&&(t=this.#j.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#j.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#te(e){if(this.#Q++,this.#Q>this.#j.retry.limit)throw e;const t=e instanceof Error?e:new Ze(e);if(t instanceof Ke)return t.customDelay??this.#ee();if(!this.#j.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#j.retry.shouldRetry){const r=await this.#j.retry.shouldRetry({error:t,retryCount:this.#Q});if(!1===r)throw e;if(!0===r)return this.#ee()}if(function(e){return e instanceof Et||e?.name===Et.name}(e)&&!this.#j.retry.retryOnTimeout)throw e;if(function(e){return e instanceof Be||e?.name===Be.name}(e)){if(!this.#j.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#j.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#j.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#ee()}#V(e){return this.#j.parseJson&&(e.json=async()=>this.#j.parseJson(await e.text())),e}#z(e){e&&e.cancel().catch(()=>{})}#H(e){this.#z(e.body??void 0)}async#F(e){try{return await e()}catch(t){const r=Math.min(await this.#te(t),2147483647);if(this.#Q<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,n)=>{function s(){clearTimeout(o),n(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",s,{once:!0}));const o=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e)})}(r,this.#J?{signal:this.#J}:{}),t instanceof Ke&&t.customRequest){const e=this.#j.signal?new globalThis.Request(t.customRequest,{signal:this.#j.signal}):new globalThis.Request(t.customRequest);this.#re(e)}for(const e of this.#j.hooks.beforeRetry){const r=await e({request:this.request,options:this.#G(),error:t,retryCount:this.#Q});if(r instanceof globalThis.Request){this.#re(r);break}if(r instanceof globalThis.Response)return r;if(r===ot)return}return this.#F(e)}}async#$(){this.#Z?.signal.aborted&&(this.#Z=new globalThis.AbortController,this.#j.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal,this.request=new globalThis.Request(this.request,{signal:this.#j.signal}));for(const t of this.#j.hooks.beforeRequest){const e=await t(this.request,this.#G(),{retryCount:this.#Q});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#re(e);break}}const e=((e,t)=>{const r={};for(const n in t)Object.hasOwn(t,n)&&(n in ut||n in ct||n in e&&!(n in lt)||(r[n]=t[n]));return r})(this.request,this.#j);return this.#W=this.request,this.request=this.#W.clone(),!1===this.#j.timeout?this.#j.fetch(this.#W,e):async function(e,t,r,n){return new Promise((s,o)=>{const i=setTimeout(()=>{r&&r.abort(),o(new Et(e))},n.timeout);n.fetch(e,t).then(s).catch(o).then(()=>{clearTimeout(i)})})}(this.#W,e,this.#Z,this.#j)}#G(){if(!this.#Y){const{hooks:e,...t}=this.#j;this.#Y=Object.freeze(t)}return this.#Y}#re(e){this.#Y=void 0,this.request=this.#X(e)}#X(e,t){return this.#j.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const n=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=st,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof n?(new TextEncoder).encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:ht(e.body,n,t)})})(e,this.#j.onUploadProgress,t??this.#j.body??void 0):e}},St=e=>{const t=(t,r)=>Rt.create(t,pt(e,r));for(const r of rt)t[r]=(t,n)=>Rt.create(t,pt(e,n,{method:r}));return t.create=e=>St(pt(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),St(pt(e,t))),t.stop=ot,t.retry=at,t},Tt=St(),Ot={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`},At={ORGANIZATION_SETTINGS:e=>`https://qrati.com/org/${e}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:e=>`https://qrati.com/org/${e}/settings/integration`,ORGANIZATION_DASHBOARD:e=>`https://qrati.com/org/${e}/dashboard`,ORGANIZATION_ADMINS:e=>`https://qrati.com/org/${e}/admins`,EVENT_SETTINGS_BASIC_DETAILS:e=>`https://qrati.com/event/${e}/settings`,EVENT_REVIEW_CONTENTS:e=>`https://qrati.com/event/${e}/review-contents`,EVENT_DEEP_SEARCH:e=>`https://qrati.com/event/${e}/deep-search`,EVENT_GENERATE_ARTICLE:e=>`https://qrati.com/event/${e}/generate-article`,EVENT_ACCESS_REQUESTS:e=>`https://qrati.com/event/${e}/access-requests`,EVENT_SHOT_INSPECTOR:e=>`https://qrati.com/event/${e}/shot-inspector`,EVENT_CURATION_DETAILS:e=>`https://qrati.com/event/${e}/curation-details`},It={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Ct="https://qrati.com/api/connect",Nt={INITIALIZE_SESSION:`${Ct}/session/initialize`,REGISTER:`${Ct}/auth/register`,LOGIN:`${Ct}/auth/login`,LOGOUT:`${Ct}/auth/logout`,UPDATE_SESSION:`${Ct}/session/update`,ACCEPT_TERMS:`${Ct}/auth/accept-terms`,EXTERNAL_LOGIN:`${Ct}/auth/external-login`,PUBLIC_EVENTS:`${Ct}/event/public-events`,SEARCH_EVENTS:`${Ct}/event/search`,FOLDER_DETAILS:`${Ct}/folder/details`,NESTED_FOLDERS:`${Ct}/folder/nested-folders`,GET_EVENT_POINTS:`${Ct}/event/points`,ELIGIBLE_TO_CURATE:`${Ct}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${Ct}/content/for-curation`,CURATE_CONTENT:`${Ct}/content/curate`,GET_LEADERBOARD:`${Ct}/event/leaderboard`,GET_UPLOAD_COUNT:`${Ct}/event/upload-count`,SINGLE_UPLOAD:`${Ct}/content/single-upload`,UPDATE_REACTION:`${Ct}/content/update-reaction`,EVENT_DATA:`${Ct}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${Ct}/event/update-layout`,GET_EVENT_STATISTICS:`${Ct}/event/statistics`,GET_CONTENTS:`${Ct}/content/for-gallery`,SEARCH_CONTENTS:`${Ct}/content/search`,GET_CONTENTS_COUNT:`${Ct}/content/count`,UPDATE_AD_ANALYTICS:`${Ct}/event/update-ad-analytics`,UPDATE_GAM_ANALYTICS:`${Ct}/event/update-gam-analytics`,INCREMENT_EVENT_VIEW:`${Ct}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${Ct}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${Ct}/auth/verify-password-reset-code`,RESET_PASSWORD:`${Ct}/auth/reset-password`,REPORT_ERROR:`${Ct}/session/report-error`},Pt={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},Dt={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},xt={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},qt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},Lt={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},Ut={WAITING:"Waiting",UPLOADING:"Uploading",RETRYING:"Retrying",DONE:"Done",FAILED:"Failed",ERROR:"Error"},kt=1048576,Mt={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},Ft={WAITING:"Waiting",PROCESSING:"Processing",DONE:"Done"},jt={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},$t={CONTEST:"CONTEST",REACTION:"REACTION"},Vt={GRID:"grid",SINGLE:"single"},Gt={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},Qt={[Gt.POPULAR]:{label:"Popular",sortField:"score"},[Gt.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[Gt.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},Ht="map-view-state",Wt=Gt.UPLOAD_TIME,zt={ASC:"asc",DESC:"desc"},Bt={[zt.ASC]:{label:"Ascending",sortOrder:""},[zt.DESC]:{label:"Descending",sortOrder:"-"}},Zt=zt.DESC,Kt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},Jt={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},Yt={[Jt.LINK]:"material-symbols:open-in-new-rounded",[Jt.EMAIL]:"material-symbols:alternate-email-rounded",[Jt.PHONE]:"material-symbols:call-outline",[Jt.SMS]:"material-symbols:sms-outline-rounded",[Jt.WHATSAPP]:"logos:whatsapp-icon",[Jt.MESSENGER]:"logos:messenger"},Xt={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},er={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`};function tr({title:e,children:t}){/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */m("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit text-[#ff4800]",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */m("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
3
3
|
/* @__PURE__ */m("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
|
|
4
4
|
/* @__PURE__ */m("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
|
|
@@ -29,5 +29,5 @@ return m("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/*
|
|
|
29
29
|
/* @__PURE__ */m("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */m("div",{className:"space-y-4",children:[/* @__PURE__ */m("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */m("p",{className:"text-muted-foreground text-center",children:t})]})]})}function rr({organizationId:e,errorType:t}){/* @__PURE__ */
|
|
30
30
|
return m(tr,"custom-auth-invalid"===t?{title:"Invalid input",children:"Custom auth mode requires uid, fname, lname. For more details please contact Qrati support."}:"service-unavailable"===t?{title:"We'll be right back!",children:"Our service is getting a quick tune-up. Hang tight — great things are coming your way soon!"}:{title:"page-not-registered"===t?"Page not registered":"Something went wrong",children:["If you are an admin of this organization, please add the current page URL in Allowed URLs under"," ",
|
|
31
31
|
/* @__PURE__ */m("a",{className:"font-medium text-blue-500",href:At.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨"," ",
|
|
32
|
-
/* @__PURE__ */m("a",{className:"font-medium text-blue-500",href:At.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Integration Settings"}),". For more details please contact Qrati support."]})}var nr=e=>({google:"Google",apple:"Apple"}[e]||e.charAt(0).toUpperCase()+e.slice(1)),sr=async e=>{try{return await e()}catch{return null}},or=(e,t=1)=>{const r=(new TextEncoder).encode(e),n=3432918353,s=461845907;let o=t>>>0;const i=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<i;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,n),e=e<<15|e>>>17,e=Math.imul(e,s),o^=e,o=o<<13|o>>>19,o=Math.imul(o,5)+3864292196>>>0}let c=0;const l=4*i,u=3&r.length;return 3===u&&(c^=r[l+2]<<16),u>=2&&(c^=r[l+1]<<8),u>=1&&(c^=r[l],c=Math.imul(c,n),c=c<<15|c>>>17,c=Math.imul(c,s),o^=c),o^=r.length,o^=o>>>16,o=Math.imul(o,2246822507)>>>0,o^=o>>>13,o=Math.imul(o,3266489909)>>>0,o^=o>>>16,o.toString(16).padStart(8,"0")},ir=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(ir).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const n of t){const t=e[n];void 0!==t&&r.push(`${ir(n)}:${ir(t)}`)}return`{${r.join(",")}}`},ar=async({debug:e=!1}={})=>{const t=performance.now(),r=await sr(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?ir(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),n=await sr(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const n of t){const t=e.canPlayType(n);r[n]=""===t?"no":t}return ir(r)})()),s=await sr(()=>(()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const n={};for(const o of e)r.style.fontFamily=o,n[o]=r.offsetWidth;const s=[];for(const o of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${o}", ${i}`,r.offsetWidth!==n[i]){s.push(o),t=!0;break}t||(r.style.fontFamily=`"${o}"`,r.offsetWidth!==n.monospace&&r.offsetWidth!==n.serif&&s.push(o))}return document.body.removeChild(r),s.length?s.sort().join(","):null})()),o=await sr(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),i=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,a=Intl.DateTimeFormat().resolvedOptions(),c=a.timeZone,l=/* @__PURE__ */(new Date).getTimezoneOffset(),u=a.calendar||null,h=void 0!==a.hour12?a.hour12?"h12":"h23":a.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",f=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",y=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",m=window.matchMedia("(forced-colors: active)").matches?"active":null,g="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:v,colorDepth:w}=window.screen,b="ontouchstart"in window||window.navigator.maxTouchPoints>0,_=await sr(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),n=r.createLinearGradient(0,0,280,100);return n.addColorStop(0,"#f60"),n.addColorStop(.4,"#09f"),n.addColorStop(.7,"#f09"),n.addColorStop(1,"#0f9"),r.fillStyle=n,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),or(t.toDataURL("image/png"))})(e)),E=await sr(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return or(ir({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))})()),R=await sr(()=>(async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return or(ir(r))})(e)),S=await sr(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const n=t.createDynamicsCompressor();n.threshold.value=-48,n.knee.value=30,n.ratio.value=14,n.attack.value=0,n.release.value=.3;const s=t.createGain();s.gain.value=.4,r.connect(n),n.connect(s),s.connect(t.destination),r.start(0);const o=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let l=3e3;l<5800;l+=2){const e=o[l];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(o.slice(4500,5e3)),n=e.width/r.length;for(let s=0;s<r.length;s++){const o=s*n,i=(r[s]+1)/2*e.height;0===s?t.moveTo(o,i):t.lineTo(o,i)}t.stroke(),document.body.appendChild(e)}return or(c.toString(16))})(e)),T=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,O=await sr(()=>window.screen.orientation?.type||null),A=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,I=A&&A.type||null,C=A?.effectiveType||null,N=!0===A?.saveData,P="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,D="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,x=await sr(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),q=await sr(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return ir(t)}),L={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:n||null,fonts:s,numberingSystem:o,languages:i,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:p,prefersContrast:f,prefersReducedTransparency:y,pdfViewerEnabled:P,webdriver:D,intlSupportedCalendars:x||null,permissionsState:q||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:m,devicePixelRatio:g,pixelDepth:v,colorDepth:w,touchSupport:b,screenOrientation:O||null,connectionType:I,effectiveType:C,saveData:N,canvasID:_,webglID:E,webgpuID:R,audioID:S},U={aspectRatio:T,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(L,U);const k=or(ir(L)),M=Math.round(performance.now()-t);return{fingerprint:k,...L,elapsedMs:M}};"undefined"!=typeof window&&(window.getBrowserFingerprint=ar);var cr=async(e,t)=>{if(e instanceof Be){try{const t=await e.response.json();if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},lr=n(void 0),ur=({props:e={},children:t})=>{const{organizationId:n,uid:s,fname:o,lname:i,theme:c="light"}=e,f=g(null),[v,w]=a(()=>{if("undefined"==typeof window)return null;if(s||o||i)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:b,data:_,error:E}=_e({queryKey:[er.QRATI_CONNECT_SESSION,n,s??null,o??null,i??null],queryFn:async()=>{const e=await(async()=>{const e=await ar();return"string"==typeof e?e:e?.fingerprint})();return(await Tt.post(Nt.INITIALIZE_SESSION,{json:{uid:s,fname:o,lname:i,browserFingerprint:e},headers:{"x-org-id":n,Authorization:s||o||i||!localStorage.getItem("qrati_token")?void 0:`Bearer ${localStorage.getItem("qrati_token")}`}}).json()).data},enabled:!!n});r(()=>{const e=_?.authSession?.session?.token,t=_?.authSession?.user;t&&e?(w({...t,token:e}),_?.organization?.customAuth||localStorage.setItem("qrati_token",e)):_?.organization?.customAuth&&s&&o&&i&&w(e=>e??{uid:s,name:`${o} ${i}`,fname:o,lname:i})},[_]);const R=u(()=>{const e=_?.organization?.integrationSettings?.fontFamily,t=d("https://qrati.com",e),r=p("https://qrati.com",n);return l(_?.organization?.integrationSettings,_?.organization?.customFontUrl?r||_.organization.customFontUrl:void 0,t||void 0)},[_?.organization?.integrationSettings,_?.organization?.customFontUrl,n]),S=async e=>{try{const t=await((e,t,r)=>new Promise((n,s)=>{if(!e)return void s(/* @__PURE__ */new Error("Provider is required"));if(!t)return void s(/* @__PURE__ */new Error("Organization ID is required"));const o=new URL(`${r}/qc-social-auth`);o.searchParams.set("provider",e),o.searchParams.set("organizationId",t),o.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(o.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void s(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const l=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:o,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(o){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),n({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),l(),c.close(),s(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),s(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),s(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),s(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,n??"","https://qrati.com");return t?.user&&t?.token&&(w({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t}catch(E){throw console.error("Social login error:",E),E}};if(E){const e=E;/* @__PURE__ */
|
|
33
|
-
return m(Ce,{fallback:null,children:/* @__PURE__ */m(rr,{organizationId:n??"",errorType:401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable"})})}return!_?.organization?.customAuth||s&&o&&i?/* @__PURE__ */m(lr.Provider,{value:{props:e,initializing:b,sessionId:_?.sessionId,organization:_?.organization,folders:_?.folders,loadingUser:b,user:v,updateUser:async e=>{w(t=>{const r={...t,...e};return r?.token&&localStorage.setItem("qrati_token",r.token),r})},registerUsingEmail:async(e,t,r,s)=>{try{const o=await Tt.post(Nt.REGISTER,{json:{email:e,password:t,fname:r,lname:s},headers:{"x-org-id":n}}).json();return o.error?{error:o.error}:(w({...o.user,token:o.token}),localStorage.setItem("qrati_token",o.token),o)}catch(E){return{error:await cr(E,"Registration failed")}}},loginWithGoogle:async()=>{try{return await S("google")}catch(E){throw console.error("Google login error:",E),E}},loginWithApple:async()=>{try{return await S("apple")}catch(E){throw console.error("Apple login error:",E),E}},loginUsingEmail:async(e,t)=>{try{const r=await Tt.post(Nt.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:(w({...r.user,token:r.token}),localStorage.setItem("qrati_token",r.token),r)}catch(E){return{error:await cr(E,"Invalid email or password")}}},sendPasswordResetCode:async e=>{try{const t=await Tt.post(Nt.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":n}}).json();return t.error?{error:t.error}:t}catch(E){return{error:await cr(E,"Failed to send password reset code")}}},verifyPasswordResetCode:async(e,t)=>{try{const r=await Tt.post(Nt.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:r}catch(E){return{error:await cr(E,"Invalid code, please check your email")}}},resetPassword:async(e,t)=>{try{const r=await Tt.post(Nt.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:r}catch(E){return{error:E?.message}}},signout:async()=>{try{const e=await Tt.post(Nt.LOGOUT,{headers:{"x-org-id":n,Authorization:`Bearer ${v?.token}`}}).json();return e.error?{error:e.error}:(localStorage.removeItem("qrati_token"),w(null),e)}catch(E){return console.error(E),{error:E?.message}}},error:E,portalContainer:f.current},children:/* @__PURE__ */m("div",{ref:f,id:"qrati-connect-container",style:{...y(_?.organization,c),fontFamily:"var(--font-family)"},className:h("bg-background text-foreground relative min-h-[80vh]"),children:
|
|
32
|
+
/* @__PURE__ */m("a",{className:"font-medium text-blue-500",href:At.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Integration Settings"}),". For more details please contact Qrati support."]})}var nr=e=>({google:"Google",apple:"Apple"}[e]||e.charAt(0).toUpperCase()+e.slice(1)),sr=async e=>{try{return await e()}catch{return null}},or=(e,t=1)=>{const r=(new TextEncoder).encode(e),n=3432918353,s=461845907;let o=t>>>0;const i=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<i;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,n),e=e<<15|e>>>17,e=Math.imul(e,s),o^=e,o=o<<13|o>>>19,o=Math.imul(o,5)+3864292196>>>0}let c=0;const l=4*i,u=3&r.length;return 3===u&&(c^=r[l+2]<<16),u>=2&&(c^=r[l+1]<<8),u>=1&&(c^=r[l],c=Math.imul(c,n),c=c<<15|c>>>17,c=Math.imul(c,s),o^=c),o^=r.length,o^=o>>>16,o=Math.imul(o,2246822507)>>>0,o^=o>>>13,o=Math.imul(o,3266489909)>>>0,o^=o>>>16,o.toString(16).padStart(8,"0")},ir=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(ir).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const n of t){const t=e[n];void 0!==t&&r.push(`${ir(n)}:${ir(t)}`)}return`{${r.join(",")}}`},ar=async({debug:e=!1}={})=>{const t=performance.now(),r=await sr(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?ir(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),n=await sr(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const n of t){const t=e.canPlayType(n);r[n]=""===t?"no":t}return ir(r)})()),s=await sr(()=>(()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const n={};for(const o of e)r.style.fontFamily=o,n[o]=r.offsetWidth;const s=[];for(const o of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${o}", ${i}`,r.offsetWidth!==n[i]){s.push(o),t=!0;break}t||(r.style.fontFamily=`"${o}"`,r.offsetWidth!==n.monospace&&r.offsetWidth!==n.serif&&s.push(o))}return document.body.removeChild(r),s.length?s.sort().join(","):null})()),o=await sr(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),i=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,a=Intl.DateTimeFormat().resolvedOptions(),c=a.timeZone,l=/* @__PURE__ */(new Date).getTimezoneOffset(),u=a.calendar||null,h=void 0!==a.hour12?a.hour12?"h12":"h23":a.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",f=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",y=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",m=window.matchMedia("(forced-colors: active)").matches?"active":null,g="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:v,colorDepth:w}=window.screen,b="ontouchstart"in window||window.navigator.maxTouchPoints>0,_=await sr(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),n=r.createLinearGradient(0,0,280,100);return n.addColorStop(0,"#f60"),n.addColorStop(.4,"#09f"),n.addColorStop(.7,"#f09"),n.addColorStop(1,"#0f9"),r.fillStyle=n,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),or(t.toDataURL("image/png"))})(e)),E=await sr(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return or(ir({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))})()),R=await sr(()=>(async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return or(ir(r))})(e)),S=await sr(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const n=t.createDynamicsCompressor();n.threshold.value=-48,n.knee.value=30,n.ratio.value=14,n.attack.value=0,n.release.value=.3;const s=t.createGain();s.gain.value=.4,r.connect(n),n.connect(s),s.connect(t.destination),r.start(0);const o=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let l=3e3;l<5800;l+=2){const e=o[l];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(o.slice(4500,5e3)),n=e.width/r.length;for(let s=0;s<r.length;s++){const o=s*n,i=(r[s]+1)/2*e.height;0===s?t.moveTo(o,i):t.lineTo(o,i)}t.stroke(),document.body.appendChild(e)}return or(c.toString(16))})(e)),T=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,O=await sr(()=>window.screen.orientation?.type||null),A=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,I=A&&A.type||null,C=A?.effectiveType||null,N=!0===A?.saveData,P="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,D="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,x=await sr(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),q=await sr(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return ir(t)}),L={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:n||null,fonts:s,numberingSystem:o,languages:i,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:p,prefersContrast:f,prefersReducedTransparency:y,pdfViewerEnabled:P,webdriver:D,intlSupportedCalendars:x||null,permissionsState:q||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:m,devicePixelRatio:g,pixelDepth:v,colorDepth:w,touchSupport:b,screenOrientation:O||null,connectionType:I,effectiveType:C,saveData:N,canvasID:_,webglID:E,webgpuID:R,audioID:S},U={aspectRatio:T,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(L,U);const k=or(ir(L)),M=Math.round(performance.now()-t);return{fingerprint:k,...L,elapsedMs:M}};"undefined"!=typeof window&&(window.getBrowserFingerprint=ar);var cr=async(e,t)=>{if(e instanceof Be){try{const t=await e.response.json();if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},lr=n(void 0),ur=({props:e={},children:t})=>{const{organizationId:n,uid:s,fname:o,lname:i,theme:c="light"}=e,f=g(null),[v,w]=a(()=>{if("undefined"==typeof window)return null;if(s||o||i)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:b,data:_,error:E}=_e({queryKey:[er.QRATI_CONNECT_SESSION,n,s??null,o??null,i??null],queryFn:async()=>{const e=await(async()=>{const e=await ar();return"string"==typeof e?e:e?.fingerprint})();return(await Tt.post(Nt.INITIALIZE_SESSION,{json:{uid:s,fname:o,lname:i,browserFingerprint:e},headers:{"x-org-id":n,Authorization:s||o||i||!localStorage.getItem("qrati_token")?void 0:`Bearer ${localStorage.getItem("qrati_token")}`}}).json()).data},enabled:!!n});r(()=>{const e=_?.authSession?.session?.token,t=_?.authSession?.user;t&&e?(w({...t,token:e}),_?.organization?.customAuth||localStorage.setItem("qrati_token",e)):_?.organization?.customAuth&&s&&o&&i&&w(e=>e??{uid:s,name:`${o} ${i}`,fname:o,lname:i})},[_]);const R=u(()=>{const e=_?.organization?.integrationSettings?.fontFamily,t=d("https://qrati.com",e),r=p("https://qrati.com",n);return l(_?.organization?.integrationSettings,_?.organization?.customFontUrl?r||_.organization.customFontUrl:void 0,t||void 0)},[_?.organization?.integrationSettings,_?.organization?.customFontUrl,n]);r(()=>{const e=`data-qrati-font-${n}`;if(document.head.querySelector(`[${e}]`)?.remove(),R){if(R.startsWith("@import")){const t=R.match(/@import url\("([^"]+)"\)/);if(!t?.[1])return;const r=document.createElement("link");r.rel="stylesheet",r.href=t[1],r.setAttribute(e,""),document.head.appendChild(r)}else{const t=document.createElement("style");t.textContent=R,t.setAttribute(e,""),document.head.appendChild(t)}return()=>{document.head.querySelector(`[${e}]`)?.remove()}}},[R,n]);const S=async e=>{try{const t=await((e,t,r)=>new Promise((n,s)=>{if(!e)return void s(/* @__PURE__ */new Error("Provider is required"));if(!t)return void s(/* @__PURE__ */new Error("Organization ID is required"));const o=new URL(`${r}/qc-social-auth`);o.searchParams.set("provider",e),o.searchParams.set("organizationId",t),o.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(o.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void s(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const l=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:o,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(o){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),n({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),l(),c.close(),s(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),s(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),s(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),s(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,n??"","https://qrati.com");return t?.user&&t?.token&&(w({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t}catch(E){throw console.error("Social login error:",E),E}};if(E){const e=E;/* @__PURE__ */
|
|
33
|
+
return m(Ce,{fallback:null,children:/* @__PURE__ */m(rr,{organizationId:n??"",errorType:401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable"})})}return!_?.organization?.customAuth||s&&o&&i?/* @__PURE__ */m(lr.Provider,{value:{props:e,initializing:b,sessionId:_?.sessionId,organization:_?.organization,folders:_?.folders,loadingUser:b,user:v,updateUser:async e=>{w(t=>{const r={...t,...e};return r?.token&&localStorage.setItem("qrati_token",r.token),r})},registerUsingEmail:async(e,t,r,s)=>{try{const o=await Tt.post(Nt.REGISTER,{json:{email:e,password:t,fname:r,lname:s},headers:{"x-org-id":n}}).json();return o.error?{error:o.error}:(w({...o.user,token:o.token}),localStorage.setItem("qrati_token",o.token),o)}catch(E){return{error:await cr(E,"Registration failed")}}},loginWithGoogle:async()=>{try{return await S("google")}catch(E){throw console.error("Google login error:",E),E}},loginWithApple:async()=>{try{return await S("apple")}catch(E){throw console.error("Apple login error:",E),E}},loginUsingEmail:async(e,t)=>{try{const r=await Tt.post(Nt.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:(w({...r.user,token:r.token}),localStorage.setItem("qrati_token",r.token),r)}catch(E){return{error:await cr(E,"Invalid email or password")}}},sendPasswordResetCode:async e=>{try{const t=await Tt.post(Nt.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":n}}).json();return t.error?{error:t.error}:t}catch(E){return{error:await cr(E,"Failed to send password reset code")}}},verifyPasswordResetCode:async(e,t)=>{try{const r=await Tt.post(Nt.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:r}catch(E){return{error:await cr(E,"Invalid code, please check your email")}}},resetPassword:async(e,t)=>{try{const r=await Tt.post(Nt.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:r}catch(E){return{error:E?.message}}},signout:async()=>{try{const e=await Tt.post(Nt.LOGOUT,{headers:{"x-org-id":n,Authorization:`Bearer ${v?.token}`}}).json();return e.error?{error:e.error}:(localStorage.removeItem("qrati_token"),w(null),e)}catch(E){return console.error(E),{error:E?.message}}},error:E,portalContainer:f.current},children:/* @__PURE__ */m("div",{ref:f,id:"qrati-connect-container",style:{...y(_?.organization,c),fontFamily:"var(--font-family)"},className:h("bg-background text-foreground relative min-h-[80vh]"),children:t})}):/* @__PURE__ */m(Ce,{fallback:null,children:/* @__PURE__ */m(rr,{organizationId:n??"",errorType:"custom-auth-invalid"})})},hr=()=>{const e=c(lr);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{x as $,jt as A,ye as B,kt as C,Ot as D,Ht as E,Ce as F,X as G,oe as H,Pe as I,G as J,Y as K,_e as L,Bt as M,Tt as N,er as O,Ue as P,q as Q,be as R,At as S,xt as T,se as U,le as V,ne as W,W as X,Q as Y,O as Z,Wt as _,Pt as a,H as at,Mt as b,Yt as c,Gt as d,D as et,Qt as f,Vt as g,Ut as h,nr as i,C as it,zt as j,Kt as k,Nt as l,Dt as m,hr as n,T as nt,Xt as o,_ as ot,Lt as p,B as q,ar as r,L as rt,Jt as s,b as st,ur as t,P as tt,Ft as u,Zt as v,qt as w,It as x,$t as y,me as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./BkE18wvt.js"),t=require("./
|
|
1
|
+
const e=require("./BkE18wvt.js"),t=require("./CSHWW4FM.js");let r=require("react");r=e.__toESM(r);var n=({as:e="div",className:r,threshold:n=.5,rootMargin:o="0px",triggerOnce:a,onChange:s,onClick:i,children:l})=>{const h=t.A(null),c=t.A(!1);return t.y(()=>{const e=h.current;if(!e)return;const t=new IntersectionObserver(e=>{e.forEach(e=>{a&&c.current||(e.isIntersecting&&(c.current=!0),s?.(e.isIntersecting))})},{threshold:n,rootMargin:o});return t.observe(e),()=>t.disconnect()},[n,o,s,a]),t.u(e,{ref:h,className:r,onClick:i,children:l})},o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],a=e=>{let t=0;for(let r=0;r<e.length;r++){let n=e[r];t=83*t+o.indexOf(n)}return t},s=e=>{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},i=e=>{let t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},l=(e,t)=>(e=>e<0?-1:1)(e)*Math.pow(Math.abs(e),t),h=class extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}},c=e=>{let t=e>>8&255,r=255&e;return[s(e>>16),s(t),s(r)]},u=(e,t)=>{let r=Math.floor(e/361),n=Math.floor(e/19)%19,o=e%19;return[l((r-9)/9,2)*t,l((n-9)/9,2)*t,l((o-9)/9,2)*t]},d=(e,t,r,n)=>{(e=>{if(!e||e.length<6)throw new h("The blurhash string must be at least 6 characters");let t=a(e[0]),r=Math.floor(t/9)+1,n=t%9+1;if(e.length!==4+2*n*r)throw new h(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*n*r}`)})(e),n|=1;let o=a(e[0]),s=Math.floor(o/9)+1,l=o%9+1,d=(a(e[1])+1)/166,p=new Array(l*s);for(let i=0;i<p.length;i++)p[i]=0===i?c(a(e.substring(2,6))):u(a(e.substring(4+2*i,6+2*i)),d*n);let f=4*t,g=new Uint8ClampedArray(f*r);for(let a=0;a<r;a++)for(let e=0;e<t;e++){let n=0,o=0,h=0;for(let i=0;i<s;i++)for(let s=0;s<l;s++){let c=Math.cos(Math.PI*e*s/t)*Math.cos(Math.PI*a*i/r),u=p[s+i*l];n+=u[0]*c,o+=u[1]*c,h+=u[2]*c}let c=i(n),u=i(o),d=i(h);g[4*e+0+a*f]=c,g[4*e+1+a*f]=u,g[4*e+2+a*f]=d,g[4*e+3+a*f]=255}return g},p=Object.defineProperty,f=Object.defineProperties,g=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,y=(e,t,r)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))m.call(t,r)&&y(e,r,t[r]);if(b)for(var r of b(t))w.call(t,r)&&y(e,r,t[r]);return e},M=(e,t)=>f(e,g(t)),j=(e,t)=>{var r={};for(var n in e)m.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&b)for(var n of b(e))t.indexOf(n)<0&&w.call(e,n)&&(r[n]=e[n]);return r},O=class extends r.PureComponent{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:r,width:n}=this.props;if(this.canvas){let o=d(e,n,t,r),a=this.canvas.getContext("2d"),s=a.createImageData(n,t);s.data.set(o),a.putImageData(s,0,0)}}}componentDidUpdate(){this.draw()}render(){let e=this.props,{hash:t,height:n,width:o}=e,a=j(e,["hash","height","width"]);return r.createElement("canvas",M(v({},a),{height:n,width:o,ref:this.handleRef}))}};O.defaultProps={height:128,width:128};var x={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"},C=class extends r.PureComponent{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let e=this.props,{hash:t,height:n,width:o,punch:a,resolutionX:s,resolutionY:i,style:l}=e,h=j(e,["hash","height","width","punch","resolutionX","resolutionY","style"]);return r.createElement("div",M(v({},h),{style:M(v({display:"inline-block",height:n,width:o},l),{position:"relative"})}),r.createElement(O,{hash:t,height:i,width:s,punch:a,style:x}))}};C.defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var P=O,E=({src:e,alt:r,threshold:o=.1,rootMargin:a="200px 0px",blurhash:s,containerClassName:i="size-full",wrapperClassName:l,imgClassName:h="",sizeMode:c="cover",position:u="center",delayMs:d=100,delayTime:p,onClick:f})=>{const g=s&&s.length>=6?s:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[b,m]=t.d(!1),[w,y]=t.d(!1),[v,M]=t.d(!1),j=t.A(null),O="number"==typeof p?p:d,x=l??i;t.y(()=>{if(!b)return v?j.current=window.setTimeout(()=>{y(!0)},O):j.current&&(clearTimeout(j.current),j.current=null),()=>{j.current&&clearTimeout(j.current)}},[v,b,O]);const C=w&&v||b;return t.u(n,{as:"div",className:t.cn(x,"relative overflow-hidden"),threshold:o,rootMargin:a,onChange:e=>M(e),children:[!b&&t.u(P,{className:"size-full blur-2xl",hash:g}),C&&e&&t.u("img",{alt:r,src:e,onLoad:()=>m(!0),className:t.cn("absolute top-0 left-0 size-full object-center transition-all duration-300",b?"scale-100 opacity-100":"scale-95 opacity-0","contain"===c?"object-contain":"object-cover","top"===u?"object-top":"bottom"===u?"object-bottom":"object-center",h),onClick:e=>f?.(e)})]})};Object.defineProperty(exports,"InView",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"LazyLoadImage",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return d}});
|