@qratilabs/qrati-connect 2.31.1 → 2.32.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/element/{DKxH7j1t2.js → 2MdYrk27.js} +7 -7
- package/element/2OzBYBrP.js +2 -0
- package/element/BIsp1V4q2.js +8 -0
- package/element/BJPVMd4a2.js +4 -0
- package/element/BKaxn8Ij2.js +5 -0
- package/element/BNAv4_JK.js +1 -0
- package/element/{BNaRcekR2.js → BVHdG-zf.js} +1 -1
- package/element/BiHVoIWk.js +2 -0
- package/element/BoLYE0I62.js +8 -0
- package/element/BpI67z3l.js +2 -0
- package/element/C84zcse72.js +1 -0
- package/element/CBL1xGp_.js +3 -0
- package/element/CF0gkb5T.js +4 -0
- package/element/CZvzyHMc2.js +3 -0
- package/element/Cf-ikOp2.js +2 -0
- package/element/{Be3fjihP2.js → Cl4c-3Xk.js} +3 -3
- package/element/CnExGazE2.js +14 -0
- package/element/CopVS738.js +5 -0
- package/element/Cte8DkX6.js +199 -0
- package/element/{BALdepDv.js → CvtQzVtn2.js} +7 -7
- package/element/Cyp_H6gp.js +8 -0
- package/element/D4ceMHZo2.js +8 -0
- package/element/D5ovViER2.js +3 -0
- package/element/{fQmLbYcp2.js → D92x_spc.js} +1 -1
- package/element/DDJfCP8g.js +16 -0
- package/element/DEzMsBix2.js +4 -0
- package/element/DGLG5AUs.js +36 -0
- package/element/Dav-zijp2.js +17 -0
- package/element/DtjeZIUE.js +32 -0
- package/element/DzMVgwWt.js +1 -0
- package/element/{7IEzYICH2.js → Xf-0nxUX.js} +24 -24
- package/element/YBIepScM.js +2 -0
- package/element/{Ot24jlyb2.js → Yvb3c4w2.js} +1 -1
- package/element/Za2nuDJ4.js +1 -0
- package/element/{DMnbtDXS2.js → dgI0MGWo.js} +1 -1
- package/element/khLYL0ji.js +1 -0
- package/element/{D2-DJv4T2.js → krvWvnLh2.js} +1 -1
- package/element/{Ba8sCyeC2.js → sLC4EOUq.js} +93 -93
- package/element/web.es.js +1 -48
- package/element/{BF7pLcqs.js → yhFHMaGN2.js} +85 -85
- package/embed/embed.js +1 -1
- package/package.json +2 -2
- package/element/7fZbqbYO2.js +0 -5
- package/element/8QLGsYN7.js +0 -11
- package/element/9E5bMl4h.js +0 -1
- package/element/B7bKBLKV2.js +0 -9
- package/element/BGo2VsHN2.js +0 -36
- package/element/BK_hWmGs.js +0 -5
- package/element/BUd_JUBh.js +0 -8
- package/element/BVxovwox.js +0 -1
- package/element/BXMw4kNf.js +0 -1
- package/element/Bb9ydqSB.js +0 -1
- package/element/BgZyx8Pz.js +0 -3
- package/element/BkIDQGIs.js +0 -1
- package/element/Bki5T_lb.js +0 -1
- package/element/BqPiuAuP.js +0 -2
- package/element/BrDFXZq12.js +0 -2
- package/element/BuhJHzFX.js +0 -1
- package/element/BwHTzCpH.js +0 -8
- package/element/BxQf2Aj9.js +0 -1
- package/element/BxZobjC-.js +0 -2
- package/element/C0eP2utz.js +0 -2
- package/element/C2WFktw12.js +0 -3
- package/element/CDSgxlAB.js +0 -1
- package/element/CIcQE2CN2.js +0 -1
- package/element/CQMPBmQq2.js +0 -3
- package/element/CS8uERGc.js +0 -1
- package/element/CTikdrXC.js +0 -80
- package/element/CXRH3zmy.js +0 -1
- package/element/CcyeEIVb2.js +0 -16
- package/element/CdivXyOP.js +0 -41
- package/element/CfszNu_Q.js +0 -17
- package/element/Ci9PI8hK2.js +0 -39
- package/element/Clga4U4Y.js +0 -4
- package/element/Cnr4EYcL.js +0 -3
- package/element/Cyknlxbq.js +0 -8
- package/element/Cz6OP78x2.js +0 -14
- package/element/DIWjXG_0.js +0 -1
- package/element/DLHvSz1a2.js +0 -1
- package/element/DXjc6xIy.js +0 -2
- package/element/DeK1vU3V2.js +0 -1
- package/element/Dl6jcv9I.js +0 -5
- package/element/DmpmrPE5.js +0 -1
- package/element/DqAzUQcH.js +0 -1
- package/element/Dstt_bTH.js +0 -2
- package/element/IK19gQaC.js +0 -8
- package/element/JY9kGm742.js +0 -2
- package/element/L4hWU3Nc.js +0 -1
- package/element/QxKjlE-j.js +0 -2
- package/element/cBUXG_uS.js +0 -1
- package/element/e2mrPlw-.js +0 -4
- package/element/p4NDlPrf.js +0 -7
- package/element/ydzHqf5r.js +0 -3
- /package/element/{1dmOpMwn2.js → 1dmOpMwn.js} +0 -0
- /package/element/{BUDCYszs.js → BUDCYszs2.js} +0 -0
- /package/element/{BYM2GyVF2.js → BYM2GyVF.js} +0 -0
- /package/element/{Bo39kG4k2.js → Bo39kG4k.js} +0 -0
- /package/element/{CfMNBPpx.js → CfMNBPpx2.js} +0 -0
- /package/element/{CtxIOzTC2.js → CtxIOzTC.js} +0 -0
- /package/element/{DnIueBGr.js → DnIueBGr2.js} +0 -0
package/element/CdivXyOP.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{E as e,_ as t,h as r,p as n,r as i,s,t as o,v as a,y as c}from"./BXMw4kNf.js";import{n as l,t as u}from"./DmpmrPE5.js";import{S as h,h as d,i as f}from"./Bb9ydqSB.js";var p=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(){}},m=new class extends p{#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}},g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},y=new class{#n=g;#i=!1;setTimeoutProvider(e){this.#n=e}setTimeout(e,t){return this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},v="undefined"==typeof window||"Deno"in globalThis;function w(){}function b(e,t){return"function"==typeof e?e(t):e}function S(e){return"number"==typeof e&&e>=0&&e!==1/0}function R(e,t){return Math.max(e+(t||0)-Date.now(),0)}function I(e,t){return"function"==typeof e?e(t):e}function O(e,t){return"function"==typeof e?e(t):e}function T(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o)if(n){if(t.queryHash!==E(o,t.options))return!1}else if(!A(t.queryKey,o))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||i&&i!==t.state.fetchStatus||s&&!s(t))}function C(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(k(t.options.mutationKey)!==k(s))return!1}else if(!A(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function E(e,t){return(t?.queryKeyHashFn||k)(e)}function k(e){return JSON.stringify(e,(e,t)=>M(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function A(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>A(e[r],t[r]))}var x=Object.prototype.hasOwnProperty;function F(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=D(e)&&D(t);if(!(n||M(e)&&M(t)))return t;const i=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),o=s.length,a=n?new Array(o):{};let c=0;for(let l=0;l<o;l++){const o=n?l:s[l],u=e[o],h=t[o];if(u===h){a[o]=u,(n?l<i:x.call(e,o))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[o]=h;continue}const d=F(u,h,r+1);a[o]=d,d===u&&c++}return i===o&&c===i?e:a}function P(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 D(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function M(e){if(!q(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!q(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function q(e){return"[object Object]"===Object.prototype.toString.call(e)}function U(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?F(e,t):t}function Q(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function L(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var j=/* @__PURE__ */Symbol();function _(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==j?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function z(e,t){return"function"==typeof e?e(...t):!!e}var N=/* @__PURE__ */(()=>{let e=()=>v;return{isServer:()=>e(),setIsServer(t){e=t}}})();function $(){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 H=function(e){setTimeout(e,0)},V=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=H;const s=n=>{t?e.push(n):i(()=>{r(n)})};return{batch:s=>{let o;t++;try{o=s()}finally{t--,t||(()=>{const t=e;e=[],t.length&&i(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return o},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}(),W=new class extends p{#s=!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.#s!==e&&(this.#s=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#s}};function G(e){return Math.min(1e3*2**e,3e4)}function Z(e){return"online"!==(e??"online")||W.isOnline()}var K=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function B(e){let t,r=!1,n=0;const i=$(),s=()=>"pending"!==i.status,o=()=>m.isFocused()&&("always"===e.networkMode||W.isOnline())&&e.canRun(),a=()=>Z(e.networkMode)&&e.canRun(),c=e=>{s()||(t?.(),i.resolve(e))},l=e=>{s()||(t?.(),i.reject(e))},u=()=>new Promise(r=>{t=e=>{(s()||o())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,s()||e.onContinue?.()}),h=()=>{if(s())return;let t;const i=0===n?e.initialPromise:void 0;try{t=i??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(s())return;const i=e.retry??(N.isServer()?0:3),a=e.retryDelay??G,c="function"==typeof a?a(n,t):a,d=!0===i||"number"==typeof i&&n<i||"function"==typeof i&&i(n,t);var f;!r&&d?(n++,e.onFail?.(n,t),(f=c,new Promise(e=>{y.setTimeout(e,f)})).then(()=>o()?void 0:u()).then(()=>{r?l(t):h()})):l(t)})};return{promise:i,status:()=>i.status,cancel:t=>{if(!s()){const r=new K(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?h():u().then(h),i)}}var J=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S(this.gcTime)&&(this.#o=y.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(N.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#o&&(y.clearTimeout(this.#o),this.#o=void 0)}};function Y(e){return{onFetch:(t,r)=>{const n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let r=!1;const l=e=>{!function(e,r,n){let i,s=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t.signal,s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)})}(e,0,()=>r=!0)},u=_(t.options,t.fetchOptions),h=async(e,n,i)=>{if(r)return Promise.reject(t.signal.reason);if(null==n&&e.pages.length)return Promise.resolve(e);const s=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta};return l(e),e})(),o=await u(s),{maxPages:a}=t.options,c=i?L:Q;return{pages:c(e.pages,o,a),pageParams:c(e.pageParams,n,a)}};if(i&&s.length){const e="backward"===i,t=e?ee:X,r={pages:s,pageParams:o};a=await h(r,t(n,r),e)}else{const t=e??s.length;do{const e=0===c?o[0]??n.initialPageParam:X(n,a);if(c>0&&null==e)break;a=await h(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function X(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function ee(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function te(e,t){return!!t&&null!=X(e,t)}function re(e,t){return!(!t||!e.getPreviousPageParam)&&null!=ee(e,t)}var ne=class extends J{#a;#c;#l;#u;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#u=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#c=oe(this.options),this.state=e.state??this.#c,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#a}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#a=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=oe(this.options);void 0!==e.data&&(this.setState(se(e.data,e.dataUpdatedAt)),this.#c=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const r=U(this.state.data,e,this.options);return this.#m({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#m({type:"setState",state:e})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#c}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==O(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===I(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||!R(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p||this.#g()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#g(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},i=()=>{const e=_(this.options,t),r=(()=>{const e={client:this.#h,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)},s=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:i};return n(e),e})();("infinite"===this.#a?Y(this.options.pages):this.options.behavior)?.onFetch(s,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===s.fetchOptions?.meta||this.#m({type:"fetch",meta:s.fetchOptions?.meta}),this.#d=B({initialPromise:t?.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof K&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(o){if(o instanceof K){if(o.silent)return this.#d.promise;if(o.revert){if(void 0===this.state.data)throw o;return this.state.data}}throw this.#m({type:"error",error:o}),this.#u.config.onError?.(o,this),this.#u.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#m(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,...se(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=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),V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function ie(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function se(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function oe(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 ae=class extends p{constructor(e,t){super(),this.options=t,this.#h=e,this.#y=null,this.#v=$(),this.bindMethods(),this.setOptions(t)}#h;#w=void 0;#b=void 0;#S=void 0;#R;#I;#v;#y;#O;#T;#C;#E;#k;#A;#x=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),ce(this.#w,this.options)?this.#F():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return le(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return le(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#D(),this.#M(),this.#w.removeObserver(this)}setOptions(e){const t=this.options,r=this.#w;if(this.options=this.#h.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof O(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#w.setOptions(this.options),t._defaulted&&!P(this.options,t)&&this.#h.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const n=this.hasListeners();n&&ue(this.#w,r,this.options,t)&&this.#F(),this.updateResult(),!n||this.#w===r&&O(this.options.enabled,this.#w)===O(t.enabled,this.#w)&&I(this.options.staleTime,this.#w)===I(t.staleTime,this.#w)||this.#U();const i=this.#Q();!n||this.#w===r&&O(this.options.enabled,this.#w)===O(t.enabled,this.#w)&&i===this.#A||this.#L(i)}getOptimisticResult(e){const t=this.#h.getQueryCache().build(this.#h,e),r=this.createResult(t,e);var n;return n=r,P(this.getCurrentResult(),n)||(this.#S=r,this.#I=this.options,this.#R=this.#w.state),r}getCurrentResult(){return this.#S}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.#v.status||this.#v.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#x.add(e)}getCurrentQuery(){return this.#w}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#h.defaultQueryOptions(e),r=this.#h.getQueryCache().build(this.#h,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#F({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#S))}#F(e){this.#q();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(w)),t}#U(){this.#D();const e=I(this.options.staleTime,this.#w);if(N.isServer()||this.#S.isStale||!S(e))return;const t=R(this.#S.dataUpdatedAt,e)+1;this.#E=y.setTimeout(()=>{this.#S.isStale||this.updateResult()},t)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#L(e){this.#M(),this.#A=e,!N.isServer()&&!1!==O(this.options.enabled,this.#w)&&S(this.#A)&&0!==this.#A&&(this.#k=y.setInterval(()=>{(this.options.refetchIntervalInBackground||m.isFocused())&&this.#F()},this.#A))}#P(){this.#U(),this.#L(this.#Q())}#D(){void 0!==this.#E&&(y.clearTimeout(this.#E),this.#E=void 0)}#M(){void 0!==this.#k&&(y.clearInterval(this.#k),this.#k=void 0)}createResult(e,t){const r=this.#w,n=this.options,i=this.#S,s=this.#R,o=this.#I,a=e!==r?e.state:this.#b,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const i=this.hasListeners(),s=!i&&ce(e,t),o=i&&ue(e,r,t,n);(s||o)&&(u={...u,...ie(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=u;l=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===p){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#C?.state.data,this.#C):t.placeholderData,void 0!==e&&(p="success",l=U(i?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!m)if(i&&l===s?.data&&t.select===this.#O)l=this.#T;else try{this.#O=t.select,l=t.select(l),l=U(i?.data,l,t),this.#T=l,this.#y=null}catch(R){this.#y=R}this.#y&&(d=this.#y,l=this.#T,f=Date.now(),p="error");const g="fetching"===u.fetchStatus,y="pending"===p,v="error"===p,w=y&&g,b=void 0!==l,S={status:p,fetchStatus:u.fetchStatus,isPending:y,isSuccess:"success"===p,isError:v,isInitialLoading:w,isLoading:w,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!y,isLoadingError:v&&!b,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:v&&b,isStale:he(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==O(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==S.data,n="error"===S.status&&!t,i=e=>{n?e.reject(S.error):t&&e.resolve(S.data)},s=()=>{const e=this.#v=S.promise=$();i(e)},o=this.#v;switch(o.status){case"pending":e.queryHash===r.queryHash&&i(o);break;case"fulfilled":(n||S.data!==o.value)&&s();break;case"rejected":n&&S.error===o.reason||s()}}return S}updateResult(){const e=this.#S,t=this.createResult(this.#w,this.options);this.#R=this.#w.state,this.#I=this.options,void 0!==this.#R.data&&(this.#C=this.#w),P(t,e)||(this.#S=t,this.#j({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#x.size)return!0;const n=new Set(r??this.#x);return this.options.throwOnError&&n.add("error"),Object.keys(this.#S).some(t=>{const r=t;return this.#S[r]!==e[r]&&n.has(r)})})()}))}#q(){const e=this.#h.getQueryCache().build(this.#h,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#b=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#j(e){V.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#S)}),this.#h.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})})}};function ce(e,t){return function(e,t){return!1!==O(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===O(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&le(e,t,t.refetchOnMount)}function le(e,t,r){if(!1!==O(t.enabled,e)&&"static"!==I(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&he(e,t)}return!1}function ue(e,t,r,n){return(e!==t||!1===O(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&he(e,r)}function he(e,t){return!1!==O(t.enabled,e)&&e.isStaleByTime(I(t.staleTime,e))}var de=e(void 0),fe=e=>{const t=c(de);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},pe=({client:e,children:r})=>(t(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */o(de.Provider,{value:e,children:r})),me=e(!1);me.Provider;var ge=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),ye=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ve(e,n,s){const o=c(me),l=c(ge),u=fe(s),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const d=u.getQueryCache().get(h.queryHash),f=!1!==e.subscribed;h._optimisticResults=o?"isRestoring":f?"optimistic":void 0,(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))}})(h),((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))})(h,l,d),(e=>{t(()=>{e.clearReset()},[e])})(l);const p=!u.getQueryCache().get(h.queryHash),[m]=r(()=>new n(u,h)),g=m.getOptimisticResult(h),y=!o&&f;if(i(a(e=>{const t=y?m.subscribe(V.batchCalls(e)):w;return m.updateResult(),t},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),t(()=>{m.setOptions(h)},[h,m]),((e,t)=>e?.suspense&&t.isPending)(h,g))throw ye(h,m,l);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&void 0===e.data||z(r,[e.error,n])))({result:g,errorResetBoundary:l,throwOnError:h.throwOnError,query:d,suspense:h.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,g),h.experimental_prefetchInRender&&!N.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(g,o)&&(p?ye(h,m,l):d?.promise)?.catch(w).finally(()=>{m.updateResult()}),h.notifyOnChangeProps?g:m.trackResult(g)}function we(e,t){return ve(e,ae,t)}var be=null;function Se(e){be=e}function Re(e){try{const t=JSON.stringify(e);fetch(f.REPORT_ERROR,{method:"POST",headers:{"Content-Type":"application/json",...be?{"x-org-id":be}:{}},body:t,keepalive:!0}).catch(()=>{})}catch{}}function Ie(e,t){Re({message:e instanceof Error?e.message:String(e),stack:e instanceof Error?e.stack:void 0,level:t?.level??"error",component:t?.component,tags:t?.tags,context:t?.extra,url:"undefined"!=typeof window?window.location.href:void 0,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0})}function Oe(e,t="info",r){Re({message:e,level:t,component:r?.component,tags:r?.tags,context:r?.extra,url:"undefined"!=typeof window?window.location.href:void 0,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0})}function Te({title:e,children:t}){/* @__PURE__ */
|
|
2
|
-
return o("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */o("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__ */o("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
3
|
-
/* @__PURE__ */o("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
|
-
/* @__PURE__ */o("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"}),
|
|
5
|
-
/* @__PURE__ */o("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
|
|
6
|
-
/* @__PURE__ */o("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
|
|
7
|
-
/* @__PURE__ */o("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
|
|
8
|
-
/* @__PURE__ */o("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
|
|
9
|
-
/* @__PURE__ */o("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
|
|
10
|
-
/* @__PURE__ */o("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
|
|
11
|
-
/* @__PURE__ */o("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
|
|
12
|
-
/* @__PURE__ */o("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
|
|
13
|
-
/* @__PURE__ */o("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
|
|
14
|
-
/* @__PURE__ */o("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
|
|
15
|
-
/* @__PURE__ */o("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
|
|
16
|
-
/* @__PURE__ */o("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
|
|
17
|
-
/* @__PURE__ */o("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
|
|
18
|
-
/* @__PURE__ */o("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
|
|
19
|
-
/* @__PURE__ */o("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
|
|
20
|
-
/* @__PURE__ */o("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
|
|
21
|
-
/* @__PURE__ */o("g",{transform:"translate(696.754 297.373)",children:[
|
|
22
|
-
/* @__PURE__ */o("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
|
|
23
|
-
/* @__PURE__ */o("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
|
|
24
|
-
/* @__PURE__ */o("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
|
|
25
|
-
/* @__PURE__ */o("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
|
|
26
|
-
/* @__PURE__ */o("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
|
|
27
|
-
/* @__PURE__ */o("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
|
|
28
|
-
/* @__PURE__ */o("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
|
|
29
|
-
/* @__PURE__ */o("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__ */o("div",{className:"space-y-4",children:[/* @__PURE__ */o("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */o("p",{className:"text-muted-foreground text-center",children:t})]})]})}var Ce=({organizationId:e})=>/* @__PURE__ */o("a",{className:"font-medium text-blue-500",href:d.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Guide"});function Ee({organizationId:e,errorType:t,errorMessage:r}){/* @__PURE__ */
|
|
30
|
-
return o(Te,"custom-auth-invalid"===t?{title:"Setup needed",children:["Custom auth is enabled. Pass ",
|
|
31
|
-
/* @__PURE__ */o("code",{children:"uid"}),", ",
|
|
32
|
-
/* @__PURE__ */o("code",{children:"fname"}),", and ",
|
|
33
|
-
/* @__PURE__ */o("code",{children:"lname"})," as props to QratiConnect to complete setup. See our ",
|
|
34
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," for details."]}:"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! See our"," ",
|
|
35
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," if you need help in the meantime."]}:"generic-error"===t&&r?{title:"Setup needed",children:[r," See our ",
|
|
36
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," for details."]}:"page-not-registered"===t?{title:"Page not registered",children:["Add the current page URL in Allowed URLs under"," ",
|
|
37
|
-
/* @__PURE__ */o("a",{className:"font-medium text-blue-500",href:d.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨ Integration Settings. See our ",
|
|
38
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," for details."]}:{title:"Heads up",children:["Something needs attention. See our ",
|
|
39
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," for details or contact Qrati support."]})}var ke='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Ae=e=>e.trim().replace(/\s+/g," "),xe=e=>e?.replace(/\/+$/,"")||"",Fe=e=>{if(!e)return ke;const t=Ae("string"==typeof e?e:e.fontFamily||""),r="string"==typeof e?void 0:e.customFontName;return t&&"system"!==t?"custom"===t?`"${r||"QratiCustomFont"}", ${ke}`:`"${t}", ${ke}`:"inherit"};function Pe(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Pe(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function De(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Pe(e))&&(n&&(n+=" "),n+=t);return n}var Me=(...e)=>De(e.filter(Boolean)),qe=e=>{const t=e.replace(/#/g,"");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"},Ue="px",Qe=(e,t="light")=>{const r=e?.themeSettings?.colors??{},n=e?.themeSettings?.border,i=e?.themeSettings?.shadow,s=e?.integrationSettings,o="dark"===t,a=(e,t,n,i)=>{const s=o?i:n;return r[o?t:e]||s},c=a("primaryLight","primaryDark","#ff4800","#ff4800");return{"--background":a("backgroundLight","backgroundDark","#fafafa","#0a0a0a"),"--foreground":a("foregroundLight","foregroundDark","#252629","#f5f5f5"),"--muted":a("mutedLight","mutedDark","#e5e5e5","#171717"),"--muted-foreground":a("mutedForegroundLight","mutedForegroundDark","#484848","#b5b8bb"),"--border":a("borderLight","borderDark","#dddddd","#353538"),"--input":a("inputLight","inputDark","#f5f5f5","#171717"),"--primary":c,"--primary-foreground":qe(c),"--popover":a("popoverLight","popoverDark","#f5f5f5","#171717"),"--popover-foreground":a("popoverForegroundLight","popoverForegroundDark","#252629","#fafafa"),"--info":a("infoLight","infoDark","#2563eb","#5b8def"),"--warning":a("warningLight","warningDark","#f59e0b","#fbbf24"),"--success":a("successLight","successDark","#10b981","#34d399"),"--destructive":a("destructiveLight","destructiveDark","#ef4444","#f87171"),"--border-width":`${n?.width??"1"}${n?.unit??"px"}`,"--radius":`${n?.radius??"10"}${n?.unit??"px"}`,"--shadow-outer-horizontal-offset":`${i?.outerHorizontalOffset??"0"}${i?.unit??Ue}`,"--shadow-outer-vertical-offset":`${i?.outerVerticalOffset??"0"}${i?.unit??Ue}`,"--shadow-outer-blur":`${i?.outerBlur??"0"}${i?.unit??Ue}`,"--shadow-outer-spread":`${i?.outerSpread??"0"}${i?.unit??Ue}`,...s?.fontFamily&&"system"!==s.fontFamily?{"--font-family":Fe(s)}:{}}},Le=async e=>{try{return await e()}catch{return null}},je=(e,t=1)=>{const r=(new TextEncoder).encode(e),n=3432918353,i=461845907;let s=t>>>0;const o=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<o;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,n),e=e<<15|e>>>17,e=Math.imul(e,i),s^=e,s=s<<13|s>>>19,s=Math.imul(s,5)+3864292196>>>0}let c=0;const l=4*o,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,i),s^=c),s^=r.length,s^=s>>>16,s=Math.imul(s,2246822507)>>>0,s^=s>>>13,s=Math.imul(s,3266489909)>>>0,s^=s>>>16,s.toString(16).padStart(8,"0")},_e=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(_e).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const n of t){const t=e[n];void 0!==t&&r.push(`${_e(n)}:${_e(t)}`)}return`{${r.join(",")}}`},ze=async({debug:e=!1}={})=>{const t=performance.now(),r=await Le(async()=>{if(!window.navigator.userAgentData||"function"!=typeof window.navigator.userAgentData.getHighEntropyValues)return null;const e=await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"]);return _e(e)}),n=await Le(()=>(()=>{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 _e(r)})()),i=await Le(()=>(()=>{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 s of e)r.style.fontFamily=s,n[s]=r.offsetWidth;const i=[];for(const s of t){let t=!1;for(const o of e)if(r.style.fontFamily=`"${s}", ${o}`,r.offsetWidth!==n[o]){i.push(s),t=!0;break}t||(r.style.fontFamily=`"${s}"`,r.offsetWidth!==n.monospace&&r.offsetWidth!==n.serif&&i.push(s))}return document.body.removeChild(r),i.length?i.sort().join(","):null})()),s=await Le(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),o=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",f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",m=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",g=window.matchMedia("(forced-colors: active)").matches?"active":null,y="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,S=await Le(()=>(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);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));const i=t.toDataURL("image/png");return je(i)})(e)),R=await Le(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info"),n={vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)};return je(_e(n))})()),I=await Le(()=>(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 je(_e(r))})(e)),O=await Le(()=>(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 i=t.createGain();i.gain.value=.4,r.connect(n),n.connect(i),i.connect(t.destination),r.start(0);const s=(await t.startRendering()).getChannelData(0);let o=0,a=0;for(let l=3e3;l<5800;l+=2){const e=s[l];o=31*o+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=o>>>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(s.slice(4500,5e3)),n=e.width/r.length;for(let i=0;i<r.length;i++){const s=i*n,o=(r[i]+1)/2*e.height;0===i?t.moveTo(s,o):t.lineTo(s,o)}t.stroke(),document.body.appendChild(e)}return je(c.toString(16))})(e)),T=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,C=await Le(()=>window.screen.orientation?.type||null),E=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,k=E&&E.type||null,A=E?.effectiveType||null,x=!0===E?.saveData,F="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,P="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,D=await Le(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),M=await Le(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 _e(t)}),q={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:n||null,fonts:i,numberingSystem:s,languages:o,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:f,prefersContrast:p,prefersReducedTransparency:m,pdfViewerEnabled:F,webdriver:P,intlSupportedCalendars:D||null,permissionsState:M||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:g,devicePixelRatio:y,pixelDepth:v,colorDepth:w,touchSupport:b,screenOrientation:C||null,connectionType:k,effectiveType:A,saveData:x,canvasID:S,webglID:R,webgpuID:I,audioID:O},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(q,U);const Q=_e(q),L=je(Q),j=Math.round(performance.now()-t);return{fingerprint:L,...q,elapsedMs:j}};"undefined"!=typeof window&&(window.getBrowserFingerprint=ze);var Ne=e=>e?`qrati_token:${e}`:"qrati_token",$e=e=>e?.trim()||void 0,He=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Ve=async(e,t)=>{if(e instanceof l){try{const t=e.data;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)},We=e(void 0),Ge=({props:e={},children:i})=>{const{organizationId:c,uid:d,fname:p,lname:m,theme:g="light"}=e,y=fe(),[v,w]=r(null);t(()=>(Se(c??null),()=>Se(null)),[c]);const[b,S]=r(()=>{if("undefined"==typeof window)return null;const e=localStorage.getItem(Ne(c));return e?{token:e}:null}),[R,I]=r(0),{isLoading:O,data:T,error:C}=we({queryKey:[h.QRATI_CONNECT_SESSION,c,d??null,p??null,m??null,R],queryFn:()=>(async({organizationId:e,uid:t,fname:r,lname:n,userToken:i})=>{const s=e.trim();if(!s)throw new Error("Organization ID is required for session initialization");const o=$e(t),a=$e(r),c=$e(n),h=(({userToken:e,uid:t,fname:r,lname:n})=>!e||t||r||n?null:e)({organizationId:s,uid:o,fname:a,lname:c,userToken:i}),d=await(async()=>{const e=await ze();return"string"==typeof e?e:e?.fingerprint})();try{const e=await u.post(f.INITIALIZE_SESSION,{json:{uid:o,fname:a,lname:c,browserFingerprint:d},headers:{"x-org-id":s,...h?{Authorization:`Bearer ${h}`}:{}}}).json();if(!He(e)||!He(e.data))throw new Error("Invalid session initialization response");const t=e.data;if("string"!=typeof t.sessionId||!He(t.organization)||!Array.isArray(t.folders)||void 0!==t.authSession&&null!==t.authSession&&!He(t.authSession)||void 0!==t.orgRole&&null!==t.orgRole&&"string"!=typeof t.orgRole)throw new Error("Invalid session initialization response");return{...t,requestToken:h}}catch(p){if(p instanceof l)try{const e=p.data;p.apiMessage=e?.message||e?.error}catch{}throw p}})({organizationId:c,uid:d,fname:p,lname:m,userToken:b?.token}),enabled:!!c,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1});t(()=>{T&&(({data:e,setUser:t,uid:r,fname:n,lname:i,organizationId:s})=>{const o=(({data:e,uid:t,fname:r,lname:n})=>{const i=e.authSession?.session?.token??e.authSession?.token,s=e.authSession?.user;return s&&i?{kind:"authenticated",sessionUser:s,sessionToken:i}:e.organization?.customAuth&&t&&r?{kind:"custom-auth",fallbackUser:{_id:t,uid:t,name:n?`${r} ${n}`:r,fname:r,lname:n}}:e.requestToken?{kind:"expired",requestToken:e.requestToken}:{kind:"none"}})({data:e,uid:r,fname:n,lname:i});"authenticated"===o.kind?(t(e=>({...e,...o.sessionUser,token:o.sessionToken,tcAccepted:void 0===o.sessionUser.tcAccepted?e?.tcAccepted:o.sessionUser.tcAccepted})),localStorage.setItem(Ne(s),o.sessionToken)):"custom-auth"===o.kind?t(e=>e??o.fallbackUser):"expired"===o.kind&&t(e=>e?.token!==o.requestToken?e:(localStorage.removeItem(Ne(s)),null))})({data:T,setUser:S,uid:d,fname:p,lname:m,organizationId:c})},[T]);const E=n(()=>{const e=T?.organization?.integrationSettings?.fontFamily,t=((e,t)=>{const r=xe("https://qrati.com"),n=t?Ae(t):"";return r&&n?`${r}/api/connect/organization/google-font?family=${encodeURIComponent(n)}`:null})(0,e),r=((e,t)=>{const r=xe("https://qrati.com");return r&&t?`${r}/api/connect/organization/custom-font?organizationId=${encodeURIComponent(t)}`:null})(0,c);return((e,t,r)=>{if(!e?.fontFamily||"system"===e.fontFamily)return"";const n=Ae(e.fontFamily);if("custom"===n&&t){const r=e.customFontName||"QratiCustomFont",n=/\.woff2(\?|$)/i.test(t)?"woff2":/\.ttf(\?|$)/i.test(t)?"truetype":"woff";return`@font-face{font-family:"${i=r,i.replace(/"/g,'\\"')}";src:url("${t}") format("${n}");font-weight:400 700;font-style:normal;font-display:swap;}`}var i;const s=r||(e=>{if(!e)return null;const t=Ae(e);return t&&"system"!==t.toLowerCase()&&"custom"!==t.toLowerCase()?`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`:null})(n);return s?`@import url("${s}");`:""})(T?.organization?.integrationSettings,T?.organization?.customFontUrl?r||T.organization.customFontUrl:void 0,t||void 0)},[T?.organization?.integrationSettings,T?.organization?.customFontUrl,c]);t(()=>{const e=`data-qrati-font-${c}`;if(document.head.querySelector(`[${e}]`)?.remove(),E){if(E.startsWith("@import")){const t=E.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=E,t.setAttribute(e,""),document.head.appendChild(t)}return()=>{document.head.querySelector(`[${e}]`)?.remove()}}},[E,c]);const k=a(async e=>{S(t=>({...t,...e}))},[]),A=a(async(e,t,r,n)=>{try{const i=await u.post(f.REGISTER,{json:{email:e,password:t,fname:r,lname:n},headers:{"x-org-id":c}}).json();if(i.error)return{error:i.error};const s={...i.user,token:i.token};return S(s),I(e=>e+1),i.token&&localStorage.setItem(Ne(c),i.token),i}catch(C){return{error:await Ve(C,"Registration failed")}}},[c]),x=a(async(e,t)=>{try{const r=await u.post(f.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":c}}).json();if(r.error)return{error:r.error};const n={...r.user,token:r.token};return S(n),I(e=>e+1),r.token&&localStorage.setItem(Ne(c),r.token),r}catch(C){return{error:await Ve(C,"Invalid email or password")}}},[c]),F=a(async e=>{const t=await((e,t,r)=>new Promise((n,i)=>{if(!e)return void i(/* @__PURE__ */new Error("Provider is required"));if(!t)return void i(/* @__PURE__ */new Error("Organization ID is required"));const s=new URL(`${r}/qc-social-auth`);s.searchParams.set("provider",e),s.searchParams.set("organizationId",t),s.searchParams.set("origin",window.location.origin);const o=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(s.toString(),"qrati_social_auth",`width=500,height=600,left=${o},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void i(/* @__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){return void console.warn("Could not parse origin for verification")}const{type:s,data:o,error:a,organizationId:u}=e.data||{};if(u===t)switch(s){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),n({user:o.user,session:o.session,token:o.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),l(),c.close(),i(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),i(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),i(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),i(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,c??"","https://qrati.com");return t?.user&&t?.token&&(S({...t.user,token:t.token}),I(e=>e+1),localStorage.setItem(Ne(c),t.token)),t},[c]),P=a(async()=>F("google"),[F]),D=a(async()=>F("apple"),[F]),M=a(async e=>{try{const t=await u.post(f.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":c}}).json();return t.error?{error:t.error}:t}catch(C){return{error:await Ve(C,"Failed to send password reset code")}}},[c]),q=a(async(e,t)=>{try{const r=await u.post(f.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(C){return{error:await Ve(C,"Invalid code, please check your email")}}},[c]),U=a(async(e,t)=>{try{const r=await u.post(f.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(C){return{error:C?.message}}},[c]),Q=a(async()=>{try{const e=await u.post(f.LOGOUT,{headers:{"x-org-id":c,Authorization:`Bearer ${b?.token}`}}).json();return e.error?{error:e.error}:(S(null),localStorage.removeItem(Ne(c)),await y.invalidateQueries({queryKey:[h.QRATI_CONNECT_SESSION]}),e)}catch(C){return{error:C?.message}}},[c,b?.token]),L=n(()=>({props:e,initializing:O,sessionId:T?.sessionId,organization:T?.organization,folders:T?.folders,orgRole:T?.orgRole??null,loadingUser:O,user:b,updateUser:k,registerUsingEmail:A,loginWithGoogle:P,loginWithApple:D,loginUsingEmail:x,sendPasswordResetCode:M,verifyPasswordResetCode:q,resetPassword:U,signout:Q,error:C,portalContainer:v}),[e,O,T,b,k,A,P,D,x,M,q,U,Q,C,v]);if(C){const e=C,t=401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable";/* @__PURE__ */
|
|
40
|
-
return o(s,{fallback:null,children:/* @__PURE__ */o(Ee,{organizationId:c??"",errorType:t,errorMessage:"generic-error"===t?e.apiMessage:void 0})})}/* @__PURE__ */
|
|
41
|
-
return o(We.Provider,{value:L,children:/* @__PURE__ */o("div",{ref:w,id:"qrati-connect-container",style:{...Qe(T?.organization,g),fontFamily:T?.organization?.integrationSettings?.fontFamily&&"system"!==T.organization.integrationSettings.fontFamily?"var(--font-family)":"inherit"},className:Me("bg-background text-foreground relative min-h-[80vh]"),children:i})})},Ze=()=>{const e=c(We);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{z as A,E as C,A as D,w as E,m as M,p as N,I as O,k as S,T,J as _,Qe as a,V as b,Oe as c,pe as d,fe as f,re as g,te as h,Me as i,j,P as k,we as l,ne as m,Ze as n,De as o,ae as p,ze as r,Ie as s,Ge as t,ve as u,B as v,C as w,b as x,W as y};
|
package/element/CfszNu_Q.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{_ as e,f as t,h as a,o as n,p as r,t as o,v as i,w as s}from"./BXMw4kNf.js";import{f as l,i as c,n as d}from"./CdivXyOP.js";import{n as u,r as m,t as p}from"./DqAzUQcH.js";import{t as h}from"./CS8uERGc.js";import{t as g}from"./DmpmrPE5.js";import{S as f,i as v,s as y}from"./Bb9ydqSB.js";import{f as w,l as x,u as N}from"./BK_hWmGs.js";import{t as b}from"./cBUXG_uS.js";import{t as T}from"./Dl6jcv9I.js";import{t as C}from"./ydzHqf5r.js";import{t as D}from"./BxQf2Aj9.js";import{n as P,r as E,t as j}from"./BuhJHzFX.js";import{t as I}from"./BqPiuAuP.js";import{t as A}from"./DKxH7j1t2.js";import{a as S,i as _,n as z,o as M,r as U,t as k}from"./BrDFXZq12.js";import{t as q}from"./DMnbtDXS2.js";import{a as O,i as $,n as L,r as B,t as K}from"./BALdepDv.js";var R=e=>e.meta.hasMore?e.meta.nextCursor??p(e):void 0,Q=({content:e,onDeleted:t,onClose:a})=>{const n=function(){const e=l(),{user:t,props:a}=d(),n=a?.organizationId,r=t?.token,o=t?._id??t?.uid??null,i=[f.USER_UPLOADS,n??"",o];return h({mutationKey:["delete-upload",n??"",o],mutationFn:async({contentId:e})=>{const t=await g.post(v.DELETE_CONTENT,{json:{contentId:e},throwHttpErrors:!1,headers:{"x-org-id":n,...r?{Authorization:`Bearer ${r}`}:{}}}).json();if(t?.error)throw new Error(t.error);return{contentId:e}},onMutate:async({contentId:t})=>{await e.cancelQueries({queryKey:i,exact:!1});const a=e.getQueriesData({queryKey:i,exact:!1});return e.setQueriesData({queryKey:i,exact:!1},e=>e?.pages?{...e,pages:e.pages.map(e=>({...e,data:e.data.filter(e=>e._id!==t),meta:{...e.meta,totalCount:Math.max(0,(e.meta.totalCount??0)-1)}}))}:e),{previousData:a}},onError:(t,a,n)=>{n?.previousData?.forEach(([t,a])=>{e.setQueryData(t,a)})}})}(),r=e?.rateCount??0,i=r<=0,s=i?null:`This upload has ${r} rating${r>1?"s":""}. Uploads with at least 1 rating cannot be deleted.`,c=n.error instanceof Error?n.error.message:null;/* @__PURE__ */
|
|
2
|
-
return o($,{open:Boolean(e),onOpenChange:e=>{e||n.isPending||a()},title:"Delete content?",description:c??s??"Are you sure you want to delete this content? This operation is permanent and cannot be undone.",cancelText:"Cancel",confirmText:i?"Delete":"Got it",confirmColor:i?"error":"primary",loading:n.isPending,onCancel:a,onConfirm:i?async()=>{if(e&&i)try{await n.mutateAsync({contentId:e._id,eventId:e.eventId}),t()}catch{}}:a})};function V({className:e}){/* @__PURE__ */
|
|
3
|
-
return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */o("path",{fill:"currentColor",d:"M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zm-7 11q.425 0 .713-.288T11 16V9q0-.425-.288-.712T10 8t-.712.288T9 9v7q0 .425.288.713T10 17m4 0q.425 0 .713-.288T15 16V9q0-.425-.288-.712T14 8t-.712.288T13 9v7q0 .425.288.713T14 17M7 6v13z"})})}var F={[y.APPROVED]:{color:"text-success",bgColor:"bg-success/20",icon:/* @__PURE__ */o(L,{className:"size-full"}),title:"Approved",description:"Your upload has been approved and is now visible to everyone viewing this event."},[y.IN_REVIEW]:{color:"text-warning",bgColor:"bg-warning/20",icon:/* @__PURE__ */o(O,{className:"size-full"}),title:"In Review",description:"Your upload is currently being reviewed. It will be visible once approved by the event admin."},[y.REJECTED]:{color:"text-destructive",bgColor:"bg-destructive/20",icon:/* @__PURE__ */o(q,{className:"size-full"}),title:"Rejected",description:"Your upload was not approved as it may not meet the content guidelines. Please upload appropriate content."}},Y=e=>{const t=new Date(e).getTime();if(Number.isNaN(t))return"";const a=Math.max(0,Math.floor((Date.now()-t)/1e3)),n=[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[Number.POSITIVE_INFINITY,"year"]];let r=a,o="second";for(const[i,s]of n){if(r<i){o=s;break}r=Math.floor(r/i),o=s}return"second"===o&&r<30?"just now":`${r} ${o}${1===r?"":"s"} ago`},G=n(({content:e,onDelete:t,onEditCaption:a,onStatusClick:n})=>{const r=e.status,i=F[r];/* @__PURE__ */
|
|
4
|
-
return o("div",{className:"group relative size-full overflow-hidden sm:rounded",children:/* @__PURE__ */o("div",{className:"relative size-full",children:[
|
|
5
|
-
/* @__PURE__ */o(E,{url:e.url||"",alt:e.caption||"",thumbnailUrl:e.thumbnailUrl||void 0,blurhash:e.blurhash||void 0,pswpData:{id:e._id,type:e.type,hash:e._id,width:e.dimension?.width,height:e.dimension?.height,thumbnailUrl:e.thumbnailUrl||void 0,caption:e.caption||""}}),
|
|
6
|
-
/* @__PURE__ */o("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-between bg-gradient-to-t from-black/50 to-transparent pl-3",children:[/* @__PURE__ */o(b,{variant:"caption",className:"text-xs text-white opacity-90 sm:text-sm",children:Y(e.createdAt)}),/* @__PURE__ */o("div",{className:"pointer-events-auto flex items-center",children:[/* @__PURE__ */o("button",{type:"button",className:"cursor-pointer p-2 text-white hover:opacity-80","aria-label":"Edit caption",onClick:t=>{t.stopPropagation(),t.preventDefault(),a(e._id)},children:/* @__PURE__ */o("svg",{viewBox:"0 0 24 24",className:"size-5","aria-hidden":"true",children:/* @__PURE__ */o("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25ZM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83Z"})})}),/* @__PURE__ */o(B,{icon:/* @__PURE__ */o(V,{className:"size-5"}),color:"error",size:"sm","aria-label":"Delete upload",tooltip:"Delete",onClick:a=>{a.stopPropagation(),a.preventDefault(),t(e._id)}})]})]}),
|
|
7
|
-
/* @__PURE__ */o("button",{type:"button","aria-label":`Status: ${i?.title||"Unknown"}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),n(r)},className:c("pointer-events-auto absolute top-1 right-1 cursor-pointer rounded-full p-1 transition-opacity hover:opacity-80",i?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */o("span",{className:c("block size-5",i?.color||"text-gray-500"),children:i?.icon||null})})]})})}),H=({content:t,onClose:n})=>{const[r,i]=a(""),s=function(){const e=l(),{user:t,props:a}=d(),n=a?.organizationId,r=t?.token,o=t?._id??t?.uid??null,i=[f.USER_UPLOADS,n??"",o];return h({mutationKey:["update-upload-caption",n??"",o],mutationFn:async({contentId:e,caption:t})=>{const a=await g.post(v.UPDATE_CONTENT_CAPTION,{json:{contentId:e,caption:t},throwHttpErrors:!1,headers:{"x-org-id":n,...r?{Authorization:`Bearer ${r}`}:{}}}).json();if(a.error)throw new Error(a.error);return{contentId:e,caption:t,content:a.data}},onMutate:async({contentId:t,caption:a})=>{await e.cancelQueries({queryKey:i,exact:!1});const n=e.getQueriesData({queryKey:i,exact:!1});return e.setQueriesData({queryKey:i,exact:!1},e=>e?.pages?{...e,pages:e.pages.map(e=>({...e,data:e.data.map(e=>e._id===t?{...e,caption:a,status:y.IN_REVIEW}:e)}))}:e),{previousData:n}},onError:(t,a,n)=>{n?.previousData?.forEach(([t,a])=>{e.setQueryData(t,a)})}})}();return e(()=>{i(t?.caption??"")},[t]),/* @__PURE__ */o(k,{open:Boolean(t),onOpenChange:e=>!e&&n(),children:/* @__PURE__ */o(z,{className:"w-full max-w-lg",children:[
|
|
8
|
-
/* @__PURE__ */o(S,{children:/* @__PURE__ */o(M,{children:"Update caption"})}),
|
|
9
|
-
/* @__PURE__ */o("div",{className:"px-4",children:/* @__PURE__ */o(K,{label:"Caption",value:r,maxLength:1e3,rows:4,disabled:s.isPending,error:s.error instanceof Error?s.error.message:void 0,onInput:e=>i(e.currentTarget.value)})}),
|
|
10
|
-
/* @__PURE__ */o(_,{children:[/* @__PURE__ */o(A,{variant:"outlined",color:"foreground",disabled:s.isPending,onClick:n,children:"Cancel"}),/* @__PURE__ */o(A,{loading:s.isPending,onClick:async()=>{if(t)try{await s.mutateAsync({contentId:t._id,caption:r}),n()}catch{}},children:"Save"})]})]})})},W=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),Z=e=>{if(0===e.length)return"";if(1===e.length)return W(e[0].createdAt);const{minTime:t,maxTime:a}=e.reduce((e,t)=>{const a=new Date(t.createdAt).getTime();return{minTime:Math.min(e.minTime,a),maxTime:Math.max(e.maxTime,a)}},{minTime:1/0,maxTime:-1/0}),n=W(new Date(t).toISOString()),r=W(new Date(a).toISOString());return n===r?n:`${n} - ${r}`},J=()=>{const n=N(),l=x(),p=w(),{user:h,loadingUser:y,portalContainer:E,organization:S}=d(),_=t(null),q=t(null),O=t(!1),$=t(null),L=t(null),[B,K]=a(null),[V,Y]=a(null),[W,J]=a(null),{contents:X,loading:ee,hasNextPage:te,fetchNextPage:ae,isFetchingNextPage:ne}=function({sort:e="-createdAt",limit:t=20}={}){const{user:a,loadingUser:n,props:o,organization:i}=d(),s=o?.organizationId,l=a?.token,c=a?._id??a?.uid??null,{data:p,isLoading:h,isError:y,error:w,isFetchingNextPage:x,hasNextPage:N,fetchNextPage:b,refetch:T}=m({queryKey:[f.USER_UPLOADS,s??"",c,t,e],queryFn:async({pageParam:a=1})=>await g.get(v.MY_UPLOADS,{searchParams:"string"==typeof a?{after:a,limit:t,sort:e}:{page:a,limit:t,sort:e},headers:{"x-org-id":s,...l?{Authorization:`Bearer ${l}`}:{}}}).json(),initialPageParam:1,getPreviousPageParam:u,getNextPageParam:R,maxPages:25,staleTime:12e4,gcTime:3e5,enabled:!n&&!!a&&!0===i?.integrationSettings?.enableMyUploads});return{contents:r(()=>p?.pages?.flatMap(e=>e?.data??[])??[],[p]),loading:h,isError:y,error:w,isFetchingNextPage:x,hasNextPage:!!N,fetchNextPage:b,refetch:T,totalCount:p?.pages?.[0]?.meta?.totalCount??0}}({sort:"-createdAt",limit:20});e(()=>{y||h||n("/auth/login",{state:{referrer:l.pathname},replace:!0})},[y,h,n,l.pathname]),e(()=>{y||!S||S.integrationSettings?.enableMyUploads||n("/",{replace:!0})},[y,S,n]);const re=X.length>0,oe=!ee&&!re,ie=r(()=>{if(!X.length)return[];const e={};return X.forEach(t=>{const a=t.eventId||"unknown";e[a]||(e[a]={eventId:a,eventName:t.event?.name||"Event",uploads:[]}),e[a].uploads.push(t)}),Object.values(e).sort((e,t)=>{const a=new Date(e.uploads[0]?.createdAt||0).getTime();return new Date(t.uploads[0]?.createdAt||0).getTime()-a})},[X]);e(()=>()=>{q.current?.destroy(),q.current=null,_.current?.destroy?.(),_.current=null},[E]),e(()=>{const e=q.current;"memory"===p&&e?.isActive()&&!P(l.state)&&e.handleBack()},[l.state,p]);const se=i(async e=>{if(_.current||O.current)return;const t=$.current,a=e.target.closest("a");if(!t||!a||!t.contains(a))return;e.preventDefault(),O.current=!0;const r=Array.from(t.querySelectorAll("a")).indexOf(a);try{const[{default:e},{default:a},{default:o},{loadPhotoSwipe:i}]=await Promise.all([import("./web.es.js").then(e=>e.n),import("./Bo39kG4k2.js"),import("./DeK1vU3V2.js"),import("./web.es.js").then(e=>e.t)]),s=new e({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:i,appendToEl:E??document.body});_.current=s;const c=new j(()=>window.pswp,"memory"===p?{location:l.pathname,state:l.state,push:(e,t)=>n(e,{state:t}),replace:(e,t)=>n(e,{state:t,replace:!0}),go:e=>n(e)}:void 0);q.current=c,s.on?.("beforeOpen",()=>c.open()),s.on?.("close",()=>{c.close(),q.current===c&&(q.current=null),_.current===s&&(_.current=null)}),new a(s),new o(s),s.init(),r>=0&&_.current?.loadAndOpen?.(r)}finally{O.current=!1}},[l.pathname,l.state,n,E,p]);e(()=>{const e=L.current;if(!e||!te)return;const t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&te&&!ne&&ae()},{rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[te,ne,ae]);const le=r(()=>X.find(e=>e._id===B)??null,[B,X]),ce=r(()=>X.find(e=>e._id===V)??null,[V,X]),de=W?F[W]:null;return S&&!S.integrationSettings?.enableMyUploads?null:/* @__PURE__ */o("div",{className:"bg-background min-h-screen w-full",children:[
|
|
11
|
-
/* @__PURE__ */o("div",{className:"relative flex items-center justify-center",children:[/* @__PURE__ */o(I,{}),/* @__PURE__ */o(b,{variant:"h4",align:"center",children:"My Uploads"})]}),
|
|
12
|
-
/* @__PURE__ */o("section",{className:"space-y-3",children:ee?/* @__PURE__ */o("div",{className:"space-y-8 py-4",children:Array.from({length:2}).map((e,t)=>/* @__PURE__ */o("div",{className:"space-y-4",children:[/* @__PURE__ */o("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */o(D,{className:"h-6 w-48"}),/* @__PURE__ */o(D,{className:"h-5 w-24"})]}),/* @__PURE__ */o("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */o(D,{className:"h-52 w-full lg:h-64"},t))})]},t))}):oe?/* @__PURE__ */o(C,{className:"py-12",title:"No uploads yet",description:"Photos and videos you upload to events will appear here."}):/* @__PURE__ */o(s,{children:[
|
|
13
|
-
/* @__PURE__ */o("div",{ref:$,onClickCapture:se,className:"space-y-8 py-4",children:ie.map(e=>/* @__PURE__ */o("div",{className:"space-y-4",children:[/* @__PURE__ */o("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */o(b,{variant:"h5",color:"muted",children:e.eventName}),/* @__PURE__ */o("span",{className:"text-muted-foreground text-sm font-light uppercase sm:text-base",children:Z(e.uploads)})]}),/* @__PURE__ */o("div",{className:"grid grid-cols-2 gap-1 sm:grid-cols-3 lg:grid-cols-4",children:e.uploads.map(e=>/* @__PURE__ */o("div",{className:"h-52 lg:h-64",children:/* @__PURE__ */o(G,{content:e,onDelete:K,onEditCaption:Y,onStatusClick:J})},e._id))})]},e.eventId))}),
|
|
14
|
-
/* @__PURE__ */o("div",{ref:L,className:"h-px w-full"}),ne&&/* @__PURE__ */o("div",{className:"my-6 w-full",children:/* @__PURE__ */o(T,{})})]})}),
|
|
15
|
-
/* @__PURE__ */o(Q,{content:le,onClose:()=>K(null),onDeleted:()=>K(null)}),
|
|
16
|
-
/* @__PURE__ */o(H,{content:ce,onClose:()=>Y(null)}),
|
|
17
|
-
/* @__PURE__ */o(k,{open:Boolean(W),onOpenChange:e=>!e&&J(null),children:/* @__PURE__ */o(z,{className:"w-full max-w-lg",children:[/* @__PURE__ */o("div",{className:"flex flex-col gap-4 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */o("div",{className:c("mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",de?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */o("span",{className:c("size-6",de?.color||"text-gray-500"),children:de?.icon||null})}),/* @__PURE__ */o("div",{className:"flex-1 space-y-2 text-center sm:text-left",children:[/* @__PURE__ */o(M,{children:de?.title||"Unknown Status"}),/* @__PURE__ */o(U,{children:de?.description||"Status information unavailable."})]})]}),/* @__PURE__ */o("div",{className:"flex justify-end p-4",children:/* @__PURE__ */o(A,{variant:"outlined",color:"foreground",onClick:()=>J(null),children:"Got it"})})]})})]})};export{J as default};
|
package/element/Ci9PI8hK2.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{_ as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./BXMw4kNf.js";import{f as c,i as d,l as u,n as m}from"./CdivXyOP.js";import{n as g,r as h,t as f}from"./DqAzUQcH.js";import{t as p}from"./DmpmrPE5.js";import{E as v,S as w,T,_ as y,a as N,c as x,d as q,f as b,g as E,h as C,i as S,l as I,m as L,o as z,p as k,s as M,u as A,x as _}from"./Bb9ydqSB.js";import{d as P,t as R}from"./BK_hWmGs.js";import{n as V,t as F}from"./cBUXG_uS.js";import{a as O,c as j,d as B,i as U,l as H,n as G,o as $,r as D,s as W,t as K,u as Q}from"./8QLGsYN7.js";import{t as Z}from"./Dl6jcv9I.js";import{t as Y}from"./ydzHqf5r.js";import{t as J}from"./BxQf2Aj9.js";import{t as X}from"./C0eP2utz.js";import{r as ee}from"./JY9kGm742.js";import{t as te}from"./DLHvSz1a2.js";import{n as ne,t as re}from"./DKxH7j1t2.js";import{t as ae}from"./fQmLbYcp2.js";import{a as ie,i as se,n as oe,o as le,r as ce,s as de,t as ue}from"./Be3fjihP2.js";import{c as me,i as ge,n as he,t as fe}from"./C2WFktw12.js";import{n as pe,t as ve}from"./CQMPBmQq2.js";function we(e){if(e<1e3)return String(e);const[t,n]=e<1e6?[1e3,"K"]:[1e6,"M"],r=Math.round(e/t*10)/10;return`${r%1==0?r.toFixed(0):r.toFixed(1)}${n}`}function Te({className:e}){/* @__PURE__ */
|
|
2
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function ye({className:e}){/* @__PURE__ */
|
|
3
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var Ne=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[c,u]=r(!1),m=n(null),g=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!m.current||!t)return void u(!1);const e=m.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(g.current=window.requestAnimationFrame(n));const i=t.lineHeight,s=parseFloat(t.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.whiteSpace="normal",l.style.width=`${r}px`,l.style.boxSizing=t.boxSizing,l.style.padding=t.padding,l.style.margin=t.margin,l.style.fontSize=t.fontSize,l.style.fontFamily=t.fontFamily,l.style.fontWeight=t.fontWeight,l.style.lineHeight=t.lineHeight,l.style.letterSpacing=t.letterSpacing,l.style.wordBreak="break-word",l.innerText=e.innerText||"",document.body.appendChild(l);const c=l.scrollHeight;document.body.removeChild(l),u(c>o*a+1)},r=()=>{null!==g.current&&window.cancelAnimationFrame(g.current),g.current=window.requestAnimationFrame(n)};let i;r(),window.addEventListener("resize",r);try{i=new MutationObserver(r),i.observe(e,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",r),null!==g.current&&window.cancelAnimationFrame(g.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:d("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:m,className:d(V({variant:"body2",color:"muted",align:"center"}),"w-full",o?void 0:`line-clamp-${a}`),children:[t,c&&o&&/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),c&&!o&&/* @__PURE__ */s("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */s("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},xe=()=>{const{t:e}=ee(),{eventSlug:t}=P(),{event:n,parameters:r}=te({eventSlug:t}),{props:a,organization:i,folders:o}=m(),{curateLabel:l,leaderboardLabel:c}=a??{},{eventViews:d,contentCount:g,curationCount:h}=(({event:e})=>{const{props:t,organization:n}=m(),r=t?.organizationId,{isLoading:a,data:i}=u({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await p.get(S.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":r}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(n?.integrationSettings?.showEventStats)});return{isLoading:a,eventViews:"number"==typeof i?.eventViews?i.eventViews:i?.eventViews?.views??0,contentCount:i?.contentCount||0,curationCount:i?.curationCount||0}})({event:n}),f=Array.isArray(r)&&r.length>0,v=n?.engagementStyle===b.CONTEST||f,w=i?.integrationSettings?.showFolderBreadcrumb&&n?.folderId?H(o??[],n.folderId):[];/* @__PURE__ */
|
|
4
|
-
return s("div",{className:"w-full space-y-3 md:-mt-6",children:[w.length>0&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s(Q,{homeLink:_.PUBLIC_EVENTS,data:w})}),
|
|
5
|
-
/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:n?.name}),/* @__PURE__ */s(Ne,{description:n?.description})]}),i?.integrationSettings?.showEventStats&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s("div",{className:"flex items-center gap-6",children:[
|
|
6
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(ye,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:we(d??0)})]}),
|
|
7
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(Te,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:we(g??0)})]}),v&&/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(de,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:h})]})]})}),(n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0||n?.status===k.OPEN&&v||n?.engagementStyle===b.REACTION&&n?.showLeaderboard||n?.engagementStyle===b.CONTEST)&&/* @__PURE__ */s("div",{className:"flex w-full flex-wrap justify-center gap-3",children:[n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0&&/* @__PURE__ */s(R,{to:_.UPLOAD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(me,{className:"size-5"}),children:e("content.upload","Upload")})}),n?.status===k.OPEN&&v&&/* @__PURE__ */s(R,{to:_.CURATE(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(de,{className:"size-5"}),children:l||e("content.curate","Rate")})}),n?.showLeaderboard&&/* @__PURE__ */s(R,{to:_.LEADERBOARD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(ae,{className:"size-5"}),children:c||e("content.leaderboard","Leaderboard")})})]})]})},qe=(e,t)=>["in-review-count",e??"",t??""];function be({className:e}){/* @__PURE__ */
|
|
8
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12.275 9H19.4q-.675-1.725-2.062-2.963T14.15 4.3l-2.3 3.95q-.15.25 0 .5t.425.25m-3.6 1.25q.15.25.425.25t.425-.25L13.1 4.1q-.275-.05-.55-.075T12 4q-1.65 0-3.075.625T6.4 6.3zM4.25 14h4.575q.275 0 .438-.25t.012-.5L5.7 7.1q-.8 1.025-1.25 2.263T4 12q0 .525.063 1.013T4.25 14m5.6 5.7l2.275-3.95q.15-.25-.012-.5t-.438-.25H4.6q.675 1.725 2.063 2.963T9.85 19.7M12 20q1.65 0 3.075-.625T17.6 17.7l-2.275-3.95q-.15-.25-.425-.25t-.425.25L10.9 19.9q.275.05.538.075T12 20m6.3-3.1q.8-1.025 1.25-2.262T20 12q0-.525-.062-1.012T19.75 10h-4.575q-.275 0-.437.25t-.013.5zM12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q2.075 0 3.888.788t3.174 2.15t2.15 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22"})})}function Ee({className:e}){/* @__PURE__ */
|
|
9
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11.25 16L9.6 13.8q-.225-.3-.6-.3t-.6.3l-1.8 2.4q-.2.25-.05.525T7 17h10q.3 0 .45-.275t-.05-.525l-2.475-3.3q-.275-.05-.563-.125T13.8 12.6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4q.425 0 .713.288T10 4t-.288.713T9 5H5v14h14v-3.325q0-.425.288-.712t.712-.288t.713.288t.287.712V19q0 .825-.587 1.413T19 21zm11.05-10q-1.85 0-3.15-1.312T11.6 6.5t1.313-3.187T16.1 2t3.188 1.313T20.6 6.5q0 .675-.2 1.3t-.5 1.15l2.35 2.35q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2.4-2.4q-.525.35-1.125.525T16.05 11m.05-2q1.05 0 1.775-.725T18.6 6.5t-.725-1.775T16.1 4t-1.775.725T13.6 6.5t.725 1.775T16.1 9"})})}function Ce({className:e}){/* @__PURE__ */
|
|
10
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M7 21q-.425 0-.712-.288T6 20t.288-.712T7 19h4v-3H4q-.825 0-1.412-.587T2 14V5q0-.825.588-1.412T4 3h16q.825 0 1.413.588T22 5v9q0 .825-.587 1.413T20 16h-7v3h4q.425 0 .713.288T18 20t-.288.713T17 21zm-3-7h16V5H4zm0 0V5z"})})}function Se({className:e}){/* @__PURE__ */
|
|
11
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12 20q-.825 0-1.412-.587T10 18t.588-1.412T12 16t1.413.588T14 18t-.587 1.413T12 20m0-6q-.825 0-1.412-.587T10 12t.588-1.412T12 10t1.413.588T14 12t-.587 1.413T12 14m0-6q-.825 0-1.412-.587T10 6t.588-1.412T12 4t1.413.588T14 6t-.587 1.413T12 8"})})}function Ie({className:e}){/* @__PURE__ */
|
|
12
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M9 20v-4q-1.275-.1-2.5-.275t-2.45-.45q-.425-.1-.675-.475T3.25 14t.513-.625t.812-.1q1.825.425 3.688.575T12 14t3.738-.15t3.687-.575q.45-.1.825.1t.5.625t-.137.8t-.688.475q-1.225.275-2.45.45T15 16v4q0 .425-.287.713T14 21h-4q-.425 0-.712-.288T9 20m3-7q-.85 0-1.425-.575T10 11q0-.825.575-1.412T12 9q.825 0 1.413.588T14 11q0 .85-.587 1.425T12 13m-7.5-3q-.65 0-1.075-.425T3 8.5q0-.625.425-1.062T4.5 7q.625 0 1.063.438T6 8.5q0 .65-.437 1.075T4.5 10m15 0q-.65 0-1.075-.425T18 8.5q0-.625.425-1.062T19.5 7q.625 0 1.063.438T21 8.5q0 .65-.437 1.075T19.5 10M7.25 6.25q-.65 0-1.075-.425T5.75 4.75q0-.625.425-1.062T7.25 3.25q.625 0 1.063.438T8.75 4.75q0 .65-.437 1.075T7.25 6.25m9.5 0q-.65 0-1.075-.425T15.25 4.75q0-.625.425-1.062t1.075-.438q.625 0 1.063.438t.437 1.062q0 .65-.437 1.075t-1.063.425M12 5q-.65 0-1.075-.425T10.5 3.5q0-.625.425-1.062T12 2q.625 0 1.063.438T13.5 3.5q0 .65-.437 1.075T12 5"})})}function Le({className:e}){/* @__PURE__ */
|
|
13
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m0-2q.825 0 1.413-.587T13 8t-.587-1.412T11 6t-1.412.588T9 8t.588 1.413T11 10m10.4 12.8l-2.5-2.5q-.525.3-1.125.5T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .675-.2 1.275t-.5 1.125l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-3.125-4.525Q19 17.55 19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19t1.775-.725M3 18v-.775q0-.85.425-1.575t1.175-1.1q1.05-.55 2.338-.962t2.637-.538q.425-.05.725.25t.3.725t-.3.738t-.725.362q-1.425.175-2.4.525t-1.65.7q-.25.125-.387.363T5 17.225V18h4.6q.425 0 .713.288T10.6 19t-.287.713T9.6 20H5q-.825 0-1.412-.587T3 18m7.175 0"})})}function ze({className:e}){/* @__PURE__ */
|
|
14
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})}function ke({className:e}){/* @__PURE__ */
|
|
15
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3c4.97 0 9 4.03 9 9",children:/* @__PURE__ */s("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})})})}var Me=({event:e})=>{const t=c(),{user:n,props:a}=m(),i=a?.organizationId,[o,l]=r(!1);/* @__PURE__ */
|
|
16
|
-
return s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(o?ke:ze,{className:"size-6"})}),/* @__PURE__ */s(D,{align:"end",side:"bottom",className:"w-44",children:Object.values(E).map(r=>/* @__PURE__ */s(U,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await p.post(S.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}l(!1)})(r),isChecked:e?.galleryLayout===r,title:pe(r)},r))})]})},Ae=({event:e,onAutoscrollClick:t})=>{const{t:n}=ee(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=j(),{inReviewCount:d}=(e=>{const t=c(),{props:n}=m(),r=n?.organizationId,{role:a,isSuper:i}=j(),{isLoading:s,data:o,isError:l,error:d}=u({queryKey:qe(r,e?.slug),queryFn:async()=>{try{const t=await p.get(S.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${M.IN_REVIEW}`},headers:{"x-org-id":r}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(a)||Boolean(i)});return{loading:s,inReviewCount:o,error:l?d:null,increment:()=>{t.setQueryData(qe(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(qe(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),g=r||i||o||l,h=r||i||o,f=a(()=>{const t=[];return h&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:be,href:C.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===L.PRIVATE&&g&&t.push({title:n("event.access_requests","Access Requests"),icon:Le,href:C.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===b.CONTEST&&h&&t.push({title:n("event.curation_details","Curation Details"),icon:Ie,href:C.EVENT_CURATION_DETAILS(e?.slug??"")}),h&&t.push({title:n("event.edit_event","Edit Event"),icon:$,href:C.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,h,g]);/* @__PURE__ */
|
|
17
|
-
return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(W,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{"aria-label":n("event.kiosk_mode","Kiosk Mode"),onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(Ce,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&h&&/* @__PURE__ */s(Me,{event:e}),g&&/* @__PURE__ */s(W,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:C.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(Ee,{className:"size-6"}),Number(d)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:d})]})}),f.length>0&&/* @__PURE__ */s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(Se,{className:"size-6"})}),/* @__PURE__ */s(D,{align:"end",side:"bottom",className:"w-48",children:f.map(e=>/* @__PURE__ */s(U,{href:e.href,icon:/* @__PURE__ */s(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */s("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function _e({className:e}){/* @__PURE__ */
|
|
18
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Pe=({engagementStyle:e,sort:t=A,order:n=q,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=ee(),l=a(()=>{const t=Object.keys(z).map(e=>({text:o(`content.sortby_${z[e].label.toLowerCase()}`,z[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===b.CONTEST?t:t.filter(e=>e.value!==N.POPULAR)},[e,o]);/* @__PURE__ */
|
|
19
|
-
return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button","aria-label":"Sort "+(n===T.ASC?"descending":"ascending"),className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:d("text-foreground w-7 -scale-x-100 transition-transform",n===T.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(B,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Re=["jpg","jpeg","png","webp","heic","tiff","bmp"],Ve=({value:t,onChange:a})=>{const[i,o]=r(!1),l=n(null),[c,d]=r(null);return e(()=>{if(!t)return void d(null);const e=URL.createObjectURL(t);return d(e),()=>{URL.revokeObjectURL(e)}},[t]),e(()=>{!t&&l.current&&(l.current.value="")},[t]),/* @__PURE__ */s("div",{className:"flex items-center gap-3",children:[!t&&/* @__PURE__ */s("div",{className:"flex items-center gap-4",children:/* @__PURE__ */s("button",{type:"button","aria-label":"Choose image for facial search",onClick:()=>l.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(i?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(i?ne:le,{})})}),t&&c&&/* @__PURE__ */s("img",{src:c,alt:"Facial Search",className:"size-10 rounded object-cover"}),
|
|
20
|
-
/* @__PURE__ */s("input",{ref:l,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!Re.includes(n))return a(null);(async e=>{if(!e)return;o(!0);let t=e;try{const n=await ge(e);t=n.size/1024/1024>1?await he(n,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):n}catch(n){console.error(n)}o(!1),a(t)})(t)}})]})},Fe={[I.GRID]:{icon:/* @__PURE__ */s(ze,{className:"size-full text-inherit"})},[I.SINGLE]:{icon:/* @__PURE__ */s(_e,{className:"size-full text-inherit"})}},Oe=Object.keys(Fe).map(e=>({icon:Fe[e].icon,value:e})),je=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:d,sortOrder:u,onSortOrderChange:g,handleChange:h,face:f,onFaceImageChange:p})=>{const{t:v}=ee(),{organization:w}=m(),T=Boolean(w?.advancedSettings?.aiSettings?.faceRecognitionEnabled),y=!0===w?.integrationSettings?.showFacialSearch&&T,[N,x]=r(""),[q,b]=r(null),E=n(null),C=o(()=>{E.current&&(URL.revokeObjectURL(E.current),E.current=null)},[]),S=o(e=>{if(b(e),C(),e){const t=URL.createObjectURL(e);E.current=t,p?.(t)}else p?.(void 0)},[p,C]),I=o(e=>{x(e.target.value)},[]),L=o(e=>{const t=e.key;"Enter"===t?h&&h(N.length>0?N:""):"Escape"===t&&(x(""),h&&h(""))},[N,h]),z=o(()=>{x(""),h&&h("")},[h]),k=o(()=>{h&&h(N)},[N,h]);return e(()=>{f||b(null)},[f]),e(()=>()=>{C()},[C]),/* @__PURE__ */s("fieldset",{disabled:a,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(a?"opacity-50":""),children:[
|
|
21
|
-
/* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[w?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(B,{buttons:Oe,selected:i,onChange:l}),w?.integrationSettings?.showKeywordSearch&&/* @__PURE__ */s("div",{className:"flex-auto",children:/* @__PURE__ */s("div",{className:"relative min-w-32 sm:min-w-48",children:[
|
|
22
|
-
/* @__PURE__ */s(ve,{placeholder:v("content.search_placeholder","Search using text"),value:N,className:"py-2",onChange:I,onKeyUp:L}),N?.length>0&&/* @__PURE__ */s("button",{type:"button","aria-label":"Clear search",className:"absolute inset-y-0 right-10 flex items-center",onClick:z,children:/* @__PURE__ */s(X,{className:"text-foreground w-5"})}),
|
|
23
|
-
/* @__PURE__ */s("button",{type:"button","aria-label":"Search",className:"absolute inset-y-0 right-3 flex items-center",onClick:k,children:/* @__PURE__ */s(K,{className:"text-foreground w-5"})})]})}),y&&/* @__PURE__ */s(Ve,{value:q,onChange:S})]}),
|
|
24
|
-
/* @__PURE__ */s("div",{className:"col-span-3 md:col-span-1"}),
|
|
25
|
-
/* @__PURE__ */s("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */s(Pe,{engagementStyle:t,sort:c,order:u,onSortChange:d,onSortOrderChange:g})})]})},Be=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-hidden":"true",children:/* @__PURE__ */s("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
26
|
-
/* @__PURE__ */s("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"}),
|
|
27
|
-
/* @__PURE__ */s("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"}),
|
|
28
|
-
/* @__PURE__ */s("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
|
|
29
|
-
/* @__PURE__ */s("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
|
|
30
|
-
/* @__PURE__ */s("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
|
|
31
|
-
/* @__PURE__ */s("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
|
|
32
|
-
/* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Ue=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=oe(),l=n(null),c=`gam-${t}-banner-${a??"ev"}`,d=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,u=null,m=null,g=null;const h=d?[d]:[],f=document.createElement("div");f.id=c,document.body.appendChild(f);const p=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(c);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],c)?.addService(window.googletag.pubads());l&&(t=l,u=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&l.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),s=ue({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:y.GAM_CLICK})}}),se(),window.googletag.display(c),n=window.setTimeout(()=>{e||(p(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==n&&window.clearTimeout(n),s?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,d,t,c]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},He=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=oe(),o=n(null),l=`gam-right-${r??"ev"}`,c=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,d=null,u=null,m=null,g=null;const h=c?[c]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const p=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,u=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&o.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),d=ue({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:y.GAM_CLICK})}}),se(),window.googletag.display(l),s=window.setTimeout(()=>{e||(p(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==s&&window.clearTimeout(s),d?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,c,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Ge=t(()=>import("./BGo2VsHN2.js")),$e=e=>e?.status===k.OPEN||Boolean(e?.isUnlimitedDuration&&!e?.endDate),De=e=>Array.isArray(e)&&e.length>0,We=()=>{const t=P().eventSlug,{loadingUser:u,organization:T}=m(),y=c(),[E,C]=r(""),[L,k]=r(void 0),[M,R]=r(A),[V,O]=r(q),[j,B]=r("undefined"!=typeof window&&window.innerWidth<768?I.SINGLE:I.GRID),U=n(null),{event:H,ads:G,gamConfig:$,parameters:D}=te({eventSlug:t}),{loading:W,isError:K,error:Q,refetch:ee,contentsWithAds:ne,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se}=(({event:e,ads:t=[],gamConfig:n,sort:r=A,order:i=q,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=m(),T=c?.organizationId,{isLoading:y,isError:N,error:b,data:E,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L,refetch:k}=h({queryKey:[w.CONTENTS_BY_EVENT(e?._id??""),T??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await p.get(S.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${v[i].sortOrder}${z[r].sortField}`,limit:l},headers:{"x-org-id":T,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(b){throw new Error(b instanceof Error?b.message:String(b)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getPreviousPageParam:e=>g(e),getNextPageParam:f,maxPages:30}),M=a(()=>E?.pages?.flatMap(e=>e?.data??[])??[],[E]);return{contents:M,contentsWithAds:a(()=>{const r=Boolean(n?.inGalleryEnabled);return((e=[],{ads:t,gamConfig:n,position:r,gamShare:a})=>{if(r<=0)return e;const i=Boolean(n?.inGalleryEnabled),s=t.length>0;if(!i&&!s)return e;const o=i?s?Math.min(1,Math.max(0,a)):1:0,l=e=>{const n=t.length>1?t.filter(t=>t._id!==e):t,r=n.reduce((e,t)=>e+Math.max(1,t.frequency??1),0);let a=Math.random()*r;for(const t of n)if(a-=Math.max(1,t.frequency??1),a<=0)return t;return n[n.length-1]};let c=null,d=0;const u=[];for(let m=0;m<e.length;m++)if(u.push(e[m]),(m+1)%r===0){if(i&&(!s||Math.floor((d+1)*o)>Math.floor(d*o))&&n){const e=s?l(c):null;u.push({_id:`gam-ad-slot-${d}`,type:x.GAM_AD,slotIndex:d,gamConfig:n,fallbackAd:e,width:n.sizes[0]?.[0]??300,height:n.sizes[0]?.[1]??250})}else{const e=l(c);c=e._id??null,u.push({...e,type:x.AD,adType:e.type})}d++}return u})(M,{ads:"gam"!==e?.adMode||r?t:[],gamConfig:r?n:null,position:e?.adPosition??0,gamShare:(n?.inGalleryBlend??50)/100})},[M,t,e,n]),loading:y,isError:N,error:b,refetch:k,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L}})({event:H,ads:G,gamConfig:$,sort:M,order:V,keywords:E,face:L}),{incrementEventView:le}=oe(),{start:ce,initializing:de,running:ue}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),f=n(null),p=n(0),v=n(!1),w=n(null),T=n(null),y=n(!1),N=n(),x=n(),q=n(i),b=n(o),E=n(s),C=n(a);q.current=i,b.current=o,E.current=s,C.current=a,e(()=>{o||(v.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===f.current&&(f.current=e);const r=Math.min((e-f.current)/1e3,.05);f.current=e,p.current+=60*m.current*r;const a=Math.floor(p.current);a>0&&(n.scrollTop+=a,p.current-=a),q.current&&!b.current&&!v.current&&"function"==typeof E.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(v.current=!0,E.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),v.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),p.current=0,f.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},L=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==w.current&&w.current.release().catch(()=>{}).finally(()=>{w.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),x.current&&document.removeEventListener("fullscreenchange",x.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},z=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||L()});return k.current=()=>{document.fullscreenElement||L()},e(()=>()=>{L()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;w.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(w.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>z.current(e),x.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",x.current),y.current=!0),p.current=0,f.current=null,v.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:U,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se,onBottomReached:()=>H?._id&&y.refetchQueries({queryKey:[w.CONTENTS_BY_EVENT(H._id)]})});e(()=>{H?.slug&&le(H.slug)},[H?.slug,le]);const me=a(()=>j===I.SINGLE,[j]),ge=a(()=>/* @__PURE__ */s(Ae,{event:H,onAutoscrollClick:ce}),[H,ce]),he=n(null),pe=n({hasNextPage:ae,isFetchingNextPage:se,loading:W,running:ue,fetchNextPage:ie});pe.current={hasNextPage:ae,isFetchingNextPage:se,loading:W,running:ue,fetchNextPage:ie},e(()=>(he.current=new IntersectionObserver(e=>{const t=pe.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{he.current?.disconnect(),he.current=null}),[]);const ve=o(e=>{const t=he.current;t&&(t.disconnect(),e&&t.observe(e))},[]),we=$?.bannerPositions??[],Te=T?._id,ye=$&&we.includes("right"),Ne=Boolean(T?.advancedSettings?.aiSettings?.faceRecognitionEnabled),qe=Boolean(T?.integrationSettings?.showQuickSearch)&&Ne;/* @__PURE__ */
|
|
33
|
-
return s("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
|
|
34
|
-
/* @__PURE__ */s("div",{className:"flex flex-row justify-end gap-4 pt-2",children:ge}),
|
|
35
|
-
/* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(xe,{})}),$&&we.includes("top")&&/* @__PURE__ */s(Ue,{position:"top",gamConfig:$,eventId:H?._id,organizationId:Te}),
|
|
36
|
-
/* @__PURE__ */s(je,{engagementStyle:H?.engagementStyle,disabled:u||W,mode:j,onModeChange:e=>B(e),sort:M,sortOrder:V,onSortChange:e=>R(e),onSortOrderChange:()=>O("asc"===V?"desc":"asc"),handleChange:C,face:L,onFaceImageChange:e=>k(e)}),L&&/* @__PURE__ */s("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",children:"Searching using"}),/* @__PURE__ */s("img",{src:L,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */s("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */s(re,{color:"error",icon:/* @__PURE__ */s(X,{className:"size-5"}),onClick:()=>k(void 0),children:"Clear search"})})]}),
|
|
37
|
-
/* @__PURE__ */s("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */s("div",{className:"min-w-0 flex-1",children:[u||W?/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}):K?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:Q?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */s("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */s(F,{variant:"body2",color:"muted",align:"center",children:Q?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(fe,{className:"size-5"}),onClick:()=>{ee()},children:"Retry"})]})})}):ne?.length<=0?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */s(Be,{})})}):/* @__PURE__ */s(l,{children:[
|
|
38
|
-
/* @__PURE__ */s("div",{ref:U,className:d(me?"flex w-full justify-center":"",de?"opacity-0":"opacity-100",ue?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */s(i,{fallback:/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}),children:/* @__PURE__ */s(Ge,{event:H,contents:ne,gamConfig:$,singleColumnMode:me,kioskMode:ue,timestampField:M===N.CAPTURE_TIME?"capturedAt":void 0,curateLink:(H?.engagementStyle===b.CONTEST||De(D))&&$e(H)&&H?.slug?_.CURATE(H.slug):void 0,onChangeFaceUrl:e=>k(e),showQuickSearch:qe})})}),
|
|
39
|
-
/* @__PURE__ */s("div",{ref:ve,className:"h-4 w-full","aria-hidden":"true"}),se&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(Z,{className:"size-8"})})]}),$&&we.includes("bottom")&&/* @__PURE__ */s(Ue,{position:"bottom",gamConfig:$,eventId:H?._id,organizationId:Te})]}),ye&&/* @__PURE__ */s(He,{gamConfig:$,eventId:H?._id,organizationId:Te})]})]})};export{We as default};
|