@chaibuilder/sdk 2.0.0-beta.39 → 2.0.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/ChaiThemeFn-Ba9O-eBT.js +201 -0
- package/dist/ChaiThemeFn-DQu-2Eh9.cjs +13 -0
- package/dist/{CodeEditor-DCZWTNZX.cjs → CodeEditor-C5hkhszC.cjs} +1 -1
- package/dist/{CodeEditor-iLT-zqjH.js → CodeEditor-DmPiW1eD.js} +2 -2
- package/dist/{Topbar-DMCtQiUj.js → Topbar-CTL7UXRB.js} +2 -2
- package/dist/{Topbar-Bk4vqKpP.cjs → Topbar-CiOsi4Ut.cjs} +1 -1
- package/dist/{context-menu-CxioWiWD.js → context-menu-BsI3Hqio.js} +1 -1
- package/dist/{context-menu-t34dYg4a.cjs → context-menu-dsqhw1Ub.cjs} +1 -1
- package/dist/core.cjs +246 -5
- package/dist/core.d.ts +15 -15
- package/dist/core.js +28438 -3616
- package/dist/jsx-runtime-DGh1k5sI.cjs +31 -0
- package/dist/jsx-runtime-Dx-03ztt.js +445 -0
- package/dist/{plugin-fWX0IMr4.cjs → plugin-2xcljWGM.cjs} +1 -1
- package/dist/{plugin-OOaLfdkf.js → plugin-Bvqh40K5.js} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -2
- package/dist/render.js +4 -4
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +5 -1
- package/dist/tailwind.js +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +58 -22
- package/dist/ui.js +3 -3
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +3 -3
- package/package.json +96 -110
- package/dist/ChaiThemeFn-BUgkaTMi.js +0 -190
- package/dist/ChaiThemeFn-B_ATMTMa.cjs +0 -13
- package/dist/jsx-runtime-BYECrxsp.cjs +0 -30
- package/dist/jsx-runtime-DGlMoOmv.js +0 -630
- /package/dist/{style.css → sdk.css} +0 -0
package/dist/core.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var U=Object.defineProperty;var $=(o,n,r)=>n in o?U(o,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[n]=r;var O=(o,n,r)=>$(o,typeof n!="symbol"?n+"":n,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("./jsx-runtime-BYECrxsp.cjs"),React=require("react"),contextMenu=require("./context-menu-t34dYg4a.cjs"),lodashEs=require("lodash-es"),jotai=require("jotai"),iconBase=require("./iconBase-Cn2BsTrq.cjs"),reactI18next=require("react-i18next"),ChaiThemeFn=require("./ChaiThemeFn-B_ATMTMa.cjs"),web=require("@react-hookz/web"),TreeModel=require("tree-model"),runtime=require("@chaibuilder/runtime"),ReactQuill=require("react-quill"),flagged=require("flagged"),reactHotkeysHook=require("react-hotkeys-hook"),dom=require("@floating-ui/dom"),reactDom=require("@floating-ui/react-dom"),reactIcons=require("@radix-ui/react-icons"),typography=require("@tailwindcss/typography"),forms=require("@tailwindcss/forms"),aspectRatio=require("@tailwindcss/aspect-ratio"),containerQueries=require("@tailwindcss/container-queries"),tailwindMerge=require("tailwind-merge"),STRINGS=require("./STRINGS-n7COZtKr.cjs"),reactWrapBalancer=require("react-wrap-balancer"),lucideReact=require("lucide-react"),ReactDOM=require("react-dom"),PropTypes=require("prop-types"),reactErrorBoundary=require("react-error-boundary"),reResizable=require("re-resizable"),reactArborist=require("react-arborist"),himalaya=require("himalaya"),RjForm=require("@rjsf/core"),validator=require("@rjsf/validator-ajv8"),IconPicker=require("react-icons-picker"),Autosuggest=require("react-autosuggest"),Fuse=require("fuse.js"),clsx=require("clsx"),i18n=require("i18next"),framerMotion=require("framer-motion");function _interopNamespaceDefault(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>o[r]})}}return n.default=o,Object.freeze(n)}const React__namespace=_interopNamespaceDefault(React),canAcceptChildBlock=(o,n)=>{if(!o)return!0;const r=runtime.getRegisteredChaiBlock(o);return r&&lodashEs.has(r,"canAcceptBlock")?r.canAcceptBlock(n):!1},canAddChildBlock=o=>{const n=runtime.getRegisteredChaiBlock(o);return n?lodashEs.has(n,"canAcceptBlock"):!1},canBeNestedInside=(o,n)=>{const r=runtime.getRegisteredChaiBlock(n);return r&&lodashEs.has(r,"canBeNested")?r.canBeNested(o):!0},canDuplicateBlock=o=>{const n=runtime.getRegisteredChaiBlock(o);return n&&lodashEs.has(n,"canDuplicate")?n.canDuplicate():!0},canDeleteBlock=o=>{const n=runtime.getRegisteredChaiBlock(o);return n&&lodashEs.has(n,"canDelete")?n.canDelete():!0};let keyCount=0;function atom(o,n){const r=`atom${++keyCount}`,a={toString:()=>r};return typeof o=="function"?a.read=o:(a.init=o,a.read=i=>i(a),a.write=(i,l,c)=>l(a,typeof c=="function"?c(i(a)):c)),n&&(a.write=n),a}const hasInitialValue=o=>"init"in o,isActuallyWritableAtom=o=>!!o.write,cancelPromiseMap=new WeakMap,registerCancelPromise=(o,n)=>{cancelPromiseMap.set(o,n),o.catch(()=>{}).finally(()=>cancelPromiseMap.delete(o))},cancelPromise=(o,n)=>{const r=cancelPromiseMap.get(o);r&&(cancelPromiseMap.delete(o),r(n))},resolvePromise=(o,n)=>{o.status="fulfilled",o.value=n},rejectPromise=(o,n)=>{o.status="rejected",o.reason=n},isPromiseLike$2=o=>typeof(o==null?void 0:o.then)=="function",isEqualAtomValue=(o,n)=>"v"in o&&"v"in n&&Object.is(o.v,n.v),isEqualAtomError=(o,n)=>"e"in o&&"e"in n&&Object.is(o.e,n.e),hasPromiseAtomValue=o=>"v"in o&&o.v instanceof Promise,isEqualPromiseAtomValue=(o,n)=>"v"in o&&"v"in n&&o.v.orig&&o.v.orig===n.v.orig,returnAtomValue=o=>{if("e"in o)throw o.e;return o.v},createStore=()=>{const o=new WeakMap,n=new WeakMap,r=new Map,a=g=>o.get(g),i=(g,E)=>{const w=o.get(g);if(o.set(g,E),r.has(g)||r.set(g,w),w&&hasPromiseAtomValue(w)){const j="v"in E?E.v instanceof Promise?E.v:Promise.resolve(E.v):Promise.reject(E.e);cancelPromise(w.v,j)}},l=(g,E,w)=>{const j=new Map;let C=!1;w.forEach((B,N)=>{!B&&N===g&&(B=E),B&&(j.set(N,B),E.d.get(N)!==B&&(C=!0))}),(C||E.d.size!==j.size)&&(E.d=j)},c=(g,E,w)=>{const j=a(g),C={d:(j==null?void 0:j.d)||new Map,v:E};if(w&&l(g,C,w),j&&isEqualAtomValue(j,C)&&j.d===C.d)return j;if(j&&hasPromiseAtomValue(j)&&hasPromiseAtomValue(C)&&isEqualPromiseAtomValue(j,C)){if(j.d===C.d)return j;C.v=j.v}return i(g,C),C},u=(g,E,w,j)=>{if(isPromiseLike$2(E)){let C;const B=new Promise((N,M)=>{let T=!1;E.then(I=>{if(!T){T=!0;const L=a(g),P=c(g,B,w);resolvePromise(B,I),N(I),(L==null?void 0:L.d)!==P.d&&S(g,P,L==null?void 0:L.d)}},I=>{if(!T){T=!0;const L=a(g),P=c(g,B,w);rejectPromise(B,I),M(I),(L==null?void 0:L.d)!==P.d&&S(g,P,L==null?void 0:L.d)}}),C=I=>{T||(T=!0,I.then(L=>resolvePromise(B,L),L=>rejectPromise(B,L)),N(I))}});return B.orig=E,B.status="pending",registerCancelPromise(B,N=>{N&&C(N),j==null||j()}),c(g,B,w)}return c(g,E,w)},x=(g,E,w)=>{const j=a(g),C={d:(j==null?void 0:j.d)||new Map,e:E};return w&&l(g,C,w),j&&isEqualAtomError(j,C)&&j.d===C.d?j:(i(g,C),C)},d=g=>{const E=a(g);if(E&&(E.d.forEach((T,I)=>{I!==g&&!n.has(I)&&d(I)}),Array.from(E.d).every(([T,I])=>{const L=a(T);return T===g||L===I||L&&!hasPromiseAtomValue(L)&&isEqualAtomValue(L,I)})))return E;const w=new Map;let j=!0;const C=T=>{if(T===g){const L=a(T);if(L)return w.set(T,L),returnAtomValue(L);if(hasInitialValue(T))return w.set(T,void 0),T.init;throw new Error("no atom init")}const I=d(T);return w.set(T,I),returnAtomValue(I)};let B,N;const M={get signal(){return B||(B=new AbortController),B.signal},get setSelf(){return!N&&isActuallyWritableAtom(g)&&(N=(...T)=>{if(!j)return y(g,...T)}),N}};try{const T=g.read(C,M);return u(g,T,w,()=>B==null?void 0:B.abort())}catch(T){return x(g,T,w)}finally{j=!1}},p=g=>returnAtomValue(d(g)),m=g=>{let E=n.get(g);return E||(E=_(g)),E},h=(g,E)=>!E.l.size&&(!E.t.size||E.t.size===1&&E.t.has(g)),b=g=>{const E=n.get(g);E&&h(g,E)&&A(g)},R=g=>{const E=new Map,w=new WeakMap,j=B=>{const N=n.get(B);N==null||N.t.forEach(M=>{M!==B&&(E.set(M,(E.get(M)||new Set).add(B)),w.set(M,(w.get(M)||0)+1),j(M))})};j(g);const C=B=>{const N=n.get(B);N==null||N.t.forEach(M=>{var T;if(M!==B){let I=w.get(M);if(I&&w.set(M,--I),!I){let L=!!((T=E.get(M))!=null&&T.size);if(L){const P=a(M),D=d(M);L=!P||!isEqualAtomValue(P,D)}L||E.forEach(P=>P.delete(M))}C(M)}})};C(g)},f=(g,...E)=>{let w=!0;const j=N=>returnAtomValue(d(N)),C=(N,...M)=>{let T;if(N===g){if(!hasInitialValue(N))throw new Error("atom not writable");const I=a(N),L=u(N,M[0]);(!I||!isEqualAtomValue(I,L))&&R(N)}else T=f(N,...M);return w||k(),T},B=g.write(j,C,...E);return w=!1,B},y=(g,...E)=>{const w=f(g,...E);return k(),w},_=(g,E)=>{const w={t:new Set(E&&[E]),l:new Set};if(n.set(g,w),d(g).d.forEach((j,C)=>{const B=n.get(C);B?B.t.add(g):C!==g&&_(C,g)}),d(g),isActuallyWritableAtom(g)&&g.onMount){const j=g.onMount((...C)=>y(g,...C));j&&(w.u=j)}return w},A=g=>{var E;const w=(E=n.get(g))==null?void 0:E.u;w&&w(),n.delete(g);const j=a(g);j&&(hasPromiseAtomValue(j)&&cancelPromise(j.v),j.d.forEach((C,B)=>{if(B!==g){const N=n.get(B);N&&(N.t.delete(g),h(B,N)&&A(B))}}))},S=(g,E,w)=>{const j=new Set(E.d.keys());w==null||w.forEach((C,B)=>{if(j.has(B)){j.delete(B);return}const N=n.get(B);N&&(N.t.delete(g),h(B,N)&&A(B))}),j.forEach(C=>{const B=n.get(C);B?B.t.add(g):n.has(g)&&_(C,g)})},k=()=>{for(;r.size;){const g=Array.from(r);r.clear(),g.forEach(([E,w])=>{const j=a(E);if(j){j.d!==(w==null?void 0:w.d)&&S(E,j,w==null?void 0:w.d);const C=n.get(E);C&&!(w&&!hasPromiseAtomValue(w)&&(isEqualAtomValue(w,j)||isEqualAtomError(w,j)))&&C.l.forEach(B=>B())}})}};return{get:p,set:y,sub:(g,E)=>{const w=m(g);k();const j=w.l;return j.add(E),()=>{j.delete(E),b(g)}}}};let defaultStore;const getDefaultStore=()=>(defaultStore||(defaultStore=createStore()),defaultStore),RESET=Symbol(),getCached$1=(o,n,r)=>(n.has(r)?n:n.set(r,o())).get(r),cache1$2=new WeakMap,memo2$1=(o,n,r)=>{const a=getCached$1(()=>new WeakMap,cache1$2,n);return getCached$1(o,a,r)},cacheKeyForEmptyKeyExtractor={},isWritable=o=>!!o.write,isFunction=o=>typeof o=="function";function splitAtom(o,n){return memo2$1(()=>{const r=new WeakMap,a=(c,u)=>{let x=r.get(c);if(x)return x;const d=u&&r.get(u),p=[],m=[];return c.forEach((h,b)=>{const R=b;m[b]=R;const f=d&&d.atomList[d.keyList.indexOf(R)];if(f){p[b]=f;return}const y=A=>{const S=A(i),k=A(o),g=a(k,S==null?void 0:S.arr).keyList.indexOf(R);if(g<0||g>=k.length){const E=c[a(c).keyList.indexOf(R)];if(E)return E;throw new Error("splitAtom: index out of bounds for read")}return k[g]},_=(A,S,k)=>{const v=A(i),g=A(o),w=a(g,v==null?void 0:v.arr).keyList.indexOf(R);if(w<0||w>=g.length)throw new Error("splitAtom: index out of bounds for write");const j=isFunction(k)?k(g[w]):k;S(o,[...g.slice(0,w),j,...g.slice(w+1)])};p[b]=isWritable(o)?atom(y,_):atom(y)}),d&&d.keyList.length===m.length&&d.keyList.every((h,b)=>h===m[b])?x=d:x={arr:c,atomList:p,keyList:m},r.set(c,x),x},i=atom(c=>{const u=c(i),x=c(o);return a(x,u==null?void 0:u.arr)});i.init=void 0;const l=isWritable(o)?atom(c=>c(i).atomList,(c,u,x)=>{switch(x.type){case"remove":{const d=c(l).indexOf(x.atom);if(d>=0){const p=c(o);u(o,[...p.slice(0,d),...p.slice(d+1)])}break}case"insert":{const d=x.before?c(l).indexOf(x.before):c(l).length;if(d>=0){const p=c(o);u(o,[...p.slice(0,d),x.value,...p.slice(d)])}break}case"move":{const d=c(l).indexOf(x.atom),p=x.before?c(l).indexOf(x.before):c(l).length;if(d>=0&&p>=0){const m=c(o);d<p?u(o,[...m.slice(0,d),...m.slice(d+1,p),m[d],...m.slice(p)]):u(o,[...m.slice(0,p),m[d],...m.slice(p,d),...m.slice(d+1)])}break}}}):atom(c=>c(i).atomList);return l},o,cacheKeyForEmptyKeyExtractor)}const isPromiseLike$1=o=>typeof(o==null?void 0:o.then)=="function";function createJSONStorage(o){let n,r;const a={getItem:(i,l)=>{var c,u;const x=p=>{if(p=p||"",n!==p){try{r=JSON.parse(p)}catch{return l}n=p}return r},d=(u=(c=o())==null?void 0:c.getItem(i))!=null?u:null;return isPromiseLike$1(d)?d.then(x):x(d)},setItem:(i,l)=>{var c;return(c=o())==null?void 0:c.setItem(i,JSON.stringify(l))},removeItem:i=>{var l;return(l=o())==null?void 0:l.removeItem(i)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(a.subscribe=(i,l,c)=>{if(!(o()instanceof window.Storage))return()=>{};const u=x=>{if(x.storageArea===o()&&x.key===i){let d;try{d=JSON.parse(x.newValue||"")}catch{d=c}l(d)}};return window.addEventListener("storage",u),()=>{window.removeEventListener("storage",u)}}),a}const defaultStorage=createJSONStorage(()=>typeof window<"u"?window.localStorage:void 0);function atomWithStorage(o,n,r=defaultStorage,a){const i=atom(n);return i.onMount=c=>{c(r.getItem(o,n));let u;return r.subscribe&&(u=r.subscribe(o,c,n)),u},atom(c=>c(i),(c,u,x)=>{const d=typeof x=="function"?x(c(i)):x;return d===RESET?(u(i,n),r.removeItem(o)):d instanceof Promise?d.then(p=>(u(i,p),r.setItem(o,p))):(u(i,d),r.setItem(o,d))})}const StoreContext=React.createContext(void 0),useStore=o=>React.useContext(StoreContext)||getDefaultStore(),isPromiseLike=o=>typeof(o==null?void 0:o.then)=="function",use=React.use||(o=>{if(o.status==="pending")throw o;if(o.status==="fulfilled")return o.value;throw o.status==="rejected"?o.reason:(o.status="pending",o.then(n=>{o.status="fulfilled",o.value=n},n=>{o.status="rejected",o.reason=n}),o)});function useAtomValue(o,n){const r=useStore(),[[a,i,l],c]=React.useReducer(d=>{const p=r.get(o);return Object.is(d[0],p)&&d[1]===r&&d[2]===o?d:[p,r,o]},void 0,()=>[r.get(o),r,o]);let u=a;return(i!==r||l!==o)&&(c(),u=r.get(o)),React.useEffect(()=>{const d=r.sub(o,()=>{c()});return c(),d},[r,o,void 0]),React.useDebugValue(u),isPromiseLike(u)?use(u):u}function useSetAtom(o,n){const r=useStore();return React.useCallback((...i)=>r.set(o,...i),[r,o])}function useAtom(o,n){return[useAtomValue(o),useSetAtom(o)]}function duplicateBlocks(o,n,r){const a=lodashEs.filter(o,l=>l._parent===n),i=[];for(let l=0;l<a.length;l++){const c=getSlots(a[l]);if(Object.keys(c).length>0&&Object.keys(c).forEach(u=>{a[l][u]=`slot:${iconBase.generateUUID()}`}),lodashEs.filter(o,{_parent:a[l]._id}).length>0){const u=iconBase.generateUUID();i.push({...a[l],oldId:a[l]._id,_id:u,_parent:r}),i.push(lodashEs.flatten(duplicateBlocks(o,a[l]._id,u)))}else i.push({...a[l],oldId:a[l]._id,_id:iconBase.generateUUID(),_parent:r})}return lodashEs.flatten(i)}function convertToBlocksTree(o){const n={};o.forEach(a=>{n[a._id]={...a,children:[]}});const r=[];return o.forEach(a=>{if(a._parent){const i=n[a._parent];i&&i.children.push(n[a._id])}else r.push(n[a._id])}),r}const getSlots=o=>{const n={};return Object.keys(o).forEach(r=>{lodashEs.isString(o[r])&&o[r].startsWith("slot")&&(n[r]=o[r].replace("slot:",""))}),n},getDuplicatedBlocks=(o,n,r=null)=>{let a=lodashEs.find(o,{_id:n});a={...a,oldId:a._id,_id:iconBase.generateUUID()},r!==(a==null?void 0:a._parent)&&(a={...a,_parent:r});const i=[a];lodashEs.filter(o,{_parent:n}).length>0&&i.push(lodashEs.flatten(duplicateBlocks(o,n,a._id)));const l=lodashEs.flatten(i);return lodashEs.map(l,c=>{const u=c,x=getSlots(u);return Object.keys(x).length>0&&Object.keys(x).forEach(d=>{const p=lodashEs.find(l,{oldId:x[d].replace("slot:","")});u[d]=`slot:${p._id}`}),lodashEs.omit(u,["global","oldId"])})},presentBlocksAtom=jotai.atom([]);presentBlocksAtom.debugLabel="presentBlocksAtom";const treeDSBlocks=jotai.atom(o=>{const n=o(presentBlocksAtom);return convertToBlocksTree([...n])});treeDSBlocks.debugLabel="treeDSBlocks";presentBlocksAtom.debugLabel="presentBlocksAtom";const pageBlocksAtomsAtom=splitAtom(presentBlocksAtom);pageBlocksAtomsAtom.debugLabel="pageBlocksAtomsAtom";const builderActivePageAtom=jotai.atom("");builderActivePageAtom.debugLabel="builderActivePageAtom";const destinationDropIndexAtom=jotai.atom(-1);destinationDropIndexAtom.debugLabel="destinationDropIndexAtom";const buildingBlocksAtom=jotai.atom([]);buildingBlocksAtom.debugLabel="buildingBlocksAtom";const globalBlocksAtom=jotai.atom(o=>{const n=o(buildingBlocksAtom);return lodashEs.filter(n,r=>lodashEs.has(r,"blockId"))});globalBlocksAtom.debugLabel="globalBlocksAtom";const selectedBlockIdsAtom=jotai.atom([]);selectedBlockIdsAtom.debugLabel="selectedBlockIdsAtom";const selectedBlocksAtom=jotai.atom(o=>{const n=o(presentBlocksAtom),r=o(selectedBlockIdsAtom);return lodashEs.map(lodashEs.filter(n,({_id:a})=>lodashEs.includes(r,a)),a=>({...a}))});selectedBlocksAtom.debugLabel="selectedBlocksAtom";const selectedBlockAtom=jotai.atom(o=>{const n=o(selectedBlocksAtom);if(n.length===0)return null;if(n.length===1)return n[0]});selectedBlockAtom.debugLabel="selectedBlockAtom";const getParentId=o=>lodashEs.get(o,"_parent",null),selectedBlocksParentsAtom=jotai.atom(o=>{const n=o(selectedBlocksAtom),r=lodashEs.map(n,getParentId);return lodashEs.filter(o(presentBlocksAtom),a=>lodashEs.includes(r,a._id))});selectedBlocksParentsAtom.debugLabel="selectedBlocksParentsAtom";const selectedBlockFlexChildAtom=jotai.atom(()=>!1);selectedBlockFlexChildAtom.debugLabel="selectedBlockFlexChildAtom";const selectedBlockGridChildAtom=jotai.atom(()=>!1);selectedBlockGridChildAtom.debugLabel="selectedBlockGridChildAtom";const styleStateAtom=jotai.atom("");styleStateAtom.debugLabel="styleStateAtom";const styleBreakpointAtom=atomWithStorage("styleBreakpoint","xs");styleBreakpointAtom.debugLabel="styleBreakpointAtom";const useSelectedBlocksDisplayChild=()=>({flexChild:jotai.useAtomValue(selectedBlockFlexChildAtom),gridChild:jotai.useAtomValue(selectedBlockGridChildAtom)}),useSelectedBlock=()=>jotai.useAtomValue(selectedBlockAtom),selectedBlockHierarchy=jotai.atom(o=>{const n=o(selectedBlockAtom),r=o(presentBlocksAtom);let a=n;const i=[n];do{const l=r.find(({_id:c})=>c===(a==null?void 0:a._parent));a=l,l&&i.push(l)}while(a!=null&&a._parent);return i}),useSelectedBlockHierarchy=()=>lodashEs.compact(jotai.useAtomValue(selectedBlockHierarchy)),useSelectedBlockIds=()=>{const[o,n]=jotai.useAtom(selectedBlockIdsAtom),r=React.useCallback(a=>{n(i=>lodashEs.includes(i,a)?lodashEs.without(i,a):[...i,a])},[n]);return[o,n,r]};var undomanager={exports:{}};(function(o){(function(){function n(a,i,l){return a.splice(i,!l||1+l-i+(!(l<0^i>=0)&&(l<0||-1)*a.length)),a.length}let r=function(){let a=[],i=-1,l=0,c=!1,u;function x(d,p){return!d||typeof d[p]!="function"?this:(c=!0,d[p](),c=!1,this)}return{add:function(d){return c?this:(a.splice(i+1,a.length-i),a.push(d),l&&a.length>l&&n(a,0,-(l+1)),i=a.length-1,u&&u(),this)},setCallback:function(d){u=d},undo:function(){let d=a[i];if(!d)return this;const p=d.groupId;for(;d.groupId===p&&(x(d,"undo"),i-=1,d=a[i],!(!d||!d.groupId)););return u&&u(),this},redo:function(){let d=a[i+1];if(!d)return this;const p=d.groupId;for(;d.groupId===p&&(x(d,"redo"),i+=1,d=a[i+1],!(!d||!d.groupId)););return u&&u(),this},clear:function(){let d=a.length;a=[],i=-1,u&&d>0&&u()},hasUndo:function(){return i!==-1},hasRedo:function(){return i<a.length-1},getCommands:function(d){return d?a.filter(p=>p.groupId===d):a},getIndex:function(){return i},setLimit:function(d){l=d}}};o.exports?o.exports=r:window.UndoManager=r})()})(undomanager);var undomanagerExports=undomanager.exports;const UndoManager=ChaiThemeFn.getDefaultExportFromCjs(undomanagerExports),MODIFIERS=["hover","focus","focus-within","focus-visible","active","visited","target","first","last","only","odd","even","first-of-type","last-of-type","only-of-type","empty","disabled","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","open","before","after","first-letter","first-line","marker","selection","file","placeholder","hs-collapse-open","hs-accordion-active"],BRANDING_OPTIONS_DEFAULTS={bodyFont:"Inter",headingFont:"Inter",roundedCorners:5,primaryColor:"#570df8",secondaryColor:"#f002b8",bodyBgDarkColor:"#031022",bodyBgLightColor:"#fcfcfc",bodyTextDarkColor:"#ffffff",bodyTextLightColor:"#000000"},brandingOptionsAtom=jotai.atom(BRANDING_OPTIONS_DEFAULTS);jotai.atom(null);const useBrandingOptions=()=>{const[o,n]=jotai.useAtom(brandingOptionsAtom);return[lodashEs.isObject(o)?{...BRANDING_OPTIONS_DEFAULTS,...o}:BRANDING_OPTIONS_DEFAULTS,n]},currentPageAtom=jotai.atom(null),useCurrentPage=()=>({currentPage:jotai.useAtomValue(currentPageAtom)});function getBlocksTree(o){return convertToBlocksTree(o)}const nestedToFlatArray=(o,n)=>lodashEs.flatten(o.map(r=>{if(r=n?{...r,_parent:n}:{...r},r.children){const a=[...r.children];return delete r.children,lodashEs.flatten([r,...nestedToFlatArray(a,r._id)])}return r}));function setProjectBlocksInMemory(o,n=!1){for(let r=0;r<o.length;r++){const a=o[r];a.global&&!n?o[r]={type:"GlobalBlock",blockId:a.blockId,_parent:lodashEs.get(a,"_parent",null),_id:a._id}:a.children&&a.children.length&&setProjectBlocksInMemory(a.children)}}function getInnerBlocks(o){let n=[],r=lodashEs.filter(o,{type:"GlobalBlock"});return r.length>0&&(r=lodashEs.map(r,getPBlocks),lodashEs.each(r,a=>{n=[...n,...getSingleBlock(a)]})),n}function getSingleBlock(o){let n=[];const r=lodashEs.get(lodashEs.first(o),"_parent",null);lodashEs.set(lodashEs.first(o),"_parent",null);const a=[flatToNestedInstance.convert(clone(o))];setProjectBlocksInMemory(a,!0);let i=nestedToFlatArray(a,o[0]._id);return i=lodashEs.set(i,"0._parent",r),n=[...n,i,...getInnerBlocks(i)],n}function getPBlocks(o){const n=lodashEs.find(FLAT_ARRAY,{_id:o._id});if(!n)return[];const r=[n],a=lodashEs.filter(FLAT_ARRAY,{_parent:o._id});return a.length?lodashEs.flatten([...r,...lodashEs.flatten(lodashEs.map(a,getPBlocks))]):lodashEs.flatten(r)}const clone=o=>JSON.parse(JSON.stringify(o));let FLAT_ARRAY=[];function splitPageBlocks(o){FLAT_ARRAY=o;const n=getBlocksTree(clone(o));setProjectBlocksInMemory(n);const r=nestedToFlatArray(n,null),a=getInnerBlocks(r),i={};return lodashEs.each(a,l=>lodashEs.set(i,lodashEs.first(l).blockId,l)),[r,i]}const useGetPageData=()=>{const[o]=useBrandingOptions(),{currentPage:n}=useCurrentPage(),[r]=useBlocksStore();return React.useCallback(()=>{const a=lodashEs.map(r,l=>lodashEs.omit(l,["expanded","order","title","siblings","tempClasses"])),[i=[]]=splitPageBlocks(a);return{currentPage:n,blocks:i}},[o,n,r])},chaiBuilderPropsAtom=jotai.atom(null);chaiBuilderPropsAtom.debugLabel="chaiBuilderPropsAtom";const chaiExternalDataAtom=jotai.atom({});chaiExternalDataAtom.debugLabel="chaiExternalDataAtom";const useBuilderProp=(o,n=void 0)=>{const r=jotai.useAtomValue(chaiBuilderPropsAtom);return lodashEs.get(r,o,n)},getDefaultThemeValues=(o=ChaiThemeFn.defaultThemeOptions)=>{const n={};return o.fontFamily&&(n.fontFamily=Object.entries(o.fontFamily).reduce((r,[a,i])=>({...r,[a.replace("font-","")]:i}),{})),n.borderRadius=o.borderRadius,o.colors&&(n.colors=o.colors.reduce((r,a)=>(Object.entries(a.items).forEach(([i,l])=>{r[i]=l}),r),{})),n},chaiThemeValuesAtom=jotai.atom({}),useTheme=()=>{const o=useThemeOptions(),n=React.useMemo(()=>getDefaultThemeValues(o),[o]),r=useBuilderProp("theme",{}),[a,i]=jotai.useAtom(chaiThemeValuesAtom);return[{...n,...!lodashEs.isEmpty(r)&&r,...!lodashEs.isEmpty(a)&&a},i]},useThemeOptions=()=>{const o=useBuilderProp("themeOptions",r=>r);return React.useMemo(()=>o(ChaiThemeFn.defaultThemeOptions),[o])},rightPanelAtom=jotai.atom("block"),useRightPanel=()=>jotai.useAtom(rightPanelAtom),builderSaveStateAtom=jotai.atom("SAVED");builderSaveStateAtom.debugLabel="builderSaveStateAtom";const useSavePage=()=>{const[o,n]=jotai.useAtom(builderSaveStateAtom),r=useBuilderProp("onSave",async u=>{}),a=useBuilderProp("onSaveStateChange",lodashEs.noop),i=useGetPageData(),[l]=useTheme();return{savePage:web.useThrottledCallback(async(u=!1)=>{n("SAVING"),a("SAVING");const x=i();return await r({autoSave:u,blocks:x.blocks,theme:l}),setTimeout(()=>{n("SAVED"),a("SAVED")},100),!0},[i,n,l,r,a],3e3),saveState:o,setSaveState:n}},undoManager=new UndoManager;undoManager.setLimit(50);const useUndoManager=()=>{const[,o]=jotai.useAtom(builderSaveStateAtom),n=useBuilderProp("onSaveStateChange",lodashEs.noop);return React.useEffect(()=>(undoManager.setCallback(()=>{o("UNSAVED"),n("UNSAVED")}),()=>{undoManager.setCallback(lodashEs.noop)}),[]),{add:undoManager.add,undo:undoManager.undo,redo:undoManager.redo,hasRedo:undoManager.hasRedo,hasUndo:undoManager.hasUndo,clear:undoManager.clear}},broadcastChannel=new BroadcastChannel("chaibuilder"),useBroadcastChannel=()=>{const o=useBuilderProp("pageId","chaibuilder_page");return{postMessage:web.useDebouncedCallback(r=>broadcastChannel.postMessage({...r,pageId:o}),[o],200)}},useUnmountBroadcastChannel=()=>{const[,o]=useBlocksStore(),n=useBuilderProp("pageId","chaibuilder_page");React.useEffect(()=>(broadcastChannel.onmessageerror=r=>{console.log("error",r)},broadcastChannel.onmessage=r=>{r.data.type==="blocks-updated"&&r.data.pageId===n&&o(r.data.blocks)},()=>{broadcastChannel.onmessage=null,broadcastChannel.onmessageerror=null}),[o,n])},removeNestedBlocks=(o,n)=>{const r=[],a=lodashEs.filter(o,i=>lodashEs.includes(n,i._id)||lodashEs.includes(n,i._parent)?(r.push(i._id),!1):!0);return lodashEs.isEmpty(r)?a:removeNestedBlocks(a,r)},useRemoveBlocks=()=>{const[o]=useBlocksStore(),[n,r]=useSelectedBlockIds(),{setNewBlocks:a}=useBlocksStoreUndoableActions();return React.useCallback(i=>{var c;const l=((c=lodashEs.find(o,{_id:i[0]}))==null?void 0:c._parent)||null;a(removeNestedBlocks(o,i)),setTimeout(()=>r(l?[l]:[]),200)},[o,r,n])};function insertBlocksAtPosition(o,n,r,a){let i=o.filter(u=>!u._parent);r&&(i=o.filter(u=>u._parent===r));const l=!isNaN(a)||a>-1?Math.min(a,i.length):i.length;let c=o.length;for(let u=0,x=0;u<o.length;u++)if(o[u]._parent===r){if(x===l){c=u;break}x++}return!r&&a!==void 0&&a>=i.length&&(c=o.length),[...o.slice(0,c),...n,...o.slice(c)]}function flattenTree(o){let n=[];return o.walk(r=>(delete r.model.children,n.push(r.model),!0)),n}function findNodeById(o,n){return o.first(r=>r.model._id===n)||null}function moveNode(o,n,r,a){const i=findNodeById(o,n),l=findNodeById(o,r);if(i&&l){i.drop(),l.children||(l.model.children=[]);try{l.addChildAtIndex(i,a)}catch(c){return console.error("Error adding child to parent:",c),!1}return!0}return!1}function moveBlocksWithChildren(o,n,r,a){if(!n)return o;r=r||"root";const l=new TreeModel().parse({_id:"root",children:getBlocksTree(o)});if(moveNode(l,n,r,a)){const c=flattenTree(l),u=c.find(x=>x._id===n);return u&&(u._parent=r==="root"?null:r),c.shift(),c}return o}const useBlocksStoreManager=()=>{const[,o]=useBlocksStore(),{postMessage:n}=useBroadcastChannel();return{setNewBlocks:r=>{o(r),n({type:"blocks-updated",blocks:r})},addBlocks:(r,a,i)=>{o(l=>{const c=insertBlocksAtPosition(l,r,a,i);return n({type:"blocks-updated",blocks:c}),c})},removeBlocks:r=>{o(a=>{const i=removeNestedBlocks(a,r);return n({type:"blocks-updated",blocks:i}),i})},moveBlocks:(r,a,i)=>{o(l=>{let c=l;for(let u=0;u<r.length;u++)c=moveBlocksWithChildren(c,r[u],a,i);return n({type:"blocks-updated",blocks:c}),c})},updateBlocksProps:r=>{o(a=>{const i=r.map(c=>c._id),l=a.map(c=>{if(i.includes(c._id)){const u=lodashEs.find(r,{_id:c._id});return{...c,...lodashEs.omit(u,"_id")}}return c});return n({type:"blocks-updated",blocks:l}),l})}}},useBlocksStore=()=>jotai.useAtom(presentBlocksAtom),useBlocksStoreUndoableActions=()=>{const{add:o}=useUndoManager(),[n]=useBlocksStore(),{setNewBlocks:r,addBlocks:a,removeBlocks:i,moveBlocks:l,updateBlocksProps:c}=useBlocksStoreManager();return{moveBlocks:(R,f,y)=>{const _=lodashEs.map(R,S=>{const v=n.find(w=>w._id===S)._parent||null,E=n.filter(w=>v?w._parent===v:!w._parent).map(w=>w._id).indexOf(S);return{_id:S,oldParent:v,oldPosition:E}}),A=_.find(({_id:S})=>S===R[0]);A&&A.oldParent===f&&A.oldPosition===y||(l(R,f,y),o({undo:()=>lodashEs.each(_,({_id:S,oldParent:k,oldPosition:v})=>{l([S],k,v)}),redo:()=>l(R,f,y)}))},addBlocks:(R,f,y)=>{a(R,f,y),o({undo:()=>i(lodashEs.map(R,"_id")),redo:()=>a(R,f,y)})},removeBlocks:R=>{var A;const f=(A=lodashEs.first(R))==null?void 0:A._parent,_=n.filter(S=>f?S._parent===f:!S._parent).indexOf(lodashEs.first(R));i(lodashEs.map(R,"_id")),o({undo:()=>a(R,f,_),redo:()=>i(lodashEs.map(R,"_id"))})},updateBlocks:(R,f,y)=>{let _=[];if(y)_=lodashEs.map(R,A=>({_id:A,...y}));else{const A=lodashEs.keys(f);_=lodashEs.map(R,S=>{const k=n.find(g=>g._id===S),v={_id:S};return lodashEs.each(A,g=>v[g]=k[g]),v})}c(lodashEs.map(R,A=>({_id:A,...f}))),o({undo:()=>c(_),redo:()=>c(lodashEs.map(R,A=>({_id:A,...f})))})},updateBlocksRuntime:(R,f)=>{c(lodashEs.map(R,y=>({_id:y,...f})))},setNewBlocks:R=>{r(R),o({undo:()=>r(n),redo:()=>r(R)})},updateMultipleBlocksProps:R=>{let f=[];f=lodashEs.map(R,y=>{const _=lodashEs.keys(y),A=n.find(k=>k._id===y._id),S={};return lodashEs.each(_,k=>S[k]=A[k]),S}),c(R),o({undo:()=>c(f),redo:()=>c(R)})}}},useAddBlock=()=>{const[o]=useBlocksStore(),[,n]=useSelectedBlockIds(),{addBlocks:r}=useBlocksStoreUndoableActions(),a=React.useCallback((l,c,u)=>{var h;for(let b=0;b<l.length;b++){const{_id:R}=l[b];l[b]._id=iconBase.generateUUID();const f=lodashEs.filter(l,{_parent:R});for(let y=0;y<f.length;y++)f[y]._parent=l[b]._id}const x=lodashEs.first(l);let d,p;return c&&(d=lodashEs.find(o,{_id:c}),l[0]._parent=c,p=c),!(d?canAcceptChildBlock(d==null?void 0:d._type,x._type):!0)&&d&&(l[0]._parent=d._parent,p=d._parent),r(l,p,u),n([(h=lodashEs.first(l))==null?void 0:h._id]),lodashEs.first(l)},[r,o,n]);return{addCoreBlock:React.useCallback((l,c,u)=>{if(lodashEs.has(l,"blocks")){const f=l.blocks;return a(f,c,u)}const x=iconBase.generateUUID(),d=runtime.getDefaultBlockProps(l.type),p={_type:l.type,_id:x,...d};let m,h;return c&&(m=lodashEs.find(o,{_id:c}),p._parent=c,h=c),!canAcceptChildBlock(m==null?void 0:m._type,p._type)&&m&&(p._parent=m._parent,h=m._parent),r([p],h,u),n([p._id]),p},[r,a,o,n]),addPredefinedBlock:a}},STANDARD=[0,1,2,3,4,5,6,7,8,9,10,11,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96],CLASS_VALUES={columns:[...lodashEs.range(1,13),"auto","3xs","2xs","xs","sm","md","lg","xl",...lodashEs.map(lodashEs.range(2,8),o=>`${o}xl`)],breakAfter:["auto","avoid","all","avoid-page","page","left","right","column"],breakInside:["auto","avoid","avoid-page","avoid-column"],display:["block","flex","grid","inline-block","inline","hidden"],objectFit:["contain","cover","fill","none","scale-down"],objectPosition:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],overflow:["auto","hidden","clip","visible","scroll"],overscroll:["auto","contain","none"],trbl:[0,"px","0.5",1,1.5,2,2.5,3,3.5,...lodashEs.range(4,13),14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,"auto","1/2","1/3","2/3","1/4","2/4","3/4","full"],flexBasis:[...STANDARD,"auto","px","0.5","1.5","2.5","3.5","1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12","full"],padding:[...STANDARD,"px","0.5","1.5","2.5","3.5"],margin:["auto",...STANDARD,"px","0.5","1.5","2.5","3.5"],scale:[0,50,75,90,95,100,105,110,125,150],origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],blendEffect:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],borderWidth:[0,2,4,8],borderRadius:["global","none","sm","md","lg","xl","2xl","3xl","full"],indent:[0,"px","0.5",1,1.5,2,2.5,3,3.5,...lodashEs.range(4,13),14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96],maxHeight:[0,"px","0.5",1,1.5,2,2.5,3,3.5,...lodashEs.range(4,13),14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,"full","screen","min","max","fit"],space:[0,"px","0.5",1,1.5,2,2.5,3,3.5,...lodashEs.range(4,13),14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,"px","reverse"],width:["0","px","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96","auto","1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],maxWidth:["0","none","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","full","min","max","fit","prose","screen-sm","screen-md","screen-lg","screen-xl","screen-2xl"],height:["0","px","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96","auto","1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","full","screen","min","max","fit"]},CLASSES_LIST={textColor:{classes:[],regExp:"text-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},aspectRatio:{classes:["aspect-auto","aspect-square","aspect-video"],regExp:"aspect-(auto|square|video)"},container:{classes:["container"],regExp:"container"},columns:{classes:lodashEs.map(CLASS_VALUES.columns,o=>`columns-${o}`),regExp:"columns-(auto|[0-9]xl|[0-9]xs|xs|sm|md|lg|xl|\\d+)"},breakAfter:{classes:lodashEs.map(CLASS_VALUES.breakAfter,o=>`break-after-${o}`),regExp:"break-after-\\S+"},breakBefore:{classes:lodashEs.map(CLASS_VALUES.breakAfter,o=>`break-before-${o}`),regExp:"break-before-\\S+"},breakInside:{classes:lodashEs.map(CLASS_VALUES.breakInside,o=>`break-inside-${o}`),regExp:"break-inside-\\S+"},boxDecoration:{classes:["box-decoration-clone","box-decoration-slice"],regExp:"box-decoration-\\S+"},boxSizing:{classes:["box-border","box-content"],regExp:"box-(border|content)"},flexDirection:{classes:["flex-row","flex-row-reverse","flex-col","flex-col-reverse"],regExp:"flex-(row|row-reverse|col|col-reverse)"},flexWrap:{classes:["flex-wrap","flex-wrap-reverse","flex-nowrap"],regExp:"flex-(wrap|wrap-reverse|nowrap)"},flexGrowShrink:{classes:["flex-1","flex-auto","flex-initial","flex-none"],regExp:"flex-1|flex-auto|flex-initial|flex-none"},gridColumns:{classes:lodashEs.map([...lodashEs.range(0,13),"none"],o=>`grid-cols-${o}`),regExp:"grid-cols-(\\d+|none)"},gridFlow:{classes:["grid-flow-row","grid-flow-col","grid-flow-row-dense","grid-flow-col-dense"],regExp:"grid-flow-(row|col|row-dense|col-dense)"},outlineStyle:{classes:lodashEs.map(["none","dashed","dotted","double","hidden"],o=>`outline-${o}`),regExp:"outline-(none|dashed|dotted|double|hidden)"},borderStyle:{classes:lodashEs.map(["solid","dashed","dotted","double","hidden","none"],o=>`border-${o}`),regExp:"border-(solid|dashed|dotted|double|hidden|none)"},overflow:{classes:lodashEs.map(CLASS_VALUES.overflow,o=>`overflow-${o}`),regExp:`overflow-(${CLASS_VALUES.overflow.join("|")})`},overflowX:{classes:lodashEs.map(CLASS_VALUES.overflow,o=>`overflow-x-${o}`),regExp:`overflow-x-(${CLASS_VALUES.overflow.join("|")})`},overflowY:{classes:lodashEs.map(CLASS_VALUES.overflow,o=>`overflow-y-${o}`),regExp:`overflow-y-(${CLASS_VALUES.overflow.join("|")})`},gridRows:{classes:lodashEs.map([1,2,3,4,5,6,"none"],o=>`grid-rows-${o}`),regExp:"grid-rows-(\\d|none)"},display:{classes:lodashEs.map(CLASS_VALUES.display,o=>o.toString()),regExp:`(${CLASS_VALUES.display.join("|")})`},float:{classes:["float-right","float-left","float-none"],regExp:"float-\\S+"},clear:{classes:["clear-right","clear-left","clear-none","clear-both"],regExp:"clear-\\S+"},isolation:{classes:["isolate","isolation-auto"],regExp:"isolate|isolation-auto"},objectFit:{classes:lodashEs.map(CLASS_VALUES.objectFit,o=>`object-${o}`),regExp:"object-(contain|cover|fill|none|scale-down)"},objectPosition:{classes:lodashEs.map(CLASS_VALUES.objectPosition,o=>`object-${o}`),regExp:`object-(${CLASS_VALUES.objectPosition.join("|")})`},overscroll:{classes:lodashEs.map(CLASS_VALUES.overscroll,o=>`overscroll-${o}`),regExp:`overscroll-(${CLASS_VALUES.overscroll.join("|")})`},overscrollX:{classes:lodashEs.map(CLASS_VALUES.overscroll,o=>`overscroll-x-${o}`),regExp:`overscroll-x-(${CLASS_VALUES.overscroll.join("|")})`},overscrollY:{classes:lodashEs.map(CLASS_VALUES.overscroll,o=>`overscroll-y-${o}`),regExp:`overscroll-y-(${CLASS_VALUES.overscroll.join("|")})`},inset:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`inset-${o}`),regExp:"-?inset-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},insetX:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`inset-x-${o}`),regExp:"-?inset-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},insetY:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`inset-y-${o}`),regExp:"-?inset-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},top:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`top-${o}`),regExp:"-?top-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},topX:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`top-x-${o}`),regExp:"-?top-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},topY:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`top-y-${o}`),regExp:"-?top-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},right:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`right-${o}`),regExp:"-?right-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},rightX:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`right-x-${o}`),regExp:"-?right-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},rightY:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`right-y-${o}`),regExp:"-?right-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},bottom:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`bottom-${o}`),regExp:"-?bottom-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},bottomX:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`bottom-x-${o}`),regExp:"-?bottom-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},bottomY:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`bottom-y-${o}`),regExp:"-?bottom-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},left:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`left-${o}`),regExp:"-?left-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},leftX:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`left-x-${o}`),regExp:"-?left-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},leftY:{classes:lodashEs.map(CLASS_VALUES.trbl,o=>`left-y-${o}`),regExp:"-?left-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},visibility:{classes:["visible","invisible"],regExp:"invisible|visible"},zIndex:{classes:lodashEs.map(["0",10,20,30,40,50,"auto"],o=>`z-${o}`),regExp:"-?z-(\\d+|auto|\\[.*\\])"},flexBasis:{classes:lodashEs.map(CLASS_VALUES.flexBasis,o=>`basis-${o}`),regExp:"basis-(\\d+|\\S+)"},flexGrow:{classes:["grow","grow-0"],regExp:"grow(-0)?"},flexShrink:{classes:["shrink","shrink-0"],regExp:"shrink(-0)?"},gridColSpan:{classes:["col-auto",...lodashEs.map(lodashEs.range(1,13),o=>`col-span-${o}`),"col-span-full"],regExp:"col-(auto|span-(\\d+|full))"},gridColStart:{classes:[...lodashEs.map(lodashEs.range(1,14),o=>`col-start-${o}`),"col-start-auto"],regExp:"col-start-(\\d+|auto)"},gridColEnd:{classes:[...lodashEs.map(lodashEs.range(1,14),o=>`col-end-${o}`),"col-end-auto"],regExp:"col-end-(\\d+|auto)"},gridRowSpan:{classes:["row-auto",...lodashEs.map(lodashEs.range(1,7),o=>`row-span-${o}`),"row-span-full"],regExp:"row-(auto|span-(\\d+|full))"},gridRowStart:{classes:[...lodashEs.map(lodashEs.range(1,8),o=>`row-start-${o}`),"row-start-auto"],regExp:"row-start-(\\d+|auto)"},gridRowEnd:{classes:[...lodashEs.map(lodashEs.range(1,8),o=>`row-end-${o}`),"row-end-auto"],regExp:"row-end-(\\d+|auto)"},gridAutoColumns:{classes:["auto-cols-auto","auto-cols-min","auto-cols-max","auto-cols-fr"],regExp:"auto-cols-(auto|min|max|fr)"},gridAutoRows:{classes:["auto-rows-auto","auto-rows-min","auto-rows-max","auto-rows-fr"],regExp:"auto-rows-(auto|min|max|fr)"},gap:{classes:lodashEs.map(CLASS_VALUES.indent,o=>`gap-${o}`),regExp:"gap-(px|\\d.\\d|\\d|\\[.*\\])"},gapX:{classes:lodashEs.map(CLASS_VALUES.indent,o=>`gap-x-${o}`),regExp:"gap-x-(px|\\d.\\d|\\d|\\[.*\\])"},gapY:{classes:lodashEs.map(CLASS_VALUES.indent,o=>`gap-y-${o}`),regExp:"gap-y-(px|\\d.\\d|\\d|\\[.*\\])"},justifyContent:{classes:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"],regExp:"justify-(start|end|center|between|around|evenly)"},justifyItems:{classes:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"],regExp:"justify-items-(start|end|center|stretch)"},justifySelf:{classes:["justify-self-auto","justify-self-start","justify-self-end","justify-self-center","justify-self-stretch"],regExp:"justify-self-(auto|start|end|center|stretch)"},placeContent:{classes:["place-content-center","place-content-start","place-content-end","place-content-between","place-content-around","place-content-evenly","place-content-stretch"],regExp:"place-content-(center|start|end|between|around|evenly|stretch)"},placeItems:{classes:["place-items-start","place-items-end","place-items-center","place-items-stretch"],regExp:"place-items-(start|end|center|stretch)"},placeSelf:{classes:["place-self-auto","place-self-start","place-self-end","place-self-center","place-self-stretch"],regExp:"place-self-(auto|start|end|center|stretch)"},alignContent:{classes:["content-center","content-start","content-end","content-between","content-around","content-evenly"],regExp:"content-(center|start|end|between|around|evenly)"},alignItems:{classes:["items-start","items-end","items-center","items-baseline","items-stretch"],regExp:"items-(start|end|center|baseline|stretch)"},alignSelf:{classes:["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"],regExp:"self-(auto|start|end|center|stretch|baseline)"},backgroundClip:{classes:["bg-clip-border","bg-clip-padding","bg-clip-content","bg-clip-text"],regExp:"bg-clip-(border|padding|content|text)"},dropShadow:{classes:lodashEs.map(["sm","md","lg","xl","2xl","none"],o=>`drop-shadow-${o}`),regExp:"drop-shadow-(sm|md|lg|xl|2xl|none)"},backdropBlur:{classes:lodashEs.map(["none","sm","md","lg","xl","2xl","3xl"],o=>`backdrop-blur-${o}`),regExp:"backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)"},backdropBrightness:{classes:lodashEs.map([0,50,75,90,95,100,105,110,125,150,200],o=>`backdrop-brightness-${o}`),regExp:"backdrop-brightness-(\\d+)"},backdropContrast:{classes:lodashEs.map([0,50,75,100,125,150,200],o=>`backdrop-contrast-${o}`),regExp:"backdrop-contrast-(\\d+)"},backdropGrayScale:{classes:["backdrop-grayscale-0","backdrop-grayscale"],regExp:"backdrop-grayscale(-0)?"},backdropHueRotate:{classes:lodashEs.map([0,15,30,60,90,180],o=>`backdrop-hue-rotate-${o}`),regExp:"-?backdrop-hue-rotate-(\\d+)"},backdropInvert:{classes:["backdrop-invert-0","backdrop-invert"],regExp:"backdrop-invert(-0)?"},backdropOpacity:{classes:lodashEs.map([0,5,10,20,25,30,40,50,60,70,75,80,90,95,100],o=>`backdrop-opacity-${o}`),regExp:"backdrop-opacity-(\\d+)"},backdropSaturate:{classes:lodashEs.map([0,50,100,150,200],o=>`backdrop-saturate-${o}`),regExp:"backdrop-saturate-(\\d+)"},backdropSepia:{classes:["backdrop-sepia-0, backdrop-sepia"],regExp:"backdrop-sepia(-0)?"},backgroundOrigin:{classes:["bg-origin-border","bg-origin-padding","bg-origin-content"],regExp:"bg-origin-(border|padding|content)"},transformOrigin:{classes:lodashEs.map(CLASS_VALUES.origin,o=>`origin-${o}`),regExp:"origin-(\\d+|\\S+)"},padding:{classes:lodashEs.map(CLASS_VALUES.padding,o=>`p-${o}`),regExp:"p-(\\d+|\\S+|\\[.*\\])"},paddingX:{classes:lodashEs.map(CLASS_VALUES.padding,o=>`px-${o}`),regExp:"px-(\\d+|\\S+|\\[.*\\])"},paddingY:{classes:lodashEs.map(CLASS_VALUES.padding,o=>`py-${o}`),regExp:"py-(\\d+|\\S+|\\[.*\\])"},paddingTop:{classes:lodashEs.map(CLASS_VALUES.padding,o=>`pt-${o}`),regExp:"pt-(\\d+|\\S+|\\[.*\\])"},paddingRight:{classes:lodashEs.map(CLASS_VALUES.padding,o=>`pr-${o}`),regExp:"pr-(\\d+|\\S+|\\[.*\\])"},paddingBottom:{classes:lodashEs.map(CLASS_VALUES.padding,o=>`pb-${o}`),regExp:"pb-(\\d+|\\S+|\\[.*\\])"},paddingLeft:{classes:lodashEs.map(CLASS_VALUES.padding,o=>`pl-${o}`),regExp:"pl-(\\d+|\\S+|\\[.*\\])"},textDecorationStyle:{classes:["decoration-solid","decoration-double","decoration-dotted","decoration-dashed","decoration-wavy"],regExp:"decoration-(solid|double|dotted|dashed|wavy)"},textDecorationThickness:{classes:lodashEs.map(["auto","from-font","0",1,2,4,8],o=>`decoration-${o}`),regExp:"decoration-(auto|from-font|\\d+|\\S+)"},fromColor:{classes:[],regExp:"from-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},margin:{classes:lodashEs.map(CLASS_VALUES.margin,o=>`m-${o}`),regExp:"-?m-(\\d+|\\S+|\\[.*\\])"},marginX:{classes:lodashEs.map(CLASS_VALUES.margin,o=>`mx-${o}`),regExp:"-?mx-(\\d+|\\S+|\\[.*\\])"},marginY:{classes:lodashEs.map(CLASS_VALUES.margin,o=>`my-${o}`),regExp:"-?my-(\\d+|\\S+|\\[.*\\])"},marginTop:{classes:lodashEs.map(CLASS_VALUES.margin,o=>`mt-${o}`),regExp:"-?mt-(\\d+|\\S+|\\[.*\\])"},marginRight:{classes:lodashEs.map(CLASS_VALUES.margin,o=>`mr-${o}`),regExp:"-?mr-(\\d+|\\S+|\\[.*\\])"},marginBottom:{classes:lodashEs.map(CLASS_VALUES.margin,o=>`mb-${o}`),regExp:"-?mb-(\\d+|\\S+|\\[.*\\])"},marginLeft:{classes:lodashEs.map(CLASS_VALUES.margin,o=>`ml-${o}`),regExp:"-?ml-(\\d+|\\S+|\\[.*\\])"},spaceX:{classes:lodashEs.map(CLASS_VALUES.space,o=>`space-x-${o}`),regExp:"-?space-x-(\\d+|\\S+|\\[.*\\])"},spaceY:{classes:lodashEs.map(CLASS_VALUES.space,o=>`space-y-${o}`),regExp:"-?space-y-(\\d+|\\S+|\\[.*\\])"},boxShadow:{classes:lodashEs.map(["sm","md","lg","xl","2xl","inner","none"],o=>`shadow-${o}`),regExp:"shadow-(sm|md|lg|xl|2xl|inner|none)"},minWidth:{classes:["min-w-0","min-w-full","min-w-min","min-w-max","min-w-fit"],regExp:"min-w-(\\d+|\\S+|\\[.*\\])"},maxWidth:{classes:lodashEs.map(CLASS_VALUES.maxWidth,o=>`max-w-${o}`),regExp:"max-w-(\\d+|\\S+|\\[.*\\])"},width:{classes:lodashEs.map([...CLASS_VALUES.width,"full","screen","min","max","fit"],o=>`w-${o}`),regExp:"w-(\\d+.\\d+|\\d+|px|auto|full|screen|min|max|fit|\\[.*\\])"},minHeight:{classes:["min-h-0","min-h-full","min-h-screen","min-h-min","min-h-max","min-h-fit"],regExp:"min-h-(\\d+|\\S+|\\[.*\\])"},maxHeight:{classes:lodashEs.map(CLASS_VALUES.maxHeight,o=>`max-h-${o}`),regExp:"max-h-(\\d+|\\S+|\\[.*\\])"},height:{classes:lodashEs.map(CLASS_VALUES.height,o=>`h-${o}`),regExp:"h-(\\d+.\\d+|\\d+|px|auto|full|screen|min|max|fit|\\[.*\\])"},fontFamily:{classes:["font-heading","font-body","font-sans","font-serif","font-mono"],regExp:"font-(heading|body|sans|serif|mono)"},textAlign:{classes:["text-left","text-center","text-right","text-justify"],regExp:"text-(left|center|right|justify)"},textOverflow:{classes:["truncate","text-ellipsis","text-clip"],regExp:"truncate|text-ellipsis|text-clip"},verticalAlign:{classes:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"],regExp:"align-(baseline|top|middle|bottom|text-top|text-bottom|sub|super)"},fontSize:{classes:["text-xs","text-sm","text-base","text-lg","text-xl","text-2xl","text-3xl","text-4xl","text-5xl","text-6xl","text-7xl","text-8xl","text-9xl"],regExp:"text-(\\d+|\\S+|\\[.*\\])"},fontSmoothing:{classes:["antialiased","subpixel-antialiased"],regExp:"antialiased|subpixel-antialiased"},fontStyle:{classes:["italic","not-italic"],regExp:"not-italic|italic"},fontWeight:{classes:["font-thin","font-extralight","font-light","font-normal","font-medium","font-semibold","font-bold","font-extrabold","font-black"],regExp:"font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)"},fontVariantNum:{classes:["normal-nums","ordinal","diagonal-fractions","stacked-fractions","tabular-nums","oldstyle-nums","proportional-nums","lining-nums","slashed-zero"],regExp:"normal-nums|ordinal|diagonal-fractions|stacked-fractions|tabular-nums|oldstyle-nums|proportional-nums|lining-nums|slashed-zero"},letterSpacing:{classes:["tracking-tighter","tracking-tight","tracking-normal","tracking-wide","tracking-wider","tracking-widest"],regExp:"-?tracking-(tighter|tight|normal|wide|wider|widest|\\[.*\\])"},lineHeight:{classes:["leading-none","leading-tight","leading-snug","leading-normal","leading-relaxed","leading-loose","leading-3","leading-4","leading-5","leading-6","leading-7","leading-8","leading-9","leading-10"],regExp:"leading-(none|tight|snug|normal|relaxed|loose|\\[.*\\]|\\d+)"},listStyleType:{classes:["list-none","list-disc","list-decimal"],regExp:"list-(none|disc|decimal)"},listStylePosition:{classes:["list-inside","list-outside"],regExp:"list-(inside|outside)"},textUnderlineOffset:{classes:["underline-offset-auto","underline-offset-0","underline-offset-1","underline-offset-2","underline-offset-4","underline-offset-8"],regExp:"underline-offset-(auto|\\d+|\\S+)"},textDecoration:{classes:["underline","overline","line-through","no-underline"],regExp:"underline|overline|line-through|no-underline"},textDecorationColor:{classes:[],regExp:"decoration-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},textTransform:{classes:["uppercase","lowercase","capitalize","normal-case"],regExp:"uppercase|lowercase|capitalize|normal-case"},textIndent:{classes:lodashEs.map(CLASS_VALUES.indent,o=>`indent-${o}`),regExp:"-?indent-(\\d+|\\S+)"},whitespace:{classes:["whitespace-normal","whitespace-no-wrap","whitespace-pre","whitespace-pre-line","whitespace-pre-wrap"],regExp:"whitespace-(normal|no-wrap|pre|pre-line|pre-wrap)"},wordBreak:{classes:["break-normal","break-words","break-all"],regExp:"break-(normal|words|all)"},content:{classes:["content-none"],regExp:"content-none"},backgroundColor:{classes:[],regExp:"bg-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},backgroundAttachment:{classes:["bg-fixed","bg-local","bg-scroll"],regExp:"bg-(fixed|local|scroll)"},backgroundPosition:{classes:["bg-bottom","bg-center","bg-left","bg-left-bottom","bg-left-top","bg-right","bg-right-bottom","bg-right-top","bg-top"],regExp:"bg-(bottom|center|left|left-bottom|left-top|right|right-bottom|right-top|top)"},backgroundRepeat:{classes:["bg-repeat","bg-repeat-x","bg-repeat-y","bg-no-repeat","bg-repeat-round","bg-repeat-space"],regExp:"bg-(repeat|repeat-x|repeat-y|no-repeat|repeat-round|repeat-space)"},backgroundSize:{classes:["bg-auto","bg-cover","bg-contain"],regExp:"bg-(auto|cover|contain)"},backgroundGradient:{classes:["bg-gradient-none","bg-gradient-to-t","bg-gradient-to-tr","bg-gradient-to-r","bg-gradient-to-br","bg-gradient-to-b","bg-gradient-to-bl","bg-gradient-to-l","bg-gradient-to-tl"],regExp:"bg-gradient-(none|to-(t|tr|r|br|b|bl|l|tl))"},viaColor:{classes:[],regExp:"via-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},toColor:{classes:[],regExp:"to-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},position:{classes:["static","fixed","absolute","relative","sticky"],regExp:"(static|fixed|absolute|relative|sticky)"},borderRadiusTopLeft:{classes:["rounded-tl",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-tl-${o}`)],regExp:"rounded-tl-?(\\d+|\\S+)?"},borderRadiusTopRight:{classes:["rounded-tr",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-tr-${o}`)],regExp:"rounded-tr-?(\\d+|\\S+)?"},borderRadiusBottomRight:{classes:["rounded-br",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-br-${o}`)],regExp:"rounded-br-?(\\d+|\\S+)?"},borderRadiusBottomLeft:{classes:["rounded-bl",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-bl-${o}`)],regExp:"rounded-bl-?(\\d+|\\S+)?"},borderRadiusTop:{classes:["rounded-t",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-t-${o}`)],regExp:"rounded-t-?(\\d+|\\S+)?"},borderRadiusRight:{classes:["rounded-r",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-r-${o}`)],regExp:"rounded-r-?(\\d+|\\S+)?"},borderRadiusBottom:{classes:["rounded-b",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-b-${o}`)],regExp:"rounded-b-?(\\d+|\\S+)?"},borderRadiusLeft:{classes:["rounded-l",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-l-${o}`)],regExp:`(rounded-l-(${CLASS_VALUES.borderRadius.join("|")})|rounded-l$)`},borderRadius:{classes:["rounded",...lodashEs.map(CLASS_VALUES.borderRadius,o=>`rounded-${o}`)],regExp:`(rounded-(${CLASS_VALUES.borderRadius.join("|")}$)|rounded)`},borderX:{classes:["border-x",...lodashEs.map(CLASS_VALUES.borderWidth,o=>`border-x-${o}`)],regExp:"border-x-?(\\d+|\\S+|\\[.*\\])?"},borderY:{classes:["border-y",...lodashEs.map(CLASS_VALUES.borderWidth,o=>`border-y-${o}`)],regExp:"border-y-?(\\d+|\\S+|\\[.*\\])?"},borderTop:{classes:["border-t",...lodashEs.map(CLASS_VALUES.borderWidth,o=>`border-t-${o}`)],regExp:"border-t-?(\\d+|\\S+|\\[.*\\])?"},borderRight:{classes:["border-r",...lodashEs.map(CLASS_VALUES.borderWidth,o=>`border-r-${o}`)],regExp:"border-r-?(\\d+|\\S+|\\[.*\\])?"},borderBottom:{classes:["border-b",...lodashEs.map(CLASS_VALUES.borderWidth,o=>`border-b-${o}`)],regExp:"border-b-?(\\d+|\\S+|\\[.*\\])?"},borderLeft:{classes:["border-l",...lodashEs.map(CLASS_VALUES.borderWidth,o=>`border-l-${o}`)],regExp:"border-l-?(\\d+|\\S+|\\[.*\\])?"},borderColor:{classes:[],regExp:"border-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},border:{classes:["border",...lodashEs.map(CLASS_VALUES.borderWidth,o=>`border-${o}`)],regExp:"border-?(\\d+|\\S+|\\[.*\\])?"},order:{classes:lodashEs.map([...lodashEs.range(0,13),"first","last","none"],o=>`order-${o}`),regExp:"-?order-(\\d+|first|last|none)"},divideXWidth:{classes:lodashEs.map(["0",2,4,8],o=>`divide-x-${o}`),regExp:"divide-x-(\\d+|\\[.*\\])"},divideYWidth:{classes:lodashEs.map(["0",2,4,8],o=>`divide-y-${o}`),regExp:"divide-y-(\\d+|\\[.*\\])"},divideColor:{classes:[],regExp:"divide-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},divideStyle:{classes:lodashEs.map(["solid","dashed","dotted","double","none"],o=>`divide-${o}`),regExp:"divide-(solid|dashed|dotted|double|none)"},outlineWidth:{classes:lodashEs.map([0,1,2,4,8],o=>`outline-${o}`),regExp:"outline-(\\d+)"},outlineOffset:{classes:lodashEs.map([0,1,2,4,8],o=>`outline-offset-${o}`),regExp:"outline-offset-(\\d+)"},outlineColor:{classes:[],regExp:"outline-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},ringWidth:{classes:lodashEs.map([0,1,2,4,8,"inset"],o=>`ring-${o}`),regExp:"ring-(\\d+|inset)"},ringOffsetWidth:{classes:lodashEs.map([0,1,2,4,8],o=>`ring-offset-${o}`),regExp:"ring-offset-(\\d+)"},ringOffsetColor:{classes:[],regExp:"ring-offset-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},ringColor:{classes:[],regExp:"ring-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},boxShadowColor:{classes:[],regExp:"shadow-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},opacity:{classes:lodashEs.map([0,5,10,20,25,30,40,50,60,70,75,80,90,95,100],o=>`opacity-${o}`),regExp:"opacity-(\\d+|\\[.*\\])"},mixBlendMode:{classes:lodashEs.map(CLASS_VALUES.blendEffect,o=>`mix-blend-${o}`),regExp:"mix-blend-(\\d+|\\S+)"},bgBlendMode:{classes:lodashEs.map(CLASS_VALUES.blendEffect,o=>`bg-blend-${o}`),regExp:"bg-blend-(\\d+|\\S+)"},blur:{classes:lodashEs.map(["none","sm","md","lg","xl","2xl","3xl"],o=>`blur-${o}`),regExp:"blur-(none|sm|md|lg|xl|2xl|3xl)"},brightness:{classes:lodashEs.map([0,50,75,90,95,100,105,110,125,150,200],o=>`brightness-${o}`),regExp:"brightness-(\\d+)"},contrast:{classes:lodashEs.map([0,50,75,100,125,150,200],o=>`contrast-${o}`),regExp:"contrast-(\\d+)"},grayScale:{classes:["grayscale-0","grayscale"],regExp:"grayscale(-0)?"},hueRotate:{classes:lodashEs.map([0,15,30,60,90,180],o=>`hue-rotate-${o}`),regExp:"-?hue-rotate-(\\d+)"},invert:{classes:["invert-0","invert"],regExp:"invert(-0)?"},saturate:{classes:lodashEs.map([0,50,100,150,200],o=>`saturate-${o}`),regExp:"saturate-(\\d+)"},sepia:{classes:["sepia-0","sepia"],regExp:"sepia(-0)?"},transition:{classes:["transition-none","transition-all","transition-colors","transition-opacity","transition-shadow","transition-transform"],regExp:"transition-(none|all|colors|opacity|shadow|transform)"},duration:{classes:lodashEs.map([75,100,150,200,300,500,700,1e3],o=>`duration-${o}`),regExp:"duration-(\\d+|\\[.*\\])"},transitionEase:{classes:["ease-linear","ease-in","ease-out","ease-in-out"],regExp:"eas(e-linear|e-in|e-out|e-in-out)"},transitionDelay:{classes:lodashEs.map([75,100,150,200,300,500,700,1e3],o=>`delay-${o}`),regExp:"delay-(\\d+|\\[.*\\])"},animation:{classes:["animation-none","animation-spin","animation-ping"],regExp:"animation-(none|spin|ping)"},scaleX:{classes:lodashEs.map(CLASS_VALUES.scale,o=>`scale-x-${o}`),regExp:"-?scale-x-(\\d+|\\S+|\\[.*\\])"},scaleY:{classes:lodashEs.map(CLASS_VALUES.scale,o=>`scale-y-${o}`),regExp:"-?scale-y-(\\d+|\\S+|\\[.*\\])"},scale:{classes:lodashEs.map(CLASS_VALUES.scale,o=>`scale-${o}`),regExp:"-?scale-(\\d+|\\S+|\\[.*\\])"},rotate:{classes:lodashEs.map([0,1,2,3,6,12,45,90,180],o=>`rotate-${o}`),regExp:"-?rotate-(\\d+|\\S+|\\[.*\\])"},translateX:{classes:lodashEs.map([0,"px","0.5",1],o=>`translate-x-${o}`),regExp:"-?translate-x-(\\d+|\\S+|\\[.*\\])"},translateY:{classes:lodashEs.map([0,"px","0.5",1],o=>`translate-y-${o}`),regExp:"-?translate-y-(\\d+|\\S+|\\[.*\\])"},skewX:{classes:lodashEs.map([0,1,2,3,6,12],o=>`skew-x-${o}`),regExp:"-?skew-x-(\\d+|\\S+|\\[.*\\])"},skewY:{classes:lodashEs.map([0,1,2,3,6,12],o=>`skew-y-${o}`),regExp:"-?skew-y-(\\d+|\\S+|\\[.*\\])"},accentColor:{classes:[],regExp:"accent-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},appearance:{classes:["appearance-none"],regExp:"appearance-none"},cursor:{classes:["cursor-auto","cursor-default","cursor-pointer","cursor-wait","cursor-text","cursor-move","cursor-help","cursor-not-allowed"],regExp:"cursor-(auto|default|pointer|wait|text|move|help|not-allowed)"},caretColor:{classes:[],regExp:"caret-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},pointerEvents:{classes:["pointer-events-none","pointer-events-auto"],regExp:"pointer-events-(none|auto)"},userSelect:{classes:["select-none","select-text","select-all","select-auto"],regExp:"select-(none|text|all|auto)"},fill:{classes:[],regExp:"caret-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},stroke:{classes:[],regExp:"caret-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},strokeWidth:{classes:["stroke-0","stroke-1","stroke-2"],regExp:"stroke-(\\d+|\\[.*\\])"}},colorOptions={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},soloColors=["current","inherit","transparent","black","white"],shadedColors=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],shades=["50","100","200","300","400","500","600","700","800","900"],colorKeys=lodashEs.map(lodashEs.values(colorOptions),o=>o),ALL_COLORS=lodashEs.flattenDeep([...lodashEs.map(soloColors,o=>lodashEs.flatten(lodashEs.map(colorKeys,n=>`${n}-${o}`))),...lodashEs.map(shadedColors,o=>lodashEs.flattenDeep(lodashEs.map(colorKeys,n=>lodashEs.flattenDeep(lodashEs.map(shades,r=>`${n}-${o}-${r}`)))))]),ALL_TW_CLASSES=lodashEs.map(lodashEs.flattenDeep(lodashEs.values(CLASSES_LIST).map(o=>o.classes).concat(ALL_COLORS)),o=>({name:o})),useFuseSearch=()=>{const o=useThemeOptions(),n=React.useMemo(()=>{let r=[];if(o.colors){const a=lodashEs.flattenDeep(lodashEs.map(o.colors,({items:i})=>lodashEs.keys(i)));r=lodashEs.flattenDeep(lodashEs.map(a,i=>lodashEs.flatten(lodashEs.map(colorKeys,l=>`${l}-${i}`))))}return o.fontFamily&&(r=[...r,...lodashEs.map(lodashEs.keys(o.fontFamily),a=>`${a}`)]),lodashEs.map(r,a=>({name:a}))},[o]);return React.useMemo(()=>new Fuse([...ALL_TW_CLASSES,...n],{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]}),[n])},useTailwindClassList=()=>{const o=useThemeOptions(),n=React.useMemo(()=>{if(o.colors){const i=lodashEs.flattenDeep(lodashEs.map(o.colors,({items:l})=>lodashEs.keys(l)));lodashEs.each(CLASSES_LIST,(l,c)=>{lodashEs.set(CLASSES_LIST,`${c}.regExp`,l.regExp.replace("__THEME_COLORS_REGEXP__",i.join("|")))})}return CLASSES_LIST},[o]),r=React.useCallback((i,l)=>{const c=lodashEs.get(n,`${i}.regExp`,"");return l.match(new RegExp(c))},[n]),a=React.useCallback((i,l=[])=>lodashEs.get(n,`${i}.classes`,l),[n]);return{match:r,getClasses:a}};function getMqForCls(o){if(lodashEs.isEmpty(o.trim()))return"";const n=o.match(/sm:|md:|lg:|xl:|2xl:/g);return lodashEs.get(n,0,"xs").replace(":","")}function getModForCls(o){const n=lodashEs.map(MODIFIERS,a=>`${a}:`).join("|"),r=new RegExp(n,"g");return lodashEs.get(r.exec(o.trim()),0,"").replace(":","")}function getPureClsName(o){return o.trim().split(":").pop()||""}const memoizedProps={};function getPropertyForClass(o){if(lodashEs.isEmpty(o))return"";if(memoizedProps[o])return memoizedProps[o];let n="";for(const r in CLASSES_LIST){const a=lodashEs.get(CLASSES_LIST,`${r}.regExp`,"");if(new RegExp(a,"g").test(o)){n=r,memoizedProps[o]=n;break}}return n}function constructClassObject(o){return lodashEs.isEmpty(o)?null:{dark:lodashEs.startsWith(o,"dark:"),mq:getMqForCls(o),mod:getModForCls(o),cls:getPureClsName(o),fullCls:o,property:getPropertyForClass(o)}}function generateFullClsName(o){let n="";return o.dark&&(n+="dark:"),o.mq.toLowerCase()!=="xs"&&(n+=`${o.mq}:`),o.mod&&(n+=`${o.mod}:`),n+=o.cls,n}const MEDIA_QUERIES={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},breakpoints=["xs","sm","md","lg","xl","2xl"];function getBelongsToForClass(o,n){if(n===null)return"baseClasses";const r=n.mq;if(r==="xs"||n.dark||n.mod!=="")return"classes";let a="baseClasses",i=breakpoints.indexOf(r);for(;i>0;){const l=breakpoints[i-1];if(lodashEs.find(o,{mq:l,property:n.property})){a="classes";break}i--}return a}const IGNORED_BASES_CLASSES_PROPERTIES=[];function getNewClasses(o="",n="",r=[]){o=o.trim().replace(/ +/g,"");let a=lodashEs.filter(lodashEs.map(o.split(" "),constructClassObject),d=>!lodashEs.isNull(d)),i=lodashEs.filter(lodashEs.map(n.split(" "),constructClassObject),d=>!lodashEs.isNull(d));i=lodashEs.filter(i,d=>!lodashEs.includes(IGNORED_BASES_CLASSES_PROPERTIES,d.property));const l=[],c=[];lodashEs.each(r,d=>{const p=constructClassObject(d),m=lodashEs.find(a,lodashEs.pick(p,["dark","mq","mod","property"]));if(m&&(a=lodashEs.filter(a,h=>h.fullCls!==(m==null?void 0:m.fullCls))),l.push(p),p.mq==="xs"&&!p.dark&&p.mod===""&&(i=lodashEs.filter(i,h=>h.property!==p.property)),getBelongsToForClass(a,p)==="baseClasses"&&!lodashEs.includes(IGNORED_BASES_CLASSES_PROPERTIES,p.property)){const h=lodashEs.find(i,lodashEs.pick(p,["property"]));m&&(i=lodashEs.filter(i,b=>b.fullCls!==(h==null?void 0:h.fullCls))),c.push({...p,fullCls:p.cls,mq:"xs"})}});const u=lodashEs.map(lodashEs.sortBy([...a,...l],d=>MEDIA_QUERIES[d.mq]),"fullCls").join(" ");return`${lodashEs.map(lodashEs.sortBy([...i,...c],d=>MEDIA_QUERIES[d.mq]),"fullCls").join(" ").trim()},${u.trim()}`.trim().replace(/ +/g,"")}const selectedStylingBlocksAtom=jotai.atom([]);selectedStylingBlocksAtom.debugLabel="selectedStylingBlocksAtom";const useSelectedStylingBlocks=()=>jotai.useAtom(selectedStylingBlocksAtom),getSplitClasses$1=o=>{const n=o.replace(STRINGS.STYLES_KEY,"").split(",");return{baseClasses:n[0],classes:n[1]}},addClassesToBlocksAtom=jotai.atom(null,(o,n,{blockIds:r,newClasses:a})=>{const i=lodashEs.filter(o(pageBlocksAtomsAtom),c=>r.includes(o(c)._id)),l=lodashEs.first(o(selectedStylingBlocksAtom));return lodashEs.map(i,c=>{const u=o(c),x=lodashEs.get(u,l.prop,`${STRINGS.STYLES_KEY},`),{baseClasses:d,classes:p}=getSplitClasses$1(x);return{ids:[u._id],props:{[l.prop]:`${STRINGS.STYLES_KEY}${getNewClasses(p,d,a)}`}}})}),useAddClassesToBlocks=()=>{const o=jotai.useSetAtom(addClassesToBlocksAtom),{updateBlocks:n,updateBlocksRuntime:r}=useBlocksStoreUndoableActions();return React.useCallback((a,i,l=!1)=>{const c=o({blockIds:a,newClasses:i});if(!l){r(a,c[0].props);return}n(a,c[0].props)},[o,n,r])},useStylingBreakpoint=()=>jotai.useAtom(styleBreakpointAtom),canvasWidthAtom=atomWithStorage("canvasWidth",800),canvasBreakpointAtom=jotai.atom(o=>{const n=o(canvasWidthAtom);return iconBase.getBreakpointValue(n).toLowerCase()}),useCanvasWidth=()=>{const[o,n]=jotai.useAtom(canvasWidthAtom),r=jotai.useAtomValue(canvasBreakpointAtom),[a,i]=useStylingBreakpoint();return React.useEffect(()=>{a!=="xs"&&i(r)},[r,a,i]),[o,r,n]},canvasZoomAtom=atomWithStorage("canvasZoom",100),useCanvasZoom=()=>jotai.useAtom(canvasZoomAtom),cutBlockIdsAtom=jotai.atom([]),useCutBlockIds=()=>{const[o,n]=jotai.useAtom(cutBlockIdsAtom),r=jotai.useSetAtom(copiedBlockIdsAtom),a=React.useCallback(i=>{n(i),r([])},[n,r]);return[o,a]},copiedBlockIdsAtom=jotai.atom([]),useCopyBlockIds=()=>{const[o]=useBlocksStore(),[n,r]=jotai.useAtom(copiedBlockIdsAtom),a=jotai.useSetAtom(cutBlockIdsAtom),i=React.useCallback(async l=>{try{r(l),a([]);const c={_chai_copied_blocks:l.flatMap(u=>getDuplicatedBlocks(o,u,null))};await navigator.clipboard.writeText(JSON.stringify(c))}catch(c){console.error("Failed to copy blocks to clipboard:",c)}},[r,a,o]);return[n,i]},darkModeAtom=atomWithStorage("darkMode",!1),useDarkMode=()=>{const[o,n]=jotai.useAtom(darkModeAtom);return[o,n]},useDuplicateBlocks=()=>{const[o]=useBlocksStore(),[,n]=useSelectedBlockIds(),{addBlocks:r}=useBlocksStoreUndoableActions();return React.useCallback((a,i=null)=>{const l=[];lodashEs.each(a,c=>{const u=o.find(h=>h._id===c);i?i==="root"&&(i=null):i=u._parent;const p=lodashEs.filter(o,h=>lodashEs.isString(i)?h._parent===i:!h._parent).indexOf(u)+1,m=getDuplicatedBlocks(o,c,i);r(m,i,p),l.push(lodashEs.get(m,"0._id",""))}),n(l)},[o,n])},hiddenBlockIdsAtom=jotai.atom([]),useHiddenBlockIds=()=>{const[o,n]=jotai.useAtom(hiddenBlockIdsAtom),r=React.useCallback(a=>{n(i=>lodashEs.includes(i,a)?lodashEs.without(i,a):[...i,a])},[n]);return[o,n,r]},highlightBlockIdAtom=jotai.atom(""),useHighlightBlockId=()=>jotai.useAtom(highlightBlockIdAtom),useCanPaste=()=>{const[o]=useBlocksStore();return(n,r)=>{var l;const a=((l=lodashEs.find(o,{_id:r}))==null?void 0:l._type)||null,i=lodashEs.first(n.map(c=>{var u;return(u=lodashEs.find(o,{_id:c}))==null?void 0:u._type}));return canAcceptChildBlock(a,i)}},useMoveCutBlocks=()=>{const o=jotai.useAtomValue(presentBlocksAtom),{moveBlocks:n}=useBlocksStoreUndoableActions();return React.useCallback((r,a)=>{const i=Array.isArray(a)?a[0]:a;if(a==="root"){const l=o==null?void 0:o.filter(c=>!c._parent);n(r,null,(l==null?void 0:l.length)||0)}else{const l=o==null?void 0:o.filter(c=>c._parent===i);n(r,i,(l==null?void 0:l.length)||0)}},[n,o])},usePasteBlocks=()=>{const[o,n]=useCutBlockIds(),r=useMoveCutBlocks(),a=useCanPaste(),{toast:i}=contextMenu.useToast(),{addPredefinedBlock:l}=useAddBlock();return{canPaste:React.useCallback(async u=>{if(o.length>0)return a(o,u);try{const x=await navigator.clipboard.readText();if(x){const d=JSON.parse(x);return lodashEs.has(d,"_chai_copied_blocks")}}catch{return!1}return!1},[a,o]),pasteBlocks:React.useCallback(async u=>{const x=Array.isArray(u)?u[0]:u;if(!lodashEs.isEmpty(o)){r(o,u),n([]),await navigator.clipboard.writeText("");return}try{const d=await navigator.clipboard.readText();if(d){const p=JSON.parse(d);lodashEs.has(p,"_chai_copied_blocks")?l(p._chai_copied_blocks,x==="root"?null:x):i({title:"Error",description:"Nothing to paste"})}else i({title:"Error",description:"Nothing to paste"})}catch{i({title:"Error",description:"Failed to paste blocks from clipboard"})}},[o,l,r,n,i])}},previewModeAtom=jotai.atom(!1),usePreviewMode=()=>{const[o,n]=jotai.useAtom(previewModeAtom);return[o,n]},getSplitClasses=o=>{const n=o.replace(STRINGS.STYLES_KEY,"").split(",");return{baseClasses:n[0],classes:n[1]}},removeClassFromBlocksAtom=jotai.atom(null,(o,n,{blockIds:r,fullClasses:a})=>{const i=lodashEs.first(o(selectedStylingBlocksAtom)),l=lodashEs.filter(o(pageBlocksAtomsAtom),c=>r.includes(o(c)._id));return lodashEs.map(l,c=>{const u=o(c),x=a;let{classes:d,baseClasses:p}=getSplitClasses(lodashEs.get(u,i.prop,"styles:,"));return lodashEs.each(x,m=>{const h=m.replace(/[\[\]\/\\{}()*+?.^$|]/g,"\\$&"),b=new RegExp(`(^| )${h}($| )`,"g");d=d.replace(b," ").replace(/ +/g," ").trim();const R=lodashEs.first(m.split(":"));lodashEs.includes(["2xl","xl","lg","md","sm"],R)&&x.push(m.split(":").pop().trim())}),lodashEs.each(x,m=>{const h=new RegExp(`(^| )${m.replace("[","\\[").replace("]","\\]")}($| )`,"g");p=p.replace(h," ").replace(/ +/g," ").trim()}),{ids:[u._id],props:{[i.prop]:`${STRINGS.STYLES_KEY}${p},${d}`}}})}),useRemoveClassesFromBlocks=()=>{const{updateBlocks:o}=useBlocksStoreUndoableActions(),n=jotai.useSetAtom(removeClassFromBlocksAtom);return React.useCallback((r,a)=>{const i=n({blockIds:r,fullClasses:a});o(r,i[0].props)},[n])},selectedBlockAllClassesAtom=jotai.atom(o=>{const n=lodashEs.first(o(selectedStylingBlocksAtom)),r=o(selectedBlockAtom);if(!n||n.blockId!==lodashEs.get(r,"_id",null))return[];const i=lodashEs.get(r,n.prop,`${STRINGS.STYLES_KEY},`).replace(STRINGS.STYLES_KEY,"").split(",").join(" ");return lodashEs.filter(lodashEs.map(i.trim().split(" "),constructClassObject),l=>!lodashEs.isNull(l))}),useSelectedBlockAllClasses=()=>jotai.useAtomValue(selectedBlockAllClassesAtom),MQ={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},selectedBlockCurrentClassesAtom=jotai.atom(o=>{const n=o(canvasBreakpointAtom),r=o(styleStateAtom),a=o(darkModeAtom),i=getQueries(n);let l=lodashEs.filter(o(selectedBlockAllClassesAtom),{mod:r});return lodashEs.startsWith(r,"_")||(l=lodashEs.filter(l,c=>i.includes(c.mq))),l=l.sort((c,u)=>MQ[c.mq]-MQ[u.mq]),a||(l=lodashEs.filter(l,{dark:!1})),l}),getQueries=o=>{let n=[];switch(o){case"xs":n=["xs"];break;case"sm":n=["xs","sm"];break;case"md":n=["xs","sm","md"];break;case"lg":n=["xs","sm","md","lg"];break;case"xl":n=["xs","sm","md","lg","xl"];break;case"2xl":n=["xs","sm","md","lg","xl","2xl"];break;default:n=["xs"];break}return n},useSelectedBlockCurrentClasses=()=>jotai.useAtomValue(selectedBlockCurrentClassesAtom),useStylingState=()=>jotai.useAtom(styleStateAtom),languageAtom=jotai.atom("");languageAtom.debugLabel="selectedLanguageAtom";const useLanguages=()=>{const o=useBuilderProp("languages",[]),n=useBuilderProp("fallbackLang","en"),[r,a]=jotai.useAtom(languageAtom),i=l=>{a(n===l?"":l)};return{languages:o==null?void 0:o.filter(l=>l!==n),fallbackLang:n,selectedLang:r,setSelectedLang:i}},updatePropsForLanguage=lodashEs.memoize((o,n,r)=>{const a=runtime.getRegisteredChaiBlock(lodashEs.get(r,"_type"));if(!a)return o;const i={...o};return lodashEs.forEach(lodashEs.keys(o),l=>{if(lodashEs.includes(lodashEs.get(a,"i18nProps",[]),l)&&!lodashEs.isEmpty(n)){const c=`${l}-${n}`;lodashEs.set(i,c,o[l]),lodashEs.unset(i,l)}}),i}),useUpdateBlocksProps=()=>{const{updateBlocks:o}=useBlocksStoreUndoableActions(),{selectedLang:n}=useLanguages(),r=useSelectedBlock();return React.useCallback((a,i,l)=>{const c=updatePropsForLanguage(i,n,r);o(a,c,l)},[n,r,o])},useUpdateMultipleBlocksProps=()=>{const{updateMultipleBlocksProps:o}=useBlocksStoreUndoableActions();return React.useCallback(n=>{o(n)},[o])},useFakeStreamEffect=()=>{const{updateBlocksRuntime:o}=useBlocksStoreUndoableActions();return React.useCallback(async(n,r,a=30)=>{const i=lodashEs.keys(lodashEs.omit(r,["_id"]));for(const l of i){const c=r[l];if(lodashEs.isString(c)){const u=lodashEs.chunk(c.split(""),12);let x="";o([n],{[l]:""});for(let d=0;d<u.length;d++)x+=u[d].join(""),o([n],{[l]:x}),await new Promise(p=>setTimeout(p,a))}}},[o])},useStreamMultipleBlocksProps=()=>{const{updateMultipleBlocksProps:o}=useBlocksStoreUndoableActions(),n=useFakeStreamEffect();return React.useCallback(async r=>{for(const a of r)await n(a._id,a);o(r)},[n,o])},useUpdateBlocksPropsRealtime=()=>{const{updateBlocksRuntime:o}=useBlocksStoreUndoableActions(),{selectedLang:n}=useLanguages(),r=useSelectedBlock();return React.useCallback((a,i)=>{const l=updatePropsForLanguage(i,n,r);o(a,l)},[n,r,o])},selectedBreakpointsAtom=atomWithStorage("selectedBreakpoints",["XS","MD","XL"]),useSelectedBreakpoints=()=>{const[o,n]=jotai.useAtom(selectedBreakpointsAtom);return[o,n]},readOnlyModeAtom=jotai.atom(!1);readOnlyModeAtom.debugLabel="readOnlyModeAtom";const networkModeAtom=jotai.atom("online");networkModeAtom.debugLabel="networkModeAtom";jotai.atom("");const editLayerNameAtom=jotai.atom(!1);editLayerNameAtom.debugLabel="editLayerNameAtom";const activeLanguageAtom=jotai.atom("");activeLanguageAtom.debugLabel="activeLanguageAtom";const primaryLanguageAtom=jotai.atom("");primaryLanguageAtom.debugLabel="primaryLanguageAtom";const canvasIframeAtom=jotai.atom(null);canvasIframeAtom.debugLabel="canvasIframeAtom";const activePanelAtom=jotai.atom("outline");activePanelAtom.debugLabel="activePanelAtom";const showPredefinedBlockCategoryAtom=jotai.atom("");showPredefinedBlockCategoryAtom.debugLabel="showPredefinedBlockCategoryAtom";const historyStatesAtom=jotai.atom({undoCount:0,redoCount:0});historyStatesAtom.debugLabel="historyStatesAtom";const inlineEditingActiveAtom=jotai.atom("");inlineEditingActiveAtom.debugLabel="inlineEditingActiveAtom";const draggingFlagAtom=jotai.atom(!1);draggingFlagAtom.debugLabel="draggingFlagAtom";const treeRefAtom=jotai.atom(null);treeRefAtom.debugLabel="treeRefAtom";const canvasSettingsAtom=jotai.atom({});canvasSettingsAtom.debugLabel="canvasSettingsAtom";const aiAssistantActiveAtom=jotai.atom(!1);aiAssistantActiveAtom.debugLabel="aiAssistantActiveAtom";const codeEditorOpenAtom=jotai.atom(!1);codeEditorOpenAtom.debugLabel="codeEditorOpenAtom";const codeEditorHeightAtom=atomWithStorage("codeEditorHeight",500);codeEditorHeightAtom.debugLabel="codeEditorHeightAtom";const xShowBlocksAtom=jotai.atom([]);xShowBlocksAtom.debugLabel="xShowBlocksAtom";const selectedLibraryAtom=atomWithStorage("_selectedLibrary",null);selectedLibraryAtom.debugLabel="selectedLibraryAtom";let lastHighlighted=null;const useBlockHighlight=()=>{const[o]=jotai.useAtom(canvasIframeAtom),n=React.useMemo(()=>{var i;return(o==null?void 0:o.contentDocument)||((i=o==null?void 0:o.contentWindow)==null?void 0:i.document)},[o]);return{highlightBlock:i=>{if(lastHighlighted&&lastHighlighted.removeAttribute("data-highlighted"),typeof i!="string")i.setAttribute("data-highlighted","true"),lastHighlighted=i;else if(typeof i=="string"){const l=n.querySelector(`[data-block-id="${i}"]`);l&&(l.setAttribute("data-highlighted","true"),lastHighlighted=l)}else lastHighlighted=null},clearHighlight:()=>{lastHighlighted&&(lastHighlighted.removeAttribute("data-highlighted"),lastHighlighted=null)},lastHighlighted}},globalBlocksStoreAtom=atom({}),globalBlocksLoadingStateAtom=atom({}),useGlobalBlocksStore=()=>{const[o,n]=useAtom(globalBlocksStoreAtom),r=React.useCallback(i=>lodashEs.get(o,i==null?void 0:i.globalBlock,[]),[o]),a=React.useCallback(()=>{n({})},[n]);return{getGlobalBlocks:r,reset:a}},useWatchGlobalBlocks=()=>{const[o]=useBlocksStore(),[n,r]=useAtom(globalBlocksStoreAtom),[a,i]=useAtom(globalBlocksLoadingStateAtom),l=useBuilderProp("getGlobalBlockBlocks",async u=>[]),c=React.useMemo(()=>o.filter(x=>x._type==="GlobalBlock").filter(x=>x._type==="GlobalBlock").map(x=>x.globalBlock),[o]);React.useEffect(()=>{lodashEs.forEach(c,u=>{lodashEs.has(n,u)||lodashEs.get(a,`${u}.loading`,!1)||(i(x=>({...x,[u]:{loading:!0,error:null}})),l(u).then(x=>{r(d=>({...d,[u]:x})),i(d=>({...d,[u]:{loading:!1,error:null}}))}).catch(x=>{i(d=>({...d,[u]:{loading:!1,error:x.message}}))}))})},[l,n,c,a,r,i])},globalBlocksListAtom=atom({}),useGlobalBlocksList=()=>{const[o,n]=React.useState(!1),[r,a]=useAtom(globalBlocksListAtom),i=useBuilderProp("getGlobalBlocks",async()=>[]),l=React.useCallback(async()=>{n(!0);const c=await i();a(c),n(!1)},[i,a]);return React.useEffect(()=>{l()},[]),{data:r,isLoading:o,refetch:l}},useBuilderReset=()=>{const o=jotai.useSetAtom(historyStatesAtom),{clear:n}=useUndoManager(),[,r]=useSelectedBlockIds(),{clearHighlight:a}=useBlockHighlight(),[,i]=useSelectedStylingBlocks(),[,l]=useAtom(aiAssistantActiveAtom),{reset:c}=useGlobalBlocksStore();return()=>{r([]),i([]),a(),n(),l(!1),o({undoCount:0,redoCount:0}),c()}},useUILibraryBlocks=()=>({data:useBuilderProp("uiLibraries",[]),isLoading:!1}),useCopyToClipboard=()=>{const[o,n]=React.useState(null),r=React.useCallback(async a=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(a),n(a),!0}catch(i){return console.warn("Copy failed",i),n(null),!1}},[]);return[o,r]},codeEditorAtom=jotai.atom(null),useCodeEditor=()=>jotai.useAtom(codeEditorAtom),LANGUAGES={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"};function getChildBlocks(o,n,r){r.push(lodashEs.find(o,{_id:n}));const a=lodashEs.filter(o,{_parent:n});for(const i of a)r.push(...getBlockWithChildren(i._id,o));return r}const getBlockWithChildren=(o,n)=>{let r=[];return r=lodashEs.flattenDeep([...r,...getChildBlocks(n,o,r)]),r},pickOnlyAIProps=(o,n)=>lodashEs.compact(o.map(r=>{const a=["_id","_type","_parent"],i=lodashEs.pick(r,a),l=runtime.getRegisteredChaiBlock(r._type),c={},u=lodashEs.get(l,"aiProps",[]);for(const x in r)a.includes(x)||u.includes(x)&&(c[x]=lodashEs.get(r,`${x}-${n}`,r[x]));return lodashEs.isEmpty(c)?!1:(lodashEs.has(i,"_parent")&&lodashEs.isEmpty(i._parent)&&delete i._parent,{...i,...c})})),addLangToPrompt=(o,n,r)=>!n||r!=="content"?o:`${o}. Generate content in ${lodashEs.get(LANGUAGES,n,n)} language.`,askAiProcessingAtom=jotai.atom(!1),useAskAi=()=>{const[o,n]=jotai.useAtom(askAiProcessingAtom),[r,a]=React.useState(null),i=useBuilderProp("askAiCallBack",null),l=useStreamMultipleBlocksProps(),c=useUpdateMultipleBlocksProps(),[u]=useBlocksStore(),{selectedLang:x,fallbackLang:d}=useLanguages(),p=x.length?x:d,m=(h,b)=>{const R=lodashEs.cloneDeep(b.find(f=>f._id===h));for(const f in R){const y=R[f];typeof y=="string"&&lodashEs.startsWith(y,STRINGS.STYLES_KEY)?R[f]=lodashEs.compact(lodashEs.flattenDeep(y.replace(STRINGS.STYLES_KEY,"").split(","))).join(" "):f!=="_id"&&delete R[f]}return R};return{askAi:React.useCallback(async(h,b,R,f)=>{if(i){n(!0),a(null);try{const y=x===d?"":x,_=h==="content"?pickOnlyAIProps(lodashEs.cloneDeep(getBlockWithChildren(b,u)),x):[m(b,u)],A=await i(h,addLangToPrompt(R,p,h),_,y),{blocks:S,error:k}=A;if(k){a(k);return}if(h==="styles"){const v=S.map(g=>{for(const E in g)E!=="_id"&&(g[E]=`${STRINGS.STYLES_KEY},${g[E]}`);return g});c(v)}else l(S);f&&f(A)}catch(y){a(y)}finally{n(!1),f&&f()}}},[i,n,x,d,u,p,c,l]),loading:o,error:r}},useAiAssistant=()=>{const[,o]=useRightPanel();return React.useCallback(n=>{o(n?"ai":"block")},[o])},wrapperBlockAtom=jotai.atom(o=>{var c;const n=o(presentBlocksAtom),r=o(selectedBlockIdsAtom),a=r.length===1?r[0]:null;if(!a)return null;const i=lodashEs.find(n,{_id:a});if(!i)return null;let l=i._parent;for(;l;){const u=lodashEs.find(n,{_id:l});if(!u)return null;if((c=runtime.getRegisteredChaiBlock(u._type))!=null&&c.wrapper)return u;l=u._parent}return null});wrapperBlockAtom.debugLabel="wrapperBlockAtom";const useWrapperBlock=()=>jotai.useAtomValue(wrapperBlockAtom),layoutVariantAtom=atomWithStorage("_layout_variant_mode","DUAL_SIDE_PANEL"),useLayoutVariant=()=>{const[o,n]=jotai.useAtom(layoutVariantAtom),r=useBuilderProp("layoutVariant","DUAL_SIDE_PANEL");return[o||r,n]},IframeInitialContent=`<!doctype html>
|
|
1
|
+
"use strict";var Jv=Object.defineProperty;var Wv=(r,h,x)=>h in r?Jv(r,h,{enumerable:!0,configurable:!0,writable:!0,value:x}):r[h]=x;var xm=(r,h,x)=>Wv(r,typeof h!="symbol"?h+"":h,x);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("./jsx-runtime-DGh1k5sI.cjs"),React=require("react"),contextMenu=require("./context-menu-dsqhw1Ub.cjs"),lodashEs=require("lodash-es"),jotai=require("jotai"),iconBase=require("./iconBase-Cn2BsTrq.cjs"),reactI18next=require("react-i18next"),ChaiThemeFn=require("./ChaiThemeFn-DQu-2Eh9.cjs"),web=require("@react-hookz/web"),TreeModel=require("tree-model"),runtime=require("@chaibuilder/runtime"),ReactQuill=require("react-quill"),flagged=require("flagged"),reactHotkeysHook=require("react-hotkeys-hook"),dom=require("@floating-ui/dom"),reactDom=require("@floating-ui/react-dom"),reactIcons=require("@radix-ui/react-icons"),typography=require("@tailwindcss/typography"),forms=require("@tailwindcss/forms"),aspectRatio=require("@tailwindcss/aspect-ratio"),containerQueries=require("@tailwindcss/container-queries"),tailwindMerge=require("tailwind-merge"),STRINGS=require("./STRINGS-n7COZtKr.cjs"),reactWrapBalancer=require("react-wrap-balancer"),lucideReact=require("lucide-react"),ReactDOM=require("react-dom"),reactErrorBoundary=require("react-error-boundary"),reResizable=require("re-resizable"),reactArborist=require("react-arborist"),himalaya=require("himalaya"),RjForm=require("@rjsf/core"),validator=require("@rjsf/validator-ajv8"),IconPicker=require("react-icons-picker"),Autosuggest=require("react-autosuggest"),Fuse=require("fuse.js"),clsx=require("clsx"),i18n=require("i18next"),framerMotion=require("framer-motion");function _interopNamespaceDefault(r){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const x in r)if(x!=="default"){const g=Object.getOwnPropertyDescriptor(r,x);Object.defineProperty(h,x,g.get?g:{enumerable:!0,get:()=>r[x]})}}return h.default=r,Object.freeze(h)}const React__namespace=_interopNamespaceDefault(React),canAcceptChildBlock=(r,h)=>{if(!r)return!0;const x=runtime.getRegisteredChaiBlock(r);return x&&lodashEs.has(x,"canAcceptBlock")?x.canAcceptBlock(h):!1},canAddChildBlock=r=>{const h=runtime.getRegisteredChaiBlock(r);return h?lodashEs.has(h,"canAcceptBlock"):!1},canBeNestedInside=(r,h)=>{const x=runtime.getRegisteredChaiBlock(h);return x&&lodashEs.has(x,"canBeNested")?x.canBeNested(r):!0},canDuplicateBlock=r=>{const h=runtime.getRegisteredChaiBlock(r);return h&&lodashEs.has(h,"canDuplicate")?h.canDuplicate():!0},canDeleteBlock=r=>{const h=runtime.getRegisteredChaiBlock(r);return h&&lodashEs.has(h,"canDelete")?h.canDelete():!0};let keyCount=0;function atom(r,h){const x=`atom${++keyCount}`,g={toString(){return x}};return typeof r=="function"?g.read=r:(g.init=r,g.read=defaultRead,g.write=defaultWrite),h&&(g.write=h),g}function defaultRead(r){return r(this)}function defaultWrite(r,h,x){return h(this,typeof x=="function"?x(r(this)):x)}const isSelfAtom=(r,h)=>r.unstable_is?r.unstable_is(h):h===r,hasInitialValue=r=>"init"in r,isActuallyWritableAtom=r=>!!r.write,cancelablePromiseMap=new WeakMap,isPendingPromise=r=>{var h;return isPromiseLike$2(r)&&!((h=cancelablePromiseMap.get(r))!=null&&h[1])},cancelPromise=(r,h)=>{const x=cancelablePromiseMap.get(r);x&&(x[1]=!0,x[0].forEach(g=>g(h)))},patchPromiseForCancelability=r=>{if(cancelablePromiseMap.has(r))return;const h=[new Set,!1];cancelablePromiseMap.set(r,h);const x=()=>{h[1]=!0};r.then(x,x),r.onCancel=g=>{h[0].add(g)}},isPromiseLike$2=r=>typeof(r==null?void 0:r.then)=="function",isAtomStateInitialized=r=>"v"in r||"e"in r,returnAtomValue=r=>{if("e"in r)throw r.e;return r.v},addPendingPromiseToDependency=(r,h,x)=>{x.p.has(r)||(x.p.add(r),h.then(()=>{x.p.delete(r)},()=>{x.p.delete(r)}))},addDependency=(r,h,x,g)=>{var v;h.d.set(x,g.n),isPendingPromise(h.v)&&addPendingPromiseToDependency(r,h.v,g),(v=g.m)==null||v.t.add(r)},INTERNAL_flushStoreHook=Symbol.for("JOTAI.EXPERIMENTAL.FLUSHSTOREHOOK"),buildStore=(...r)=>{const[h,x,g,v,R,A]=r,j=be=>{let ge=h(be);return ge||(ge={d:new Map,p:new Set,n:0},x(be,ge),R==null||R(be,xe)),ge},C=new WeakMap,T=new Map,M=new Set,O=new Set,z=()=>{var be;const ge=[],je=oe=>{try{oe()}catch(me){ge.push(me)}};do{(be=xe[INTERNAL_flushStoreHook])==null||be.call(xe);const oe=new Set,me=oe.add.bind(oe);T.forEach(V=>{var ie;return(ie=V.m)==null?void 0:ie.l.forEach(me)}),T.clear(),M.forEach(me),M.clear(),O.forEach(me),O.clear(),oe.forEach(je),T.size&&te()}while(T.size||M.size||O.size);if(ge.length)throw ge[0]},Z=(be,ge,je)=>{const oe="v"in ge,me=ge.v,V=isPendingPromise(ge.v)?ge.v:null;if(isPromiseLike$2(je)){patchPromiseForCancelability(je);for(const ie of ge.d.keys())addPendingPromiseToDependency(be,je,j(ie));ge.v=je}else ge.v=je;delete ge.e,(!oe||!Object.is(me,ge.v))&&(++ge.n,V&&cancelPromise(V,je))},q=be=>{var ge;const je=j(be);if(isAtomStateInitialized(je)&&(je.m&&C.get(be)!==je.n||Array.from(je.d).every(([Re,Ve])=>q(Re).n===Ve)))return je;je.d.clear();let oe=!0;const me=()=>{je.m&&(se(be,je),te(),z())},V=Re=>{if(isSelfAtom(be,Re)){const qe=j(Re);if(!isAtomStateInitialized(qe))if(hasInitialValue(Re))Z(Re,qe,Re.init);else throw new Error("no atom init");return returnAtomValue(qe)}const Ve=q(Re);try{return returnAtomValue(Ve)}finally{addDependency(be,je,Re,Ve),oe||me()}};let ie,re;const Ae={get signal(){return ie||(ie=new AbortController),ie.signal},get setSelf(){return!re&&isActuallyWritableAtom(be)&&(re=(...Re)=>{if(!oe)return X(be,...Re)}),re}};try{const Re=g(be,V,Ae);return Z(be,je,Re),isPromiseLike$2(Re)&&((ge=Re.onCancel)==null||ge.call(Re,()=>ie==null?void 0:ie.abort()),Re.then(me,me)),je}catch(Re){return delete je.v,je.e=Re,++je.n,je}finally{oe=!1}},Y=be=>returnAtomValue(q(be)),P=be=>{var ge;const je=new Map;for(const oe of((ge=be.m)==null?void 0:ge.t)||[]){const me=j(oe);me.m&&je.set(oe,me)}for(const oe of be.p)je.set(oe,j(oe));return je},he=be=>{const ge=[be];for(;ge.length;){const je=ge.pop();for(const[oe,me]of P(je))C.has(oe)||(C.set(oe,me.n),ge.push(me))}},te=()=>{var be;const ge=[],je=new WeakSet,oe=new WeakSet,me=Array.from(T);for(;me.length;){const[V,ie]=me[me.length-1];if(oe.has(V)){me.pop();continue}if(je.has(V)){C.get(V)===ie.n?ge.push([V,ie,ie.n]):(C.delete(V),T.set(V,ie)),oe.add(V),me.pop();continue}je.add(V);for(const[re,Ae]of P(ie))je.has(re)||me.push([re,Ae])}for(let V=ge.length-1;V>=0;--V){const[ie,re,Ae]=ge[V];let Re=!1;for(const Ve of re.d.keys())if(Ve!==ie&&T.has(Ve)){Re=!0;break}Re&&(q(ie),se(ie,re),Ae!==re.n&&(T.set(ie,re),(be=re.u)==null||be.call(re))),C.delete(ie)}},ue=(be,...ge)=>{let je=!0;const oe=V=>returnAtomValue(q(V)),me=(V,...ie)=>{var re;const Ae=j(V);try{if(isSelfAtom(be,V)){if(!hasInitialValue(V))throw new Error("atom not writable");const Re=Ae.n,Ve=ie[0];Z(V,Ae,Ve),se(V,Ae),Re!==Ae.n&&(T.set(V,Ae),(re=Ae.u)==null||re.call(Ae),he(Ae));return}else return ue(V,...ie)}finally{je||(te(),z())}};try{return v(be,oe,me,...ge)}finally{je=!1}},X=(be,...ge)=>{try{return ue(be,...ge)}finally{te(),z()}},se=(be,ge)=>{var je;if(ge.m&&!isPendingPromise(ge.v)){for(const[oe,me]of ge.d)if(!ge.m.d.has(oe)){const V=j(oe);pe(oe,V).t.add(be),ge.m.d.add(oe),me!==V.n&&(T.set(oe,V),(je=V.u)==null||je.call(V),he(V))}for(const oe of ge.m.d||[])if(!ge.d.has(oe)){ge.m.d.delete(oe);const me=ve(oe,j(oe));me==null||me.t.delete(be)}}},pe=(be,ge)=>{var je;if(!ge.m){q(be);for(const oe of ge.d.keys())pe(oe,j(oe)).t.add(be);if(ge.m={l:new Set,d:new Set(ge.d.keys()),t:new Set},(je=ge.h)==null||je.call(ge),isActuallyWritableAtom(be)){const oe=ge.m,me=()=>{let V=!0;const ie=(...re)=>{try{return ue(be,...re)}finally{V||(te(),z())}};try{const re=A(be,ie);re&&(oe.u=()=>{V=!0;try{re()}finally{V=!1}})}finally{V=!1}};O.add(me)}}return ge.m},ve=(be,ge)=>{var je;if(ge.m&&!ge.m.l.size&&!Array.from(ge.m.t).some(oe=>{var me;return(me=j(oe).m)==null?void 0:me.d.has(be)})){const oe=ge.m.u;oe&&M.add(oe),delete ge.m,(je=ge.h)==null||je.call(ge);for(const me of ge.d.keys()){const V=ve(me,j(me));V==null||V.t.delete(be)}return}return ge.m},xe={get:Y,set:X,sub:(be,ge)=>{const je=j(be),me=pe(be,je).l;return me.add(ge),z(),()=>{me.delete(ge),ve(be,je),z()}},unstable_derive:be=>buildStore(...be(...r))};return xe},createStore=()=>{const r=new WeakMap;return buildStore(x=>r.get(x),(x,g)=>r.set(x,g).get(x),(x,...g)=>x.read(...g),(x,...g)=>x.write(...g),(x,...g)=>{var v;return(v=x.unstable_onInit)==null?void 0:v.call(x,...g)},(x,...g)=>{var v;return(v=x.onMount)==null?void 0:v.call(x,...g)})};let defaultStore;const getDefaultStore=()=>(defaultStore||(defaultStore=createStore()),defaultStore),RESET=Symbol(""),getCached$1=(r,h,x)=>(h.has(x)?h:h.set(x,r())).get(x),cache1$2=new WeakMap,memo2$1=(r,h,x)=>{const g=getCached$1(()=>new WeakMap,cache1$2,h);return getCached$1(r,g,x)},cacheKeyForEmptyKeyExtractor={},isWritable=r=>!!r.write,isFunction=r=>typeof r=="function";function splitAtom(r,h){return memo2$1(()=>{const x=new WeakMap,g=(A,j)=>{let C=x.get(A);if(C)return C;const T=j&&x.get(j),M=[],O=[];return A.forEach((z,Z)=>{const q=Z;O[Z]=q;const Y=T&&T.atomList[T.keyList.indexOf(q)];if(Y){M[Z]=Y;return}const P=te=>{const ue=te(v),X=te(r),pe=g(X,ue==null?void 0:ue.arr).keyList.indexOf(q);if(pe<0||pe>=X.length){const ve=A[g(A).keyList.indexOf(q)];if(ve)return ve;throw new Error("splitAtom: index out of bounds for read")}return X[pe]},he=(te,ue,X)=>{const se=te(v),pe=te(r),Me=g(pe,se==null?void 0:se.arr).keyList.indexOf(q);if(Me<0||Me>=pe.length)throw new Error("splitAtom: index out of bounds for write");const J=isFunction(X)?X(pe[Me]):X;Object.is(pe[Me],J)||ue(r,[...pe.slice(0,Me),J,...pe.slice(Me+1)])};M[Z]=isWritable(r)?atom(P,he):atom(P)}),T&&T.keyList.length===O.length&&T.keyList.every((z,Z)=>z===O[Z])?C=T:C={arr:A,atomList:M,keyList:O},x.set(A,C),C},v=atom(A=>{const j=A(v),C=A(r);return g(C,j==null?void 0:j.arr)});v.init=void 0;const R=isWritable(r)?atom(A=>A(v).atomList,(A,j,C)=>{switch(C.type){case"remove":{const T=A(R).indexOf(C.atom);if(T>=0){const M=A(r);j(r,[...M.slice(0,T),...M.slice(T+1)])}break}case"insert":{const T=C.before?A(R).indexOf(C.before):A(R).length;if(T>=0){const M=A(r);j(r,[...M.slice(0,T),C.value,...M.slice(T)])}break}case"move":{const T=A(R).indexOf(C.atom),M=C.before?A(R).indexOf(C.before):A(R).length;if(T>=0&&M>=0){const O=A(r);T<M?j(r,[...O.slice(0,T),...O.slice(T+1,M),O[T],...O.slice(M)]):j(r,[...O.slice(0,M),O[T],...O.slice(M,T),...O.slice(T+1)])}break}}}):atom(A=>A(v).atomList);return R},r,cacheKeyForEmptyKeyExtractor)}const isPromiseLike$1=r=>typeof(r==null?void 0:r.then)=="function";function createJSONStorage(r=()=>{try{return window.localStorage}catch{return}},h){var x;let g,v;const R={getItem:(C,T)=>{var M,O;const z=q=>{if(q=q||"",g!==q){try{v=JSON.parse(q,h==null?void 0:h.reviver)}catch{return T}g=q}return v},Z=(O=(M=r())==null?void 0:M.getItem(C))!=null?O:null;return isPromiseLike$1(Z)?Z.then(z):z(Z)},setItem:(C,T)=>{var M;return(M=r())==null?void 0:M.setItem(C,JSON.stringify(T,void 0))},removeItem:C=>{var T;return(T=r())==null?void 0:T.removeItem(C)}},A=C=>(T,M,O)=>C(T,z=>{let Z;try{Z=JSON.parse(z||"")}catch{Z=O}M(Z)});let j;try{j=(x=r())==null?void 0:x.subscribe}catch{}return!j&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(j=(C,T)=>{if(!(r()instanceof window.Storage))return()=>{};const M=O=>{O.storageArea===r()&&O.key===C&&T(O.newValue)};return window.addEventListener("storage",M),()=>{window.removeEventListener("storage",M)}}),j&&(R.subscribe=A(j)),R}const defaultStorage=createJSONStorage();function atomWithStorage(r,h,x=defaultStorage,g){const v=atom(h);return v.onMount=A=>{A(x.getItem(r,h));let j;return x.subscribe&&(j=x.subscribe(r,A,h)),j},atom(A=>A(v),(A,j,C)=>{const T=typeof C=="function"?C(A(v)):C;return T===RESET?(j(v,h),x.removeItem(r)):T instanceof Promise?T.then(M=>(j(v,M),x.setItem(r,M))):(j(v,T),x.setItem(r,T))})}const StoreContext=React.createContext(void 0),useStore=r=>React.useContext(StoreContext)||getDefaultStore(),isPromiseLike=r=>typeof(r==null?void 0:r.then)=="function",attachPromiseMeta=r=>{r.status="pending",r.then(h=>{r.status="fulfilled",r.value=h},h=>{r.status="rejected",r.reason=h})},use=React.use||(r=>{if(r.status==="pending")throw r;if(r.status==="fulfilled")return r.value;throw r.status==="rejected"?r.reason:(attachPromiseMeta(r),r)}),continuablePromiseMap=new WeakMap,createContinuablePromise=r=>{let h=continuablePromiseMap.get(r);return h||(h=new Promise((x,g)=>{let v=r;const R=C=>T=>{v===C&&x(T)},A=C=>T=>{v===C&&g(T)},j=C=>{"onCancel"in C&&typeof C.onCancel=="function"&&C.onCancel(T=>{isPromiseLike(T)?(continuablePromiseMap.set(T,h),v=T,T.then(R(T),A(T)),j(T)):x(T)})};r.then(R(r),A(r)),j(r)}),continuablePromiseMap.set(r,h)),h};function useAtomValue(r,h){const x=useStore(),[[g,v,R],A]=React.useReducer(T=>{const M=x.get(r);return Object.is(T[0],M)&&T[1]===x&&T[2]===r?T:[M,x,r]},void 0,()=>[x.get(r),x,r]);let j=g;if((v!==x||R!==r)&&(A(),j=x.get(r)),React.useEffect(()=>{const T=x.sub(r,()=>{A()});return A(),T},[x,r,void 0]),React.useDebugValue(j),isPromiseLike(j)){const T=createContinuablePromise(j);return use(T)}return j}function useSetAtom(r,h){const x=useStore();return React.useCallback((...v)=>x.set(r,...v),[x,r])}function useAtom(r,h){return[useAtomValue(r),useSetAtom(r)]}function duplicateBlocks(r,h,x){const g=lodashEs.filter(r,R=>R._parent===h),v=[];for(let R=0;R<g.length;R++){const A=getSlots(g[R]);if(Object.keys(A).length>0&&Object.keys(A).forEach(j=>{g[R][j]=`slot:${iconBase.generateUUID()}`}),lodashEs.filter(r,{_parent:g[R]._id}).length>0){const j=iconBase.generateUUID();v.push({...g[R],oldId:g[R]._id,_id:j,_parent:x}),v.push(lodashEs.flatten(duplicateBlocks(r,g[R]._id,j)))}else v.push({...g[R],oldId:g[R]._id,_id:iconBase.generateUUID(),_parent:x})}return lodashEs.flatten(v)}function convertToBlocksTree(r){const h={};r.forEach(g=>{h[g._id]={...g,children:[]}});const x=[];return r.forEach(g=>{if(g._parent){const v=h[g._parent];v&&v.children.push(h[g._id])}else x.push(h[g._id])}),x}const getSlots=r=>{const h={};return Object.keys(r).forEach(x=>{lodashEs.isString(r[x])&&r[x].startsWith("slot")&&(h[x]=r[x].replace("slot:",""))}),h},getDuplicatedBlocks=(r,h,x=null)=>{let g=lodashEs.find(r,{_id:h});g={...g,oldId:g._id,_id:iconBase.generateUUID()},x!==(g==null?void 0:g._parent)&&(g={...g,_parent:x});const v=[g];lodashEs.filter(r,{_parent:h}).length>0&&v.push(lodashEs.flatten(duplicateBlocks(r,h,g._id)));const R=lodashEs.flatten(v);return lodashEs.map(R,A=>{const j=A,C=getSlots(j);return Object.keys(C).length>0&&Object.keys(C).forEach(T=>{const M=lodashEs.find(R,{oldId:C[T].replace("slot:","")});j[T]=`slot:${M._id}`}),lodashEs.omit(j,["global","oldId"])})},presentBlocksAtom=jotai.atom([]);presentBlocksAtom.debugLabel="presentBlocksAtom";const treeDSBlocks=jotai.atom(r=>{const h=r(presentBlocksAtom);return convertToBlocksTree([...h])});treeDSBlocks.debugLabel="treeDSBlocks";presentBlocksAtom.debugLabel="presentBlocksAtom";const pageBlocksAtomsAtom=splitAtom(presentBlocksAtom);pageBlocksAtomsAtom.debugLabel="pageBlocksAtomsAtom";const builderActivePageAtom=jotai.atom("");builderActivePageAtom.debugLabel="builderActivePageAtom";const destinationDropIndexAtom=jotai.atom(-1);destinationDropIndexAtom.debugLabel="destinationDropIndexAtom";const buildingBlocksAtom=jotai.atom([]);buildingBlocksAtom.debugLabel="buildingBlocksAtom";const globalBlocksAtom=jotai.atom(r=>{const h=r(buildingBlocksAtom);return lodashEs.filter(h,x=>lodashEs.has(x,"blockId"))});globalBlocksAtom.debugLabel="globalBlocksAtom";const selectedBlockIdsAtom=jotai.atom([]);selectedBlockIdsAtom.debugLabel="selectedBlockIdsAtom";const selectedBlocksAtom=jotai.atom(r=>{const h=r(presentBlocksAtom),x=r(selectedBlockIdsAtom);return lodashEs.map(lodashEs.filter(h,({_id:g})=>lodashEs.includes(x,g)),g=>({...g}))});selectedBlocksAtom.debugLabel="selectedBlocksAtom";const selectedBlockAtom=jotai.atom(r=>{const h=r(selectedBlocksAtom);if(h.length===0)return null;if(h.length===1)return h[0]});selectedBlockAtom.debugLabel="selectedBlockAtom";const getParentId=r=>lodashEs.get(r,"_parent",null),selectedBlocksParentsAtom=jotai.atom(r=>{const h=r(selectedBlocksAtom),x=lodashEs.map(h,getParentId);return lodashEs.filter(r(presentBlocksAtom),g=>lodashEs.includes(x,g._id))});selectedBlocksParentsAtom.debugLabel="selectedBlocksParentsAtom";const selectedBlockFlexChildAtom=jotai.atom(()=>!1);selectedBlockFlexChildAtom.debugLabel="selectedBlockFlexChildAtom";const selectedBlockGridChildAtom=jotai.atom(()=>!1);selectedBlockGridChildAtom.debugLabel="selectedBlockGridChildAtom";const styleStateAtom=jotai.atom("");styleStateAtom.debugLabel="styleStateAtom";const styleBreakpointAtom=atomWithStorage("styleBreakpoint","xs");styleBreakpointAtom.debugLabel="styleBreakpointAtom";const useSelectedBlocksDisplayChild=()=>({flexChild:jotai.useAtomValue(selectedBlockFlexChildAtom),gridChild:jotai.useAtomValue(selectedBlockGridChildAtom)}),useSelectedBlock=()=>jotai.useAtomValue(selectedBlockAtom),selectedBlockHierarchy=jotai.atom(r=>{const h=r(selectedBlockAtom),x=r(presentBlocksAtom);let g=h;const v=[h];do{const R=x.find(({_id:A})=>A===(g==null?void 0:g._parent));g=R,R&&v.push(R)}while(g!=null&&g._parent);return v}),useSelectedBlockHierarchy=()=>lodashEs.compact(jotai.useAtomValue(selectedBlockHierarchy)),useSelectedBlockIds=()=>{const[r,h]=jotai.useAtom(selectedBlockIdsAtom),x=React.useCallback(g=>{h(v=>lodashEs.includes(v,g)?lodashEs.without(v,g):[...v,g])},[h]);return[r,h,x]};var undomanager={exports:{}},hasRequiredUndomanager;function requireUndomanager(){return hasRequiredUndomanager||(hasRequiredUndomanager=1,function(r){(function(){function h(g,v,R){return g.splice(v,!R||1+R-v+(!(R<0^v>=0)&&(R<0||-1)*g.length)),g.length}let x=function(){let g=[],v=-1,R=0,A=!1,j;function C(T,M){return!T||typeof T[M]!="function"?this:(A=!0,T[M](),A=!1,this)}return{add:function(T){return A?this:(g.splice(v+1,g.length-v),g.push(T),R&&g.length>R&&h(g,0,-(R+1)),v=g.length-1,j&&j(),this)},setCallback:function(T){j=T},undo:function(){let T=g[v];if(!T)return this;const M=T.groupId;for(;T.groupId===M&&(C(T,"undo"),v-=1,T=g[v],!(!T||!T.groupId)););return j&&j(),this},redo:function(){let T=g[v+1];if(!T)return this;const M=T.groupId;for(;T.groupId===M&&(C(T,"redo"),v+=1,T=g[v+1],!(!T||!T.groupId)););return j&&j(),this},clear:function(){let T=g.length;g=[],v=-1,j&&T>0&&j()},hasUndo:function(){return v!==-1},hasRedo:function(){return v<g.length-1},getCommands:function(T){return T?g.filter(M=>M.groupId===T):g},getIndex:function(){return v},setLimit:function(T){R=T}}};r.exports?r.exports=x:window.UndoManager=x})()}(undomanager)),undomanager.exports}var undomanagerExports=requireUndomanager();const UndoManager=ChaiThemeFn.getDefaultExportFromCjs(undomanagerExports),MODIFIERS=["hover","focus","focus-within","focus-visible","active","visited","target","first","last","only","odd","even","first-of-type","last-of-type","only-of-type","empty","disabled","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","open","before","after","first-letter","first-line","marker","selection","file","placeholder","hs-collapse-open","hs-accordion-active"],BRANDING_OPTIONS_DEFAULTS={bodyFont:"Inter",headingFont:"Inter",roundedCorners:5,primaryColor:"#570df8",secondaryColor:"#f002b8",bodyBgDarkColor:"#031022",bodyBgLightColor:"#fcfcfc",bodyTextDarkColor:"#ffffff",bodyTextLightColor:"#000000"},brandingOptionsAtom=jotai.atom(BRANDING_OPTIONS_DEFAULTS);jotai.atom(null);const useBrandingOptions=()=>{const[r,h]=jotai.useAtom(brandingOptionsAtom);return[lodashEs.isObject(r)?{...BRANDING_OPTIONS_DEFAULTS,...r}:BRANDING_OPTIONS_DEFAULTS,h]},currentPageAtom=jotai.atom(null),useCurrentPage=()=>({currentPage:jotai.useAtomValue(currentPageAtom)});function getBlocksTree(r){return convertToBlocksTree(r)}const nestedToFlatArray=(r,h)=>lodashEs.flatten(r.map(x=>{if(x=h?{...x,_parent:h}:{...x},x.children){const g=[...x.children];return delete x.children,lodashEs.flatten([x,...nestedToFlatArray(g,x._id)])}return x}));function setProjectBlocksInMemory(r,h=!1){for(let x=0;x<r.length;x++){const g=r[x];g.global&&!h?r[x]={type:"GlobalBlock",blockId:g.blockId,_parent:lodashEs.get(g,"_parent",null),_id:g._id}:g.children&&g.children.length&&setProjectBlocksInMemory(g.children)}}function getInnerBlocks(r){let h=[],x=lodashEs.filter(r,{type:"GlobalBlock"});return x.length>0&&(x=lodashEs.map(x,getPBlocks),lodashEs.each(x,g=>{h=[...h,...getSingleBlock(g)]})),h}function getSingleBlock(r){let h=[];const x=lodashEs.get(lodashEs.first(r),"_parent",null);lodashEs.set(lodashEs.first(r),"_parent",null);const g=[flatToNestedInstance.convert(clone(r))];setProjectBlocksInMemory(g,!0);let v=nestedToFlatArray(g,r[0]._id);return v=lodashEs.set(v,"0._parent",x),h=[...h,v,...getInnerBlocks(v)],h}function getPBlocks(r){const h=lodashEs.find(FLAT_ARRAY,{_id:r._id});if(!h)return[];const x=[h],g=lodashEs.filter(FLAT_ARRAY,{_parent:r._id});return g.length?lodashEs.flatten([...x,...lodashEs.flatten(lodashEs.map(g,getPBlocks))]):lodashEs.flatten(x)}const clone=r=>JSON.parse(JSON.stringify(r));let FLAT_ARRAY=[];function splitPageBlocks(r){FLAT_ARRAY=r;const h=getBlocksTree(clone(r));setProjectBlocksInMemory(h);const x=nestedToFlatArray(h,null),g=getInnerBlocks(x),v={};return lodashEs.each(g,R=>lodashEs.set(v,lodashEs.first(R).blockId,R)),[x,v]}const useGetPageData=()=>{const[r]=useBrandingOptions(),{currentPage:h}=useCurrentPage(),[x]=useBlocksStore();return React.useCallback(()=>{const g=lodashEs.map(x,R=>lodashEs.omit(R,["expanded","order","title","siblings","tempClasses"])),[v=[]]=splitPageBlocks(g);return{currentPage:h,blocks:v}},[r,h,x])},chaiBuilderPropsAtom=jotai.atom(null);chaiBuilderPropsAtom.debugLabel="chaiBuilderPropsAtom";const chaiExternalDataAtom=jotai.atom({});chaiExternalDataAtom.debugLabel="chaiExternalDataAtom";const useBuilderProp=(r,h=void 0)=>{const x=jotai.useAtomValue(chaiBuilderPropsAtom);return lodashEs.get(x,r,h)},getDefaultThemeValues=(r=ChaiThemeFn.defaultThemeOptions)=>{const h={};return r.fontFamily&&(h.fontFamily=Object.entries(r.fontFamily).reduce((x,[g,v])=>({...x,[g.replace("font-","")]:v}),{})),h.borderRadius=r.borderRadius,r.colors&&(h.colors=r.colors.reduce((x,g)=>(Object.entries(g.items).forEach(([v,R])=>{x[v]=R}),x),{})),h},chaiThemeValuesAtom=jotai.atom({}),useTheme=()=>{const r=useThemeOptions(),h=React.useMemo(()=>getDefaultThemeValues(r),[r]),x=useBuilderProp("theme",{}),[g,v]=jotai.useAtom(chaiThemeValuesAtom);return[{...h,...!lodashEs.isEmpty(x)&&x,...!lodashEs.isEmpty(g)&&g},v]},useThemeOptions=()=>{const r=useBuilderProp("themeOptions",x=>x);return React.useMemo(()=>r(ChaiThemeFn.defaultThemeOptions),[r])},rightPanelAtom=jotai.atom("block"),useRightPanel=()=>jotai.useAtom(rightPanelAtom),builderSaveStateAtom=jotai.atom("SAVED");builderSaveStateAtom.debugLabel="builderSaveStateAtom";const useSavePage=()=>{const[r,h]=jotai.useAtom(builderSaveStateAtom),x=useBuilderProp("onSave",async j=>{}),g=useBuilderProp("onSaveStateChange",lodashEs.noop),v=useGetPageData(),[R]=useTheme();return{savePage:web.useThrottledCallback(async(j=!1)=>{h("SAVING"),g("SAVING");const C=v();return await x({autoSave:j,blocks:C.blocks,theme:R}),setTimeout(()=>{h("SAVED"),g("SAVED")},100),!0},[v,h,R,x,g],3e3),saveState:r,setSaveState:h}},undoManager=new UndoManager;undoManager.setLimit(50);const useUndoManager=()=>{const[,r]=jotai.useAtom(builderSaveStateAtom),h=useBuilderProp("onSaveStateChange",lodashEs.noop);return React.useEffect(()=>(undoManager.setCallback(()=>{r("UNSAVED"),h("UNSAVED")}),()=>{undoManager.setCallback(lodashEs.noop)}),[]),{add:undoManager.add,undo:undoManager.undo,redo:undoManager.redo,hasRedo:undoManager.hasRedo,hasUndo:undoManager.hasUndo,clear:undoManager.clear}},broadcastChannel=new BroadcastChannel("chaibuilder"),useBroadcastChannel=()=>{const r=useBuilderProp("pageId","chaibuilder_page");return{postMessage:web.useDebouncedCallback(x=>broadcastChannel.postMessage({...x,pageId:r}),[r],200)}},useUnmountBroadcastChannel=()=>{const[,r]=useBlocksStore(),h=useBuilderProp("pageId","chaibuilder_page");React.useEffect(()=>(broadcastChannel.onmessageerror=x=>{console.log("error",x)},broadcastChannel.onmessage=x=>{x.data.type==="blocks-updated"&&x.data.pageId===h&&r(x.data.blocks)},()=>{broadcastChannel.onmessage=null,broadcastChannel.onmessageerror=null}),[r,h])},removeNestedBlocks=(r,h)=>{const x=[],g=lodashEs.filter(r,v=>lodashEs.includes(h,v._id)||lodashEs.includes(h,v._parent)?(x.push(v._id),!1):!0);return lodashEs.isEmpty(x)?g:removeNestedBlocks(g,x)},useRemoveBlocks=()=>{const[r]=useBlocksStore(),[h,x]=useSelectedBlockIds(),{setNewBlocks:g}=useBlocksStoreUndoableActions();return React.useCallback(v=>{var A;const R=((A=lodashEs.find(r,{_id:v[0]}))==null?void 0:A._parent)||null;g(removeNestedBlocks(r,v)),setTimeout(()=>x(R?[R]:[]),200)},[r,x,h])};function insertBlocksAtPosition(r,h,x,g){let v=r.filter(j=>!j._parent);x&&(v=r.filter(j=>j._parent===x));const R=!isNaN(g)||g>-1?Math.min(g,v.length):v.length;let A=r.length;for(let j=0,C=0;j<r.length;j++)if(r[j]._parent===x){if(C===R){A=j;break}C++}return!x&&g!==void 0&&g>=v.length&&(A=r.length),[...r.slice(0,A),...h,...r.slice(A)]}function flattenTree(r){let h=[];return r.walk(x=>(delete x.model.children,h.push(x.model),!0)),h}function findNodeById(r,h){return r.first(x=>x.model._id===h)||null}function moveNode(r,h,x,g){const v=findNodeById(r,h),R=findNodeById(r,x);if(v&&R){v.drop(),R.children||(R.model.children=[]);try{R.addChildAtIndex(v,g)}catch(A){return console.error("Error adding child to parent:",A),!1}return!0}return!1}function moveBlocksWithChildren(r,h,x,g){if(!h)return r;x=x||"root";const R=new TreeModel().parse({_id:"root",children:getBlocksTree(r)});if(moveNode(R,h,x,g)){const A=flattenTree(R),j=A.find(C=>C._id===h);return j&&(j._parent=x==="root"?null:x),A.shift(),A}return r}const useBlocksStoreManager=()=>{const[,r]=useBlocksStore(),{postMessage:h}=useBroadcastChannel();return{setNewBlocks:x=>{r(x),h({type:"blocks-updated",blocks:x})},addBlocks:(x,g,v)=>{r(R=>{const A=insertBlocksAtPosition(R,x,g,v);return h({type:"blocks-updated",blocks:A}),A})},removeBlocks:x=>{r(g=>{const v=removeNestedBlocks(g,x);return h({type:"blocks-updated",blocks:v}),v})},moveBlocks:(x,g,v)=>{r(R=>{let A=R;for(let j=0;j<x.length;j++)A=moveBlocksWithChildren(A,x[j],g,v);return h({type:"blocks-updated",blocks:A}),A})},updateBlocksProps:x=>{r(g=>{const v=x.map(A=>A._id),R=g.map(A=>{if(v.includes(A._id)){const j=lodashEs.find(x,{_id:A._id});return{...A,...lodashEs.omit(j,"_id")}}return A});return h({type:"blocks-updated",blocks:R}),R})}}},useBlocksStore=()=>jotai.useAtom(presentBlocksAtom),useBlocksStoreUndoableActions=()=>{const{add:r}=useUndoManager(),[h]=useBlocksStore(),{setNewBlocks:x,addBlocks:g,removeBlocks:v,moveBlocks:R,updateBlocksProps:A}=useBlocksStoreManager();return{moveBlocks:(q,Y,P)=>{const he=lodashEs.map(q,ue=>{const se=h.find(Me=>Me._id===ue)._parent||null,ve=h.filter(Me=>se?Me._parent===se:!Me._parent).map(Me=>Me._id).indexOf(ue);return{_id:ue,oldParent:se,oldPosition:ve}}),te=he.find(({_id:ue})=>ue===q[0]);te&&te.oldParent===Y&&te.oldPosition===P||(R(q,Y,P),r({undo:()=>lodashEs.each(he,({_id:ue,oldParent:X,oldPosition:se})=>{R([ue],X,se)}),redo:()=>R(q,Y,P)}))},addBlocks:(q,Y,P)=>{g(q,Y,P),r({undo:()=>v(lodashEs.map(q,"_id")),redo:()=>g(q,Y,P)})},removeBlocks:q=>{var te;const Y=(te=lodashEs.first(q))==null?void 0:te._parent,he=h.filter(ue=>Y?ue._parent===Y:!ue._parent).indexOf(lodashEs.first(q));v(lodashEs.map(q,"_id")),r({undo:()=>g(q,Y,he),redo:()=>v(lodashEs.map(q,"_id"))})},updateBlocks:(q,Y,P)=>{let he=[];if(P)he=lodashEs.map(q,te=>({_id:te,...P}));else{const te=lodashEs.keys(Y);he=lodashEs.map(q,ue=>{const X=h.find(pe=>pe._id===ue),se={_id:ue};return lodashEs.each(te,pe=>se[pe]=X[pe]),se})}A(lodashEs.map(q,te=>({_id:te,...Y}))),r({undo:()=>A(he),redo:()=>A(lodashEs.map(q,te=>({_id:te,...Y})))})},updateBlocksRuntime:(q,Y)=>{A(lodashEs.map(q,P=>({_id:P,...Y})))},setNewBlocks:q=>{x(q),r({undo:()=>x(h),redo:()=>x(q)})},updateMultipleBlocksProps:q=>{let Y=[];Y=lodashEs.map(q,P=>{const he=lodashEs.keys(P),te=h.find(X=>X._id===P._id),ue={};return lodashEs.each(he,X=>ue[X]=te[X]),ue}),A(q),r({undo:()=>A(Y),redo:()=>A(q)})}}},useAddBlock=()=>{const[r]=useBlocksStore(),[,h]=useSelectedBlockIds(),{addBlocks:x}=useBlocksStoreUndoableActions(),g=React.useCallback((R,A,j)=>{var z;for(let Z=0;Z<R.length;Z++){const{_id:q}=R[Z];R[Z]._id=iconBase.generateUUID();const Y=lodashEs.filter(R,{_parent:q});for(let P=0;P<Y.length;P++)Y[P]._parent=R[Z]._id}const C=lodashEs.first(R);let T,M;return A&&(T=lodashEs.find(r,{_id:A}),R[0]._parent=A,M=A),!(T?canAcceptChildBlock(T==null?void 0:T._type,C._type):!0)&&T&&(R[0]._parent=T._parent,M=T._parent),x(R,M,j),h([(z=lodashEs.first(R))==null?void 0:z._id]),lodashEs.first(R)},[x,r,h]);return{addCoreBlock:React.useCallback((R,A,j)=>{if(lodashEs.has(R,"blocks")){const Y=R.blocks;return g(Y,A,j)}const C=iconBase.generateUUID(),T=runtime.getDefaultBlockProps(R.type),M={_type:R.type,_id:C,...T};let O,z;return A&&(O=lodashEs.find(r,{_id:A}),M._parent=A,z=A),!canAcceptChildBlock(O==null?void 0:O._type,M._type)&&O&&(M._parent=O._parent,z=O._parent),x([M],z,j),h([M._id]),M},[x,g,r,h]),addPredefinedBlock:g}},STANDARD=[0,1,2,3,4,5,6,7,8,9,10,11,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96],CLASS_VALUES={columns:[...lodashEs.range(1,13),"auto","3xs","2xs","xs","sm","md","lg","xl",...lodashEs.map(lodashEs.range(2,8),r=>`${r}xl`)],breakAfter:["auto","avoid","all","avoid-page","page","left","right","column"],breakInside:["auto","avoid","avoid-page","avoid-column"],display:["block","flex","grid","inline-block","inline","hidden"],objectFit:["contain","cover","fill","none","scale-down"],objectPosition:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],overflow:["auto","hidden","clip","visible","scroll"],overscroll:["auto","contain","none"],trbl:[0,"px","0.5",1,1.5,2,2.5,3,3.5,...lodashEs.range(4,13),14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,"auto","1/2","1/3","2/3","1/4","2/4","3/4","full"],flexBasis:[...STANDARD,"auto","px","0.5","1.5","2.5","3.5","1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12","full"],padding:[...STANDARD,"px","0.5","1.5","2.5","3.5"],margin:["auto",...STANDARD,"px","0.5","1.5","2.5","3.5"],scale:[0,50,75,90,95,100,105,110,125,150],origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],blendEffect:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],borderWidth:[0,2,4,8],borderRadius:["global","none","sm","md","lg","xl","2xl","3xl","full"],indent:[0,"px","0.5",1,1.5,2,2.5,3,3.5,...lodashEs.range(4,13),14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96],maxHeight:[0,"px","0.5",1,1.5,2,2.5,3,3.5,...lodashEs.range(4,13),14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,"full","screen","min","max","fit"],space:[0,"px","0.5",1,1.5,2,2.5,3,3.5,...lodashEs.range(4,13),14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,"px","reverse"],width:["0","px","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96","auto","1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],maxWidth:["0","none","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","full","min","max","fit","prose","screen-sm","screen-md","screen-lg","screen-xl","screen-2xl"],height:["0","px","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96","auto","1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","full","screen","min","max","fit"]},CLASSES_LIST={textColor:{classes:[],regExp:"text-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},aspectRatio:{classes:["aspect-auto","aspect-square","aspect-video"],regExp:"aspect-(auto|square|video)"},container:{classes:["container"],regExp:"container"},columns:{classes:lodashEs.map(CLASS_VALUES.columns,r=>`columns-${r}`),regExp:"columns-(auto|[0-9]xl|[0-9]xs|xs|sm|md|lg|xl|\\d+)"},breakAfter:{classes:lodashEs.map(CLASS_VALUES.breakAfter,r=>`break-after-${r}`),regExp:"break-after-\\S+"},breakBefore:{classes:lodashEs.map(CLASS_VALUES.breakAfter,r=>`break-before-${r}`),regExp:"break-before-\\S+"},breakInside:{classes:lodashEs.map(CLASS_VALUES.breakInside,r=>`break-inside-${r}`),regExp:"break-inside-\\S+"},boxDecoration:{classes:["box-decoration-clone","box-decoration-slice"],regExp:"box-decoration-\\S+"},boxSizing:{classes:["box-border","box-content"],regExp:"box-(border|content)"},flexDirection:{classes:["flex-row","flex-row-reverse","flex-col","flex-col-reverse"],regExp:"flex-(row|row-reverse|col|col-reverse)"},flexWrap:{classes:["flex-wrap","flex-wrap-reverse","flex-nowrap"],regExp:"flex-(wrap|wrap-reverse|nowrap)"},flexGrowShrink:{classes:["flex-1","flex-auto","flex-initial","flex-none"],regExp:"flex-1|flex-auto|flex-initial|flex-none"},gridColumns:{classes:lodashEs.map([...lodashEs.range(0,13),"none"],r=>`grid-cols-${r}`),regExp:"grid-cols-(\\d+|none)"},gridFlow:{classes:["grid-flow-row","grid-flow-col","grid-flow-row-dense","grid-flow-col-dense"],regExp:"grid-flow-(row|col|row-dense|col-dense)"},outlineStyle:{classes:lodashEs.map(["none","dashed","dotted","double","hidden"],r=>`outline-${r}`),regExp:"outline-(none|dashed|dotted|double|hidden)"},borderStyle:{classes:lodashEs.map(["solid","dashed","dotted","double","hidden","none"],r=>`border-${r}`),regExp:"border-(solid|dashed|dotted|double|hidden|none)"},overflow:{classes:lodashEs.map(CLASS_VALUES.overflow,r=>`overflow-${r}`),regExp:`overflow-(${CLASS_VALUES.overflow.join("|")})`},overflowX:{classes:lodashEs.map(CLASS_VALUES.overflow,r=>`overflow-x-${r}`),regExp:`overflow-x-(${CLASS_VALUES.overflow.join("|")})`},overflowY:{classes:lodashEs.map(CLASS_VALUES.overflow,r=>`overflow-y-${r}`),regExp:`overflow-y-(${CLASS_VALUES.overflow.join("|")})`},gridRows:{classes:lodashEs.map([1,2,3,4,5,6,"none"],r=>`grid-rows-${r}`),regExp:"grid-rows-(\\d|none)"},display:{classes:lodashEs.map(CLASS_VALUES.display,r=>r.toString()),regExp:`(${CLASS_VALUES.display.join("|")})`},float:{classes:["float-right","float-left","float-none"],regExp:"float-\\S+"},clear:{classes:["clear-right","clear-left","clear-none","clear-both"],regExp:"clear-\\S+"},isolation:{classes:["isolate","isolation-auto"],regExp:"isolate|isolation-auto"},objectFit:{classes:lodashEs.map(CLASS_VALUES.objectFit,r=>`object-${r}`),regExp:"object-(contain|cover|fill|none|scale-down)"},objectPosition:{classes:lodashEs.map(CLASS_VALUES.objectPosition,r=>`object-${r}`),regExp:`object-(${CLASS_VALUES.objectPosition.join("|")})`},overscroll:{classes:lodashEs.map(CLASS_VALUES.overscroll,r=>`overscroll-${r}`),regExp:`overscroll-(${CLASS_VALUES.overscroll.join("|")})`},overscrollX:{classes:lodashEs.map(CLASS_VALUES.overscroll,r=>`overscroll-x-${r}`),regExp:`overscroll-x-(${CLASS_VALUES.overscroll.join("|")})`},overscrollY:{classes:lodashEs.map(CLASS_VALUES.overscroll,r=>`overscroll-y-${r}`),regExp:`overscroll-y-(${CLASS_VALUES.overscroll.join("|")})`},inset:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`inset-${r}`),regExp:"-?inset-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},insetX:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`inset-x-${r}`),regExp:"-?inset-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},insetY:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`inset-y-${r}`),regExp:"-?inset-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},top:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`top-${r}`),regExp:"-?top-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},topX:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`top-x-${r}`),regExp:"-?top-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},topY:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`top-y-${r}`),regExp:"-?top-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},right:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`right-${r}`),regExp:"-?right-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},rightX:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`right-x-${r}`),regExp:"-?right-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},rightY:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`right-y-${r}`),regExp:"-?right-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},bottom:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`bottom-${r}`),regExp:"-?bottom-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},bottomX:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`bottom-x-${r}`),regExp:"-?bottom-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},bottomY:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`bottom-y-${r}`),regExp:"-?bottom-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},left:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`left-${r}`),regExp:"-?left-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},leftX:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`left-x-${r}`),regExp:"-?left-x-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},leftY:{classes:lodashEs.map(CLASS_VALUES.trbl,r=>`left-y-${r}`),regExp:"-?left-y-(px|\\d\\/\\d|\\d\\.\\d|\\d+|full|auto|\\[.*\\])"},visibility:{classes:["visible","invisible"],regExp:"invisible|visible"},zIndex:{classes:lodashEs.map(["0",10,20,30,40,50,"auto"],r=>`z-${r}`),regExp:"-?z-(\\d+|auto|\\[.*\\])"},flexBasis:{classes:lodashEs.map(CLASS_VALUES.flexBasis,r=>`basis-${r}`),regExp:"basis-(\\d+|\\S+)"},flexGrow:{classes:["grow","grow-0"],regExp:"grow(-0)?"},flexShrink:{classes:["shrink","shrink-0"],regExp:"shrink(-0)?"},gridColSpan:{classes:["col-auto",...lodashEs.map(lodashEs.range(1,13),r=>`col-span-${r}`),"col-span-full"],regExp:"col-(auto|span-(\\d+|full))"},gridColStart:{classes:[...lodashEs.map(lodashEs.range(1,14),r=>`col-start-${r}`),"col-start-auto"],regExp:"col-start-(\\d+|auto)"},gridColEnd:{classes:[...lodashEs.map(lodashEs.range(1,14),r=>`col-end-${r}`),"col-end-auto"],regExp:"col-end-(\\d+|auto)"},gridRowSpan:{classes:["row-auto",...lodashEs.map(lodashEs.range(1,7),r=>`row-span-${r}`),"row-span-full"],regExp:"row-(auto|span-(\\d+|full))"},gridRowStart:{classes:[...lodashEs.map(lodashEs.range(1,8),r=>`row-start-${r}`),"row-start-auto"],regExp:"row-start-(\\d+|auto)"},gridRowEnd:{classes:[...lodashEs.map(lodashEs.range(1,8),r=>`row-end-${r}`),"row-end-auto"],regExp:"row-end-(\\d+|auto)"},gridAutoColumns:{classes:["auto-cols-auto","auto-cols-min","auto-cols-max","auto-cols-fr"],regExp:"auto-cols-(auto|min|max|fr)"},gridAutoRows:{classes:["auto-rows-auto","auto-rows-min","auto-rows-max","auto-rows-fr"],regExp:"auto-rows-(auto|min|max|fr)"},gap:{classes:lodashEs.map(CLASS_VALUES.indent,r=>`gap-${r}`),regExp:"gap-(px|\\d.\\d|\\d|\\[.*\\])"},gapX:{classes:lodashEs.map(CLASS_VALUES.indent,r=>`gap-x-${r}`),regExp:"gap-x-(px|\\d.\\d|\\d|\\[.*\\])"},gapY:{classes:lodashEs.map(CLASS_VALUES.indent,r=>`gap-y-${r}`),regExp:"gap-y-(px|\\d.\\d|\\d|\\[.*\\])"},justifyContent:{classes:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"],regExp:"justify-(start|end|center|between|around|evenly)"},justifyItems:{classes:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"],regExp:"justify-items-(start|end|center|stretch)"},justifySelf:{classes:["justify-self-auto","justify-self-start","justify-self-end","justify-self-center","justify-self-stretch"],regExp:"justify-self-(auto|start|end|center|stretch)"},placeContent:{classes:["place-content-center","place-content-start","place-content-end","place-content-between","place-content-around","place-content-evenly","place-content-stretch"],regExp:"place-content-(center|start|end|between|around|evenly|stretch)"},placeItems:{classes:["place-items-start","place-items-end","place-items-center","place-items-stretch"],regExp:"place-items-(start|end|center|stretch)"},placeSelf:{classes:["place-self-auto","place-self-start","place-self-end","place-self-center","place-self-stretch"],regExp:"place-self-(auto|start|end|center|stretch)"},alignContent:{classes:["content-center","content-start","content-end","content-between","content-around","content-evenly"],regExp:"content-(center|start|end|between|around|evenly)"},alignItems:{classes:["items-start","items-end","items-center","items-baseline","items-stretch"],regExp:"items-(start|end|center|baseline|stretch)"},alignSelf:{classes:["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"],regExp:"self-(auto|start|end|center|stretch|baseline)"},backgroundClip:{classes:["bg-clip-border","bg-clip-padding","bg-clip-content","bg-clip-text"],regExp:"bg-clip-(border|padding|content|text)"},dropShadow:{classes:lodashEs.map(["sm","md","lg","xl","2xl","none"],r=>`drop-shadow-${r}`),regExp:"drop-shadow-(sm|md|lg|xl|2xl|none)"},backdropBlur:{classes:lodashEs.map(["none","sm","md","lg","xl","2xl","3xl"],r=>`backdrop-blur-${r}`),regExp:"backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)"},backdropBrightness:{classes:lodashEs.map([0,50,75,90,95,100,105,110,125,150,200],r=>`backdrop-brightness-${r}`),regExp:"backdrop-brightness-(\\d+)"},backdropContrast:{classes:lodashEs.map([0,50,75,100,125,150,200],r=>`backdrop-contrast-${r}`),regExp:"backdrop-contrast-(\\d+)"},backdropGrayScale:{classes:["backdrop-grayscale-0","backdrop-grayscale"],regExp:"backdrop-grayscale(-0)?"},backdropHueRotate:{classes:lodashEs.map([0,15,30,60,90,180],r=>`backdrop-hue-rotate-${r}`),regExp:"-?backdrop-hue-rotate-(\\d+)"},backdropInvert:{classes:["backdrop-invert-0","backdrop-invert"],regExp:"backdrop-invert(-0)?"},backdropOpacity:{classes:lodashEs.map([0,5,10,20,25,30,40,50,60,70,75,80,90,95,100],r=>`backdrop-opacity-${r}`),regExp:"backdrop-opacity-(\\d+)"},backdropSaturate:{classes:lodashEs.map([0,50,100,150,200],r=>`backdrop-saturate-${r}`),regExp:"backdrop-saturate-(\\d+)"},backdropSepia:{classes:["backdrop-sepia-0, backdrop-sepia"],regExp:"backdrop-sepia(-0)?"},backgroundOrigin:{classes:["bg-origin-border","bg-origin-padding","bg-origin-content"],regExp:"bg-origin-(border|padding|content)"},transformOrigin:{classes:lodashEs.map(CLASS_VALUES.origin,r=>`origin-${r}`),regExp:"origin-(\\d+|\\S+)"},padding:{classes:lodashEs.map(CLASS_VALUES.padding,r=>`p-${r}`),regExp:"p-(\\d+|\\S+|\\[.*\\])"},paddingX:{classes:lodashEs.map(CLASS_VALUES.padding,r=>`px-${r}`),regExp:"px-(\\d+|\\S+|\\[.*\\])"},paddingY:{classes:lodashEs.map(CLASS_VALUES.padding,r=>`py-${r}`),regExp:"py-(\\d+|\\S+|\\[.*\\])"},paddingTop:{classes:lodashEs.map(CLASS_VALUES.padding,r=>`pt-${r}`),regExp:"pt-(\\d+|\\S+|\\[.*\\])"},paddingRight:{classes:lodashEs.map(CLASS_VALUES.padding,r=>`pr-${r}`),regExp:"pr-(\\d+|\\S+|\\[.*\\])"},paddingBottom:{classes:lodashEs.map(CLASS_VALUES.padding,r=>`pb-${r}`),regExp:"pb-(\\d+|\\S+|\\[.*\\])"},paddingLeft:{classes:lodashEs.map(CLASS_VALUES.padding,r=>`pl-${r}`),regExp:"pl-(\\d+|\\S+|\\[.*\\])"},textDecorationStyle:{classes:["decoration-solid","decoration-double","decoration-dotted","decoration-dashed","decoration-wavy"],regExp:"decoration-(solid|double|dotted|dashed|wavy)"},textDecorationThickness:{classes:lodashEs.map(["auto","from-font","0",1,2,4,8],r=>`decoration-${r}`),regExp:"decoration-(auto|from-font|\\d+|\\S+)"},fromColor:{classes:[],regExp:"from-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},margin:{classes:lodashEs.map(CLASS_VALUES.margin,r=>`m-${r}`),regExp:"-?m-(\\d+|\\S+|\\[.*\\])"},marginX:{classes:lodashEs.map(CLASS_VALUES.margin,r=>`mx-${r}`),regExp:"-?mx-(\\d+|\\S+|\\[.*\\])"},marginY:{classes:lodashEs.map(CLASS_VALUES.margin,r=>`my-${r}`),regExp:"-?my-(\\d+|\\S+|\\[.*\\])"},marginTop:{classes:lodashEs.map(CLASS_VALUES.margin,r=>`mt-${r}`),regExp:"-?mt-(\\d+|\\S+|\\[.*\\])"},marginRight:{classes:lodashEs.map(CLASS_VALUES.margin,r=>`mr-${r}`),regExp:"-?mr-(\\d+|\\S+|\\[.*\\])"},marginBottom:{classes:lodashEs.map(CLASS_VALUES.margin,r=>`mb-${r}`),regExp:"-?mb-(\\d+|\\S+|\\[.*\\])"},marginLeft:{classes:lodashEs.map(CLASS_VALUES.margin,r=>`ml-${r}`),regExp:"-?ml-(\\d+|\\S+|\\[.*\\])"},spaceX:{classes:lodashEs.map(CLASS_VALUES.space,r=>`space-x-${r}`),regExp:"-?space-x-(\\d+|\\S+|\\[.*\\])"},spaceY:{classes:lodashEs.map(CLASS_VALUES.space,r=>`space-y-${r}`),regExp:"-?space-y-(\\d+|\\S+|\\[.*\\])"},boxShadow:{classes:lodashEs.map(["sm","md","lg","xl","2xl","inner","none"],r=>`shadow-${r}`),regExp:"shadow-(sm|md|lg|xl|2xl|inner|none)"},minWidth:{classes:["min-w-0","min-w-full","min-w-min","min-w-max","min-w-fit"],regExp:"min-w-(\\d+|\\S+|\\[.*\\])"},maxWidth:{classes:lodashEs.map(CLASS_VALUES.maxWidth,r=>`max-w-${r}`),regExp:"max-w-(\\d+|\\S+|\\[.*\\])"},width:{classes:lodashEs.map([...CLASS_VALUES.width,"full","screen","min","max","fit"],r=>`w-${r}`),regExp:"^w-(\\d+.\\d+|\\d+|px|auto|full|screen|min|max|fit|\\[.*\\])$"},minHeight:{classes:["min-h-0","min-h-full","min-h-screen","min-h-min","min-h-max","min-h-fit"],regExp:"min-h-(\\d+|\\S+|\\[.*\\])"},maxHeight:{classes:lodashEs.map(CLASS_VALUES.maxHeight,r=>`max-h-${r}`),regExp:"max-h-(\\d+|\\S+|\\[.*\\])"},height:{classes:lodashEs.map(CLASS_VALUES.height,r=>`h-${r}`),regExp:"h-(\\d+.\\d+|\\d+|px|auto|full|screen|min|max|fit|\\[.*\\])"},fontFamily:{classes:["font-heading","font-body","font-sans","font-serif","font-mono"],regExp:"font-(heading|body|sans|serif|mono)"},textAlign:{classes:["text-left","text-center","text-right","text-justify"],regExp:"text-(left|center|right|justify)"},textOverflow:{classes:["truncate","text-ellipsis","text-clip"],regExp:"truncate|text-ellipsis|text-clip"},verticalAlign:{classes:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"],regExp:"align-(baseline|top|middle|bottom|text-top|text-bottom|sub|super)"},fontSize:{classes:["text-xs","text-sm","text-base","text-lg","text-xl","text-2xl","text-3xl","text-4xl","text-5xl","text-6xl","text-7xl","text-8xl","text-9xl"],regExp:"text-(\\d+|\\S+|\\[.*\\])"},fontSmoothing:{classes:["antialiased","subpixel-antialiased"],regExp:"antialiased|subpixel-antialiased"},fontStyle:{classes:["italic","not-italic"],regExp:"not-italic|italic"},fontWeight:{classes:["font-thin","font-extralight","font-light","font-normal","font-medium","font-semibold","font-bold","font-extrabold","font-black"],regExp:"font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)"},fontVariantNum:{classes:["normal-nums","ordinal","diagonal-fractions","stacked-fractions","tabular-nums","oldstyle-nums","proportional-nums","lining-nums","slashed-zero"],regExp:"normal-nums|ordinal|diagonal-fractions|stacked-fractions|tabular-nums|oldstyle-nums|proportional-nums|lining-nums|slashed-zero"},letterSpacing:{classes:["tracking-tighter","tracking-tight","tracking-normal","tracking-wide","tracking-wider","tracking-widest"],regExp:"-?tracking-(tighter|tight|normal|wide|wider|widest|\\[.*\\])"},lineHeight:{classes:["leading-none","leading-tight","leading-snug","leading-normal","leading-relaxed","leading-loose","leading-3","leading-4","leading-5","leading-6","leading-7","leading-8","leading-9","leading-10"],regExp:"leading-(none|tight|snug|normal|relaxed|loose|\\[.*\\]|\\d+)"},listStyleType:{classes:["list-none","list-disc","list-decimal"],regExp:"list-(none|disc|decimal)"},listStylePosition:{classes:["list-inside","list-outside"],regExp:"list-(inside|outside)"},textUnderlineOffset:{classes:["underline-offset-auto","underline-offset-0","underline-offset-1","underline-offset-2","underline-offset-4","underline-offset-8"],regExp:"underline-offset-(auto|\\d+|\\S+)"},textDecoration:{classes:["underline","overline","line-through","no-underline"],regExp:"underline|overline|line-through|no-underline"},textDecorationColor:{classes:[],regExp:"decoration-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},textTransform:{classes:["uppercase","lowercase","capitalize","normal-case"],regExp:"uppercase|lowercase|capitalize|normal-case"},textIndent:{classes:lodashEs.map(CLASS_VALUES.indent,r=>`indent-${r}`),regExp:"-?indent-(\\d+|\\S+)"},whitespace:{classes:["whitespace-normal","whitespace-no-wrap","whitespace-pre","whitespace-pre-line","whitespace-pre-wrap"],regExp:"whitespace-(normal|no-wrap|pre|pre-line|pre-wrap)"},wordBreak:{classes:["break-normal","break-words","break-all"],regExp:"break-(normal|words|all)"},content:{classes:["content-none"],regExp:"content-none"},backgroundAttachment:{classes:lodashEs.map(["fixed","local","scroll"],r=>`bg-${r}`),regExp:"bg-(fixed|local|scroll)"},backgroundColor:{classes:[],regExp:"bg-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},backgroundPosition:{classes:["bg-bottom","bg-center","bg-left","bg-left-bottom","bg-left-top","bg-right","bg-right-bottom","bg-right-top","bg-top"],regExp:"bg-(bottom|center|left|left-bottom|left-top|right|right-bottom|right-top|top)"},backgroundRepeat:{classes:["bg-repeat","bg-repeat-x","bg-repeat-y","bg-no-repeat","bg-repeat-round","bg-repeat-space"],regExp:"bg-(repeat|repeat-x|repeat-y|no-repeat|repeat-round|repeat-space)"},backgroundSize:{classes:["bg-auto","bg-cover","bg-contain"],regExp:"bg-(auto|cover|contain)"},backgroundGradient:{classes:["bg-gradient-none","bg-gradient-to-t","bg-gradient-to-tr","bg-gradient-to-r","bg-gradient-to-br","bg-gradient-to-b","bg-gradient-to-bl","bg-gradient-to-l","bg-gradient-to-tl"],regExp:"bg-gradient-(none|to-(t|tr|r|br|b|bl|l|tl))"},viaColor:{classes:[],regExp:"via-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},toColor:{classes:[],regExp:"to-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},position:{classes:["static","fixed","absolute","relative","sticky"],regExp:"(static|fixed|absolute|relative|sticky)"},borderRadiusTopLeft:{classes:["rounded-tl",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-tl-${r}`)],regExp:"rounded-tl-?(\\d+|\\S+)?"},borderRadiusTopRight:{classes:["rounded-tr",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-tr-${r}`)],regExp:"rounded-tr-?(\\d+|\\S+)?"},borderRadiusBottomRight:{classes:["rounded-br",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-br-${r}`)],regExp:"rounded-br-?(\\d+|\\S+)?"},borderRadiusBottomLeft:{classes:["rounded-bl",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-bl-${r}`)],regExp:"rounded-bl-?(\\d+|\\S+)?"},borderRadiusTop:{classes:["rounded-t",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-t-${r}`)],regExp:"rounded-t-?(\\d+|\\S+)?"},borderRadiusRight:{classes:["rounded-r",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-r-${r}`)],regExp:"rounded-r-?(\\d+|\\S+)?"},borderRadiusBottom:{classes:["rounded-b",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-b-${r}`)],regExp:"rounded-b-?(\\d+|\\S+)?"},borderRadiusLeft:{classes:["rounded-l",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-l-${r}`)],regExp:`(rounded-l-(${CLASS_VALUES.borderRadius.join("|")})|rounded-l$)`},borderRadius:{classes:["rounded",...lodashEs.map(CLASS_VALUES.borderRadius,r=>`rounded-${r}`)],regExp:`(rounded-(${CLASS_VALUES.borderRadius.join("|")}$)|rounded)`},borderX:{classes:["border-x",...lodashEs.map(CLASS_VALUES.borderWidth,r=>`border-x-${r}`)],regExp:"border-x-?(\\d+|\\S+|\\[.*\\])?"},borderY:{classes:["border-y",...lodashEs.map(CLASS_VALUES.borderWidth,r=>`border-y-${r}`)],regExp:"border-y-?(\\d+|\\S+|\\[.*\\])?"},borderTop:{classes:["border-t",...lodashEs.map(CLASS_VALUES.borderWidth,r=>`border-t-${r}`)],regExp:"border-t-?(\\d+|\\S+|\\[.*\\])?"},borderRight:{classes:["border-r",...lodashEs.map(CLASS_VALUES.borderWidth,r=>`border-r-${r}`)],regExp:"border-r-?(\\d+|\\S+|\\[.*\\])?"},borderBottom:{classes:["border-b",...lodashEs.map(CLASS_VALUES.borderWidth,r=>`border-b-${r}`)],regExp:"border-b-?(\\d+|\\S+|\\[.*\\])?"},borderLeft:{classes:["border-l",...lodashEs.map(CLASS_VALUES.borderWidth,r=>`border-l-${r}`)],regExp:"border-l-?(\\d+|\\S+|\\[.*\\])?"},borderColor:{classes:[],regExp:"^border-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\w+-\\d+|\\[#[0-9a-fA-F]+\\])$"},border:{classes:["border",...lodashEs.map(CLASS_VALUES.borderWidth,r=>`border-${r}`)],regExp:"^border(-\\d+|\\[\\d+px\\])?$"},order:{classes:lodashEs.map([...lodashEs.range(0,13),"first","last","none"],r=>`order-${r}`),regExp:"-?order-(\\d+|first|last|none)"},divideXWidth:{classes:lodashEs.map(["0",2,4,8],r=>`divide-x-${r}`),regExp:"divide-x-(\\d+|\\[.*\\])"},divideYWidth:{classes:lodashEs.map(["0",2,4,8],r=>`divide-y-${r}`),regExp:"divide-y-(\\d+|\\[.*\\])"},divideColor:{classes:[],regExp:"divide-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},divideStyle:{classes:lodashEs.map(["solid","dashed","dotted","double","none"],r=>`divide-${r}`),regExp:"divide-(solid|dashed|dotted|double|none)"},outlineWidth:{classes:lodashEs.map([0,1,2,4,8],r=>`outline-${r}`),regExp:"outline-(\\d+)"},outlineOffset:{classes:lodashEs.map([0,1,2,4,8],r=>`outline-offset-${r}`),regExp:"outline-offset-(\\d+)"},outlineColor:{classes:[],regExp:"outline-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},ringWidth:{classes:lodashEs.map([0,1,2,4,8,"inset"],r=>`ring-${r}`),regExp:"ring-(\\d+|inset)"},ringOffsetWidth:{classes:lodashEs.map([0,1,2,4,8],r=>`ring-offset-${r}`),regExp:"ring-offset-(\\d+)"},ringOffsetColor:{classes:[],regExp:"ring-offset-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},ringColor:{classes:[],regExp:"ring-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},boxShadowColor:{classes:[],regExp:"shadow-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},opacity:{classes:lodashEs.map([0,5,10,20,25,30,40,50,60,70,75,80,90,95,100],r=>`opacity-${r}`),regExp:"opacity-(\\d+|\\[.*\\])"},mixBlendMode:{classes:lodashEs.map(CLASS_VALUES.blendEffect,r=>`mix-blend-${r}`),regExp:"mix-blend-(\\d+|\\S+)"},bgBlendMode:{classes:lodashEs.map(CLASS_VALUES.blendEffect,r=>`bg-blend-${r}`),regExp:"bg-blend-(\\d+|\\S+)"},blur:{classes:lodashEs.map(["none","sm","md","lg","xl","2xl","3xl"],r=>`blur-${r}`),regExp:"blur-(none|sm|md|lg|xl|2xl|3xl)"},brightness:{classes:lodashEs.map([0,50,75,90,95,100,105,110,125,150,200],r=>`brightness-${r}`),regExp:"brightness-(\\d+)"},contrast:{classes:lodashEs.map([0,50,75,100,125,150,200],r=>`contrast-${r}`),regExp:"contrast-(\\d+)"},grayScale:{classes:["grayscale-0","grayscale"],regExp:"grayscale(-0)?"},hueRotate:{classes:lodashEs.map([0,15,30,60,90,180],r=>`hue-rotate-${r}`),regExp:"-?hue-rotate-(\\d+)"},invert:{classes:["invert-0","invert"],regExp:"invert(-0)?"},saturate:{classes:lodashEs.map([0,50,100,150,200],r=>`saturate-${r}`),regExp:"saturate-(\\d+)"},sepia:{classes:["sepia-0","sepia"],regExp:"sepia(-0)?"},transition:{classes:["transition-none","transition-all","transition-colors","transition-opacity","transition-shadow","transition-transform"],regExp:"transition-(none|all|colors|opacity|shadow|transform)"},duration:{classes:lodashEs.map([75,100,150,200,300,500,700,1e3],r=>`duration-${r}`),regExp:"duration-(\\d+|\\[.*\\])"},transitionEase:{classes:["ease-linear","ease-in","ease-out","ease-in-out"],regExp:"eas(e-linear|e-in|e-out|e-in-out)"},transitionDelay:{classes:lodashEs.map([75,100,150,200,300,500,700,1e3],r=>`delay-${r}`),regExp:"delay-(\\d+|\\[.*\\])"},animation:{classes:["animation-none","animation-spin","animation-ping"],regExp:"animation-(none|spin|ping)"},scaleX:{classes:lodashEs.map(CLASS_VALUES.scale,r=>`scale-x-${r}`),regExp:"-?scale-x-(\\d+|\\S+|\\[.*\\])"},scaleY:{classes:lodashEs.map(CLASS_VALUES.scale,r=>`scale-y-${r}`),regExp:"-?scale-y-(\\d+|\\S+|\\[.*\\])"},scale:{classes:lodashEs.map(CLASS_VALUES.scale,r=>`scale-${r}`),regExp:"-?scale-(\\d+|\\S+|\\[.*\\])"},rotate:{classes:lodashEs.map([0,1,2,3,6,12,45,90,180],r=>`rotate-${r}`),regExp:"-?rotate-(\\d+|\\S+|\\[.*\\])"},translateX:{classes:lodashEs.map([0,"px","0.5",1],r=>`translate-x-${r}`),regExp:"-?translate-x-(\\d+|\\S+|\\[.*\\])"},translateY:{classes:lodashEs.map([0,"px","0.5",1],r=>`translate-y-${r}`),regExp:"-?translate-y-(\\d+|\\S+|\\[.*\\])"},skewX:{classes:lodashEs.map([0,1,2,3,6,12],r=>`skew-x-${r}`),regExp:"-?skew-x-(\\d+|\\S+|\\[.*\\])"},skewY:{classes:lodashEs.map([0,1,2,3,6,12],r=>`skew-y-${r}`),regExp:"-?skew-y-(\\d+|\\S+|\\[.*\\])"},accentColor:{classes:[],regExp:"accent-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},appearance:{classes:["appearance-none"],regExp:"appearance-none"},cursor:{classes:["cursor-auto","cursor-default","cursor-pointer","cursor-wait","cursor-text","cursor-move","cursor-help","cursor-not-allowed"],regExp:"cursor-(auto|default|pointer|wait|text|move|help|not-allowed)"},caretColor:{classes:[],regExp:"caret-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},pointerEvents:{classes:["pointer-events-none","pointer-events-auto"],regExp:"pointer-events-(none|auto)"},userSelect:{classes:["select-none","select-text","select-all","select-auto"],regExp:"select-(none|text|all|auto)"},fill:{classes:[],regExp:"caret-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},stroke:{classes:[],regExp:"caret-(black|transparent|current|white|__THEME_COLORS_REGEXP__|\\S+-\\d+)"},strokeWidth:{classes:["stroke-0","stroke-1","stroke-2"],regExp:"stroke-(\\d+|\\[.*\\])"}},colorOptions={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},soloColors=["current","inherit","transparent","black","white"],shadedColors=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],shades=["50","100","200","300","400","500","600","700","800","900"],colorKeys=lodashEs.map(lodashEs.values(colorOptions),r=>r),ALL_COLORS=lodashEs.flattenDeep([...lodashEs.map(soloColors,r=>lodashEs.flatten(lodashEs.map(colorKeys,h=>`${h}-${r}`))),...lodashEs.map(shadedColors,r=>lodashEs.flattenDeep(lodashEs.map(colorKeys,h=>lodashEs.flattenDeep(lodashEs.map(shades,x=>`${h}-${r}-${x}`)))))]),ALL_TW_CLASSES=lodashEs.map(lodashEs.flattenDeep(lodashEs.values(CLASSES_LIST).map(r=>r.classes).concat(ALL_COLORS)),r=>({name:r})),useFuseSearch=()=>{const r=useThemeOptions(),h=React.useMemo(()=>{let x=[];if(r.colors){const g=lodashEs.flattenDeep(lodashEs.map(r.colors,({items:v})=>lodashEs.keys(v)));x=lodashEs.flattenDeep(lodashEs.map(g,v=>lodashEs.flatten(lodashEs.map(colorKeys,R=>`${R}-${v}`))))}return r.fontFamily&&(x=[...x,...lodashEs.map(lodashEs.keys(r.fontFamily),g=>`${g}`)]),lodashEs.map(x,g=>({name:g}))},[r]);return React.useMemo(()=>new Fuse([...ALL_TW_CLASSES,...h],{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]}),[h])},useTailwindClassList=()=>{const r=useThemeOptions(),h=React.useMemo(()=>{if(r.colors){const v=lodashEs.flattenDeep(lodashEs.map(r.colors,({items:R})=>lodashEs.keys(R)));lodashEs.each(CLASSES_LIST,(R,A)=>{lodashEs.set(CLASSES_LIST,`${A}.regExp`,R.regExp.replace("__THEME_COLORS_REGEXP__",v.join("|")))})}return CLASSES_LIST},[r]),x=React.useCallback((v,R)=>{const A=lodashEs.get(h,`${v}.regExp`,"");return R.match(new RegExp(A))},[h]),g=React.useCallback((v,R=[])=>lodashEs.get(h,`${v}.classes`,R),[h]);return{match:x,getClasses:g}};function getMqForCls(r){if(lodashEs.isEmpty(r.trim()))return"";const h=r.match(/sm:|md:|lg:|xl:|2xl:/g);return lodashEs.get(h,0,"xs").replace(":","")}function getModForCls(r){const h=lodashEs.map(MODIFIERS,g=>`${g}:`).join("|"),x=new RegExp(h,"g");return lodashEs.get(x.exec(r.trim()),0,"").replace(":","")}function getPureClsName(r){return r.trim().split(":").pop()||""}const memoizedProps={};function getPropertyForClass(r){if(lodashEs.isEmpty(r))return"";if(memoizedProps[r])return memoizedProps[r];let h="";for(const x in CLASSES_LIST){const g=lodashEs.get(CLASSES_LIST,`${x}.regExp`,"");if(new RegExp(g,"g").test(r)){h=x,memoizedProps[r]=h;break}}return h}function constructClassObject(r){return lodashEs.isEmpty(r)?null:{dark:lodashEs.startsWith(r,"dark:"),mq:getMqForCls(r),mod:getModForCls(r),cls:getPureClsName(r),fullCls:r,property:getPropertyForClass(r)}}function generateFullClsName(r){let h="";return r.dark&&(h+="dark:"),r.mq.toLowerCase()!=="xs"&&(h+=`${r.mq}:`),r.mod&&(h+=`${r.mod}:`),h+=r.cls,h}const MEDIA_QUERIES={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},breakpoints=["xs","sm","md","lg","xl","2xl"];function getBelongsToForClass(r,h){if(h===null)return"baseClasses";const x=h.mq;if(x==="xs"||h.dark||h.mod!=="")return"classes";let g="baseClasses",v=breakpoints.indexOf(x);for(;v>0;){const R=breakpoints[v-1];if(lodashEs.find(r,{mq:R,property:h.property})){g="classes";break}v--}return g}const IGNORED_BASES_CLASSES_PROPERTIES=[];function getNewClasses(r="",h="",x=[]){r=r.trim().replace(/ +/g,"");let g=lodashEs.filter(lodashEs.map(r.split(" "),constructClassObject),T=>!lodashEs.isNull(T)),v=lodashEs.filter(lodashEs.map(h.split(" "),constructClassObject),T=>!lodashEs.isNull(T));v=lodashEs.filter(v,T=>!lodashEs.includes(IGNORED_BASES_CLASSES_PROPERTIES,T.property));const R=[],A=[];lodashEs.each(x,T=>{const M=constructClassObject(T),O=lodashEs.find(g,lodashEs.pick(M,["dark","mq","mod","property"]));if(O&&(g=lodashEs.filter(g,z=>z.fullCls!==(O==null?void 0:O.fullCls))),R.push(M),M.mq==="xs"&&!M.dark&&M.mod===""&&(v=lodashEs.filter(v,z=>z.property!==M.property)),getBelongsToForClass(g,M)==="baseClasses"&&!lodashEs.includes(IGNORED_BASES_CLASSES_PROPERTIES,M.property)){const z=lodashEs.find(v,lodashEs.pick(M,["property"]));O&&(v=lodashEs.filter(v,Z=>Z.fullCls!==(z==null?void 0:z.fullCls))),A.push({...M,fullCls:M.cls,mq:"xs"})}});const j=lodashEs.map(lodashEs.sortBy([...g,...R],T=>MEDIA_QUERIES[T.mq]),"fullCls").join(" ");return`${lodashEs.map(lodashEs.sortBy([...v,...A],T=>MEDIA_QUERIES[T.mq]),"fullCls").join(" ").trim()},${j.trim()}`.trim().replace(/ +/g,"")}const selectedStylingBlocksAtom=jotai.atom([]);selectedStylingBlocksAtom.debugLabel="selectedStylingBlocksAtom";const useSelectedStylingBlocks=()=>jotai.useAtom(selectedStylingBlocksAtom),getSplitClasses$1=r=>{const h=r.replace(STRINGS.STYLES_KEY,"").split(",");return{baseClasses:h[0],classes:h[1]}},addClassesToBlocksAtom=jotai.atom(null,(r,h,{blockIds:x,newClasses:g})=>{const v=lodashEs.filter(r(pageBlocksAtomsAtom),A=>x.includes(r(A)._id)),R=lodashEs.first(r(selectedStylingBlocksAtom));return lodashEs.map(v,A=>{const j=r(A),C=lodashEs.get(j,R.prop,`${STRINGS.STYLES_KEY},`),{baseClasses:T,classes:M}=getSplitClasses$1(C);return{ids:[j._id],props:{[R.prop]:`${STRINGS.STYLES_KEY}${getNewClasses(M,T,g)}`}}})}),useAddClassesToBlocks=()=>{const r=jotai.useSetAtom(addClassesToBlocksAtom),{updateBlocks:h,updateBlocksRuntime:x}=useBlocksStoreUndoableActions();return React.useCallback((g,v,R=!1)=>{const A=r({blockIds:g,newClasses:v});if(!R){x(g,A[0].props);return}h(g,A[0].props)},[r,h,x])},useStylingBreakpoint=()=>jotai.useAtom(styleBreakpointAtom),canvasWidthAtom=atomWithStorage("canvasWidth",800),canvasBreakpointAtom=jotai.atom(r=>{const h=r(canvasWidthAtom);return iconBase.getBreakpointValue(h).toLowerCase()}),useCanvasWidth=()=>{const[r,h]=jotai.useAtom(canvasWidthAtom),x=jotai.useAtomValue(canvasBreakpointAtom),[g,v]=useStylingBreakpoint();return React.useEffect(()=>{g!=="xs"&&v(x)},[x,g,v]),[r,x,h]},canvasZoomAtom=atomWithStorage("canvasZoom",100),useCanvasZoom=()=>jotai.useAtom(canvasZoomAtom),cutBlockIdsAtom=jotai.atom([]),useCutBlockIds=()=>{const[r,h]=jotai.useAtom(cutBlockIdsAtom),x=jotai.useSetAtom(copiedBlockIdsAtom),g=React.useCallback(v=>{h(v),x([])},[h,x]);return[r,g]},copiedBlockIdsAtom=jotai.atom([]),useCopyBlockIds=()=>{const[r]=useBlocksStore(),[h,x]=jotai.useAtom(copiedBlockIdsAtom),g=jotai.useSetAtom(cutBlockIdsAtom),v=React.useCallback(async R=>{try{x(R),g([]);const A={_chai_copied_blocks:R.flatMap(j=>getDuplicatedBlocks(r,j,null))};await navigator.clipboard.writeText(JSON.stringify(A))}catch(A){console.error("Failed to copy blocks to clipboard:",A)}},[x,g,r]);return[h,v]},darkModeAtom=atomWithStorage("darkMode",!1),useDarkMode=()=>{const[r,h]=jotai.useAtom(darkModeAtom);return[r,h]},useDuplicateBlocks=()=>{const[r]=useBlocksStore(),[,h]=useSelectedBlockIds(),{addBlocks:x}=useBlocksStoreUndoableActions();return React.useCallback((g,v=null)=>{const R=[];lodashEs.each(g,A=>{const j=r.find(z=>z._id===A);v?v==="root"&&(v=null):v=j._parent;const M=lodashEs.filter(r,z=>lodashEs.isString(v)?z._parent===v:!z._parent).indexOf(j)+1,O=getDuplicatedBlocks(r,A,v);x(O,v,M),R.push(lodashEs.get(O,"0._id",""))}),h(R)},[r,h])},hiddenBlockIdsAtom=jotai.atom([]),useHiddenBlockIds=()=>{const[r,h]=jotai.useAtom(hiddenBlockIdsAtom),x=React.useCallback(g=>{h(v=>lodashEs.includes(v,g)?lodashEs.without(v,g):[...v,g])},[h]);return[r,h,x]},highlightBlockIdAtom=jotai.atom(""),useHighlightBlockId=()=>jotai.useAtom(highlightBlockIdAtom),useCanPaste=()=>{const[r]=useBlocksStore();return(h,x)=>{var R;const g=((R=lodashEs.find(r,{_id:x}))==null?void 0:R._type)||null,v=lodashEs.first(h.map(A=>{var j;return(j=lodashEs.find(r,{_id:A}))==null?void 0:j._type}));return canAcceptChildBlock(g,v)}},useMoveCutBlocks=()=>{const r=jotai.useAtomValue(presentBlocksAtom),{moveBlocks:h}=useBlocksStoreUndoableActions();return React.useCallback((x,g)=>{const v=Array.isArray(g)?g[0]:g;if(g==="root"){const R=r==null?void 0:r.filter(A=>!A._parent);h(x,null,(R==null?void 0:R.length)||0)}else{const R=r==null?void 0:r.filter(A=>A._parent===v);h(x,v,(R==null?void 0:R.length)||0)}},[h,r])},usePasteBlocks=()=>{const[r,h]=useCutBlockIds(),x=useMoveCutBlocks(),g=useCanPaste(),{toast:v}=contextMenu.useToast(),{addPredefinedBlock:R}=useAddBlock();return{canPaste:React.useCallback(async j=>{if(r.length>0)return g(r,j);try{const C=await navigator.clipboard.readText();if(C){const T=JSON.parse(C);return lodashEs.has(T,"_chai_copied_blocks")}}catch{return!1}return!1},[g,r]),pasteBlocks:React.useCallback(async j=>{const C=Array.isArray(j)?j[0]:j;if(!lodashEs.isEmpty(r)){x(r,j),h([]),await navigator.clipboard.writeText("");return}try{const T=await navigator.clipboard.readText();if(T){const M=JSON.parse(T);lodashEs.has(M,"_chai_copied_blocks")?R(M._chai_copied_blocks,C==="root"?null:C):v({title:"Error",description:"Nothing to paste"})}else v({title:"Error",description:"Nothing to paste"})}catch{v({title:"Error",description:"Failed to paste blocks from clipboard"})}},[r,R,x,h,v])}},previewModeAtom=jotai.atom(!1),usePreviewMode=()=>{const[r,h]=jotai.useAtom(previewModeAtom);return[r,h]},getSplitClasses=r=>{const h=r.replace(STRINGS.STYLES_KEY,"").split(",");return{baseClasses:h[0],classes:h[1]}},removeClassFromBlocksAtom=jotai.atom(null,(r,h,{blockIds:x,fullClasses:g})=>{const v=lodashEs.first(r(selectedStylingBlocksAtom)),R=lodashEs.filter(r(pageBlocksAtomsAtom),A=>x.includes(r(A)._id));return lodashEs.map(R,A=>{const j=r(A),C=g;let{classes:T,baseClasses:M}=getSplitClasses(lodashEs.get(j,v.prop,"styles:,"));return lodashEs.each(C,O=>{const z=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Z=new RegExp(`(^|\\s)${z}(?=\\s|$)`,"g");T=T.replace(Z," ").replace(/\s+/g," ").trim();const q=lodashEs.first(O.split(":"));lodashEs.includes(["2xl","xl","lg","md","sm"],q)&&C.push(O.split(":").pop().trim())}),lodashEs.each(C,O=>{const z=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Z=new RegExp(`(^|\\s)${z}(?=\\s|$)`,"g");M=M.replace(Z," ").replace(/\s+/g," ").trim()}),{ids:[j._id],props:{[v.prop]:`${STRINGS.STYLES_KEY}${M},${T}`}}})}),useRemoveClassesFromBlocks=()=>{const{updateBlocks:r}=useBlocksStoreUndoableActions(),h=jotai.useSetAtom(removeClassFromBlocksAtom);return React.useCallback((x,g)=>{const v=h({blockIds:x,fullClasses:g});r(x,v[0].props)},[h])},selectedBlockAllClassesAtom=jotai.atom(r=>{const h=lodashEs.first(r(selectedStylingBlocksAtom)),x=r(selectedBlockAtom);if(!h||h.blockId!==lodashEs.get(x,"_id",null))return[];const v=lodashEs.get(x,h.prop,`${STRINGS.STYLES_KEY},`).replace(STRINGS.STYLES_KEY,"").split(",").join(" ");return lodashEs.filter(lodashEs.map(v.trim().split(" "),constructClassObject),R=>!lodashEs.isNull(R))}),useSelectedBlockAllClasses=()=>jotai.useAtomValue(selectedBlockAllClassesAtom),MQ={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},selectedBlockCurrentClassesAtom=jotai.atom(r=>{const h=r(canvasBreakpointAtom),x=r(styleStateAtom),g=r(darkModeAtom),v=getQueries(h);let R=lodashEs.filter(r(selectedBlockAllClassesAtom),{mod:x});return lodashEs.startsWith(x,"_")||(R=lodashEs.filter(R,A=>v.includes(A.mq))),R=R.sort((A,j)=>MQ[A.mq]-MQ[j.mq]),g||(R=lodashEs.filter(R,{dark:!1})),R}),getQueries=r=>{let h=[];switch(r){case"xs":h=["xs"];break;case"sm":h=["xs","sm"];break;case"md":h=["xs","sm","md"];break;case"lg":h=["xs","sm","md","lg"];break;case"xl":h=["xs","sm","md","lg","xl"];break;case"2xl":h=["xs","sm","md","lg","xl","2xl"];break;default:h=["xs"];break}return h},useSelectedBlockCurrentClasses=()=>jotai.useAtomValue(selectedBlockCurrentClassesAtom),useStylingState=()=>jotai.useAtom(styleStateAtom),languageAtom=jotai.atom("");languageAtom.debugLabel="selectedLanguageAtom";const useLanguages=()=>{const r=useBuilderProp("languages",[]),h=useBuilderProp("fallbackLang","en"),[x,g]=jotai.useAtom(languageAtom),v=R=>{g(h===R?"":R)};return{languages:r==null?void 0:r.filter(R=>R!==h),fallbackLang:h,selectedLang:x,setSelectedLang:v}},updatePropsForLanguage=lodashEs.memoize((r,h,x)=>{const g=runtime.getRegisteredChaiBlock(lodashEs.get(x,"_type"));if(!g)return r;const v={...r};return lodashEs.forEach(lodashEs.keys(r),R=>{if(lodashEs.includes(lodashEs.get(g,"i18nProps",[]),R)&&!lodashEs.isEmpty(h)){const A=`${R}-${h}`;lodashEs.set(v,A,r[R]),lodashEs.unset(v,R)}}),v}),useUpdateBlocksProps=()=>{const{updateBlocks:r}=useBlocksStoreUndoableActions(),{selectedLang:h}=useLanguages(),x=useSelectedBlock();return React.useCallback((g,v,R)=>{const A=updatePropsForLanguage(v,h,x);r(g,A,R)},[h,x,r])},useUpdateMultipleBlocksProps=()=>{const{updateMultipleBlocksProps:r}=useBlocksStoreUndoableActions();return React.useCallback(h=>{r(h)},[r])},useFakeStreamEffect=()=>{const{updateBlocksRuntime:r}=useBlocksStoreUndoableActions();return React.useCallback(async(h,x,g=30)=>{const v=lodashEs.keys(lodashEs.omit(x,["_id"]));for(const R of v){const A=x[R];if(lodashEs.isString(A)){const j=lodashEs.chunk(A.split(""),12);let C="";r([h],{[R]:""});for(let T=0;T<j.length;T++)C+=j[T].join(""),r([h],{[R]:C}),await new Promise(M=>setTimeout(M,g))}}},[r])},useStreamMultipleBlocksProps=()=>{const{updateMultipleBlocksProps:r}=useBlocksStoreUndoableActions(),h=useFakeStreamEffect();return React.useCallback(async x=>{for(const g of x)await h(g._id,g);r(x)},[h,r])},useUpdateBlocksPropsRealtime=()=>{const{updateBlocksRuntime:r}=useBlocksStoreUndoableActions(),{selectedLang:h}=useLanguages(),x=useSelectedBlock();return React.useCallback((g,v)=>{const R=updatePropsForLanguage(v,h,x);r(g,R)},[h,x,r])},selectedBreakpointsAtom=atomWithStorage("selectedBreakpoints",["XS","MD","XL"]),useSelectedBreakpoints=()=>{const[r,h]=jotai.useAtom(selectedBreakpointsAtom);return[r,h]},readOnlyModeAtom=jotai.atom(!1);readOnlyModeAtom.debugLabel="readOnlyModeAtom";const networkModeAtom=jotai.atom("online");networkModeAtom.debugLabel="networkModeAtom";jotai.atom("");const editLayerNameAtom=jotai.atom(!1);editLayerNameAtom.debugLabel="editLayerNameAtom";const activeLanguageAtom=jotai.atom("");activeLanguageAtom.debugLabel="activeLanguageAtom";const primaryLanguageAtom=jotai.atom("");primaryLanguageAtom.debugLabel="primaryLanguageAtom";const canvasIframeAtom=jotai.atom(null);canvasIframeAtom.debugLabel="canvasIframeAtom";const activePanelAtom=jotai.atom("outline");activePanelAtom.debugLabel="activePanelAtom";const showPredefinedBlockCategoryAtom=jotai.atom("");showPredefinedBlockCategoryAtom.debugLabel="showPredefinedBlockCategoryAtom";const historyStatesAtom=jotai.atom({undoCount:0,redoCount:0});historyStatesAtom.debugLabel="historyStatesAtom";const inlineEditingActiveAtom=jotai.atom("");inlineEditingActiveAtom.debugLabel="inlineEditingActiveAtom";const draggingFlagAtom=jotai.atom(!1);draggingFlagAtom.debugLabel="draggingFlagAtom";const treeRefAtom=jotai.atom(null);treeRefAtom.debugLabel="treeRefAtom";const canvasSettingsAtom=jotai.atom({});canvasSettingsAtom.debugLabel="canvasSettingsAtom";const aiAssistantActiveAtom=jotai.atom(!1);aiAssistantActiveAtom.debugLabel="aiAssistantActiveAtom";const codeEditorOpenAtom=jotai.atom(!1);codeEditorOpenAtom.debugLabel="codeEditorOpenAtom";const codeEditorHeightAtom=atomWithStorage("codeEditorHeight",500);codeEditorHeightAtom.debugLabel="codeEditorHeightAtom";const xShowBlocksAtom=jotai.atom([]);xShowBlocksAtom.debugLabel="xShowBlocksAtom";const selectedLibraryAtom=atomWithStorage("_selectedLibrary",null);selectedLibraryAtom.debugLabel="selectedLibraryAtom";let lastHighlighted=null;const useBlockHighlight=()=>{const[r]=jotai.useAtom(canvasIframeAtom),h=React.useMemo(()=>{var v;return(r==null?void 0:r.contentDocument)||((v=r==null?void 0:r.contentWindow)==null?void 0:v.document)},[r]);return{highlightBlock:v=>{if(lastHighlighted&&lastHighlighted.removeAttribute("data-highlighted"),typeof v!="string")v.setAttribute("data-highlighted","true"),lastHighlighted=v;else if(typeof v=="string"){const R=h.querySelector(`[data-block-id="${v}"]`);R&&(R.setAttribute("data-highlighted","true"),lastHighlighted=R)}else lastHighlighted=null},clearHighlight:()=>{lastHighlighted&&(lastHighlighted.removeAttribute("data-highlighted"),lastHighlighted=null)},lastHighlighted}},globalBlocksStoreAtom=atom({}),globalBlocksLoadingStateAtom=atom({}),useGlobalBlocksStore=()=>{const[r,h]=useAtom(globalBlocksStoreAtom),x=React.useCallback(v=>lodashEs.get(r,v==null?void 0:v.globalBlock,[]),[r]),g=React.useCallback(()=>{h({})},[h]);return{getGlobalBlocks:x,reset:g}},useWatchGlobalBlocks=()=>{const[r]=useBlocksStore(),[h,x]=useAtom(globalBlocksStoreAtom),[g,v]=useAtom(globalBlocksLoadingStateAtom),R=useBuilderProp("getGlobalBlockBlocks",async j=>[]),A=React.useMemo(()=>r.filter(C=>C._type==="GlobalBlock").filter(C=>C._type==="GlobalBlock").map(C=>C.globalBlock),[r]);React.useEffect(()=>{lodashEs.forEach(A,j=>{lodashEs.has(h,j)||lodashEs.get(g,`${j}.loading`,!1)||(v(C=>({...C,[j]:{loading:!0,error:null}})),R(j).then(C=>{x(T=>({...T,[j]:C})),v(T=>({...T,[j]:{loading:!1,error:null}}))}).catch(C=>{v(T=>({...T,[j]:{loading:!1,error:C.message}}))}))})},[R,h,A,g,x,v])},globalBlocksListAtom=atom({}),useGlobalBlocksList=()=>{const[r,h]=React.useState(!1),[x,g]=useAtom(globalBlocksListAtom),v=useBuilderProp("getGlobalBlocks",async()=>[]),R=React.useCallback(async()=>{h(!0);const A=await v();g(A),h(!1)},[v,g]);return React.useEffect(()=>{R()},[]),{data:x,isLoading:r,refetch:R}},useBuilderReset=()=>{const r=jotai.useSetAtom(historyStatesAtom),{clear:h}=useUndoManager(),[,x]=useSelectedBlockIds(),{clearHighlight:g}=useBlockHighlight(),[,v]=useSelectedStylingBlocks(),[,R]=useAtom(aiAssistantActiveAtom),{reset:A}=useGlobalBlocksStore();return()=>{x([]),v([]),g(),h(),R(!1),r({undoCount:0,redoCount:0}),A()}},useUILibraryBlocks=()=>({data:useBuilderProp("uiLibraries",[]),isLoading:!1}),useCopyToClipboard=()=>{const[r,h]=React.useState(null),x=React.useCallback(async g=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(g),h(g),!0}catch(v){return console.warn("Copy failed",v),h(null),!1}},[]);return[r,x]},codeEditorAtom=jotai.atom(null),useCodeEditor=()=>jotai.useAtom(codeEditorAtom),LANGUAGES={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"};function getChildBlocks(r,h,x){x.push(lodashEs.find(r,{_id:h}));const g=lodashEs.filter(r,{_parent:h});for(const v of g)x.push(...getBlockWithChildren(v._id,r));return x}const getBlockWithChildren=(r,h)=>{let x=[];return x=lodashEs.flattenDeep([...x,...getChildBlocks(h,r,x)]),x},pickOnlyAIProps=(r,h)=>lodashEs.compact(r.map(x=>{const g=["_id","_type","_parent"],v=lodashEs.pick(x,g),R=runtime.getRegisteredChaiBlock(x._type),A={},j=lodashEs.get(R,"aiProps",[]);for(const C in x)g.includes(C)||j.includes(C)&&(A[C]=lodashEs.get(x,`${C}-${h}`,x[C]));return lodashEs.isEmpty(A)?!1:(lodashEs.has(v,"_parent")&&lodashEs.isEmpty(v._parent)&&delete v._parent,{...v,...A})})),addLangToPrompt=(r,h,x)=>!h||x!=="content"?r:`${r}. Generate content in ${lodashEs.get(LANGUAGES,h,h)} language.`,askAiProcessingAtom=jotai.atom(!1),useAskAi=()=>{const[r,h]=jotai.useAtom(askAiProcessingAtom),[x,g]=React.useState(null),v=useBuilderProp("askAiCallBack",null),R=useStreamMultipleBlocksProps(),A=useUpdateMultipleBlocksProps(),[j]=useBlocksStore(),{selectedLang:C,fallbackLang:T}=useLanguages(),M=C.length?C:T,O=(z,Z)=>{const q=lodashEs.cloneDeep(Z.find(Y=>Y._id===z));for(const Y in q){const P=q[Y];typeof P=="string"&&lodashEs.startsWith(P,STRINGS.STYLES_KEY)?q[Y]=lodashEs.compact(lodashEs.flattenDeep(P.replace(STRINGS.STYLES_KEY,"").split(","))).join(" "):Y!=="_id"&&delete q[Y]}return q};return{askAi:React.useCallback(async(z,Z,q,Y)=>{if(v){h(!0),g(null);try{const P=C===T?"":C,he=z==="content"?pickOnlyAIProps(lodashEs.cloneDeep(getBlockWithChildren(Z,j)),C):[O(Z,j)],te=await v(z,addLangToPrompt(q,M,z),he,P),{blocks:ue,error:X}=te;if(X){g(X);return}if(z==="styles"){const se=ue.map(pe=>{for(const ve in pe)ve!=="_id"&&(pe[ve]=`${STRINGS.STYLES_KEY},${pe[ve]}`);return pe});A(se)}else R(ue);Y&&Y(te)}catch(P){g(P)}finally{h(!1),Y&&Y()}}},[v,h,C,T,j,M,A,R]),loading:r,error:x}},useAiAssistant=()=>{const[,r]=useRightPanel();return React.useCallback(h=>{r(h?"ai":"block")},[r])},wrapperBlockAtom=jotai.atom(r=>{var A;const h=r(presentBlocksAtom),x=r(selectedBlockIdsAtom),g=x.length===1?x[0]:null;if(!g)return null;const v=lodashEs.find(h,{_id:g});if(!v)return null;let R=v._parent;for(;R;){const j=lodashEs.find(h,{_id:R});if(!j)return null;if((A=runtime.getRegisteredChaiBlock(j._type))!=null&&A.wrapper)return j;R=j._parent}return null});wrapperBlockAtom.debugLabel="wrapperBlockAtom";const useWrapperBlock=()=>jotai.useAtomValue(wrapperBlockAtom),layoutVariantAtom=atomWithStorage("_layout_variant_mode","DUAL_SIDE_PANEL"),useLayoutVariant=()=>{const[r,h]=jotai.useAtom(layoutVariantAtom),x=useBuilderProp("layoutVariant","DUAL_SIDE_PANEL");return[r||x,h]},IframeInitialContent=`<!doctype html>
|
|
2
2
|
<html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
@@ -54,8 +54,249 @@
|
|
|
54
54
|
<div class="frame-root h-full"></div>
|
|
55
55
|
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
56
56
|
</body>
|
|
57
|
-
</html>`,useCanvasScale=o=>{const[n]=useCanvasWidth(),[,r]=useCanvasZoom(),a=useBuilderProp("htmlDir","ltr"),[i,l]=React.useState({}),c=React.useCallback(()=>{const{width:u,height:x}=o;if(u<n){const d=parseFloat((u/n).toFixed(2).toString());let p={};const m=x*d,h=u*d;x&&(p={height:100+(x-m)/m*100+"%",width:100+(u-h)/h*100+"%"}),l({position:"relative",top:0,transform:`scale(${d})`,transformOrigin:a==="rtl"?"top right":"top left",...p,maxWidth:"none"}),r(d*100)}else l({}),r(100)},[n,o,a,r]);return React.useEffect(()=>{c()},[n,o,r,c]),i};let doc,win;typeof document<"u"&&(doc=document);typeof window<"u"&&(win=window);const FrameContext=React.createContext({document:doc,window:win}),useFrame=()=>React.useContext(FrameContext),{Provider:FrameContextProvider,Consumer:FrameContextConsumer}=FrameContext;class Content extends React.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return React.Children.only(this.props.children)}}O(Content,"propTypes",{children:PropTypes.element.isRequired,contentDidMount:PropTypes.func.isRequired,contentDidUpdate:PropTypes.func.isRequired});class Frame extends React.Component{constructor(r,a){super(r,a);O(this,"setRef",r=>{this.nodeRef.current=r;const{forwardedRef:a}=this.props;typeof a=="function"?a(r):a&&(a.current=r)});O(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});O(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=React.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const r=this.getDoc();return this.props.mountTarget?r.querySelector(this.props.mountTarget):r.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const r=this.getDoc();if(!r)return null;const a=this.props.contentDidMount,i=this.props.contentDidUpdate,l=r.defaultView||r.parentView,c=jsxRuntime.jsxRuntimeExports.jsx(Content,{contentDidMount:a,contentDidUpdate:i,children:jsxRuntime.jsxRuntimeExports.jsx(FrameContextProvider,{value:{document:r,window:l},children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),u=this.getMountTarget();return[ReactDOM.createPortal(this.props.head,this.getDoc().head),ReactDOM.createPortal(c,u)]}render(){const r={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete r.head,delete r.initialContent,delete r.mountTarget,delete r.contentDidMount,delete r.contentDidUpdate,delete r.forwardedRef,jsxRuntime.jsxRuntimeExports.jsx("iframe",{...r,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}O(Frame,"propTypes",{style:PropTypes.object,head:PropTypes.node,initialContent:PropTypes.string,mountTarget:PropTypes.string,className:PropTypes.string,contentDidMount:PropTypes.func,contentDidUpdate:PropTypes.func,children:PropTypes.oneOfType([PropTypes.element,PropTypes.arrayOf(PropTypes.element)])}),O(Frame,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const ChaiFrame=React.forwardRef((o,n)=>jsxRuntime.jsxRuntimeExports.jsx(Frame,{...o,forwardedRef:n}));function getOrientation(o){const n=window.getComputedStyle(o),r=n.display;if(r==="flex"||r==="inline-flex"){const a=n.flexDirection;return a==="column"||a==="column-reverse"?"vertical":"horizontal"}else if(r==="grid"){const a=n.gridAutoFlow,i=n.gridTemplateRows,l=n.gridTemplateColumns;return a.includes("column")||i.split(" ").length>l.split(" ").length?"vertical":"horizontal"}else if(r==="block"||r==="inline-block")return"vertical";return"horizontal"}const draggedBlockAtom=jotai.atom(null),dropTargetBlockIdAtom=jotai.atom(null);let iframeDocument=null,possiblePositions=[],dropTarget=null,dropIndex=null;const positionPlaceholder=(o,n,r)=>{if(!iframeDocument||!o)return;const a=iframeDocument==null?void 0:iframeDocument.getElementById("placeholder"),i=possiblePositions.map(([x])=>x),l=i.reduce((x,d)=>Math.abs(d-r)<Math.abs(x-r)?d:x,0),c=i.indexOf(l);if(!possiblePositions[c])return;const u=possiblePositions[c];a.style.width=n==="vertical"?u[2]+"px":"2px",a.style.height=n==="vertical"?"2px":u[2]+"px",a.style.display="block",n==="vertical"?(a.style.top=u[0]+"px",a.style.left=u[1]+"px"):(a.style.top=u[1]+"px",a.style.left=u[0]+"px")};function calculateDropIndex(o,n){let r=0,a=1/0;return n.forEach((i,l)=>{const c=Math.abs(i[0]-o);c<a&&(a=c,r=l)}),r}const calculatePossiblePositions=o=>{const r=getOrientation(o)==="horizontal";possiblePositions=[],Array.from(o.children).forEach((a,i)=>{if(a.classList.contains("pointer-events-none"))return;const l=r?a.offsetLeft:a.offsetTop,c=r?[a.offsetTop,a.clientHeight]:[a.offsetLeft,a.clientWidth];if(possiblePositions.push([l,c[0],c[1]]),i===o.children.length-1){const u=r?a.offsetLeft+a.clientWidth:a.offsetTop+a.clientHeight;possiblePositions.push([u,c[0],c[1]])}})},throttledDragOver=lodashEs.throttle(o=>{var i;const n=o.target,r=getOrientation(n),a=(i=iframeDocument==null?void 0:iframeDocument.defaultView)==null?void 0:i.scrollY;r==="vertical"?positionPlaceholder(n,r,o.clientY+a):positionPlaceholder(n,r,o.clientX)},0);function removePlaceholder(){const o=iframeDocument==null?void 0:iframeDocument.getElementById("placeholder");o.style.display="none",removeClassFromElements("pointer-none"),removeDataDrop()}function removeClassFromElements(o){(iframeDocument==null?void 0:iframeDocument.querySelectorAll(`.${o}`)).forEach(r=>{r.classList.remove(o)})}function removeDataDrop(){const o=iframeDocument==null?void 0:iframeDocument.querySelector('[data-drop="yes"]');o&&o.removeAttribute("data-drop")}const useDnd=()=>{const{document:o}=useFrame(),[n,r]=jotai.useAtom(draggingFlagAtom),{addCoreBlock:a}=useAddBlock(),[,i]=useHighlightBlockId(),[,l]=useSelectedBlockIds(),{moveBlocks:c}=useBlocksStoreUndoableActions(),[u,x]=jotai.useAtom(draggedBlockAtom),[,d]=jotai.useAtom(dropTargetBlockIdAtom);if(!flagged.useFeature("dnd"))return{};const m=()=>{removePlaceholder(),r(!1),x(null),d(null),possiblePositions=[]};return iframeDocument=o,{isDragging:n,onDragOver:h=>{h.preventDefault(),h.stopPropagation(),throttledDragOver(h)},onDrop:h=>{var k;const b=dropTarget,f=getOrientation(b)==="vertical"?h.clientY+((k=iframeDocument==null?void 0:iframeDocument.defaultView)==null?void 0:k.scrollY):h.clientX;dropIndex=calculateDropIndex(f,possiblePositions);const y=u,_=b.getAttribute("data-block-id"),A=dropTarget.getAttribute("data-dnd-dragged")!=="yes";if((y==null?void 0:y._id)===_||!A){m();return}if(!lodashEs.has(y,"_id")){a(y,_==="canvas"?null:_,dropIndex),setTimeout(m,300);return}let S=b.getAttribute("data-block-id");S===null&&(S=h.target.parentElement.getAttribute("data-block-id")),c([y._id],S==="canvas"?null:S,dropIndex),m(),setTimeout(removePlaceholder,300)},onDragEnter:h=>{const b=h,R=b.target;dropTarget=R;const f=R.getAttribute("data-block-id"),y=R.getAttribute("data-dnd-dragged")!=="yes";d(f),b.stopPropagation(),b.preventDefault(),possiblePositions=[],y&&calculatePossiblePositions(R),r(!0),i(""),l([])},onDragLeave:h=>{h.target.getAttribute("data-block-id")==="canvas"&&(d(null),r(!1),removePlaceholder(),possiblePositions=[])}}};function getTargetedBlock(o){if(o.getAttribute("data-block-id")==="canvas")return null;if(o.getAttribute("data-block-id")||o.getAttribute("data-block-parent"))return o;const n=o.closest("[data-block-id]");return(n==null?void 0:n.getAttribute("data-block-id"))==="canvas"?null:n}function destroyQuill(o){o.container.innerHTML="",o.container.parentNode.removeChild(o.container);const n=document.querySelector(".ql-toolbar");n&&n.parentNode.removeChild(n),o=null}const useHandleCanvasDblClick=()=>{const o=["Heading","Paragraph","Text","Link","Span","Button"],n=useUpdateBlocksProps(),[r,a]=jotai.useAtom(inlineEditingActiveAtom),{clearHighlight:i}=useBlockHighlight();return l=>{var m;if(r)return;const c=getTargetedBlock(l.target),u=c.getAttribute("data-block-type");if(!u||!o.includes(u))return;const x=c.cloneNode(!0);c.style.display="none",Array.from(x.attributes).forEach(h=>{h.name!=="class"&&x.removeAttribute(h.name)}),u==="Text"&&(x.style.display="inline-block"),c.parentNode.insertBefore(x,c.nextSibling);const d=new ReactQuill.Quill(x,{placeholder:"Type here..."});function p(){const h=d.getText(0,d.getLength());n([c.getAttribute("data-block-id")],{content:h}),c.removeAttribute("style"),x.removeEventListener("blur",p,!0),destroyQuill(d),a(""),i(),x.remove()}x.addEventListener("blur",p,!0),x.addEventListener("click",h=>{h.stopPropagation()}),x.addEventListener("keydown",h=>{(h.key==="Enter"||h.key==="Escape")&&p()}),d.focus(),(m=x.querySelector(".ql-clipboard"))==null||m.remove(),a(c.getAttribute("data-block-id"))}},useHandleCanvasClick=()=>{const[,o]=useSelectedStylingBlocks(),[n,r]=useSelectedBlockIds(),[a]=jotai.useAtom(inlineEditingActiveAtom),[i]=jotai.useAtom(treeRefAtom),{clearHighlight:l}=useBlockHighlight();return c=>{if(a)return;c.stopPropagation();const u=getTargetedBlock(c.target);if(u!=null&&u.getAttribute("data-block-id")&&(u==null?void 0:u.getAttribute("data-block-id"))==="container"){r([]),o([]),l();return}if(u!=null&&u.getAttribute("data-block-parent")){const x=u.getAttribute("data-style-prop"),d=u.getAttribute("data-style-id"),p=u.getAttribute("data-block-parent");n.includes(p)||i==null||i.closeAll(),o([{id:d,prop:x,blockId:p}]),r([p])}else if(u!=null&&u.getAttribute("data-block-id")){const x=u.getAttribute("data-block-id");n.includes(x)||i==null||i.closeAll(),o([]),r(x==="canvas"?[]:[x])}l()}},useHandleMouseMove=()=>{const[o]=jotai.useAtom(inlineEditingActiveAtom),{highlightBlock:n}=useBlockHighlight();return lodashEs.throttle(r=>{if(o)return;const a=getTargetedBlock(r.target);a&&n(a)},20)},useHandleMouseLeave=()=>{const{clearHighlight:o}=useBlockHighlight();return o},Canvas=({children:o})=>{const{document:n}=useFrame(),[r]=useSelectedBlockIds(),[a,i]=useSelectedStylingBlocks(),{clearHighlight:l}=useBlockHighlight();React.useEffect(()=>l,[l]),React.useEffect(()=>{setTimeout(()=>{if(!lodashEs.isEmpty(a))return;const m=getElementByDataBlockId(n,lodashEs.first(r));if(m){const h=m.getAttribute("data-style-prop");if(h){const b=m.getAttribute("data-style-id"),R=m.getAttribute("data-block-parent");i([{id:b,prop:h,blockId:R}])}}},100)},[n,r,i,a]);const c=useHandleCanvasDblClick(),u=useHandleCanvasClick(),x=useHandleMouseMove(),d=useHandleMouseLeave(),p=useDnd();return jsxRuntime.jsxRuntimeExports.jsx("div",{"data-block-id":"canvas",id:"canvas",onClick:u,onDoubleClick:c,onMouseMove:x,onMouseLeave:d,...lodashEs.omit(p,"isDragging"),className:"relative h-full max-w-full p-px "+(p.isDragging?"dragging":""),children:o})},getElementByDataBlockId=(o,n)=>o.querySelector(`[data-block-id="${n}"]`),useKeyEventWatcher=o=>{const[n,r]=useSelectedBlockIds(),a=useSelectedBlock(),i=useRemoveBlocks(),l=useDuplicateBlocks(),{undo:c,redo:u}=useUndoManager(),[,x]=useCutBlockIds(),[,d]=useCopyBlockIds(),{canPaste:p,pasteBlocks:m}=usePasteBlocks(),h=o?{document:o}:{};reactHotkeysHook.useHotkeys("ctrl+z,command+z",()=>c(),{},[c]),reactHotkeysHook.useHotkeys("ctrl+y,command+y",()=>u(),{},[u]),reactHotkeysHook.useHotkeys("ctrl+x,command+x",()=>x(n),{},[n,x]),reactHotkeysHook.useHotkeys("ctrl+c,command+c",()=>d(n),{},[n,d]),reactHotkeysHook.useHotkeys("ctrl+v,command+v",()=>{p(n[0])&&m(n)},{...h,preventDefault:!0},[n,p,m]),reactHotkeysHook.useHotkeys("esc",()=>r([]),h,[r]),reactHotkeysHook.useHotkeys("ctrl+d,command+d",()=>l(n),{...h,preventDefault:!0},[n,l]),reactHotkeysHook.useHotkeys("del, backspace",b=>{b.preventDefault(),canDeleteBlock(lodashEs.get(a,"_type",""))&&i(n)},h,[n,i])},KeyboardHandler=()=>{const{document:o}=useFrame();return useKeyEventWatcher(o),null},CHAI_BUILDER_EVENTS={OPEN_ADD_BLOCK:"OPEN_ADD_BLOCK",CLOSE_ADD_BLOCK:"CLOSE_ADD_BLOCK",SHOW_BLOCK_SETTINGS:"SHOW_BLOCK_SETTINGS"};class PubSub{constructor(){O(this,"subscribers",new Map)}subscribe(n,r){return this.subscribers.has(n)||this.subscribers.set(n,new Set),this.subscribers.get(n).add(r),()=>{const a=this.subscribers.get(n);a&&(a.delete(r),a.size===0&&this.subscribers.delete(n))}}publish(n,r){const a=this.subscribers.get(n);a&&a.forEach(i=>i(r))}}const pubsub=new PubSub,BlockActionLabel=({block:o,label:n})=>{const[,r]=useSelectedBlockIds(),[,a]=useHighlightBlockId(),[,i]=jotai.useAtom(draggedBlockAtom),l=flagged.useFeature("dnd");return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-default items-center space-x-1 px-1",draggable:l?"true":"false",onDragStart:c=>{c.dataTransfer.setData("text/plain",JSON.stringify(lodashEs.pick(o,["_id","_type","_name"]))),i(o),setTimeout(()=>{r([]),a(null)},200)},children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DragHandleDots2Icon,{}),n]})},BlockActionsStatic=({selectedBlockElement:o,block:n})=>{const r=useRemoveBlocks(),a=useDuplicateBlocks(),[,i]=useSelectedBlockIds(),[,l]=useHighlightBlockId(),[,c]=useSelectedStylingBlocks(),[u]=jotai.useAtom(inlineEditingActiveAtom),{floatingStyles:x,refs:d,update:p}=reactDom.useFloating({placement:"top-start",middleware:[reactDom.shift(),dom.flip()],elements:{reference:o}});web.useResizeObserver(o,()=>p(),o!==null);const m=lodashEs.get(n,"_parent",null),h=lodashEs.isEmpty(lodashEs.get(n,"_name",""))?lodashEs.get(n,"_type",""):lodashEs.get(n,"_name","");return!o||!n||u?null:jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:d.setFloating,style:x,onClick:b=>{b.stopPropagation(),b.preventDefault()},onMouseEnter:b=>{b.stopPropagation(),l(null)},onKeyDown:b=>b.stopPropagation(),className:"isolate z-[999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[m&&jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{c([]),i([m])}}),jsxRuntime.jsxRuntimeExports.jsx(BlockActionLabel,{label:h,block:n}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1",children:[canAddChildBlock(lodashEs.get(n,"_type",""))&&jsxRuntime.jsxRuntimeExports.jsx(reactIcons.PlusIcon,{className:"hover:scale-105",onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,n)}),canDuplicateBlock(lodashEs.get(n,"_type",""))?jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CopyIcon,{className:"hover:scale-105",onClick:()=>a([n==null?void 0:n._id])}):null,canDeleteBlock(lodashEs.get(n,"_type",""))?jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TrashIcon,{className:"hover:scale-105",onClick:()=>r([n==null?void 0:n._id])}):null]})]})})},HeadTags=()=>{const[o]=useTheme(),n=useThemeOptions(),[r]=useSelectedBlockIds(),[a]=useDarkMode(),[i]=useSelectedStylingBlocks(),[l]=jotai.useAtom(draggedBlockAtom),[c]=jotai.useAtom(dropTargetBlockIdAtom),{document:u,window:x}=useFrame(),[d]=React.useState(u==null?void 0:u.getElementById("highlighted-block")),[p]=React.useState(u==null?void 0:u.getElementById("selected-block")),[m]=React.useState(u==null?void 0:u.getElementById("selected-styling-block")),[h]=React.useState(u==null?void 0:u.getElementById("dragged-block"));React.useEffect(()=>{a?u==null||u.documentElement.classList.add("dark"):u==null||u.documentElement.classList.remove("dark")},[a,u]),React.useEffect(()=>{!x||!x.tailwind||(x.tailwind.config={darkMode:"class",theme:{extend:{container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...ChaiThemeFn.getChaiThemeOptions(n)}},plugins:[typography,forms,aspectRatio,containerQueries,ChaiThemeFn.plugin(function({addBase:f,theme:y}){f({"h1,h2,h3,h4,h5,h6":{fontFamily:y("fontFamily.heading")},body:{fontFamily:y("fontFamily.body"),color:y("colors.foreground"),backgroundColor:y("colors.background")}})})]})},[o,n,x]),React.useEffect(()=>{p&&(p.textContent=`${lodashEs.map(r,f=>`[data-block-id="${f}"]`).join(",")}{
|
|
58
|
-
outline: 1px solid ${
|
|
59
|
-
}`)},[
|
|
57
|
+
</html>`,useCanvasScale=r=>{const[h]=useCanvasWidth(),[,x]=useCanvasZoom(),g=useBuilderProp("htmlDir","ltr"),[v,R]=React.useState({}),A=React.useCallback(()=>{const{width:j,height:C}=r;if(j<h){const T=parseFloat((j/h).toFixed(2).toString());let M={};const O=C*T,z=j*T;C&&(M={height:100+(C-O)/O*100+"%",width:100+(j-z)/z*100+"%"}),R({position:"relative",top:0,transform:`scale(${T})`,transformOrigin:g==="rtl"?"top right":"top left",...M,maxWidth:"none"}),x(T*100)}else R({}),x(100)},[h,r,g,x]);return React.useEffect(()=>{A()},[h,r,x,A]),v};let doc,win;typeof document<"u"&&(doc=document);typeof window<"u"&&(win=window);const FrameContext=React.createContext({document:doc,window:win}),useFrame=()=>React.useContext(FrameContext),{Provider:FrameContextProvider,Consumer:FrameContextConsumer}=FrameContext;class Content extends React.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return React.Children.only(this.props.children)}}class Frame extends React.Component{constructor(x,g){super(x,g);xm(this,"setRef",x=>{this.nodeRef.current=x;const{forwardedRef:g}=this.props;typeof g=="function"?g(x):g&&(g.current=x)});xm(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});xm(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=React.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const x=this.getDoc();return this.props.mountTarget?x.querySelector(this.props.mountTarget):x.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const x=this.getDoc();if(!x)return null;const g=this.props.contentDidMount,v=this.props.contentDidUpdate,R=x.defaultView||x.parentView,A=jsxRuntime.jsxRuntimeExports.jsx(Content,{contentDidMount:g,contentDidUpdate:v,children:jsxRuntime.jsxRuntimeExports.jsx(FrameContextProvider,{value:{document:x,window:R},children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),j=this.getMountTarget();return[ReactDOM.createPortal(this.props.head,this.getDoc().head),ReactDOM.createPortal(A,j)]}render(){const x={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete x.head,delete x.initialContent,delete x.mountTarget,delete x.contentDidMount,delete x.contentDidUpdate,delete x.forwardedRef,jsxRuntime.jsxRuntimeExports.jsx("iframe",{...x,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}xm(Frame,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const ChaiFrame=React.forwardRef((r,h)=>jsxRuntime.jsxRuntimeExports.jsx(Frame,{...r,forwardedRef:h}));function getOrientation(r){const h=window.getComputedStyle(r),x=h.display;if(x==="flex"||x==="inline-flex"){const g=h.flexDirection;return g==="column"||g==="column-reverse"?"vertical":"horizontal"}else if(x==="grid"){const g=h.gridAutoFlow,v=h.gridTemplateRows,R=h.gridTemplateColumns;return g.includes("column")||v.split(" ").length>R.split(" ").length?"vertical":"horizontal"}else if(x==="block"||x==="inline-block")return"vertical";return"horizontal"}const draggedBlockAtom=jotai.atom(null),dropTargetBlockIdAtom=jotai.atom(null);let iframeDocument=null,possiblePositions=[],dropTarget=null,dropIndex=null;const positionPlaceholder=(r,h,x)=>{if(!iframeDocument||!r)return;const g=iframeDocument==null?void 0:iframeDocument.getElementById("placeholder"),v=possiblePositions.map(([C])=>C),R=v.reduce((C,T)=>Math.abs(T-x)<Math.abs(C-x)?T:C,0),A=v.indexOf(R);if(!possiblePositions[A])return;const j=possiblePositions[A];g.style.width=h==="vertical"?j[2]+"px":"2px",g.style.height=h==="vertical"?"2px":j[2]+"px",g.style.display="block",h==="vertical"?(g.style.top=j[0]+"px",g.style.left=j[1]+"px"):(g.style.top=j[1]+"px",g.style.left=j[0]+"px")};function calculateDropIndex(r,h){let x=0,g=1/0;return h.forEach((v,R)=>{const A=Math.abs(v[0]-r);A<g&&(g=A,x=R)}),x}const calculatePossiblePositions=r=>{const x=getOrientation(r)==="horizontal";possiblePositions=[],Array.from(r.children).forEach((g,v)=>{if(g.classList.contains("pointer-events-none"))return;const R=x?g.offsetLeft:g.offsetTop,A=x?[g.offsetTop,g.clientHeight]:[g.offsetLeft,g.clientWidth];if(possiblePositions.push([R,A[0],A[1]]),v===r.children.length-1){const j=x?g.offsetLeft+g.clientWidth:g.offsetTop+g.clientHeight;possiblePositions.push([j,A[0],A[1]])}})},throttledDragOver=lodashEs.throttle(r=>{var v;const h=r.target,x=getOrientation(h),g=(v=iframeDocument==null?void 0:iframeDocument.defaultView)==null?void 0:v.scrollY;x==="vertical"?positionPlaceholder(h,x,r.clientY+g):positionPlaceholder(h,x,r.clientX)},0);function removePlaceholder(){const r=iframeDocument==null?void 0:iframeDocument.getElementById("placeholder");r.style.display="none",removeClassFromElements("pointer-none"),removeDataDrop()}function removeClassFromElements(r){(iframeDocument==null?void 0:iframeDocument.querySelectorAll(`.${r}`)).forEach(x=>{x.classList.remove(r)})}function removeDataDrop(){const r=iframeDocument==null?void 0:iframeDocument.querySelector('[data-drop="yes"]');r&&r.removeAttribute("data-drop")}const useDnd=()=>{const{document:r}=useFrame(),[h,x]=jotai.useAtom(draggingFlagAtom),{addCoreBlock:g}=useAddBlock(),[,v]=useHighlightBlockId(),[,R]=useSelectedBlockIds(),{moveBlocks:A}=useBlocksStoreUndoableActions(),[j,C]=jotai.useAtom(draggedBlockAtom),[,T]=jotai.useAtom(dropTargetBlockIdAtom);if(!flagged.useFeature("dnd"))return{};const O=()=>{removePlaceholder(),x(!1),C(null),T(null),possiblePositions=[]};return iframeDocument=r,{isDragging:h,onDragOver:z=>{z.preventDefault(),z.stopPropagation(),throttledDragOver(z)},onDrop:z=>{var X;const Z=dropTarget,Y=getOrientation(Z)==="vertical"?z.clientY+((X=iframeDocument==null?void 0:iframeDocument.defaultView)==null?void 0:X.scrollY):z.clientX;dropIndex=calculateDropIndex(Y,possiblePositions);const P=j,he=Z.getAttribute("data-block-id"),te=dropTarget.getAttribute("data-dnd-dragged")!=="yes";if((P==null?void 0:P._id)===he||!te){O();return}if(!lodashEs.has(P,"_id")){g(P,he==="canvas"?null:he,dropIndex),setTimeout(O,300);return}let ue=Z.getAttribute("data-block-id");ue===null&&(ue=z.target.parentElement.getAttribute("data-block-id")),A([P._id],ue==="canvas"?null:ue,dropIndex),O(),setTimeout(removePlaceholder,300)},onDragEnter:z=>{const Z=z,q=Z.target;dropTarget=q;const Y=q.getAttribute("data-block-id"),P=q.getAttribute("data-dnd-dragged")!=="yes";T(Y),Z.stopPropagation(),Z.preventDefault(),possiblePositions=[],P&&calculatePossiblePositions(q),x(!0),v(""),R([])},onDragLeave:z=>{z.target.getAttribute("data-block-id")==="canvas"&&(T(null),x(!1),removePlaceholder(),possiblePositions=[])}}};function getTargetedBlock(r){if(r.getAttribute("data-block-id")==="canvas")return null;if(r.getAttribute("data-block-id")||r.getAttribute("data-block-parent"))return r;const h=r.closest("[data-block-id]");return(h==null?void 0:h.getAttribute("data-block-id"))==="canvas"?null:h}function destroyQuill(r){r.container.innerHTML="",r.container.parentNode.removeChild(r.container);const h=document.querySelector(".ql-toolbar");h&&h.parentNode.removeChild(h),r=null}const useHandleCanvasDblClick=()=>{const r=["Heading","Paragraph","Text","Link","Span","Button"],h=useUpdateBlocksProps(),[x,g]=jotai.useAtom(inlineEditingActiveAtom),{clearHighlight:v}=useBlockHighlight();return R=>{var O;if(x)return;const A=getTargetedBlock(R.target),j=A.getAttribute("data-block-type");if(!j||!r.includes(j))return;const C=A.cloneNode(!0);A.style.display="none",Array.from(C.attributes).forEach(z=>{z.name!=="class"&&C.removeAttribute(z.name)}),j==="Text"&&(C.style.display="inline-block"),A.parentNode.insertBefore(C,A.nextSibling);const T=new ReactQuill.Quill(C,{placeholder:"Type here..."});function M(){const z=T.getText(0,T.getLength());h([A.getAttribute("data-block-id")],{content:z}),A.removeAttribute("style"),C.removeEventListener("blur",M,!0),destroyQuill(T),g(""),v(),C.remove()}C.addEventListener("blur",M,!0),C.addEventListener("click",z=>{z.stopPropagation()}),C.addEventListener("keydown",z=>{(z.key==="Enter"||z.key==="Escape")&&M()}),T.focus(),(O=C.querySelector(".ql-clipboard"))==null||O.remove(),g(A.getAttribute("data-block-id"))}},useHandleCanvasClick=()=>{const[,r]=useSelectedStylingBlocks(),[h,x]=useSelectedBlockIds(),[g]=jotai.useAtom(inlineEditingActiveAtom),[v]=jotai.useAtom(treeRefAtom),{clearHighlight:R}=useBlockHighlight();return A=>{if(g)return;A.stopPropagation();const j=getTargetedBlock(A.target);if(j!=null&&j.getAttribute("data-block-id")&&(j==null?void 0:j.getAttribute("data-block-id"))==="container"){x([]),r([]),R();return}if(j!=null&&j.getAttribute("data-block-parent")){const C=j.getAttribute("data-style-prop"),T=j.getAttribute("data-style-id"),M=j.getAttribute("data-block-parent");h.includes(M)||v==null||v.closeAll(),r([{id:T,prop:C,blockId:M}]),x([M])}else if(j!=null&&j.getAttribute("data-block-id")){const C=j.getAttribute("data-block-id");h.includes(C)||v==null||v.closeAll(),r([]),x(C==="canvas"?[]:[C])}R()}},useHandleMouseMove=()=>{const[r]=jotai.useAtom(inlineEditingActiveAtom),{highlightBlock:h}=useBlockHighlight();return lodashEs.throttle(x=>{if(r)return;const g=getTargetedBlock(x.target);g&&h(g)},20)},useHandleMouseLeave=()=>{const{clearHighlight:r}=useBlockHighlight();return r},Canvas=({children:r})=>{const{document:h}=useFrame(),[x]=useSelectedBlockIds(),[g,v]=useSelectedStylingBlocks(),{clearHighlight:R}=useBlockHighlight();React.useEffect(()=>R,[R]),React.useEffect(()=>{setTimeout(()=>{if(!lodashEs.isEmpty(g))return;const O=getElementByDataBlockId(h,lodashEs.first(x));if(O){const z=O.getAttribute("data-style-prop");if(z){const Z=O.getAttribute("data-style-id"),q=O.getAttribute("data-block-parent");v([{id:Z,prop:z,blockId:q}])}}},100)},[h,x,v,g]);const A=useHandleCanvasDblClick(),j=useHandleCanvasClick(),C=useHandleMouseMove(),T=useHandleMouseLeave(),M=useDnd();return jsxRuntime.jsxRuntimeExports.jsx("div",{"data-block-id":"canvas",id:"canvas",onClick:j,onDoubleClick:A,onMouseMove:C,onMouseLeave:T,...lodashEs.omit(M,"isDragging"),className:"relative h-full max-w-full p-px "+(M.isDragging?"dragging":""),children:r})},getElementByDataBlockId=(r,h)=>r.querySelector(`[data-block-id="${h}"]`),useKeyEventWatcher=r=>{const[h,x]=useSelectedBlockIds(),g=useSelectedBlock(),v=useRemoveBlocks(),R=useDuplicateBlocks(),{undo:A,redo:j}=useUndoManager(),[,C]=useCutBlockIds(),[,T]=useCopyBlockIds(),{canPaste:M,pasteBlocks:O}=usePasteBlocks(),z=r?{document:r}:{};reactHotkeysHook.useHotkeys("ctrl+z,command+z",()=>A(),{},[A]),reactHotkeysHook.useHotkeys("ctrl+y,command+y",()=>j(),{},[j]),reactHotkeysHook.useHotkeys("ctrl+x,command+x",()=>C(h),{},[h,C]),reactHotkeysHook.useHotkeys("ctrl+c,command+c",()=>T(h),{},[h,T]),reactHotkeysHook.useHotkeys("ctrl+v,command+v",()=>{M(h[0])&&O(h)},{...z,preventDefault:!0},[h,M,O]),reactHotkeysHook.useHotkeys("esc",()=>x([]),z,[x]),reactHotkeysHook.useHotkeys("ctrl+d,command+d",()=>R(h),{...z,preventDefault:!0},[h,R]),reactHotkeysHook.useHotkeys("del, backspace",Z=>{Z.preventDefault(),canDeleteBlock(lodashEs.get(g,"_type",""))&&v(h)},z,[h,v])},KeyboardHandler=()=>{const{document:r}=useFrame();return useKeyEventWatcher(r),null},CHAI_BUILDER_EVENTS={OPEN_ADD_BLOCK:"OPEN_ADD_BLOCK",CLOSE_ADD_BLOCK:"CLOSE_ADD_BLOCK",SHOW_BLOCK_SETTINGS:"SHOW_BLOCK_SETTINGS"};class PubSub{constructor(){xm(this,"subscribers",new Map)}subscribe(h,x){return this.subscribers.has(h)||this.subscribers.set(h,new Set),this.subscribers.get(h).add(x),()=>{const g=this.subscribers.get(h);g&&(g.delete(x),g.size===0&&this.subscribers.delete(h))}}publish(h,x){const g=this.subscribers.get(h);g&&g.forEach(v=>v(x))}}const pubsub=new PubSub,BlockActionLabel=({block:r,label:h})=>{const[,x]=useSelectedBlockIds(),[,g]=useHighlightBlockId(),[,v]=jotai.useAtom(draggedBlockAtom),R=flagged.useFeature("dnd");return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-default items-center space-x-1 px-1",draggable:R?"true":"false",onDragStart:A=>{A.dataTransfer.setData("text/plain",JSON.stringify(lodashEs.pick(r,["_id","_type","_name"]))),v(r),setTimeout(()=>{x([]),g(null)},200)},children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DragHandleDots2Icon,{}),h]})},BlockActionsStatic=({selectedBlockElement:r,block:h})=>{const x=useRemoveBlocks(),g=useDuplicateBlocks(),[,v]=useSelectedBlockIds(),[,R]=useHighlightBlockId(),[,A]=useSelectedStylingBlocks(),[j]=jotai.useAtom(inlineEditingActiveAtom),{floatingStyles:C,refs:T,update:M}=reactDom.useFloating({placement:"top-start",middleware:[reactDom.shift(),dom.flip()],elements:{reference:r}});web.useResizeObserver(r,()=>M(),r!==null);const O=lodashEs.get(h,"_parent",null),z=lodashEs.isEmpty(lodashEs.get(h,"_name",""))?lodashEs.get(h,"_type",""):lodashEs.get(h,"_name","");return!r||!h||j?null:jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:T.setFloating,style:C,onClick:Z=>{Z.stopPropagation(),Z.preventDefault()},onMouseEnter:Z=>{Z.stopPropagation(),R(null)},onKeyDown:Z=>Z.stopPropagation(),className:"isolate z-[999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[O&&jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{A([]),v([O])}}),jsxRuntime.jsxRuntimeExports.jsx(BlockActionLabel,{label:z,block:h}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1",children:[canAddChildBlock(lodashEs.get(h,"_type",""))&&jsxRuntime.jsxRuntimeExports.jsx(reactIcons.PlusIcon,{className:"hover:scale-105",onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,h)}),canDuplicateBlock(lodashEs.get(h,"_type",""))?jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CopyIcon,{className:"hover:scale-105",onClick:()=>g([h==null?void 0:h._id])}):null,canDeleteBlock(lodashEs.get(h,"_type",""))?jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TrashIcon,{className:"hover:scale-105",onClick:()=>x([h==null?void 0:h._id])}):null]})]})})},HeadTags=()=>{const[r]=useTheme(),h=useThemeOptions(),[x]=useSelectedBlockIds(),[g]=useDarkMode(),[v]=useSelectedStylingBlocks(),[R]=jotai.useAtom(draggedBlockAtom),[A]=jotai.useAtom(dropTargetBlockIdAtom),{document:j,window:C}=useFrame(),[T]=React.useState(j==null?void 0:j.getElementById("highlighted-block")),[M]=React.useState(j==null?void 0:j.getElementById("selected-block")),[O]=React.useState(j==null?void 0:j.getElementById("selected-styling-block")),[z]=React.useState(j==null?void 0:j.getElementById("dragged-block"));React.useEffect(()=>{g?j==null||j.documentElement.classList.add("dark"):j==null||j.documentElement.classList.remove("dark")},[g,j]),React.useEffect(()=>{!C||!C.tailwind||(C.tailwind.config={darkMode:"class",theme:{extend:{container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...ChaiThemeFn.getChaiThemeOptions(h)}},plugins:[typography,forms,aspectRatio,containerQueries,ChaiThemeFn.plugin(function({addBase:Y,theme:P}){Y({"h1,h2,h3,h4,h5,h6":{fontFamily:P("fontFamily.heading")},body:{fontFamily:P("fontFamily.body"),color:P("colors.foreground"),backgroundColor:P("colors.background")}})})]})},[r,h,C]),React.useEffect(()=>{M&&(M.textContent=`${lodashEs.map(x,Y=>`[data-block-id="${Y}"]`).join(",")}{
|
|
58
|
+
outline: 1px solid ${x.length===1?"#42a1fc !important":"orange !important"}; outline-offset: -1px;
|
|
59
|
+
}`)},[x,M]),React.useEffect(()=>{z.textContent=R?`[data-block-id="${R._id}"], [data-block-id="${R._id}"] > * { pointer-events: none !important; opacity: 0.6 !important}`:""},[R,z]),React.useEffect(()=>{T&&(T.textContent='[data-highlighted="true"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}')},[T]),React.useEffect(()=>{O&&(O.textContent=`${lodashEs.map(v,({id:Y})=>`[data-style-id="${Y}"]`).join(",")}{
|
|
60
60
|
outline: 1px solid orange !important; outline-offset: -1px;
|
|
61
|
-
}`)},[i,m]),React.useEffect(()=>{u.querySelector("#drop-target-block").innerHTML=c?`[data-block-id="${c}"]{ outline: 1px dashed orange !important; outline-offset: -1px;}`:""},[c,u]);const b=React.useMemo(()=>ChaiThemeFn.getChaiThemeCssVariables(o),[o]),R=React.useMemo(()=>ChaiThemeFn.getThemeFontsLinkMarkup(lodashEs.pick(o,["fontFamily"])),[o]);return jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx("style",{id:"chai-theme",children:b}),jsxRuntime.jsxRuntimeExports.jsx("span",{id:"chai-fonts",dangerouslySetInnerHTML:{__html:R}})]})};function AsyncPropsBlock(o){const{dataProvider:n,block:r}=o,a=React.useMemo(()=>n?n(r,o.lang):{},[r,n,o.lang]);return jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:React.createElement(o.component,{...o.props,...a})})}function RuntimePropsBlock(o){const n=useSelectedBlockHierarchy(),r=Object.entries(o.runtimeProps).reduce((a,[i,l])=>{const c=lodashEs.find(n,{_type:l.block});return c&&(a[i]=lodashEs.get(c,l.prop)),a},{});return jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:React.createElement(o.component,{...o.props,...r})})}const useChaiExternalData=()=>jotai.useAtom(chaiExternalDataAtom),generateClassNames=lodashEs.memoize(o=>{const n=o.replace(STRINGS.STYLES_KEY,"").split(",");return tailwindMerge.twMerge(n[0],n[1])});function getElementAttrs(o,n){return lodashEs.get(o,`${n}_attrs`,{})}function getStyleAttrs(o){const n={};return Object.keys(o).forEach(r=>{if(lodashEs.isString(o[r])&&o[r].startsWith(STRINGS.STYLES_KEY)){const a=generateClassNames(o[r]),i=getElementAttrs(o,r);n[r]={className:a,"data-style-prop":r,"data-block-parent":o._id,"data-style-id":`${r}-${o._id}`,...i}}}),n}function applyBindings(o,n){const r=lodashEs.get(o,"_bindings",{});return lodashEs.isEmpty(r)?{...o}:(lodashEs.each(r,(a,i)=>{lodashEs.isString(a)&&lodashEs.get(n,a,null)&&(o[i]=lodashEs.get(n,a,null))}),o)}const getRuntimeProps=lodashEs.memoize(o=>{const n=runtime.getRegisteredChaiBlock(o),r=lodashEs.get(n,"schema.properties",{});return Object.fromEntries(Object.entries(r).filter(([,a])=>lodashEs.get(a,"runtime",!1)))});function isDescendant(o,n,r){if(!lodashEs.find(r,{_id:o}))return!1;const i=lodashEs.filter(r,{_parent:o});return i.some(l=>l._id===n)?!0:i.some(l=>isDescendant(l._id,n,r))}const RenderGlobalBlock=({blocks:o,allBlocks:n})=>jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:n,blocks:o});function applyLanguage(o,n,r){if(lodashEs.isEmpty(n))return o;const a=lodashEs.cloneDeep(o);return lodashEs.forEach(lodashEs.keys(a),i=>{lodashEs.includes(lodashEs.get(r,"i18nProps",[]),i)&&!lodashEs.isEmpty(n)&&(a[i]=lodashEs.get(a,`${i}-${n}`,a[i]))}),a}function BlocksRendererStatic({blocks:o,allBlocks:n}){const{selectedLang:r}=useLanguages(),[a]=useCutBlockIds(),[i]=jotai.useAtom(draggedBlockAtom),[l]=jotai.useAtom(dropTargetBlockIdAtom),[c]=useHiddenBlockIds(),{getGlobalBlocks:u}=useGlobalBlocksStore(),x=React.useCallback(m=>getStyleAttrs(m),[]),[d]=useChaiExternalData(),[p]=jotai.useAtom(inlineEditingActiveAtom);return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:React.Children.toArray(o.map((m,h)=>{if(p===m._id||c.includes(m._id))return null;const b={},R=lodashEs.filter(n,{_parent:m._id});if(b.children=R.length>0?jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:n,blocks:R}):null,m._type==="GlobalBlock"){const g=u(m);b.children=jsxRuntime.jsxRuntimeExports.jsx(RenderGlobalBlock,{blocks:lodashEs.filter(g,E=>!E._parent),allBlocks:g})}const f=runtime.getRegisteredChaiBlock(m._type),y=lodashEs.get(f,"component",null);if(lodashEs.isNull(y))return jsxRuntime.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${m==null?void 0:m._type} not registered -->`});const _=x(m),A=i&&isDescendant(i._id,m._id,n),k={blockProps:{"data-block-id":m._id,"data-block-type":m._type,...i?{"data-dnd":canAcceptChildBlock(m._type,i==null?void 0:i._type)?"yes":"no","data-dnd-dragged":i._id===m._id||A?"yes":"no"}:{},...l===m._id&&!A?{"data-drop":"yes"}:{},...lodashEs.includes(a,m._id)?{"data-cut-block":"yes"}:{}},index:h,...applyBindings(applyLanguage(m,r,f),d),..._,...b,inBuilder:!0,lang:r};if(lodashEs.has(f,"dataProvider"))return jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntime.jsxRuntimeExports.jsx(AsyncPropsBlock,{lang:r,dataProvider:f.dataProvider,block:m,component:y,props:k})});const v=getRuntimeProps(m._type);return v?jsxRuntime.jsxRuntimeExports.jsx(RuntimePropsBlock,{runtimeProps:v,block:m,component:y,props:k}):jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:React.createElement(y,k)})}))})}const dataProvidersAtom=jotai.atom([]);dataProvidersAtom.debugLabel="dataProvidersAtom";const usePageDataProviders=()=>jotai.useAtom(dataProvidersAtom),useAllDataProviders=()=>React.useMemo(()=>[],[]),BlocksExternalDataProvider=({children:o})=>{const[,n]=useChaiExternalData(),[r]=usePageDataProviders(),a=useAllDataProviders();return React.useEffect(()=>(n({}),lodashEs.each(r,i=>{const l=lodashEs.find(a,{providerKey:i.providerKey});if(l){const c=(l==null?void 0:l.mockFn)||(l==null?void 0:l.dataFn);c&&c(i.args).then(u=>n(x=>({...x,[i.providerKey]:u})))}}),()=>{lodashEs.each(r,i=>{n(l=>(delete l[i.providerKey],l))})}),[a,r,n]),jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:o})},StaticBlocksRenderer=()=>{const[o]=useBlocksStore(),n=lodashEs.isEmpty(o)?null:jsxRuntime.jsxRuntimeExports.jsx(BlocksExternalDataProvider,{children:jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:o,blocks:lodashEs.filter(o,r=>lodashEs.isEmpty(r._parent))})});return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:n})},AddBlockAtBottom=()=>{const{t:o}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative w-full cursor-pointer py-2",children:[jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK),className:"h-1 rounded bg-purple-500 opacity-0 duration-200 group-hover:opacity-100",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 transform items-center gap-x-1 rounded-full bg-purple-500 px-3 py-1 text-xs leading-tight text-white hover:bg-purple-500",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{className:"size-2.5 stroke-[3]"})," ",o("Add block")]})}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})},ResizableCanvasWrapper=({children:o,onMount:n,onResize:r})=>{const[,a]=useSelectedBlockIds(),[,i]=useSelectedStylingBlocks(),l=React.useRef(null),c=web.useDebouncedCallback(()=>{const{clientWidth:x}=l.current;r(x)},[l.current],100);web.useResizeObserver(l.current,c,l.current!==null),React.useEffect(()=>{const{clientWidth:x}=l.current;n(x)},[]);const u=()=>{a([]),i([])};return jsxRuntime.jsxRuntimeExports.jsx("div",{id:"main-content",onClick:u,className:"h-full w-full p-8 pb-0",ref:l,children:o})},getElementByStyleId=(o,n)=>o.querySelector(`[data-style-id="${n}"]`),StaticCanvas=()=>{const[o]=jotai.useAtom(networkModeAtom),[n]=useCanvasWidth(),[,r]=useSelectedBlockIds(),a=useSelectedBlock(),[,i]=useHighlightBlockId(),l=React.useRef(null),c=React.useRef(null),[u,x]=React.useState({width:0,height:0}),d=useCanvasScale(u),[p,m]=React.useState([]),[,h]=React.useState([]),[,b]=jotai.useAtom(canvasIframeAtom),[R,f]=useSelectedStylingBlocks(),y=useBuilderProp("loading",!1),_=useBuilderProp("htmlDir","ltr"),A=v=>{x(g=>({...g,width:v}))};React.useEffect(()=>{if(!c.current)return;const{clientWidth:v,clientHeight:g}=c.current;x({width:v,height:g})},[c,n]);const S=(v,g=0)=>{const{top:E}=v.getBoundingClientRect();return E+g>=0&&E-g<=window.innerHeight};React.useEffect(()=>{var v,g;if(a&&a.type!=="Multiple"&&l.current){const E=getElementByDataBlockId(l.current.contentDocument,a._id);E&&(S(E)||(g=(v=l.current)==null?void 0:v.contentWindow)==null||g.scrollTo({top:E.offsetTop,behavior:"smooth"}),m([E]))}},[a]),React.useEffect(()=>{if(!lodashEs.isEmpty(R)&&l.current){const v=getElementByStyleId(l.current.contentDocument,lodashEs.first(R).id);h(v?[v]:[null])}else h([null])},[R]);const k=React.useMemo(()=>{let v=IframeInitialContent;return v=v.replace("__HTML_DIR__",_),o==="offline"&&(v=v.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),v=v.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),v=v.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),v},[o,_]);return jsxRuntime.jsxRuntimeExports.jsx(ResizableCanvasWrapper,{onMount:A,onResize:A,children:jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>{r([]),f([])},onMouseLeave:()=>setTimeout(()=>i(""),300),className:"relative mx-auto h-full w-full overflow-hidden",ref:c,children:jsxRuntime.jsxRuntimeExports.jsxs(ChaiFrame,{contentDidMount:()=>b(l.current),ref:l,id:"canvas-iframe",style:{...d,...lodashEs.isEmpty(d)?{width:`${n}px`}:{}},className:"relative mx-auto box-content h-full w-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:k,children:[jsxRuntime.jsxRuntimeExports.jsx(KeyboardHandler,{}),jsxRuntime.jsxRuntimeExports.jsx(BlockActionsStatic,{block:a,selectedBlockElement:lodashEs.first(p)}),jsxRuntime.jsxRuntimeExports.jsx(HeadTags,{}),jsxRuntime.jsxRuntimeExports.jsx(reactWrapBalancer.Provider,{children:jsxRuntime.jsxRuntimeExports.jsxs(Canvas,{children:[y?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"h-full"})}):jsxRuntime.jsxRuntimeExports.jsx(StaticBlocksRenderer,{}),jsxRuntime.jsxRuntimeExports.jsx(AddBlockAtBottom,{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})}),jsxRuntime.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"pointer-events-none absolute z-[99999] max-w-full bg-green-500 transition-transform"})]})})})},FallbackError=()=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center",children:[jsxRuntime.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),jsxRuntime.jsxRuntimeExports.jsx("p",{children:"Please try again."})]})}),TypeIcon=o=>{switch(o.type){case"GlobalBlock":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.GlobeIcon,{className:"h-3 w-3 stroke-[2]"});case"Image":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ImageIcon,{className:"h-3 w-3 stroke-[2]"});case"Heading":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.HeadingIcon,{className:"h-3 w-3 stroke-[2]"});case"Text":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TextIcon,{className:"h-3 w-3 stroke-[2]"});case"Link":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Link1Icon,{className:"h-3 w-3 stroke-[2]"});case"Video":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.VideoIcon,{className:"h-3 w-3 stroke-[2]"});case"RichText":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CursorTextIcon,{className:"h-3 w-3 stroke-[2]"});case"Button":case"DropdownButton":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ButtonIcon,{className:"h-3 w-3 stroke-[2]"});case"CustomHTML":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CodeIcon,{className:"h-3 w-3 stroke-[2]"});case"Divider":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DividerHorizontalIcon,{className:"h-3 w-3 stroke-[2]"});case"Icon":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.SketchLogoIcon,{className:"h-3 w-3 stroke-[2]"});case"List":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RowsIcon,{className:"h-3 w-3 stroke-[2]"});case"Paragraph":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TextIcon,{className:"h-3 w-3 stroke-[2]"});case"Row":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Rows,{className:"h-3 w-3 stroke-[2]"});case"Column":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Columns,{className:"h-3 w-3 stroke-[2]"});case"ListItem":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ColumnsIcon,{className:"h-3 w-3 stroke-[2]"});case"LineBreak":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.SpaceBetweenVerticallyIcon,{className:"h-3 w-3 stroke-[2]"});case"Form":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.GroupIcon,{className:"h-3 w-3 stroke-[2]"});case"Checkbox":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CheckboxIcon,{className:"h-3 w-3 stroke-[2]"});case"FormButton":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ButtonIcon,{className:"h-3 w-3 stroke-[2]"});case"Input":case"TextArea":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InputIcon,{className:"h-3 w-3 stroke-[2]"});case"Radio":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RadiobuttonIcon,{className:"h-3 w-3 stroke-[2]"});case"Select":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DropdownMenuIcon,{className:"h-3 w-3 stroke-[2]"});case"Table":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TableIcon,{className:"h-3 w-3 stroke-[2]"});case"TableHead":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BorderTopIcon,{className:"h-3 w-3 stroke-[2]"});case"TableBody":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BorderAllIcon,{className:"h-3 w-3 stroke-[2]"});case"TableRow":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ViewHorizontalIcon,{className:"h-3 w-3 stroke-[2]"});case"TableCell":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DragHandleHorizontalIcon,{className:"h-3 w-3 stroke-[2]"});case"DataProvider":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.DatabaseIcon,{className:"h-3 w-3 stroke-[2]"});case"Box":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BoxIcon,{className:"h-3 w-3 stroke-[2]"});case"Dropdown":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DropdownMenuIcon,{className:"h-3 w-3 stroke-[2]"});case"DropdownContent":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ReaderIcon,{className:"h-3 w-3 stroke-[2]"});default:return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BoxModelIcon,{className:"h-3 w-3 stroke-[2]"})}},Breadcrumb=()=>{const o=useSelectedBlockHierarchy(),[,n]=useSelectedBlockIds(),{highlightBlock:r}=useBlockHighlight();return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"-mx-2 border-t border-border bg-background px-2 py-1 text-xs text-muted-foreground",children:jsxRuntime.jsxRuntimeExports.jsxs("ol",{className:"flex items-center whitespace-nowrap",children:[jsxRuntime.jsxRuntimeExports.jsxs("li",{className:"inline-flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>n([]),variant:"ghost",className:"h-fit p-1 text-xs font-normal",children:"Body"}),jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:"rtl:rotate-180",size:16})]}),lodashEs.reverse(o).map((a,i)=>jsxRuntime.jsxRuntimeExports.jsxs("li",{className:"inline-flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{onMouseEnter:()=>{r(a==null?void 0:a._id)},onClick:()=>n([a==null?void 0:a._id]),variant:"ghost",className:"h-fit gap-x-1 p-1 text-xs font-normal",children:[jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:a==null?void 0:a._type}),a._name||a._type]}),i!==o.length-1&&jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:"rtl:rotate-180",size:16})]},i))]})})},CodeEditor$1=React.lazy(()=>Promise.resolve().then(()=>require("./CodeEditor-DCZWTNZX.cjs"))),CanvasArea=()=>{const[o]=useCodeEditor(),n=useBuilderProp("onError",lodashEs.noop);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-full flex-1 flex-col",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40 px-2",children:[jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"h-full"}),children:jsxRuntime.jsxRuntimeExports.jsx(reactErrorBoundary.ErrorBoundary,{fallback:jsxRuntime.jsxRuntimeExports.jsx(FallbackError,{}),onError:n,children:jsxRuntime.jsxRuntimeExports.jsx(StaticCanvas,{})})}),o?jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"h-full"}),children:jsxRuntime.jsxRuntimeExports.jsx(reResizable.Resizable,{enable:{top:!0,bottom:!1},className:"max-h-[400px] min-h-[200px]",children:jsxRuntime.jsxRuntimeExports.jsx(CodeEditor$1,{})})}):null,jsxRuntime.jsxRuntimeExports.jsx(Breadcrumb,{})]})})},FONTS=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"},{title:"Bebas Neue",value:"Bebas Neue"},{title:"Manrope",value:"Manrope"}],FontSelector=({label:o,value:n,onChange:r})=>jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-0.5",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-sm text-slate-800",children:lodashEs.startCase(o)}),jsxRuntime.jsxRuntimeExports.jsx("select",{className:"mt-1 w-full cursor-pointer 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",value:n,onChange:a=>r(a.target.value),children:FONTS.map(a=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:a.value,children:a.title},a.value))})]}),ColorPickerInput=({value:o,onChange:n})=>{const r=lodashEs.debounce(a=>n(a),200);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"relative flex h-6 w-6 cursor-pointer rounded-lg border border-border",style:{backgroundColor:o},children:jsxRuntime.jsxRuntimeExports.jsx("input",{type:"color",value:o.startsWith("#")?o:"#000000",onChange:a=>{const i=a.target.value;/^#[0-9A-F]{6}$/i.test(i)&&r(i)},className:"absolute inset-0 h-full w-full cursor-pointer rounded-lg border-0 opacity-0"})})},BorderRadiusInput=({value:o,onChange:n,disabled:r})=>{const a=lodashEs.debounce(i=>n(i),200);return jsxRuntime.jsxRuntimeExports.jsx("input",{type:"range",min:"0",step:"1",max:"30",disabled:r,defaultValue:o.replace("px",""),onChange:i=>a(i.target.value),className:"flex-1 cursor-pointer"})},ThemeConfigPanel$1=React__namespace.memo(({className:o=""})=>{const[n]=useDarkMode(),[r,a]=React__namespace.useState(""),i=useBuilderProp("themePresets",[]),[l,c]=useTheme(),u=useThemeOptions(),{t:x}=reactI18next.useTranslation(),d=f=>{a(f)},p=()=>{const f=i.find(y=>Object.keys(y)[0]===r);if(f){const y=Object.values(f)[0];y&&typeof y=="object"&&"fontFamily"in y&&"borderRadius"in y&&"colors"in y?c(y):console.error("Invalid preset structure:",y)}else console.error("Preset not found:",r)},m=web.useDebouncedCallback((f,y)=>{c(()=>({...l,fontFamily:{...l.fontFamily,[f.replace(/font-/g,"")]:y}}))},[l],200),h=web.useDebouncedCallback(f=>{c(()=>({...l,borderRadius:`${f}px`}))},[l],200),b=web.useDebouncedCallback((f,y)=>{c(()=>{const _=lodashEs.get(l,`colors.${f}`);return n?lodashEs.set(_,1,y):lodashEs.set(_,0,y),{...l,colors:{...l.colors,[f]:_}}})},[l],200),R=f=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-1",children:Object.entries(f.items).map(([y])=>{const _=lodashEs.get(l,`colors.${y}.${n?1:0}`);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex items-center gap-x-2",children:[jsxRuntime.jsxRuntimeExports.jsx(ColorPickerInput,{value:_,onChange:A=>b(y,A)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-xs font-normal leading-tight text-slate-600",children:y.split(/(?=[A-Z])/).join(" ").replace(/-/g," ").split(" ").map(A=>A.charAt(0).toUpperCase()+A.slice(1)).join(" ")+(!y.toLowerCase().includes("foreground")&&!y.toLowerCase().includes("border")&&!y.toLowerCase().includes("input")&&!y.toLowerCase().includes("ring")&&!y.toLowerCase().includes("background")?" Background":"")})]},y)})});return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("no-scrollbar h-full w-full overflow-y-auto",o),children:[i.length>0&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 py-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-sm text-slate-800",children:x("Presets")}),jsxRuntime.jsxRuntimeExports.jsxs("select",{value:r,onChange:f=>d(f.target.value),className:"w-full space-y-0.5 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:[jsxRuntime.jsxRuntimeExports.jsx("option",{value:"",children:"Select preset"}),Array.isArray(i)&&i.map(f=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:Object.keys(f)[0],children:lodashEs.capitalize(Object.keys(f)[0])},Object.keys(f)[0]))]})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-[30%] items-end",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{className:"w-full text-sm",disabled:r==="",variant:"default",onClick:p,children:x("Apply")})})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("space-y-2",o),children:[(u==null?void 0:u.fontFamily)&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grid gap-4",children:Object.entries(u.fontFamily).map(([f,y])=>jsxRuntime.jsxRuntimeExports.jsx(FontSelector,{label:f,value:l.fontFamily[f.replace(/font-/g,"")]||y[Object.keys(y)[0]],onChange:_=>m(f,_)},f))}),(u==null?void 0:u.borderRadius)&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-0.5 py-3",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-sm text-slate-800",children:x("Border Radius")}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-4 py-2",children:[jsxRuntime.jsxRuntimeExports.jsx(BorderRadiusInput,{value:l.borderRadius,onChange:h}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"w-12 text-sm",children:l.borderRadius})]})]}),(u==null?void 0:u.colors)&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-4 space-y-0.5",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-sm text-slate-800",children:x("Colors")}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-full space-y-4 pt-2",children:u.colors.map(f=>R(f))},n?"dark":"light")]})]}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})}),ThemeConfigPanel$2=Object.freeze(Object.defineProperty({__proto__:null,default:ThemeConfigPanel$1},Symbol.toStringTag,{value:"Module"})),placeholderStyle={display:"flex",alignItems:"center",zIndex:1},DefaultCursor=React.memo(function({top:n,left:r}){const a={position:"absolute",pointerEvents:"none",top:n+"px",left:r+"px",right:0};return jsxRuntime.jsxRuntimeExports.jsx("div",{style:{...placeholderStyle,...a},children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-0.5 flex-1 rounded-[1px] bg-green-500"})})}),Overlay=React.memo(function({children:n,isDragging:r}){return r?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"pointer-events-none fixed left-0 top-0 z-[100] h-full w-full",children:n}):null}),DefaultDragPreview=React.memo(({id:o,isDragging:n,mouse:r})=>{const[a]=useBlocksStore(),i=React.useMemo(()=>a.find(c=>c._id===o),[a,o]),l=React.useMemo(()=>({transform:`translate(${(r==null?void 0:r.x)-10}px, ${(r==null?void 0:r.y)-10}px)`}),[r]);return r?jsxRuntime.jsxRuntimeExports.jsx("div",{children:jsxRuntime.jsxRuntimeExports.jsx(Overlay,{isDragging:n,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute z-50 rounded border border-border bg-gray-100/80 font-semibold text-blue-600 shadow-md dark:border-gray-700 dark:bg-gray-800",style:l,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex !cursor-grab items-center p-0.5","aria-label":`Type: ${i==null?void 0:i._type}`,children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:i==null?void 0:i._type})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:(i==null?void 0:i._name)||(i==null?void 0:i._type)})]})})})}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"hidden"})}),PasteAtRootContextMenu=({parentContext:o,setParentContext:n})=>{const{t:r}=reactI18next.useTranslation(),{canPaste:a,pasteBlocks:i}=usePasteBlocks();return React.useEffect(()=>{a("root")||n(null)},[a("root")]),o&&a("root")&&jsxRuntime.jsxRuntimeExports.jsx("div",{style:{position:"absolute",top:o.y-75,left:o.x-56},onMouseLeave:()=>n(null),className:"w-28 rounded-md border bg-white p-1 shadow-xl",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex cursor-pointer items-center gap-x-4 rounded px-2 py-1 text-xs hover:bg-blue-50",onClick:()=>{i("root"),n(null)},children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CardStackIcon,{})," ",r("Paste")]})})},CopyPasteBlocks=()=>{const[o]=useBlocksStore(),[n]=useSelectedBlockIds(),{pasteBlocks:r}=usePasteBlocks(),[,a]=useCopyBlockIds(),{t:i}=reactI18next.useTranslation(),l=useSelectedBlock(),c=React.useCallback(()=>{const u=n.map(x=>{const d=o.find(p=>p._id===x);return{id:x,data:d}});a(u.map(x=>x.id))},[n,o,a]);return jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{disabled:!canDuplicateBlock(l==null?void 0:l._type),onClick:c,className:"flex items-center gap-x-4 text-xs",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CopyIcon,{})," ",i("Copy")]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>{r(n)},children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CardStackIcon,{})," ",i("Paste")]})]})},CutBlocks=()=>{const[o]=useSelectedBlockIds(),[,n]=useCutBlockIds(),{t:r}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(o),children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ScissorsIcon,{})," ",r("Cut")]})},RemoveBlocks=()=>{const[o]=useSelectedBlockIds(),n=useRemoveBlocks(),r=useSelectedBlock(),{t:a}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{disabled:!canDeleteBlock(r==null?void 0:r._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>n(o),children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TrashIcon,{})," ",a("Remove")]})},BlockContextMenuContent=()=>{const{t:o}=reactI18next.useTranslation(),[n]=useSelectedBlockIds(),r=useDuplicateBlocks(),a=useSelectedBlock(),i=React.useCallback(()=>{r(n)},[n,r]);return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuContent,{className:"border-border text-xs",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{disabled:!canAddChildBlock(a==null?void 0:a._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,a),children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{size:"14"})," ",o("Add block")]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{disabled:!canDuplicateBlock(a==null?void 0:a._type),className:"flex items-center gap-x-4 text-xs",onClick:i,children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CardStackPlusIcon,{})," ",o("Duplicate")]}),jsxRuntime.jsxRuntimeExports.jsx(CutBlocks,{}),jsxRuntime.jsxRuntimeExports.jsx(CopyPasteBlocks,{}),jsxRuntime.jsxRuntimeExports.jsx(RemoveBlocks,{})]})},BlockContextMenu=({children:o})=>jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenu,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.ContextMenuTrigger,{asChild:!0,children:o}),jsxRuntime.jsxRuntimeExports.jsx(BlockContextMenuContent,{})]})}),defaultShortcuts=[{key:"ArrowDown",command:"selectNext"},{key:"ArrowUp",command:"selectPrev"},{key:"ArrowLeft",command:"selectParent",when:"isLeaf || isClosed"},{key:"ArrowLeft",command:"close",when:"isOpen"},{key:"ArrowRight",command:"open",when:"isClosed"},{key:"ArrowRight",command:"selectNext",when:"isOpen"},{key:"Home",command:"selectFirst"},{key:"End",command:"selectLast"}];function selectFirst(o){o.firstNode&&o.select(o.firstNode.id)}function selectLast(o){o.lastNode&&o.select(o.lastNode.id)}function selectNext(o){const n=o.selectedNodes[0].next||o.firstNode;o.select(n.id)}function selectPrev(o){const n=o.selectedNodes[0].prev||o.lastNode;o.select(n.id)}const selectParent=(o,n)=>{var a;const r=((a=o.selectedIds[0])==null?void 0:a.parent)||null;r&&n&&o.select(r.id)},open=(o,n)=>{const r=o.selectedNodes[0];r.isInternal&&n&&r.open()},close=(o,n)=>{const r=o.selectedNodes[0];r.isInternal&&n&&r.close()};function VscJson(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.984V2h-.09c-.313 0-.616.062-.909.185a2.33 2.33 0 0 0-.775.53 2.23 2.23 0 0 0-.493.753v.001a3.542 3.542 0 0 0-.198.83v.002a6.08 6.08 0 0 0-.024.863c.012.29.018.58.018.869 0 .203-.04.393-.117.572v.001a1.504 1.504 0 0 1-.765.787 1.376 1.376 0 0 1-.558.115H2v.984h.09c.195 0 .38.04.556.121l.001.001c.178.078.329.184.455.318l.002.002c.13.13.233.285.307.465l.001.002c.078.18.117.368.117.566 0 .29-.006.58-.018.869-.012.296-.004.585.024.87v.001c.033.283.099.558.197.824v.001c.106.273.271.524.494.753.223.23.482.407.775.53.293.123.596.185.91.185H6v-.984h-.09c-.2 0-.387-.038-.563-.115a1.613 1.613 0 0 1-.457-.32 1.659 1.659 0 0 1-.309-.467c-.074-.18-.11-.37-.11-.573 0-.228.003-.453.011-.672.008-.228.008-.45 0-.665a4.639 4.639 0 0 0-.055-.64 2.682 2.682 0 0 0-.168-.609A2.284 2.284 0 0 0 3.522 8a2.284 2.284 0 0 0 .738-.955c.08-.192.135-.393.168-.602.033-.21.051-.423.055-.64.008-.22.008-.442 0-.666-.008-.224-.012-.45-.012-.678a1.47 1.47 0 0 1 .877-1.354 1.33 1.33 0 0 1 .563-.121H6zm4 10.032V14h.09c.313 0 .616-.062.909-.185.293-.123.552-.3.775-.53.223-.23.388-.48.493-.753v-.001c.1-.266.165-.543.198-.83v-.002c.028-.28.036-.567.024-.863-.012-.29-.018-.58-.018-.869 0-.203.04-.393.117-.572v-.001a1.502 1.502 0 0 1 .765-.787 1.38 1.38 0 0 1 .558-.115H14v-.984h-.09c-.196 0-.381-.04-.557-.121l-.001-.001a1.376 1.376 0 0 1-.455-.318l-.002-.002a1.415 1.415 0 0 1-.307-.465v-.002a1.405 1.405 0 0 1-.118-.566c0-.29.006-.58.018-.869a6.174 6.174 0 0 0-.024-.87v-.001a3.537 3.537 0 0 0-.197-.824v-.001a2.23 2.23 0 0 0-.494-.753 2.331 2.331 0 0 0-.775-.53 2.325 2.325 0 0 0-.91-.185H10v.984h.09c.2 0 .387.038.562.115.174.082.326.188.457.32.127.134.23.29.309.467.074.18.11.37.11.573 0 .228-.003.452-.011.672-.008.228-.008.45 0 .665.004.222.022.435.055.64.033.214.089.416.168.609a2.285 2.285 0 0 0 .738.955 2.285 2.285 0 0 0-.738.955 2.689 2.689 0 0 0-.168.602c-.033.21-.051.423-.055.64a9.15 9.15 0 0 0 0 .666c.008.224.012.45.012.678a1.471 1.471 0 0 1-.877 1.354 1.33 1.33 0 0 1-.563.121H10z"},child:[]}]})(o)}function BsLightningFill(o){return iconBase.GenIcon({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641z"},child:[]}]})(o)}function TbEyeDown(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"},child:[]},{tag:"path",attr:{d:"M12 18c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"},child:[]},{tag:"path",attr:{d:"M19 16v6"},child:[]},{tag:"path",attr:{d:"M22 19l-3 3l-3 -3"},child:[]}]})(o)}function BiCollapseVertical(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 7.59 7.05 2.64 5.64 4.05 12 10.41l6.36-6.36-1.41-1.41L12 7.59zM5.64 19.95l1.41 1.41L12 16.41l4.95 4.95 1.41-1.41L12 13.59l-6.36 6.36z"},child:[]}]})(o)}function BiExpandVertical(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12 19.24-4.95-4.95-1.41 1.42L12 22.07l6.36-6.36-1.41-1.42L12 19.24zM5.64 8.29l1.41 1.42L12 4.76l4.95 4.95 1.41-1.42L12 1.93 5.64 8.29z"},child:[]}]})(o)}const currentAddSelection=jotai.atom(null),Node=React.memo(({node:o,style:n,dragHandle:r})=>{var T;const a=useBuilderProp("outlineMenuItems",[]),{t:i}=reactI18next.useTranslation(),[l,,c]=useHiddenBlockIds(),[u]=jotai.useAtom(canvasIframeAtom);let x=null;const d=o.children.length>0,{highlightBlock:p,clearHighlight:m}=useBlockHighlight(),{id:h,data:b,isSelected:R,willReceiveDrop:f,isDragging:y,isEditing:_,handleClick:A}=o,S=I=>{I.stopPropagation(),!l.includes(h)&&o.toggle()},k=I=>{I.isInternal&&(x=I.isOpen,I.isOpen&&I.close())},v=I=>{I.isInternal&&x!==null&&(x?I.open():I.close(),x=null)},[g,E]=jotai.useAtom(currentAddSelection),w=()=>{var I;j(),o.parent.isSelected||E((I=o==null?void 0:o.parent)==null?void 0:I.id)},j=()=>{E(null)},C=I=>{j(),I.stopPropagation(),!o.isOpen&&!l.includes(h)&&o.toggle(),A(I)};React.useEffect(()=>{const I=setTimeout(()=>{f&&!o.isOpen&&!y&&!l.includes(h)&&o.toggle()},500);return()=>clearTimeout(I)},[f,o,y]);const B=React.useMemo(()=>{const I=Object.keys(b),L=[];for(let P=0;P<I.length;P++)if(I[P].endsWith("_attrs")){const D=b[I[P]],H=Object.keys(D).join("|");H.match(/x-data/)&&L.push("data"),H.match(/x-on/)&&L.push("event"),H.match(/x-show|x-if/)&&L.push("show")}return L},[b]),N=(I,L)=>{const P=u.contentDocument||u.contentWindow.document,D=P.querySelector(`[data-block-id=${I}]`);D&&D.setAttribute("data-drop",L);const H=D.getBoundingClientRect(),V=u.getBoundingClientRect();H.top>=V.top&&H.left>=V.left&&H.bottom<=V.bottom&&H.right<=V.right||(P.documentElement.scrollTop=D.offsetTop-V.top)},M=I=>{j();const L=lodashEs.get(o,"parent.id");L!=="__REACT_ARBORIST_INTERNAL_ROOT__"?pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{_id:L,position:I}):pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{position:I})};return h===STRINGS.ROOT_TEMP_KEY?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative w-full cursor-pointer",children:[jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>M(-1),className:"h-1 rounded bg-purple-500 opacity-0 duration-200 group-hover:opacity-100",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 transform items-center gap-x-1 rounded-full bg-purple-500 px-3 py-1 text-[9px] leading-tight text-white hover:bg-purple-500",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{className:"h-2 w-2 stroke-[3]"})," ",i("Add block")]})}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]}):jsxRuntime.jsxRuntimeExports.jsx(BlockContextMenu,{id:h,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-full",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>p(h),onMouseLeave:()=>m(),onClick:C,style:n,"data-node-id":h,ref:l.includes(h)?null:r,onDragStart:()=>k(o),onDragEnd:()=>v(o),onDragOver:I=>{I.preventDefault(),N(h,"yes")},onDragLeave:I=>{I.preventDefault(),N(h,"no")},onDrop:I=>{I.preventDefault(),N(h,"no")},children:[(o==null?void 0:o.rowIndex)>0&&(o.parent.isOpen&&canAddChildBlock(lodashEs.get(o,"parent.data._type"))||((T=o==null?void 0:o.parent)==null?void 0:T.id)==="__REACT_ARBORIST_INTERNAL_ROOT__")&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"group relative ml-5 h-full w-full cursor-pointer",children:jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:I=>{I.stopPropagation(),M(o.childIndex)},onMouseEnter:w,onMouseLeave:j,className:"absolute -top-0.5 h-1 w-[90%] rounded bg-purple-500 opacity-0 delay-200 duration-200 group-hover:opacity-100",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute left-1/2 top-1/2 flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 transform items-center justify-center rounded-full bg-purple-500 p-1 outline outline-2 outline-white hover:bg-purple-500",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{className:"h-3 w-3 stroke-[4] text-white"})})})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("group flex w-full cursor-pointer items-center justify-between space-x-px !rounded p-1 text-foreground/80 outline-none",R?"bg-blue-500 text-white":"hover:bg-slate-200 dark:hover:bg-gray-800",f&&canAcceptChildBlock(b._type,"Icon")?"bg-green-200":"",(o==null?void 0:o.id)===g?"bg-purple-100":"",y&&"opacity-20",l.includes(h)?"opacity-50":""),children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center transition-transform duration-100 ${o.isOpen?"rotate-90":""}`,children:d&&jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:S,type:"button",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:`h-3 w-3 stroke-[3] ${R?"text-slate-200":"text-slate-400"}`})})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"leading-1 flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:b==null?void 0:b._type}),_?jsxRuntime.jsxRuntimeExports.jsx(Input,{node:o}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"ml-1.5 flex items-center gap-x-1 truncate text-[13px]",onDoubleClick:I=>{I.stopPropagation(),o.edit(),o.deselect()},children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:(b==null?void 0:b._name)||(b==null?void 0:b._type.split("/").pop())}),B.includes("data")&&jsxRuntime.jsxRuntimeExports.jsx(VscJson,{className:"h-3 w-3 text-orange-600"}),B.includes("event")&&jsxRuntime.jsxRuntimeExports.jsx(BsLightningFill,{className:"h-3 w-3 text-yellow-500"}),B.includes("show")&&jsxRuntime.jsxRuntimeExports.jsx(TbEyeDown,{className:"h-3 w-3 text-orange-600"})]})]})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"invisible flex items-center space-x-1.5 pr-2 group-hover:visible",children:[!l.includes(h)&&a.map(I=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:React.createElement(I.item,{blockId:h})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-10",children:I.tooltip})]})),canAddChildBlock(b==null?void 0:b._type)&&!l.includes(h)?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{_id:h}),className:"cursor-pointer rounded bg-transparent hover:text-black",asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{size:"15"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",side:"left",children:i("Add block")})]}):null,jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{onClick:I=>{I.stopPropagation(),c(h),o.isOpen&&o.toggle()},className:"cursor-pointer rounded bg-transparent hover:text-black",asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.EyeOff,{size:"15"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",side:"left",children:i("Hide block")})]})]})]})]})})})}),Input=({node:o})=>{var n,r;return jsxRuntime.jsxRuntimeExports.jsx("input",{autoFocus:!0,className:iconBase.cn("ml-2 !h-4 w-full rounded-sm border border-border bg-background px-1 text-[11px] leading-tight outline-none",o.isSelected?"text-black dark:text-white":""),type:"text",defaultValue:((n=o.data)==null?void 0:n._name)||((r=o.data)==null?void 0:r._type),onFocus:a=>a.currentTarget.select(),onBlur:a=>o.submit(a.currentTarget.value),onKeyDown:a=>{a.key==="Enter"&&o.submit(a.currentTarget.value)}})},useCanMove=()=>{const[o]=useBlocksStore();return(n,r)=>{var l;const a=(l=lodashEs.find(o,{_id:r}))==null?void 0:l._type,i=lodashEs.first(n.map(c=>{var u;return(u=lodashEs.find(o,{_id:c}))==null?void 0:u._type}));return canAcceptChildBlock(a,i)}},ListTree=()=>{const[treeData]=jotai.useAtom(treeDSBlocks),[ids,setIds]=useSelectedBlockIds(),[cutBlocksIds]=useCutBlockIds(),[,setHiddenBlocks]=useHiddenBlockIds(),updateBlockProps=useUpdateBlocksProps(),[,setStyleBlocks]=useSelectedStylingBlocks(),{moveBlocks}=useBlocksStoreUndoableActions(),canMove=useCanMove(),treeRef=React.useRef(null),[,setTreeRef]=jotai.useAtom(treeRefAtom),{t}=reactI18next.useTranslation(),[parentContext,setParentContext]=React.useState(null),clearSelection=()=>{setIds([]),setStyleBlocks([])},filteredTreeData=React.useMemo(()=>{const o=(r,a)=>r.filter(i=>!a.includes(i._id)).map(i=>({...i,children:i.children?o(i.children,a):[]}));return[...o(treeData,cutBlocksIds),{_type:STRINGS.ROOT_TEMP_KEY,_id:STRINGS.ROOT_TEMP_KEY,children:[]}]},[treeData,cutBlocksIds]),onRename=({id:o,name:n,node:r})=>{updateBlockProps([o],{_name:n},r.data._name)},onMove=({dragIds:o,parentId:n,index:r})=>{canMove(o,n)&&moveBlocks(o,n,r)},onSelect=o=>{if(o.length===0)return;const n=o[0]?o[0].id:"";setStyleBlocks([]),setIds([n])},onContextMenu=o=>{var a;o.preventDefault(),parentContext&&setParentContext(null);const n=o.target,r=n.getAttribute("data-node-id")||((a=n.closest("[data-node-id]"))==null?void 0:a.getAttribute("data-node-id"));r?(setStyleBlocks([]),setIds([r])):(setStyleBlocks([]),setIds([]),setParentContext({x:o.clientX,y:o.clientY}))},debouncedDisableDrop=web.useDebouncedCallback(({parentNode:o,dragNodes:n})=>{var r;return(o==null?void 0:o.data._type)===STRINGS.ROOT_TEMP_KEY||!canAcceptChildBlock(o==null?void 0:o.data._type,(r=n[0])==null?void 0:r.data._type)},[],300),handleKeyDown=e=>{if(!treeRef.current)return;const tree=treeRef.current,selectedNode=tree.selectedNodes[0];if(!selectedNode)return;setIds[selectedNode.id],setStyleBlocks([]);const isLeaf=!selectedNode.isInternal,isClosed=!selectedNode.isOpen,isOpen=selectedNode.isOpen,shortcut=defaultShortcuts.find(s=>s.key===e.key&&(!s.when||eval(s.when)));if(shortcut)switch(e.preventDefault(),shortcut.command){case"selectNext":selectNext(tree);break;case"selectPrev":selectPrev(tree);break;case"selectParent":selectParent(tree,isLeaf||isClosed);break;case"close":close(tree,isOpen);break;case"open":open(tree,isClosed);break;case"selectFirst":selectFirst(tree);break;case"selectLast":selectLast(tree);break}};return React.useEffect(()=>{const o=()=>{treeRef.current&&setTreeRef(treeRef.current)};o();const n=new MutationObserver(o);return n.observe(document.body,{childList:!0,subtree:!0}),()=>n.disconnect()},[setTreeRef]),lodashEs.isEmpty(treeData)?jsxRuntime.jsxRuntimeExports.jsx("div",{children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-10 flex h-full w-full items-center justify-center p-8 text-center",children:jsxRuntime.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 text-sm text-gray-400",children:[t("This page is empty"),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK),variant:"default",size:"sm",children:["+ ",t("Add Block")]})]})})}):jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:iconBase.cn("flex h-full select-none flex-col space-y-1"),onClick:()=>clearSelection(),children:jsxRuntime.jsxRuntimeExports.jsxs("div",{id:"outline-view",className:"no-scrollbar h-full overflow-y-auto text-sm",onKeyDown:o=>{treeRef.current.isEditing||handleKeyDown(o)},children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex items-center justify-end gap-x-2 pb-2 text-sm text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>setHiddenBlocks([]),variant:"outline",className:"h-fit p-1 disabled:cursor-not-allowed disabled:opacity-50",size:"sm",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Eye,{className:"h-4 w-4"})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",children:t("Show hidden blocks")})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{className:"h-fit p-1",onClick:()=>{var o;return(o=treeRef==null?void 0:treeRef.current)==null?void 0:o.openAll()},variant:"outline",size:"sm",children:jsxRuntime.jsxRuntimeExports.jsx(BiExpandVertical,{size:"14"})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",children:t("Expand all")})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{className:"h-fit p-1",onClick:()=>{var o;return(o=treeRef==null?void 0:treeRef.current)==null?void 0:o.closeAll()},variant:"outline",size:"sm",children:jsxRuntime.jsxRuntimeExports.jsx(BiCollapseVertical,{size:"14"})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",children:t("Collapse all")})]})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"group relative z-[9999] ml-5 w-full cursor-pointer",children:jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{position:0}),className:"h-1 w-[90%] rounded bg-purple-500 opacity-0 duration-200 group-hover:opacity-100",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute left-[45%] top-1/2 flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 transform items-center justify-center rounded-full bg-purple-500 p-1 outline outline-2 outline-white hover:bg-purple-500",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{className:"h-3 w-3 stroke-[3] text-white"})})})}),jsxRuntime.jsxRuntimeExports.jsx(reactArborist.Tree,{ref:treeRef,height:window.innerHeight-160,className:"no-scrollbar !h-full max-w-full space-y-1 !overflow-y-auto !overflow-x-hidden",rowClassName:"flex items-center h-full border-b border-transparent",selection:ids[0]||"",onRename,openByDefault:!1,onMove,data:[...filteredTreeData],renderCursor:DefaultCursor,onSelect,childrenAccessor:o=>o.children,width:"100%",rowHeight:28,renderDragPreview:DefaultDragPreview,indent:10,onContextMenu,disableDrop:debouncedDisableDrop,idAccessor:"_id",children:Node})]})}),jsxRuntime.jsxRuntimeExports.jsx(PasteAtRootContextMenu,{parentContext,setParentContext})]})},hasVideoEmbed=o=>{const n=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,r=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return n.test(o)||r.test(o)},getVideoURLFromHTML=o=>{if(lodashEs.isEmpty(o))return o;const n=/<video[^>]+src=['"]([^'">]+)['"]/,r=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=o.match(n),i=o.match(r),l=a?a[1]:i?i[1]:null,c=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,u=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return l&&(c.test(l)||u.test(l))?l:o},NAME_ATTRIBUTES=["chai-name","data-chai-name"],ATTRIBUTE_MAP={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},shouldAddText=(o,n)=>o.children.length===1&&lodashEs.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],n._type),getTextContent=o=>o.map(n=>n.type==="text"?lodashEs.get(n,"content",""):lodashEs.isEmpty(n.children)?"":getTextContent(n.children)).join(""),getSanitizedValue=o=>o===null?"":o,getAttrs=o=>{if(o.tagName==="svg")return{};const n={},r=ATTRIBUTE_MAP[o.tagName]||{},a=o.attributes;return lodashEs.forEach(a,({key:i,value:l})=>{if(!lodashEs.includes(NAME_ATTRIBUTES,i))if(r[i]){if(o.tagName==="img"&&i==="src"&&!l.startsWith("http")){const c=lodashEs.find(o.attributes,{key:"width"}),u=lodashEs.find(o.attributes,{key:"height"});c&&u?l=`https://via.placeholder.com/${c==null?void 0:c.value}x${u==null?void 0:u.value}`:l="https://via.placeholder.com/150x150"}lodashEs.set(n,r[i],getSanitizedValue(l))}else lodashEs.includes(["style","class","srcset"],i)||(lodashEs.has(n,"styles_attrs")||(n.styles_attrs={}),lodashEs.startsWith(i,"@")&&(i=i.replace("@","x-on:")),n.styles_attrs[`${i}`]=getSanitizedValue(l))}),delete n.class,n},getStyles=(o,n="styles")=>{if(!o.attributes)return{[n]:`${STRINGS.STYLES_KEY},`};const r=lodashEs.find(o.attributes,{key:"class"});if(r){const a=r.value;return{[n]:`${STRINGS.STYLES_KEY},${a}`}}return{[n]:`${STRINGS.STYLES_KEY},`}},getBlockProps=o=>{const n=lodashEs.get(o,"attributes",[]),r=n.find(u=>u.key==="data-chai-richtext"||u.key==="chai-richtext"),a=n.find(u=>u.key==="data-chai-lightbox"||u.key==="chai-lightbox"),i=n.find(u=>u.key==="data-chai-dropdown"||u.key==="chai-dropdown"),l=n.find(u=>u.key==="data-chai-dropdown-button"||u.key==="chai-dropdown-button"),c=n.find(u=>u.key==="data-chai-dropdown-content"||u.key==="chai-dropdown-content");if(i)return{_type:"Dropdown"};if(l)return{_type:"DropdownButton"};if(c)return{_type:"DropdownContent"};if(r)return{_type:"RichText"};if(a)return{_type:"LightBoxLink"};switch(o.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:o.tagName,_listType:o.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:o.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:o.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:o.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:o.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const u=lodashEs.get(o,"children",[]).length>0?"Box":"EmptyBox";return{_type:u,tag:o.tagName,_name:u=="EmptyBox"||o.tagName==="div"?u:lodashEs.capitalize(o.tagName)}}}},traverseNodes=(o,n=null)=>lodashEs.flatMapDeep(o,r=>{var m,h,b,R,f,y,_,A;if(r.type==="comment")return[];console.log("node ===>",r);let a={_id:iconBase.generateUUID()};if(n&&(a._parent=n.block._id),r.type==="text")return lodashEs.isEmpty(lodashEs.get(r,"content",""))?[]:n&&shouldAddText(n.node,n.block)?(lodashEs.set(n,"block.content",lodashEs.get(r,"content","")),[]):{...a,_type:"Text",content:lodashEs.get(r,"content","")};const i=lodashEs.get(r,"attributes",[]),l=i.find(S=>S.key==="data-chai-richtext"||S.key==="chai-richtext"),c=i.find(S=>S.key==="data-chai-lightbox"||S.key==="chai-lightbox"),u=i.find(S=>S.key==="data-chai-dropdown"||S.key==="chai-dropdown"),x=i.find(S=>S.key==="data-chai-dropdown-button"||S.key==="chai-dropdown-button"),d=i.find(S=>S.key==="data-chai-dropdown-content"||S.key==="chai-dropdown-content");if(a={...a,...getBlockProps(r),...getAttrs(r),...getStyles(r)},r.attributes){const S=r.attributes.find(k=>lodashEs.includes(NAME_ATTRIBUTES,k.key));S&&(a._name=S.value)}if(l)return a.content=himalaya.stringify(r.children),lodashEs.has(a,"styles_attrs.data-chai-richtext")&&delete a.styles_attrs["data-chai-richtext"],lodashEs.has(a,"styles_attrs.chai-richtext")&&delete a.styles_attrs["chai-richtext"],[a];if(c){const S=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];a={...a,href:((m=i.find(k=>k.key==="href"))==null?void 0:m.value)||"",hrefType:((h=i.find(k=>k.key==="data-vbtype"))==null?void 0:h.value)||"video",autoplay:((b=i.find(k=>k.key==="data-autoplay"))==null?void 0:b.value)==="true"?"true":"false",maxWidth:((f=(R=i.find(k=>k.key==="data-maxwidth"))==null?void 0:R.value)==null?void 0:f.replace("px",""))||"",backdropColor:((y=i.find(k=>k.key==="data-overlay"))==null?void 0:y.value)||"",galleryName:((_=i.find(k=>k.key==="data-gall"))==null?void 0:_.value)||""},lodashEs.forEach(S,k=>{lodashEs.has(a,`styles_attrs.${k}`)&&delete a.styles_attrs[k]})}if(u&&(delete a.styles_attrs,a.showDropdown=!1),d&&delete a.styles_attrs,x){delete a.styles_attrs;const S=lodashEs.filter(r.children||[],v=>(v==null?void 0:v.tagName)!=="span");a.content=getTextContent(S);const k=lodashEs.find(r.children||[],v=>(v==null?void 0:v.tagName)==="span"&&lodashEs.some(v.children||[],g=>(g==null?void 0:g.tagName)==="svg"));if(k){const v=lodashEs.find(k.children||[],g=>(g==null?void 0:g.tagName)==="svg");if(v){a.icon=himalaya.stringify([v]);const{height:g,width:E}=getSvgDimensions(v,"16px","16px");a.iconHeight=g,a.iconWidth=E}}return[a]}if(a._type==="Input"){const S=a.inputType||"text";S==="checkbox"?lodashEs.set(a,"_type","Checkbox"):S==="radio"&&lodashEs.set(a,"_type","Radio")}else if(r.tagName==="video"||r.tagName==="iframe"){const S=himalaya.stringify([r]);return hasVideoEmbed(S)&&(lodashEs.set(a,"_type","Video"),lodashEs.set(a,"url",getVideoURLFromHTML(S)),lodashEs.set(a,"styles",`${STRINGS.STYLES_KEY},`),lodashEs.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=S,[a]}else if(r.tagName==="svg"){const S=lodashEs.find(r.attributes,{key:"height"}),k=lodashEs.find(r.attributes,{key:"width"}),v=lodashEs.get(S,"value")?`[${lodashEs.get(S,"value")}px]`:"24px",g=lodashEs.get(k,"value")?`[${lodashEs.get(k,"value")}px]`:"24px",E=lodashEs.get(lodashEs.find(r.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${STRINGS.STYLES_KEY}, ${iconBase.cn(`w-${g} h-${v}`,E)}`.trim(),r.attributes=lodashEs.filter(r.attributes,w=>!lodashEs.includes(["style","width","height","class"],w.key)),a.icon=himalaya.stringify([r]),[a]}else if(r.tagName=="option"&&n&&((A=n.block)==null?void 0:A._type)==="Select")return n.block.options.push({label:getTextContent(r.children),...getAttrs(r)}),[];const p=traverseNodes(r.children,{block:a,node:r});return[a,...p]}),getSvgDimensions=(o,n,r)=>{const a=lodashEs.get(o,"attributes",[]),i=lodashEs.find(a,{key:"height"}),l=lodashEs.find(a,{key:"width"});return{height:lodashEs.get(i,"value")?`[${lodashEs.get(i,"value")}px]`:r,width:lodashEs.get(l,"value")?`[${lodashEs.get(l,"value")}px]`:n}},getSanitizedHTML=o=>{o=o.replace(/(\w+)=\\?"(.*?)\\?"/g,(a,i,l)=>{let c=l.replace(/\\"/g,'"');return c=c.replace(/{([^}]+)}/g,u=>u.replace(/"/g,'\\"')),`${i}="${c.replace(/\\"/g,'"')}"`}),o=o.replace(/\\n/g,"").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g,"");const n=o.match(/<body[^>]*>[\s\S]*?<\/body>/);return(n&&n.length>0?n[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):o).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},getBlocksFromHTML=o=>{const n=himalaya.parse(getSanitizedHTML(o));return lodashEs.isEmpty(o)?[]:lodashEs.flatten(traverseNodes(n))},ImportHTML=({parentId:o,position:n})=>{const{t:r}=reactI18next.useTranslation(),[a,i]=React.useState(""),{addPredefinedBlock:l}=useAddBlock(),c=()=>{const u=getBlocksFromHTML(a);l([...u],o,n),i(""),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)};return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Card,{className:"border-border/0 p-0 shadow-none",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.CardHeader,{className:"p-3",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.CardDescription,{children:r("Use HTML snippets from Tailwind CSS component libraries")})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.CardContent,{className:"space-y-2 px-3 py-0",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{htmlFor:"current",className:"text-sm",children:r("Tailwind HTML snippet")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{autoFocus:!0,tabIndex:1,ref:u=>u&&u.focus(),onChange:u=>i(u.target.value),rows:12,value:a,placeholder:r("Enter your code snippet here"),className:"resize-none overflow-x-auto whitespace-pre bg-background font-mono text-xs font-normal"})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.CardFooter,{className:"flex flex-col justify-end p-3",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:a.trim()==="",onClick:()=>c(),size:"sm",className:"w-fit",children:r("Import HTML")})})]})},GlobalBlockSettings=()=>{const o=useSelectedBlock(),{data:n,refetch:r,isLoading:a}=useGlobalBlocksList(),i=useUpdateBlocksProps();return jsxRuntime.jsxRuntimeExports.jsxs("div",{children:[jsxRuntime.jsxRuntimeExports.jsx("label",{className:"text-sm",children:"Choose a global block"}),jsxRuntime.jsxRuntimeExports.jsxs("select",{className:"h-8 w-full rounded-md border border-border bg-gray-50 p-0 px-2 text-xs dark:bg-gray-800",value:(o==null?void 0:o.globalBlock)||"",onChange:l=>{var c;i([o._id],{globalBlock:l.target.value,_name:`Global: ${lodashEs.startCase((c=lodashEs.get(n,l.target.value,""))==null?void 0:c.name)}`})},children:[jsxRuntime.jsxRuntimeExports.jsx("option",{value:"",children:"Select a global block"}),Object.keys(n).map(l=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:l,children:n[l].name||l},l))]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-2 text-xs",children:jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:r,className:"rounded-md bg-gray-100 p-1 px-2 text-xs hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700",children:a?"Loading...":"Refresh List"})})]})},BindingWidget=()=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),getSvgMarkup=o=>{try{const n=document.getElementById("icon-picker-field"),r=document.createElement("div");ReactDOM.render(jsxRuntime.jsxRuntimeExports.jsx(IconPicker.IconPickerItem,{value:o}),r),n.appendChild(r),r.hidden=!0;const a=r.innerHTML;setTimeout(()=>n.removeChild(r),100);const l=new DOMParser().parseFromString(a,"image/svg+xml"),c=l.querySelector("svg");return c&&(c.removeAttribute("width"),c.removeAttribute("height")),new XMLSerializer().serializeToString(l)}catch(n){return console.error(n),""}},IconPickerField=({value:o,onChange:n})=>{const{t:r}=reactI18next.useTranslation(),a=i=>{n("<svg />");const l=getSvgMarkup(i);n(l)};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o?o.replace("<svg",'<svg class="h-5 w-5"'):"<svg class='h-5 w-5' />"},className:"absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"}),jsxRuntime.jsxRuntimeExports.jsx(IconPicker,{value:o||"BiSolidGrid",onChange:a,pickButtonStyle:{position:"relative",height:"48px",width:"48px",border:"1px solid #999",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",backgroundColor:"transparent",zIndex:1},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),jsxRuntime.jsxRuntimeExports.jsx("textarea",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",value:o,onChange:i=>n(i.target.value),placeholder:r("Choose Icon or SVG"),className:"no-scrollbar disabled:opacity-50; mt-1 flex 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"})]})},MediaManagerModal=({children:o,onSelect:n})=>{const[r,a]=React.useState(!1),i=useBuilderProp("mediaManagerComponent",null),l=(...c)=>{n.call(void 0,...c),a(!1)};return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Dialog,{open:r,onOpenChange:c=>a(c),children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DialogTrigger,{asChild:!0,children:o}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DialogContent,{className:"flex h-3/4 max-w-5xl border-border",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:jsxRuntime.jsxRuntimeExports.jsx(i,{onSelect:l})})})]})};MediaManagerModal.displayName="MediaManagerModal";const ImagePickerField=({value:o,onChange:n,id:r,onBlur:a})=>{const i=useBuilderProp("mediaManagerComponent",null),{t:l}=reactI18next.useTranslation(),c=i!==null;return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[o?jsxRuntime.jsxRuntimeExports.jsx("img",{src:o,className:"h-20 w-20 overflow-hidden rounded-md border border-border object-cover",alt:""}):jsxRuntime.jsxRuntimeExports.jsx(MediaManagerModal,{onSelect:n,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-20 w-20 cursor-pointer rounded-md border border-border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px]"})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[c&&jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(MediaManagerModal,{onSelect:n,children:jsxRuntime.jsxRuntimeExports.jsx("small",{className:"h-6 cursor-pointer rounded-md bg-primary px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:o||!lodashEs.isEmpty(o)?l("Replace image"):l("Choose image")})}),jsxRuntime.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"})]}),jsxRuntime.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",type:"url",className:"text-xs",placeholder:l("Enter image URL"),value:o,onBlur:({target:{value:u}})=>a(r,u),onChange:u=>n(u.target.value)})]})]})},RichTextEditorField=({id:o,placeholder:n,value:r,onChange:a,onBlur:i})=>{const l={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},c=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:jsxRuntime.jsxRuntimeExports.jsx(ReactQuill,{id:o,value:r,onBlur:u=>i(o,u),onChange:u=>a(u),modules:l,formats:c,placeholder:n,className:"mt-1 rounded-md"})},PageTypeField=({href:o,pageTypes:n,onChange:r})=>{var w;const{t:a}=reactI18next.useTranslation(),i=useBuilderProp("searchPageTypeItems",(j,C)=>[]),[l,c]=React.useState(!1),[u,x]=React.useState(!1),[d,p]=React.useState("page"),[m,h]=React.useState(""),[b,R]=React.useState([]),[f,y]=React.useState(-1),_=React.useRef(null),A=(w=n==null?void 0:n.find(j=>j.key===d))==null?void 0:w.name;React.useEffect(()=>{if(h(""),R([]),y(-1),x(!1),!o||l||!lodashEs.startsWith(o,"pageType:"))return;const j=lodashEs.split(o,":"),C=lodashEs.get(j,1,"page")||"page";p(C),(async()=>{const B=await i(C,[lodashEs.get(j,2,"page")]);B&&Array.isArray(B)&&h(lodashEs.get(B,[0,"name"],""))})()},[o]);const S=web.useDebouncedCallback(async j=>{if(lodashEs.isEmpty(j))R([]);else{const C=await i(d,j);R(C)}c(!1),y(-1)},[d],300),k=j=>{const C=["pageType",d,j.id];C[1]&&(r(C.join(":")),h(j.name),x(!1),R([]),y(-1))},v=j=>{switch(j.key){case"ArrowDown":j.preventDefault(),y(C=>C<b.length-1?C+1:C);break;case"ArrowUp":j.preventDefault(),y(C=>C>0?C-1:C);break;case"Enter":if(j.preventDefault(),b.length===0)return;f>=0&&k(b[f]);break;case"Escape":j.preventDefault(),g();break}};React.useEffect(()=>{if(f>=0&&_.current){const j=_.current.children[f];j==null||j.scrollIntoView({block:"nearest"})}},[f]);const g=()=>{h(""),R([]),y(-1),x(!1),r("")},E=j=>{h(j),x(!lodashEs.isEmpty(j)),c(!0),S(j)};return jsxRuntime.jsxRuntimeExports.jsxs("div",{children:[jsxRuntime.jsxRuntimeExports.jsx("select",{name:"pageType",value:d,onChange:j=>p(j.target.value),children:lodashEs.map(n,j=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:j.key,children:j.name},j.key))}),d&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative mt-2 flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx("input",{type:"text",value:m,onChange:j=>E(j.target.value),onKeyDown:v,placeholder:a(`Search ${A??""}`),className:"w-full rounded-md border border-gray-300 p-2 pr-16"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute bottom-2 right-2 top-3 flex items-center gap-1.5",children:m&&jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:g,className:"text-gray-400 hover:text-gray-600",title:a("Clear search"),children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.X,{className:"h-4 w-4"})})})]}),(l||!lodashEs.isEmpty(b)||u&&lodashEs.isEmpty(b))&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute z-40 mt-2 max-h-40 w-full overflow-y-auto rounded-md border border-border bg-background shadow-lg",children:l?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-1 p-2",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"})]}):u&&lodashEs.isEmpty(b)?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center p-4 text-sm text-gray-500",children:[a("No results found for"),' "',m,'"']}):jsxRuntime.jsxRuntimeExports.jsx("ul",{ref:_,children:lodashEs.map(b==null?void 0:b.slice(0,20),(j,C)=>jsxRuntime.jsxRuntimeExports.jsxs("li",{onClick:()=>k(j),className:`cursor-pointer p-2 text-xs ${o!=null&&o.includes(j.id)?"bg-blue-200":C===f?"bg-gray-100":"hover:bg-gray-100"}`,children:[j.name," ",j.slug&&jsxRuntime.jsxRuntimeExports.jsxs("small",{className:"font-light text-gray-500",children:["( ",j.slug," )"]})]},j.id))})})]})},LinkField=({schema:o,formData:n,onChange:r})=>{const{t:a}=reactI18next.useTranslation(),{type:i="pageType",href:l="",target:c="self"}=n,u=useBuilderProp("pageTypes",[]),x=i==="pageType"&&lodashEs.isEmpty(u)?"url":i;return jsxRuntime.jsxRuntimeExports.jsxs("div",{children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(o==null?void 0:o.title)??"Link"}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[jsxRuntime.jsxRuntimeExports.jsx("select",{name:"type",value:i,onChange:d=>r({...n,type:d.target.value}),children:lodashEs.map([...lodashEs.isEmpty(u)?[]:[{const:"pageType",title:a("Goto Page")}],{const:"url",title:a("Open URL")},{const:"email",title:a("Compose Email")},{const:"telephone",title:a("Call Phone")},{const:"scroll",title:a("Scroll to element")}],d=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:d.const,children:d.title},d.const))}),x==="pageType"&&!lodashEs.isEmpty(u)?jsxRuntime.jsxRuntimeExports.jsx(PageTypeField,{href:l,pageTypes:u,onChange:d=>r({...n,href:d})}):jsxRuntime.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",name:"href",type:"text",value:l,onChange:d=>r({...n,href:d.target.value}),placeholder:a(i==="url"?"Enter URL":i==="scroll"?"#ElementID":"Enter details")}),x==="url"&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",type:"checkbox",defaultChecked:c==="_blank",className:"!w-fit cursor-pointer rounded-md border border-border",onChange:()=>r({...n,target:c==="_blank"?"_self":"_blank"})}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:a("Open in new tab")})]})]})]})},RowColField=()=>{const o=useSelectedBlock(),n=useWrapperBlock(),{addCoreBlock:r}=useAddBlock();if(!o&&!n)return null;const a=(o==null?void 0:o._type)==="Row"?o:n;return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"pt-1",children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",className:"duratiom-300 flex items-center gap-x-1 rounded border border-gray-400 bg-gray-100 px-4 py-1 text-[11px] font-medium leading-tight hover:bg-slate-200",onClick:()=>r({type:"Column",styles:"#styles:,"},a==null?void 0:a._id),children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Plus,{className:"h-4 w-4"})," Add Column"]})})},CodeEditor=({id:o,placeholder:n})=>{const{t:r}=reactI18next.useTranslation(),[,a]=useCodeEditor(),i=useSelectedBlock();if(typeof window>"u")return null;const l=o.replace("root.",""),c=lodashEs.get(i,l,""),u=()=>{const x=i==null?void 0:i._id;a({blockId:x,blockProp:l,placeholder:n,initialCode:lodashEs.get(i,l,c)})};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex flex-col gap-y-1",children:[jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:u,className:"text-pretty w-[90%] max-w-full cursor-default truncate rounded border border-border bg-background p-2 text-left text-[10px]",children:c.trim().length>0?c.substring(0,46):n||"Eg: <script>console.log('Hello, world!');<\/script>"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:u,size:"sm",variant:"outline",className:"w-fit",children:r("Open code editor")})]})},CustomFieldTemplate=({id:o,classNames:n,label:r,children:a,errors:i,help:l,description:c,hidden:u,required:x,schema:d,formData:p})=>{const{selectedLang:m,fallbackLang:h,languages:b}=useLanguages(),R=lodashEs.isEmpty(b)?"":lodashEs.isEmpty(m)?h:m,f=lodashEs.get(LANGUAGES,R,R),y=useSelectedBlock(),_=runtime.useRegisteredChaiBlocks(),A=lodashEs.get(_,[y==null?void 0:y._type,"i18nProps"],[])||[],[S,k]=React.useState(null);if(u)return null;if(d.type==="boolean")return jsxRuntime.jsxRuntimeExports.jsx("div",{className:n,children:a});const g=A==null?void 0:A.includes(o.replace("root.",""));if(d.type==="array"){const E=S===o;return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`${n} relative`,children:[d.title&&jsxRuntime.jsxRuntimeExports.jsxs("label",{htmlFor:o,onClick:()=>k(E?null:o),className:"flex cursor-pointer items-center gap-x-1 py-1 leading-tight duration-200 hover:bg-slate-100",children:[E?jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronDown,{className:"h-3 w-3"}):jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:"h-3 w-3"}),jsxRuntime.jsxRuntimeExports.jsx(lucideReact.List,{className:"h-3 w-3"}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"leading-tight",children:r})," ",jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Badge,{className:"m-0 bg-gray-200 px-2 leading-tight text-gray-500 hover:bg-gray-200 hover:text-gray-500",children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-[9px] font-medium text-slate-600",children:p==null?void 0:p.length})})]}),(p==null?void 0:p.length)===0?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-0 overflow-hidden",children:a}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`${E?"pt-0.5":"h-0 overflow-hidden"}`,children:[c,a,i,l]})]})}return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:n,children:[d.title&&jsxRuntime.jsxRuntimeExports.jsxs("label",{htmlFor:o,className:d.type==="object"?"pb-2":"",children:[r," ",g&&jsxRuntime.jsxRuntimeExports.jsxs("small",{className:"text-[9px] text-zinc-400",children:[" ",f]}),x&&d.type!=="object"?" *":null]}),c,a,i,l]})},CustomAddButton=o=>jsxRuntime.jsxRuntimeExports.jsx("button",{...o,className:"duration absolute right-2 top-2 cursor-pointer text-blue-400 hover:text-blue-500",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-0.5 text-[11px] leading-tight",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Plus,{className:"h-3 w-3"})," ",jsxRuntime.jsxRuntimeExports.jsx("span",{children:"Add"})]})}),JSONForm=React.memo(({id:o,schema:n,uiSchema:r,formData:a,onChange:i})=>{const[l,c]=React.useState(a),{selectedLang:u}=useLanguages();React.useEffect(()=>{c(a)},[o,u]);const x=web.useThrottledCallback(async({formData:d},p)=>{i({formData:d},p)},[i,u],1e3);return jsxRuntime.jsxRuntimeExports.jsx(RjForm,{widgets:{binding:BindingWidget,richtext:RichTextEditorField,icon:IconPickerField,image:ImagePickerField,code:CodeEditor,colCount:RowColField},fields:{link:LinkField},templates:{FieldTemplate:CustomFieldTemplate,ButtonTemplates:{AddButton:CustomAddButton}},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator,uiSchema:r,schema:n,formData:l,onChange:({formData:d},p)=>{p&&(c(d),x({formData:d},p))}},u)}),formDataWithSelectedLang=(o,n,r)=>{const a=lodashEs.cloneDeep(o);return lodashEs.forEach(lodashEs.keys(o),i=>{lodashEs.includes(lodashEs.get(r,"i18nProps",[]),i)&&!lodashEs.isEmpty(n)&&(a[i]=lodashEs.get(o,`${i}-${n}`))}),a},convertDotNotationToObject=(o,n)=>{const r={};return lodashEs.set(r,o,n),r};function BlockSettings(){const{selectedLang:o}=useLanguages(),n=useSelectedBlock(),r=useUpdateBlocksPropsRealtime(),a=useUpdateBlocksProps(),i=runtime.getRegisteredChaiBlock(n==null?void 0:n._type),l=formDataWithSelectedLang(n,o,i),[c,u]=React.useState(l),[x,d]=React.useState(!1),p=useWrapperBlock(),m=runtime.getRegisteredChaiBlock(p==null?void 0:p._type),h=formDataWithSelectedLang(p,o,m),b=({formData:v},g,E)=>{if(g&&(c==null?void 0:c._id)===n._id){const w=g.replace("root.","");a([n._id],{[w]:lodashEs.get(v,w)},E)}},R=React.useCallback(lodashEs.debounce(({formData:v},g,E)=>{b({formData:v},g,E),u(v)},1500),[n==null?void 0:n._id,o]),f=({formData:v},g)=>{if(g){const E=g.replace("root.","");r([n._id],convertDotNotationToObject(E,lodashEs.get(v,E.split(".")))),R({formData:v},g,{[E]:lodashEs.get(c,E)})}},y=({formData:v},g)=>{if(g){const E=g.replace("root.","");r([p._id],convertDotNotationToObject(E,lodashEs.get(v,E.split(".")))),R({formData:v},g,{[E]:lodashEs.get(c,E)})}};lodashEs.keys(lodashEs.get(l,"_bindings",{}));const{schema:_,uiSchema:A}=React.useMemo(()=>{const v=n==null?void 0:n._type;if(v)return runtime.getBlockFormSchemas(v)},[n]),{wrapperSchema:S,wrapperUiSchema:k}=React.useMemo(()=>{if(!p||!(p!=null&&p._type))return{wrapperSchema:{},wrapperUiSchema:{}};const v=p==null?void 0:p._type,{schema:g={},uiSchema:E={}}=runtime.getBlockFormSchemas(v);return{wrapperSchema:g,wrapperUiSchema:E}},[p]);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar overflow-x-hidden px-px",children:[!lodashEs.isEmpty(p)&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mb-4 rounded border bg-zinc-100 px-1",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:()=>d(v=>!v),className:"flex cursor-pointer items-center gap-x-1 py-2 text-xs font-medium leading-tight hover:bg-slate-100",children:[x?jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 stroke-[3] text-slate-400"}):jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:"h-4 w-4 stroke-[3] text-slate-400"}),lodashEs.startCase(p._type)," settings"," ",p._name&&jsxRuntime.jsxRuntimeExports.jsxs("span",{className:"text-[11px] font-light text-slate-400",children:["(",p._name,")"]})]}),x&&jsxRuntime.jsxRuntimeExports.jsx(JSONForm,{id:p==null?void 0:p._id,onChange:y,formData:h,schema:S,uiSchema:k})]}),lodashEs.isEmpty(_)?null:jsxRuntime.jsxRuntimeExports.jsx(JSONForm,{id:n==null?void 0:n._id,onChange:f,formData:l,schema:_,uiSchema:A}),(n==null?void 0:n._type)==="GlobalBlock"?jsxRuntime.jsxRuntimeExports.jsx(GlobalBlockSettings,{}):null]})}function FaLanguage(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"},child:[]}]})(o)}function FaMoon(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"},child:[]}]})(o)}function FaRecycle(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"},child:[]}]})(o)}function FaSpinner(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"},child:[]}]})(o)}const SECONDS=10;function Countdown(){const[o,n]=React.useState(SECONDS),[r,a]=React.useState(!1);React.useEffect(()=>{if(r&&o>0){const x=setTimeout(()=>{n(o-.1)},100);return()=>clearTimeout(x)}else o<=0&&(a(!1),n(SECONDS))},[r,o]);const i=()=>{a(!0),n(SECONDS)};React.useEffect(()=>{o===SECONDS&&i()},[o]);const l=18,c=2*Math.PI*l,u=c*(1-(SECONDS-o)/SECONDS);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"relative h-4 w-4",children:[jsxRuntime.jsxRuntimeExports.jsxs("svg",{className:"h-full w-full",viewBox:"0 0 40 40",children:[jsxRuntime.jsxRuntimeExports.jsx("circle",{className:"text-gray-300",strokeWidth:"4",stroke:"currentColor",fill:"transparent",r:l,cx:"20",cy:"20"}),jsxRuntime.jsxRuntimeExports.jsx("circle",{className:"text-blue-600",strokeWidth:"4",strokeDasharray:c,strokeDashoffset:u,strokeLinecap:"round",stroke:"currentColor",fill:"transparent",r:l,cx:"20",cy:"20"})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-xs font-semibold",children:" "})})]})}const AskAIStyles=({blockId:o})=>{const{t:n}=reactI18next.useTranslation(),{askAi:r,loading:a,error:i}=useAskAi(),[l,c]=React.useState(""),u=React.useRef(null),x=React.useRef(null),[d,p]=React.useState();React.useEffect(()=>{var h;(h=u.current)==null||h.focus()},[]);const m=h=>{const{usage:b}=h||{};!i&&b&&p(b),x.current=setTimeout(()=>p(void 0),1e4),i||c("")};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"",children:[jsxRuntime.jsxRuntimeExports.jsx("h2",{className:"mb-1 text-sm font-semibold leading-none tracking-tight",children:n("Ask AI")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{ref:u,value:l,onChange:h=>c(h.target.value),placeholder:n("Ask AI to edit styles"),className:"no-scrollbar my-2 w-full border border-border p-2 text-xs",rows:4,onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),x.current&&clearTimeout(x.current),p(void 0),r("styles",o,l,m))}}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"my-2 flex items-center gap-2",children:[a?null:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:l.trim().length<5||a,onClick:()=>{x.current&&clearTimeout(x.current),p(void 0),r("styles",o,l,m)},variant:"default",className:"w-fit",size:"sm",children:a?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"h-5 w-5 animate-spin"}),n("Generating... Please wait...")]}):n("Edit with AI")}),a?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Skeleton,{className:"flex w-full items-center space-x-1 px-4 py-1 pl-2",children:[jsxRuntime.jsxRuntimeExports.jsx(FaSpinner,{className:"h-4 w-4 animate-spin text-gray-500"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs",children:n("Generating... Please wait...")})]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"destructive",onClick:()=>stop(),className:"hidden w-fit",size:"sm",children:n("Stop")})]}):null]}),d?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:jsxRuntime.jsxRuntimeExports.jsxs("p",{className:"mb-1 flex justify-between break-words rounded border border-blue-500 bg-blue-100 p-1 text-xs text-blue-500",children:[jsxRuntime.jsxRuntimeExports.jsxs("span",{children:[n("Total tokens used"),": ",d.totalTokens]}),jsxRuntime.jsxRuntimeExports.jsx(Countdown,{})]})}):null,jsxRuntime.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:i.message})})]})};function ManualClasses(){var g;const o=useFuseSearch(),{t:n}=reactI18next.useTranslation(),[r]=useSelectedStylingBlocks(),a=useSelectedBlock(),i=useAddClassesToBlocks(),l=useRemoveClassesFromBlocks(),[c]=useSelectedBlockIds(),u=useBuilderProp("askAiCallBack",null),[x,d]=React.useState(""),{toast:p}=contextMenu.useToast(),m=(g=lodashEs.first(r))==null?void 0:g.prop,h=lodashEs.reject((lodashEs.get(a,m,"").replace(STRINGS.STYLES_KEY,"").split(",").pop()||"").split(" "),lodashEs.isEmpty),b=()=>{const E=x.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");i(c,E,!0),d("")},[R,f]=React.useState([]),y=({value:E})=>{const w=E.trim().toLowerCase(),j=w.match(/.+:/g);let C=[];if(j&&j.length>0){const[B]=j,N=w.replace(B,"");C=o.search(N).map(T=>({...T,item:{...T.item,name:B+T.item.name}}))}else C=o.search(w);return f(lodashEs.map(C,"item"))},_=()=>{f([])},A=E=>E.name,S=E=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:E.name}),k={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:n("Enter classes separated by space"),value:x,onKeyDown:E=>{E.key==="Enter"&&x.trim()!==""&&b()},onChange:(E,{newValue:w})=>d(w),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"},v=()=>{if(navigator.clipboard===void 0){p({title:n("Clipboard not supported"),description:n("Please use Chrome, Firefox or Safari"),variant:"destructive"});return}navigator.clipboard.writeText(h.join(" ")),p({title:n("Copied"),description:n("Classes copied to clipboard")})};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`flex ${R.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-1.5 overflow-y-auto pb-4`,children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between gap-x-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:n("Classes")}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CopyIcon,{onClick:v,className:"cursor-pointer"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:n("Copy classes to clipboard")})})]})]}),u?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Popover,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{variant:"default",className:"h-6 w-fit",size:"sm",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.SparklesIcon,{className:"h-4 w-4"}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"ml-2",children:n("Ask AI")})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.PopoverContent,{side:"left",className:"p-2",children:jsxRuntime.jsxRuntimeExports.jsx(AskAIStyles,{blockId:a==null?void 0:a._id})})]}):null]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"relative flex items-center gap-x-3",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:jsxRuntime.jsxRuntimeExports.jsx(Autosuggest,{suggestions:R,onSuggestionsFetchRequested:y,onSuggestionsClearRequested:_,getSuggestionValue:A,renderSuggestion:S,inputProps:k,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-border text-xs"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"!bg-gray-300 dark:!bg-gray-800 cursor-pointer",suggestionsContainerOpen:"absolute bg-background no-scrollbar z-50 max-h-[230px] overflow-y-auto w-full border border-border rounded-md"}})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"outline",className:"h-6 border-border",onClick:b,disabled:x.trim()==="",size:"sm",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.PlusIcon,{})})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-wrap gap-2 overflow-x-hidden",children:React__namespace.Children.toArray(h.map(E=>jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate rounded border border-border bg-gray-200 p-px px-1.5 text-[11px] text-gray-600 hover:border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300",children:[E,jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Cross2Icon,{onClick:()=>l(c,[E]),className:"invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},E)))})]})}const BASIC_UNITS=["px","%","em","rem","ch","vh","vw"],FLEX_CHILD_SECTION={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:BASIC_UNITS,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},GRID_CHILD_SECTION={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},SETTINGS_SECTIONS=[{heading:"Styles",items:[{component:ManualClasses},{type:"arbitrary",label:"layout.width",units:BASIC_UNITS.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:BASIC_UNITS.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...BASIC_UNITS,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"accordion",heading:"Typography",items:[{type:"dropdown",property:"textAlign",label:"typography.align"},{type:"dropdown",property:"fontFamily",label:"typography.font"},{type:"arbitrary",property:"fontSize",label:"typography.size",units:BASIC_UNITS},{type:"arbitrary",property:"lineHeight",label:"typography.height",units:BASIC_UNITS.concat("-")},{type:"range",property:"fontWeight",label:"typography.weight"},{type:"color",property:"textColor",label:"typography.color"}]},{styleType:"accordion",heading:"Background",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]}]}];BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("auto"),[...BASIC_UNITS],BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("-");const EDITOR_ICONS={"not-italic":()=>jsxRuntime.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:reactIcons.EyeOpenIcon,invisible:reactIcons.EyeClosedIcon,hidden:reactIcons.EyeClosedIcon,gap:reactIcons.BorderAllIcon,gapX:reactIcons.WidthIcon,gapY:reactIcons.HeightIcon,spaceX:reactIcons.WidthIcon,spaceY:reactIcons.HeightIcon,overscroll:reactIcons.BorderAllIcon,overscrollX:reactIcons.WidthIcon,overscrollY:reactIcons.HeightIcon,overflow:reactIcons.BorderAllIcon,overflowX:reactIcons.WidthIcon,overflowY:reactIcons.HeightIcon,top:reactIcons.ArrowUpIcon,right:reactIcons.ArrowRightIcon,bottom:reactIcons.ArrowDownIcon,left:reactIcons.ArrowLeftIcon,inset:reactIcons.BorderAllIcon,insetX:reactIcons.WidthIcon,insetY:reactIcons.HeightIcon,border:reactIcons.BorderAllIcon,borderX:reactIcons.WidthIcon,borderY:reactIcons.HeightIcon,borderTop:reactIcons.ArrowUpIcon,borderRight:reactIcons.ArrowRightIcon,borderBottom:reactIcons.ArrowDownIcon,borderLeft:reactIcons.ArrowLeftIcon,borderRadius:reactIcons.BorderAllIcon,borderRadiusX:reactIcons.WidthIcon,borderRadiusY:reactIcons.HeightIcon,borderRadiusTop:reactIcons.ArrowUpIcon,borderRadiusRight:reactIcons.ArrowRightIcon,borderRadiusBottom:reactIcons.ArrowDownIcon,borderRadiusLeft:reactIcons.ArrowLeftIcon,borderRadiusTopLeft:reactIcons.ArrowTopLeftIcon,borderRadiusTopRight:reactIcons.ArrowTopRightIcon,borderRadiusBottomRight:reactIcons.ArrowBottomRightIcon,borderRadiusBottomLeft:reactIcons.ArrowBottomLeftIcon,divideXWidth:reactIcons.WidthIcon,divideYWidth:reactIcons.HeightIcon,scale:reactIcons.BorderAllIcon,scaleX:reactIcons.WidthIcon,scaleY:reactIcons.HeightIcon,skewX:reactIcons.WidthIcon,skewY:reactIcons.HeightIcon,translateX:reactIcons.WidthIcon,translateY:reactIcons.HeightIcon,padding:reactIcons.BorderAllIcon,paddingX:reactIcons.WidthIcon,paddingY:reactIcons.HeightIcon,paddingTop:reactIcons.ArrowUpIcon,paddingRight:reactIcons.ArrowRightIcon,paddingBottom:reactIcons.ArrowDownIcon,paddingLeft:reactIcons.ArrowLeftIcon,margin:reactIcons.BorderAllIcon,marginX:reactIcons.WidthIcon,marginY:reactIcons.HeightIcon,marginTop:reactIcons.ArrowUpIcon,marginRight:reactIcons.ArrowRightIcon,marginBottom:reactIcons.ArrowDownIcon,marginLeft:reactIcons.ArrowLeftIcon,textLeft:reactIcons.AlignLeftIcon,textCenter:reactIcons.AlignCenterHorizontallyIcon,textRight:reactIcons.AlignRightIcon,textJustify:reactIcons.StretchHorizontallyIcon,italic:reactIcons.FontItalicIcon,underline:reactIcons.UnderlineIcon,overline:reactIcons.OverlineIcon,uppercase:reactIcons.LetterCaseUppercaseIcon,block:()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":reactIcons.Cross2Icon,fixed:()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>jsxRuntime.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:reactIcons.Cross1Icon},StyleContext=React.createContext({canReset:!1,canChange:!0}),BlockStyleProvider=({children:o,canReset:n=!1,canChange:r=!0})=>jsxRuntime.jsxRuntimeExports.jsx(StyleContext.Provider,{value:{canReset:n,canChange:r},children:o}),DropDownChoices=({label:o,property:n,onChange:r})=>{const{getClasses:a}=useTailwindClassList(),i=a(n),l=useCurrentClassByProperty(n),c=React.useMemo(()=>lodashEs.get(l,"cls",""),[l]),{canChange:u}=React.useContext(StyleContext),x=/\[.*\]/g.test(c);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:o?"w-full rounded":"grow",children:x?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:c}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{delayDuration:100,children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InfoCircledIcon,{})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):jsxRuntime.jsxRuntimeExports.jsx(DropDown,{rounded:o,onChange:d=>r(d,n),selected:c,options:i,disabled:!u})})};function DropDown({selected:o,onChange:n,rounded:r=!1,options:a,disabled:i=!1}){const l=o.replace(/.*:/g,"").trim(),{undo:c,redo:u}=useUndoManager();return jsxRuntime.jsxRuntimeExports.jsxs("select",{disabled:!a.length||i,className:`${r?"rounded-md border border-border":"border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:x=>n(x.target.value),onKeyDown:x=>{x.ctrlKey&&(x.key==="z"&&c(),x.key==="y"&&u())},value:l,children:[jsxRuntime.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),React.Children.toArray(a.map(x=>jsxRuntime.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:x,children:x})))]})}const RangeChoices=({property:o,onChange:n})=>{const{canReset:r,canChange:a}=React.useContext(StyleContext),i=useCurrentClassByProperty(o),l=React.useMemo(()=>lodashEs.get(i,"cls",""),[i]),{getClasses:c}=useTailwindClassList(),u=c(o,[""]),x=u.indexOf(l)>-1?u.indexOf(l):0,d=/\[.*\]/g.test(l);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:d?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"px-2 py-[5px]",children:l}):jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"hover:bg-bg-gray-700 box-border w-2/12 rounded-bl rounded-tl bg-background px-1 text-center disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!a&&(!r||x-1<0),onClick:()=>n(lodashEs.nth(u,x-1),o),children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.MinusIcon,{className:!a&&(!r||x-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:jsxRuntime.jsxRuntimeExports.jsx(DropDownChoices,{label:!1,property:o,onChange:n})}),jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"hover:bg-bg-gray-700 w-2/12 rounded-br rounded-tr bg-background px-1 text-center disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!a&&(!r||x+1>=u.length),onClick:()=>n(lodashEs.nth(u,x+1),o),children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.PlusIcon,{className:!a&&(!r||x+1>=u.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},IconChoices=({property:o,onChange:n})=>{const{getClasses:r}=useTailwindClassList(),a=r(o),{canChange:i}=React.useContext(StyleContext),l=useCurrentClassByProperty(o),c=React.useMemo(()=>lodashEs.get(l,"cls",""),[l]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:lodashEs.map(a,u=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",disabled:!i,onClick:()=>n(u,o),className:`cursor-pointer rounded border border-border p-1 disabled:cursor-not-allowed ${c===u?"bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:React.createElement(lodashEs.get(EDITOR_ICONS,u,reactIcons.BoxIcon))})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:lodashEs.startCase(lodashEs.toLower(u))})]}))})},COLOR_PROP={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},ColorChoice=({property:o,onChange:n})=>{const r=useCurrentClassByProperty(o),a=React.useMemo(()=>lodashEs.get(r,"cls",""),[r]),{canChange:i}=React.useContext(StyleContext),[l,c]=React.useState([]),[u,x]=React.useState({color:"",shade:""}),d=a.split("-"),p=lodashEs.get(d,"1",""),m=lodashEs.get(d,"2",""),h=React.useCallback(f=>{["current","inherit","transparent","black","white"].includes(f)?(c([]),x({color:f})):(c(["50","100","200","300","400","500","600","700","800","900"]),x(y=>({...y,color:f,shade:y.shade?y.shade:"500"})))},[c,x]);React.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(p))return c([]);c(["50","100","200","300","400","500","600","700","800","900"])},[p]);const b=React.useCallback(f=>{x({color:p,shade:f})},[p]);React.useEffect(()=>{x({color:"",shade:""})},[r]);const{match:R}=useTailwindClassList();return React.useEffect(()=>{const y=`${lodashEs.get(COLOR_PROP,o,"")}-${u.color}${u.shade?`-${u.shade}`:""}`;R(o,y)&&n(y,o)},[R,u,n,o]),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-transparent text-xs",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:jsxRuntime.jsxRuntimeExports.jsx(DropDown,{disabled:!i,rounded:!0,selected:p,onChange:h,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:jsxRuntime.jsxRuntimeExports.jsx(DropDown,{rounded:!0,selected:m,disabled:!p||!i,onChange:b,options:l})})]})},getUserInputValues=(o,n)=>{o=o.toLowerCase();let r=o.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&n.includes(r))return{value:"",unit:r};const a=n.length?new RegExp(n.join("|"),"g"):/XXXXXX/g;r=r.replace(a,"");const i=o.match(a),l=i&&i.length>1,c=!lodashEs.isEmpty(r)&&Number.isNaN(Number(r));return l||c?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}},getTwClassValue=o=>{const n=o.startsWith("-")?"-":"",r=o.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:o.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(lodashEs.includes(o,"skew-"))return{value:`${n}${r}`,unit:"deg"};if(lodashEs.includes(o,"rotate-"))return{value:`${n}${r}`,unit:"deg"};if(lodashEs.includes(o,"opacity-"))return{value:`${r/100}`,unit:"-"};if(lodashEs.includes(o,"duration-")||lodashEs.includes(o,"delay-"))return{value:`${r}`,unit:"ms"};if(lodashEs.includes(o,"translate-")&&!r.includes("/"))return{value:`${n}${`${r/4}`}`,unit:"rem"};if(lodashEs.includes(o,"scale-"))return{value:`${n}${`${r/100}`}`,unit:"-"};if(lodashEs.startsWith(o,"border")){const a=o.match(/border-?(x|y|t|r|b|l)?\d+/g);if(a)return{value:a[0].split("-").pop(),unit:"px"};if(o.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(lodashEs.startsWith(o,"max-w-")){if(o==="max-w-screen-sm")return{value:"640",unit:"px"};if(o==="max-w-screen-md")return{value:"768",unit:"px"};if(o==="max-w-screen-lg")return{value:"1024",unit:"px"};if(o==="max-w-screen-xl")return{value:"1280",unit:"px"};if(o==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(lodashEs.startsWith(o,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(lodashEs.startsWith(o,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(lodashEs.startsWith(o,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:o,unit:"class"};if(r.includes("/")){const[a,i]=lodashEs.map(r.split("/"),l=>parseInt(l,10));return{value:n+(a/i*100).toFixed(2).replace(".00",""),unit:"%"}}return lodashEs.isNumber(parseFloat(r))?{value:`${n+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}},getClassValueAndUnit=o=>{if(lodashEs.isEmpty(o))return{value:"",unit:""};const n=o.match(/\[.*\]/g);if(n===null)return getValueAndUnitForTWClass(o);const r=lodashEs.get(n,"0","").replace(/\[|\]/g,""),a=o.startsWith("-")?"-":"",i=lodashEs.first(r.match(/\d+.\d+|\d+/g));return{value:`${a}${i}`,unit:r.replace(i,"")}},getValueAndUnitForTWClass=o=>lodashEs.isEmpty(o)?{value:"",unit:""}:getTwClassValue(o),BlockSettingsContext=React.createContext({setDragData:()=>{}}),DragStyleButton=({unit:o,currentValue:n,onDrag:r,onDragEnd:a,onDragStart:i,negative:l,cssProperty:c})=>{const{setDragData:u}=React.useContext(BlockSettingsContext);return jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:x=>{const d={onDrag:r,onDragEnd:a,dragging:!0,dragStartY:x.pageY,dragStartValue:`${n}`,dragUnit:o,negative:l,cssProperty:c};i(d),u(d)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RowSpacingIcon,{})})},UnitSelection=({onSelect:o,current:n,units:r})=>jsxRuntime.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(a=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:n===a?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),o(a)},children:a},a))}),THROTTLE_TIME=50,AdvanceChoices=o=>{const[n,r]=React.useState(!1),[a,i]=React.useState(""),{currentClass:l,onChange:c,classPrefix:u,cssProperty:x,units:d,negative:p}=o,[m,h]=React.useState(x!=null&&x.toLowerCase().includes("width")?"%":d[0]),[b,R]=React.useState(!1),[f,y]=React.useState(""),[_,A]=React.useState(!1),[S,k]=React.useState(!1);React.useEffect(()=>{const{value:j,unit:C}=getClassValueAndUnit(l);if(C===""){i(j),h(x!=null&&x.toLowerCase().includes("width")?"%":lodashEs.first(d));return}h(C),i(C==="class"||lodashEs.isEmpty(j)?"":j)},[l,x,d]);const v=web.useThrottledCallback(j=>c(j),[c],THROTTLE_TIME),g=web.useThrottledCallback(j=>c(j,!1),[c],THROTTLE_TIME),E=React.useCallback((j=!1)=>{const C=getUserInputValues(`${a}`,d);if(lodashEs.get(C,"error",!1)){R(!0);return}const B=lodashEs.get(C,"unit")!==""?lodashEs.get(C,"unit"):m;if(B==="auto"||B==="none"){v(`${u}${B}`);return}if(lodashEs.get(C,"value")==="")return;const M=`${lodashEs.get(C,"value","").startsWith("-")?"-":""}${u}[${lodashEs.get(C,"value","").replace("-","")}${B==="-"?"":B}]`;j?g(M):v(M)},[v,g,a,m,u,d]),w=React.useCallback(j=>{const C=getUserInputValues(`${a}`,d);if(lodashEs.get(C,"error",!1)){R(!0);return}if(j==="auto"||j==="none"){v(`${u}${j}`);return}if(lodashEs.get(C,"value")==="")return;const B=lodashEs.get(C,"unit")!==""?lodashEs.get(C,"unit"):j,M=`${lodashEs.get(C,"value","").startsWith("-")?"-":""}${u}[${lodashEs.get(C,"value","").replace("-","")}${B==="-"?"":B}]`;v(M)},[v,a,u,d]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:m==="class"?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx("input",{className:"h-6 w-24 rounded border border-foreground/20 bg-background px-2 py-0.5 text-sm focus-visible:outline-0",readOnly:!0,value:l}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InfoCircledIcon,{})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${_?"z-auto":""}`,children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(m)!==-1?null:jsxRuntime.jsxRuntimeExports.jsx("input",{readOnly:m==="class",onKeyPress:j=>{j.key==="Enter"&&E()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),k(!0);const C=lodashEs.parseInt(j.target.value);let B=lodashEs.isNaN(C)?0:C;j.keyCode===38&&(B+=1),j.keyCode===40&&(B-=1);const N=`${B}`,T=`${N.startsWith("-")?"-":""}${u}[${N.replace("-","")}${m==="-"?"":m}]`;g(T)},onKeyUp:j=>{S&&(j.preventDefault(),k(!1))},onBlur:()=>E(),onChange:j=>{R(!1),i(j.target.value)},onClick:j=>{var C;(C=j==null?void 0:j.target)==null||C.select(),r(!1)},value:_?f:a,className:"h-6 w-14 rounded rounded-r-none border border-transparent bg-background pl-2 text-sm focus-visible:outline-0".concat(" ",b?"border-red-500 text-red-500":"border-foreground/20")}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{open:n,delayDuration:100,children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!n),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:`inline-block ${d.length===1?"px-2 font-semibold":""}`,children:m}),d.length>1?jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TriangleDownIcon,{}):null]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipPortal,{children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"bg-background",children:jsxRuntime.jsxRuntimeExports.jsx(UnitSelection,{units:d,current:m,onSelect:j=>{r(!1),h(j),w(j)}})})})]})]}),["none","auto"].indexOf(m)!==-1||_?null:jsxRuntime.jsxRuntimeExports.jsx(DragStyleButton,{onDragStart:()=>A(!0),onDragEnd:j=>{if(y(()=>""),A(!1),lodashEs.isEmpty(j))return;const C=`${j}`,N=`${C.startsWith("-")?"-":""}${u}[${C.replace("-","")}${m==="-"?"":m}]`;v(N)},onDrag:j=>{if(lodashEs.isEmpty(j))return;y(j);const C=`${j}`,N=`${C.startsWith("-")?"-":""}${u}[${C.replace("-","")}${m==="-"?"":m}]`;g(N)},currentValue:a,unit:m,negative:p,cssProperty:x})]})})})},useCurrentClassByProperty=o=>{const n=useSelectedBlockCurrentClasses();return lodashEs.findLast(n,{property:o})},canChangeClass=(o,n)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[lodashEs.get(o,"mq","xs")]<=r[n]},CLASS_PREFIXES={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},BREAKPOINTS={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},getBreakpoint=o=>`${o.toUpperCase()} ${BREAKPOINTS[o]?`(${BREAKPOINTS[o]} & up)`:""}`,BlockStyle=o=>{const{t:n}=reactI18next.useTranslation(),{type:r="icons",label:a,property:i,onEmitChange:l=()=>{},units:c,negative:u=!1}=o,[x]=useDarkMode(),[d]=useStylingState(),[,p]=useCanvasWidth(),m=useCurrentClassByProperty(i),h=useAddClassesToBlocks(),b=useRemoveClassesFromBlocks(),[R]=useSelectedBlockIds(),f=React.useMemo(()=>lodashEs.get(m,"fullCls",""),[m]),y=React.useCallback((g,E=!0)=>{const w={dark:x,mq:p,mod:d,cls:g,property:i,fullCls:""};(x||d!=="")&&(w.mq="xs");const j=generateFullClsName(w);h(R,[j],E)},[R,x,p,d,i,h]),_=React.useCallback(()=>{b(R,[f])},[R,f,b]),A=React.useMemo(()=>canChangeClass(m,p),[m,p]);React.useEffect(()=>{l(A,m)},[A,l,m]);const[,,S]=useCanvasWidth(),k=React.useCallback(g=>{S({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[g])},[S]),v=lodashEs.get(m,"dark",null)===x&&lodashEs.get(m,"mod",null)===d&&lodashEs.get(m,"mq",null)===p;return jsxRuntime.jsxRuntimeExports.jsx(BlockStyleProvider,{canChange:A,canReset:m&&v,children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${m&&!v?"text-foreground":""}`,children:n(a)})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[r==="arbitrary"?jsxRuntime.jsxRuntimeExports.jsx(AdvanceChoices,{currentClass:lodashEs.get(m,"cls",""),classPrefix:lodashEs.get(CLASS_PREFIXES,i,""),units:c||[],onChange:y,negative:u,cssProperty:i}):null,r==="icons"&&jsxRuntime.jsxRuntimeExports.jsx(IconChoices,{property:i,onChange:y}),r==="range"&&jsxRuntime.jsxRuntimeExports.jsx(RangeChoices,{property:i,onChange:y}),r==="color"&&jsxRuntime.jsxRuntimeExports.jsx(ColorChoice,{property:i,onChange:y}),r==="dropdown"&&jsxRuntime.jsxRuntimeExports.jsx(DropDownChoices,{label:a,property:i,onChange:y})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${f?"visible":"invisible"}`,children:v?jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>_(),title:"Reset",className:"flex px-1.5 text-xs",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):A&&m?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{delayDuration:100,children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InfoCircledIcon,{})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"text-right",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",jsxRuntime.jsxRuntimeExports.jsxs("span",{className:"font-bold",children:[getBreakpoint(lodashEs.get(m,"mq")),x&&!m.dark?"(Light mode)":""]}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>k(lodashEs.get(m,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",lodashEs.get(m,"mq").toUpperCase()]})]})})})]}):null})]})]})})},basicUnits=["px","%","em","rem","ch","vh","vw"],MultipleChoices=({label:o,options:n,borderB:r=!1,borderT:a=!1,type:i="arbitrary",units:l=basicUnits,negative:c=!1})=>{const{t:u}=reactI18next.useTranslation(),[x,d]=React.useState(n[0].key),p=useSelectedBlockCurrentClasses(),m=React.useCallback(h=>lodashEs.map(p,"property").includes(h),[p]);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-border py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${a?"border-t":""}`,children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[o&&jsxRuntime.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:u(o)}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:React.Children.toArray(n.map(({label:h,key:b})=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>d(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===x?"bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[React.createElement("div",{className:m(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),React.createElement(lodashEs.get(EDITOR_ICONS,b,reactIcons.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:lodashEs.startCase(lodashEs.toLower(h))})]})})))})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{type:i,units:[...l],label:"",property:x,negative:c})})]})},NestedOptions=({heading:o,items:n})=>{const{t:r}=reactI18next.useTranslation(),a=useSelectedBlockCurrentClasses(),i=React.useMemo(()=>{const l=x=>lodashEs.flatten(x.map(d=>d.styleType==="multiple"?lodashEs.map(d.options,"key"):d.property)),c=lodashEs.flatten(n.map(x=>x.styleType==="accordion"?l(x.items):x.styleType==="multiple"?lodashEs.map(x.options,"key"):x.property)),u=lodashEs.map(a,"property");return lodashEs.intersection(c,u).length>0},[a,n]);return jsxRuntime.jsxRuntimeExports.jsxs("details",{children:[jsxRuntime.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-gray-50 p-px px-2 text-[11px] text-foreground dark:bg-gray-800",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"inline",children:[lodashEs.startCase(r(o.toLowerCase())),i?jsxRuntime.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"p-2",children:n.map(l=>l.styleType==="multiple"?jsxRuntime.jsxRuntimeExports.jsx(MultipleChoices,{...l},l.label):jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{...l},l.label))})]})},SectionContext=React.createContext({}),StylingGroup=({section:o,showAccordian:n})=>{const{t:r}=reactI18next.useTranslation(),a=useSelectedBlockCurrentClasses(),i=React.useCallback((c=[])=>{const u={};for(let d=0;d<a.length;d++)u[a[d].property]=a[d].cls;let x=!0;for(const d in c)if(!lodashEs.has(u,d)||u[d]!==c[d]){x=!1;break}return x},[a]),l=React.useMemo(()=>({}),[]);return jsxRuntime.jsxRuntimeExports.jsx(SectionContext.Provider,{value:l,children:n?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AccordionItem,{value:o.heading,className:"border-none",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionTrigger,{className:"border-slate-150 border-t py-2 text-xs",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center py-2",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-x-2 text-xs font-medium",children:lodashEs.startCase(r(o.heading))})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionContent,{className:"py-2",children:React.Children.toArray(o.items.map(c=>lodashEs.has(c,"component")?React.createElement(c.component,{key:c.label}):lodashEs.has(c,"styleType")?c.styleType==="multiple"?jsxRuntime.jsxRuntimeExports.jsx(MultipleChoices,{...c},c.label):c.styleType==="accordion"&&i(c==null?void 0:c.conditions)?jsxRuntime.jsxRuntimeExports.jsx(NestedOptions,{...c},c.label):null:jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{...c},c.label)))})]}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"py-2",children:React.Children.toArray(o.items.map(c=>lodashEs.has(c,"component")?React.createElement(c.component,{key:c.label}):lodashEs.has(c,"styleType")?c.styleType==="multiple"?jsxRuntime.jsxRuntimeExports.jsx(MultipleChoices,{...c},c.label):c.styleType==="accordion"&&i(c==null?void 0:c.conditions)?jsxRuntime.jsxRuntimeExports.jsx(NestedOptions,{...c},c.label):null:jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{...c},c.label)))})})},StylingHelpers=()=>{const o=useSelectedBlock(),[n]=useSelectedStylingBlocks(),{t:r}=reactI18next.useTranslation(),a=useAddClassesToBlocks(),i=runtime.getRegisteredChaiBlock(o._type),l=lodashEs.get(lodashEs.first(n),"prop"),c=lodashEs.get(i.props,`${l}.presets`,{});if(!lodashEs.has(i,"props")||lodashEs.isEmpty(c))return null;const u=x=>{const d=x.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");a([o._id],d,!0)};return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-10",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenu,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"px-4",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{variant:"default",className:"w-full",size:"sm",children:[r("Apply Presets"),jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CaretDownIcon,{})]})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuContent,{className:"max-h-80 w-56",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.ScrollArea,{className:"no-scrollbar h-full",children:lodashEs.isEmpty(c)?null:jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenuLabel,{children:[i.type," ",r("presets")]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuSeparator,{}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuGroup,{children:lodashEs.keys(c).map(x=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenuItem,{className:"group text-xs",onClick:()=>u(c[x]),children:[lodashEs.capitalize(lodashEs.startCase(r(x))),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuShortcut,{className:"invisible hover:font-bold hover:text-blue-600 group-hover:visible",children:r("apply")})]}))})]})})})]})})},BlockStylingProps=()=>{const o=useSelectedBlock(),[n,r]=useSelectedStylingBlocks(),{t:a}=reactI18next.useTranslation();if(!o)return null;const i=Object.keys(o).filter(c=>typeof o[c]=="string"&&o[c].startsWith("#styles:"));if(lodashEs.isEmpty(i)||i.length<=1)return null;const l=c=>lodashEs.find(n,u=>u.prop===c);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap gap-1",children:[jsxRuntime.jsxRuntimeExports.jsxs("label",{htmlFor:"block-styling-props",className:"py-1 text-xs",children:[a("Style element"),":"]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-wrap gap-2",children:lodashEs.map(i,c=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Badge,{className:"cursor-pointer",onClick:()=>{r([{id:`${c}-${o._id}`,blockId:o._id,prop:c}])},variant:l(c)?"default":"secondary",children:lodashEs.startCase(c)},c))}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"my-2 h-[1px] w-full bg-border"})]})},MAPPER={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1};function BlockStyling(){const{flexChild:o,gridChild:n}=useSelectedBlocksDisplayChild(),[r]=useSelectedStylingBlocks(),[a,i]=React.useState(""),[l,c]=React.useState({onDrag:d=>d,onDragEnd:d=>d,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),u=web.useThrottledCallback(d=>{const p=!lodashEs.get(l,"negative",!1),m=lodashEs.get(l,"cssProperty","");let h=parseFloat(l.dragStartValue);h=isNaN(h)?0:h;let b=MAPPER[l.dragUnit];(lodashEs.startsWith(m,"scale")||m==="opacity")&&(b=10);let f=(l.dragStartY-d.pageY)/b+h;p&&f<0&&(f=0),m==="opacity"&&f>1&&(f=1),l.onDrag(`${f}`),i(`${f}`)},[l],50),x=React.useCallback(()=>{setTimeout(()=>l.onDragEnd(`${a}`),100),c({onDrag:d=>d,onDragEnd:d=>d,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[l,a,c]);return lodashEs.isEmpty(r)?null:jsxRuntime.jsxRuntimeExports.jsxs(BlockSettingsContext.Provider,{value:{setDragData:c},children:[l.dragging?jsxRuntime.jsxRuntimeExports.jsx("div",{onMouseMove:u,onMouseUp:()=>x(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"}):null,jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsxRuntimeExports.jsx(BlockStylingProps,{}),jsxRuntime.jsxRuntimeExports.jsx(StylingHelpers,{}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Accordion,{defaultValue:["Styles"],type:"multiple",className:"w-full",children:[o&&jsxRuntime.jsxRuntimeExports.jsx(StylingGroup,{section:FLEX_CHILD_SECTION,showAccordian:o||n}),n&&jsxRuntime.jsxRuntimeExports.jsx(StylingGroup,{section:GRID_CHILD_SECTION,showAccordian:o||n}),SETTINGS_SECTIONS.map(d=>jsxRuntime.jsxRuntimeExports.jsx(StylingGroup,{section:d,showAccordian:o||n},d.heading))]})]})]})}const ChaiSelect=({defaultValue:o="",onValueChange:n,options:r,placeholder:a="Select",className:i=""})=>{const[l,c]=React.useState(o),u=x=>{const d=x.target.value;c(d),n(d)};return jsxRuntime.jsxRuntimeExports.jsx("div",{className:iconBase.cn("relative inline-block w-full",i),children:jsxRuntime.jsxRuntimeExports.jsxs("select",{className:"mt-1 flex w-full rounded-md border border-border bg-background px-3 py-1 text-sm text-foreground 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",value:l,onChange:u,children:[jsxRuntime.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,children:a}),r.map(x=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:x.value,children:x.label},x.value))]})})};function UILibrariesSelect({uiLibraries:o,library:n,setLibrary:r}){const{t:a}=reactI18next.useTranslation();return n?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"h-12",children:[jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs font-bold text-gray-500",children:a("Choose library")}),jsxRuntime.jsxRuntimeExports.jsx(ChaiSelect,{className:"mt-1",options:o.map(i=>({value:i.uuid,label:i.name})),defaultValue:n,onValueChange:i=>r(i)})]}):null}const BlockCard=({block:o,library:n,parentId:r=void 0,position:a=-1})=>{const[i,l]=React.useState(!1),c=useBuilderProp("getUILibraryBlock",lodashEs.noop),{addCoreBlock:u,addPredefinedBlock:x}=useAddBlock(),[,d]=useSelectedBlockIds(),{clearHighlight:p}=useBlockHighlight(),m=lodashEs.get(o,"name",lodashEs.get(o,"label")),h=flagged.useFeature("dnd"),[,b]=jotai.useAtom(draggedBlockAtom),R=_=>{const A=lodashEs.has(_,"styles_attrs.data-page-section");return _._type==="Box"&&A},f=React.useCallback(async _=>{if(_.stopPropagation(),lodashEs.has(o,"component")){u(o,r,a),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);return}l(!0);const A=await c(n,o);lodashEs.isEmpty(A)||x(runtime.syncBlocksWithDefaults(A),r,a),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},[u,x,o,c,n,r,a]),y=async _=>{const A=await c(n,o);let S=r;if(R(lodashEs.first(A))&&(S=null),!lodashEs.isEmpty(A)){const k={blocks:A,uiLibrary:!0,parent:S};if(_.dataTransfer.setData("text/plain",JSON.stringify(k)),o.preview){const v=new Image;v.src=o.preview,v.onload=()=>{_.dataTransfer.setDragImage(v,0,0)}}else _.dataTransfer.setDragImage(new Image,0,0);b(k),setTimeout(()=>{d([]),p(),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},200)}};return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:i?()=>{}:f,draggable:h?"true":"false",onDragStart:y,className:clsx("relative mt-2 cursor-pointer overflow-hidden rounded-md border border-border bg-white duration-200 hover:border-blue-500 hover:shadow-xl"),children:[i&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"animate-spin",size:15,color:"white"}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),o.preview?jsxRuntime.jsxRuntimeExports.jsx("img",{src:o.preview,className:"min-h-[45px] w-full rounded-md",alt:m}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border bg-gray-200",children:jsxRuntime.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:m})})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:m})})]})},libraryBlocksAtom=jotai.atom({}),useLibraryBlocks=o=>{const[n,r]=jotai.useAtom(libraryBlocksAtom),a=useBuilderProp("getUILibraryBlocks",lodashEs.noop),i=lodashEs.get(n,`${o==null?void 0:o.uuid}.blocks`,null),l=lodashEs.get(n,`${o==null?void 0:o.uuid}.loading`,"idle"),c=React.useRef("idle");return React.useEffect(()=>{(async()=>{if(l==="complete"||c.current==="loading")return;c.current="loading",r(x=>({...x,[o==null?void 0:o.uuid]:{loading:"loading",blocks:[]}}));const u=await a(o);c.current="idle",r(x=>({...x,[o==null?void 0:o.uuid]:{loading:"complete",blocks:u||[]}}))})()},[o,i,l,c,r,a]),{data:i||[],isLoading:l==="loading"}},UILibrarySection=({parentId:o,position:n})=>{const[r,a]=jotai.useAtom(selectedLibraryAtom),i=useBuilderProp("uiLibraries",[]),l=runtime.useRegisteredChaiBlocks(),c=lodashEs.values(l).filter(S=>S.category==="custom"),u=i.find(S=>S.uuid===r)||lodashEs.first(i),{data:x,isLoading:d}=useLibraryBlocks(u),p=lodashEs.groupBy([...x,...c],"group"),[m,h]=React.useState("Hero"),b=lodashEs.get(p,m,[]),R=React.useRef(null),{t:f}=reactI18next.useTranslation(),y=S=>{R.current&&(clearTimeout(R.current),R.current=null),R.current=setTimeout(()=>{R.current&&h(S)},300)};if(d)return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-4 grid h-full w-full grid-cols-12 gap-2",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"col-span-3 h-full"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"col-span-9 h-full"})]});const _=lodashEs.filter(b,(S,k)=>k%2===0),A=lodashEs.filter(b,(S,k)=>k%2===1);return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"relative mt-2 flex h-full max-h-full overflow-hidden bg-background",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full pt-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full max-h-full w-60 flex-col gap-1 px-1 pr-2",children:[jsxRuntime.jsxRuntimeExports.jsx(UILibrariesSelect,{library:u==null?void 0:u.uuid,setLibrary:a,uiLibraries:i}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex h-full max-h-full w-full flex-1 flex-col",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-xs font-bold text-gray-500",children:f("Groups")}),jsxRuntime.jsxRuntimeExports.jsx("hr",{className:"mt-1 border-border"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar mt-2 h-full max-h-full flex-1 overflow-y-auto pb-20",children:React.Children.toArray(lodashEs.map(p,(S,k)=>jsxRuntime.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>y(k),onMouseLeave:()=>clearTimeout(R.current),onClick:()=>h(k),className:iconBase.cn("flex w-full cursor-pointer items-center justify-between rounded-md p-2 text-sm text-foreground transition-all ease-in-out hover:bg-gray-200 dark:hover:bg-gray-800",k===m?"bg-blue-500 text-white hover:bg-blue-600":""),children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:lodashEs.capitalize(f(k.toLowerCase()))}),jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},k)))})]})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ScrollArea,{onMouseEnter:()=>R.current?clearTimeout(R.current):null,className:"z-10 -mt-2 flex h-full max-h-full w-full flex-col gap-2 border-l border-border transition-all ease-linear",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-2 px-2",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-1",children:React.Children.toArray(_.map(S=>jsxRuntime.jsxRuntimeExports.jsx(BlockCard,{parentId:o,position:n,block:S,library:u})))}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-1",children:React.Children.toArray(A.map(S=>jsxRuntime.jsxRuntimeExports.jsx(BlockCard,{parentId:o,position:n,block:S,library:u})))})]}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})]})})})},UILibrariesPanel=({parentId:o,position:n})=>jsxRuntime.jsxRuntimeExports.jsx(UILibrarySection,{parentId:o,position:n}),Core="Core",Import="Import",Breakpoints$1="Breakpoints",Clear="Clear",Cancel="Cancel",Yes="Yes",Preview="Preview",Settings="Settings",Styling="Styling",Remove="Remove",Choose="Choose",Cut="Cut",Copy="Copy",Paste="Paste",Delete="Delete",classes="classes",Theme="Theme",Outline="Outline",Copied="Copied",Stop="Stop",Edit="Edit",Tag="Tag",Value="Value",Images="Images",Library="Library",Blocks="Blocks",Basic="Basic",Media="Media",Advanced="Advanced",Form="Form",Groups="Groups",Accordions="Accordions",Buttons="Buttons",Layouts="Layouts",FAQ="FAQ",Hero="Hero",Features="Features",Footer="Footer",Navbar="Navbar",Icons="Icons",Testimonials="Testimonials",Blog="Blog",Saved="Saved",Unsaved="Unsaved",Randomize="Randomize",theme_config={heading_font:"Heading Font",body_font:"Body Font",rounded_corner:"Rounded Corners",primary:"Primary",secondary:"Secondary",background:"Background",text_color:"Text Color",background_dark_mode:"Background (Dark Mode)",text_color_dark_mode:"Text Color (Dark Mode)"},web_blocks={box:"box",tag:"Tag",div:"div",level:"Level",header:"header",footer:"footer",section:"section",article:"article",aside:"aside",main:"main",nav:"navigation",figure:"figure",details:"details",summary:"summary",dialog:"dialog",strike:"strike",caption:"caption",legend:"legend",figcaption:"figure caption",mark:"mark",background_image:"Background Image",label:"Label",default:"default",icon_size:"Icon Size",icon_position:"Icon Position",start:"Start",end:"End",button:"Button",custom_html:"Custom HTML",html_code:"HTML Code",default_snippet:"The HTML snippet goes here...",placeholder:"Enter custom HTML code here",custom_script:"Custom Script",dark_mode:"Dark Mode",divider:"Divider",empty_box:"Empty Box",heading:"Heading",image:"Image",alt:"Alt",width:"Width",height:"Height",video:"Video",span:"Span",content:"Content",icon:"Icon",richtext:"Rich Text",list:"List",list_type:"List Type",listitem:"List Item",link:"Link",list_item:"List Item",none:"None",disc:"Disc",number:"Number",paragraph:"Paragraph",lightbox_link:"Lightbox Link",href:"Link",type:"Type",iframe:"iframe",inline:"inline",ajax:"ajax",autoplay:"Video autoplay",max_width:"Max Width",backdrop_color:"Background Color",gallery_name:"Gallery Name",slot:"Slot",empty_slot:"Empty Slot",text:"Text",video_url:"Video URL",controls:"Show Controls",loop:"Loop",muted:"Muted",checkbox:"Checkbox",required:"Required",checked:"Checked",submit_button:"Submit Button",form:"Form",submit_url:"Submit URL",error_message:"Error Message",success_message:"Success Message",input:"Input",value:"Value",show_label:"Show Label",field_name:"Field Name",radio:"Radio",multiple:"Multiple",options:"Options",select:"Select",multiple_choice:"Multiple Choice",textarea:"Textarea",rows:"Rows"},Undo="Undo",Redo="Redo",Duplicate="Duplicate",Close="Close",Selected="Selected",Select="Select",Attributes="Attributes",apply="apply",presets="presets",Orientation="Orientation",Color="Color",Upload="Upload",lngEn={"Add block":"Add Block","Add blocks":"Add blocks","Enter or paste TailwindCSS HTML snippet":"Enter or paste TailwindCSS HTML snippet","Click to add block to page":"Click to add block to page",Core,"Custom Blocks":"Custom Blocks","UI Library":"UI Library",Import,"Use HTML snippets from Tailwind CSS component libraries":"Use HTML snippets from Tailwind CSS component libraries","Tailwind HTML snippet":"Tailwind HTML snippet","Enter your code snippet here":"Enter your code snippet here","Import HTML":"Import HTML","Imported HTML Note":"NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page.","Dark Mode":"Dark Mode","This page has no blocks. Add a block by clicking the + button":"This page has no blocks. Add a block by clicking the + button","This page is empty":"This page is empty","Please select a block to edit settings or styles":"Please select a block to edit settings or styles","Please select a block to Ask AI":"Please select a block to ask AI","Please select a styling block":"Please select a styling block","Drop your block here":"Drop your block here","Use setting":"Use setting","Mobile (XS)":"Mobile (XS)","Styles set here are applied to all screen unless edited at higher breakpoint":"Styles set here are applied to all screen unless edited at higher breakpoint","Mobile landscape (SM)":"Mobile landscape (SM)","Styles set here are applied at 640px and up unless edited at higher breakpoint":"Styles set here are applied at 640px and up unless edited at higher breakpoint","Tablet (MD)":"Tablet (MD)","Styles set here are applied at 768px and up":"Styles set here are applied at 768px and up","Tablet Landscape (LG)":"Tablet Landscape (LG)","Styles set here are applied at 1024px and up unless edited at higher breakpoint":"Styles set here are applied at 1024px and up unless edited at higher breakpoint","Desktop (XL)":"Desktop (XL)","Styles set here are applied at 1280px and up unless edited at higher breakpoint":"Styles set here are applied at 1280px and up unless edited at higher breakpoint","Large Desktop (2XL)":"Large Desktop (2XL)","Styles set here are applied at 1536px and up":"Styles set here are applied at 1536px and up",Breakpoints:Breakpoints$1,Clear,"Clear whole canvas?":"Clear whole canvas?","Are you sure you want to clear the whole canvas?":"Are you sure you want to clear the whole canvas?",Cancel,Yes,Preview,Settings,Styling,"Data Provider":"Data Provider","Remove Provider Confirmation":"Are you sure you want to remove <span class='text-blue-500'>{name}</span> provider?","Your data provider will be removed from this page and all added data binding will be not visible on blocks.":"Your data provider will be removed from this page and all added data binding will be not visible on blocks.",Remove,"You have no data providers registered. Please add a data provider to your project.":"You have no data providers registered. Please add a data provider to your project.","Learn more":"Learn more","Add data providers:":"Add data providers:","Select a provider":"Select a provider",Choose,"Page data providers:":"Page data providers:","View Data":"View Data","Mark as Global":"Mark as Global","Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.":"Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.","Global blocks are indicated with":"Global blocks are indicated with","Global blocks are available under 'Global' category":"Global blocks are available under 'Global' category","Enter global block name":"Enter global block name","Eg: Header, Footer":"Eg: Header, Footer","{length} blocks selected.":"{length} blocks selected.",Cut,Copy,Paste,Delete,"Clear Selection":"Clear Selection","This is dev mode. Visit":"This is dev mode. Visit","to see page preview":"to see page preview",classes,Theme,Outline,"Not supported":"Not supported","Please use Chrome, Firefox or Safari":"Please use Chrome, Firefox or Safari","Download Complete":"Download complete",Copied,"Enter Classes":"Enter classes separated by space","Ask AI":"Ask AI","Edit with AI":"Edit with AI","Generating... Please wait...":"Generating... Please wait...","Saving... Please wait...":"Saving... Please wait...","Deleting... Please wait...":"Deleting... Please wait...",Stop,"E.g.: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI":"E.g.: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.","Ask AI to edit styles":"Ask AI to edit styles","Ask AI to edit content":"Ask AI to edit content","AI Context":"AI Context","Select Block for AI":"Select a block to edit with AI","Select Block to Edit":"Please select a block to edit",Edit,"Describe this page. E.g.: This page is about...":"Describe this page. E.g.: This page is about...",Tag,Value,"Background Image":"Background Image","Enter image URL":"Enter image URL","Replace image":"Replace image","Choose image":"Choose image",Images,Library,Blocks,Basic,Media,Advanced,Form,"Choose Icon or SVG":"Choose an icon or enter SVG",Groups,"UI Libraries":"UI Libraries",Accordions,Buttons,Layouts,"Choose Library":"Choose library","No Library Found":"No library found.",FAQ,Hero,Features,Footer,Navbar,Icons,Testimonials,Blog,"Remove context":"Remove context","Yes, Delete":"Yes, Delete","AI Context Updated":"AI Context Updated","You can now ask AI to edit your content.":"You can now ask AI to edit your content.",Saved,Unsaved,"Saving...":"Saving...","Improve writing":"Improve writing","Replace placeholder content":"Replace placeholder content","Fix grammar":"Fix grammar","Make longer":"Make longer","Make shorter":"Make shorter","Add emojis":"Add emojis",Randomize,"Edit Block":"Edit Block","AI Assistant":"AI Assistant","Theme Config":{"Heading Font":"Heading Font","Body Font":"Body Font","Rounded Corner":"Rounded Corners",Primary:"Primary",Secondary:"Secondary",Background:"Background","Text Color":"Text Color","Background Dark Mode":"Background (Dark Mode)","Text Color Dark Mode":"Text Color (Dark Mode)"},"flex.heading":"Flex Child","flex.basis":"Basis","flex.order":"Order","flex.flex":"Flex","flex.grow":"Grow","flex.shrink":"Shrink","grid.heading":"Grid Child","grid.col_span":"Col Span","grid.col_start":"Col Start","grid.col_end":"Col End","grid.row_span":"Row Span","grid.row_start":"Row Start","grid.row_end":"Row End","grid.order":"Order","layout.heading":"Layout","layout.width":"Width","layout.height":"Height","layout.margin":"Margin","layout.margin_all":"All","layout.margin_lr":"Left-Right","layout.margin_tb":"Top-Bottom","layout.margin_top":"Top","layout.margin_right":"Right","layout.margin_bottom":"Bottom","layout.margin_left":"Left","layout.padding":"Padding","layout.padding_all":"All","layout.padding_lr":"Left-Right","layout.padding_tb":"Top-Bottom","layout.padding_top":"Top","layout.padding_right":"Right","layout.padding_bottom":"Bottom","layout.padding_left":"Left","layout.space_bt":"Space Bt.","layout.space_lr":"Left-Right","layout.space_tb":"Top-Bottom","size.heading":"Size","size.min_width_height":"Min width & height","size.min_width":"Min Width","size.min_height":"Min Height","size.max_width_height":"Max width & height","size.max_width":"Max Width","size.max_height":"Max Height","size.object_options_aspect_ratio":"Object options & aspect ratio","size.aspect":"Aspect","size.fit":"Fit","size.position":"Position","display.heading":"Display","display.display":"Display","display.flex_options":"Flex options","display.flex_direction":"Direction","display.flex_wrap":"Wrap","display.justify_content":"Justify","display.align_content":"Content","display.align_items":"Items","display.gap":"Gap","display.gap_all":"All","display.gap_lr":"Left-Right","display.gap_tb":"Top-Bottom","display.grid_options":"Grid options","display.grid_columns":"Columns","display.grid_rows":"Rows","display.grid_auto_flow":"Auto Flow","display.grid_auto_cols":"Auto Cols","display.grid_auto_rows":"Auto Rows","display.visibility_opacity":"Visibility & Opacity","display.visibility":"Visibility","display.opacity":"Opacity","position.heading":"Position","position.position":"Position","position.options":"Position options","position.direction":"Direction","position.top":"Top","position.right":"Right","position.bottom":"Bottom","position.left":"Left","position.inset":"Inset","position.all":"All","position.lr":"Left Right","position.tb":"Top Bottom","position.z_index":"Z-Index","position.float_clear":"Float & Clear","position.float":"Float","position.clear":"Clear","position.overflow_overscroll":"Overflow & Overscroll","position.overflow":"Overflow","position.overscroll":"Overscroll","typography.heading":"Typography","typography.font":"Font","typography.size":"Size","typography.height":"Height","typography.weight":"Weight","typography.color":"Color","typography.alignments":"Alignments","typography.align":"Align","typography.valign":"V. Align","typography.spacing_decoration_more":"Spacing, decoration & more","typography.spacing":"Spacing","typography.decoration":"Decoration","typography.thickness":"Thickness","typography.transform":"Transform","typography.whitespace_breaks":"White space & breaks","typography.whitespace":"Whitespace","typography.wordbreak":"Wordbreak","background.heading":"Background","background.bgcolor":"Bg. Color","background.position_size_more":"Position, Size & more","background.attachment":"Attachment","background.clipping":"Clipping","background.origin":"Origin","background.position":"Position","background.repeat":"Repeat","background.size":"Size","background.gradient":"Gradient","background.gradient_colors":"Gradient colors","background.from_color":"From","background.via_color":"Via","background.to_color":"To","border.heading":"Border & Outline","border.width":"Width","border.all":"All","border.lr":"Left Right","border.tb":"Top bottom","border.top":"Top","border.right":"Right","border.bottom":"Bottom","border.left":"Left","border.corners":"Corners","border.top_left":"Top Left","border.top_right":"Top right","border.bottom_right":"Bottom right","border.bottom_left":"Bottom left","border.color":"Color","border.style":"Style","border.divide_options":"Divide options","border.divide_color":"Color","border.divide_style":"Style","border.outline_styling":"Outline styling","border.outline_width":"Width","border.outline_offset":"Offset","border.outline_style":"Style","border.ring_options":"Ring options","border.ring_width":"Width","border.ring_color":"Color","border.ring_offset_width":"Offset","border.ring_offset_color":"Off. color","effect.heading":"Effect & Animation","effect.shadow":"Shadow","effect.color":"Color","effect.cursor":"Cursor","effect.blend_cursor":"Blend & Cursor","effect.mix_blend":"Mix Blend","effect.bg_blend":"Bg. Blend","effect.transform":"Transform","effect.origin":"Origin","effect.scale":"Scale","effect.all":"All","effect.lr":"Left-Right","effect.tb":"Top-Bottom","effect.skew":"Skew","effect.translate":"Translate","effect.rotate":"Rotate","effect.animation":"Animation","effect.transition":"Transition","effect.easing":"Easing","effect.duration":"Duration","effect.delay":"Delay","classes.heading":"Classes",theme_config,web_blocks,"Copy classes to clipboard":"Copy classes to clipboard","Classes copied to clipboard":"Classes copied to clipboard","Show hidden blocks":"Show hidden blocks","Expand all":"Expand all","Collapse all":"Collapse all","Choose library":"Choose library","Close Preview":"Close Preview",Error:"Error","Failed to copy template":"Failed to copy template","Total tokens used":"Total tokens used","Updated AI Context":"Updated AI Context","You can now Ask AI to edit your content":"You can now Ask AI to edit your content","Tell about this page eg this page is about":"Tell about this page eg this page is about..","Delete Context":"Delete Context","Keyboard shortcuts":"Keyboard shortcuts",Undo,Redo,Duplicate,"Deselect blocks":"Deselect blocks","Delete block":"Delete block","Save page":"Save page","Scripts will be only executed in preview and live mode.":"Scripts will be only executed in preview and live mode.","HTML Code Editor |":"HTML Code Editor |",Close,"Coming soon":"Coming soon",Selected,Select,"Choose Builder Layout":"Choose Builder Layout","Single side panel":"Single side panel","Suitable for smaller screens. Bigger canvas size.":"Suitable for smaller screens. Bigger canvas size.","Dual side panel":"Dual side panel","Suitable for larger screens. Smaller canvas size.":"Suitable for larger screens. Smaller canvas size.","Dual side panel advanced":"Dual side panel advanced","Suitable for heavy styling & block editing. Setting are always visible.":"Suitable for heavy styling & block editing. Setting are always visible.","Block Settings":"Block Settings","Visibility settings":"Visibility settings","Show on canvas":"Show on canvas",Attributes,"Apply Presets":"Apply Presets",apply,presets,"Global presets":"Global presets",Orientation,Color,"Please select an image":"Please select an image","click to upload":"click to upload","SVG, PNG, JPG or GIF (Max. 2mb)":"SVG, PNG, JPG or GIF (Max. 2mb)","Uploading...":"Uploading...",Upload,"Something went wrong":"Something went wrong","Fetching...":"Fetching...","No images found":"No images found","It looks like you haven't uploaded any images yet. Start by clicking the upload button above.":"It looks like you haven't uploaded any images yet. Start by clicking the upload button above.","Open Code Editor":"Open Code Editor","Clear search":"Clear search","No results found for":"No results found for","Search {pageTypeName}":"Search {pageTypeName}"};i18n.use(reactI18next.initReactI18next).init({resources:{en:{translation:lngEn}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const CoreBlock=({block:o,disabled:n,parentId:r,position:a})=>{const[,i]=jotai.useAtom(draggedBlockAtom),{type:l,icon:c,label:u}=o,{addCoreBlock:x,addPredefinedBlock:d}=useAddBlock(),[,p]=useSelectedBlockIds(),{clearHighlight:m}=useBlockHighlight(),h=()=>{if(lodashEs.has(o,"blocks")){const f=lodashEs.isFunction(o.blocks)?o.blocks():o.blocks;d(runtime.syncBlocksWithDefaults(f),r||null,a)}else x(o,r||null,a);pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},b=flagged.useFeature("dnd"),{t:R}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{disabled:n,onClick:h,type:"button",onDragStart:f=>{f.dataTransfer.setData("text/plain",JSON.stringify(lodashEs.omit(o,["component","icon"]))),f.dataTransfer.setDragImage(new Image,0,0),i(lodashEs.omit(o,["component","icon"])),setTimeout(()=>{p([]),m()},200)},draggable:b?"true":"false",className:"cursor-pointer space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 dark:border-gray-700 dark:text-white dark:hover:bg-slate-800/50 dark:disabled:bg-gray-900 dark:disabled:text-foreground",children:[React.createElement(c||reactIcons.BoxIcon,{className:"w-4 h-4 mx-auto"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:lodashEs.capitalize(R(u||l))})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:R(u||l)})})]})})},DefaultChaiBlocks=({parentId:o,position:n,gridCols:r="grid-cols-2"})=>{const a=runtime.useRegisteredChaiBlocks(),i=useBuilderProp("filterChaiBlock",()=>!0),l=lodashEs.filter(a,i),c=lodashEs.groupBy(l,"category"),u=lodashEs.uniq(lodashEs.map(c.core,"group"));return jsxRuntime.jsxRuntimeExports.jsx(ChaiBuilderBlocks,{gridCols:r,parentId:o,position:n,groups:u,blocks:c.core})},CORE_GROUPS=["basic","typography","media","layout","form","advanced","other"],ChaiBuilderBlocks=({groups:o,blocks:n,parentId:r,position:a,gridCols:i="grid-cols-4"})=>{var x;const{t:l}=reactI18next.useTranslation(),[c]=useBlocksStore(),u=(x=lodashEs.find(c,d=>d._id===r))==null?void 0:x._type;return React.Children.toArray(lodashEs.map(lodashEs.sortBy(o,d=>CORE_GROUPS.indexOf(d)===-1?99:CORE_GROUPS.indexOf(d)),d=>lodashEs.reject(lodashEs.filter(lodashEs.values(n),{group:d}),{hidden:!0}).length?jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Accordion,{type:"single",value:d,collapsible:!0,className:"w-full",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AccordionItem,{value:d,className:"border-border",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionTrigger,{className:"rounded-md bg-background px-4 py-2 capitalize text-foreground hover:no-underline",children:lodashEs.capitalize(l(d.toLowerCase()))}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionContent,{className:"mx-auto max-w-xl p-3",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grid gap-2 "+i,children:React.Children.toArray(lodashEs.reject(lodashEs.filter(lodashEs.values(n),{group:d}),{hidden:!0}).map(p=>jsxRuntime.jsxRuntimeExports.jsx(CoreBlock,{parentId:r,position:a,block:p,disabled:!canAcceptChildBlock(u,p.type)||!canBeNestedInside(u,p.type)})))})})]})}):null))},addBlockTabAtom=atomWithStorage("__add_block_tab","library"),AddBlocksPanel=({className:o,showHeading:n=!0,parentId:r=void 0,position:a=-1})=>{const{t:i}=reactI18next.useTranslation(),[l,c]=jotai.useAtom(addBlockTabAtom),[,u]=jotai.useAtom(showPredefinedBlockCategoryAtom),x=useBuilderProp("importHTMLSupport",!0),d=useBuilderProp("addBlocksDialogTabs",[]),p=React.useCallback(()=>{pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},[]);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("flex h-full w-full flex-col overflow-hidden",o),children:[n?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[jsxRuntime.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:i("Add block")}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:i(l==="html"?"Enter or paste TailwindCSS HTML snippet":"Click to add block to page")})]}):null,jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tabs,{onValueChange:m=>{u(""),c(m)},value:l,className:"flex h-full max-h-full flex-col overflow-hidden",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TabsList,{className:"flex w-full items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"library",children:i("Library")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"core",children:i("Blocks")}),x?jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"html",children:i("Import")}):null,lodashEs.map(d,m=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:m.key,children:React.createElement(m.tab)}))]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:"core",className:"h-full max-h-full flex-1 pb-20",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.ScrollArea,{className:"-mx-1.5 h-full max-h-full overflow-y-auto",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:jsxRuntime.jsxRuntimeExports.jsx(DefaultChaiBlocks,{gridCols:"grid-cols-4",parentId:r,position:a})})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:"library",className:"h-full max-h-full flex-1 pb-20",children:jsxRuntime.jsxRuntimeExports.jsx(UILibrariesPanel,{parentId:r,position:a})}),x?jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:"html",className:"h-full max-h-full flex-1 pb-20",children:jsxRuntime.jsxRuntimeExports.jsx(ImportHTML,{parentId:r,position:a})}):null,lodashEs.map(d,m=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:m.key,children:React.createElement(m.tabContent,{close:p,parentId:r,position:a})}))]})]})};function usePubSub(o,n){React.useEffect(()=>{const r=pubsub.subscribe(o,n);return()=>r()},[o,n])}const AddBlocksDialog=()=>{const{t:o}=reactI18next.useTranslation(),[n,r]=React.useState(""),[a,i]=React.useState(-1),[l,c]=React.useState(!1);return usePubSub(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,u=>{r(u?u._id:null),i(isNaN(u==null?void 0:u.position)?-1:u==null?void 0:u.position),c(!0)}),usePubSub(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK,()=>{r(""),i(-1),c(!1)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialog,{open:l,onOpenChange:()=>l?c(!1):"",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogContent,{className:"max-w-5xl overflow-hidden border-border",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogHeader,{className:"flex flex-row items-center justify-between",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTitle,{className:"text-foreground",children:o("Add blocks")}),jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:()=>c(!1),className:"text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Cross2Icon,{className:"h-6 w-6"})})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-[500px] max-h-full overflow-hidden",children:jsxRuntime.jsxRuntimeExports.jsx(AddBlocksPanel,{parentId:n,position:a,showHeading:!1})})]})})};function FaFilePen(o){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V299.6l-94.7 94.7c-8.2 8.2-14 18.5-16.8 29.7l-15 60.1c-2.3 9.4-1.8 19 1.4 27.8H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"},child:[]}]})(o)}const QUICK_PROMPTS=[{name:"Improve writing",icon:FaFilePen,prompt:"Improving writing in all text elements. Replacing placeholder content with meaningful relevant content."},{name:"Replace placeholder content",icon:FaRecycle,prompt:"Discard current placeholder content and replace with meaningful relevant content."},{name:"Fix grammar",icon:reactIcons.CheckIcon,prompt:"Fix grammar in all text elements. Ensuring the text is grammatically correct and free of errors."},{name:"Make longer",icon:reactIcons.ArrowUpIcon,prompt:"Make all text elements longer."},{name:"Make shorter",icon:reactIcons.ArrowDownIcon,prompt:"Make all text elements shorter."},{name:"Add emojis",icon:lucideReact.SmileIcon,prompt:"Add emojis to text elements if relevant."},{name:"Randomize",icon:lucideReact.ShuffleIcon,prompt:"Randomize all text elements."}];function QuickPrompts({onClick:o}){const{loading:n}=useAskAi(),{t:r}=reactI18next.useTranslation(),{selectedLang:a,fallbackLang:i}=useLanguages(),l=[...QUICK_PROMPTS];return a&&a!==i&&l.splice(0,0,{name:`Translate to ${lodashEs.get(LANGUAGES,a,a)}`,icon:FaLanguage,prompt:`Translate the content to ${lodashEs.get(LANGUAGES,a,a)}. Maintain same tone, style and length.`}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:n?"pointer-events-none opacity-50":"",children:jsxRuntime.jsxRuntimeExports.jsx("ul",{className:"space-y-2",children:l.map(({name:c,icon:u,subMenus:x,prompt:d})=>x?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Popover,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("li",{className:"flex cursor-pointer items-center space-x-2 rounded p-1 pl-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-800",children:[jsxRuntime.jsxRuntimeExports.jsx(u,{className:"h-4 w-4"}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:c})]},c)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.PopoverContent,{side:"right",children:jsxRuntime.jsxRuntimeExports.jsx("ul",{children:jsxRuntime.jsxRuntimeExports.jsx("li",{children:"Happy"})})})]}):jsxRuntime.jsxRuntimeExports.jsxs("li",{onClick:()=>o(d),className:"flex cursor-pointer items-center space-x-2 rounded p-1 text-sm hover:bg-gray-100 dark:hover:bg-gray-800",children:[jsxRuntime.jsxRuntimeExports.jsx(u,{className:"h-4 w-4"}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:r(c)})]},c))})})}const AIUserPrompt=({blockId:o})=>{const{t:n}=reactI18next.useTranslation(),{askAi:r,loading:a,error:i}=useAskAi(),[l,c]=React.useState(""),[u,x]=React.useState(!0),[d,p]=React.useState(),m=React.useRef(null),h=React.useRef(null);React.useEffect(()=>{var R;(R=m.current)==null||R.focus()},[]);const b=R=>{const{usage:f}=R||{};!i&&f&&p(f),h.current=setTimeout(()=>p(void 0),1e4),i||c("")};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:()=>x(!u),className:"flex cursor-pointer items-center justify-between border-t border-border py-2 text-sm font-medium hover:underline",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:n("Ask AI")}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 text-gray-500 "+(u?"rotate-180":"")})})]}),u&&o?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{ref:m,value:l,onChange:R=>c(R.target.value),placeholder:n("Ask AI to edit content"),className:"w-full",rows:3,onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),h.current&&clearTimeout(h.current),p(void 0),r("content",o,l,b))}}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"my-2 flex items-center gap-2",children:[a?null:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:l.trim().length<5||a,onClick:()=>{h.current&&clearTimeout(h.current),p(void 0),r("content",o,l,b)},variant:"default",className:"w-fit",size:"sm",children:a?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"h-5 w-5 animate-spin"}),n("Generating... Please wait...")]}):n("Edit with AI")}),a?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Skeleton,{className:"flex w-full items-center space-x-1 px-4 py-1 pl-2",children:[jsxRuntime.jsxRuntimeExports.jsx(FaSpinner,{className:"h-4 w-4 animate-spin text-gray-500"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs",children:n("Generating... Please wait...")})]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"destructive",onClick:()=>stop(),className:"hidden w-fit",size:"sm",children:n("Stop")})]}):null]}),d?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:jsxRuntime.jsxRuntimeExports.jsxs("p",{className:"mb-1 flex justify-between break-words rounded border border-blue-500 bg-blue-100 p-1 text-xs text-blue-500",children:[jsxRuntime.jsxRuntimeExports.jsxs("span",{children:[n("Total tokens used"),": ",d.totalTokens]}),jsxRuntime.jsxRuntimeExports.jsx(Countdown,{})]})}):null,jsxRuntime.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:i.message})}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx(QuickPrompts,{onClick:R=>{h.current&&clearTimeout(h.current),p(void 0),r("content",o,R,b)}})]}):u?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4 text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.SparklesIcon,{className:"mx-auto text-3xl text-muted-foreground"}),jsxRuntime.jsxRuntimeExports.jsx("h1",{children:n("Please select a block to Ask AI")})]})}):null]})},AISetContext=()=>{const{t:o}=reactI18next.useTranslation(),n=useBuilderProp("aiContext",""),[r,a]=React.useState(n),i=React.useRef(null),l=useBuilderProp("saveAiContextCallback",lodashEs.noop),[c,u]=React.useState(!1),[x,d]=React.useState(null),[,p]=React.useState(!1),{toast:m}=contextMenu.useToast(),h=React.useRef(null);React.useEffect(()=>{n&&a(n)},[n]);const b=async()=>{try{u(!0),d(null),await l(r),m({title:o("Updated AI Context"),description:o("You can now Ask AI to edit your content"),variant:"default"}),h.current.click()}catch(R){d(R)}finally{u(!1)}};return jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Accordion,{onValueChange:R=>{p(R!=="")},type:"single",collapsible:!0,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AccordionItem,{value:"set-context",className:"border-none",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionTrigger,{ref:h,className:"border-0 border-border py-2",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-between",children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"font-medium",children:o("AI Context")})})}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AccordionContent,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{ref:i,value:r,onChange:R=>a(R.target.value),placeholder:o("Tell about this page eg this page is about"),className:"mt-1 w-full",rows:10,onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),b())}}),n.trim().length===0?jsxRuntime.jsxRuntimeExports.jsx("p",{className:"mt-2 text-xs text-gray-500",children:o("Eg: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.")}):null,jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:r.trim().length<5,onClick:()=>b(),variant:"default",className:"w-fit",size:"sm",children:c?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"h-5 w-5 animate-spin"}),o("Saving... Please wait...")]}):o("Save")}),n.trim().length>0?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialog,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:n.trim().length===0,variant:"ghost",className:"w-fit",size:"sm",children:c?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"h-5 w-5 animate-spin"}),o("Deleting... Please wait...")]}):o("Delete")})}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogContent,{children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogHeader,{children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogTitle,{children:[o("Delete context")," ?"]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogDescription,{})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogFooter,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogCancel,{children:o("Cancel")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogAction,{onClick:()=>{a(""),b()},children:o("Yes, Delete")})]})]})]}):null]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-2 max-w-full",children:x&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:x.message})})]})]})})},AskAI=()=>{const[o]=useSelectedBlockIds();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar mt-2 flex-1 overflow-y-auto",children:[jsxRuntime.jsxRuntimeExports.jsx(AISetContext,{}),jsxRuntime.jsxRuntimeExports.jsx(AIUserPrompt,{blockId:lodashEs.first(o)})]})},AttrsEditor=React.memo(function o({preloadedAttributes:n=[],onAttributesChange:r}){const[a,i]=React.useState([]),[l,c]=React.useState(""),[u,x]=React.useState(""),[d,p]=React.useState(null),[m,h]=React.useState(""),b=React.useRef(null),R=React.useRef(null);React.useEffect(()=>{i(n)},[n]);const f=()=>{if(l.startsWith("@")){h("Attribute keys cannot start with '@'");return}if(l){const k=[...a,{key:l,value:u}];r(k),i(a),c(""),x(""),h("")}},y=k=>{const v=a.filter((g,E)=>E!==k);r(v),i(v)},_=k=>{p(k),c(a[k].key),x(a[k].value)},A=()=>{if(l.startsWith("@")){h("Attribute keys cannot start with '@'");return}if(d!==null&&l){const k=[...a];k[d]={key:l,value:u},r(k),i(k),p(null),c(""),x(""),h("")}},S=k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),d!==null?A():f())};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex max-h-full flex-1 flex-col",children:[jsxRuntime.jsxRuntimeExports.jsxs("form",{onSubmit:k=>{k.preventDefault(),d!==null?A():f()},className:"space-y-3",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{htmlFor:"attrKey",className:"text-[11px] font-normal leading-tight text-slate-600",children:"Key"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Input,{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",id:"attrKey",ref:b,value:l,onChange:k=>c(k.target.value),placeholder:"Enter Key",className:"py-0 text-xs font-normal leading-tight placeholder:text-slate-400"})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{htmlFor:"attrValue",className:"text-[11px] font-normal text-slate-600",children:"Value"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",id:"attrValue",rows:2,ref:R,value:u,onChange:k=>x(k.target.value),onKeyDown:S,placeholder:"Enter Value",className:"text-xs font-normal leading-tight placeholder:text-slate-400"})]})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{type:"submit",disabled:!l.length,variant:"default",size:"sm",className:"h-8 w-24 text-xs",children:d!==null?"Save":"Add"})}),m&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs text-red-500",children:m})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"space-y-1 py-4",children:a.map((k,v)=>jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col text-xs leading-tight",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:"truncate text-[12px] font-light text-muted-foreground",children:k.key}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-wrap max-w-[200px] font-normal",children:k.value.toString()})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex-shrink-0 text-slate-400",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>_(v),children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Edit2,{className:"h-3 w-3"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>y(v),children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.X,{className:"h-3 w-3"})})]})]},v))})]})}),BlockAttributesEditor=React__namespace.memo(()=>{const o=useSelectedBlock(),[n,r]=React.useState([]),[a]=useSelectedStylingBlocks(),i=useUpdateBlocksProps(),l=`${lodashEs.get(a,"0.prop")}_attrs`;React__namespace.useEffect(()=>{const u=lodashEs.map(lodashEs.get(o,l),(x,d)=>({key:d,value:x}));lodashEs.isEmpty(u)?r([]):r(u)},[lodashEs.get(o,l)]);const c=React__namespace.useCallback((u=[])=>{const x={};lodashEs.forEach(u,d=>{lodashEs.isEmpty(d.key)||lodashEs.set(x,d.key,d.value)}),i([lodashEs.get(o,"_id")],{[l]:x})},[o,i,l]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex-col gap-y-2",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsxRuntimeExports.jsx("div",{children:jsxRuntime.jsxRuntimeExports.jsx(AttrsEditor,{preloadedAttributes:n,onAttributesChange:c})})})})});function getDNDSupport(){return new URLSearchParams(window.location.search).has("dnd")}const FEATURE_TOGGLES={dnd:getDNDSupport()},builderStore=jotai.getDefaultStore(),setDebugLogs=o=>{},getParentNodeIds=(o,n)=>{const r=[];let a=lodashEs.find(o,{_id:n}),i=lodashEs.get(a,"_parent","");for(;lodashEs.isString(i)&&!lodashEs.isEmpty(i);)r.push(a==null?void 0:a._parent),a=lodashEs.find(o,{_id:i}),i=a==null?void 0:a._parent;return lodashEs.flatten(r)},expandedIdsAtom=jotai.atom([]),useExpandTree=()=>{const[o]=useSelectedBlockIds(),n=jotai.useAtomValue(presentBlocksAtom),[,r]=jotai.useAtom(expandedIdsAtom);React.useEffect(()=>{let a=[];const i=lodashEs.first(o);lodashEs.isString(i)&&(a=[i,...getParentNodeIds(n,i)]),r(a)},[o,n,r])},UndoRedo=()=>{const{hasUndo:o,hasRedo:n,undo:r,redo:a}=useUndoManager();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:!o(),size:"sm",onClick:r,className:"rounded-full",variant:"ghost",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ResetIcon,{})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:!n(),onClick:a,size:"sm",className:"rounded-full",variant:"ghost",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function DarkMode(){const[o,n]=useDarkMode();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.SunIcon,{className:"size-4 shrink-0"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Switch,{id:"dark-mode-switch",checked:o,onCheckedChange:()=>{n(!o)},className:`${o?"bg-violet-600":"bg-violet-300"} relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:jsxRuntime.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${o?"translate-x-5":"translate-x-0"} pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})}),jsxRuntime.jsxRuntimeExports.jsx(FaMoon,{className:"size-4 ml-3 shrink-0"})]})}const TabletIcon=({landscape:o=!1})=>jsxRuntime.jsxRuntimeExports.jsx("svg",{className:o?"rotate-90":"",stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"14px",width:"14px",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxRuntimeExports.jsx("path",{d:"M400 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM224 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm176-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h328c6.6 0 12 5.4 12 12v312z"})}),WEB_BREAKPOINTS=[{title:"Mobile (XS)",content:"Styles set here are applied to all screen unless edited at higher breakpoint",breakpoint:"xs",icon:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.MobileIcon,{}),width:400},{title:"Mobile landscape (SM)",content:"Styles set here are applied at 640px and up unless edited at higher breakpoint",breakpoint:"sm",icon:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.MobileIcon,{className:"rotate-90"}),width:640},{title:"Tablet (MD)",content:"Styles set here are applied at 768px and up",breakpoint:"md",icon:jsxRuntime.jsxRuntimeExports.jsx(TabletIcon,{}),width:800},{title:"Tablet Landscape (LG)",content:"Styles set here are applied at 1024px and up unless edited at higher breakpoint",breakpoint:"lg",icon:jsxRuntime.jsxRuntimeExports.jsx(TabletIcon,{landscape:!0}),width:1024},{title:"Desktop (XL)",content:"Styles set here are applied at 1280px and up unless edited at higher breakpoint",breakpoint:"xl",icon:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.LaptopIcon,{}),width:1420},{title:"Large Desktop (2XL)",content:"Styles set here are applied at 1536px and up",breakpoint:"2xl",icon:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DesktopIcon,{}),width:1920}],BreakpointCard=({title:o,content:n,currentBreakpoint:r,breakpoint:a,width:i,icon:l,onClick:c})=>{const{t:u}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.HoverCard,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.HoverCardTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>c(i),size:"sm",variant:a===r?"secondary":"ghost",children:l})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.HoverCardContent,{className:"w-52 border-border",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:u(o)}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs",children:u(n)})]})})})]})},Breakpoints=()=>{const[,o,n]=useCanvasWidth(),[r,a]=useSelectedBreakpoints(),{t:i}=reactI18next.useTranslation(),l=useBuilderProp("breakpoints",WEB_BREAKPOINTS),c=u=>{r.includes(u)?r.length>2&&a(r.filter(x=>x!==u)):a(x=>[...x,u])};return l.length<4?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:lodashEs.map(l,u=>React.createElement(BreakpointCard,{...u,onClick:n,key:u.breakpoint,currentBreakpoint:o}))}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[lodashEs.map(l.filter(u=>lodashEs.includes(r,lodashEs.toUpper(u.breakpoint))),u=>React.createElement(BreakpointCard,{...u,onClick:n,key:u.breakpoint,currentBreakpoint:o})),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenu,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DotsVerticalIcon,{className:"scale-90 transform"})})}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuLabel,{children:i("Breakpoints")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuSeparator,{}),lodashEs.map(l,u=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuCheckboxItem,{disabled:u.breakpoint==="xs",onCheckedChange:()=>c(lodashEs.toUpper(u.breakpoint)),checked:lodashEs.includes(r,lodashEs.toUpper(u.breakpoint)),children:i(u.title)},u.breakpoint))]})]})]})},ClearCanvas=()=>{const{t:o}=reactI18next.useTranslation(),{setNewBlocks:n}=useBlocksStoreUndoableActions(),[,r]=useSelectedBlockIds(),[,a]=useSelectedStylingBlocks(),i=React.useCallback(()=>{n([]),r([]),a([])},[n]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialog,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.EraserIcon,{})," ",o("Clear")]})}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogContent,{className:"border-border",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogHeader,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTitle,{className:"text-foreground",children:o("Clear whole canvas? ")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogDescription,{children:o("Are you sure you want to clear the page?")})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogFooter,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogCancel,{className:"text-foreground",children:o("Cancel")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogAction,{onClick:i,children:o("Yes")})]})]})]})})},AiAssistant=()=>{const o=useAiAssistant(),[n]=useRightPanel(),r=useBuilderProp("askAiCallBack",null),{t:a}=reactI18next.useTranslation();return r?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Label,{htmlFor:"ai-assistant",className:"flex items-center gap-x-1 text-sm text-yellow-600",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.SparklesIcon,{className:"w-4"}),a("AI Assistant")]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Switch,{className:"scale-90",checked:n==="ai",onCheckedChange:i=>{o(i)},id:"ai-assistant"})]}):null},CanvasTopBar=()=>{const o=useBuilderProp("darkMode",!0),[n]=useCanvasZoom();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-border bg-background/70 px-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[jsxRuntime.jsxRuntimeExports.jsx(Breakpoints,{}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Separator,{orientation:"vertical"}),o?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(DarkMode,{}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Separator,{orientation:"vertical"})]}):null,jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[lodashEs.round(n,0),"%"]})]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Separator,{orientation:"vertical"}),jsxRuntime.jsxRuntimeExports.jsx(UndoRedo,{})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[jsxRuntime.jsxRuntimeExports.jsx(ClearCanvas,{}),jsxRuntime.jsxRuntimeExports.jsx(AiAssistant,{})]})]})};function BlockAttributesToggle(){const{t:o}=reactI18next.useTranslation(),[n,r]=React.useState(!0),[a]=useSelectedStylingBlocks();return lodashEs.isEmpty(a)?null:jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:()=>r(!n),className:"flex cursor-pointer items-center justify-between border-t border-border py-3 text-xs font-medium hover:underline",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:o("Attributes")}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 text-gray-500 "+(n?"rotate-180":"")})})]}),n&&jsxRuntime.jsxRuntimeExports.jsx(BlockAttributesEditor,{})]})}const SettingsPanel=()=>{const o=useSelectedBlock(),{t:n}=reactI18next.useTranslation(),r=useBuilderProp("onError",lodashEs.noop);return lodashEs.isNull(o)?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4 text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),jsxRuntime.jsxRuntimeExports.jsx("h1",{children:n("Please select a block to edit settings or styles")})]})}):jsxRuntime.jsxRuntimeExports.jsx(reactErrorBoundary.ErrorBoundary,{fallback:jsxRuntime.jsxRuntimeExports.jsx(FallbackError,{}),onError:r,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tabs,{defaultValue:"settings",className:"flex flex-1 flex-col",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TabsList,{className:"grid h-auto w-full grid-cols-2 p-1 py-1",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"settings",className:"text-xs",children:"Settings"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"styles",className:"text-xs",children:"Styles"})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TabsContent,{value:"settings",className:"no-scrollbar h-full max-h-min overflow-y-auto",children:[jsxRuntime.jsxRuntimeExports.jsx(BlockSettings,{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TabsContent,{value:"styles",className:"no-scrollbar h-full max-h-min max-w-full overflow-y-auto overflow-x-hidden",children:[jsxRuntime.jsxRuntimeExports.jsx(BlockStyling,{}),jsxRuntime.jsxRuntimeExports.jsx(BlockAttributesToggle,{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})]})})};function LayoutCard({disabled:o=!1,description:n,title:r,selected:a,onSelect:i,children:l}){const{t:c}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Card,{"aria-disabled":o,className:`cursor-pointer border-border transition-all ${a?"ring-2 ring-secondary":""} ${o?"cursor-not-allowed opacity-50":""}`,onClick:i,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.CardContent,{className:"p-4",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxRuntimeExports.jsx("h3",{className:"text-lg font-semibold",children:r}),a&&jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CheckIcon,{className:"h-6 w-6 rounded-full bg-background p-px text-foreground"})]}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:n}),l,jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:o,className:"mt-4 w-full",variant:a?"default":"outline",children:c(o?"Coming soon":a?"Selected":"Select")})]})})}const ChooseLayout=({open:o,close:n})=>{const{t:r}=reactI18next.useTranslation(),[a,i]=useLayoutVariant(),l=c=>{i(c),n()};return jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialog,{open:o,onOpenChange:()=>o?n():"",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogContent,{className:"max-w-4xl overflow-hidden border-border",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogHeader,{className:"flex flex-row items-center justify-between",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTitle,{className:"text-foreground",children:r("Choose Builder Layout")}),jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:()=>n(),className:"text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Cross2Icon,{className:"h-6 w-6"})})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar max-h-full overflow-hidden",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxRuntime.jsxRuntimeExports.jsx(LayoutCard,{title:r("Single side panel"),description:r("Suitable for smaller screens. Bigger canvas size."),selected:a==="SINGLE_SIDE_PANEL",onSelect:()=>l("SINGLE_SIDE_PANEL"),children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col rounded border border-border",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"borde-b h-4 border-b border-border"}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-32",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-3/4 border-l border-border bg-background"})]})]})}),jsxRuntime.jsxRuntimeExports.jsx(LayoutCard,{title:r("Dual side panel"),description:r("Suitable for larger screens. Blocks settings is always visible."),selected:a==="DUAL_SIDE_PANEL",onSelect:()=>l("DUAL_SIDE_PANEL"),children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col rounded border border-border",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"borde-b h-4 border-b border-border"}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-32",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-2/4 border-x border-border bg-background"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"})]})]})}),jsxRuntime.jsxRuntimeExports.jsx(LayoutCard,{disabled:!0,title:r("Dual side panel advanced"),description:r("Suitable for heavy styling & block editing. Setting are always visible."),selected:!1,onSelect:()=>{},children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col rounded border border-border",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"borde-b h-4 border-b border-border"}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-32",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-2/4 border-x border-border bg-background"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"})]})]})})]})})]})})},TopBar=React.lazy(()=>Promise.resolve().then(()=>require("./Topbar-Bk4vqKpP.cjs"))),ThemeConfigPanel=React.lazy(()=>Promise.resolve().then(()=>ThemeConfigPanel$2));function useSidebarMenuItems(){return React.useMemo(()=>{const o=[{icon:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Layers,{size:20}),label:"Outline",component:()=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"-mt-8",children:jsxRuntime.jsxRuntimeExports.jsx(ListTree,{})})}];return lodashEs.compact(o)},[])}const RootLayout=()=>{const[o,n]=React.useState(0),[r,a]=React.useState(!1),[i,l]=useRightPanel();usePubSub(CHAI_BUILDER_EVENTS.SHOW_BLOCK_SETTINGS,()=>{n(1)});const c=useBuilderProp("sideBarComponents.top",[]),u=useBuilderProp("sideBarComponents.bottom",[]),x=R=>{R.preventDefault()},d=R=>{n(o===R?null:R)},p=useSidebarMenuItems(),{t:m}=reactI18next.useTranslation(),h=[...p,...c],b=useBuilderProp("htmlDir","ltr");return jsxRuntime.jsxRuntimeExports.jsx("div",{dir:b,className:"h-screen max-h-full w-screen overflow-x-hidden bg-background text-foreground",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TooltipProvider,{children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onContextMenu:x,className:"flex h-screen max-h-full flex-col bg-background text-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntime.jsxRuntimeExports.jsx(TopBar,{})})}),jsxRuntime.jsxRuntimeExports.jsxs("main",{className:"relative flex h-[calc(100vh-56px)] max-w-full flex-1 flex-row",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex w-12 flex-col items-center justify-between border-r border-border py-2",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col",children:h.map((R,f)=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:o===f?"default":"ghost",className:"mb-2 rounded-lg p-2 transition-colors",onClick:()=>d(f),children:lodashEs.get(R,"icon",null)},f)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{side:"right",children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:m(R.label)})})]},"button"+f))}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col",children:u==null?void 0:u.map((R,f)=>jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx("div",{}),children:React.createElement(R,{key:f})}))})]}),jsxRuntime.jsxRuntimeExports.jsx(framerMotion.motion.div,{className:"h-full max-h-full border-r border-border",initial:{width:280},animate:{width:o!==null?280:0},transition:{duration:.3,ease:"easeInOut"},children:o!==null&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar overflow h-full overflow-x-hidden",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col p-3",children:[jsxRuntime.jsxRuntimeExports.jsxs("h2",{className:"-mt-1 flex h-10 items-center space-x-1 text-base font-bold",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:"rtl:ml-2 rtl:inline-block",children:lodashEs.get(h,`${o}.icon`,null)}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:m(h[o].label)})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex-1",children:jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:React.createElement(lodashEs.get(h,`${o}.component`,null),{})})})]})})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col bg-slate-800/20",children:[jsxRuntime.jsxRuntimeExports.jsx(CanvasTopBar,{}),jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntime.jsxRuntimeExports.jsx(CanvasArea,{})})]}),jsxRuntime.jsxRuntimeExports.jsx(framerMotion.motion.div,{className:"h-full max-h-full border-l border-border",initial:{width:280},animate:{width:280},transition:{duration:.3,ease:"easeInOut"},children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar overflow h-full max-h-full overflow-hidden",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full max-h-full flex-col overflow-hidden p-3",children:[jsxRuntime.jsxRuntimeExports.jsx("h2",{className:"-mt-1 flex items-center space-x-1 text-base font-bold",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex grow items-center gap-2",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-between gap-2",children:i==="ai"?jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.LightningBoltIcon,{className:"rtl:ml-2"})," ",m("AI Assistant")]})}):i==="theme"?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Paintbrush,{className:"h-4 w-4 rtl:ml-2"}),m("Theme Settings")]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>l("block"),variant:"ghost",size:"icon",className:"text-xs text-gray-400",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.X,{className:"h-4 w-4 rtl:ml-2"})})]}):null})})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex max-h-full w-full",children:jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:i==="ai"?jsxRuntime.jsxRuntimeExports.jsx(AskAI,{}):i==="theme"?jsxRuntime.jsxRuntimeExports.jsx(ThemeConfigPanel,{}):jsxRuntime.jsxRuntimeExports.jsx(SettingsPanel,{})})})]})})})]})]}),jsxRuntime.jsxRuntimeExports.jsx(AddBlocksDialog,{}),jsxRuntime.jsxRuntimeExports.jsx(ChooseLayout,{open:r,close:()=>a(!1)})]})})},PreviewScreen=()=>{const[o,n]=usePreviewMode(),{t:r}=reactI18next.useTranslation(),a=useBuilderProp("previewComponent",null);return o?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("fixed inset-0 z-[999] bg-background",o?"block":"hidden"),children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{size:"sm",className:"absolute right-0 top-0 m-4 space-x-2",onClick:()=>n(!1),children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.EyeClosedIcon,{}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:r("Close Preview")})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{children:a?jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"h-96 w-full"}),children:React.createElement(a)}):null})]}):null},SmallScreenMessage=()=>jsxRuntime.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[jsxRuntime.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})}),useAutoSave=()=>{const{savePage:o}=useSavePage(),n=useBuilderProp("autoSaveSupport",!0),r=useBuilderProp("autoSaveInterval",60);web.useIntervalEffect(()=>{n&&o(!0)},r*1e3)},ChaiBuilderComponent=o=>{const[,n]=useBlocksStore(),r=useBuilderReset(),[a]=useAtom(builderSaveStateAtom),i=React.useMemo(()=>o.layout||RootLayout,[o.layout]);useAtom(selectedLibraryAtom),useKeyEventWatcher(),useExpandTree(),useAutoSave(),useWatchGlobalBlocks(),useUnmountBroadcastChannel();const{postMessage:l}=useBroadcastChannel();return React.useEffect(()=>{builderStore.set(chaiBuilderPropsAtom,lodashEs.omit(o,["blocks","subPages","brandingOptions","dataProviders","customRootLayout","translations"]))},[o]),React.useEffect(()=>{setTimeout(()=>{n(o.blocks||[]),o.blocks&&o.blocks.length>0&&l({type:"blocks-updated",blocks:o.blocks||[]}),r()},400)},[o.blocks]),React.useEffect(()=>{i18n.changeLanguage(o.locale||"en")},[o.locale]),React.useEffect(()=>{setDebugLogs(o.showDebugLogs)},[o.showDebugLogs]),React.useEffect(()=>{o.translations&&lodashEs.each(o.translations,(c,u)=>{i18n.addResourceBundle(u,"translation",c,!0,!0)})},[o.translations]),React.useEffect(()=>(a!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[a]),jsxRuntime.jsxRuntimeExports.jsx(i,{})},ChaiBuilderEditor=o=>{const n=o._flags||{},r=o.onError||lodashEs.noop;return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-screen h-screen",children:jsxRuntime.jsxRuntimeExports.jsx(reactErrorBoundary.ErrorBoundary,{fallback:jsxRuntime.jsxRuntimeExports.jsx(FallbackError,{}),onError:r,children:jsxRuntime.jsxRuntimeExports.jsxs(flagged.FlagsProvider,{features:{...FEATURE_TOGGLES,...n},children:[jsxRuntime.jsxRuntimeExports.jsx(SmallScreenMessage,{}),jsxRuntime.jsxRuntimeExports.jsx(ChaiBuilderComponent,{...o}),jsxRuntime.jsxRuntimeExports.jsx(PreviewScreen,{}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Toaster,{})]})})})};exports.generateBlockId=iconBase.generateUUID;exports.mergeClasses=iconBase.cn;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>reactI18next.useTranslation});Object.defineProperty(exports,"registerChaiBlock",{enumerable:!0,get:()=>runtime.registerChaiBlock});exports.i18n=i18n;exports.AISetContext=AISetContext;exports.AIUserPrompt=AIUserPrompt;exports.AddBlocksDialog=AddBlocksDialog;exports.AddBlocksPanel=AddBlocksPanel;exports.BlockAttributesEditor=BlockAttributesEditor;exports.BlockPropsEditor=BlockSettings;exports.BlockStyleEditor=BlockStyling;exports.CHAI_BUILDER_EVENTS=CHAI_BUILDER_EVENTS;exports.ChaiBuilderCanvas=CanvasArea;exports.ChaiBuilderEditor=ChaiBuilderEditor;exports.DarkModeSwitcher=DarkMode;exports.DefaultChaiBlocks=DefaultChaiBlocks;exports.ImportHTML=ImportHTML;exports.Outline=ListTree;exports.ScreenSizes=Breakpoints;exports.ThemeOptions=ThemeConfigPanel$1;exports.UILibraries=UILibrariesPanel;exports.UndoRedo=UndoRedo;exports.getBlocksFromHTML=getBlocksFromHTML;exports.getClassValueAndUnit=getClassValueAndUnit;exports.useAddBlock=useAddBlock;exports.useAddClassesToBlocks=useAddClassesToBlocks;exports.useAskAi=useAskAi;exports.useBlockHighlight=useBlockHighlight;exports.useBlocksStore=useBlocksStore;exports.useBlocksStoreUndoableActions=useBlocksStoreUndoableActions;exports.useBrandingOptions=useBrandingOptions;exports.useBuilderProp=useBuilderProp;exports.useBuilderReset=useBuilderReset;exports.useCanvasWidth=useCanvasWidth;exports.useCanvasZoom=useCanvasZoom;exports.useCodeEditor=useCodeEditor;exports.useCopyBlockIds=useCopyBlockIds;exports.useCopyToClipboard=useCopyToClipboard;exports.useCurrentPage=useCurrentPage;exports.useCutBlockIds=useCutBlockIds;exports.useDarkMode=useDarkMode;exports.useDuplicateBlocks=useDuplicateBlocks;exports.useGlobalBlocksList=useGlobalBlocksList;exports.useGlobalBlocksStore=useGlobalBlocksStore;exports.useHiddenBlockIds=useHiddenBlockIds;exports.useHighlightBlockId=useHighlightBlockId;exports.useLanguages=useLanguages;exports.useLayoutVariant=useLayoutVariant;exports.usePasteBlocks=usePasteBlocks;exports.usePreviewMode=usePreviewMode;exports.useRemoveBlocks=useRemoveBlocks;exports.useRemoveClassesFromBlocks=useRemoveClassesFromBlocks;exports.useRightPanel=useRightPanel;exports.useSavePage=useSavePage;exports.useSelectedBlock=useSelectedBlock;exports.useSelectedBlockAllClasses=useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=useSelectedBreakpoints;exports.useSelectedStylingBlocks=useSelectedStylingBlocks;exports.useStylingBreakpoint=useStylingBreakpoint;exports.useStylingState=useStylingState;exports.useTheme=useTheme;exports.useThemeOptions=useThemeOptions;exports.useUILibraryBlocks=useUILibraryBlocks;exports.useUndoManager=useUndoManager;exports.useUpdateBlocksProps=useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=useUpdateBlocksPropsRealtime;exports.useWrapperBlock=useWrapperBlock;
|
|
61
|
+
}`)},[v,O]),React.useEffect(()=>{j.querySelector("#drop-target-block").innerHTML=A?`[data-block-id="${A}"]{ outline: 1px dashed orange !important; outline-offset: -1px;}`:""},[A,j]);const Z=React.useMemo(()=>ChaiThemeFn.getChaiThemeCssVariables(r),[r]),q=React.useMemo(()=>ChaiThemeFn.getThemeFontsLinkMarkup(lodashEs.pick(r,["fontFamily"])),[r]);return jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx("style",{id:"chai-theme",children:Z}),jsxRuntime.jsxRuntimeExports.jsx("span",{id:"chai-fonts",dangerouslySetInnerHTML:{__html:q}})]})};function AsyncPropsBlock(r){const{dataProvider:h,block:x}=r,g=React.useMemo(()=>h?h(x,r.lang):{},[x,h,r.lang]);return jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:React.createElement(r.component,{...r.props,...g})})}function RuntimePropsBlock(r){const h=useSelectedBlockHierarchy(),x=Object.entries(r.runtimeProps).reduce((g,[v,R])=>{const A=lodashEs.find(h,{_type:R.block});return A&&(g[v]=lodashEs.get(A,R.prop)),g},{});return jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:React.createElement(r.component,{...r.props,...x})})}const useChaiExternalData=()=>jotai.useAtom(chaiExternalDataAtom),generateClassNames=lodashEs.memoize(r=>{const h=r.replace(STRINGS.STYLES_KEY,"").split(",");return tailwindMerge.twMerge(h[0],h[1])});function getElementAttrs(r,h){return lodashEs.get(r,`${h}_attrs`,{})}function getStyleAttrs(r){const h={};return Object.keys(r).forEach(x=>{if(lodashEs.isString(r[x])&&r[x].startsWith(STRINGS.STYLES_KEY)){const g=generateClassNames(r[x]),v=getElementAttrs(r,x);h[x]={className:g,"data-style-prop":x,"data-block-parent":r._id,"data-style-id":`${x}-${r._id}`,...v}}}),h}function applyBindings(r,h){const x=lodashEs.get(r,"_bindings",{});return lodashEs.isEmpty(x)?{...r}:(lodashEs.each(x,(g,v)=>{lodashEs.isString(g)&&lodashEs.get(h,g,null)&&(r[v]=lodashEs.get(h,g,null))}),r)}const getRuntimeProps=lodashEs.memoize(r=>{const h=runtime.getRegisteredChaiBlock(r),x=lodashEs.get(h,"schema.properties",{});return Object.fromEntries(Object.entries(x).filter(([,g])=>lodashEs.get(g,"runtime",!1)))});function isDescendant(r,h,x){if(!lodashEs.find(x,{_id:r}))return!1;const v=lodashEs.filter(x,{_parent:r});return v.some(R=>R._id===h)?!0:v.some(R=>isDescendant(R._id,h,x))}const RenderGlobalBlock=({blocks:r,allBlocks:h})=>jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:h,blocks:r});function applyLanguage(r,h,x){if(lodashEs.isEmpty(h))return r;const g=lodashEs.cloneDeep(r);return lodashEs.forEach(lodashEs.keys(g),v=>{lodashEs.includes(lodashEs.get(x,"i18nProps",[]),v)&&!lodashEs.isEmpty(h)&&(g[v]=lodashEs.get(g,`${v}-${h}`,g[v]))}),g}function BlocksRendererStatic({blocks:r,allBlocks:h}){const{selectedLang:x}=useLanguages(),[g]=useCutBlockIds(),[v]=jotai.useAtom(draggedBlockAtom),[R]=jotai.useAtom(dropTargetBlockIdAtom),[A]=useHiddenBlockIds(),{getGlobalBlocks:j}=useGlobalBlocksStore(),C=React.useCallback(O=>getStyleAttrs(O),[]),[T]=useChaiExternalData(),[M]=jotai.useAtom(inlineEditingActiveAtom);return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:React.Children.toArray(r.map((O,z)=>{if(M===O._id||A.includes(O._id))return null;const Z={},q=lodashEs.filter(h,{_parent:O._id});if(Z.children=q.length>0?jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:h,blocks:q}):null,O._type==="GlobalBlock"){const pe=j(O);Z.children=jsxRuntime.jsxRuntimeExports.jsx(RenderGlobalBlock,{blocks:lodashEs.filter(pe,ve=>!ve._parent),allBlocks:pe})}const Y=runtime.getRegisteredChaiBlock(O._type),P=lodashEs.get(Y,"component",null);if(lodashEs.isNull(P))return jsxRuntime.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${O==null?void 0:O._type} not registered -->`});const he=C(O),te=v&&isDescendant(v._id,O._id,h),X={blockProps:{"data-block-id":O._id,"data-block-type":O._type,...v?{"data-dnd":canAcceptChildBlock(O._type,v==null?void 0:v._type)?"yes":"no","data-dnd-dragged":v._id===O._id||te?"yes":"no"}:{},...R===O._id&&!te?{"data-drop":"yes"}:{},...lodashEs.includes(g,O._id)?{"data-cut-block":"yes"}:{}},index:z,...applyBindings(applyLanguage(O,x,Y),T),...he,...Z,inBuilder:!0,lang:x};if(lodashEs.has(Y,"dataProvider"))return jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntime.jsxRuntimeExports.jsx(AsyncPropsBlock,{lang:x,dataProvider:Y.dataProvider,block:O,component:P,props:X})});const se=getRuntimeProps(O._type);return se?jsxRuntime.jsxRuntimeExports.jsx(RuntimePropsBlock,{runtimeProps:se,block:O,component:P,props:X}):jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:React.createElement(P,X)})}))})}const dataProvidersAtom=jotai.atom([]);dataProvidersAtom.debugLabel="dataProvidersAtom";const usePageDataProviders=()=>jotai.useAtom(dataProvidersAtom),useAllDataProviders=()=>React.useMemo(()=>[],[]),BlocksExternalDataProvider=({children:r})=>{const[,h]=useChaiExternalData(),[x]=usePageDataProviders(),g=useAllDataProviders();return React.useEffect(()=>(h({}),lodashEs.each(x,v=>{const R=lodashEs.find(g,{providerKey:v.providerKey});if(R){const A=(R==null?void 0:R.mockFn)||(R==null?void 0:R.dataFn);A&&A(v.args).then(j=>h(C=>({...C,[v.providerKey]:j})))}}),()=>{lodashEs.each(x,v=>{h(R=>(delete R[v.providerKey],R))})}),[g,x,h]),jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:r})},StaticBlocksRenderer=()=>{const[r]=useBlocksStore(),h=lodashEs.isEmpty(r)?null:jsxRuntime.jsxRuntimeExports.jsx(BlocksExternalDataProvider,{children:jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:r,blocks:lodashEs.filter(r,x=>lodashEs.isEmpty(x._parent))})});return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:h})},AddBlockAtBottom=()=>{const{t:r}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative w-full cursor-pointer py-2",children:[jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK),className:"h-1 rounded bg-purple-500 opacity-0 duration-200 group-hover:opacity-100",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 transform items-center gap-x-1 rounded-full bg-purple-500 px-3 py-1 text-xs leading-tight text-white hover:bg-purple-500",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{className:"size-2.5 stroke-[3]"})," ",r("Add block")]})}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})},ResizableCanvasWrapper=({children:r,onMount:h,onResize:x})=>{const[,g]=useSelectedBlockIds(),[,v]=useSelectedStylingBlocks(),R=React.useRef(null),A=web.useDebouncedCallback(()=>{const{clientWidth:C}=R.current;x(C)},[R.current],100);web.useResizeObserver(R.current,A,R.current!==null),React.useEffect(()=>{const{clientWidth:C}=R.current;h(C)},[]);const j=()=>{g([]),v([])};return jsxRuntime.jsxRuntimeExports.jsx("div",{id:"main-content",onClick:j,className:"h-full w-full p-8 pb-0",ref:R,children:r})},getElementByStyleId=(r,h)=>r.querySelector(`[data-style-id="${h}"]`),StaticCanvas=()=>{const[r]=jotai.useAtom(networkModeAtom),[h]=useCanvasWidth(),[,x]=useSelectedBlockIds(),g=useSelectedBlock(),[,v]=useHighlightBlockId(),R=React.useRef(null),A=React.useRef(null),[j,C]=React.useState({width:0,height:0}),T=useCanvasScale(j),[M,O]=React.useState([]),[,z]=React.useState([]),[,Z]=jotai.useAtom(canvasIframeAtom),[q,Y]=useSelectedStylingBlocks(),P=useBuilderProp("loading",!1),he=useBuilderProp("htmlDir","ltr"),te=se=>{C(pe=>({...pe,width:se}))};React.useEffect(()=>{if(!A.current)return;const{clientWidth:se,clientHeight:pe}=A.current;C({width:se,height:pe})},[A,h]);const ue=(se,pe=0)=>{const{top:ve}=se.getBoundingClientRect();return ve+pe>=0&&ve-pe<=window.innerHeight};React.useEffect(()=>{var se,pe;if(g&&g.type!=="Multiple"&&R.current){const ve=getElementByDataBlockId(R.current.contentDocument,g._id);ve&&(ue(ve)||(pe=(se=R.current)==null?void 0:se.contentWindow)==null||pe.scrollTo({top:ve.offsetTop,behavior:"smooth"}),O([ve]))}},[g]),React.useEffect(()=>{if(!lodashEs.isEmpty(q)&&R.current){const se=getElementByStyleId(R.current.contentDocument,lodashEs.first(q).id);z(se?[se]:[null])}else z([null])},[q]);const X=React.useMemo(()=>{let se=IframeInitialContent;return se=se.replace("__HTML_DIR__",he),r==="offline"&&(se=se.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),se=se.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),se=se.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),se},[r,he]);return jsxRuntime.jsxRuntimeExports.jsx(ResizableCanvasWrapper,{onMount:te,onResize:te,children:jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>{x([]),Y([])},onMouseLeave:()=>setTimeout(()=>v(""),300),className:"relative mx-auto h-full w-full overflow-hidden",ref:A,children:jsxRuntime.jsxRuntimeExports.jsxs(ChaiFrame,{contentDidMount:()=>Z(R.current),ref:R,id:"canvas-iframe",style:{...T,...lodashEs.isEmpty(T)?{width:`${h}px`}:{}},className:"relative mx-auto box-content h-full w-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:X,children:[jsxRuntime.jsxRuntimeExports.jsx(KeyboardHandler,{}),jsxRuntime.jsxRuntimeExports.jsx(BlockActionsStatic,{block:g,selectedBlockElement:lodashEs.first(M)}),jsxRuntime.jsxRuntimeExports.jsx(HeadTags,{}),jsxRuntime.jsxRuntimeExports.jsx(reactWrapBalancer.Provider,{children:jsxRuntime.jsxRuntimeExports.jsxs(Canvas,{children:[P?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"h-full"})}):jsxRuntime.jsxRuntimeExports.jsx(StaticBlocksRenderer,{}),jsxRuntime.jsxRuntimeExports.jsx(AddBlockAtBottom,{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})}),jsxRuntime.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"pointer-events-none absolute z-[99999] max-w-full bg-green-500 transition-transform"})]})})})},FallbackError=()=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center",children:[jsxRuntime.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),jsxRuntime.jsxRuntimeExports.jsx("p",{children:"Please try again."})]})}),TypeIcon=r=>{switch(r.type){case"GlobalBlock":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.GlobeIcon,{className:"h-3 w-3 stroke-[2]"});case"Image":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ImageIcon,{className:"h-3 w-3 stroke-[2]"});case"Heading":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.HeadingIcon,{className:"h-3 w-3 stroke-[2]"});case"Text":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TextIcon,{className:"h-3 w-3 stroke-[2]"});case"Link":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Link1Icon,{className:"h-3 w-3 stroke-[2]"});case"Video":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.VideoIcon,{className:"h-3 w-3 stroke-[2]"});case"RichText":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CursorTextIcon,{className:"h-3 w-3 stroke-[2]"});case"Button":case"DropdownButton":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ButtonIcon,{className:"h-3 w-3 stroke-[2]"});case"CustomHTML":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CodeIcon,{className:"h-3 w-3 stroke-[2]"});case"Divider":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DividerHorizontalIcon,{className:"h-3 w-3 stroke-[2]"});case"Icon":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.SketchLogoIcon,{className:"h-3 w-3 stroke-[2]"});case"List":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RowsIcon,{className:"h-3 w-3 stroke-[2]"});case"Paragraph":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TextIcon,{className:"h-3 w-3 stroke-[2]"});case"Row":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Rows,{className:"h-3 w-3 stroke-[2]"});case"Column":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Columns,{className:"h-3 w-3 stroke-[2]"});case"ListItem":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ColumnsIcon,{className:"h-3 w-3 stroke-[2]"});case"LineBreak":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.SpaceBetweenVerticallyIcon,{className:"h-3 w-3 stroke-[2]"});case"Form":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.GroupIcon,{className:"h-3 w-3 stroke-[2]"});case"Checkbox":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CheckboxIcon,{className:"h-3 w-3 stroke-[2]"});case"FormButton":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ButtonIcon,{className:"h-3 w-3 stroke-[2]"});case"Input":case"TextArea":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InputIcon,{className:"h-3 w-3 stroke-[2]"});case"Radio":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RadiobuttonIcon,{className:"h-3 w-3 stroke-[2]"});case"Select":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DropdownMenuIcon,{className:"h-3 w-3 stroke-[2]"});case"Table":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TableIcon,{className:"h-3 w-3 stroke-[2]"});case"TableHead":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BorderTopIcon,{className:"h-3 w-3 stroke-[2]"});case"TableBody":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BorderAllIcon,{className:"h-3 w-3 stroke-[2]"});case"TableRow":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ViewHorizontalIcon,{className:"h-3 w-3 stroke-[2]"});case"TableCell":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DragHandleHorizontalIcon,{className:"h-3 w-3 stroke-[2]"});case"DataProvider":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.DatabaseIcon,{className:"h-3 w-3 stroke-[2]"});case"Box":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BoxIcon,{className:"h-3 w-3 stroke-[2]"});case"Dropdown":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DropdownMenuIcon,{className:"h-3 w-3 stroke-[2]"});case"DropdownContent":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ReaderIcon,{className:"h-3 w-3 stroke-[2]"});default:return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BoxModelIcon,{className:"h-3 w-3 stroke-[2]"})}},Breadcrumb=()=>{const r=useSelectedBlockHierarchy(),[,h]=useSelectedBlockIds(),{highlightBlock:x}=useBlockHighlight();return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"-mx-2 border-t border-border bg-background px-2 py-1 text-xs text-muted-foreground",children:jsxRuntime.jsxRuntimeExports.jsxs("ol",{className:"flex items-center whitespace-nowrap",children:[jsxRuntime.jsxRuntimeExports.jsxs("li",{className:"inline-flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>h([]),variant:"ghost",className:"h-fit p-1 text-xs font-normal",children:"Body"}),jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:"rtl:rotate-180",size:16})]}),lodashEs.reverse(r).map((g,v)=>jsxRuntime.jsxRuntimeExports.jsxs("li",{className:"inline-flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{onMouseEnter:()=>{x(g==null?void 0:g._id)},onClick:()=>h([g==null?void 0:g._id]),variant:"ghost",className:"h-fit gap-x-1 p-1 text-xs font-normal",children:[jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:g==null?void 0:g._type}),g._name||g._type]}),v!==r.length-1&&jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:"rtl:rotate-180",size:16})]},v))]})})},CodeEditor$1=React.lazy(()=>Promise.resolve().then(()=>require("./CodeEditor-C5hkhszC.cjs"))),CanvasArea=()=>{const[r]=useCodeEditor(),h=useBuilderProp("onError",lodashEs.noop);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-full flex-1 flex-col",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40 px-2",children:[jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"h-full"}),children:jsxRuntime.jsxRuntimeExports.jsx(reactErrorBoundary.ErrorBoundary,{fallback:jsxRuntime.jsxRuntimeExports.jsx(FallbackError,{}),onError:h,children:jsxRuntime.jsxRuntimeExports.jsx(StaticCanvas,{})})}),r?jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"h-full"}),children:jsxRuntime.jsxRuntimeExports.jsx(reResizable.Resizable,{enable:{top:!0,bottom:!1},className:"max-h-[400px] min-h-[200px]",children:jsxRuntime.jsxRuntimeExports.jsx(CodeEditor$1,{})})}):null,jsxRuntime.jsxRuntimeExports.jsx(Breadcrumb,{})]})})},FONTS=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"},{title:"Bebas Neue",value:"Bebas Neue"},{title:"Manrope",value:"Manrope"}],FontSelector=({label:r,value:h,onChange:x})=>jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-0.5",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-sm text-slate-800",children:lodashEs.startCase(r)}),jsxRuntime.jsxRuntimeExports.jsx("select",{className:"mt-1 w-full cursor-pointer 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",value:h,onChange:g=>x(g.target.value),children:FONTS.map(g=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:g.value,children:g.title},g.value))})]}),ColorPickerInput=({value:r,onChange:h})=>{const x=lodashEs.debounce(g=>h(g),200);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"relative flex h-6 w-6 cursor-pointer rounded-lg border border-border",style:{backgroundColor:r},children:jsxRuntime.jsxRuntimeExports.jsx("input",{type:"color",value:r.startsWith("#")?r:"#000000",onChange:g=>{const v=g.target.value;/^#[0-9A-F]{6}$/i.test(v)&&x(v)},className:"absolute inset-0 h-full w-full cursor-pointer rounded-lg border-0 opacity-0"})})},BorderRadiusInput=({value:r,onChange:h,disabled:x})=>{const g=lodashEs.debounce(v=>h(v),200);return jsxRuntime.jsxRuntimeExports.jsx("input",{type:"range",min:"0",step:"1",max:"30",disabled:x,defaultValue:r.replace("px",""),onChange:v=>g(v.target.value),className:"flex-1 cursor-pointer"})},ThemeConfigPanel=React__namespace.memo(({className:r=""})=>{const[h]=useDarkMode(),[x,g]=React__namespace.useState(""),v=useBuilderProp("themePresets",[]),[R,A]=useTheme(),j=useThemeOptions(),{t:C}=reactI18next.useTranslation(),T=Y=>{g(Y)},M=()=>{const Y=v.find(P=>Object.keys(P)[0]===x);if(Y){const P=Object.values(Y)[0];P&&typeof P=="object"&&"fontFamily"in P&&"borderRadius"in P&&"colors"in P?A(P):console.error("Invalid preset structure:",P)}else console.error("Preset not found:",x)},O=web.useDebouncedCallback((Y,P)=>{A(()=>({...R,fontFamily:{...R.fontFamily,[Y.replace(/font-/g,"")]:P}}))},[R],200),z=web.useDebouncedCallback(Y=>{A(()=>({...R,borderRadius:`${Y}px`}))},[R],200),Z=web.useDebouncedCallback((Y,P)=>{A(()=>{const he=lodashEs.get(R,`colors.${Y}`);return h?lodashEs.set(he,1,P):lodashEs.set(he,0,P),{...R,colors:{...R.colors,[Y]:he}}})},[R],200),q=Y=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-1",children:Object.entries(Y.items).map(([P])=>{const he=lodashEs.get(R,`colors.${P}.${h?1:0}`);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex items-center gap-x-2",children:[jsxRuntime.jsxRuntimeExports.jsx(ColorPickerInput,{value:he,onChange:te=>Z(P,te)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-xs font-normal leading-tight text-slate-600",children:P.split(/(?=[A-Z])/).join(" ").replace(/-/g," ").split(" ").map(te=>te.charAt(0).toUpperCase()+te.slice(1)).join(" ")+(!P.toLowerCase().includes("foreground")&&!P.toLowerCase().includes("border")&&!P.toLowerCase().includes("input")&&!P.toLowerCase().includes("ring")&&!P.toLowerCase().includes("background")?" Background":"")})]},P)})});return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("no-scrollbar h-full w-full overflow-y-auto",r),children:[v.length>0&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 py-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-sm text-slate-800",children:C("Presets")}),jsxRuntime.jsxRuntimeExports.jsxs("select",{value:x,onChange:Y=>T(Y.target.value),className:"w-full space-y-0.5 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:[jsxRuntime.jsxRuntimeExports.jsx("option",{value:"",children:"Select preset"}),Array.isArray(v)&&v.map(Y=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:Object.keys(Y)[0],children:lodashEs.capitalize(Object.keys(Y)[0])},Object.keys(Y)[0]))]})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-[30%] items-end",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{className:"w-full text-sm",disabled:x==="",variant:"default",onClick:M,children:C("Apply")})})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("space-y-2",r),children:[(j==null?void 0:j.fontFamily)&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grid gap-4",children:Object.entries(j.fontFamily).map(([Y,P])=>jsxRuntime.jsxRuntimeExports.jsx(FontSelector,{label:Y,value:R.fontFamily[Y.replace(/font-/g,"")]||P[Object.keys(P)[0]],onChange:he=>O(Y,he)},Y))}),(j==null?void 0:j.borderRadius)&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-0.5 py-3",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-sm text-slate-800",children:C("Border Radius")}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-4 py-2",children:[jsxRuntime.jsxRuntimeExports.jsx(BorderRadiusInput,{value:R.borderRadius,onChange:z}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"w-12 text-sm",children:R.borderRadius})]})]}),(j==null?void 0:j.colors)&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-4 space-y-0.5",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-sm text-slate-800",children:C("Colors")}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-full space-y-4 pt-2",children:j.colors.map(Y=>q(Y))},h?"dark":"light")]})]}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})}),placeholderStyle={display:"flex",alignItems:"center",zIndex:1},DefaultCursor=React.memo(function({top:h,left:x}){const g={position:"absolute",pointerEvents:"none",top:h+"px",left:x+"px",right:0};return jsxRuntime.jsxRuntimeExports.jsx("div",{style:{...placeholderStyle,...g},children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-0.5 flex-1 rounded-[1px] bg-green-500"})})}),Overlay=React.memo(function({children:h,isDragging:x}){return x?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"pointer-events-none fixed left-0 top-0 z-[100] h-full w-full",children:h}):null}),DefaultDragPreview=React.memo(({id:r,isDragging:h,mouse:x})=>{const[g]=useBlocksStore(),v=React.useMemo(()=>g.find(A=>A._id===r),[g,r]),R=React.useMemo(()=>({transform:`translate(${(x==null?void 0:x.x)-10}px, ${(x==null?void 0:x.y)-10}px)`}),[x]);return x?jsxRuntime.jsxRuntimeExports.jsx("div",{children:jsxRuntime.jsxRuntimeExports.jsx(Overlay,{isDragging:h,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute z-50 rounded border border-border bg-gray-100/80 font-semibold text-blue-600 shadow-md dark:border-gray-700 dark:bg-gray-800",style:R,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex !cursor-grab items-center p-0.5","aria-label":`Type: ${v==null?void 0:v._type}`,children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:v==null?void 0:v._type})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:(v==null?void 0:v._name)||(v==null?void 0:v._type)})]})})})}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"hidden"})}),PasteAtRootContextMenu=({parentContext:r,setParentContext:h})=>{const{t:x}=reactI18next.useTranslation(),{canPaste:g,pasteBlocks:v}=usePasteBlocks();return React.useEffect(()=>{g("root")||h(null)},[g("root")]),r&&g("root")&&jsxRuntime.jsxRuntimeExports.jsx("div",{style:{position:"absolute",top:r.y-75,left:r.x-56},onMouseLeave:()=>h(null),className:"w-28 rounded-md border bg-white p-1 shadow-xl",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex cursor-pointer items-center gap-x-4 rounded px-2 py-1 text-xs hover:bg-blue-50",onClick:()=>{v("root"),h(null)},children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CardStackIcon,{})," ",x("Paste")]})})},CopyPasteBlocks=()=>{const[r]=useBlocksStore(),[h]=useSelectedBlockIds(),{pasteBlocks:x}=usePasteBlocks(),[,g]=useCopyBlockIds(),{t:v}=reactI18next.useTranslation(),R=useSelectedBlock(),A=React.useCallback(()=>{const j=h.map(C=>{const T=r.find(M=>M._id===C);return{id:C,data:T}});g(j.map(C=>C.id))},[h,r,g]);return jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{disabled:!canDuplicateBlock(R==null?void 0:R._type),onClick:A,className:"flex items-center gap-x-4 text-xs",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CopyIcon,{})," ",v("Copy")]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>{x(h)},children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CardStackIcon,{})," ",v("Paste")]})]})},CutBlocks=()=>{const[r]=useSelectedBlockIds(),[,h]=useCutBlockIds(),{t:x}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>h(r),children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ScissorsIcon,{})," ",x("Cut")]})},RemoveBlocks=()=>{const[r]=useSelectedBlockIds(),h=useRemoveBlocks(),x=useSelectedBlock(),{t:g}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{disabled:!canDeleteBlock(x==null?void 0:x._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>h(r),children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TrashIcon,{})," ",g("Remove")]})},BlockContextMenuContent=()=>{const{t:r}=reactI18next.useTranslation(),[h]=useSelectedBlockIds(),x=useDuplicateBlocks(),g=useSelectedBlock(),v=React.useCallback(()=>{x(h)},[h,x]);return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuContent,{className:"border-border text-xs",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{disabled:!canAddChildBlock(g==null?void 0:g._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,g),children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{size:"14"})," ",r("Add block")]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenuItem,{disabled:!canDuplicateBlock(g==null?void 0:g._type),className:"flex items-center gap-x-4 text-xs",onClick:v,children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CardStackPlusIcon,{})," ",r("Duplicate")]}),jsxRuntime.jsxRuntimeExports.jsx(CutBlocks,{}),jsxRuntime.jsxRuntimeExports.jsx(CopyPasteBlocks,{}),jsxRuntime.jsxRuntimeExports.jsx(RemoveBlocks,{})]})},BlockContextMenu=({children:r})=>jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ContextMenu,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.ContextMenuTrigger,{asChild:!0,children:r}),jsxRuntime.jsxRuntimeExports.jsx(BlockContextMenuContent,{})]})}),defaultShortcuts=[{key:"ArrowDown",command:"selectNext"},{key:"ArrowUp",command:"selectPrev"},{key:"ArrowLeft",command:"selectParent",when:"isLeaf || isClosed"},{key:"ArrowLeft",command:"close",when:"isOpen"},{key:"ArrowRight",command:"open",when:"isClosed"},{key:"ArrowRight",command:"selectNext",when:"isOpen"},{key:"Home",command:"selectFirst"},{key:"End",command:"selectLast"}];function selectFirst(r){r.firstNode&&r.select(r.firstNode.id)}function selectLast(r){r.lastNode&&r.select(r.lastNode.id)}function selectNext(r){const h=r.selectedNodes[0].next||r.firstNode;r.select(h.id)}function selectPrev(r){const h=r.selectedNodes[0].prev||r.lastNode;r.select(h.id)}const selectParent=(r,h)=>{var g;const x=((g=r.selectedIds[0])==null?void 0:g.parent)||null;x&&h&&r.select(x.id)},open=(r,h)=>{const x=r.selectedNodes[0];x.isInternal&&h&&x.open()},close=(r,h)=>{const x=r.selectedNodes[0];x.isInternal&&h&&x.close()};function VscJson(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.984V2h-.09c-.313 0-.616.062-.909.185a2.33 2.33 0 0 0-.775.53 2.23 2.23 0 0 0-.493.753v.001a3.542 3.542 0 0 0-.198.83v.002a6.08 6.08 0 0 0-.024.863c.012.29.018.58.018.869 0 .203-.04.393-.117.572v.001a1.504 1.504 0 0 1-.765.787 1.376 1.376 0 0 1-.558.115H2v.984h.09c.195 0 .38.04.556.121l.001.001c.178.078.329.184.455.318l.002.002c.13.13.233.285.307.465l.001.002c.078.18.117.368.117.566 0 .29-.006.58-.018.869-.012.296-.004.585.024.87v.001c.033.283.099.558.197.824v.001c.106.273.271.524.494.753.223.23.482.407.775.53.293.123.596.185.91.185H6v-.984h-.09c-.2 0-.387-.038-.563-.115a1.613 1.613 0 0 1-.457-.32 1.659 1.659 0 0 1-.309-.467c-.074-.18-.11-.37-.11-.573 0-.228.003-.453.011-.672.008-.228.008-.45 0-.665a4.639 4.639 0 0 0-.055-.64 2.682 2.682 0 0 0-.168-.609A2.284 2.284 0 0 0 3.522 8a2.284 2.284 0 0 0 .738-.955c.08-.192.135-.393.168-.602.033-.21.051-.423.055-.64.008-.22.008-.442 0-.666-.008-.224-.012-.45-.012-.678a1.47 1.47 0 0 1 .877-1.354 1.33 1.33 0 0 1 .563-.121H6zm4 10.032V14h.09c.313 0 .616-.062.909-.185.293-.123.552-.3.775-.53.223-.23.388-.48.493-.753v-.001c.1-.266.165-.543.198-.83v-.002c.028-.28.036-.567.024-.863-.012-.29-.018-.58-.018-.869 0-.203.04-.393.117-.572v-.001a1.502 1.502 0 0 1 .765-.787 1.38 1.38 0 0 1 .558-.115H14v-.984h-.09c-.196 0-.381-.04-.557-.121l-.001-.001a1.376 1.376 0 0 1-.455-.318l-.002-.002a1.415 1.415 0 0 1-.307-.465v-.002a1.405 1.405 0 0 1-.118-.566c0-.29.006-.58.018-.869a6.174 6.174 0 0 0-.024-.87v-.001a3.537 3.537 0 0 0-.197-.824v-.001a2.23 2.23 0 0 0-.494-.753 2.331 2.331 0 0 0-.775-.53 2.325 2.325 0 0 0-.91-.185H10v.984h.09c.2 0 .387.038.562.115.174.082.326.188.457.32.127.134.23.29.309.467.074.18.11.37.11.573 0 .228-.003.452-.011.672-.008.228-.008.45 0 .665.004.222.022.435.055.64.033.214.089.416.168.609a2.285 2.285 0 0 0 .738.955 2.285 2.285 0 0 0-.738.955 2.689 2.689 0 0 0-.168.602c-.033.21-.051.423-.055.64a9.15 9.15 0 0 0 0 .666c.008.224.012.45.012.678a1.471 1.471 0 0 1-.877 1.354 1.33 1.33 0 0 1-.563.121H10z"},child:[]}]})(r)}function BsLightningFill(r){return iconBase.GenIcon({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641z"},child:[]}]})(r)}function TbEyeDown(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"},child:[]},{tag:"path",attr:{d:"M12 18c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"},child:[]},{tag:"path",attr:{d:"M19 16v6"},child:[]},{tag:"path",attr:{d:"M22 19l-3 3l-3 -3"},child:[]}]})(r)}function BiCollapseVertical(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 7.59 7.05 2.64 5.64 4.05 12 10.41l6.36-6.36-1.41-1.41L12 7.59zM5.64 19.95l1.41 1.41L12 16.41l4.95 4.95 1.41-1.41L12 13.59l-6.36 6.36z"},child:[]}]})(r)}function BiExpandVertical(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12 19.24-4.95-4.95-1.41 1.42L12 22.07l6.36-6.36-1.41-1.42L12 19.24zM5.64 8.29l1.41 1.42L12 4.76l4.95 4.95 1.41-1.42L12 1.93 5.64 8.29z"},child:[]}]})(r)}const currentAddSelection=jotai.atom(null),Node=React.memo(({node:r,style:h,dragHandle:x})=>{var oe;const g=useBuilderProp("outlineMenuItems",[]),{t:v}=reactI18next.useTranslation(),[R,,A]=useHiddenBlockIds(),[j]=jotai.useAtom(canvasIframeAtom);let C=null;const T=r.children.length>0,{highlightBlock:M,clearHighlight:O}=useBlockHighlight(),{id:z,data:Z,isSelected:q,willReceiveDrop:Y,isDragging:P,isEditing:he,handleClick:te}=r,ue=me=>{me.stopPropagation(),!R.includes(z)&&r.toggle()},X=me=>{me.isInternal&&(C=me.isOpen,me.isOpen&&me.close())},se=me=>{me.isInternal&&C!==null&&(C?me.open():me.close(),C=null)},[pe,ve]=jotai.useAtom(currentAddSelection),Me=()=>{var me;J(),r.parent.isSelected||ve((me=r==null?void 0:r.parent)==null?void 0:me.id)},J=()=>{ve(null)},xe=me=>{J(),me.stopPropagation(),!r.isOpen&&!R.includes(z)&&r.toggle(),te(me)};React.useEffect(()=>{const me=setTimeout(()=>{Y&&!r.isOpen&&!P&&!R.includes(z)&&r.toggle()},500);return()=>clearTimeout(me)},[Y,r,P]);const be=React.useMemo(()=>{const me=Object.keys(Z),V=[];for(let ie=0;ie<me.length;ie++)if(me[ie].endsWith("_attrs")){const re=Z[me[ie]],Ae=Object.keys(re).join("|");Ae.match(/x-data/)&&V.push("data"),Ae.match(/x-on/)&&V.push("event"),Ae.match(/x-show|x-if/)&&V.push("show")}return V},[Z]),ge=(me,V)=>{const ie=j.contentDocument||j.contentWindow.document,re=ie.querySelector(`[data-block-id=${me}]`);re&&re.setAttribute("data-drop",V);const Ae=re.getBoundingClientRect(),Re=j.getBoundingClientRect();Ae.top>=Re.top&&Ae.left>=Re.left&&Ae.bottom<=Re.bottom&&Ae.right<=Re.right||(ie.documentElement.scrollTop=re.offsetTop-Re.top)},je=me=>{J();const V=lodashEs.get(r,"parent.id");V!=="__REACT_ARBORIST_INTERNAL_ROOT__"?pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{_id:V,position:me}):pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{position:me})};return z===STRINGS.ROOT_TEMP_KEY?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative w-full cursor-pointer",children:[jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>je(-1),className:"h-1 rounded bg-purple-500 opacity-0 duration-200 group-hover:opacity-100",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 transform items-center gap-x-1 rounded-full bg-purple-500 px-3 py-1 text-[9px] leading-tight text-white hover:bg-purple-500",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{className:"h-2 w-2 stroke-[3]"})," ",v("Add block")]})}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]}):jsxRuntime.jsxRuntimeExports.jsx(BlockContextMenu,{id:z,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-full",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>M(z),onMouseLeave:()=>O(),onClick:xe,style:h,"data-node-id":z,ref:R.includes(z)?null:x,onDragStart:()=>X(r),onDragEnd:()=>se(r),onDragOver:me=>{me.preventDefault(),ge(z,"yes")},onDragLeave:me=>{me.preventDefault(),ge(z,"no")},onDrop:me=>{me.preventDefault(),ge(z,"no")},children:[(r==null?void 0:r.rowIndex)>0&&(r.parent.isOpen&&canAddChildBlock(lodashEs.get(r,"parent.data._type"))||((oe=r==null?void 0:r.parent)==null?void 0:oe.id)==="__REACT_ARBORIST_INTERNAL_ROOT__")&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"group relative ml-5 h-full w-full cursor-pointer",children:jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:me=>{me.stopPropagation(),je(r.childIndex)},onMouseEnter:Me,onMouseLeave:J,className:"absolute -top-0.5 h-1 w-[90%] rounded bg-purple-500 opacity-0 delay-200 duration-200 group-hover:opacity-100",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute left-1/2 top-1/2 flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 transform items-center justify-center rounded-full bg-purple-500 p-1 outline outline-2 outline-white hover:bg-purple-500",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{className:"h-3 w-3 stroke-[4] text-white"})})})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("group flex w-full cursor-pointer items-center justify-between space-x-px !rounded p-1 text-foreground/80 outline-none",q?"bg-blue-500 text-white":"hover:bg-slate-200 dark:hover:bg-gray-800",Y&&canAcceptChildBlock(Z._type,"Icon")?"bg-green-200":"",(r==null?void 0:r.id)===pe?"bg-purple-100":"",P&&"opacity-20",R.includes(z)?"opacity-50":""),children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center transition-transform duration-100 ${r.isOpen?"rotate-90":""}`,children:T&&jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:ue,type:"button",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:`h-3 w-3 stroke-[3] ${q?"text-slate-200":"text-slate-400"}`})})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"leading-1 flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:Z==null?void 0:Z._type}),he?jsxRuntime.jsxRuntimeExports.jsx(Input,{node:r}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"ml-1.5 flex items-center gap-x-1 truncate text-[13px]",onDoubleClick:me=>{me.stopPropagation(),r.edit(),r.deselect()},children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:(Z==null?void 0:Z._name)||(Z==null?void 0:Z._type.split("/").pop())}),be.includes("data")&&jsxRuntime.jsxRuntimeExports.jsx(VscJson,{className:"h-3 w-3 text-orange-600"}),be.includes("event")&&jsxRuntime.jsxRuntimeExports.jsx(BsLightningFill,{className:"h-3 w-3 text-yellow-500"}),be.includes("show")&&jsxRuntime.jsxRuntimeExports.jsx(TbEyeDown,{className:"h-3 w-3 text-orange-600"})]})]})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"invisible flex items-center space-x-1.5 pr-2 group-hover:visible",children:[!R.includes(z)&&g.map(me=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:React.createElement(me.item,{blockId:z})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-10",children:me.tooltip})]})),canAddChildBlock(Z==null?void 0:Z._type)&&!R.includes(z)?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{_id:z}),className:"cursor-pointer rounded bg-transparent hover:text-black",asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{size:"15"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",side:"left",children:v("Add block")})]}):null,jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{onClick:me=>{me.stopPropagation(),A(z),r.isOpen&&r.toggle()},className:"cursor-pointer rounded bg-transparent hover:text-black",asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.EyeOff,{size:"15"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",side:"left",children:v("Hide block")})]})]})]})]})})})}),Input=({node:r})=>{var h,x;return jsxRuntime.jsxRuntimeExports.jsx("input",{autoFocus:!0,className:iconBase.cn("ml-2 !h-4 w-full rounded-sm border border-border bg-background px-1 text-[11px] leading-tight outline-none",r.isSelected?"text-black dark:text-white":""),type:"text",defaultValue:((h=r.data)==null?void 0:h._name)||((x=r.data)==null?void 0:x._type),onFocus:g=>g.currentTarget.select(),onBlur:g=>r.submit(g.currentTarget.value),onKeyDown:g=>{g.key==="Enter"&&r.submit(g.currentTarget.value)}})},useCanMove=()=>{const[r]=useBlocksStore();return(h,x)=>{var R;const g=(R=lodashEs.find(r,{_id:x}))==null?void 0:R._type,v=lodashEs.first(h.map(A=>{var j;return(j=lodashEs.find(r,{_id:A}))==null?void 0:j._type}));return canAcceptChildBlock(g,v)}},ListTree=()=>{const[treeData]=jotai.useAtom(treeDSBlocks),[ids,setIds]=useSelectedBlockIds(),[cutBlocksIds]=useCutBlockIds(),[,setHiddenBlocks]=useHiddenBlockIds(),updateBlockProps=useUpdateBlocksProps(),[,setStyleBlocks]=useSelectedStylingBlocks(),{moveBlocks}=useBlocksStoreUndoableActions(),canMove=useCanMove(),treeRef=React.useRef(null),[,setTreeRef]=jotai.useAtom(treeRefAtom),{t}=reactI18next.useTranslation(),[parentContext,setParentContext]=React.useState(null),clearSelection=()=>{setIds([]),setStyleBlocks([])},filteredTreeData=React.useMemo(()=>{const r=(x,g)=>x.filter(v=>!g.includes(v._id)).map(v=>({...v,children:v.children?r(v.children,g):[]}));return[...r(treeData,cutBlocksIds),{_type:STRINGS.ROOT_TEMP_KEY,_id:STRINGS.ROOT_TEMP_KEY,children:[]}]},[treeData,cutBlocksIds]),onRename=({id:r,name:h,node:x})=>{updateBlockProps([r],{_name:h},x.data._name)},onMove=({dragIds:r,parentId:h,index:x})=>{canMove(r,h)&&moveBlocks(r,h,x)},onSelect=r=>{if(r.length===0)return;const h=r[0]?r[0].id:"";setStyleBlocks([]),setIds([h])},onContextMenu=r=>{var g;r.preventDefault(),parentContext&&setParentContext(null);const h=r.target,x=h.getAttribute("data-node-id")||((g=h.closest("[data-node-id]"))==null?void 0:g.getAttribute("data-node-id"));x?(setStyleBlocks([]),setIds([x])):(setStyleBlocks([]),setIds([]),setParentContext({x:r.clientX,y:r.clientY}))},debouncedDisableDrop=web.useDebouncedCallback(({parentNode:r,dragNodes:h})=>{var x;return(r==null?void 0:r.data._type)===STRINGS.ROOT_TEMP_KEY||!canAcceptChildBlock(r==null?void 0:r.data._type,(x=h[0])==null?void 0:x.data._type)},[],300),handleKeyDown=e=>{if(!treeRef.current)return;const tree=treeRef.current,selectedNode=tree.selectedNodes[0];if(!selectedNode)return;setIds[selectedNode.id],setStyleBlocks([]);const isLeaf=!selectedNode.isInternal,isClosed=!selectedNode.isOpen,isOpen=selectedNode.isOpen,shortcut=defaultShortcuts.find(s=>s.key===e.key&&(!s.when||eval(s.when)));if(shortcut)switch(e.preventDefault(),shortcut.command){case"selectNext":selectNext(tree);break;case"selectPrev":selectPrev(tree);break;case"selectParent":selectParent(tree,isLeaf||isClosed);break;case"close":close(tree,isOpen);break;case"open":open(tree,isClosed);break;case"selectFirst":selectFirst(tree);break;case"selectLast":selectLast(tree);break}};return React.useEffect(()=>{const r=()=>{treeRef.current&&setTreeRef(treeRef.current)};r();const h=new MutationObserver(r);return h.observe(document.body,{childList:!0,subtree:!0}),()=>h.disconnect()},[setTreeRef]),lodashEs.isEmpty(treeData)?jsxRuntime.jsxRuntimeExports.jsx("div",{children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-10 flex h-full w-full items-center justify-center p-8 text-center",children:jsxRuntime.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 text-sm text-gray-400",children:[t("This page is empty"),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK),variant:"default",size:"sm",children:["+ ",t("Add Block")]})]})})}):jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:iconBase.cn("flex h-full select-none flex-col space-y-1"),onClick:()=>clearSelection(),children:jsxRuntime.jsxRuntimeExports.jsxs("div",{id:"outline-view",className:"no-scrollbar h-full overflow-y-auto text-sm",onKeyDown:r=>{treeRef.current.isEditing||handleKeyDown(r)},children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex items-center justify-end gap-x-2 pb-2 text-sm text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>setHiddenBlocks([]),variant:"outline",className:"h-fit p-1 disabled:cursor-not-allowed disabled:opacity-50",size:"sm",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Eye,{className:"h-4 w-4"})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",children:t("Show hidden blocks")})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{className:"h-fit p-1",onClick:()=>{var r;return(r=treeRef==null?void 0:treeRef.current)==null?void 0:r.openAll()},variant:"outline",size:"sm",children:jsxRuntime.jsxRuntimeExports.jsx(BiExpandVertical,{size:"14"})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",children:t("Expand all")})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{className:"h-fit p-1",onClick:()=>{var r;return(r=treeRef==null?void 0:treeRef.current)==null?void 0:r.closeAll()},variant:"outline",size:"sm",children:jsxRuntime.jsxRuntimeExports.jsx(BiCollapseVertical,{size:"14"})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-[9999]",children:t("Collapse all")})]})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"group relative z-[9999] ml-5 w-full cursor-pointer",children:jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{position:0}),className:"h-1 w-[90%] rounded bg-purple-500 opacity-0 duration-200 group-hover:opacity-100",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute left-[45%] top-1/2 flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 transform items-center justify-center rounded-full bg-purple-500 p-1 outline outline-2 outline-white hover:bg-purple-500",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.PlusIcon,{className:"h-3 w-3 stroke-[3] text-white"})})})}),jsxRuntime.jsxRuntimeExports.jsx(reactArborist.Tree,{ref:treeRef,height:window.innerHeight-160,className:"no-scrollbar !h-full max-w-full space-y-1 !overflow-y-auto !overflow-x-hidden",rowClassName:"flex items-center h-full border-b border-transparent",selection:ids[0]||"",onRename,openByDefault:!1,onMove,data:[...filteredTreeData],renderCursor:DefaultCursor,onSelect,childrenAccessor:r=>r.children,width:"100%",rowHeight:28,renderDragPreview:DefaultDragPreview,indent:10,onContextMenu,disableDrop:debouncedDisableDrop,idAccessor:"_id",children:Node})]})}),jsxRuntime.jsxRuntimeExports.jsx(PasteAtRootContextMenu,{parentContext,setParentContext})]})},hasVideoEmbed=r=>{const h=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,x=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return h.test(r)||x.test(r)},getVideoURLFromHTML=r=>{if(lodashEs.isEmpty(r))return r;const h=/<video[^>]+src=['"]([^'">]+)['"]/,x=/<iframe[^>]+src=['"]([^'">]+)['"]/,g=r.match(h),v=r.match(x),R=g?g[1]:v?v[1]:null,A=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,j=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return R&&(A.test(R)||j.test(R))?R:r},NAME_ATTRIBUTES=["chai-name","data-chai-name"],ATTRIBUTE_MAP={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},shouldAddText=(r,h)=>r.children.length===1&&lodashEs.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],h._type),getTextContent=r=>r.map(h=>h.type==="text"?lodashEs.get(h,"content",""):lodashEs.isEmpty(h.children)?"":getTextContent(h.children)).join(""),getSanitizedValue=r=>r===null?"":r,getAttrs=r=>{if(r.tagName==="svg")return{};const h={},x=ATTRIBUTE_MAP[r.tagName]||{},g=r.attributes;return lodashEs.forEach(g,({key:v,value:R})=>{if(!lodashEs.includes(NAME_ATTRIBUTES,v))if(x[v]){if(r.tagName==="img"&&v==="src"&&!R.startsWith("http")){const A=lodashEs.find(r.attributes,{key:"width"}),j=lodashEs.find(r.attributes,{key:"height"});A&&j?R=`https://via.placeholder.com/${A==null?void 0:A.value}x${j==null?void 0:j.value}`:R="https://via.placeholder.com/150x150"}lodashEs.set(h,x[v],getSanitizedValue(R))}else lodashEs.includes(["style","class","srcset"],v)||(lodashEs.has(h,"styles_attrs")||(h.styles_attrs={}),lodashEs.startsWith(v,"@")&&(v=v.replace("@","x-on:")),h.styles_attrs[`${v}`]=getSanitizedValue(R))}),delete h.class,h},getStyles=(r,h="styles")=>{if(!r.attributes)return{[h]:`${STRINGS.STYLES_KEY},`};const x=lodashEs.find(r.attributes,{key:"class"});if(x){const g=x.value;return{[h]:`${STRINGS.STYLES_KEY},${g}`}}return{[h]:`${STRINGS.STYLES_KEY},`}},getBlockProps=r=>{const h=lodashEs.get(r,"attributes",[]),x=h.find(j=>j.key==="data-chai-richtext"||j.key==="chai-richtext"),g=h.find(j=>j.key==="data-chai-lightbox"||j.key==="chai-lightbox"),v=h.find(j=>j.key==="data-chai-dropdown"||j.key==="chai-dropdown"),R=h.find(j=>j.key==="data-chai-dropdown-button"||j.key==="chai-dropdown-button"),A=h.find(j=>j.key==="data-chai-dropdown-content"||j.key==="chai-dropdown-content");if(v)return{_type:"Dropdown"};if(R)return{_type:"DropdownButton"};if(A)return{_type:"DropdownContent"};if(x)return{_type:"RichText"};if(g)return{_type:"LightBoxLink"};switch(r.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:r.tagName,_listType:r.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:r.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:r.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:r.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:r.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const j=lodashEs.get(r,"children",[]).length>0?"Box":"EmptyBox";return{_type:j,tag:r.tagName,_name:j=="EmptyBox"||r.tagName==="div"?j:lodashEs.capitalize(r.tagName)}}}},traverseNodes=(r,h=null)=>lodashEs.flatMapDeep(r,x=>{var O,z,Z,q,Y,P,he,te;if(x.type==="comment")return[];console.log("node ===>",x);let g={_id:iconBase.generateUUID()};if(h&&(g._parent=h.block._id),x.type==="text")return lodashEs.isEmpty(lodashEs.get(x,"content",""))?[]:h&&shouldAddText(h.node,h.block)?(lodashEs.set(h,"block.content",lodashEs.get(x,"content","")),[]):{...g,_type:"Text",content:lodashEs.get(x,"content","")};const v=lodashEs.get(x,"attributes",[]),R=v.find(ue=>ue.key==="data-chai-richtext"||ue.key==="chai-richtext"),A=v.find(ue=>ue.key==="data-chai-lightbox"||ue.key==="chai-lightbox"),j=v.find(ue=>ue.key==="data-chai-dropdown"||ue.key==="chai-dropdown"),C=v.find(ue=>ue.key==="data-chai-dropdown-button"||ue.key==="chai-dropdown-button"),T=v.find(ue=>ue.key==="data-chai-dropdown-content"||ue.key==="chai-dropdown-content");if(g={...g,...getBlockProps(x),...getAttrs(x),...getStyles(x)},x.attributes){const ue=x.attributes.find(X=>lodashEs.includes(NAME_ATTRIBUTES,X.key));ue&&(g._name=ue.value)}if(R)return g.content=himalaya.stringify(x.children),lodashEs.has(g,"styles_attrs.data-chai-richtext")&&delete g.styles_attrs["data-chai-richtext"],lodashEs.has(g,"styles_attrs.chai-richtext")&&delete g.styles_attrs["chai-richtext"],[g];if(A){const ue=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];g={...g,href:((O=v.find(X=>X.key==="href"))==null?void 0:O.value)||"",hrefType:((z=v.find(X=>X.key==="data-vbtype"))==null?void 0:z.value)||"video",autoplay:((Z=v.find(X=>X.key==="data-autoplay"))==null?void 0:Z.value)==="true"?"true":"false",maxWidth:((Y=(q=v.find(X=>X.key==="data-maxwidth"))==null?void 0:q.value)==null?void 0:Y.replace("px",""))||"",backdropColor:((P=v.find(X=>X.key==="data-overlay"))==null?void 0:P.value)||"",galleryName:((he=v.find(X=>X.key==="data-gall"))==null?void 0:he.value)||""},lodashEs.forEach(ue,X=>{lodashEs.has(g,`styles_attrs.${X}`)&&delete g.styles_attrs[X]})}if(j&&(delete g.styles_attrs,g.showDropdown=!1),T&&delete g.styles_attrs,C){delete g.styles_attrs;const ue=lodashEs.filter(x.children||[],se=>(se==null?void 0:se.tagName)!=="span");g.content=getTextContent(ue);const X=lodashEs.find(x.children||[],se=>(se==null?void 0:se.tagName)==="span"&&lodashEs.some(se.children||[],pe=>(pe==null?void 0:pe.tagName)==="svg"));if(X){const se=lodashEs.find(X.children||[],pe=>(pe==null?void 0:pe.tagName)==="svg");if(se){g.icon=himalaya.stringify([se]);const{height:pe,width:ve}=getSvgDimensions(se,"16px","16px");g.iconHeight=pe,g.iconWidth=ve}}return[g]}if(g._type==="Input"){const ue=g.inputType||"text";ue==="checkbox"?lodashEs.set(g,"_type","Checkbox"):ue==="radio"&&lodashEs.set(g,"_type","Radio")}else if(x.tagName==="video"||x.tagName==="iframe"){const ue=himalaya.stringify([x]);return hasVideoEmbed(ue)&&(lodashEs.set(g,"_type","Video"),lodashEs.set(g,"url",getVideoURLFromHTML(ue)),lodashEs.set(g,"styles",`${STRINGS.STYLES_KEY},`),lodashEs.set(g,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),g.content=ue,[g]}else if(x.tagName==="svg"){const ue=lodashEs.find(x.attributes,{key:"height"}),X=lodashEs.find(x.attributes,{key:"width"}),se=lodashEs.get(ue,"value")?`[${lodashEs.get(ue,"value")}px]`:"24px",pe=lodashEs.get(X,"value")?`[${lodashEs.get(X,"value")}px]`:"24px",ve=lodashEs.get(lodashEs.find(x.attributes,{key:"class"}),"value","w-full h-full");return g.styles=`${STRINGS.STYLES_KEY}, ${iconBase.cn(`w-${pe} h-${se}`,ve)}`.trim(),x.attributes=lodashEs.filter(x.attributes,Me=>!lodashEs.includes(["style","width","height","class"],Me.key)),g.icon=himalaya.stringify([x]),[g]}else if(x.tagName=="option"&&h&&((te=h.block)==null?void 0:te._type)==="Select")return h.block.options.push({label:getTextContent(x.children),...getAttrs(x)}),[];const M=traverseNodes(x.children,{block:g,node:x});return[g,...M]}),getSvgDimensions=(r,h,x)=>{const g=lodashEs.get(r,"attributes",[]),v=lodashEs.find(g,{key:"height"}),R=lodashEs.find(g,{key:"width"});return{height:lodashEs.get(v,"value")?`[${lodashEs.get(v,"value")}px]`:x,width:lodashEs.get(R,"value")?`[${lodashEs.get(R,"value")}px]`:h}},getSanitizedHTML=r=>{r=r.replace(/(\w+)=\\?"(.*?)\\?"/g,(g,v,R)=>{let A=R.replace(/\\"/g,'"');return A=A.replace(/{([^}]+)}/g,j=>j.replace(/"/g,'\\"')),`${v}="${A.replace(/\\"/g,'"')}"`}),r=r.replace(/\\n/g,"").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g,"");const h=r.match(/<body[^>]*>[\s\S]*?<\/body>/);return(h&&h.length>0?h[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):r).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},getBlocksFromHTML=r=>{const h=himalaya.parse(getSanitizedHTML(r));return lodashEs.isEmpty(r)?[]:lodashEs.flatten(traverseNodes(h))},ImportHTML=({parentId:r,position:h})=>{const{t:x}=reactI18next.useTranslation(),[g,v]=React.useState(""),{addPredefinedBlock:R}=useAddBlock(),A=()=>{const j=getBlocksFromHTML(g);R([...j],r,h),v(""),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)};return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Card,{className:"border-border/0 p-0 shadow-none",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.CardHeader,{className:"p-3",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.CardDescription,{children:x("Use HTML snippets from Tailwind CSS component libraries")})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.CardContent,{className:"space-y-2 px-3 py-0",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{htmlFor:"current",className:"text-sm",children:x("Tailwind HTML snippet")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{autoFocus:!0,tabIndex:1,ref:j=>j&&j.focus(),onChange:j=>v(j.target.value),rows:12,value:g,placeholder:x("Enter your code snippet here"),className:"resize-none overflow-x-auto whitespace-pre bg-background font-mono text-xs font-normal"})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.CardFooter,{className:"flex flex-col justify-end p-3",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:g.trim()==="",onClick:()=>A(),size:"sm",className:"w-fit",children:x("Import HTML")})})]})},GlobalBlockSettings=()=>{const r=useSelectedBlock(),{data:h,refetch:x,isLoading:g}=useGlobalBlocksList(),v=useUpdateBlocksProps();return jsxRuntime.jsxRuntimeExports.jsxs("div",{children:[jsxRuntime.jsxRuntimeExports.jsx("label",{className:"text-sm",children:"Choose a global block"}),jsxRuntime.jsxRuntimeExports.jsxs("select",{className:"h-8 w-full rounded-md border border-border bg-gray-50 p-0 px-2 text-xs dark:bg-gray-800",value:(r==null?void 0:r.globalBlock)||"",onChange:R=>{var A;v([r._id],{globalBlock:R.target.value,_name:`Global: ${lodashEs.startCase((A=lodashEs.get(h,R.target.value,""))==null?void 0:A.name)}`})},children:[jsxRuntime.jsxRuntimeExports.jsx("option",{value:"",children:"Select a global block"}),Object.keys(h).map(R=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:R,children:h[R].name||R},R))]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-2 text-xs",children:jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:x,className:"rounded-md bg-gray-100 p-1 px-2 text-xs hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700",children:g?"Loading...":"Refresh List"})})]})},BindingWidget=()=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"});var client={exports:{}},reactDomClient_production={},scheduler={exports:{}},scheduler_production={};/**
|
|
62
|
+
* @license React
|
|
63
|
+
* scheduler.production.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/var hasRequiredScheduler_production;function requireScheduler_production(){return hasRequiredScheduler_production||(hasRequiredScheduler_production=1,function(r){function h(V,ie){var re=V.length;V.push(ie);e:for(;0<re;){var Ae=re-1>>>1,Re=V[Ae];if(0<v(Re,ie))V[Ae]=ie,V[re]=Re,re=Ae;else break e}}function x(V){return V.length===0?null:V[0]}function g(V){if(V.length===0)return null;var ie=V[0],re=V.pop();if(re!==ie){V[0]=re;e:for(var Ae=0,Re=V.length,Ve=Re>>>1;Ae<Ve;){var qe=2*(Ae+1)-1,Xt=V[qe],Ne=qe+1,Dt=V[Ne];if(0>v(Xt,re))Ne<Re&&0>v(Dt,Xt)?(V[Ae]=Dt,V[Ne]=re,Ae=Ne):(V[Ae]=Xt,V[qe]=re,Ae=qe);else if(Ne<Re&&0>v(Dt,re))V[Ae]=Dt,V[Ne]=re,Ae=Ne;else break e}}return ie}function v(V,ie){var re=V.sortIndex-ie.sortIndex;return re!==0?re:V.id-ie.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var R=performance;r.unstable_now=function(){return R.now()}}else{var A=Date,j=A.now();r.unstable_now=function(){return A.now()-j}}var C=[],T=[],M=1,O=null,z=3,Z=!1,q=!1,Y=!1,P=typeof setTimeout=="function"?setTimeout:null,he=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;function ue(V){for(var ie=x(T);ie!==null;){if(ie.callback===null)g(T);else if(ie.startTime<=V)g(T),ie.sortIndex=ie.expirationTime,h(C,ie);else break;ie=x(T)}}function X(V){if(Y=!1,ue(V),!q)if(x(C)!==null)q=!0,oe();else{var ie=x(T);ie!==null&&me(X,ie.startTime-V)}}var se=!1,pe=-1,ve=5,Me=-1;function J(){return!(r.unstable_now()-Me<ve)}function xe(){if(se){var V=r.unstable_now();Me=V;var ie=!0;try{e:{q=!1,Y&&(Y=!1,he(pe),pe=-1),Z=!0;var re=z;try{t:{for(ue(V),O=x(C);O!==null&&!(O.expirationTime>V&&J());){var Ae=O.callback;if(typeof Ae=="function"){O.callback=null,z=O.priorityLevel;var Re=Ae(O.expirationTime<=V);if(V=r.unstable_now(),typeof Re=="function"){O.callback=Re,ue(V),ie=!0;break t}O===x(C)&&g(C),ue(V)}else g(C);O=x(C)}if(O!==null)ie=!0;else{var Ve=x(T);Ve!==null&&me(X,Ve.startTime-V),ie=!1}}break e}finally{O=null,z=re,Z=!1}ie=void 0}}finally{ie?be():se=!1}}}var be;if(typeof te=="function")be=function(){te(xe)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,je=ge.port2;ge.port1.onmessage=xe,be=function(){je.postMessage(null)}}else be=function(){P(xe,0)};function oe(){se||(se=!0,be())}function me(V,ie){pe=P(function(){V(r.unstable_now())},ie)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(V){V.callback=null},r.unstable_continueExecution=function(){q||Z||(q=!0,oe())},r.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ve=0<V?Math.floor(1e3/V):5},r.unstable_getCurrentPriorityLevel=function(){return z},r.unstable_getFirstCallbackNode=function(){return x(C)},r.unstable_next=function(V){switch(z){case 1:case 2:case 3:var ie=3;break;default:ie=z}var re=z;z=ie;try{return V()}finally{z=re}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(V,ie){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var re=z;z=V;try{return ie()}finally{z=re}},r.unstable_scheduleCallback=function(V,ie,re){var Ae=r.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?Ae+re:Ae):re=Ae,V){case 1:var Re=-1;break;case 2:Re=250;break;case 5:Re=1073741823;break;case 4:Re=1e4;break;default:Re=5e3}return Re=re+Re,V={id:M++,callback:ie,priorityLevel:V,startTime:re,expirationTime:Re,sortIndex:-1},re>Ae?(V.sortIndex=re,h(T,V),x(C)===null&&V===x(T)&&(Y?(he(pe),pe=-1):Y=!0,me(X,re-Ae))):(V.sortIndex=Re,h(C,V),q||Z||(q=!0,oe())),V},r.unstable_shouldYield=J,r.unstable_wrapCallback=function(V){var ie=z;return function(){var re=z;z=ie;try{return V.apply(this,arguments)}finally{z=re}}}}(scheduler_production)),scheduler_production}var scheduler_development={};/**
|
|
70
|
+
* @license React
|
|
71
|
+
* scheduler.development.js
|
|
72
|
+
*
|
|
73
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the MIT license found in the
|
|
76
|
+
* LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/var hasRequiredScheduler_development;function requireScheduler_development(){return hasRequiredScheduler_development||(hasRequiredScheduler_development=1,function(r){process.env.NODE_ENV!=="production"&&function(){function h(){if(J){var V=r.unstable_now();ge=V;var ie=!0;try{e:{X=!1,se&&(se=!1,ve(xe),xe=-1),ue=!0;var re=te;try{t:{for(A(V),he=g(q);he!==null&&!(he.expirationTime>V&&C());){var Ae=he.callback;if(typeof Ae=="function"){he.callback=null,te=he.priorityLevel;var Re=Ae(he.expirationTime<=V);if(V=r.unstable_now(),typeof Re=="function"){he.callback=Re,A(V),ie=!0;break t}he===g(q)&&v(q),A(V)}else v(q);he=g(q)}if(he!==null)ie=!0;else{var Ve=g(Y);Ve!==null&&M(j,Ve.startTime-V),ie=!1}}break e}finally{he=null,te=re,ue=!1}ie=void 0}}finally{ie?je():J=!1}}}function x(V,ie){var re=V.length;V.push(ie);e:for(;0<re;){var Ae=re-1>>>1,Re=V[Ae];if(0<R(Re,ie))V[Ae]=ie,V[re]=Re,re=Ae;else break e}}function g(V){return V.length===0?null:V[0]}function v(V){if(V.length===0)return null;var ie=V[0],re=V.pop();if(re!==ie){V[0]=re;e:for(var Ae=0,Re=V.length,Ve=Re>>>1;Ae<Ve;){var qe=2*(Ae+1)-1,Xt=V[qe],Ne=qe+1,Dt=V[Ne];if(0>R(Xt,re))Ne<Re&&0>R(Dt,Xt)?(V[Ae]=Dt,V[Ne]=re,Ae=Ne):(V[Ae]=Xt,V[qe]=re,Ae=qe);else if(Ne<Re&&0>R(Dt,re))V[Ae]=Dt,V[Ne]=re,Ae=Ne;else break e}}return ie}function R(V,ie){var re=V.sortIndex-ie.sortIndex;return re!==0?re:V.id-ie.id}function A(V){for(var ie=g(Y);ie!==null;){if(ie.callback===null)v(Y);else if(ie.startTime<=V)v(Y),ie.sortIndex=ie.expirationTime,x(q,ie);else break;ie=g(Y)}}function j(V){if(se=!1,A(V),!X)if(g(q)!==null)X=!0,T();else{var ie=g(Y);ie!==null&&M(j,ie.startTime-V)}}function C(){return!(r.unstable_now()-ge<be)}function T(){J||(J=!0,je())}function M(V,ie){xe=pe(function(){V(r.unstable_now())},ie)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var O=performance;r.unstable_now=function(){return O.now()}}else{var z=Date,Z=z.now();r.unstable_now=function(){return z.now()-Z}}var q=[],Y=[],P=1,he=null,te=3,ue=!1,X=!1,se=!1,pe=typeof setTimeout=="function"?setTimeout:null,ve=typeof clearTimeout=="function"?clearTimeout:null,Me=typeof setImmediate<"u"?setImmediate:null,J=!1,xe=-1,be=5,ge=-1;if(typeof Me=="function")var je=function(){Me(h)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,me=oe.port2;oe.port1.onmessage=h,je=function(){me.postMessage(null)}}else je=function(){pe(h,0)};r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(V){V.callback=null},r.unstable_continueExecution=function(){X||ue||(X=!0,T())},r.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):be=0<V?Math.floor(1e3/V):5},r.unstable_getCurrentPriorityLevel=function(){return te},r.unstable_getFirstCallbackNode=function(){return g(q)},r.unstable_next=function(V){switch(te){case 1:case 2:case 3:var ie=3;break;default:ie=te}var re=te;te=ie;try{return V()}finally{te=re}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(V,ie){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var re=te;te=V;try{return ie()}finally{te=re}},r.unstable_scheduleCallback=function(V,ie,re){var Ae=r.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?Ae+re:Ae):re=Ae,V){case 1:var Re=-1;break;case 2:Re=250;break;case 5:Re=1073741823;break;case 4:Re=1e4;break;default:Re=5e3}return Re=re+Re,V={id:P++,callback:ie,priorityLevel:V,startTime:re,expirationTime:Re,sortIndex:-1},re>Ae?(V.sortIndex=re,x(Y,V),g(q)===null&&V===g(Y)&&(se?(ve(xe),xe=-1):se=!0,M(j,re-Ae))):(V.sortIndex=Re,x(q,V),X||ue||(X=!0,T())),V},r.unstable_shouldYield=C,r.unstable_wrapCallback=function(V){var ie=te;return function(){var re=te;te=ie;try{return V.apply(this,arguments)}finally{te=re}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(scheduler_development)),scheduler_development}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,process.env.NODE_ENV==="production"?scheduler.exports=requireScheduler_production():scheduler.exports=requireScheduler_development()),scheduler.exports}/**
|
|
78
|
+
* @license React
|
|
79
|
+
* react-dom-client.production.js
|
|
80
|
+
*
|
|
81
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the MIT license found in the
|
|
84
|
+
* LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/var hasRequiredReactDomClient_production;function requireReactDomClient_production(){if(hasRequiredReactDomClient_production)return reactDomClient_production;hasRequiredReactDomClient_production=1;var r=requireScheduler(),h=React,x=ReactDOM;function g(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function v(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}var R=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),z=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),he=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ue=Symbol.for("react.offscreen"),X=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function pe(a){return a===null||typeof a!="object"?null:(a=se&&a[se]||a["@@iterator"],typeof a=="function"?a:null)}var ve=Symbol.for("react.client.reference");function Me(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ve?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case C:return"Fragment";case j:return"Portal";case M:return"Profiler";case T:return"StrictMode";case Y:return"Suspense";case P:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case Z:return(a.displayName||"Context")+".Provider";case z:return(a._context.displayName||"Context")+".Consumer";case q:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case he:return i=a.displayName||null,i!==null?i:Me(a.type)||"Memo";case te:i=a._payload,a=a._init;try{return Me(a(i))}catch{}}return null}var J=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=Object.assign,be,ge;function je(a){if(be===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);be=i&&i[1]||"",ge=-1<u.stack.indexOf(`
|
|
86
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
87
|
+
`+be+a+ge}var oe=!1;function me(a,i){if(!a||oe)return"";oe=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ee){var K=ee}Reflect.construct(a,[],fe)}else{try{fe.call()}catch(ee){K=ee}a.call(fe.prototype)}}else{try{throw Error()}catch(ee){K=ee}(fe=a())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ee){if(ee&&K&&typeof ee.stack=="string")return[ee.stack,K.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),S=y[0],B=y[1];if(S&&B){var D=S.split(`
|
|
88
|
+
`),U=B.split(`
|
|
89
|
+
`);for(p=d=0;d<D.length&&!D[d].includes("DetermineComponentFrameRoot");)d++;for(;p<U.length&&!U[p].includes("DetermineComponentFrameRoot");)p++;if(d===D.length||p===U.length)for(d=D.length-1,p=U.length-1;1<=d&&0<=p&&D[d]!==U[p];)p--;for(;1<=d&&0<=p;d--,p--)if(D[d]!==U[p]){if(d!==1||p!==1)do if(d--,p--,0>p||D[d]!==U[p]){var le=`
|
|
90
|
+
`+D[d].replace(" at new "," at ");return a.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",a.displayName)),le}while(1<=d&&0<=p);break}}}finally{oe=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?je(u):""}function V(a){switch(a.tag){case 26:case 27:case 5:return je(a.type);case 16:return je("Lazy");case 13:return je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return a=me(a.type,!1),a;case 11:return a=me(a.type.render,!1),a;case 1:return a=me(a.type,!0),a;default:return""}}function ie(a){try{var i="";do i+=V(a),a=a.return;while(a);return i}catch(u){return`
|
|
91
|
+
Error generating stack: `+u.message+`
|
|
92
|
+
`+u.stack}}function re(a){var i=a,u=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,i.flags&4098&&(u=i.return),a=i.return;while(a)}return i.tag===3?u:null}function Ae(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function Re(a){if(re(a)!==a)throw Error(g(188))}function Ve(a){var i=a.alternate;if(!i){if(i=re(a),i===null)throw Error(g(188));return i!==a?null:a}for(var u=a,d=i;;){var p=u.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){u=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===u)return Re(p),a;if(y===d)return Re(p),i;y=y.sibling}throw Error(g(188))}if(u.return!==d.return)u=p,d=y;else{for(var S=!1,B=p.child;B;){if(B===u){S=!0,u=p,d=y;break}if(B===d){S=!0,d=p,u=y;break}B=B.sibling}if(!S){for(B=y.child;B;){if(B===u){S=!0,u=y,d=p;break}if(B===d){S=!0,d=y,u=p;break}B=B.sibling}if(!S)throw Error(g(189))}}if(u.alternate!==d)throw Error(g(190))}if(u.tag!==3)throw Error(g(188));return u.stateNode.current===u?a:i}function qe(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=qe(a),i!==null)return i;a=a.sibling}return null}var Xt=Array.isArray,Ne=x.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Dt={pending:!1,data:null,method:null,action:null},Wa=[],qs=-1;function sl(a){return{current:a}}function zt(a){0>qs||(a.current=Wa[qs],Wa[qs]=null,qs--)}function dt(a,i){qs++,Wa[qs]=a.current,a.current=i}var Qn=sl(null),at=sl(null),ca=sl(null),Lo=sl(null);function Pr(a,i){switch(dt(ca,i),dt(at,a),dt(Qn,null),a=i.nodeType,a){case 9:case 11:i=(i=i.documentElement)&&(i=i.namespaceURI)?_f(i):0;break;default:if(a=a===8?i.parentNode:i,i=a.tagName,a=a.namespaceURI)a=_f(a),i=Pp(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}zt(Qn),dt(Qn,i)}function Ji(){zt(Qn),zt(at),zt(ca)}function mt(a){a.memoizedState!==null&&dt(Lo,a);var i=Qn.current,u=Pp(i,a.type);i!==u&&(dt(at,a),dt(Qn,u))}function ed(a){at.current===a&&(zt(Qn),zt(at)),Lo.current===a&&(zt(Lo),ll._currentValue=Dt)}var td=Object.prototype.hasOwnProperty,Ho=r.unstable_scheduleCallback,Gs=r.unstable_cancelCallback,Zh=r.unstable_shouldYield,Ih=r.unstable_requestPaint,Zn=r.unstable_now,zg=r.unstable_getCurrentPriorityLevel,$h=r.unstable_ImmediatePriority,Ys=r.unstable_UserBlockingPriority,Uo=r.unstable_NormalPriority,xc=r.unstable_LowPriority,Kh=r.unstable_IdlePriority,Jh=r.log,Wh=r.unstable_setDisableYieldValue,Vo=null,mn=null;function Lg(a){if(mn&&typeof mn.onCommitFiberRoot=="function")try{mn.onCommitFiberRoot(Vo,a,void 0,(a.current.flags&128)===128)}catch{}}function Fa(a){if(typeof Jh=="function"&&Wh(a),mn&&typeof mn.setStrictMode=="function")try{mn.setStrictMode(Vo,a)}catch{}}var In=Math.clz32?Math.clz32:ex,Fh=Math.log,Ph=Math.LN2;function ex(a){return a>>>=0,a===0?32:31-(Fh(a)/Ph|0)|0}var gc=128,nd=4194304;function Pa(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function ra(a,i){var u=a.pendingLanes;if(u===0)return 0;var d=0,p=a.suspendedLanes,y=a.pingedLanes,S=a.warmLanes;a=a.finishedLanes!==0;var B=u&134217727;return B!==0?(u=B&~p,u!==0?d=Pa(u):(y&=B,y!==0?d=Pa(y):a||(S=B&~S,S!==0&&(d=Pa(S))))):(B=u&~p,B!==0?d=Pa(B):y!==0?d=Pa(y):a||(S=u&~S,S!==0&&(d=Pa(S)))),d===0?0:i!==0&&i!==d&&!(i&p)&&(p=d&-d,S=i&-i,p>=S||p===32&&(S&4194176)!==0)?i:d}function ql(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function yc(a,i){switch(a){case 1:case 2:case 4:case 8:return i+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qo(){var a=gc;return gc<<=1,!(gc&4194176)&&(gc=128),a}function Qt(){var a=nd;return nd<<=1,!(nd&62914560)&&(nd=4194304),a}function es(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function da(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Wi(a,i,u,d,p,y){var S=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var B=a.entanglements,D=a.expirationTimes,U=a.hiddenUpdates;for(u=S&~u;0<u;){var le=31-In(u),fe=1<<le;B[le]=0,D[le]=-1;var K=U[le];if(K!==null)for(U[le]=null,le=0;le<K.length;le++){var ee=K[le];ee!==null&&(ee.lane&=-536870913)}u&=~fe}d!==0&&ld(a,d,0),y!==0&&p===0&&a.tag!==0&&(a.suspendedLanes|=y&~(S&~i))}function ld(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var d=31-In(i);a.entangledLanes|=i,a.entanglements[d]=a.entanglements[d]|1073741824|u&4194218}function gm(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var d=31-In(u),p=1<<d;p&i|a[d]&i&&(a[d]|=i),u&=~p}}function bc(a){return a&=-a,2<a?8<a?a&134217727?32:268435456:8:2}function vc(){var a=Ne.p;return a!==0?a:(a=window.event,a===void 0?32:Px(a.type))}function ts(a,i){var u=Ne.p;try{return Ne.p=a,i()}finally{Ne.p=u}}var Zt=Math.random().toString(36).slice(2),pn="__reactFiber$"+Zt,$n="__reactProps$"+Zt,ns="__reactContainer$"+Zt,ad="__reactEvents$"+Zt,sd="__reactListeners$"+Zt,Bl="__reactHandles$"+Zt,ym="__reactResources$"+Zt,Go="__reactMarker$"+Zt;function od(a){delete a[pn],delete a[$n],delete a[ad],delete a[sd],delete a[Bl]}function ls(a){var i=a[pn];if(i)return i;for(var u=a.parentNode;u;){if(i=u[ns]||u[pn]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=Cr(a);a!==null;){if(u=a[pn])return u;a=Cr(a)}return i}a=u,u=a.parentNode}return null}function Yo(a){if(a=a[pn]||a[ns]){var i=a.tag;if(i===5||i===6||i===13||i===26||i===27||i===3)return a}return null}function Fi(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(g(33))}function Gl(a){var i=a[ym];return i||(i=a[ym]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function It(a){a[Go]=!0}var bm=new Set,vm={};function Xs(a,i){Xo(a,i),Xo(a+"Capture",i)}function Xo(a,i){for(vm[a]=i,a=0;a<i.length;a++)bm.add(i[a])}var Lt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pi=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Qs={},Rm={};function Rc(a){return td.call(Rm,a)?!0:td.call(Qs,a)?!1:Pi.test(a)?Rm[a]=!0:(Qs[a]=!0,!1)}function Qo(a,i,u){if(Rc(i))if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+u)}}function eu(a,i,u){if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+u)}}function ol(a,i,u,d){if(d===null)a.removeAttribute(u);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(i,u,""+d)}}function hn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function id(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Hg(a){var i=id(a)?"checked":"value",u=Object.getOwnPropertyDescriptor(a.constructor.prototype,i),d=""+a[i];if(!a.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,y=u.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return p.call(this)},set:function(S){d=""+S,y.call(this,S)}}),Object.defineProperty(a,i,{enumerable:u.enumerable}),{getValue:function(){return d},setValue:function(S){d=""+S},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function ud(a){a._valueTracker||(a._valueTracker=Hg(a))}function Em(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),d="";return a&&(d=id(a)?a.checked?"true":"false":a.value),a=d,a!==u?(i.setValue(a),!0):!1}function tu(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var jm=/[\n"\\]/g;function il(a){return a.replace(jm,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function cd(a,i,u,d,p,y,S,B){a.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?a.type=S:a.removeAttribute("type"),i!=null?S==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+hn(i)):a.value!==""+hn(i)&&(a.value=""+hn(i)):S!=="submit"&&S!=="reset"||a.removeAttribute("value"),i!=null?Am(a,S,hn(i)):u!=null?Am(a,S,hn(u)):d!=null&&a.removeAttribute("value"),p==null&&y!=null&&(a.defaultChecked=!!y),p!=null&&(a.checked=p&&typeof p!="function"&&typeof p!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?a.name=""+hn(B):a.removeAttribute("name")}function Sm(a,i,u,d,p,y,S,B){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),i!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||i!=null))return;u=u!=null?""+hn(u):"",i=i!=null?""+hn(i):u,B||i===a.value||(a.value=i),a.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,a.checked=B?a.checked:!!d,a.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.name=S)}function Am(a,i,u){i==="number"&&tu(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Zo(a,i,u,d){if(a=a.options,i){i={};for(var p=0;p<u.length;p++)i["$"+u[p]]=!0;for(u=0;u<a.length;u++)p=i.hasOwnProperty("$"+a[u].value),a[u].selected!==p&&(a[u].selected=p),p&&d&&(a[u].defaultSelected=!0)}else{for(u=""+hn(u),i=null,p=0;p<a.length;p++){if(a[p].value===u){a[p].selected=!0,d&&(a[p].defaultSelected=!0);return}i!==null||a[p].disabled||(i=a[p])}i!==null&&(i.selected=!0)}}function rd(a,i,u){if(i!=null&&(i=""+hn(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+hn(u):""}function Ec(a,i,u,d){if(i==null){if(d!=null){if(u!=null)throw Error(g(92));if(Xt(d)){if(1<d.length)throw Error(g(93));d=d[0]}u=d}u==null&&(u=""),i=u}u=hn(i),a.defaultValue=u,d=a.textContent,d===u&&d!==""&&d!==null&&(a.value=d)}function fa(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var Ug=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Cm(a,i,u){var d=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?d?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":d?a.setProperty(i,u):typeof u!="number"||u===0||Ug.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function Tm(a,i,u){if(i!=null&&typeof i!="object")throw Error(g(62));if(a=a.style,u!=null){for(var d in u)!u.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?a.setProperty(d,""):d==="float"?a.cssFloat="":a[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&u[p]!==d&&Cm(a,p,d)}else for(var y in i)i.hasOwnProperty(y)&&Cm(a,y,i[y])}function Io(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Vg=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function dd(a){return Vg.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var km=null;function Bm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ma=null,Zs=null;function wm(a){var i=Yo(a);if(i&&(a=i.stateNode)){var u=a[$n]||null;e:switch(a=i.stateNode,i.type){case"input":if(cd(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+il(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var d=u[i];if(d!==a&&d.form===a.form){var p=d[$n]||null;if(!p)throw Error(g(90));cd(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<u.length;i++)d=u[i],d.form===a.form&&Em(d)}break e;case"textarea":rd(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Zo(a,!!u.multiple,i,!1)}}}var fd=!1;function nu(a,i,u){if(fd)return a(i,u);fd=!0;try{var d=a(i);return d}finally{if(fd=!1,(ma!==null||Zs!==null)&&(Bi(),ma&&(i=ma,a=Zs,Zs=ma=null,wm(i),a)))for(i=0;i<a.length;i++)wm(a[i])}}function lu(a,i){var u=a.stateNode;if(u===null)return null;var d=u[$n]||null;if(d===null)return null;u=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(a=a.type,d=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!d;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(g(231,i,typeof u));return u}var au=!1;if(Lt)try{var Is={};Object.defineProperty(Is,"passive",{get:function(){au=!0}}),window.addEventListener("test",Is,Is),window.removeEventListener("test",Is,Is)}catch{au=!1}var as=null,An=null,md=null;function pd(){if(md)return md;var a,i=An,u=i.length,d,p="value"in as?as.value:as.textContent,y=p.length;for(a=0;a<u&&i[a]===p[a];a++);var S=u-a;for(d=1;d<=S&&i[u-d]===p[y-d];d++);return md=p.slice(a,1<d?1-d:void 0)}function jc(a){var i=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function Sc(){return!0}function nx(){return!1}function Kn(a){function i(u,d,p,y,S){this._reactName=u,this._targetInst=p,this.type=d,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var B in a)a.hasOwnProperty(B)&&(u=a[B],this[B]=u?u(y):y[B]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Sc:nx,this.isPropagationStopped=nx,this}return xe(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Sc)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Sc)},persist:function(){},isPersistent:Sc}),i}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hd=Kn($s),su=xe({},$s,{view:0,detail:0}),qg=Kn(su),ou,xd,iu,Ac=xe({},su,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ul,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==iu&&(iu&&a.type==="mousemove"?(ou=a.screenX-iu.screenX,xd=a.screenY-iu.screenY):xd=ou=0,iu=a),ou)},movementY:function(a){return"movementY"in a?a.movementY:xd}}),lx=Kn(Ac),Gg=xe({},Ac,{dataTransfer:0}),Yg=Kn(Gg),Xg=xe({},su,{relatedTarget:0}),Dm=Kn(Xg),Cc=xe({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),ax=Kn(Cc),sx=xe({},$s,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),ox=Kn(sx),ix=xe({},$s,{data:0}),gd=Kn(ix),Qg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ux={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},$o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ko(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=$o[a])?!!i[a]:!1}function ul(){return Ko}var yd=xe({},su,{key:function(a){if(a.key){var i=Qg[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=jc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?ux[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ul,charCode:function(a){return a.type==="keypress"?jc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?jc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),bd=Kn(yd),Mm=xe({},Ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xn=Kn(Mm),cx=xe({},su,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ul}),vd=Kn(cx),Jo=xe({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),_m=Kn(Jo),rx=xe({},Ac,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),dx=Kn(rx),Nm=xe({},$s,{newState:0,oldState:0}),ss=Kn(Nm),Rd=[9,13,27,32],Wo=Lt&&"CompositionEvent"in window,Fo=null;Lt&&"documentMode"in document&&(Fo=document.documentMode);var Om=Lt&&"TextEvent"in window&&!Fo,zm=Lt&&(!Wo||Fo&&8<Fo&&11>=Fo),Yl=" ",Xl=!1;function Tc(a,i){switch(a){case"keyup":return Rd.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jn(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var wl=!1;function fx(a,i){switch(a){case"compositionend":return Jn(i);case"keypress":return i.which!==32?null:(Xl=!0,Yl);case"textInput":return a=i.data,a===Yl&&Xl?null:a;default:return null}}function Lm(a,i){if(wl)return a==="compositionend"||!Wo&&Tc(a,i)?(a=pd(),md=An=as=null,wl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return zm&&i.locale!=="ko"?null:i.data;default:return null}}var Hm={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ks(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!Hm[a.type]:i==="textarea"}function Js(a,i,u,d){ma?Zs?Zs.push(d):Zs=[d]:ma=d,i=Dn(i,"onChange"),0<i.length&&(u=new hd("onChange","change",null,u,d),a.push({event:u,listeners:i}))}var Po=null,Ql=null;function mx(a){kf(a,0)}function kc(a){var i=Fi(a);if(Em(i))return a}function uu(a,i){if(a==="change")return i}var cu=!1;if(Lt){var ei;if(Lt){var Ed="oninput"in document;if(!Ed){var Um=document.createElement("div");Um.setAttribute("oninput","return;"),Ed=typeof Um.oninput=="function"}ei=Ed}else ei=!1;cu=ei&&(!document.documentMode||9<document.documentMode)}function Vm(){Po&&(Po.detachEvent("onpropertychange",Bc),Ql=Po=null)}function Bc(a){if(a.propertyName==="value"&&kc(Ql)){var i=[];Js(i,Ql,a,Bm(a)),nu(mx,i)}}function px(a,i,u){a==="focusin"?(Vm(),Po=i,Ql=u,Po.attachEvent("onpropertychange",Bc)):a==="focusout"&&Vm()}function hx(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return kc(Ql)}function xx(a,i){if(a==="click")return kc(i)}function gn(a,i){if(a==="input"||a==="change")return kc(i)}function jd(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var Cn=typeof Object.is=="function"?Object.is:jd;function os(a,i){if(Cn(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var u=Object.keys(a),d=Object.keys(i);if(u.length!==d.length)return!1;for(d=0;d<u.length;d++){var p=u[d];if(!td.call(i,p)||!Cn(a[p],i[p]))return!1}return!0}function wc(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Dc(a,i){var u=wc(a);a=0;for(var d;u;){if(u.nodeType===3){if(d=a+u.textContent.length,a<=i&&d>=i)return{node:u,offset:i-a};a=d}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=wc(u)}}function Mc(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?Mc(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function qm(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=tu(a.document);i instanceof a.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)a=i.contentWindow;else break;i=tu(a.document)}return i}function Sd(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}function Gm(a,i){var u=qm(i);i=a.focusedElem;var d=a.selectionRange;if(u!==i&&i&&i.ownerDocument&&Mc(i.ownerDocument.documentElement,i)){if(d!==null&&Sd(i)){if(a=d.start,u=d.end,u===void 0&&(u=a),"selectionStart"in i)i.selectionStart=a,i.selectionEnd=Math.min(u,i.value.length);else if(u=(a=i.ownerDocument||document)&&a.defaultView||window,u.getSelection){u=u.getSelection();var p=i.textContent.length,y=Math.min(d.start,p);d=d.end===void 0?y:Math.min(d.end,p),!u.extend&&y>d&&(p=d,d=y,y=p),p=Dc(i,y);var S=Dc(i,d);p&&S&&(u.rangeCount!==1||u.anchorNode!==p.node||u.anchorOffset!==p.offset||u.focusNode!==S.node||u.focusOffset!==S.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),u.removeAllRanges(),y>d?(u.addRange(a),u.extend(S.node,S.offset)):(a.setEnd(S.node,S.offset),u.addRange(a)))}}for(a=[],u=i;u=u.parentNode;)u.nodeType===1&&a.push({element:u,left:u.scrollLeft,top:u.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<a.length;i++)u=a[i],u.element.scrollLeft=u.left,u.element.scrollTop=u.top}}var Ym=Lt&&"documentMode"in document&&11>=document.documentMode,cl=null,Ad=null,Dl=null,Zl=!1;function _c(a,i,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Zl||cl==null||cl!==tu(d)||(d=cl,"selectionStart"in d&&Sd(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Dl&&os(Dl,d)||(Dl=d,d=Dn(Ad,"onSelect"),0<d.length&&(i=new hd("onSelect","select",null,i,u),a.push({event:i,listeners:d}),i.target=cl)))}function is(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var Ml={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},ti={},gx={};Lt&&(gx=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function Ws(a){if(ti[a])return ti[a];if(!Ml[a])return a;var i=Ml[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in gx)return ti[a]=i[u];return a}var yx=Ws("animationend"),Cd=Ws("animationiteration"),Nc=Ws("animationstart"),bx=Ws("transitionrun"),Ze=Ws("transitionstart"),ye=Ws("transitioncancel"),ni=Ws("transitionend"),Oc=new Map,Mt="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function rl(a,i){Oc.set(a,i),Xs(i,[a])}var Wn=[],li=0,zc=0;function Td(){for(var a=li,i=zc=li=0;i<a;){var u=Wn[i];Wn[i++]=null;var d=Wn[i];Wn[i++]=null;var p=Wn[i];Wn[i++]=null;var y=Wn[i];if(Wn[i++]=null,d!==null&&p!==null){var S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}y!==0&&Ln(u,p,y)}}function ru(a,i,u,d){Wn[li++]=a,Wn[li++]=i,Wn[li++]=u,Wn[li++]=d,zc|=d,a.lanes|=d,a=a.alternate,a!==null&&(a.lanes|=d)}function Lc(a,i,u,d){return ru(a,i,u,d),tt(a)}function pa(a,i){return ru(a,null,null,i),tt(a)}function Ln(a,i,u){a.lanes|=u;var d=a.alternate;d!==null&&(d.lanes|=u);for(var p=!1,y=a.return;y!==null;)y.childLanes|=u,d=y.alternate,d!==null&&(d.childLanes|=u),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(p=!0)),a=y,y=y.return;p&&i!==null&&a.tag===3&&(y=a.stateNode,p=31-In(u),y=y.hiddenUpdates,a=y[p],a===null?y[p]=[i]:a.push(i),i.lane=u|536870912)}function tt(a){if(50<qu)throw qu=0,vf=null,Error(g(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var ha={},us=new WeakMap;function ln(a,i){if(typeof a=="object"&&a!==null){var u=us.get(a);return u!==void 0?u:(i={value:a,source:i,stack:ie(i)},us.set(a,i),i)}return{value:a,source:i,stack:ie(i)}}var Tn=[],Fs=0,cs=null,du=0,kn=[],Fn=0,xa=null,ga=1,ya="";function Ps(a,i){Tn[Fs++]=du,Tn[Fs++]=cs,cs=a,du=i}function Xm(a,i,u){kn[Fn++]=ga,kn[Fn++]=ya,kn[Fn++]=xa,xa=a;var d=ga;a=ya;var p=32-In(d)-1;d&=~(1<<p),u+=1;var y=32-In(i)+p;if(30<y){var S=p-p%5;y=(d&(1<<S)-1).toString(32),d>>=S,p-=S,ga=1<<32-In(i)+p|u<<p|d,ya=y+a}else ga=1<<y|u<<p|d,ya=a}function kd(a){a.return!==null&&(Ps(a,1),Xm(a,1,0))}function Hc(a){for(;a===cs;)cs=Tn[--Fs],Tn[Fs]=null,du=Tn[--Fs],Tn[Fs]=null;for(;a===xa;)xa=kn[--Fn],kn[Fn]=null,ya=kn[--Fn],kn[Fn]=null,ga=kn[--Fn],kn[Fn]=null}var yn=null,$t=null,Pe=!1,_l=null,Il=!1,Qm=Error(g(519));function eo(a){var i=Error(g(418,""));throw mu(ln(i,a)),Qm}function Zm(a){var i=a.stateNode,u=a.type,d=a.memoizedProps;switch(i[pn]=a,i[$n]=d,u){case"dialog":We("cancel",i),We("close",i);break;case"iframe":case"object":case"embed":We("load",i);break;case"video":case"audio":for(u=0;u<La.length;u++)We(La[u],i);break;case"source":We("error",i);break;case"img":case"image":case"link":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"input":We("invalid",i),Sm(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0),ud(i);break;case"select":We("invalid",i);break;case"textarea":We("invalid",i),Ec(i,d.value,d.defaultValue,d.children),ud(i)}u=d.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||d.suppressHydrationWarning===!0||He(i.textContent,u)?(d.popover!=null&&(We("beforetoggle",i),We("toggle",i)),d.onScroll!=null&&We("scroll",i),d.onScrollEnd!=null&&We("scrollend",i),d.onClick!=null&&(i.onclick=Eo),i=!0):i=!1,i||eo(a)}function Im(a){for(yn=a.return;yn;)switch(yn.tag){case 3:case 27:Il=!0;return;case 5:case 13:Il=!1;return;default:yn=yn.return}}function ai(a){if(a!==yn)return!1;if(!Pe)return Im(a),Pe=!0,!1;var i=!1,u;if((u=a.tag!==3&&a.tag!==27)&&((u=a.tag===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Er(a.type,a.memoizedProps)),u=!u),u&&(i=!0),i&&$t&&eo(a),Im(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(g(317));e:{for(a=a.nextSibling,i=0;a;){if(a.nodeType===8)if(u=a.data,u==="/$"){if(i===0){$t=rn(a.nextSibling);break e}i--}else u!=="$"&&u!=="$!"&&u!=="$?"||i++;a=a.nextSibling}$t=null}}else $t=yn?rn(a.stateNode.nextSibling):null;return!0}function fu(){$t=yn=null,Pe=!1}function mu(a){_l===null?_l=[a]:_l.push(a)}var ba=Error(g(460)),Uc=Error(g(474)),Bd={then:function(){}};function vx(a){return a=a.status,a==="fulfilled"||a==="rejected"}function si(){}function oi(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(si,si),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,a===ba?Error(g(483)):a;default:if(typeof i.status=="string")i.then(si,si);else{if(a=ct,a!==null&&100<a.shellSuspendCounter)throw Error(g(482));a=i,a.status="pending",a.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,a===ba?Error(g(483)):a}throw ii=i,ba}}var ii=null;function to(){if(ii===null)throw Error(g(459));var a=ii;return ii=null,a}var Kt=null,no=0;function pu(a){var i=no;return no+=1,Kt===null&&(Kt=[]),oi(Kt,a,i)}function hu(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function xu(a,i){throw i.$$typeof===R?Error(g(525)):(a=Object.prototype.toString.call(i),Error(g(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function Vc(a){var i=a._init;return i(a._payload)}function wd(a){function i(G,H){if(a){var Q=G.deletions;Q===null?(G.deletions=[H],G.flags|=16):Q.push(H)}}function u(G,H){if(!a)return null;for(;H!==null;)i(G,H),H=H.sibling;return null}function d(G){for(var H=new Map;G!==null;)G.key!==null?H.set(G.key,G):H.set(G.index,G),G=G.sibling;return H}function p(G,H){return G=na(G,H),G.index=0,G.sibling=null,G}function y(G,H,Q){return G.index=Q,a?(Q=G.alternate,Q!==null?(Q=Q.index,Q<H?(G.flags|=33554434,H):Q):(G.flags|=33554434,H)):(G.flags|=1048576,H)}function S(G){return a&&G.alternate===null&&(G.flags|=33554434),G}function B(G,H,Q,de){return H===null||H.tag!==6?(H=hf(Q,G.mode,de),H.return=G,H):(H=p(H,Q),H.return=G,H)}function D(G,H,Q,de){var Te=Q.type;return Te===C?le(G,H,Q.props.children,de,Q.key):H!==null&&(H.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===te&&Vc(Te)===H.type)?(H=p(H,Q.props),hu(H,Q),H.return=G,H):(H=Lu(Q.type,Q.key,Q.props,null,G.mode,de),hu(H,Q),H.return=G,H)}function U(G,H,Q,de){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=dr(Q,G.mode,de),H.return=G,H):(H=p(H,Q.children||[]),H.return=G,H)}function le(G,H,Q,de,Te){return H===null||H.tag!==7?(H=kt(Q,G.mode,de,Te),H.return=G,H):(H=p(H,Q),H.return=G,H)}function fe(G,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=hf(""+H,G.mode,Q),H.return=G,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case A:return Q=Lu(H.type,H.key,H.props,null,G.mode,Q),hu(Q,H),Q.return=G,Q;case j:return H=dr(H,G.mode,Q),H.return=G,H;case te:var de=H._init;return H=de(H._payload),fe(G,H,Q)}if(Xt(H)||pe(H))return H=kt(H,G.mode,Q,null),H.return=G,H;if(typeof H.then=="function")return fe(G,pu(H),Q);if(H.$$typeof===Z)return fe(G,lf(G,H),Q);xu(G,H)}return null}function K(G,H,Q,de){var Te=H!==null?H.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Te!==null?null:B(G,H,""+Q,de);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case A:return Q.key===Te?D(G,H,Q,de):null;case j:return Q.key===Te?U(G,H,Q,de):null;case te:return Te=Q._init,Q=Te(Q._payload),K(G,H,Q,de)}if(Xt(Q)||pe(Q))return Te!==null?null:le(G,H,Q,de,null);if(typeof Q.then=="function")return K(G,H,pu(Q),de);if(Q.$$typeof===Z)return K(G,H,lf(G,Q),de);xu(G,Q)}return null}function ee(G,H,Q,de,Te){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return G=G.get(Q)||null,B(H,G,""+de,Te);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case A:return G=G.get(de.key===null?Q:de.key)||null,D(H,G,de,Te);case j:return G=G.get(de.key===null?Q:de.key)||null,U(H,G,de,Te);case te:var Ge=de._init;return de=Ge(de._payload),ee(G,H,Q,de,Te)}if(Xt(de)||pe(de))return G=G.get(Q)||null,le(H,G,de,Te,null);if(typeof de.then=="function")return ee(G,H,Q,pu(de),Te);if(de.$$typeof===Z)return ee(G,H,Q,lf(H,de),Te);xu(H,de)}return null}function Ce(G,H,Q,de){for(var Te=null,Ge=null,we=H,De=H=0,en=null;we!==null&&De<Q.length;De++){we.index>De?(en=we,we=null):en=we.sibling;var nt=K(G,we,Q[De],de);if(nt===null){we===null&&(we=en);break}a&&we&&nt.alternate===null&&i(G,we),H=y(nt,H,De),Ge===null?Te=nt:Ge.sibling=nt,Ge=nt,we=en}if(De===Q.length)return u(G,we),Pe&&Ps(G,De),Te;if(we===null){for(;De<Q.length;De++)we=fe(G,Q[De],de),we!==null&&(H=y(we,H,De),Ge===null?Te=we:Ge.sibling=we,Ge=we);return Pe&&Ps(G,De),Te}for(we=d(we);De<Q.length;De++)en=ee(we,G,De,Q[De],de),en!==null&&(a&&en.alternate!==null&&we.delete(en.key===null?De:en.key),H=y(en,H,De),Ge===null?Te=en:Ge.sibling=en,Ge=en);return a&&we.forEach(function(Mo){return i(G,Mo)}),Pe&&Ps(G,De),Te}function _e(G,H,Q,de){if(Q==null)throw Error(g(151));for(var Te=null,Ge=null,we=H,De=H=0,en=null,nt=Q.next();we!==null&&!nt.done;De++,nt=Q.next()){we.index>De?(en=we,we=null):en=we.sibling;var Mo=K(G,we,nt.value,de);if(Mo===null){we===null&&(we=en);break}a&&we&&Mo.alternate===null&&i(G,we),H=y(Mo,H,De),Ge===null?Te=Mo:Ge.sibling=Mo,Ge=Mo,we=en}if(nt.done)return u(G,we),Pe&&Ps(G,De),Te;if(we===null){for(;!nt.done;De++,nt=Q.next())nt=fe(G,nt.value,de),nt!==null&&(H=y(nt,H,De),Ge===null?Te=nt:Ge.sibling=nt,Ge=nt);return Pe&&Ps(G,De),Te}for(we=d(we);!nt.done;De++,nt=Q.next())nt=ee(we,G,De,nt.value,de),nt!==null&&(a&&nt.alternate!==null&&we.delete(nt.key===null?De:nt.key),H=y(nt,H,De),Ge===null?Te=nt:Ge.sibling=nt,Ge=nt);return a&&we.forEach(function(cy){return i(G,cy)}),Pe&&Ps(G,De),Te}function bt(G,H,Q,de){if(typeof Q=="object"&&Q!==null&&Q.type===C&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case A:e:{for(var Te=Q.key;H!==null;){if(H.key===Te){if(Te=Q.type,Te===C){if(H.tag===7){u(G,H.sibling),de=p(H,Q.props.children),de.return=G,G=de;break e}}else if(H.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===te&&Vc(Te)===H.type){u(G,H.sibling),de=p(H,Q.props),hu(de,Q),de.return=G,G=de;break e}u(G,H);break}else i(G,H);H=H.sibling}Q.type===C?(de=kt(Q.props.children,G.mode,de,Q.key),de.return=G,G=de):(de=Lu(Q.type,Q.key,Q.props,null,G.mode,de),hu(de,Q),de.return=G,G=de)}return S(G);case j:e:{for(Te=Q.key;H!==null;){if(H.key===Te)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){u(G,H.sibling),de=p(H,Q.children||[]),de.return=G,G=de;break e}else{u(G,H);break}else i(G,H);H=H.sibling}de=dr(Q,G.mode,de),de.return=G,G=de}return S(G);case te:return Te=Q._init,Q=Te(Q._payload),bt(G,H,Q,de)}if(Xt(Q))return Ce(G,H,Q,de);if(pe(Q)){if(Te=pe(Q),typeof Te!="function")throw Error(g(150));return Q=Te.call(Q),_e(G,H,Q,de)}if(typeof Q.then=="function")return bt(G,H,pu(Q),de);if(Q.$$typeof===Z)return bt(G,H,lf(G,Q),de);xu(G,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(u(G,H.sibling),de=p(H,Q),de.return=G,G=de):(u(G,H),de=hf(Q,G.mode,de),de.return=G,G=de),S(G)):u(G,H)}return function(G,H,Q,de){try{no=0;var Te=bt(G,H,Q,de);return Kt=null,Te}catch(we){if(we===ba)throw we;var Ge=Ft(29,we,null,G.mode);return Ge.lanes=de,Ge.return=G,Ge}finally{}}}var va=wd(!0),Dd=wd(!1),rs=sl(null),gu=sl(0);function $m(a,i){a=ws,dt(gu,a),dt(rs,i),ws=a|i.baseLanes}function Md(){dt(gu,ws),dt(rs,rs.current)}function qc(){ws=gu.current,zt(rs),zt(gu)}var dl=sl(null),$l=null;function Ra(a){var i=a.alternate;dt(Vt,Vt.current&1),dt(dl,a),$l===null&&(i===null||rs.current!==null||i.memoizedState!==null)&&($l=a)}function Km(a){if(a.tag===22){if(dt(Vt,Vt.current),dt(dl,a),$l===null){var i=a.alternate;i!==null&&i.memoizedState!==null&&($l=a)}}else ds()}function ds(){dt(Vt,Vt.current),dt(dl,dl.current)}function Kl(a){zt(dl),$l===a&&($l=null),zt(Vt)}var Vt=sl(0);function Gc(a){for(var i=a;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if(i.flags&128)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ui=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(u,d){a.push(d)}};this.abort=function(){i.aborted=!0,a.forEach(function(u){return u()})}},Jm=r.unstable_scheduleCallback,Wm=r.unstable_NormalPriority,Jt={$$typeof:Z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fm(){return{controller:new ui,data:new Map,refCount:0}}function yu(a){a.refCount--,a.refCount===0&&Jm(Wm,function(){a.controller.abort()})}var fs=null,Yc=0,ms=0,ci=null;function Rx(a,i){if(fs===null){var u=fs=[];Yc=0,ms=Zu(),ci={status:"pending",value:void 0,then:function(d){u.push(d)}}}return Yc++,i.then(_d,_d),i}function _d(){if(--Yc===0&&fs!==null){ci!==null&&(ci.status="fulfilled");var a=fs;fs=null,ms=0,ci=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function Pm(a,i){var u=[],d={status:"pending",value:null,reason:null,then:function(p){u.push(p)}};return a.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<u.length;p++)(0,u[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<u.length;p++)(0,u[p])(void 0)}),d}var ep=J.S;J.S=function(a,i){typeof i=="object"&&i!==null&&typeof i.then=="function"&&Rx(a,i),ep!==null&&ep(a,i)};var lo=sl(null);function ps(){var a=lo.current;return a!==null?a:ct.pooledCache}function Xc(a,i){i===null?dt(lo,lo.current):dt(lo,i.pool)}function tp(){var a=ps();return a===null?null:{parent:Jt._currentValue,pool:a}}var hs=0,ze=null,st=null,_t=null,bu=!1,ao=!1,ri=!1,qt=0,vu=0,di=null,Ex=0;function Nt(){throw Error(g(321))}function Nd(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!Cn(a[u],i[u]))return!1;return!0}function fi(a,i,u,d,p,y){return hs=y,ze=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,J.H=a===null||a.memoizedState===null?io:vs,ri=!1,y=u(d,p),ri=!1,ao&&(y=np(i,u,d,p)),Od(a),y}function Od(a){J.H=an;var i=st!==null&&st.next!==null;if(hs=0,_t=st=ze=null,bu=!1,vu=0,di=null,i)throw Error(g(300));a===null||Tt||(a=a.dependencies,a!==null&&sr(a)&&(Tt=!0))}function np(a,i,u,d){ze=a;var p=0;do{if(ao&&(di=null),vu=0,ao=!1,25<=p)throw Error(g(301));if(p+=1,_t=st=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}J.H=hi,y=i(u,d)}while(ao);return y}function jx(){var a=J.H,i=a.useState()[0];return i=typeof i.then=="function"?mi(i):i,a=a.useState()[0],(st!==null?st.memoizedState:null)!==a&&(ze.flags|=1024),i}function zd(){var a=qt!==0;return qt=0,a}function Qc(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function Zc(a){if(bu){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}bu=!1}hs=0,_t=st=ze=null,ao=!1,vu=qt=0,di=null}function Bn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?ze.memoizedState=_t=a:_t=_t.next=a,_t}function Ht(){if(st===null){var a=ze.alternate;a=a!==null?a.memoizedState:null}else a=st.next;var i=_t===null?ze.memoizedState:_t.next;if(i!==null)_t=i,st=a;else{if(a===null)throw ze.alternate===null?Error(g(467)):Error(g(310));st=a,a={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},_t===null?ze.memoizedState=_t=a:_t=_t.next=a}return _t}var Ru;Ru=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function mi(a){var i=vu;return vu+=1,di===null&&(di=[]),a=oi(di,a,i),i=ze,(_t===null?i.memoizedState:_t.next)===null&&(i=i.alternate,J.H=i===null||i.memoizedState===null?io:vs),a}function Eu(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return mi(a);if(a.$$typeof===Z)return bn(a)}throw Error(g(438,String(a)))}function Ld(a){var i=null,u=ze.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var d=ze.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Ru(),ze.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(a),d=0;d<a;d++)u[d]=X;return i.index++,u}function Ea(a,i){return typeof i=="function"?i(a):i}function ju(a){var i=Ht();return Hd(i,st,a)}function Hd(a,i,u){var d=a.queue;if(d===null)throw Error(g(311));d.lastRenderedReducer=u;var p=a.baseQueue,y=d.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}i.baseQueue=p=y,d.pending=null}if(y=a.baseState,p===null)a.memoizedState=y;else{i=p.next;var B=S=null,D=null,U=i,le=!1;do{var fe=U.lane&-536870913;if(fe!==U.lane?(Fe&fe)===fe:(hs&fe)===fe){var K=U.revertLane;if(K===0)D!==null&&(D=D.next={lane:0,revertLane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),fe===ms&&(le=!0);else if((hs&K)===K){U=U.next,K===ms&&(le=!0);continue}else fe={lane:0,revertLane:U.revertLane,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},D===null?(B=D=fe,S=y):D=D.next=fe,ze.lanes|=K,ho|=K;fe=U.action,ri&&u(y,fe),y=U.hasEagerState?U.eagerState:u(y,fe)}else K={lane:fe,revertLane:U.revertLane,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},D===null?(B=D=K,S=y):D=D.next=K,ze.lanes|=fe,ho|=fe;U=U.next}while(U!==null&&U!==i);if(D===null?S=y:D.next=B,!Cn(y,a.memoizedState)&&(Tt=!0,le&&(u=ci,u!==null)))throw u;a.memoizedState=y,a.baseState=S,a.baseQueue=D,d.lastRenderedState=y}return p===null&&(d.lanes=0),[a.memoizedState,d.dispatch]}function Jl(a){var i=Ht(),u=i.queue;if(u===null)throw Error(g(311));u.lastRenderedReducer=a;var d=u.dispatch,p=u.pending,y=i.memoizedState;if(p!==null){u.pending=null;var S=p=p.next;do y=a(y,S.action),S=S.next;while(S!==p);Cn(y,i.memoizedState)||(Tt=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),u.lastRenderedState=y}return[y,d]}function Ud(a,i,u){var d=ze,p=Ht(),y=Pe;if(y){if(u===void 0)throw Error(g(407));u=u()}else u=i();var S=!Cn((st||p).memoizedState,u);if(S&&(p.memoizedState=u,Tt=!0),p=p.queue,Nl(Ic.bind(null,d,p,a),[a]),p.getSnapshot!==i||S||_t!==null&&_t.memoizedState.tag&1){if(d.flags|=2048,Sa(9,Vd.bind(null,d,p,u,i),{destroy:void 0},null),ct===null)throw Error(g(349));y||hs&60||Sx(d,i,u)}return u}function Sx(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=ze.updateQueue,i===null?(i=Ru(),ze.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function Vd(a,i,u,d){i.value=u,i.getSnapshot=d,xs(i)&&ja(a)}function Ic(a,i,u){return u(function(){xs(i)&&ja(a)})}function xs(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!Cn(a,u)}catch{return!0}}function ja(a){var i=pa(a,2);i!==null&&Pt(i,a,2)}function $c(a){var i=Bn();if(typeof a=="function"){var u=a;if(a=u(),ri){Fa(!0);try{u()}finally{Fa(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:a},i}function qd(a,i,u,d){return a.baseState=u,Hd(a,st,typeof d=="function"?d:Ea)}function Kc(a,i,u,d,p){if(Kd(a))throw Error(g(485));if(a=i.action,a!==null){var y={payload:p,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};J.T!==null?u(!0):y.isTransition=!1,d(y),u=i.pending,u===null?(y.next=i.pending=y,Jc(i,y)):(y.next=u.next,i.pending=u.next=y)}}function Jc(a,i){var u=i.action,d=i.payload,p=a.state;if(i.isTransition){var y=J.T,S={};J.T=S;try{var B=u(p,d),D=J.S;D!==null&&D(S,B),so(a,i,B)}catch(U){Su(a,i,U)}finally{J.T=y}}else try{y=u(p,d),so(a,i,y)}catch(U){Su(a,i,U)}}function so(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(d){gt(a,i,d)},function(d){return Su(a,i,d)}):gt(a,i,u)}function gt(a,i,u){i.status="fulfilled",i.value=u,lp(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,Jc(a,u)))}function Su(a,i,u){var d=a.pending;if(a.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=u,lp(i),i=i.next;while(i!==d)}a.action=null}function lp(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function Gd(a,i){return i}function Yd(a,i){if(Pe){var u=ct.formState;if(u!==null){e:{var d=ze;if(Pe){if($t){t:{for(var p=$t,y=Il;p.nodeType!==8;){if(!y){p=null;break t}if(p=rn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){$t=rn(p.nextSibling),d=p.data==="F!";break e}}eo(d)}d=!1}d&&(i=u[0])}}return u=Bn(),u.memoizedState=u.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gd,lastRenderedState:i},u.queue=d,u=$d.bind(null,ze,d),d.dispatch=u,d=$c(!1),y=pp.bind(null,ze,!1,d.queue),d=Bn(),p={state:i,dispatch:null,action:a,pending:null},d.queue=p,u=Kc.bind(null,ze,p,y,u),p.dispatch=u,d.memoizedState=a,[i,u,!1]}function gs(a){var i=Ht();return ys(i,st,a)}function ys(a,i,u){i=Hd(a,i,Gd)[0],a=ju(Ea)[0],i=typeof i=="object"&&i!==null&&typeof i.then=="function"?mi(i):i;var d=Ht(),p=d.queue,y=p.dispatch;return u!==d.memoizedState&&(ze.flags|=2048,Sa(9,Wc.bind(null,p,u),{destroy:void 0},null)),[i,y,a]}function Wc(a,i){a.action=i}function Fc(a){var i=Ht(),u=st;if(u!==null)return ys(i,u,a);Ht(),i=i.memoizedState,u=Ht();var d=u.queue.dispatch;return u.memoizedState=a,[i,d,!1]}function Sa(a,i,u,d){return a={tag:a,create:i,inst:u,deps:d,next:null},i=ze.updateQueue,i===null&&(i=Ru(),ze.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=a.next=a:(d=u.next,u.next=a,a.next=d,i.lastEffect=a),a}function Au(){return Ht().memoizedState}function Pc(a,i,u,d){var p=Bn();ze.flags|=a,p.memoizedState=Sa(1|i,u,{destroy:void 0},d===void 0?null:d)}function Xd(a,i,u,d){var p=Ht();d=d===void 0?null:d;var y=p.memoizedState.inst;st!==null&&d!==null&&Nd(d,st.memoizedState.deps)?p.memoizedState=Sa(i,u,y,d):(ze.flags|=a,p.memoizedState=Sa(1|i,u,y,d))}function ap(a,i){Pc(8390656,8,a,i)}function Nl(a,i){Xd(2048,8,a,i)}function sp(a,i){return Xd(4,2,a,i)}function Qd(a,i){return Xd(4,4,a,i)}function Cu(a,i){if(typeof i=="function"){a=a();var u=i(a);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function pi(a,i,u){u=u!=null?u.concat([a]):null,Xd(4,4,Cu.bind(null,i,a),u)}function Zd(){}function Id(a,i){var u=Ht();i=i===void 0?null:i;var d=u.memoizedState;return i!==null&&Nd(i,d[1])?d[0]:(u.memoizedState=[a,i],a)}function op(a,i){var u=Ht();i=i===void 0?null:i;var d=u.memoizedState;if(i!==null&&Nd(i,d[1]))return d[0];if(d=a(),ri){Fa(!0);try{a()}finally{Fa(!1)}}return u.memoizedState=[d,i],d}function ip(a,i,u){return u===void 0||hs&1073741824?a.memoizedState=i:(a.memoizedState=u,a=Ti(),ze.lanes|=a,ho|=a,u)}function Ax(a,i,u,d){return Cn(u,i)?u:rs.current!==null?(a=ip(a,u,d),Cn(a,i)||(Tt=!0),a):hs&42?(a=Ti(),ze.lanes|=a,ho|=a,i):(Tt=!0,a.memoizedState=u)}function up(a,i,u,d,p){var y=Ne.p;Ne.p=y!==0&&8>y?y:8;var S=J.T,B={};J.T=B,pp(a,!1,i,u);try{var D=p(),U=J.S;if(U!==null&&U(B,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var le=Pm(D,d);oo(a,i,le,wn(a))}else oo(a,i,d,wn(a))}catch(fe){oo(a,i,{then:function(){},status:"rejected",reason:fe},wn())}finally{Ne.p=y,J.T=S}}function Zg(){}function bs(a,i,u,d){if(a.tag!==5)throw Error(g(476));var p=Pn(a).queue;up(a,p,i,Dt,u===null?Zg:function(){return cp(a),u(d)})}function Pn(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:Dt,baseState:Dt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:Dt},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function cp(a){var i=Pn(a).next.queue;oo(a,i,{},wn())}function rp(){return bn(ll)}function dp(){return Ht().memoizedState}function fp(){return Ht().memoizedState}function Cx(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=wn();a=Ss(u);var d=As(i,a,u);d!==null&&(Pt(d,i,u),_u(d,i,u)),i={cache:Fm()},a.payload=i;return}i=i.return}}function mp(a,i,u){var d=wn();u={lane:d,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},Kd(a)?hp(i,u):(u=Lc(a,i,u,d),u!==null&&(Pt(u,a,d),xp(u,i,d)))}function $d(a,i,u){var d=wn();oo(a,i,u,d)}function oo(a,i,u,d){var p={lane:d,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(Kd(a))hp(i,p);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var S=i.lastRenderedState,B=y(S,u);if(p.hasEagerState=!0,p.eagerState=B,Cn(B,S))return ru(a,i,p,0),ct===null&&Td(),!1}catch{}finally{}if(u=Lc(a,i,p,d),u!==null)return Pt(u,a,d),xp(u,i,d),!0}return!1}function pp(a,i,u,d){if(d={lane:2,revertLane:Zu(),action:d,hasEagerState:!1,eagerState:null,next:null},Kd(a)){if(i)throw Error(g(479))}else i=Lc(a,u,d,2),i!==null&&Pt(i,a,2)}function Kd(a){var i=a.alternate;return a===ze||i!==null&&i===ze}function hp(a,i){ao=bu=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function xp(a,i,u){if(u&4194176){var d=i.lanes;d&=a.pendingLanes,u|=d,i.lanes=u,gm(a,u)}}var an={readContext:bn,use:Eu,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt};an.useCacheRefresh=Nt,an.useMemoCache=Nt,an.useHostTransitionStatus=Nt,an.useFormState=Nt,an.useActionState=Nt,an.useOptimistic=Nt;var io={readContext:bn,use:Eu,useCallback:function(a,i){return Bn().memoizedState=[a,i===void 0?null:i],a},useContext:bn,useEffect:ap,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,Pc(4194308,4,Cu.bind(null,i,a),u)},useLayoutEffect:function(a,i){return Pc(4194308,4,a,i)},useInsertionEffect:function(a,i){Pc(4,2,a,i)},useMemo:function(a,i){var u=Bn();i=i===void 0?null:i;var d=a();if(ri){Fa(!0);try{a()}finally{Fa(!1)}}return u.memoizedState=[d,i],d},useReducer:function(a,i,u){var d=Bn();if(u!==void 0){var p=u(i);if(ri){Fa(!0);try{u(i)}finally{Fa(!1)}}}else p=i;return d.memoizedState=d.baseState=p,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:p},d.queue=a,a=a.dispatch=mp.bind(null,ze,a),[d.memoizedState,a]},useRef:function(a){var i=Bn();return a={current:a},i.memoizedState=a},useState:function(a){a=$c(a);var i=a.queue,u=$d.bind(null,ze,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:Zd,useDeferredValue:function(a,i){var u=Bn();return ip(u,a,i)},useTransition:function(){var a=$c(!1);return a=up.bind(null,ze,a.queue,!0,!1),Bn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var d=ze,p=Bn();if(Pe){if(u===void 0)throw Error(g(407));u=u()}else{if(u=i(),ct===null)throw Error(g(349));Fe&60||Sx(d,i,u)}p.memoizedState=u;var y={value:u,getSnapshot:i};return p.queue=y,ap(Ic.bind(null,d,y,a),[a]),d.flags|=2048,Sa(9,Vd.bind(null,d,y,u,i),{destroy:void 0},null),u},useId:function(){var a=Bn(),i=ct.identifierPrefix;if(Pe){var u=ya,d=ga;u=(d&~(1<<32-In(d)-1)).toString(32)+u,i=":"+i+"R"+u,u=qt++,0<u&&(i+="H"+u.toString(32)),i+=":"}else u=Ex++,i=":"+i+"r"+u.toString(32)+":";return a.memoizedState=i},useCacheRefresh:function(){return Bn().memoizedState=Cx.bind(null,ze)}};io.useMemoCache=Ld,io.useHostTransitionStatus=rp,io.useFormState=Yd,io.useActionState=Yd,io.useOptimistic=function(a){var i=Bn();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=pp.bind(null,ze,!0,u),u.dispatch=i,[a,i]};var vs={readContext:bn,use:Eu,useCallback:Id,useContext:bn,useEffect:Nl,useImperativeHandle:pi,useInsertionEffect:sp,useLayoutEffect:Qd,useMemo:op,useReducer:ju,useRef:Au,useState:function(){return ju(Ea)},useDebugValue:Zd,useDeferredValue:function(a,i){var u=Ht();return Ax(u,st.memoizedState,a,i)},useTransition:function(){var a=ju(Ea)[0],i=Ht().memoizedState;return[typeof a=="boolean"?a:mi(a),i]},useSyncExternalStore:Ud,useId:dp};vs.useCacheRefresh=fp,vs.useMemoCache=Ld,vs.useHostTransitionStatus=rp,vs.useFormState=gs,vs.useActionState=gs,vs.useOptimistic=function(a,i){var u=Ht();return qd(u,st,a,i)};var hi={readContext:bn,use:Eu,useCallback:Id,useContext:bn,useEffect:Nl,useImperativeHandle:pi,useInsertionEffect:sp,useLayoutEffect:Qd,useMemo:op,useReducer:Jl,useRef:Au,useState:function(){return Jl(Ea)},useDebugValue:Zd,useDeferredValue:function(a,i){var u=Ht();return st===null?ip(u,a,i):Ax(u,st.memoizedState,a,i)},useTransition:function(){var a=Jl(Ea)[0],i=Ht().memoizedState;return[typeof a=="boolean"?a:mi(a),i]},useSyncExternalStore:Ud,useId:dp};hi.useCacheRefresh=fp,hi.useMemoCache=Ld,hi.useHostTransitionStatus=rp,hi.useFormState=Fc,hi.useActionState=Fc,hi.useOptimistic=function(a,i){var u=Ht();return st!==null?qd(u,st,a,i):(u.baseState=a,[a,u.queue.dispatch])};function er(a,i,u,d){i=a.memoizedState,u=u(d,i),u=u==null?i:xe({},i,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var gp={isMounted:function(a){return(a=a._reactInternals)?re(a)===a:!1},enqueueSetState:function(a,i,u){a=a._reactInternals;var d=wn(),p=Ss(d);p.payload=i,u!=null&&(p.callback=u),i=As(a,p,d),i!==null&&(Pt(i,a,d),_u(i,a,d))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var d=wn(),p=Ss(d);p.tag=1,p.payload=i,u!=null&&(p.callback=u),i=As(a,p,d),i!==null&&(Pt(i,a,d),_u(i,a,d))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=wn(),d=Ss(u);d.tag=2,i!=null&&(d.callback=i),i=As(a,d,u),i!==null&&(Pt(i,a,u),_u(i,a,u))}};function fl(a,i,u,d,p,y,S){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(d,y,S):i.prototype&&i.prototype.isPureReactComponent?!os(u,d)||!os(p,y):!0}function yp(a,i,u,d){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,d),i.state!==a&&gp.enqueueReplaceState(i,i.state,null)}function sn(a,i){var u=i;if("ref"in i){u={};for(var d in i)d!=="ref"&&(u[d]=i[d])}if(a=a.defaultProps){u===i&&(u=xe({},u));for(var p in a)u[p]===void 0&&(u[p]=a[p])}return u}var tr=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function Tx(a){tr(a)}function Wl(a){console.error(a)}function bp(a){tr(a)}function Rs(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function vp(a,i,u){try{var d=a.onCaughtError;d(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Fl(a,i,u){return u=Ss(u),u.tag=3,u.payload={element:null},u.callback=function(){Rs(a,i)},u}function Jd(a){return a=Ss(a),a.tag=3,a}function Wd(a,i,u,d){var p=u.type.getDerivedStateFromError;if(typeof p=="function"){var y=d.value;a.payload=function(){return p(y)},a.callback=function(){vp(i,u,d)}}var S=u.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(a.callback=function(){vp(i,u,d),typeof p!="function"&&(Ds===null?Ds=new Set([this]):Ds.add(this));var B=d.stack;this.componentDidCatch(d.value,{componentStack:B!==null?B:""})})}function uo(a,i,u,d,p){if(u.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=u.alternate,i!==null&&ft(i,u,p,!0),u=dl.current,u!==null){switch(u.tag){case 13:return $l===null?Rf():u.alternate===null&&At===0&&(At=3),u.flags&=-257,u.flags|=65536,u.lanes=p,d===Bd?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([d]):i.add(d),Yp(a,d,p)),!1;case 22:return u.flags|=65536,d===Bd?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([d]):u.add(d)),Yp(a,d,p)),!1}throw Error(g(435,u.tag))}return Yp(a,d,p),Rf(),!1}if(Pe)return i=dl.current,i!==null?(!(i.flags&65536)&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==Qm&&(a=Error(g(422),{cause:d}),mu(ln(a,u)))):(d!==Qm&&(i=Error(g(423),{cause:d}),mu(ln(i,u))),a=a.current.alternate,a.flags|=65536,p&=-p,a.lanes|=p,d=ln(d,u),p=Fl(a.stateNode,d,p),ir(a,p),At!==4&&(At=2)),!1;var y=Error(g(520),{cause:d});if(y=ln(y,u),mr===null?mr=[y]:mr.push(y),At!==4&&(At=2),i===null)return!0;d=ln(d,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=p&-p,u.lanes|=a,a=Fl(u.stateNode,d,a),ir(u,a),!1;case 1:if(i=u.type,y=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ds===null||!Ds.has(y))))return u.flags|=65536,p&=-p,u.lanes|=p,p=Jd(p),Wd(p,a,u,d),ir(u,p),!1}u=u.return}while(u!==null);return!1}var Rp=Error(g(461)),Tt=!1;function on(a,i,u,d){i.child=a===null?Dd(i,null,u,d):va(i,a.child,u,d)}function Tu(a,i,u,d,p){u=u.render;var y=i.ref;if("ref"in d){var S={};for(var B in d)B!=="ref"&&(S[B]=d[B])}else S=d;return js(i),d=fi(a,i,u,S,y,p),B=zd(),a!==null&&!Tt?(Qc(a,i,p),Ta(a,i,p)):(Pe&&B&&kd(i),i.flags|=1,on(a,i,d,p),i.child)}function xi(a,i,u,d,p){if(a===null){var y=u.type;return typeof y=="function"&&!pf(y)&&y.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=y,Ep(a,i,y,d,p)):(a=Lu(u.type,null,d,i,i.mode,p),a.ref=i.ref,a.return=i,i.child=a)}if(y=a.child,!Mu(a,p)){var S=y.memoizedProps;if(u=u.compare,u=u!==null?u:os,u(S,d)&&a.ref===i.ref)return Ta(a,i,p)}return i.flags|=1,a=na(y,d),a.ref=i.ref,a.return=i,i.child=a}function Ep(a,i,u,d,p){if(a!==null){var y=a.memoizedProps;if(os(y,d)&&a.ref===i.ref)if(Tt=!1,i.pendingProps=d=y,Mu(a,p))a.flags&131072&&(Tt=!0);else return i.lanes=a.lanes,Ta(a,i,p)}return wu(a,i,u,d,p)}function jp(a,i,u){var d=i.pendingProps,p=d.children,y=(i.stateNode._pendingVisibility&2)!==0,S=a!==null?a.memoizedState:null;if(Bu(a,i),d.mode==="hidden"||y){if(i.flags&128){if(d=S!==null?S.baseLanes|u:u,a!==null){for(p=i.child=a.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;i.childLanes=y&~d}else i.childLanes=0,i.child=null;return ku(a,i,d,u)}if(u&536870912)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&Xc(i,S!==null?S.cachePool:null),S!==null?$m(i,S):Md(),Km(i);else return i.lanes=i.childLanes=536870912,ku(a,i,S!==null?S.baseLanes|u:u,u)}else S!==null?(Xc(i,S.cachePool),$m(i,S),ds(),i.memoizedState=null):(a!==null&&Xc(i,null),Md(),ds());return on(a,i,p,u),i.child}function ku(a,i,u,d){var p=ps();return p=p===null?null:{parent:Jt._currentValue,pool:p},i.memoizedState={baseLanes:u,cachePool:p},a!==null&&Xc(i,null),Md(),Km(i),a!==null&&ft(a,i,d,!0),null}function Bu(a,i){var u=i.ref;if(u===null)a!==null&&a.ref!==null&&(i.flags|=2097664);else{if(typeof u!="function"&&typeof u!="object")throw Error(g(284));(a===null||a.ref!==u)&&(i.flags|=2097664)}}function wu(a,i,u,d,p){return js(i),u=fi(a,i,u,d,void 0,p),d=zd(),a!==null&&!Tt?(Qc(a,i,p),Ta(a,i,p)):(Pe&&d&&kd(i),i.flags|=1,on(a,i,u,p),i.child)}function Sp(a,i,u,d,p,y){return js(i),i.updateQueue=null,u=np(i,d,u,p),Od(a),d=zd(),a!==null&&!Tt?(Qc(a,i,y),Ta(a,i,y)):(Pe&&d&&kd(i),i.flags|=1,on(a,i,u,y),i.child)}function Ap(a,i,u,d,p){if(js(i),i.stateNode===null){var y=ha,S=u.contextType;typeof S=="object"&&S!==null&&(y=bn(S)),y=new u(d,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=gp,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=d,y.state=i.memoizedState,y.refs={},or(i),S=u.contextType,y.context=typeof S=="object"&&S!==null?bn(S):ha,y.state=i.memoizedState,S=u.getDerivedStateFromProps,typeof S=="function"&&(er(i,u,S,d),y.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&gp.enqueueReplaceState(y,y.state,null),cr(i,d,y,p),Nu(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(a===null){y=i.stateNode;var B=i.memoizedProps,D=sn(u,B);y.props=D;var U=y.context,le=u.contextType;S=ha,typeof le=="object"&&le!==null&&(S=bn(le));var fe=u.getDerivedStateFromProps;le=typeof fe=="function"||typeof y.getSnapshotBeforeUpdate=="function",B=i.pendingProps!==B,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(B||U!==S)&&yp(i,y,d,S),ml=!1;var K=i.memoizedState;y.state=K,cr(i,d,y,p),Nu(),U=i.memoizedState,B||K!==U||ml?(typeof fe=="function"&&(er(i,u,fe,d),U=i.memoizedState),(D=ml||fl(i,u,D,d,K,U,S))?(le||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=U),y.props=d,y.state=U,y.context=S,d=D):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{y=i.stateNode,ro(a,i),S=i.memoizedProps,le=sn(u,S),y.props=le,fe=i.pendingProps,K=y.context,U=u.contextType,D=ha,typeof U=="object"&&U!==null&&(D=bn(U)),B=u.getDerivedStateFromProps,(U=typeof B=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==fe||K!==D)&&yp(i,y,d,D),ml=!1,K=i.memoizedState,y.state=K,cr(i,d,y,p),Nu();var ee=i.memoizedState;S!==fe||K!==ee||ml||a!==null&&a.dependencies!==null&&sr(a.dependencies)?(typeof B=="function"&&(er(i,u,B,d),ee=i.memoizedState),(le=ml||fl(i,u,le,d,K,ee,D)||a!==null&&a.dependencies!==null&&sr(a.dependencies))?(U||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,ee,D),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,ee,D)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===a.memoizedProps&&K===a.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===a.memoizedProps&&K===a.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ee),y.props=d,y.state=ee,y.context=D,d=le):(typeof y.componentDidUpdate!="function"||S===a.memoizedProps&&K===a.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===a.memoizedProps&&K===a.memoizedState||(i.flags|=1024),d=!1)}return y=d,Bu(a,i),d=(i.flags&128)!==0,y||d?(y=i.stateNode,u=d&&typeof u.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,a!==null&&d?(i.child=va(i,a.child,null,p),i.child=va(i,null,u,p)):on(a,i,u,p),i.memoizedState=y.state,a=i.child):a=Ta(a,i,p),a}function kx(a,i,u,d){return fu(),i.flags|=256,on(a,i,u,d),i.child}var nr={dehydrated:null,treeContext:null,retryLane:0};function Aa(a){return{baseLanes:a,cachePool:tp()}}function Fd(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=zl),a}function Pd(a,i,u){var d=i.pendingProps,p=!1,y=(i.flags&128)!==0,S;if((S=y)||(S=a!==null&&a.memoizedState===null?!1:(Vt.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,a===null){if(Pe){if(p?Ra(i):ds(),Pe){var B=$t,D;if(D=B){e:{for(D=B,B=Il;D.nodeType!==8;){if(!B){B=null;break e}if(D=rn(D.nextSibling),D===null){B=null;break e}}B=D}B!==null?(i.memoizedState={dehydrated:B,treeContext:xa!==null?{id:ga,overflow:ya}:null,retryLane:536870912},D=Ft(18,null,null,0),D.stateNode=B,D.return=i,i.child=D,yn=i,$t=null,D=!0):D=!1}D||eo(i)}if(B=i.memoizedState,B!==null&&(B=B.dehydrated,B!==null))return B.data==="$!"?i.lanes=16:i.lanes=536870912,null;Kl(i)}return B=d.children,d=d.fallback,p?(ds(),p=i.mode,B=Es({mode:"hidden",children:B},p),d=kt(d,p,u,null),B.return=i,d.return=i,B.sibling=d,i.child=B,p=i.child,p.memoizedState=Aa(u),p.childLanes=Fd(a,S,u),i.memoizedState=nr,d):(Ra(i),Du(i,B))}if(D=a.memoizedState,D!==null&&(B=D.dehydrated,B!==null)){if(y)i.flags&256?(Ra(i),i.flags&=-257,i=ef(a,i,u)):i.memoizedState!==null?(ds(),i.child=a.child,i.flags|=128,i=null):(ds(),p=d.fallback,B=i.mode,d=Es({mode:"visible",children:d.children},B),p=kt(p,B,u,null),p.flags|=2,d.return=i,p.return=i,d.sibling=p,i.child=d,va(i,a.child,null,u),d=i.child,d.memoizedState=Aa(u),d.childLanes=Fd(a,S,u),i.memoizedState=nr,i=p);else if(Ra(i),B.data==="$!"){if(S=B.nextSibling&&B.nextSibling.dataset,S)var U=S.dgst;S=U,d=Error(g(419)),d.stack="",d.digest=S,mu({value:d,source:null,stack:null}),i=ef(a,i,u)}else if(Tt||ft(a,i,u,!1),S=(u&a.childLanes)!==0,Tt||S){if(S=ct,S!==null){if(d=u&-u,d&42)d=1;else switch(d){case 2:d=1;break;case 8:d=4;break;case 32:d=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:d=64;break;case 268435456:d=134217728;break;default:d=0}if(d=d&(S.suspendedLanes|u)?0:d,d!==0&&d!==D.retryLane)throw D.retryLane=d,pa(a,d),Pt(S,a,d),Rp}B.data==="$?"||Rf(),i=ef(a,i,u)}else B.data==="$?"?(i.flags|=128,i.child=a.child,i=Jg.bind(null,a),B._reactRetry=i,i=null):(a=D.treeContext,$t=rn(B.nextSibling),yn=i,Pe=!0,_l=null,Il=!1,a!==null&&(kn[Fn++]=ga,kn[Fn++]=ya,kn[Fn++]=xa,ga=a.id,ya=a.overflow,xa=i),i=Du(i,d.children),i.flags|=4096);return i}return p?(ds(),p=d.fallback,B=i.mode,D=a.child,U=D.sibling,d=na(D,{mode:"hidden",children:d.children}),d.subtreeFlags=D.subtreeFlags&31457280,U!==null?p=na(U,p):(p=kt(p,B,u,null),p.flags|=2),p.return=i,d.return=i,d.sibling=p,i.child=d,d=p,p=i.child,B=a.child.memoizedState,B===null?B=Aa(u):(D=B.cachePool,D!==null?(U=Jt._currentValue,D=D.parent!==U?{parent:U,pool:U}:D):D=tp(),B={baseLanes:B.baseLanes|u,cachePool:D}),p.memoizedState=B,p.childLanes=Fd(a,S,u),i.memoizedState=nr,d):(Ra(i),u=a.child,a=u.sibling,u=na(u,{mode:"visible",children:d.children}),u.return=i,u.sibling=null,a!==null&&(S=i.deletions,S===null?(i.deletions=[a],i.flags|=16):S.push(a)),i.child=u,i.memoizedState=null,u)}function Du(a,i){return i=Es({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function Es(a,i){return zx(a,i,0,null)}function ef(a,i,u){return va(i,a.child,null,u),a=Du(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function tf(a,i,u){a.lanes|=i;var d=a.alternate;d!==null&&(d.lanes|=i),Hn(a.return,i,u)}function lr(a,i,u,d,p){var y=a.memoizedState;y===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:u,tailMode:p}:(y.isBackwards=i,y.rendering=null,y.renderingStartTime=0,y.last=d,y.tail=u,y.tailMode=p)}function Ca(a,i,u){var d=i.pendingProps,p=d.revealOrder,y=d.tail;if(on(a,i,d.children,u),d=Vt.current,d&2)d=d&1|2,i.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&tf(a,u,i);else if(a.tag===19)tf(a,u,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}d&=1}switch(dt(Vt,d),p){case"forwards":for(u=i.child,p=null;u!==null;)a=u.alternate,a!==null&&Gc(a)===null&&(p=u),u=u.sibling;u=p,u===null?(p=i.child,i.child=null):(p=u.sibling,u.sibling=null),lr(i,!1,p,u,y);break;case"backwards":for(u=null,p=i.child,i.child=null;p!==null;){if(a=p.alternate,a!==null&&Gc(a)===null){i.child=p;break}a=p.sibling,p.sibling=u,u=p,p=a}lr(i,!0,u,null,y);break;case"together":lr(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Ta(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),ho|=i.lanes,!(u&i.childLanes))if(a!==null){if(ft(a,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(g(153));if(i.child!==null){for(a=i.child,u=na(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=na(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function Mu(a,i){return a.lanes&i?!0:(a=a.dependencies,!!(a!==null&&sr(a)))}function ar(a,i,u){switch(i.tag){case 3:Pr(i,i.stateNode.containerInfo),co(i,Jt,a.memoizedState.cache),fu();break;case 27:case 5:mt(i);break;case 4:Pr(i,i.stateNode.containerInfo);break;case 10:co(i,i.type,i.memoizedProps.value);break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Ra(i),i.flags|=128,null):u&i.child.childLanes?Pd(a,i,u):(Ra(i),a=Ta(a,i,u),a!==null?a.sibling:null);Ra(i);break;case 19:var p=(a.flags&128)!==0;if(d=(u&i.childLanes)!==0,d||(ft(a,i,u,!1),d=(u&i.childLanes)!==0),p){if(d)return Ca(a,i,u);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),dt(Vt,Vt.current),d)break;return null;case 22:case 23:return i.lanes=0,jp(a,i,u);case 24:co(i,Jt,a.memoizedState.cache)}return Ta(a,i,u)}function yt(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)Tt=!0;else{if(!Mu(a,u)&&!(i.flags&128))return Tt=!1,ar(a,i,u);Tt=!!(a.flags&131072)}else Tt=!1,Pe&&i.flags&1048576&&Xm(i,du,i.index);switch(i.lanes=0,i.tag){case 16:e:{a=i.pendingProps;var d=i.elementType,p=d._init;if(d=p(d._payload),i.type=d,typeof d=="function")pf(d)?(a=sn(d,a),i.tag=1,i=Ap(null,i,d,a,u)):(i.tag=0,i=wu(null,i,d,a,u));else{if(d!=null){if(p=d.$$typeof,p===q){i.tag=11,i=Tu(null,i,d,a,u);break e}else if(p===he){i.tag=14,i=xi(null,i,d,a,u);break e}}throw i=Me(d)||d,Error(g(306,i,""))}}return i;case 0:return wu(a,i,i.type,i.pendingProps,u);case 1:return d=i.type,p=sn(d,i.pendingProps),Ap(a,i,d,p,u);case 3:e:{if(Pr(i,i.stateNode.containerInfo),a===null)throw Error(g(387));var y=i.pendingProps;p=i.memoizedState,d=p.element,ro(a,i),cr(i,y,null,u);var S=i.memoizedState;if(y=S.cache,co(i,Jt,y),y!==p.cache&&nf(i,[Jt],u,!0),Nu(),y=S.element,p.isDehydrated)if(p={element:y,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=p,i.memoizedState=p,i.flags&256){i=kx(a,i,y,u);break e}else if(y!==d){d=ln(Error(g(424)),i),mu(d),i=kx(a,i,y,u);break e}else for($t=rn(i.stateNode.containerInfo.firstChild),yn=i,Pe=!0,_l=null,Il=!0,u=Dd(i,null,y,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(fu(),y===d){i=Ta(a,i,u);break e}on(a,i,y,u)}i=i.child}return i;case 26:return Bu(a,i),a===null?(u=Se(i.type,null,i.pendingProps,null))?i.memoizedState=u:Pe||(u=i.type,a=i.pendingProps,d=Rr(ca.current).createElement(u),d[pn]=i,d[$n]=a,cn(d,u,a),It(d),i.stateNode=d):i.memoizedState=Se(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return mt(i),a===null&&Pe&&(d=i.stateNode=Ha(i.type,i.pendingProps,ca.current),yn=i,Il=!0,$t=rn(d.firstChild)),d=i.pendingProps.children,a!==null||Pe?on(a,i,d,u):i.child=va(i,null,d,u),Bu(a,i),i.child;case 5:return a===null&&Pe&&((p=d=$t)&&(d=jo(d,i.type,i.pendingProps,Il),d!==null?(i.stateNode=d,yn=i,$t=rn(d.firstChild),Il=!1,p=!0):p=!1),p||eo(i)),mt(i),p=i.type,y=i.pendingProps,S=a!==null?a.memoizedProps:null,d=y.children,Er(p,y)?d=null:S!==null&&Er(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=fi(a,i,jx,null,null,u),ll._currentValue=p),Bu(a,i),on(a,i,d,u),i.child;case 6:return a===null&&Pe&&((a=u=$t)&&(u=Ar(u,i.pendingProps,Il),u!==null?(i.stateNode=u,yn=i,$t=null,a=!0):a=!1),a||eo(i)),null;case 13:return Pd(a,i,u);case 4:return Pr(i,i.stateNode.containerInfo),d=i.pendingProps,a===null?i.child=va(i,null,d,u):on(a,i,d,u),i.child;case 11:return Tu(a,i,i.type,i.pendingProps,u);case 7:return on(a,i,i.pendingProps,u),i.child;case 8:return on(a,i,i.pendingProps.children,u),i.child;case 12:return on(a,i,i.pendingProps.children,u),i.child;case 10:return d=i.pendingProps,co(i,i.type,d.value),on(a,i,d.children,u),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,js(i),p=bn(p),d=d(p),i.flags|=1,on(a,i,d,u),i.child;case 14:return xi(a,i,i.type,i.pendingProps,u);case 15:return Ep(a,i,i.type,i.pendingProps,u);case 19:return Ca(a,i,u);case 22:return jp(a,i,u);case 24:return js(i),d=bn(Jt),a===null?(p=ps(),p===null&&(p=ct,y=Fm(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=u),p=y),i.memoizedState={parent:d,cache:p},or(i),co(i,Jt,p)):(a.lanes&u&&(ro(a,i),cr(i,null,null,u),Nu()),p=a.memoizedState,y=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),co(i,Jt,d)):(d=y.cache,co(i,Jt,d),d!==p.cache&&nf(i,[Jt],u,!0))),on(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(g(156,i.tag))}var Cp=sl(null),gi=null,ka=null;function co(a,i,u){dt(Cp,i._currentValue),i._currentValue=u}function Ba(a){a._currentValue=Cp.current,zt(Cp)}function Hn(a,i,u){for(;a!==null;){var d=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),a===u)break;a=a.return}}function nf(a,i,u,d){var p=a.child;for(p!==null&&(p.return=a);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var B=y;y=p;for(var D=0;D<i.length;D++)if(B.context===i[D]){y.lanes|=u,B=y.alternate,B!==null&&(B.lanes|=u),Hn(y.return,u,a),d||(S=null);break e}y=B.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(g(341));S.lanes|=u,y=S.alternate,y!==null&&(y.lanes|=u),Hn(S,u,a),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===a){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function ft(a,i,u,d){a=null;for(var p=i,y=!1;p!==null;){if(!y){if(p.flags&524288)y=!0;else if(p.flags&262144)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(g(387));if(S=S.memoizedProps,S!==null){var B=p.type;Cn(p.pendingProps.value,S.value)||(a!==null?a.push(B):a=[B])}}else if(p===Lo.current){if(S=p.alternate,S===null)throw Error(g(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(a!==null?a.push(ll):a=[ll])}p=p.return}a!==null&&nf(i,a,u,d),i.flags|=262144}function sr(a){for(a=a.firstContext;a!==null;){if(!Cn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function js(a){gi=a,ka=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function bn(a){return wa(gi,a)}function lf(a,i){return gi===null&&js(a),wa(a,i)}function wa(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},ka===null){if(a===null)throw Error(g(308));ka=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else ka=ka.next=i;return u}var ml=!1;function or(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ro(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ss(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function As(a,i,u){var d=a.updateQueue;if(d===null)return null;if(d=d.shared,St&2){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=tt(a),Ln(a,null,u),i}return ru(a,d,i,u),tt(a)}function _u(a,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194176)!==0)){var d=i.lanes;d&=a.pendingLanes,u|=d,i.lanes=u,gm(a,u)}}function ir(a,i){var u=a.updateQueue,d=a.alternate;if(d!==null&&(d=d.updateQueue,u===d)){var p=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var S={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,u=u.next}while(u!==null);y===null?p=y=i:y=y.next=i}else p=y=i;u={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=i:a.next=i,u.lastBaseUpdate=i}var ur=!1;function Nu(){if(ur){var a=ci;if(a!==null)throw a}}function cr(a,i,u,d){ur=!1;var p=a.updateQueue;ml=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,B=p.shared.pending;if(B!==null){p.shared.pending=null;var D=B,U=D.next;D.next=null,S===null?y=U:S.next=U,S=D;var le=a.alternate;le!==null&&(le=le.updateQueue,B=le.lastBaseUpdate,B!==S&&(B===null?le.firstBaseUpdate=U:B.next=U,le.lastBaseUpdate=D))}if(y!==null){var fe=p.baseState;S=0,le=U=D=null,B=y;do{var K=B.lane&-536870913,ee=K!==B.lane;if(ee?(Fe&K)===K:(d&K)===K){K!==0&&K===ms&&(ur=!0),le!==null&&(le=le.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var Ce=a,_e=B;K=i;var bt=u;switch(_e.tag){case 1:if(Ce=_e.payload,typeof Ce=="function"){fe=Ce.call(bt,fe,K);break e}fe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=_e.payload,K=typeof Ce=="function"?Ce.call(bt,fe,K):Ce,K==null)break e;fe=xe({},fe,K);break e;case 2:ml=!0}}K=B.callback,K!==null&&(a.flags|=64,ee&&(a.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[K]:ee.push(K))}else ee={lane:K,tag:B.tag,payload:B.payload,callback:B.callback,next:null},le===null?(U=le=ee,D=fe):le=le.next=ee,S|=K;if(B=B.next,B===null){if(B=p.shared.pending,B===null)break;ee=B,B=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);le===null&&(D=fe),p.baseState=D,p.firstBaseUpdate=U,p.lastBaseUpdate=le,y===null&&(p.shared.lanes=0),ho|=S,a.lanes=S,a.memoizedState=fe}}function Bx(a,i){if(typeof a!="function")throw Error(g(191,a));a.call(i)}function Tp(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)Bx(u[a],i)}function Ou(a,i){try{var u=i.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var p=d.next;u=p;do{if((u.tag&a)===a){d=void 0;var y=u.create,S=u.inst;d=y(),S.destroy=d}u=u.next}while(u!==p)}}catch(B){rt(i,i.return,B)}}function fo(a,i,u){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var y=p.next;d=y;do{if((d.tag&a)===a){var S=d.inst,B=S.destroy;if(B!==void 0){S.destroy=void 0,p=i;var D=u;try{B()}catch(U){rt(p,D,U)}}}d=d.next}while(d!==y)}}catch(U){rt(i,i.return,U)}}function yi(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{Tp(i,u)}catch(d){rt(a,a.return,d)}}}function rr(a,i,u){u.props=sn(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(d){rt(a,i,d)}}function mo(a,i){try{var u=a.ref;if(u!==null){var d=a.stateNode;switch(a.tag){case 26:case 27:case 5:var p=d;break;default:p=d}typeof u=="function"?a.refCleanup=u(p):u.current=p}}catch(y){rt(a,i,y)}}function Un(a,i){var u=a.ref,d=a.refCleanup;if(u!==null)if(typeof d=="function")try{d()}catch(p){rt(a,i,p)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(p){rt(a,i,p)}else u.current=null}function wx(a){var i=a.type,u=a.memoizedProps,d=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&d.focus();break e;case"img":u.src?d.src=u.src:u.srcSet&&(d.srcset=u.srcSet)}}catch(p){rt(a,a.return,p)}}function Dx(a,i,u){try{var d=a.stateNode;Zx(d,a.type,u,i),d[$n]=i}catch(p){rt(a,a.return,p)}}function kp(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27||a.tag===4}function Cs(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||kp(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==27&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function af(a,i,u){var d=a.tag;if(d===5||d===6)a=a.stateNode,i?u.nodeType===8?u.parentNode.insertBefore(a,i):u.insertBefore(a,i):(u.nodeType===8?(i=u.parentNode,i.insertBefore(a,u)):(i=u,i.appendChild(a)),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Eo));else if(d!==4&&d!==27&&(a=a.child,a!==null))for(af(a,i,u),a=a.sibling;a!==null;)af(a,i,u),a=a.sibling}function lt(a,i,u){var d=a.tag;if(d===5||d===6)a=a.stateNode,i?u.insertBefore(a,i):u.appendChild(a);else if(d!==4&&d!==27&&(a=a.child,a!==null))for(lt(a,i,u),a=a.sibling;a!==null;)lt(a,i,u),a=a.sibling}var Pl=!1,Ot=!1,sf=!1,Mx=typeof WeakSet=="function"?WeakSet:Set,un=null,of=!1;function _x(a,i){if(a=a.containerInfo,Df=Br,a=qm(a),Sd(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var d=u.getSelection&&u.getSelection();if(d&&d.rangeCount!==0){u=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var S=0,B=-1,D=-1,U=0,le=0,fe=a,K=null;t:for(;;){for(var ee;fe!==u||p!==0&&fe.nodeType!==3||(B=S+p),fe!==y||d!==0&&fe.nodeType!==3||(D=S+d),fe.nodeType===3&&(S+=fe.nodeValue.length),(ee=fe.firstChild)!==null;)K=fe,fe=ee;for(;;){if(fe===a)break t;if(K===u&&++U===p&&(B=S),K===y&&++le===d&&(D=S),(ee=fe.nextSibling)!==null)break;fe=K,K=fe.parentNode}fe=ee}u=B===-1||D===-1?null:{start:B,end:D}}else u=null}u=u||{start:0,end:0}}else u=null;for(Mf={focusedElem:a,selectionRange:u},Br=!1,un=i;un!==null;)if(i=un,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,un=a;else for(;un!==null;){switch(i=un,y=i.alternate,a=i.flags,i.tag){case 0:break;case 11:case 15:break;case 1:if(a&1024&&y!==null){a=void 0,u=i,p=y.memoizedProps,y=y.memoizedState,d=u.stateNode;try{var Ce=sn(u.type,p,u.elementType===u.type);a=d.getSnapshotBeforeUpdate(Ce,y),d.__reactInternalSnapshotBeforeUpdate=a}catch(_e){rt(u,u.return,_e)}}break;case 3:if(a&1024){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)la(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":la(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(a&1024)throw Error(g(163))}if(a=i.sibling,a!==null){a.return=i.return,un=a;break}un=i.return}return Ce=of,of=!1,Ce}function Bp(a,i,u){var d=u.flags;switch(u.tag){case 0:case 11:case 15:Da(a,u),d&4&&Ou(5,u);break;case 1:if(Da(a,u),d&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(B){rt(u,u.return,B)}else{var p=sn(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(p,i,a.__reactInternalSnapshotBeforeUpdate)}catch(B){rt(u,u.return,B)}}d&64&&yi(u),d&512&&mo(u,u.return);break;case 3:if(Da(a,u),d&64&&(d=u.updateQueue,d!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{Tp(d,a)}catch(B){rt(u,u.return,B)}}break;case 26:Da(a,u),d&512&&mo(u,u.return);break;case 27:case 5:Da(a,u),i===null&&d&4&&wx(u),d&512&&mo(u,u.return);break;case 12:Da(a,u);break;case 13:Da(a,u),d&4&&zu(a,u);break;case 22:if(p=u.memoizedState!==null||Pl,!p){i=i!==null&&i.memoizedState!==null||Ot;var y=Pl,S=Ot;Pl=p,(Ot=i)&&!S?po(a,u,(u.subtreeFlags&8772)!==0):Da(a,u),Pl=y,Ot=S}d&512&&(u.memoizedProps.mode==="manual"?mo(u,u.return):Un(u,u.return));break;default:Da(a,u)}}function wp(a){var i=a.alternate;i!==null&&(a.alternate=null,wp(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&od(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Et=null,pl=!1;function Ts(a,i,u){for(u=u.child;u!==null;)ea(a,i,u),u=u.sibling}function ea(a,i,u){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(Vo,u)}catch{}switch(u.tag){case 26:Ot||Un(u,i),Ts(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Ot||Un(u,i);var d=Et,p=pl;for(Et=u.stateNode,Ts(a,i,u),u=u.stateNode,i=u.attributes;i.length;)u.removeAttributeNode(i[0]);od(u),Et=d,pl=p;break;case 5:Ot||Un(u,i);case 6:p=Et;var y=pl;if(Et=null,Ts(a,i,u),Et=p,pl=y,Et!==null)if(pl)try{a=Et,d=u.stateNode,a.nodeType===8?a.parentNode.removeChild(d):a.removeChild(d)}catch(S){rt(u,i,S)}else try{Et.removeChild(u.stateNode)}catch(S){rt(u,i,S)}break;case 18:Et!==null&&(pl?(i=Et,u=u.stateNode,i.nodeType===8?Sr(i.parentNode,u):i.nodeType===1&&Sr(i,u),ec(i)):Sr(Et,u.stateNode));break;case 4:d=Et,p=pl,Et=u.stateNode.containerInfo,pl=!0,Ts(a,i,u),Et=d,pl=p;break;case 0:case 11:case 14:case 15:Ot||fo(2,u,i),Ot||fo(4,u,i),Ts(a,i,u);break;case 1:Ot||(Un(u,i),d=u.stateNode,typeof d.componentWillUnmount=="function"&&rr(u,i,d)),Ts(a,i,u);break;case 21:Ts(a,i,u);break;case 22:Ot||Un(u,i),Ot=(d=Ot)||u.memoizedState!==null,Ts(a,i,u),Ot=d;break;default:Ts(a,i,u)}}function zu(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{ec(a)}catch(u){rt(i,i.return,u)}}function Nx(a){switch(a.tag){case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new Mx),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new Mx),i;default:throw Error(g(435,a.tag))}}function uf(a,i){var u=Nx(a);i.forEach(function(d){var p=Xp.bind(null,a,d);u.has(d)||(u.add(d),d.then(p,p))})}function hl(a,i){var u=i.deletions;if(u!==null)for(var d=0;d<u.length;d++){var p=u[d],y=a,S=i,B=S;e:for(;B!==null;){switch(B.tag){case 27:case 5:Et=B.stateNode,pl=!1;break e;case 3:Et=B.stateNode.containerInfo,pl=!0;break e;case 4:Et=B.stateNode.containerInfo,pl=!0;break e}B=B.return}if(Et===null)throw Error(g(160));ea(y,S,p),Et=null,pl=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13878)for(i=i.child;i!==null;)cf(i,a),i=i.sibling}var Ol=null;function cf(a,i){var u=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:hl(i,a),xl(a),d&4&&(fo(3,a,a.return),Ou(3,a),fo(5,a,a.return));break;case 1:hl(i,a),xl(a),d&512&&(Ot||u===null||Un(u,u.return)),d&64&&Pl&&(a=a.updateQueue,a!==null&&(d=a.callbacks,d!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?d:u.concat(d))));break;case 26:var p=Ol;if(hl(i,a),xl(a),d&512&&(Ot||u===null||Un(u,u.return)),d&4){var y=u!==null?u.memoizedState:null;if(d=a.memoizedState,u===null)if(d===null)if(a.stateNode===null){e:{d=a.type,u=a.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Go]||y[pn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(d),p.head.insertBefore(y,p.querySelector("head > title"))),cn(y,d,u),y[pn]=a,It(y),d=y;break e;case"link":var S=_s("link","href",p).get(d+(u.href||""));if(S){for(var B=0;B<S.length;B++)if(y=S[B],y.getAttribute("href")===(u.href==null?null:u.href)&&y.getAttribute("rel")===(u.rel==null?null:u.rel)&&y.getAttribute("title")===(u.title==null?null:u.title)&&y.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){S.splice(B,1);break t}}y=p.createElement(d),cn(y,d,u),p.head.appendChild(y);break;case"meta":if(S=_s("meta","content",p).get(d+(u.content||""))){for(B=0;B<S.length;B++)if(y=S[B],y.getAttribute("content")===(u.content==null?null:""+u.content)&&y.getAttribute("name")===(u.name==null?null:u.name)&&y.getAttribute("property")===(u.property==null?null:u.property)&&y.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&y.getAttribute("charset")===(u.charSet==null?null:u.charSet)){S.splice(B,1);break t}}y=p.createElement(d),cn(y,d,u),p.head.appendChild(y);break;default:throw Error(g(468,d))}y[pn]=a,It(y),d=y}a.stateNode=d}else Rn(p,a.type,a.stateNode);else a.stateNode=Tr(p,d,a.memoizedProps);else y!==d?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,d===null?Rn(p,a.type,a.stateNode):Tr(p,d,a.memoizedProps)):d===null&&a.stateNode!==null&&Dx(a,a.memoizedProps,u.memoizedProps)}break;case 27:if(d&4&&a.alternate===null){p=a.stateNode,y=a.memoizedProps;try{for(var D=p.firstChild;D;){var U=D.nextSibling,le=D.nodeName;D[Go]||le==="HEAD"||le==="BODY"||le==="SCRIPT"||le==="STYLE"||le==="LINK"&&D.rel.toLowerCase()==="stylesheet"||p.removeChild(D),D=U}for(var fe=a.type,K=p.attributes;K.length;)p.removeAttributeNode(K[0]);cn(p,fe,y),p[pn]=a,p[$n]=y}catch(Ce){rt(a,a.return,Ce)}}case 5:if(hl(i,a),xl(a),d&512&&(Ot||u===null||Un(u,u.return)),a.flags&32){p=a.stateNode;try{fa(p,"")}catch(Ce){rt(a,a.return,Ce)}}d&4&&a.stateNode!=null&&(p=a.memoizedProps,Dx(a,p,u!==null?u.memoizedProps:p)),d&1024&&(sf=!0);break;case 6:if(hl(i,a),xl(a),d&4){if(a.stateNode===null)throw Error(g(162));d=a.memoizedProps,u=a.stateNode;try{u.nodeValue=d}catch(Ce){rt(a,a.return,Ce)}}break;case 3:if(Ni=null,p=Ol,Ol=Nf(i.containerInfo),hl(i,a),Ol=p,xl(a),d&4&&u!==null&&u.memoizedState.isDehydrated)try{ec(i.containerInfo)}catch(Ce){rt(a,a.return,Ce)}sf&&(sf=!1,rf(a));break;case 4:d=Ol,Ol=Nf(a.stateNode.containerInfo),hl(i,a),xl(a),Ol=d;break;case 12:hl(i,a),xl(a);break;case 13:hl(i,a),xl(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(yf=Zn()),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,uf(a,d)));break;case 22:if(d&512&&(Ot||u===null||Un(u,u.return)),D=a.memoizedState!==null,U=u!==null&&u.memoizedState!==null,le=Pl,fe=Ot,Pl=le||D,Ot=fe||U,hl(i,a),Ot=fe,Pl=le,xl(a),i=a.stateNode,i._current=a,i._visibility&=-3,i._visibility|=i._pendingVisibility&2,d&8192&&(i._visibility=D?i._visibility&-2:i._visibility|1,D&&(i=Pl||Ot,u===null||U||i||bi(a)),a.memoizedProps===null||a.memoizedProps.mode!=="manual"))e:for(u=null,i=a;;){if(i.tag===5||i.tag===26||i.tag===27){if(u===null){U=u=i;try{if(p=U.stateNode,D)y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{S=U.stateNode,B=U.memoizedProps.style;var ee=B!=null&&B.hasOwnProperty("display")?B.display:null;S.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(Ce){rt(U,U.return,Ce)}}}else if(i.tag===6){if(u===null){U=i;try{U.stateNode.nodeValue=D?"":U.memoizedProps}catch(Ce){rt(U,U.return,Ce)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=a.updateQueue,d!==null&&(u=d.retryQueue,u!==null&&(d.retryQueue=null,uf(a,u))));break;case 19:hl(i,a),xl(a),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,uf(a,d)));break;case 21:break;default:hl(i,a),xl(a)}}function xl(a){var i=a.flags;if(i&2){try{if(a.tag!==27){e:{for(var u=a.return;u!==null;){if(kp(u)){var d=u;break e}u=u.return}throw Error(g(160))}switch(d.tag){case 27:var p=d.stateNode,y=Cs(a);lt(a,y,p);break;case 5:var S=d.stateNode;d.flags&32&&(fa(S,""),d.flags&=-33);var B=Cs(a);lt(a,B,S);break;case 3:case 4:var D=d.stateNode.containerInfo,U=Cs(a);af(a,U,D);break;default:throw Error(g(161))}}}catch(le){rt(a,a.return,le)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function rf(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;rf(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function Da(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Bp(a,i.alternate,i),i=i.sibling}function bi(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:fo(4,i,i.return),bi(i);break;case 1:Un(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&rr(i,i.return,u),bi(i);break;case 26:case 27:case 5:Un(i,i.return),bi(i);break;case 22:Un(i,i.return),i.memoizedState===null&&bi(i);break;default:bi(i)}a=a.sibling}}function po(a,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=a,y=i,S=y.flags;switch(y.tag){case 0:case 11:case 15:po(p,y,u),Ou(4,y);break;case 1:if(po(p,y,u),d=y,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(U){rt(d,d.return,U)}if(d=y,p=d.updateQueue,p!==null){var B=d.stateNode;try{var D=p.shared.hiddenCallbacks;if(D!==null)for(p.shared.hiddenCallbacks=null,p=0;p<D.length;p++)Bx(D[p],B)}catch(U){rt(d,d.return,U)}}u&&S&64&&yi(y),mo(y,y.return);break;case 26:case 27:case 5:po(p,y,u),u&&d===null&&S&4&&wx(y),mo(y,y.return);break;case 12:po(p,y,u);break;case 13:po(p,y,u),u&&S&4&&zu(p,y);break;case 22:y.memoizedState===null&&po(p,y,u),mo(y,y.return);break;default:po(p,y,u)}i=i.sibling}}function df(a,i){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&yu(u))}function Ie(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&yu(a))}function Ma(a,i,u,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ff(a,i,u,d),i=i.sibling}function ff(a,i,u,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Ma(a,i,u,d),p&2048&&Ou(9,i);break;case 3:Ma(a,i,u,d),p&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&yu(a)));break;case 12:if(p&2048){Ma(a,i,u,d),a=i.stateNode;try{var y=i.memoizedProps,S=y.id,B=y.onPostCommit;typeof B=="function"&&B(S,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(D){rt(i,i.return,D)}}else Ma(a,i,u,d);break;case 23:break;case 22:y=i.stateNode,i.memoizedState!==null?y._visibility&4?Ma(a,i,u,d):Ri(a,i):y._visibility&4?Ma(a,i,u,d):(y._visibility|=4,vi(a,i,u,d,(i.subtreeFlags&10256)!==0)),p&2048&&df(i.alternate,i);break;case 24:Ma(a,i,u,d),p&2048&&Ie(i.alternate,i);break;default:Ma(a,i,u,d)}}function vi(a,i,u,d,p){for(p=p&&(i.subtreeFlags&10256)!==0,i=i.child;i!==null;){var y=a,S=i,B=u,D=d,U=S.flags;switch(S.tag){case 0:case 11:case 15:vi(y,S,B,D,p),Ou(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&4?vi(y,S,B,D,p):Ri(y,S):(le._visibility|=4,vi(y,S,B,D,p)),p&&U&2048&&df(S.alternate,S);break;case 24:vi(y,S,B,D,p),p&&U&2048&&Ie(S.alternate,S);break;default:vi(y,S,B,D,p)}i=i.sibling}}function Ri(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=a,d=i,p=d.flags;switch(d.tag){case 22:Ri(u,d),p&2048&&df(d.alternate,d);break;case 24:Ri(u,d),p&2048&&Ie(d.alternate,d);break;default:Ri(u,d)}i=i.sibling}}var ks=8192;function Bs(a){if(a.subtreeFlags&ks)for(a=a.child;a!==null;)Ei(a),a=a.sibling}function Ei(a){switch(a.tag){case 26:Bs(a),a.flags&ks&&a.memoizedState!==null&&oy(Ol,a.memoizedState,a.memoizedProps);break;case 5:Bs(a);break;case 3:case 4:var i=Ol;Ol=Nf(a.stateNode.containerInfo),Bs(a),Ol=i;break;case 22:a.memoizedState===null&&(i=a.alternate,i!==null&&i.memoizedState!==null?(i=ks,ks=16777216,Bs(a),ks=i):Bs(a));break;default:Bs(a)}}function Dp(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function ji(a){var i=a.deletions;if(a.flags&16){if(i!==null)for(var u=0;u<i.length;u++){var d=i[u];un=d,ta(d,a)}Dp(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Wt(a),a=a.sibling}function Wt(a){switch(a.tag){case 0:case 11:case 15:ji(a),a.flags&2048&&fo(9,a,a.return);break;case 3:ji(a);break;case 12:ji(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&4&&(a.return===null||a.return.tag!==13)?(i._visibility&=-5,mf(a)):ji(a);break;default:ji(a)}}function mf(a){var i=a.deletions;if(a.flags&16){if(i!==null)for(var u=0;u<i.length;u++){var d=i[u];un=d,ta(d,a)}Dp(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:fo(8,i,i.return),mf(i);break;case 22:u=i.stateNode,u._visibility&4&&(u._visibility&=-5,mf(i));break;default:mf(i)}a=a.sibling}}function ta(a,i){for(;un!==null;){var u=un;switch(u.tag){case 0:case 11:case 15:fo(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var d=u.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:yu(u.memoizedState.cache)}if(d=u.child,d!==null)d.return=u,un=d;else e:for(u=a;un!==null;){d=un;var p=d.sibling,y=d.return;if(wp(d),d===u){un=null;break e}if(p!==null){p.return=y,un=p;break e}un=y}}}function Ox(a,i,u,d){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(a,i,u,d){return new Ox(a,i,u,d)}function pf(a){return a=a.prototype,!(!a||!a.isReactComponent)}function na(a,i){var u=a.alternate;return u===null?(u=Ft(a.tag,i,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=i,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&31457280,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,i=a.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function ot(a,i){a.flags&=31457282;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,i=u.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function Lu(a,i,u,d,p,y){var S=0;if(d=a,typeof a=="function")pf(a)&&(S=1);else if(typeof a=="string")S=nl(a,u,Qn.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case C:return kt(u.children,p,y,i);case T:S=8,p|=24;break;case M:return a=Ft(12,u,i,p|2),a.elementType=M,a.lanes=y,a;case Y:return a=Ft(13,u,i,p),a.elementType=Y,a.lanes=y,a;case P:return a=Ft(19,u,i,p),a.elementType=P,a.lanes=y,a;case ue:return zx(u,p,y,i);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case O:case Z:S=10;break e;case z:S=9;break e;case q:S=11;break e;case he:S=14;break e;case te:S=16,d=null;break e}S=29,u=Error(g(130,a===null?"null":typeof a,"")),d=null}return i=Ft(S,u,i,p),i.elementType=a,i.type=d,i.lanes=y,i}function kt(a,i,u,d){return a=Ft(7,a,d,i),a.lanes=u,a}function zx(a,i,u,d){a=Ft(22,a,d,i),a.elementType=ue,a.lanes=u;var p={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var y=p._current;if(y===null)throw Error(g(456));if(!(p._pendingVisibility&2)){var S=pa(y,2);S!==null&&(p._pendingVisibility|=2,Pt(S,y,2))}},attach:function(){var y=p._current;if(y===null)throw Error(g(456));if(p._pendingVisibility&2){var S=pa(y,2);S!==null&&(p._pendingVisibility&=-3,Pt(S,y,2))}}};return a.stateNode=p,a}function hf(a,i,u){return a=Ft(6,a,null,i),a.lanes=u,a}function dr(a,i,u){return i=Ft(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}function _a(a){a.flags|=4}function gl(a,i){if(i.type!=="stylesheet"||i.state.loading&4)a.flags&=-16777217;else if(a.flags|=16777216,!Co(i)){if(i=dl.current,i!==null&&((Fe&4194176)===Fe?$l!==null:(Fe&62914560)!==Fe&&!(Fe&536870912)||i!==$l))throw ii=Bd,Uc;a.flags|=8192}}function fr(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?Qt():536870912,a.lanes|=i,xo|=i)}function Si(a,i){if(!Pe)switch(a.tailMode){case"hidden":i=a.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:d.sibling=null}}function jt(a){var i=a.alternate!==null&&a.alternate.child===a.child,u=0,d=0;if(i)for(var p=a.child;p!==null;)u|=p.lanes|p.childLanes,d|=p.subtreeFlags&31457280,d|=p.flags&31457280,p.return=a,p=p.sibling;else for(p=a.child;p!==null;)u|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=a,p=p.sibling;return a.subtreeFlags|=d,a.childLanes=u,i}function xf(a,i,u){var d=i.pendingProps;switch(Hc(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(i),null;case 1:return jt(i),null;case 3:return u=i.stateNode,d=null,a!==null&&(d=a.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Ba(Jt),Ji(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(ai(i)?_a(i):a===null||a.memoizedState.isDehydrated&&!(i.flags&256)||(i.flags|=1024,_l!==null&&(zp(_l),_l=null))),jt(i),null;case 26:return u=i.memoizedState,a===null?(_a(i),u!==null?(jt(i),gl(i,u)):(jt(i),i.flags&=-16777217)):u?u!==a.memoizedState?(_a(i),jt(i),gl(i,u)):(jt(i),i.flags&=-16777217):(a.memoizedProps!==d&&_a(i),jt(i),i.flags&=-16777217),null;case 27:ed(i),u=ca.current;var p=i.type;if(a!==null&&i.stateNode!=null)a.memoizedProps!==d&&_a(i);else{if(!d){if(i.stateNode===null)throw Error(g(166));return jt(i),null}a=Qn.current,ai(i)?Zm(i):(a=Ha(p,d,u),i.stateNode=a,_a(i))}return jt(i),null;case 5:if(ed(i),u=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==d&&_a(i);else{if(!d){if(i.stateNode===null)throw Error(g(166));return jt(i),null}if(a=Qn.current,ai(i))Zm(i);else{switch(p=Rr(ca.current),a){case 1:a=p.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:a=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":a=p.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":a=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":a=p.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?a.multiple=!0:d.size&&(a.size=d.size);break;default:a=typeof d.is=="string"?p.createElement(u,{is:d.is}):p.createElement(u)}}a[pn]=i,a[$n]=d;e:for(p=i.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===i)break e;for(;p.sibling===null;){if(p.return===null||p.return===i)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}i.stateNode=a;e:switch(cn(a,u,d),u){case"button":case"input":case"select":case"textarea":a=!!d.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&_a(i)}}return jt(i),i.flags&=-16777217,null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==d&&_a(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(g(166));if(a=ca.current,ai(i)){if(a=i.stateNode,u=i.memoizedProps,d=null,p=yn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}a[pn]=i,a=!!(a.nodeValue===u||d!==null&&d.suppressHydrationWarning===!0||He(a.nodeValue,u)),a||eo(i)}else a=Rr(a).createTextNode(d),a[pn]=i,i.stateNode=a}return jt(i),null;case 13:if(d=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(p=ai(i),d!==null&&d.dehydrated!==null){if(a===null){if(!p)throw Error(g(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(g(317));p[pn]=i}else fu(),!(i.flags&128)&&(i.memoizedState=null),i.flags|=4;jt(i),p=!1}else _l!==null&&(zp(_l),_l=null),p=!0;if(!p)return i.flags&256?(Kl(i),i):(Kl(i),null)}if(Kl(i),i.flags&128)return i.lanes=u,i;if(u=d!==null,a=a!==null&&a.memoizedState!==null,u){d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var y=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==p&&(d.flags|=2048)}return u!==a&&u&&(i.child.flags|=8192),fr(i,i.updateQueue),jt(i),null;case 4:return Ji(),a===null&&Mi(i.stateNode.containerInfo),jt(i),null;case 10:return Ba(i.type),jt(i),null;case 19:if(zt(Vt),p=i.memoizedState,p===null)return jt(i),null;if(d=(i.flags&128)!==0,y=p.rendering,y===null)if(d)Si(p,!1);else{if(At!==0||a!==null&&a.flags&128)for(a=i.child;a!==null;){if(y=Gc(a),y!==null){for(i.flags|=128,Si(p,!1),a=y.updateQueue,i.updateQueue=a,fr(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)ot(u,a),u=u.sibling;return dt(Vt,Vt.current&1|2),i.child}a=a.sibling}p.tail!==null&&Zn()>pr&&(i.flags|=128,d=!0,Si(p,!1),i.lanes=4194304)}else{if(!d)if(a=Gc(y),a!==null){if(i.flags|=128,d=!0,a=a.updateQueue,i.updateQueue=a,fr(i,a),Si(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!Pe)return jt(i),null}else 2*Zn()-p.renderingStartTime>pr&&u!==536870912&&(i.flags|=128,d=!0,Si(p,!1),i.lanes=4194304);p.isBackwards?(y.sibling=i.child,i.child=y):(a=p.last,a!==null?a.sibling=y:i.child=y,p.last=y)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=Zn(),i.sibling=null,a=Vt.current,dt(Vt,d?a&1|2:a&1),i):(jt(i),null);case 22:case 23:return Kl(i),qc(),d=i.memoizedState!==null,a!==null?a.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?u&536870912&&!(i.flags&128)&&(jt(i),i.subtreeFlags&6&&(i.flags|=8192)):jt(i),u=i.updateQueue,u!==null&&fr(i,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==u&&(i.flags|=2048),a!==null&&zt(lo),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ba(Jt),jt(i),null;case 25:return null}throw Error(g(156,i.tag))}function Lx(a,i){switch(Hc(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return Ba(Jt),Ji(),a=i.flags,a&65536&&!(a&128)?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return ed(i),null;case 13:if(Kl(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(g(340));fu()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return zt(Vt),null;case 4:return Ji(),null;case 10:return Ba(i.type),null;case 22:case 23:return Kl(i),qc(),a!==null&&zt(lo),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return Ba(Jt),null;case 25:return null;default:return null}}function Hx(a,i){switch(Hc(i),i.tag){case 3:Ba(Jt),Ji();break;case 26:case 27:case 5:ed(i);break;case 4:Ji();break;case 13:Kl(i);break;case 19:zt(Vt);break;case 10:Ba(i.type);break;case 22:case 23:Kl(i),qc(),a!==null&&zt(lo);break;case 24:Ba(Jt)}}var gf={getCacheForType:function(a){var i=bn(Jt),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u}},Ux=typeof WeakMap=="function"?WeakMap:Map,St=0,ct=null,$e=null,Fe=0,pt=0,yl=null,Na=!1,Hu=!1,Mp=!1,ws=0,At=0,ho=0,Ai=0,_p=0,zl=0,xo=0,mr=null,Oa=null,el=!1,yf=0,pr=1/0,hr=null,Ds=null,bf=!1,Ci=null,Uu=0,Np=0,Vu=null,qu=0,vf=null;function wn(){if(St&2&&Fe!==0)return Fe&-Fe;if(J.T!==null){var a=ms;return a!==0?a:Zu()}return vc()}function Ti(){zl===0&&(zl=!(Fe&536870912)||Pe?qo():536870912);var a=dl.current;return a!==null&&(a.flags|=32),zl}function Pt(a,i,u){(a===ct&&pt===2||a.cancelPendingCommit!==null)&&(go(a,0),za(a,Fe,zl,!1)),da(a,u),(!(St&2)||a!==ct)&&(a===ct&&(!(St&2)&&(Ai|=u),At===4&&za(a,Fe,zl,!1)),bl(a))}function Op(a,i,u){if(St&6)throw Error(g(327));var d=!u&&(i&60)===0&&(i&a.expiredLanes)===0||ql(a,i),p=d?$g(a,i):Up(a,i,!0),y=d;do{if(p===0){Hu&&!d&&za(a,i,0,!1);break}else if(p===6)za(a,i,0,!Na);else{if(u=a.current.alternate,y&&!xr(u)){p=Up(a,i,!1),y=!1;continue}if(p===2){if(y=i,a.errorRecoveryDisabledLanes&y)var S=0;else S=a.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var B=a;p=mr;var D=B.current.memoizedState.isDehydrated;if(D&&(go(B,S).flags|=256),S=Up(B,S,!1),S!==2){if(Mp&&!D){B.errorRecoveryDisabledLanes|=y,Ai|=y,p=4;break e}y=Oa,Oa=p,y!==null&&zp(y)}p=S}if(y=!1,p!==2)continue}}if(p===1){go(a,0),za(a,i,0,!0);break}e:{switch(d=a,p){case 0:case 1:throw Error(g(345));case 4:if((i&4194176)===i){za(d,i,zl,!Na);break e}break;case 2:Oa=null;break;case 3:case 5:break;default:throw Error(g(329))}if(d.finishedWork=u,d.finishedLanes=i,(i&62914560)===i&&(y=yf+300-Zn(),10<y)){if(za(d,i,zl,!Na),ra(d,0)!==0)break e;d.timeoutHandle=Rl(ki.bind(null,d,u,Oa,hr,el,i,zl,Ai,xo,Na,2,-0,0),y);break e}ki(d,u,Oa,hr,el,i,zl,Ai,xo,Na,0,-0,0)}}break}while(!0);bl(a)}function zp(a){Oa===null?Oa=a:Oa.push.apply(Oa,a)}function ki(a,i,u,d,p,y,S,B,D,U,le,fe,K){var ee=i.subtreeFlags;if((ee&8192||(ee&16785408)===16785408)&&(Oi={stylesheets:null,count:0,unsuspend:sy},Ei(i),i=$x(),i!==null)){a.cancelPendingCommit=i(qp.bind(null,a,u,d,p,S,B,D,1,fe,K)),za(a,y,S,!U);return}qp(a,u,d,p,S,B,D,le,fe,K)}function xr(a){for(var i=a;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var d=0;d<u.length;d++){var p=u[d],y=p.getSnapshot;p=p.value;try{if(!Cn(y(),p))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function za(a,i,u,d){i&=~_p,i&=~Ai,a.suspendedLanes|=i,a.pingedLanes&=~i,d&&(a.warmLanes|=i),d=a.expirationTimes;for(var p=i;0<p;){var y=31-In(p),S=1<<y;d[y]=-1,p&=~S}u!==0&&ld(a,u,i)}function Bi(){return St&6?!0:(Xu(0),!1)}function gr(){if($e!==null){if(pt===0)var a=$e.return;else a=$e,ka=gi=null,Zc(a),Kt=null,no=0,a=$e;for(;a!==null;)Hx(a.alternate,a),a=a.return;$e=null}}function go(a,i){a.finishedWork=null,a.finishedLanes=0;var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,vn(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),gr(),ct=a,$e=u=na(a.current,null),Fe=i,pt=0,yl=null,Na=!1,Hu=ql(a,i),Mp=!1,xo=zl=_p=Ai=ho=At=0,Oa=mr=null,el=!1,i&8&&(i|=i&32);var d=a.entangledLanes;if(d!==0)for(a=a.entanglements,d&=i;0<d;){var p=31-In(d),y=1<<p;i|=a[p],d&=~y}return ws=i,Td(),u}function Lp(a,i){ze=null,J.H=an,i===ba?(i=to(),pt=3):i===Uc?(i=to(),pt=4):pt=i===Rp?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,yl=i,$e===null&&(At=1,Rs(a,ln(i,a.current)))}function Hp(){var a=J.H;return J.H=an,a===null?an:a}function Vx(){var a=J.A;return J.A=gf,a}function Rf(){At=4,Na||(Fe&4194176)!==Fe&&dl.current!==null||(Hu=!0),!(ho&134217727)&&!(Ai&134217727)||ct===null||za(ct,Fe,zl,!1)}function Up(a,i,u){var d=St;St|=2;var p=Hp(),y=Vx();(ct!==a||Fe!==i)&&(hr=null,go(a,i)),i=!1;var S=At;e:do try{if(pt!==0&&$e!==null){var B=$e,D=yl;switch(pt){case 8:gr(),S=6;break e;case 3:case 2:case 6:dl.current===null&&(i=!0);var U=pt;if(pt=0,yl=null,Gu(a,B,D,U),u&&Hu){S=0;break e}break;default:U=pt,pt=0,yl=null,Gu(a,B,D,U)}}Ig(),S=At;break}catch(le){Lp(a,le)}while(!0);return i&&a.shellSuspendCounter++,ka=gi=null,St=d,J.H=p,J.A=y,$e===null&&(ct=null,Fe=0,Td()),S}function Ig(){for(;$e!==null;)jf($e)}function $g(a,i){var u=St;St|=2;var d=Hp(),p=Vx();ct!==a||Fe!==i?(hr=null,pr=Zn()+500,go(a,i)):Hu=ql(a,i);e:do try{if(pt!==0&&$e!==null){i=$e;var y=yl;t:switch(pt){case 1:pt=0,yl=null,Gu(a,i,y,1);break;case 2:if(vx(y)){pt=0,yl=null,qx(i);break}i=function(){pt===2&&ct===a&&(pt=7),bl(a)},y.then(i,i);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:vx(y)?(pt=0,yl=null,qx(i)):(pt=0,yl=null,Gu(a,i,y,7));break;case 5:var S=null;switch($e.tag){case 26:S=$e.memoizedState;case 5:case 27:var B=$e;if(!S||Co(S)){pt=0,yl=null;var D=B.sibling;if(D!==null)$e=D;else{var U=B.return;U!==null?($e=U,Sf(U)):$e=null}break t}}pt=0,yl=null,Gu(a,i,y,5);break;case 6:pt=0,yl=null,Gu(a,i,y,6);break;case 8:gr(),At=6;break e;default:throw Error(g(462))}}Ef();break}catch(le){Lp(a,le)}while(!0);return ka=gi=null,J.H=d,J.A=p,St=u,$e!==null?0:(ct=null,Fe=0,Td(),At)}function Ef(){for(;$e!==null&&!Zh();)jf($e)}function jf(a){var i=yt(a.alternate,a,ws);a.memoizedProps=a.pendingProps,i===null?Sf(a):$e=i}function qx(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=Sp(u,i,i.pendingProps,i.type,void 0,Fe);break;case 11:i=Sp(u,i,i.pendingProps,i.type.render,i.ref,Fe);break;case 5:Zc(i);default:Hx(u,i),i=$e=ot(i,ws),i=yt(u,i,ws)}a.memoizedProps=a.pendingProps,i===null?Sf(a):$e=i}function Gu(a,i,u,d){ka=gi=null,Zc(i),Kt=null,no=0;var p=i.return;try{if(uo(a,p,i,u,Fe)){At=1,Rs(a,ln(u,a.current)),$e=null;return}}catch(y){if(p!==null)throw $e=p,y;At=1,Rs(a,ln(u,a.current)),$e=null;return}i.flags&32768?(Pe||d===1?a=!0:Hu||Fe&536870912?a=!1:(Na=a=!0,(d===2||d===3||d===6)&&(d=dl.current,d!==null&&d.tag===13&&(d.flags|=16384))),Vp(i,a)):Sf(i)}function Sf(a){var i=a;do{if(i.flags&32768){Vp(i,Na);return}a=i.return;var u=xf(i.alternate,i,ws);if(u!==null){$e=u;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=a}while(i!==null);At===0&&(At=5)}function Vp(a,i){do{var u=Lx(a.alternate,a);if(u!==null){u.flags&=32767,$e=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(a=a.sibling,a!==null)){$e=a;return}$e=a=u}while(a!==null);At=6,$e=null}function qp(a,i,u,d,p,y,S,B,D,U){var le=J.T,fe=Ne.p;try{Ne.p=2,J.T=null,Gx(a,i,u,d,fe,p,y,S,B,D,U)}finally{J.T=le,Ne.p=fe}}function Gx(a,i,u,d,p,y,S,B){do wi();while(Ci!==null);if(St&6)throw Error(g(327));var D=a.finishedWork;if(d=a.finishedLanes,D===null)return null;if(a.finishedWork=null,a.finishedLanes=0,D===a.current)throw Error(g(177));a.callbackNode=null,a.callbackPriority=0,a.cancelPendingCommit=null;var U=D.lanes|D.childLanes;if(U|=zc,Wi(a,d,U,y,S,B),a===ct&&($e=ct=null,Fe=0),!(D.subtreeFlags&10256)&&!(D.flags&10256)||bf||(bf=!0,Np=U,Vu=u,Qp(Uo,function(){return wi(),null})),u=(D.flags&15990)!==0,D.subtreeFlags&15990||u?(u=J.T,J.T=null,y=Ne.p,Ne.p=2,S=St,St|=4,_x(a,D),cf(D,a),Gm(Mf,a.containerInfo),Br=!!Df,Mf=Df=null,a.current=D,Bp(a,D.alternate,D),Ih(),St=S,Ne.p=y,J.T=u):a.current=D,bf?(bf=!1,Ci=a,Uu=d):Gp(a,U),U=a.pendingLanes,U===0&&(Ds=null),Lg(D.stateNode),bl(a),i!==null)for(p=a.onRecoverableError,D=0;D<i.length;D++)U=i[D],p(U.value,{componentStack:U.stack});return Uu&3&&wi(),U=a.pendingLanes,d&4194218&&U&42?a===vf?qu++:(qu=0,vf=a):qu=0,Xu(0),null}function Gp(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,yu(i)))}function wi(){if(Ci!==null){var a=Ci,i=Np;Np=0;var u=bc(Uu),d=J.T,p=Ne.p;try{if(Ne.p=32>u?32:u,J.T=null,Ci===null)var y=!1;else{u=Vu,Vu=null;var S=Ci,B=Uu;if(Ci=null,Uu=0,St&6)throw Error(g(331));var D=St;if(St|=4,Wt(S.current),ff(S,S.current,B,u),St=D,Xu(0,!1),mn&&typeof mn.onPostCommitFiberRoot=="function")try{mn.onPostCommitFiberRoot(Vo,S)}catch{}y=!0}return y}finally{Ne.p=p,J.T=d,Gp(a,i)}}return!1}function Af(a,i,u){i=ln(u,i),i=Fl(a.stateNode,i,2),a=As(a,i,2),a!==null&&(da(a,2),bl(a))}function rt(a,i,u){if(a.tag===3)Af(a,a,u);else for(;i!==null;){if(i.tag===3){Af(i,a,u);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ds===null||!Ds.has(d))){a=ln(u,a),u=Jd(2),d=As(i,u,2),d!==null&&(Wd(u,d,i,a),da(d,2),bl(d));break}}i=i.return}}function Yp(a,i,u){var d=a.pingCache;if(d===null){d=a.pingCache=new Ux;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(u)||(Mp=!0,p.add(u),a=Kg.bind(null,a,i,u),i.then(a,a))}function Kg(a,i,u){var d=a.pingCache;d!==null&&d.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,ct===a&&(Fe&u)===u&&(At===4||At===3&&(Fe&62914560)===Fe&&300>Zn()-yf?!(St&2)&&go(a,0):_p|=u,xo===Fe&&(xo=0)),bl(a)}function Yx(a,i){i===0&&(i=Qt()),a=pa(a,i),a!==null&&(da(a,i),bl(a))}function Jg(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),Yx(a,u)}function Xp(a,i){var u=0;switch(a.tag){case 13:var d=a.stateNode,p=a.memoizedState;p!==null&&(u=p.retryLane);break;case 19:d=a.stateNode;break;case 22:d=a.stateNode._retryCache;break;default:throw Error(g(314))}d!==null&&d.delete(i),Yx(a,u)}function Qp(a,i){return Ho(a,i)}var Yu=null,Di=null,Cf=!1,yo=!1,Zp=!1,bo=0;function bl(a){a!==Di&&a.next===null&&(Di===null?Yu=Di=a:Di=Di.next=a),yo=!0,Cf||(Cf=!0,$p(Wg))}function Xu(a,i){if(!Zp&&yo){Zp=!0;do for(var u=!1,d=Yu;d!==null;){if(a!==0){var p=d.pendingLanes;if(p===0)var y=0;else{var S=d.suspendedLanes,B=d.pingedLanes;y=(1<<31-In(42|a)+1)-1,y&=p&~(S&~B),y=y&201326677?y&201326677|1:y?y|2:0}y!==0&&(u=!0,Qu(d,y))}else y=Fe,y=ra(d,d===ct?y:0),!(y&3)||ql(d,y)||(u=!0,Qu(d,y));d=d.next}while(u);Zp=!1}}function Wg(){yo=Cf=!1;var a=0;bo!==0&&(Mn()&&(a=bo),bo=0);for(var i=Zn(),u=null,d=Yu;d!==null;){var p=d.next,y=yr(d,i);y===0?(d.next=null,u===null?Yu=p:u.next=p,p===null&&(Di=u)):(u=d,(a!==0||y&3)&&(yo=!0)),d=p}Xu(a)}function yr(a,i){for(var u=a.suspendedLanes,d=a.pingedLanes,p=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var S=31-In(y),B=1<<S,D=p[S];D===-1?(!(B&u)||B&d)&&(p[S]=yc(B,i)):D<=i&&(a.expiredLanes|=B),y&=~B}if(i=ct,u=Fe,u=ra(a,a===i?u:0),d=a.callbackNode,u===0||a===i&&pt===2||a.cancelPendingCommit!==null)return d!==null&&d!==null&&Gs(d),a.callbackNode=null,a.callbackPriority=0;if(!(u&3)||ql(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(d!==null&&Gs(d),bc(u)){case 2:case 8:u=Ys;break;case 32:u=Uo;break;case 268435456:u=Kh;break;default:u=Uo}return d=Ip.bind(null,a),u=Ho(u,d),a.callbackPriority=i,a.callbackNode=u,i}return d!==null&&d!==null&&Gs(d),a.callbackPriority=2,a.callbackNode=null,2}function Ip(a,i){var u=a.callbackNode;if(wi()&&a.callbackNode!==u)return null;var d=Fe;return d=ra(a,a===ct?d:0),d===0?null:(Op(a,d,i),yr(a,Zn()),a.callbackNode!=null&&a.callbackNode===u?Ip.bind(null,a):null)}function Qu(a,i){if(wi())return null;Op(a,i,!0)}function $p(a){Pg(function(){St&6?Ho($h,a):a()})}function Zu(){return bo===0&&(bo=qo()),bo}function Kp(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:dd(""+a)}function Ut(a,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,a.id&&u.setAttribute("form",a.id),i.parentNode.insertBefore(u,i),a=new FormData(a),u.parentNode.removeChild(u),a}function Jp(a,i,u,d,p){if(i==="submit"&&u&&u.stateNode===p){var y=Kp((p[$n]||null).action),S=d.submitter;S&&(i=(i=S[$n]||null)?Kp(i.formAction):S.getAttribute("formAction"),i!==null&&(y=i,S=null));var B=new hd("action","action",null,d,p);a.push({event:B,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(bo!==0){var D=S?Ut(p,S):new FormData(p);bs(u,{pending:!0,data:D,method:p.method,action:y},null,D)}}else typeof y=="function"&&(B.preventDefault(),D=S?Ut(p,S):new FormData(p),bs(u,{pending:!0,data:D,method:p.method,action:y},y,D))},currentTarget:p}]})}}for(var Wp=0;Wp<Mt.length;Wp++){var Fp=Mt[Wp],vo=Fp.toLowerCase(),Iu=Fp[0].toUpperCase()+Fp.slice(1);rl(vo,"on"+Iu)}rl(yx,"onAnimationEnd"),rl(Cd,"onAnimationIteration"),rl(Nc,"onAnimationStart"),rl("dblclick","onDoubleClick"),rl("focusin","onFocus"),rl("focusout","onBlur"),rl(bx,"onTransitionRun"),rl(Ze,"onTransitionStart"),rl(ye,"onTransitionCancel"),rl(ni,"onTransitionEnd"),Xo("onMouseEnter",["mouseout","mouseover"]),Xo("onMouseLeave",["mouseout","mouseover"]),Xo("onPointerEnter",["pointerout","pointerover"]),Xo("onPointerLeave",["pointerout","pointerover"]),Xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var La="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tf=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(La));function kf(a,i){i=(i&4)!==0;for(var u=0;u<a.length;u++){var d=a[u],p=d.event;d=d.listeners;e:{var y=void 0;if(i)for(var S=d.length-1;0<=S;S--){var B=d[S],D=B.instance,U=B.currentTarget;if(B=B.listener,D!==y&&p.isPropagationStopped())break e;y=B,p.currentTarget=U;try{y(p)}catch(le){tr(le)}p.currentTarget=null,y=D}else for(S=0;S<d.length;S++){if(B=d[S],D=B.instance,U=B.currentTarget,B=B.listener,D!==y&&p.isPropagationStopped())break e;y=B,p.currentTarget=U;try{y(p)}catch(le){tr(le)}p.currentTarget=null,y=D}}}}function We(a,i){var u=i[ad];u===void 0&&(u=i[ad]=new Set);var d=a+"__bubble";u.has(d)||(Bf(i,a,2,!1),u.add(d))}function br(a,i,u){var d=0;i&&(d|=4),Bf(u,a,d,i)}var vl="_reactListening"+Math.random().toString(36).slice(2);function Mi(a){if(!a[vl]){a[vl]=!0,bm.forEach(function(u){u!=="selectionchange"&&(Tf.has(u)||br(u,!1,a),br(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[vl]||(i[vl]=!0,br("selectionchange",!1,i))}}function Bf(a,i,u,d){switch(Px(i)){case 2:var p=Wx;break;case 8:p=Fx;break;default:p=Lf}u=p.bind(null,i,u,a),p=void 0,!au||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?a.addEventListener(i,u,{capture:!0,passive:p}):a.addEventListener(i,u,!0):p!==void 0?a.addEventListener(i,u,{passive:p}):a.addEventListener(i,u,!1)}function vr(a,i,u,d,p){var y=d;if(!(i&1)&&!(i&2)&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var B=d.stateNode.containerInfo;if(B===p||B.nodeType===8&&B.parentNode===p)break;if(S===4)for(S=d.return;S!==null;){var D=S.tag;if((D===3||D===4)&&(D=S.stateNode.containerInfo,D===p||D.nodeType===8&&D.parentNode===p))return;S=S.return}for(;B!==null;){if(S=ls(B),S===null)return;if(D=S.tag,D===5||D===6||D===26||D===27){d=y=S;continue e}B=B.parentNode}}d=d.return}nu(function(){var U=y,le=Bm(u),fe=[];e:{var K=Oc.get(a);if(K!==void 0){var ee=hd,Ce=a;switch(a){case"keypress":if(jc(u)===0)break e;case"keydown":case"keyup":ee=bd;break;case"focusin":Ce="focus",ee=Dm;break;case"focusout":Ce="blur",ee=Dm;break;case"beforeblur":case"afterblur":ee=Dm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=lx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Yg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=vd;break;case yx:case Cd:case Nc:ee=ax;break;case ni:ee=_m;break;case"scroll":case"scrollend":ee=qg;break;case"wheel":ee=dx;break;case"copy":case"cut":case"paste":ee=ox;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=xn;break;case"toggle":case"beforetoggle":ee=ss}var _e=(i&4)!==0,bt=!_e&&(a==="scroll"||a==="scrollend"),G=_e?K!==null?K+"Capture":null:K;_e=[];for(var H=U,Q;H!==null;){var de=H;if(Q=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||Q===null||G===null||(de=lu(H,G),de!=null&&_e.push(Ro(H,de,Q))),bt)break;H=H.return}0<_e.length&&(K=new ee(K,Ce,null,u,le),fe.push({event:K,listeners:_e}))}}if(!(i&7)){e:{if(K=a==="mouseover"||a==="pointerover",ee=a==="mouseout"||a==="pointerout",K&&u!==km&&(Ce=u.relatedTarget||u.fromElement)&&(ls(Ce)||Ce[ns]))break e;if((ee||K)&&(K=le.window===le?le:(K=le.ownerDocument)?K.defaultView||K.parentWindow:window,ee?(Ce=u.relatedTarget||u.toElement,ee=U,Ce=Ce?ls(Ce):null,Ce!==null&&(bt=re(Ce),_e=Ce.tag,Ce!==bt||_e!==5&&_e!==27&&_e!==6)&&(Ce=null)):(ee=null,Ce=U),ee!==Ce)){if(_e=lx,de="onMouseLeave",G="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(_e=xn,de="onPointerLeave",G="onPointerEnter",H="pointer"),bt=ee==null?K:Fi(ee),Q=Ce==null?K:Fi(Ce),K=new _e(de,H+"leave",ee,u,le),K.target=bt,K.relatedTarget=Q,de=null,ls(le)===U&&(_e=new _e(G,H+"enter",Ce,u,le),_e.target=Q,_e.relatedTarget=bt,de=_e),bt=de,ee&&Ce)t:{for(_e=ee,G=Ce,H=0,Q=_e;Q;Q=_i(Q))H++;for(Q=0,de=G;de;de=_i(de))Q++;for(;0<H-Q;)_e=_i(_e),H--;for(;0<Q-H;)G=_i(G),Q--;for(;H--;){if(_e===G||G!==null&&_e===G.alternate)break t;_e=_i(_e),G=_i(G)}_e=null}else _e=null;ee!==null&&Xx(fe,K,ee,_e,!1),Ce!==null&&bt!==null&&Xx(fe,bt,Ce,_e,!0)}}e:{if(K=U?Fi(U):window,ee=K.nodeName&&K.nodeName.toLowerCase(),ee==="select"||ee==="input"&&K.type==="file")var Te=uu;else if(Ks(K))if(cu)Te=gn;else{Te=hx;var Ge=px}else ee=K.nodeName,!ee||ee.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?U&&Io(U.elementType)&&(Te=uu):Te=xx;if(Te&&(Te=Te(a,U))){Js(fe,Te,u,le);break e}Ge&&Ge(a,K,U),a==="focusout"&&U&&K.type==="number"&&U.memoizedProps.value!=null&&Am(K,"number",K.value)}switch(Ge=U?Fi(U):window,a){case"focusin":(Ks(Ge)||Ge.contentEditable==="true")&&(cl=Ge,Ad=U,Dl=null);break;case"focusout":Dl=Ad=cl=null;break;case"mousedown":Zl=!0;break;case"contextmenu":case"mouseup":case"dragend":Zl=!1,_c(fe,u,le);break;case"selectionchange":if(Ym)break;case"keydown":case"keyup":_c(fe,u,le)}var we;if(Wo)e:{switch(a){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else wl?Tc(a,u)&&(De="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(De="onCompositionStart");De&&(zm&&u.locale!=="ko"&&(wl||De!=="onCompositionStart"?De==="onCompositionEnd"&&wl&&(we=pd()):(as=le,An="value"in as?as.value:as.textContent,wl=!0)),Ge=Dn(U,De),0<Ge.length&&(De=new gd(De,a,null,u,le),fe.push({event:De,listeners:Ge}),we?De.data=we:(we=Jn(u),we!==null&&(De.data=we)))),(we=Om?fx(a,u):Lm(a,u))&&(De=Dn(U,"onBeforeInput"),0<De.length&&(Ge=new gd("onBeforeInput","beforeinput",null,u,le),fe.push({event:Ge,listeners:De}),Ge.data=we)),Jp(fe,a,U,u,le)}kf(fe,i)})}function Ro(a,i,u){return{instance:a,listener:i,currentTarget:u}}function Dn(a,i){for(var u=i+"Capture",d=[];a!==null;){var p=a,y=p.stateNode;p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=lu(a,u),p!=null&&d.unshift(Ro(a,p,y)),p=lu(a,i),p!=null&&d.push(Ro(a,p,y))),a=a.return}return d}function _i(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Xx(a,i,u,d,p){for(var y=i._reactName,S=[];u!==null&&u!==d;){var B=u,D=B.alternate,U=B.stateNode;if(B=B.tag,D!==null&&D===d)break;B!==5&&B!==26&&B!==27||U===null||(D=U,p?(U=lu(u,y),U!=null&&S.unshift(Ro(u,U,D))):p||(U=lu(u,y),U!=null&&S.push(Ro(u,U,D)))),u=u.return}S.length!==0&&a.push({event:i,listeners:S})}var Qx=/\r\n?/g,Fg=/\u0000|\uFFFD/g;function W(a){return(typeof a=="string"?a:""+a).replace(Qx,`
|
|
93
|
+
`).replace(Fg,"")}function He(a,i){return i=W(i),W(a)===i}function Eo(){}function it(a,i,u,d,p,y){switch(u){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||fa(a,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&fa(a,""+d);break;case"className":eu(a,"class",d);break;case"tabIndex":eu(a,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":eu(a,u,d);break;case"style":Tm(a,d,y);break;case"data":if(i!=="object"){eu(a,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||u!=="href")){a.removeAttribute(u);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){a.removeAttribute(u);break}d=dd(""+d),a.setAttribute(u,d);break;case"action":case"formAction":if(typeof d=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(u==="formAction"?(i!=="input"&&it(a,i,"name",p.name,p,null),it(a,i,"formEncType",p.formEncType,p,null),it(a,i,"formMethod",p.formMethod,p,null),it(a,i,"formTarget",p.formTarget,p,null)):(it(a,i,"encType",p.encType,p,null),it(a,i,"method",p.method,p,null),it(a,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){a.removeAttribute(u);break}d=dd(""+d),a.setAttribute(u,d);break;case"onClick":d!=null&&(a.onclick=Eo);break;case"onScroll":d!=null&&We("scroll",a);break;case"onScrollEnd":d!=null&&We("scrollend",a);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(g(61));if(u=d.__html,u!=null){if(p.children!=null)throw Error(g(60));a.innerHTML=u}}break;case"multiple":a.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":a.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){a.removeAttribute("xlink:href");break}u=dd(""+d),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(u,""+d):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":d===!0?a.setAttribute(u,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(u,d):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?a.setAttribute(u,d):a.removeAttribute(u);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?a.removeAttribute(u):a.setAttribute(u,d);break;case"popover":We("beforetoggle",a),We("toggle",a),Qo(a,"popover",d);break;case"xlinkActuate":ol(a,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ol(a,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ol(a,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ol(a,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ol(a,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ol(a,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ol(a,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ol(a,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ol(a,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Qo(a,"is",d);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=tx.get(u)||u,Qo(a,u,d))}}function wf(a,i,u,d,p,y){switch(u){case"style":Tm(a,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(g(61));if(u=d.__html,u!=null){if(p.children!=null)throw Error(g(60));a.innerHTML=u}}break;case"children":typeof d=="string"?fa(a,d):(typeof d=="number"||typeof d=="bigint")&&fa(a,""+d);break;case"onScroll":d!=null&&We("scroll",a);break;case"onScrollEnd":d!=null&&We("scrollend",a);break;case"onClick":d!=null&&(a.onclick=Eo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vm.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(p=u.endsWith("Capture"),i=u.slice(2,p?u.length-7:void 0),y=a[$n]||null,y=y!=null?y[u]:null,typeof y=="function"&&a.removeEventListener(i,y,p),typeof d=="function")){typeof y!="function"&&y!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(i,d,p);break e}u in a?a[u]=d:d===!0?a.setAttribute(u,""):Qo(a,u,d)}}}function cn(a,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",a),We("load",a);var d=!1,p=!1,y;for(y in u)if(u.hasOwnProperty(y)){var S=u[y];if(S!=null)switch(y){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(g(137,i));default:it(a,i,y,S,u,null)}}p&&it(a,i,"srcSet",u.srcSet,u,null),d&&it(a,i,"src",u.src,u,null);return;case"input":We("invalid",a);var B=y=S=p=null,D=null,U=null;for(d in u)if(u.hasOwnProperty(d)){var le=u[d];if(le!=null)switch(d){case"name":p=le;break;case"type":S=le;break;case"checked":D=le;break;case"defaultChecked":U=le;break;case"value":y=le;break;case"defaultValue":B=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(g(137,i));break;default:it(a,i,d,le,u,null)}}Sm(a,y,B,D,U,S,p,!1),ud(a);return;case"select":We("invalid",a),d=S=y=null;for(p in u)if(u.hasOwnProperty(p)&&(B=u[p],B!=null))switch(p){case"value":y=B;break;case"defaultValue":S=B;break;case"multiple":d=B;default:it(a,i,p,B,u,null)}i=y,u=S,a.multiple=!!d,i!=null?Zo(a,!!d,i,!1):u!=null&&Zo(a,!!d,u,!0);return;case"textarea":We("invalid",a),y=p=d=null;for(S in u)if(u.hasOwnProperty(S)&&(B=u[S],B!=null))switch(S){case"value":d=B;break;case"defaultValue":p=B;break;case"children":y=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(g(91));break;default:it(a,i,S,B,u,null)}Ec(a,d,p,y),ud(a);return;case"option":for(D in u)if(u.hasOwnProperty(D)&&(d=u[D],d!=null))switch(D){case"selected":a.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:it(a,i,D,d,u,null)}return;case"dialog":We("cancel",a),We("close",a);break;case"iframe":case"object":We("load",a);break;case"video":case"audio":for(d=0;d<La.length;d++)We(La[d],a);break;case"image":We("error",a),We("load",a);break;case"details":We("toggle",a);break;case"embed":case"source":case"link":We("error",a),We("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in u)if(u.hasOwnProperty(U)&&(d=u[U],d!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(g(137,i));default:it(a,i,U,d,u,null)}return;default:if(Io(i)){for(le in u)u.hasOwnProperty(le)&&(d=u[le],d!==void 0&&wf(a,i,le,d,u,void 0));return}}for(B in u)u.hasOwnProperty(B)&&(d=u[B],d!=null&&it(a,i,B,d,u,null))}function Zx(a,i,u,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,S=null,B=null,D=null,U=null,le=null;for(ee in u){var fe=u[ee];if(u.hasOwnProperty(ee)&&fe!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":D=fe;default:d.hasOwnProperty(ee)||it(a,i,ee,null,d,fe)}}for(var K in d){var ee=d[K];if(fe=u[K],d.hasOwnProperty(K)&&(ee!=null||fe!=null))switch(K){case"type":y=ee;break;case"name":p=ee;break;case"checked":U=ee;break;case"defaultChecked":le=ee;break;case"value":S=ee;break;case"defaultValue":B=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(g(137,i));break;default:ee!==fe&&it(a,i,K,ee,d,fe)}}cd(a,S,B,D,U,le,y,p);return;case"select":ee=S=B=K=null;for(y in u)if(D=u[y],u.hasOwnProperty(y)&&D!=null)switch(y){case"value":break;case"multiple":ee=D;default:d.hasOwnProperty(y)||it(a,i,y,null,d,D)}for(p in d)if(y=d[p],D=u[p],d.hasOwnProperty(p)&&(y!=null||D!=null))switch(p){case"value":K=y;break;case"defaultValue":B=y;break;case"multiple":S=y;default:y!==D&&it(a,i,p,y,d,D)}i=B,u=S,d=ee,K!=null?Zo(a,!!u,K,!1):!!d!=!!u&&(i!=null?Zo(a,!!u,i,!0):Zo(a,!!u,u?[]:"",!1));return;case"textarea":ee=K=null;for(B in u)if(p=u[B],u.hasOwnProperty(B)&&p!=null&&!d.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:it(a,i,B,null,d,p)}for(S in d)if(p=d[S],y=u[S],d.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":K=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(g(91));break;default:p!==y&&it(a,i,S,p,d,y)}rd(a,K,ee);return;case"option":for(var Ce in u)if(K=u[Ce],u.hasOwnProperty(Ce)&&K!=null&&!d.hasOwnProperty(Ce))switch(Ce){case"selected":a.selected=!1;break;default:it(a,i,Ce,null,d,K)}for(D in d)if(K=d[D],ee=u[D],d.hasOwnProperty(D)&&K!==ee&&(K!=null||ee!=null))switch(D){case"selected":a.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:it(a,i,D,K,d,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _e in u)K=u[_e],u.hasOwnProperty(_e)&&K!=null&&!d.hasOwnProperty(_e)&&it(a,i,_e,null,d,K);for(U in d)if(K=d[U],ee=u[U],d.hasOwnProperty(U)&&K!==ee&&(K!=null||ee!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(g(137,i));break;default:it(a,i,U,K,d,ee)}return;default:if(Io(i)){for(var bt in u)K=u[bt],u.hasOwnProperty(bt)&&K!==void 0&&!d.hasOwnProperty(bt)&&wf(a,i,bt,void 0,d,K);for(le in d)K=d[le],ee=u[le],!d.hasOwnProperty(le)||K===ee||K===void 0&&ee===void 0||wf(a,i,le,K,d,ee);return}}for(var G in u)K=u[G],u.hasOwnProperty(G)&&K!=null&&!d.hasOwnProperty(G)&&it(a,i,G,null,d,K);for(fe in d)K=d[fe],ee=u[fe],!d.hasOwnProperty(fe)||K===ee||K==null&&ee==null||it(a,i,fe,K,d,ee)}var Df=null,Mf=null;function Rr(a){return a.nodeType===9?a:a.ownerDocument}function _f(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Pp(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function Er(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var jr=null;function Mn(){var a=window.event;return a&&a.type==="popstate"?a===jr?!1:(jr=a,!0):(jr=null,!1)}var Rl=typeof setTimeout=="function"?setTimeout:void 0,vn=typeof clearTimeout=="function"?clearTimeout:void 0,ht=typeof Promise=="function"?Promise:void 0,Pg=typeof queueMicrotask=="function"?queueMicrotask:typeof ht<"u"?function(a){return ht.resolve(null).then(a).catch(eh)}:Rl;function eh(a){setTimeout(function(){throw a})}function Sr(a,i){var u=i,d=0;do{var p=u.nextSibling;if(a.removeChild(u),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(d===0){a.removeChild(p),ec(i);return}d--}else u!=="$"&&u!=="$?"&&u!=="$!"||d++;u=p}while(u);ec(i)}function la(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":la(u),od(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function jo(a,i,u,d){for(;a.nodeType===1;){var p=u;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(d){if(!a[Go])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==p.rel||a.getAttribute("href")!==(p.href==null?null:p.href)||a.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||a.getAttribute("title")!==(p.title==null?null:p.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(p.src==null?null:p.src)||a.getAttribute("type")!==(p.type==null?null:p.type)||a.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=rn(a.nextSibling),a===null)break}return null}function Ar(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=rn(a.nextSibling),a===null))return null;return a}function rn(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="F!"||i==="F")break;if(i==="/$")return null}}return a}function Cr(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"){if(i===0)return a;i--}else u==="/$"&&i++}a=a.previousSibling}return null}function Ha(a,i,u){switch(i=Rr(u),a){case"html":if(a=i.documentElement,!a)throw Error(g(452));return a;case"head":if(a=i.head,!a)throw Error(g(453));return a;case"body":if(a=i.body,!a)throw Error(g(454));return a;default:throw Error(g(451))}}var tl=new Map,Ix=new Set;function Nf(a){return typeof a.getRootNode=="function"?a.getRootNode():a.ownerDocument}var Ms=Ne.d;Ne.d={f:Ua,r:ey,D:$u,C:ty,L:th,m:ny,X:Ku,S:ly,M:_n};function Ua(){var a=Ms.f(),i=Bi();return a||i}function ey(a){var i=Yo(a);i!==null&&i.tag===5&&i.type==="form"?cp(i):Ms.r(a)}var So=typeof document>"u"?null:document;function Of(a,i,u){var d=So;if(d&&typeof i=="string"&&i){var p=il(i);p='link[rel="'+a+'"][href="'+p+'"]',typeof u=="string"&&(p+='[crossorigin="'+u+'"]'),Ix.has(p)||(Ix.add(p),a={rel:a,crossOrigin:u,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),cn(i,"link",a),It(i),d.head.appendChild(i)))}}function $u(a){Ms.D(a),Of("dns-prefetch",a,null)}function ty(a,i){Ms.C(a,i),Of("preconnect",a,i)}function th(a,i,u){Ms.L(a,i,u);var d=So;if(d&&a&&i){var p='link[rel="preload"][as="'+il(i)+'"]';i==="image"&&u&&u.imageSrcSet?(p+='[imagesrcset="'+il(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(p+='[imagesizes="'+il(u.imageSizes)+'"]')):p+='[href="'+il(a)+'"]';var y=p;switch(i){case"style":y=Vn(a);break;case"script":y=Ju(a)}tl.has(y)||(a=xe({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),tl.set(y,a),d.querySelector(p)!==null||i==="style"&&d.querySelector(qn(y))||i==="script"&&d.querySelector(Ao(y))||(i=d.createElement("link"),cn(i,"link",a),It(i),d.head.appendChild(i)))}}function ny(a,i){Ms.m(a,i);var u=So;if(u&&a){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+il(d)+'"][href="'+il(a)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ju(a)}if(!tl.has(y)&&(a=xe({rel:"modulepreload",href:a},i),tl.set(y,a),u.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ao(y)))return}d=u.createElement("link"),cn(d,"link",a),It(d),u.head.appendChild(d)}}}function ly(a,i,u){Ms.S(a,i,u);var d=So;if(d&&a){var p=Gl(d).hoistableStyles,y=Vn(a);i=i||"default";var S=p.get(y);if(!S){var B={loading:0,preload:null};if(S=d.querySelector(qn(y)))B.loading=5;else{a=xe({rel:"stylesheet",href:a,"data-precedence":i},u),(u=tl.get(y))&&Ll(a,u);var D=S=d.createElement("link");It(D),cn(D,"link",a),D._p=new Promise(function(U,le){D.onload=U,D.onerror=le}),D.addEventListener("load",function(){B.loading|=1}),D.addEventListener("error",function(){B.loading|=2}),B.loading|=4,El(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:B},p.set(y,S)}}}function Ku(a,i){Ms.X(a,i);var u=So;if(u&&a){var d=Gl(u).hoistableScripts,p=Ju(a),y=d.get(p);y||(y=u.querySelector(Ao(p)),y||(a=xe({src:a,async:!0},i),(i=tl.get(p))&&aa(a,i),y=u.createElement("script"),It(y),cn(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function _n(a,i){Ms.M(a,i);var u=So;if(u&&a){var d=Gl(u).hoistableScripts,p=Ju(a),y=d.get(p);y||(y=u.querySelector(Ao(p)),y||(a=xe({src:a,async:!0,type:"module"},i),(i=tl.get(p))&&aa(a,i),y=u.createElement("script"),It(y),cn(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function Se(a,i,u,d){var p=(p=ca.current)?Nf(p):null;if(!p)throw Error(g(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=Vn(u.href),u=Gl(p).hoistableStyles,d=u.get(i),d||(d={type:"style",instance:null,count:0,state:null},u.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Vn(u.href);var y=Gl(p).hoistableStyles,S=y.get(a);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,S),(y=p.querySelector(qn(a)))&&!y._p&&(S.instance=y,S.state.loading=5),tl.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},tl.set(a,u),y||ay(p,a,u,S.state))),i&&d===null)throw Error(g(528,""));return S}if(i&&d!==null)throw Error(g(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Ju(u),u=Gl(p).hoistableScripts,d=u.get(i),d||(d={type:"script",instance:null,count:0,state:null},u.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,a))}}function Vn(a){return'href="'+il(a)+'"'}function qn(a){return'link[rel="stylesheet"]['+a+"]"}function Nn(a){return xe({},a,{"data-precedence":a.precedence,precedence:null})}function ay(a,i,u,d){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=a.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),cn(i,"link",u),It(i),a.head.appendChild(i))}function Ju(a){return'[src="'+il(a)+'"]'}function Ao(a){return"script[async]"+a}function Tr(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var d=a.querySelector('style[data-href~="'+il(u.href)+'"]');if(d)return i.instance=d,It(d),d;var p=xe({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return d=(a.ownerDocument||a).createElement("style"),It(d),cn(d,"style",p),El(d,u.precedence,a),i.instance=d;case"stylesheet":p=Vn(u.href);var y=a.querySelector(qn(p));if(y)return i.state.loading|=4,i.instance=y,It(y),y;d=Nn(u),(p=tl.get(p))&&Ll(d,p),y=(a.ownerDocument||a).createElement("link"),It(y);var S=y;return S._p=new Promise(function(B,D){S.onload=B,S.onerror=D}),cn(y,"link",d),i.state.loading|=4,El(y,u.precedence,a),i.instance=y;case"script":return y=Ju(u.src),(p=a.querySelector(Ao(y)))?(i.instance=p,It(p),p):(d=u,(p=tl.get(y))&&(d=xe({},u),aa(d,p)),a=a.ownerDocument||a,p=a.createElement("script"),It(p),cn(p,"link",d),a.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(g(443,i.type))}else i.type==="stylesheet"&&!(i.state.loading&4)&&(d=i.instance,i.state.loading|=4,El(d,u.precedence,a));return i.instance}function El(a,i,u){for(var d=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,y=p,S=0;S<d.length;S++){var B=d[S];if(B.dataset.precedence===i)y=B;else if(y!==p)break}y?y.parentNode.insertBefore(a,y.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(a,i.firstChild))}function Ll(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function aa(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var Ni=null;function _s(a,i,u){if(Ni===null){var d=new Map,p=Ni=new Map;p.set(u,d)}else p=Ni,d=p.get(u),d||(d=new Map,p.set(u,d));if(d.has(a))return d;for(d.set(a,null),u=u.getElementsByTagName(a),p=0;p<u.length;p++){var y=u[p];if(!(y[Go]||y[pn]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(i)||"";S=a+S;var B=d.get(S);B?B.push(y):d.set(S,[y])}}return d}function Rn(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function nl(a,i,u){if(u===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return a=i.disabled,typeof i.precedence=="string"&&a==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Co(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}var Oi=null;function sy(){}function oy(a,i,u){if(Oi===null)throw Error(g(475));var d=Oi;if(i.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var p=Vn(u.href),y=a.querySelector(qn(p));if(y){a=y._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(d.count++,d=To.bind(d),a.then(d,d)),i.state.loading|=4,i.instance=y,It(y);return}y=a.ownerDocument||a,u=Nn(u),(p=tl.get(p))&&Ll(u,p),y=y.createElement("link"),It(y);var S=y;S._p=new Promise(function(B,D){S.onload=B,S.onerror=D}),cn(y,"link",u),i.instance=y}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(i,a),(a=i.state.preload)&&!(i.state.loading&3)&&(d.count++,i=To.bind(d),a.addEventListener("load",i),a.addEventListener("error",i))}}function $x(){if(Oi===null)throw Error(g(475));var a=Oi;return a.stylesheets&&a.count===0&&Ns(a,a.stylesheets),0<a.count?function(i){var u=setTimeout(function(){if(a.stylesheets&&Ns(a,a.stylesheets),a.unsuspend){var d=a.unsuspend;a.unsuspend=null,d()}},6e4);return a.unsuspend=i,function(){a.unsuspend=null,clearTimeout(u)}}:null}function To(){if(this.count--,this.count===0){if(this.stylesheets)Ns(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var kr=null;function Ns(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,kr=new Map,i.forEach(nh,a),kr=null,To.call(a))}function nh(a,i){if(!(i.state.loading&4)){var u=kr.get(a);if(u)var d=u.get(null);else{u=new Map,kr.set(a,u);for(var p=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(u.set(S.dataset.precedence,S),d=S)}d&&u.set(null,d)}p=i.instance,S=p.getAttribute("data-precedence"),y=u.get(S)||d,y===d&&u.set(null,p),u.set(S,p),this.count++,d=To.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),y?y.parentNode.insertBefore(p,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(p,a.firstChild)),i.state.loading|=4}}var ll={$$typeof:Z,Provider:null,Consumer:null,_currentValue:Dt,_currentValue2:Dt,_threadCount:0};function iy(a,i,u,d,p,y,S,B){this.tag=1,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=es(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=es(0),this.hiddenUpdates=es(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function Kx(a,i,u,d,p,y,S,B,D,U,le,fe){return a=new iy(a,i,u,S,B,D,U,fe),i=1,y===!0&&(i|=24),y=Ft(3,null,null,i),a.current=y,y.stateNode=a,i=Fm(),i.refCount++,a.pooledCache=i,i.refCount++,y.memoizedState={element:d,isDehydrated:u,cache:i},or(y),a}function lh(a){return a?(a=ha,a):ha}function ah(a,i,u,d,p,y){p=lh(p),d.context===null?d.context=p:d.pendingContext=p,d=Ss(i),d.payload={element:u},y=y===void 0?null:y,y!==null&&(d.callback=y),u=As(a,d,i),u!==null&&(Pt(u,a,i),_u(u,a,i))}function Jx(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function zf(a,i){Jx(a,i),(a=a.alternate)&&Jx(a,i)}function sh(a){if(a.tag===13){var i=pa(a,67108864);i!==null&&Pt(i,a,67108864),zf(a,67108864)}}var Br=!0;function Wx(a,i,u,d){var p=J.T;J.T=null;var y=Ne.p;try{Ne.p=2,Lf(a,i,u,d)}finally{Ne.p=y,J.T=p}}function Fx(a,i,u,d){var p=J.T;J.T=null;var y=Ne.p;try{Ne.p=8,Lf(a,i,u,d)}finally{Ne.p=y,J.T=p}}function Lf(a,i,u,d){if(Br){var p=Hf(d);if(p===null)vr(a,i,d,wr,u),ih(a,d);else if(uy(p,a,i,u,d))d.stopPropagation();else if(ih(a,d),i&4&&-1<oh.indexOf(a)){for(;p!==null;){var y=Yo(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=Pa(y.pendingLanes);if(S!==0){var B=y;for(B.pendingLanes|=2,B.entangledLanes|=2;S;){var D=1<<31-In(S);B.entanglements[1]|=D,S&=~D}bl(y),!(St&6)&&(pr=Zn()+500,Xu(0))}}break;case 13:B=pa(y,2),B!==null&&Pt(B,y,2),Bi(),zf(y,2)}if(y=Hf(d),y===null&&vr(a,i,d,wr,u),y===p)break;p=y}p!==null&&d.stopPropagation()}else vr(a,i,d,null,u)}}function Hf(a){return a=Bm(a),Uf(a)}var wr=null;function Uf(a){if(wr=null,a=ls(a),a!==null){var i=re(a);if(i===null)a=null;else{var u=i.tag;if(u===13){if(a=Ae(i),a!==null)return a;a=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return wr=a,null}function Px(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(zg()){case $h:return 2;case Ys:return 8;case Uo:case xc:return 32;case Kh:return 268435456;default:return 32}default:return 32}}var Vf=!1,ko=null,Bo=null,Os=null,wo=new Map,Do=new Map,jl=[],oh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ih(a,i){switch(a){case"focusin":case"focusout":ko=null;break;case"dragenter":case"dragleave":Bo=null;break;case"mouseover":case"mouseout":Os=null;break;case"pointerover":case"pointerout":wo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(i.pointerId)}}function Wu(a,i,u,d,p,y){return a===null||a.nativeEvent!==y?(a={blockedOn:i,domEventName:u,eventSystemFlags:d,nativeEvent:y,targetContainers:[p]},i!==null&&(i=Yo(i),i!==null&&sh(i)),a):(a.eventSystemFlags|=d,i=a.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),a)}function uy(a,i,u,d,p){switch(i){case"focusin":return ko=Wu(ko,a,i,u,d,p),!0;case"dragenter":return Bo=Wu(Bo,a,i,u,d,p),!0;case"mouseover":return Os=Wu(Os,a,i,u,d,p),!0;case"pointerover":var y=p.pointerId;return wo.set(y,Wu(wo.get(y)||null,a,i,u,d,p)),!0;case"gotpointercapture":return y=p.pointerId,Do.set(y,Wu(Do.get(y)||null,a,i,u,d,p)),!0}return!1}function eg(a){var i=ls(a.target);if(i!==null){var u=re(i);if(u!==null){if(i=u.tag,i===13){if(i=Ae(u),i!==null){a.blockedOn=i,ts(a.priority,function(){if(u.tag===13){var d=wn(),p=pa(u,d);p!==null&&Pt(p,u,d),zf(u,d)}});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function qf(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=Hf(a.nativeEvent);if(u===null){u=a.nativeEvent;var d=new u.constructor(u.type,u);km=d,u.target.dispatchEvent(d),km=null}else return i=Yo(u),i!==null&&sh(i),a.blockedOn=u,!1;i.shift()}return!0}function uh(a,i,u){qf(a)&&u.delete(i)}function Fu(){Vf=!1,ko!==null&&qf(ko)&&(ko=null),Bo!==null&&qf(Bo)&&(Bo=null),Os!==null&&qf(Os)&&(Os=null),wo.forEach(uh),Do.forEach(uh)}function Pu(a,i){a.blockedOn===i&&(a.blockedOn=null,Vf||(Vf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Fu)))}var Dr=null;function ch(a){Dr!==a&&(Dr=a,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Dr===a&&(Dr=null);for(var i=0;i<a.length;i+=3){var u=a[i],d=a[i+1],p=a[i+2];if(typeof d!="function"){if(Uf(d||u)===null)continue;break}var y=Yo(u);y!==null&&(a.splice(i,3),i-=3,bs(y,{pending:!0,data:p,method:u.method,action:d},d,p))}}))}function ec(a){function i(D){return Pu(D,a)}ko!==null&&Pu(ko,a),Bo!==null&&Pu(Bo,a),Os!==null&&Pu(Os,a),wo.forEach(i),Do.forEach(i);for(var u=0;u<jl.length;u++){var d=jl[u];d.blockedOn===a&&(d.blockedOn=null)}for(;0<jl.length&&(u=jl[0],u.blockedOn===null);)eg(u),u.blockedOn===null&&jl.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(d=0;d<u.length;d+=3){var p=u[d],y=u[d+1],S=p[$n]||null;if(typeof y=="function")S||ch(u);else if(S){var B=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[$n]||null)B=S.formAction;else if(Uf(p)!==null)continue}else B=S.action;typeof B=="function"?u[d+1]=B:(u.splice(d,3),d-=3),ch(u)}}}function rh(a){this._internalRoot=a}zi.prototype.render=rh.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(g(409));var u=i.current,d=wn();ah(u,d,a,i,null,null)},zi.prototype.unmount=rh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;a.tag===0&&wi(),ah(a.current,2,null,a,null,null),Bi(),i[ns]=null}};function zi(a){this._internalRoot=a}zi.prototype.unstable_scheduleHydration=function(a){if(a){var i=vc();a={blockedOn:null,target:a,priority:i};for(var u=0;u<jl.length&&i!==0&&i<jl[u].priority;u++);jl.splice(u,0,a),u===0&&eg(a)}};var dh=h.version;if(dh!=="19.0.0")throw Error(g(527,dh,"19.0.0"));Ne.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(g(188)):(a=Object.keys(a).join(","),Error(g(268,a)));return a=Ve(i),a=a!==null?qe(a):null,a=a===null?null:a.stateNode,a};var tc={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:J,findFiberByHostInstance:ls,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gf.isDisabled&&Gf.supportsFiber)try{Vo=Gf.inject(tc),mn=Gf}catch{}}return reactDomClient_production.createRoot=function(a,i){if(!v(a))throw Error(g(299));var u=!1,d="",p=Tx,y=Wl,S=bp,B=null;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(B=i.unstable_transitionCallbacks)),i=Kx(a,1,!1,null,null,u,d,p,y,S,B,null),a[ns]=i.current,Mi(a.nodeType===8?a.parentNode:a),new rh(i)},reactDomClient_production.hydrateRoot=function(a,i,u){if(!v(a))throw Error(g(299));var d=!1,p="",y=Tx,S=Wl,B=bp,D=null,U=null;return u!=null&&(u.unstable_strictMode===!0&&(d=!0),u.identifierPrefix!==void 0&&(p=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(B=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(D=u.unstable_transitionCallbacks),u.formState!==void 0&&(U=u.formState)),i=Kx(a,1,!0,i,u??null,d,p,y,S,B,D,U),i.context=lh(null),u=i.current,d=wn(),p=Ss(d),p.callback=null,As(u,p,d),i.current.lanes=d,da(i,d),bl(i),a[ns]=i.current,Mi(a),new zi(i)},reactDomClient_production.version="19.0.0",reactDomClient_production}var reactDomClient_development={};/**
|
|
94
|
+
* @license React
|
|
95
|
+
* react-dom-client.development.js
|
|
96
|
+
*
|
|
97
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the MIT license found in the
|
|
100
|
+
* LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/var hasRequiredReactDomClient_development;function requireReactDomClient_development(){return hasRequiredReactDomClient_development||(hasRequiredReactDomClient_development=1,process.env.NODE_ENV!=="production"&&function(){function r(n,l){for(n=n.memoizedState;n!==null&&0<l;)n=n.next,l--;return n}function h(n,l,o,c){if(o>=l.length)return c;var f=l[o],m=vn(n)?n.slice():He({},n);return m[f]=h(n[f],l,o+1,c),m}function x(n,l,o){if(l.length!==o.length)console.warn("copyWithRename() expects paths of the same length");else{for(var c=0;c<o.length-1;c++)if(l[c]!==o[c]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return g(n,l,o,0)}}function g(n,l,o,c){var f=l[c],m=vn(n)?n.slice():He({},n);return c+1===l.length?(m[o[c]]=m[f],vn(m)?m.splice(f,1):delete m[f]):m[f]=g(n[f],l,o,c+1),m}function v(n,l,o){var c=l[o],f=vn(n)?n.slice():He({},n);return o+1===l.length?(vn(f)?f.splice(c,1):delete f[c],f):(f[c]=v(n[c],l,o+1),f)}function R(){return!1}function A(){return null}function j(n,l,o,c){return new kx(n,l,o,c)}function C(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function T(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function M(){}function O(){}function z(n){var l=[];return n.forEach(function(o){l.push(o)}),l.sort().join(", ")}function Z(n,l){n.context===nc&&(Gx(l,n,null,null),ml())}function q(n,l){if(qa!==null){var o=l.staleFamilies;l=l.updatedFamilies,Cs(),Nm(n.current,l,o),ml()}}function Y(n){qa=n}function P(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function he(n){return n===null||typeof n!="object"?null:(n=Qx&&n[Qx]||n["@@iterator"],typeof n=="function"?n:null)}function te(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Fg?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case La:return"Fragment";case Iu:return"Portal";case kf:return"Profiler";case Tf:return"StrictMode";case Bf:return"Suspense";case vr:return"SuspenseList"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case vl:return(n.displayName||"Context")+".Provider";case br:return(n._context.displayName||"Context")+".Consumer";case Mi:var l=n.render;return n=n.displayName,n||(n=l.displayName||l.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Ro:return l=n.displayName||null,l!==null?l:te(n.type)||"Memo";case Dn:l=n._payload,n=n._init;try{return te(n(l))}catch{}}return null}function ue(n){return typeof n.tag=="number"?X(n):typeof n.name=="string"?n.name:null}function X(n){var l=n.type;switch(n.tag){case 24:return"Cache";case 9:return(l._context.displayName||"Context")+".Consumer";case 10:return(l.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=l.render,n=n.displayName||n.name||"",l.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(l);case 8:return l===Tf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;break;case 29:if(l=n._debugInfo,l!=null){for(var o=l.length-1;0<=o;o--)if(typeof l[o].name=="string")return l[o].name}if(n.return!==null)return X(n.return)}return null}function se(){}function pe(){if(Eo===0){it=console.log,wf=console.info,cn=console.warn,Zx=console.error,Df=console.group,Mf=console.groupCollapsed,Rr=console.groupEnd;var n={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}Eo++}function ve(){if(Eo--,Eo===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:He({},n,{value:it}),info:He({},n,{value:wf}),warn:He({},n,{value:cn}),error:He({},n,{value:Zx}),group:He({},n,{value:Df}),groupCollapsed:He({},n,{value:Mf}),groupEnd:He({},n,{value:Rr})})}0>Eo&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Me(n){if(_f===void 0)try{throw Error()}catch(o){var l=o.stack.trim().match(/\n( *(at )?)/);_f=l&&l[1]||"",Pp=-1<o.stack.indexOf(`
|
|
102
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
103
|
+
`+_f+n+Pp}function J(n,l){if(!n||Er)return"";var o=jr.get(n);if(o!==void 0)return o;Er=!0,o=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var c=null;c=W.H,W.H=null,pe();try{var f={DetermineComponentFrameRoot:function(){try{if(l){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(Be){var ce=Be}Reflect.construct(n,[],$)}else{try{$.call()}catch(Be){ce=Be}n.call($.prototype)}}else{try{throw Error()}catch(Be){ce=Be}($=n())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(Be){if(Be&&ce&&typeof Be.stack=="string")return[Be.stack,ce.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=f.DetermineComponentFrameRoot(),E=b[0],k=b[1];if(E&&k){var w=E.split(`
|
|
104
|
+
`),I=k.split(`
|
|
105
|
+
`);for(b=m=0;m<w.length&&!w[m].includes("DetermineComponentFrameRoot");)m++;for(;b<I.length&&!I[b].includes("DetermineComponentFrameRoot");)b++;if(m===w.length||b===I.length)for(m=w.length-1,b=I.length-1;1<=m&&0<=b&&w[m]!==I[b];)b--;for(;1<=m&&0<=b;m--,b--)if(w[m]!==I[b]){if(m!==1||b!==1)do if(m--,b--,0>b||w[m]!==I[b]){var ae=`
|
|
106
|
+
`+w[m].replace(" at new "," at ");return n.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",n.displayName)),typeof n=="function"&&jr.set(n,ae),ae}while(1<=m&&0<=b);break}}}finally{Er=!1,W.H=c,ve(),Error.prepareStackTrace=o}return w=(w=n?n.displayName||n.name:"")?Me(w):"",typeof n=="function"&&jr.set(n,w),w}function xe(n){switch(n.tag){case 26:case 27:case 5:return Me(n.type);case 16:return Me("Lazy");case 13:return Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return n=J(n.type,!1),n;case 11:return n=J(n.type.render,!1),n;case 1:return n=J(n.type,!0),n;default:return""}}function be(n){try{var l="";do{l+=xe(n);var o=n._debugInfo;if(o)for(var c=o.length-1;0<=c;c--){var f=o[c];if(typeof f.name=="string"){var m=l,b=f.env,E=Me(f.name+(b?" ["+b+"]":""));l=m+E}}n=n.return}while(n);return l}catch(k){return`
|
|
107
|
+
Error generating stack: `+k.message+`
|
|
108
|
+
`+k.stack}}function ge(){if(Mn===null)return null;var n=Mn._debugOwner;return n!=null?ue(n):null}function je(){return Mn===null?"":be(Mn)}function oe(n,l,o,c,f,m,b){var E=Mn;W.getCurrentStack=n===null?null:je,Rl=!1,Mn=n;try{return l(o,c,f,m,b)}finally{Mn=E}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function me(n){var l=n,o=n;if(n.alternate)for(;l.return;)l=l.return;else{n=l;do l=n,l.flags&4098&&(o=l.return),n=l.return;while(n)}return l.tag===3?o:null}function V(n){if(n.tag===13){var l=n.memoizedState;if(l===null&&(n=n.alternate,n!==null&&(l=n.memoizedState)),l!==null)return l.dehydrated}return null}function ie(n){if(me(n)!==n)throw Error("Unable to find node on an unmounted component.")}function re(n){var l=n.alternate;if(!l){if(l=me(n),l===null)throw Error("Unable to find node on an unmounted component.");return l!==n?null:n}for(var o=n,c=l;;){var f=o.return;if(f===null)break;var m=f.alternate;if(m===null){if(c=f.return,c!==null){o=c;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===o)return ie(f),n;if(m===c)return ie(f),l;m=m.sibling}throw Error("Unable to find node on an unmounted component.")}if(o.return!==c.return)o=f,c=m;else{for(var b=!1,E=f.child;E;){if(E===o){b=!0,o=f,c=m;break}if(E===c){b=!0,c=f,o=m;break}E=E.sibling}if(!b){for(E=m.child;E;){if(E===o){b=!0,o=m,c=f;break}if(E===c){b=!0,c=m,o=f;break}E=E.sibling}if(!b)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(o.alternate!==c)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(o.tag!==3)throw Error("Unable to find node on an unmounted component.");return o.stateNode.current===o?n:l}function Ae(n){var l=n.tag;if(l===5||l===26||l===27||l===6)return n;for(n=n.child;n!==null;){if(l=Ae(n),l!==null)return l;n=n.sibling}return null}function Re(n){return{current:n}}function Ve(n,l){0>la?console.error("Unexpected pop."):(l!==Sr[la]&&console.error("Unexpected Fiber popped."),n.current=eh[la],eh[la]=null,Sr[la]=null,la--)}function qe(n,l,o){la++,eh[la]=n.current,Sr[la]=o,n.current=l}function Xt(n){return n===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),n}function Ne(n,l){qe(rn,l,n),qe(Ar,n,n),qe(jo,null,n);var o=l.nodeType;switch(o){case 9:case 11:o=o===9?"#document":"#fragment",l=(l=l.documentElement)&&(l=l.namespaceURI)?Ux(l):Ii;break;default:if(l=o===8?l.parentNode:l,o=l.tagName,l=l.namespaceURI)l=Ux(l),l=St(l,o);else switch(o){case"svg":l=pm;break;case"math":l=Bg;break;default:l=Ii}}o=o.toLowerCase(),o=cd(null,o),o={context:l,ancestorInfo:o},Ve(jo,n),qe(jo,o,n)}function Dt(n){Ve(jo,n),Ve(Ar,n),Ve(rn,n)}function Wa(){return Xt(jo.current)}function qs(n){n.memoizedState!==null&&qe(Cr,n,n);var l=Xt(jo.current),o=n.type,c=St(l.context,o);o=cd(l.ancestorInfo,o),c={context:c,ancestorInfo:o},l!==c&&(qe(Ar,n,n),qe(jo,c,n))}function sl(n){Ar.current===n&&(Ve(jo,n),Ve(Ar,n)),Cr.current===n&&(Ve(Cr,n),Yh._currentValue=Fr)}function zt(n){return typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object"}function dt(n){try{return Qn(n),!1}catch{return!0}}function Qn(n){return""+n}function at(n,l){if(dt(n))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",l,zt(n)),Qn(n)}function ca(n,l){if(dt(n))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",l,zt(n)),Qn(n)}function Lo(n){if(dt(n))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",zt(n)),Qn(n)}function Pr(n){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(l.isDisabled)return!0;if(!l.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{Ku=l.inject(n),_n=l}catch(o){console.error("React instrumentation encountered an error: %s.",o)}return!!l.checkDCE}function Ji(n,l){if(_n&&typeof _n.onCommitFiberRoot=="function")try{var o=(n.current.flags&128)===128;switch(l){case El:var c=So;break;case Ll:c=Of;break;case aa:c=$u;break;case Ni:c=th;break;default:c=$u}_n.onCommitFiberRoot(Ku,n,c,o)}catch(f){Vn||(Vn=!0,console.error("React instrumentation encountered an error: %s",f))}}function mt(n){if(typeof ny=="function"&&ly(n),_n&&typeof _n.setStrictMode=="function")try{_n.setStrictMode(Ku,n)}catch(l){Vn||(Vn=!0,console.error("React instrumentation encountered an error: %s",l))}}function ed(n){Se=n}function td(){Se!==null&&typeof Se.markCommitStopped=="function"&&Se.markCommitStopped()}function Ho(n){Se!==null&&typeof Se.markComponentRenderStarted=="function"&&Se.markComponentRenderStarted(n)}function Gs(){Se!==null&&typeof Se.markComponentRenderStopped=="function"&&Se.markComponentRenderStopped()}function Zh(n){Se!==null&&typeof Se.markRenderStarted=="function"&&Se.markRenderStarted(n)}function Ih(){Se!==null&&typeof Se.markRenderStopped=="function"&&Se.markRenderStopped()}function Zn(n,l){Se!==null&&typeof Se.markStateUpdateScheduled=="function"&&Se.markStateUpdateScheduled(n,l)}function zg(n){return n>>>=0,n===0?32:31-(ay(n)/Ju|0)|0}function $h(n){if(n&1)return"SyncHydrationLane";if(n&2)return"Sync";if(n&4)return"InputContinuousHydration";if(n&8)return"InputContinuous";if(n&16)return"DefaultHydration";if(n&32)return"Default";if(n&64)return"TransitionHydration";if(n&4194176)return"Transition";if(n&62914560)return"Retry";if(n&67108864)return"SelectiveHydration";if(n&134217728)return"IdleHydration";if(n&268435456)return"Idle";if(n&536870912)return"Offscreen";if(n&1073741824)return"Deferred"}function Ys(n){var l=n&42;if(l!==0)return l;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),n}}function Uo(n,l){var o=n.pendingLanes;if(o===0)return 0;var c=0,f=n.suspendedLanes,m=n.pingedLanes,b=n.warmLanes;n=n.finishedLanes!==0;var E=o&134217727;return E!==0?(o=E&~f,o!==0?c=Ys(o):(m&=E,m!==0?c=Ys(m):n||(b=E&~b,b!==0&&(c=Ys(b))))):(E=o&~f,E!==0?c=Ys(E):m!==0?c=Ys(m):n||(b=o&~b,b!==0&&(c=Ys(b)))),c===0?0:l!==0&&l!==c&&!(l&f)&&(f=c&-c,b=l&-l,f>=b||f===32&&(b&4194176)!==0)?l:c}function xc(n,l){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&l)===0}function Kh(n,l){switch(n){case 1:case 2:case 4:case 8:return l+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function Jh(){var n=Ao;return Ao<<=1,!(Ao&4194176)&&(Ao=128),n}function Wh(){var n=Tr;return Tr<<=1,!(Tr&62914560)&&(Tr=4194304),n}function Vo(n){for(var l=[],o=0;31>o;o++)l.push(n);return l}function mn(n,l){n.pendingLanes|=l,l!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Lg(n,l,o,c,f,m){var b=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var E=n.entanglements,k=n.expirationTimes,w=n.hiddenUpdates;for(o=b&~o;0<o;){var I=31-Nn(o),ae=1<<I;E[I]=0,k[I]=-1;var $=w[I];if($!==null)for(w[I]=null,I=0;I<$.length;I++){var ce=$[I];ce!==null&&(ce.lane&=-536870913)}o&=~ae}c!==0&&Fa(n,c,0),m!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=m&~(b&~l))}function Fa(n,l,o){n.pendingLanes|=l,n.suspendedLanes&=~l;var c=31-Nn(l);n.entangledLanes|=l,n.entanglements[c]=n.entanglements[c]|1073741824|o&4194218}function In(n,l){var o=n.entangledLanes|=l;for(n=n.entanglements;o;){var c=31-Nn(o),f=1<<c;f&l|n[c]&l&&(n[c]|=l),o&=~f}}function Fh(n,l,o){if(qn)for(n=n.pendingUpdatersLaneMap;0<o;){var c=31-Nn(o),f=1<<c;n[c].add(l),o&=~f}}function Ph(n,l){if(qn)for(var o=n.pendingUpdatersLaneMap,c=n.memoizedUpdaters;0<l;){var f=31-Nn(l);n=1<<f,f=o[f],0<f.size&&(f.forEach(function(m){var b=m.alternate;b!==null&&c.has(b)||c.add(m)}),f.clear()),l&=~n}}function ex(n){return n&=-n,El<n?Ll<n?n&134217727?aa:Ni:Ll:El}function gc(){var n=ht.p;return n!==0?n:(n=window.event,n===void 0?aa:Di(n.type))}function nd(n,l){var o=ht.p;try{return ht.p=n,l()}finally{ht.p=o}}function Pa(n){delete n[Rn],delete n[nl],delete n[Oi],delete n[sy],delete n[oy]}function ra(n){var l=n[Rn];if(l)return l;for(var o=n.parentNode;o;){if(l=o[Co]||o[Rn]){if(o=l.alternate,l.child!==null||o!==null&&o.child!==null)for(n=Ds(n);n!==null;){if(o=n[Rn])return o;n=Ds(n)}return l}n=o,o=n.parentNode}return null}function ql(n){if(n=n[Rn]||n[Co]){var l=n.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return n}return null}function yc(n){var l=n.tag;if(l===5||l===26||l===27||l===6)return n.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function qo(n){var l=n[$x];return l||(l=n[$x]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Qt(n){n[To]=!0}function es(n,l){da(n,l),da(n+"Capture",l)}function da(n,l){Ns[n]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",n),Ns[n]=l;var o=n.toLowerCase();for(nh[o]=n,n==="onDoubleClick"&&(nh.ondblclick=n),n=0;n<l.length;n++)kr.add(l[n])}function Wi(n,l){iy[l.type]||l.onChange||l.onInput||l.readOnly||l.disabled||l.value==null||console.error(n==="select"?"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`.":"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),l.onChange||l.readOnly||l.disabled||l.checked==null||console.error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function ld(n){return Ha.call(ah,n)?!0:Ha.call(lh,n)?!1:Kx.test(n)?ah[n]=!0:(lh[n]=!0,console.error("Invalid attribute name: `%s`",n),!1)}function gm(n,l,o){if(ld(l)){if(!n.hasAttribute(l)){switch(typeof o){case"symbol":case"object":return o;case"function":return o;case"boolean":if(o===!1)return o}return o===void 0?void 0:null}return n=n.getAttribute(l),n===""&&o===!0?!0:(at(o,l),n===""+o?o:n)}}function bc(n,l,o){if(ld(l))if(o===null)n.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(l);return;case"boolean":var c=l.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(l);return}}at(o,l),n.setAttribute(l,""+o)}}function vc(n,l,o){if(o===null)n.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}at(o,l),n.setAttribute(l,""+o)}}function ts(n,l,o,c){if(c===null)n.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}at(c,o),n.setAttributeNS(l,o,""+c)}}function Zt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return Lo(n),n;default:return""}}function pn(n){var l=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function $n(n){var l=pn(n)?"checked":"value",o=Object.getOwnPropertyDescriptor(n.constructor.prototype,l);Lo(n[l]);var c=""+n[l];if(!n.hasOwnProperty(l)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,m=o.set;return Object.defineProperty(n,l,{configurable:!0,get:function(){return f.call(this)},set:function(b){Lo(b),c=""+b,m.call(this,b)}}),Object.defineProperty(n,l,{enumerable:o.enumerable}),{getValue:function(){return c},setValue:function(b){Lo(b),c=""+b},stopTracking:function(){n._valueTracker=null,delete n[l]}}}}function ns(n){n._valueTracker||(n._valueTracker=$n(n))}function ad(n){if(!n)return!1;var l=n._valueTracker;if(!l)return!0;var o=l.getValue(),c="";return n&&(c=pn(n)?n.checked?"true":"false":n.value),n=c,n!==o?(l.setValue(n),!0):!1}function sd(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Bl(n){return n.replace(Jx,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function ym(n,l){l.checked===void 0||l.defaultChecked===void 0||sh||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",ge()||"A component",l.type),sh=!0),l.value===void 0||l.defaultValue===void 0||zf||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",ge()||"A component",l.type),zf=!0)}function Go(n,l,o,c,f,m,b,E){n.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?(at(b,"type"),n.type=b):n.removeAttribute("type"),l!=null?b==="number"?(l===0&&n.value===""||n.value!=l)&&(n.value=""+Zt(l)):n.value!==""+Zt(l)&&(n.value=""+Zt(l)):b!=="submit"&&b!=="reset"||n.removeAttribute("value"),l!=null?ls(n,b,Zt(l)):o!=null?ls(n,b,Zt(o)):c!=null&&n.removeAttribute("value"),f==null&&m!=null&&(n.defaultChecked=!!m),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?(at(E,"name"),n.name=""+Zt(E)):n.removeAttribute("name")}function od(n,l,o,c,f,m,b,E){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(at(m,"type"),n.type=m),l!=null||o!=null){if(!(m!=="submit"&&m!=="reset"||l!=null))return;o=o!=null?""+Zt(o):"",l=l!=null?""+Zt(l):o,E||l===n.value||(n.value=l),n.defaultValue=l}c=c??f,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=E?n.checked:!!c,n.defaultChecked=!!c,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(at(b,"name"),n.name=b)}function ls(n,l,o){l==="number"&&sd(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Yo(n,l){l.value==null&&(typeof l.children=="object"&&l.children!==null?Jp.Children.forEach(l.children,function(o){o==null||typeof o=="string"||typeof o=="number"||typeof o=="bigint"||Wx||(Wx=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."))}):l.dangerouslySetInnerHTML==null||Fx||(Fx=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),l.selected==null||Br||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),Br=!0)}function Fi(){var n=ge();return n?`
|
|
109
|
+
|
|
110
|
+
Check the render method of \``+n+"`.":""}function Gl(n,l,o,c){if(n=n.options,l){l={};for(var f=0;f<o.length;f++)l["$"+o[f]]=!0;for(o=0;o<n.length;o++)f=l.hasOwnProperty("$"+n[o].value),n[o].selected!==f&&(n[o].selected=f),f&&c&&(n[o].defaultSelected=!0)}else{for(o=""+Zt(o),l=null,f=0;f<n.length;f++){if(n[f].value===o){n[f].selected=!0,c&&(n[f].defaultSelected=!0);return}l!==null||n[f].disabled||(l=n[f])}l!==null&&(l.selected=!0)}}function It(n,l){for(n=0;n<Hf.length;n++){var o=Hf[n];if(l[o]!=null){var c=vn(l[o]);l.multiple&&!c?console.error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",o,Fi()):!l.multiple&&c&&console.error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",o,Fi())}}l.value===void 0||l.defaultValue===void 0||Lf||(console.error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://react.dev/link/controlled-components"),Lf=!0)}function bm(n,l){l.value===void 0||l.defaultValue===void 0||wr||(console.error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components",ge()||"A component"),wr=!0),l.children!=null&&l.value==null&&console.error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.")}function vm(n,l,o){if(l!=null&&(l=""+Zt(l),l!==n.value&&(n.value=l),o==null)){n.defaultValue!==l&&(n.defaultValue=l);return}n.defaultValue=o!=null?""+Zt(o):""}function Xs(n,l,o,c){if(l==null){if(c!=null){if(o!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(vn(c)){if(1<c.length)throw Error("<textarea> can only have at most one child.");c=c[0]}o=c}o==null&&(o=""),l=o}o=Zt(l),n.defaultValue=o,c=n.textContent,c===o&&c!==""&&c!==null&&(n.value=c)}function Xo(n,l){return n.serverProps===void 0&&n.serverTail.length===0&&n.children.length===1&&3<n.distanceFromLeaf&&n.distanceFromLeaf>15-l?Xo(n.children[0],l):n}function Lt(n){return" "+" ".repeat(n)}function Pi(n){return"+ "+" ".repeat(n)}function Qs(n){return"- "+" ".repeat(n)}function Rm(n){switch(n.tag){case 26:case 27:case 5:return n.type;case 16:return"Lazy";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return n=n.type,n.displayName||n.name||null;case 11:return n=n.type.render,n.displayName||n.name||null;case 1:return n=n.type,n.displayName||n.name||null;default:return null}}function Rc(n,l){return Uf.test(n)?(n=JSON.stringify(n),n.length>l-2?8>l?'{"..."}':"{"+n.slice(0,l-7)+'..."}':"{"+n+"}"):n.length>l?5>l?'{"..."}':n.slice(0,l-3)+"...":n}function Qo(n,l,o){var c=120-2*o;if(l===null)return Pi(o)+Rc(n,c)+`
|
|
111
|
+
`;if(typeof l=="string"){for(var f=0;f<l.length&&f<n.length&&l.charCodeAt(f)===n.charCodeAt(f);f++);return f>c-8&&10<f&&(n="..."+n.slice(f-8),l="..."+l.slice(f-8)),Pi(o)+Rc(n,c)+`
|
|
112
|
+
`+Qs(o)+Rc(l,c)+`
|
|
113
|
+
`}return Lt(o)+Rc(n,c)+`
|
|
114
|
+
`}function eu(n){return Object.prototype.toString.call(n).replace(/^\[object (.*)\]$/,function(l,o){return o})}function ol(n,l){switch(typeof n){case"string":return n=JSON.stringify(n),n.length>l?5>l?'"..."':n.slice(0,l-4)+'..."':n;case"object":if(n===null)return"null";if(vn(n))return"[...]";if(n.$$typeof===vo)return(l=te(n.type))?"<"+l+">":"<...>";var o=eu(n);if(o==="Object"){o="",l-=2;for(var c in n)if(n.hasOwnProperty(c)){var f=JSON.stringify(c);if(f!=='"'+c+'"'&&(c=f),l-=c.length-2,f=ol(n[c],15>l?l:15),l-=f.length,0>l){o+=o===""?"...":", ...";break}o+=(o===""?"":",")+c+":"+f}return"{"+o+"}"}return o;case"function":return(l=n.displayName||n.name)?"function "+l:"function";default:return String(n)}}function hn(n,l){return typeof n!="string"||Uf.test(n)?"{"+ol(n,l-2)+"}":n.length>l-2?5>l?'"..."':'"'+n.slice(0,l-5)+'..."':'"'+n+'"'}function id(n,l,o){var c=120-o.length-n.length,f=[],m;for(m in l)if(l.hasOwnProperty(m)&&m!=="children"){var b=hn(l[m],120-o.length-m.length-1);c-=m.length+b.length+2,f.push(m+"="+b)}return f.length===0?o+"<"+n+`>
|
|
115
|
+
`:0<c?o+"<"+n+" "+f.join(" ")+`>
|
|
116
|
+
`:o+"<"+n+`
|
|
117
|
+
`+o+" "+f.join(`
|
|
118
|
+
`+o+" ")+`
|
|
119
|
+
`+o+`>
|
|
120
|
+
`}function Hg(n,l,o){var c="",f=He({},l),m;for(m in n)if(n.hasOwnProperty(m)){delete f[m];var b=120-2*o-m.length-2,E=ol(n[m],b);l.hasOwnProperty(m)?(b=ol(l[m],b),c+=Pi(o)+m+": "+E+`
|
|
121
|
+
`,c+=Qs(o)+m+": "+b+`
|
|
122
|
+
`):c+=Pi(o)+m+": "+E+`
|
|
123
|
+
`}for(var k in f)f.hasOwnProperty(k)&&(n=ol(f[k],120-2*o-k.length-2),c+=Qs(o)+k+": "+n+`
|
|
124
|
+
`);return c}function ud(n,l,o,c){var f="",m=new Map;for(w in o)o.hasOwnProperty(w)&&m.set(w.toLowerCase(),w);if(m.size===1&&m.has("children"))f+=id(n,l,Lt(c));else{for(var b in l)if(l.hasOwnProperty(b)&&b!=="children"){var E=120-2*(c+1)-b.length-1,k=m.get(b.toLowerCase());if(k!==void 0){m.delete(b.toLowerCase());var w=l[b];k=o[k];var I=hn(w,E);E=hn(k,E),typeof w=="object"&&w!==null&&typeof k=="object"&&k!==null&&eu(w)==="Object"&&eu(k)==="Object"&&(2<Object.keys(w).length||2<Object.keys(k).length||-1<I.indexOf("...")||-1<E.indexOf("..."))?f+=Lt(c+1)+b+`={{
|
|
125
|
+
`+Hg(w,k,c+2)+Lt(c+1)+`}}
|
|
126
|
+
`:(f+=Pi(c+1)+b+"="+I+`
|
|
127
|
+
`,f+=Qs(c+1)+b+"="+E+`
|
|
128
|
+
`)}else f+=Lt(c+1)+b+"="+hn(l[b],E)+`
|
|
129
|
+
`}m.forEach(function(ae){if(ae!=="children"){var $=120-2*(c+1)-ae.length-1;f+=Qs(c+1)+ae+"="+hn(o[ae],$)+`
|
|
130
|
+
`}}),f=f===""?Lt(c)+"<"+n+`>
|
|
131
|
+
`:Lt(c)+"<"+n+`
|
|
132
|
+
`+f+Lt(c)+`>
|
|
133
|
+
`}return n=o.children,l=l.children,typeof n=="string"||typeof n=="number"||typeof n=="bigint"?(m="",(typeof l=="string"||typeof l=="number"||typeof l=="bigint")&&(m=""+l),f+=Qo(m,""+n,c+1)):(typeof l=="string"||typeof l=="number"||typeof l=="bigint")&&(f=n==null?f+Qo(""+l,null,c+1):f+Qo(""+l,void 0,c+1)),f}function Em(n,l){var o=Rm(n);if(o===null){for(o="",n=n.child;n;)o+=Em(n,l),n=n.sibling;return o}return Lt(l)+"<"+o+`>
|
|
134
|
+
`}function tu(n,l){var o=Xo(n,l);if(o!==n&&(n.children.length!==1||n.children[0]!==o))return Lt(l)+`...
|
|
135
|
+
`+tu(o,l+1);o="";var c=n.fiber._debugInfo;if(c)for(var f=0;f<c.length;f++){var m=c[f].name;typeof m=="string"&&(o+=Lt(l)+"<"+m+`>
|
|
136
|
+
`,l++)}if(c="",f=n.fiber.pendingProps,n.fiber.tag===6)c=Qo(f,n.serverProps,l),l++;else if(m=Rm(n.fiber),m!==null)if(n.serverProps===void 0){c=l;var b=120-2*c-m.length-2,E="";for(w in f)if(f.hasOwnProperty(w)&&w!=="children"){var k=hn(f[w],15);if(b-=w.length+k.length+2,0>b){E+=" ...";break}E+=" "+w+"="+k}c=Lt(c)+"<"+m+E+`>
|
|
137
|
+
`,l++}else n.serverProps===null?(c=id(m,f,Pi(l)),l++):typeof n.serverProps=="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(c=ud(m,f,n.serverProps,l),l++);var w="";for(f=n.fiber.child,m=0;f&&m<n.children.length;)b=n.children[m],b.fiber===f?(w+=tu(b,l),m++):w+=Em(f,l),f=f.sibling;for(f&&0<n.children.length&&(w+=Lt(l)+`...
|
|
138
|
+
`),f=n.serverTail,n.serverProps===null&&l--,n=0;n<f.length;n++)m=f[n],w=typeof m=="string"?w+(Qs(l)+Rc(m,120-2*l)+`
|
|
139
|
+
`):w+id(m.type,m.props,Qs(l));return o+c+w}function jm(n){try{return`
|
|
140
|
+
|
|
141
|
+
`+tu(n,0)}catch{return""}}function il(n,l,o){for(var c=l,f=null,m=0;c;)c===n&&(m=0),f={fiber:c,children:f!==null?[f]:[],serverProps:c===l?o:c===n?null:void 0,serverTail:[],distanceFromLeaf:m},m++,c=c.return;return f!==null?jm(f).replaceAll(/^[+-]/gm,">"):""}function cd(n,l){n=He({},n||Os);var o={tag:l};return Vf.indexOf(l)!==-1&&(n.aTagInScope=null,n.buttonTagInScope=null,n.nobrTagInScope=null),ko.indexOf(l)!==-1&&(n.pTagInButtonScope=null),Px.indexOf(l)!==-1&&l!=="address"&&l!=="div"&&l!=="p"&&(n.listItemTagAutoclosing=null,n.dlItemTagAutoclosing=null),n.current=o,l==="form"&&(n.formTag=o),l==="a"&&(n.aTagInScope=o),l==="button"&&(n.buttonTagInScope=o),l==="nobr"&&(n.nobrTagInScope=o),l==="p"&&(n.pTagInButtonScope=o),l==="li"&&(n.listItemTagAutoclosing=o),(l==="dd"||l==="dt")&&(n.dlItemTagAutoclosing=o),l==="#document"||l==="html"?n.containerTagInScope=null:n.containerTagInScope||(n.containerTagInScope=o),n}function Sm(n,l){switch(l){case"select":return n==="hr"||n==="option"||n==="optgroup"||n==="#text";case"optgroup":return n==="option"||n==="#text";case"option":return n==="#text";case"tr":return n==="th"||n==="td"||n==="style"||n==="script"||n==="template";case"tbody":case"thead":case"tfoot":return n==="tr"||n==="style"||n==="script"||n==="template";case"colgroup":return n==="col"||n==="template";case"table":return n==="caption"||n==="colgroup"||n==="tbody"||n==="tfoot"||n==="thead"||n==="style"||n==="script"||n==="template";case"head":return n==="base"||n==="basefont"||n==="bgsound"||n==="link"||n==="meta"||n==="title"||n==="noscript"||n==="noframes"||n==="style"||n==="script"||n==="template";case"html":return n==="head"||n==="body"||n==="frameset";case"frameset":return n==="frame";case"#document":return n==="html"}switch(n){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return l!=="h1"&&l!=="h2"&&l!=="h3"&&l!=="h4"&&l!=="h5"&&l!=="h6";case"rp":case"rt":return Bo.indexOf(l)===-1;case"body":case"caption":case"col":case"colgroup":case"frameset":case"frame":case"head":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return l==null}return!0}function Am(n,l){switch(n){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return l.pTagInButtonScope;case"form":return l.formTag||l.pTagInButtonScope;case"li":return l.listItemTagAutoclosing;case"dd":case"dt":return l.dlItemTagAutoclosing;case"button":return l.buttonTagInScope;case"a":return l.aTagInScope;case"nobr":return l.nobrTagInScope}return null}function Zo(n,l){for(;n;){switch(n.tag){case 5:case 26:case 27:if(n.type===l)return n}n=n.return}return null}function rd(n,l){l=l||Os;var o=l.current;if(l=(o=Sm(n,o&&o.tag)?null:o)?null:Am(n,l),l=o||l,!l)return!0;l=l.tag;var c=String(!!o)+"|"+n+"|"+l;if(wo[c])return!1;wo[c]=!0;var f=(c=Mn)?Zo(c.return,l):null;return c=c!==null&&f!==null?il(f,c,null):"",f="<"+n+">",o?(o="",l==="table"&&n==="tr"&&(o+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),console.error(`In HTML, %s cannot be a child of <%s>.%s
|
|
142
|
+
This will cause a hydration error.%s`,f,l,o,c)):console.error(`In HTML, %s cannot be a descendant of <%s>.
|
|
143
|
+
This will cause a hydration error.%s`,f,l,c),!1}function Ec(n,l){if(Sm("#text",l))return!0;var o="#text|"+l;if(wo[o])return!1;wo[o]=!0;var c=(o=Mn)?Zo(o,l):null;return o=o!==null&&c!==null?il(c,o,o.tag!==6?{children:null}:null):"",/\S/.test(n)?console.error(`In HTML, text nodes cannot be a child of <%s>.
|
|
144
|
+
This will cause a hydration error.%s`,l,o):console.error(`In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.
|
|
145
|
+
This will cause a hydration error.%s`,l,o),!1}function fa(n,l){if(l){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=l;return}}n.textContent=l}function Ug(n){return n.replace(qf,function(l,o){return o.toUpperCase()})}function Cm(n,l,o){var c=l.indexOf("--")===0;c||(-1<l.indexOf("-")?Fu.hasOwnProperty(l)&&Fu[l]||(Fu[l]=!0,console.error("Unsupported style property %s. Did you mean %s?",l,Ug(l.replace(eg,"ms-")))):uy.test(l)?Fu.hasOwnProperty(l)&&Fu[l]||(Fu[l]=!0,console.error("Unsupported vendor-prefixed style property %s. Did you mean %s?",l,l.charAt(0).toUpperCase()+l.slice(1))):!uh.test(o)||Pu.hasOwnProperty(o)&&Pu[o]||(Pu[o]=!0,console.error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,l,o.replace(uh,""))),typeof o=="number"&&(isNaN(o)?Dr||(Dr=!0,console.error("`NaN` is an invalid value for the `%s` css style property.",l)):isFinite(o)||ch||(ch=!0,console.error("`Infinity` is an invalid value for the `%s` css style property.",l)))),o==null||typeof o=="boolean"||o===""?c?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="":c?n.setProperty(l,o):typeof o!="number"||o===0||ec.has(l)?l==="float"?n.cssFloat=o:(ca(o,l),n[l]=(""+o).trim()):n[l]=o+"px"}function Tm(n,l,o){if(l!=null&&typeof l!="object")throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");if(l&&Object.freeze(l),n=n.style,o!=null){if(l){var c={};if(o){for(var f in o)if(o.hasOwnProperty(f)&&!l.hasOwnProperty(f))for(var m=oh[f]||[f],b=0;b<m.length;b++)c[m[b]]=f}for(var E in l)if(l.hasOwnProperty(E)&&(!o||o[E]!==l[E]))for(f=oh[E]||[E],m=0;m<f.length;m++)c[f[m]]=E;E={};for(var k in l)for(f=oh[k]||[k],m=0;m<f.length;m++)E[f[m]]=k;k={};for(var w in c)if(f=c[w],(m=E[w])&&f!==m&&(b=f+","+m,!k[b])){k[b]=!0,b=console;var I=l[f];b.error.call(b,"%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",I==null||typeof I=="boolean"||I===""?"Removing":"Updating",f,m)}}for(var ae in o)!o.hasOwnProperty(ae)||l!=null&&l.hasOwnProperty(ae)||(ae.indexOf("--")===0?n.setProperty(ae,""):ae==="float"?n.cssFloat="":n[ae]="");for(var $ in l)w=l[$],l.hasOwnProperty($)&&o[$]!==w&&Cm(n,$,w)}else for(c in l)l.hasOwnProperty(c)&&Cm(n,c,l[c])}function Io(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function tx(n){return rh.get(n)||n}function Vg(n,l){if(Ha.call(tc,l)&&tc[l])return!0;if(a.test(l)){if(n="aria-"+l.slice(4).toLowerCase(),n=dh.hasOwnProperty(n)?n:null,n==null)return console.error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",l),tc[l]=!0;if(l!==n)return console.error("Invalid ARIA attribute `%s`. Did you mean `%s`?",l,n),tc[l]=!0}if(Gf.test(l)){if(n=l.toLowerCase(),n=dh.hasOwnProperty(n)?n:null,n==null)return tc[l]=!0,!1;l!==n&&(console.error("Unknown ARIA attribute `%s`. Did you mean `%s`?",l,n),tc[l]=!0)}return!0}function dd(n,l){var o=[],c;for(c in l)Vg(n,c)||o.push(c);l=o.map(function(f){return"`"+f+"`"}).join(", "),o.length===1?console.error("Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",l,n):1<o.length&&console.error("Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",l,n)}function km(n,l,o,c){if(Ha.call(u,l)&&u[l])return!0;var f=l.toLowerCase();if(f==="onfocusin"||f==="onfocusout")return console.error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),u[l]=!0;if(typeof o=="function"&&(n==="form"&&l==="action"||n==="input"&&l==="formAction"||n==="button"&&l==="formAction"))return!0;if(c!=null){if(n=c.possibleRegistrationNames,c.registrationNameDependencies.hasOwnProperty(l))return!0;if(c=n.hasOwnProperty(f)?n[f]:null,c!=null)return console.error("Invalid event handler property `%s`. Did you mean `%s`?",l,c),u[l]=!0;if(d.test(l))return console.error("Unknown event handler property `%s`. It will be ignored.",l),u[l]=!0}else if(d.test(l))return p.test(l)&&console.error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",l),u[l]=!0;if(y.test(l)||S.test(l))return!0;if(f==="innerhtml")return console.error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),u[l]=!0;if(f==="aria")return console.error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),u[l]=!0;if(f==="is"&&o!==null&&o!==void 0&&typeof o!="string")return console.error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof o),u[l]=!0;if(typeof o=="number"&&isNaN(o))return console.error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",l),u[l]=!0;if(zi.hasOwnProperty(f)){if(f=zi[f],f!==l)return console.error("Invalid DOM property `%s`. Did you mean `%s`?",l,f),u[l]=!0}else if(l!==f)return console.error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",l,f),u[l]=!0;switch(l){case"dangerouslySetInnerHTML":case"children":case"style":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":return!0;case"innerText":case"textContent":return!0}switch(typeof o){case"boolean":switch(l){case"autoFocus":case"checked":case"multiple":case"muted":case"selected":case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"capture":case"download":case"inert":return!0;default:return f=l.toLowerCase().slice(0,5),f==="data-"||f==="aria-"?!0:(o?console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',o,l,l,o,l):console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',o,l,l,o,l,l,l),u[l]=!0)}case"function":case"symbol":return u[l]=!0,!1;case"string":if(o==="false"||o==="true"){switch(l){case"checked":case"selected":case"multiple":case"muted":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"inert":break;default:return!0}console.error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",o,l,o==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',l,o),u[l]=!0}}return!0}function Bm(n,l,o){var c=[],f;for(f in l)km(n,f,l[f],o)||c.push(f);l=c.map(function(m){return"`"+m+"`"}).join(", "),c.length===1?console.error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ",l,n):1<c.length&&console.error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ",l,n)}function ma(n){return B.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Zs(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}function wm(n){var l=ql(n);if(l&&(n=l.stateNode)){var o=n[nl]||null;e:switch(n=l.stateNode,l.type){case"input":if(Go(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),l=o.name,o.type==="radio"&&l!=null){for(o=n;o.parentNode;)o=o.parentNode;for(at(l,"name"),o=o.querySelectorAll('input[name="'+Bl(""+l)+'"][type="radio"]'),l=0;l<o.length;l++){var c=o[l];if(c!==n&&c.form===n.form){var f=c[nl]||null;if(!f)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");Go(c,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(l=0;l<o.length;l++)c=o[l],c.form===n.form&&ad(c)}break e;case"textarea":vm(n,o.value,o.defaultValue);break e;case"select":l=o.value,l!=null&&Gl(n,!!o.multiple,l,!1)}}}function fd(n,l,o){if(fe)return n(l,o);fe=!0;try{var c=n(l);return c}finally{if(fe=!1,(U!==null||le!==null)&&(ml(),U&&(l=U,n=le,le=U=null,wm(l),n)))for(l=0;l<n.length;l++)wm(n[l])}}function nu(n,l){var o=n.stateNode;if(o===null)return null;var c=o[nl]||null;if(c===null)return null;o=c[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error("Expected `"+l+"` listener to be a function, instead got a value of `"+typeof o+"` type.");return o}function lu(){if(bt)return bt;var n,l=_e,o=l.length,c,f="value"in Ce?Ce.value:Ce.textContent,m=f.length;for(n=0;n<o&&l[n]===f[n];n++);var b=o-n;for(c=1;c<=b&&l[o-c]===f[m-c];c++);return bt=f.slice(n,1<c?1-c:void 0)}function au(n){var l=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&l===13&&(n=13)):n=l,n===10&&(n=13),32<=n||n===13?n:0}function Is(){return!0}function as(){return!1}function An(n){function l(o,c,f,m,b){this._reactName=o,this._targetInst=f,this.type=c,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var E in n)n.hasOwnProperty(E)&&(o=n[E],this[E]=o?o(m):m[E]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Is:as,this.isPropagationStopped=as,this}return He(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Is)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Is)},persist:function(){},isPersistent:Is}),l}function md(n){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(n):(n=sv[n])?!!l[n]:!1}function pd(){return md}function jc(n,l){switch(n){case"keyup":return gv.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==i0;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sc(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}function nx(n,l){switch(n){case"compositionend":return Sc(l);case"keypress":return l.which!==c0?null:(d0=!0,r0);case"textInput":return n=l.data,n===r0&&d0?null:n;default:return null}}function Kn(n,l){if(Yf)return n==="compositionend"||!dy&&jc(n,l)?(n=lu(),bt=_e=Ce=null,Yf=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return u0&&l.locale!=="ko"?null:l.data;default:return null}}function $s(n){var l=n&&n.nodeName&&n.nodeName.toLowerCase();return l==="input"?!!bv[n.type]:l==="textarea"}function hd(n){if(!ll)return!1;n="on"+n;var l=n in document;return l||(l=document.createElement("div"),l.setAttribute(n,"return;"),l=typeof l[n]=="function"),l}function su(n,l,o,c){U?le?le.push(c):le=[c]:U=c,l=Bs(l,"onChange"),0<l.length&&(o=new H("onChange","change",null,o,c),n.push({event:o,listeners:l}))}function qg(n){df(n,0)}function ou(n){var l=yc(n);if(ad(l))return n}function xd(n,l){if(n==="change")return l}function iu(){mh&&(mh.detachEvent("onpropertychange",Ac),ph=mh=null)}function Ac(n){if(n.propertyName==="value"&&ou(ph)){var l=[];su(l,ph,n,Zs(n)),fd(qg,l)}}function lx(n,l,o){n==="focusin"?(iu(),mh=l,ph=o,mh.attachEvent("onpropertychange",Ac)):n==="focusout"&&iu()}function Gg(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ou(ph)}function Yg(n,l){if(n==="click")return ou(l)}function Xg(n,l){if(n==="input"||n==="change")return ou(l)}function Dm(n,l){return n===l&&(n!==0||1/n===1/l)||n!==n&&l!==l}function Cc(n,l){if(Sl(n,l))return!0;if(typeof n!="object"||n===null||typeof l!="object"||l===null)return!1;var o=Object.keys(n),c=Object.keys(l);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var f=o[c];if(!Ha.call(l,f)||!Sl(n[f],l[f]))return!1}return!0}function ax(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function sx(n,l){var o=ax(n);n=0;for(var c;o;){if(o.nodeType===3){if(c=n+o.textContent.length,n<=l&&c>=l)return{node:o,offset:l-n};n=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ax(o)}}function ox(n,l){return n&&l?n===l?!0:n&&n.nodeType===3?!1:l&&l.nodeType===3?ox(n,l.parentNode):"contains"in n?n.contains(l):n.compareDocumentPosition?!!(n.compareDocumentPosition(l)&16):!1:!1}function ix(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var l=sd(n.document);l instanceof n.HTMLIFrameElement;){try{var o=typeof l.contentWindow.location.href=="string"}catch{o=!1}if(o)n=l.contentWindow;else break;l=sd(n.document)}return l}function gd(n){var l=n&&n.nodeName&&n.nodeName.toLowerCase();return l&&(l==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||l==="textarea"||n.contentEditable==="true")}function Qg(n,l){var o=ix(l);l=n.focusedElem;var c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&ox(l.ownerDocument.documentElement,l)){if(c!==null&&gd(l)){if(n=c.start,o=c.end,o===void 0&&(o=n),"selectionStart"in l)l.selectionStart=n,l.selectionEnd=Math.min(o,l.value.length);else if(o=(n=l.ownerDocument||document)&&n.defaultView||window,o.getSelection){o=o.getSelection();var f=l.textContent.length,m=Math.min(c.start,f);c=c.end===void 0?m:Math.min(c.end,f),!o.extend&&m>c&&(f=c,c=m,m=f),f=sx(l,m);var b=sx(l,c);f&&b&&(o.rangeCount!==1||o.anchorNode!==f.node||o.anchorOffset!==f.offset||o.focusNode!==b.node||o.focusOffset!==b.offset)&&(n=n.createRange(),n.setStart(f.node,f.offset),o.removeAllRanges(),m>c?(o.addRange(n),o.extend(b.node,b.offset)):(n.setEnd(b.node,b.offset),o.addRange(n)))}}for(n=[],o=l;o=o.parentNode;)o.nodeType===1&&n.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<n.length;l++)o=n[l],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}function ux(n,l,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;my||Xf==null||Xf!==sd(c)||(c=Xf,"selectionStart"in c&&gd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),hh&&Cc(hh,c)||(hh=c,c=Bs(fy,"onSelect"),0<c.length&&(l=new H("onSelect","select",null,l,o),n.push({event:l,listeners:c}),l.target=Xf)))}function $o(n,l){var o={};return o[n.toLowerCase()]=l.toLowerCase(),o["Webkit"+n]="webkit"+l,o["Moz"+n]="moz"+l,o}function Ko(n){if(py[n])return py[n];if(!Qf[n])return n;var l=Qf[n],o;for(o in l)if(l.hasOwnProperty(o)&&o in m0)return py[n]=l[o];return n}function ul(n,l){y0.set(n,l),es(l,[n])}function yd(){for(var n=Zf,l=hy=Zf=0;l<n;){var o=Va[l];Va[l++]=null;var c=Va[l];Va[l++]=null;var f=Va[l];Va[l++]=null;var m=Va[l];if(Va[l++]=null,c!==null&&f!==null){var b=c.pending;b===null?f.next=f:(f.next=b.next,b.next=f),c.pending=f}m!==0&&cx(o,f,m)}}function bd(n,l,o,c){Va[Zf++]=n,Va[Zf++]=l,Va[Zf++]=o,Va[Zf++]=c,hy|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Mm(n,l,o,c){return bd(n,l,o,c),vd(n)}function xn(n,l){return bd(n,null,null,l),vd(n)}function cx(n,l,o){n.lanes|=o;var c=n.alternate;c!==null&&(c.lanes|=o);for(var f=!1,m=n.return;m!==null;)m.childLanes|=o,c=m.alternate,c!==null&&(c.childLanes|=o),m.tag===22&&(n=m.stateNode,n===null||n._visibility&xh||(f=!0)),n=m,m=m.return;f&&l!==null&&n.tag===3&&(m=n.stateNode,f=31-Nn(o),m=m.hiddenUpdates,n=m[f],n===null?m[f]=[l]:n.push(l),l.lane=o|536870912)}function vd(n){if(Hh>zv)throw Zr=Hh=0,Uh=Xy=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");Zr>Lv&&(Zr=0,Uh=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),n.alternate===null&&n.flags&4098&&wp(n);for(var l=n,o=l.return;o!==null;)l.alternate===null&&l.flags&4098&&wp(n),l=o,o=l.return;return l.tag===3?l.stateNode:null}function Jo(n){if(qa===null)return n;var l=qa(n);return l===void 0?n:l.current}function _m(n){if(qa===null)return n;var l=qa(n);return l===void 0?n!=null&&typeof n.render=="function"&&(l=Jo(n.render),n.render!==l)?(l={$$typeof:Mi,render:l},n.displayName!==void 0&&(l.displayName=n.displayName),l):n:l.current}function rx(n,l){if(qa===null)return!1;var o=n.elementType;l=l.type;var c=!1,f=typeof l=="object"&&l!==null?l.$$typeof:null;switch(n.tag){case 1:typeof l=="function"&&(c=!0);break;case 0:(typeof l=="function"||f===Dn)&&(c=!0);break;case 11:(f===Mi||f===Dn)&&(c=!0);break;case 14:case 15:(f===Ro||f===Dn)&&(c=!0);break;default:return!1}return!!(c&&(n=qa(o),n!==void 0&&n===qa(l)))}function dx(n){qa!==null&&typeof WeakSet=="function"&&(If===null&&(If=new WeakSet),If.add(n))}function Nm(n,l,o){var c=n.alternate,f=n.child,m=n.sibling,b=n.tag,E=n.type,k=null;switch(b){case 0:case 15:case 1:k=E;break;case 11:k=E.render}if(qa===null)throw Error("Expected resolveFamily to be set during hot reload.");var w=!1;E=!1,k!==null&&(k=qa(k),k!==void 0&&(o.has(k)?E=!0:l.has(k)&&(b===1?E=!0:w=!0))),If!==null&&(If.has(n)||c!==null&&If.has(c))&&(E=!0),E&&(n._debugNeedsRemount=!0),(E||w)&&(c=xn(n,2),c!==null&&ft(c,n,2)),f===null||E||Nm(f,l,o),m!==null&&Nm(m,l,o)}function ss(){var n=_r;return _r=0,n}function Rd(n){var l=_r;return _r=n,l}function Wo(n){var l=_r;return _r+=n,l}function Fo(n){Hl=$f(),0>n.actualStartTime&&(n.actualStartTime=Hl)}function Om(n){if(0<=Hl){var l=$f()-Hl;n.actualDuration+=l,n.selfBaseDuration=l,Hl=-1}}function zm(n){if(0<=Hl){var l=$f()-Hl;n.actualDuration+=l,Hl=-1}}function Yl(){if(0<=Hl){var n=$f()-Hl;Hl=-1,_r+=n}}function Xl(){Hl=$f()}function Tc(n){for(var l=n.child;l;)n.actualDuration+=l.actualDuration,l=l.sibling}function Jn(n,l){if(typeof n=="object"&&n!==null){var o=gy.get(n);return o!==void 0?o:(l={value:n,source:l,stack:be(l)},gy.set(n,l),l)}return{value:n,source:l,stack:be(l)}}function wl(n,l){Ks(),Kf[Jf++]=og,Kf[Jf++]=sg,sg=n,og=l}function fx(n,l,o){Ks(),Ga[Ya++]=Hi,Ga[Ya++]=Ui,Ga[Ya++]=Or,Or=n;var c=Hi;n=Ui;var f=32-Nn(c)-1;c&=~(1<<f),o+=1;var m=32-Nn(l)+f;if(30<m){var b=f-f%5;m=(c&(1<<b)-1).toString(32),c>>=b,f-=b,Hi=1<<32-Nn(l)+f|o<<f|c,Ui=m+n}else Hi=1<<m|o<<f|c,Ui=n}function Lm(n){Ks(),n.return!==null&&(wl(n,1),fx(n,1,0))}function Hm(n){for(;n===sg;)sg=Kf[--Jf],Kf[Jf]=null,og=Kf[--Jf],Kf[Jf]=null;for(;n===Or;)Or=Ga[--Ya],Ga[Ya]=null,Ui=Ga[--Ya],Ga[Ya]=null,Hi=Ga[--Ya],Ga[Ya]=null}function Ks(){et||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function Js(n,l){if(n.return===null){if(Xa===null)Xa={fiber:n,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:l};else{if(Xa.fiber!==n)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");Xa.distanceFromLeaf>l&&(Xa.distanceFromLeaf=l)}return Xa}var o=Js(n.return,l+1).children;return 0<o.length&&o[o.length-1].fiber===n?(o=o[o.length-1],o.distanceFromLeaf>l&&(o.distanceFromLeaf=l),o):(l={fiber:n,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:l},o.push(l),l)}function Po(n,l){Vi||(n=Js(n,0),n.serverProps=null,l!==null&&(l=yf(l),n.serverTail.push(l)))}function Ql(n){var l="",o=Xa;throw o!==null&&(Xa=null,l=jm(o)),ei(Jn(Error(`Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:
|
|
146
|
+
|
|
147
|
+
- A server/client branch \`if (typeof window !== 'undefined')\`.
|
|
148
|
+
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
|
|
149
|
+
- Date formatting in a user's locale which doesn't match the server.
|
|
150
|
+
- External changing data without sending a snapshot of it along with the HTML.
|
|
151
|
+
- Invalid HTML tag nesting.
|
|
152
|
+
|
|
153
|
+
It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
|
|
154
|
+
|
|
155
|
+
https://react.dev/link/hydration-mismatch`+l),n)),yy}function mx(n){var l=n.stateNode,o=n.type,c=n.memoizedProps;switch(l[Rn]=n,l[nl]=c,ji(o,c),o){case"dialog":Ie("cancel",l),Ie("close",l);break;case"iframe":case"object":case"embed":Ie("load",l);break;case"video":case"audio":for(o=0;o<Vh.length;o++)Ie(Vh[o],l);break;case"source":Ie("error",l);break;case"img":case"image":case"link":Ie("error",l),Ie("load",l);break;case"details":Ie("toggle",l);break;case"input":Wi("input",c),Ie("invalid",l),ym(l,c),od(l,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0),ns(l);break;case"option":Yo(l,c);break;case"select":Wi("select",c),Ie("invalid",l),It(l,c);break;case"textarea":Wi("textarea",c),Ie("invalid",l),bm(l,c),Xs(l,c.value,c.defaultValue,c.children),ns(l)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||l.textContent===""+o||c.suppressHydrationWarning===!0||pf(l.textContent,o)?(c.popover!=null&&(Ie("beforetoggle",l),Ie("toggle",l)),c.onScroll!=null&&Ie("scroll",l),c.onScrollEnd!=null&&Ie("scrollend",l),c.onClick!=null&&(l.onclick=na),l=!0):l=!1,l||Ql(n)}function kc(n){for(Al=n.return;Al;)switch(Al.tag){case 3:case 27:_o=!0;return;case 5:case 13:_o=!1;return;default:Al=Al.return}}function uu(n){if(n!==Al)return!1;if(!et)return kc(n),et=!0,!1;var l=!1,o;if((o=n.tag!==3&&n.tag!==27)&&((o=n.tag===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||ct(n.type,n.memoizedProps)),o=!o),o&&(l=!0),l&&Yn){for(l=Yn;l;){o=Js(n,0);var c=yf(l);o.serverTail.push(c),l=c.type==="Suspense"?hr(l):el(l.nextSibling)}Ql(n)}if(kc(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Yn=hr(n)}else Yn=Al?el(n.stateNode.nextSibling):null;return!0}function cu(){Yn=Al=null,Vi=et=!1}function ei(n){Hs===null?Hs=[n]:Hs.push(n)}function Ed(){var n=Xa;n!==null&&(Xa=null,n=jm(n),console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:
|
|
156
|
+
|
|
157
|
+
- A server/client branch \`if (typeof window !== 'undefined')\`.
|
|
158
|
+
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
|
|
159
|
+
- Date formatting in a user's locale which doesn't match the server.
|
|
160
|
+
- External changing data without sending a snapshot of it along with the HTML.
|
|
161
|
+
- Invalid HTML tag nesting.
|
|
162
|
+
|
|
163
|
+
It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
|
|
164
|
+
|
|
165
|
+
%s%s`,"https://react.dev/link/hydration-mismatch",n))}function Um(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function Vm(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Bc(){}function px(n,l,o){W.actQueue!==null&&(W.didUsePromise=!0);var c=n.thenables;switch(o=c[o],o===void 0?c.push(l):o!==l&&(n.didWarnAboutUncachedPromise||(n.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),l.then(Bc,Bc),l=o),l.status){case"fulfilled":return l.value;case"rejected":throw n=l.reason,xx(n),n;default:if(typeof l.status=="string")l.then(Bc,Bc);else{if(n=vt,n!==null&&100<n.shellSuspendCounter)throw Error("async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");n=l,n.status="pending",n.then(function(f){if(l.status==="pending"){var m=l;m.status="fulfilled",m.value=f}},function(f){if(l.status==="pending"){var m=l;m.status="rejected",m.reason=f}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw n=l.reason,xx(n),n}throw jh=l,ug=!0,ig}}function hx(){if(jh===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var n=jh;return jh=null,ug=!1,n}function xx(n){if(n===ig)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function gn(n){var l=Qe;return n!=null&&(Qe=l===null?n:l.concat(n)),l}function jd(n,l,o){for(var c=Object.keys(n.props),f=0;f<c.length;f++){var m=c[f];if(m!=="children"&&m!=="key"){l===null&&(l=Du(n,o.mode,0),l._debugInfo=Qe,l.return=o),oe(l,function(b){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b)},m);break}}}function Cn(n){var l=Sh;return Sh+=1,Wf===null&&(Wf=Um()),px(Wf,n,l)}function os(n,l){l=l.props.ref,n.ref=l!==void 0?l:null}function wc(n,l){throw l.$$typeof===Fp?Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
|
|
166
|
+
- Multiple copies of the "react" package is used.
|
|
167
|
+
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
|
|
168
|
+
- A compiler tries to "inline" JSX instead of using the runtime.`):(n=Object.prototype.toString.call(l),Error("Objects are not valid as a React child (found: "+(n==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead."))}function Dc(n,l){var o=X(n)||"Component";L0[o]||(L0[o]=!0,l=l.displayName||l.name||"Component",n.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
|
|
169
|
+
root.render(%s)`,l,l,l):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
|
|
170
|
+
<%s>{%s}</%s>`,l,l,o,l,o))}function Mc(n,l){var o=X(n)||"Component";H0[o]||(H0[o]=!0,l=String(l),n.tag===3?console.error(`Symbols are not valid as a React child.
|
|
171
|
+
root.render(%s)`,l):console.error(`Symbols are not valid as a React child.
|
|
172
|
+
<%s>%s</%s>`,o,l,o))}function qm(n){function l(N,_){if(n){var L=N.deletions;L===null?(N.deletions=[_],N.flags|=16):L.push(_)}}function o(N,_){if(!n)return null;for(;_!==null;)l(N,_),_=_.sibling;return null}function c(N){for(var _=new Map;N!==null;)N.key!==null?_.set(N.key,N):_.set(N.index,N),N=N.sibling;return _}function f(N,_){return N=Aa(N,_),N.index=0,N.sibling=null,N}function m(N,_,L){return N.index=L,n?(L=N.alternate,L!==null?(L=L.index,L<_?(N.flags|=33554434,_):L):(N.flags|=33554434,_)):(N.flags|=1048576,_)}function b(N){return n&&N.alternate===null&&(N.flags|=33554434),N}function E(N,_,L,ne){return _===null||_.tag!==6?(_=tf(L,N.mode,ne),_.return=N,_._debugOwner=N,_._debugInfo=Qe,_):(_=f(_,L),_.return=N,_._debugInfo=Qe,_)}function k(N,_,L,ne){var Ee=L.type;return Ee===La?(_=I(N,_,L.props.children,ne,L.key),jd(L,_,N),_):_!==null&&(_.elementType===Ee||rx(_,L)||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Dn&&lc(Ee)===_.type)?(_=f(_,L.props),os(_,L),_.return=N,_._debugOwner=L._owner,_._debugInfo=Qe,_):(_=Du(L,N.mode,ne),os(_,L),_.return=N,_._debugInfo=Qe,_)}function w(N,_,L,ne){return _===null||_.tag!==4||_.stateNode.containerInfo!==L.containerInfo||_.stateNode.implementation!==L.implementation?(_=lr(L,N.mode,ne),_.return=N,_._debugInfo=Qe,_):(_=f(_,L.children||[]),_.return=N,_._debugInfo=Qe,_)}function I(N,_,L,ne,Ee){return _===null||_.tag!==7?(_=Es(L,N.mode,ne,Ee),_.return=N,_._debugOwner=N,_._debugInfo=Qe,_):(_=f(_,L),_.return=N,_._debugInfo=Qe,_)}function ae(N,_,L){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=tf(""+_,N.mode,L),_.return=N,_._debugOwner=N,_._debugInfo=Qe,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case vo:return L=Du(_,N.mode,L),os(L,_),L.return=N,N=gn(_._debugInfo),L._debugInfo=Qe,Qe=N,L;case Iu:return _=lr(_,N.mode,L),_.return=N,_._debugInfo=Qe,_;case Dn:var ne=gn(_._debugInfo);return _=lc(_),N=ae(N,_,L),Qe=ne,N}if(vn(_)||he(_))return L=Es(_,N.mode,L,null),L.return=N,L._debugOwner=N,N=gn(_._debugInfo),L._debugInfo=Qe,Qe=N,L;if(typeof _.then=="function")return ne=gn(_._debugInfo),N=ae(N,Cn(_),L),Qe=ne,N;if(_.$$typeof===vl)return ae(N,Su(N,_),L);wc(N,_)}return typeof _=="function"&&Dc(N,_),typeof _=="symbol"&&Mc(N,_),null}function $(N,_,L,ne){var Ee=_!==null?_.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return Ee!==null?null:E(N,_,""+L,ne);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case vo:return L.key===Ee?(Ee=gn(L._debugInfo),N=k(N,_,L,ne),Qe=Ee,N):null;case Iu:return L.key===Ee?w(N,_,L,ne):null;case Dn:return Ee=gn(L._debugInfo),L=lc(L),N=$(N,_,L,ne),Qe=Ee,N}if(vn(L)||he(L))return Ee!==null?null:(Ee=gn(L._debugInfo),N=I(N,_,L,ne,null),Qe=Ee,N);if(typeof L.then=="function")return Ee=gn(L._debugInfo),N=$(N,_,Cn(L),ne),Qe=Ee,N;if(L.$$typeof===vl)return $(N,_,Su(N,L),ne);wc(N,L)}return typeof L=="function"&&Dc(N,L),typeof L=="symbol"&&Mc(N,L),null}function ce(N,_,L,ne,Ee){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return N=N.get(L)||null,E(_,N,""+ne,Ee);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case vo:return L=N.get(ne.key===null?L:ne.key)||null,N=gn(ne._debugInfo),_=k(_,L,ne,Ee),Qe=N,_;case Iu:return N=N.get(ne.key===null?L:ne.key)||null,w(_,N,ne,Ee);case Dn:var Le=gn(ne._debugInfo);return ne=lc(ne),_=ce(N,_,L,ne,Ee),Qe=Le,_}if(vn(ne)||he(ne))return L=N.get(L)||null,N=gn(ne._debugInfo),_=I(_,L,ne,Ee,null),Qe=N,_;if(typeof ne.then=="function")return Le=gn(ne._debugInfo),_=ce(N,_,L,Cn(ne),Ee),Qe=Le,_;if(ne.$$typeof===vl)return ce(N,_,L,Su(_,ne),Ee);wc(_,ne)}return typeof ne=="function"&&Dc(_,ne),typeof ne=="symbol"&&Mc(_,ne),null}function Be(N,_,L,ne){if(typeof L!="object"||L===null)return ne;switch(L.$$typeof){case vo:case Iu:O(N,_,L);var Ee=L.key;if(typeof Ee!="string")break;if(ne===null){ne=new Set,ne.add(Ee);break}if(!ne.has(Ee)){ne.add(Ee);break}oe(_,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",Ee)});break;case Dn:L=lc(L),Be(N,_,L,ne)}return ne}function Ye(N,_,L,ne){for(var Ee=null,Le=null,ke=null,Ue=_,Xe=_=0,wt=null;Ue!==null&&Xe<L.length;Xe++){Ue.index>Xe?(wt=Ue,Ue=null):wt=Ue.sibling;var nn=$(N,Ue,L[Xe],ne);if(nn===null){Ue===null&&(Ue=wt);break}Ee=Be(N,nn,L[Xe],Ee),n&&Ue&&nn.alternate===null&&l(N,Ue),_=m(nn,_,Xe),ke===null?Le=nn:ke.sibling=nn,ke=nn,Ue=wt}if(Xe===L.length)return o(N,Ue),et&&wl(N,Xe),Le;if(Ue===null){for(;Xe<L.length;Xe++)Ue=ae(N,L[Xe],ne),Ue!==null&&(Ee=Be(N,Ue,L[Xe],Ee),_=m(Ue,_,Xe),ke===null?Le=Ue:ke.sibling=Ue,ke=Ue);return et&&wl(N,Xe),Le}for(Ue=c(Ue);Xe<L.length;Xe++)wt=ce(Ue,N,Xe,L[Xe],ne),wt!==null&&(Ee=Be(N,wt,L[Xe],Ee),n&&wt.alternate!==null&&Ue.delete(wt.key===null?Xe:wt.key),_=m(wt,_,Xe),ke===null?Le=wt:ke.sibling=wt,ke=wt);return n&&Ue.forEach(function(Ki){return l(N,Ki)}),et&&wl(N,Xe),Le}function tn(N,_,L,ne){if(L==null)throw Error("An iterable object provided no iterator.");for(var Ee=null,Le=null,ke=_,Ue=_=0,Xe=null,wt=null,nn=L.next();ke!==null&&!nn.done;Ue++,nn=L.next()){ke.index>Ue?(Xe=ke,ke=null):Xe=ke.sibling;var Ki=$(N,ke,nn.value,ne);if(Ki===null){ke===null&&(ke=Xe);break}wt=Be(N,Ki,nn.value,wt),n&&ke&&Ki.alternate===null&&l(N,ke),_=m(Ki,_,Ue),Le===null?Ee=Ki:Le.sibling=Ki,Le=Ki,ke=Xe}if(nn.done)return o(N,ke),et&&wl(N,Ue),Ee;if(ke===null){for(;!nn.done;Ue++,nn=L.next())ke=ae(N,nn.value,ne),ke!==null&&(wt=Be(N,ke,nn.value,wt),_=m(ke,_,Ue),Le===null?Ee=ke:Le.sibling=ke,Le=ke);return et&&wl(N,Ue),Ee}for(ke=c(ke);!nn.done;Ue++,nn=L.next())Xe=ce(ke,N,Ue,nn.value,ne),Xe!==null&&(wt=Be(N,Xe,nn.value,wt),n&&Xe.alternate!==null&&ke.delete(Xe.key===null?Ue:Xe.key),_=m(Xe,_,Ue),Le===null?Ee=Xe:Le.sibling=Xe,Le=Xe);return n&&ke.forEach(function(Kv){return l(N,Kv)}),et&&wl(N,Ue),Ee}function ut(N,_,L,ne){if(typeof L=="object"&&L!==null&&L.type===La&&L.key===null&&(jd(L,null,N),L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case vo:var Ee=gn(L._debugInfo);e:{for(var Le=L.key;_!==null;){if(_.key===Le){if(Le=L.type,Le===La){if(_.tag===7){o(N,_.sibling),ne=f(_,L.props.children),ne.return=N,ne._debugOwner=L._owner,ne._debugInfo=Qe,jd(L,ne,N),N=ne;break e}}else if(_.elementType===Le||rx(_,L)||typeof Le=="object"&&Le!==null&&Le.$$typeof===Dn&&lc(Le)===_.type){o(N,_.sibling),ne=f(_,L.props),os(ne,L),ne.return=N,ne._debugOwner=L._owner,ne._debugInfo=Qe,N=ne;break e}o(N,_);break}else l(N,_);_=_.sibling}L.type===La?(ne=Es(L.props.children,N.mode,ne,L.key),ne.return=N,ne._debugOwner=N,ne._debugInfo=Qe,jd(L,ne,N),N=ne):(ne=Du(L,N.mode,ne),os(ne,L),ne.return=N,ne._debugInfo=Qe,N=ne)}return N=b(N),Qe=Ee,N;case Iu:e:{for(Ee=L,L=Ee.key;_!==null;){if(_.key===L)if(_.tag===4&&_.stateNode.containerInfo===Ee.containerInfo&&_.stateNode.implementation===Ee.implementation){o(N,_.sibling),ne=f(_,Ee.children||[]),ne.return=N,N=ne;break e}else{o(N,_);break}else l(N,_);_=_.sibling}ne=lr(Ee,N.mode,ne),ne.return=N,N=ne}return b(N);case Dn:return Ee=gn(L._debugInfo),L=lc(L),N=ut(N,_,L,ne),Qe=Ee,N}if(vn(L))return Ee=gn(L._debugInfo),N=Ye(N,_,L,ne),Qe=Ee,N;if(he(L)){if(Ee=gn(L._debugInfo),Le=he(L),typeof Le!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");var ke=Le.call(L);return ke===L?(N.tag!==0||Object.prototype.toString.call(N.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(ke)!=="[object Generator]")&&(O0||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),O0=!0):L.entries!==Le||Ey||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ey=!0),N=tn(N,_,ke,ne),Qe=Ee,N}if(typeof L.then=="function")return Ee=gn(L._debugInfo),N=ut(N,_,Cn(L),ne),Qe=Ee,N;if(L.$$typeof===vl)return ut(N,_,Su(N,L),ne);wc(N,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(Ee=""+L,_!==null&&_.tag===6?(o(N,_.sibling),ne=f(_,Ee),ne.return=N,N=ne):(o(N,_),ne=tf(Ee,N.mode,ne),ne.return=N,ne._debugOwner=N,ne._debugInfo=Qe,N=ne),b(N)):(typeof L=="function"&&Dc(N,L),typeof L=="symbol"&&Mc(N,L),o(N,_))}return function(N,_,L,ne){var Ee=Qe;Qe=null;try{Sh=0;var Le=ut(N,_,L,ne);return Wf=null,Le}catch(wt){if(wt===ig)throw wt;var ke=j(29,wt,null,N.mode);ke.lanes=ne,ke.return=N;var Ue=ke._debugInfo=Qe;if(ke._debugOwner=N._debugOwner,Ue!=null){for(var Xe=Ue.length-1;0<=Xe;Xe--)if(typeof Ue[Xe].stack=="string"){ke._debugOwner=Ue[Xe];break}}return ke}finally{Qe=Ee}}}function Sd(n,l){var o=zo;qe(cg,o,n),qe(Ff,l,n),zo=o|l.baseLanes}function Gm(n){qe(cg,zo,n),qe(Ff,Ff.current,n)}function Ym(n){zo=cg.current,Ve(Ff,n),Ve(cg,n)}function cl(n){var l=n.alternate;qe(En,En.current&Pf,n),qe(Qa,n,n),No===null&&(l===null||Ff.current!==null||l.memoizedState!==null)&&(No=n)}function Ad(n){if(n.tag===22){if(qe(En,En.current,n),qe(Qa,n,n),No===null){var l=n.alternate;l!==null&&l.memoizedState!==null&&(No=n)}}else Dl(n)}function Dl(n){qe(En,En.current,n),qe(Qa,Qa.current,n)}function Zl(n){Ve(Qa,n),No===n&&(No=null),Ve(En,n)}function _c(n){for(var l=n;l!==null;){if(l.tag===13){var o=l.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data===Kr||o.data===Jr))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===n)break;for(;l.sibling===null;){if(l.return===null||l.return===n)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function is(){return{controller:new kv,data:new Map,refCount:0}}function Ml(n){n.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),n.refCount++}function ti(n){n.refCount--,0>n.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),n.refCount===0&&Bv(wv,function(){n.controller.abort()})}function gx(n,l){if(Ch===null){var o=Ch=[];jy=0,Lr=rf(),em={status:"pending",value:void 0,then:function(c){o.push(c)}}}return jy++,l.then(Ws,Ws),l}function Ws(){if(--jy===0&&Ch!==null){em!==null&&(em.status="fulfilled");var n=Ch;Ch=null,Lr=0,em=null;for(var l=0;l<n.length;l++)(0,n[l])()}}function yx(n,l){var o=[],c={status:"pending",value:null,reason:null,then:function(f){o.push(f)}};return n.then(function(){c.status="fulfilled",c.value=l;for(var f=0;f<o.length;f++)(0,o[f])(l)},function(f){for(c.status="rejected",c.reason=f,f=0;f<o.length;f++)(0,o[f])(void 0)}),c}function Cd(){var n=Hr.current;return n!==null?n:vt.pooledCache}function Nc(n,l){l===null?qe(Hr,Hr.current,n):qe(Hr,l.pool,n)}function bx(){var n=Cd();return n===null?null:{parent:Sn._currentValue,pool:n}}function Ze(){var n=F;$a===null?$a=[n]:$a.push(n)}function ye(){var n=F;if($a!==null&&(Gi++,$a[Gi]!==n)){var l=X(Oe);if(!q0.has(l)&&(q0.add(l),$a!==null)){for(var o="",c=0;c<=Gi;c++){var f=$a[c],m=c===Gi?n:f;for(f=c+1+". "+f;30>f.length;)f+=" ";f+=m+`
|
|
173
|
+
`,o+=f}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks
|
|
174
|
+
|
|
175
|
+
Previous render Next render
|
|
176
|
+
------------------------------------------------------
|
|
177
|
+
%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
178
|
+
`,l,o)}}}function ni(n){n==null||vn(n)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",F,typeof n)}function Oc(){var n=X(Oe);Y0.has(n)||(Y0.add(n),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",n))}function Mt(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
179
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
180
|
+
2. You might be breaking the Rules of Hooks
|
|
181
|
+
3. You might have more than one copy of React in the same app
|
|
182
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function rl(n,l){if(kh)return!1;if(l===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",F),!1;n.length!==l.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
|
|
183
|
+
|
|
184
|
+
Previous: %s
|
|
185
|
+
Incoming: %s`,F,"["+l.join(", ")+"]","["+n.join(", ")+"]");for(var o=0;o<l.length&&o<n.length;o++)if(!Sl(n[o],l[o]))return!1;return!0}function Wn(n,l,o,c,f,m){ac=m,Oe=l,$a=n!==null?n._debugHookTypes:null,Gi=-1,kh=n!==null&&n.type!==l.type,(Object.prototype.toString.call(o)==="[object AsyncFunction]"||Object.prototype.toString.call(o)==="[object AsyncGeneratorFunction]")&&(m=X(Oe),Sy.has(m)||(Sy.add(m),console.error("async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."))),l.memoizedState=null,l.updateQueue=null,l.lanes=0,W.H=n!==null&&n.memoizedState!==null?oc:$a!==null?Vr:sc,Ur=m=(l.mode&al)!==Ct;var b=vy(o,c,f);if(Ur=!1,nm&&(b=zc(l,o,c,f)),m){mt(!0);try{b=zc(l,o,c,f)}finally{mt(!1)}}return li(n,l),b}function li(n,l){l._debugHookTypes=$a,l.dependencies===null?qi!==null&&(l.dependencies={lanes:0,firstContext:null,_debugThenableState:qi}):l.dependencies._debugThenableState=qi,W.H=Oo;var o=xt!==null&&xt.next!==null;if(ac=0,$a=F=dn=xt=Oe=null,Gi=-1,n!==null&&(n.flags&31457280)!==(l.flags&31457280)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),rg=!1,Th=0,qi=null,o)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");n===null||On||(n=n.dependencies,n!==null&&Jc(n)&&(On=!0)),ug?(ug=!1,n=!0):n=!1,n&&(l=X(l)||"Unknown",G0.has(l)||Sy.has(l)||(G0.add(l),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function zc(n,l,o,c){Oe=n;var f=0;do{if(nm&&(qi=null),Th=0,nm=!1,f>=Mv)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(f+=1,kh=!1,dn=xt=null,n.updateQueue!=null){var m=n.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}Gi=-1,W.H=qr,m=vy(l,o,c)}while(nm);return m}function Td(){var n=W.H,l=n.useState()[0];return l=typeof l.then=="function"?ha(l):l,n=n.useState()[0],(xt!==null?xt.memoizedState:null)!==n&&(Oe.flags|=1024),l}function ru(){var n=dg!==0;return dg=0,n}function Lc(n,l,o){l.updateQueue=n.updateQueue,l.flags=(l.mode&zs)!==Ct?l.flags&-201328645:l.flags&-2053,n.lanes&=~o}function pa(n){if(rg){for(n=n.memoizedState;n!==null;){var l=n.queue;l!==null&&(l.pending=null),n=n.next}rg=!1}ac=0,$a=dn=xt=Oe=null,Gi=-1,F=null,nm=!1,Th=dg=0,qi=null}function Ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?Oe.memoizedState=dn=n:dn=dn.next=n,dn}function tt(){if(xt===null){var n=Oe.alternate;n=n!==null?n.memoizedState:null}else n=xt.next;var l=dn===null?Oe.memoizedState:dn.next;if(l!==null)dn=l,xt=n;else{if(n===null)throw Oe.alternate===null?Error("Update hook called on initial render. This is likely a bug in React. Please file an issue."):Error("Rendered more hooks than during the previous render.");xt=n,n={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},dn===null?Oe.memoizedState=dn=n:dn=dn.next=n}return dn}function ha(n){var l=Th;return Th+=1,qi===null&&(qi=Um()),n=px(qi,n,l),l=Oe,(dn===null?l.memoizedState:dn.next)===null&&(l=l.alternate,W.H=l!==null&&l.memoizedState!==null?oc:sc),n}function us(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return ha(n);if(n.$$typeof===vl)return gt(n)}throw Error("An unsupported type was passed to use(): "+String(n))}function ln(n){var l=null,o=Oe.updateQueue;if(o!==null&&(l=o.memoCache),l==null){var c=Oe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(l={data:c.data.map(function(f){return f.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),o===null&&(o=Ay(),Oe.updateQueue=o),o.memoCache=l,o=l.data[l.index],o===void 0||kh)for(o=l.data[l.index]=Array(n),c=0;c<n;c++)o[c]=Xx;else o.length!==n&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",o.length,n);return l.index++,o}function Tn(n,l){return typeof l=="function"?l(n):l}function Fs(n,l,o){var c=Ln();if(o!==void 0){var f=o(l);if(Ur){mt(!0);try{o(l)}finally{mt(!1)}}}else f=l;return c.memoizedState=c.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},c.queue=n,n=n.dispatch=Fm.bind(null,Oe,n),[c.memoizedState,n]}function cs(n){var l=tt();return du(l,xt,n)}function du(n,l,o){var c=n.queue;if(c===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");c.lastRenderedReducer=o;var f=n.baseQueue,m=c.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}l.baseQueue!==f&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),l.baseQueue=f=m,c.pending=null}if(m=n.baseState,f===null)n.memoizedState=m;else{l=f.next;var E=b=null,k=null,w=l,I=!1;do{var ae=w.lane&-536870913;if(ae!==w.lane?(Je&ae)===ae:(ac&ae)===ae){var $=w.revertLane;if($===0)k!==null&&(k=k.next={lane:0,revertLane:0,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null}),ae===Lr&&(I=!0);else if((ac&$)===$){w=w.next,$===Lr&&(I=!0);continue}else ae={lane:0,revertLane:w.revertLane,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null},k===null?(E=k=ae,b=m):k=k.next=ae,Oe.lanes|=$,cc|=$;ae=w.action,Ur&&o(m,ae),m=w.hasEagerState?w.eagerState:o(m,ae)}else $={lane:ae,revertLane:w.revertLane,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null},k===null?(E=k=$,b=m):k=k.next=$,Oe.lanes|=ae,cc|=ae;w=w.next}while(w!==null&&w!==l);if(k===null?b=m:k.next=E,!Sl(m,n.memoizedState)&&(On=!0,I&&(o=em,o!==null)))throw o;n.memoizedState=m,n.baseState=b,n.baseQueue=k,c.lastRenderedState=m}return f===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function kn(n){var l=tt(),o=l.queue;if(o===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");o.lastRenderedReducer=n;var c=o.dispatch,f=o.pending,m=l.memoizedState;if(f!==null){o.pending=null;var b=f=f.next;do m=n(m,b.action),b=b.next;while(b!==f);Sl(m,l.memoizedState)||(On=!0),l.memoizedState=m,l.baseQueue===null&&(l.baseState=m),o.lastRenderedState=m}return[m,c]}function Fn(n,l,o){var c=Oe,f=Ln();if(et){if(o===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var m=o();tm||m===o()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),tm=!0)}else{if(m=l(),tm||(o=l(),Sl(m,o)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),tm=!0)),vt===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");Je&60||ga(c,l,m)}return f.memoizedState=m,o={value:m,getSnapshot:l},f.queue=o,no(Ps.bind(null,c,o,n),[n]),c.flags|=2048,oi(Ia|jn,ya.bind(null,c,o,m,l),{destroy:void 0},null),m}function xa(n,l,o){var c=Oe,f=tt(),m=et;if(m){if(o===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");o=o()}else if(o=l(),!tm){var b=l();Sl(o,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),tm=!0)}(b=!Sl((xt||f).memoizedState,o))&&(f.memoizedState=o,On=!0),f=f.queue;var E=Ps.bind(null,c,f,n);if(Kt(2048,jn,E,[n]),f.getSnapshot!==l||b||dn!==null&&dn.memoizedState.tag&Ia){if(c.flags|=2048,oi(Ia|jn,ya.bind(null,c,f,o,l),{destroy:void 0},null),vt===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");m||ac&60||ga(c,l,o)}return o}function ga(n,l,o){n.flags|=16384,n={getSnapshot:l,value:o},l=Oe.updateQueue,l===null?(l=Ay(),Oe.updateQueue=l,l.stores=[n]):(o=l.stores,o===null?l.stores=[n]:o.push(n))}function ya(n,l,o,c){l.value=o,l.getSnapshot=c,Xm(l)&&kd(n)}function Ps(n,l,o){return o(function(){Xm(l)&&kd(n)})}function Xm(n){var l=n.getSnapshot;n=n.value;try{var o=l();return!Sl(n,o)}catch{return!0}}function kd(n){var l=xn(n,2);l!==null&&ft(l,n,2)}function Hc(n){var l=Ln();if(typeof n=="function"){var o=n;if(n=o(),Ur){mt(!0);try{o()}finally{mt(!1)}}}return l.memoizedState=l.baseState=n,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:n},l}function yn(n){n=Hc(n);var l=n.queue,o=yu.bind(null,Oe,l);return l.dispatch=o,[n.memoizedState,o]}function $t(n){var l=Ln();l.memoizedState=l.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=o,l=Yc.bind(null,Oe,!0,o),o.dispatch=l,[n,l]}function Pe(n,l){var o=tt();return _l(o,xt,n,l)}function _l(n,l,o,c){return n.baseState=o,du(n,xt,typeof c=="function"?c:Tn)}function Il(n,l){var o=tt();return xt!==null?_l(o,xt,n,l):(o.baseState=n,[n,o.queue.dispatch])}function Qm(n,l,o,c,f){if(ms(n))throw Error("Cannot update form state while rendering.");if(n=l.action,n!==null){var m={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};W.T!==null?o(!0):m.isTransition=!1,c(m),o=l.pending,o===null?(m.next=l.pending=m,eo(l,m)):(m.next=o.next,l.pending=o.next=m)}}function eo(n,l){var o=l.action,c=l.payload,f=n.state;if(l.isTransition){var m=W.T,b={};W.T=b,W.T._updatedFibers=new Set;try{var E=o(f,c),k=W.S;k!==null&&k(b,E),Zm(n,l,E)}catch(w){ai(n,l,w)}finally{W.T=m,m===null&&b._updatedFibers&&(n=b._updatedFibers.size,b._updatedFibers.clear(),10<n&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{b=o(f,c),Zm(n,l,b)}catch(w){ai(n,l,w)}}function Zm(n,l,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?(o.then(function(c){Im(n,l,c)},function(c){return ai(n,l,c)}),l.isTransition||console.error("An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`")):Im(n,l,o)}function Im(n,l,o){l.status="fulfilled",l.value=o,fu(l),n.state=o,l=n.pending,l!==null&&(o=l.next,o===l?n.pending=null:(o=o.next,l.next=o,eo(n,o)))}function ai(n,l,o){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do l.status="rejected",l.reason=o,fu(l),l=l.next;while(l!==c)}n.action=null}function fu(n){n=n.listeners;for(var l=0;l<n.length;l++)(0,n[l])()}function mu(n,l){return l}function ba(n,l){if(et){var o=vt.formState;if(o!==null){e:{var c=Oe;if(et){if(Yn){t:{for(var f=Yn,m=_o;f.nodeType!==8;){if(!m){f=null;break t}if(f=el(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m===Fy||m===Bb?f:null}if(f){Yn=el(f.nextSibling),c=f.data===Fy;break e}}Ql(c)}c=!1}c&&(l=o[0])}}return o=Ln(),o.memoizedState=o.baseState=l,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mu,lastRenderedState:l},o.queue=c,o=yu.bind(null,Oe,c),c.dispatch=o,c=Hc(!1),m=Yc.bind(null,Oe,!1,c.queue),c=Ln(),f={state:l,dispatch:null,action:n,pending:null},c.queue=f,o=Qm.bind(null,Oe,f,m,o),f.dispatch=o,c.memoizedState=n,[l,o,!1]}function Uc(n){var l=tt();return Bd(l,xt,n)}function Bd(n,l,o){l=du(n,l,mu)[0],n=cs(Tn)[0],l=typeof l=="object"&&l!==null&&typeof l.then=="function"?ha(l):l;var c=tt(),f=c.queue,m=f.dispatch;return o!==c.memoizedState&&(Oe.flags|=2048,oi(Ia|jn,vx.bind(null,f,o),{destroy:void 0},null)),[l,m,n]}function vx(n,l){n.action=l}function si(n){var l=tt(),o=xt;if(o!==null)return Bd(l,o,n);tt(),l=l.memoizedState,o=tt();var c=o.queue.dispatch;return o.memoizedState=n,[l,c,!1]}function oi(n,l,o,c){return n={tag:n,create:l,inst:o,deps:c,next:null},l=Oe.updateQueue,l===null&&(l=Ay(),Oe.updateQueue=l),o=l.lastEffect,o===null?l.lastEffect=n.next=n:(c=o.next,o.next=n,n.next=c,l.lastEffect=n),n}function ii(n){var l=Ln();return n={current:n},l.memoizedState=n}function to(n,l,o,c){var f=Ln();Oe.flags|=n,f.memoizedState=oi(Ia|l,o,{destroy:void 0},c===void 0?null:c)}function Kt(n,l,o,c){var f=tt();c=c===void 0?null:c;var m=f.memoizedState.inst;xt!==null&&c!==null&&rl(c,xt.memoizedState.deps)?f.memoizedState=oi(l,o,m,c):(Oe.flags|=n,f.memoizedState=oi(Ia|l,o,m,c))}function no(n,l){(Oe.mode&zs)!==Ct&&(Oe.mode&v0)===Ct?to(142608384,jn,n,l):to(8390656,jn,n,l)}function pu(n,l){var o=4194308;return(Oe.mode&zs)!==Ct&&(o|=67108864),to(o,Xn,n,l)}function hu(n,l){if(typeof l=="function"){n=n();var o=l(n);return function(){typeof o=="function"?o():l(null)}}if(l!=null)return l.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(l).join(", ")+"}"),n=n(),l.current=n,function(){l.current=null}}function xu(n,l,o){typeof l!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",l!==null?typeof l:"null"),o=o!=null?o.concat([n]):null;var c=4194308;(Oe.mode&zs)!==Ct&&(c|=67108864),to(c,Xn,hu.bind(null,l,n),o)}function Vc(n,l,o){typeof l!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",l!==null?typeof l:"null"),o=o!=null?o.concat([n]):null,Kt(4,Xn,hu.bind(null,l,n),o)}function wd(n,l){return Ln().memoizedState=[n,l===void 0?null:l],n}function va(n,l){var o=tt();l=l===void 0?null:l;var c=o.memoizedState;return l!==null&&rl(l,c[1])?c[0]:(o.memoizedState=[n,l],n)}function Dd(n,l){var o=Ln();l=l===void 0?null:l;var c=n();if(Ur){mt(!0);try{n()}finally{mt(!1)}}return o.memoizedState=[c,l],c}function rs(n,l){var o=tt();l=l===void 0?null:l;var c=o.memoizedState;if(l!==null&&rl(l,c[1]))return c[0];if(c=n(),Ur){mt(!0);try{n()}finally{mt(!1)}}return o.memoizedState=[c,l],c}function gu(n,l){var o=Ln();return qc(o,n,l)}function $m(n,l){var o=tt();return dl(o,xt.memoizedState,n,l)}function Md(n,l){var o=tt();return xt===null?qc(o,n,l):dl(o,xt.memoizedState,n,l)}function qc(n,l,o){return o===void 0||ac&1073741824?n.memoizedState=l:(n.memoizedState=o,n=nf(),Oe.lanes|=n,cc|=n,o)}function dl(n,l,o,c){return Sl(o,l)?o:Ff.current!==null?(n=qc(n,o,c),Sl(n,l)||(On=!0),n):ac&42?(n=nf(),Oe.lanes|=n,cc|=n,l):(On=!0,n.memoizedState=o)}function $l(n,l,o,c,f){var m=ht.p;ht.p=m!==0&&m<Ll?m:Ll;var b=W.T,E={};W.T=E,Yc(n,!1,l,o),E._updatedFibers=new Set;try{var k=f(),w=W.S;if(w!==null&&w(E,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var I=yx(k,c);fs(n,l,I,Hn(n))}else fs(n,l,c,Hn(n))}catch(ae){fs(n,l,{then:function(){},status:"rejected",reason:ae},Hn(n))}finally{ht.p=m,W.T=b,b===null&&E._updatedFibers&&(n=E._updatedFibers.size,E._updatedFibers.clear(),10<n&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function Ra(n,l,o,c){if(n.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var f=Km(n).queue;$l(n,f,l,Fr,o===null?M:function(){return ds(n),o(c)})}function Km(n){var l=n.memoizedState;if(l!==null)return l;l={memoizedState:Fr,baseState:Fr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:Fr},next:null};var o={};return l.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:o},next:null},n.memoizedState=l,n=n.alternate,n!==null&&(n.memoizedState=l),l}function ds(n){W.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var l=Km(n).next.queue;fs(n,l,{},Hn(n))}function Kl(){var n=Hc(!1);return n=$l.bind(null,Oe,n.queue,!0,!1),Ln().memoizedState=n,[!1,n]}function Vt(){var n=cs(Tn)[0],l=tt().memoizedState;return[typeof n=="boolean"?n:ha(n),l]}function Gc(){var n=kn(Tn)[0],l=tt().memoizedState;return[typeof n=="boolean"?n:ha(n),l]}function ui(){return gt(Yh)}function Jm(){var n=Ln(),l=vt.identifierPrefix;if(et){var o=Ui,c=Hi;o=(c&~(1<<32-Nn(c)-1)).toString(32)+o,l=":"+l+"R"+o,o=dg++,0<o&&(l+="H"+o.toString(32)),l+=":"}else o=Dv++,l=":"+l+"r"+o.toString(32)+":";return n.memoizedState=l}function Wm(){return Ln().memoizedState=Jt.bind(null,Oe)}function Jt(n,l){for(var o=n.return;o!==null;){switch(o.tag){case 24:case 3:var c=Hn(o);n=gs(c);var f=ys(o,n,c);f!==null&&(ft(f,o,c),Wc(f,o,c)),o=is(),l!=null&&f!==null&&console.error("The seed argument is not enabled outside experimental channels."),n.payload={cache:o};return}o=o.return}}function Fm(n,l,o,c){typeof c=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),c=Hn(n),o={lane:c,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},ms(n)?ci(l,o):(o=Mm(n,l,o,c),o!==null&&(ft(o,n,c),Rx(o,l,c))),Zn(n,c)}function yu(n,l,o,c){typeof c=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),c=Hn(n),fs(n,l,o,c),Zn(n,c)}function fs(n,l,o,c){var f={lane:c,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(ms(n))ci(l,f);else{var m=n.alternate;if(n.lanes===0&&(m===null||m.lanes===0)&&(m=l.lastRenderedReducer,m!==null)){var b=W.H;W.H=Tl;try{var E=l.lastRenderedState,k=m(E,o);if(f.hasEagerState=!0,f.eagerState=k,Sl(k,E))return bd(n,l,f,0),vt===null&&yd(),!1}catch{}finally{W.H=b}}if(o=Mm(n,l,f,c),o!==null)return ft(o,n,c),Rx(o,l,c),!0}return!1}function Yc(n,l,o,c){if(W.T===null&&Lr===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),c={lane:2,revertLane:rf(),action:c,hasEagerState:!1,eagerState:null,next:null},ms(n)){if(l)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else l=Mm(n,o,c,2),l!==null&&ft(l,n,2);Zn(n,2)}function ms(n){var l=n.alternate;return n===Oe||l!==null&&l===Oe}function ci(n,l){nm=rg=!0;var o=n.pending;o===null?l.next=l:(l.next=o.next,o.next=l),n.pending=l}function Rx(n,l,o){if(o&4194176){var c=l.lanes;c&=n.pendingLanes,o|=c,l.lanes=o,In(n,o)}}function _d(n){if(n!==null&&typeof n!="function"){var l=String(n);eb.has(l)||(eb.add(l),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",n))}}function Pm(n,l,o,c){var f=n.memoizedState,m=o(c,f);if(n.mode&al){mt(!0);try{m=o(c,f)}finally{mt(!1)}}m===void 0&&(l=te(l)||"Component",J0.has(l)||(J0.add(l),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",l))),f=m==null?f:He({},f,m),n.memoizedState=f,n.lanes===0&&(n.updateQueue.baseState=f)}function ep(n,l,o,c,f,m,b){var E=n.stateNode;if(typeof E.shouldComponentUpdate=="function"){if(o=E.shouldComponentUpdate(c,m,b),n.mode&al){mt(!0);try{o=E.shouldComponentUpdate(c,m,b)}finally{mt(!1)}}return o===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",te(l)||"Component"),o}return l.prototype&&l.prototype.isPureReactComponent?!Cc(o,c)||!Cc(f,m):!0}function lo(n,l,o,c){var f=l.state;typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(o,c),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(o,c),l.state!==f&&(n=X(n)||"Component",Q0.has(n)||(Q0.add(n),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",n)),Cy.enqueueReplaceState(l,l.state,null))}function ps(n,l){var o=l;if("ref"in l){o={};for(var c in l)c!=="ref"&&(o[c]=l[c])}if(n=n.defaultProps){o===l&&(o=He({},o));for(var f in n)o[f]===void 0&&(o[f]=n[f])}return o}function Xc(n,l){fg(n),n=lm?"An error occurred in the <"+lm+"> component.":"An error occurred in one of your React components.";var o=W.getCurrentStack,c=l.componentStack!=null?l.componentStack:"";W.getCurrentStack=function(){return c};try{console.warn(`%s
|
|
186
|
+
|
|
187
|
+
%s
|
|
188
|
+
`,n,`Consider adding an error boundary to your tree to customize error handling behavior.
|
|
189
|
+
Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)}finally{W.getCurrentStack=o}}function tp(n,l){var o=lm?"The above error occurred in the <"+lm+"> component.":"The above error occurred in one of your React components.",c="React will try to recreate this component tree from scratch using the error boundary you provided, "+((Ty||"Anonymous")+"."),f=W.getCurrentStack,m=l.componentStack!=null?l.componentStack:"";W.getCurrentStack=function(){return m};try{typeof n=="object"&&n!==null&&typeof n.environmentName=="string"?Gu("error",[`%o
|
|
190
|
+
|
|
191
|
+
%s
|
|
192
|
+
|
|
193
|
+
%s
|
|
194
|
+
`,n,o,c],n.environmentName)():console.error(`%o
|
|
195
|
+
|
|
196
|
+
%s
|
|
197
|
+
|
|
198
|
+
%s
|
|
199
|
+
`,n,o,c)}finally{W.getCurrentStack=f}}function hs(n){fg(n)}function ze(n,l){try{lm=l.source?X(l.source):null,Ty=null;var o=l.value;if(W.actQueue!==null)W.thrownErrors.push(o);else{var c=n.onUncaughtError;c(o,{componentStack:l.stack})}}catch(f){setTimeout(function(){throw f})}}function st(n,l,o){try{lm=o.source?X(o.source):null,Ty=X(l);var c=n.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function _t(n,l,o){return o=gs(o),o.tag=My,o.payload={element:null},o.callback=function(){oe(l.source,ze,n,l)},o}function bu(n){return n=gs(n),n.tag=My,n}function ao(n,l,o,c){var f=o.type.getDerivedStateFromError;if(typeof f=="function"){var m=c.value;n.payload=function(){return f(m)},n.callback=function(){dx(o),oe(c.source,st,l,o,c)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(n.callback=function(){dx(o),oe(c.source,st,l,o,c),typeof f!="function"&&(dc===null?dc=new Set([this]):dc.add(this)),Av(this,c),typeof f=="function"||!(o.lanes&2)&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",X(o)||"Unknown")})}function ri(n,l,o,c,f){if(o.flags|=32768,qn&&Et(n,f),c!==null&&typeof c=="object"&&typeof c.then=="function"){if(l=o.alternate,l!==null&&Kc(l,o,f,!0),et&&(Vi=!0),o=Qa.current,o!==null){switch(o.tag){case 13:return No===null?ir():o.alternate===null&&Yt===Qi&&(Yt=zy),o.flags&=-257,o.flags|=65536,o.lanes=f,c===by?o.flags|=16384:(l=o.updateQueue,l===null?o.updateQueue=new Set([c]):l.add(c),Pl(n,c,f)),!1;case 22:return o.flags|=65536,c===by?o.flags|=16384:(l=o.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=l):(o=l.retryQueue,o===null?l.retryQueue=new Set([c]):o.add(c)),Pl(n,c,f)),!1}throw Error("Unexpected Suspense handler tag ("+o.tag+"). This is a bug in React.")}return Pl(n,c,f),ir(),!1}if(et)return Vi=!0,l=Qa.current,l!==null?(!(l.flags&65536)&&(l.flags|=256),l.flags|=65536,l.lanes=f,c!==yy&&ei(Jn(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:c}),o))):(c!==yy&&ei(Jn(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:c}),o)),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,c=Jn(c,o),f=_t(n.stateNode,c,f),Fc(n,f),Yt!==Gr&&(Yt=cm)),!1;var m=Jn(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:c}),o);if(Oh===null?Oh=[m]:Oh.push(m),Yt!==Gr&&(Yt=cm),l===null)return!0;c=Jn(c,o),o=l;do{switch(o.tag){case 3:return o.flags|=65536,n=f&-f,o.lanes|=n,n=_t(o.stateNode,c,n),Fc(o,n),!1;case 1:if(l=o.type,m=o.stateNode,(o.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(dc===null||!dc.has(m))))return o.flags|=65536,f&=-f,o.lanes|=f,f=bu(f),ao(f,n,o,c),Fc(o,f),!1}o=o.return}while(o!==null);return!1}function qt(n,l,o,c){l.child=n===null?U0(l,null,o,c):zr(l,n.child,o,c)}function vu(n,l,o,c,f){o=o.render;var m=l.ref;if("ref"in c){var b={};for(var E in c)E!=="ref"&&(b[E]=c[E])}else b=c;return so(l),Ho(l),c=Wn(n,l,o,b,m,f),E=ru(),Gs(),n!==null&&!On?(Lc(n,l,f),Jl(n,l,f)):(et&&E&&Lm(l),l.flags|=1,qt(n,l,c,f),l.child)}function di(n,l,o,c,f){if(n===null){var m=o.type;return typeof m=="function"&&!nr(m)&&m.defaultProps===void 0&&o.compare===null?(o=Jo(m),l.tag=15,l.type=o,Qc(l,m),Ex(n,l,o,c,f)):(n=Pd(o.type,null,c,l,l.mode,f),n.ref=l.ref,n.return=l,l.child=n)}if(m=n.child,!Ud(n,f)){var b=m.memoizedProps;if(o=o.compare,o=o!==null?o:Cc,o(b,c)&&n.ref===l.ref)return Jl(n,l,f)}return l.flags|=1,n=Aa(m,c),n.ref=l.ref,n.return=l,l.child=n}function Ex(n,l,o,c,f){if(n!==null){var m=n.memoizedProps;if(Cc(m,c)&&n.ref===l.ref&&l.type===n.type)if(On=!1,l.pendingProps=c=m,Ud(n,f))n.flags&131072&&(On=!0);else return l.lanes=n.lanes,Jl(n,l,f)}return Od(n,l,o,c,f)}function Nt(n,l,o){var c=l.pendingProps,f=c.children,m=(l.stateNode._pendingVisibility&Mr)!==0,b=n!==null?n.memoizedState:null;if(fi(n,l),c.mode==="hidden"||m){if(l.flags&128){if(c=b!==null?b.baseLanes|o:o,n!==null){for(f=l.child=n.child,m=0;f!==null;)m=m|f.lanes|f.childLanes,f=f.sibling;l.childLanes=m&~c}else l.childLanes=0,l.child=null;return Nd(n,l,c,o)}if(o&536870912)l.memoizedState={baseLanes:0,cachePool:null},n!==null&&Nc(l,b!==null?b.cachePool:null),b!==null?Sd(l,b):Gm(l),Ad(l);else return l.lanes=l.childLanes=536870912,Nd(n,l,b!==null?b.baseLanes|o:o,o)}else b!==null?(Nc(l,b.cachePool),Sd(l,b),Dl(l),l.memoizedState=null):(n!==null&&Nc(l,null),Gm(l),Dl(l));return qt(n,l,f,o),l.child}function Nd(n,l,o,c){var f=Cd();return f=f===null?null:{parent:Sn._currentValue,pool:f},l.memoizedState={baseLanes:o,cachePool:f},n!==null&&Nc(l,null),Gm(l),Ad(l),n!==null&&Kc(n,l,c,!0),null}function fi(n,l){var o=l.ref;if(o===null)n!==null&&n.ref!==null&&(l.flags|=2097664);else{if(typeof o!="function"&&typeof o!="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");(n===null||n.ref!==o)&&(l.flags|=2097664)}}function Od(n,l,o,c,f){if(o.prototype&&typeof o.prototype.render=="function"){var m=te(o)||"Unknown";nb[m]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",m,m),nb[m]=!0)}return l.mode&al&&Ls.recordLegacyContextWarning(l,null),n===null&&(Qc(l,l.type),o.contextTypes&&(m=te(o)||"Unknown",ab[m]||(ab[m]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",m)))),so(l),Ho(l),o=Wn(n,l,o,c,void 0,f),c=ru(),Gs(),n!==null&&!On?(Lc(n,l,f),Jl(n,l,f)):(et&&c&&Lm(l),l.flags|=1,qt(n,l,o,f),l.child)}function np(n,l,o,c,f,m){return so(l),Ho(l),Gi=-1,kh=n!==null&&n.type!==l.type,l.updateQueue=null,o=zc(l,c,o,f),li(n,l),c=ru(),Gs(),n!==null&&!On?(Lc(n,l,m),Jl(n,l,m)):(et&&c&&Lm(l),l.flags|=1,qt(n,l,o,m),l.child)}function jx(n,l,o,c,f){switch(A(l)){case!1:var m=l.stateNode,b=new l.type(l.memoizedProps,m.context).state;m.updater.enqueueSetState(m,b,null);break;case!0:l.flags|=128,l.flags|=65536,m=Error("Simulated error coming from DevTools");var E=f&-f;if(l.lanes|=E,b=vt,b===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");E=bu(E),ao(E,b,l,Jn(m,l)),Fc(l,E)}if(so(l),l.stateNode===null){if(b=nc,m=o.contextType,"contextType"in o&&m!==null&&(m===void 0||m.$$typeof!==vl)&&!P0.has(o)&&(P0.add(o),E=m===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof m!="object"?" However, it is set to a "+typeof m+".":m.$$typeof===br?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(m).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",te(o)||"Component",E)),typeof m=="object"&&m!==null&&(b=gt(m)),m=new o(c,b),l.mode&al){mt(!0);try{m=new o(c,b)}finally{mt(!1)}}if(b=l.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Cy,l.stateNode=m,m._reactInternals=l,m._reactInternalInstance=X0,typeof o.getDerivedStateFromProps=="function"&&b===null&&(b=te(o)||"Component",Z0.has(b)||(Z0.add(b),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",b,m.state===null?"null":"undefined",b))),typeof o.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"){var k=E=b=null;if(typeof m.componentWillMount=="function"&&m.componentWillMount.__suppressDeprecationWarning!==!0?b="componentWillMount":typeof m.UNSAFE_componentWillMount=="function"&&(b="UNSAFE_componentWillMount"),typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps.__suppressDeprecationWarning!==!0?E="componentWillReceiveProps":typeof m.UNSAFE_componentWillReceiveProps=="function"&&(E="UNSAFE_componentWillReceiveProps"),typeof m.componentWillUpdate=="function"&&m.componentWillUpdate.__suppressDeprecationWarning!==!0?k="componentWillUpdate":typeof m.UNSAFE_componentWillUpdate=="function"&&(k="UNSAFE_componentWillUpdate"),b!==null||E!==null||k!==null){m=te(o)||"Component";var w=typeof o.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";$0.has(m)||($0.add(m),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
200
|
+
|
|
201
|
+
%s uses %s but also contains the following legacy lifecycles:%s%s%s
|
|
202
|
+
|
|
203
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
204
|
+
https://react.dev/link/unsafe-component-lifecycles`,m,w,b!==null?`
|
|
205
|
+
`+b:"",E!==null?`
|
|
206
|
+
`+E:"",k!==null?`
|
|
207
|
+
`+k:""))}}m=l.stateNode,b=te(o)||"Component",m.render||(o.prototype&&typeof o.prototype.render=="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",b):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",b)),!m.getInitialState||m.getInitialState.isReactClassApproved||m.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",b),m.getDefaultProps&&!m.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",b),m.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",b),o.childContextTypes&&!F0.has(o)&&(F0.add(o),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",b)),o.contextTypes&&!W0.has(o)&&(W0.add(o),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",b)),typeof m.componentShouldUpdate=="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",b),o.prototype&&o.prototype.isPureReactComponent&&typeof m.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",te(o)||"A pure component"),typeof m.componentDidUnmount=="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",b),typeof m.componentDidReceiveProps=="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",b),typeof m.componentWillRecieveProps=="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",b),typeof m.UNSAFE_componentWillRecieveProps=="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",b),E=m.props!==c,m.props!==void 0&&E&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",b),m.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",b,b),typeof m.getSnapshotBeforeUpdate!="function"||typeof m.componentDidUpdate=="function"||I0.has(o)||(I0.add(o),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",te(o))),typeof m.getDerivedStateFromProps=="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",b),typeof m.getDerivedStateFromError=="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",b),typeof o.getSnapshotBeforeUpdate=="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",b),(E=m.state)&&(typeof E!="object"||vn(E))&&console.error("%s.state: must be set to an object or null",b),typeof m.getChildContext=="function"&&typeof o.childContextTypes!="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",b),m=l.stateNode,m.props=c,m.state=l.memoizedState,m.refs={},Gd(l),b=o.contextType,m.context=typeof b=="object"&&b!==null?gt(b):nc,m.state===c&&(b=te(o)||"Component",K0.has(b)||(K0.add(b),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",b))),l.mode&al&&Ls.recordLegacyContextWarning(l,m),Ls.recordUnsafeLifecycleWarnings(l,m),m.state=l.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(Pm(l,o,b,c),m.state=l.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",X(l)||"Component"),Cy.enqueueReplaceState(m,m.state,null)),Au(l,c,m,f),Sa(),m.state=l.memoizedState),typeof m.componentDidMount=="function"&&(l.flags|=4194308),(l.mode&zs)!==Ct&&(l.flags|=67108864),m=!0}else if(n===null){m=l.stateNode;var I=l.memoizedProps;E=ps(o,I),m.props=E;var ae=m.context;k=o.contextType,b=nc,typeof k=="object"&&k!==null&&(b=gt(k)),w=o.getDerivedStateFromProps,k=typeof w=="function"||typeof m.getSnapshotBeforeUpdate=="function",I=l.pendingProps!==I,k||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(I||ae!==b)&&lo(l,m,c,b),uc=!1;var $=l.memoizedState;m.state=$,Au(l,c,m,f),Sa(),ae=l.memoizedState,I||$!==ae||uc?(typeof w=="function"&&(Pm(l,o,w,c),ae=l.memoizedState),(E=uc||ep(l,o,E,c,$,ae,b))?(k||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(l.flags|=4194308),(l.mode&zs)!==Ct&&(l.flags|=67108864)):(typeof m.componentDidMount=="function"&&(l.flags|=4194308),(l.mode&zs)!==Ct&&(l.flags|=67108864),l.memoizedProps=c,l.memoizedState=ae),m.props=c,m.state=ae,m.context=b,m=E):(typeof m.componentDidMount=="function"&&(l.flags|=4194308),(l.mode&zs)!==Ct&&(l.flags|=67108864),m=!1)}else{m=l.stateNode,Yd(n,l),b=l.memoizedProps,k=ps(o,b),m.props=k,w=l.pendingProps,$=m.context,ae=o.contextType,E=nc,typeof ae=="object"&&ae!==null&&(E=gt(ae)),I=o.getDerivedStateFromProps,(ae=typeof I=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==w||$!==E)&&lo(l,m,c,E),uc=!1,$=l.memoizedState,m.state=$,Au(l,c,m,f),Sa();var ce=l.memoizedState;b!==w||$!==ce||uc||n!==null&&n.dependencies!==null&&Jc(n.dependencies)?(typeof I=="function"&&(Pm(l,o,I,c),ce=l.memoizedState),(k=uc||ep(l,o,k,c,$,ce,E)||n!==null&&n.dependencies!==null&&Jc(n.dependencies))?(ae||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(c,ce,E),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(c,ce,E)),typeof m.componentDidUpdate=="function"&&(l.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===n.memoizedProps&&$===n.memoizedState||(l.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===n.memoizedProps&&$===n.memoizedState||(l.flags|=1024),l.memoizedProps=c,l.memoizedState=ce),m.props=c,m.state=ce,m.context=E,m=k):(typeof m.componentDidUpdate!="function"||b===n.memoizedProps&&$===n.memoizedState||(l.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===n.memoizedProps&&$===n.memoizedState||(l.flags|=1024),m=!1)}if(E=m,fi(n,l),b=(l.flags&128)!==0,E||b){if(E=l.stateNode,W.getCurrentStack=l===null?null:je,Rl=!1,Mn=l,b&&typeof o.getDerivedStateFromError!="function")o=null,Hl=-1;else{if(Ho(l),o=A0(E),l.mode&al){mt(!0);try{A0(E)}finally{mt(!1)}}Gs()}l.flags|=1,n!==null&&b?(l.child=zr(l,n.child,null,f),l.child=zr(l,null,o,f)):qt(n,l,o,f),l.memoizedState=E.state,n=l.child}else n=Jl(n,l,f);return f=l.stateNode,m&&f.props!==c&&(am||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",X(l)||"a component"),am=!0),n}function zd(n,l,o,c){return cu(),l.flags|=256,qt(n,l,o,c),l.child}function Qc(n,l){l&&l.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
|
|
208
|
+
%s.childContextTypes = ...`,l.displayName||l.name||"Component"),typeof l.getDerivedStateFromProps=="function"&&(n=te(l)||"Unknown",sb[n]||(console.error("%s: Function components do not support getDerivedStateFromProps.",n),sb[n]=!0)),typeof l.contextType=="object"&&l.contextType!==null&&(l=te(l)||"Unknown",lb[l]||(console.error("%s: Function components do not support contextType.",l),lb[l]=!0))}function Zc(n){return{baseLanes:n,cachePool:bx()}}function Bn(n,l,o){return n=n!==null?n.childLanes&~o:0,l&&(n|=ua),n}function Ht(n,l,o){var c,f=l.pendingProps;R(l)&&(l.flags|=128);var m=!1,b=(l.flags&128)!==0;if((c=b)||(c=n!==null&&n.memoizedState===null?!1:(En.current&Ah)!==0),c&&(m=!0,l.flags&=-129),c=(l.flags&32)!==0,l.flags&=-33,n===null){if(et){if(m?cl(l):Dl(l),et){var E=Yn,k;if(!(k=!E)){e:{var w=E;for(k=_o;w.nodeType!==8;){if(!k){k=null;break e}if(w=el(w.nextSibling),w===null){k=null;break e}}k=w}k!==null?(Ks(),l.memoizedState={dehydrated:k,treeContext:Or!==null?{id:Hi,overflow:Ui}:null,retryLane:536870912},w=j(18,null,null,Ct),w.stateNode=k,w.return=l,l.child=w,Al=l,Yn=null,k=!0):k=!1,k=!k}k&&(Po(l,E),Ql(l))}if(E=l.memoizedState,E!==null&&(E=E.dehydrated,E!==null))return E.data===Jr?l.lanes=16:l.lanes=536870912,null;Zl(l)}return E=f.children,f=f.fallback,m?(Dl(l),m=l.mode,E=mi({mode:"hidden",children:E},m),f=Es(f,m,o,null),E.return=l,f.return=l,E.sibling=f,l.child=E,m=l.child,m.memoizedState=Zc(o),m.childLanes=Bn(n,c,o),l.memoizedState=By,f):(cl(l),Ru(l,E))}var I=n.memoizedState;if(I!==null&&(E=I.dehydrated,E!==null)){if(b)l.flags&256?(cl(l),l.flags&=-257,l=Eu(n,l,o)):l.memoizedState!==null?(Dl(l),l.child=n.child,l.flags|=128,l=null):(Dl(l),m=f.fallback,E=l.mode,f=mi({mode:"visible",children:f.children},E),m=Es(m,E,o,null),m.flags|=2,f.return=l,m.return=l,f.sibling=m,l.child=f,zr(l,n.child,null,o),f=l.child,f.memoizedState=Zc(o),f.childLanes=Bn(n,c,o),l.memoizedState=By,l=m);else if(cl(l),et&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug."),E.data===Jr){if(c=E.nextSibling&&E.nextSibling.dataset,c){k=c.dgst;var ae=c.msg;w=c.stck;var $=c.cstck}E=ae,c=k,f=w,k=m=$,m=Error(E||"The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),m.stack=f||"",m.digest=c,c=k===void 0?null:k,f={value:m,source:null,stack:c},typeof c=="string"&&gy.set(m,f),ei(f),l=Eu(n,l,o)}else if(On||Kc(n,l,o,!1),c=(o&n.childLanes)!==0,On||c){if(c=vt,c!==null){if(f=o&-o,f&42)f=1;else switch(f){case 2:f=1;break;case 8:f=4;break;case 32:f=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:f=64;break;case 268435456:f=134217728;break;default:f=0}if(f=f&(c.suspendedLanes|o)?0:f,f!==0&&f!==I.retryLane)throw I.retryLane=f,xn(n,f),ft(c,n,f),tb}E.data===Kr||ir(),l=Eu(n,l,o)}else E.data===Kr?(l.flags|=128,l.child=n.child,l=Mx.bind(null,n),E._reactRetry=l,l=null):(n=I.treeContext,Yn=el(E.nextSibling),Al=l,et=!0,Hs=null,Vi=!1,Xa=null,_o=!1,n!==null&&(Ks(),Ga[Ya++]=Hi,Ga[Ya++]=Ui,Ga[Ya++]=Or,Hi=n.id,Ui=n.overflow,Or=l),l=Ru(l,f.children),l.flags|=4096);return l}return m?(Dl(l),m=f.fallback,E=l.mode,k=n.child,w=k.sibling,f=Aa(k,{mode:"hidden",children:f.children}),f.subtreeFlags=k.subtreeFlags&31457280,w!==null?m=Aa(w,m):(m=Es(m,E,o,null),m.flags|=2),m.return=l,f.return=l,f.sibling=m,l.child=f,f=m,m=l.child,E=n.child.memoizedState,E===null?E=Zc(o):(k=E.cachePool,k!==null?(w=Sn._currentValue,k=k.parent!==w?{parent:w,pool:w}:k):k=bx(),E={baseLanes:E.baseLanes|o,cachePool:k}),m.memoizedState=E,m.childLanes=Bn(n,c,o),l.memoizedState=By,f):(cl(l),o=n.child,n=o.sibling,o=Aa(o,{mode:"visible",children:f.children}),o.return=l,o.sibling=null,n!==null&&(c=l.deletions,c===null?(l.deletions=[n],l.flags|=16):c.push(n)),l.child=o,l.memoizedState=null,o)}function Ru(n,l){return l=mi({mode:"visible",children:l},n.mode),l.return=n,n.child=l}function mi(n,l){return ef(n,l,0,null)}function Eu(n,l,o){return zr(l,n.child,null,o),n=Ru(l,l.pendingProps.children),n.flags|=2,l.memoizedState=null,n}function Ld(n,l,o){n.lanes|=l;var c=n.alternate;c!==null&&(c.lanes|=l),$c(n.return,l,o)}function Ea(n,l){var o=vn(n);return n=!o&&typeof he(n)=="function",o||n?(o=o?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",o,l,o),!1):!0}function ju(n,l,o,c,f){var m=n.memoizedState;m===null?n.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:f}:(m.isBackwards=l,m.rendering=null,m.renderingStartTime=0,m.last=c,m.tail=o,m.tailMode=f)}function Hd(n,l,o){var c=l.pendingProps,f=c.revealOrder,m=c.tail;if(c=c.children,f!==void 0&&f!=="forwards"&&f!=="backwards"&&f!=="together"&&!ob[f])if(ob[f]=!0,typeof f=="string")switch(f.toLowerCase()){case"together":case"forwards":case"backwards":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',f,f.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',f,f.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',f)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',f);m===void 0||ky[m]||(m!=="collapsed"&&m!=="hidden"?(ky[m]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',m)):f!=="forwards"&&f!=="backwards"&&(ky[m]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',m)));e:if((f==="forwards"||f==="backwards")&&c!==void 0&&c!==null&&c!==!1)if(vn(c)){for(var b=0;b<c.length;b++)if(!Ea(c[b],b))break e}else if(b=he(c),typeof b=="function"){if(b=b.call(c))for(var E=b.next(),k=0;!E.done;E=b.next()){if(!Ea(E.value,k))break e;k++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',f);if(qt(n,l,c,o),c=En.current,c&Ah)c=c&Pf|Ah,l.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=l.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Ld(n,o,l);else if(n.tag===19)Ld(n,o,l);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===l)break e;for(;n.sibling===null;){if(n.return===null||n.return===l)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}c&=Pf}switch(qe(En,c,l),f){case"forwards":for(o=l.child,f=null;o!==null;)n=o.alternate,n!==null&&_c(n)===null&&(f=o),o=o.sibling;o=f,o===null?(f=l.child,l.child=null):(f=o.sibling,o.sibling=null),ju(l,!1,f,o,m);break;case"backwards":for(o=null,f=l.child,l.child=null;f!==null;){if(n=f.alternate,n!==null&&_c(n)===null){l.child=f;break}n=f.sibling,f.sibling=o,o=f,f=n}ju(l,!0,o,null,m);break;case"together":ju(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Jl(n,l,o){if(n!==null&&(l.dependencies=n.dependencies),Hl=-1,cc|=l.lanes,!(o&l.childLanes))if(n!==null){if(Kc(n,l,o,!1),(o&l.childLanes)===0)return null}else return null;if(n!==null&&l.child!==n.child)throw Error("Resuming work not yet implemented.");if(l.child!==null){for(n=l.child,o=Aa(n,n.pendingProps),l.child=o,o.return=l;n.sibling!==null;)n=n.sibling,o=o.sibling=Aa(n,n.pendingProps),o.return=l;o.sibling=null}return l.child}function Ud(n,l){return n.lanes&l?!0:(n=n.dependencies,!!(n!==null&&Jc(n)))}function Sx(n,l,o){switch(l.tag){case 3:Ne(l,l.stateNode.containerInfo),xs(l,Sn,n.memoizedState.cache),cu();break;case 27:case 5:qs(l);break;case 4:Ne(l,l.stateNode.containerInfo);break;case 10:xs(l,l.type,l.memoizedProps.value);break;case 12:o&l.childLanes&&(l.flags|=4),l.flags|=2048;var c=l.stateNode;c.effectDuration=-0,c.passiveEffectDuration=-0;break;case 13:if(c=l.memoizedState,c!==null)return c.dehydrated!==null?(cl(l),l.flags|=128,null):o&l.child.childLanes?Ht(n,l,o):(cl(l),n=Jl(n,l,o),n!==null?n.sibling:null);cl(l);break;case 19:var f=(n.flags&128)!==0;if(c=(o&l.childLanes)!==0,c||(Kc(n,l,o,!1),c=(o&l.childLanes)!==0),f){if(c)return Hd(n,l,o);l.flags|=128}if(f=l.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),qe(En,En.current,l),c)break;return null;case 22:case 23:return l.lanes=0,Nt(n,l,o);case 24:xs(l,Sn,n.memoizedState.cache)}return Jl(n,l,o)}function Vd(n,l,o){if(l._debugNeedsRemount&&n!==null){o=Pd(l.type,l.key,l.pendingProps,l._debugOwner||null,l.mode,l.lanes);var c=l.return;if(c===null)throw Error("Cannot swap the root fiber.");if(n.alternate=null,l.alternate=null,o.index=l.index,o.sibling=l.sibling,o.return=l.return,o.ref=l.ref,o._debugInfo=l._debugInfo,l===c.child)c.child=o;else{var f=c.child;if(f===null)throw Error("Expected parent to have a child.");for(;f.sibling!==l;)if(f=f.sibling,f===null)throw Error("Expected to find the previous sibling.");f.sibling=o}return l=c.deletions,l===null?(c.deletions=[n],c.flags|=16):l.push(n),o.flags|=2,o}if(n!==null)if(n.memoizedProps!==l.pendingProps||l.type!==n.type)On=!0;else{if(!Ud(n,o)&&!(l.flags&128))return On=!1,Sx(n,l,o);On=!!(n.flags&131072)}else On=!1,(c=et)&&(Ks(),c=(l.flags&1048576)!==0),c&&(c=l.index,Ks(),fx(l,og,c));switch(l.lanes=0,l.tag){case 16:e:if(c=l.pendingProps,n=lc(l.elementType),l.type=n,typeof n=="function")nr(n)?(c=ps(n,c),l.tag=1,l.type=n=Jo(n),l=jx(null,l,n,c,o)):(l.tag=0,Qc(l,n),l.type=n=Jo(n),l=Od(null,l,n,c,o));else{if(n!=null){if(f=n.$$typeof,f===Mi){l.tag=11,l.type=n=_m(n),l=vu(null,l,n,c,o);break e}else if(f===Ro){l.tag=14,l=di(null,l,n,c,o);break e}}throw l="",n!==null&&typeof n=="object"&&n.$$typeof===Dn&&(l=" Did you wrap a component in React.lazy() more than once?"),n=te(n)||n,Error("Element type is invalid. Received a promise that resolves to: "+n+". Lazy element type must resolve to a class or function."+l)}return l;case 0:return Od(n,l,l.type,l.pendingProps,o);case 1:return c=l.type,f=ps(c,l.pendingProps),jx(n,l,c,f,o);case 3:e:{if(Ne(l,l.stateNode.containerInfo),n===null)throw Error("Should have a current fiber. This is a bug in React.");var m=l.pendingProps;f=l.memoizedState,c=f.element,Yd(n,l),Au(l,m,null,o);var b=l.memoizedState;if(m=b.cache,xs(l,Sn,m),m!==f.cache&&qd(l,[Sn],o,!0),Sa(),m=b.element,f.isDehydrated)if(f={element:m,isDehydrated:!1,cache:b.cache},l.updateQueue.baseState=f,l.memoizedState=f,l.flags&256){l=zd(n,l,m,o);break e}else if(m!==c){c=Jn(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),l),ei(c),l=zd(n,l,m,o);break e}else for(Yn=el(l.stateNode.containerInfo.firstChild),Al=l,et=!0,Hs=null,Vi=!1,Xa=null,_o=!0,n=U0(l,null,m,o),l.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(cu(),m===c){l=Jl(n,l,o);break e}qt(n,l,m,o)}l=l.child}return l;case 26:return fi(n,l),n===null?(n=vf(l.type,null,l.pendingProps,null))?l.memoizedState=n:et||(n=l.type,o=l.pendingProps,c=Xt(rn.current),c=gf(c).createElement(n),c[Rn]=l,c[nl]=o,kt(c,n,o),Qt(c),l.stateNode=c):l.memoizedState=vf(l.type,n.memoizedProps,l.pendingProps,n.memoizedState),null;case 27:return qs(l),n===null&&et&&(f=Xt(rn.current),c=Wa(),f=l.stateNode=Uu(l.type,l.pendingProps,f,c,!1),Vi||(c=Lx(f,l.type,l.pendingProps,c),c!==null&&(Js(l,0).serverProps=c)),Al=l,_o=!0,Yn=el(f.firstChild)),c=l.pendingProps.children,n!==null||et?qt(n,l,c,o):l.child=zr(l,null,c,o),fi(n,l),l.child;case 5:return n===null&&et&&(m=Wa(),c=rd(l.type,m.ancestorInfo),f=Yn,(b=!f)||(b=mr(f,l.type,l.pendingProps,_o),b!==null?(l.stateNode=b,Vi||(m=Lx(b,l.type,l.pendingProps,m),m!==null&&(Js(l,0).serverProps=m)),Al=l,Yn=el(b.firstChild),_o=!1,m=!0):m=!1,b=!m),b&&(c&&Po(l,f),Ql(l))),qs(l),f=l.type,m=l.pendingProps,b=n!==null?n.memoizedProps:null,c=m.children,ct(f,m)?c=null:b!==null&&ct(f,b)&&(l.flags|=32),l.memoizedState!==null&&(f=Wn(n,l,Td,null,null,o),Yh._currentValue=f),fi(n,l),qt(n,l,c,o),l.child;case 6:return n===null&&et&&(n=l.pendingProps,o=Wa().ancestorInfo.current,n=o!=null?Ec(n,o.tag):!0,o=Yn,(c=!o)||(c=Oa(o,l.pendingProps,_o),c!==null?(l.stateNode=c,Al=l,Yn=null,c=!0):c=!1,c=!c),c&&(n&&Po(l,o),Ql(l))),null;case 13:return Ht(n,l,o);case 4:return Ne(l,l.stateNode.containerInfo),c=l.pendingProps,n===null?l.child=zr(l,null,c,o):qt(n,l,c,o),l.child;case 11:return vu(n,l,l.type,l.pendingProps,o);case 7:return qt(n,l,l.pendingProps,o),l.child;case 8:return qt(n,l,l.pendingProps.children,o),l.child;case 12:return l.flags|=4,l.flags|=2048,c=l.stateNode,c.effectDuration=-0,c.passiveEffectDuration=-0,qt(n,l,l.pendingProps.children,o),l.child;case 10:return c=l.type,f=l.pendingProps,m=f.value,"value"in f||ib||(ib=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),xs(l,c,m),qt(n,l,f.children,o),l.child;case 9:return f=l.type._context,c=l.pendingProps.children,typeof c!="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),so(l),f=gt(f),Ho(l),c=vy(c,f,void 0),Gs(),l.flags|=1,qt(n,l,c,o),l.child;case 14:return di(n,l,l.type,l.pendingProps,o);case 15:return Ex(n,l,l.type,l.pendingProps,o);case 19:return Hd(n,l,o);case 22:return Nt(n,l,o);case 24:return so(l),c=gt(Sn),n===null?(f=Cd(),f===null&&(f=vt,m=is(),f.pooledCache=m,Ml(m),m!==null&&(f.pooledCacheLanes|=o),f=m),l.memoizedState={parent:c,cache:f},Gd(l),xs(l,Sn,f)):(n.lanes&o&&(Yd(n,l),Au(l,null,null,o),Sa()),f=n.memoizedState,m=l.memoizedState,f.parent!==c?(f={parent:c,cache:c},l.memoizedState=f,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=f),xs(l,Sn,c)):(c=m.cache,xs(l,Sn,c),c!==f.cache&&qd(l,[Sn],o,!0))),qt(n,l,l.pendingProps.children,o),l.child;case 29:throw l.pendingProps}throw Error("Unknown unit of work tag ("+l.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function Ic(){sm=mg=null,om=!1}function xs(n,l,o){qe(wy,l._currentValue,n),l._currentValue=o,qe(Dy,l._currentRenderer,n),l._currentRenderer!==void 0&&l._currentRenderer!==null&&l._currentRenderer!==ub&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),l._currentRenderer=ub}function ja(n,l){n._currentValue=wy.current;var o=Dy.current;Ve(Dy,l),n._currentRenderer=o,Ve(wy,l)}function $c(n,l,o){for(;n!==null;){var c=n.alternate;if((n.childLanes&l)!==l?(n.childLanes|=l,c!==null&&(c.childLanes|=l)):c!==null&&(c.childLanes&l)!==l&&(c.childLanes|=l),n===o)break;n=n.return}n!==o&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function qd(n,l,o,c){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var E=m;m=f;for(var k=0;k<l.length;k++)if(E.context===l[k]){m.lanes|=o,E=m.alternate,E!==null&&(E.lanes|=o),$c(m.return,o,n),c||(b=null);break e}m=E.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");b.lanes|=o,m=b.alternate,m!==null&&(m.lanes|=o),$c(b,o,n),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===n){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Kc(n,l,o,c){n=null;for(var f=l,m=!1;f!==null;){if(!m){if(f.flags&524288)m=!0;else if(f.flags&262144)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error("Should have a current fiber. This is a bug in React.");if(b=b.memoizedProps,b!==null){var E=f.type;Sl(f.pendingProps.value,b.value)||(n!==null?n.push(E):n=[E])}}else if(f===Cr.current){if(b=f.alternate,b===null)throw Error("Should have a current fiber. This is a bug in React.");b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(Yh):n=[Yh])}f=f.return}n!==null&&qd(l,n,o,c),l.flags|=262144}function Jc(n){for(n=n.firstContext;n!==null;){if(!Sl(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function so(n){mg=n,sm=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function gt(n){return om&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),lp(mg,n)}function Su(n,l){return mg===null&&so(n),lp(n,l)}function lp(n,l){var o=l._currentValue;if(l={context:l,memoizedValue:o,next:null},sm===null){if(n===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");sm=l,n.dependencies={lanes:0,firstContext:l,_debugThenableState:null},n.flags|=524288}else sm=sm.next=l;return o}function Gd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yd(n,l){n=n.updateQueue,l.updateQueue===n&&(l.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function gs(n){return{lane:n,tag:cb,payload:null,callback:null,next:null}}function ys(n,l,o){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,_y===c&&!fb){var f=X(n);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.
|
|
209
|
+
|
|
210
|
+
Please update the following component: %s`,f),fb=!0}return(Bt&kl)!==oa?(f=c.pending,f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l,l=vd(n),cx(n,null,o),l):(bd(n,c,l,o),vd(n))}function Wc(n,l,o){if(l=l.updateQueue,l!==null&&(l=l.shared,(o&4194176)!==0)){var c=l.lanes;c&=n.pendingLanes,o|=c,l.lanes=o,In(n,o)}}function Fc(n,l){var o=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var f=null,m=null;if(o=o.firstBaseUpdate,o!==null){do{var b={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,o=o.next}while(o!==null);m===null?f=m=l:m=m.next=l}else f=m=l;o={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:c.shared,callbacks:c.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=l:n.next=l,o.lastBaseUpdate=l}function Sa(){if(Ny){var n=em;if(n!==null)throw n}}function Au(n,l,o,c){Ny=!1;var f=n.updateQueue;uc=!1,_y=f.shared;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var k=E,w=k.next;k.next=null,b===null?m=w:b.next=w,b=k;var I=n.alternate;I!==null&&(I=I.updateQueue,E=I.lastBaseUpdate,E!==b&&(E===null?I.firstBaseUpdate=w:E.next=w,I.lastBaseUpdate=k))}if(m!==null){var ae=f.baseState;b=0,I=w=k=null,E=m;do{var $=E.lane&-536870913,ce=$!==E.lane;if(ce?(Je&$)===$:(c&$)===$){$!==0&&$===Lr&&(Ny=!0),I!==null&&(I=I.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{$=n;var Be=E,Ye=l,tn=o;switch(Be.tag){case rb:if(Be=Be.payload,typeof Be=="function"){om=!0;var ut=Be.call(tn,ae,Ye);if($.mode&al){mt(!0);try{Be.call(tn,ae,Ye)}finally{mt(!1)}}om=!1,ae=ut;break e}ae=Be;break e;case My:$.flags=$.flags&-65537|128;case cb:if(ut=Be.payload,typeof ut=="function"){if(om=!0,Be=ut.call(tn,ae,Ye),$.mode&al){mt(!0);try{ut.call(tn,ae,Ye)}finally{mt(!1)}}om=!1}else Be=ut;if(Be==null)break e;ae=He({},ae,Be);break e;case db:uc=!0}}$=E.callback,$!==null&&(n.flags|=64,ce&&(n.flags|=8192),ce=f.callbacks,ce===null?f.callbacks=[$]:ce.push($))}else ce={lane:$,tag:E.tag,payload:E.payload,callback:E.callback,next:null},I===null?(w=I=ce,k=ae):I=I.next=ce,b|=$;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;ce=E,E=ce.next,ce.next=null,f.lastBaseUpdate=ce,f.shared.pending=null}}while(!0);I===null&&(k=ae),f.baseState=k,f.firstBaseUpdate=w,f.lastBaseUpdate=I,m===null&&(f.shared.lanes=0),cc|=b,n.lanes=b,n.memoizedState=ae}_y=null}function Pc(n,l){if(typeof n!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+n);n.call(l)}function Xd(n,l){var o=n.shared.hiddenCallbacks;if(o!==null)for(n.shared.hiddenCallbacks=null,n=0;n<o.length;n++)Pc(o[n],l)}function ap(n,l){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Pc(o[n],l)}function Nl(n){return(n.mode&Gn)!==Ct}function sp(n,l){Nl(n)?(Xl(),Cu(l,n),Yl()):Cu(l,n)}function Qd(n,l,o){Nl(n)?(Xl(),pi(o,n,l),Yl()):pi(o,n,l)}function Cu(n,l){try{var o=l.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var f=c.next;o=f;do{if((o.tag&n)===n&&((n&jn)!==Za?Se!==null&&typeof Se.markComponentPassiveEffectMountStarted=="function"&&Se.markComponentPassiveEffectMountStarted(l):(n&Xn)!==Za&&Se!==null&&typeof Se.markComponentLayoutEffectMountStarted=="function"&&Se.markComponentLayoutEffectMountStarted(l),c=void 0,(n&Cl)!==Za&&(fm=!0),c=oe(l,Cv,o),(n&Cl)!==Za&&(fm=!1),(n&jn)!==Za?Se!==null&&typeof Se.markComponentPassiveEffectMountStopped=="function"&&Se.markComponentPassiveEffectMountStopped():(n&Xn)!==Za&&Se!==null&&typeof Se.markComponentLayoutEffectMountStopped=="function"&&Se.markComponentLayoutEffectMountStopped(),c!==void 0&&typeof c!="function")){var m=void 0;m=o.tag&Xn?"useLayoutEffect":o.tag&Cl?"useInsertionEffect":"useEffect";var b=void 0;b=c===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof c.then=="function"?`
|
|
211
|
+
|
|
212
|
+
It looks like you wrote `+m+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
|
|
213
|
+
|
|
214
|
+
`+m+`(() => {
|
|
215
|
+
async function fetchData() {
|
|
216
|
+
// You can await here
|
|
217
|
+
const response = await MyAPI.getData(someId);
|
|
218
|
+
// ...
|
|
219
|
+
}
|
|
220
|
+
fetchData();
|
|
221
|
+
}, [someId]); // Or [] if effect doesn't need props or state
|
|
222
|
+
|
|
223
|
+
Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+c,oe(l,function(E,k){console.error("%s must not return anything besides a function, which is used for clean-up.%s",E,k)},m,b)}o=o.next}while(o!==f)}}catch(E){lt(l,l.return,E)}}function pi(n,l,o){try{var c=l.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var m=f.next;c=m;do{if((c.tag&n)===n){var b=c.inst,E=b.destroy;E!==void 0&&(b.destroy=void 0,(n&jn)!==Za?Se!==null&&typeof Se.markComponentPassiveEffectUnmountStarted=="function"&&Se.markComponentPassiveEffectUnmountStarted(l):(n&Xn)!==Za&&Se!==null&&typeof Se.markComponentLayoutEffectUnmountStarted=="function"&&Se.markComponentLayoutEffectUnmountStarted(l),(n&Cl)!==Za&&(fm=!0),oe(l,Tv,l,o,E),(n&Cl)!==Za&&(fm=!1),(n&jn)!==Za?Se!==null&&typeof Se.markComponentPassiveEffectUnmountStopped=="function"&&Se.markComponentPassiveEffectUnmountStopped():(n&Xn)!==Za&&Se!==null&&typeof Se.markComponentLayoutEffectUnmountStopped=="function"&&Se.markComponentLayoutEffectUnmountStopped())}c=c.next}while(c!==m)}}catch(k){lt(l,l.return,k)}}function Zd(n,l){Nl(n)?(Xl(),Cu(l,n),Yl()):Cu(l,n)}function Id(n,l,o){Nl(n)?(Xl(),pi(o,n,l),Yl()):pi(o,n,l)}function op(n){var l=n.updateQueue;if(l!==null){var o=n.stateNode;n.type.defaultProps||"ref"in n.memoizedProps||am||(o.props!==n.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",X(n)||"instance"),o.state!==n.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",X(n)||"instance"));try{oe(n,ap,l,o)}catch(c){lt(n,n.return,c)}}}function ip(n,l,o){return n.getSnapshotBeforeUpdate(l,o)}function Ax(n,l){var o=l.memoizedProps,c=l.memoizedState;l=n.stateNode,n.type.defaultProps||"ref"in n.memoizedProps||am||(l.props!==n.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",X(n)||"instance"),l.state!==n.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",X(n)||"instance"));try{var f=ps(n.type,o,n.elementType===n.type),m=oe(n,ip,l,f,c);o=mb,m!==void 0||o.has(n.type)||(o.add(n.type),oe(n,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",X(n))})),l.__reactInternalSnapshotBeforeUpdate=m}catch(b){lt(n,n.return,b)}}function up(n,l,o){o.props=ps(n.type,n.memoizedProps),o.state=n.memoizedState,Nl(n)?(Xl(),oe(n,D0,n,l,o),Yl()):oe(n,D0,n,l,o)}function Zg(n){var l=n.ref;if(l!==null){var o=n.stateNode;if(typeof l=="function")if(Nl(n))try{Xl(),n.refCleanup=l(o)}finally{Yl()}else n.refCleanup=l(o);else typeof l=="string"?console.error("String refs are no longer supported."):l.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",X(n)),l.current=o}}function bs(n,l){try{oe(n,Zg,n)}catch(o){lt(n,l,o)}}function Pn(n,l){var o=n.ref,c=n.refCleanup;if(o!==null)if(typeof c=="function")try{if(Nl(n))try{Xl(),oe(n,c)}finally{Yl(n)}else oe(n,c)}catch(f){lt(n,l,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{if(Nl(n))try{Xl(),oe(n,o,null)}finally{Yl(n)}else oe(n,o,null)}catch(f){lt(n,l,f)}else o.current=null}function cp(n,l,o,c){var f=n.memoizedProps,m=f.id,b=f.onCommit;f=f.onRender,l=l===null?"mount":"update",ng&&(l="nested-update"),typeof f=="function"&&f(m,l,n.actualDuration,n.treeBaseDuration,n.actualStartTime,o),typeof b=="function"&&b(n.memoizedProps.id,l,c,o)}function rp(n,l,o,c){var f=n.memoizedProps;n=f.id,f=f.onPostCommit,l=l===null?"mount":"update",ng&&(l="nested-update"),typeof f=="function"&&f(n,l,c,o)}function dp(n){var l=n.type,o=n.memoizedProps,c=n.stateNode;try{oe(n,pt,c,l,o,n)}catch(f){lt(n,n.return,f)}}function fp(n,l,o){try{oe(n,yl,n.stateNode,n.type,o,l,n)}catch(c){lt(n,n.return,c)}}function Cx(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27||n.tag===4}function mp(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Cx(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==27&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function $d(n,l,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,l?o.nodeType===8?o.parentNode.insertBefore(n,l):o.insertBefore(n,l):(o.nodeType===8?(l=o.parentNode,l.insertBefore(n,o)):(l=o,l.appendChild(n)),o=o._reactRootContainer,o!=null||l.onclick!==null||(l.onclick=na));else if(c!==4&&c!==27&&(n=n.child,n!==null))for($d(n,l,o),n=n.sibling;n!==null;)$d(n,l,o),n=n.sibling}function oo(n,l,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,l?o.insertBefore(n,l):o.appendChild(n);else if(c!==4&&c!==27&&(n=n.child,n!==null))for(oo(n,l,o),n=n.sibling;n!==null;)oo(n,l,o),n=n.sibling}function pp(n){if(n.tag!==27){e:{for(var l=n.return;l!==null;){if(Cx(l)){var o=l;break e}l=l.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}switch(o.tag){case 27:l=o.stateNode,o=mp(n),oo(n,o,l);break;case 5:l=o.stateNode,o.flags&32&&(Na(l),o.flags&=-33),o=mp(n),oo(n,o,l);break;case 3:case 4:l=o.stateNode.containerInfo,o=mp(n),$d(n,o,l);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}}function Kd(n,l){if(n=n.containerInfo,Py=_g,n=ix(n),gd(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var f=c.anchorOffset,m=c.focusNode;c=c.focusOffset;try{o.nodeType,m.nodeType}catch{o=null;break e}var b=0,E=-1,k=-1,w=0,I=0,ae=n,$=null;t:for(;;){for(var ce;ae!==o||f!==0&&ae.nodeType!==3||(E=b+f),ae!==m||c!==0&&ae.nodeType!==3||(k=b+c),ae.nodeType===3&&(b+=ae.nodeValue.length),(ce=ae.firstChild)!==null;)$=ae,ae=ce;for(;;){if(ae===n)break t;if($===o&&++w===f&&(E=b),$===m&&++I===c&&(k=b),(ce=ae.nextSibling)!==null)break;ae=$,$=ae.parentNode}ae=ce}o=E===-1||k===-1?null:{start:E,end:k}}else o=null}o=o||{start:0,end:0}}else o=null;for(e0={focusedElem:n,selectionRange:o},_g=!1,zn=l;zn!==null;)if(l=zn,n=l.child,(l.subtreeFlags&1028)!==0&&n!==null)n.return=l,zn=n;else for(;zn!==null;){switch(n=l=zn,o=n.alternate,f=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:f&1024&&o!==null&&Ax(n,o);break;case 3:if(f&1024){if(n=n.stateNode.containerInfo,o=n.nodeType,o===9)xo(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":xo(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(f&1024)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(n=l.sibling,n!==null){n.return=l.return,zn=n;break}zn=l.return}return l=hb,hb=!1,l}function hp(n,l,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Wl(n,o),c&4&&sp(o,Xn|Ia);break;case 1:if(Wl(n,o),c&4)if(n=o.stateNode,l===null)o.type.defaultProps||"ref"in o.memoizedProps||am||(n.props!==o.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",X(o)||"instance"),n.state!==o.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",X(o)||"instance")),Nl(o)?(Xl(),oe(o,Ry,o,n),Yl()):oe(o,Ry,o,n);else{var f=ps(o.type,l.memoizedProps);l=l.memoizedState,o.type.defaultProps||"ref"in o.memoizedProps||am||(n.props!==o.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",X(o)||"instance"),n.state!==o.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",X(o)||"instance")),Nl(o)?(Xl(),oe(o,k0,o,n,f,l,n.__reactInternalSnapshotBeforeUpdate),Yl()):oe(o,k0,o,n,f,l,n.__reactInternalSnapshotBeforeUpdate)}c&64&&op(o),c&512&&bs(o,o.return);break;case 3:if(l=ss(),Wl(n,o),c&64&&(c=o.updateQueue,c!==null)){if(f=null,o.child!==null)switch(o.child.tag){case 27:case 5:f=o.child.stateNode;break;case 1:f=o.child.stateNode}try{oe(o,ap,c,f)}catch(E){lt(o,o.return,E)}}n.effectDuration+=Rd(l);break;case 26:Wl(n,o),c&512&&bs(o,o.return);break;case 27:case 5:Wl(n,o),l===null&&c&4&&dp(o),c&512&&bs(o,o.return);break;case 12:if(c&4){c=ss(),Wl(n,o),n=o.stateNode,n.effectDuration+=Wo(c);try{oe(o,cp,o,l,tg,n.effectDuration)}catch(E){lt(o,o.return,E)}}else Wl(n,o);break;case 13:Wl(n,o),c&4&&vs(n,o);break;case 22:if(f=o.memoizedState!==null||Yi,!f){l=l!==null&&l.memoizedState!==null||Gt;var m=Yi,b=Gt;Yi=f,(Gt=l)&&!b?Fl(n,o,(o.subtreeFlags&8772)!==0):Wl(n,o),Yi=m,Gt=b}c&512&&(o.memoizedProps.mode==="manual"?bs(o,o.return):Pn(o,o.return));break;default:Wl(n,o)}}function xp(n){var l=n.alternate;l!==null&&(n.alternate=null,xp(l)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(l=n.stateNode,l!==null&&Pa(l)),n.stateNode=null,n._debugOwner=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function an(n,l,o){for(o=o.child;o!==null;)io(n,l,o),o=o.sibling}function io(n,l,o){if(_n&&typeof _n.onCommitFiberUnmount=="function")try{_n.onCommitFiberUnmount(Ku,o)}catch(m){Vn||(Vn=!0,console.error("React instrumentation encountered an error: %s",m))}switch(o.tag){case 26:Gt||Pn(o,l),an(n,l,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Gt||Pn(o,l);var c=fn,f=sa;for(fn=o.stateNode,an(n,l,o),o=o.stateNode,n=o.attributes;n.length;)o.removeAttributeNode(n[0]);Pa(o),fn=c,sa=f;break;case 5:Gt||Pn(o,l);case 6:if(c=fn,f=sa,fn=null,an(n,l,o),fn=c,sa=f,fn!==null)if(sa)try{oe(o,ws,fn,o.stateNode)}catch(m){lt(o,l,m)}else try{oe(o,Mp,fn,o.stateNode)}catch(m){lt(o,l,m)}break;case 18:fn!==null&&(sa?(n=fn,o=o.stateNode,n.nodeType===8?At(n.parentNode,o):n.nodeType===1&&At(n,o),Qu(n)):At(fn,o.stateNode));break;case 4:c=fn,f=sa,fn=o.stateNode.containerInfo,sa=!0,an(n,l,o),fn=c,sa=f;break;case 0:case 11:case 14:case 15:Gt||pi(Cl,o,l),Gt||Qd(o,l,Xn),an(n,l,o);break;case 1:Gt||(Pn(o,l),c=o.stateNode,typeof c.componentWillUnmount=="function"&&up(o,l,c)),an(n,l,o);break;case 21:an(n,l,o);break;case 22:Gt||Pn(o,l),Gt=(c=Gt)||o.memoizedState!==null,an(n,l,o),Gt=c;break;default:an(n,l,o)}}function vs(n,l){if(l.memoizedState===null&&(n=l.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{oe(l,Ci,n)}catch(o){lt(l,l.return,o)}}function hi(n){switch(n.tag){case 13:case 19:var l=n.stateNode;return l===null&&(l=n.stateNode=new pb),l;case 22:return n=n.stateNode,l=n._retryCache,l===null&&(l=n._retryCache=new pb),l;default:throw Error("Unexpected Suspense handler tag ("+n.tag+"). This is a bug in React.")}}function er(n,l){var o=hi(n);l.forEach(function(c){var f=un.bind(null,n,c);if(!o.has(c)){if(o.add(c),qn)if(im!==null&&um!==null)Et(um,im);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");c.then(f,f)}})}function gp(n,l,o){im=o,um=n,yp(l,n),um=im=null}function fl(n,l){var o=l.deletions;if(o!==null)for(var c=0;c<o.length;c++){var f=n,m=l,b=o[c],E=m;e:for(;E!==null;){switch(E.tag){case 27:case 5:fn=E.stateNode,sa=!1;break e;case 3:fn=E.stateNode.containerInfo,sa=!0;break e;case 4:fn=E.stateNode.containerInfo,sa=!0;break e}E=E.return}if(fn===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");io(f,m,b),fn=null,sa=!1,f=b,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)yp(l,n),l=l.sibling}function yp(n,l){var o=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:fl(l,n),sn(n),c&4&&(pi(Cl|Ia,n,n.return),Cu(Cl|Ia,n),Qd(n,n.return,Xn|Ia));break;case 1:fl(l,n),sn(n),c&512&&(Gt||o===null||Pn(o,o.return)),c&64&&Yi&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var f=Us;if(fl(l,n),sn(n),c&512&&(Gt||o===null||Pn(o,o.return)),c&4)if(l=o!==null?o.memoizedState:null,c=n.memoizedState,o===null)if(c===null)if(n.stateNode===null){e:{c=n.type,o=n.memoizedProps,l=f.ownerDocument||f;t:switch(c){case"title":f=l.getElementsByTagName("title")[0],(!f||f[To]||f[Rn]||f.namespaceURI===jl||f.hasAttribute("itemprop"))&&(f=l.createElement(c),l.head.insertBefore(f,l.querySelector("head > title"))),kt(f,c,o),f[Rn]=n,Qt(f),c=f;break e;case"link":var m=Lp("link","href",l).get(c+(o.href||""));if(m){for(var b=0;b<m.length;b++)if(f=m[b],f.getAttribute("href")===(o.href==null?null:o.href)&&f.getAttribute("rel")===(o.rel==null?null:o.rel)&&f.getAttribute("title")===(o.title==null?null:o.title)&&f.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){m.splice(b,1);break t}}f=l.createElement(c),kt(f,c,o),l.head.appendChild(f);break;case"meta":if(m=Lp("meta","content",l).get(c+(o.content||""))){for(b=0;b<m.length;b++)if(f=m[b],at(o.content,"content"),f.getAttribute("content")===(o.content==null?null:""+o.content)&&f.getAttribute("name")===(o.name==null?null:o.name)&&f.getAttribute("property")===(o.property==null?null:o.property)&&f.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&f.getAttribute("charset")===(o.charSet==null?null:o.charSet)){m.splice(b,1);break t}}f=l.createElement(c),kt(f,c,o),l.head.appendChild(f);break;default:throw Error('getNodesForType encountered a type it did not expect: "'+c+'". This is a bug in React.')}f[Rn]=n,Qt(f),c=f}n.stateNode=c}else Hp(f,n.type,n.stateNode);else n.stateNode=za(f,c,n.memoizedProps);else l!==c?(l===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):l.count--,c===null?Hp(f,n.type,n.stateNode):za(f,c,n.memoizedProps)):c===null&&n.stateNode!==null&&fp(n,n.memoizedProps,o.memoizedProps);break;case 27:if(c&4&&n.alternate===null){f=n.stateNode,m=n.memoizedProps;try{for(b=f.firstChild;b;){var E=b.nextSibling,k=b.nodeName;b[To]||k==="HEAD"||k==="BODY"||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&b.rel.toLowerCase()==="stylesheet"||f.removeChild(b),b=E}oe(n,Np,n.type,m,f,n)}catch(I){lt(n,n.return,I)}}case 5:if(fl(l,n),sn(n),c&512&&(Gt||o===null||Pn(o,o.return)),n.flags&32){l=n.stateNode;try{oe(n,Na,l)}catch(I){lt(n,n.return,I)}}c&4&&n.stateNode!=null&&(l=n.memoizedProps,fp(n,l,o!==null?o.memoizedProps:l)),c&1024&&(Oy=!0,n.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."));break;case 6:if(fl(l,n),sn(n),c&4){if(n.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");c=n.memoizedProps,o=o!==null?o.memoizedProps:c,l=n.stateNode;try{oe(n,Hu,l,o,c)}catch(I){lt(n,n.return,I)}}break;case 3:if(f=ss(),wg=null,m=Us,Us=Vu(l.containerInfo),fl(l,n),Us=m,sn(n),c&4&&o!==null&&o.memoizedState.isDehydrated)try{oe(n,bf,l.containerInfo)}catch(I){lt(n,n.return,I)}Oy&&(Oy=!1,tr(n)),l.effectDuration+=Rd(f);break;case 4:c=Us,Us=Vu(n.stateNode.containerInfo),fl(l,n),sn(n),Us=c;break;case 12:c=ss(),fl(l,n),sn(n),n.stateNode.effectDuration+=Wo(c);break;case 13:fl(l,n),sn(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(qy=Ua()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,er(n,c)));break;case 22:c&512&&(Gt||o===null||Pn(o,o.return)),b=n.memoizedState!==null,E=o!==null&&o.memoizedState!==null,k=Yi;var w=Gt;if(Yi=k||b,Gt=w||E,fl(l,n),Gt=w,Yi=k,sn(n),l=n.stateNode,l._current=n,l._visibility&=~Mr,l._visibility|=l._pendingVisibility&Mr,c&8192&&(l._visibility=b?l._visibility&~xh:l._visibility|xh,b&&(l=Yi||Gt,o===null||E||l||Rs(n)),n.memoizedProps===null||n.memoizedProps.mode!=="manual"))e:for(o=null,l=n;;){if(l.tag===5||l.tag===26||l.tag===27){if(o===null){E=o=l;try{f=E.stateNode,b?oe(E,ho,f):oe(E,_p,E.stateNode,E.memoizedProps)}catch(I){lt(E,E.return,I)}}}else if(l.tag===6){if(o===null){E=l;try{m=E.stateNode,b?oe(E,Ai,m):oe(E,zl,m,E.memoizedProps)}catch(I){lt(E,E.return,I)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===n)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===n)break e;for(;l.sibling===null;){if(l.return===null||l.return===n)break e;o===l&&(o=null),l=l.return}o===l&&(o=null),l.sibling.return=l.return,l=l.sibling}c&4&&(c=n.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,er(n,o))));break;case 19:fl(l,n),sn(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,er(n,c)));break;case 21:break;default:fl(l,n),sn(n)}}function sn(n){var l=n.flags;if(l&2){try{oe(n,pp,n)}catch(o){lt(n,n.return,o)}n.flags&=-3}l&4096&&(n.flags&=-4097)}function tr(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var l=n;tr(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),n=n.sibling}}function Tx(n,l,o){im=o,um=l,hp(l,n.alternate,n),um=im=null}function Wl(n,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)hp(n,l.alternate,l),l=l.sibling}function bp(n){switch(n.tag){case 0:case 11:case 14:case 15:Qd(n,n.return,Xn),Rs(n);break;case 1:Pn(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&up(n,n.return,l),Rs(n);break;case 26:case 27:case 5:Pn(n,n.return),Rs(n);break;case 22:Pn(n,n.return),n.memoizedState===null&&Rs(n);break;default:Rs(n)}}function Rs(n){for(n=n.child;n!==null;)bp(n),n=n.sibling}function vp(n,l,o,c){var f=o.flags;switch(o.tag){case 0:case 11:case 15:Fl(n,o,c),sp(o,Xn);break;case 1:if(Fl(n,o,c),l=o.stateNode,typeof l.componentDidMount=="function"&&oe(o,Ry,o,l),l=o.updateQueue,l!==null){n=o.stateNode;try{oe(o,Xd,l,n)}catch(m){lt(o,o.return,m)}}c&&f&64&&op(o),bs(o,o.return);break;case 26:case 27:case 5:Fl(n,o,c),c&&l===null&&f&4&&dp(o),bs(o,o.return);break;case 12:if(c&&f&4){f=ss(),Fl(n,o,c),c=o.stateNode,c.effectDuration+=Wo(f);try{oe(o,cp,o,l,tg,c.effectDuration)}catch(m){lt(o,o.return,m)}}else Fl(n,o,c);break;case 13:Fl(n,o,c),c&&f&4&&vs(n,o);break;case 22:o.memoizedState===null&&Fl(n,o,c),bs(o,o.return);break;default:Fl(n,o,c)}}function Fl(n,l,o){for(o=o&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;)vp(n,l.alternate,l,o),l=l.sibling}function Jd(n,l){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(n=l.memoizedState.cachePool.pool),n!==o&&(n!=null&&Ml(n),o!=null&&ti(o))}function Wd(n,l){n=null,l.alternate!==null&&(n=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==n&&(Ml(l),n!=null&&ti(n))}function uo(n,l,o,c){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Rp(n,l,o,c),l=l.sibling}function Rp(n,l,o,c){var f=l.flags;switch(l.tag){case 0:case 11:case 15:uo(n,l,o,c),f&2048&&Zd(l,jn|Ia);break;case 3:var m=ss();uo(n,l,o,c),f&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(Ml(l),o!=null&&ti(o))),n.passiveEffectDuration+=Rd(m);break;case 12:if(f&2048){m=ss(),uo(n,l,o,c),n=l.stateNode,n.passiveEffectDuration+=Wo(m);try{oe(l,rp,l,l.alternate,tg,n.passiveEffectDuration)}catch(b){lt(l,l.return,b)}}else uo(n,l,o,c);break;case 23:break;case 22:m=l.stateNode,l.memoizedState!==null?m._visibility&Li?uo(n,l,o,c):Tu(n,l):m._visibility&Li?uo(n,l,o,c):(m._visibility|=Li,Tt(n,l,o,c,(l.subtreeFlags&10256)!==0)),f&2048&&Jd(l.alternate,l);break;case 24:uo(n,l,o,c),f&2048&&Wd(l.alternate,l);break;default:uo(n,l,o,c)}}function Tt(n,l,o,c,f){for(f=f&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;)on(n,l,o,c,f),l=l.sibling}function on(n,l,o,c,f){var m=l.flags;switch(l.tag){case 0:case 11:case 15:Tt(n,l,o,c,f),Zd(l,jn);break;case 23:break;case 22:var b=l.stateNode;l.memoizedState!==null?b._visibility&Li?Tt(n,l,o,c,f):Tu(n,l):(b._visibility|=Li,Tt(n,l,o,c,f)),f&&m&2048&&Jd(l.alternate,l);break;case 24:Tt(n,l,o,c,f),f&&m&2048&&Wd(l.alternate,l);break;default:Tt(n,l,o,c,f)}}function Tu(n,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var o=n,c=l,f=c.flags;switch(c.tag){case 22:Tu(o,c),f&2048&&Jd(c.alternate,c);break;case 24:Tu(o,c),f&2048&&Wd(c.alternate,c);break;default:Tu(o,c)}l=l.sibling}}function xi(n){if(n.subtreeFlags&Bh)for(n=n.child;n!==null;)Ep(n),n=n.sibling}function Ep(n){switch(n.tag){case 26:xi(n),n.flags&Bh&&n.memoizedState!==null&&Ig(Us,n.memoizedState,n.memoizedProps);break;case 5:xi(n);break;case 3:case 4:var l=Us;Us=Vu(n.stateNode.containerInfo),xi(n),Us=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=Bh,Bh=16777216,xi(n),Bh=l):xi(n));break;default:xi(n)}}function jp(n){var l=n.alternate;if(l!==null&&(n=l.child,n!==null)){l.child=null;do l=n.sibling,n.sibling=null,n=l;while(n!==null)}}function ku(n){var l=n.deletions;if(n.flags&16){if(l!==null)for(var o=0;o<l.length;o++){var c=l[o];zn=c,Ap(c,n)}jp(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Bu(n),n=n.sibling}function Bu(n){switch(n.tag){case 0:case 11:case 15:ku(n),n.flags&2048&&Id(n,n.return,jn|Ia);break;case 3:var l=ss();ku(n),n.stateNode.passiveEffectDuration+=Rd(l);break;case 12:l=ss(),ku(n),n.stateNode.passiveEffectDuration+=Wo(l);break;case 22:l=n.stateNode,n.memoizedState!==null&&l._visibility&Li&&(n.return===null||n.return.tag!==13)?(l._visibility&=~Li,wu(n)):ku(n);break;default:ku(n)}}function wu(n){var l=n.deletions;if(n.flags&16){if(l!==null)for(var o=0;o<l.length;o++){var c=l[o];zn=c,Ap(c,n)}jp(n)}for(n=n.child;n!==null;)Sp(n),n=n.sibling}function Sp(n){switch(n.tag){case 0:case 11:case 15:Id(n,n.return,jn),wu(n);break;case 22:var l=n.stateNode;l._visibility&Li&&(l._visibility&=~Li,wu(n));break;default:wu(n)}}function Ap(n,l){for(;zn!==null;){var o=zn,c=o;switch(c.tag){case 0:case 11:case 15:Id(c,l,jn);break;case 23:case 22:c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(c=c.memoizedState.cachePool.pool,c!=null&&Ml(c));break;case 24:ti(c.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,zn=c;else e:for(o=n;zn!==null;){c=zn;var f=c.sibling,m=c.return;if(xp(c),c===o){zn=null;break e}if(f!==null){f.return=m,zn=f;break e}zn=m}}}function kx(n,l,o,c){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,xb||typeof Object.preventExtensions!="function"||Object.preventExtensions(this)}function nr(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Aa(n,l){var o=n.alternate;switch(o===null?(o=j(n.tag,l,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o._debugOwner=n._debugOwner,o._debugHookTypes=n._debugHookTypes,o.alternate=n,n.alternate=o):(o.pendingProps=l,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null,o.actualDuration=-0,o.actualStartTime=-1.1),o.flags=n.flags&31457280,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,l=n.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext,_debugThenableState:l._debugThenableState},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o.selfBaseDuration=n.selfBaseDuration,o.treeBaseDuration=n.treeBaseDuration,o._debugInfo=n._debugInfo,o._debugNeedsRemount=n._debugNeedsRemount,o.tag){case 0:case 15:o.type=Jo(n.type);break;case 1:o.type=Jo(n.type);break;case 11:o.type=_m(n.type)}return o}function Fd(n,l){n.flags&=31457282;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=l,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null,n.selfBaseDuration=0,n.treeBaseDuration=0):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,l=o.dependencies,n.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext,_debugThenableState:l._debugThenableState},n.selfBaseDuration=o.selfBaseDuration,n.treeBaseDuration=o.treeBaseDuration),n}function Pd(n,l,o,c,f,m){var b=0,E=n;if(typeof n=="function")nr(n)&&(b=1),E=Jo(E);else if(typeof n=="string")b=Wa(),b=Vx(n,o,b)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case La:return Es(o.children,f,m,l);case Tf:b=8,f|=al,f|=zs;break;case kf:return n=o,c=f,typeof n.id!="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof n.id),l=j(12,n,l,c|Gn),l.elementType=kf,l.lanes=m,l.stateNode={effectDuration:0,passiveEffectDuration:0},l;case Bf:return l=j(13,o,l,f),l.elementType=Bf,l.lanes=m,l;case vr:return l=j(19,o,l,f),l.elementType=vr,l.lanes=m,l;case _i:return ef(o,f,m,l);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case We:case vl:b=10;break e;case br:b=9;break e;case Mi:b=11,E=_m(E);break e;case Ro:b=14;break e;case Dn:b=16,E=null;break e}E="",(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(E+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n===null?o="null":vn(n)?o="array":n!==void 0&&n.$$typeof===vo?(o="<"+(te(n.type)||"Unknown")+" />",E=" Did you accidentally export a JSX literal instead of a component?"):o=typeof n,(b=c?ue(c):null)&&(E+=`
|
|
224
|
+
|
|
225
|
+
Check the render method of \``+b+"`."),b=29,o=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(o+"."+E)),E=null}return l=j(b,o,l,f),l.elementType=n,l.type=E,l.lanes=m,l._debugOwner=c,l}function Du(n,l,o){return l=Pd(n.type,n.key,n.props,n._owner,l,o),l._debugOwner=n._owner,l}function Es(n,l,o,c){return n=j(7,n,c,l),n.lanes=o,n}function ef(n,l,o,c){n=j(22,n,c,l),n.elementType=_i,n.lanes=o;var f={_visibility:xh,_pendingVisibility:xh,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var m=f,b=m._current;if(b===null)throw Error("Calling Offscreen.detach before instance handle has been set.");if(!(m._pendingVisibility&Mr)){var E=xn(b,2);E!==null&&(m._pendingVisibility|=Mr,ft(E,b,2))}},attach:function(){var m=f,b=m._current;if(b===null)throw Error("Calling Offscreen.detach before instance handle has been set.");if(m._pendingVisibility&Mr){var E=xn(b,2);E!==null&&(m._pendingVisibility&=~Mr,ft(E,b,2))}}};return n.stateNode=f,n}function tf(n,l,o){return n=j(6,n,null,l),n.lanes=o,n}function lr(n,l,o){return l=j(4,n.children!==null?n.children:[],n.key,l),l.lanes=o,l.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},l}function Ca(n){n.flags|=4}function Ta(n,l){if(l.type!=="stylesheet"||(l.state.loading&Ka)!==Wr)n.flags&=-16777217;else if(n.flags|=16777216,!Rf(l)){if(l=Qa.current,l!==null&&((Je&4194176)===Je?No!==null:(Je&62914560)!==Je&&!(Je&536870912)||l!==No))throw jh=by,E0;n.flags|=8192}}function Mu(n,l){l!==null&&(n.flags|=4),n.flags&16384&&(l=n.tag!==22?Wh():536870912,n.lanes|=l,Xr|=l)}function ar(n,l){if(!et)switch(n.tailMode){case"hidden":l=n.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?l||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function yt(n){var l=n.alternate!==null&&n.alternate.child===n.child,o=0,c=0;if(l)if((n.mode&Gn)!==Ct){for(var f=n.selfBaseDuration,m=n.child;m!==null;)o|=m.lanes|m.childLanes,c|=m.subtreeFlags&31457280,c|=m.flags&31457280,f+=m.treeBaseDuration,m=m.sibling;n.treeBaseDuration=f}else for(f=n.child;f!==null;)o|=f.lanes|f.childLanes,c|=f.subtreeFlags&31457280,c|=f.flags&31457280,f.return=n,f=f.sibling;else if((n.mode&Gn)!==Ct){f=n.actualDuration,m=n.selfBaseDuration;for(var b=n.child;b!==null;)o|=b.lanes|b.childLanes,c|=b.subtreeFlags,c|=b.flags,f+=b.actualDuration,m+=b.treeBaseDuration,b=b.sibling;n.actualDuration=f,n.treeBaseDuration=m}else for(f=n.child;f!==null;)o|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=c,n.childLanes=o,l}function Cp(n,l,o){var c=l.pendingProps;switch(Hm(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(l),null;case 1:return yt(l),null;case 3:return c=l.stateNode,o=null,n!==null&&(o=n.memoizedState.cache),l.memoizedState.cache!==o&&(l.flags|=2048),ja(Sn,l),Dt(l),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(n===null||n.child===null)&&(uu(l)?(Ed(),Ca(l)):n===null||n.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,Hs!==null&&(js(Hs),Hs=null))),yt(l),null;case 26:return o=l.memoizedState,n===null?(Ca(l),o!==null?(yt(l),Ta(l,o)):(yt(l),l.flags&=-16777217)):o?o!==n.memoizedState?(Ca(l),yt(l),Ta(l,o)):(yt(l),l.flags&=-16777217):(n.memoizedProps!==c&&Ca(l),yt(l),l.flags&=-16777217),null;case 27:sl(l),o=Xt(rn.current);var f=l.type;if(n!==null&&l.stateNode!=null)n.memoizedProps!==c&&Ca(l);else{if(!c){if(l.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return yt(l),null}n=Wa(),uu(l)?mx(l):(n=Uu(f,c,o,n,!0),l.stateNode=n,Ca(l))}return yt(l),null;case 5:if(sl(l),o=l.type,n!==null&&l.stateNode!=null)n.memoizedProps!==c&&Ca(l);else{if(!c){if(l.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return yt(l),null}if(f=Wa(),uu(l))mx(l);else{switch(n=Xt(rn.current),rd(o,f.ancestorInfo),f=f.context,n=gf(n),f){case pm:n=n.createElementNS(jl,o);break;case Bg:n=n.createElementNS(Do,o);break;default:switch(o){case"svg":n=n.createElementNS(jl,o);break;case"math":n=n.createElementNS(Do,o);break;case"script":n=n.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof c.is=="string"?n.createElement("select",{is:c.is}):n.createElement("select"),c.multiple?n.multiple=!0:c.size&&(n.size=c.size);break;default:n=typeof c.is=="string"?n.createElement(o,{is:c.is}):n.createElement(o),o.indexOf("-")===-1&&(o!==o.toLowerCase()&&console.error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",o),Object.prototype.toString.call(n)!=="[object HTMLUnknownElement]"||Ha.call(wb,o)||(wb[o]=!0,console.error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",o)))}}n[Rn]=l,n[nl]=c;e:for(f=l.child;f!==null;){if(f.tag===5||f.tag===6)n.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break e;for(;f.sibling===null;){if(f.return===null||f.return===l)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}l.stateNode=n;e:switch(kt(n,o,c),o){case"button":case"input":case"select":case"textarea":n=!!c.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Ca(l)}}return yt(l),l.flags&=-16777217,null;case 6:if(n&&l.stateNode!=null)n.memoizedProps!==c&&Ca(l);else{if(typeof c!="string"&&l.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(n=Xt(rn.current),o=Wa(),uu(l)){n=l.stateNode,c=l.memoizedProps,f=!Vi,o=null;var m=Al;if(m!==null)switch(m.tag){case 3:f&&(f=pr(n,c,o),f!==null&&(Js(l,0).serverProps=f));break;case 27:case 5:o=m.memoizedProps,f&&(f=pr(n,c,o),f!==null&&(Js(l,0).serverProps=f))}n[Rn]=l,n=!!(n.nodeValue===c||o!==null&&o.suppressHydrationWarning===!0||pf(n.nodeValue,c)),n||Ql(l)}else o=o.ancestorInfo.current,o!=null&&Ec(c,o.tag),n=gf(n).createTextNode(c),n[Rn]=l,l.stateNode=n}return yt(l),null;case 13:if(c=l.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=uu(l),c!==null&&c.dehydrated!==null){if(n===null){if(!f)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(f=l.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");f[Rn]=l,yt(l),(l.mode&Gn)!==Ct&&c!==null&&(f=l.child,f!==null&&(l.treeBaseDuration-=f.treeBaseDuration))}else Ed(),cu(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4,yt(l),(l.mode&Gn)!==Ct&&c!==null&&(f=l.child,f!==null&&(l.treeBaseDuration-=f.treeBaseDuration));f=!1}else Hs!==null&&(js(Hs),Hs=null),f=!0;if(!f)return l.flags&256?(Zl(l),l):(Zl(l),null)}return Zl(l),l.flags&128?(l.lanes=o,(l.mode&Gn)!==Ct&&Tc(l),l):(c=c!==null,n=n!==null&&n.memoizedState!==null,c&&(o=l.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==f&&(o.flags|=2048)),c!==n&&c&&(l.child.flags|=8192),Mu(l,l.updateQueue),yt(l),(l.mode&Gn)!==Ct&&c&&(n=l.child,n!==null&&(l.treeBaseDuration-=n.treeBaseDuration)),null);case 4:return Dt(l),n===null&&ff(l.stateNode.containerInfo),yt(l),null;case 10:return ja(l.type,l),yt(l),null;case 19:if(Ve(En,l),f=l.memoizedState,f===null)return yt(l),null;if(c=(l.flags&128)!==0,m=f.rendering,m===null)if(c)ar(f,!1);else{if(Yt!==Qi||n!==null&&n.flags&128)for(n=l.child;n!==null;){if(m=_c(n),m!==null){for(l.flags|=128,ar(f,!1),n=m.updateQueue,l.updateQueue=n,Mu(l,n),l.subtreeFlags=0,n=o,c=l.child;c!==null;)Fd(c,n),c=c.sibling;return qe(En,En.current&Pf|Ah,l),l.child}n=n.sibling}f.tail!==null&&Ua()>xg&&(l.flags|=128,c=!0,ar(f,!1),l.lanes=4194304)}else{if(!c)if(n=_c(m),n!==null){if(l.flags|=128,c=!0,n=n.updateQueue,l.updateQueue=n,Mu(l,n),ar(f,!0),f.tail===null&&f.tailMode==="hidden"&&!m.alternate&&!et)return yt(l),null}else 2*Ua()-f.renderingStartTime>xg&&o!==536870912&&(l.flags|=128,c=!0,ar(f,!1),l.lanes=4194304);f.isBackwards?(m.sibling=l.child,l.child=m):(n=f.last,n!==null?n.sibling=m:l.child=m,f.last=m)}return f.tail!==null?(n=f.tail,f.rendering=n,f.tail=n.sibling,f.renderingStartTime=Ua(),n.sibling=null,o=En.current,o=c?o&Pf|Ah:o&Pf,qe(En,o,l),n):(yt(l),null);case 22:case 23:return Zl(l),Ym(l),c=l.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(l.flags|=8192):c&&(l.flags|=8192),c?o&536870912&&!(l.flags&128)&&(yt(l),l.subtreeFlags&6&&(l.flags|=8192)):yt(l),c=l.updateQueue,c!==null&&Mu(l,c.retryQueue),c=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==c&&(l.flags|=2048),n!==null&&Ve(Hr,l),null;case 24:return c=null,n!==null&&(c=n.memoizedState.cache),l.memoizedState.cache!==c&&(l.flags|=2048),ja(Sn,l),yt(l),null;case 25:return null}throw Error("Unknown unit of work tag ("+l.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function gi(n,l){switch(Hm(l),l.tag){case 1:return n=l.flags,n&65536?(l.flags=n&-65537|128,(l.mode&Gn)!==Ct&&Tc(l),l):null;case 3:return ja(Sn,l),Dt(l),n=l.flags,n&65536&&!(n&128)?(l.flags=n&-65537|128,l):null;case 26:case 27:case 5:return sl(l),null;case 13:if(Zl(l),n=l.memoizedState,n!==null&&n.dehydrated!==null){if(l.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");cu()}return n=l.flags,n&65536?(l.flags=n&-65537|128,(l.mode&Gn)!==Ct&&Tc(l),l):null;case 19:return Ve(En,l),null;case 4:return Dt(l),null;case 10:return ja(l.type,l),null;case 22:case 23:return Zl(l),Ym(l),n!==null&&Ve(Hr,l),n=l.flags,n&65536?(l.flags=n&-65537|128,(l.mode&Gn)!==Ct&&Tc(l),l):null;case 24:return ja(Sn,l),null;case 25:return null;default:return null}}function ka(n,l){switch(Hm(l),l.tag){case 3:ja(Sn,l),Dt(l);break;case 26:case 27:case 5:sl(l);break;case 4:Dt(l);break;case 13:Zl(l);break;case 19:Ve(En,l);break;case 10:ja(l.type,l);break;case 22:case 23:Zl(l),Ym(l),n!==null&&Ve(Hr,l);break;case 24:ja(Sn,l)}}function co(){Nv.forEach(function(n){return n()})}function Ba(){var n=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return n||W.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),n}function Hn(n){if((Bt&kl)!==oa&&Je!==0)return Je&-Je;var l=W.T;return l!==null?(l._updatedFibers||(l._updatedFibers=new Set),l._updatedFibers.add(n),n=Lr,n!==0?n:rf()):gc()}function nf(){ua===0&&(ua=!(Je&536870912)||et?Jh():536870912);var n=Qa.current;return n!==null&&(n.flags|=32),ua}function ft(n,l,o){if(fm&&console.error("useInsertionEffect must not schedule updates."),Qy&&(yg=!0),(n===vt&&Rt===Yr||n.cancelPendingCommit!==null)&&(ro(n,0),wa(n,Je,ua,!1)),mn(n,o),Bt&kl&&n===vt){if(Rl)switch(l.tag){case 0:case 11:case 15:n=Ke&&X(Ke)||"Unknown",Sb.has(n)||(Sb.add(n),l=X(l)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",l,n,n));break;case 1:jb||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),jb=!0)}}else qn&&Fh(n,l,o),Ts(l),n===vt&&((Bt&kl)===oa&&(rc|=o),Yt===Gr&&wa(n,Je,ua,!1)),ea(n)}function sr(n,l,o){if((Bt&(kl|Xi))!==oa)throw Error("Should not already be working.");var c=!o&&(l&60)===0&&(l&n.expiredLanes)===0||xc(n,l),f=c?cr(n,l):ur(n,l,!0),m=c;do{if(f===Qi){dm&&!c&&wa(n,l,0,!1);break}else if(f===pg)wa(n,l,0,!Zi);else{if(o=n.current.alternate,m&&!lf(o)){f=ur(n,l,!1),m=!1;continue}if(f===cm){if(m=l,n.errorRecoveryDisabledLanes&m)var b=0;else b=n.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){l=b;e:{f=n;var E=b;b=Oh;var k=f.current.memoizedState.isDehydrated;if(k&&(ro(f,E).flags|=256),E=ur(f,E,!1),E!==cm){if(Uy&&!k){f.errorRecoveryDisabledLanes|=m,rc|=m,f=Gr;break e}f=Vs,Vs=b,f!==null&&js(f)}f=E}if(m=!1,f!==cm)continue}}if(f===Dh){ro(n,0),wa(n,l,0,!0);break}e:{switch(c=n,f){case Qi:case Dh:throw Error("Root did not complete. This is a bug in React.");case Gr:if((l&4194176)===l){wa(c,l,ua,!Zi);break e}break;case cm:Vs=null;break;case zy:case yb:break;default:throw Error("Unknown root exit status.")}if(c.finishedWork=o,c.finishedLanes=l,W.actQueue!==null)Un(c,Vs,zh,hg,ua,rc,Xr,Eb,xy,0);else{if((l&62914560)===l&&(f=qy+vb-Ua(),10<f)){if(wa(c,l,ua,!Zi),Uo(c,0)!==0)break e;c.timeoutHandle=Db(bn.bind(null,c,o,Vs,zh,hg,l,ua,rc,Xr,Zi,Uv,xy,0),f);break e}bn(c,o,Vs,zh,hg,l,ua,rc,Xr,Zi,Eb,xy,0)}}}break}while(!0);ea(n)}function js(n){Vs===null?Vs=n:Vs.push.apply(Vs,n)}function bn(n,l,o,c,f,m,b,E,k,w,I,ae,$){var ce=l.subtreeFlags;if((ce&8192||(ce&16785408)===16785408)&&(Gh={stylesheets:null,count:0,unsuspend:Up},Ep(l),l=$g(),l!==null)){n.cancelPendingCommit=l(Un.bind(null,n,o,c,f,b,E,k,Hv,ae,$)),wa(n,m,b,!w);return}Un(n,o,c,f,b,E,k,I,ae,$)}function lf(n){for(var l=n;;){var o=l.tag;if((o===0||o===11||o===15)&&l.flags&16384&&(o=l.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var f=o[c],m=f.getSnapshot;f=f.value;try{if(!Sl(m(),f))return!1}catch{return!1}}if(o=l.child,l.subtreeFlags&16384&&o!==null)o.return=l,l=o;else{if(l===n)break;for(;l.sibling===null;){if(l.return===null||l.return===n)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function wa(n,l,o,c){l&=~Vy,l&=~rc,n.suspendedLanes|=l,n.pingedLanes&=~l,c&&(n.warmLanes|=l),c=n.expirationTimes;for(var f=l;0<f;){var m=31-Nn(f),b=1<<m;c[m]=-1,f&=~b}o!==0&&Fa(n,o,l)}function ml(){return(Bt&(kl|Xi))===oa?(zu(0),!1):!0}function or(){if(Ke!==null){if(Rt===Vl)var n=Ke.return;else n=Ke,Ic(),pa(n),Wf=null,Sh=0,n=Ke;for(;n!==null;)ka(n.alternate,n),n=n.return;Ke=null}}function ro(n,l){n.finishedWork=null,n.finishedLanes=0;var o=n.timeoutHandle;o!==n0&&(n.timeoutHandle=n0,Zv(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),or(),vt=n,Ke=o=Aa(n.current,null),Je=l,Rt=Vl,ia=null,Zi=!1,dm=xc(n,l),Uy=!1,Yt=Qi,Xr=ua=Vy=rc=cc=0,Vs=Oh=null,hg=!1,l&8&&(l|=l&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=l;0<c;){var f=31-Nn(c),m=1<<f;l|=n[f],c&=~m}return zo=l,yd(),Ls.discardPendingWarnings(),o}function Ss(n,l){Oe=null,W.H=Oo,W.getCurrentStack=null,Rl=!1,Mn=null,l===ig?(l=hx(),Rt=_h):l===E0?(l=hx(),Rt=bb):Rt=l===tb?Hy:l!==null&&typeof l=="object"&&typeof l.then=="function"?rm:Mh,ia=l;var o=Ke;if(o===null)Yt=Dh,ze(n,Jn(l,n.current));else switch(o.mode&Gn&&Om(o),Gs(),Rt){case Mh:Se!==null&&typeof Se.markComponentErrored=="function"&&Se.markComponentErrored(o,l,Je);break;case Yr:case _h:case rm:case Nh:Se!==null&&typeof Se.markComponentSuspended=="function"&&Se.markComponentSuspended(o,l,Je)}}function As(){var n=W.H;return W.H=Oo,n===null?Oo:n}function _u(){var n=W.A;return W.A=_v,n}function ir(){Yt=Gr,Zi||(Je&4194176)!==Je&&Qa.current!==null||(dm=!0),!(cc&134217727)&&!(rc&134217727)||vt===null||wa(vt,Je,ua,!1)}function ur(n,l,o){var c=Bt;Bt|=kl;var f=As(),m=_u();if(vt!==n||Je!==l){if(qn){var b=n.memoizedUpdaters;0<b.size&&(Et(n,Je),b.clear()),Ph(n,l)}zh=null,ro(n,l)}Zh(l),l=!1,b=Yt;e:do try{if(Rt!==Vl&&Ke!==null){var E=Ke,k=ia;switch(Rt){case Hy:or(),b=pg;break e;case _h:case Yr:case rm:Qa.current===null&&(l=!0);var w=Rt;if(Rt=Vl,ia=null,yi(n,E,k,w),o&&dm){b=Qi;break e}break;default:w=Rt,Rt=Vl,ia=null,yi(n,E,k,w)}}Nu(),b=Yt;break}catch(I){Ss(n,I)}while(!0);return l&&n.shellSuspendCounter++,Ic(),Bt=c,W.H=f,W.A=m,Ih(),Ke===null&&(vt=null,Je=0,yd()),b}function Nu(){for(;Ke!==null;)Tp(Ke)}function cr(n,l){var o=Bt;Bt|=kl;var c=As(),f=_u();if(vt!==n||Je!==l){if(qn){var m=n.memoizedUpdaters;0<m.size&&(Et(n,Je),m.clear()),Ph(n,l)}zh=null,xg=Ua()+Rb,ro(n,l)}else dm=xc(n,l);Zh(l);e:do try{if(Rt!==Vl&&Ke!==null)t:switch(l=Ke,m=ia,Rt){case Mh:Rt=Vl,ia=null,yi(n,l,m,Mh);break;case Yr:if(Vm(m)){Rt=Vl,ia=null,Ou(l);break}l=function(){Rt===Yr&&vt===n&&(Rt=Nh),ea(n)},m.then(l,l);break e;case _h:Rt=Nh;break e;case bb:Rt=Ly;break e;case Nh:Vm(m)?(Rt=Vl,ia=null,Ou(l)):(Rt=Vl,ia=null,yi(n,l,m,Nh));break;case Ly:var b=null;switch(Ke.tag){case 26:b=Ke.memoizedState;case 5:case 27:var E=Ke;if(!b||Rf(b)){Rt=Vl,ia=null;var k=E.sibling;if(k!==null)Ke=k;else{var w=E.return;w!==null?(Ke=w,rr(w)):Ke=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}Rt=Vl,ia=null,yi(n,l,m,Ly);break;case rm:Rt=Vl,ia=null,yi(n,l,m,rm);break;case Hy:or(),Yt=pg;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}W.actQueue!==null?Nu():Bx();break}catch(I){Ss(n,I)}while(!0);return Ic(),W.H=c,W.A=f,Bt=o,Ke!==null?(Se!==null&&typeof Se.markRenderYielded=="function"&&Se.markRenderYielded(),Qi):(Ih(),vt=null,Je=0,yd(),Yt)}function Bx(){for(;Ke!==null&&!Nf();)Tp(Ke)}function Tp(n){var l=n.alternate;(n.mode&Gn)!==Ct?(Fo(n),l=oe(n,Vd,l,n,zo),Om(n)):l=oe(n,Vd,l,n,zo),n.memoizedProps=n.pendingProps,l===null?rr(n):Ke=l}function Ou(n){var l=oe(n,fo,n);n.memoizedProps=n.pendingProps,l===null?rr(n):Ke=l}function fo(n){var l=n.alternate,o=(n.mode&Gn)!==Ct;switch(o&&Fo(n),n.tag){case 15:case 0:l=np(l,n,n.pendingProps,n.type,void 0,Je);break;case 11:l=np(l,n,n.pendingProps,n.type.render,n.ref,Je);break;case 5:pa(n);default:ka(l,n),n=Ke=Fd(n,zo),l=Vd(l,n,zo)}return o&&Om(n),l}function yi(n,l,o,c){Ic(),pa(l),Wf=null,Sh=0;var f=l.return;try{if(ri(n,f,l,o,Je)){Yt=Dh,ze(n,Jn(o,n.current)),Ke=null;return}}catch(m){if(f!==null)throw Ke=f,m;Yt=Dh,ze(n,Jn(o,n.current)),Ke=null;return}l.flags&32768?(et||c===Mh?n=!0:dm||Je&536870912?n=!1:(Zi=n=!0,(c===Yr||c===_h||c===rm)&&(c=Qa.current,c!==null&&c.tag===13&&(c.flags|=16384))),mo(l,n)):rr(l)}function rr(n){var l=n;do{if(l.flags&32768){mo(l,Zi);return}var o=l.alternate;if(n=l.return,Fo(l),o=oe(l,Cp,o,l,zo),(l.mode&Gn)!==Ct&&zm(l),o!==null){Ke=o;return}if(l=l.sibling,l!==null){Ke=l;return}Ke=l=n}while(l!==null);Yt===Qi&&(Yt=yb)}function mo(n,l){do{var o=gi(n.alternate,n);if(o!==null){o.flags&=32767,Ke=o;return}if((n.mode&Gn)!==Ct){zm(n),o=n.actualDuration;for(var c=n.child;c!==null;)o+=c.actualDuration,c=c.sibling;n.actualDuration=o}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!l&&(n=n.sibling,n!==null)){Ke=n;return}Ke=n=o}while(n!==null);Yt=pg,Ke=null}function Un(n,l,o,c,f,m,b,E,k,w){var I=W.T,ae=ht.p;try{ht.p=El,W.T=null,wx(n,l,o,c,ae,f,m,b,E,k,w)}finally{W.T=I,ht.p=ae}}function wx(n,l,o,c,f,m,b,E){do Cs();while(Qr!==null);if(Ls.flushLegacyContextWarning(),Ls.flushPendingUnsafeLifecycleWarnings(),(Bt&(kl|Xi))!==oa)throw Error("Should not already be working.");var k=n.finishedWork;if(c=n.finishedLanes,Se!==null&&typeof Se.markCommitStarted=="function"&&Se.markCommitStarted(c),k===null)return td(),null;if(c===0&&console.error("root.finishedLanes should not be empty during a commit. This is a bug in React."),n.finishedWork=null,n.finishedLanes=0,k===n.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");n.callbackNode=null,n.callbackPriority=0,n.cancelPendingCommit=null;var w=k.lanes|k.childLanes;if(w|=hy,Lg(n,c,w,m,b,E),n===vt&&(Ke=vt=null,Je=0),!(k.subtreeFlags&10256)&&!(k.flags&10256)||gg||(gg=!0,Gy=w,Yy=o,pl($u,function(){return Cs(),null})),tg=$f(),o=(k.flags&15990)!==0,k.subtreeFlags&15990||o?(o=W.T,W.T=null,m=ht.p,ht.p=El,b=Bt,Bt|=Xi,Kd(n,k),gp(n,k,c),Qg(e0,n.containerInfo),_g=!!Py,e0=Py=null,n.current=k,Se!==null&&typeof Se.markLayoutEffectsStarted=="function"&&Se.markLayoutEffectsStarted(c),Tx(k,n,c),Se!==null&&typeof Se.markLayoutEffectsStopped=="function"&&Se.markLayoutEffectsStopped(),Ms(),Bt=b,ht.p=m,W.T=o):n.current=k,(o=gg)?(gg=!1,Qr=n,Lh=c):(kp(n,w),Zr=0,Uh=null),w=n.pendingLanes,w===0&&(dc=null),o||Bp(n),Ji(k.stateNode,f),qn&&n.memoizedUpdaters.clear(),co(),ea(n),l!==null)for(f=n.onRecoverableError,k=0;k<l.length;k++)w=l[k],o=Dx(w.stack),oe(w.source,f,w.value,o);return Lh&3&&Cs(),w=n.pendingLanes,c&4194218&&w&42?(lg=!0,n===Xy?Hh++:(Hh=0,Xy=n)):Hh=0,zu(0),td(),null}function Dx(n){return n={componentStack:n},Object.defineProperty(n,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),n}function kp(n,l){(n.pooledCacheLanes&=l)===0&&(l=n.pooledCache,l!=null&&(n.pooledCache=null,ti(l)))}function Cs(){if(Qr!==null){var n=Qr,l=Gy;Gy=0;var o=ex(Lh),c=aa>o?aa:o;o=W.T;var f=ht.p;try{if(ht.p=c,W.T=null,Qr===null)var m=!1;else{c=Yy,Yy=null;var b=Qr,E=Lh;if(Qr=null,Lh=0,(Bt&(kl|Xi))!==oa)throw Error("Cannot flush passive effects while already rendering.");Qy=!0,yg=!1,Se!==null&&typeof Se.markPassiveEffectsStarted=="function"&&Se.markPassiveEffectsStarted(E);var k=Bt;if(Bt|=Xi,Bu(b.current),Rp(b,b.current,E,c),Se!==null&&typeof Se.markPassiveEffectsStopped=="function"&&Se.markPassiveEffectsStopped(),Bp(b),Bt=k,zu(0,!1),yg?b===Uh?Zr++:(Zr=0,Uh=b):Zr=0,yg=Qy=!1,_n&&typeof _n.onPostCommitFiberRoot=="function")try{_n.onPostCommitFiberRoot(Ku,b)}catch(I){Vn||(Vn=!0,console.error("React instrumentation encountered an error: %s",I))}var w=b.current.stateNode;w.effectDuration=0,w.passiveEffectDuration=0,m=!0}return m}finally{ht.p=f,W.T=o,kp(n,l)}}return!1}function af(n,l,o){l=Jn(o,l),l=_t(n.stateNode,l,2),n=ys(n,l,2),n!==null&&(mn(n,2),ea(n))}function lt(n,l,o){if(fm=!1,n.tag===3)af(n,n,o);else{for(;l!==null;){if(l.tag===3){af(l,n,o);return}if(l.tag===1){var c=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(dc===null||!dc.has(c))){n=Jn(o,n),o=bu(2),c=ys(l,o,2),c!==null&&(ao(o,c,l,n),mn(c,2),ea(c));return}}l=l.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
|
|
226
|
+
|
|
227
|
+
Error message:
|
|
228
|
+
|
|
229
|
+
%s`,o)}}function Pl(n,l,o){var c=n.pingCache;if(c===null){c=n.pingCache=new Ov;var f=new Set;c.set(l,f)}else f=c.get(l),f===void 0&&(f=new Set,c.set(l,f));f.has(o)||(Uy=!0,f.add(o),c=Ot.bind(null,n,l,o),qn&&Et(n,o),l.then(c,c))}function Ot(n,l,o){var c=n.pingCache;c!==null&&c.delete(l),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,Ba()&&W.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
|
|
230
|
+
|
|
231
|
+
When testing, code that resolves suspended data should be wrapped into act(...):
|
|
232
|
+
|
|
233
|
+
act(() => {
|
|
234
|
+
/* finish loading suspended data */
|
|
235
|
+
});
|
|
236
|
+
/* assert on the output */
|
|
237
|
+
|
|
238
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),vt===n&&(Je&o)===o&&(Yt===Gr||Yt===zy&&(Je&62914560)===Je&&Ua()-qy<vb?(Bt&kl)===oa&&ro(n,0):Vy|=o,Xr===Je&&(Xr=0)),ea(n)}function sf(n,l){l===0&&(l=Wh()),n=xn(n,l),n!==null&&(mn(n,l),ea(n))}function Mx(n){var l=n.memoizedState,o=0;l!==null&&(o=l.retryLane),sf(n,o)}function un(n,l){var o=0;switch(n.tag){case 13:var c=n.stateNode,f=n.memoizedState;f!==null&&(o=f.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}c!==null&&c.delete(l),sf(n,o)}function of(n,l,o){if(l.subtreeFlags&33562624)for(l=l.child;l!==null;){var c=n,f=l,m=f.type===Tf;m=o||m,f.tag!==22?f.flags&33554432?m&&oe(f,_x,c,f,(f.mode&v0)===Ct):of(c,f,m):f.memoizedState===null&&(m&&f.flags&8192?oe(f,_x,c,f):f.subtreeFlags&33554432&&oe(f,of,c,f,m)),l=l.sibling}}function _x(n,l){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;mt(!0);try{bp(l),o&&Sp(l),vp(n,l.alternate,l,!1),o&&on(n,l,0,null,!1)}finally{mt(!1)}}function Bp(n){var l=!0;n.current.mode&(al|zs)||(l=!1),of(n,n.current,l)}function wp(n){if((Bt&kl)===oa){var l=n.tag;if(l===3||l===1||l===0||l===11||l===14||l===15){if(l=X(n)||"ReactComponent",bg!==null){if(bg.has(l))return;bg.add(l)}else bg=new Set([l]);oe(n,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")})}}}function Et(n,l){qn&&n.memoizedUpdaters.forEach(function(o){Fh(n,o,l)})}function pl(n,l){var o=W.actQueue;return o!==null?(o.push(l),Vv):tl(n,l)}function Ts(n){Ba()&&W.actQueue===null&&oe(n,function(){console.error(`An update to %s inside a test was not wrapped in act(...).
|
|
239
|
+
|
|
240
|
+
When testing, code that causes React state updates should be wrapped into act(...):
|
|
241
|
+
|
|
242
|
+
act(() => {
|
|
243
|
+
/* fire events that update state */
|
|
244
|
+
});
|
|
245
|
+
/* assert on the output */
|
|
246
|
+
|
|
247
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,X(n))})}function ea(n){n!==mm&&n.next===null&&(mm===null?vg=mm=n:mm=mm.next=n),Rg=!0,W.actQueue!==null?Iy||(Iy=!0,xl(Nx)):Zy||(Zy=!0,xl(Nx))}function zu(n,l){if(!$y&&Rg){$y=!0;do for(var o=!1,c=vg;c!==null;){if(n!==0){var f=c.pendingLanes;if(f===0)var m=0;else{var b=c.suspendedLanes,E=c.pingedLanes;m=(1<<31-Nn(42|n)+1)-1,m&=f&~(b&~E),m=m&201326677?m&201326677|1:m?m|2:0}m!==0&&(o=!0,Ol(c,m))}else m=Je,m=Uo(c,c===vt?m:0),!(m&3)||xc(c,m)||(o=!0,Ol(c,m));c=c.next}while(o);$y=!1}}function Nx(){Rg=Iy=Zy=!1;var n=0;Ir!==0&&($e()&&(n=Ir),Ir=0);for(var l=Ua(),o=null,c=vg;c!==null;){var f=c.next,m=uf(c,l);m===0?(c.next=null,o===null?vg=f:o.next=f,f===null&&(mm=o)):(o=c,(n!==0||m&3)&&(Rg=!0)),c=f}zu(n)}function uf(n,l){for(var o=n.suspendedLanes,c=n.pingedLanes,f=n.expirationTimes,m=n.pendingLanes&-62914561;0<m;){var b=31-Nn(m),E=1<<b,k=f[b];k===-1?(!(E&o)||E&c)&&(f[b]=Kh(E,l)):k<=l&&(n.expiredLanes|=E),m&=~E}if(l=vt,o=Je,o=Uo(n,n===l?o:0),c=n.callbackNode,o===0||n===l&&Rt===Yr||n.cancelPendingCommit!==null)return c!==null&&cf(c),n.callbackNode=null,n.callbackPriority=0;if(!(o&3)||xc(n,o)){if(l=o&-o,l!==n.callbackPriority||W.actQueue!==null&&c!==Ky)cf(c);else return l;switch(ex(o)){case El:case Ll:o=Of;break;case aa:o=$u;break;case Ni:o=th;break;default:o=$u}return c=hl.bind(null,n),W.actQueue!==null?(W.actQueue.push(c),o=Ky):o=tl(o,c),n.callbackPriority=l,n.callbackNode=o,l}return c!==null&&cf(c),n.callbackPriority=2,n.callbackNode=null,2}function hl(n,l){lg=ng=!1;var o=n.callbackNode;if(Cs()&&n.callbackNode!==o)return null;var c=Je;return c=Uo(n,n===vt?c:0),c===0?null:(sr(n,c,l),uf(n,Ua()),n.callbackNode!=null&&n.callbackNode===o?hl.bind(null,n):null)}function Ol(n,l){if(Cs())return null;ng=lg,lg=!1,sr(n,l,!0)}function cf(n){n!==Ky&&n!==null&&Ix(n)}function xl(n){W.actQueue!==null&&W.actQueue.push(function(){return n(),null}),Iv(function(){(Bt&(kl|Xi))!==oa?tl(So,n):n()})}function rf(){return Ir===0&&(Ir=Jh()),Ir}function Da(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:(at(n,"action"),ma(""+n))}function bi(n,l){var o=l.ownerDocument.createElement("input");return o.name=l.name,o.value=l.value,n.id&&o.setAttribute("form",n.id),l.parentNode.insertBefore(o,l),n=new FormData(n),o.parentNode.removeChild(o),n}function po(n,l,o,c,f){if(l==="submit"&&o&&o.stateNode===f){var m=Da((f[nl]||null).action),b=c.submitter;b&&(l=(l=b[nl]||null)?Da(l.formAction):b.getAttribute("formAction"),l!==null&&(m=l,b=null));var E=new H("action","action",null,c,f);n.push({event:E,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ir!==0){var k=b?bi(f,b):new FormData(f),w={pending:!0,data:k,method:f.method,action:m};Object.freeze(w),Ra(o,w,null,k)}}else typeof m=="function"&&(E.preventDefault(),k=b?bi(f,b):new FormData(f),w={pending:!0,data:k,method:f.method,action:m},Object.freeze(w),Ra(o,w,m,k))},currentTarget:f}]})}}function df(n,l){l=(l&4)!==0;for(var o=0;o<n.length;o++){var c=n[o];e:{var f=void 0,m=c.event;if(c=c.listeners,l)for(var b=c.length-1;0<=b;b--){var E=c[b],k=E.instance,w=E.currentTarget;if(E=E.listener,k!==f&&m.isPropagationStopped())break e;f=m,f.currentTarget=w;try{E(f)}catch(I){fg(I)}f.currentTarget=null,f=k}else for(b=0;b<c.length;b++){if(E=c[b],k=E.instance,w=E.currentTarget,E=E.listener,k!==f&&m.isPropagationStopped())break e;f=m,f.currentTarget=w;try{E(f)}catch(I){fg(I)}f.currentTarget=null,f=k}}}}function Ie(n,l){Jy.has(n)||console.error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',n);var o=l[Oi];o===void 0&&(o=l[Oi]=new Set);var c=n+"__bubble";o.has(c)||(vi(l,n,2,!1),o.add(c))}function Ma(n,l,o){Jy.has(n)&&!l&&console.error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',n);var c=0;l&&(c|=4),vi(o,n,c,l)}function ff(n){if(!n[Eg]){n[Eg]=!0,kr.forEach(function(o){o!=="selectionchange"&&(Jy.has(o)||Ma(o,!1,n),Ma(o,!0,n))});var l=n.nodeType===9?n:n.ownerDocument;l===null||l[Eg]||(l[Eg]=!0,Ma("selectionchange",!1,l))}}function vi(n,l,o,c){switch(Di(l)){case El:var f=Yx;break;case Ll:f=Jg;break;default:f=Xp}o=f.bind(null,l,o,n),f=void 0,!K||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(f=!0),c?f!==void 0?n.addEventListener(l,o,{capture:!0,passive:f}):n.addEventListener(l,o,!0):f!==void 0?n.addEventListener(l,o,{passive:f}):n.addEventListener(l,o,!1)}function Ri(n,l,o,c,f){var m=c;if(!(l&1)&&!(l&2)&&c!==null)e:for(;;){if(c===null)return;var b=c.tag;if(b===3||b===4){var E=c.stateNode.containerInfo;if(E===f||E.nodeType===8&&E.parentNode===f)break;if(b===4)for(b=c.return;b!==null;){var k=b.tag;if((k===3||k===4)&&(k=b.stateNode.containerInfo,k===f||k.nodeType===8&&k.parentNode===f))return;b=b.return}for(;E!==null;){if(b=ra(E),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){c=m=b;continue e}E=E.parentNode}}c=c.return}fd(function(){var w=m,I=Zs(o),ae=[];e:{var $=y0.get(n);if($!==void 0){var ce=H,Be=n;switch(n){case"keypress":if(au(o)===0)break e;case"keydown":case"keyup":ce=iv;break;case"focusin":Be="focus",ce=ry;break;case"focusout":Be="blur",ce=ry;break;case"beforeblur":case"afterblur":ce=ry;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=en;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=Mo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=rv;break;case p0:case h0:case x0:ce=Fb;break;case g0:ce=fv;break;case"scroll":case"scrollend":ce=de;break;case"wheel":ce=pv;break;case"copy":case"cut":case"paste":ce=ev;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=o0;break;case"toggle":case"beforetoggle":ce=xv}var Ye=(l&4)!==0,tn=!Ye&&(n==="scroll"||n==="scrollend"),ut=Ye?$!==null?$+"Capture":null:$;Ye=[];for(var N=w,_;N!==null;){var L=N;if(_=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||_===null||ut===null||(L=nu(N,ut),L!=null&&Ye.push(ks(N,L,_))),tn)break;N=N.return}0<Ye.length&&($=new ce($,Be,null,o,I),ae.push({event:$,listeners:Ye}))}}if(!(l&7)){e:{if($=n==="mouseover"||n==="pointerover",ce=n==="mouseout"||n==="pointerout",$&&o!==D&&(Be=o.relatedTarget||o.fromElement)&&(ra(Be)||Be[Co]))break e;if((ce||$)&&($=I.window===I?I:($=I.ownerDocument)?$.defaultView||$.parentWindow:window,ce?(Be=o.relatedTarget||o.toElement,ce=w,Be=Be?ra(Be):null,Be!==null&&(tn=me(Be),Ye=Be.tag,Be!==tn||Ye!==5&&Ye!==27&&Ye!==6)&&(Be=null)):(ce=null,Be=w),ce!==Be)){if(Ye=en,L="onMouseLeave",ut="onMouseEnter",N="mouse",(n==="pointerout"||n==="pointerover")&&(Ye=o0,L="onPointerLeave",ut="onPointerEnter",N="pointer"),tn=ce==null?$:yc(ce),_=Be==null?$:yc(Be),$=new Ye(L,N+"leave",ce,o,I),$.target=tn,$.relatedTarget=_,L=null,ra(I)===w&&(Ye=new Ye(ut,N+"enter",Be,o,I),Ye.target=_,Ye.relatedTarget=tn,L=Ye),tn=L,ce&&Be)t:{for(Ye=ce,ut=Be,N=0,_=Ye;_;_=Ei(_))N++;for(_=0,L=ut;L;L=Ei(L))_++;for(;0<N-_;)Ye=Ei(Ye),N--;for(;0<_-N;)ut=Ei(ut),_--;for(;N--;){if(Ye===ut||ut!==null&&Ye===ut.alternate)break t;Ye=Ei(Ye),ut=Ei(ut)}Ye=null}else Ye=null;ce!==null&&Dp(ae,$,ce,Ye,!1),Be!==null&&tn!==null&&Dp(ae,tn,Be,Ye,!0)}}e:{if($=w?yc(w):window,ce=$.nodeName&&$.nodeName.toLowerCase(),ce==="select"||ce==="input"&&$.type==="file")var ne=xd;else if($s($))if(f0)ne=Xg;else{ne=Gg;var Ee=lx}else ce=$.nodeName,!ce||ce.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?w&&Io(w.elementType)&&(ne=xd):ne=Yg;if(ne&&(ne=ne(n,w))){su(ae,ne,o,I);break e}Ee&&Ee(n,$,w),n==="focusout"&&w&&$.type==="number"&&w.memoizedProps.value!=null&&ls($,"number",$.value)}switch(Ee=w?yc(w):window,n){case"focusin":($s(Ee)||Ee.contentEditable==="true")&&(Xf=Ee,fy=w,hh=null);break;case"focusout":hh=fy=Xf=null;break;case"mousedown":my=!0;break;case"contextmenu":case"mouseup":case"dragend":my=!1,ux(ae,o,I);break;case"selectionchange":if(vv)break;case"keydown":case"keyup":ux(ae,o,I)}var Le;if(dy)e:{switch(n){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Yf?jc(n,o)&&(ke="onCompositionEnd"):n==="keydown"&&o.keyCode===i0&&(ke="onCompositionStart");ke&&(u0&&o.locale!=="ko"&&(Yf||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Yf&&(Le=lu()):(Ce=I,_e="value"in Ce?Ce.value:Ce.textContent,Yf=!0)),Ee=Bs(w,ke),0<Ee.length&&(ke=new s0(ke,n,null,o,I),ae.push({event:ke,listeners:Ee}),Le?ke.data=Le:(Le=Sc(o),Le!==null&&(ke.data=Le)))),(Le=yv?nx(n,o):Kn(n,o))&&(ke=Bs(w,"onBeforeInput"),0<ke.length&&(Ee=new nv("onBeforeInput","beforeinput",null,o,I),ae.push({event:Ee,listeners:ke}),Ee.data=Le)),po(ae,n,w,o,I)}df(ae,l)})}function ks(n,l,o){return{instance:n,listener:l,currentTarget:o}}function Bs(n,l){for(var o=l+"Capture",c=[];n!==null;){var f=n,m=f.stateNode;f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=nu(n,o),f!=null&&c.unshift(ks(n,f,m)),f=nu(n,l),f!=null&&c.push(ks(n,f,m))),n=n.return}return c}function Ei(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Dp(n,l,o,c,f){for(var m=l._reactName,b=[];o!==null&&o!==c;){var E=o,k=E.alternate,w=E.stateNode;if(E=E.tag,k!==null&&k===c)break;E!==5&&E!==26&&E!==27||w===null||(k=w,f?(w=nu(o,m),w!=null&&b.unshift(ks(o,w,k))):f||(w=nu(o,m),w!=null&&b.push(ks(o,w,k)))),o=o.return}b.length!==0&&n.push({event:l,listeners:b})}function ji(n,l){dd(n,l),n!=="input"&&n!=="textarea"&&n!=="select"||l==null||l.value!==null||i||(i=!0,n==="select"&&l.multiple?console.error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",n):console.error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",n));var o={registrationNameDependencies:Ns,possibleRegistrationNames:nh};Io(n)||typeof l.is=="string"||Bm(n,l,o),l.contentEditable&&!l.suppressContentEditableWarning&&l.children!=null&&console.error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.")}function Wt(n,l,o,c){l!==o&&(o=Ft(o),Ft(l)!==o&&(c[n]=l))}function mf(n,l,o){l.forEach(function(c){o[hf(c)]=c==="style"?dr(n):n.getAttribute(c)})}function ta(n,l){l===!1?console.error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",n,n,n):console.error("Expected `%s` listener to be a function, instead got a value of `%s` type.",n,typeof l)}function Ox(n,l){return n=n.namespaceURI===Do||n.namespaceURI===jl?n.ownerDocument.createElementNS(n.namespaceURI,n.tagName):n.ownerDocument.createElement(n.tagName),n.innerHTML=l,n.innerHTML}function Ft(n){return dt(n)&&(console.error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",zt(n)),Qn(n)),(typeof n=="string"?n:""+n).replace(qv,`
|
|
248
|
+
`).replace(Gv,"")}function pf(n,l){return l=Ft(l),Ft(n)===l}function na(){}function ot(n,l,o,c,f,m){switch(o){case"children":typeof c=="string"?(Ec(c,l),l==="body"||l==="textarea"&&c===""||fa(n,c)):(typeof c=="number"||typeof c=="bigint")&&(Ec(""+c,l),l!=="body"&&fa(n,""+c));break;case"className":vc(n,"class",c);break;case"tabIndex":vc(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":vc(n,o,c);break;case"style":Tm(n,c,m);break;case"data":if(l!=="object"){vc(n,"data",c);break}case"src":case"href":if(c===""&&(l!=="a"||o!=="href")){console.error(o==="src"?'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.':'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',o,o),n.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}at(c,o),c=ma(""+c),n.setAttribute(o,c);break;case"action":case"formAction":if(c!=null&&(l==="form"?o==="formAction"?console.error("You can only pass the formAction prop to <input> or <button>. Use the action prop on <form>."):typeof c=="function"&&(f.encType==null&&f.method==null||Ag||(Ag=!0,console.error("Cannot specify a encType or method for a form that specifies a function as the action. React provides those automatically. They will get overridden.")),f.target==null||Sg||(Sg=!0,console.error("Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window."))):l==="input"||l==="button"?o==="action"?console.error("You can only pass the action prop to <form>. Use the formAction prop on <input> or <button>."):l!=="input"||f.type==="submit"||f.type==="image"||jg?l!=="button"||f.type==null||f.type==="submit"||jg?typeof c=="function"&&(f.name==null||Tb||(Tb=!0,console.error('Cannot specify a "name" prop for a button that specifies a function as a formAction. React needs it to encode which action should be invoked. It will get overridden.')),f.formEncType==null&&f.formMethod==null||Ag||(Ag=!0,console.error("Cannot specify a formEncType or formMethod for a button that specifies a function as a formAction. React provides those automatically. They will get overridden.")),f.formTarget==null||Sg||(Sg=!0,console.error("Cannot specify a formTarget for a button that specifies a function as a formAction. The function will always be executed in the same window."))):(jg=!0,console.error('A button can only specify a formAction along with type="submit" or no type.')):(jg=!0,console.error('An input can only specify a formAction along with type="submit" or type="image".')):console.error(o==="action"?"You can only pass the action prop to <form>.":"You can only pass the formAction prop to <input> or <button>.")),typeof c=="function"){n.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(o==="formAction"?(l!=="input"&&ot(n,l,"name",f.name,f,null),ot(n,l,"formEncType",f.formEncType,f,null),ot(n,l,"formMethod",f.formMethod,f,null),ot(n,l,"formTarget",f.formTarget,f,null)):(ot(n,l,"encType",f.encType,f,null),ot(n,l,"method",f.method,f,null),ot(n,l,"target",f.target,f,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}at(c,o),c=ma(""+c),n.setAttribute(o,c);break;case"onClick":c!=null&&(typeof c!="function"&&ta(o,c),n.onclick=na);break;case"onScroll":c!=null&&(typeof c!="function"&&ta(o,c),Ie("scroll",n));break;case"onScrollEnd":c!=null&&(typeof c!="function"&&ta(o,c),Ie("scrollend",n));break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(o=c.__html,o!=null){if(f.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");n.innerHTML=o}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}at(c,o),o=ma(""+c),n.setAttributeNS($r,"xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?(at(c,o),n.setAttribute(o,""+c)):n.removeAttribute(o);break;case"inert":c!==""||Cg[o]||(Cg[o]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",o));case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":c===!0?n.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?(at(c,o),n.setAttribute(o,c)):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?(at(c,o),n.setAttribute(o,c)):n.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(o):(at(c,o),n.setAttribute(o,c));break;case"popover":Ie("beforetoggle",n),Ie("toggle",n),bc(n,"popover",c);break;case"xlinkActuate":ts(n,$r,"xlink:actuate",c);break;case"xlinkArcrole":ts(n,$r,"xlink:arcrole",c);break;case"xlinkRole":ts(n,$r,"xlink:role",c);break;case"xlinkShow":ts(n,$r,"xlink:show",c);break;case"xlinkTitle":ts(n,$r,"xlink:title",c);break;case"xlinkType":ts(n,$r,"xlink:type",c);break;case"xmlBase":ts(n,Wy,"xml:base",c);break;case"xmlLang":ts(n,Wy,"xml:lang",c);break;case"xmlSpace":ts(n,Wy,"xml:space",c);break;case"is":m!=null&&console.error('Cannot update the "is" prop after it has been initialized.'),bc(n,"is",c);break;case"innerText":case"textContent":break;case"popoverTarget":kb||c==null||typeof c!="object"||(kb=!0,console.error("The `popoverTarget` prop expects the ID of an Element as a string. Received %s instead.",c));default:!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N"?(o=tx(o),bc(n,o,c)):Ns.hasOwnProperty(o)&&c!=null&&typeof c!="function"&&ta(o,c)}}function Lu(n,l,o,c,f,m){switch(o){case"style":Tm(n,c,m);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(o=c.__html,o!=null){if(f.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");n.innerHTML=o}}break;case"children":typeof c=="string"?fa(n,c):(typeof c=="number"||typeof c=="bigint")&&fa(n,""+c);break;case"onScroll":c!=null&&(typeof c!="function"&&ta(o,c),Ie("scroll",n));break;case"onScrollEnd":c!=null&&(typeof c!="function"&&ta(o,c),Ie("scrollend",n));break;case"onClick":c!=null&&(typeof c!="function"&&ta(o,c),n.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(Ns.hasOwnProperty(o))c!=null&&typeof c!="function"&&ta(o,c);else e:{if(o[0]==="o"&&o[1]==="n"&&(f=o.endsWith("Capture"),l=o.slice(2,f?o.length-7:void 0),m=n[nl]||null,m=m!=null?m[o]:null,typeof m=="function"&&n.removeEventListener(l,m,f),typeof c=="function")){typeof m!="function"&&m!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(l,c,f);break e}o in n?n[o]=c:c===!0?n.setAttribute(o,""):bc(n,o,c)}}}function kt(n,l,o){switch(ji(l,o),l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",n),Ie("load",n);var c=!1,f=!1,m;for(m in o)if(o.hasOwnProperty(m)){var b=o[m];if(b!=null)switch(m){case"src":c=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:ot(n,l,m,b,o,null)}}f&&ot(n,l,"srcSet",o.srcSet,o,null),c&&ot(n,l,"src",o.src,o,null);return;case"input":Wi("input",o),Ie("invalid",n);var E=m=b=f=null,k=null,w=null;for(c in o)if(o.hasOwnProperty(c)){var I=o[c];if(I!=null)switch(c){case"name":f=I;break;case"type":b=I;break;case"checked":k=I;break;case"defaultChecked":w=I;break;case"value":m=I;break;case"defaultValue":E=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(l+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:ot(n,l,c,I,o,null)}}ym(n,o),od(n,m,E,k,w,b,f,!1),ns(n);return;case"select":Wi("select",o),Ie("invalid",n),c=b=m=null;for(f in o)if(o.hasOwnProperty(f)&&(E=o[f],E!=null))switch(f){case"value":m=E;break;case"defaultValue":b=E;break;case"multiple":c=E;default:ot(n,l,f,E,o,null)}It(n,o),l=m,o=b,n.multiple=!!c,l!=null?Gl(n,!!c,l,!1):o!=null&&Gl(n,!!c,o,!0);return;case"textarea":Wi("textarea",o),Ie("invalid",n),m=f=c=null;for(b in o)if(o.hasOwnProperty(b)&&(E=o[b],E!=null))switch(b){case"value":c=E;break;case"defaultValue":f=E;break;case"children":m=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:ot(n,l,b,E,o,null)}bm(n,o),Xs(n,c,f,m),ns(n);return;case"option":Yo(n,o);for(k in o)if(o.hasOwnProperty(k)&&(c=o[k],c!=null))switch(k){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:ot(n,l,k,c,o,null)}return;case"dialog":Ie("cancel",n),Ie("close",n);break;case"iframe":case"object":Ie("load",n);break;case"video":case"audio":for(c=0;c<Vh.length;c++)Ie(Vh[c],n);break;case"image":Ie("error",n),Ie("load",n);break;case"details":Ie("toggle",n);break;case"embed":case"source":case"link":Ie("error",n),Ie("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(w in o)if(o.hasOwnProperty(w)&&(c=o[w],c!=null))switch(w){case"children":case"dangerouslySetInnerHTML":throw Error(l+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:ot(n,l,w,c,o,null)}return;default:if(Io(l)){for(I in o)o.hasOwnProperty(I)&&(c=o[I],c!==void 0&&Lu(n,l,I,c,o,void 0));return}}for(E in o)o.hasOwnProperty(E)&&(c=o[E],c!=null&&ot(n,l,E,c,o,null))}function zx(n,l,o,c){switch(ji(l,c),l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,E=null,k=null,w=null,I=null;for(ce in o){var ae=o[ce];if(o.hasOwnProperty(ce)&&ae!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":k=ae;default:c.hasOwnProperty(ce)||ot(n,l,ce,null,c,ae)}}for(var $ in c){var ce=c[$];if(ae=o[$],c.hasOwnProperty($)&&(ce!=null||ae!=null))switch($){case"type":m=ce;break;case"name":f=ce;break;case"checked":w=ce;break;case"defaultChecked":I=ce;break;case"value":b=ce;break;case"defaultValue":E=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(l+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:ce!==ae&&ot(n,l,$,ce,c,ae)}}l=o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null,c=c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null,l||!c||Cb||(console.error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),Cb=!0),!l||c||Ab||(console.error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),Ab=!0),Go(n,b,E,k,w,I,m,f);return;case"select":ce=b=E=$=null;for(m in o)if(k=o[m],o.hasOwnProperty(m)&&k!=null)switch(m){case"value":break;case"multiple":ce=k;default:c.hasOwnProperty(m)||ot(n,l,m,null,c,k)}for(f in c)if(m=c[f],k=o[f],c.hasOwnProperty(f)&&(m!=null||k!=null))switch(f){case"value":$=m;break;case"defaultValue":E=m;break;case"multiple":b=m;default:m!==k&&ot(n,l,f,m,c,k)}c=E,l=b,o=ce,$!=null?Gl(n,!!l,$,!1):!!o!=!!l&&(c!=null?Gl(n,!!l,c,!0):Gl(n,!!l,l?[]:"",!1));return;case"textarea":ce=$=null;for(E in o)if(f=o[E],o.hasOwnProperty(E)&&f!=null&&!c.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:ot(n,l,E,null,c,f)}for(b in c)if(f=c[b],m=o[b],c.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":$=f;break;case"defaultValue":ce=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:f!==m&&ot(n,l,b,f,c,m)}vm(n,$,ce);return;case"option":for(var Be in o)if($=o[Be],o.hasOwnProperty(Be)&&$!=null&&!c.hasOwnProperty(Be))switch(Be){case"selected":n.selected=!1;break;default:ot(n,l,Be,null,c,$)}for(k in c)if($=c[k],ce=o[k],c.hasOwnProperty(k)&&$!==ce&&($!=null||ce!=null))switch(k){case"selected":n.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:ot(n,l,k,$,c,ce)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ye in o)$=o[Ye],o.hasOwnProperty(Ye)&&$!=null&&!c.hasOwnProperty(Ye)&&ot(n,l,Ye,null,c,$);for(w in c)if($=c[w],ce=o[w],c.hasOwnProperty(w)&&$!==ce&&($!=null||ce!=null))switch(w){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(l+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:ot(n,l,w,$,c,ce)}return;default:if(Io(l)){for(var tn in o)$=o[tn],o.hasOwnProperty(tn)&&$!==void 0&&!c.hasOwnProperty(tn)&&Lu(n,l,tn,void 0,c,$);for(I in c)$=c[I],ce=o[I],!c.hasOwnProperty(I)||$===ce||$===void 0&&ce===void 0||Lu(n,l,I,$,c,ce);return}}for(var ut in o)$=o[ut],o.hasOwnProperty(ut)&&$!=null&&!c.hasOwnProperty(ut)&&ot(n,l,ut,null,c,$);for(ae in c)$=c[ae],ce=o[ae],!c.hasOwnProperty(ae)||$===ce||$==null&&ce==null||ot(n,l,ae,$,c,ce)}function hf(n){switch(n){case"class":return"className";case"for":return"htmlFor";default:return n}}function dr(n){var l={};n=n.style;for(var o=0;o<n.length;o++){var c=n[o];l[c]=n.getPropertyValue(c)}return l}function _a(n,l,o){if(l!=null&&typeof l!="object")console.error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");else{var c,f=c="",m;for(m in l)if(l.hasOwnProperty(m)){var b=l[m];b!=null&&typeof b!="boolean"&&b!==""&&(m.indexOf("--")===0?(ca(b,m),c+=f+m+":"+(""+b).trim()):typeof b!="number"||b===0||ec.has(m)?(ca(b,m),c+=f+m.replace(ih,"-$1").toLowerCase().replace(Wu,"-ms-")+":"+(""+b).trim()):c+=f+m.replace(ih,"-$1").toLowerCase().replace(Wu,"-ms-")+":"+b+"px",f=";")}c=c||null,l=n.getAttribute("style"),l!==c&&(c=Ft(c),Ft(l)!==c&&(o.style=dr(n)))}}function gl(n,l,o,c,f,m){if(f.delete(o),n=n.getAttribute(o),n===null)switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":return}else if(c!=null)switch(typeof c){case"function":case"symbol":case"boolean":break;default:if(at(c,l),n===""+c)return}Wt(l,n,c,m)}function fr(n,l,o,c,f,m){if(f.delete(o),n=n.getAttribute(o),n===null){switch(typeof c){case"function":case"symbol":return}if(!c)return}else switch(typeof c){case"function":case"symbol":break;default:if(c)return}Wt(l,n,c,m)}function Si(n,l,o,c,f,m){if(f.delete(o),n=n.getAttribute(o),n===null)switch(typeof c){case"undefined":case"function":case"symbol":return}else if(c!=null)switch(typeof c){case"function":case"symbol":break;default:if(at(c,o),n===""+c)return}Wt(l,n,c,m)}function jt(n,l,o,c,f,m){if(f.delete(o),n=n.getAttribute(o),n===null)switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":return;default:if(isNaN(c))return}else if(c!=null)switch(typeof c){case"function":case"symbol":case"boolean":break;default:if(!isNaN(c)&&(at(c,l),n===""+c))return}Wt(l,n,c,m)}function xf(n,l,o,c,f,m){if(f.delete(o),n=n.getAttribute(o),n===null)switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":return}else if(c!=null)switch(typeof c){case"function":case"symbol":case"boolean":break;default:if(at(c,l),o=ma(""+c),n===o)return}Wt(l,n,c,m)}function Lx(n,l,o,c){for(var f={},m=new Set,b=n.attributes,E=0;E<b.length;E++)switch(b[E].name.toLowerCase()){case"value":break;case"checked":break;case"selected":break;default:m.add(b[E].name)}if(Io(l)){for(var k in o)if(o.hasOwnProperty(k)){var w=o[k];if(w!=null){if(Ns.hasOwnProperty(k))typeof w!="function"&&ta(k,w);else if(o.suppressHydrationWarning!==!0)switch(k){case"children":typeof w!="string"&&typeof w!="number"||Wt("children",n.textContent,w,f);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":b=n.innerHTML,w=w?w.__html:void 0,w!=null&&(w=Ox(n,w),Wt(k,b,w,f));continue;case"style":m.delete(k),_a(n,w,f);continue;case"offsetParent":case"offsetTop":case"offsetLeft":case"offsetWidth":case"offsetHeight":case"isContentEditable":case"outerText":case"outerHTML":m.delete(k.toLowerCase()),console.error("Assignment to read-only property will result in a no-op: `%s`",k);continue;case"className":m.delete("class"),b=gm(n,"class",w),Wt("className",b,w,f);continue;default:c.context===Ii&&l!=="svg"&&l!=="math"?m.delete(k.toLowerCase()):m.delete(k),b=gm(n,k,w),Wt(k,b,w,f)}}}}else for(w in o)if(o.hasOwnProperty(w)&&(k=o[w],k!=null)){if(Ns.hasOwnProperty(w))typeof k!="function"&&ta(w,k);else if(o.suppressHydrationWarning!==!0)switch(w){case"children":typeof k!="string"&&typeof k!="number"||Wt("children",n.textContent,k,f);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"value":case"checked":case"selected":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":b=n.innerHTML,k=k?k.__html:void 0,k!=null&&(k=Ox(n,k),b!==k&&(f[w]={__html:b}));continue;case"className":gl(n,w,"class",k,m,f);continue;case"tabIndex":gl(n,w,"tabindex",k,m,f);continue;case"style":m.delete(w),_a(n,k,f);continue;case"multiple":m.delete(w),Wt(w,n.multiple,k,f);continue;case"muted":m.delete(w),Wt(w,n.muted,k,f);continue;case"autoFocus":m.delete("autofocus"),Wt(w,n.autofocus,k,f);continue;case"data":if(l!=="object"){m.delete(w),b=n.getAttribute("data"),Wt(w,b,k,f);continue}case"src":case"href":if(!(k!==""||l==="a"&&w==="href"||l==="object"&&w==="data")){console.error(w==="src"?'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.':'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',w,w),xf(n,w,w,null,m,f);continue}xf(n,w,w,k,m,f);continue;case"action":case"formAction":if(b=n.getAttribute(w),typeof k=="function"){m.delete(w.toLowerCase()),w==="formAction"?(m.delete("name"),m.delete("formenctype"),m.delete("formmethod"),m.delete("formtarget")):(m.delete("enctype"),m.delete("method"),m.delete("target"));continue}else if(b===Yv){m.delete(w.toLowerCase()),Wt(w,"function",k,f);continue}xf(n,w,w.toLowerCase(),k,m,f);continue;case"xlinkHref":xf(n,w,"xlink:href",k,m,f);continue;case"contentEditable":Si(n,w,"contenteditable",k,m,f);continue;case"spellCheck":Si(n,w,"spellcheck",k,m,f);continue;case"draggable":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":Si(n,w,w,k,m,f);continue;case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":fr(n,w,w.toLowerCase(),k,m,f);continue;case"capture":case"download":e:{E=n;var I=b=w,ae=f;if(m.delete(I),E=E.getAttribute(I),E===null)switch(typeof k){case"undefined":case"function":case"symbol":break e;default:if(k===!1)break e}else if(k!=null)switch(typeof k){case"function":case"symbol":break;case"boolean":if(k===!0&&E==="")break e;break;default:if(at(k,b),E===""+k)break e}Wt(b,E,k,ae)}continue;case"cols":case"rows":case"size":case"span":e:{if(E=n,I=b=w,ae=f,m.delete(I),E=E.getAttribute(I),E===null)switch(typeof k){case"undefined":case"function":case"symbol":case"boolean":break e;default:if(isNaN(k)||1>k)break e}else if(k!=null)switch(typeof k){case"function":case"symbol":case"boolean":break;default:if(!(isNaN(k)||1>k)&&(at(k,b),E===""+k))break e}Wt(b,E,k,ae)}continue;case"rowSpan":jt(n,w,"rowspan",k,m,f);continue;case"start":jt(n,w,w,k,m,f);continue;case"xHeight":gl(n,w,"x-height",k,m,f);continue;case"xlinkActuate":gl(n,w,"xlink:actuate",k,m,f);continue;case"xlinkArcrole":gl(n,w,"xlink:arcrole",k,m,f);continue;case"xlinkRole":gl(n,w,"xlink:role",k,m,f);continue;case"xlinkShow":gl(n,w,"xlink:show",k,m,f);continue;case"xlinkTitle":gl(n,w,"xlink:title",k,m,f);continue;case"xlinkType":gl(n,w,"xlink:type",k,m,f);continue;case"xmlBase":gl(n,w,"xml:base",k,m,f);continue;case"xmlLang":gl(n,w,"xml:lang",k,m,f);continue;case"xmlSpace":gl(n,w,"xml:space",k,m,f);continue;case"inert":k!==""||Cg[w]||(Cg[w]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",w)),fr(n,w,w,k,m,f);continue;default:if(!(2<w.length)||w[0]!=="o"&&w[0]!=="O"||w[1]!=="n"&&w[1]!=="N"){E=tx(w),b=!1,c.context===Ii&&l!=="svg"&&l!=="math"?m.delete(E.toLowerCase()):(I=w.toLowerCase(),I=zi.hasOwnProperty(I)&&zi[I]||null,I!==null&&I!==w&&(b=!0,m.delete(I)),m.delete(E));e:if(I=n,ae=E,E=k,ld(ae))if(I.hasAttribute(ae))I=I.getAttribute(ae),at(E,ae),E=I===""+E?E:I;else{switch(typeof E){case"function":case"symbol":break e;case"boolean":if(I=ae.toLowerCase().slice(0,5),I!=="data-"&&I!=="aria-")break e}E=E===void 0?void 0:null}else E=void 0;b||Wt(w,E,k,f)}}}return 0<m.size&&o.suppressHydrationWarning!==!0&&mf(n,m,f),Object.keys(f).length===0?null:f}function Hx(n,l){switch(n.length){case 0:return"";case 1:return n[0];case 2:return n[0]+" "+l+" "+n[1];default:return n.slice(0,-1).join(", ")+", "+l+" "+n[n.length-1]}}function gf(n){return n.nodeType===9?n:n.ownerDocument}function Ux(n){switch(n){case jl:return pm;case Do:return Bg;default:return Ii}}function St(n,l){if(n===Ii)switch(l){case"svg":return pm;case"math":return Bg;default:return Ii}return n===pm&&l==="foreignObject"?Ii:n}function ct(n,l){return n==="textarea"||n==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}function $e(){var n=window.event;return n&&n.type==="popstate"?n===t0?!1:(t0=n,!0):(t0=null,!1)}function Fe(n){setTimeout(function(){throw n})}function pt(n,l,o){switch(l){case"button":case"input":case"select":case"textarea":o.autoFocus&&n.focus();break;case"img":o.src?n.src=o.src:o.srcSet&&(n.srcset=o.srcSet)}}function yl(n,l,o,c){zx(n,l,o,c),n[nl]=c}function Na(n){fa(n,"")}function Hu(n,l,o){n.nodeValue=o}function Mp(n,l){n.removeChild(l)}function ws(n,l){n.nodeType===8?n.parentNode.removeChild(l):n.removeChild(l)}function At(n,l){var o=l,c=0;do{var f=o.nextSibling;if(n.removeChild(o),f&&f.nodeType===8)if(o=f.data,o===kg){if(c===0){n.removeChild(f),Qu(l);return}c--}else o!==Tg&&o!==Kr&&o!==Jr||c++;o=f}while(o);Qu(l)}function ho(n){n=n.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"}function Ai(n){n.nodeValue=""}function _p(n,l){l=l[Qv],l=l!=null&&l.hasOwnProperty("display")?l.display:null,n.style.display=l==null||typeof l=="boolean"?"":(""+l).trim()}function zl(n,l){n.nodeValue=l}function xo(n){var l=n.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var o=l;switch(l=l.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":xo(o),Pa(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function mr(n,l,o,c){for(;n.nodeType===1;){var f=o;if(n.nodeName.toLowerCase()!==l.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[To])switch(l){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(m=n.getAttribute("rel"),m==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(m!==f.rel||n.getAttribute("href")!==(f.href==null?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(m=n.getAttribute("src"),(m!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(l==="input"&&n.type==="hidden"){at(f.name,"name");var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===m)return n}else return n;if(n=el(n.nextSibling),n===null)break}return null}function Oa(n,l,o){if(l==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=el(n.nextSibling),n===null))return null;return n}function el(n){for(;n!=null;n=n.nextSibling){var l=n.nodeType;if(l===1||l===3)break;if(l===8){if(l=n.data,l===Tg||l===Jr||l===Kr||l===Fy||l===Bb)break;if(l===kg)return null}}return n}function yf(n){if(n.nodeType===1){for(var l=n.nodeName.toLowerCase(),o={},c=n.attributes,f=0;f<c.length;f++){var m=c[f];o[hf(m.name)]=m.name.toLowerCase()==="style"?dr(n):m.value}return{type:l,props:o}}return n.nodeType===8?{type:"Suspense",props:{}}:n.nodeValue}function pr(n,l,o){return o===null||o[Xv]!==!0?(n.nodeValue===l?n=null:(l=Ft(l),n=Ft(n.nodeValue)===l?null:n.nodeValue),n):null}function hr(n){n=n.nextSibling;for(var l=0;n;){if(n.nodeType===8){var o=n.data;if(o===kg){if(l===0)return el(n.nextSibling);l--}else o!==Tg&&o!==Jr&&o!==Kr||l++}n=n.nextSibling}return null}function Ds(n){n=n.previousSibling;for(var l=0;n;){if(n.nodeType===8){var o=n.data;if(o===Tg||o===Jr||o===Kr){if(l===0)return n;l--}else o===kg&&l++}n=n.previousSibling}return null}function bf(n){Qu(n)}function Ci(n){Qu(n)}function Uu(n,l,o,c,f){switch(f&&rd(n,c.ancestorInfo),l=gf(o),n){case"html":if(n=l.documentElement,!n)throw Error("React expected an <html> element (document.documentElement) to exist in the Document but one was not found. React never removes the documentElement for any Document it renders into so the cause is likely in some other script running on this page.");return n;case"head":if(n=l.head,!n)throw Error("React expected a <head> element (document.head) to exist in the Document but one was not found. React never removes the head for any Document it renders into so the cause is likely in some other script running on this page.");return n;case"body":if(n=l.body,!n)throw Error("React expected a <body> element (document.body) to exist in the Document but one was not found. React never removes the body for any Document it renders into so the cause is likely in some other script running on this page.");return n;default:throw Error("resolveSingletonInstance was called with an element type that is not supported. This is a bug in React.")}}function Np(n,l,o,c){if(ql(o)){var f=o.tagName.toLowerCase();console.error("You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",f,f,f)}switch(n){case"html":case"head":case"body":break;default:console.error("acquireSingletonInstance was called with an element type that is not supported. This is a bug in React.")}for(f=o.attributes;f.length;)o.removeAttributeNode(f[0]);kt(o,n,l),o[Rn]=c,o[nl]=l}function Vu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.ownerDocument}function qu(n,l,o){var c=hm;if(c&&typeof l=="string"&&l){var f=Bl(l);f='link[rel="'+n+'"][href="'+f+'"]',typeof o=="string"&&(f+='[crossorigin="'+o+'"]'),Ob.has(f)||(Ob.add(f),n={rel:n,crossOrigin:o,href:l},c.querySelector(f)===null&&(l=c.createElement("link"),kt(l,"link",n),Qt(l),c.head.appendChild(l)))}}function vf(n,l,o,c){var f=(f=rn.current)?Vu(f):null;if(!f)throw Error('"resourceRoot" was expected to exist. This is a bug in React.');switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(o=Ti(o.href),l=qo(f).hoistableStyles,c=l.get(o),c||(c={type:"style",instance:null,count:0,state:null},l.set(o,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=Ti(o.href);var m=qo(f).hoistableStyles,b=m.get(n);if(!b&&(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:Wr,preload:null}},m.set(n,b),(m=f.querySelector(Pt(n)))&&!m._p&&(b.instance=m,b.state.loading=qh|Ka),!Ja.has(n))){var E={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy};Ja.set(n,E),m||zp(f,n,E,b.state)}if(l&&c===null)throw o=`
|
|
249
|
+
|
|
250
|
+
- `+wn(l)+`
|
|
251
|
+
+ `+wn(o),Error("Expected <link> not to update to be updated to a stylesheet with precedence. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+o);return b}if(l&&c!==null)throw o=`
|
|
252
|
+
|
|
253
|
+
- `+wn(l)+`
|
|
254
|
+
+ `+wn(o),Error("Expected stylesheet with precedence to not be updated to a different kind of <link>. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+o);return null;case"script":return l=o.async,o=o.src,typeof o=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(o=ki(o),l=qo(f).hoistableScripts,c=l.get(o),c||(c={type:"script",instance:null,count:0,state:null},l.set(o,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error('getResource encountered a type it did not expect: "'+n+'". this is a bug in React.')}}function wn(n){var l=0,o="<link";return typeof n.rel=="string"?(l++,o+=' rel="'+n.rel+'"'):Ha.call(n,"rel")&&(l++,o+=' rel="'+(n.rel===null?"null":"invalid type "+typeof n.rel)+'"'),typeof n.href=="string"?(l++,o+=' href="'+n.href+'"'):Ha.call(n,"href")&&(l++,o+=' href="'+(n.href===null?"null":"invalid type "+typeof n.href)+'"'),typeof n.precedence=="string"?(l++,o+=' precedence="'+n.precedence+'"'):Ha.call(n,"precedence")&&(l++,o+=" precedence={"+(n.precedence===null?"null":"invalid type "+typeof n.precedence)+"}"),Object.getOwnPropertyNames(n).length>l&&(o+=" ..."),o+" />"}function Ti(n){return'href="'+Bl(n)+'"'}function Pt(n){return'link[rel="stylesheet"]['+n+"]"}function Op(n){return He({},n,{"data-precedence":n.precedence,precedence:null})}function zp(n,l,o,c){n.querySelector('link[rel="preload"][as="style"]['+l+"]")?c.loading=qh:(l=n.createElement("link"),c.preload=l,l.addEventListener("load",function(){return c.loading|=qh}),l.addEventListener("error",function(){return c.loading|=_b}),kt(l,"link",o),Qt(l),n.head.appendChild(l))}function ki(n){return'[src="'+Bl(n)+'"]'}function xr(n){return"script[async]"+n}function za(n,l,o){if(l.count++,l.instance===null)switch(l.type){case"style":var c=n.querySelector('style[data-href~="'+Bl(o.href)+'"]');if(c)return l.instance=c,Qt(c),c;var f=He({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),Qt(c),kt(c,"style",f),Bi(c,o.precedence,n),l.instance=c;case"stylesheet":f=Ti(o.href);var m=n.querySelector(Pt(f));if(m)return l.state.loading|=Ka,l.instance=m,Qt(m),m;c=Op(o),(f=Ja.get(f))&&gr(c,f),m=(n.ownerDocument||n).createElement("link"),Qt(m);var b=m;return b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),kt(m,"link",c),l.state.loading|=Ka,Bi(m,o.precedence,n),l.instance=m;case"script":return m=ki(o.src),(f=n.querySelector(xr(m)))?(l.instance=f,Qt(f),f):(c=o,(f=Ja.get(m))&&(c=He({},o),go(c,f)),n=n.ownerDocument||n,f=n.createElement("script"),Qt(f),kt(f,"link",c),n.head.appendChild(f),l.instance=f);case"void":return null;default:throw Error('acquireResource encountered a resource type it did not expect: "'+l.type+'". this is a bug in React.')}else l.type==="stylesheet"&&(l.state.loading&Ka)===Wr&&(c=l.instance,l.state.loading|=Ka,Bi(c,o.precedence,n));return l.instance}function Bi(n,l,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=c.length?c[c.length-1]:null,m=f,b=0;b<c.length;b++){var E=c[b];if(E.dataset.precedence===l)m=E;else if(m!==f)break}m?m.parentNode.insertBefore(n,m.nextSibling):(l=o.nodeType===9?o.head:o,l.insertBefore(n,l.firstChild))}function gr(n,l){n.crossOrigin==null&&(n.crossOrigin=l.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=l.referrerPolicy),n.title==null&&(n.title=l.title)}function go(n,l){n.crossOrigin==null&&(n.crossOrigin=l.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=l.referrerPolicy),n.integrity==null&&(n.integrity=l.integrity)}function Lp(n,l,o){if(wg===null){var c=new Map,f=wg=new Map;f.set(o,c)}else f=wg,c=f.get(o),c||(c=new Map,f.set(o,c));if(c.has(n))return c;for(c.set(n,null),o=o.getElementsByTagName(n),f=0;f<o.length;f++){var m=o[f];if(!(m[To]||m[Rn]||n==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!==jl){var b=m.getAttribute(l)||"";b=n+b;var E=c.get(b);E?E.push(m):c.set(b,[m])}}return c}function Hp(n,l,o){n=n.ownerDocument||n,n.head.insertBefore(o,l==="title"?n.querySelector("head > title"):null)}function Vx(n,l,o){var c=!o.ancestorInfo.containerTagInScope;if(o.context===pm||l.itemProp!=null)return!c||l.itemProp==null||n!=="meta"&&n!=="title"&&n!=="style"&&n!=="link"&&n!=="script"||console.error("Cannot render a <%s> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <%s> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.",n,n),!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href===""){c&&console.error('Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflic with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`, or move the <style> to the <style> tag.');break}return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError){if(l.rel==="stylesheet"&&typeof l.precedence=="string"){n=l.href;var f=l.onError,m=l.disabled;o=[],l.onLoad&&o.push("`onLoad`"),f&&o.push("`onError`"),m!=null&&o.push("`disabled`"),f=Hx(o,"and"),f+=o.length===1?" prop":" props",m=o.length===1?"an "+f:"the "+f,o.length&&console.error('React encountered a <link rel="stylesheet" href="%s" ... /> with a `precedence` prop that also included %s. The presence of loading and error handlers indicates an intent to manage the stylesheet loading state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the %s, otherwise remove the `precedence` prop.',n,m,f)}c&&(typeof l.rel!="string"||typeof l.href!="string"||l.href===""?console.error("Cannot render a <link> outside the main document without a `rel` and `href` prop. Try adding a `rel` and/or `href` prop to this <link> or moving the link into the <head> tag"):(l.onError||l.onLoad)&&console.error("Cannot render a <link> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."));break}switch(l.rel){case"stylesheet":return n=l.precedence,l=l.disabled,typeof n!="string"&&c&&console.error('Cannot render a <link rel="stylesheet" /> outside the main document without knowing its precedence. Consider adding precedence="default" or moving it into the root <head> tag.'),typeof n=="string"&&l==null;default:return!0}case"script":if(n=l.async&&typeof l.async!="function"&&typeof l.async!="symbol",!n||l.onLoad||l.onError||!l.src||typeof l.src!="string"){c&&(n?l.onLoad||l.onError?console.error("Cannot render a <script> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."):console.error("Cannot render a <script> outside the main document without `async={true}` and a non-empty `src` prop. Ensure there is a valid `src` and either make the script async or move it into the root <head> tag or somewhere in the <body>."):console.error('Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag.'));break}return!0;case"noscript":case"template":c&&console.error("Cannot render <%s> outside the main document. Try moving it into the root <head> tag.",n)}return!1}function Rf(n){return!(n.type==="stylesheet"&&(n.state.loading&Nb)===Wr)}function Up(){}function Ig(n,l,o){if(Gh===null)throw Error("Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug.");var c=Gh;if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&Ka)===Wr){if(l.instance===null){var f=Ti(o.href),m=n.querySelector(Pt(f));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(c.count++,c=Ef.bind(c),n.then(c,c)),l.state.loading|=Ka,l.instance=m,Qt(m);return}m=n.ownerDocument||n,o=Op(o),(f=Ja.get(f))&&gr(o,f),m=m.createElement("link"),Qt(m);var b=m;b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),kt(m,"link",o),l.instance=m}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&Nb)===Wr&&(c.count++,l=Ef.bind(c),n.addEventListener("load",l),n.addEventListener("error",l))}}function $g(){if(Gh===null)throw Error("Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug.");var n=Gh;return n.stylesheets&&n.count===0&&jf(n,n.stylesheets),0<n.count?function(l){var o=setTimeout(function(){if(n.stylesheets&&jf(n,n.stylesheets),n.unsuspend){var c=n.unsuspend;n.unsuspend=null,c()}},6e4);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(o)}}:null}function Ef(){if(this.count--,this.count===0){if(this.stylesheets)jf(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}function jf(n,l){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Dg=new Map,l.forEach(qx,n),Dg=null,Ef.call(n))}function qx(n,l){if(!(l.state.loading&Ka)){var o=Dg.get(n);if(o)var c=o.get(l0);else{o=new Map,Dg.set(n,o);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(o.set(b.dataset.precedence,b),c=b)}c&&o.set(l0,c)}f=l.instance,b=f.getAttribute("data-precedence"),m=o.get(b)||c,m===c&&o.set(l0,f),o.set(b,f),this.count++,c=Ef.bind(this),f.addEventListener("load",c),f.addEventListener("error",c),m?m.parentNode.insertBefore(f,m.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),l.state.loading|=Ka}}function Gu(n,l,o){var c=0;switch(n){case"dir":case"dirxml":case"groupEnd":case"table":return Ub.apply(console[n],[console].concat(l));case"assert":c=1}return l=l.slice(0),typeof l[c]=="string"?l.splice(c,1,zb+l[c],Lb,Mg+o+Mg,Hb):l.splice(c,0,zb,Lb,Mg+o+Mg,Hb),l.unshift(console),Ub.apply(console[n],l)}function Sf(n,l,o,c,f,m,b,E){for(this.tag=1,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=n0,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vo(0),this.hiddenUpdates=Vo(null),this.identifierPrefix=c,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,n=this.pendingUpdatersLaneMap=[],l=0;31>l;l++)n.push(new Set);this._debugRootType=o?"hydrateRoot()":"createRoot()"}function Vp(n,l,o,c,f,m,b,E,k,w,I,ae){return n=new Sf(n,l,o,b,E,k,w,ae),l=Sv,m===!0&&(l|=al|zs),qn&&(l|=Gn),m=j(3,null,null,l),n.current=m,m.stateNode=n,l=is(),Ml(l),n.pooledCache=l,Ml(l),m.memoizedState={element:c,isDehydrated:o,cache:l},Gd(m),n}function qp(n){return n?(n=nc,n):nc}function Gx(n,l,o,c){return l.tag===0&&Cs(),Gp(l.current,2,n,l,o,c),2}function Gp(n,l,o,c,f,m){if(_n&&typeof _n.onScheduleFiberRoot=="function")try{_n.onScheduleFiberRoot(Ku,c,o)}catch(b){Vn||(Vn=!0,console.error("React instrumentation encountered an error: %s",b))}Se!==null&&typeof Se.markRenderScheduled=="function"&&Se.markRenderScheduled(l),f=qp(f),c.context===null?c.context=f:c.pendingContext=f,Rl&&Mn!==null&&!Vb&&(Vb=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
|
|
255
|
+
|
|
256
|
+
Check the render method of %s.`,X(Mn)||"Unknown")),c=gs(l),c.payload={element:o},m=m===void 0?null:m,m!==null&&(typeof m!="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",m),c.callback=m),o=ys(n,c,l),o!==null&&(ft(o,n,l),Wc(o,n,l))}function wi(n,l){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<l?o:l}}function Af(n,l){wi(n,l),(n=n.alternate)&&wi(n,l)}function rt(n){if(n.tag===13){var l=xn(n,67108864);l!==null&&ft(l,n,67108864),Af(n,67108864)}}function Yp(){return Mn}function Kg(){for(var n=new Map,l=1,o=0;31>o;o++){var c=$h(l);n.set(l,c),l*=2}return n}function Yx(n,l,o,c){var f=W.T;W.T=null;var m=ht.p;try{ht.p=El,Xp(n,l,o,c)}finally{ht.p=m,W.T=f}}function Jg(n,l,o,c){var f=W.T;W.T=null;var m=ht.p;try{ht.p=Ll,Xp(n,l,o,c)}finally{ht.p=m,W.T=f}}function Xp(n,l,o,c){if(_g){var f=Qp(c);if(f===null)Ri(n,l,c,Ng,o),Cf(n,c);else if(Zp(f,n,l,o,c))c.stopPropagation();else if(Cf(n,c),l&4&&-1<$v.indexOf(n)){for(;f!==null;){var m=ql(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Ys(m.pendingLanes);if(b!==0){var E=m;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var k=1<<31-Nn(b);E.entanglements[1]|=k,b&=~k}ea(m),(Bt&(kl|Xi))===oa&&(xg=Ua()+Rb,zu(0))}}break;case 13:E=xn(m,2),E!==null&&ft(E,m,2),ml(),Af(m,2)}if(m=Qp(c),m===null&&Ri(n,l,c,Ng,o),m===f)break;f=m}f!==null&&c.stopPropagation()}else Ri(n,l,c,null,o)}}function Qp(n){return n=Zs(n),Yu(n)}function Yu(n){if(Ng=null,n=ra(n),n!==null){var l=me(n);if(l===null)n=null;else{var o=l.tag;if(o===13){if(n=V(l),n!==null)return n;n=null}else if(o===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;n=null}else l!==n&&(n=null)}}return Ng=n,null}function Di(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return El;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return Ll;case"message":switch(ey()){case So:return El;case Of:return Ll;case $u:case ty:return aa;case th:return Ni;default:return aa}default:return aa}}function Cf(n,l){switch(n){case"focusin":case"focusout":fc=null;break;case"dragenter":case"dragleave":mc=null;break;case"mouseover":case"mouseout":pc=null;break;case"pointerover":case"pointerout":Xh.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qh.delete(l.pointerId)}}function yo(n,l,o,c,f,m){return n===null||n.nativeEvent!==m?(n={blockedOn:l,domEventName:o,eventSystemFlags:c,nativeEvent:m,targetContainers:[f]},l!==null&&(l=ql(l),l!==null&&rt(l)),n):(n.eventSystemFlags|=c,l=n.targetContainers,f!==null&&l.indexOf(f)===-1&&l.push(f),n)}function Zp(n,l,o,c,f){switch(l){case"focusin":return fc=yo(fc,n,l,o,c,f),!0;case"dragenter":return mc=yo(mc,n,l,o,c,f),!0;case"mouseover":return pc=yo(pc,n,l,o,c,f),!0;case"pointerover":var m=f.pointerId;return Xh.set(m,yo(Xh.get(m)||null,n,l,o,c,f)),!0;case"gotpointercapture":return m=f.pointerId,Qh.set(m,yo(Qh.get(m)||null,n,l,o,c,f)),!0}return!1}function bo(n){var l=ra(n.target);if(l!==null){var o=me(l);if(o!==null){if(l=o.tag,l===13){if(l=V(o),l!==null){n.blockedOn=l,nd(n.priority,function(){if(o.tag===13){var c=Hn(o),f=xn(o,c);f!==null&&ft(f,o,c),Af(o,c)}});return}}else if(l===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function bl(n){if(n.blockedOn!==null)return!1;for(var l=n.targetContainers;0<l.length;){var o=Qp(n.nativeEvent);if(o===null){o=n.nativeEvent;var c=new o.constructor(o.type,o),f=c;D!==null&&console.error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."),D=f,o.target.dispatchEvent(c),D===null&&console.error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."),D=null}else return l=ql(o),l!==null&&rt(l),n.blockedOn=o,!1;l.shift()}return!0}function Xu(n,l,o){bl(n)&&o.delete(l)}function Wg(){a0=!1,fc!==null&&bl(fc)&&(fc=null),mc!==null&&bl(mc)&&(mc=null),pc!==null&&bl(pc)&&(pc=null),Xh.forEach(Xu),Qh.forEach(Xu)}function yr(n,l){n.blockedOn===l&&(n.blockedOn=null,a0||(a0=!0,Ut.unstable_scheduleCallback(Ut.unstable_NormalPriority,Wg)))}function Ip(n){Og!==n&&(Og=n,Ut.unstable_scheduleCallback(Ut.unstable_NormalPriority,function(){Og===n&&(Og=null);for(var l=0;l<n.length;l+=3){var o=n[l],c=n[l+1],f=n[l+2];if(typeof c!="function"){if(Yu(c||o)===null)continue;break}var m=ql(o);m!==null&&(n.splice(l,3),l-=3,o={pending:!0,data:f,method:o.method,action:c},Object.freeze(o),Ra(m,o,c,f))}}))}function Qu(n){function l(k){return yr(k,n)}fc!==null&&yr(fc,n),mc!==null&&yr(mc,n),pc!==null&&yr(pc,n),Xh.forEach(l),Qh.forEach(l);for(var o=0;o<hc.length;o++){var c=hc[o];c.blockedOn===n&&(c.blockedOn=null)}for(;0<hc.length&&(o=hc[0],o.blockedOn===null);)bo(o),o.blockedOn===null&&hc.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var f=o[c],m=o[c+1],b=f[nl]||null;if(typeof m=="function")b||Ip(o);else if(b){var E=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[nl]||null)E=b.formAction;else if(Yu(f)!==null)continue}else E=b.action;typeof E=="function"?o[c+1]=E:(o.splice(c,3),c-=3),Ip(o)}}}function $p(n){this._internalRoot=n}function Zu(n){this._internalRoot=n}function Kp(n){n[Co]&&(n._reactRootContainer?console.error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):console.error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Ut=requireScheduler(),Jp=React,Wp=ReactDOM,Fp=Symbol.for("react.element"),vo=Symbol.for("react.transitional.element"),Iu=Symbol.for("react.portal"),La=Symbol.for("react.fragment"),Tf=Symbol.for("react.strict_mode"),kf=Symbol.for("react.profiler"),We=Symbol.for("react.provider"),br=Symbol.for("react.consumer"),vl=Symbol.for("react.context"),Mi=Symbol.for("react.forward_ref"),Bf=Symbol.for("react.suspense"),vr=Symbol.for("react.suspense_list"),Ro=Symbol.for("react.memo"),Dn=Symbol.for("react.lazy"),_i=Symbol.for("react.offscreen"),Xx=Symbol.for("react.memo_cache_sentinel"),Qx=Symbol.iterator,Fg=Symbol.for("react.client.reference"),W=Jp.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,He=Object.assign,Eo=0,it,wf,cn,Zx,Df,Mf,Rr;se.__reactDisabledLog=!0;var _f,Pp,Er=!1,jr=new(typeof WeakMap=="function"?WeakMap:Map),Mn=null,Rl=!1,vn=Array.isArray,ht=Wp.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pg=Object.freeze({pending:!1,data:null,method:null,action:null}),eh=[],Sr=[],la=-1,jo=Re(null),Ar=Re(null),rn=Re(null),Cr=Re(null),Ha=Object.prototype.hasOwnProperty,tl=Ut.unstable_scheduleCallback,Ix=Ut.unstable_cancelCallback,Nf=Ut.unstable_shouldYield,Ms=Ut.unstable_requestPaint,Ua=Ut.unstable_now,ey=Ut.unstable_getCurrentPriorityLevel,So=Ut.unstable_ImmediatePriority,Of=Ut.unstable_UserBlockingPriority,$u=Ut.unstable_NormalPriority,ty=Ut.unstable_LowPriority,th=Ut.unstable_IdlePriority,ny=Ut.log,ly=Ut.unstable_setDisableYieldValue,Ku=null,_n=null,Se=null,Vn=!1,qn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",Nn=Math.clz32?Math.clz32:zg,ay=Math.log,Ju=Math.LN2,Ao=128,Tr=4194304,El=2,Ll=8,aa=32,Ni=268435456,_s=Math.random().toString(36).slice(2),Rn="__reactFiber$"+_s,nl="__reactProps$"+_s,Co="__reactContainer$"+_s,Oi="__reactEvents$"+_s,sy="__reactListeners$"+_s,oy="__reactHandles$"+_s,$x="__reactResources$"+_s,To="__reactMarker$"+_s,kr=new Set,Ns={},nh={},ll=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iy={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},Kx=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lh={},ah={},Jx=/[\n"\\]/g,zf=!1,sh=!1,Br=!1,Wx=!1,Fx=!1,Lf=!1,Hf=["value","defaultValue"],wr=!1,Uf=/["'&<>\n\t]|^\s|\s$/,Px="address applet area article aside base basefont bgsound blockquote body br button caption center col colgroup dd details dir div dl dt embed fieldset figcaption figure footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html iframe img input isindex li link listing main marquee menu menuitem meta nav noembed noframes noscript object ol p param plaintext pre script section select source style summary table tbody td template textarea tfoot th thead title tr track ul wbr xmp".split(" "),Vf="applet caption html table td th marquee object template foreignObject desc title".split(" "),ko=Vf.concat(["button"]),Bo="dd dt li option optgroup p rp rt".split(" "),Os={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null,containerTagInScope:null},wo={},Do="http://www.w3.org/1998/Math/MathML",jl="http://www.w3.org/2000/svg",oh={animation:"animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(" "),background:"backgroundAttachment backgroundClip backgroundColor backgroundImage backgroundOrigin backgroundPositionX backgroundPositionY backgroundRepeat backgroundSize".split(" "),backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:"borderBottomColor borderBottomStyle borderBottomWidth borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderTopColor borderTopStyle borderTopWidth".split(" "),borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:"fontFamily fontFeatureSettings fontKerning fontLanguageOverride fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition fontWeight lineHeight".split(" "),fontVariant:"fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition".split(" "),gap:["columnGap","rowGap"],grid:"gridAutoColumns gridAutoFlow gridAutoRows gridTemplateAreas gridTemplateColumns gridTemplateRows".split(" "),gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marker:["markerEnd","markerMid","markerStart"],mask:"maskClip maskComposite maskImage maskMode maskOrigin maskPositionX maskPositionY maskRepeat maskSize".split(" "),maskPosition:["maskPositionX","maskPositionY"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],transition:["transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],wordWrap:["overflowWrap"]},ih=/([A-Z])/g,Wu=/^ms-/,uy=/^(?:webkit|moz|o)[A-Z]/,eg=/^-ms-/,qf=/-(.)/g,uh=/;\s*$/,Fu={},Pu={},Dr=!1,ch=!1,ec=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),rh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),zi={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",fetchpriority:"fetchPriority",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",inert:"inert",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",popover:"popover",popovertarget:"popoverTarget",popovertargetaction:"popoverTargetAction",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",transformorigin:"transformOrigin","transform-origin":"transformOrigin",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},dh={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},tc={},Gf=RegExp("^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),a=RegExp("^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),i=!1,u={},d=/^on./,p=/^on[^A-Z]/,y=RegExp("^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),S=RegExp("^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),B=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,D=null,U=null,le=null,fe=!1,K=!1;if(ll)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){K=!0}}),window.addEventListener("test",ee,ee),window.removeEventListener("test",ee,ee)}catch{K=!1}var Ce=null,_e=null,bt=null,G={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},H=An(G),Q=He({},G,{view:0,detail:0}),de=An(Q),Te,Ge,we,De=He({},Q,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==we&&(we&&n.type==="mousemove"?(Te=n.screenX-we.screenX,Ge=n.screenY-we.screenY):Ge=Te=0,we=n),Te)},movementY:function(n){return"movementY"in n?n.movementY:Ge}}),en=An(De),nt=He({},De,{dataTransfer:0}),Mo=An(nt),cy=He({},Q,{relatedTarget:0}),ry=An(cy),Wb=He({},G,{animationName:0,elapsedTime:0,pseudoElement:0}),Fb=An(Wb),Pb=He({},G,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),ev=An(Pb),tv=He({},G,{data:0}),s0=An(tv),nv=s0,lv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},av={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},sv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},ov=He({},Q,{key:function(n){if(n.key){var l=lv[n.key]||n.key;if(l!=="Unidentified")return l}return n.type==="keypress"?(n=au(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?av[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pd,charCode:function(n){return n.type==="keypress"?au(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?au(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),iv=An(ov),uv=He({},De,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),o0=An(uv),cv=He({},Q,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pd}),rv=An(cv),dv=He({},G,{propertyName:0,elapsedTime:0,pseudoElement:0}),fv=An(dv),mv=He({},De,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),pv=An(mv),hv=He({},G,{newState:0,oldState:0}),xv=An(hv),gv=[9,13,27,32],i0=229,dy=ll&&"CompositionEvent"in window,fh=null;ll&&"documentMode"in document&&(fh=document.documentMode);var yv=ll&&"TextEvent"in window&&!fh,u0=ll&&(!dy||fh&&8<fh&&11>=fh),c0=32,r0=String.fromCharCode(c0),d0=!1,Yf=!1,bv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},mh=null,ph=null,f0=!1;ll&&(f0=hd("input")&&(!document.documentMode||9<document.documentMode));var Sl=typeof Object.is=="function"?Object.is:Dm,vv=ll&&"documentMode"in document&&11>=document.documentMode,Xf=null,fy=null,hh=null,my=!1,Qf={animationend:$o("Animation","AnimationEnd"),animationiteration:$o("Animation","AnimationIteration"),animationstart:$o("Animation","AnimationStart"),transitionrun:$o("Transition","TransitionRun"),transitionstart:$o("Transition","TransitionStart"),transitioncancel:$o("Transition","TransitionCancel"),transitionend:$o("Transition","TransitionEnd")},py={},m0={};ll&&(m0=document.createElement("div").style,"AnimationEvent"in window||(delete Qf.animationend.animation,delete Qf.animationiteration.animation,delete Qf.animationstart.animation),"TransitionEvent"in window||delete Qf.transitionend.transition);var p0=Ko("animationend"),h0=Ko("animationiteration"),x0=Ko("animationstart"),Rv=Ko("transitionrun"),Ev=Ko("transitionstart"),jv=Ko("transitioncancel"),g0=Ko("transitionend"),y0=new Map,b0="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" "),xh=1,Mr=2,Li=4,Va=[],Zf=0,hy=0,nc={};Object.freeze(nc);var qa=null,If=null,Ct=0,Sv=1,Gn=2,al=8,zs=16,v0=64,$f=Ut.unstable_now,xy=-0,tg=-0,Hl=-1.1,_r=-0,ng=!1,lg=!1,Ls={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},gh=[],yh=[],bh=[],vh=[],Rh=[],Eh=[],Nr=new Set;Ls.recordUnsafeLifecycleWarnings=function(n,l){Nr.has(n.type)||(typeof l.componentWillMount=="function"&&l.componentWillMount.__suppressDeprecationWarning!==!0&&gh.push(n),n.mode&al&&typeof l.UNSAFE_componentWillMount=="function"&&yh.push(n),typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&bh.push(n),n.mode&al&&typeof l.UNSAFE_componentWillReceiveProps=="function"&&vh.push(n),typeof l.componentWillUpdate=="function"&&l.componentWillUpdate.__suppressDeprecationWarning!==!0&&Rh.push(n),n.mode&al&&typeof l.UNSAFE_componentWillUpdate=="function"&&Eh.push(n))},Ls.flushPendingUnsafeLifecycleWarnings=function(){var n=new Set;0<gh.length&&(gh.forEach(function(E){n.add(X(E)||"Component"),Nr.add(E.type)}),gh=[]);var l=new Set;0<yh.length&&(yh.forEach(function(E){l.add(X(E)||"Component"),Nr.add(E.type)}),yh=[]);var o=new Set;0<bh.length&&(bh.forEach(function(E){o.add(X(E)||"Component"),Nr.add(E.type)}),bh=[]);var c=new Set;0<vh.length&&(vh.forEach(function(E){c.add(X(E)||"Component"),Nr.add(E.type)}),vh=[]);var f=new Set;0<Rh.length&&(Rh.forEach(function(E){f.add(X(E)||"Component"),Nr.add(E.type)}),Rh=[]);var m=new Set;if(0<Eh.length&&(Eh.forEach(function(E){m.add(X(E)||"Component"),Nr.add(E.type)}),Eh=[]),0<l.size){var b=z(l);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
257
|
+
|
|
258
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
259
|
+
|
|
260
|
+
Please update the following components: %s`,b)}0<c.size&&(b=z(c),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
261
|
+
|
|
262
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
263
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
|
|
264
|
+
|
|
265
|
+
Please update the following components: %s`,b)),0<m.size&&(b=z(m),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
266
|
+
|
|
267
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
268
|
+
|
|
269
|
+
Please update the following components: %s`,b)),0<n.size&&(b=z(n),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
270
|
+
|
|
271
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
272
|
+
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
273
|
+
|
|
274
|
+
Please update the following components: %s`,b)),0<o.size&&(b=z(o),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
275
|
+
|
|
276
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
277
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
|
|
278
|
+
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
279
|
+
|
|
280
|
+
Please update the following components: %s`,b)),0<f.size&&(b=z(f),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
281
|
+
|
|
282
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
283
|
+
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
284
|
+
|
|
285
|
+
Please update the following components: %s`,b))};var ag=new Map,R0=new Set;Ls.recordLegacyContextWarning=function(n,l){for(var o=null,c=n;c!==null;)c.mode&al&&(o=c),c=c.return;o===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!R0.has(n.type)&&(c=ag.get(o),n.type.contextTypes!=null||n.type.childContextTypes!=null||l!==null&&typeof l.getChildContext=="function")&&(c===void 0&&(c=[],ag.set(o,c)),c.push(n))},Ls.flushLegacyContextWarning=function(){ag.forEach(function(n){if(n.length!==0){var l=n[0],o=new Set;n.forEach(function(f){o.add(X(f)||"Component"),R0.add(f.type)});var c=z(o);oe(l,function(){console.error(`Legacy context API has been detected within a strict-mode tree.
|
|
286
|
+
|
|
287
|
+
The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
|
|
288
|
+
|
|
289
|
+
Please update the following components: %s
|
|
290
|
+
|
|
291
|
+
Learn more about this warning here: https://react.dev/link/legacy-context`,c)})}})},Ls.discardPendingWarnings=function(){gh=[],yh=[],bh=[],vh=[],Rh=[],Eh=[],ag=new Map};var gy=new WeakMap,Kf=[],Jf=0,sg=null,og=0,Ga=[],Ya=0,Or=null,Hi=1,Ui="",Al=null,Yn=null,et=!1,Vi=!1,Xa=null,Hs=null,_o=!1,yy=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),ig=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"),E0=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),by={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},jh=null,ug=!1,j0={"react-stack-bottom-frame":function(n,l,o){var c=Rl;Rl=!0;try{return n(l,o)}finally{Rl=c}}},vy=j0["react-stack-bottom-frame"].bind(j0),S0={"react-stack-bottom-frame":function(n){var l=Rl;Rl=!0;try{return n.render()}finally{Rl=l}}},A0=S0["react-stack-bottom-frame"].bind(S0),C0={"react-stack-bottom-frame":function(n,l){try{l.componentDidMount()}catch(o){lt(n,n.return,o)}}},Ry=C0["react-stack-bottom-frame"].bind(C0),T0={"react-stack-bottom-frame":function(n,l,o,c,f){try{l.componentDidUpdate(o,c,f)}catch(m){lt(n,n.return,m)}}},k0=T0["react-stack-bottom-frame"].bind(T0),B0={"react-stack-bottom-frame":function(n,l){var o=l.stack;n.componentDidCatch(l.value,{componentStack:o!==null?o:""})}},Av=B0["react-stack-bottom-frame"].bind(B0),w0={"react-stack-bottom-frame":function(n,l,o){try{o.componentWillUnmount()}catch(c){lt(n,l,c)}}},D0=w0["react-stack-bottom-frame"].bind(w0),M0={"react-stack-bottom-frame":function(n){var l=n.create;return n=n.inst,l=l(),n.destroy=l}},Cv=M0["react-stack-bottom-frame"].bind(M0),_0={"react-stack-bottom-frame":function(n,l,o){try{o()}catch(c){lt(n,l,c)}}},Tv=_0["react-stack-bottom-frame"].bind(_0),N0={"react-stack-bottom-frame":function(n){var l=n._init;return l(n._payload)}},lc=N0["react-stack-bottom-frame"].bind(N0),Wf=null,Sh=0,Qe=null,Ey,O0=Ey=!1,z0={},L0={},H0={};O=function(n,l,o){if(o!==null&&typeof o=="object"&&o._store&&(!o._store.validated&&o.key==null||o._store.validated===2)){if(typeof o._store!="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");o._store.validated=1;var c=X(n),f=c||"null";if(!z0[f]){z0[f]=!0,o=o._owner,n=n._debugOwner;var m="";n&&typeof n.tag=="number"&&(f=X(n))&&(m=`
|
|
292
|
+
|
|
293
|
+
Check the render method of \``+f+"`."),m||c&&(m=`
|
|
294
|
+
|
|
295
|
+
Check the top-level render call using <`+c+">.");var b="";o!=null&&n!==o&&(c=null,typeof o.tag=="number"?c=X(o):typeof o.name=="string"&&(c=o.name),c&&(b=" It was passed a child from "+c+".")),oe(l,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',m,b)})}}};var zr=qm(!0),U0=qm(!1),Ff=Re(null),cg=Re(0),Qa=Re(null),No=null,Pf=1,Ah=2,En=Re(0),Za=0,Ia=1,Cl=2,Xn=4,jn=8,kv=typeof AbortController<"u"?AbortController:function(){var n=[],l=this.signal={aborted:!1,addEventListener:function(o,c){n.push(c)}};this.abort=function(){l.aborted=!0,n.forEach(function(o){return o()})}},Bv=Ut.unstable_scheduleCallback,wv=Ut.unstable_NormalPriority,Sn={$$typeof:vl,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},Ch=null,jy=0,Lr=0,em=null,V0=W.S;W.S=function(n,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&gx(n,l),V0!==null&&V0(n,l)};var Hr=Re(null),tm,q0=new Set,G0=new Set,Sy=new Set,Y0=new Set,ac=0,Oe=null,xt=null,dn=null,rg=!1,nm=!1,Ur=!1,dg=0,Th=0,qi=null,Dv=0,Mv=25,F=null,$a=null,Gi=-1,kh=!1,Ay=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},Oo={readContext:gt,use:us,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt};Oo.useCacheRefresh=Mt,Oo.useMemoCache=Mt,Oo.useHostTransitionStatus=Mt,Oo.useFormState=Mt,Oo.useActionState=Mt,Oo.useOptimistic=Mt;var sc=null,Vr=null,oc=null,qr=null,Ul=null,Tl=null,ic=null;sc={readContext:function(n){return gt(n)},use:us,useCallback:function(n,l){return F="useCallback",Ze(),ni(l),wd(n,l)},useContext:function(n){return F="useContext",Ze(),gt(n)},useEffect:function(n,l){return F="useEffect",Ze(),ni(l),no(n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",Ze(),ni(o),xu(n,l,o)},useInsertionEffect:function(n,l){F="useInsertionEffect",Ze(),ni(l),to(4,Cl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",Ze(),ni(l),pu(n,l)},useMemo:function(n,l){F="useMemo",Ze(),ni(l);var o=W.H;W.H=Ul;try{return Dd(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",Ze();var c=W.H;W.H=Ul;try{return Fs(n,l,o)}finally{W.H=c}},useRef:function(n){return F="useRef",Ze(),ii(n)},useState:function(n){F="useState",Ze();var l=W.H;W.H=Ul;try{return yn(n)}finally{W.H=l}},useDebugValue:function(){F="useDebugValue",Ze()},useDeferredValue:function(n,l){return F="useDeferredValue",Ze(),gu(n,l)},useTransition:function(){return F="useTransition",Ze(),Kl()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",Ze(),Fn(n,l,o)},useId:function(){return F="useId",Ze(),Jm()},useCacheRefresh:function(){return F="useCacheRefresh",Ze(),Wm()}},sc.useMemoCache=ln,sc.useHostTransitionStatus=ui,sc.useFormState=function(n,l){return F="useFormState",Ze(),Oc(),ba(n,l)},sc.useActionState=function(n,l){return F="useActionState",Ze(),ba(n,l)},sc.useOptimistic=function(n){return F="useOptimistic",Ze(),$t(n)},Vr={readContext:function(n){return gt(n)},use:us,useCallback:function(n,l){return F="useCallback",ye(),wd(n,l)},useContext:function(n){return F="useContext",ye(),gt(n)},useEffect:function(n,l){return F="useEffect",ye(),no(n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",ye(),xu(n,l,o)},useInsertionEffect:function(n,l){F="useInsertionEffect",ye(),to(4,Cl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",ye(),pu(n,l)},useMemo:function(n,l){F="useMemo",ye();var o=W.H;W.H=Ul;try{return Dd(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",ye();var c=W.H;W.H=Ul;try{return Fs(n,l,o)}finally{W.H=c}},useRef:function(n){return F="useRef",ye(),ii(n)},useState:function(n){F="useState",ye();var l=W.H;W.H=Ul;try{return yn(n)}finally{W.H=l}},useDebugValue:function(){F="useDebugValue",ye()},useDeferredValue:function(n,l){return F="useDeferredValue",ye(),gu(n,l)},useTransition:function(){return F="useTransition",ye(),Kl()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",ye(),Fn(n,l,o)},useId:function(){return F="useId",ye(),Jm()},useCacheRefresh:function(){return F="useCacheRefresh",ye(),Wm()}},Vr.useMemoCache=ln,Vr.useHostTransitionStatus=ui,Vr.useFormState=function(n,l){return F="useFormState",ye(),Oc(),ba(n,l)},Vr.useActionState=function(n,l){return F="useActionState",ye(),ba(n,l)},Vr.useOptimistic=function(n){return F="useOptimistic",ye(),$t(n)},oc={readContext:function(n){return gt(n)},use:us,useCallback:function(n,l){return F="useCallback",ye(),va(n,l)},useContext:function(n){return F="useContext",ye(),gt(n)},useEffect:function(n,l){F="useEffect",ye(),Kt(2048,jn,n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",ye(),Vc(n,l,o)},useInsertionEffect:function(n,l){return F="useInsertionEffect",ye(),Kt(4,Cl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",ye(),Kt(4,Xn,n,l)},useMemo:function(n,l){F="useMemo",ye();var o=W.H;W.H=Tl;try{return rs(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",ye();var c=W.H;W.H=Tl;try{return cs(n,l,o)}finally{W.H=c}},useRef:function(){return F="useRef",ye(),tt().memoizedState},useState:function(){F="useState",ye();var n=W.H;W.H=Tl;try{return cs(Tn)}finally{W.H=n}},useDebugValue:function(){F="useDebugValue",ye()},useDeferredValue:function(n,l){return F="useDeferredValue",ye(),$m(n,l)},useTransition:function(){return F="useTransition",ye(),Vt()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",ye(),xa(n,l,o)},useId:function(){return F="useId",ye(),tt().memoizedState},useCacheRefresh:function(){return F="useCacheRefresh",ye(),tt().memoizedState}},oc.useMemoCache=ln,oc.useHostTransitionStatus=ui,oc.useFormState=function(n){return F="useFormState",ye(),Oc(),Uc(n)},oc.useActionState=function(n){return F="useActionState",ye(),Uc(n)},oc.useOptimistic=function(n,l){return F="useOptimistic",ye(),Pe(n,l)},qr={readContext:function(n){return gt(n)},use:us,useCallback:function(n,l){return F="useCallback",ye(),va(n,l)},useContext:function(n){return F="useContext",ye(),gt(n)},useEffect:function(n,l){F="useEffect",ye(),Kt(2048,jn,n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",ye(),Vc(n,l,o)},useInsertionEffect:function(n,l){return F="useInsertionEffect",ye(),Kt(4,Cl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",ye(),Kt(4,Xn,n,l)},useMemo:function(n,l){F="useMemo",ye();var o=W.H;W.H=ic;try{return rs(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",ye();var c=W.H;W.H=ic;try{return kn(n,l,o)}finally{W.H=c}},useRef:function(){return F="useRef",ye(),tt().memoizedState},useState:function(){F="useState",ye();var n=W.H;W.H=ic;try{return kn(Tn)}finally{W.H=n}},useDebugValue:function(){F="useDebugValue",ye()},useDeferredValue:function(n,l){return F="useDeferredValue",ye(),Md(n,l)},useTransition:function(){return F="useTransition",ye(),Gc()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",ye(),xa(n,l,o)},useId:function(){return F="useId",ye(),tt().memoizedState},useCacheRefresh:function(){return F="useCacheRefresh",ye(),tt().memoizedState}},qr.useMemoCache=ln,qr.useHostTransitionStatus=ui,qr.useFormState=function(n){return F="useFormState",ye(),Oc(),si(n)},qr.useActionState=function(n){return F="useActionState",ye(),si(n)},qr.useOptimistic=function(n,l){return F="useOptimistic",ye(),Il(n,l)},Ul={readContext:function(n){return T(),gt(n)},use:function(n){return C(),us(n)},useCallback:function(n,l){return F="useCallback",C(),Ze(),wd(n,l)},useContext:function(n){return F="useContext",C(),Ze(),gt(n)},useEffect:function(n,l){return F="useEffect",C(),Ze(),no(n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",C(),Ze(),xu(n,l,o)},useInsertionEffect:function(n,l){F="useInsertionEffect",C(),Ze(),to(4,Cl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",C(),Ze(),pu(n,l)},useMemo:function(n,l){F="useMemo",C(),Ze();var o=W.H;W.H=Ul;try{return Dd(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",C(),Ze();var c=W.H;W.H=Ul;try{return Fs(n,l,o)}finally{W.H=c}},useRef:function(n){return F="useRef",C(),Ze(),ii(n)},useState:function(n){F="useState",C(),Ze();var l=W.H;W.H=Ul;try{return yn(n)}finally{W.H=l}},useDebugValue:function(){F="useDebugValue",C(),Ze()},useDeferredValue:function(n,l){return F="useDeferredValue",C(),Ze(),gu(n,l)},useTransition:function(){return F="useTransition",C(),Ze(),Kl()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",C(),Ze(),Fn(n,l,o)},useId:function(){return F="useId",C(),Ze(),Jm()},useCacheRefresh:function(){return F="useCacheRefresh",Ze(),Wm()},useMemoCache:function(n){return C(),ln(n)}},Ul.useHostTransitionStatus=ui,Ul.useFormState=function(n,l){return F="useFormState",C(),Ze(),ba(n,l)},Ul.useActionState=function(n,l){return F="useActionState",C(),Ze(),ba(n,l)},Ul.useOptimistic=function(n){return F="useOptimistic",C(),Ze(),$t(n)},Tl={readContext:function(n){return T(),gt(n)},use:function(n){return C(),us(n)},useCallback:function(n,l){return F="useCallback",C(),ye(),va(n,l)},useContext:function(n){return F="useContext",C(),ye(),gt(n)},useEffect:function(n,l){F="useEffect",C(),ye(),Kt(2048,jn,n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",C(),ye(),Vc(n,l,o)},useInsertionEffect:function(n,l){return F="useInsertionEffect",C(),ye(),Kt(4,Cl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",C(),ye(),Kt(4,Xn,n,l)},useMemo:function(n,l){F="useMemo",C(),ye();var o=W.H;W.H=Tl;try{return rs(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",C(),ye();var c=W.H;W.H=Tl;try{return cs(n,l,o)}finally{W.H=c}},useRef:function(){return F="useRef",C(),ye(),tt().memoizedState},useState:function(){F="useState",C(),ye();var n=W.H;W.H=Tl;try{return cs(Tn)}finally{W.H=n}},useDebugValue:function(){F="useDebugValue",C(),ye()},useDeferredValue:function(n,l){return F="useDeferredValue",C(),ye(),$m(n,l)},useTransition:function(){return F="useTransition",C(),ye(),Vt()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",C(),ye(),xa(n,l,o)},useId:function(){return F="useId",C(),ye(),tt().memoizedState},useCacheRefresh:function(){return F="useCacheRefresh",ye(),tt().memoizedState},useMemoCache:function(n){return C(),ln(n)}},Tl.useHostTransitionStatus=ui,Tl.useFormState=function(n){return F="useFormState",C(),ye(),Uc(n)},Tl.useActionState=function(n){return F="useActionState",C(),ye(),Uc(n)},Tl.useOptimistic=function(n,l){return F="useOptimistic",C(),ye(),Pe(n,l)},ic={readContext:function(n){return T(),gt(n)},use:function(n){return C(),us(n)},useCallback:function(n,l){return F="useCallback",C(),ye(),va(n,l)},useContext:function(n){return F="useContext",C(),ye(),gt(n)},useEffect:function(n,l){F="useEffect",C(),ye(),Kt(2048,jn,n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",C(),ye(),Vc(n,l,o)},useInsertionEffect:function(n,l){return F="useInsertionEffect",C(),ye(),Kt(4,Cl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",C(),ye(),Kt(4,Xn,n,l)},useMemo:function(n,l){F="useMemo",C(),ye();var o=W.H;W.H=Tl;try{return rs(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",C(),ye();var c=W.H;W.H=Tl;try{return kn(n,l,o)}finally{W.H=c}},useRef:function(){return F="useRef",C(),ye(),tt().memoizedState},useState:function(){F="useState",C(),ye();var n=W.H;W.H=Tl;try{return kn(Tn)}finally{W.H=n}},useDebugValue:function(){F="useDebugValue",C(),ye()},useDeferredValue:function(n,l){return F="useDeferredValue",C(),ye(),Md(n,l)},useTransition:function(){return F="useTransition",C(),ye(),Gc()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",C(),ye(),xa(n,l,o)},useId:function(){return F="useId",C(),ye(),tt().memoizedState},useCacheRefresh:function(){return F="useCacheRefresh",ye(),tt().memoizedState},useMemoCache:function(n){return C(),ln(n)}},ic.useHostTransitionStatus=ui,ic.useFormState=function(n){return F="useFormState",C(),ye(),si(n)},ic.useActionState=function(n){return F="useActionState",C(),ye(),si(n)},ic.useOptimistic=function(n,l){return F="useOptimistic",C(),ye(),Il(n,l)};var X0={},Q0=new Set,Z0=new Set,I0=new Set,$0=new Set,K0=new Set,J0=new Set,W0=new Set,F0=new Set,P0=new Set,eb=new Set;Object.freeze(X0);var Cy={isMounted:function(n){var l=Mn;if(l!==null&&Rl&&l.tag===1){var o=l.stateNode;o._warnedAboutRefsInRender||console.error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",X(l)||"A component"),o._warnedAboutRefsInRender=!0}return(n=n._reactInternals)?me(n)===n:!1},enqueueSetState:function(n,l,o){n=n._reactInternals;var c=Hn(n),f=gs(c);f.payload=l,o!=null&&(_d(o),f.callback=o),l=ys(n,f,c),l!==null&&(ft(l,n,c),Wc(l,n,c)),Zn(n,c)},enqueueReplaceState:function(n,l,o){n=n._reactInternals;var c=Hn(n),f=gs(c);f.tag=rb,f.payload=l,o!=null&&(_d(o),f.callback=o),l=ys(n,f,c),l!==null&&(ft(l,n,c),Wc(l,n,c)),Zn(n,c)},enqueueForceUpdate:function(n,l){n=n._reactInternals;var o=Hn(n),c=gs(o);c.tag=db,l!=null&&(_d(l),c.callback=l),l=ys(n,c,o),l!==null&&(ft(l,n,o),Wc(l,n,o)),Se!==null&&typeof Se.markForceUpdateScheduled=="function"&&Se.markForceUpdateScheduled(n,o)}},fg=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},lm=null,Ty=null,tb=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),On=!1,nb={},lb={},ab={},sb={},am=!1,ob={},ky={},By={dehydrated:null,treeContext:null,retryLane:0},ib=!1,wy=Re(null),Dy=Re(null),ub={},mg=null,sm=null,om=!1,cb=0,rb=1,db=2,My=3,uc=!1,fb=!1,_y=null,Ny=!1,mb=null;mb=new Set;var Yi=!1,Gt=!1,Oy=!1,pb=typeof WeakSet=="function"?WeakSet:Set,zn=null,im=null,um=null,hb=!1,fn=null,sa=!1,Us=null,Bh=8192,xb=!1;try{var gb=Object.preventExtensions({})}catch{xb=!0}var _v={getCacheForType:function(n){var l=gt(Sn),o=l.data.get(n);return o===void 0&&(o=n(),l.data.set(n,o)),o},getOwner:function(){return Mn}};if(typeof Symbol=="function"&&Symbol.for){var wh=Symbol.for;wh("selector.component"),wh("selector.has_pseudo_class"),wh("selector.role"),wh("selector.test_id"),wh("selector.text")}var Nv=[],Ov=typeof WeakMap=="function"?WeakMap:Map,oa=0,kl=2,Xi=4,Qi=0,Dh=1,cm=2,zy=3,Gr=4,yb=5,pg=6,Bt=oa,vt=null,Ke=null,Je=0,Vl=0,Mh=1,Yr=2,_h=3,bb=4,Ly=5,rm=6,Nh=7,Hy=8,Rt=Vl,ia=null,Zi=!1,dm=!1,Uy=!1,zo=0,Yt=Qi,cc=0,rc=0,Vy=0,ua=0,Xr=0,Oh=null,Vs=null,hg=!1,qy=0,vb=300,xg=1/0,Rb=500,zh=null,dc=null,gg=!1,Qr=null,Lh=0,Gy=0,Yy=null,zv=50,Hh=0,Xy=null,Qy=!1,yg=!1,Lv=50,Zr=0,Uh=null,fm=!1,Eb=0,Hv=1,Uv=2,bg=null,jb=!1,Sb=new Set,Vv={},vg=null,mm=null,Zy=!1,Iy=!1,Rg=!1,$y=!1,Ir=0,Ky={};(function(){for(var n=0;n<b0.length;n++){var l=b0[n],o=l.toLowerCase();l=l[0].toUpperCase()+l.slice(1),ul(o,"on"+l)}ul(p0,"onAnimationEnd"),ul(h0,"onAnimationIteration"),ul(x0,"onAnimationStart"),ul("dblclick","onDoubleClick"),ul("focusin","onFocus"),ul("focusout","onBlur"),ul(Rv,"onTransitionRun"),ul(Ev,"onTransitionStart"),ul(jv,"onTransitionCancel"),ul(g0,"onTransitionEnd")})(),da("onMouseEnter",["mouseout","mouseover"]),da("onMouseLeave",["mouseout","mouseover"]),da("onPointerEnter",["pointerout","pointerover"]),da("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Jy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vh)),Eg="_reactListening"+Math.random().toString(36).slice(2),Ab=!1,Cb=!1,jg=!1,Tb=!1,Sg=!1,Ag=!1,kb=!1,Cg={},qv=/\r\n?/g,Gv=/\u0000|\uFFFD/g,$r="http://www.w3.org/1999/xlink",Wy="http://www.w3.org/XML/1998/namespace",Yv="javascript:throw new Error('React form unexpectedly submitted.')",Xv="suppressHydrationWarning",Tg="$",kg="/$",Kr="$?",Jr="$!",Fy="F!",Bb="F",Qv="style",Ii=0,pm=1,Bg=2,Py=null,e0=null,wb={dialog:!0,webview:!0},t0=null,Db=typeof setTimeout=="function"?setTimeout:void 0,Zv=typeof clearTimeout=="function"?clearTimeout:void 0,n0=-1,Mb=typeof Promise=="function"?Promise:void 0,Iv=typeof queueMicrotask=="function"?queueMicrotask:typeof Mb<"u"?function(n){return Mb.resolve(null).then(n).catch(Fe)}:Db,Wr=0,qh=1,_b=2,Nb=3,Ka=4,Ja=new Map,Ob=new Set,$i=ht.d;ht.d={f:function(){var n=$i.f(),l=ml();return n||l},r:function(n){var l=ql(n);l!==null&&l.tag===5&&l.type==="form"?ds(l):$i.r(n)},D:function(n){$i.D(n),qu("dns-prefetch",n,null)},C:function(n,l){$i.C(n,l),qu("preconnect",n,l)},L:function(n,l,o){$i.L(n,l,o);var c=hm;if(c&&n&&l){var f='link[rel="preload"][as="'+Bl(l)+'"]';l==="image"&&o&&o.imageSrcSet?(f+='[imagesrcset="'+Bl(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(f+='[imagesizes="'+Bl(o.imageSizes)+'"]')):f+='[href="'+Bl(n)+'"]';var m=f;switch(l){case"style":m=Ti(n);break;case"script":m=ki(n)}Ja.has(m)||(n=He({rel:"preload",href:l==="image"&&o&&o.imageSrcSet?void 0:n,as:l},o),Ja.set(m,n),c.querySelector(f)!==null||l==="style"&&c.querySelector(Pt(m))||l==="script"&&c.querySelector(xr(m))||(l=c.createElement("link"),kt(l,"link",n),Qt(l),c.head.appendChild(l)))}},m:function(n,l){$i.m(n,l);var o=hm;if(o&&n){var c=l&&typeof l.as=="string"?l.as:"script",f='link[rel="modulepreload"][as="'+Bl(c)+'"][href="'+Bl(n)+'"]',m=f;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ki(n)}if(!Ja.has(m)&&(n=He({rel:"modulepreload",href:n},l),Ja.set(m,n),o.querySelector(f)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(xr(m)))return}c=o.createElement("link"),kt(c,"link",n),Qt(c),o.head.appendChild(c)}}},X:function(n,l){$i.X(n,l);var o=hm;if(o&&n){var c=qo(o).hoistableScripts,f=ki(n),m=c.get(f);m||(m=o.querySelector(xr(f)),m||(n=He({src:n,async:!0},l),(l=Ja.get(f))&&go(n,l),m=o.createElement("script"),Qt(m),kt(m,"link",n),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(f,m))}},S:function(n,l,o){$i.S(n,l,o);var c=hm;if(c&&n){var f=qo(c).hoistableStyles,m=Ti(n);l=l||"default";var b=f.get(m);if(!b){var E={loading:Wr,preload:null};if(b=c.querySelector(Pt(m)))E.loading=qh|Ka;else{n=He({rel:"stylesheet",href:n,"data-precedence":l},o),(o=Ja.get(m))&&gr(n,o);var k=b=c.createElement("link");Qt(k),kt(k,"link",n),k._p=new Promise(function(w,I){k.onload=w,k.onerror=I}),k.addEventListener("load",function(){E.loading|=qh}),k.addEventListener("error",function(){E.loading|=_b}),E.loading|=Ka,Bi(b,l,c)}b={type:"stylesheet",instance:b,count:1,state:E},f.set(m,b)}}},M:function(n,l){$i.M(n,l);var o=hm;if(o&&n){var c=qo(o).hoistableScripts,f=ki(n),m=c.get(f);m||(m=o.querySelector(xr(f)),m||(n=He({src:n,async:!0,type:"module"},l),(l=Ja.get(f))&&go(n,l),m=o.createElement("script"),Qt(m),kt(m,"link",n),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(f,m))}}};var hm=typeof document>"u"?null:document,wg=null,Gh=null,l0=null,Dg=null,Fr=Pg,Yh={$$typeof:vl,Provider:null,Consumer:null,_currentValue:Fr,_currentValue2:Fr,_threadCount:0},zb="%c%s%c ",Lb="background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",Hb="",Mg=" ",Ub=Function.prototype.bind,Vb=!1,qb=null,Gb=null,Yb=null,Xb=null,Qb=null,Zb=null,Ib=null,$b=null,Kb=null;qb=function(n,l,o,c){l=r(n,l),l!==null&&(o=h(l.memoizedState,o,0,c),l.memoizedState=o,l.baseState=o,n.memoizedProps=He({},n.memoizedProps),o=xn(n,2),o!==null&&ft(o,n,2))},Gb=function(n,l,o){l=r(n,l),l!==null&&(o=v(l.memoizedState,o,0),l.memoizedState=o,l.baseState=o,n.memoizedProps=He({},n.memoizedProps),o=xn(n,2),o!==null&&ft(o,n,2))},Yb=function(n,l,o,c){l=r(n,l),l!==null&&(o=x(l.memoizedState,o,c),l.memoizedState=o,l.baseState=o,n.memoizedProps=He({},n.memoizedProps),o=xn(n,2),o!==null&&ft(o,n,2))},Xb=function(n,l,o){n.pendingProps=h(n.memoizedProps,l,0,o),n.alternate&&(n.alternate.pendingProps=n.pendingProps),l=xn(n,2),l!==null&&ft(l,n,2)},Qb=function(n,l){n.pendingProps=v(n.memoizedProps,l,0),n.alternate&&(n.alternate.pendingProps=n.pendingProps),l=xn(n,2),l!==null&&ft(l,n,2)},Zb=function(n,l,o){n.pendingProps=x(n.memoizedProps,l,o),n.alternate&&(n.alternate.pendingProps=n.pendingProps),l=xn(n,2),l!==null&&ft(l,n,2)},Ib=function(n){var l=xn(n,2);l!==null&&ft(l,n,2)},$b=function(n){A=n},Kb=function(n){R=n};var _g=!0,Ng=null,a0=!1,fc=null,mc=null,pc=null,Xh=new Map,Qh=new Map,hc=[],$v="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" "),Og=null;if(Zu.prototype.render=$p.prototype.render=function(n,l){var o=this._internalRoot;if(o===null)throw Error("Cannot update an unmounted root.");typeof l=="function"?console.error("does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):P(l)?console.error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):typeof l<"u"&&console.error("You passed a second argument to root.render(...) but it only accepts one argument."),l=o.current;var c=Hn(l);Gp(l,c,n,o,null,null)},Zu.prototype.unmount=$p.prototype.unmount=function(n){if(typeof n=="function"&&console.error("does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."),n=this._internalRoot,n!==null){this._internalRoot=null;var l=n.containerInfo;(Bt&(kl|Xi))!==oa&&console.error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),Gx(null,n,null,null),ml(),l[Co]=null}},Zu.prototype.unstable_scheduleHydration=function(n){if(n){var l=gc();n={blockedOn:null,target:n,priority:l};for(var o=0;o<hc.length&&l!==0&&l<hc[o].priority;o++);hc.splice(o,0,n),o===0&&bo(n)}},function(){var n=Jp.version;if(n!=="19.0.0")throw Error(`Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
|
|
296
|
+
- react: `+(n+`
|
|
297
|
+
- react-dom: 19.0.0
|
|
298
|
+
Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"),ht.findDOMNode=function(n){var l=n._reactInternals;if(l===void 0)throw typeof n.render=="function"?Error("Unable to find node on an unmounted component."):(n=Object.keys(n).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+n));return n=re(l),n=n!==null?Ae(n):null,n=n===null?null:n.stateNode,n},!function(){var n={bundleType:1,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:W,findFiberByHostInstance:ra,reconcilerVersion:"19.0.0"};return n.overrideHookState=qb,n.overrideHookStateDeletePath=Gb,n.overrideHookStateRenamePath=Yb,n.overrideProps=Xb,n.overridePropsDeletePath=Qb,n.overridePropsRenamePath=Zb,n.scheduleUpdate=Ib,n.setErrorHandler=$b,n.setSuspenseHandler=Kb,n.scheduleRefresh=q,n.scheduleRoot=Z,n.setRefreshHandler=Y,n.getCurrentFiber=Yp,n.getLaneLabelMap=Kg,n.injectProfilingHooks=ed,Pr(n)}()&&ll&&window.top===window.self&&(-1<navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Edge")===-1||-1<navigator.userAgent.indexOf("Firefox"))){var Jb=window.location.protocol;/^(https?|file):$/.test(Jb)&&console.info("%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools"+(Jb==="file:"?`
|
|
299
|
+
You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}reactDomClient_development.createRoot=function(n,l){if(!P(n))throw Error("Target container is not a DOM element.");Kp(n);var o=!1,c="",f=Xc,m=tp,b=hs,E=null;return l!=null&&(l.hydrate?console.warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof l=="object"&&l!==null&&l.$$typeof===vo&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
|
|
300
|
+
|
|
301
|
+
let root = createRoot(domContainer);
|
|
302
|
+
root.render(<App />);`),l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(c=l.identifierPrefix),l.onUncaughtError!==void 0&&(f=l.onUncaughtError),l.onCaughtError!==void 0&&(m=l.onCaughtError),l.onRecoverableError!==void 0&&(b=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(E=l.unstable_transitionCallbacks)),l=Vp(n,1,!1,null,null,o,c,f,m,b,E,null),n[Co]=l.current,ff(n.nodeType===8?n.parentNode:n),new $p(l)},reactDomClient_development.hydrateRoot=function(n,l,o){if(!P(n))throw Error("Target container is not a DOM element.");Kp(n),l===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var c=!1,f="",m=Xc,b=tp,E=hs,k=null,w=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(m=o.onUncaughtError),o.onCaughtError!==void 0&&(b=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(k=o.unstable_transitionCallbacks),o.formState!==void 0&&(w=o.formState)),l=Vp(n,1,!0,l,o??null,c,f,m,b,E,k,w),l.context=qp(null),o=l.current,c=Hn(o),f=gs(c),f.callback=null,ys(o,f,c),l.current.lanes=c,mn(l,c),ea(l),n[Co]=l.current,ff(n),new Zu(l)},reactDomClient_development.version="19.0.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),reactDomClient_development}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client.exports;hasRequiredClient=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(h){console.error(h)}}}return process.env.NODE_ENV==="production"?(r(),client.exports=requireReactDomClient_production()):client.exports=requireReactDomClient_development(),client.exports}var clientExports=requireClient();const getSvgMarkup=r=>{try{const h=document.getElementById("icon-picker-field"),x=document.createElement("div");clientExports.createRoot(x).render(jsxRuntime.jsxRuntimeExports.jsx(IconPicker.IconPickerItem,{value:r})),h.appendChild(x),x.hidden=!0;const v=x.innerHTML;setTimeout(()=>h.removeChild(x),100);const A=new DOMParser().parseFromString(v,"image/svg+xml"),j=A.querySelector("svg");return j&&(j.removeAttribute("width"),j.removeAttribute("height")),new XMLSerializer().serializeToString(A)}catch(h){return console.error(h),""}},IconPickerField=({value:r,onChange:h})=>{const{t:x}=reactI18next.useTranslation(),g=v=>{h("<svg />");const R=getSvgMarkup(v);h(R)};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r?r.replace("<svg",'<svg class="h-5 w-5"'):"<svg class='h-5 w-5' />"},className:"absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"}),jsxRuntime.jsxRuntimeExports.jsx(IconPicker,{value:r||"BiSolidGrid",onChange:g,pickButtonStyle:{position:"relative",height:"48px",width:"48px",border:"1px solid #999",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",backgroundColor:"transparent",zIndex:1},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),jsxRuntime.jsxRuntimeExports.jsx("textarea",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",value:r,onChange:v=>h(v.target.value),placeholder:x("Choose Icon or SVG"),className:"no-scrollbar disabled:opacity-50; mt-1 flex 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"})]})},MediaManagerModal=({children:r,onSelect:h})=>{const[x,g]=React.useState(!1),v=useBuilderProp("mediaManagerComponent",null),R=(...A)=>{h.call(void 0,...A),g(!1)};return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Dialog,{open:x,onOpenChange:A=>g(A),children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DialogTrigger,{asChild:!0,children:r}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DialogContent,{className:"flex h-3/4 max-w-5xl border-border",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:jsxRuntime.jsxRuntimeExports.jsx(v,{onSelect:R})})})]})};MediaManagerModal.displayName="MediaManagerModal";const ImagePickerField=({value:r,onChange:h,id:x,onBlur:g})=>{const v=useBuilderProp("mediaManagerComponent",null),{t:R}=reactI18next.useTranslation(),A=v!==null;return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[r?jsxRuntime.jsxRuntimeExports.jsx("img",{src:r,className:"h-20 w-20 overflow-hidden rounded-md border border-border object-cover",alt:""}):jsxRuntime.jsxRuntimeExports.jsx(MediaManagerModal,{onSelect:h,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-20 w-20 cursor-pointer rounded-md border border-border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px]"})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[A&&jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(MediaManagerModal,{onSelect:h,children:jsxRuntime.jsxRuntimeExports.jsx("small",{className:"h-6 cursor-pointer rounded-md bg-primary px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:r||!lodashEs.isEmpty(r)?R("Replace image"):R("Choose image")})}),jsxRuntime.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"})]}),jsxRuntime.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",type:"url",className:"text-xs",placeholder:R("Enter image URL"),value:r,onBlur:({target:{value:j}})=>g(x,j),onChange:j=>h(j.target.value)})]})]})},RichTextEditorField=({id:r,placeholder:h,value:x,onChange:g,onBlur:v})=>{const R={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},A=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:jsxRuntime.jsxRuntimeExports.jsx(ReactQuill,{id:r,value:x,onBlur:j=>v(r,j),onChange:j=>g(j),modules:R,formats:A,placeholder:h,className:"mt-1 rounded-md"})},PageTypeField=({href:r,pageTypes:h,onChange:x})=>{var Me;const{t:g}=reactI18next.useTranslation(),v=useBuilderProp("searchPageTypeItems",(J,xe)=>[]),[R,A]=React.useState(!1),[j,C]=React.useState(!1),[T,M]=React.useState("page"),[O,z]=React.useState(""),[Z,q]=React.useState([]),[Y,P]=React.useState(-1),he=React.useRef(null),te=(Me=h==null?void 0:h.find(J=>J.key===T))==null?void 0:Me.name;React.useEffect(()=>{if(z(""),q([]),P(-1),C(!1),!r||R||!lodashEs.startsWith(r,"pageType:"))return;const J=lodashEs.split(r,":"),xe=lodashEs.get(J,1,"page")||"page";M(xe),(async()=>{const be=await v(xe,[lodashEs.get(J,2,"page")]);be&&Array.isArray(be)&&z(lodashEs.get(be,[0,"name"],""))})()},[r]);const ue=web.useDebouncedCallback(async J=>{if(lodashEs.isEmpty(J))q([]);else{const xe=await v(T,J);q(xe)}A(!1),P(-1)},[T],300),X=J=>{const xe=["pageType",T,J.id];xe[1]&&(x(xe.join(":")),z(J.name),C(!1),q([]),P(-1))},se=J=>{switch(J.key){case"ArrowDown":J.preventDefault(),P(xe=>xe<Z.length-1?xe+1:xe);break;case"ArrowUp":J.preventDefault(),P(xe=>xe>0?xe-1:xe);break;case"Enter":if(J.preventDefault(),Z.length===0)return;Y>=0&&X(Z[Y]);break;case"Escape":J.preventDefault(),pe();break}};React.useEffect(()=>{if(Y>=0&&he.current){const J=he.current.children[Y];J==null||J.scrollIntoView({block:"nearest"})}},[Y]);const pe=()=>{z(""),q([]),P(-1),C(!1),x("")},ve=J=>{z(J),C(!lodashEs.isEmpty(J)),A(!0),ue(J)};return jsxRuntime.jsxRuntimeExports.jsxs("div",{children:[jsxRuntime.jsxRuntimeExports.jsx("select",{name:"pageType",value:T,onChange:J=>M(J.target.value),children:lodashEs.map(h,J=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:J.key,children:J.name},J.key))}),T&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative mt-2 flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx("input",{type:"text",value:O,onChange:J=>ve(J.target.value),onKeyDown:se,placeholder:g(`Search ${te??""}`),className:"w-full rounded-md border border-gray-300 p-2 pr-16"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute bottom-2 right-2 top-3 flex items-center gap-1.5",children:O&&jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:pe,className:"text-gray-400 hover:text-gray-600",title:g("Clear search"),children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.X,{className:"h-4 w-4"})})})]}),(R||!lodashEs.isEmpty(Z)||j&&lodashEs.isEmpty(Z))&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute z-40 mt-2 max-h-40 w-full overflow-y-auto rounded-md border border-border bg-background shadow-lg",children:R?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-1 p-2",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"})]}):j&&lodashEs.isEmpty(Z)?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center p-4 text-sm text-gray-500",children:[g("No results found for"),' "',O,'"']}):jsxRuntime.jsxRuntimeExports.jsx("ul",{ref:he,children:lodashEs.map(Z==null?void 0:Z.slice(0,20),(J,xe)=>jsxRuntime.jsxRuntimeExports.jsxs("li",{onClick:()=>X(J),className:`cursor-pointer p-2 text-xs ${r!=null&&r.includes(J.id)?"bg-blue-200":xe===Y?"bg-gray-100":"hover:bg-gray-100"}`,children:[J.name," ",J.slug&&jsxRuntime.jsxRuntimeExports.jsxs("small",{className:"font-light text-gray-500",children:["( ",J.slug," )"]})]},J.id))})})]})},LinkField=({schema:r,formData:h,onChange:x})=>{const{t:g}=reactI18next.useTranslation(),{type:v="pageType",href:R="",target:A="self"}=h,j=useBuilderProp("pageTypes",[]),C=v==="pageType"&&lodashEs.isEmpty(j)?"url":v;return jsxRuntime.jsxRuntimeExports.jsxs("div",{children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(r==null?void 0:r.title)??"Link"}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[jsxRuntime.jsxRuntimeExports.jsx("select",{name:"type",value:v,onChange:T=>x({...h,type:T.target.value}),children:lodashEs.map([...lodashEs.isEmpty(j)?[]:[{const:"pageType",title:g("Goto Page")}],{const:"url",title:g("Open URL")},{const:"email",title:g("Compose Email")},{const:"telephone",title:g("Call Phone")},{const:"scroll",title:g("Scroll to element")}],T=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:T.const,children:T.title},T.const))}),C==="pageType"&&!lodashEs.isEmpty(j)?jsxRuntime.jsxRuntimeExports.jsx(PageTypeField,{href:R,pageTypes:j,onChange:T=>x({...h,href:T})}):jsxRuntime.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",name:"href",type:"text",value:R,onChange:T=>x({...h,href:T.target.value}),placeholder:g(v==="url"?"Enter URL":v==="scroll"?"#ElementID":"Enter details")}),C==="url"&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx("input",{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",type:"checkbox",defaultChecked:A==="_blank",className:"!w-fit cursor-pointer rounded-md border border-border",onChange:()=>x({...h,target:A==="_blank"?"_self":"_blank"})}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:g("Open in new tab")})]})]})]})},RowColField=()=>{const r=useSelectedBlock(),h=useWrapperBlock(),{addCoreBlock:x}=useAddBlock();if(!r&&!h)return null;const g=(r==null?void 0:r._type)==="Row"?r:h;return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"pt-1",children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",className:"duratiom-300 flex items-center gap-x-1 rounded border border-gray-400 bg-gray-100 px-4 py-1 text-[11px] font-medium leading-tight hover:bg-slate-200",onClick:()=>x({type:"Column",styles:"#styles:,"},g==null?void 0:g._id),children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Plus,{className:"h-4 w-4"})," Add Column"]})})},CodeEditor=({id:r,placeholder:h})=>{const{t:x}=reactI18next.useTranslation(),[,g]=useCodeEditor(),v=useSelectedBlock();if(typeof window>"u")return null;const R=r.replace("root.",""),A=lodashEs.get(v,R,""),j=()=>{const C=v==null?void 0:v._id;g({blockId:C,blockProp:R,placeholder:h,initialCode:lodashEs.get(v,R,A)})};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex flex-col gap-y-1",children:[jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:j,className:"text-pretty w-[90%] max-w-full cursor-default truncate rounded border border-border bg-background p-2 text-left text-[10px]",children:A.trim().length>0?A.substring(0,46):h||"Eg: <script>console.log('Hello, world!');<\/script>"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:j,size:"sm",variant:"outline",className:"w-fit",children:x("Open code editor")})]})},CustomFieldTemplate=({id:r,classNames:h,label:x,children:g,errors:v,help:R,description:A,hidden:j,required:C,schema:T,formData:M})=>{const{selectedLang:O,fallbackLang:z,languages:Z}=useLanguages(),q=lodashEs.isEmpty(Z)?"":lodashEs.isEmpty(O)?z:O,Y=lodashEs.get(LANGUAGES,q,q),P=useSelectedBlock(),he=runtime.useRegisteredChaiBlocks(),te=lodashEs.get(he,[P==null?void 0:P._type,"i18nProps"],[])||[],[ue,X]=React.useState(null);if(j)return null;if(T.type==="boolean")return jsxRuntime.jsxRuntimeExports.jsx("div",{className:h,children:g});const pe=te==null?void 0:te.includes(r.replace("root.",""));if(T.type==="array"){const ve=ue===r;return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`${h} relative`,children:[T.title&&jsxRuntime.jsxRuntimeExports.jsxs("label",{htmlFor:r,onClick:()=>X(ve?null:r),className:"flex cursor-pointer items-center gap-x-1 py-1 leading-tight duration-200 hover:bg-slate-100",children:[ve?jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronDown,{className:"h-3 w-3"}):jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:"h-3 w-3"}),jsxRuntime.jsxRuntimeExports.jsx(lucideReact.List,{className:"h-3 w-3"}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"leading-tight",children:x})," ",jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Badge,{className:"m-0 bg-gray-200 px-2 leading-tight text-gray-500 hover:bg-gray-200 hover:text-gray-500",children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-[9px] font-medium text-slate-600",children:M==null?void 0:M.length})})]}),(M==null?void 0:M.length)===0?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-0 overflow-hidden",children:g}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`${ve?"pt-0.5":"h-0 overflow-hidden"}`,children:[A,g,v,R]})]})}return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:h,children:[T.title&&jsxRuntime.jsxRuntimeExports.jsxs("label",{htmlFor:r,className:T.type==="object"?"pb-2":"",children:[x," ",pe&&jsxRuntime.jsxRuntimeExports.jsxs("small",{className:"text-[9px] text-zinc-400",children:[" ",Y]}),C&&T.type!=="object"?" *":null]}),A,g,v,R]})},CustomAddButton=r=>jsxRuntime.jsxRuntimeExports.jsx("button",{...r,className:"duration absolute right-2 top-2 cursor-pointer text-blue-400 hover:text-blue-500",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-0.5 text-[11px] leading-tight",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Plus,{className:"h-3 w-3"})," ",jsxRuntime.jsxRuntimeExports.jsx("span",{children:"Add"})]})}),JSONForm=React.memo(({id:r,schema:h,uiSchema:x,formData:g,onChange:v})=>{const[R,A]=React.useState(g),{selectedLang:j}=useLanguages();React.useEffect(()=>{A(g)},[r,j]);const C=web.useThrottledCallback(async({formData:T},M)=>{v({formData:T},M)},[v,j],1e3);return jsxRuntime.jsxRuntimeExports.jsx(RjForm,{widgets:{binding:BindingWidget,richtext:RichTextEditorField,icon:IconPickerField,image:ImagePickerField,code:CodeEditor,colCount:RowColField},fields:{link:LinkField},templates:{FieldTemplate:CustomFieldTemplate,ButtonTemplates:{AddButton:CustomAddButton}},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator,uiSchema:x,schema:h,formData:R,onChange:({formData:T},M)=>{M&&(A(T),C({formData:T},M))}},j)}),formDataWithSelectedLang=(r,h,x)=>{const g=lodashEs.cloneDeep(r);return lodashEs.forEach(lodashEs.keys(r),v=>{lodashEs.includes(lodashEs.get(x,"i18nProps",[]),v)&&!lodashEs.isEmpty(h)&&(g[v]=lodashEs.get(r,`${v}-${h}`))}),g},convertDotNotationToObject=(r,h)=>{const x={};return lodashEs.set(x,r,h),x};function BlockSettings(){const{selectedLang:r}=useLanguages(),h=useSelectedBlock(),x=useUpdateBlocksPropsRealtime(),g=useUpdateBlocksProps(),v=runtime.getRegisteredChaiBlock(h==null?void 0:h._type),R=formDataWithSelectedLang(h,r,v),[A,j]=React.useState(R),[C,T]=React.useState(!1),M=useWrapperBlock(),O=runtime.getRegisteredChaiBlock(M==null?void 0:M._type),z=formDataWithSelectedLang(M,r,O),Z=({formData:se},pe,ve)=>{if(pe&&(A==null?void 0:A._id)===h._id){const Me=pe.replace("root.","");g([h._id],{[Me]:lodashEs.get(se,Me)},ve)}},q=React.useCallback(lodashEs.debounce(({formData:se},pe,ve)=>{Z({formData:se},pe,ve),j(se)},1500),[h==null?void 0:h._id,r]),Y=({formData:se},pe)=>{if(pe){const ve=pe.replace("root.","");x([h._id],convertDotNotationToObject(ve,lodashEs.get(se,ve.split(".")))),q({formData:se},pe,{[ve]:lodashEs.get(A,ve)})}},P=({formData:se},pe)=>{if(pe){const ve=pe.replace("root.","");x([M._id],convertDotNotationToObject(ve,lodashEs.get(se,ve.split(".")))),q({formData:se},pe,{[ve]:lodashEs.get(A,ve)})}};lodashEs.keys(lodashEs.get(R,"_bindings",{}));const{schema:he,uiSchema:te}=React.useMemo(()=>{const se=h==null?void 0:h._type;if(se)return runtime.getBlockFormSchemas(se)},[h]),{wrapperSchema:ue,wrapperUiSchema:X}=React.useMemo(()=>{if(!M||!(M!=null&&M._type))return{wrapperSchema:{},wrapperUiSchema:{}};const se=M==null?void 0:M._type,{schema:pe={},uiSchema:ve={}}=runtime.getBlockFormSchemas(se);return{wrapperSchema:pe,wrapperUiSchema:ve}},[M]);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar overflow-x-hidden px-px",children:[!lodashEs.isEmpty(M)&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mb-4 rounded border bg-zinc-100 px-1",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:()=>T(se=>!se),className:"flex cursor-pointer items-center gap-x-1 py-2 text-xs font-medium leading-tight hover:bg-slate-100",children:[C?jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 stroke-[3] text-slate-400"}):jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:"h-4 w-4 stroke-[3] text-slate-400"}),lodashEs.startCase(M._type)," settings"," ",M._name&&jsxRuntime.jsxRuntimeExports.jsxs("span",{className:"text-[11px] font-light text-slate-400",children:["(",M._name,")"]})]}),C&&jsxRuntime.jsxRuntimeExports.jsx(JSONForm,{id:M==null?void 0:M._id,onChange:P,formData:z,schema:ue,uiSchema:X})]}),lodashEs.isEmpty(he)?null:jsxRuntime.jsxRuntimeExports.jsx(JSONForm,{id:h==null?void 0:h._id,onChange:Y,formData:R,schema:he,uiSchema:te}),(h==null?void 0:h._type)==="GlobalBlock"?jsxRuntime.jsxRuntimeExports.jsx(GlobalBlockSettings,{}):null]})}function FaLanguage(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"},child:[]}]})(r)}function FaMoon(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"},child:[]}]})(r)}function FaRecycle(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"},child:[]}]})(r)}function FaSpinner(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"},child:[]}]})(r)}const SECONDS=10;function Countdown(){const[r,h]=React.useState(SECONDS),[x,g]=React.useState(!1);React.useEffect(()=>{if(x&&r>0){const C=setTimeout(()=>{h(r-.1)},100);return()=>clearTimeout(C)}else r<=0&&(g(!1),h(SECONDS))},[x,r]);const v=()=>{g(!0),h(SECONDS)};React.useEffect(()=>{r===SECONDS&&v()},[r]);const R=18,A=2*Math.PI*R,j=A*(1-(SECONDS-r)/SECONDS);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"relative h-4 w-4",children:[jsxRuntime.jsxRuntimeExports.jsxs("svg",{className:"h-full w-full",viewBox:"0 0 40 40",children:[jsxRuntime.jsxRuntimeExports.jsx("circle",{className:"text-gray-300",strokeWidth:"4",stroke:"currentColor",fill:"transparent",r:R,cx:"20",cy:"20"}),jsxRuntime.jsxRuntimeExports.jsx("circle",{className:"text-blue-600",strokeWidth:"4",strokeDasharray:A,strokeDashoffset:j,strokeLinecap:"round",stroke:"currentColor",fill:"transparent",r:R,cx:"20",cy:"20"})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-xs font-semibold",children:" "})})]})}const AskAIStyles=({blockId:r})=>{const{t:h}=reactI18next.useTranslation(),{askAi:x,loading:g,error:v}=useAskAi(),[R,A]=React.useState(""),j=React.useRef(null),C=React.useRef(null),[T,M]=React.useState();React.useEffect(()=>{var z;(z=j.current)==null||z.focus()},[]);const O=z=>{const{usage:Z}=z||{};!v&&Z&&M(Z),C.current=setTimeout(()=>M(void 0),1e4),v||A("")};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"",children:[jsxRuntime.jsxRuntimeExports.jsx("h2",{className:"mb-1 text-sm font-semibold leading-none tracking-tight",children:h("Ask AI")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{ref:j,value:R,onChange:z=>A(z.target.value),placeholder:h("Ask AI to edit styles"),className:"no-scrollbar my-2 w-full border border-border p-2 text-xs",rows:4,onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),C.current&&clearTimeout(C.current),M(void 0),x("styles",r,R,O))}}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"my-2 flex items-center gap-2",children:[g?null:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:R.trim().length<5||g,onClick:()=>{C.current&&clearTimeout(C.current),M(void 0),x("styles",r,R,O)},variant:"default",className:"w-fit",size:"sm",children:g?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"h-5 w-5 animate-spin"}),h("Generating... Please wait...")]}):h("Edit with AI")}),g?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Skeleton,{className:"flex w-full items-center space-x-1 px-4 py-1 pl-2",children:[jsxRuntime.jsxRuntimeExports.jsx(FaSpinner,{className:"h-4 w-4 animate-spin text-gray-500"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs",children:h("Generating... Please wait...")})]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"destructive",onClick:()=>stop(),className:"hidden w-fit",size:"sm",children:h("Stop")})]}):null]}),T?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:jsxRuntime.jsxRuntimeExports.jsxs("p",{className:"mb-1 flex justify-between break-words rounded border border-blue-500 bg-blue-100 p-1 text-xs text-blue-500",children:[jsxRuntime.jsxRuntimeExports.jsxs("span",{children:[h("Total tokens used"),": ",T.totalTokens]}),jsxRuntime.jsxRuntimeExports.jsx(Countdown,{})]})}):null,jsxRuntime.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:v&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:v.message})})]})};function ManualClasses(){var pe;const r=useFuseSearch(),{t:h}=reactI18next.useTranslation(),[x]=useSelectedStylingBlocks(),g=useSelectedBlock(),v=useAddClassesToBlocks(),R=useRemoveClassesFromBlocks(),[A]=useSelectedBlockIds(),j=useBuilderProp("askAiCallBack",null),[C,T]=React.useState(""),{toast:M}=contextMenu.useToast(),O=(pe=lodashEs.first(x))==null?void 0:pe.prop,z=lodashEs.reject((lodashEs.get(g,O,"").replace(STRINGS.STYLES_KEY,"").split(",").pop()||"").split(" "),lodashEs.isEmpty),Z=()=>{const ve=C.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");v(A,ve,!0),T("")},[q,Y]=React.useState([]),P=({value:ve})=>{const Me=ve.trim().toLowerCase(),J=Me.match(/.+:/g);let xe=[];if(J&&J.length>0){const[be]=J,ge=Me.replace(be,"");xe=r.search(ge).map(oe=>({...oe,item:{...oe.item,name:be+oe.item.name}}))}else xe=r.search(Me);return Y(lodashEs.map(xe,"item"))},he=()=>{Y([])},te=ve=>ve.name,ue=ve=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:ve.name}),X={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:h("Enter classes separated by space"),value:C,onKeyDown:ve=>{ve.key==="Enter"&&C.trim()!==""&&Z()},onChange:(ve,{newValue:Me})=>T(Me),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"},se=()=>{if(navigator.clipboard===void 0){M({title:h("Clipboard not supported"),description:h("Please use Chrome, Firefox or Safari"),variant:"destructive"});return}navigator.clipboard.writeText(z.join(" ")),M({title:h("Copied"),description:h("Classes copied to clipboard")})};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`flex ${q.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-1.5 overflow-y-auto pb-4`,children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between gap-x-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:h("Classes")}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CopyIcon,{onClick:se,className:"cursor-pointer"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:h("Copy classes to clipboard")})})]})]}),j?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Popover,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{variant:"default",className:"h-6 w-fit",size:"sm",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.SparklesIcon,{className:"h-4 w-4"}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"ml-2",children:h("Ask AI")})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.PopoverContent,{side:"left",className:"p-2",children:jsxRuntime.jsxRuntimeExports.jsx(AskAIStyles,{blockId:g==null?void 0:g._id})})]}):null]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"relative flex items-center gap-x-3",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:jsxRuntime.jsxRuntimeExports.jsx(Autosuggest,{suggestions:q,onSuggestionsFetchRequested:P,onSuggestionsClearRequested:he,getSuggestionValue:te,renderSuggestion:ue,inputProps:X,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-border text-xs"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"!bg-gray-300 dark:!bg-gray-800 cursor-pointer",suggestionsContainerOpen:"absolute bg-background no-scrollbar z-50 max-h-[230px] overflow-y-auto w-full border border-border rounded-md"}})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"outline",className:"h-6 border-border",onClick:Z,disabled:C.trim()==="",size:"sm",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.PlusIcon,{})})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-wrap gap-2 overflow-x-hidden",children:React__namespace.Children.toArray(z.map(ve=>jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate rounded border border-border bg-gray-200 p-px px-1.5 text-[11px] text-gray-600 hover:border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300",children:[ve,jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Cross2Icon,{onClick:()=>R(A,[ve]),className:"invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},ve)))})]})}const BASIC_UNITS=["px","%","em","rem","ch","vh","vw"],FLEX_CHILD_SECTION={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:BASIC_UNITS,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},GRID_CHILD_SECTION={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},SETTINGS_SECTIONS=[{heading:"Styles",items:[{component:ManualClasses},{type:"arbitrary",label:"layout.width",units:BASIC_UNITS.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:BASIC_UNITS.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...BASIC_UNITS,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"accordion",heading:"Typography",items:[{type:"dropdown",property:"textAlign",label:"typography.align"},{type:"dropdown",property:"fontFamily",label:"typography.font"},{type:"arbitrary",property:"fontSize",label:"typography.size",units:BASIC_UNITS},{type:"arbitrary",property:"lineHeight",label:"typography.height",units:BASIC_UNITS.concat("-")},{type:"range",property:"fontWeight",label:"typography.weight"},{type:"color",property:"textColor",label:"typography.color"}]},{styleType:"accordion",heading:"Background",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]}]}];BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("auto"),[...BASIC_UNITS],BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("auto"),BASIC_UNITS.concat("-");const EDITOR_ICONS={"not-italic":()=>jsxRuntime.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:reactIcons.EyeOpenIcon,invisible:reactIcons.EyeClosedIcon,hidden:reactIcons.EyeClosedIcon,gap:reactIcons.BorderAllIcon,gapX:reactIcons.WidthIcon,gapY:reactIcons.HeightIcon,spaceX:reactIcons.WidthIcon,spaceY:reactIcons.HeightIcon,overscroll:reactIcons.BorderAllIcon,overscrollX:reactIcons.WidthIcon,overscrollY:reactIcons.HeightIcon,overflow:reactIcons.BorderAllIcon,overflowX:reactIcons.WidthIcon,overflowY:reactIcons.HeightIcon,top:reactIcons.ArrowUpIcon,right:reactIcons.ArrowRightIcon,bottom:reactIcons.ArrowDownIcon,left:reactIcons.ArrowLeftIcon,inset:reactIcons.BorderAllIcon,insetX:reactIcons.WidthIcon,insetY:reactIcons.HeightIcon,border:reactIcons.BorderAllIcon,borderX:reactIcons.WidthIcon,borderY:reactIcons.HeightIcon,borderTop:reactIcons.ArrowUpIcon,borderRight:reactIcons.ArrowRightIcon,borderBottom:reactIcons.ArrowDownIcon,borderLeft:reactIcons.ArrowLeftIcon,borderRadius:reactIcons.BorderAllIcon,borderRadiusX:reactIcons.WidthIcon,borderRadiusY:reactIcons.HeightIcon,borderRadiusTop:reactIcons.ArrowUpIcon,borderRadiusRight:reactIcons.ArrowRightIcon,borderRadiusBottom:reactIcons.ArrowDownIcon,borderRadiusLeft:reactIcons.ArrowLeftIcon,borderRadiusTopLeft:reactIcons.ArrowTopLeftIcon,borderRadiusTopRight:reactIcons.ArrowTopRightIcon,borderRadiusBottomRight:reactIcons.ArrowBottomRightIcon,borderRadiusBottomLeft:reactIcons.ArrowBottomLeftIcon,divideXWidth:reactIcons.WidthIcon,divideYWidth:reactIcons.HeightIcon,scale:reactIcons.BorderAllIcon,scaleX:reactIcons.WidthIcon,scaleY:reactIcons.HeightIcon,skewX:reactIcons.WidthIcon,skewY:reactIcons.HeightIcon,translateX:reactIcons.WidthIcon,translateY:reactIcons.HeightIcon,padding:reactIcons.BorderAllIcon,paddingX:reactIcons.WidthIcon,paddingY:reactIcons.HeightIcon,paddingTop:reactIcons.ArrowUpIcon,paddingRight:reactIcons.ArrowRightIcon,paddingBottom:reactIcons.ArrowDownIcon,paddingLeft:reactIcons.ArrowLeftIcon,margin:reactIcons.BorderAllIcon,marginX:reactIcons.WidthIcon,marginY:reactIcons.HeightIcon,marginTop:reactIcons.ArrowUpIcon,marginRight:reactIcons.ArrowRightIcon,marginBottom:reactIcons.ArrowDownIcon,marginLeft:reactIcons.ArrowLeftIcon,textLeft:reactIcons.AlignLeftIcon,textCenter:reactIcons.AlignCenterHorizontallyIcon,textRight:reactIcons.AlignRightIcon,textJustify:reactIcons.StretchHorizontallyIcon,italic:reactIcons.FontItalicIcon,underline:reactIcons.UnderlineIcon,overline:reactIcons.OverlineIcon,uppercase:reactIcons.LetterCaseUppercaseIcon,block:()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":reactIcons.Cross2Icon,fixed:()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>jsxRuntime.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>jsxRuntime.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),jsxRuntime.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:reactIcons.Cross1Icon},StyleContext=React.createContext({canReset:!1,canChange:!0}),BlockStyleProvider=({children:r,canReset:h=!1,canChange:x=!0})=>jsxRuntime.jsxRuntimeExports.jsx(StyleContext.Provider,{value:{canReset:h,canChange:x},children:r}),DropDownChoices=({label:r,property:h,onChange:x})=>{const{getClasses:g}=useTailwindClassList(),v=g(h),R=useCurrentClassByProperty(h),A=React.useMemo(()=>lodashEs.get(R,"cls",""),[R]),{canChange:j}=React.useContext(StyleContext),C=/\[.*\]/g.test(A);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:r?"w-full rounded":"grow",children:C?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:A}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{delayDuration:100,children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InfoCircledIcon,{})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):jsxRuntime.jsxRuntimeExports.jsx(DropDown,{rounded:r,onChange:T=>x(T,h),selected:A,options:v,disabled:!j})})};function DropDown({selected:r,onChange:h,rounded:x=!1,options:g,disabled:v=!1}){const R=r.replace(/.*:/g,"").trim(),{undo:A,redo:j}=useUndoManager();return jsxRuntime.jsxRuntimeExports.jsxs("select",{disabled:!g.length||v,className:`${x?"rounded-md border border-border":"border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:C=>h(C.target.value),onKeyDown:C=>{C.ctrlKey&&(C.key==="z"&&A(),C.key==="y"&&j())},value:R,children:[jsxRuntime.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),React.Children.toArray(g.map(C=>jsxRuntime.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:C,children:C})))]})}const RangeChoices=({property:r,onChange:h})=>{const{canReset:x,canChange:g}=React.useContext(StyleContext),v=useCurrentClassByProperty(r),R=React.useMemo(()=>lodashEs.get(v,"cls",""),[v]),{getClasses:A}=useTailwindClassList(),j=A(r,[""]),C=j.indexOf(R)>-1?j.indexOf(R):0,T=/\[.*\]/g.test(R);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:T?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"px-2 py-[5px]",children:R}):jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"hover:bg-bg-gray-700 box-border w-2/12 rounded-bl rounded-tl bg-background px-1 text-center disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!g&&(!x||C-1<0),onClick:()=>h(lodashEs.nth(j,C-1),r),children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.MinusIcon,{className:!g&&(!x||C-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:jsxRuntime.jsxRuntimeExports.jsx(DropDownChoices,{label:!1,property:r,onChange:h})}),jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"hover:bg-bg-gray-700 w-2/12 rounded-br rounded-tr bg-background px-1 text-center disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!g&&(!x||C+1>=j.length),onClick:()=>h(lodashEs.nth(j,C+1),r),children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.PlusIcon,{className:!g&&(!x||C+1>=j.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},IconChoices=({property:r,onChange:h})=>{const{getClasses:x}=useTailwindClassList(),g=x(r),{canChange:v}=React.useContext(StyleContext),R=useCurrentClassByProperty(r),A=React.useMemo(()=>lodashEs.get(R,"cls",""),[R]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:lodashEs.map(g,j=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",disabled:!v,onClick:()=>h(j,r),className:`cursor-pointer rounded border border-border p-1 disabled:cursor-not-allowed ${A===j?"bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:React.createElement(lodashEs.get(EDITOR_ICONS,j,reactIcons.BoxIcon))})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:lodashEs.startCase(lodashEs.toLower(j))})]}))})},COLOR_PROP={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},ColorChoice=({property:r,onChange:h})=>{const x=useCurrentClassByProperty(r),g=React.useMemo(()=>lodashEs.get(x,"cls",""),[x]),{canChange:v}=React.useContext(StyleContext),[R,A]=React.useState([]),[j,C]=React.useState({color:"",shade:""}),T=g.split("-"),M=lodashEs.get(T,"1",""),O=lodashEs.get(T,"2",""),z=React.useCallback(Y=>{["current","inherit","transparent","black","white"].includes(Y)?(A([]),C({color:Y})):(A(["50","100","200","300","400","500","600","700","800","900"]),C(P=>({...P,color:Y,shade:P.shade?P.shade:"500"})))},[A,C]);React.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(M))return A([]);A(["50","100","200","300","400","500","600","700","800","900"])},[M]);const Z=React.useCallback(Y=>{C({color:M,shade:Y})},[M]);React.useEffect(()=>{C({color:"",shade:""})},[x]);const{match:q}=useTailwindClassList();return React.useEffect(()=>{const P=`${lodashEs.get(COLOR_PROP,r,"")}-${j.color}${j.shade?`-${j.shade}`:""}`;q(r,P)&&h(P,r)},[q,j,h,r]),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-transparent text-xs",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:jsxRuntime.jsxRuntimeExports.jsx(DropDown,{disabled:!v,rounded:!0,selected:M,onChange:z,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:jsxRuntime.jsxRuntimeExports.jsx(DropDown,{rounded:!0,selected:O,disabled:!M||!v,onChange:Z,options:R})})]})},getUserInputValues=(r,h)=>{r=r.toLowerCase();let x=r.trim().replace(/ |\+/g,"");if((x==="auto"||x==="none")&&h.includes(x))return{value:"",unit:x};const g=h.length?new RegExp(h.join("|"),"g"):/XXXXXX/g;x=x.replace(g,"");const v=r.match(g),R=v&&v.length>1,A=!lodashEs.isEmpty(x)&&Number.isNaN(Number(x));return R||A?{error:"Invalid value"}:v&&(v[0]==="auto"||v[0]==="none")?{value:v[0],unit:""}:{value:x,unit:v?v[0]:""}},getTwClassValue=r=>{const h=r.startsWith("-")?"-":"",x=r.split("-").pop();if(["auto","none"].includes(x))return{value:"",unit:x};if(x==="px")return{value:"1",unit:"px"};if(x==="screen")return{value:"100",unit:r.indexOf("w-")!==-1?"vw":"vh"};if(x==="full")return{value:"100",unit:"%"};if(lodashEs.includes(r,"skew-"))return{value:`${h}${x}`,unit:"deg"};if(lodashEs.includes(r,"rotate-"))return{value:`${h}${x}`,unit:"deg"};if(lodashEs.includes(r,"opacity-"))return{value:`${x/100}`,unit:"-"};if(lodashEs.includes(r,"duration-")||lodashEs.includes(r,"delay-"))return{value:`${x}`,unit:"ms"};if(lodashEs.includes(r,"translate-")&&!x.includes("/"))return{value:`${h}${`${x/4}`}`,unit:"rem"};if(lodashEs.includes(r,"scale-"))return{value:`${h}${`${x/100}`}`,unit:"-"};if(lodashEs.startsWith(r,"border")){const g=r.match(/border-?(x|y|t|r|b|l)?\d+/g);if(g)return{value:g[0].split("-").pop(),unit:"px"};if(r.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(lodashEs.startsWith(r,"max-w-")){if(r==="max-w-screen-sm")return{value:"640",unit:"px"};if(r==="max-w-screen-md")return{value:"768",unit:"px"};if(r==="max-w-screen-lg")return{value:"1024",unit:"px"};if(r==="max-w-screen-xl")return{value:"1280",unit:"px"};if(r==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(x==="xs")return{value:"320",unit:"px"};if(x==="sm")return{value:"384",unit:"px"};if(x==="md")return{value:"448",unit:"px"};if(x==="lg")return{value:"512",unit:"px"};if(x==="xl")return{value:"576",unit:"px"};if(x==="2xl")return{value:"672",unit:"px"};if(x==="3xl")return{value:"768",unit:"px"};if(x==="4xl")return{value:"896",unit:"px"};if(x==="5xl")return{value:"1024",unit:"px"};if(x==="6xl")return{value:"1152",unit:"px"};if(x==="7xl")return{value:"1280",unit:"px"};if(x==="prose")return{value:"65",unit:"ch"}}if(lodashEs.startsWith(r,"text-")){if(x==="xs")return{value:"12",unit:"px"};if(x==="sm")return{value:"14",unit:"px"};if(x==="base")return{value:"16",unit:"px"};if(x==="lg")return{value:"18",unit:"px"};if(x==="xl")return{value:"20",unit:"px"};if(x==="2xl")return{value:"24",unit:"px"};if(x==="3xl")return{value:"30",unit:"px"};if(x==="4xl")return{value:"36",unit:"px"};if(x==="5xl")return{value:"48",unit:"px"};if(x==="6xl")return{value:"60",unit:"px"};if(x==="7xl")return{value:"72",unit:"px"};if(x==="8xl")return{value:"96",unit:"px"};if(x==="9xl")return{value:"128",unit:"px"}}if(lodashEs.startsWith(r,"leading-")){if(x==="none")return{value:"1",unit:"-"};if(x==="tight")return{value:"1.25",unit:"-"};if(x==="snug")return{value:"1.375",unit:"-"};if(x==="normal")return{value:"1.5",unit:"-"};if(x==="relaxed")return{value:"1.625",unit:"-"};if(x==="loose")return{value:"2",unit:"-"}}if(lodashEs.startsWith(r,"tracking-")){if(x==="tighter")return{value:"-0.05",unit:"em"};if(x==="tight")return{value:"-0.025",unit:"em"};if(x==="normal")return{value:"0",unit:"em"};if(x==="wide")return{value:"0.025",unit:"em"};if(x==="wider")return{value:"0.05",unit:"em"};if(x==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(x))return{value:r,unit:"class"};if(x.includes("/")){const[g,v]=lodashEs.map(x.split("/"),R=>parseInt(R,10));return{value:h+(g/v*100).toFixed(2).replace(".00",""),unit:"%"}}return lodashEs.isNumber(parseFloat(x))?{value:`${h+parseFloat(x)*4}`,unit:"px"}:{value:x,unit:"class"}},getClassValueAndUnit=r=>{if(lodashEs.isEmpty(r))return{value:"",unit:""};const h=r.match(/\[.*\]/g);if(h===null)return getValueAndUnitForTWClass(r);const x=lodashEs.get(h,"0","").replace(/\[|\]/g,""),g=r.startsWith("-")?"-":"",v=lodashEs.first(x.match(/\d+.\d+|\d+/g));return{value:`${g}${v}`,unit:x.replace(v,"")}},getValueAndUnitForTWClass=r=>lodashEs.isEmpty(r)?{value:"",unit:""}:getTwClassValue(r),BlockSettingsContext=React.createContext({setDragData:()=>{}}),DragStyleButton=({unit:r,currentValue:h,onDrag:x,onDragEnd:g,onDragStart:v,negative:R,cssProperty:A})=>{const{setDragData:j}=React.useContext(BlockSettingsContext);return jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:C=>{const T={onDrag:x,onDragEnd:g,dragging:!0,dragStartY:C.pageY,dragStartValue:`${h}`,dragUnit:r,negative:R,cssProperty:A};v(T),j(T)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RowSpacingIcon,{})})},UnitSelection=({onSelect:r,current:h,units:x})=>jsxRuntime.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:x.map(g=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:h===g?"primary":void 0,size:"sm",onClick:v=>{v.stopPropagation(),r(g)},children:g},g))}),THROTTLE_TIME=50,AdvanceChoices=r=>{const[h,x]=React.useState(!1),[g,v]=React.useState(""),{currentClass:R,onChange:A,classPrefix:j,cssProperty:C,units:T,negative:M}=r,[O,z]=React.useState(C!=null&&C.toLowerCase().includes("width")?"%":T[0]),[Z,q]=React.useState(!1),[Y,P]=React.useState(""),[he,te]=React.useState(!1),[ue,X]=React.useState(!1);React.useEffect(()=>{const{value:J,unit:xe}=getClassValueAndUnit(R);if(xe===""){v(J),z(C!=null&&C.toLowerCase().includes("width")?"%":lodashEs.first(T));return}z(xe),v(xe==="class"||lodashEs.isEmpty(J)?"":J)},[R,C,T]);const se=web.useThrottledCallback(J=>A(J),[A],THROTTLE_TIME),pe=web.useThrottledCallback(J=>A(J,!1),[A],THROTTLE_TIME),ve=React.useCallback((J=!1)=>{const xe=getUserInputValues(`${g}`,T);if(lodashEs.get(xe,"error",!1)){q(!0);return}const be=lodashEs.get(xe,"unit")!==""?lodashEs.get(xe,"unit"):O;if(be==="auto"||be==="none"){se(`${j}${be}`);return}if(lodashEs.get(xe,"value")==="")return;const je=`${lodashEs.get(xe,"value","").startsWith("-")?"-":""}${j}[${lodashEs.get(xe,"value","").replace("-","")}${be==="-"?"":be}]`;J?pe(je):se(je)},[se,pe,g,O,j,T]),Me=React.useCallback(J=>{const xe=getUserInputValues(`${g}`,T);if(lodashEs.get(xe,"error",!1)){q(!0);return}if(J==="auto"||J==="none"){se(`${j}${J}`);return}if(lodashEs.get(xe,"value")==="")return;const be=lodashEs.get(xe,"unit")!==""?lodashEs.get(xe,"unit"):J,je=`${lodashEs.get(xe,"value","").startsWith("-")?"-":""}${j}[${lodashEs.get(xe,"value","").replace("-","")}${be==="-"?"":be}]`;se(je)},[se,g,j,T]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:O==="class"?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx("input",{className:"h-6 w-24 rounded border border-foreground/20 bg-background px-2 py-0.5 text-sm focus-visible:outline-0",readOnly:!0,value:R}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InfoCircledIcon,{})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${he?"z-auto":""}`,children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(O)!==-1?null:jsxRuntime.jsxRuntimeExports.jsx("input",{readOnly:O==="class",onKeyPress:J=>{J.key==="Enter"&&ve()},onKeyDown:J=>{if(J.keyCode!==38&&J.keyCode!==40)return;J.preventDefault(),X(!0);const xe=lodashEs.parseInt(J.target.value);let be=lodashEs.isNaN(xe)?0:xe;J.keyCode===38&&(be+=1),J.keyCode===40&&(be-=1);const ge=`${be}`,oe=`${ge.startsWith("-")?"-":""}${j}[${ge.replace("-","")}${O==="-"?"":O}]`;pe(oe)},onKeyUp:J=>{ue&&(J.preventDefault(),X(!1))},onBlur:()=>ve(),onChange:J=>{q(!1),v(J.target.value)},onClick:J=>{var xe;(xe=J==null?void 0:J.target)==null||xe.select(),x(!1)},value:he?Y:g,className:"h-6 w-14 rounded rounded-r-none border border-transparent bg-background pl-2 text-sm focus-visible:outline-0".concat(" ",Z?"border-red-500 text-red-500":"border-foreground/20")}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{open:h,delayDuration:100,children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>x(!h),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:`inline-block ${T.length===1?"px-2 font-semibold":""}`,children:O}),T.length>1?jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TriangleDownIcon,{}):null]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipPortal,{children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"bg-background",children:jsxRuntime.jsxRuntimeExports.jsx(UnitSelection,{units:T,current:O,onSelect:J=>{x(!1),z(J),Me(J)}})})})]})]}),["none","auto"].indexOf(O)!==-1||he?null:jsxRuntime.jsxRuntimeExports.jsx(DragStyleButton,{onDragStart:()=>te(!0),onDragEnd:J=>{if(P(()=>""),te(!1),lodashEs.isEmpty(J))return;const xe=`${J}`,ge=`${xe.startsWith("-")?"-":""}${j}[${xe.replace("-","")}${O==="-"?"":O}]`;se(ge)},onDrag:J=>{if(lodashEs.isEmpty(J))return;P(J);const xe=`${J}`,ge=`${xe.startsWith("-")?"-":""}${j}[${xe.replace("-","")}${O==="-"?"":O}]`;pe(ge)},currentValue:g,unit:O,negative:M,cssProperty:C})]})})})},useCurrentClassByProperty=r=>{const h=useSelectedBlockCurrentClasses();return lodashEs.findLast(h,{property:r})},canChangeClass=(r,h)=>{const x={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return x[lodashEs.get(r,"mq","xs")]<=x[h]},CLASS_PREFIXES={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},BREAKPOINTS={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},getBreakpoint=r=>`${r.toUpperCase()} ${BREAKPOINTS[r]?`(${BREAKPOINTS[r]} & up)`:""}`,BlockStyle=r=>{const{t:h}=reactI18next.useTranslation(),{type:x="icons",label:g,property:v,onEmitChange:R=()=>{},units:A,negative:j=!1}=r,[C]=useDarkMode(),[T]=useStylingState(),[,M]=useCanvasWidth(),O=useCurrentClassByProperty(v),z=useAddClassesToBlocks(),Z=useRemoveClassesFromBlocks(),[q]=useSelectedBlockIds(),Y=React.useMemo(()=>lodashEs.get(O,"fullCls",""),[O]),P=React.useCallback((pe,ve=!0)=>{const Me={dark:C,mq:M,mod:T,cls:pe,property:v,fullCls:""};(C||T!=="")&&(Me.mq="xs");const J=generateFullClsName(Me);z(q,[J],ve)},[q,C,M,T,v,z]),he=React.useCallback(()=>{Z(q,[Y])},[q,Y,Z]),te=React.useMemo(()=>canChangeClass(O,M),[O,M]);React.useEffect(()=>{R(te,O)},[te,R,O]);const[,,ue]=useCanvasWidth(),X=React.useCallback(pe=>{ue({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[pe])},[ue]),se=lodashEs.get(O,"dark",null)===C&&lodashEs.get(O,"mod",null)===T&&lodashEs.get(O,"mq",null)===M;return jsxRuntime.jsxRuntimeExports.jsx(BlockStyleProvider,{canChange:te,canReset:O&&se,children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${O&&!se?"text-foreground":""}`,children:h(g)})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[x==="arbitrary"?jsxRuntime.jsxRuntimeExports.jsx(AdvanceChoices,{currentClass:lodashEs.get(O,"cls",""),classPrefix:lodashEs.get(CLASS_PREFIXES,v,""),units:A||[],onChange:P,negative:j,cssProperty:v}):null,x==="icons"&&jsxRuntime.jsxRuntimeExports.jsx(IconChoices,{property:v,onChange:P}),x==="range"&&jsxRuntime.jsxRuntimeExports.jsx(RangeChoices,{property:v,onChange:P}),x==="color"&&jsxRuntime.jsxRuntimeExports.jsx(ColorChoice,{property:v,onChange:P}),x==="dropdown"&&jsxRuntime.jsxRuntimeExports.jsx(DropDownChoices,{label:g,property:v,onChange:P})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${Y?"visible":"invisible"}`,children:se?jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>he(),title:"Reset",className:"flex px-1.5 text-xs",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):te&&O?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{delayDuration:100,children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InfoCircledIcon,{})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"text-right",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",jsxRuntime.jsxRuntimeExports.jsxs("span",{className:"font-bold",children:[getBreakpoint(lodashEs.get(O,"mq")),C&&!O.dark?"(Light mode)":""]}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>X(lodashEs.get(O,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",lodashEs.get(O,"mq").toUpperCase()]})]})})})]}):null})]})]})})},basicUnits=["px","%","em","rem","ch","vh","vw"],MultipleChoices=({label:r,options:h,borderB:x=!1,borderT:g=!1,type:v="arbitrary",units:R=basicUnits,negative:A=!1})=>{const{t:j}=reactI18next.useTranslation(),[C,T]=React.useState(h[0].key),M=useSelectedBlockCurrentClasses(),O=React.useCallback(z=>lodashEs.map(M,"property").includes(z),[M]);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-border py-2 first:pt-0 last:pb-0 ${x?"border-b":""} ${g?"border-t":""}`,children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[r&&jsxRuntime.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:j(r)}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:React.Children.toArray(h.map(({label:z,key:Z})=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>T(Z),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${Z===C?"bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[React.createElement("div",{className:O(Z)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),React.createElement(lodashEs.get(EDITOR_ICONS,Z,reactIcons.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:lodashEs.startCase(lodashEs.toLower(z))})]})})))})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{type:v,units:[...R],label:"",property:C,negative:A})})]})},NestedOptions=({heading:r,items:h})=>{const{t:x}=reactI18next.useTranslation(),g=useSelectedBlockCurrentClasses(),v=React.useMemo(()=>{const R=C=>lodashEs.flatten(C.map(T=>T.styleType==="multiple"?lodashEs.map(T.options,"key"):T.property)),A=lodashEs.flatten(h.map(C=>C.styleType==="accordion"?R(C.items):C.styleType==="multiple"?lodashEs.map(C.options,"key"):C.property)),j=lodashEs.map(g,"property");return lodashEs.intersection(A,j).length>0},[g,h]);return jsxRuntime.jsxRuntimeExports.jsxs("details",{children:[jsxRuntime.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-gray-50 p-px px-2 text-[11px] text-foreground dark:bg-gray-800",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"inline",children:[lodashEs.startCase(x(r.toLowerCase())),v?jsxRuntime.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${v?"bg-blue-500":"bg-gray-300"}`}):null]})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"p-2",children:h.map(R=>R.styleType==="multiple"?jsxRuntime.jsxRuntimeExports.jsx(MultipleChoices,{...R},R.label):jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{...R},R.label))})]})},SectionContext=React.createContext({}),StylingGroup=({section:r,showAccordian:h})=>{const{t:x}=reactI18next.useTranslation(),g=useSelectedBlockCurrentClasses(),v=React.useCallback((A=[])=>{const j={};for(let T=0;T<g.length;T++)j[g[T].property]=g[T].cls;let C=!0;for(const T in A)if(!lodashEs.has(j,T)||j[T]!==A[T]){C=!1;break}return C},[g]),R=React.useMemo(()=>({}),[]);return jsxRuntime.jsxRuntimeExports.jsx(SectionContext.Provider,{value:R,children:h?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AccordionItem,{value:r.heading,className:"border-none",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionTrigger,{className:"border-slate-150 border-t py-2 text-xs",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center py-2",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-x-2 text-xs font-medium",children:lodashEs.startCase(x(r.heading))})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionContent,{className:"py-2",children:React.Children.toArray(r.items.map(A=>lodashEs.has(A,"component")?React.createElement(A.component,{key:A.label}):lodashEs.has(A,"styleType")?A.styleType==="multiple"?jsxRuntime.jsxRuntimeExports.jsx(MultipleChoices,{...A},A.label):A.styleType==="accordion"&&v(A==null?void 0:A.conditions)?jsxRuntime.jsxRuntimeExports.jsx(NestedOptions,{...A},A.label):null:jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{...A},A.label)))})]}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"py-2",children:React.Children.toArray(r.items.map(A=>lodashEs.has(A,"component")?React.createElement(A.component,{key:A.label}):lodashEs.has(A,"styleType")?A.styleType==="multiple"?jsxRuntime.jsxRuntimeExports.jsx(MultipleChoices,{...A},A.label):A.styleType==="accordion"&&v(A==null?void 0:A.conditions)?jsxRuntime.jsxRuntimeExports.jsx(NestedOptions,{...A},A.label):null:jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{...A},A.label)))})})},StylingHelpers=()=>{const r=useSelectedBlock(),[h]=useSelectedStylingBlocks(),{t:x}=reactI18next.useTranslation(),g=useAddClassesToBlocks(),v=runtime.getRegisteredChaiBlock(r._type),R=lodashEs.get(lodashEs.first(h),"prop"),A=lodashEs.get(v.props,`${R}.presets`,{});if(!lodashEs.has(v,"props")||lodashEs.isEmpty(A))return null;const j=C=>{const T=C.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");g([r._id],T,!0)};return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-10",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenu,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"px-4",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{variant:"default",className:"w-full",size:"sm",children:[x("Apply Presets"),jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CaretDownIcon,{})]})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuContent,{className:"max-h-80 w-56",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.ScrollArea,{className:"no-scrollbar h-full",children:lodashEs.isEmpty(A)?null:jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenuLabel,{children:[v.type," ",x("presets")]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuSeparator,{}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuGroup,{children:lodashEs.keys(A).map(C=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenuItem,{className:"group text-xs",onClick:()=>j(A[C]),children:[lodashEs.capitalize(lodashEs.startCase(x(C))),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuShortcut,{className:"invisible hover:font-bold hover:text-blue-600 group-hover:visible",children:x("apply")})]}))})]})})})]})})},BlockStylingProps=()=>{const r=useSelectedBlock(),[h,x]=useSelectedStylingBlocks(),{t:g}=reactI18next.useTranslation();if(!r)return null;const v=Object.keys(r).filter(A=>typeof r[A]=="string"&&r[A].startsWith("#styles:"));if(lodashEs.isEmpty(v)||v.length<=1)return null;const R=A=>lodashEs.find(h,j=>j.prop===A);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap gap-1",children:[jsxRuntime.jsxRuntimeExports.jsxs("label",{htmlFor:"block-styling-props",className:"py-1 text-xs",children:[g("Style element"),":"]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-wrap gap-2",children:lodashEs.map(v,A=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Badge,{className:"cursor-pointer",onClick:()=>{x([{id:`${A}-${r._id}`,blockId:r._id,prop:A}])},variant:R(A)?"default":"secondary",children:lodashEs.startCase(A)},A))}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"my-2 h-[1px] w-full bg-border"})]})},MAPPER={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1};function BlockStyling(){const{flexChild:r,gridChild:h}=useSelectedBlocksDisplayChild(),[x]=useSelectedStylingBlocks(),[g,v]=React.useState(""),[R,A]=React.useState({onDrag:T=>T,onDragEnd:T=>T,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),j=web.useThrottledCallback(T=>{const M=!lodashEs.get(R,"negative",!1),O=lodashEs.get(R,"cssProperty","");let z=parseFloat(R.dragStartValue);z=isNaN(z)?0:z;let Z=MAPPER[R.dragUnit];(lodashEs.startsWith(O,"scale")||O==="opacity")&&(Z=10);let Y=(R.dragStartY-T.pageY)/Z+z;M&&Y<0&&(Y=0),O==="opacity"&&Y>1&&(Y=1),R.onDrag(`${Y}`),v(`${Y}`)},[R],50),C=React.useCallback(()=>{setTimeout(()=>R.onDragEnd(`${g}`),100),A({onDrag:T=>T,onDragEnd:T=>T,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[R,g,A]);return lodashEs.isEmpty(x)?null:jsxRuntime.jsxRuntimeExports.jsxs(BlockSettingsContext.Provider,{value:{setDragData:A},children:[R.dragging?jsxRuntime.jsxRuntimeExports.jsx("div",{onMouseMove:j,onMouseUp:()=>C(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"}):null,jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsxRuntimeExports.jsx(BlockStylingProps,{}),jsxRuntime.jsxRuntimeExports.jsx(StylingHelpers,{}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Accordion,{defaultValue:["Styles"],type:"multiple",className:"w-full",children:[r&&jsxRuntime.jsxRuntimeExports.jsx(StylingGroup,{section:FLEX_CHILD_SECTION,showAccordian:r||h}),h&&jsxRuntime.jsxRuntimeExports.jsx(StylingGroup,{section:GRID_CHILD_SECTION,showAccordian:r||h}),SETTINGS_SECTIONS.map(T=>jsxRuntime.jsxRuntimeExports.jsx(StylingGroup,{section:T,showAccordian:r||h},T.heading))]})]})]})}const ChaiSelect=({defaultValue:r="",onValueChange:h,options:x,placeholder:g="Select",className:v=""})=>{const[R,A]=React.useState(r),j=C=>{const T=C.target.value;A(T),h(T)};return jsxRuntime.jsxRuntimeExports.jsx("div",{className:iconBase.cn("relative inline-block w-full",v),children:jsxRuntime.jsxRuntimeExports.jsxs("select",{className:"mt-1 flex w-full rounded-md border border-border bg-background px-3 py-1 text-sm text-foreground 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",value:R,onChange:j,children:[jsxRuntime.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,children:g}),x.map(C=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:C.value,children:C.label},C.value))]})})};function UILibrariesSelect({uiLibraries:r,library:h,setLibrary:x}){const{t:g}=reactI18next.useTranslation();return h?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"h-12",children:[jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs font-bold text-gray-500",children:g("Choose library")}),jsxRuntime.jsxRuntimeExports.jsx(ChaiSelect,{className:"mt-1",options:r.map(v=>({value:v.uuid,label:v.name})),defaultValue:h,onValueChange:v=>x(v)})]}):null}const BlockCard=({block:r,library:h,parentId:x=void 0,position:g=-1})=>{const[v,R]=React.useState(!1),A=useBuilderProp("getUILibraryBlock",lodashEs.noop),{addCoreBlock:j,addPredefinedBlock:C}=useAddBlock(),[,T]=useSelectedBlockIds(),{clearHighlight:M}=useBlockHighlight(),O=lodashEs.get(r,"name",lodashEs.get(r,"label")),z=flagged.useFeature("dnd"),[,Z]=jotai.useAtom(draggedBlockAtom),q=he=>{const te=lodashEs.has(he,"styles_attrs.data-page-section");return he._type==="Box"&&te},Y=React.useCallback(async he=>{if(he.stopPropagation(),lodashEs.has(r,"component")){j(r,x,g),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);return}R(!0);const te=await A(h,r);lodashEs.isEmpty(te)||C(runtime.syncBlocksWithDefaults(te),x,g),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},[j,C,r,A,h,x,g]),P=async he=>{const te=await A(h,r);let ue=x;if(q(lodashEs.first(te))&&(ue=null),!lodashEs.isEmpty(te)){const X={blocks:te,uiLibrary:!0,parent:ue};if(he.dataTransfer.setData("text/plain",JSON.stringify(X)),r.preview){const se=new Image;se.src=r.preview,se.onload=()=>{he.dataTransfer.setDragImage(se,0,0)}}else he.dataTransfer.setDragImage(new Image,0,0);Z(X),setTimeout(()=>{T([]),M(),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},200)}};return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:v?()=>{}:Y,draggable:z?"true":"false",onDragStart:P,className:clsx("relative mt-2 cursor-pointer overflow-hidden rounded-md border border-border bg-white duration-200 hover:border-blue-500 hover:shadow-xl"),children:[v&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"animate-spin",size:15,color:"white"}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?jsxRuntime.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[45px] w-full rounded-md",alt:O}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border bg-gray-200",children:jsxRuntime.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:O})})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:O})})]})},libraryBlocksAtom=jotai.atom({}),useLibraryBlocks=r=>{const[h,x]=jotai.useAtom(libraryBlocksAtom),g=useBuilderProp("getUILibraryBlocks",lodashEs.noop),v=lodashEs.get(h,`${r==null?void 0:r.uuid}.blocks`,null),R=lodashEs.get(h,`${r==null?void 0:r.uuid}.loading`,"idle"),A=React.useRef("idle");return React.useEffect(()=>{(async()=>{if(R==="complete"||A.current==="loading")return;A.current="loading",x(C=>({...C,[r==null?void 0:r.uuid]:{loading:"loading",blocks:[]}}));const j=await g(r);A.current="idle",x(C=>({...C,[r==null?void 0:r.uuid]:{loading:"complete",blocks:j||[]}}))})()},[r,v,R,A,x,g]),{data:v||[],isLoading:R==="loading"}},UILibrarySection=({parentId:r,position:h})=>{const[x,g]=jotai.useAtom(selectedLibraryAtom),v=useBuilderProp("uiLibraries",[]),R=runtime.useRegisteredChaiBlocks(),A=lodashEs.values(R).filter(ue=>ue.category==="custom"),j=v.find(ue=>ue.uuid===x)||lodashEs.first(v),{data:C,isLoading:T}=useLibraryBlocks(j),M=lodashEs.groupBy([...C,...A],"group"),[O,z]=React.useState("Hero"),Z=lodashEs.get(M,O,[]),q=React.useRef(null),{t:Y}=reactI18next.useTranslation(),P=ue=>{q.current&&(clearTimeout(q.current),q.current=null),q.current=setTimeout(()=>{q.current&&z(ue)},300)};if(T)return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-4 grid h-full w-full grid-cols-12 gap-2",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"col-span-3 h-full"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"col-span-9 h-full"})]});const he=lodashEs.filter(Z,(ue,X)=>X%2===0),te=lodashEs.filter(Z,(ue,X)=>X%2===1);return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"relative mt-2 flex h-full max-h-full overflow-hidden bg-background",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full pt-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full max-h-full w-60 flex-col gap-1 px-1 pr-2",children:[jsxRuntime.jsxRuntimeExports.jsx(UILibrariesSelect,{library:j==null?void 0:j.uuid,setLibrary:g,uiLibraries:v}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex h-full max-h-full w-full flex-1 flex-col",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-xs font-bold text-gray-500",children:Y("Groups")}),jsxRuntime.jsxRuntimeExports.jsx("hr",{className:"mt-1 border-border"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar mt-2 h-full max-h-full flex-1 overflow-y-auto pb-20",children:React.Children.toArray(lodashEs.map(M,(ue,X)=>jsxRuntime.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>P(X),onMouseLeave:()=>clearTimeout(q.current),onClick:()=>z(X),className:iconBase.cn("flex w-full cursor-pointer items-center justify-between rounded-md p-2 text-sm text-foreground transition-all ease-in-out hover:bg-gray-200 dark:hover:bg-gray-800",X===O?"bg-blue-500 text-white hover:bg-blue-600":""),children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:lodashEs.capitalize(Y(X.toLowerCase()))}),jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},X)))})]})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ScrollArea,{onMouseEnter:()=>q.current?clearTimeout(q.current):null,className:"z-10 -mt-2 flex h-full max-h-full w-full flex-col gap-2 border-l border-border transition-all ease-linear",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-2 px-2",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-1",children:React.Children.toArray(he.map(ue=>jsxRuntime.jsxRuntimeExports.jsx(BlockCard,{parentId:r,position:h,block:ue,library:j})))}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-1",children:React.Children.toArray(te.map(ue=>jsxRuntime.jsxRuntimeExports.jsx(BlockCard,{parentId:r,position:h,block:ue,library:j})))})]}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})]})})})},UILibrariesPanel=({parentId:r,position:h})=>jsxRuntime.jsxRuntimeExports.jsx(UILibrarySection,{parentId:r,position:h}),Core="Core",Import="Import",Breakpoints$1="Breakpoints",Clear="Clear",Cancel="Cancel",Yes="Yes",Preview="Preview",Settings="Settings",Styling="Styling",Remove="Remove",Choose="Choose",Cut="Cut",Copy="Copy",Paste="Paste",Delete="Delete",classes="classes",Theme="Theme",Outline="Outline",Copied="Copied",Stop="Stop",Edit="Edit",Tag="Tag",Value="Value",Images="Images",Library="Library",Blocks="Blocks",Basic="Basic",Media="Media",Advanced="Advanced",Form="Form",Groups="Groups",Accordions="Accordions",Buttons="Buttons",Layouts="Layouts",FAQ="FAQ",Hero="Hero",Features="Features",Footer="Footer",Navbar="Navbar",Icons="Icons",Testimonials="Testimonials",Blog="Blog",Saved="Saved",Unsaved="Unsaved",Randomize="Randomize",theme_config={heading_font:"Heading Font",body_font:"Body Font",rounded_corner:"Rounded Corners",primary:"Primary",secondary:"Secondary",background:"Background",text_color:"Text Color",background_dark_mode:"Background (Dark Mode)",text_color_dark_mode:"Text Color (Dark Mode)"},web_blocks={box:"box",tag:"Tag",div:"div",level:"Level",header:"header",footer:"footer",section:"section",article:"article",aside:"aside",main:"main",nav:"navigation",figure:"figure",details:"details",summary:"summary",dialog:"dialog",strike:"strike",caption:"caption",legend:"legend",figcaption:"figure caption",mark:"mark",background_image:"Background Image",label:"Label",default:"default",icon_size:"Icon Size",icon_position:"Icon Position",start:"Start",end:"End",button:"Button",custom_html:"Custom HTML",html_code:"HTML Code",default_snippet:"The HTML snippet goes here...",placeholder:"Enter custom HTML code here",custom_script:"Custom Script",dark_mode:"Dark Mode",divider:"Divider",empty_box:"Empty Box",heading:"Heading",image:"Image",alt:"Alt",width:"Width",height:"Height",video:"Video",span:"Span",content:"Content",icon:"Icon",richtext:"Rich Text",list:"List",list_type:"List Type",listitem:"List Item",link:"Link",list_item:"List Item",none:"None",disc:"Disc",number:"Number",paragraph:"Paragraph",lightbox_link:"Lightbox Link",href:"Link",type:"Type",iframe:"iframe",inline:"inline",ajax:"ajax",autoplay:"Video autoplay",max_width:"Max Width",backdrop_color:"Background Color",gallery_name:"Gallery Name",slot:"Slot",empty_slot:"Empty Slot",text:"Text",video_url:"Video URL",controls:"Show Controls",loop:"Loop",muted:"Muted",checkbox:"Checkbox",required:"Required",checked:"Checked",submit_button:"Submit Button",form:"Form",submit_url:"Submit URL",error_message:"Error Message",success_message:"Success Message",input:"Input",value:"Value",show_label:"Show Label",field_name:"Field Name",radio:"Radio",multiple:"Multiple",options:"Options",select:"Select",multiple_choice:"Multiple Choice",textarea:"Textarea",rows:"Rows"},Undo="Undo",Redo="Redo",Duplicate="Duplicate",Close="Close",Selected="Selected",Select="Select",Attributes="Attributes",apply="apply",presets="presets",Orientation="Orientation",Color="Color",Upload="Upload",lngEn={"Add block":"Add Block","Add blocks":"Add blocks","Enter or paste TailwindCSS HTML snippet":"Enter or paste TailwindCSS HTML snippet","Click to add block to page":"Click to add block to page",Core,"Custom Blocks":"Custom Blocks","UI Library":"UI Library",Import,"Use HTML snippets from Tailwind CSS component libraries":"Use HTML snippets from Tailwind CSS component libraries","Tailwind HTML snippet":"Tailwind HTML snippet","Enter your code snippet here":"Enter your code snippet here","Import HTML":"Import HTML","Imported HTML Note":"NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page.","Dark Mode":"Dark Mode","This page has no blocks. Add a block by clicking the + button":"This page has no blocks. Add a block by clicking the + button","This page is empty":"This page is empty","Please select a block to edit settings or styles":"Please select a block to edit settings or styles","Please select a block to Ask AI":"Please select a block to ask AI","Please select a styling block":"Please select a styling block","Drop your block here":"Drop your block here","Use setting":"Use setting","Mobile (XS)":"Mobile (XS)","Styles set here are applied to all screen unless edited at higher breakpoint":"Styles set here are applied to all screen unless edited at higher breakpoint","Mobile landscape (SM)":"Mobile landscape (SM)","Styles set here are applied at 640px and up unless edited at higher breakpoint":"Styles set here are applied at 640px and up unless edited at higher breakpoint","Tablet (MD)":"Tablet (MD)","Styles set here are applied at 768px and up":"Styles set here are applied at 768px and up","Tablet Landscape (LG)":"Tablet Landscape (LG)","Styles set here are applied at 1024px and up unless edited at higher breakpoint":"Styles set here are applied at 1024px and up unless edited at higher breakpoint","Desktop (XL)":"Desktop (XL)","Styles set here are applied at 1280px and up unless edited at higher breakpoint":"Styles set here are applied at 1280px and up unless edited at higher breakpoint","Large Desktop (2XL)":"Large Desktop (2XL)","Styles set here are applied at 1536px and up":"Styles set here are applied at 1536px and up",Breakpoints:Breakpoints$1,Clear,"Clear whole canvas?":"Clear whole canvas?","Are you sure you want to clear the whole canvas?":"Are you sure you want to clear the whole canvas?",Cancel,Yes,Preview,Settings,Styling,"Data Provider":"Data Provider","Remove Provider Confirmation":"Are you sure you want to remove <span class='text-blue-500'>{name}</span> provider?","Your data provider will be removed from this page and all added data binding will be not visible on blocks.":"Your data provider will be removed from this page and all added data binding will be not visible on blocks.",Remove,"You have no data providers registered. Please add a data provider to your project.":"You have no data providers registered. Please add a data provider to your project.","Learn more":"Learn more","Add data providers:":"Add data providers:","Select a provider":"Select a provider",Choose,"Page data providers:":"Page data providers:","View Data":"View Data","Mark as Global":"Mark as Global","Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.":"Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.","Global blocks are indicated with":"Global blocks are indicated with","Global blocks are available under 'Global' category":"Global blocks are available under 'Global' category","Enter global block name":"Enter global block name","Eg: Header, Footer":"Eg: Header, Footer","{length} blocks selected.":"{length} blocks selected.",Cut,Copy,Paste,Delete,"Clear Selection":"Clear Selection","This is dev mode. Visit":"This is dev mode. Visit","to see page preview":"to see page preview",classes,Theme,Outline,"Not supported":"Not supported","Please use Chrome, Firefox or Safari":"Please use Chrome, Firefox or Safari","Download Complete":"Download complete",Copied,"Enter Classes":"Enter classes separated by space","Ask AI":"Ask AI","Edit with AI":"Edit with AI","Generating... Please wait...":"Generating... Please wait...","Saving... Please wait...":"Saving... Please wait...","Deleting... Please wait...":"Deleting... Please wait...",Stop,"E.g.: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI":"E.g.: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.","Ask AI to edit styles":"Ask AI to edit styles","Ask AI to edit content":"Ask AI to edit content","AI Context":"AI Context","Select Block for AI":"Select a block to edit with AI","Select Block to Edit":"Please select a block to edit",Edit,"Describe this page. E.g.: This page is about...":"Describe this page. E.g.: This page is about...",Tag,Value,"Background Image":"Background Image","Enter image URL":"Enter image URL","Replace image":"Replace image","Choose image":"Choose image",Images,Library,Blocks,Basic,Media,Advanced,Form,"Choose Icon or SVG":"Choose an icon or enter SVG",Groups,"UI Libraries":"UI Libraries",Accordions,Buttons,Layouts,"Choose Library":"Choose library","No Library Found":"No library found.",FAQ,Hero,Features,Footer,Navbar,Icons,Testimonials,Blog,"Remove context":"Remove context","Yes, Delete":"Yes, Delete","AI Context Updated":"AI Context Updated","You can now ask AI to edit your content.":"You can now ask AI to edit your content.",Saved,Unsaved,"Saving...":"Saving...","Improve writing":"Improve writing","Replace placeholder content":"Replace placeholder content","Fix grammar":"Fix grammar","Make longer":"Make longer","Make shorter":"Make shorter","Add emojis":"Add emojis",Randomize,"Edit Block":"Edit Block","AI Assistant":"AI Assistant","Theme Config":{"Heading Font":"Heading Font","Body Font":"Body Font","Rounded Corner":"Rounded Corners",Primary:"Primary",Secondary:"Secondary",Background:"Background","Text Color":"Text Color","Background Dark Mode":"Background (Dark Mode)","Text Color Dark Mode":"Text Color (Dark Mode)"},"flex.heading":"Flex Child","flex.basis":"Basis","flex.order":"Order","flex.flex":"Flex","flex.grow":"Grow","flex.shrink":"Shrink","grid.heading":"Grid Child","grid.col_span":"Col Span","grid.col_start":"Col Start","grid.col_end":"Col End","grid.row_span":"Row Span","grid.row_start":"Row Start","grid.row_end":"Row End","grid.order":"Order","layout.heading":"Layout","layout.width":"Width","layout.height":"Height","layout.margin":"Margin","layout.margin_all":"All","layout.margin_lr":"Left-Right","layout.margin_tb":"Top-Bottom","layout.margin_top":"Top","layout.margin_right":"Right","layout.margin_bottom":"Bottom","layout.margin_left":"Left","layout.padding":"Padding","layout.padding_all":"All","layout.padding_lr":"Left-Right","layout.padding_tb":"Top-Bottom","layout.padding_top":"Top","layout.padding_right":"Right","layout.padding_bottom":"Bottom","layout.padding_left":"Left","layout.space_bt":"Space Bt.","layout.space_lr":"Left-Right","layout.space_tb":"Top-Bottom","size.heading":"Size","size.min_width_height":"Min width & height","size.min_width":"Min Width","size.min_height":"Min Height","size.max_width_height":"Max width & height","size.max_width":"Max Width","size.max_height":"Max Height","size.object_options_aspect_ratio":"Object options & aspect ratio","size.aspect":"Aspect","size.fit":"Fit","size.position":"Position","display.heading":"Display","display.display":"Display","display.flex_options":"Flex options","display.flex_direction":"Direction","display.flex_wrap":"Wrap","display.justify_content":"Justify","display.align_content":"Content","display.align_items":"Items","display.gap":"Gap","display.gap_all":"All","display.gap_lr":"Left-Right","display.gap_tb":"Top-Bottom","display.grid_options":"Grid options","display.grid_columns":"Columns","display.grid_rows":"Rows","display.grid_auto_flow":"Auto Flow","display.grid_auto_cols":"Auto Cols","display.grid_auto_rows":"Auto Rows","display.visibility_opacity":"Visibility & Opacity","display.visibility":"Visibility","display.opacity":"Opacity","position.heading":"Position","position.position":"Position","position.options":"Position options","position.direction":"Direction","position.top":"Top","position.right":"Right","position.bottom":"Bottom","position.left":"Left","position.inset":"Inset","position.all":"All","position.lr":"Left Right","position.tb":"Top Bottom","position.z_index":"Z-Index","position.float_clear":"Float & Clear","position.float":"Float","position.clear":"Clear","position.overflow_overscroll":"Overflow & Overscroll","position.overflow":"Overflow","position.overscroll":"Overscroll","typography.heading":"Typography","typography.font":"Font","typography.size":"Size","typography.height":"Height","typography.weight":"Weight","typography.color":"Color","typography.alignments":"Alignments","typography.align":"Align","typography.valign":"V. Align","typography.spacing_decoration_more":"Spacing, decoration & more","typography.spacing":"Spacing","typography.decoration":"Decoration","typography.thickness":"Thickness","typography.transform":"Transform","typography.whitespace_breaks":"White space & breaks","typography.whitespace":"Whitespace","typography.wordbreak":"Wordbreak","background.heading":"Background","background.bgcolor":"Bg. Color","background.position_size_more":"Position, Size & more","background.attachment":"Attachment","background.clipping":"Clipping","background.origin":"Origin","background.position":"Position","background.repeat":"Repeat","background.size":"Size","background.gradient":"Gradient","background.gradient_colors":"Gradient colors","background.from_color":"From","background.via_color":"Via","background.to_color":"To","border.heading":"Border & Outline","border.width":"Width","border.all":"All","border.lr":"Left Right","border.tb":"Top bottom","border.top":"Top","border.right":"Right","border.bottom":"Bottom","border.left":"Left","border.corners":"Corners","border.top_left":"Top Left","border.top_right":"Top right","border.bottom_right":"Bottom right","border.bottom_left":"Bottom left","border.color":"Color","border.style":"Style","border.divide_options":"Divide options","border.divide_color":"Color","border.divide_style":"Style","border.outline_styling":"Outline styling","border.outline_width":"Width","border.outline_offset":"Offset","border.outline_style":"Style","border.ring_options":"Ring options","border.ring_width":"Width","border.ring_color":"Color","border.ring_offset_width":"Offset","border.ring_offset_color":"Off. color","effect.heading":"Effect & Animation","effect.shadow":"Shadow","effect.color":"Color","effect.cursor":"Cursor","effect.blend_cursor":"Blend & Cursor","effect.mix_blend":"Mix Blend","effect.bg_blend":"Bg. Blend","effect.transform":"Transform","effect.origin":"Origin","effect.scale":"Scale","effect.all":"All","effect.lr":"Left-Right","effect.tb":"Top-Bottom","effect.skew":"Skew","effect.translate":"Translate","effect.rotate":"Rotate","effect.animation":"Animation","effect.transition":"Transition","effect.easing":"Easing","effect.duration":"Duration","effect.delay":"Delay","classes.heading":"Classes",theme_config,web_blocks,"Copy classes to clipboard":"Copy classes to clipboard","Classes copied to clipboard":"Classes copied to clipboard","Show hidden blocks":"Show hidden blocks","Expand all":"Expand all","Collapse all":"Collapse all","Choose library":"Choose library","Close Preview":"Close Preview",Error:"Error","Failed to copy template":"Failed to copy template","Total tokens used":"Total tokens used","Updated AI Context":"Updated AI Context","You can now Ask AI to edit your content":"You can now Ask AI to edit your content","Tell about this page eg this page is about":"Tell about this page eg this page is about..","Delete Context":"Delete Context","Keyboard shortcuts":"Keyboard shortcuts",Undo,Redo,Duplicate,"Deselect blocks":"Deselect blocks","Delete block":"Delete block","Save page":"Save page","Scripts will be only executed in preview and live mode.":"Scripts will be only executed in preview and live mode.","HTML Code Editor |":"HTML Code Editor |",Close,"Coming soon":"Coming soon",Selected,Select,"Choose Builder Layout":"Choose Builder Layout","Single side panel":"Single side panel","Suitable for smaller screens. Bigger canvas size.":"Suitable for smaller screens. Bigger canvas size.","Dual side panel":"Dual side panel","Suitable for larger screens. Smaller canvas size.":"Suitable for larger screens. Smaller canvas size.","Dual side panel advanced":"Dual side panel advanced","Suitable for heavy styling & block editing. Setting are always visible.":"Suitable for heavy styling & block editing. Setting are always visible.","Block Settings":"Block Settings","Visibility settings":"Visibility settings","Show on canvas":"Show on canvas",Attributes,"Apply Presets":"Apply Presets",apply,presets,"Global presets":"Global presets",Orientation,Color,"Please select an image":"Please select an image","click to upload":"click to upload","SVG, PNG, JPG or GIF (Max. 2mb)":"SVG, PNG, JPG or GIF (Max. 2mb)","Uploading...":"Uploading...",Upload,"Something went wrong":"Something went wrong","Fetching...":"Fetching...","No images found":"No images found","It looks like you haven't uploaded any images yet. Start by clicking the upload button above.":"It looks like you haven't uploaded any images yet. Start by clicking the upload button above.","Open Code Editor":"Open Code Editor","Clear search":"Clear search","No results found for":"No results found for","Search {pageTypeName}":"Search {pageTypeName}"};i18n.use(reactI18next.initReactI18next).init({resources:{en:{translation:lngEn}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const CoreBlock=({block:r,disabled:h,parentId:x,position:g})=>{const[,v]=jotai.useAtom(draggedBlockAtom),{type:R,icon:A,label:j}=r,{addCoreBlock:C,addPredefinedBlock:T}=useAddBlock(),[,M]=useSelectedBlockIds(),{clearHighlight:O}=useBlockHighlight(),z=()=>{if(lodashEs.has(r,"blocks")){const Y=lodashEs.isFunction(r.blocks)?r.blocks():r.blocks;T(runtime.syncBlocksWithDefaults(Y),x||null,g)}else C(r,x||null,g);pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},Z=flagged.useFeature("dnd"),{t:q}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{disabled:h,onClick:z,type:"button",onDragStart:Y=>{Y.dataTransfer.setData("text/plain",JSON.stringify(lodashEs.omit(r,["component","icon"]))),Y.dataTransfer.setDragImage(new Image,0,0),v(lodashEs.omit(r,["component","icon"])),setTimeout(()=>{M([]),O()},200)},draggable:Z?"true":"false",className:"cursor-pointer space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 dark:border-gray-700 dark:text-white dark:hover:bg-slate-800/50 dark:disabled:bg-gray-900 dark:disabled:text-foreground",children:[React.createElement(A||reactIcons.BoxIcon,{className:"w-4 h-4 mx-auto"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:lodashEs.capitalize(q(j||R))})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:q(j||R)})})]})})},DefaultChaiBlocks=({parentId:r,position:h,gridCols:x="grid-cols-2"})=>{const g=runtime.useRegisteredChaiBlocks(),v=useBuilderProp("filterChaiBlock",()=>!0),R=lodashEs.filter(g,v),A=lodashEs.groupBy(R,"category"),j=lodashEs.uniq(lodashEs.map(A.core,"group"));return jsxRuntime.jsxRuntimeExports.jsx(ChaiBuilderBlocks,{gridCols:x,parentId:r,position:h,groups:j,blocks:A.core})},CORE_GROUPS=["basic","typography","media","layout","form","advanced","other"],ChaiBuilderBlocks=({groups:r,blocks:h,parentId:x,position:g,gridCols:v="grid-cols-4"})=>{var C;const{t:R}=reactI18next.useTranslation(),[A]=useBlocksStore(),j=(C=lodashEs.find(A,T=>T._id===x))==null?void 0:C._type;return React.Children.toArray(lodashEs.map(lodashEs.sortBy(r,T=>CORE_GROUPS.indexOf(T)===-1?99:CORE_GROUPS.indexOf(T)),T=>lodashEs.reject(lodashEs.filter(lodashEs.values(h),{group:T}),{hidden:!0}).length?jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Accordion,{type:"single",value:T,collapsible:!0,className:"w-full",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AccordionItem,{value:T,className:"border-border",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionTrigger,{className:"rounded-md bg-background px-4 py-2 capitalize text-foreground hover:no-underline",children:lodashEs.capitalize(R(T.toLowerCase()))}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionContent,{className:"mx-auto max-w-xl p-3",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grid gap-2 "+v,children:React.Children.toArray(lodashEs.reject(lodashEs.filter(lodashEs.values(h),{group:T}),{hidden:!0}).map(M=>jsxRuntime.jsxRuntimeExports.jsx(CoreBlock,{parentId:x,position:g,block:M,disabled:!canAcceptChildBlock(j,M.type)||!canBeNestedInside(j,M.type)})))})})]})}):null))},addBlockTabAtom=atomWithStorage("__add_block_tab","library"),AddBlocksPanel=({className:r,showHeading:h=!0,parentId:x=void 0,position:g=-1})=>{const{t:v}=reactI18next.useTranslation(),[R,A]=jotai.useAtom(addBlockTabAtom),[,j]=jotai.useAtom(showPredefinedBlockCategoryAtom),C=useBuilderProp("importHTMLSupport",!0),T=useBuilderProp("addBlocksDialogTabs",[]),M=React.useCallback(()=>{pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},[]);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("flex h-full w-full flex-col overflow-hidden",r),children:[h?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[jsxRuntime.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:v("Add block")}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:v(R==="html"?"Enter or paste TailwindCSS HTML snippet":"Click to add block to page")})]}):null,jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tabs,{onValueChange:O=>{j(""),A(O)},value:R,className:"flex h-full max-h-full flex-col overflow-hidden",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TabsList,{className:"flex w-full items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"library",children:v("Library")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"core",children:v("Blocks")}),C?jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"html",children:v("Import")}):null,lodashEs.map(T,O=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:O.key,children:React.createElement(O.tab)}))]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:"core",className:"h-full max-h-full flex-1 pb-20",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.ScrollArea,{className:"-mx-1.5 h-full max-h-full overflow-y-auto",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:jsxRuntime.jsxRuntimeExports.jsx(DefaultChaiBlocks,{gridCols:"grid-cols-4",parentId:x,position:g})})})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:"library",className:"h-full max-h-full flex-1 pb-20",children:jsxRuntime.jsxRuntimeExports.jsx(UILibrariesPanel,{parentId:x,position:g})}),C?jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:"html",className:"h-full max-h-full flex-1 pb-20",children:jsxRuntime.jsxRuntimeExports.jsx(ImportHTML,{parentId:x,position:g})}):null,lodashEs.map(T,O=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:O.key,children:React.createElement(O.tabContent,{close:M,parentId:x,position:g})}))]})]})};function usePubSub(r,h){React.useEffect(()=>{const x=pubsub.subscribe(r,h);return()=>x()},[r,h])}const AddBlocksDialog=()=>{const{t:r}=reactI18next.useTranslation(),[h,x]=React.useState(""),[g,v]=React.useState(-1),[R,A]=React.useState(!1);return usePubSub(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,j=>{x(j?j._id:null),v(isNaN(j==null?void 0:j.position)?-1:j==null?void 0:j.position),A(!0)}),usePubSub(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK,()=>{x(""),v(-1),A(!1)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialog,{open:R,onOpenChange:()=>R?A(!1):"",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogContent,{className:"max-w-5xl overflow-hidden border-border",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogHeader,{className:"flex flex-row items-center justify-between",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTitle,{className:"text-foreground",children:r("Add blocks")}),jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:()=>A(!1),className:"text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Cross2Icon,{className:"h-6 w-6"})})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-[500px] max-h-full overflow-hidden",children:jsxRuntime.jsxRuntimeExports.jsx(AddBlocksPanel,{parentId:h,position:g,showHeading:!1})})]})})};function FaFilePen(r){return iconBase.GenIcon({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 125.7-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"},child:[]}]})(r)}const QUICK_PROMPTS=[{name:"Improve writing",icon:FaFilePen,prompt:"Improving writing in all text elements. Replacing placeholder content with meaningful relevant content."},{name:"Replace placeholder content",icon:FaRecycle,prompt:"Discard current placeholder content and replace with meaningful relevant content."},{name:"Fix grammar",icon:reactIcons.CheckIcon,prompt:"Fix grammar in all text elements. Ensuring the text is grammatically correct and free of errors."},{name:"Make longer",icon:reactIcons.ArrowUpIcon,prompt:"Make all text elements longer."},{name:"Make shorter",icon:reactIcons.ArrowDownIcon,prompt:"Make all text elements shorter."},{name:"Add emojis",icon:lucideReact.SmileIcon,prompt:"Add emojis to text elements if relevant."},{name:"Randomize",icon:lucideReact.ShuffleIcon,prompt:"Randomize all text elements."}];function QuickPrompts({onClick:r}){const{loading:h}=useAskAi(),{t:x}=reactI18next.useTranslation(),{selectedLang:g,fallbackLang:v}=useLanguages(),R=[...QUICK_PROMPTS];return g&&g!==v&&R.splice(0,0,{name:`Translate to ${lodashEs.get(LANGUAGES,g,g)}`,icon:FaLanguage,prompt:`Translate the content to ${lodashEs.get(LANGUAGES,g,g)}. Maintain same tone, style and length.`}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:h?"pointer-events-none opacity-50":"",children:jsxRuntime.jsxRuntimeExports.jsx("ul",{className:"space-y-2",children:R.map(({name:A,icon:j,subMenus:C,prompt:T})=>C?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Popover,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs("li",{className:"flex cursor-pointer items-center space-x-2 rounded p-1 pl-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-800",children:[jsxRuntime.jsxRuntimeExports.jsx(j,{className:"h-4 w-4"}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:A})]},A)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.PopoverContent,{side:"right",children:jsxRuntime.jsxRuntimeExports.jsx("ul",{children:jsxRuntime.jsxRuntimeExports.jsx("li",{children:"Happy"})})})]}):jsxRuntime.jsxRuntimeExports.jsxs("li",{onClick:()=>r(T),className:"flex cursor-pointer items-center space-x-2 rounded p-1 text-sm hover:bg-gray-100 dark:hover:bg-gray-800",children:[jsxRuntime.jsxRuntimeExports.jsx(j,{className:"h-4 w-4"}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:x(A)})]},A))})})}const AIUserPrompt=({blockId:r})=>{const{t:h}=reactI18next.useTranslation(),{askAi:x,loading:g,error:v}=useAskAi(),[R,A]=React.useState(""),[j,C]=React.useState(!0),[T,M]=React.useState(),O=React.useRef(null),z=React.useRef(null);React.useEffect(()=>{var q;(q=O.current)==null||q.focus()},[]);const Z=q=>{const{usage:Y}=q||{};!v&&Y&&M(Y),z.current=setTimeout(()=>M(void 0),1e4),v||A("")};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:()=>C(!j),className:"flex cursor-pointer items-center justify-between border-t border-border py-2 text-sm font-medium hover:underline",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:h("Ask AI")}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 text-gray-500 "+(j?"rotate-180":"")})})]}),j&&r?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{ref:O,value:R,onChange:q=>A(q.target.value),placeholder:h("Ask AI to edit content"),className:"w-full",rows:3,onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),z.current&&clearTimeout(z.current),M(void 0),x("content",r,R,Z))}}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"my-2 flex items-center gap-2",children:[g?null:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:R.trim().length<5||g,onClick:()=>{z.current&&clearTimeout(z.current),M(void 0),x("content",r,R,Z)},variant:"default",className:"w-fit",size:"sm",children:g?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"h-5 w-5 animate-spin"}),h("Generating... Please wait...")]}):h("Edit with AI")}),g?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Skeleton,{className:"flex w-full items-center space-x-1 px-4 py-1 pl-2",children:[jsxRuntime.jsxRuntimeExports.jsx(FaSpinner,{className:"h-4 w-4 animate-spin text-gray-500"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs",children:h("Generating... Please wait...")})]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"destructive",onClick:()=>stop(),className:"hidden w-fit",size:"sm",children:h("Stop")})]}):null]}),T?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:jsxRuntime.jsxRuntimeExports.jsxs("p",{className:"mb-1 flex justify-between break-words rounded border border-blue-500 bg-blue-100 p-1 text-xs text-blue-500",children:[jsxRuntime.jsxRuntimeExports.jsxs("span",{children:[h("Total tokens used"),": ",T.totalTokens]}),jsxRuntime.jsxRuntimeExports.jsx(Countdown,{})]})}):null,jsxRuntime.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:v&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:v.message})}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx(QuickPrompts,{onClick:q=>{z.current&&clearTimeout(z.current),M(void 0),x("content",r,q,Z)}})]}):j?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4 text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.SparklesIcon,{className:"mx-auto text-3xl text-muted-foreground"}),jsxRuntime.jsxRuntimeExports.jsx("h1",{children:h("Please select a block to Ask AI")})]})}):null]})},AISetContext=()=>{const{t:r}=reactI18next.useTranslation(),h=useBuilderProp("aiContext",""),[x,g]=React.useState(h),v=React.useRef(null),R=useBuilderProp("saveAiContextCallback",lodashEs.noop),[A,j]=React.useState(!1),[C,T]=React.useState(null),[,M]=React.useState(!1),{toast:O}=contextMenu.useToast(),z=React.useRef(null);React.useEffect(()=>{h&&g(h)},[h]);const Z=async()=>{try{j(!0),T(null),await R(x),O({title:r("Updated AI Context"),description:r("You can now Ask AI to edit your content"),variant:"default"}),z.current.click()}catch(q){T(q)}finally{j(!1)}};return jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Accordion,{onValueChange:q=>{M(q!=="")},type:"single",collapsible:!0,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AccordionItem,{value:"set-context",className:"border-none",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AccordionTrigger,{ref:z,className:"border-0 border-border py-2",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-between",children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"font-medium",children:r("AI Context")})})}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AccordionContent,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{ref:v,value:x,onChange:q=>g(q.target.value),placeholder:r("Tell about this page eg this page is about"),className:"mt-1 w-full",rows:10,onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),Z())}}),h.trim().length===0?jsxRuntime.jsxRuntimeExports.jsx("p",{className:"mt-2 text-xs text-gray-500",children:r("Eg: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.")}):null,jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:x.trim().length<5,onClick:()=>Z(),variant:"default",className:"w-fit",size:"sm",children:A?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"h-5 w-5 animate-spin"}),r("Saving... Please wait...")]}):r("Save")}),h.trim().length>0?jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialog,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:h.trim().length===0,variant:"ghost",className:"w-fit",size:"sm",children:A?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Loader,{className:"h-5 w-5 animate-spin"}),r("Deleting... Please wait...")]}):r("Delete")})}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogContent,{children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogHeader,{children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogTitle,{children:[r("Delete context")," ?"]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogDescription,{})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogFooter,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogCancel,{children:r("Cancel")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogAction,{onClick:()=>{g(""),Z()},children:r("Yes, Delete")})]})]})]}):null]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mt-2 max-w-full",children:C&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:C.message})})]})]})})},AskAI=()=>{const[r]=useSelectedBlockIds();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar mt-2 flex-1 overflow-y-auto",children:[jsxRuntime.jsxRuntimeExports.jsx(AISetContext,{}),jsxRuntime.jsxRuntimeExports.jsx(AIUserPrompt,{blockId:lodashEs.first(r)})]})},AttrsEditor=React.memo(function r({preloadedAttributes:h=[],onAttributesChange:x}){const[g,v]=React.useState([]),[R,A]=React.useState(""),[j,C]=React.useState(""),[T,M]=React.useState(null),[O,z]=React.useState(""),Z=React.useRef(null),q=React.useRef(null);React.useEffect(()=>{v(h)},[h]);const Y=()=>{if(R.startsWith("@")){z("Attribute keys cannot start with '@'");return}if(R){const X=[...g,{key:R,value:j}];x(X),v(g),A(""),C(""),z("")}},P=X=>{const se=g.filter((pe,ve)=>ve!==X);x(se),v(se)},he=X=>{M(X),A(g[X].key),C(g[X].value)},te=()=>{if(R.startsWith("@")){z("Attribute keys cannot start with '@'");return}if(T!==null&&R){const X=[...g];X[T]={key:R,value:j},x(X),v(X),M(null),A(""),C(""),z("")}},ue=X=>{X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),T!==null?te():Y())};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex max-h-full flex-1 flex-col",children:[jsxRuntime.jsxRuntimeExports.jsxs("form",{onSubmit:X=>{X.preventDefault(),T!==null?te():Y()},className:"space-y-3",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{htmlFor:"attrKey",className:"text-[11px] font-normal leading-tight text-slate-600",children:"Key"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Input,{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",id:"attrKey",ref:Z,value:R,onChange:X=>A(X.target.value),placeholder:"Enter Key",className:"py-0 text-xs font-normal leading-tight placeholder:text-slate-400"})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{htmlFor:"attrValue",className:"text-[11px] font-normal text-slate-600",children:"Value"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{autoCapitalize:"off",autoCorrect:"off",spellCheck:"false",id:"attrValue",rows:2,ref:q,value:j,onChange:X=>C(X.target.value),onKeyDown:ue,placeholder:"Enter Value",className:"text-xs font-normal leading-tight placeholder:text-slate-400"})]})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{type:"submit",disabled:!R.length,variant:"default",size:"sm",className:"h-8 w-24 text-xs",children:T!==null?"Save":"Add"})}),O&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs text-red-500",children:O})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"space-y-1 py-4",children:g.map((X,se)=>jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col text-xs leading-tight",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:"truncate text-[12px] font-light text-muted-foreground",children:X.key}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-wrap max-w-[200px] font-normal",children:X.value.toString()})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex-shrink-0 text-slate-400",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>he(se),children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Edit2,{className:"h-3 w-3"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>P(se),children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.X,{className:"h-3 w-3"})})]})]},se))})]})}),BlockAttributesEditor=React__namespace.memo(()=>{const r=useSelectedBlock(),[h,x]=React.useState([]),[g]=useSelectedStylingBlocks(),v=useUpdateBlocksProps(),R=`${lodashEs.get(g,"0.prop")}_attrs`;React__namespace.useEffect(()=>{const j=lodashEs.map(lodashEs.get(r,R),(C,T)=>({key:T,value:C}));lodashEs.isEmpty(j)?x([]):x(j)},[lodashEs.get(r,R)]);const A=React__namespace.useCallback((j=[])=>{const C={};lodashEs.forEach(j,T=>{lodashEs.isEmpty(T.key)||lodashEs.set(C,T.key,T.value)}),v([lodashEs.get(r,"_id")],{[R]:C})},[r,v,R]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex-col gap-y-2",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsxRuntimeExports.jsx("div",{children:jsxRuntime.jsxRuntimeExports.jsx(AttrsEditor,{preloadedAttributes:h,onAttributesChange:A})})})})});function getDNDSupport(){return new URLSearchParams(window.location.search).has("dnd")}const FEATURE_TOGGLES={dnd:getDNDSupport()},builderStore=jotai.getDefaultStore(),setDebugLogs=r=>{},getParentNodeIds=(r,h)=>{const x=[];let g=lodashEs.find(r,{_id:h}),v=lodashEs.get(g,"_parent","");for(;lodashEs.isString(v)&&!lodashEs.isEmpty(v);)x.push(g==null?void 0:g._parent),g=lodashEs.find(r,{_id:v}),v=g==null?void 0:g._parent;return lodashEs.flatten(x)},expandedIdsAtom=jotai.atom([]),useExpandTree=()=>{const[r]=useSelectedBlockIds(),h=jotai.useAtomValue(presentBlocksAtom),[,x]=jotai.useAtom(expandedIdsAtom);React.useEffect(()=>{let g=[];const v=lodashEs.first(r);lodashEs.isString(v)&&(g=[v,...getParentNodeIds(h,v)]),x(g)},[r,h,x])},UndoRedo=()=>{const{hasUndo:r,hasRedo:h,undo:x,redo:g}=useUndoManager();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:!r(),size:"sm",onClick:x,className:"rounded-full",variant:"ghost",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ResetIcon,{})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:!h(),onClick:g,size:"sm",className:"rounded-full",variant:"ghost",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function DarkMode(){const[r,h]=useDarkMode();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.SunIcon,{className:"size-4 shrink-0"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Switch,{id:"dark-mode-switch",checked:r,onCheckedChange:()=>{h(!r)},className:`${r?"bg-violet-600":"bg-violet-300"} relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:jsxRuntime.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${r?"translate-x-5":"translate-x-0"} pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})}),jsxRuntime.jsxRuntimeExports.jsx(FaMoon,{className:"size-4 ml-3 shrink-0"})]})}const TabletIcon=({landscape:r=!1})=>jsxRuntime.jsxRuntimeExports.jsx("svg",{className:r?"rotate-90":"",stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"14px",width:"14px",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxRuntimeExports.jsx("path",{d:"M400 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM224 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm176-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h328c6.6 0 12 5.4 12 12v312z"})}),WEB_BREAKPOINTS=[{title:"Mobile (XS)",content:"Styles set here are applied to all screen unless edited at higher breakpoint",breakpoint:"xs",icon:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.MobileIcon,{}),width:400},{title:"Mobile landscape (SM)",content:"Styles set here are applied at 640px and up unless edited at higher breakpoint",breakpoint:"sm",icon:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.MobileIcon,{className:"rotate-90"}),width:640},{title:"Tablet (MD)",content:"Styles set here are applied at 768px and up",breakpoint:"md",icon:jsxRuntime.jsxRuntimeExports.jsx(TabletIcon,{}),width:800},{title:"Tablet Landscape (LG)",content:"Styles set here are applied at 1024px and up unless edited at higher breakpoint",breakpoint:"lg",icon:jsxRuntime.jsxRuntimeExports.jsx(TabletIcon,{landscape:!0}),width:1024},{title:"Desktop (XL)",content:"Styles set here are applied at 1280px and up unless edited at higher breakpoint",breakpoint:"xl",icon:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.LaptopIcon,{}),width:1420},{title:"Large Desktop (2XL)",content:"Styles set here are applied at 1536px and up",breakpoint:"2xl",icon:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DesktopIcon,{}),width:1920}],BreakpointCard=({title:r,content:h,currentBreakpoint:x,breakpoint:g,width:v,icon:R,onClick:A})=>{const{t:j}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.HoverCard,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.HoverCardTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>A(v),size:"sm",variant:g===x?"secondary":"ghost",children:R})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.HoverCardContent,{className:"w-52 border-border",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:j(r)}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs",children:j(h)})]})})})]})},Breakpoints=()=>{const[,r,h]=useCanvasWidth(),[x,g]=useSelectedBreakpoints(),{t:v}=reactI18next.useTranslation(),R=useBuilderProp("breakpoints",WEB_BREAKPOINTS),A=j=>{x.includes(j)?x.length>2&&g(x.filter(C=>C!==j)):g(C=>[...C,j])};return R.length<4?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:lodashEs.map(R,j=>React.createElement(BreakpointCard,{...j,onClick:h,key:j.breakpoint,currentBreakpoint:r}))}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[lodashEs.map(R.filter(j=>lodashEs.includes(x,lodashEs.toUpper(j.breakpoint))),j=>React.createElement(BreakpointCard,{...j,onClick:h,key:j.breakpoint,currentBreakpoint:r})),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenu,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DotsVerticalIcon,{className:"scale-90 transform"})})}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuLabel,{children:v("Breakpoints")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuSeparator,{}),lodashEs.map(R,j=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuCheckboxItem,{disabled:j.breakpoint==="xs",onCheckedChange:()=>A(lodashEs.toUpper(j.breakpoint)),checked:lodashEs.includes(x,lodashEs.toUpper(j.breakpoint)),children:v(j.title)},j.breakpoint))]})]})]})},ClearCanvas=()=>{const{t:r}=reactI18next.useTranslation(),{setNewBlocks:h}=useBlocksStoreUndoableActions(),[,x]=useSelectedBlockIds(),[,g]=useSelectedStylingBlocks(),v=React.useCallback(()=>{h([]),x([]),g([])},[h]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialog,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.EraserIcon,{})," ",r("Clear")]})}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogContent,{className:"border-border",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogHeader,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTitle,{className:"text-foreground",children:r("Clear whole canvas? ")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogDescription,{children:r("Are you sure you want to clear the page?")})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogFooter,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogCancel,{className:"text-foreground",children:r("Cancel")}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogAction,{onClick:v,children:r("Yes")})]})]})]})})},AiAssistant=()=>{const r=useAiAssistant(),[h]=useRightPanel(),x=useBuilderProp("askAiCallBack",null),{t:g}=reactI18next.useTranslation();return x?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Label,{htmlFor:"ai-assistant",className:"flex items-center gap-x-1 text-sm text-yellow-600",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.SparklesIcon,{className:"w-4"}),g("AI Assistant")]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Switch,{className:"scale-90",checked:h==="ai",onCheckedChange:v=>{r(v)},id:"ai-assistant"})]}):null},CanvasTopBar=()=>{const r=useBuilderProp("darkMode",!0),[h]=useCanvasZoom();return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-border bg-background/70 px-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[jsxRuntime.jsxRuntimeExports.jsx(Breakpoints,{}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Separator,{orientation:"vertical"}),r?jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsx(DarkMode,{}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Separator,{orientation:"vertical"})]}):null,jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[lodashEs.round(h,0),"%"]})]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Separator,{orientation:"vertical"}),jsxRuntime.jsxRuntimeExports.jsx(UndoRedo,{})]}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[jsxRuntime.jsxRuntimeExports.jsx(ClearCanvas,{}),jsxRuntime.jsxRuntimeExports.jsx(AiAssistant,{})]})]})};function BlockAttributesToggle(){const{t:r}=reactI18next.useTranslation(),[h,x]=React.useState(!0),[g]=useSelectedStylingBlocks();return lodashEs.isEmpty(g)?null:jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment,{children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:()=>x(!h),className:"flex cursor-pointer items-center justify-between border-t border-border py-3 text-xs font-medium hover:underline",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:r("Attributes")}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 text-gray-500 "+(h?"rotate-180":"")})})]}),h&&jsxRuntime.jsxRuntimeExports.jsx(BlockAttributesEditor,{})]})}const SettingsPanel=()=>{const r=useSelectedBlock(),{t:h}=reactI18next.useTranslation(),x=useBuilderProp("onError",lodashEs.noop);return lodashEs.isNull(r)?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4 text-muted-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),jsxRuntime.jsxRuntimeExports.jsx("h1",{children:h("Please select a block to edit settings or styles")})]})}):jsxRuntime.jsxRuntimeExports.jsx(reactErrorBoundary.ErrorBoundary,{fallback:jsxRuntime.jsxRuntimeExports.jsx(FallbackError,{}),onError:x,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tabs,{defaultValue:"settings",className:"flex flex-1 flex-col",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TabsList,{className:"grid h-auto w-full grid-cols-2 p-1 py-1",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"settings",className:"text-xs",children:"Settings"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:"styles",className:"text-xs",children:"Styles"})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TabsContent,{value:"settings",className:"no-scrollbar h-full max-h-min overflow-y-auto",children:[jsxRuntime.jsxRuntimeExports.jsx(BlockSettings,{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TabsContent,{value:"styles",className:"no-scrollbar h-full max-h-min max-w-full overflow-y-auto overflow-x-hidden",children:[jsxRuntime.jsxRuntimeExports.jsx(BlockStyling,{}),jsxRuntime.jsxRuntimeExports.jsx(BlockAttributesToggle,{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})]})})};function LayoutCard({disabled:r=!1,description:h,title:x,selected:g,onSelect:v,children:R}){const{t:A}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Card,{"aria-disabled":r,className:`cursor-pointer border-border transition-all ${g?"ring-2 ring-secondary":""} ${r?"cursor-not-allowed opacity-50":""}`,onClick:v,children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.CardContent,{className:"p-4",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxRuntimeExports.jsx("h3",{className:"text-lg font-semibold",children:x}),g&&jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CheckIcon,{className:"h-6 w-6 rounded-full bg-background p-px text-foreground"})]}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:h}),R,jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{disabled:r,className:"mt-4 w-full",variant:g?"default":"outline",children:A(r?"Coming soon":g?"Selected":"Select")})]})})}const ChooseLayout=({open:r,close:h})=>{const{t:x}=reactI18next.useTranslation(),[g,v]=useLayoutVariant(),R=A=>{v(A),h()};return jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialog,{open:r,onOpenChange:()=>r?h():"",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogContent,{className:"max-w-4xl overflow-hidden border-border",children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.AlertDialogHeader,{className:"flex flex-row items-center justify-between",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialogTitle,{className:"text-foreground",children:x("Choose Builder Layout")}),jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:()=>h(),className:"text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Cross2Icon,{className:"h-6 w-6"})})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar max-h-full overflow-hidden",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxRuntime.jsxRuntimeExports.jsx(LayoutCard,{title:x("Single side panel"),description:x("Suitable for smaller screens. Bigger canvas size."),selected:g==="SINGLE_SIDE_PANEL",onSelect:()=>R("SINGLE_SIDE_PANEL"),children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col rounded border border-border",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"borde-b h-4 border-b border-border"}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-32",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-3/4 border-l border-border bg-background"})]})]})}),jsxRuntime.jsxRuntimeExports.jsx(LayoutCard,{title:x("Dual side panel"),description:x("Suitable for larger screens. Blocks settings is always visible."),selected:g==="DUAL_SIDE_PANEL",onSelect:()=>R("DUAL_SIDE_PANEL"),children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col rounded border border-border",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"borde-b h-4 border-b border-border"}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-32",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-2/4 border-x border-border bg-background"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"})]})]})}),jsxRuntime.jsxRuntimeExports.jsx(LayoutCard,{disabled:!0,title:x("Dual side panel advanced"),description:x("Suitable for heavy styling & block editing. Setting are always visible."),selected:!1,onSelect:()=>{},children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col rounded border border-border",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"borde-b h-4 border-b border-border"}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-32",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-2/4 border-x border-border bg-background"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-1/4 bg-secondary"})]})]})})]})})]})})},TopBar=React.lazy(()=>Promise.resolve().then(()=>require("./Topbar-CiOsi4Ut.cjs")));function useSidebarMenuItems(){return React.useMemo(()=>{const r=[{icon:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Layers,{size:20}),label:"Outline",component:()=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"-mt-8",children:jsxRuntime.jsxRuntimeExports.jsx(ListTree,{})})}];return lodashEs.compact(r)},[])}const RootLayout=()=>{const[r,h]=React.useState(0),[x,g]=React.useState(!1),[v,R]=useRightPanel();usePubSub(CHAI_BUILDER_EVENTS.SHOW_BLOCK_SETTINGS,()=>{h(1)});const A=useBuilderProp("sideBarComponents.top",[]),j=useBuilderProp("sideBarComponents.bottom",[]),C=q=>{q.preventDefault()},T=q=>{h(r===q?null:q)},M=useSidebarMenuItems(),{t:O}=reactI18next.useTranslation(),z=[...M,...A],Z=useBuilderProp("htmlDir","ltr");return jsxRuntime.jsxRuntimeExports.jsx("div",{dir:Z,className:"h-screen max-h-full w-screen overflow-x-hidden bg-background text-foreground",children:jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.TooltipProvider,{children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onContextMenu:C,className:"flex h-screen max-h-full flex-col bg-background text-foreground",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntime.jsxRuntimeExports.jsx(TopBar,{})})}),jsxRuntime.jsxRuntimeExports.jsxs("main",{className:"relative flex h-[calc(100vh-56px)] max-w-full flex-1 flex-row",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex w-12 flex-col items-center justify-between border-r border-border py-2",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col",children:z.map((q,Y)=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:r===Y?"default":"ghost",className:"mb-2 rounded-lg p-2 transition-colors",onClick:()=>T(Y),children:lodashEs.get(q,"icon",null)},Y)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{side:"right",children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:O(q.label)})})]},"button"+Y))}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col",children:j==null?void 0:j.map((q,Y)=>jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx("div",{}),children:React.createElement(q,{key:Y})}))})]}),jsxRuntime.jsxRuntimeExports.jsx(framerMotion.motion.div,{className:"h-full max-h-full border-r border-border",initial:{width:280},animate:{width:r!==null?280:0},transition:{duration:.3,ease:"easeInOut"},children:r!==null&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar overflow h-full overflow-x-hidden",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex flex-col p-3",children:[jsxRuntime.jsxRuntimeExports.jsxs("h2",{className:"-mt-1 flex h-10 items-center space-x-1 text-base font-bold",children:[jsxRuntime.jsxRuntimeExports.jsx("span",{className:"rtl:ml-2 rtl:inline-block",children:lodashEs.get(z,`${r}.icon`,null)}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:O(z[r].label)})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex-1",children:jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:React.createElement(lodashEs.get(z,`${r}.component`,null),{})})})]})})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col bg-slate-800/20",children:[jsxRuntime.jsxRuntimeExports.jsx(CanvasTopBar,{}),jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntime.jsxRuntimeExports.jsx(CanvasArea,{})})]}),jsxRuntime.jsxRuntimeExports.jsx(framerMotion.motion.div,{className:"h-full max-h-full border-l border-border",initial:{width:280},animate:{width:280},transition:{duration:.3,ease:"easeInOut"},children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"no-scrollbar overflow h-full max-h-full overflow-hidden",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex h-full max-h-full flex-col overflow-hidden p-3",children:[jsxRuntime.jsxRuntimeExports.jsx("h2",{className:"-mt-1 flex items-center space-x-1 text-base font-bold",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex grow items-center gap-2",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-between gap-2",children:v==="ai"?jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.LightningBoltIcon,{className:"rtl:ml-2"})," ",O("AI Assistant")]})}):v==="theme"?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[jsxRuntime.jsxRuntimeExports.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsxRuntimeExports.jsx(lucideReact.Paintbrush,{className:"h-4 w-4 rtl:ml-2"}),O("Theme Settings")]}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>R("block"),variant:"ghost",size:"icon",className:"text-xs text-gray-400",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.X,{className:"h-4 w-4 rtl:ml-2"})})]}):null})})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex max-h-full w-full",children:jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:v==="ai"?jsxRuntime.jsxRuntimeExports.jsx(AskAI,{}):v==="theme"?jsxRuntime.jsxRuntimeExports.jsx(ThemeConfigPanel,{}):jsxRuntime.jsxRuntimeExports.jsx(SettingsPanel,{})})})]})})})]})]}),jsxRuntime.jsxRuntimeExports.jsx(AddBlocksDialog,{}),jsxRuntime.jsxRuntimeExports.jsx(ChooseLayout,{open:x,close:()=>g(!1)})]})})},PreviewScreen=()=>{const[r,h]=usePreviewMode(),{t:x}=reactI18next.useTranslation(),g=useBuilderProp("previewComponent",null);return r?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:iconBase.cn("fixed inset-0 z-[999] bg-background",r?"block":"hidden"),children:[jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Button,{size:"sm",className:"absolute right-0 top-0 m-4 space-x-2",onClick:()=>h(!1),children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.EyeClosedIcon,{}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:x("Close Preview")})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{children:g?jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Skeleton,{className:"h-96 w-full"}),children:React.createElement(g)}):null})]}):null},SmallScreenMessage=()=>jsxRuntime.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[jsxRuntime.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})}),useAutoSave=()=>{const{savePage:r}=useSavePage(),h=useBuilderProp("autoSaveSupport",!0),x=useBuilderProp("autoSaveInterval",60);web.useIntervalEffect(()=>{h&&r(!0)},x*1e3)},ChaiBuilderComponent=r=>{const[,h]=useBlocksStore(),x=useBuilderReset(),[g]=useAtom(builderSaveStateAtom),v=React.useMemo(()=>r.layout||RootLayout,[r.layout]);useAtom(selectedLibraryAtom),useKeyEventWatcher(),useExpandTree(),useAutoSave(),useWatchGlobalBlocks(),useUnmountBroadcastChannel();const{postMessage:R}=useBroadcastChannel();return React.useEffect(()=>{builderStore.set(chaiBuilderPropsAtom,lodashEs.omit(r,["blocks","subPages","brandingOptions","dataProviders","customRootLayout","translations"]))},[r]),React.useEffect(()=>{setTimeout(()=>{h(r.blocks||[]),r.blocks&&r.blocks.length>0&&R({type:"blocks-updated",blocks:r.blocks||[]}),x()},400)},[r.blocks]),React.useEffect(()=>{i18n.changeLanguage(r.locale||"en")},[r.locale]),React.useEffect(()=>{setDebugLogs(r.showDebugLogs)},[r.showDebugLogs]),React.useEffect(()=>{r.translations&&lodashEs.each(r.translations,(A,j)=>{i18n.addResourceBundle(j,"translation",A,!0,!0)})},[r.translations]),React.useEffect(()=>(g!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[g]),jsxRuntime.jsxRuntimeExports.jsx(v,{})},ChaiBuilderEditor=r=>{const h=r._flags||{},x=r.onError||lodashEs.noop;return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"w-screen h-screen",children:jsxRuntime.jsxRuntimeExports.jsx(reactErrorBoundary.ErrorBoundary,{fallback:jsxRuntime.jsxRuntimeExports.jsx(FallbackError,{}),onError:x,children:jsxRuntime.jsxRuntimeExports.jsxs(flagged.FlagsProvider,{features:{...FEATURE_TOGGLES,...h},children:[jsxRuntime.jsxRuntimeExports.jsx(SmallScreenMessage,{}),jsxRuntime.jsxRuntimeExports.jsx(ChaiBuilderComponent,{...r}),jsxRuntime.jsxRuntimeExports.jsx(PreviewScreen,{}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Toaster,{})]})})})};exports.generateBlockId=iconBase.generateUUID;exports.mergeClasses=iconBase.cn;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>reactI18next.useTranslation});Object.defineProperty(exports,"registerChaiBlock",{enumerable:!0,get:()=>runtime.registerChaiBlock});exports.i18n=i18n;exports.AISetContext=AISetContext;exports.AIUserPrompt=AIUserPrompt;exports.AddBlocksDialog=AddBlocksDialog;exports.AddBlocksPanel=AddBlocksPanel;exports.BlockAttributesEditor=BlockAttributesEditor;exports.BlockPropsEditor=BlockSettings;exports.BlockStyleEditor=BlockStyling;exports.CHAI_BUILDER_EVENTS=CHAI_BUILDER_EVENTS;exports.ChaiBuilderCanvas=CanvasArea;exports.ChaiBuilderEditor=ChaiBuilderEditor;exports.DarkModeSwitcher=DarkMode;exports.DefaultChaiBlocks=DefaultChaiBlocks;exports.ImportHTML=ImportHTML;exports.Outline=ListTree;exports.ScreenSizes=Breakpoints;exports.ThemeOptions=ThemeConfigPanel;exports.UILibraries=UILibrariesPanel;exports.UndoRedo=UndoRedo;exports.getBlocksFromHTML=getBlocksFromHTML;exports.getClassValueAndUnit=getClassValueAndUnit;exports.useAddBlock=useAddBlock;exports.useAddClassesToBlocks=useAddClassesToBlocks;exports.useAskAi=useAskAi;exports.useBlockHighlight=useBlockHighlight;exports.useBlocksStore=useBlocksStore;exports.useBlocksStoreUndoableActions=useBlocksStoreUndoableActions;exports.useBrandingOptions=useBrandingOptions;exports.useBuilderProp=useBuilderProp;exports.useBuilderReset=useBuilderReset;exports.useCanvasWidth=useCanvasWidth;exports.useCanvasZoom=useCanvasZoom;exports.useCodeEditor=useCodeEditor;exports.useCopyBlockIds=useCopyBlockIds;exports.useCopyToClipboard=useCopyToClipboard;exports.useCurrentPage=useCurrentPage;exports.useCutBlockIds=useCutBlockIds;exports.useDarkMode=useDarkMode;exports.useDuplicateBlocks=useDuplicateBlocks;exports.useGlobalBlocksList=useGlobalBlocksList;exports.useGlobalBlocksStore=useGlobalBlocksStore;exports.useHiddenBlockIds=useHiddenBlockIds;exports.useHighlightBlockId=useHighlightBlockId;exports.useLanguages=useLanguages;exports.useLayoutVariant=useLayoutVariant;exports.usePasteBlocks=usePasteBlocks;exports.usePreviewMode=usePreviewMode;exports.useRemoveBlocks=useRemoveBlocks;exports.useRemoveClassesFromBlocks=useRemoveClassesFromBlocks;exports.useRightPanel=useRightPanel;exports.useSavePage=useSavePage;exports.useSelectedBlock=useSelectedBlock;exports.useSelectedBlockAllClasses=useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=useSelectedBreakpoints;exports.useSelectedStylingBlocks=useSelectedStylingBlocks;exports.useStylingBreakpoint=useStylingBreakpoint;exports.useStylingState=useStylingState;exports.useTheme=useTheme;exports.useThemeOptions=useThemeOptions;exports.useUILibraryBlocks=useUILibraryBlocks;exports.useUndoManager=useUndoManager;exports.useUpdateBlocksProps=useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=useUpdateBlocksPropsRealtime;exports.useWrapperBlock=useWrapperBlock;
|