@chaibuilder/pages 0.1.0-beta.39 → 0.1.0-beta.40
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/dist/{BMGNQTAT-BOrHoPa0.cjs → BMGNQTAT-Co5DHPtg.cjs} +1 -1
- package/dist/{BMGNQTAT-ibyDBcRk.js → BMGNQTAT-lkaYe2TN.js} +2 -2
- package/dist/ChaiBuilderPages-Db5MecpD.cjs +30 -0
- package/dist/{ChaiBuilderPages-DtKEiWwQ.js → ChaiBuilderPages-F_9rLL3W.js} +1756 -1815
- package/dist/{STCWXWCR-BuBdzLWk.cjs → STCWXWCR-DBsvrFpH.cjs} +1 -1
- package/dist/{STCWXWCR-CKCJLbuH.js → STCWXWCR-DQNwTOJD.js} +1 -1
- package/dist/{UODQIBEW-BfNt2Ca3.js → UODQIBEW-Bv_kQBsJ.js} +2 -2
- package/dist/{UODQIBEW-CvDcEoUf.cjs → UODQIBEW-Cu_TygYI.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/ChaiBuilderPages-I5hA-q8D.cjs +0 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./STCWXWCR-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./STCWXWCR-DBsvrFpH.cjs"),t=require("./ChaiBuilderPages-Db5MecpD.cjs");var s=c=>{const[r,o]=e.createLocalStorage({prefix:"TanstackQueryDevtools"}),l=t.getPreferredColorScheme(),a=t.createMemo(()=>{const n=r.theme_preference||e.THEME_PREFERENCE;return n!=="system"?n:l()});return t.createComponent(e.QueryDevtoolsContext.Provider,{value:c,get children(){return t.createComponent(e.PiPProvider,{localStore:r,setLocalStore:o,get children(){return t.createComponent(e.ThemeContext.Provider,{value:a,get children(){return t.createComponent(e.Devtools,{localStore:r,setLocalStore:o})}})}})}})},u=s;exports.default=u;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./STCWXWCR-
|
|
2
|
-
import { g as d, c as f, a as e } from "./ChaiBuilderPages-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./STCWXWCR-DQNwTOJD.js";
|
|
2
|
+
import { g as d, c as f, a as e } from "./ChaiBuilderPages-F_9rLL3W.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";var qn=e=>{throw TypeError(e)};var $n=(e,t,n)=>t.has(e)||qn("Cannot "+n);var k=(e,t,n)=>($n(e,t,"read from private field"),n?n.call(e):t.get(e)),$=(e,t,n)=>t.has(e)?qn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),M=(e,t,n,s)=>($n(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);const w=require("react"),L=require("@tanstack/react-query"),wr=require("@chaibuilder/sdk/web-blocks"),he=require("@chaibuilder/sdk"),h=require("lodash-es"),ss=require("jotai"),d=require("@chaibuilder/sdk/ui"),_=require("lucide-react");function Er(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ae=Er(w);var Zt={exports:{}},Ye={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Vn;function jr(){if(Vn)return Ye;Vn=1;var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,f){var m,g={},b=null,C=null;f!==void 0&&(b=""+f),u.key!==void 0&&(b=""+u.key),u.ref!==void 0&&(C=u.ref);for(m in u)s.call(u,m)&&!a.hasOwnProperty(m)&&(g[m]=u[m]);if(l&&l.defaultProps)for(m in u=l.defaultProps,u)g[m]===void 0&&(g[m]=u[m]);return{$$typeof:t,type:l,key:b,ref:C,props:g,_owner:i.current}}return Ye.Fragment=n,Ye.jsx=o,Ye.jsxs=o,Ye}var Je={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Kn;function Sr(){return Kn||(Kn=1,process.env.NODE_ENV!=="production"&&function(){var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),T=Symbol.iterator,x="@@iterator";function v(c){if(c===null||typeof c!="object")return null;var y=T&&c[T]||c[x];return typeof y=="function"?y:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(c){{for(var y=arguments.length,p=new Array(y>1?y-1:0),A=1;A<y;A++)p[A-1]=arguments[A];z("error",c,p)}}function z(c,y,p){{var A=E.ReactDebugCurrentFrame,U=A.getStackAddendum();U!==""&&(y+="%s",p=p.concat([U]));var W=p.map(function(R){return String(R)});W.unshift("Warning: "+y),Function.prototype.apply.call(console[c],console,W)}}var Y=!1,G=!1,N=!1,q=!1,ce=!1,S;S=Symbol.for("react.module.reference");function I(c){return!!(typeof c=="string"||typeof c=="function"||c===s||c===a||ce||c===i||c===f||c===m||q||c===C||Y||G||N||typeof c=="object"&&c!==null&&(c.$$typeof===b||c.$$typeof===g||c.$$typeof===o||c.$$typeof===l||c.$$typeof===u||c.$$typeof===S||c.getModuleId!==void 0))}function B(c,y,p){var A=c.displayName;if(A)return A;var U=y.displayName||y.name||"";return U!==""?p+"("+U+")":p}function oe(c){return c.displayName||"Context"}function re(c){if(c==null)return null;if(typeof c.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case s:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case m:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case l:var y=c;return oe(y)+".Consumer";case o:var p=c;return oe(p._context)+".Provider";case u:return B(c,c.render,"ForwardRef");case g:var A=c.displayName||null;return A!==null?A:re(c.type)||"Memo";case b:{var U=c,W=U._payload,R=U._init;try{return re(R(W))}catch{return null}}}return null}var ve=Object.assign,ze=0,bn,wn,En,jn,Sn,Cn,Nn;function Tn(){}Tn.__reactDisabledLog=!0;function Hs(){{if(ze===0){bn=console.log,wn=console.info,En=console.warn,jn=console.error,Sn=console.group,Cn=console.groupCollapsed,Nn=console.groupEnd;var c={configurable:!0,enumerable:!0,value:Tn,writable:!0};Object.defineProperties(console,{info:c,log:c,warn:c,error:c,group:c,groupCollapsed:c,groupEnd:c})}ze++}}function Qs(){{if(ze--,ze===0){var c={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ve({},c,{value:bn}),info:ve({},c,{value:wn}),warn:ve({},c,{value:En}),error:ve({},c,{value:jn}),group:ve({},c,{value:Sn}),groupCollapsed:ve({},c,{value:Cn}),groupEnd:ve({},c,{value:Nn})})}ze<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Mt=E.ReactCurrentDispatcher,Bt;function vt(c,y,p){{if(Bt===void 0)try{throw Error()}catch(U){var A=U.stack.trim().match(/\n( *(at )?)/);Bt=A&&A[1]||""}return`
|
|
18
|
+
`+Bt+c}}var qt=!1,bt;{var Ys=typeof WeakMap=="function"?WeakMap:Map;bt=new Ys}function An(c,y){if(!c||qt)return"";{var p=bt.get(c);if(p!==void 0)return p}var A;qt=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var W;W=Mt.current,Mt.current=null,Hs();try{if(y){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(ie){A=ie}Reflect.construct(c,[],R)}else{try{R.call()}catch(ie){A=ie}c.call(R.prototype)}}else{try{throw Error()}catch(ie){A=ie}c()}}catch(ie){if(ie&&A&&typeof ie.stack=="string"){for(var D=ie.stack.split(`
|
|
19
|
+
`),ne=A.stack.split(`
|
|
20
|
+
`),Q=D.length-1,J=ne.length-1;Q>=1&&J>=0&&D[Q]!==ne[J];)J--;for(;Q>=1&&J>=0;Q--,J--)if(D[Q]!==ne[J]){if(Q!==1||J!==1)do if(Q--,J--,J<0||D[Q]!==ne[J]){var le=`
|
|
21
|
+
`+D[Q].replace(" at new "," at ");return c.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",c.displayName)),typeof c=="function"&&bt.set(c,le),le}while(Q>=1&&J>=0);break}}}finally{qt=!1,Mt.current=W,Qs(),Error.prepareStackTrace=U}var Ce=c?c.displayName||c.name:"",be=Ce?vt(Ce):"";return typeof c=="function"&&bt.set(c,be),be}function Js(c,y,p){return An(c,!1)}function Xs(c){var y=c.prototype;return!!(y&&y.isReactComponent)}function wt(c,y,p){if(c==null)return"";if(typeof c=="function")return An(c,Xs(c));if(typeof c=="string")return vt(c);switch(c){case f:return vt("Suspense");case m:return vt("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case u:return Js(c.render);case g:return wt(c.type,y,p);case b:{var A=c,U=A._payload,W=A._init;try{return wt(W(U),y,p)}catch{}}}return""}var He=Object.prototype.hasOwnProperty,kn={},Pn=E.ReactDebugCurrentFrame;function Et(c){if(c){var y=c._owner,p=wt(c.type,c._source,y?y.type:null);Pn.setExtraStackFrame(p)}else Pn.setExtraStackFrame(null)}function Zs(c,y,p,A,U){{var W=Function.call.bind(He);for(var R in c)if(W(c,R)){var D=void 0;try{if(typeof c[R]!="function"){var ne=Error((A||"React class")+": "+p+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ne.name="Invariant Violation",ne}D=c[R](y,R,A,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Q){D=Q}D&&!(D instanceof Error)&&(Et(U),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",A||"React class",p,R,typeof D),Et(null)),D instanceof Error&&!(D.message in kn)&&(kn[D.message]=!0,Et(U),j("Failed %s type: %s",p,D.message),Et(null))}}}var er=Array.isArray;function $t(c){return er(c)}function tr(c){{var y=typeof Symbol=="function"&&Symbol.toStringTag,p=y&&c[Symbol.toStringTag]||c.constructor.name||"Object";return p}}function nr(c){try{return _n(c),!1}catch{return!0}}function _n(c){return""+c}function On(c){if(nr(c))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tr(c)),_n(c)}var Qe=E.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Dn,In,Vt;Vt={};function rr(c){if(He.call(c,"ref")){var y=Object.getOwnPropertyDescriptor(c,"ref").get;if(y&&y.isReactWarning)return!1}return c.ref!==void 0}function ir(c){if(He.call(c,"key")){var y=Object.getOwnPropertyDescriptor(c,"key").get;if(y&&y.isReactWarning)return!1}return c.key!==void 0}function ar(c,y){if(typeof c.ref=="string"&&Qe.current&&y&&Qe.current.stateNode!==y){var p=re(Qe.current.type);Vt[p]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',re(Qe.current.type),c.ref),Vt[p]=!0)}}function or(c,y){{var p=function(){Dn||(Dn=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",y))};p.isReactWarning=!0,Object.defineProperty(c,"key",{get:p,configurable:!0})}}function lr(c,y){{var p=function(){In||(In=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",y))};p.isReactWarning=!0,Object.defineProperty(c,"ref",{get:p,configurable:!0})}}var cr=function(c,y,p,A,U,W,R){var D={$$typeof:t,type:c,key:y,ref:p,props:R,_owner:W};return D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(D,"_self",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.defineProperty(D,"_source",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D};function ur(c,y,p,A,U){{var W,R={},D=null,ne=null;p!==void 0&&(On(p),D=""+p),ir(y)&&(On(y.key),D=""+y.key),rr(y)&&(ne=y.ref,ar(y,U));for(W in y)He.call(y,W)&&!sr.hasOwnProperty(W)&&(R[W]=y[W]);if(c&&c.defaultProps){var Q=c.defaultProps;for(W in Q)R[W]===void 0&&(R[W]=Q[W])}if(D||ne){var J=typeof c=="function"?c.displayName||c.name||"Unknown":c;D&&or(R,J),ne&&lr(R,J)}return cr(c,D,ne,U,A,Qe.current,R)}}var Kt=E.ReactCurrentOwner,Rn=E.ReactDebugCurrentFrame;function Se(c){if(c){var y=c._owner,p=wt(c.type,c._source,y?y.type:null);Rn.setExtraStackFrame(p)}else Rn.setExtraStackFrame(null)}var Wt;Wt=!1;function zt(c){return typeof c=="object"&&c!==null&&c.$$typeof===t}function Ln(){{if(Kt.current){var c=re(Kt.current.type);if(c)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+c+"`."}return""}}function dr(c){return""}var Gn={};function fr(c){{var y=Ln();if(!y){var p=typeof c=="string"?c:c.displayName||c.name;p&&(y=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+p+">.")}return y}}function Fn(c,y){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var p=fr(y);if(Gn[p])return;Gn[p]=!0;var A="";c&&c._owner&&c._owner!==Kt.current&&(A=" It was passed a child from "+re(c._owner.type)+"."),Se(c),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,A),Se(null)}}function Un(c,y){{if(typeof c!="object")return;if($t(c))for(var p=0;p<c.length;p++){var A=c[p];zt(A)&&Fn(A,y)}else if(zt(c))c._store&&(c._store.validated=!0);else if(c){var U=v(c);if(typeof U=="function"&&U!==c.entries)for(var W=U.call(c),R;!(R=W.next()).done;)zt(R.value)&&Fn(R.value,y)}}}function hr(c){{var y=c.type;if(y==null||typeof y=="string")return;var p;if(typeof y=="function")p=y.propTypes;else if(typeof y=="object"&&(y.$$typeof===u||y.$$typeof===g))p=y.propTypes;else return;if(p){var A=re(y);Zs(p,c.props,"prop",A,c)}else if(y.PropTypes!==void 0&&!Wt){Wt=!0;var U=re(y);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",U||"Unknown")}typeof y.getDefaultProps=="function"&&!y.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gr(c){{for(var y=Object.keys(c.props),p=0;p<y.length;p++){var A=y[p];if(A!=="children"&&A!=="key"){Se(c),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",A),Se(null);break}}c.ref!==null&&(Se(c),j("Invalid attribute `ref` supplied to `React.Fragment`."),Se(null))}}var Mn={};function Bn(c,y,p,A,U,W){{var R=I(c);if(!R){var D="";(c===void 0||typeof c=="object"&&c!==null&&Object.keys(c).length===0)&&(D+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ne=dr();ne?D+=ne:D+=Ln();var Q;c===null?Q="null":$t(c)?Q="array":c!==void 0&&c.$$typeof===t?(Q="<"+(re(c.type)||"Unknown")+" />",D=" Did you accidentally export a JSX literal instead of a component?"):Q=typeof c,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Q,D)}var J=ur(c,y,p,U,W);if(J==null)return J;if(R){var le=y.children;if(le!==void 0)if(A)if($t(le)){for(var Ce=0;Ce<le.length;Ce++)Un(le[Ce],c);Object.freeze&&Object.freeze(le)}else j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Un(le,c)}if(He.call(y,"key")){var be=re(c),ie=Object.keys(y).filter(function(br){return br!=="key"}),Ht=ie.length>0?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}";if(!Mn[be+Ht]){var vr=ie.length>0?"{"+ie.join(": ..., ")+": ...}":"{}";j(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,Ht,be,vr,be),Mn[be+Ht]=!0}}return c===s?gr(J):hr(J),J}}function mr(c,y,p){return Bn(c,y,p,!0)}function yr(c,y,p){return Bn(c,y,p,!1)}var pr=yr,xr=mr;Je.Fragment=s,Je.jsx=pr,Je.jsxs=xr}()),Je}process.env.NODE_ENV==="production"?Zt.exports=jr():Zt.exports=Sr();var r=Zt.exports,O={context:void 0,registry:void 0,getContextId(){return Wn(this.context.count)},getNextContextId(){return Wn(this.context.count++)}};function Wn(e){const t=String(e),n=t.length-1;return O.context.id+(n?String.fromCharCode(96+n):"")+t}function Xe(e){O.context=e}var Cr=(e,t)=>e===t,Tt=Symbol("solid-proxy"),dn=Symbol("solid-track"),At={equals:Cr},rs=us,ge=1,kt=2,is={owned:null,cleanups:null,context:null,owner:null},Qt={},F=null,Yt=null,Nr=null,V=null,te=null,fe=null,Rt=0;function me(e,t){const n=V,s=F,i=e.length===0,a=t===void 0?s:t,o=i?is:{owned:null,cleanups:null,context:a?a.context:null,owner:a},l=i?e:()=>e(()=>ee(()=>Gt(o)));F=o,V=null;try{return de(l,!0)}finally{V=n,F=s}}function H(e,t){t=t?Object.assign({},At,t):At;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},s=i=>(typeof i=="function"&&(i=i(n.value)),cs(n,i));return[ls.bind(n),s]}function en(e,t,n){const s=Lt(e,t,!0,ge);Ke(s)}function ye(e,t,n){const s=Lt(e,t,!1,ge);Ke(s)}function fn(e,t,n){rs=Mr;const s=Lt(e,t,!1,ge);(!n||!n.render)&&(s.user=!0),fe?fe.push(s):Ke(s)}function se(e,t,n){n=n?Object.assign({},At,n):At;const s=Lt(e,t,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,Ke(s),ls.bind(s)}function Tr(e){return e&&typeof e=="object"&&"then"in e}function Ar(e,t,n){let s,i,a;arguments.length===2&&typeof t=="object"||arguments.length===1?(s=!0,i=e,a={}):(s=e,i=t,a={});let o=null,l=Qt,u=null,f=!1,m="initialValue"in a,g=typeof s=="function"&&se(s);const b=new Set,[C,T]=(a.storage||H)(a.initialValue),[x,v]=H(void 0),[E,j]=H(void 0,{equals:!1}),[z,Y]=H(m?"ready":"unresolved");if(O.context){u=O.getNextContextId();let S;a.ssrLoadFrom==="initial"?l=a.initialValue:O.load&&(S=O.load(u))&&(l=S)}function G(S,I,B,oe){return o===S&&(o=null,oe!==void 0&&(m=!0),(S===l||I===l)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(oe,{value:I})),l=Qt,N(I,B)),I}function N(S,I){de(()=>{I===void 0&&T(()=>S),Y(I!==void 0?"errored":m?"ready":"unresolved"),v(I);for(const B of b.keys())B.decrement();b.clear()},!1)}function q(){const S=Gr,I=C(),B=x();if(B!==void 0&&!o)throw B;return V&&!V.user&&S&&en(()=>{E(),o&&(S.resolved||b.has(S)||(S.increment(),b.add(S)))}),I}function ce(S=!0){if(S!==!1&&f)return;f=!1;const I=g?g():s;if(I==null||I===!1){G(o,ee(C));return}const B=l!==Qt?l:ee(()=>i(I,{value:C(),refetching:S}));return Tr(B)?(o=B,"value"in B?(B.status==="success"?G(o,B.value,void 0,I):G(o,void 0,tn(B.value),I),B):(f=!0,queueMicrotask(()=>f=!1),de(()=>{Y(m?"refreshing":"pending"),j()},!1),B.then(oe=>G(B,oe,void 0,I),oe=>G(B,void 0,tn(oe),I)))):(G(o,B,void 0,I),B)}return Object.defineProperties(q,{state:{get:()=>z()},error:{get:()=>x()},loading:{get(){const S=z();return S==="pending"||S==="refreshing"}},latest:{get(){if(!m)return q();const S=x();if(S&&!o)throw S;return C()}}}),g?en(()=>ce(!1)):ce(!1),[q,{refetch:ce,mutate:T}]}function kr(e){return de(e,!1)}function ee(e){if(V===null)return e();const t=V;V=null;try{return e()}finally{V=t}}function Pr(e,t,n){const s=Array.isArray(e);let i,a=n&&n.defer;return o=>{let l;if(s){l=Array(e.length);for(let f=0;f<e.length;f++)l[f]=e[f]()}else l=e();if(a)return a=!1,o;const u=ee(()=>t(l,i,o));return i=l,u}}function as(e){fn(()=>ee(e))}function $e(e){return F===null||(F.cleanups===null?F.cleanups=[e]:F.cleanups.push(e)),e}function zn(){return F}function _r(e,t){const n=F,s=V;F=e,V=null;try{return de(t,!0)}catch(i){hn(i)}finally{F=n,V=s}}function Or(e){const t=V,n=F;return Promise.resolve().then(()=>{V=t,F=n;let s;return de(e,!1),V=F=null,s?s.done:void 0})}var[Dr,Ja]=H(!1);function Ir(){return[Dr,Or]}function Rr(e,t){const n=Symbol("context");return{id:n,Provider:Br(n),defaultValue:e}}function Lr(e){let t;return F&&F.context&&(t=F.context[e.id])!==void 0?t:e.defaultValue}function os(e){const t=se(e),n=se(()=>nn(t()));return n.toArray=()=>{const s=n();return Array.isArray(s)?s:s!=null?[s]:[]},n}var Gr;function ls(){if(this.sources&&this.state)if(this.state===ge)Ke(this);else{const e=te;te=null,de(()=>_t(this),!1),te=e}if(V){const e=this.observers?this.observers.length:0;V.sources?(V.sources.push(this),V.sourceSlots.push(e)):(V.sources=[this],V.sourceSlots=[e]),this.observers?(this.observers.push(V),this.observerSlots.push(V.sources.length-1)):(this.observers=[V],this.observerSlots=[V.sources.length-1])}return this.value}function cs(e,t,n){let s=e.value;return(!e.comparator||!e.comparator(s,t))&&(e.value=t,e.observers&&e.observers.length&&de(()=>{for(let i=0;i<e.observers.length;i+=1){const a=e.observers[i],o=Yt&&Yt.running;o&&Yt.disposed.has(a),(o?!a.tState:!a.state)&&(a.pure?te.push(a):fe.push(a),a.observers&&ds(a)),o||(a.state=ge)}if(te.length>1e6)throw te=[],new Error},!1)),t}function Ke(e){if(!e.fn)return;Gt(e);const t=Rt;Fr(e,e.value,t)}function Fr(e,t,n){let s;const i=F,a=V;V=F=e;try{s=e.fn(t)}catch(o){return e.pure&&(e.state=ge,e.owned&&e.owned.forEach(Gt),e.owned=null),e.updatedAt=n+1,hn(o)}finally{V=a,F=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?cs(e,s):e.value=s,e.updatedAt=n)}function Lt(e,t,n,s=ge,i){const a={fn:e,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:F,context:F?F.context:null,pure:n};return F===null||F!==is&&(F.owned?F.owned.push(a):F.owned=[a]),a}function Pt(e){if(e.state===0)return;if(e.state===kt)return _t(e);if(e.suspense&&ee(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Rt);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===ge)Ke(e);else if(e.state===kt){const s=te;te=null,de(()=>_t(e,t[0]),!1),te=s}}function de(e,t){if(te)return e();let n=!1;t||(te=[]),fe?n=!0:fe=[],Rt++;try{const s=e();return Ur(n),s}catch(s){n||(fe=null),te=null,hn(s)}}function Ur(e){if(te&&(us(te),te=null),e)return;const t=fe;fe=null,t.length&&de(()=>rs(t),!1)}function us(e){for(let t=0;t<e.length;t++)Pt(e[t])}function Mr(e){let t,n=0;for(t=0;t<e.length;t++){const s=e[t];s.user?e[n++]=s:Pt(s)}if(O.context){if(O.count){O.effects||(O.effects=[]),O.effects.push(...e.slice(0,n));return}else O.effects&&(e=[...O.effects,...e],n+=O.effects.length,delete O.effects);Xe()}for(t=0;t<n;t++)Pt(e[t])}function _t(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const s=e.sources[n];if(s.sources){const i=s.state;i===ge?s!==t&&(!s.updatedAt||s.updatedAt<Rt)&&Pt(s):i===kt&&_t(s,t)}}}function ds(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=kt,n.pure?te.push(n):fe.push(n),n.observers&&ds(n))}}function Gt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),s=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const a=i.pop(),o=n.observerSlots.pop();s<i.length&&(a.sourceSlots[o]=s,i[s]=a,n.observerSlots[s]=o)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Gt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function tn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function hn(e,t=F){throw tn(e)}function nn(e){if(typeof e=="function"&&!e.length)return nn(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const s=nn(e[n]);Array.isArray(s)?t.push.apply(t,s):t.push(s)}return t}return e}function Br(e,t){return function(s){let i;return ye(()=>i=ee(()=>(F.context={...F.context,[e]:s.value},os(()=>s.children))),void 0),i}}var sn=Symbol("fallback");function Ot(e){for(let t=0;t<e.length;t++)e[t]()}function qr(e,t,n={}){let s=[],i=[],a=[],o=0,l=t.length>1?[]:null;return $e(()=>Ot(a)),()=>{let u=e()||[],f=u.length,m,g;return u[dn],ee(()=>{let C,T,x,v,E,j,z,Y,G;if(f===0)o!==0&&(Ot(a),a=[],s=[],i=[],o=0,l&&(l=[])),n.fallback&&(s=[sn],i[0]=me(N=>(a[0]=N,n.fallback())),o=1);else if(o===0){for(i=new Array(f),g=0;g<f;g++)s[g]=u[g],i[g]=me(b);o=f}else{for(x=new Array(f),v=new Array(f),l&&(E=new Array(f)),j=0,z=Math.min(o,f);j<z&&s[j]===u[j];j++);for(z=o-1,Y=f-1;z>=j&&Y>=j&&s[z]===u[Y];z--,Y--)x[Y]=i[z],v[Y]=a[z],l&&(E[Y]=l[z]);for(C=new Map,T=new Array(Y+1),g=Y;g>=j;g--)G=u[g],m=C.get(G),T[g]=m===void 0?-1:m,C.set(G,g);for(m=j;m<=z;m++)G=s[m],g=C.get(G),g!==void 0&&g!==-1?(x[g]=i[m],v[g]=a[m],l&&(E[g]=l[m]),g=T[g],C.set(G,g)):a[m]();for(g=j;g<f;g++)g in x?(i[g]=x[g],a[g]=v[g],l&&(l[g]=E[g],l[g](g))):i[g]=me(b);i=i.slice(0,o=f),s=u.slice(0)}return i});function b(C){if(a[g]=C,l){const[T,x]=H(g);return l[g]=x,t(u[g],T)}return t(u[g])}}}function $r(e,t,n={}){let s=[],i=[],a=[],o=[],l=0,u;return $e(()=>Ot(a)),()=>{const f=e()||[],m=f.length;return f[dn],ee(()=>{if(m===0)return l!==0&&(Ot(a),a=[],s=[],i=[],l=0,o=[]),n.fallback&&(s=[sn],i[0]=me(b=>(a[0]=b,n.fallback())),l=1),i;for(s[0]===sn&&(a[0](),a=[],s=[],i=[],l=0),u=0;u<m;u++)u<s.length&&s[u]!==f[u]?o[u](()=>f[u]):u>=s.length&&(i[u]=me(g));for(;u<s.length;u++)a[u]();return l=o.length=a.length=m,s=f.slice(0),i=i.slice(0,l)});function g(b){a[u]=b;const[C,T]=H(f[u]);return o[u]=T,t(C,u)}}}function gn(e,t){return ee(()=>e(t||{}))}function jt(){return!0}var rn={get(e,t,n){return t===Tt?n:e.get(t)},has(e,t){return t===Tt?!0:e.has(t)},set:jt,deleteProperty:jt,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:jt,deleteProperty:jt}},ownKeys(e){return e.keys()}};function Jt(e){return(e=typeof e=="function"?e():e)?e:{}}function Vr(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function mn(...e){let t=!1;for(let o=0;o<e.length;o++){const l=e[o];t=t||!!l&&Tt in l,e[o]=typeof l=="function"?(t=!0,se(l)):l}if(t)return new Proxy({get(o){for(let l=e.length-1;l>=0;l--){const u=Jt(e[l])[o];if(u!==void 0)return u}},has(o){for(let l=e.length-1;l>=0;l--)if(o in Jt(e[l]))return!0;return!1},keys(){const o=[];for(let l=0;l<e.length;l++)o.push(...Object.keys(Jt(e[l])));return[...new Set(o)]}},rn);const n={},s=Object.create(null);for(let o=e.length-1;o>=0;o--){const l=e[o];if(!l)continue;const u=Object.getOwnPropertyNames(l);for(let f=u.length-1;f>=0;f--){const m=u[f];if(m==="__proto__"||m==="constructor")continue;const g=Object.getOwnPropertyDescriptor(l,m);if(!s[m])s[m]=g.get?{enumerable:!0,configurable:!0,get:Vr.bind(n[m]=[g.get.bind(l)])}:g.value!==void 0?g:void 0;else{const b=n[m];b&&(g.get?b.push(g.get.bind(l)):g.value!==void 0&&b.push(()=>g.value))}}}const i={},a=Object.keys(s);for(let o=a.length-1;o>=0;o--){const l=a[o],u=s[l];u&&u.get?Object.defineProperty(i,l,u):i[l]=u?u.value:void 0}return i}function fs(e,...t){if(Tt in e){const i=new Set(t.length>1?t.flat():t[0]),a=t.map(o=>new Proxy({get(l){return o.includes(l)?e[l]:void 0},has(l){return o.includes(l)&&l in e},keys(){return o.filter(l=>l in e)}},rn));return a.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},rn)),a}const n={},s=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const a=Object.getOwnPropertyDescriptor(e,i),o=!a.get&&!a.set&&a.enumerable&&a.writable&&a.configurable;let l=!1,u=0;for(const f of t)f.includes(i)&&(l=!0,o?s[u][i]=a.value:Object.defineProperty(s[u],i,a)),++u;l||(o?n[i]=a.value:Object.defineProperty(n,i,a))}return[...s,n]}function hs(e){let t,n;const s=i=>{const a=O.context;if(a){const[l,u]=H();O.count||(O.count=0),O.count++,(n||(n=e())).then(f=>{Xe(a),O.count--,u(()=>f.default),Xe()}),t=l}else if(!t){const[l]=Ar(()=>(n||(n=e())).then(u=>u.default));t=l}let o;return se(()=>(o=t())&&ee(()=>{if(!a)return o(i);const l=O.context;Xe(a);const u=o(i);return Xe(l),u}))};return s.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),s}var Kr=0;function Wr(){return O.context?O.getNextContextId():`cl-${Kr++}`}var gs=e=>`Stale read from <${e}>.`;function zr(e){const t="fallback"in e&&{fallback:()=>e.fallback};return se(qr(()=>e.each,e.children,t||void 0))}function Hr(e){const t="fallback"in e&&{fallback:()=>e.fallback};return se($r(()=>e.each,e.children,t||void 0))}function Qr(e){const t=e.keyed,n=se(()=>e.when,void 0,{equals:(s,i)=>t?s===i:!s==!i});return se(()=>{const s=n();if(s){const i=e.children;return typeof i=="function"&&i.length>0?ee(()=>i(t?s:()=>{if(!ee(n))throw gs("Show");return e.when})):i}return e.fallback},void 0,void 0)}function Yr(e){let t=!1;const n=(a,o)=>(t?a[1]===o[1]:!a[1]==!o[1])&&a[2]===o[2],s=os(()=>e.children),i=se(()=>{let a=s();Array.isArray(a)||(a=[a]);for(let o=0;o<a.length;o++){const l=a[o].when;if(l)return t=!!a[o].keyed,[o,l,a[o]]}return[-1]},void 0,{equals:n});return se(()=>{const[a,o,l]=i();if(a<0)return e.fallback;const u=l.children;return typeof u=="function"&&u.length>0?ee(()=>u(t?o:()=>{if(ee(i)[0]!==a)throw gs("Match");return l.when})):u},void 0,void 0)}function Jr(e){return e}var Xr=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Zr=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Xr]),ei=new Set(["innerHTML","textContent","innerText","children"]),ti=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ni=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function si(e,t){const n=ni[e];return typeof n=="object"?n[t]?n.$:void 0:n}var ri=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ii=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ai={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function oi(e,t,n){let s=n.length,i=t.length,a=s,o=0,l=0,u=t[i-1].nextSibling,f=null;for(;o<i||l<a;){if(t[o]===n[l]){o++,l++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){const m=a<s?l?n[l-1].nextSibling:n[a-l]:u;for(;l<a;)e.insertBefore(n[l++],m)}else if(a===l)for(;o<i;)(!f||!f.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[l]===t[i-1]){const m=t[--i].nextSibling;e.insertBefore(n[l++],t[o++].nextSibling),e.insertBefore(n[--a],m),t[i]=n[a]}else{if(!f){f=new Map;let g=l;for(;g<a;)f.set(n[g],g++)}const m=f.get(t[o]);if(m!=null)if(l<m&&m<a){let g=o,b=1,C;for(;++g<i&&g<a&&!((C=f.get(t[g]))==null||C!==m+b);)b++;if(b>m-l){const T=t[o];for(;l<m;)e.insertBefore(n[l++],T)}else e.replaceChild(n[l++],t[o++])}else o++;else t[o++].remove()}}}var tt="_$DX_DELEGATE";function ms(e,t,n,s={}){let i;return me(a=>{i=a,t===document?e():It(t,e(),t.firstChild?null:void 0,n)},s.owner),()=>{i(),t.textContent=""}}function li(e,t,n){let s;const i=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},a=()=>(s||(s=i())).cloneNode(!0);return a.cloneNode=a,a}function ys(e,t=window.document){const n=t[tt]||(t[tt]=new Set);for(let s=0,i=e.length;s<i;s++){const a=e[s];n.has(a)||(n.add(a),t.addEventListener(a,ws))}}function ci(e=window.document){if(e[tt]){for(let t of e[tt].keys())e.removeEventListener(t,ws);delete e[tt]}}function Dt(e,t,n){O.context&&e.isConnected||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ui(e,t,n,s){O.context&&e.isConnected||(s==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,s))}function ps(e,t){O.context&&e.isConnected||(t==null?e.removeAttribute("class"):e.className=t)}function xs(e,t,n,s){if(s)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=a=>i.call(e,n[1],a))}else e.addEventListener(t,n)}function di(e,t,n={}){const s=Object.keys(t||{}),i=Object.keys(n);let a,o;for(a=0,o=i.length;a<o;a++){const l=i[a];!l||l==="undefined"||t[l]||(Hn(e,l,!1),delete n[l])}for(a=0,o=s.length;a<o;a++){const l=s[a],u=!!t[l];!l||l==="undefined"||n[l]===u||!u||(Hn(e,l,!0),n[l]=u)}return n}function fi(e,t,n){if(!t)return n?Dt(e,"style"):t;const s=e.style;if(typeof t=="string")return s.cssText=t;typeof n=="string"&&(s.cssText=n=void 0),n||(n={}),t||(t={});let i,a;for(a in n)t[a]==null&&s.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(s.setProperty(a,i),n[a]=i);return n}function vs(e,t={},n,s){const i={};return s||ye(()=>i.children=st(e,t.children,i.children)),ye(()=>typeof t.ref=="function"&&bs(t.ref,e)),ye(()=>hi(e,t,n,!0,i,!0)),i}function bs(e,t,n){return ee(()=>e(t,n))}function It(e,t,n,s){if(n!==void 0&&!s&&(s=[]),typeof t!="function")return st(e,t,s,n);ye(i=>st(e,t(),i,n),s)}function hi(e,t,n,s,i={},a=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=Qn(e,o,null,i[o],n,a)}for(const o in t){if(o==="children")continue;const l=t[o];i[o]=Qn(e,o,l,i[o],n,a)}}function gi(e){let t,n;return!O.context||!(t=O.registry.get(n=yi()))?e():(O.completed&&O.completed.add(t),O.registry.delete(n),t)}function mi(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Hn(e,t,n){const s=t.trim().split(/\s+/);for(let i=0,a=s.length;i<a;i++)e.classList.toggle(s[i],n)}function Qn(e,t,n,s,i,a){let o,l,u,f,m;if(t==="style")return fi(e,n,s);if(t==="classList")return di(e,n,s);if(n===s)return s;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);s&&e.removeEventListener(g,s),n&&e.addEventListener(g,n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);s&&e.removeEventListener(g,s,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),b=ri.has(g);if(!b&&s){const C=Array.isArray(s)?s[0]:s;e.removeEventListener(g,C)}(b||n)&&(xs(e,g,n,b),b&&ys([g]))}else if(t.slice(0,5)==="attr:")Dt(e,t.slice(5),n);else if((m=t.slice(0,5)==="prop:")||(u=ei.has(t))||!i&&((f=si(t,e.tagName))||(l=Zr.has(t)))||(o=e.nodeName.includes("-"))){if(m)t=t.slice(5),l=!0;else if(O.context&&e.isConnected)return n;t==="class"||t==="className"?ps(e,n):o&&!l&&!u?e[mi(t)]=n:e[f||t]=n}else{const g=i&&t.indexOf(":")>-1&&ai[t.split(":")[0]];g?ui(e,g,t,n):Dt(e,ti[t]||t,n)}return n}function ws(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),O.registry&&!O.done&&(O.done=_$HY.done=!0);n;){const s=n[t];if(s&&!n.disabled){const i=n[`${t}Data`];if(i!==void 0?s.call(n,i,e):s.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function st(e,t,n,s,i){const a=!!O.context&&e.isConnected;if(a){!n&&(n=[...e.childNodes]);let u=[];for(let f=0;f<n.length;f++){const m=n[f];m.nodeType===8&&m.data.slice(0,2)==="!$"?m.remove():u.push(m)}n=u}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,l=s!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(a||o==="number"&&(t=t.toString(),t===n))return n;if(l){let u=n[0];u&&u.nodeType===3?u.data!==t&&(u.data=t):u=document.createTextNode(t),n=Ne(e,n,s,u)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(a)return n;n=Ne(e,n,s)}else{if(o==="function")return ye(()=>{let u=t();for(;typeof u=="function";)u=u();n=st(e,u,n,s)}),()=>n;if(Array.isArray(t)){const u=[],f=n&&Array.isArray(n);if(an(u,t,n,i))return ye(()=>n=st(e,u,n,s,!0)),()=>n;if(a){if(!u.length)return n;if(s===void 0)return[...e.childNodes];let m=u[0],g=[m];for(;(m=m.nextSibling)!==s;)g.push(m);return n=g}if(u.length===0){if(n=Ne(e,n,s),l)return n}else f?n.length===0?Yn(e,u,s):oi(e,n,u):(n&&Ne(e),Yn(e,u));n=u}else if(t.nodeType){if(a&&t.parentNode)return n=l?[t]:t;if(Array.isArray(n)){if(l)return n=Ne(e,n,s,t);Ne(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function an(e,t,n,s){let i=!1;for(let a=0,o=t.length;a<o;a++){let l=t[a],u=n&&n[e.length],f;if(!(l==null||l===!0||l===!1))if((f=typeof l)=="object"&&l.nodeType)e.push(l);else if(Array.isArray(l))i=an(e,l,u)||i;else if(f==="function")if(s){for(;typeof l=="function";)l=l();i=an(e,Array.isArray(l)?l:[l],Array.isArray(u)?u:[u])||i}else e.push(l),i=!0;else{const m=String(l);u&&u.nodeType===3&&u.data===m?e.push(u):e.push(document.createTextNode(m))}}return i}function Yn(e,t,n=null){for(let s=0,i=t.length;s<i;s++)e.insertBefore(t[s],n)}function Ne(e,t,n,s){if(n===void 0)return e.textContent="";const i=s||document.createTextNode("");if(t.length){let a=!1;for(let o=t.length-1;o>=0;o--){const l=t[o];if(i!==l){const u=l.parentNode===e;!a&&!o?u?e.replaceChild(i,l):e.insertBefore(i,n):u&&l.remove()}else a=!0}}else e.insertBefore(i,n);return[i]}function yi(){return O.getNextContextId()}var pi="http://www.w3.org/2000/svg";function Es(e,t=!1){return t?document.createElementNS(pi,e):document.createElement(e)}function xi(e){const{useShadow:t}=e,n=document.createTextNode(""),s=()=>e.mount||document.body,i=zn();let a,o=!!O.context;return fn(()=>{o&&(zn().user=o=!1),a||(a=_r(i,()=>se(()=>e.children)));const l=s();if(l instanceof HTMLHeadElement){const[u,f]=H(!1),m=()=>f(!0);me(g=>It(l,()=>u()?g():a(),null)),$e(m)}else{const u=Es(e.isSVG?"g":"div",e.isSVG),f=t&&u.attachShadow?u.attachShadow({mode:"open"}):u;Object.defineProperty(u,"_$host",{get(){return n.parentNode},configurable:!0}),It(f,a),l.appendChild(u),e.ref&&e.ref(u),$e(()=>l.removeChild(u))}},void 0,{render:!o}),n}function vi(e){const[t,n]=fs(e,["component"]),s=se(()=>t.component);return se(()=>{const i=s();switch(typeof i){case"function":return ee(()=>i(n));case"string":const a=ii.has(i),o=O.context?gi():Es(i,a);return vs(o,n,a),o}})}var bi=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},js=class{constructor(e){this.generateIdentifier=e,this.kv=new bi}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},wi=class extends js{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function Ei(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function ji(e,t){const n=Ei(e);if("find"in n)return n.find(t);const s=n;for(let i=0;i<s.length;i++){const a=s[i];if(t(a))return a}}function Ve(e,t){Object.entries(e).forEach(([n,s])=>t(s,n))}function Nt(e,t){return e.indexOf(t)!==-1}function Jn(e,t){for(let n=0;n<e.length;n++){const s=e[n];if(t(s))return s}}var Si=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return ji(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},Ci=e=>Object.prototype.toString.call(e).slice(8,-1),Ss=e=>typeof e>"u",Ni=e=>e===null,rt=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,on=e=>rt(e)&&Object.keys(e).length===0,xe=e=>Array.isArray(e),Ti=e=>typeof e=="string",Ai=e=>typeof e=="number"&&!isNaN(e),ki=e=>typeof e=="boolean",Pi=e=>e instanceof RegExp,it=e=>e instanceof Map,at=e=>e instanceof Set,Cs=e=>Ci(e)==="Symbol",_i=e=>e instanceof Date&&!isNaN(e.valueOf()),Oi=e=>e instanceof Error,Xn=e=>typeof e=="number"&&isNaN(e),Di=e=>ki(e)||Ni(e)||Ss(e)||Ai(e)||Ti(e)||Cs(e),Ii=e=>typeof e=="bigint",Ri=e=>e===1/0||e===-1/0,Li=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Gi=e=>e instanceof URL,Ns=e=>e.replace(/\./g,"\\."),Xt=e=>e.map(String).map(Ns).join("."),nt=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let a=e.charAt(i);if(a==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(a==="."){t.push(n),n="";continue}n+=a}const s=n;return t.push(s),t};function ue(e,t,n,s){return{isApplicable:e,annotation:t,transform:n,untransform:s}}var Ts=[ue(Ss,"undefined",()=>null,()=>{}),ue(Ii,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):e),ue(_i,"Date",e=>e.toISOString(),e=>new Date(e)),ue(Oi,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(s=>{n[s]=e[s]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(s=>{n[s]=e[s]}),n}),ue(Pi,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ue(at,"set",e=>[...e.values()],e=>new Set(e)),ue(it,"map",e=>[...e.entries()],e=>new Map(e)),ue(e=>Xn(e)||Ri(e),"number",e=>Xn(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ue(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ue(Gi,"URL",e=>e.toString(),e=>new URL(e))];function Ft(e,t,n,s){return{isApplicable:e,annotation:t,transform:n,untransform:s}}var As=Ft((e,t)=>Cs(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const s=n.symbolRegistry.getValue(t[1]);if(!s)throw new Error("Trying to deserialize unknown symbol");return s}),Fi=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),ks=Ft(Li,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=Fi[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Ps(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var _s=Ft(Ps,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const s={};return n.forEach(i=>{s[i]=e[i]}),s},(e,t,n)=>{const s=n.classRegistry.getValue(t[1]);if(!s)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(s.prototype),e)}),Os=Ft((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const s=n.customTransformerRegistry.findByName(t[1]);if(!s)throw new Error("Trying to deserialize unknown custom value");return s.deserialize(e)}),Ui=[_s,As,Os,ks],Zn=(e,t)=>{const n=Jn(Ui,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const s=Jn(Ts,i=>i.isApplicable(e,t));if(s)return{value:s.transform(e,t),type:s.annotation}},Ds={};Ts.forEach(e=>{Ds[e.annotation]=e});var Mi=(e,t,n)=>{if(xe(t))switch(t[0]){case"symbol":return As.untransform(e,t,n);case"class":return _s.untransform(e,t,n);case"custom":return Os.untransform(e,t,n);case"typed-array":return ks.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const s=Ds[t];if(!s)throw new Error("Unknown transformation: "+t);return s.untransform(e,n)}},Te=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Is(e){if(Nt(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Nt(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Nt(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Bi=(e,t)=>{Is(t);for(let n=0;n<t.length;n++){const s=t[n];if(at(e))e=Te(e,+s);else if(it(e)){const i=+s,a=+t[++n]==0?"key":"value",o=Te(e,i);switch(a){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[s]}return e},ln=(e,t,n)=>{if(Is(t),t.length===0)return n(e);let s=e;for(let a=0;a<t.length-1;a++){const o=t[a];if(xe(s)){const l=+o;s=s[l]}else if(rt(s))s=s[o];else if(at(s)){const l=+o;s=Te(s,l)}else if(it(s)){if(a===t.length-2)break;const u=+o,f=+t[++a]==0?"key":"value",m=Te(s,u);switch(f){case"key":s=m;break;case"value":s=s.get(m);break}}}const i=t[t.length-1];if(xe(s)?s[+i]=n(s[+i]):rt(s)&&(s[i]=n(s[i])),at(s)){const a=Te(s,+i),o=n(a);a!==o&&(s.delete(a),s.add(o))}if(it(s)){const a=+t[t.length-2],o=Te(s,a);switch(+i==0?"key":"value"){case"key":{const u=n(o);s.set(u,s.get(o)),u!==o&&s.delete(o);break}case"value":{s.set(o,n(s.get(o)));break}}}return e};function cn(e,t,n=[]){if(!e)return;if(!xe(e)){Ve(e,(a,o)=>cn(a,t,[...n,...nt(o)]));return}const[s,i]=e;i&&Ve(i,(a,o)=>{cn(a,t,[...n,...nt(o)])}),t(s,n)}function qi(e,t,n){return cn(t,(s,i)=>{e=ln(e,i,a=>Mi(a,s,n))}),e}function $i(e,t){function n(s,i){const a=Bi(e,nt(i));s.map(nt).forEach(o=>{e=ln(e,o,()=>a)})}if(xe(t)){const[s,i]=t;s.forEach(a=>{e=ln(e,nt(a),()=>e)}),i&&Ve(i,n)}else Ve(t,n);return e}var Vi=(e,t)=>rt(e)||xe(e)||it(e)||at(e)||Ps(e,t);function Ki(e,t,n){const s=n.get(e);s?s.push(t):n.set(e,[t])}function Wi(e,t){const n={};let s;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(l=>l.map(String)).sort((l,u)=>l.length-u.length));const[a,...o]=i;a.length===0?s=o.map(Xt):n[Xt(a)]=o.map(Xt)}),s?on(n)?[s]:[s,n]:on(n)?void 0:n}var Rs=(e,t,n,s,i=[],a=[],o=new Map)=>{const l=Di(e);if(!l){Ki(e,i,t);const C=o.get(e);if(C)return s?{transformedValue:null}:C}if(!Vi(e,n)){const C=Zn(e,n),T=C?{transformedValue:C.value,annotations:[C.type]}:{transformedValue:e};return l||o.set(e,T),T}if(Nt(a,e))return{transformedValue:null};const u=Zn(e,n),f=(u==null?void 0:u.value)??e,m=xe(f)?[]:{},g={};Ve(f,(C,T)=>{if(T==="__proto__"||T==="constructor"||T==="prototype")throw new Error(`Detected property ${T}. This is a prototype pollution risk, please remove it from your object.`);const x=Rs(C,t,n,s,[...i,T],[...a,e],o);m[T]=x.transformedValue,xe(x.annotations)?g[T]=x.annotations:rt(x.annotations)&&Ve(x.annotations,(v,E)=>{g[Ns(T)+"."+E]=v})});const b=on(g)?{transformedValue:m,annotations:u?[u.type]:void 0}:{transformedValue:m,annotations:u?[u.type,g]:g};return l||o.set(e,b),b};function Ls(e){return Object.prototype.toString.call(e).slice(8,-1)}function es(e){return Ls(e)==="Array"}function zi(e){if(Ls(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Hi(e,t,n,s,i){const a={}.propertyIsEnumerable.call(s,t)?"enumerable":"nonenumerable";a==="enumerable"&&(e[t]=n),i&&a==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function un(e,t={}){if(es(e))return e.map(i=>un(i,t));if(!zi(e))return e;const n=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e);return[...n,...s].reduce((i,a)=>{if(es(t.props)&&!t.props.includes(a))return i;const o=e[a],l=un(o,t);return Hi(i,a,l,e,t.nonenumerable),i},{})}var K=class{constructor({dedupe:e=!1}={}){this.classRegistry=new wi,this.symbolRegistry=new js(t=>t.description??""),this.customTransformerRegistry=new Si,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=Rs(e,t,this,this.dedupe),s={json:n.transformedValue};n.annotations&&(s.meta={...s.meta,values:n.annotations});const i=Wi(t,this.dedupe);return i&&(s.meta={...s.meta,referentialEqualities:i}),s}deserialize(e){const{json:t,meta:n}=e;let s=un(t);return n!=null&&n.values&&(s=qi(s,n.values,this)),n!=null&&n.referentialEqualities&&(s=$i(s,n.referentialEqualities)),s}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};K.defaultInstance=new K;K.serialize=K.defaultInstance.serialize.bind(K.defaultInstance);K.deserialize=K.defaultInstance.deserialize.bind(K.defaultInstance);K.stringify=K.defaultInstance.stringify.bind(K.defaultInstance);K.parse=K.defaultInstance.parse.bind(K.defaultInstance);K.registerClass=K.defaultInstance.registerClass.bind(K.defaultInstance);K.registerSymbol=K.defaultInstance.registerSymbol.bind(K.defaultInstance);K.registerCustom=K.defaultInstance.registerCustom.bind(K.defaultInstance);K.allowErrorProps=K.defaultInstance.allowErrorProps.bind(K.defaultInstance);var Gs=K.serialize,Qi=K.stringify;function Yi(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function Ji(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function Xi({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function Zi({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function ea(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var ta=(e,t=!1)=>{const{json:n}=Gs(e);return JSON.stringify(n,null,t?2:void 0)},St=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,na=(e,t)=>e.queryHash.localeCompare(t.queryHash),Fs=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,sa=(e,t)=>St(e)===St(t)?Fs(e,t):St(e)>St(t)?1:-1,ra={status:sa,"query hash":na,"last updated":Fs},Ct=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,Us=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,ia=(e,t)=>Ct(e)===Ct(t)?Us(e,t):Ct(e)>Ct(t)?1:-1,aa={status:ia,"last updated":Us},oa=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),la=()=>{const[e,t]=H("dark");return as(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const s=i=>{t(i.matches?"dark":"light")};n.addEventListener("change",s),$e(()=>n.removeEventListener("change",s))}),e},Ze=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const s=new Map(e);if(t.length===1)return s.set(t[0],n),s;const[i,...a]=t;return s.set(i,Ze(s.get(i),a,n)),s}if(e instanceof Set){const s=Ze(Array.from(e),t,n);return new Set(s)}if(Array.isArray(e)){const s=[...e];if(t.length===1)return s[t[0]]=n,s;const[i,...a]=t;return s[i]=Ze(s[i],a,n),s}if(e instanceof Object){const s={...e};if(t.length===1)return s[t[0]]=n,s;const[i,...a]=t;return s[i]=Ze(s[i],a,n),s}return e},et=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[s,...i]=t;return n.set(s,et(n.get(s),i)),n}if(e instanceof Set){const n=et(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((a,o)=>o.toString()!==t[0]);const[s,...i]=t;return n[s]=et(n[s],i),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[s,...i]=t;return n[s]=et(n[s],i),n}return e},Ms=(e,t)=>{if(!e||document.querySelector("#_goober")||(t==null?void 0:t.querySelector("#_goober")))return;const s=document.createElement("style"),i=document.createTextNode("");s.appendChild(i),s.id="_goober",s.setAttribute("nonce",e),t?t.appendChild(s):document.head.appendChild(s)},Ae,ot,lt,ct,we,ut,ke,Pe,_e,Oe,De,Ie,dt,ts,ca=(ts=class{constructor(e){$(this,Ae);$(this,ot);$(this,lt);$(this,ct);$(this,we,!1);$(this,ut);$(this,ke);$(this,Pe);$(this,_e);$(this,Oe);$(this,De);$(this,Ie);$(this,dt);const{client:t,queryFlavor:n,version:s,onlineManager:i,buttonPosition:a,position:o,initialIsOpen:l,errorTypes:u,styleNonce:f,shadowDOMTarget:m}=e;M(this,Ae,H(t)),M(this,lt,n),M(this,ct,s),M(this,ot,i),M(this,ut,f),M(this,ke,m),M(this,Pe,H(a)),M(this,_e,H(o)),M(this,Oe,H(l)),M(this,De,H(u))}setButtonPosition(e){k(this,Pe)[1](e)}setPosition(e){k(this,_e)[1](e)}setInitialIsOpen(e){k(this,Oe)[1](e)}setErrorTypes(e){k(this,De)[1](e)}setClient(e){k(this,Ae)[1](e)}mount(e){if(k(this,we))throw new Error("Devtools is already mounted");const t=ms(()=>{const n=this,[s]=k(this,Pe),[i]=k(this,_e),[a]=k(this,Oe),[o]=k(this,De),[l]=k(this,Ae);let u;return k(this,Ie)?u=k(this,Ie):(u=hs(()=>Promise.resolve().then(()=>require("./BMGNQTAT-Co5DHPtg.cjs"))),M(this,Ie,u)),Ms(k(this,ut),k(this,ke)),gn(u,mn({get queryFlavor(){return k(n,lt)},get version(){return k(n,ct)},get onlineManager(){return k(n,ot)},get shadowDOMTarget(){return k(n,ke)}},{get client(){return l()},get buttonPosition(){return s()},get position(){return i()},get initialIsOpen(){return a()},get errorTypes(){return o()}}))},e);M(this,we,!0),M(this,dt,t)}unmount(){var e;if(!k(this,we))throw new Error("Devtools is not mounted");(e=k(this,dt))==null||e.call(this),M(this,we,!1)}},Ae=new WeakMap,ot=new WeakMap,lt=new WeakMap,ct=new WeakMap,we=new WeakMap,ut=new WeakMap,ke=new WeakMap,Pe=new WeakMap,_e=new WeakMap,Oe=new WeakMap,De=new WeakMap,Ie=new WeakMap,dt=new WeakMap,ts),Re,ft,ht,gt,Ee,mt,Le,Ge,Fe,Ue,Me,Be,qe,yt,ns,ua=(ns=class{constructor(e){$(this,Re);$(this,ft);$(this,ht);$(this,gt);$(this,Ee,!1);$(this,mt);$(this,Le);$(this,Ge);$(this,Fe);$(this,Ue);$(this,Me);$(this,Be);$(this,qe);$(this,yt);const{client:t,queryFlavor:n,version:s,onlineManager:i,buttonPosition:a,position:o,initialIsOpen:l,errorTypes:u,styleNonce:f,shadowDOMTarget:m,onClose:g}=e;M(this,Re,H(t)),M(this,ht,n),M(this,gt,s),M(this,ft,i),M(this,mt,f),M(this,Le,m),M(this,Ge,H(a)),M(this,Fe,H(o)),M(this,Ue,H(l)),M(this,Me,H(u)),M(this,Be,H(g))}setButtonPosition(e){k(this,Ge)[1](e)}setPosition(e){k(this,Fe)[1](e)}setInitialIsOpen(e){k(this,Ue)[1](e)}setErrorTypes(e){k(this,Me)[1](e)}setClient(e){k(this,Re)[1](e)}setOnClose(e){k(this,Be)[1](()=>e)}mount(e){if(k(this,Ee))throw new Error("Devtools is already mounted");const t=ms(()=>{const n=this,[s]=k(this,Ge),[i]=k(this,Fe),[a]=k(this,Ue),[o]=k(this,Me),[l]=k(this,Re),[u]=k(this,Be);let f;return k(this,qe)?f=k(this,qe):(f=hs(()=>Promise.resolve().then(()=>require("./UODQIBEW-Cu_TygYI.cjs"))),M(this,qe,f)),Ms(k(this,mt),k(this,Le)),gn(f,mn({get queryFlavor(){return k(n,ht)},get version(){return k(n,gt)},get onlineManager(){return k(n,ft)},get shadowDOMTarget(){return k(n,Le)}},{get client(){return l()},get buttonPosition(){return s()},get position(){return i()},get initialIsOpen(){return a()},get errorTypes(){return o()},get onClose(){return u()}}))},e);M(this,Ee,!0),M(this,yt,t)}unmount(){var e;if(!k(this,Ee))throw new Error("Devtools is not mounted");(e=k(this,yt))==null||e.call(this),M(this,Ee,!1)}},Re=new WeakMap,ft=new WeakMap,ht=new WeakMap,gt=new WeakMap,Ee=new WeakMap,mt=new WeakMap,Le=new WeakMap,Ge=new WeakMap,Fe=new WeakMap,Ue=new WeakMap,Me=new WeakMap,Be=new WeakMap,qe=new WeakMap,yt=new WeakMap,ns);function da(e){const t=L.useQueryClient(e.client),n=ae.useRef(null),{buttonPosition:s,position:i,initialIsOpen:a,errorTypes:o,styleNonce:l,shadowDOMTarget:u}=e,[f]=ae.useState(new ca({client:t,queryFlavor:"React Query",version:"5",onlineManager:L.onlineManager,buttonPosition:s,position:i,initialIsOpen:a,errorTypes:o,styleNonce:l,shadowDOMTarget:u}));return ae.useEffect(()=>{f.setClient(t)},[t,f]),ae.useEffect(()=>{s&&f.setButtonPosition(s)},[s,f]),ae.useEffect(()=>{i&&f.setPosition(i)},[i,f]),ae.useEffect(()=>{f.setInitialIsOpen(a||!1)},[a,f]),ae.useEffect(()=>{f.setErrorTypes(o||[])},[o,f]),ae.useEffect(()=>(n.current&&f.mount(n.current),()=>{f.unmount()}),[f]),r.jsx("div",{className:"tsqd-parent-container",ref:n})}function fa(e){const t=L.useQueryClient(e.client),n=ae.useRef(null),{errorTypes:s,styleNonce:i,shadowDOMTarget:a}=e,[o]=ae.useState(new ua({client:t,queryFlavor:"React Query",version:"5",onlineManager:L.onlineManager,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:s,styleNonce:i,shadowDOMTarget:a,onClose:e.onClose}));return ae.useEffect(()=>{o.setClient(t)},[t,o]),ae.useEffect(()=>{o.setOnClose(e.onClose??(()=>{}))},[e.onClose,o]),ae.useEffect(()=>{o.setErrorTypes(s||[])},[s,o]),ae.useEffect(()=>(n.current&&o.mount(n.current),()=>{o.unmount()}),[o]),r.jsx("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:n})}var ha=process.env.NODE_ENV!=="development"?function(){return null}:da;process.env.NODE_ENV;const ga=ss.atom({}),Bs=()=>ss.useAtom(ga),pt=(e,t)=>{const[n]=Bs();return h.get(n,e,t)},X=()=>pt("apiUrl","/chai/api"),P={ASK_AI:"ASK_AI",GET_PAGE:"GET_PAGE",CREATE_PAGE:"CREATE_PAGE",UPDATE_PAGE:"UPDATE_PAGE",DELETE_PAGE:"DELETE_PAGE",CHANGE_SLUG:"CHANGE_SLUG",TAKE_OFFLINE:"TAKE_OFFLINE",PUBLISH_PAGE:"PUBLISH_PAGE",PUBLISH_CHANGES:"PUBLISH_CHANGES",ADD_NEW_LANGUAGE:"ADD_NEW_LANGUAGE",EDIT_LANGUAGE:"EDIT_LANGUAGE",DELETE_LANGUAGE:"DELETE_LANGUAGE",GET_CHANGES:"GET_CHANGES",GET_SERVER_BLOCK:"GET_SERVER_BLOCK",GET_LANGUAGE_PAGES:"GET_LANGUAGE_PAGES",GET_PROJECT_PAGES:"GET_PROJECT_PAGES",UPDATE_WEBSITE_SETTINGS:"UPDATE_WEBSITE_SETTINGS",GET_COLLECTIONS:"GET_COLLECTIONS",SEARCH_PAGES:"SEARCH_PAGES",GET_WEBSITE_SETTINGS:"GET_WEBSITE_SETTINGS",AI_CONTEXT:"AI_CONTEXT",GET_WEBSITE_DATA:"GET_WEBSITE_DATA",UPDATE_WEBSITE_DATA:"UPDATE_WEBSITE_DATA"},yn=()=>{const e=L.useQueryClient(),{data:t}=L.useQuery({queryKey:[P.AI_CONTEXT],initialData:"",queryFn:()=>""});return{setAiContext:w.useCallback(s=>{e.setQueryData([P.AI_CONTEXT],s)},[]),aiContext:t}},Z=async(e,t)=>{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await n.json();if(s!=null&&s.error||n.status===400||!n.ok)throw new Error((s==null?void 0:s.error)||"Something went wrong.");return s},ma=()=>{const e=X(),{aiContext:t}=yn();return w.useCallback(async(n,s,i,a)=>Z(e,{action:P.ASK_AI,data:{type:n,prompt:s,blocks:i,context:t,lang:a}}),[e,t])},ya=()=>{const e=X();return{getUILibraryBlock:async(i,a)=>{const u=(await(await fetch(i.url+(a.path?"/blocks/"+a.path:"/"+a.uuid+".html"))).text()).replace(/---([\s\S]*?)---/g,"");return he.getBlocksFromHTML(`${u}`)},getUILibraryBlocks:async i=>{try{return(await(await fetch(i.url+"/blocks.json")).json()).map(l=>({...l,preview:i.url.replace("chaiblocks","")+l.preview}))}catch(a){return console.error(a),[]}},onSave:async({page:i,blocks:a})=>{try{return await Z(e,{action:"UPDATE_PAGE",data:{id:i,blocks:a}})}catch{return new Error("Failed to save blocks")}}}};function je(){const[e,t]=w.useState(new URLSearchParams(window.location.search));return w.useEffect(()=>{const n=()=>{t(new URLSearchParams(window.location.search))};return window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}},[]),[e,t]}const pn=()=>{const e=X();return L.useQuery({queryKey:[P.GET_PROJECT_PAGES],staleTime:1e3*60*5,queryFn:async()=>Z(e,{action:P.GET_PROJECT_PAGES})||[]})},We=()=>{const[e]=je(),t=e.get("page"),{data:n,isFetching:s}=pn();return{data:w.useMemo(()=>h.find(n,{id:t})||{},[n,t]),isFetching:s}},pa=()=>L.useQuery({queryKey:["uiLibraries"],initialData:[],queryFn:async()=>[{uuid:"meraki-ui",name:"Meraki UI",url:"https://chai-ui-blocks.vercel.app"},{uuid:"chaiblocks",name:"UI Blocks",url:"https://chaibuilder.com/chaiblocks"}]}),xa=()=>{const[e]=je(),t=e.get("page"),n=X(),{setAiContext:s}=yn();return L.useQuery({queryKey:[P.GET_PAGE,t],initialData:[],queryFn:async()=>{const a=(await Z(n,{action:P.GET_PAGE,data:{id:t,draft:!0}})).blocks??[],o=h.find(a,{_type:"@chai/ai-context"});return s(h.get(o,"_value","")||""),a},enabled:!!t})},va=e=>w.useMemo(()=>{if(!e||h.isEmpty(e))return{blocks:[],theme:{}};const t=h.find(e,{_type:"@chai/theme"}),n=h.get(t,"_value",{})||{},s=h.filter(e,i=>!h.includes(i==null?void 0:i._type,"@chai/"));return{theme:n,blocks:s}},[e]),qs=()=>{const e=X();return L.useQuery({queryKey:[P.GET_WEBSITE_SETTINGS],initialData:{theme:{},fallbackLang:"en",languages:[]},queryFn:async()=>Z(e,{action:P.GET_WEBSITE_SETTINGS,data:{draft:!0}})})},ba=()=>{const{data:e}=pn(),t=X();return{getGlobalBlocks:async()=>{const n={};for(const s of e??[])h.isEmpty(s==null?void 0:s.slug)&&(n[s.id]={name:h.startCase(s.name??s.slug),description:""});return n},getGlobalBlockBlocks:async n=>n?(await Z(t,{action:"GET_PAGE",data:{id:n,draft:!0}})).blocks:[]}},xn=()=>{const e=X(),[t]=je(),n=t.get("page");return L.useQuery({queryKey:[P.GET_LANGUAGE_PAGES,n],initialData:[],queryFn:async()=>{if(!n)return null;const s=await Z(e,{action:P.GET_LANGUAGE_PAGES,data:{id:n}});return h.reverse(h.sortBy(s,"primaryPage"))}})},xt=()=>{const e=X();return L.useQuery({queryKey:[P.GET_COLLECTIONS],initialData:[],queryFn:async()=>Z(e,{action:P.GET_COLLECTIONS})})},wa=()=>{const e=X();return L.useMutation({mutationFn:async({collection:t,query:n})=>{try{return Z(e,{action:P.SEARCH_PAGES,data:{collection:t,query:Array.isArray(n)&&n.length>0?n[0]:n}})||[]}catch{return[]}}})},pe={ab:"Abkhazian",aa:"Afar",af:"Afrikaans",ak:"Akan",sq:"Albanian",am:"Amharic",ar:"Arabic",an:"Aragonese",hy:"Armenian",as:"Assamese",av:"Avaric",ae:"Avestan",ay:"Aymara",az:"Azerbaijani",bm:"Bambara",ba:"Bashkir",eu:"Basque",be:"Belarusian",bn:"Bengali",bh:"Bihari",bi:"Bislama",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",ny:"Chichewa",zh:"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)",cv:"Chuvash",kw:"Cornish",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",dv:"Maldivian",nl:"Dutch",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",fi:"Finnish",fr:"French",ff:"Fula, Pular",gl:"Galician",gd:"Gaelic (Scottish)",gv:"Manx",ka:"Georgian",de:"German",el:"Greek",kl:"Kalaallisut",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",he:"Hebrew",hz:"Herero",hi:"Hindi",ho:"Hiri Motu",hu:"Hungarian",is:"Icelandic",io:"Ido",ig:"Igbo",id:"Indonesian",ia:"Interlingua",ie:"Interlingue",iu:"Inuktitut",ik:"Inupiak",ga:"Irish",it:"Italian",ja:"Japanese",jv:"Javanese",kn:"Kannada",kr:"Kanuri",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ki:"Kikuyu",rw:"Kinyarwanda",rn:"Kirundi",ky:"Kyrgyz",kv:"Komi",kg:"Kongo",ko:"Korean",ku:"Kurdish",kj:"Kwanyama",lo:"Lao",la:"Latin",lv:"Latvian",li:"Limburgish",ln:"Lingala",lt:"Lithuanian",lu:"Luga-Katanga",lg:"Luganda, Ganda",lb:"Luxembourgish",mk:"Macedonian",mg:"Malagasy",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mh:"Marshallese",mo:"Moldavian",mn:"Mongolian",na:"Nauru",nv:"Navajo",ng:"Ndonga",nd:"Northern Ndebele",ne:"Nepali",no:"Norwegian",nb:"Norwegian bokmål",nn:"Norwegian nynorsk",ii:"Sichuan Yi",oc:"Occitan",oj:"Ojibwe",cu:"Old Church Slavonic",or:"Oriya",om:"Oromo",os:"Ossetian",pi:"Pāli",ps:"Pashto, Pushto",fa:"Persian (Farsi)",pl:"Polish",pt:"Portuguese",pa:"Punjabi (Eastern)",qu:"Quechua",rm:"Romansh",ro:"Romanian",ru:"Russian",se:"Sami",sm:"Samoan",sg:"Sango",sa:"Sanskrit",sr:"Serbian",sh:"Serbo-Croatian",st:"Sesotho",tn:"Setswana",sn:"Shona",sd:"Sindhi",si:"Sinhalese",ss:"Swati",sk:"Slovak",sl:"Slovenian",so:"Somali",nr:"Southern Ndebele",es:"Spanish",su:"Sundanese",sw:"Swahili (Kiswahili)",sv:"Swedish",tl:"Tagalog",ty:"Tahitian",tg:"Tajik",ta:"Tamil",tt:"Tatar",te:"Telugu",th:"Thai",bo:"Tibetan",ti:"Tigrinya",to:"Tonga",ts:"Tsonga",tr:"Turkish",tk:"Turkmen",tw:"Twi",ug:"Uyghur",uk:"Ukrainian",ur:"Urdu",uz:"Uzbek",ve:"Venda",vi:"Vietnamese",vo:"Volapük",wa:"Wallon",cy:"Welsh",wo:"Wolof",fy:"Western Frisian",xh:"Xhosa",yi:"Yiddish",yo:"Yoruba",za:"Zhuang, Chuang",zu:"Zulu"},$s=()=>{const e=X(),t=L.useQueryClient(),{toast:n}=d.useToast();return L.useMutation({mutationFn:async s=>Z(e,{action:P.CREATE_PAGE,data:s}),onSuccess:(s,i)=>{i&&(i!=null&&i.primaryPage)?t.invalidateQueries({queryKey:[P.GET_LANGUAGE_PAGES,i==null?void 0:i.primaryPage]}):t.invalidateQueries({queryKey:[P.GET_PROJECT_PAGES]}),n({title:`New ${i.collection==="global"?"global block":"page"} added successfully.`})},onError:(s,i)=>{n({variant:"destructive",title:`Failed to add new ${i.collection==="global"?"global block":"page"}.`,description:s.message})}})},vn=()=>{const e=X(),t=L.useQueryClient(),{toast:n}=d.useToast();return L.useMutation({mutationFn:async s=>Z(e,{action:P.UPDATE_PAGE,data:s}),onSuccess:(s,i)=>{i&&(i!=null&&i.primaryPage||i!=null&&i.seo)?t.invalidateQueries({queryKey:[P.GET_LANGUAGE_PAGES,i==null?void 0:i.primaryPage]}):t.invalidateQueries({queryKey:[P.GET_PROJECT_PAGES]}),i!=null&&i.seo?n({title:"SEO Settings updated successfully."}):n({title:`${i.collection==="global"?"Global block":"Page"} updated successfully.`})},onError:(s,i)=>{n({variant:"destructive",title:`Failed to update ${i.collection==="global"?"global block":"page"}.`,description:s.message})}})},Ea=()=>{const e=X(),t=L.useQueryClient(),{toast:n}=d.useToast();return L.useMutation({mutationFn:async s=>Z(e,{action:P.DELETE_PAGE,data:{id:s==null?void 0:s.id}}),onSuccess:(s,i)=>{i&&(i!=null&&i.primaryPage)?t.invalidateQueries({queryKey:[P.GET_LANGUAGE_PAGES,i==null?void 0:i.primaryPage]}):t.invalidateQueries({queryKey:[P.GET_PROJECT_PAGES]}),n({title:`${i.collection==="global"?"Global block":"Page"} deleted successfully.`})},onError:(s,i)=>{n({variant:"destructive",title:`Failed to delete ${i.collection==="global"?"global block":"page"}.`,description:s.message})}})},ja=()=>{const e=X(),t=L.useQueryClient(),{toast:n}=d.useToast();return L.useMutation({mutationFn:async s=>Z(e,{action:P.TAKE_OFFLINE,data:{id:s==null?void 0:s.id}}),onSuccess:(s,i)=>{i&&(i!=null&&i.primaryPage)?t.invalidateQueries({queryKey:[P.GET_LANGUAGE_PAGES,i==null?void 0:i.primaryPage]}):t.invalidateQueries({queryKey:[P.GET_PROJECT_PAGES]}),n({title:`${i.collection==="global"?"Global block":"Page"} taken offline successfully.`})},onError:(s,i)=>{n({variant:"destructive",title:`Failed to take offline ${i.collection==="global"?"global block":"page"}.`,description:s.message})}})},Sa=()=>{const e=X(),{toast:t}=d.useToast(),n=L.useQueryClient(),{data:s}=We();return L.useMutation({mutationFn:async({ids:i,theme:a})=>Z(e,{action:P.PUBLISH_CHANGES,data:{ids:i,theme:a}}),onSuccess:()=>{t({title:"Your changes have been published successfully."}),n.invalidateQueries({queryKey:[P.GET_CHANGES]}),n.invalidateQueries({queryKey:[P.GET_PROJECT_PAGES]}),n.invalidateQueries({queryKey:[P.GET_LANGUAGE_PAGES,s==null?void 0:s.id]})},onError:()=>{t({title:"Failed to publish pages.",variant:"destructive"})}})},Ca=()=>{const e=X(),{toast:t}=d.useToast(),n=L.useQueryClient();return L.useMutation({mutationFn:async({id:s,slug:i})=>Z(e,{action:P.CHANGE_SLUG,data:{id:s,slug:i}}),onSuccess:(s,{primaryPage:i})=>{t({title:"Slug changed successfully."}),i?n.invalidateQueries({queryKey:[P.GET_LANGUAGE_PAGES,i]}):n.invalidateQueries({queryKey:[P.GET_PROJECT_PAGES]})},onError:()=>{t({title:"Failed to change slug",variant:"destructive"})}})},Na=()=>{const{selectedLang:e}=he.useLanguages(),{data:t,isFetching:n}=xn();return{data:w.useMemo(()=>h.find(t,{lang:e||""})||{},[t,e]),isFetching:n}},Vs=()=>{const{data:e,isFetching:t}=Na(),n=e==null?void 0:e.seo,[s,i]=w.useState({title:"",description:"",cononicalUrl:"",noIndex:!1,noFollow:"",ogTitle:"",ogDescription:"",ogImage:"",searchTitle:"",searchDescription:"",jsonLD:"",...n}),a=w.useRef({initial:s,updated:s}),{selectedLang:o,fallbackLang:l,languages:u}=he.useLanguages(),f=o.length?o:l,{mutate:m,isPending:g}=vn(),b=g;w.useEffect(()=>{!t&&n&&i({title:"",description:"",cononicalUrl:"",noIndex:!1,noFollow:"",ogTitle:"",ogDescription:"",ogImage:"",searchTitle:"",searchDescription:"",jsonLD:"",...n})},[t,n]);const C=async()=>{m({id:e==null?void 0:e.id,seo:s}),a.current.initial=s,a.current.updated=s},T=()=>{i({...s,ogTitle:s.title,ogDescription:s.description})},x=()=>{i({...s,searchTitle:s.ogTitle,searchDescription:s.ogDescription})},v=E=>{const j={...s,[E.target.name]:E.target.name==="noIndex"||E.target.name==="noFollow"?E.target.checked:E.target.value};i(j),a.current.updated=j};return r.jsxs("div",{className:"relative pb-40",children:[r.jsxs("div",{className:"text-xs bg-gray-100 p-2 rounded-md text-left",children:["Slug: ",e==null?void 0:e.slug," ",u.length>0&&r.jsxs("span",{className:"text-blue-500 font-semibold",children:["(",h.get(pe,f,f),")"]})]}),r.jsx("form",{className:"space-y-8",children:r.jsxs(d.Accordion,{type:"multiple",defaultValue:["page"],children:[r.jsxs(d.AccordionItem,{value:"page",children:[r.jsx(d.AccordionTrigger,{className:"text-slate-700 font-semibold",children:"SEO"}),r.jsx(d.AccordionContent,{className:"pt-2",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{className:"text-xs",htmlFor:"title",children:"SEO Title"}),r.jsxs(r.Fragment,{children:[r.jsx(d.Input,{type:"text",id:"title",name:"title",value:s.title,onChange:v,disabled:b,placeholder:"Enter SEO title"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The title should be between 10 and 60 characters."})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{className:"text-xs",htmlFor:"description",children:"SEO Description"}),r.jsx(d.Textarea,{id:"description",name:"description",value:s.description,onChange:v,disabled:b,placeholder:"Enter SEO description"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The description should be between 50 and 160 characters."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{className:"text-xs",htmlFor:"title",children:"Canonical URL"}),r.jsx(d.Input,{type:"text",id:"canonicalUrl",name:"canonicalUrl",value:s.canonicalUrl,onChange:v,disabled:b,placeholder:"Enter Canonical URL"})]}),r.jsxs("div",{className:"",children:[r.jsxs("div",{className:"flex items-center gap-x-2",children:[r.jsx(d.Input,{type:"checkbox",id:"noIndex",name:"noIndex",checked:s.noIndex,onChange:v,disabled:b,className:"h-4 w-4"}),r.jsx(d.Label,{className:"text-xs pb-1",htmlFor:"noIndex",children:"No Index"})]}),r.jsx("p",{className:"mt-0 text-[10px] font-light text-gray-400 leading-4",children:"Check this if you don't want search engines to index this page."})]}),r.jsxs("div",{className:"",children:[r.jsxs("div",{className:"flex items-center gap-x-2",children:[r.jsx(d.Input,{type:"checkbox",id:"noFollow",name:"noFollow",checked:s.noFollow,onChange:v,disabled:b,className:"h-4 w-4"}),r.jsx(d.Label,{className:"text-xs pb-1",htmlFor:"noIndex",children:"No Follow"})]}),r.jsx("p",{className:"text-[10px] font-light text-gray-400 leading-4",children:"Check this if you don't want search engines to follow links on this page."})]})]})})]}),r.jsxs(d.AccordionItem,{value:"og",children:[r.jsx(d.AccordionTrigger,{className:"text-slate-700 font-bold",children:"OG"}),r.jsx(d.AccordionContent,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:T,children:"Copy from SEO Settings"})}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{className:"text-xs",htmlFor:"ogTitle",children:"OG Title"}),r.jsx(d.Input,{type:"text",id:"ogTitle",name:"ogTitle",value:s.ogTitle,onChange:v,disabled:b,placeholder:"Enter OG title"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The OG title should be between 10 and 60 characters."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{className:"text-xs pb-1",htmlFor:"ogDescription",children:"OG Description"}),r.jsx(d.Textarea,{id:"ogDescription",name:"ogDescription",value:s.ogDescription,onChange:v,disabled:b,placeholder:"Enter OG description"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The OG description should be between 50 and 160 characters."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{className:"text-xs pb-1",htmlFor:"ogImage",children:"OG Image URL"}),r.jsx(d.Input,{type:"text",id:"ogImage",name:"ogImage",value:s.ogImage,onChange:v,disabled:b,placeholder:"Enter OG image URL"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"Enter a valid URL for the OG image."})]})]})})]}),r.jsxs(d.AccordionItem,{value:"search",children:[r.jsx(d.AccordionTrigger,{className:"text-slate-700 font-bold",children:"SEARCH"}),r.jsx(d.AccordionContent,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:x,children:"Copy from OG Settings"})}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{className:"text-xs",htmlFor:"searchTitle",children:"Search Title"}),r.jsx(d.Input,{type:"text",id:"searchTitle",name:"searchTitle",value:s.searchTitle,onChange:v,disabled:b,placeholder:"Enter search title"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The search title should be between 10 and 60 characters."})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{className:"text-xs",htmlFor:"searchDescription",children:"Search Description"}),r.jsx(d.Textarea,{id:"searchDescription",name:"searchDescription",value:s.searchDescription,onChange:v,placeholder:"Enter search description"}),r.jsx("p",{className:"mt-1 text-[10px] font-light text-gray-400 leading-4",children:"The search description should be between 50 and 160 characters."})]})]})})]}),r.jsxs(d.AccordionItem,{value:"jsonLD",children:[r.jsx(d.AccordionTrigger,{className:"text-slate-700 font-bold",children:"JSON-LD"}),r.jsx(d.AccordionContent,{children:r.jsx("div",{className:"space-y-4",children:r.jsx("div",{children:r.jsx(d.Textarea,{id:"jsonLD",name:"jsonLD",rows:3,value:s.jsonLD,onChange:v,placeholder:"Enter JSON-LD"})})})})]})]})}),r.jsx("div",{className:"w-full flex items-center justify-end mt-4",children:r.jsx(d.Button,{size:"lg",variant:"default",onClick:C,disabled:h.isEqual(a.current.initial,s)||b,children:g?"Saving...":"Save"})})]})};Vs.displayName="SeoPanel";const Ks=({page:e,onClose:t})=>{const[n,s]=w.useState(e.slug||""),{mutate:i,isPending:a}=Ca(),{data:o}=xt(),l=h.find(o,{key:e==null?void 0:e.collection}),u=m=>{m.preventDefault(),i({...e,slug:n},{onSuccess:t})},f=(e==null?void 0:e.lang)||"";return r.jsx(d.Dialog,{open:!!e,onOpenChange:t,children:r.jsxs(d.DialogContent,{children:[r.jsxs(d.DialogHeader,{children:[r.jsx(d.DialogTitle,{children:"Change Slug"}),r.jsx(d.DialogDescription,{className:"text-xs",children:r.jsxs(d.Alert,{variant:"destructive",className:"mt-2",children:[r.jsx(_.AlertCircle,{className:"h-4 w-4"}),"Changing the slug may have impact on your SEO. Please proceed with caution."]})})]}),r.jsxs("form",{onSubmit:u,children:[r.jsxs("div",{className:"space-y-4 py-4 text-sm ",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{children:[r.jsx("span",{children:"Type:"}),r.jsxs("span",{className:"font-medium text-gray-600",children:[" ",(l==null?void 0:l.name)||(e==null?void 0:e.collection)]})]}),r.jsxs("div",{children:[r.jsx("span",{children:"Name:"}),r.jsxs("span",{className:"font-medium text-gray-600",children:[" ",e.name]})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs(d.Label,{htmlFor:"slug",className:"text-right",children:["Slug"," ",r.jsxs("small",{className:"font-light text-gray-500",children:["Slug should start with /",f]})]}),r.jsx(d.Input,{id:"slug",value:n,onChange:m=>{const g=m.target.value;h.startsWith(g,`/${f}`)&&s(g)},className:"col-span-3",required:!0,pattern:"^/.*",title:"Slug must start with /",placeholder:"Enter page slug"})]})]}),r.jsx(d.DialogFooter,{children:r.jsx(d.Button,{type:"submit",disabled:a||!h.startsWith(n,`/${f}`)||h.isEqual(e==null?void 0:e.slug,n),children:a?"Changing...":"Change Slug"})})]})]})})};function Ws({page:e,onClose:t}){const[,n]=je(),{mutate:s,isPending:i}=Ea(),a=()=>{s(e,{onSuccess:()=>{e!=null&&e.primaryPage||(window.history.replaceState(null,"","/"),n(new URLSearchParams({})),window.dispatchEvent(new PopStateEvent("popstate"))),t()}})};return r.jsx(d.Dialog,{open:!!e,onOpenChange:t,children:r.jsxs(d.DialogContent,{children:[r.jsxs(d.DialogHeader,{children:[r.jsx(d.DialogTitle,{children:"Confirm Deletion"}),r.jsxs(d.DialogDescription,{className:"py-4 text-slate-500",children:[r.jsxs("div",{children:["Are you sure you want to remove ",r.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)})," ",(e==null?void 0:e.collection)==="global"?"global block?":`page? ${e!=null&&e.primaryPage?"":"This will also delete all associated language pages."}`]}),e.lang&&r.jsxs("div",{className:"py-2 text-sm",children:["Language:"," ",r.jsx("span",{className:"font-medium text-gray-500",children:h.get(pe,e.lang,e.lang)})]})]})]}),r.jsxs(d.DialogFooter,{children:[r.jsx(d.Button,{variant:"outline",onClick:t,children:"Cancel"}),r.jsx(d.Button,{variant:"destructive",disabled:i,onClick:a,children:i?"Deleting...":"Delete"})]})]})})}const zs=({page:e,onClose:t})=>{const{mutate:n,isPending:s}=ja(),i=async()=>{n(e,{onSuccess:t})};return r.jsx(d.Dialog,{open:!!e,onOpenChange:t,children:r.jsxs(d.DialogContent,{children:[r.jsxs(d.DialogHeader,{children:[r.jsx(d.DialogTitle,{children:"Confirm action"}),r.jsxs(d.DialogDescription,{children:["Are you sure you want to take offline"," ",r.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)}),"?"]})]}),r.jsxs(d.DialogFooter,{children:[r.jsx(d.Button,{variant:"outline",onClick:t,children:"Cancel"}),r.jsx(d.Button,{variant:"destructive",disabled:s,onClick:i,children:s?"Updating...":"Take offline"})]})]})})},Ta=({langProps:e,onClose:t,languages:n})=>{const{data:s}=We(),[i,a]=w.useState(e.name||""),[o,l]=w.useState(e.edit?e.lang:""),[u,f]=w.useState(e.edit?e.slug:""),{mutate:m,isPending:g}=$s(),{mutate:b,isPending:C}=vn(),T=(e==null?void 0:e.collection)==="global",x=g||C,v=E=>{E.preventDefault();const j={name:i,lang:o,primaryPage:s==null?void 0:s.id,slug:u,collection:s==null?void 0:s.collection};j.collection=e.collection,e.edit&&(j.id=e==null?void 0:e.id),e.edit?b(j,{onSuccess:t}):m(j,{onSuccess:t})};return r.jsx(d.Dialog,{open:!!e,onOpenChange:t,children:r.jsxs(d.DialogContent,{className:"sm:max-w-[425px]",children:[r.jsxs(d.DialogHeader,{children:[r.jsx(d.DialogTitle,{children:e.edit?"Edit language":"Add New language"}),r.jsx(d.DialogDescription,{children:"Enter the details for the language"})]}),r.jsxs("form",{onSubmit:v,children:[r.jsxs("div",{className:"grid gap-4 py-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{htmlFor:"lang",className:"text-right",children:"Language"}),r.jsxs("select",{value:o,disabled:e.edit||h.isEmpty(n),onChange:E=>{const j=E.target.value;l(j),!T&&f(`/${j}`)},className:"flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",children:[r.jsx("option",{value:"",disabled:!0,selected:!0,children:e.edit?h.get(pe,e.lang,e.lang):h.isEmpty(n)?"All available language page is created.":"Choose language"}),h.map(n,E=>r.jsx("option",{value:E,children:h.get(pe,E,E)},E))]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{htmlFor:"slug",className:"text-right",children:"Page Name"}),r.jsx(d.Input,{id:"name",value:i,onChange:E=>a(E.target.value),className:"col-span-3",required:!0,placeholder:"Enter page name"})]}),!T&&r.jsxs("div",{className:"space-y-1",children:[r.jsxs(d.Label,{htmlFor:"slug",className:"text-right",children:["Slug"," ",r.jsx("small",{className:"font-light",children:e.edit?"To update slug use 'Change slug' action":" (Slug should start with /{lang})"})]}),r.jsx(d.Input,{id:"slug",value:u,onChange:E=>{const j=E.target.value;h.startsWith(j,`/${o}`)&&f(h.toLower(h.trim(j)))},className:"col-span-3",required:!0,pattern:"^/.*",disabled:h.isEmpty(o)||(e==null?void 0:e.edit),title:"Slug must start with /",placeholder:h.isEmpty(o)?"Choose language to add slug":"Enter page slug"})]})]}),r.jsx(d.DialogFooter,{children:r.jsx(d.Button,{type:"submit",disabled:x||!i||!o||!T&&!h.startsWith(u,`/${o}`),children:x?e.edit?"Updating...":"Adding...":e.edit?"Update":"Add new language"})})]})]})})},Aa=()=>{const[e,t]=w.useState(null),{selectedLang:n,fallbackLang:s,setSelectedLang:i}=he.useLanguages(),{data:a,isFetching:o}=xn(),{data:l}=We(),[u,f]=w.useState(null),[m,g]=w.useState(null),[b,C]=w.useState(null),{data:T}=qs(),x=h.filter(h.get(T,"languages")||["en"],v=>!h.find(a,{lang:v})&&v!==h.get(T,"fallbackLang"));return r.jsxs("div",{className:"space-y-4 pt-2",children:[r.jsx("ul",{className:"space-y-2 mt-4",children:o?r.jsxs("div",{className:"w-full space-y-3 py-4",children:[r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"})]}):h.map(a,v=>{const E=v.lang,j=v.slug,z=!v.primaryPage,Y=E===n;return r.jsxs(r.Fragment,{children:[r.jsxs("li",{className:`text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${Y?"bg-gray-200":"hover:bg-gray-100"}`,onClick:()=>i(E),children:[r.jsxs("div",{className:" flex-1 gap-x-3",children:[r.jsxs("div",{className:"text-[13px] flex items-center gap-x-2",children:[h.get(pe,z?s:E,E),r.jsx("div",{style:{backgroundColor:v!=null&&v.online?"lightgreen":"lightgray"},className:"rounded-full w-2 h-2 mt-1"})]}),r.jsxs("div",{children:[j&&r.jsxs("div",{className:"text-[11px] text-slate-500",children:["Slug:",r.jsxs("b",{children:[" ",j]})]}),r.jsxs("div",{className:"text-[11px] text-slate-500",children:["Name:",r.jsxs("b",{children:[" ",v.name," "]})]})]})]}),z?r.jsxs("div",{className:"flex items-center text-[11px] text-orange-500 gap-x-1",children:[r.jsx(_.StarIcon,{fill:"orange",className:"w-3 h-3"}),r.jsx("b",{children:" Primary"})]}):r.jsx("div",{className:"flex items-center gap-x-3",children:r.jsxs(d.DropdownMenu,{children:[r.jsx(d.DropdownMenuTrigger,{asChild:!0,onClick:G=>G.stopPropagation(),children:r.jsx(d.Button,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:r.jsx(_.MoreVertical,{className:"h-4 w-4"})})}),r.jsxs(d.DropdownMenuContent,{align:"end",className:"text-sm",children:[r.jsxs(d.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:G=>{G.stopPropagation(),t({...v,edit:!0})},children:[r.jsx(_.PencilIcon,{className:"size-3"}),"Edit"]}),(v==null?void 0:v.online)&&r.jsxs(d.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:G=>{G.stopPropagation(),g(v)},children:[r.jsx(_.Power,{className:"size-3"}),"Take offline"]}),(v==null?void 0:v.collection)!=="global"&&r.jsxs(d.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:G=>{G.stopPropagation(),C(v)},children:[r.jsx(_.Link,{className:"size-3"}),"Change slug"]}),r.jsxs(d.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:G=>{G.stopPropagation(),f(v)},children:[r.jsx(_.TrashIcon,{className:"size-3"}),"Delete"]})]})]})})]},v.id),r.jsx("div",{className:"h-1 w-full border-b"})]})})}),r.jsx("div",{className:"flex justify-center w-full",children:r.jsx(d.Button,{variant:"default",size:"sm",disabled:h.isEmpty(x),onClick:()=>{t({name:l==null?void 0:l.name,collection:l==null?void 0:l.collection,lang:"",slug:"",edit:!1})},children:"+ Add new language"})}),e&&r.jsx(Ta,{languages:x,langProps:e,onClose:()=>t(null)}),u&&r.jsx(Ws,{page:u,onClose:()=>f(null)}),m&&r.jsx(zs,{page:m,onClose:()=>g(null)}),b&&r.jsx(Ks,{page:b,onClose:()=>C(null)})]})},ka=()=>{const e=X();return L.useQuery({queryKey:[P.GET_CHANGES],queryFn:async()=>Z(e,{action:P.GET_CHANGES})})};function Pa({onClose:e=()=>console.log("Cancelled")}){const[t,n]=w.useState([]),{data:s,isFetching:i}=ka(),{data:a}=xt(),o=w.useMemo(()=>h.filter(s,x=>x.collection!=="global"),[s]),l=w.useMemo(()=>h.filter(s,{collection:"global"}),[s]),{mutate:u,isPending:f}=Sa();w.useEffect(()=>{n(h.map(h.filter(s,{online:!0}),"id"))},[s]);const m=t.length===(s==null?void 0:s.length),g=x=>{n(v=>h.includes(v,x)?h.filter(v,E=>E!==x):h.concat(v,x))},b=()=>{n(m?[]:h.map(s,"id"))},C=()=>{u({ids:t,theme:!1},{onSuccess:()=>{e()}})},T=x=>{if(x==="global")return"Global Block";const v=h.find(a,{key:x});return v?v==null?void 0:v.name:x};return r.jsx(d.Dialog,{open:!0,onOpenChange:f?()=>{}:e,children:r.jsxs(d.DialogContent,{className:"max-w-4xl",children:[r.jsxs(d.DialogHeader,{children:[r.jsx(d.DialogTitle,{children:"Publish changes"}),r.jsx(d.DialogDescription,{className:"text-xs",children:"Select the pages you want to publish. Click publish when you're done."})]}),r.jsx("div",{className:"relative overflow-x-auto -mx-4",children:i?r.jsxs("div",{className:"space-y-2 px-1",children:[r.jsx("div",{className:"bg-gray-200 h-6 w-full rounded animate-pulse mt-2"}),r.jsx("div",{className:"bg-gray-200 h-6 w-full rounded animate-pulse"}),r.jsx("div",{className:"bg-gray-200 h-6 w-full rounded animate-pulse"}),r.jsx("div",{className:"bg-gray-200 h-6 w-full rounded animate-pulse"})]}):r.jsxs("table",{className:"max-h-96 w-full text-xs text-left rtl:text-right text-gray-500 dark:text-gray-400",children:[r.jsx("thead",{className:"text-gray-700 border-b bg-gray-50 dark:bg-gray-700 dark:text-gray-400",children:r.jsxs("tr",{children:[r.jsxs("th",{scope:"col",className:"px-6 py-3 flex items-center gap-x-2 w-[1 50px]",children:[r.jsx("input",{checked:m,onClick:x=>{x.stopPropagation(),b()},type:"checkbox",className:"rounded focus:outline-none focus:ring-0 mt-1 cursor-pointer"}),"Name"]}),r.jsx("th",{scope:"col",className:"px-2 py-3 w-[100px]",children:"Type"}),r.jsx("th",{scope:"col",className:"px-4 py-3 w-[150px] text-right",children:"Status"})]})}),r.jsx("tbody",{children:h.map([{label:"Updated Pages & Global Blocks",top:"pt-2"},...h.orderBy(h.filter(o,{online:!0}),"collection"),...h.orderBy(h.filter(l,{online:!0}),"collection"),{label:"Offline Pages & Global Blocks",top:"pt-6"},...h.orderBy(h.filter(o,{online:!1}),"collection"),...h.orderBy(h.filter(l,{online:!1}),"collection")],x=>x.label?r.jsx("tr",{children:r.jsxs("td",{colSpan:4,className:`px-6 py-2 text-xs font-medium text-gray-800 relative ${x.top}`,children:[r.jsx("div",{className:"absolute inset-0 left-6 flex items-center",children:r.jsx("div",{className:"w-full order-gray-300"})}),r.jsx("div",{className:"relative flex justify-start",children:r.jsx("span",{className:"bg-gray-50 pr-2",children:x.label})})]})},"separator"):r.jsxs("tr",{className:"hover:bg-gray-50 border-b last:border-b-0",children:[r.jsxs("td",{scope:"row",className:"px-6 py-2 text-gray-900 whitespace-nowrap dark:text-white flex items-center gap-x-1",children:[r.jsx("input",{checked:h.includes(t,x==null?void 0:x.id),onClick:v=>{v.stopPropagation(),g(x==null?void 0:x.id)},type:"checkbox",className:"rounded focus:outline-none focus:ring-0 cursor-pointer"})," ",x.collection==="global"?r.jsx(_.GlobeIcon,{className:"h-4 w-4"}):r.jsx(_.File,{className:"h-4 w-4"}),x.name,x.slug&&r.jsxs("span",{className:"text-xs text-gray-500",children:["(",x.slug,")"]})]}),r.jsx("td",{className:"px-2",children:T(x==null?void 0:x.collection)}),r.jsx("td",{className:"px-4 text-right",children:h.first(x.changes)||""})]},x==null?void 0:x.id))})]})}),r.jsxs(d.DialogFooter,{className:"mt-10",children:[r.jsx(d.Button,{disabled:f,variant:"outline",onClick:e,children:"Cancel"}),r.jsx(d.Button,{disabled:f||i||h.isEmpty(s),onClick:C,children:f?"Publishing...":"Publish"})]})]})})}const _a=()=>{const e=X();return L.useQuery({queryKey:[P.GET_WEBSITE_DATA],staleTime:1e3*60*5,queryFn:async()=>Z(e,{action:P.GET_WEBSITE_DATA,data:{draft:!0}})})},Oa=()=>{const e=X(),t=L.useQueryClient(),{toast:n}=d.useToast();return L.useMutation({mutationFn:async s=>Z(e,{action:P.UPDATE_WEBSITE_SETTINGS,data:s}),onSuccess:()=>{t.invalidateQueries({queryKey:[P.GET_WEBSITE_SETTINGS]}),n({title:"Website settings updated successfully."})},onError:s=>{n({variant:"destructive",title:"Failed to update website settings",description:s.message})}})},Da=()=>{const e=X(),t=L.useQueryClient(),{toast:n}=d.useToast();return L.useMutation({mutationFn:async s=>Z(e,{action:P.UPDATE_WEBSITE_DATA,data:s}),onSuccess:()=>{t.invalidateQueries({queryKey:[P.GET_WEBSITE_DATA]}),n({title:"Website data updated successfully."})},onError:s=>{n({variant:"destructive",title:"Failed to update website data",description:s.message})}})};function Ia({onClose:e}){const{data:t,isFetching:n}=_a(),{mutateAsync:s,isPending:i}=Da(),a=pt("settingComponent",null),o=h.debounce(async l=>(await s({data:l}),!0),300);return a?r.jsx(d.Dialog,{open:!0,onOpenChange:e,children:r.jsxs(d.DialogContent,{className:"w-full",children:[r.jsx(d.DialogHeader,{children:r.jsx(d.DialogTitle,{children:"Website Settings"})}),n?r.jsxs("div",{className:"w-full space-y-3 py-4",children:[r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"}),r.jsx("div",{className:"w-full h-8 rounded bg-gray-300 animate-pulse"})]}):r.jsx("div",{children:w.createElement(a,{data:t||{},onSave:i?()=>{}:o,cancel:i?()=>{}:e})})]})}):null}function Ut({children:e,content:t}){return r.jsx(d.TooltipProvider,{children:r.jsxs(d.Tooltip,{children:[r.jsx(d.TooltipTrigger,{asChild:!0,children:e}),r.jsx(d.TooltipContent,{side:"bottom",sideOffset:10,children:r.jsx("p",{children:t})})]})})}const Ra=()=>{const e=pt("getPreviewUrl",async o=>o),[t,n]=w.useState(""),{data:s,isFetching:i}=We(),a=w.useMemo(()=>s==null?void 0:s.slug,[s==null?void 0:s.slug]);return w.useEffect(()=>{(async()=>{if(a&&typeof e=="function"){const o=await e(a||"");n(o)}else n("")})()},[e,a]),!t||(s==null?void 0:s.collection)==="global"||i?null:r.jsxs(r.Fragment,{children:[r.jsx(Ut,{content:"Preview",children:r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:r.jsx(d.Button,{variant:"ghost",size:"icon",className:"gap-2",children:r.jsx(_.Eye,{className:"w-4 h-4"})})})}),r.jsx("div",{className:"w-px h-4 bg-gray-200 dark:bg-gray-700"})]})},La=()=>{const[e,t]=he.useRightPanel();return r.jsxs(r.Fragment,{children:[r.jsx(Ut,{content:"Theme",children:r.jsx(d.Button,{variant:e==="theme"?"outline":"ghost",size:"icon",className:"gap-2",onClick:()=>t(e==="theme"?"block":"theme"),children:r.jsx(_.Palette,{className:"w-4 h-4"})})}),r.jsx("div",{className:"w-px h-4 bg-gray-200 dark:bg-gray-700"})]})},Ga=()=>{const[e,t]=w.useState(!1),{savePage:n,saveState:s}=he.useSavePage();w.useEffect(()=>{const f=m=>{s==="UNSAVED"&&(m.preventDefault(),m.returnValue=!1)};return s==="UNSAVED"&&window.addEventListener("beforeunload",f),()=>{window.removeEventListener("beforeunload",f)}},[s]);const i=w.useCallback(async()=>{t(!0),await n(!1)},[n]);w.useEffect(()=>{s==="SAVED"&&t(!1)},[s]);const a=w.useMemo(()=>{if(s==="SAVED"||s==="UNSAVED")return s;if(s==="SAVING")return e?s:"SAVED"},[e,s]),{buttonIcon:o,buttonClass:l,tooltipContent:u}=w.useMemo(()=>{switch(a){case"UNSAVED":return{tooltipContent:"Save changes",buttonIcon:r.jsx(_.Check,{strokeWidth:5,className:"w-4 h-4 transition eas-in"}),buttonClass:"bg-gray-300 text-gray-500 focus:ring-gray-400 duration-100 hover:text-gray-900"};case"SAVING":return{tooltipContent:"Saving...",buttonIcon:r.jsx(_.Loader,{strokeWidth:3,className:"w-5 h-5 animate-spin transition ease-in-out"}),buttonClass:"bg-yellow-500 text-white focus:ring-yellow-400"};case"SAVED":return{tooltipContent:"Changes saved",buttonIcon:r.jsx(_.Check,{strokeWidth:5,className:"w-4 h-4 transition eas-in"}),buttonClass:"bg-green-500 text-white hover:bg-green-600 hover:text-white focus:ring-green-400"}}},[a]);return r.jsx(Ut,{content:u,children:r.jsx("button",{className:`w-7 h-7 mx-3 flex items-center justify-center p-2 rounded-full shadow-sm transition-all duration-200 ease-in-out active:scale-95 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-opacity-50 ${l}`,onClick:i,disabled:a==="SAVING","aria-label":u,children:o})})},Fa=()=>{const[e,t]=w.useState(!1),[n,s]=w.useState(!1);return r.jsxs(r.Fragment,{children:[r.jsxs(d.Button,{size:"sm",className:"relative overflow-hidden transition-all duration-300 ease-in-out from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white font-semibold shadow-md",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:()=>t(!0),disabled:e,children:[r.jsx("span",{className:`flex items-center gap-2 transition-transform duration-300 ease-in-out ${n?"-translate-y-10":""}`,children:r.jsx(_.Rocket,{className:"w-4 h-4 mr-2"})}),r.jsx("span",{className:`absolute inset-0 flex items-center left-3 transition-transform duration-300 ease-in-out ${n?"":"translate-y-10"}`,children:r.jsx(_.Send,{className:"w-4 h-4 mr-2"})}),"Publish"]}),e&&r.jsx(Pa,{onClose:()=>t(!1)})]})},Ua=()=>{const e=pt("settingComponent",null),[t,n]=w.useState(!1);return e?r.jsxs(r.Fragment,{children:[r.jsx(Ut,{content:"Website data",children:r.jsx(d.Button,{variant:"ghost",size:"icon",className:"gap-2",onClick:()=>n(!0),children:r.jsx(_.Settings,{className:"w-4 h-4"})})}),r.jsx("div",{className:"w-px h-4 bg-gray-200 dark:bg-gray-700"}),t&&r.jsx(Ia,{onClose:()=>n(!1)})]}):null};function Ma(){return r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[r.jsx(Ua,{}),r.jsx(Ra,{}),r.jsx(La,{}),r.jsxs(r.Fragment,{children:[r.jsx(Ga,{}),r.jsx(Fa,{})]})]})}const Ba=({editPage:e,addEditPage:t,setAddEditPage:n})=>{const s=t.id,[i,a]=w.useState(s&&t.name||""),[o,l]=w.useState(s&&t.slug||""),[u,f]=w.useState(s||!h.isEmpty(t==null?void 0:t.collection)?(t==null?void 0:t.collection)||"":"page"),{data:m=[]}=xt(),{mutate:g,isPending:b}=$s(),{mutate:C,isPending:T}=vn(),x=b||T,v=E=>{E.preventDefault(),s?C({name:i,slug:o,id:t.id,collection:t.global?"global":u},{onSuccess:()=>{n(null)}}):g({name:i,slug:o,collection:t.global?"global":u},{onSuccess:j=>{n(null),e(j.page.id)}})};return r.jsx(d.Dialog,{open:!!t,onOpenChange:()=>n(void 0),children:r.jsxs(d.DialogContent,{className:"sm:max-w-[425px]",children:[r.jsxs(d.DialogHeader,{children:[r.jsxs(d.DialogTitle,{children:[s?"Edit":"Add New"," ",t.global?"Global Block":h.startCase(u)]}),r.jsxs(d.DialogDescription,{children:["Enter the details for the new"," ",t.global?"Global Block":`${h.startCase(u)}. Slug must start with /`]})]}),r.jsxs("form",{onSubmit:v,children:[r.jsxs("div",{className:"grid gap-4 py-4",children:[!t.global&&r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{htmlFor:"pageType",children:"Type"}),r.jsx("select",{value:u,disabled:s,onChange:E=>f(E.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:m.map(E=>r.jsx("option",{value:E.key,children:E.name},E.key))})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(d.Label,{htmlFor:"name",className:"text-right",children:"Name"}),r.jsx(d.Input,{id:"name",value:i,placeholder:`Enter ${t.global?"global block":"page"} name`,onChange:E=>a(E.target.value),className:"col-span-3",required:!0})]}),!t.global&&r.jsx(r.Fragment,{children:r.jsxs("div",{className:"space-y-1",children:[r.jsxs(d.Label,{htmlFor:"slug",className:"text-right",children:[t.global?"Identifier":"Slug"," ",s&&r.jsx("small",{className:"text-gray-400 font-light",children:"To update slug use 'Change slug' action"})]}),r.jsx(d.Input,{id:"slug",value:o,disabled:s,onChange:E=>{var j;return l((j=E.target.value)==null?void 0:j.trim().toLowerCase())},className:"col-span-3",required:!0,pattern:"^/.*",title:"Slug must start with /",placeholder:"Enter page slug"})]})})]}),r.jsx(d.DialogFooter,{children:r.jsx(d.Button,{type:"submit",disabled:x||!i||!t.global&&!o.startsWith("/")||h.isEqual(t.name,i)&&h.isEqual(t.slug,o)&&h.isEqual(t.pageType,u),children:x?s?"Updating...":"Adding...":t.global?`${s?"Update":"Add"} global block`:`${s?"Update":"Add"} Page`})})]})]})})},qa=({close:e})=>{const[t,n]=w.useState([]),[s,i]=w.useState(""),[a,o]=w.useState(null),[l,u]=w.useState(null),[f,m]=w.useState(null),[g,b]=w.useState(null),{data:C}=xt(),{data:T,isFetching:x}=pn(),[v,E]=je(),j=v.get("page"),z=w.useCallback(N=>{window.history.pushState({},"",`?page=${N}`),E(new URLSearchParams({page:N})),window.dispatchEvent(new PopStateEvent("popstate")),e()},[e,E]),Y=N=>{h.includes(t,N)?n(h.filter(t,q=>q!==N)):n([...t,N])};w.useEffect(()=>{if(j){const N=h.find(T,{id:j});N&&(N!=null&&N.collection)&&n(q=>[...q,N==null?void 0:N.collection])}},[T,j]);const G=w.useMemo(()=>{const N=h.filter(T,S=>h.isEmpty(s)?!0:h.includes(h.toLower(S==null?void 0:S.name),h.toLower(s))||h.includes(h.toLower(S==null?void 0:S.slug),h.toLower(s)));h.isEmpty(s)||n(h.map(N,"collection"));const q=h.groupBy(N,"collection"),ce=[{key:"page",name:"Pages"},{key:"global",name:"Global Block"},...C.filter(S=>S.key!=="page")];return h.map(ce,S=>({...S,items:h.orderBy(h.get(q,S.key,[]),"slug")||[]}))},[T,C,s]);return r.jsxs("div",{className:"h-full flex flex-col justify-between",children:[r.jsxs("div",{className:"space-y-6 flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"rounded-md bg-primary p-2 text-primary-foreground",children:r.jsx(_.File,{className:"h-6 w-6"})}),r.jsxs("div",{className:"flex flex-col",children:[r.jsx("span",{className:"text-sm font-semibold",children:"Pages"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Manage your site structure"})]})]}),r.jsxs("div",{className:"relative flex item-center gap-x-4",children:[r.jsx(_.Search,{strokeWidth:2.5,className:"absolute left-3 top-2.5 h-4 w-4 text-gray-400"}),r.jsx(d.Input,{placeholder:"Search pages...",className:"pl-9 text-xs font-medium placeholder:text-gray-400 leading-none text-gray-700",value:s,onChange:N=>i(N.target.value)})]}),x?r.jsx("div",{className:"space-y-2",children:h.map([...Array(5).keys()],N=>r.jsx("div",{className:"h-9 w-full rounded bg-gray-200 animate-pulse"},N))}):h.isEmpty(G)?r.jsxs("div",{className:"h-[70vh] flex flex-col gap-y-1 items-center justify-center text-slate-500 text-sm font-medium",children:[r.jsx(_.File,{className:"h-6 w-6 stroke-[1]"}),"Empty List!",r.jsx("span",{className:"font-light",children:"Add new page to start"})]}):r.jsx("div",{className:"text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto",children:h.map(G,N=>r.jsxs("div",{className:"border-0 py-",children:[r.jsxs("div",{className:"group font-medium flex items-center leading-none gap-x-2 cursor-pointer hover:bg-slate-100 rounded duration-200 p-1.5",onClick:()=>Y(N.key),children:[h.includes(t,N.key)?r.jsx(_.ChevronDown,{className:"w-4 h-4 text-slate-400 ease-in transition-all"}):r.jsx(_.ChevronRight,{className:"w-4 h-4 text-slate-400 ease-in"}),["page","global"].includes(N.key)?r.jsx(_.Folder,{className:"w-4 h-4"}):r.jsx(_.Database,{className:"w-4 h-4"}),r.jsx("span",{className:"leading-none",children:h.startCase(N.name)||"Uncategorized"}),r.jsx(d.Badge,{variant:"outline",className:`ml-2 text-xs font-bold rounded-full leading-none text-slate-500 ${N.key==="global"||N.key==="page"?"opacity-0":""}`,children:h.get(N,"baseSlug.FALLBACK")||"/"}),r.jsxs(d.Button,{variant:"ghost",size:"sm",className:"h-6 opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-1 text-xs",onClick:q=>{q.stopPropagation(),b({slug:"",name:"",collection:N.key,global:N.key==="global"})},children:[r.jsx(_.Plus,{className:"h-3 w-3"}),"Add ",h.startCase(N.name)||"Uncategorized"]})]}),h.includes(t,N.key)&&r.jsxs("div",{className:"bg-white pl-6 pt-2",children:[h.isEmpty(h.get(N,"items",[]))&&r.jsxs("div",{className:"text-xs font-light px-3 pb-1",children:["No ",h.startCase(N.name)||"Uncategorized"]}),h.map(h.get(N,"items",[]),q=>{const ce=j===h.get(q,"id");return r.jsxs("div",{onClick:()=>z(h.get(q,"id")),className:`rounded flex items-center justify-between leading-none duration-300 cursor-pointer px-3 py-1.5 ${ce?"bg-gray-200":"hover:bg-gray-100"}`,children:[r.jsxs("div",{className:"flex items-center gap-x-2",children:[N.key==="global"?r.jsx(_.Globe,{className:"w-4 h-4 text-slate-500 stroke-[1]"}):r.jsx(_.File,{className:"w-4 h-4 text-slate-500 stroke-[1]"}),r.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${q.online?"bg-green-300":"bg-gray-300"}`}),r.jsx("span",{className:"leading-none text-slate-800 font-light",children:h.startCase(q.name)}),r.jsx(d.Badge,{variant:"outline",className:`ml-2 font-bold text-xs rounded-full leading-none text-slate-500 ${N.key==="global"?"opacity-0":""}`,children:h.get(q,"slug")||"/"})]}),r.jsx("div",{className:"flex items-center space-x-4",children:r.jsxs(d.DropdownMenu,{children:[r.jsx(d.DropdownMenuTrigger,{asChild:!0,onClick:S=>S.stopPropagation(),children:r.jsx(_.MoreHorizontal,{className:"h-4 w-4 hover:stroke-[3]"})}),r.jsxs(d.DropdownMenuContent,{align:"end",className:"text-sm",children:[r.jsxs(d.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:S=>{S.stopPropagation(),b({...q,global:N.key==="global"})},children:[r.jsx(_.Pencil,{className:"size-3"}),"Edit"]}),(q==null?void 0:q.online)&&r.jsxs(d.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:S=>{S.stopPropagation(),u(q)},children:[r.jsx(_.Power,{className:"size-3"}),"Take offline"]}),N.key!=="global"&&r.jsxs(d.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:S=>{S.stopPropagation(),m(q)},children:[r.jsx(_.Link,{className:"size-3"}),"Change slug"]}),r.jsxs(d.DropdownMenuItem,{className:"flex items-center gap-2 cursor-pointer",onClick:S=>{S.stopPropagation(),o(q)},children:[r.jsx(_.Trash,{className:"size-3"}),"Delete"]})]})]})})]})})]})]},N.key))})]}),r.jsxs(d.Button,{className:"text-sm flex gap-x-2",onClick:()=>{b({slug:"",name:"",collection:"page"})},children:[r.jsx(_.Plus,{className:"w-4 h-4"})," Add New"]}),g&&r.jsx(Ba,{editPage:z,addEditPage:g,setAddEditPage:b}),a&&r.jsx(Ws,{page:a,onClose:()=>o(null)}),l&&r.jsx(zs,{page:l,onClose:()=>u(null)}),f&&r.jsx(Ks,{page:f,onClose:()=>m(null)})]})},$a=()=>{const e=pt("logo",null);return e?r.jsx("div",{className:"w-full max-h-9 overflow-hidden pr-2",children:w.createElement(e,{})}):null},Va=()=>{const[e]=je(),t=e.get("page"),{data:n,isFetching:s}=We(),[i,a]=w.useState(!1),o=!!t&&!h.isEmpty(n),l=!t||!s&&h.isEmpty(n)||i;return r.jsxs(r.Fragment,{children:[r.jsxs(d.Button,{variant:"secondary",className:"flex items-center w-full space-x-2 py-1",onClick:()=>a(!0),children:[r.jsx("div",{children:r.jsx(_.Logs,{className:"h-4 w-4"})}),r.jsxs("span",{className:"truncate leading-tight flex items-center max-w-[200px]",children:[r.jsx("span",{className:"text-slate-600 pr-1 font-light",children:"Editing:"}),s?r.jsx(_.Loader,{className:"h-4 w-4 animate-spin text-slate-400 ml-2"}):h.get(n,"name")??""]})]},"template-viewer"),r.jsx(d.Sheet,{open:l,onOpenChange:u=>!u&&o&&a(!1),children:r.jsx(d.SheetContent,{side:"left",className:`!max-w-screen-sm border-border w-full ${o?"":"sheet-hide-close-btn"}`,children:r.jsx(qa,{close:()=>a(!1)})})})]})},Ka=()=>{const{fallbackLang:e,languages:t,selectedLang:n,setSelectedLang:s}=he.useLanguages(),i=h.isEmpty(n)?e:n,a=w.useMemo(()=>h.uniq([e,...t]).map(o=>{const l=h.get(pe,o);return l?{key:o,value:l}:null}).filter(o=>o&&(o==null?void 0:o.value)),[e,t]);return h.isEmpty(t)&&i===e?null:h.isEmpty(t)&&i!==e?r.jsxs(d.Button,{variant:"ghost",size:"sm",className:"gap-2 hover:bg-transparent",children:[r.jsx(_.LanguagesIcon,{className:"w-4 h-4"}),h.get(pe,i,i)]}):r.jsxs(d.DropdownMenu,{children:[r.jsx(d.DropdownMenuTrigger,{asChild:!0,className:"focus:outline-none",children:r.jsxs(d.Button,{variant:"ghost",size:"sm",className:"gap-2",children:[r.jsx(_.LanguagesIcon,{className:"w-4 h-4"}),h.get(pe,i,i),r.jsx(_.ChevronDown,{className:"w-4 h-4"})]})}),r.jsx(d.DropdownMenuContent,{className:"border-border space-y-1",children:h.map(a,o=>r.jsxs(d.DropdownMenuItem,{className:he.mergeClasses("flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",o.key===i&&"!bg-gray-200 text-gray-700"),onClick:()=>s(o.key),children:[r.jsx("div",{children:o.value}),o.key===e&&r.jsxs("small",{className:"text-[9px] flex items-center gap-x-1 text-orange-500 leading-none",children:[r.jsx(_.Star,{fill:"orange",className:"w-2 h-2"}),"Primary"]})]},o.value))})]})};function Wa(){return r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[r.jsx($a,{}),r.jsx(Va,{}),r.jsx(Ka,{})]})}wr.loadWebBlocks();const za=e=>{const t=w.useRef([]),[n]=je(),s=n.get("page"),{data:i}=We(),{data:a}=pa(),{data:o,isFetching:l}=xa(),{blocks:u}=va(o),{data:f}=qs(),{data:m}=xt(),{data:g}=xn(),{mutateAsync:b}=Oa(),C=ma(),{getUILibraryBlock:T,getUILibraryBlocks:x,onSave:v}=ya(),{getGlobalBlocks:E,getGlobalBlockBlocks:j}=ba(),{aiContext:z,setAiContext:Y}=yn(),{mutateAsync:G}=wa();t.current=u;const N=w.useMemo(()=>{const I={};return e.mediaManagerComponent&&(I.mediaManagerComponent=e.mediaManagerComponent),I},[e.mediaManagerComponent]),q=w.useMemo(()=>Array.isArray(e==null?void 0:e.uiLibraries)?[...a,...e==null?void 0:e.uiLibraries]:a,[a,e==null?void 0:e.uiLibraries]),ce=w.useCallback(async(I,B)=>await G({collection:I,query:B}),[G]),S=w.useMemo(()=>h.get(f,"theme",{}),[f]);return console.log("currentTheme",S),r.jsx(r.Fragment,{children:r.jsx(he.ChaiBuilderEditor,{loading:l,fallbackLang:f.fallbackLang||"en",languages:h.compact(h.map(g,"lang"))||[],brandingOptions:(f==null?void 0:f.theme)||{},translations:e.translations||{},locale:e.locale||"en",htmlDir:e.htmlDir||"ltr",autoSaveSupport:e.autoSaveSupport||!1,autoSaveInterval:e.autoSaveInterval||15,onError:e.onError||console.error,getGlobalBlockBlocks:j,getGlobalBlocks:E,blocks:u,theme:S,getUILibraryBlock:T,getUILibraryBlocks:x,uiLibraries:q,collections:m,searchCollectionItems:ce,saveAiContextCallback:async I=>{if(!s)return!0;const B=t.current,oe={_type:"@chai/ai-context",_value:h.isString(I)?I:""},re=[...B,oe];return await v({page:s,blocks:re}),Y(I),!0},aiContext:z,askAiCallBack:C,onSave:async({blocks:I,theme:B})=>{if(h.isEqual(B,S)||await b({settings:{theme:B}}),console.log("onSave",I,B),!s)return!0;t.current=I;const oe={_type:"@chai/ai-context",_value:h.isString(z)?z:""},re=[...I,oe];return await v({page:s,blocks:re}),t.current=I,!0},topBarComponents:{left:[Wa],right:[Ma]},sideBarComponents:{top:[...(i==null?void 0:i.collection)!=="global"?[{label:"SEO Setting",component:Vs,icon:r.jsx(r.Fragment,{children:r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 21",fill:"currentColor",width:"21",height:"21",children:[r.jsx("path",{d:"M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249"}),r.jsx("path",{d:"M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z"})]})})}]:[],...h.isEmpty(f==null?void 0:f.languages)?[]:[{label:`Language ${(i==null?void 0:i.collection)==="global"?"":"page"}`,component:Aa,icon:r.jsx(_.LanguagesIcon,{className:"w-5 h-5 stroke-[2]"})}]]},...N})})},Ha=new L.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),Qa=e=>{const[,t]=Bs();return w.useEffect(()=>{t(h.pick(e,["apiUrl","getPreviewUrl","logo","settingComponent"]))},[e,t]),r.jsxs(L.QueryClientProvider,{client:Ha,children:[r.jsx(za,{...e}),r.jsx(ha,{})]})};exports.$TRACK=dn;exports.ChaiBuilderForge=Qa;exports.Dynamic=vi;exports.For=zr;exports.Index=Hr;exports.Match=Jr;exports.Portal=xi;exports.Show=Qr;exports.Switch=Yr;exports.addEventListener=xs;exports.batch=kr;exports.className=ps;exports.clearDelegatedEvents=ci;exports.convertRemToPixels=oa;exports.createComponent=gn;exports.createComputed=en;exports.createContext=Rr;exports.createEffect=fn;exports.createMemo=se;exports.createRenderEffect=ye;exports.createRoot=me;exports.createSignal=H;exports.createUniqueId=Wr;exports.delegateEvents=ys;exports.deleteNestedDataByPath=et;exports.displayValue=ta;exports.getMutationStatusColor=Zi;exports.getPreferredColorScheme=la;exports.getQueryStatusColor=Xi;exports.getQueryStatusColorByLabel=ea;exports.getQueryStatusLabel=Yi;exports.getSidedProp=Ji;exports.insert=It;exports.mergeProps=mn;exports.mutationSortFns=aa;exports.on=Pr;exports.onCleanup=$e;exports.onMount=as;exports.serialize=Gs;exports.setAttribute=Dt;exports.sortFns=ra;exports.splitProps=fs;exports.spread=vs;exports.stringify=Qi;exports.template=li;exports.untrack=ee;exports.updateNestedDataByPath=Ze;exports.use=bs;exports.useContext=Lr;exports.useTransition=Ir;
|