@chaibuilder/sdk 2.0.0-beta.54 → 2.0.0-beta.56
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/{CodeEditor-DvFaAnJ4.js → CodeEditor-BLTQpTTM.js} +2 -2
- package/dist/{CodeEditor-CzoZfMYd.cjs → CodeEditor-CJhjQonw.cjs} +1 -1
- package/dist/{Topbar-XpkgGUK2.js → Topbar-CEyGOl06.js} +2 -2
- package/dist/{Topbar-Zby0BmoN.cjs → Topbar-pFV2NO8v.cjs} +1 -1
- package/dist/{context-menu-dsqhw1Ub.cjs → context-menu-C_ITMOD1.cjs} +1 -1
- package/dist/{context-menu-BsI3Hqio.js → context-menu-FCyNTUkl.js} +1 -1
- package/dist/core.cjs +5 -246
- package/dist/core.d.ts +15 -15
- package/dist/core.js +3509 -28338
- package/dist/jsx-runtime-Drh4NO5G.js +633 -0
- package/dist/jsx-runtime-qcKc-DpB.cjs +30 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +2 -2
- package/dist/render.js +92 -83
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +14 -14
- package/dist/ui.js +3 -3
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +7 -6
- package/dist/jsx-runtime-DGh1k5sI.cjs +0 -31
- package/dist/jsx-runtime-Dx-03ztt.js +0 -445
package/dist/core.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Wv=Object.defineProperty;var Fv=(r,h,x)=>h in r?Wv(r,h,{enumerable:!0,configurable:!0,writable:!0,value:x}):r[h]=x;var gm=(r,h,x)=>Fv(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"),jotai=require("jotai"),lodashEs=require("lodash-es"),reactWrapBalancer=require("react-wrap-balancer"),iconBase=require("./iconBase-Cn2BsTrq.cjs"),reactI18next=require("react-i18next"),dom=require("@floating-ui/dom"),reactDom=require("@floating-ui/react-dom"),reactIcons=require("@radix-ui/react-icons"),web=require("@react-hookz/web"),flagged=require("flagged"),runtime=require("@chaibuilder/runtime"),ChaiThemeFn=require("./ChaiThemeFn-DQu-2Eh9.cjs"),TreeModel=require("tree-model"),reactHotkeysHook=require("react-hotkeys-hook"),lucideReact=require("lucide-react"),ReactQuill=require("react-quill"),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"),ReactDOM=require("react-dom"),reactErrorBoundary=require("react-error-boundary"),reResizable=require("re-resizable"),RjForm=require("@rjsf/core"),validator=require("@rjsf/validator-ajv8"),IconPicker=require("react-icons-picker"),Autosuggest=require("react-autosuggest"),Fuse=require("fuse.js"),himalaya=require("himalaya"),clsx=require("clsx"),reactArborist=require("react-arborist"),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);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,O=new Set,N=new Set,z=()=>{var be;const ge=[],je=se=>{try{se()}catch(me){ge.push(me)}};do{(be=xe[INTERNAL_flushStoreHook])==null||be.call(xe);const se=new Set,me=se.add.bind(se);T.forEach(V=>{var ie;return(ie=V.m)==null?void 0:ie.l.forEach(me)}),T.clear(),O.forEach(me),O.clear(),N.forEach(me),N.clear(),se.forEach(je),T.size&&te()}while(T.size||O.size||N.size);if(ge.length)throw ge[0]},Z=(be,ge,je)=>{const se="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,(!se||!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 se=!0;const me=()=>{je.m&&(oe(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),se||me()}};let ie,re;const Ae={get signal(){return ie||(ie=new AbortController),ie.signal},get setSelf(){return!re&&isActuallyWritableAtom(be)&&(re=(...Re)=>{if(!se)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{se=!1}},Y=be=>returnAtomValue(q(be)),P=be=>{var ge;const je=new Map;for(const se of((ge=be.m)==null?void 0:ge.t)||[]){const me=j(se);me.m&&je.set(se,me)}for(const se of be.p)je.set(se,j(se));return je},he=be=>{const ge=[be];for(;ge.length;){const je=ge.pop();for(const[se,me]of P(je))C.has(se)||(C.set(se,me.n),ge.push(me))}},te=()=>{var be;const ge=[],je=new WeakSet,se=new WeakSet,me=Array.from(T);for(;me.length;){const[V,ie]=me[me.length-1];if(se.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)),se.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),oe(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 se=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),oe(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,se,me,...ge)}finally{je=!1}},X=(be,...ge)=>{try{return ue(be,...ge)}finally{te(),z()}},oe=(be,ge)=>{var je;if(ge.m&&!isPendingPromise(ge.v)){for(const[se,me]of ge.d)if(!ge.m.d.has(se)){const V=j(se);pe(se,V).t.add(be),ge.m.d.add(se),me!==V.n&&(T.set(se,V),(je=V.u)==null||je.call(V),he(V))}for(const se of ge.m.d||[])if(!ge.d.has(se)){ge.m.d.delete(se);const me=ve(se,j(se));me==null||me.t.delete(be)}}},pe=(be,ge)=>{var je;if(!ge.m){q(be);for(const se of ge.d.keys())pe(se,j(se)).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 se=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&&(se.u=()=>{V=!0;try{re()}finally{V=!1}})}finally{V=!1}};N.add(me)}}return ge.m},ve=(be,ge)=>{var je;if(ge.m&&!ge.m.l.size&&!Array.from(ge.m.t).some(se=>{var me;return(me=j(se).m)==null?void 0:me.d.has(be)})){const se=ge.m.u;se&&O.add(se),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),O=[],N=[];return A.forEach((z,Z)=>{const q=Z;N[Z]=q;const Y=T&&T.atomList[T.keyList.indexOf(q)];if(Y){O[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 oe=te(v),pe=te(r),Me=g(pe,oe==null?void 0:oe.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)])};O[Z]=isWritable(r)?atom(P,he):atom(P)}),T&&T.keyList.length===N.length&&T.keyList.every((z,Z)=>z===N[Z])?C=T:C={arr:A,atomList:O,keyList:N},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 O=A(r);j(r,[...O.slice(0,T),...O.slice(T+1)])}break}case"insert":{const T=C.before?A(R).indexOf(C.before):A(R).length;if(T>=0){const O=A(r);j(r,[...O.slice(0,T),C.value,...O.slice(T)])}break}case"move":{const T=A(R).indexOf(C.atom),O=C.before?A(R).indexOf(C.before):A(R).length;if(T>=0&&O>=0){const N=A(r);T<O?j(r,[...N.slice(0,T),...N.slice(T+1,O),N[T],...N.slice(O)]):j(r,[...N.slice(0,O),N[T],...N.slice(O,T),...N.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 O,N;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=(N=(O=r())==null?void 0:O.getItem(C))!=null?N:null;return isPromiseLike$1(Z)?Z.then(z):z(Z)},setItem:(C,T)=>{var O;return(O=r())==null?void 0:O.setItem(C,JSON.stringify(T,void 0))},removeItem:C=>{var T;return(T=r())==null?void 0:T.removeItem(C)}},A=C=>(T,O,N)=>C(T,z=>{let Z;try{Z=JSON.parse(z||"")}catch{Z=N}O(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 O=N=>{N.storageArea===r()&&N.key===C&&T(N.newValue)};return window.addEventListener("storage",O),()=>{window.removeEventListener("storage",O)}}),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(O=>(j(v,O),x.setItem(r,O))):(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 O=x.get(r);return Object.is(T[0],O)&&T[1]===x&&T[2]===r?T:[O,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)]}const 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 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);gm(this,"setRef",x=>{this.nodeRef.current=x;const{forwardedRef:g}=this.props;typeof g=="function"?g(x):g&&(g.current=x)});gm(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});gm(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()})}}gm(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})),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},canDropBlock=(r,{dragSource:h,dropTarget:x})=>{const g=lodashEs.get(h,"data._type",""),v=lodashEs.get(x,"data._type","");return canAcceptChildBlock(v,g)};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 O=lodashEs.find(R,{oldId:C[T].replace("slot:","")});j[T]=`slot:${O._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,O){return!T||typeof T[O]!="function"?this:(A=!0,T[O](),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 O=T.groupId;for(;T.groupId===O&&(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 O=T.groupId;for(;T.groupId===O&&(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(O=>O.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 chaiRjsfFieldsAtom=jotai.atom({});chaiRjsfFieldsAtom.debugLabel="chaiRjsfFieldsAtom";const chaiRjsfWidgetsAtom=jotai.atom({});chaiRjsfWidgetsAtom.debugLabel="chaiRjsfWidgetsAtom";const chaiRjsfTemplatesAtom=jotai.atom({});chaiRjsfTemplatesAtom.debugLabel="chaiRjsfTemplatesAtom";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[React.useMemo(()=>({...h,...!lodashEs.isEmpty(x)&&x,...!lodashEs.isEmpty(g)&&g}),[h,x,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 oe=h.find(Me=>Me._id===ue)._parent||null,ve=h.filter(Me=>oe?Me._parent===oe:!Me._parent).map(Me=>Me._id).indexOf(ue);return{_id:ue,oldParent:oe,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:oe})=>{R([ue],X,oe)}),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),oe={_id:ue};return lodashEs.each(te,pe=>oe[pe]=X[pe]),oe})}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,O;return A&&(T=lodashEs.find(r,{_id:A}),R[0]._parent=A,O=A),!(T?canAcceptChildBlock(T==null?void 0:T._type,C._type):!0)&&T&&(R[0]._parent=T._parent,O=T._parent),x(R,O,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),O={_type:R.type,_id:C,...T};let N,z;return A&&(N=lodashEs.find(r,{_id:A}),O._parent=A,z=A),!canAcceptChildBlock(N==null?void 0:N._type,O._type)&&N&&(O._parent=N._parent,z=N._parent),x([O],z,j),h([O._id]),O},[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}function orderClassesByBreakpoint(r){r=r.replace(/\s+/g," ");const h=r.split(" ").map(constructClassObject),x=["xs","sm","md","lg","xl","2xl"];return h.sort((g,v)=>x.indexOf(g.mq)-x.indexOf(v.mq)).map(g=>g.fullCls).join(" ")}function removeDuplicateClasses(r){if(r=r.replace(/\s+/g," "),!r)return"";const h=["xs","sm","md","lg","xl","2xl"],x=r.split(" ").map(constructClassObject);let g=r;if(x.length===1)return x[0].fullCls;for(const v of x){const R=v.property,A=h.indexOf(v.mq);for(let j=A+1;j<h.length;j++){const C=h[j],T=x.find(O=>O.property===R&&O.mq===C);if(T&&T.cls===v.cls)g=g.replace(T.fullCls,"");else if(T&&T.cls!==v.cls)break}}return g.replace(/\s+/g," ").trim()}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},`),{classes:T}=getSplitClasses$1(C);return{ids:[j._id],props:{[R.prop]:`${STRINGS.STYLES_KEY},${orderClassesByBreakpoint(removeDuplicateClasses(tailwindMerge.twMerge(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 O=lodashEs.filter(r,z=>lodashEs.isString(v)?z._parent===v:!z._parent).indexOf(j)+1,N=getDuplicatedBlocks(r,A,v);x(N,v,O),R.push(lodashEs.get(N,"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 O=JSON.parse(T);lodashEs.has(O,"_chai_copied_blocks")?R(O._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:O}=getSplitClasses(lodashEs.get(j,v.prop,"styles:,"));return lodashEs.each(C,N=>{const z=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Z=new RegExp(`(^|\\s)${z}(?=\\s|$)`,"g");T=T.replace(Z," ").replace(/\s+/g," ").trim();const q=lodashEs.first(N.split(":"));lodashEs.includes(["2xl","xl","lg","md","sm"],q)&&C.push(N.split(":").pop().trim())}),lodashEs.each(C,N=>{const z=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Z=new RegExp(`(^|\\s)${z}(?=\\s|$)`,"g");O=O.replace(Z," ").replace(/\s+/g," ").trim()}),{ids:[j._id],props:{[v.prop]:`${STRINGS.STYLES_KEY}${O},${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(O=>setTimeout(O,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]};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(),O=C.length?C:T,N=(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):[N(Z,j)],te=await v(z,addLangToPrompt(q,O,z),he,P),{blocks:ue,error:X}=te;if(X){g(X);return}if(z==="styles"){const oe=ue.map(pe=>{for(const ve in pe)ve!=="_id"&&(pe[ve]=`${STRINGS.STYLES_KEY},${pe[ve]}`);return pe});A(oe)}else R(ue);Y&&Y(te)}catch(P){g(P)}finally{h(!1),Y&&Y()}}},[v,h,C,T,j,O,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]},CHAI_BUILDER_EVENTS={OPEN_ADD_BLOCK:"OPEN_ADD_BLOCK",CLOSE_ADD_BLOCK:"CLOSE_ADD_BLOCK",SHOW_BLOCK_SETTINGS:"SHOW_BLOCK_SETTINGS"};class PubSub{constructor(){gm(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,draggedBlockAtom=jotai.atom(null),dropTargetBlockIdAtom=jotai.atom(null),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]})},BlockFloatingSelector=({selectedBlockElement:r,block:h})=>{const x=useRemoveBlocks(),g=useDuplicateBlocks(),[,v]=useSelectedBlockIds(),[,R]=useHighlightBlockId(),[,A]=useSelectedStylingBlocks(),[j]=jotai.useAtom(inlineEditingActiveAtom),{floatingStyles:C,refs:T,update:O}=reactDom.useFloating({placement:"top-start",middleware:[reactDom.shift(),dom.flip()],elements:{reference:r}});web.useResizeObserver(r,()=>O(),r!==null);const N=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:[N&&jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{A([]),v([N])}}),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]})]})})},IframeInitialContent=`<!doctype html>
|
|
1
|
+
"use strict";var F=Object.defineProperty;var z=(o,n,r)=>n in o?F(o,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[n]=r;var U=(o,n,r)=>z(o,typeof n!="symbol"?n+"":n,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("./jsx-runtime-qcKc-DpB.cjs"),React=require("react"),contextMenu=require("./context-menu-C_ITMOD1.cjs"),jotai=require("jotai"),lodashEs=require("lodash-es"),reactWrapBalancer=require("react-wrap-balancer"),iconBase=require("./iconBase-Cn2BsTrq.cjs"),reactI18next=require("react-i18next"),dom=require("@floating-ui/dom"),reactDom=require("@floating-ui/react-dom"),reactIcons=require("@radix-ui/react-icons"),web=require("@react-hookz/web"),flagged=require("flagged"),runtime=require("@chaibuilder/runtime"),ChaiThemeFn=require("./ChaiThemeFn-DQu-2Eh9.cjs"),TreeModel=require("tree-model"),reactHotkeysHook=require("react-hotkeys-hook"),lucideReact=require("lucide-react"),ReactQuill=require("react-quill"),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"),ReactDOM=require("react-dom"),reactErrorBoundary=require("react-error-boundary"),reResizable=require("re-resizable"),RjForm=require("@rjsf/core"),validator=require("@rjsf/validator-ajv8"),IconPicker=require("react-icons-picker"),Autosuggest=require("react-autosuggest"),Fuse=require("fuse.js"),himalaya=require("himalaya"),clsx=require("clsx"),reactArborist=require("react-arborist"),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);let keyCount=0;function atom(o,n){const r=`atom${++keyCount}`,a={toString(){return r}};return typeof o=="function"?a.read=o:(a.init=o,a.read=defaultRead,a.write=defaultWrite),n&&(a.write=n),a}function defaultRead(o){return o(this)}function defaultWrite(o,n,r){return n(this,typeof r=="function"?r(o(this)):r)}const isSelfAtom=(o,n)=>o.unstable_is?o.unstable_is(n):n===o,hasInitialValue=o=>"init"in o,isActuallyWritableAtom=o=>!!o.write,cancelablePromiseMap=new WeakMap,isPendingPromise=o=>{var n;return isPromiseLike$2(o)&&!((n=cancelablePromiseMap.get(o))!=null&&n[1])},cancelPromise=(o,n)=>{const r=cancelablePromiseMap.get(o);r&&(r[1]=!0,r[0].forEach(a=>a(n)))},patchPromiseForCancelability=o=>{if(cancelablePromiseMap.has(o))return;const n=[new Set,!1];cancelablePromiseMap.set(o,n);const r=()=>{n[1]=!0};o.then(r,r),o.onCancel=a=>{n[0].add(a)}},isPromiseLike$2=o=>typeof(o==null?void 0:o.then)=="function",isAtomStateInitialized=o=>"v"in o||"e"in o,returnAtomValue=o=>{if("e"in o)throw o.e;return o.v},addPendingPromiseToDependency=(o,n,r)=>{r.p.has(o)||(r.p.add(o),n.then(()=>{r.p.delete(o)},()=>{r.p.delete(o)}))},addDependency=(o,n,r,a)=>{var i;n.d.set(r,a.n),isPendingPromise(n.v)&&addPendingPromiseToDependency(o,n.v,a),(i=a.m)==null||i.t.add(o)},INTERNAL_flushStoreHook=Symbol.for("JOTAI.EXPERIMENTAL.FLUSHSTOREHOOK"),buildStore=(...o)=>{const[n,r,a,i,l,u]=o,c=B=>{let C=n(B);return C||(C={d:new Map,p:new Set,n:0},r(B,C),l==null||l(B,N)),C},x=new WeakMap,d=new Map,p=new Set,m=new Set,h=()=>{var B;const C=[],I=T=>{try{T()}catch(v){C.push(v)}};do{(B=N[INTERNAL_flushStoreHook])==null||B.call(N);const T=new Set,v=T.add.bind(T);d.forEach(L=>{var M;return(M=L.m)==null?void 0:M.l.forEach(v)}),d.clear(),p.forEach(v),p.clear(),m.forEach(v),m.clear(),T.forEach(I),d.size&&w()}while(d.size||p.size||m.size);if(C.length)throw C[0]},f=(B,C,I)=>{const T="v"in C,v=C.v,L=isPendingPromise(C.v)?C.v:null;if(isPromiseLike$2(I)){patchPromiseForCancelability(I);for(const M of C.d.keys())addPendingPromiseToDependency(B,I,c(M));C.v=I}else C.v=I;delete C.e,(!T||!Object.is(v,C.v))&&(++C.n,L&&cancelPromise(L,I))},g=B=>{var C;const I=c(B);if(isAtomStateInitialized(I)&&(I.m&&x.get(B)!==I.n||Array.from(I.d).every(([P,V])=>g(P).n===V)))return I;I.d.clear();let T=!0;const v=()=>{I.m&&(E(B,I),w(),h())},L=P=>{if(isSelfAtom(B,P)){const $=c(P);if(!isAtomStateInitialized($))if(hasInitialValue(P))f(P,$,P.init);else throw new Error("no atom init");return returnAtomValue($)}const V=g(P);try{return returnAtomValue(V)}finally{addDependency(B,I,P,V),T||v()}};let M,H;const O={get signal(){return M||(M=new AbortController),M.signal},get setSelf(){return!H&&isActuallyWritableAtom(B)&&(H=(...P)=>{if(!T)return b(B,...P)}),H}};try{const P=a(B,L,O);return f(B,I,P),isPromiseLike$2(P)&&((C=P.onCancel)==null||C.call(P,()=>M==null?void 0:M.abort()),P.then(v,v)),I}catch(P){return delete I.v,I.e=P,++I.n,I}finally{T=!1}},j=B=>returnAtomValue(g(B)),R=B=>{var C;const I=new Map;for(const T of((C=B.m)==null?void 0:C.t)||[]){const v=c(T);v.m&&I.set(T,v)}for(const T of B.p)I.set(T,c(T));return I},_=B=>{const C=[B];for(;C.length;){const I=C.pop();for(const[T,v]of R(I))x.has(T)||(x.set(T,v.n),C.push(v))}},w=()=>{var B;const C=[],I=new WeakSet,T=new WeakSet,v=Array.from(d);for(;v.length;){const[L,M]=v[v.length-1];if(T.has(L)){v.pop();continue}if(I.has(L)){x.get(L)===M.n?C.push([L,M,M.n]):(x.delete(L),d.set(L,M)),T.add(L),v.pop();continue}I.add(L);for(const[H,O]of R(M))I.has(H)||v.push([H,O])}for(let L=C.length-1;L>=0;--L){const[M,H,O]=C[L];let P=!1;for(const V of H.d.keys())if(V!==M&&d.has(V)){P=!0;break}P&&(g(M),E(M,H),O!==H.n&&(d.set(M,H),(B=H.u)==null||B.call(H))),x.delete(M)}},y=(B,...C)=>{let I=!0;const T=L=>returnAtomValue(g(L)),v=(L,...M)=>{var H;const O=c(L);try{if(isSelfAtom(B,L)){if(!hasInitialValue(L))throw new Error("atom not writable");const P=O.n,V=M[0];f(L,O,V),E(L,O),P!==O.n&&(d.set(L,O),(H=O.u)==null||H.call(O),_(O));return}else return y(L,...M)}finally{I||(w(),h())}};try{return i(B,T,v,...C)}finally{I=!1}},b=(B,...C)=>{try{return y(B,...C)}finally{w(),h()}},E=(B,C)=>{var I;if(C.m&&!isPendingPromise(C.v)){for(const[T,v]of C.d)if(!C.m.d.has(T)){const L=c(T);S(T,L).t.add(B),C.m.d.add(T),v!==L.n&&(d.set(T,L),(I=L.u)==null||I.call(L),_(L))}for(const T of C.m.d||[])if(!C.d.has(T)){C.m.d.delete(T);const v=A(T,c(T));v==null||v.t.delete(B)}}},S=(B,C)=>{var I;if(!C.m){g(B);for(const T of C.d.keys())S(T,c(T)).t.add(B);if(C.m={l:new Set,d:new Set(C.d.keys()),t:new Set},(I=C.h)==null||I.call(C),isActuallyWritableAtom(B)){const T=C.m,v=()=>{let L=!0;const M=(...H)=>{try{return y(B,...H)}finally{L||(w(),h())}};try{const H=u(B,M);H&&(T.u=()=>{L=!0;try{H()}finally{L=!1}})}finally{L=!1}};m.add(v)}}return C.m},A=(B,C)=>{var I;if(C.m&&!C.m.l.size&&!Array.from(C.m.t).some(T=>{var v;return(v=c(T).m)==null?void 0:v.d.has(B)})){const T=C.m.u;T&&p.add(T),delete C.m,(I=C.h)==null||I.call(C);for(const v of C.d.keys()){const L=A(v,c(v));L==null||L.t.delete(B)}return}return C.m},N={get:j,set:b,sub:(B,C)=>{const I=c(B),v=S(B,I).l;return v.add(C),h(),()=>{v.delete(C),A(B,I),h()}},unstable_derive:B=>buildStore(...B(...o))};return N},createStore=()=>{const o=new WeakMap;return buildStore(r=>o.get(r),(r,a)=>o.set(r,a).get(r),(r,...a)=>r.read(...a),(r,...a)=>r.write(...a),(r,...a)=>{var i;return(i=r.unstable_onInit)==null?void 0:i.call(r,...a)},(r,...a)=>{var i;return(i=r.onMount)==null?void 0:i.call(r,...a)})};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=(u,c)=>{let x=r.get(u);if(x)return x;const d=c&&r.get(c),p=[],m=[];return u.forEach((h,f)=>{const g=f;m[f]=g;const j=d&&d.atomList[d.keyList.indexOf(g)];if(j){p[f]=j;return}const R=w=>{const y=w(i),b=w(o),S=a(b,y==null?void 0:y.arr).keyList.indexOf(g);if(S<0||S>=b.length){const A=u[a(u).keyList.indexOf(g)];if(A)return A;throw new Error("splitAtom: index out of bounds for read")}return b[S]},_=(w,y,b)=>{const E=w(i),S=w(o),D=a(S,E==null?void 0:E.arr).keyList.indexOf(g);if(D<0||D>=S.length)throw new Error("splitAtom: index out of bounds for write");const k=isFunction(b)?b(S[D]):b;Object.is(S[D],k)||y(o,[...S.slice(0,D),k,...S.slice(D+1)])};p[f]=isWritable(o)?atom(R,_):atom(R)}),d&&d.keyList.length===m.length&&d.keyList.every((h,f)=>h===m[f])?x=d:x={arr:u,atomList:p,keyList:m},r.set(u,x),x},i=atom(u=>{const c=u(i),x=u(o);return a(x,c==null?void 0:c.arr)});i.init=void 0;const l=isWritable(o)?atom(u=>u(i).atomList,(u,c,x)=>{switch(x.type){case"remove":{const d=u(l).indexOf(x.atom);if(d>=0){const p=u(o);c(o,[...p.slice(0,d),...p.slice(d+1)])}break}case"insert":{const d=x.before?u(l).indexOf(x.before):u(l).length;if(d>=0){const p=u(o);c(o,[...p.slice(0,d),x.value,...p.slice(d)])}break}case"move":{const d=u(l).indexOf(x.atom),p=x.before?u(l).indexOf(x.before):u(l).length;if(d>=0&&p>=0){const m=u(o);d<p?c(o,[...m.slice(0,d),...m.slice(d+1,p),m[d],...m.slice(p)]):c(o,[...m.slice(0,p),m[d],...m.slice(p,d),...m.slice(d+1)])}break}}}):atom(u=>u(i).atomList);return l},o,cacheKeyForEmptyKeyExtractor)}const isPromiseLike$1=o=>typeof(o==null?void 0:o.then)=="function";function createJSONStorage(o=()=>{try{return window.localStorage}catch{return}},n){var r;let a,i;const l={getItem:(x,d)=>{var p,m;const h=g=>{if(g=g||"",a!==g){try{i=JSON.parse(g,n==null?void 0:n.reviver)}catch{return d}a=g}return i},f=(m=(p=o())==null?void 0:p.getItem(x))!=null?m:null;return isPromiseLike$1(f)?f.then(h):h(f)},setItem:(x,d)=>{var p;return(p=o())==null?void 0:p.setItem(x,JSON.stringify(d,void 0))},removeItem:x=>{var d;return(d=o())==null?void 0:d.removeItem(x)}},u=x=>(d,p,m)=>x(d,h=>{let f;try{f=JSON.parse(h||"")}catch{f=m}p(f)});let c;try{c=(r=o())==null?void 0:r.subscribe}catch{}return!c&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(c=(x,d)=>{if(!(o()instanceof window.Storage))return()=>{};const p=m=>{m.storageArea===o()&&m.key===x&&d(m.newValue)};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}}),c&&(l.subscribe=u(c)),l}const defaultStorage=createJSONStorage();function atomWithStorage(o,n,r=defaultStorage,a){const i=atom(n);return i.onMount=u=>{u(r.getItem(o,n));let c;return r.subscribe&&(c=r.subscribe(o,u,n)),c},atom(u=>u(i),(u,c,x)=>{const d=typeof x=="function"?x(u(i)):x;return d===RESET?(c(i,n),r.removeItem(o)):d instanceof Promise?d.then(p=>(c(i,p),r.setItem(o,p))):(c(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",attachPromiseMeta=o=>{o.status="pending",o.then(n=>{o.status="fulfilled",o.value=n},n=>{o.status="rejected",o.reason=n})},use=React.use||(o=>{if(o.status==="pending")throw o;if(o.status==="fulfilled")return o.value;throw o.status==="rejected"?o.reason:(attachPromiseMeta(o),o)}),continuablePromiseMap=new WeakMap,createContinuablePromise=o=>{let n=continuablePromiseMap.get(o);return n||(n=new Promise((r,a)=>{let i=o;const l=x=>d=>{i===x&&r(d)},u=x=>d=>{i===x&&a(d)},c=x=>{"onCancel"in x&&typeof x.onCancel=="function"&&x.onCancel(d=>{isPromiseLike(d)?(continuablePromiseMap.set(d,n),i=d,d.then(l(d),u(d)),c(d)):r(d)})};o.then(l(o),u(o)),c(o)}),continuablePromiseMap.set(o,n)),n};function useAtomValue(o,n){const r=useStore(),[[a,i,l],u]=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 c=a;if((i!==r||l!==o)&&(u(),c=r.get(o)),React.useEffect(()=>{const d=r.sub(o,()=>{u()});return u(),d},[r,o,void 0]),React.useDebugValue(c),isPromiseLike(c)){const d=createContinuablePromise(c);return use(d)}return c}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)]}const 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 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(r,a){super(r,a);U(this,"setRef",r=>{this.nodeRef.current=r;const{forwardedRef:a}=this.props;typeof a=="function"?a(r):a&&(a.current=r)});U(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});U(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,u=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})})}),c=this.getMountTarget();return[ReactDOM.createPortal(this.props.head,this.getDoc().head),ReactDOM.createPortal(u,c)]}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()})}}U(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})),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},canDropBlock=(o,{dragSource:n,dropTarget:r})=>{const a=lodashEs.get(n,"data._type",""),i=lodashEs.get(r,"data._type","");return canAcceptChildBlock(i,a)};function duplicateBlocks(o,n,r){const a=lodashEs.filter(o,l=>l._parent===n),i=[];for(let l=0;l<a.length;l++){const u=getSlots(a[l]);if(Object.keys(u).length>0&&Object.keys(u).forEach(c=>{a[l][c]=`slot:${iconBase.generateUUID()}`}),lodashEs.filter(o,{_parent:a[l]._id}).length>0){const c=iconBase.generateUUID();i.push({...a[l],oldId:a[l]._id,_id:c,_parent:r}),i.push(lodashEs.flatten(duplicateBlocks(o,a[l]._id,c)))}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,u=>{const c=u,x=getSlots(c);return Object.keys(x).length>0&&Object.keys(x).forEach(d=>{const p=lodashEs.find(l,{oldId:x[d].replace("slot:","")});c[d]=`slot:${p._id}`}),lodashEs.omit(c,["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:u})=>u===(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:{}},hasRequiredUndomanager;function requireUndomanager(){return hasRequiredUndomanager||(hasRequiredUndomanager=1,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,u=!1,c;function x(d,p){return!d||typeof d[p]!="function"?this:(u=!0,d[p](),u=!1,this)}return{add:function(d){return u?this:(a.splice(i+1,a.length-i),a.push(d),l&&a.length>l&&n(a,0,-(l+1)),i=a.length-1,c&&c(),this)},setCallback:function(d){c=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 c&&c(),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 c&&c(),this},clear:function(){let d=a.length;a=[],i=-1,c&&d>0&&c()},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)),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[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 chaiRjsfFieldsAtom=jotai.atom({});chaiRjsfFieldsAtom.debugLabel="chaiRjsfFieldsAtom";const chaiRjsfWidgetsAtom=jotai.atom({});chaiRjsfWidgetsAtom.debugLabel="chaiRjsfWidgetsAtom";const chaiRjsfTemplatesAtom=jotai.atom({});chaiRjsfTemplatesAtom.debugLabel="chaiRjsfTemplatesAtom";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[React.useMemo(()=>({...n,...!lodashEs.isEmpty(r)&&r,...!lodashEs.isEmpty(a)&&a}),[n,r,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 c=>{}),a=useBuilderProp("onSaveStateChange",lodashEs.noop),i=useGetPageData(),[l]=useTheme();return{savePage:web.useThrottledCallback(async(c=!1)=>{n("SAVING"),a("SAVING");const x=i();return await r({autoSave:c,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 u;const l=((u=lodashEs.find(o,{_id:i[0]}))==null?void 0:u._parent)||null;a(removeNestedBlocks(o,i)),setTimeout(()=>r(l?[l]:[]),200)},[o,r,n])};function insertBlocksAtPosition(o,n,r,a){let i=o.filter(c=>!c._parent);r&&(i=o.filter(c=>c._parent===r));const l=!isNaN(a)||a>-1?Math.min(a,i.length):i.length;let u=o.length;for(let c=0,x=0;c<o.length;c++)if(o[c]._parent===r){if(x===l){u=c;break}x++}return!r&&a!==void 0&&a>=i.length&&(u=o.length),[...o.slice(0,u),...n,...o.slice(u)]}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(u){return console.error("Error adding child to parent:",u),!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 u=flattenTree(l),c=u.find(x=>x._id===n);return c&&(c._parent=r==="root"?null:r),u.shift(),u}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 u=insertBlocksAtPosition(l,r,a,i);return n({type:"blocks-updated",blocks:u}),u})},removeBlocks:r=>{o(a=>{const i=removeNestedBlocks(a,r);return n({type:"blocks-updated",blocks:i}),i})},moveBlocks:(r,a,i)=>{o(l=>{let u=l;for(let c=0;c<r.length;c++)u=moveBlocksWithChildren(u,r[c],a,i);return n({type:"blocks-updated",blocks:u}),u})},updateBlocksProps:r=>{o(a=>{const i=r.map(u=>u._id),l=a.map(u=>{if(i.includes(u._id)){const c=lodashEs.find(r,{_id:u._id});return{...u,...lodashEs.omit(c,"_id")}}return u});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:u}=useBlocksStoreManager();return{moveBlocks:(g,j,R)=>{const _=lodashEs.map(g,y=>{const E=n.find(D=>D._id===y)._parent||null,A=n.filter(D=>E?D._parent===E:!D._parent).map(D=>D._id).indexOf(y);return{_id:y,oldParent:E,oldPosition:A}}),w=_.find(({_id:y})=>y===g[0]);w&&w.oldParent===j&&w.oldPosition===R||(l(g,j,R),o({undo:()=>lodashEs.each(_,({_id:y,oldParent:b,oldPosition:E})=>{l([y],b,E)}),redo:()=>l(g,j,R)}))},addBlocks:(g,j,R)=>{a(g,j,R),o({undo:()=>i(lodashEs.map(g,"_id")),redo:()=>a(g,j,R)})},removeBlocks:g=>{var w;const j=(w=lodashEs.first(g))==null?void 0:w._parent,_=n.filter(y=>j?y._parent===j:!y._parent).indexOf(lodashEs.first(g));i(lodashEs.map(g,"_id")),o({undo:()=>a(g,j,_),redo:()=>i(lodashEs.map(g,"_id"))})},updateBlocks:(g,j,R)=>{let _=[];if(R)_=lodashEs.map(g,w=>({_id:w,...R}));else{const w=lodashEs.keys(j);_=lodashEs.map(g,y=>{const b=n.find(S=>S._id===y),E={_id:y};return lodashEs.each(w,S=>E[S]=b[S]),E})}u(lodashEs.map(g,w=>({_id:w,...j}))),o({undo:()=>u(_),redo:()=>u(lodashEs.map(g,w=>({_id:w,...j})))})},updateBlocksRuntime:(g,j)=>{u(lodashEs.map(g,R=>({_id:R,...j})))},setNewBlocks:g=>{r(g),o({undo:()=>r(n),redo:()=>r(g)})},updateMultipleBlocksProps:g=>{let j=[];j=lodashEs.map(g,R=>{const _=lodashEs.keys(R),w=n.find(b=>b._id===R._id),y={};return lodashEs.each(_,b=>y[b]=w[b]),y}),u(g),o({undo:()=>u(j),redo:()=>u(g)})}}},useAddBlock=()=>{const[o]=useBlocksStore(),[,n]=useSelectedBlockIds(),{addBlocks:r}=useBlocksStoreUndoableActions(),a=React.useCallback((l,u,c)=>{var h;for(let f=0;f<l.length;f++){const{_id:g}=l[f];l[f]._id=iconBase.generateUUID();const j=lodashEs.filter(l,{_parent:g});for(let R=0;R<j.length;R++)j[R]._parent=l[f]._id}const x=lodashEs.first(l);let d,p;return u&&(d=lodashEs.find(o,{_id:u}),l[0]._parent=u,p=u),!(d?canAcceptChildBlock(d==null?void 0:d._type,x._type):!0)&&d&&(l[0]._parent=d._parent,p=d._parent),r(l,p,c),n([(h=lodashEs.first(l))==null?void 0:h._id]),lodashEs.first(l)},[r,o,n]);return{addCoreBlock:React.useCallback((l,u,c)=>{if(lodashEs.has(l,"blocks")){const j=l.blocks;return a(j,u,c)}const x=iconBase.generateUUID(),d=runtime.getDefaultBlockProps(l.type),p={_type:l.type,_id:x,...d};let m,h;return u&&(m=lodashEs.find(o,{_id:u}),p._parent=u,h=u),!canAcceptChildBlock(m==null?void 0:m._type,p._type)&&m&&(p._parent=m._parent,h=m._parent),r([p],h,c),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"},backgroundAttachment:{classes:lodashEs.map(["fixed","local","scroll"],o=>`bg-${o}`),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,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__|\\w+-\\d+|\\[#[0-9a-fA-F]+\\])$"},border:{classes:["border",...lodashEs.map(CLASS_VALUES.borderWidth,o=>`border-${o}`)],regExp:"^border(-\\d+|\\[\\d+px\\])?$"},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,u)=>{lodashEs.set(CLASSES_LIST,`${u}.regExp`,l.regExp.replace("__THEME_COLORS_REGEXP__",i.join("|")))})}return CLASSES_LIST},[o]),r=React.useCallback((i,l)=>{const u=lodashEs.get(n,`${i}.regExp`,"");return l.match(new RegExp(u))},[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}function orderClassesByBreakpoint(o){o=o.replace(/\s+/g," ");const n=o.split(" ").map(constructClassObject),r=["xs","sm","md","lg","xl","2xl"];return n.sort((a,i)=>r.indexOf(a.mq)-r.indexOf(i.mq)).map(a=>a.fullCls).join(" ")}function removeDuplicateClasses(o){if(o=o.replace(/\s+/g," "),!o)return"";const n=["xs","sm","md","lg","xl","2xl"],r=o.split(" ").map(constructClassObject);let a=o;if(r.length===1)return r[0].fullCls;for(const i of r){const l=i.property,u=n.indexOf(i.mq);for(let c=u+1;c<n.length;c++){const x=n[c],d=r.find(p=>p.property===l&&p.mq===x);if(d&&d.cls===i.cls)a=a.replace(d.fullCls,"");else if(d&&d.cls!==i.cls)break}}return a.replace(/\s+/g," ").trim()}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),u=>r.includes(o(u)._id)),l=lodashEs.first(o(selectedStylingBlocksAtom));return lodashEs.map(i,u=>{const c=o(u),x=lodashEs.get(c,l.prop,`${STRINGS.STYLES_KEY},`),{classes:d}=getSplitClasses$1(x);return{ids:[c._id],props:{[l.prop]:`${STRINGS.STYLES_KEY},${orderClassesByBreakpoint(removeDuplicateClasses(tailwindMerge.twMerge(d,a)))}`}}})}),useAddClassesToBlocks=()=>{const o=jotai.useSetAtom(addClassesToBlocksAtom),{updateBlocks:n,updateBlocksRuntime:r}=useBlocksStoreUndoableActions();return React.useCallback((a,i,l=!1)=>{const u=o({blockIds:a,newClasses:i});if(!l){r(a,u[0].props);return}n(a,u[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 u={_chai_copied_blocks:l.flatMap(c=>getDuplicatedBlocks(o,c,null))};await navigator.clipboard.writeText(JSON.stringify(u))}catch(u){console.error("Failed to copy blocks to clipboard:",u)}},[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,u=>{const c=o.find(h=>h._id===u);i?i==="root"&&(i=null):i=c._parent;const p=lodashEs.filter(o,h=>lodashEs.isString(i)?h._parent===i:!h._parent).indexOf(c)+1,m=getDuplicatedBlocks(o,u,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(u=>{var c;return(c=lodashEs.find(o,{_id:u}))==null?void 0:c._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(u=>!u._parent);n(r,null,(l==null?void 0:l.length)||0)}else{const l=o==null?void 0:o.filter(u=>u._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 c=>{if(o.length>0)return a(o,c);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 c=>{const x=Array.isArray(c)?c[0]:c;if(!lodashEs.isEmpty(o)){r(o,c),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),u=>r.includes(o(u)._id));return lodashEs.map(l,u=>{const c=o(u),x=a;let{classes:d,baseClasses:p}=getSplitClasses(lodashEs.get(c,i.prop,"styles:,"));return lodashEs.each(x,m=>{const h=m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f=new RegExp(`(^|\\s)${h}(?=\\s|$)`,"g");d=d.replace(f," ").replace(/\s+/g," ").trim();const g=lodashEs.first(m.split(":"));lodashEs.includes(["2xl","xl","lg","md","sm"],g)&&x.push(m.split(":").pop().trim())}),lodashEs.each(x,m=>{const h=m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f=new RegExp(`(^|\\s)${h}(?=\\s|$)`,"g");p=p.replace(f," ").replace(/\s+/g," ").trim()}),{ids:[c._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,u=>i.includes(u.mq))),l=l.sort((u,c)=>MQ[u.mq]-MQ[c.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 u=`${l}-${n}`;lodashEs.set(i,u,o[l]),lodashEs.unset(i,l)}}),i}),useUpdateBlocksProps=()=>{const{updateBlocks:o}=useBlocksStoreUndoableActions(),{selectedLang:n}=useLanguages(),r=useSelectedBlock();return React.useCallback((a,i,l)=>{const u=updatePropsForLanguage(i,n,r);o(a,u,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 u=r[l];if(lodashEs.isString(u)){const c=lodashEs.chunk(u.split(""),12);let x="";o([n],{[l]:""});for(let d=0;d<c.length;d++)x+=c[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]};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 c=>[]),u=React.useMemo(()=>o.filter(x=>x._type==="GlobalBlock").filter(x=>x._type==="GlobalBlock").map(x=>x.globalBlock),[o]);React.useEffect(()=>{lodashEs.forEach(u,c=>{lodashEs.has(n,c)||lodashEs.get(a,`${c}.loading`,!1)||(i(x=>({...x,[c]:{loading:!0,error:null}})),l(c).then(x=>{r(d=>({...d,[c]:x})),i(d=>({...d,[c]:{loading:!1,error:null}}))}).catch(x=>{i(d=>({...d,[c]:{loading:!1,error:x.message}}))}))})},[l,n,u,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 u=await i();a(u),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:u}=useGlobalBlocksStore();return()=>{r([]),i([]),a(),n(),l(!1),o({undoCount:0,redoCount:0}),u()}},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),u={},c=lodashEs.get(l,"aiProps",[]);for(const x in r)a.includes(x)||c.includes(x)&&(u[x]=lodashEs.get(r,`${x}-${n}`,r[x]));return lodashEs.isEmpty(u)?!1:(lodashEs.has(i,"_parent")&&lodashEs.isEmpty(i._parent)&&delete i._parent,{...i,...u})})),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(),u=useUpdateMultipleBlocksProps(),[c]=useBlocksStore(),{selectedLang:x,fallbackLang:d}=useLanguages(),p=x.length?x:d,m=(h,f)=>{const g=lodashEs.cloneDeep(f.find(j=>j._id===h));for(const j in g){const R=g[j];typeof R=="string"&&lodashEs.startsWith(R,STRINGS.STYLES_KEY)?g[j]=lodashEs.compact(lodashEs.flattenDeep(R.replace(STRINGS.STYLES_KEY,"").split(","))).join(" "):j!=="_id"&&delete g[j]}return g};return{askAi:React.useCallback(async(h,f,g,j)=>{if(i){n(!0),a(null);try{const R=x===d?"":x,_=h==="content"?pickOnlyAIProps(lodashEs.cloneDeep(getBlockWithChildren(f,c)),x):[m(f,c)],w=await i(h,addLangToPrompt(g,p,h),_,R),{blocks:y,error:b}=w;if(b){a(b);return}if(h==="styles"){const E=y.map(S=>{for(const A in S)A!=="_id"&&(S[A]=`${STRINGS.STYLES_KEY},${S[A]}`);return S});u(E)}else l(y);j&&j(w)}catch(R){a(R)}finally{n(!1),j&&j()}}},[i,n,x,d,c,p,u,l]),loading:o,error:r}},useAiAssistant=()=>{const[,o]=useRightPanel();return React.useCallback(n=>{o(n?"ai":"block")},[o])},wrapperBlockAtom=jotai.atom(o=>{var u;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 c=lodashEs.find(n,{_id:l});if(!c)return null;if((u=runtime.getRegisteredChaiBlock(c._type))!=null&&u.wrapper)return c;l=c._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]},CHAI_BUILDER_EVENTS={OPEN_ADD_BLOCK:"OPEN_ADD_BLOCK",CLOSE_ADD_BLOCK:"CLOSE_ADD_BLOCK",SHOW_BLOCK_SETTINGS:"SHOW_BLOCK_SETTINGS"};class PubSub{constructor(){U(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,draggedBlockAtom=jotai.atom(null),dropTargetBlockIdAtom=jotai.atom(null),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:u=>{u.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]})},BlockFloatingSelector=({selectedBlockElement:o,block:n})=>{const r=useRemoveBlocks(),a=useDuplicateBlocks(),[,i]=useSelectedBlockIds(),[,l]=useHighlightBlockId(),[,u]=useSelectedStylingBlocks(),[c]=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||c?null:jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:d.setFloating,style:x,onClick:f=>{f.stopPropagation(),f.preventDefault()},onMouseEnter:f=>{f.stopPropagation(),l(null)},onKeyDown:f=>f.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:()=>{u([]),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]})]})})},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,249 +54,8 @@
|
|
|
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>`,useKeyEventWatcher=r=>{const[h,x]=useSelectedBlockIds(),g=useSelectedBlock(),v=useRemoveBlocks(),R=useDuplicateBlocks(),{undo:A,redo:j}=useUndoManager(),[,C]=useCutBlockIds(),[,T]=useCopyBlockIds(),{canPaste:O,pasteBlocks:N}=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",()=>{O(h[0])&&N(h)},{...z,preventDefault:!0},[h,O,N]),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},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",{})]})};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"}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 N=()=>{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){N();return}if(!lodashEs.has(P,"_id")){g(P,he==="canvas"?null:he,dropIndex),setTimeout(N,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),N(),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 N;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 O(){const z=T.getText(0,T.getLength());h([A.getAttribute("data-block-id")],{content:z}),A.removeAttribute("style"),C.removeEventListener("blur",O,!0),destroyQuill(T),g(""),v(),C.remove()}C.addEventListener("blur",O,!0),C.addEventListener("click",z=>{z.stopPropagation()}),C.addEventListener("keydown",z=>{(z.key==="Enter"||z.key==="Escape")&&O()}),T.focus(),(N=C.querySelector(".ql-clipboard"))==null||N.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"),O=j.getAttribute("data-block-parent");h.includes(O)||v==null||v.closeAll(),r([{id:T,prop:C,blockId:O}]),x([O])}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 N=getElementByDataBlockId(h,lodashEs.first(x));if(N){const z=N.getAttribute("data-style-prop");if(z){const Z=N.getAttribute("data-style-id"),q=N.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(),O=useDnd();return jsxRuntime.jsxRuntimeExports.jsx("div",{"data-block-id":"canvas",id:"canvas",onClick:j,onDoubleClick:A,onMouseMove:C,onMouseLeave:T,...lodashEs.omit(O,"isDragging"),className:"relative h-full max-w-full p-px "+(O.isDragging?"dragging":""),children:r})},getElementByDataBlockId=(r,h)=>r.querySelector(`[data-block-id="${h}"]`),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")),[O]=React.useState(j==null?void 0:j.getElementById("selected-block")),[N]=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(()=>{O&&(O.textContent=`${lodashEs.map(x,Y=>`[data-block-id="${Y}"]`).join(",")}{
|
|
58
|
-
outline: 1px solid ${
|
|
59
|
-
}`)},[
|
|
57
|
+
</html>`,useKeyEventWatcher=o=>{const[n,r]=useSelectedBlockIds(),a=useSelectedBlock(),i=useRemoveBlocks(),l=useDuplicateBlocks(),{undo:u,redo:c}=useUndoManager(),[,x]=useCutBlockIds(),[,d]=useCopyBlockIds(),{canPaste:p,pasteBlocks:m}=usePasteBlocks(),h=o?{document:o}:{};reactHotkeysHook.useHotkeys("ctrl+z,command+z",()=>u(),{},[u]),reactHotkeysHook.useHotkeys("ctrl+y,command+y",()=>c(),{},[c]),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",f=>{f.preventDefault(),canDeleteBlock(lodashEs.get(a,"_type",""))&&i(n)},h,[n,i])},KeyboardHandler=()=>{const{document:o}=useFrame();return useKeyEventWatcher(o),null},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",{})]})};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"}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),u=i.indexOf(l);if(!possiblePositions[u])return;const c=possiblePositions[u];a.style.width=n==="vertical"?c[2]+"px":"2px",a.style.height=n==="vertical"?"2px":c[2]+"px",a.style.display="block",n==="vertical"?(a.style.top=c[0]+"px",a.style.left=c[1]+"px"):(a.style.top=c[1]+"px",a.style.left=c[0]+"px")};function calculateDropIndex(o,n){let r=0,a=1/0;return n.forEach((i,l)=>{const u=Math.abs(i[0]-o);u<a&&(a=u,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,u=r?[a.offsetTop,a.clientHeight]:[a.offsetLeft,a.clientWidth];if(possiblePositions.push([l,u[0],u[1]]),i===o.children.length-1){const c=r?a.offsetLeft+a.clientWidth:a.offsetTop+a.clientHeight;possiblePositions.push([c,u[0],u[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:u}=useBlocksStoreUndoableActions(),[c,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 b;const f=dropTarget,j=getOrientation(f)==="vertical"?h.clientY+((b=iframeDocument==null?void 0:iframeDocument.defaultView)==null?void 0:b.scrollY):h.clientX;dropIndex=calculateDropIndex(j,possiblePositions);const R=c,_=f.getAttribute("data-block-id"),w=dropTarget.getAttribute("data-dnd-dragged")!=="yes";if((R==null?void 0:R._id)===_||!w){m();return}if(!lodashEs.has(R,"_id")){a(R,_==="canvas"?null:_,dropIndex),setTimeout(m,300);return}let y=f.getAttribute("data-block-id");y===null&&(y=h.target.parentElement.getAttribute("data-block-id")),u([R._id],y==="canvas"?null:y,dropIndex),m(),setTimeout(removePlaceholder,300)},onDragEnter:h=>{const f=h,g=f.target;dropTarget=g;const j=g.getAttribute("data-block-id"),R=g.getAttribute("data-dnd-dragged")!=="yes";d(j),f.stopPropagation(),f.preventDefault(),possiblePositions=[],R&&calculatePossiblePositions(g),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 u=getTargetedBlock(l.target),c=u.getAttribute("data-block-type");if(!c||!o.includes(c))return;const x=u.cloneNode(!0);u.style.display="none",Array.from(x.attributes).forEach(h=>{h.name!=="class"&&x.removeAttribute(h.name)}),c==="Text"&&(x.style.display="inline-block"),u.parentNode.insertBefore(x,u.nextSibling);const d=new ReactQuill.Quill(x,{placeholder:"Type here..."});function p(){const h=d.getText(0,d.getLength());n([u.getAttribute("data-block-id")],{content:h}),u.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(u.getAttribute("data-block-id"))}},useHandleCanvasClick=()=>{const[,o]=useSelectedStylingBlocks(),[n,r]=useSelectedBlockIds(),[a]=jotai.useAtom(inlineEditingActiveAtom),[i]=jotai.useAtom(treeRefAtom),{clearHighlight:l}=useBlockHighlight();return u=>{if(a)return;u.stopPropagation();const c=getTargetedBlock(u.target);if(c!=null&&c.getAttribute("data-block-id")&&(c==null?void 0:c.getAttribute("data-block-id"))==="container"){r([]),o([]),l();return}if(c!=null&&c.getAttribute("data-block-parent")){const x=c.getAttribute("data-style-prop"),d=c.getAttribute("data-style-id"),p=c.getAttribute("data-block-parent");n.includes(p)||i==null||i.closeAll(),o([{id:d,prop:x,blockId:p}]),r([p])}else if(c!=null&&c.getAttribute("data-block-id")){const x=c.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 f=m.getAttribute("data-style-id"),g=m.getAttribute("data-block-parent");i([{id:f,prop:h,blockId:g}])}}},100)},[n,r,i,a]);const u=useHandleCanvasDblClick(),c=useHandleCanvasClick(),x=useHandleMouseMove(),d=useHandleMouseLeave(),p=useDnd();return jsxRuntime.jsxRuntimeExports.jsx("div",{"data-block-id":"canvas",id:"canvas",onClick:c,onDoubleClick:u,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}"]`),HeadTags=()=>{const[o]=useTheme(),n=useThemeOptions(),[r]=useSelectedBlockIds(),[a]=useDarkMode(),[i]=useSelectedStylingBlocks(),[l]=jotai.useAtom(draggedBlockAtom),[u]=jotai.useAtom(dropTargetBlockIdAtom),{document:c,window:x}=useFrame(),[d]=React.useState(c==null?void 0:c.getElementById("highlighted-block")),[p]=React.useState(c==null?void 0:c.getElementById("selected-block")),[m]=React.useState(c==null?void 0:c.getElementById("selected-styling-block")),[h]=React.useState(c==null?void 0:c.getElementById("dragged-block"));React.useEffect(()=>{a?c==null||c.documentElement.classList.add("dark"):c==null||c.documentElement.classList.remove("dark")},[a,c]),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:j,theme:R}){j({"h1,h2,h3,h4,h5,h6":{fontFamily:R("fontFamily.heading")},body:{fontFamily:R("fontFamily.body"),color:R("colors.foreground"),backgroundColor:R("colors.background")}})})]})},[o,n,x]),React.useEffect(()=>{p&&(p.textContent=`${lodashEs.map(r,j=>`[data-block-id="${j}"]`).join(",")}{
|
|
58
|
+
outline: 1px solid ${r.length===1?"#42a1fc !important":"orange !important"}; outline-offset: -1px;
|
|
59
|
+
}`)},[r,p]),React.useEffect(()=>{h.textContent=l?`[data-block-id="${l._id}"], [data-block-id="${l._id}"] > * { pointer-events: none !important; opacity: 0.6 !important}`:""},[l,h]),React.useEffect(()=>{d&&(d.textContent='[data-highlighted="true"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}')},[d]),React.useEffect(()=>{m&&(m.textContent=`${lodashEs.map(i,({id:j})=>`[data-style-id="${j}"]`).join(",")}{
|
|
60
60
|
outline: 1px solid orange !important; outline-offset: -1px;
|
|
61
|
-
}`)},[v,N]),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}})]})},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})};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(N=>getStyleAttrs(N),[]),[T]=useChaiExternalData(),[O]=jotai.useAtom(inlineEditingActiveAtom);return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:React.Children.toArray(r.map((N,z)=>{if(O===N._id||A.includes(N._id))return null;const Z={},q=lodashEs.filter(h,{_parent:N._id});if(Z.children=q.length>0?jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:h,blocks:q}):null,N._type==="GlobalBlock"){const pe=j(N);Z.children=jsxRuntime.jsxRuntimeExports.jsx(RenderGlobalBlock,{blocks:lodashEs.filter(pe,ve=>!ve._parent),allBlocks:pe})}const Y=runtime.getRegisteredChaiBlock(N._type),P=lodashEs.get(Y,"component",null);if(lodashEs.isNull(P))return jsxRuntime.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${N==null?void 0:N._type} not registered -->`});const he=C(N),te=v&&isDescendant(v._id,N._id,h),X={blockProps:{"data-block-id":N._id,"data-block-type":N._type,...v?{"data-dnd":canAcceptChildBlock(N._type,v==null?void 0:v._type)?"yes":"no","data-dnd-dragged":v._id===N._id||te?"yes":"no"}:{},...R===N._id&&!te?{"data-drop":"yes"}:{},...lodashEs.includes(g,N._id)?{"data-cut-block":"yes"}:{}},index:z,...applyBindings(applyLanguage(N,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:N,component:P,props:X})});const oe=getRuntimeProps(N._type);return oe?jsxRuntime.jsxRuntimeExports.jsx(RuntimePropsBlock,{runtimeProps:oe,block:N,component:P,props:X},N._id):jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:React.createElement(P,X)})}))})}const StaticBlocksRenderer=()=>{const[r]=useBlocksStore(),h=lodashEs.isEmpty(r)?null:jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:r,blocks:lodashEs.filter(r,x=>lodashEs.isEmpty(x._parent))});return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:h})},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 O={};const N=C*T,z=j*T;C&&(O={height:100+(C-N)/N*100+"%",width:100+(j-z)/z*100+"%"}),R({position:"relative",top:0,transform:`scale(${T})`,transformOrigin:g==="rtl"?"top right":"top left",...O,maxWidth:"none"}),x(T*100)}else R({}),x(100)},[h,r,g,x]);return React.useEffect(()=>{A()},[h,r,x,A]),v},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),[O,N]=React.useState([]),[,z]=React.useState([]),[,Z]=jotai.useAtom(canvasIframeAtom),[q,Y]=useSelectedStylingBlocks(),P=useBuilderProp("loading",!1),he=useBuilderProp("htmlDir","ltr"),te=oe=>{C(pe=>({...pe,width:oe}))};React.useEffect(()=>{if(!A.current)return;const{clientWidth:oe,clientHeight:pe}=A.current;C({width:oe,height:pe})},[A,h]);const ue=(oe,pe=0)=>{const{top:ve}=oe.getBoundingClientRect();return ve+pe>=0&&ve-pe<=window.innerHeight};React.useEffect(()=>{var oe,pe;if(g&&g.type!=="Multiple"&&R.current){const ve=getElementByDataBlockId(R.current.contentDocument,g._id);ve&&(ue(ve)||(pe=(oe=R.current)==null?void 0:oe.contentWindow)==null||pe.scrollTo({top:ve.offsetTop,behavior:"smooth"}),N([ve]))}},[g]),React.useEffect(()=>{if(!lodashEs.isEmpty(q)&&R.current){const oe=getElementByStyleId(R.current.contentDocument,lodashEs.first(q).id);z(oe?[oe]:[null])}else z([null])},[q]);const X=React.useMemo(()=>{let oe=IframeInitialContent;return oe=oe.replace("__HTML_DIR__",he),r==="offline"&&(oe=oe.replace("https://chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js")),oe},[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(BlockFloatingSelector,{block:g,selectedBlockElement:lodashEs.first(O)}),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-CzoZfMYd.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)},O=()=>{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)},N=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:O,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=>N(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",{})]})}),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"})})]})};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,Qt=V[qe],Ne=qe+1,Mt=V[Ne];if(0>v(Qt,re))Ne<Re&&0>v(Mt,Qt)?(V[Ae]=Mt,V[Ne]=re,Ae=Ne):(V[Ae]=Qt,V[qe]=re,Ae=qe);else if(Ne<Re&&0>v(Mt,re))V[Ae]=Mt,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=[],O=1,N=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,se();else{var ie=x(T);ie!==null&&me(X,ie.startTime-V)}}var oe=!1,pe=-1,ve=5,Me=-1;function J(){return!(r.unstable_now()-Me<ve)}function xe(){if(oe){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),N=x(C);N!==null&&!(N.expirationTime>V&&J());){var Ae=N.callback;if(typeof Ae=="function"){N.callback=null,z=N.priorityLevel;var Re=Ae(N.expirationTime<=V);if(V=r.unstable_now(),typeof Re=="function"){N.callback=Re,ue(V),ie=!0;break t}N===x(C)&&g(C),ue(V)}else g(C);N=x(C)}if(N!==null)ie=!0;else{var Ve=x(T);Ve!==null&&me(X,Ve.startTime-V),ie=!1}}break e}finally{N=null,z=re,Z=!1}ie=void 0}}finally{ie?be():oe=!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 se(){oe||(oe=!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,se())},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:O++,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,se())),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,oe&&(oe=!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&&O(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,Qt=V[qe],Ne=qe+1,Mt=V[Ne];if(0>R(Qt,re))Ne<Re&&0>R(Mt,Qt)?(V[Ae]=Mt,V[Ne]=re,Ae=Ne):(V[Ae]=Qt,V[qe]=re,Ae=qe);else if(Ne<Re&&0>R(Mt,re))V[Ae]=Mt,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(oe=!1,A(V),!X)if(g(q)!==null)X=!0,T();else{var ie=g(Y);ie!==null&&O(j,ie.startTime-V)}}function C(){return!(r.unstable_now()-ge<be)}function T(){J||(J=!0,je())}function O(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 N=performance;r.unstable_now=function(){return N.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,oe=!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 se=new MessageChannel,me=se.port2;se.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)&&(oe?(ve(xe),xe=-1):oe=!0,O(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"),O=Symbol.for("react.profiler"),N=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"),oe=Symbol.iterator;function pe(a){return a===null||typeof a!="object"?null:(a=oe&&a[oe]||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 O: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 se=!1;function me(a,i){if(!a||se)return"";se=!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{se=!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 Qt=Array.isArray,Ne=x.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Mt={pending:!1,data:null,method:null,action:null},Fa=[],Gs=-1;function ol(a){return{current:a}}function Lt(a){0>Gs||(a.current=Fa[Gs],Fa[Gs]=null,Gs--)}function ft(a,i){Gs++,Fa[Gs]=a.current,a.current=i}var Zn=ol(null),at=ol(null),ra=ol(null),Ho=ol(null);function ed(a,i){switch(ft(ra,i),ft(at,a),ft(Zn,null),a=i.nodeType,a){case 9:case 11:i=(i=i.documentElement)&&(i=i.namespaceURI)?Nf(i):0;break;default:if(a=a===8?i.parentNode:i,i=a.tagName,a=a.namespaceURI)a=Nf(a),i=eh(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Lt(Zn),ft(Zn,i)}function Wi(){Lt(Zn),Lt(at),Lt(ra)}function pt(a){a.memoizedState!==null&&ft(Ho,a);var i=Zn.current,u=eh(i,a.type);i!==u&&(ft(at,a),ft(Zn,u))}function td(a){at.current===a&&(Lt(Zn),Lt(at)),Ho.current===a&&(Lt(Ho),al._currentValue=Mt)}var nd=Object.prototype.hasOwnProperty,Uo=r.unstable_scheduleCallback,Ys=r.unstable_cancelCallback,Ih=r.unstable_shouldYield,$h=r.unstable_requestPaint,In=r.unstable_now,Lg=r.unstable_getCurrentPriorityLevel,Kh=r.unstable_ImmediatePriority,Xs=r.unstable_UserBlockingPriority,Vo=r.unstable_NormalPriority,gc=r.unstable_LowPriority,Jh=r.unstable_IdlePriority,Wh=r.log,Fh=r.unstable_setDisableYieldValue,qo=null,pn=null;function Hg(a){if(pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(qo,a,void 0,(a.current.flags&128)===128)}catch{}}function Pa(a){if(typeof Wh=="function"&&Fh(a),pn&&typeof pn.setStrictMode=="function")try{pn.setStrictMode(qo,a)}catch{}}var $n=Math.clz32?Math.clz32:tx,Ph=Math.log,ex=Math.LN2;function tx(a){return a>>>=0,a===0?32:31-(Ph(a)/ex|0)|0}var yc=128,ld=4194304;function es(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 da(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=es(u):(y&=B,y!==0?d=es(y):a||(S=B&~S,S!==0&&(d=es(S))))):(B=u&~p,B!==0?d=es(B):y!==0?d=es(y):a||(S=u&~S,S!==0&&(d=es(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 Gl(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function bc(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 Go(){var a=yc;return yc<<=1,!(yc&4194176)&&(yc=128),a}function Zt(){var a=ld;return ld<<=1,!(ld&62914560)&&(ld=4194304),a}function ts(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function fa(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Fi(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-$n(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&&ad(a,d,0),y!==0&&p===0&&a.tag!==0&&(a.suspendedLanes|=y&~(S&~i))}function ad(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var d=31-$n(i);a.entangledLanes|=i,a.entanglements[d]=a.entanglements[d]|1073741824|u&4194218}function ym(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var d=31-$n(u),p=1<<d;p&i|a[d]&i&&(a[d]|=i),u&=~p}}function vc(a){return a&=-a,2<a?8<a?a&134217727?32:268435456:8:2}function Rc(){var a=Ne.p;return a!==0?a:(a=window.event,a===void 0?32:eg(a.type))}function ns(a,i){var u=Ne.p;try{return Ne.p=a,i()}finally{Ne.p=u}}var It=Math.random().toString(36).slice(2),hn="__reactFiber$"+It,Kn="__reactProps$"+It,ls="__reactContainer$"+It,sd="__reactEvents$"+It,od="__reactListeners$"+It,wl="__reactHandles$"+It,bm="__reactResources$"+It,Yo="__reactMarker$"+It;function id(a){delete a[hn],delete a[Kn],delete a[sd],delete a[od],delete a[wl]}function as(a){var i=a[hn];if(i)return i;for(var u=a.parentNode;u;){if(i=u[ls]||u[hn]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=Tr(a);a!==null;){if(u=a[hn])return u;a=Tr(a)}return i}a=u,u=a.parentNode}return null}function Xo(a){if(a=a[hn]||a[ls]){var i=a.tag;if(i===5||i===6||i===13||i===26||i===27||i===3)return a}return null}function Pi(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(g(33))}function Yl(a){var i=a[bm];return i||(i=a[bm]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function $t(a){a[Yo]=!0}var vm=new Set,Rm={};function Qs(a,i){Qo(a,i),Qo(a+"Capture",i)}function Qo(a,i){for(Rm[a]=i,a=0;a<i.length;a++)vm.add(i[a])}var Ht=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eu=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]*$"),Zs={},Em={};function Ec(a){return nd.call(Em,a)?!0:nd.call(Zs,a)?!1:eu.test(a)?Em[a]=!0:(Zs[a]=!0,!1)}function Zo(a,i,u){if(Ec(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 tu(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 il(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 xn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ud(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ug(a){var i=ud(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 cd(a){a._valueTracker||(a._valueTracker=Ug(a))}function jm(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),d="";return a&&(d=ud(a)?a.checked?"true":"false":a.value),a=d,a!==u?(i.setValue(a),!0):!1}function nu(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 Sm=/[\n"\\]/g;function ul(a){return a.replace(Sm,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function rd(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=""+xn(i)):a.value!==""+xn(i)&&(a.value=""+xn(i)):S!=="submit"&&S!=="reset"||a.removeAttribute("value"),i!=null?Cm(a,S,xn(i)):u!=null?Cm(a,S,xn(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=""+xn(B):a.removeAttribute("name")}function Am(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?""+xn(u):"",i=i!=null?""+xn(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 Cm(a,i,u){i==="number"&&nu(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Io(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=""+xn(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 dd(a,i,u){if(i!=null&&(i=""+xn(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+xn(u):""}function jc(a,i,u,d){if(i==null){if(d!=null){if(u!=null)throw Error(g(92));if(Qt(d)){if(1<d.length)throw Error(g(93));d=d[0]}u=d}u==null&&(u=""),i=u}u=xn(i),a.defaultValue=u,d=a.textContent,d===u&&d!==""&&d!==null&&(a.value=d)}function ma(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var Vg=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 Tm(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||Vg.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function km(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&&Tm(a,p,d)}else for(var y in i)i.hasOwnProperty(y)&&Tm(a,y,i[y])}function $o(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 nx=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"]]),qg=/^[\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 fd(a){return qg.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var Bm=null;function wm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var pa=null,Is=null;function Dm(a){var i=Xo(a);if(i&&(a=i.stateNode)){var u=a[Kn]||null;e:switch(a=i.stateNode,i.type){case"input":if(rd(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="'+ul(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var d=u[i];if(d!==a&&d.form===a.form){var p=d[Kn]||null;if(!p)throw Error(g(90));rd(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&&jm(d)}break e;case"textarea":dd(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Io(a,!!u.multiple,i,!1)}}}var md=!1;function lu(a,i,u){if(md)return a(i,u);md=!0;try{var d=a(i);return d}finally{if(md=!1,(pa!==null||Is!==null)&&(wi(),pa&&(i=pa,a=Is,Is=pa=null,Dm(i),a)))for(i=0;i<a.length;i++)Dm(a[i])}}function au(a,i){var u=a.stateNode;if(u===null)return null;var d=u[Kn]||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 su=!1;if(Ht)try{var $s={};Object.defineProperty($s,"passive",{get:function(){su=!0}}),window.addEventListener("test",$s,$s),window.removeEventListener("test",$s,$s)}catch{su=!1}var ss=null,Cn=null,pd=null;function hd(){if(pd)return pd;var a,i=Cn,u=i.length,d,p="value"in ss?ss.value:ss.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 pd=p.slice(a,1<d?1-d:void 0)}function Sc(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 Ac(){return!0}function lx(){return!1}function Jn(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)?Ac:lx,this.isPropagationStopped=lx,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=Ac)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ac)},persist:function(){},isPersistent:Ac}),i}var Ks={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xd=Jn(Ks),ou=xe({},Ks,{view:0,detail:0}),Gg=Jn(ou),iu,gd,uu,Cc=xe({},ou,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cl,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!==uu&&(uu&&a.type==="mousemove"?(iu=a.screenX-uu.screenX,gd=a.screenY-uu.screenY):gd=iu=0,uu=a),iu)},movementY:function(a){return"movementY"in a?a.movementY:gd}}),ax=Jn(Cc),Yg=xe({},Cc,{dataTransfer:0}),Xg=Jn(Yg),Qg=xe({},ou,{relatedTarget:0}),Mm=Jn(Qg),Tc=xe({},Ks,{animationName:0,elapsedTime:0,pseudoElement:0}),sx=Jn(Tc),ox=xe({},Ks,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),ix=Jn(ox),ux=xe({},Ks,{data:0}),yd=Jn(ux),Zg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cx={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"},Ko={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jo(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=Ko[a])?!!i[a]:!1}function cl(){return Jo}var bd=xe({},ou,{key:function(a){if(a.key){var i=Zg[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=Sc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?cx[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cl,charCode:function(a){return a.type==="keypress"?Sc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Sc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),vd=Jn(bd),_m=xe({},Cc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gn=Jn(_m),rx=xe({},ou,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cl}),Rd=Jn(rx),Wo=xe({},Ks,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nm=Jn(Wo),dx=xe({},Cc,{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}),fx=Jn(dx),Om=xe({},Ks,{newState:0,oldState:0}),os=Jn(Om),Ed=[9,13,27,32],Fo=Ht&&"CompositionEvent"in window,Po=null;Ht&&"documentMode"in document&&(Po=document.documentMode);var zm=Ht&&"TextEvent"in window&&!Po,Lm=Ht&&(!Fo||Po&&8<Po&&11>=Po),Xl=" ",Ql=!1;function kc(a,i){switch(a){case"keyup":return Ed.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wn(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Dl=!1;function mx(a,i){switch(a){case"compositionend":return Wn(i);case"keypress":return i.which!==32?null:(Ql=!0,Xl);case"textInput":return a=i.data,a===Xl&&Ql?null:a;default:return null}}function Hm(a,i){if(Dl)return a==="compositionend"||!Fo&&kc(a,i)?(a=hd(),pd=Cn=ss=null,Dl=!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 Lm&&i.locale!=="ko"?null:i.data;default:return null}}var Um={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 Js(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!Um[a.type]:i==="textarea"}function Ws(a,i,u,d){pa?Is?Is.push(d):Is=[d]:pa=d,i=Mn(i,"onChange"),0<i.length&&(u=new xd("onChange","change",null,u,d),a.push({event:u,listeners:i}))}var ei=null,Zl=null;function px(a){Bf(a,0)}function Bc(a){var i=Pi(a);if(jm(i))return a}function cu(a,i){if(a==="change")return i}var ru=!1;if(Ht){var ti;if(Ht){var jd="oninput"in document;if(!jd){var Vm=document.createElement("div");Vm.setAttribute("oninput","return;"),jd=typeof Vm.oninput=="function"}ti=jd}else ti=!1;ru=ti&&(!document.documentMode||9<document.documentMode)}function qm(){ei&&(ei.detachEvent("onpropertychange",wc),Zl=ei=null)}function wc(a){if(a.propertyName==="value"&&Bc(Zl)){var i=[];Ws(i,Zl,a,wm(a)),lu(px,i)}}function hx(a,i,u){a==="focusin"?(qm(),ei=i,Zl=u,ei.attachEvent("onpropertychange",wc)):a==="focusout"&&qm()}function xx(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Bc(Zl)}function gx(a,i){if(a==="click")return Bc(i)}function yn(a,i){if(a==="input"||a==="change")return Bc(i)}function Sd(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var Tn=typeof Object.is=="function"?Object.is:Sd;function is(a,i){if(Tn(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(!nd.call(i,p)||!Tn(a[p],i[p]))return!1}return!0}function Dc(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Mc(a,i){var u=Dc(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=Dc(u)}}function _c(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?_c(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function Gm(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=nu(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=nu(a.document)}return i}function Ad(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 Ym(a,i){var u=Gm(i);i=a.focusedElem;var d=a.selectionRange;if(u!==i&&i&&i.ownerDocument&&_c(i.ownerDocument.documentElement,i)){if(d!==null&&Ad(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=Mc(i,y);var S=Mc(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 Xm=Ht&&"documentMode"in document&&11>=document.documentMode,rl=null,Cd=null,Ml=null,Il=!1;function Nc(a,i,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Il||rl==null||rl!==nu(d)||(d=rl,"selectionStart"in d&&Ad(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}),Ml&&is(Ml,d)||(Ml=d,d=Mn(Cd,"onSelect"),0<d.length&&(i=new xd("onSelect","select",null,i,u),a.push({event:i,listeners:d}),i.target=rl)))}function us(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var _l={animationend:us("Animation","AnimationEnd"),animationiteration:us("Animation","AnimationIteration"),animationstart:us("Animation","AnimationStart"),transitionrun:us("Transition","TransitionRun"),transitionstart:us("Transition","TransitionStart"),transitioncancel:us("Transition","TransitionCancel"),transitionend:us("Transition","TransitionEnd")},ni={},yx={};Ht&&(yx=document.createElement("div").style,"AnimationEvent"in window||(delete _l.animationend.animation,delete _l.animationiteration.animation,delete _l.animationstart.animation),"TransitionEvent"in window||delete _l.transitionend.transition);function Fs(a){if(ni[a])return ni[a];if(!_l[a])return a;var i=_l[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in yx)return ni[a]=i[u];return a}var bx=Fs("animationend"),Td=Fs("animationiteration"),Oc=Fs("animationstart"),vx=Fs("transitionrun"),Ze=Fs("transitionstart"),ye=Fs("transitioncancel"),li=Fs("transitionend"),zc=new Map,_t="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 dl(a,i){zc.set(a,i),Qs(i,[a])}var Fn=[],ai=0,Lc=0;function kd(){for(var a=ai,i=Lc=ai=0;i<a;){var u=Fn[i];Fn[i++]=null;var d=Fn[i];Fn[i++]=null;var p=Fn[i];Fn[i++]=null;var y=Fn[i];if(Fn[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&&Hn(u,p,y)}}function du(a,i,u,d){Fn[ai++]=a,Fn[ai++]=i,Fn[ai++]=u,Fn[ai++]=d,Lc|=d,a.lanes|=d,a=a.alternate,a!==null&&(a.lanes|=d)}function Hc(a,i,u,d){return du(a,i,u,d),tt(a)}function ha(a,i){return du(a,null,null,i),tt(a)}function Hn(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-$n(u),y=y.hiddenUpdates,a=y[p],a===null?y[p]=[i]:a.push(i),i.lane=u|536870912)}function tt(a){if(50<Gu)throw Gu=0,Rf=null,Error(g(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var xa={},cs=new WeakMap;function an(a,i){if(typeof a=="object"&&a!==null){var u=cs.get(a);return u!==void 0?u:(i={value:a,source:i,stack:ie(i)},cs.set(a,i),i)}return{value:a,source:i,stack:ie(i)}}var kn=[],Ps=0,rs=null,fu=0,Bn=[],Pn=0,ga=null,ya=1,ba="";function eo(a,i){kn[Ps++]=fu,kn[Ps++]=rs,rs=a,fu=i}function Qm(a,i,u){Bn[Pn++]=ya,Bn[Pn++]=ba,Bn[Pn++]=ga,ga=a;var d=ya;a=ba;var p=32-$n(d)-1;d&=~(1<<p),u+=1;var y=32-$n(i)+p;if(30<y){var S=p-p%5;y=(d&(1<<S)-1).toString(32),d>>=S,p-=S,ya=1<<32-$n(i)+p|u<<p|d,ba=y+a}else ya=1<<y|u<<p|d,ba=a}function Bd(a){a.return!==null&&(eo(a,1),Qm(a,1,0))}function Uc(a){for(;a===rs;)rs=kn[--Ps],kn[Ps]=null,fu=kn[--Ps],kn[Ps]=null;for(;a===ga;)ga=Bn[--Pn],Bn[Pn]=null,ba=Bn[--Pn],Bn[Pn]=null,ya=Bn[--Pn],Bn[Pn]=null}var bn=null,Kt=null,Pe=!1,Nl=null,$l=!1,Zm=Error(g(519));function to(a){var i=Error(g(418,""));throw pu(an(i,a)),Zm}function Im(a){var i=a.stateNode,u=a.type,d=a.memoizedProps;switch(i[hn]=a,i[Kn]=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<Ha.length;u++)We(Ha[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),Am(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0),cd(i);break;case"select":We("invalid",i);break;case"textarea":We("invalid",i),jc(i,d.value,d.defaultValue,d.children),cd(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=jo),i=!0):i=!1,i||to(a)}function $m(a){for(bn=a.return;bn;)switch(bn.tag){case 3:case 27:$l=!0;return;case 5:case 13:$l=!1;return;default:bn=bn.return}}function si(a){if(a!==bn)return!1;if(!Pe)return $m(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")||jr(a.type,a.memoizedProps)),u=!u),u&&(i=!0),i&&Kt&&to(a),$m(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){Kt=dn(a.nextSibling);break e}i--}else u!=="$"&&u!=="$!"&&u!=="$?"||i++;a=a.nextSibling}Kt=null}}else Kt=bn?dn(a.stateNode.nextSibling):null;return!0}function mu(){Kt=bn=null,Pe=!1}function pu(a){Nl===null?Nl=[a]:Nl.push(a)}var va=Error(g(460)),Vc=Error(g(474)),wd={then:function(){}};function Rx(a){return a=a.status,a==="fulfilled"||a==="rejected"}function oi(){}function ii(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(oi,oi),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,a===va?Error(g(483)):a;default:if(typeof i.status=="string")i.then(oi,oi);else{if(a=rt,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===va?Error(g(483)):a}throw ui=i,va}}var ui=null;function no(){if(ui===null)throw Error(g(459));var a=ui;return ui=null,a}var Jt=null,lo=0;function hu(a){var i=lo;return lo+=1,Jt===null&&(Jt=[]),ii(Jt,a,i)}function xu(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function gu(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 qc(a){var i=a._init;return i(a._payload)}function Dd(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=la(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=xf(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&&qc(Te)===H.type)?(H=p(H,Q.props),xu(H,Q),H.return=G,H):(H=Hu(Q.type,Q.key,Q.props,null,G.mode,de),xu(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=fr(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=Bt(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=xf(""+H,G.mode,Q),H.return=G,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case A:return Q=Hu(H.type,H.key,H.props,null,G.mode,Q),xu(Q,H),Q.return=G,Q;case j:return H=fr(H,G.mode,Q),H.return=G,H;case te:var de=H._init;return H=de(H._payload),fe(G,H,Q)}if(Qt(H)||pe(H))return H=Bt(H,G.mode,Q,null),H.return=G,H;if(typeof H.then=="function")return fe(G,hu(H),Q);if(H.$$typeof===Z)return fe(G,af(G,H),Q);gu(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(Qt(Q)||pe(Q))return Te!==null?null:le(G,H,Q,de,null);if(typeof Q.then=="function")return K(G,H,hu(Q),de);if(Q.$$typeof===Z)return K(G,H,af(G,Q),de);gu(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(Qt(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,hu(de),Te);if(de.$$typeof===Z)return ee(G,H,Q,af(H,de),Te);gu(H,de)}return null}function Ce(G,H,Q,de){for(var Te=null,Ge=null,we=H,De=H=0,tn=null;we!==null&&De<Q.length;De++){we.index>De?(tn=we,we=null):tn=we.sibling;var nt=K(G,we,Q[De],de);if(nt===null){we===null&&(we=tn);break}a&&we&&nt.alternate===null&&i(G,we),H=y(nt,H,De),Ge===null?Te=nt:Ge.sibling=nt,Ge=nt,we=tn}if(De===Q.length)return u(G,we),Pe&&eo(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&&eo(G,De),Te}for(we=d(we);De<Q.length;De++)tn=ee(we,G,De,Q[De],de),tn!==null&&(a&&tn.alternate!==null&&we.delete(tn.key===null?De:tn.key),H=y(tn,H,De),Ge===null?Te=tn:Ge.sibling=tn,Ge=tn);return a&&we.forEach(function(_o){return i(G,_o)}),Pe&&eo(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,tn=null,nt=Q.next();we!==null&&!nt.done;De++,nt=Q.next()){we.index>De?(tn=we,we=null):tn=we.sibling;var _o=K(G,we,nt.value,de);if(_o===null){we===null&&(we=tn);break}a&&we&&_o.alternate===null&&i(G,we),H=y(_o,H,De),Ge===null?Te=_o:Ge.sibling=_o,Ge=_o,we=tn}if(nt.done)return u(G,we),Pe&&eo(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&&eo(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(ry){return i(G,ry)}),Pe&&eo(G,De),Te}function vt(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&&qc(Te)===H.type){u(G,H.sibling),de=p(H,Q.props),xu(de,Q),de.return=G,G=de;break e}u(G,H);break}else i(G,H);H=H.sibling}Q.type===C?(de=Bt(Q.props.children,G.mode,de,Q.key),de.return=G,G=de):(de=Hu(Q.type,Q.key,Q.props,null,G.mode,de),xu(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=fr(Q,G.mode,de),de.return=G,G=de}return S(G);case te:return Te=Q._init,Q=Te(Q._payload),vt(G,H,Q,de)}if(Qt(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 vt(G,H,hu(Q),de);if(Q.$$typeof===Z)return vt(G,H,af(G,Q),de);gu(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=xf(Q,G.mode,de),de.return=G,G=de),S(G)):u(G,H)}return function(G,H,Q,de){try{lo=0;var Te=vt(G,H,Q,de);return Jt=null,Te}catch(we){if(we===va)throw we;var Ge=Pt(29,we,null,G.mode);return Ge.lanes=de,Ge.return=G,Ge}finally{}}}var Ra=Dd(!0),Md=Dd(!1),ds=ol(null),yu=ol(0);function Km(a,i){a=Ds,ft(yu,a),ft(ds,i),Ds=a|i.baseLanes}function _d(){ft(yu,Ds),ft(ds,ds.current)}function Gc(){Ds=yu.current,Lt(ds),Lt(yu)}var fl=ol(null),Kl=null;function Ea(a){var i=a.alternate;ft(qt,qt.current&1),ft(fl,a),Kl===null&&(i===null||ds.current!==null||i.memoizedState!==null)&&(Kl=a)}function Jm(a){if(a.tag===22){if(ft(qt,qt.current),ft(fl,a),Kl===null){var i=a.alternate;i!==null&&i.memoizedState!==null&&(Kl=a)}}else fs()}function fs(){ft(qt,qt.current),ft(fl,fl.current)}function Jl(a){Lt(fl),Kl===a&&(Kl=null),Lt(qt)}var qt=ol(0);function Yc(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 ci=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()})}},Wm=r.unstable_scheduleCallback,Fm=r.unstable_NormalPriority,Wt={$$typeof:Z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pm(){return{controller:new ci,data:new Map,refCount:0}}function bu(a){a.refCount--,a.refCount===0&&Wm(Fm,function(){a.controller.abort()})}var ms=null,Xc=0,ps=0,ri=null;function Ex(a,i){if(ms===null){var u=ms=[];Xc=0,ps=Iu(),ri={status:"pending",value:void 0,then:function(d){u.push(d)}}}return Xc++,i.then(Nd,Nd),i}function Nd(){if(--Xc===0&&ms!==null){ri!==null&&(ri.status="fulfilled");var a=ms;ms=null,ps=0,ri=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function ep(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 tp=J.S;J.S=function(a,i){typeof i=="object"&&i!==null&&typeof i.then=="function"&&Ex(a,i),tp!==null&&tp(a,i)};var ao=ol(null);function hs(){var a=ao.current;return a!==null?a:rt.pooledCache}function Qc(a,i){i===null?ft(ao,ao.current):ft(ao,i.pool)}function np(){var a=hs();return a===null?null:{parent:Wt._currentValue,pool:a}}var xs=0,ze=null,st=null,Nt=null,vu=!1,so=!1,di=!1,Gt=0,Ru=0,fi=null,jx=0;function Ot(){throw Error(g(321))}function Od(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!Tn(a[u],i[u]))return!1;return!0}function mi(a,i,u,d,p,y){return xs=y,ze=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,J.H=a===null||a.memoizedState===null?uo:Rs,di=!1,y=u(d,p),di=!1,so&&(y=lp(i,u,d,p)),zd(a),y}function zd(a){J.H=sn;var i=st!==null&&st.next!==null;if(xs=0,Nt=st=ze=null,vu=!1,Ru=0,fi=null,i)throw Error(g(300));a===null||kt||(a=a.dependencies,a!==null&&or(a)&&(kt=!0))}function lp(a,i,u,d){ze=a;var p=0;do{if(so&&(fi=null),Ru=0,so=!1,25<=p)throw Error(g(301));if(p+=1,Nt=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=xi,y=i(u,d)}while(so);return y}function Sx(){var a=J.H,i=a.useState()[0];return i=typeof i.then=="function"?pi(i):i,a=a.useState()[0],(st!==null?st.memoizedState:null)!==a&&(ze.flags|=1024),i}function Ld(){var a=Gt!==0;return Gt=0,a}function Zc(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function Ic(a){if(vu){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}vu=!1}xs=0,Nt=st=ze=null,so=!1,Ru=Gt=0,fi=null}function wn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?ze.memoizedState=Nt=a:Nt=Nt.next=a,Nt}function Ut(){if(st===null){var a=ze.alternate;a=a!==null?a.memoizedState:null}else a=st.next;var i=Nt===null?ze.memoizedState:Nt.next;if(i!==null)Nt=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},Nt===null?ze.memoizedState=Nt=a:Nt=Nt.next=a}return Nt}var Eu;Eu=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function pi(a){var i=Ru;return Ru+=1,fi===null&&(fi=[]),a=ii(fi,a,i),i=ze,(Nt===null?i.memoizedState:Nt.next)===null&&(i=i.alternate,J.H=i===null||i.memoizedState===null?uo:Rs),a}function ju(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return pi(a);if(a.$$typeof===Z)return vn(a)}throw Error(g(438,String(a)))}function Hd(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=Eu(),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 ja(a,i){return typeof i=="function"?i(a):i}function Su(a){var i=Ut();return Ud(i,st,a)}function Ud(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:(xs&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===ps&&(le=!0);else if((xs&K)===K){U=U.next,K===ps&&(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,xo|=K;fe=U.action,di&&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,xo|=fe;U=U.next}while(U!==null&&U!==i);if(D===null?S=y:D.next=B,!Tn(y,a.memoizedState)&&(kt=!0,le&&(u=ri,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 Wl(a){var i=Ut(),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);Tn(y,i.memoizedState)||(kt=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),u.lastRenderedState=y}return[y,d]}function Vd(a,i,u){var d=ze,p=Ut(),y=Pe;if(y){if(u===void 0)throw Error(g(407));u=u()}else u=i();var S=!Tn((st||p).memoizedState,u);if(S&&(p.memoizedState=u,kt=!0),p=p.queue,Ol($c.bind(null,d,p,a),[a]),p.getSnapshot!==i||S||Nt!==null&&Nt.memoizedState.tag&1){if(d.flags|=2048,Aa(9,qd.bind(null,d,p,u,i),{destroy:void 0},null),rt===null)throw Error(g(349));y||xs&60||Ax(d,i,u)}return u}function Ax(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=ze.updateQueue,i===null?(i=Eu(),ze.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function qd(a,i,u,d){i.value=u,i.getSnapshot=d,gs(i)&&Sa(a)}function $c(a,i,u){return u(function(){gs(i)&&Sa(a)})}function gs(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!Tn(a,u)}catch{return!0}}function Sa(a){var i=ha(a,2);i!==null&&en(i,a,2)}function Kc(a){var i=wn();if(typeof a=="function"){var u=a;if(a=u(),di){Pa(!0);try{u()}finally{Pa(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:a},i}function Gd(a,i,u,d){return a.baseState=u,Ud(a,st,typeof d=="function"?d:ja)}function Jc(a,i,u,d,p){if(Jd(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,Wc(i,y)):(y.next=u.next,i.pending=u.next=y)}}function Wc(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),oo(a,i,B)}catch(U){Au(a,i,U)}finally{J.T=y}}else try{y=u(p,d),oo(a,i,y)}catch(U){Au(a,i,U)}}function oo(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(d){yt(a,i,d)},function(d){return Au(a,i,d)}):yt(a,i,u)}function yt(a,i,u){i.status="fulfilled",i.value=u,ap(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,Wc(a,u)))}function Au(a,i,u){var d=a.pending;if(a.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=u,ap(i),i=i.next;while(i!==d)}a.action=null}function ap(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function Yd(a,i){return i}function Xd(a,i){if(Pe){var u=rt.formState;if(u!==null){e:{var d=ze;if(Pe){if(Kt){t:{for(var p=Kt,y=$l;p.nodeType!==8;){if(!y){p=null;break t}if(p=dn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Kt=dn(p.nextSibling),d=p.data==="F!";break e}}to(d)}d=!1}d&&(i=u[0])}}return u=wn(),u.memoizedState=u.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yd,lastRenderedState:i},u.queue=d,u=Kd.bind(null,ze,d),d.dispatch=u,d=Kc(!1),y=hp.bind(null,ze,!1,d.queue),d=wn(),p={state:i,dispatch:null,action:a,pending:null},d.queue=p,u=Jc.bind(null,ze,p,y,u),p.dispatch=u,d.memoizedState=a,[i,u,!1]}function ys(a){var i=Ut();return bs(i,st,a)}function bs(a,i,u){i=Ud(a,i,Yd)[0],a=Su(ja)[0],i=typeof i=="object"&&i!==null&&typeof i.then=="function"?pi(i):i;var d=Ut(),p=d.queue,y=p.dispatch;return u!==d.memoizedState&&(ze.flags|=2048,Aa(9,Fc.bind(null,p,u),{destroy:void 0},null)),[i,y,a]}function Fc(a,i){a.action=i}function Pc(a){var i=Ut(),u=st;if(u!==null)return bs(i,u,a);Ut(),i=i.memoizedState,u=Ut();var d=u.queue.dispatch;return u.memoizedState=a,[i,d,!1]}function Aa(a,i,u,d){return a={tag:a,create:i,inst:u,deps:d,next:null},i=ze.updateQueue,i===null&&(i=Eu(),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 Cu(){return Ut().memoizedState}function er(a,i,u,d){var p=wn();ze.flags|=a,p.memoizedState=Aa(1|i,u,{destroy:void 0},d===void 0?null:d)}function Qd(a,i,u,d){var p=Ut();d=d===void 0?null:d;var y=p.memoizedState.inst;st!==null&&d!==null&&Od(d,st.memoizedState.deps)?p.memoizedState=Aa(i,u,y,d):(ze.flags|=a,p.memoizedState=Aa(1|i,u,y,d))}function sp(a,i){er(8390656,8,a,i)}function Ol(a,i){Qd(2048,8,a,i)}function op(a,i){return Qd(4,2,a,i)}function Zd(a,i){return Qd(4,4,a,i)}function Tu(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 hi(a,i,u){u=u!=null?u.concat([a]):null,Qd(4,4,Tu.bind(null,i,a),u)}function Id(){}function $d(a,i){var u=Ut();i=i===void 0?null:i;var d=u.memoizedState;return i!==null&&Od(i,d[1])?d[0]:(u.memoizedState=[a,i],a)}function ip(a,i){var u=Ut();i=i===void 0?null:i;var d=u.memoizedState;if(i!==null&&Od(i,d[1]))return d[0];if(d=a(),di){Pa(!0);try{a()}finally{Pa(!1)}}return u.memoizedState=[d,i],d}function up(a,i,u){return u===void 0||xs&1073741824?a.memoizedState=i:(a.memoizedState=u,a=ki(),ze.lanes|=a,xo|=a,u)}function Cx(a,i,u,d){return Tn(u,i)?u:ds.current!==null?(a=up(a,u,d),Tn(a,i)||(kt=!0),a):xs&42?(a=ki(),ze.lanes|=a,xo|=a,i):(kt=!0,a.memoizedState=u)}function cp(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,hp(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=ep(D,d);io(a,i,le,Dn(a))}else io(a,i,d,Dn(a))}catch(fe){io(a,i,{then:function(){},status:"rejected",reason:fe},Dn())}finally{Ne.p=y,J.T=S}}function Ig(){}function vs(a,i,u,d){if(a.tag!==5)throw Error(g(476));var p=el(a).queue;cp(a,p,i,Mt,u===null?Ig:function(){return rp(a),u(d)})}function el(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:Mt,baseState:Mt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:Mt},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function rp(a){var i=el(a).next.queue;io(a,i,{},Dn())}function dp(){return vn(al)}function fp(){return Ut().memoizedState}function mp(){return Ut().memoizedState}function Tx(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=Dn();a=As(u);var d=Cs(i,a,u);d!==null&&(en(d,i,u),Nu(d,i,u)),i={cache:Pm()},a.payload=i;return}i=i.return}}function pp(a,i,u){var d=Dn();u={lane:d,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},Jd(a)?xp(i,u):(u=Hc(a,i,u,d),u!==null&&(en(u,a,d),gp(u,i,d)))}function Kd(a,i,u){var d=Dn();io(a,i,u,d)}function io(a,i,u,d){var p={lane:d,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(Jd(a))xp(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,Tn(B,S))return du(a,i,p,0),rt===null&&kd(),!1}catch{}finally{}if(u=Hc(a,i,p,d),u!==null)return en(u,a,d),gp(u,i,d),!0}return!1}function hp(a,i,u,d){if(d={lane:2,revertLane:Iu(),action:d,hasEagerState:!1,eagerState:null,next:null},Jd(a)){if(i)throw Error(g(479))}else i=Hc(a,u,d,2),i!==null&&en(i,a,2)}function Jd(a){var i=a.alternate;return a===ze||i!==null&&i===ze}function xp(a,i){so=vu=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function gp(a,i,u){if(u&4194176){var d=i.lanes;d&=a.pendingLanes,u|=d,i.lanes=u,ym(a,u)}}var sn={readContext:vn,use:ju,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot};sn.useCacheRefresh=Ot,sn.useMemoCache=Ot,sn.useHostTransitionStatus=Ot,sn.useFormState=Ot,sn.useActionState=Ot,sn.useOptimistic=Ot;var uo={readContext:vn,use:ju,useCallback:function(a,i){return wn().memoizedState=[a,i===void 0?null:i],a},useContext:vn,useEffect:sp,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,er(4194308,4,Tu.bind(null,i,a),u)},useLayoutEffect:function(a,i){return er(4194308,4,a,i)},useInsertionEffect:function(a,i){er(4,2,a,i)},useMemo:function(a,i){var u=wn();i=i===void 0?null:i;var d=a();if(di){Pa(!0);try{a()}finally{Pa(!1)}}return u.memoizedState=[d,i],d},useReducer:function(a,i,u){var d=wn();if(u!==void 0){var p=u(i);if(di){Pa(!0);try{u(i)}finally{Pa(!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=pp.bind(null,ze,a),[d.memoizedState,a]},useRef:function(a){var i=wn();return a={current:a},i.memoizedState=a},useState:function(a){a=Kc(a);var i=a.queue,u=Kd.bind(null,ze,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:Id,useDeferredValue:function(a,i){var u=wn();return up(u,a,i)},useTransition:function(){var a=Kc(!1);return a=cp.bind(null,ze,a.queue,!0,!1),wn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var d=ze,p=wn();if(Pe){if(u===void 0)throw Error(g(407));u=u()}else{if(u=i(),rt===null)throw Error(g(349));Fe&60||Ax(d,i,u)}p.memoizedState=u;var y={value:u,getSnapshot:i};return p.queue=y,sp($c.bind(null,d,y,a),[a]),d.flags|=2048,Aa(9,qd.bind(null,d,y,u,i),{destroy:void 0},null),u},useId:function(){var a=wn(),i=rt.identifierPrefix;if(Pe){var u=ba,d=ya;u=(d&~(1<<32-$n(d)-1)).toString(32)+u,i=":"+i+"R"+u,u=Gt++,0<u&&(i+="H"+u.toString(32)),i+=":"}else u=jx++,i=":"+i+"r"+u.toString(32)+":";return a.memoizedState=i},useCacheRefresh:function(){return wn().memoizedState=Tx.bind(null,ze)}};uo.useMemoCache=Hd,uo.useHostTransitionStatus=dp,uo.useFormState=Xd,uo.useActionState=Xd,uo.useOptimistic=function(a){var i=wn();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=hp.bind(null,ze,!0,u),u.dispatch=i,[a,i]};var Rs={readContext:vn,use:ju,useCallback:$d,useContext:vn,useEffect:Ol,useImperativeHandle:hi,useInsertionEffect:op,useLayoutEffect:Zd,useMemo:ip,useReducer:Su,useRef:Cu,useState:function(){return Su(ja)},useDebugValue:Id,useDeferredValue:function(a,i){var u=Ut();return Cx(u,st.memoizedState,a,i)},useTransition:function(){var a=Su(ja)[0],i=Ut().memoizedState;return[typeof a=="boolean"?a:pi(a),i]},useSyncExternalStore:Vd,useId:fp};Rs.useCacheRefresh=mp,Rs.useMemoCache=Hd,Rs.useHostTransitionStatus=dp,Rs.useFormState=ys,Rs.useActionState=ys,Rs.useOptimistic=function(a,i){var u=Ut();return Gd(u,st,a,i)};var xi={readContext:vn,use:ju,useCallback:$d,useContext:vn,useEffect:Ol,useImperativeHandle:hi,useInsertionEffect:op,useLayoutEffect:Zd,useMemo:ip,useReducer:Wl,useRef:Cu,useState:function(){return Wl(ja)},useDebugValue:Id,useDeferredValue:function(a,i){var u=Ut();return st===null?up(u,a,i):Cx(u,st.memoizedState,a,i)},useTransition:function(){var a=Wl(ja)[0],i=Ut().memoizedState;return[typeof a=="boolean"?a:pi(a),i]},useSyncExternalStore:Vd,useId:fp};xi.useCacheRefresh=mp,xi.useMemoCache=Hd,xi.useHostTransitionStatus=dp,xi.useFormState=Pc,xi.useActionState=Pc,xi.useOptimistic=function(a,i){var u=Ut();return st!==null?Gd(u,st,a,i):(u.baseState=a,[a,u.queue.dispatch])};function tr(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 yp={isMounted:function(a){return(a=a._reactInternals)?re(a)===a:!1},enqueueSetState:function(a,i,u){a=a._reactInternals;var d=Dn(),p=As(d);p.payload=i,u!=null&&(p.callback=u),i=Cs(a,p,d),i!==null&&(en(i,a,d),Nu(i,a,d))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var d=Dn(),p=As(d);p.tag=1,p.payload=i,u!=null&&(p.callback=u),i=Cs(a,p,d),i!==null&&(en(i,a,d),Nu(i,a,d))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=Dn(),d=As(u);d.tag=2,i!=null&&(d.callback=i),i=Cs(a,d,u),i!==null&&(en(i,a,u),Nu(i,a,u))}};function ml(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?!is(u,d)||!is(p,y):!0}function bp(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&&yp.enqueueReplaceState(i,i.state,null)}function on(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 nr=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 kx(a){nr(a)}function Fl(a){console.error(a)}function vp(a){nr(a)}function Es(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function Rp(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 Pl(a,i,u){return u=As(u),u.tag=3,u.payload={element:null},u.callback=function(){Es(a,i)},u}function Wd(a){return a=As(a),a.tag=3,a}function Fd(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(){Rp(i,u,d)}}var S=u.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(a.callback=function(){Rp(i,u,d),typeof p!="function"&&(Ms===null?Ms=new Set([this]):Ms.add(this));var B=d.stack;this.componentDidCatch(d.value,{componentStack:B!==null?B:""})})}function co(a,i,u,d,p){if(u.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=u.alternate,i!==null&&mt(i,u,p,!0),u=fl.current,u!==null){switch(u.tag){case 13:return Kl===null?Ef():u.alternate===null&&Ct===0&&(Ct=3),u.flags&=-257,u.flags|=65536,u.lanes=p,d===wd?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([d]):i.add(d),Xp(a,d,p)),!1;case 22:return u.flags|=65536,d===wd?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)),Xp(a,d,p)),!1}throw Error(g(435,u.tag))}return Xp(a,d,p),Ef(),!1}if(Pe)return i=fl.current,i!==null?(!(i.flags&65536)&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==Zm&&(a=Error(g(422),{cause:d}),pu(an(a,u)))):(d!==Zm&&(i=Error(g(423),{cause:d}),pu(an(i,u))),a=a.current.alternate,a.flags|=65536,p&=-p,a.lanes|=p,d=an(d,u),p=Pl(a.stateNode,d,p),ur(a,p),Ct!==4&&(Ct=2)),!1;var y=Error(g(520),{cause:d});if(y=an(y,u),pr===null?pr=[y]:pr.push(y),Ct!==4&&(Ct=2),i===null)return!0;d=an(d,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=p&-p,u.lanes|=a,a=Pl(u.stateNode,d,a),ur(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"&&(Ms===null||!Ms.has(y))))return u.flags|=65536,p&=-p,u.lanes|=p,p=Wd(p),Fd(p,a,u,d),ur(u,p),!1}u=u.return}while(u!==null);return!1}var Ep=Error(g(461)),kt=!1;function un(a,i,u,d){i.child=a===null?Md(i,null,u,d):Ra(i,a.child,u,d)}function ku(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 Ss(i),d=mi(a,i,u,S,y,p),B=Ld(),a!==null&&!kt?(Zc(a,i,p),ka(a,i,p)):(Pe&&B&&Bd(i),i.flags|=1,un(a,i,d,p),i.child)}function gi(a,i,u,d,p){if(a===null){var y=u.type;return typeof y=="function"&&!hf(y)&&y.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=y,jp(a,i,y,d,p)):(a=Hu(u.type,null,d,i,i.mode,p),a.ref=i.ref,a.return=i,i.child=a)}if(y=a.child,!_u(a,p)){var S=y.memoizedProps;if(u=u.compare,u=u!==null?u:is,u(S,d)&&a.ref===i.ref)return ka(a,i,p)}return i.flags|=1,a=la(y,d),a.ref=i.ref,a.return=i,i.child=a}function jp(a,i,u,d,p){if(a!==null){var y=a.memoizedProps;if(is(y,d)&&a.ref===i.ref)if(kt=!1,i.pendingProps=d=y,_u(a,p))a.flags&131072&&(kt=!0);else return i.lanes=a.lanes,ka(a,i,p)}return Du(a,i,u,d,p)}function Sp(a,i,u){var d=i.pendingProps,p=d.children,y=(i.stateNode._pendingVisibility&2)!==0,S=a!==null?a.memoizedState:null;if(wu(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 Bu(a,i,d,u)}if(u&536870912)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&Qc(i,S!==null?S.cachePool:null),S!==null?Km(i,S):_d(),Jm(i);else return i.lanes=i.childLanes=536870912,Bu(a,i,S!==null?S.baseLanes|u:u,u)}else S!==null?(Qc(i,S.cachePool),Km(i,S),fs(),i.memoizedState=null):(a!==null&&Qc(i,null),_d(),fs());return un(a,i,p,u),i.child}function Bu(a,i,u,d){var p=hs();return p=p===null?null:{parent:Wt._currentValue,pool:p},i.memoizedState={baseLanes:u,cachePool:p},a!==null&&Qc(i,null),_d(),Jm(i),a!==null&&mt(a,i,d,!0),null}function wu(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 Du(a,i,u,d,p){return Ss(i),u=mi(a,i,u,d,void 0,p),d=Ld(),a!==null&&!kt?(Zc(a,i,p),ka(a,i,p)):(Pe&&d&&Bd(i),i.flags|=1,un(a,i,u,p),i.child)}function Ap(a,i,u,d,p,y){return Ss(i),i.updateQueue=null,u=lp(i,d,u,p),zd(a),d=Ld(),a!==null&&!kt?(Zc(a,i,y),ka(a,i,y)):(Pe&&d&&Bd(i),i.flags|=1,un(a,i,u,y),i.child)}function Cp(a,i,u,d,p){if(Ss(i),i.stateNode===null){var y=xa,S=u.contextType;typeof S=="object"&&S!==null&&(y=vn(S)),y=new u(d,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=yp,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=d,y.state=i.memoizedState,y.refs={},ir(i),S=u.contextType,y.context=typeof S=="object"&&S!==null?vn(S):xa,y.state=i.memoizedState,S=u.getDerivedStateFromProps,typeof S=="function"&&(tr(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&&yp.enqueueReplaceState(y,y.state,null),rr(i,d,y,p),Ou(),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=on(u,B);y.props=D;var U=y.context,le=u.contextType;S=xa,typeof le=="object"&&le!==null&&(S=vn(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)&&bp(i,y,d,S),pl=!1;var K=i.memoizedState;y.state=K,rr(i,d,y,p),Ou(),U=i.memoizedState,B||K!==U||pl?(typeof fe=="function"&&(tr(i,u,fe,d),U=i.memoizedState),(D=pl||ml(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,fo(a,i),S=i.memoizedProps,le=on(u,S),y.props=le,fe=i.pendingProps,K=y.context,U=u.contextType,D=xa,typeof U=="object"&&U!==null&&(D=vn(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)&&bp(i,y,d,D),pl=!1,K=i.memoizedState,y.state=K,rr(i,d,y,p),Ou();var ee=i.memoizedState;S!==fe||K!==ee||pl||a!==null&&a.dependencies!==null&&or(a.dependencies)?(typeof B=="function"&&(tr(i,u,B,d),ee=i.memoizedState),(le=pl||ml(i,u,le,d,K,ee,D)||a!==null&&a.dependencies!==null&&or(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,wu(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=Ra(i,a.child,null,p),i.child=Ra(i,null,u,p)):un(a,i,u,p),i.memoizedState=y.state,a=i.child):a=ka(a,i,p),a}function Bx(a,i,u,d){return mu(),i.flags|=256,un(a,i,u,d),i.child}var lr={dehydrated:null,treeContext:null,retryLane:0};function Ca(a){return{baseLanes:a,cachePool:np()}}function Pd(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=Ll),a}function ef(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:(qt.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,a===null){if(Pe){if(p?Ea(i):fs(),Pe){var B=Kt,D;if(D=B){e:{for(D=B,B=$l;D.nodeType!==8;){if(!B){B=null;break e}if(D=dn(D.nextSibling),D===null){B=null;break e}}B=D}B!==null?(i.memoizedState={dehydrated:B,treeContext:ga!==null?{id:ya,overflow:ba}:null,retryLane:536870912},D=Pt(18,null,null,0),D.stateNode=B,D.return=i,i.child=D,bn=i,Kt=null,D=!0):D=!1}D||to(i)}if(B=i.memoizedState,B!==null&&(B=B.dehydrated,B!==null))return B.data==="$!"?i.lanes=16:i.lanes=536870912,null;Jl(i)}return B=d.children,d=d.fallback,p?(fs(),p=i.mode,B=js({mode:"hidden",children:B},p),d=Bt(d,p,u,null),B.return=i,d.return=i,B.sibling=d,i.child=B,p=i.child,p.memoizedState=Ca(u),p.childLanes=Pd(a,S,u),i.memoizedState=lr,d):(Ea(i),Mu(i,B))}if(D=a.memoizedState,D!==null&&(B=D.dehydrated,B!==null)){if(y)i.flags&256?(Ea(i),i.flags&=-257,i=tf(a,i,u)):i.memoizedState!==null?(fs(),i.child=a.child,i.flags|=128,i=null):(fs(),p=d.fallback,B=i.mode,d=js({mode:"visible",children:d.children},B),p=Bt(p,B,u,null),p.flags|=2,d.return=i,p.return=i,d.sibling=p,i.child=d,Ra(i,a.child,null,u),d=i.child,d.memoizedState=Ca(u),d.childLanes=Pd(a,S,u),i.memoizedState=lr,i=p);else if(Ea(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,pu({value:d,source:null,stack:null}),i=tf(a,i,u)}else if(kt||mt(a,i,u,!1),S=(u&a.childLanes)!==0,kt||S){if(S=rt,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,ha(a,d),en(S,a,d),Ep}B.data==="$?"||Ef(),i=tf(a,i,u)}else B.data==="$?"?(i.flags|=128,i.child=a.child,i=Wg.bind(null,a),B._reactRetry=i,i=null):(a=D.treeContext,Kt=dn(B.nextSibling),bn=i,Pe=!0,Nl=null,$l=!1,a!==null&&(Bn[Pn++]=ya,Bn[Pn++]=ba,Bn[Pn++]=ga,ya=a.id,ba=a.overflow,ga=i),i=Mu(i,d.children),i.flags|=4096);return i}return p?(fs(),p=d.fallback,B=i.mode,D=a.child,U=D.sibling,d=la(D,{mode:"hidden",children:d.children}),d.subtreeFlags=D.subtreeFlags&31457280,U!==null?p=la(U,p):(p=Bt(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=Ca(u):(D=B.cachePool,D!==null?(U=Wt._currentValue,D=D.parent!==U?{parent:U,pool:U}:D):D=np(),B={baseLanes:B.baseLanes|u,cachePool:D}),p.memoizedState=B,p.childLanes=Pd(a,S,u),i.memoizedState=lr,d):(Ea(i),u=a.child,a=u.sibling,u=la(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 Mu(a,i){return i=js({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function js(a,i){return Lx(a,i,0,null)}function tf(a,i,u){return Ra(i,a.child,null,u),a=Mu(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function nf(a,i,u){a.lanes|=i;var d=a.alternate;d!==null&&(d.lanes|=i),Un(a.return,i,u)}function ar(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 Ta(a,i,u){var d=i.pendingProps,p=d.revealOrder,y=d.tail;if(un(a,i,d.children,u),d=qt.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&&nf(a,u,i);else if(a.tag===19)nf(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(ft(qt,d),p){case"forwards":for(u=i.child,p=null;u!==null;)a=u.alternate,a!==null&&Yc(a)===null&&(p=u),u=u.sibling;u=p,u===null?(p=i.child,i.child=null):(p=u.sibling,u.sibling=null),ar(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&&Yc(a)===null){i.child=p;break}a=p.sibling,p.sibling=u,u=p,p=a}ar(i,!0,u,null,y);break;case"together":ar(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function ka(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),xo|=i.lanes,!(u&i.childLanes))if(a!==null){if(mt(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=la(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=la(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function _u(a,i){return a.lanes&i?!0:(a=a.dependencies,!!(a!==null&&or(a)))}function sr(a,i,u){switch(i.tag){case 3:ed(i,i.stateNode.containerInfo),ro(i,Wt,a.memoizedState.cache),mu();break;case 27:case 5:pt(i);break;case 4:ed(i,i.stateNode.containerInfo);break;case 10:ro(i,i.type,i.memoizedProps.value);break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Ea(i),i.flags|=128,null):u&i.child.childLanes?ef(a,i,u):(Ea(i),a=ka(a,i,u),a!==null?a.sibling:null);Ea(i);break;case 19:var p=(a.flags&128)!==0;if(d=(u&i.childLanes)!==0,d||(mt(a,i,u,!1),d=(u&i.childLanes)!==0),p){if(d)return Ta(a,i,u);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ft(qt,qt.current),d)break;return null;case 22:case 23:return i.lanes=0,Sp(a,i,u);case 24:ro(i,Wt,a.memoizedState.cache)}return ka(a,i,u)}function bt(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)kt=!0;else{if(!_u(a,u)&&!(i.flags&128))return kt=!1,sr(a,i,u);kt=!!(a.flags&131072)}else kt=!1,Pe&&i.flags&1048576&&Qm(i,fu,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")hf(d)?(a=on(d,a),i.tag=1,i=Cp(null,i,d,a,u)):(i.tag=0,i=Du(null,i,d,a,u));else{if(d!=null){if(p=d.$$typeof,p===q){i.tag=11,i=ku(null,i,d,a,u);break e}else if(p===he){i.tag=14,i=gi(null,i,d,a,u);break e}}throw i=Me(d)||d,Error(g(306,i,""))}}return i;case 0:return Du(a,i,i.type,i.pendingProps,u);case 1:return d=i.type,p=on(d,i.pendingProps),Cp(a,i,d,p,u);case 3:e:{if(ed(i,i.stateNode.containerInfo),a===null)throw Error(g(387));var y=i.pendingProps;p=i.memoizedState,d=p.element,fo(a,i),rr(i,y,null,u);var S=i.memoizedState;if(y=S.cache,ro(i,Wt,y),y!==p.cache&&lf(i,[Wt],u,!0),Ou(),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=Bx(a,i,y,u);break e}else if(y!==d){d=an(Error(g(424)),i),pu(d),i=Bx(a,i,y,u);break e}else for(Kt=dn(i.stateNode.containerInfo.firstChild),bn=i,Pe=!0,Nl=null,$l=!0,u=Md(i,null,y,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(mu(),y===d){i=ka(a,i,u);break e}un(a,i,y,u)}i=i.child}return i;case 26:return wu(a,i),a===null?(u=Se(i.type,null,i.pendingProps,null))?i.memoizedState=u:Pe||(u=i.type,a=i.pendingProps,d=Er(ra.current).createElement(u),d[hn]=i,d[Kn]=a,rn(d,u,a),$t(d),i.stateNode=d):i.memoizedState=Se(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return pt(i),a===null&&Pe&&(d=i.stateNode=Ua(i.type,i.pendingProps,ra.current),bn=i,$l=!0,Kt=dn(d.firstChild)),d=i.pendingProps.children,a!==null||Pe?un(a,i,d,u):i.child=Ra(i,null,d,u),wu(a,i),i.child;case 5:return a===null&&Pe&&((p=d=Kt)&&(d=So(d,i.type,i.pendingProps,$l),d!==null?(i.stateNode=d,bn=i,Kt=dn(d.firstChild),$l=!1,p=!0):p=!1),p||to(i)),pt(i),p=i.type,y=i.pendingProps,S=a!==null?a.memoizedProps:null,d=y.children,jr(p,y)?d=null:S!==null&&jr(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=mi(a,i,Sx,null,null,u),al._currentValue=p),wu(a,i),un(a,i,d,u),i.child;case 6:return a===null&&Pe&&((a=u=Kt)&&(u=Cr(u,i.pendingProps,$l),u!==null?(i.stateNode=u,bn=i,Kt=null,a=!0):a=!1),a||to(i)),null;case 13:return ef(a,i,u);case 4:return ed(i,i.stateNode.containerInfo),d=i.pendingProps,a===null?i.child=Ra(i,null,d,u):un(a,i,d,u),i.child;case 11:return ku(a,i,i.type,i.pendingProps,u);case 7:return un(a,i,i.pendingProps,u),i.child;case 8:return un(a,i,i.pendingProps.children,u),i.child;case 12:return un(a,i,i.pendingProps.children,u),i.child;case 10:return d=i.pendingProps,ro(i,i.type,d.value),un(a,i,d.children,u),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Ss(i),p=vn(p),d=d(p),i.flags|=1,un(a,i,d,u),i.child;case 14:return gi(a,i,i.type,i.pendingProps,u);case 15:return jp(a,i,i.type,i.pendingProps,u);case 19:return Ta(a,i,u);case 22:return Sp(a,i,u);case 24:return Ss(i),d=vn(Wt),a===null?(p=hs(),p===null&&(p=rt,y=Pm(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=u),p=y),i.memoizedState={parent:d,cache:p},ir(i),ro(i,Wt,p)):(a.lanes&u&&(fo(a,i),rr(i,null,null,u),Ou()),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),ro(i,Wt,d)):(d=y.cache,ro(i,Wt,d),d!==p.cache&&lf(i,[Wt],u,!0))),un(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(g(156,i.tag))}var Tp=ol(null),yi=null,Ba=null;function ro(a,i,u){ft(Tp,i._currentValue),i._currentValue=u}function wa(a){a._currentValue=Tp.current,Lt(Tp)}function Un(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 lf(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),Un(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),Un(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 mt(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;Tn(p.pendingProps.value,S.value)||(a!==null?a.push(B):a=[B])}}else if(p===Ho.current){if(S=p.alternate,S===null)throw Error(g(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(a!==null?a.push(al):a=[al])}p=p.return}a!==null&&lf(i,a,u,d),i.flags|=262144}function or(a){for(a=a.firstContext;a!==null;){if(!Tn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Ss(a){yi=a,Ba=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function vn(a){return Da(yi,a)}function af(a,i){return yi===null&&Ss(a),Da(a,i)}function Da(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Ba===null){if(a===null)throw Error(g(308));Ba=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else Ba=Ba.next=i;return u}var pl=!1;function ir(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(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 As(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Cs(a,i,u){var d=a.updateQueue;if(d===null)return null;if(d=d.shared,At&2){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=tt(a),Hn(a,null,u),i}return du(a,d,i,u),tt(a)}function Nu(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,ym(a,u)}}function ur(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 cr=!1;function Ou(){if(cr){var a=ri;if(a!==null)throw a}}function rr(a,i,u,d){cr=!1;var p=a.updateQueue;pl=!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===ps&&(cr=!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 vt=u;switch(_e.tag){case 1:if(Ce=_e.payload,typeof Ce=="function"){fe=Ce.call(vt,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(vt,fe,K):Ce,K==null)break e;fe=xe({},fe,K);break e;case 2:pl=!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),xo|=S,a.lanes=S,a.memoizedState=fe}}function wx(a,i){if(typeof a!="function")throw Error(g(191,a));a.call(i)}function kp(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)wx(u[a],i)}function zu(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){dt(i,i.return,B)}}function mo(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){dt(p,D,U)}}}d=d.next}while(d!==y)}}catch(U){dt(i,i.return,U)}}function bi(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{kp(i,u)}catch(d){dt(a,a.return,d)}}}function dr(a,i,u){u.props=on(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(d){dt(a,i,d)}}function po(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){dt(a,i,y)}}function Vn(a,i){var u=a.ref,d=a.refCleanup;if(u!==null)if(typeof d=="function")try{d()}catch(p){dt(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){dt(a,i,p)}else u.current=null}function Dx(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){dt(a,a.return,p)}}function Mx(a,i,u){try{var d=a.stateNode;Ix(d,a.type,u,i),d[Kn]=i}catch(p){dt(a,a.return,p)}}function Bp(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27||a.tag===4}function Ts(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Bp(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 sf(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=jo));else if(d!==4&&d!==27&&(a=a.child,a!==null))for(sf(a,i,u),a=a.sibling;a!==null;)sf(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 ea=!1,zt=!1,of=!1,_x=typeof WeakSet=="function"?WeakSet:Set,cn=null,uf=!1;function Nx(a,i){if(a=a.containerInfo,Mf=wr,a=Gm(a),Ad(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(_f={focusedElem:a,selectionRange:u},wr=!1,cn=i;cn!==null;)if(i=cn,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,cn=a;else for(;cn!==null;){switch(i=cn,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=on(u.type,p,u.elementType===u.type);a=d.getSnapshotBeforeUpdate(Ce,y),d.__reactInternalSnapshotBeforeUpdate=a}catch(_e){dt(u,u.return,_e)}}break;case 3:if(a&1024){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)aa(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":aa(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,cn=a;break}cn=i.return}return Ce=uf,uf=!1,Ce}function wp(a,i,u){var d=u.flags;switch(u.tag){case 0:case 11:case 15:Ma(a,u),d&4&&zu(5,u);break;case 1:if(Ma(a,u),d&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(B){dt(u,u.return,B)}else{var p=on(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(p,i,a.__reactInternalSnapshotBeforeUpdate)}catch(B){dt(u,u.return,B)}}d&64&&bi(u),d&512&&po(u,u.return);break;case 3:if(Ma(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{kp(d,a)}catch(B){dt(u,u.return,B)}}break;case 26:Ma(a,u),d&512&&po(u,u.return);break;case 27:case 5:Ma(a,u),i===null&&d&4&&Dx(u),d&512&&po(u,u.return);break;case 12:Ma(a,u);break;case 13:Ma(a,u),d&4&&Lu(a,u);break;case 22:if(p=u.memoizedState!==null||ea,!p){i=i!==null&&i.memoizedState!==null||zt;var y=ea,S=zt;ea=p,(zt=i)&&!S?ho(a,u,(u.subtreeFlags&8772)!==0):Ma(a,u),ea=y,zt=S}d&512&&(u.memoizedProps.mode==="manual"?po(u,u.return):Vn(u,u.return));break;default:Ma(a,u)}}function Dp(a){var i=a.alternate;i!==null&&(a.alternate=null,Dp(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&id(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 jt=null,hl=!1;function ks(a,i,u){for(u=u.child;u!==null;)ta(a,i,u),u=u.sibling}function ta(a,i,u){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(qo,u)}catch{}switch(u.tag){case 26:zt||Vn(u,i),ks(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:zt||Vn(u,i);var d=jt,p=hl;for(jt=u.stateNode,ks(a,i,u),u=u.stateNode,i=u.attributes;i.length;)u.removeAttributeNode(i[0]);id(u),jt=d,hl=p;break;case 5:zt||Vn(u,i);case 6:p=jt;var y=hl;if(jt=null,ks(a,i,u),jt=p,hl=y,jt!==null)if(hl)try{a=jt,d=u.stateNode,a.nodeType===8?a.parentNode.removeChild(d):a.removeChild(d)}catch(S){dt(u,i,S)}else try{jt.removeChild(u.stateNode)}catch(S){dt(u,i,S)}break;case 18:jt!==null&&(hl?(i=jt,u=u.stateNode,i.nodeType===8?Ar(i.parentNode,u):i.nodeType===1&&Ar(i,u),tc(i)):Ar(jt,u.stateNode));break;case 4:d=jt,p=hl,jt=u.stateNode.containerInfo,hl=!0,ks(a,i,u),jt=d,hl=p;break;case 0:case 11:case 14:case 15:zt||mo(2,u,i),zt||mo(4,u,i),ks(a,i,u);break;case 1:zt||(Vn(u,i),d=u.stateNode,typeof d.componentWillUnmount=="function"&&dr(u,i,d)),ks(a,i,u);break;case 21:ks(a,i,u);break;case 22:zt||Vn(u,i),zt=(d=zt)||u.memoizedState!==null,ks(a,i,u),zt=d;break;default:ks(a,i,u)}}function Lu(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{tc(a)}catch(u){dt(i,i.return,u)}}function Ox(a){switch(a.tag){case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new _x),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new _x),i;default:throw Error(g(435,a.tag))}}function cf(a,i){var u=Ox(a);i.forEach(function(d){var p=Qp.bind(null,a,d);u.has(d)||(u.add(d),d.then(p,p))})}function xl(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:jt=B.stateNode,hl=!1;break e;case 3:jt=B.stateNode.containerInfo,hl=!0;break e;case 4:jt=B.stateNode.containerInfo,hl=!0;break e}B=B.return}if(jt===null)throw Error(g(160));ta(y,S,p),jt=null,hl=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13878)for(i=i.child;i!==null;)rf(i,a),i=i.sibling}var zl=null;function rf(a,i){var u=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:xl(i,a),gl(a),d&4&&(mo(3,a,a.return),zu(3,a),mo(5,a,a.return));break;case 1:xl(i,a),gl(a),d&512&&(zt||u===null||Vn(u,u.return)),d&64&&ea&&(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=zl;if(xl(i,a),gl(a),d&512&&(zt||u===null||Vn(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[Yo]||y[hn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(d),p.head.insertBefore(y,p.querySelector("head > title"))),rn(y,d,u),y[hn]=a,$t(y),d=y;break e;case"link":var S=Ns("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),rn(y,d,u),p.head.appendChild(y);break;case"meta":if(S=Ns("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),rn(y,d,u),p.head.appendChild(y);break;default:throw Error(g(468,d))}y[hn]=a,$t(y),d=y}a.stateNode=d}else En(p,a.type,a.stateNode);else a.stateNode=kr(p,d,a.memoizedProps);else y!==d?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,d===null?En(p,a.type,a.stateNode):kr(p,d,a.memoizedProps)):d===null&&a.stateNode!==null&&Mx(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[Yo]||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]);rn(p,fe,y),p[hn]=a,p[Kn]=y}catch(Ce){dt(a,a.return,Ce)}}case 5:if(xl(i,a),gl(a),d&512&&(zt||u===null||Vn(u,u.return)),a.flags&32){p=a.stateNode;try{ma(p,"")}catch(Ce){dt(a,a.return,Ce)}}d&4&&a.stateNode!=null&&(p=a.memoizedProps,Mx(a,p,u!==null?u.memoizedProps:p)),d&1024&&(of=!0);break;case 6:if(xl(i,a),gl(a),d&4){if(a.stateNode===null)throw Error(g(162));d=a.memoizedProps,u=a.stateNode;try{u.nodeValue=d}catch(Ce){dt(a,a.return,Ce)}}break;case 3:if(Oi=null,p=zl,zl=Of(i.containerInfo),xl(i,a),zl=p,gl(a),d&4&&u!==null&&u.memoizedState.isDehydrated)try{tc(i.containerInfo)}catch(Ce){dt(a,a.return,Ce)}of&&(of=!1,df(a));break;case 4:d=zl,zl=Of(a.stateNode.containerInfo),xl(i,a),gl(a),zl=d;break;case 12:xl(i,a),gl(a);break;case 13:xl(i,a),gl(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(bf=In()),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,cf(a,d)));break;case 22:if(d&512&&(zt||u===null||Vn(u,u.return)),D=a.memoizedState!==null,U=u!==null&&u.memoizedState!==null,le=ea,fe=zt,ea=le||D,zt=fe||U,xl(i,a),zt=fe,ea=le,gl(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=ea||zt,u===null||U||i||vi(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){dt(U,U.return,Ce)}}}else if(i.tag===6){if(u===null){U=i;try{U.stateNode.nodeValue=D?"":U.memoizedProps}catch(Ce){dt(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,cf(a,u))));break;case 19:xl(i,a),gl(a),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,cf(a,d)));break;case 21:break;default:xl(i,a),gl(a)}}function gl(a){var i=a.flags;if(i&2){try{if(a.tag!==27){e:{for(var u=a.return;u!==null;){if(Bp(u)){var d=u;break e}u=u.return}throw Error(g(160))}switch(d.tag){case 27:var p=d.stateNode,y=Ts(a);lt(a,y,p);break;case 5:var S=d.stateNode;d.flags&32&&(ma(S,""),d.flags&=-33);var B=Ts(a);lt(a,B,S);break;case 3:case 4:var D=d.stateNode.containerInfo,U=Ts(a);sf(a,U,D);break;default:throw Error(g(161))}}}catch(le){dt(a,a.return,le)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function df(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;df(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function Ma(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)wp(a,i.alternate,i),i=i.sibling}function vi(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:mo(4,i,i.return),vi(i);break;case 1:Vn(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&dr(i,i.return,u),vi(i);break;case 26:case 27:case 5:Vn(i,i.return),vi(i);break;case 22:Vn(i,i.return),i.memoizedState===null&&vi(i);break;default:vi(i)}a=a.sibling}}function ho(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:ho(p,y,u),zu(4,y);break;case 1:if(ho(p,y,u),d=y,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(U){dt(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++)wx(D[p],B)}catch(U){dt(d,d.return,U)}}u&&S&64&&bi(y),po(y,y.return);break;case 26:case 27:case 5:ho(p,y,u),u&&d===null&&S&4&&Dx(y),po(y,y.return);break;case 12:ho(p,y,u);break;case 13:ho(p,y,u),u&&S&4&&Lu(p,y);break;case 22:y.memoizedState===null&&ho(p,y,u),po(y,y.return);break;default:ho(p,y,u)}i=i.sibling}}function ff(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&&bu(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&&bu(a))}function _a(a,i,u,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)mf(a,i,u,d),i=i.sibling}function mf(a,i,u,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:_a(a,i,u,d),p&2048&&zu(9,i);break;case 3:_a(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&&bu(a)));break;case 12:if(p&2048){_a(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){dt(i,i.return,D)}}else _a(a,i,u,d);break;case 23:break;case 22:y=i.stateNode,i.memoizedState!==null?y._visibility&4?_a(a,i,u,d):Ei(a,i):y._visibility&4?_a(a,i,u,d):(y._visibility|=4,Ri(a,i,u,d,(i.subtreeFlags&10256)!==0)),p&2048&&ff(i.alternate,i);break;case 24:_a(a,i,u,d),p&2048&&Ie(i.alternate,i);break;default:_a(a,i,u,d)}}function Ri(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:Ri(y,S,B,D,p),zu(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&4?Ri(y,S,B,D,p):Ei(y,S):(le._visibility|=4,Ri(y,S,B,D,p)),p&&U&2048&&ff(S.alternate,S);break;case 24:Ri(y,S,B,D,p),p&&U&2048&&Ie(S.alternate,S);break;default:Ri(y,S,B,D,p)}i=i.sibling}}function Ei(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:Ei(u,d),p&2048&&ff(d.alternate,d);break;case 24:Ei(u,d),p&2048&&Ie(d.alternate,d);break;default:Ei(u,d)}i=i.sibling}}var Bs=8192;function ws(a){if(a.subtreeFlags&Bs)for(a=a.child;a!==null;)ji(a),a=a.sibling}function ji(a){switch(a.tag){case 26:ws(a),a.flags&Bs&&a.memoizedState!==null&&iy(zl,a.memoizedState,a.memoizedProps);break;case 5:ws(a);break;case 3:case 4:var i=zl;zl=Of(a.stateNode.containerInfo),ws(a),zl=i;break;case 22:a.memoizedState===null&&(i=a.alternate,i!==null&&i.memoizedState!==null?(i=Bs,Bs=16777216,ws(a),Bs=i):ws(a));break;default:ws(a)}}function Mp(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 Si(a){var i=a.deletions;if(a.flags&16){if(i!==null)for(var u=0;u<i.length;u++){var d=i[u];cn=d,na(d,a)}Mp(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Ft(a),a=a.sibling}function Ft(a){switch(a.tag){case 0:case 11:case 15:Si(a),a.flags&2048&&mo(9,a,a.return);break;case 3:Si(a);break;case 12:Si(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&4&&(a.return===null||a.return.tag!==13)?(i._visibility&=-5,pf(a)):Si(a);break;default:Si(a)}}function pf(a){var i=a.deletions;if(a.flags&16){if(i!==null)for(var u=0;u<i.length;u++){var d=i[u];cn=d,na(d,a)}Mp(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:mo(8,i,i.return),pf(i);break;case 22:u=i.stateNode,u._visibility&4&&(u._visibility&=-5,pf(i));break;default:pf(i)}a=a.sibling}}function na(a,i){for(;cn!==null;){var u=cn;switch(u.tag){case 0:case 11:case 15:mo(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:bu(u.memoizedState.cache)}if(d=u.child,d!==null)d.return=u,cn=d;else e:for(u=a;cn!==null;){d=cn;var p=d.sibling,y=d.return;if(Dp(d),d===u){cn=null;break e}if(p!==null){p.return=y,cn=p;break e}cn=y}}}function zx(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 Pt(a,i,u,d){return new zx(a,i,u,d)}function hf(a){return a=a.prototype,!(!a||!a.isReactComponent)}function la(a,i){var u=a.alternate;return u===null?(u=Pt(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 Hu(a,i,u,d,p,y){var S=0;if(d=a,typeof a=="function")hf(a)&&(S=1);else if(typeof a=="string")S=ll(a,u,Zn.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case C:return Bt(u.children,p,y,i);case T:S=8,p|=24;break;case O:return a=Pt(12,u,i,p|2),a.elementType=O,a.lanes=y,a;case Y:return a=Pt(13,u,i,p),a.elementType=Y,a.lanes=y,a;case P:return a=Pt(19,u,i,p),a.elementType=P,a.lanes=y,a;case ue:return Lx(u,p,y,i);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N: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=Pt(S,u,i,p),i.elementType=a,i.type=d,i.lanes=y,i}function Bt(a,i,u,d){return a=Pt(7,a,d,i),a.lanes=u,a}function Lx(a,i,u,d){a=Pt(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=ha(y,2);S!==null&&(p._pendingVisibility|=2,en(S,y,2))}},attach:function(){var y=p._current;if(y===null)throw Error(g(456));if(p._pendingVisibility&2){var S=ha(y,2);S!==null&&(p._pendingVisibility&=-3,en(S,y,2))}}};return a.stateNode=p,a}function xf(a,i,u){return a=Pt(6,a,null,i),a.lanes=u,a}function fr(a,i,u){return i=Pt(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}function Na(a){a.flags|=4}function yl(a,i){if(i.type!=="stylesheet"||i.state.loading&4)a.flags&=-16777217;else if(a.flags|=16777216,!To(i)){if(i=fl.current,i!==null&&((Fe&4194176)===Fe?Kl!==null:(Fe&62914560)!==Fe&&!(Fe&536870912)||i!==Kl))throw ui=wd,Vc;a.flags|=8192}}function mr(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?Zt():536870912,a.lanes|=i,go|=i)}function Ai(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 St(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 gf(a,i,u){var d=i.pendingProps;switch(Uc(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(i),null;case 1:return St(i),null;case 3:return u=i.stateNode,d=null,a!==null&&(d=a.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),wa(Wt),Wi(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(si(i)?Na(i):a===null||a.memoizedState.isDehydrated&&!(i.flags&256)||(i.flags|=1024,Nl!==null&&(Lp(Nl),Nl=null))),St(i),null;case 26:return u=i.memoizedState,a===null?(Na(i),u!==null?(St(i),yl(i,u)):(St(i),i.flags&=-16777217)):u?u!==a.memoizedState?(Na(i),St(i),yl(i,u)):(St(i),i.flags&=-16777217):(a.memoizedProps!==d&&Na(i),St(i),i.flags&=-16777217),null;case 27:td(i),u=ra.current;var p=i.type;if(a!==null&&i.stateNode!=null)a.memoizedProps!==d&&Na(i);else{if(!d){if(i.stateNode===null)throw Error(g(166));return St(i),null}a=Zn.current,si(i)?Im(i):(a=Ua(p,d,u),i.stateNode=a,Na(i))}return St(i),null;case 5:if(td(i),u=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==d&&Na(i);else{if(!d){if(i.stateNode===null)throw Error(g(166));return St(i),null}if(a=Zn.current,si(i))Im(i);else{switch(p=Er(ra.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[hn]=i,a[Kn]=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(rn(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&&Na(i)}}return St(i),i.flags&=-16777217,null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==d&&Na(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(g(166));if(a=ra.current,si(i)){if(a=i.stateNode,u=i.memoizedProps,d=null,p=bn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}a[hn]=i,a=!!(a.nodeValue===u||d!==null&&d.suppressHydrationWarning===!0||He(a.nodeValue,u)),a||to(i)}else a=Er(a).createTextNode(d),a[hn]=i,i.stateNode=a}return St(i),null;case 13:if(d=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(p=si(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[hn]=i}else mu(),!(i.flags&128)&&(i.memoizedState=null),i.flags|=4;St(i),p=!1}else Nl!==null&&(Lp(Nl),Nl=null),p=!0;if(!p)return i.flags&256?(Jl(i),i):(Jl(i),null)}if(Jl(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),mr(i,i.updateQueue),St(i),null;case 4:return Wi(),a===null&&_i(i.stateNode.containerInfo),St(i),null;case 10:return wa(i.type),St(i),null;case 19:if(Lt(qt),p=i.memoizedState,p===null)return St(i),null;if(d=(i.flags&128)!==0,y=p.rendering,y===null)if(d)Ai(p,!1);else{if(Ct!==0||a!==null&&a.flags&128)for(a=i.child;a!==null;){if(y=Yc(a),y!==null){for(i.flags|=128,Ai(p,!1),a=y.updateQueue,i.updateQueue=a,mr(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)ot(u,a),u=u.sibling;return ft(qt,qt.current&1|2),i.child}a=a.sibling}p.tail!==null&&In()>hr&&(i.flags|=128,d=!0,Ai(p,!1),i.lanes=4194304)}else{if(!d)if(a=Yc(y),a!==null){if(i.flags|=128,d=!0,a=a.updateQueue,i.updateQueue=a,mr(i,a),Ai(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!Pe)return St(i),null}else 2*In()-p.renderingStartTime>hr&&u!==536870912&&(i.flags|=128,d=!0,Ai(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=In(),i.sibling=null,a=qt.current,ft(qt,d?a&1|2:a&1),i):(St(i),null);case 22:case 23:return Jl(i),Gc(),d=i.memoizedState!==null,a!==null?a.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?u&536870912&&!(i.flags&128)&&(St(i),i.subtreeFlags&6&&(i.flags|=8192)):St(i),u=i.updateQueue,u!==null&&mr(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&&Lt(ao),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),wa(Wt),St(i),null;case 25:return null}throw Error(g(156,i.tag))}function Hx(a,i){switch(Uc(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return wa(Wt),Wi(),a=i.flags,a&65536&&!(a&128)?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return td(i),null;case 13:if(Jl(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(g(340));mu()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return Lt(qt),null;case 4:return Wi(),null;case 10:return wa(i.type),null;case 22:case 23:return Jl(i),Gc(),a!==null&&Lt(ao),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return wa(Wt),null;case 25:return null;default:return null}}function Ux(a,i){switch(Uc(i),i.tag){case 3:wa(Wt),Wi();break;case 26:case 27:case 5:td(i);break;case 4:Wi();break;case 13:Jl(i);break;case 19:Lt(qt);break;case 10:wa(i.type);break;case 22:case 23:Jl(i),Gc(),a!==null&&Lt(ao);break;case 24:wa(Wt)}}var yf={getCacheForType:function(a){var i=vn(Wt),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u}},Vx=typeof WeakMap=="function"?WeakMap:Map,At=0,rt=null,$e=null,Fe=0,ht=0,bl=null,Oa=!1,Uu=!1,_p=!1,Ds=0,Ct=0,xo=0,Ci=0,Np=0,Ll=0,go=0,pr=null,za=null,tl=!1,bf=0,hr=1/0,xr=null,Ms=null,vf=!1,Ti=null,Vu=0,Op=0,qu=null,Gu=0,Rf=null;function Dn(){if(At&2&&Fe!==0)return Fe&-Fe;if(J.T!==null){var a=ps;return a!==0?a:Iu()}return Rc()}function ki(){Ll===0&&(Ll=!(Fe&536870912)||Pe?Go():536870912);var a=fl.current;return a!==null&&(a.flags|=32),Ll}function en(a,i,u){(a===rt&&ht===2||a.cancelPendingCommit!==null)&&(yo(a,0),La(a,Fe,Ll,!1)),fa(a,u),(!(At&2)||a!==rt)&&(a===rt&&(!(At&2)&&(Ci|=u),Ct===4&&La(a,Fe,Ll,!1)),vl(a))}function zp(a,i,u){if(At&6)throw Error(g(327));var d=!u&&(i&60)===0&&(i&a.expiredLanes)===0||Gl(a,i),p=d?Kg(a,i):Vp(a,i,!0),y=d;do{if(p===0){Uu&&!d&&La(a,i,0,!1);break}else if(p===6)La(a,i,0,!Oa);else{if(u=a.current.alternate,y&&!gr(u)){p=Vp(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=pr;var D=B.current.memoizedState.isDehydrated;if(D&&(yo(B,S).flags|=256),S=Vp(B,S,!1),S!==2){if(_p&&!D){B.errorRecoveryDisabledLanes|=y,Ci|=y,p=4;break e}y=za,za=p,y!==null&&Lp(y)}p=S}if(y=!1,p!==2)continue}}if(p===1){yo(a,0),La(a,i,0,!0);break}e:{switch(d=a,p){case 0:case 1:throw Error(g(345));case 4:if((i&4194176)===i){La(d,i,Ll,!Oa);break e}break;case 2:za=null;break;case 3:case 5:break;default:throw Error(g(329))}if(d.finishedWork=u,d.finishedLanes=i,(i&62914560)===i&&(y=bf+300-In(),10<y)){if(La(d,i,Ll,!Oa),da(d,0)!==0)break e;d.timeoutHandle=El(Bi.bind(null,d,u,za,xr,tl,i,Ll,Ci,go,Oa,2,-0,0),y);break e}Bi(d,u,za,xr,tl,i,Ll,Ci,go,Oa,0,-0,0)}}break}while(!0);vl(a)}function Lp(a){za===null?za=a:za.push.apply(za,a)}function Bi(a,i,u,d,p,y,S,B,D,U,le,fe,K){var ee=i.subtreeFlags;if((ee&8192||(ee&16785408)===16785408)&&(zi={stylesheets:null,count:0,unsuspend:oy},ji(i),i=Kx(),i!==null)){a.cancelPendingCommit=i(Gp.bind(null,a,u,d,p,S,B,D,1,fe,K)),La(a,y,S,!U);return}Gp(a,u,d,p,S,B,D,le,fe,K)}function gr(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(!Tn(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 La(a,i,u,d){i&=~Np,i&=~Ci,a.suspendedLanes|=i,a.pingedLanes&=~i,d&&(a.warmLanes|=i),d=a.expirationTimes;for(var p=i;0<p;){var y=31-$n(p),S=1<<y;d[y]=-1,p&=~S}u!==0&&ad(a,u,i)}function wi(){return At&6?!0:(Qu(0),!1)}function yr(){if($e!==null){if(ht===0)var a=$e.return;else a=$e,Ba=yi=null,Ic(a),Jt=null,lo=0,a=$e;for(;a!==null;)Ux(a.alternate,a),a=a.return;$e=null}}function yo(a,i){a.finishedWork=null,a.finishedLanes=0;var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,Rn(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),yr(),rt=a,$e=u=la(a.current,null),Fe=i,ht=0,bl=null,Oa=!1,Uu=Gl(a,i),_p=!1,go=Ll=Np=Ci=xo=Ct=0,za=pr=null,tl=!1,i&8&&(i|=i&32);var d=a.entangledLanes;if(d!==0)for(a=a.entanglements,d&=i;0<d;){var p=31-$n(d),y=1<<p;i|=a[p],d&=~y}return Ds=i,kd(),u}function Hp(a,i){ze=null,J.H=sn,i===va?(i=no(),ht=3):i===Vc?(i=no(),ht=4):ht=i===Ep?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,bl=i,$e===null&&(Ct=1,Es(a,an(i,a.current)))}function Up(){var a=J.H;return J.H=sn,a===null?sn:a}function qx(){var a=J.A;return J.A=yf,a}function Ef(){Ct=4,Oa||(Fe&4194176)!==Fe&&fl.current!==null||(Uu=!0),!(xo&134217727)&&!(Ci&134217727)||rt===null||La(rt,Fe,Ll,!1)}function Vp(a,i,u){var d=At;At|=2;var p=Up(),y=qx();(rt!==a||Fe!==i)&&(xr=null,yo(a,i)),i=!1;var S=Ct;e:do try{if(ht!==0&&$e!==null){var B=$e,D=bl;switch(ht){case 8:yr(),S=6;break e;case 3:case 2:case 6:fl.current===null&&(i=!0);var U=ht;if(ht=0,bl=null,Yu(a,B,D,U),u&&Uu){S=0;break e}break;default:U=ht,ht=0,bl=null,Yu(a,B,D,U)}}$g(),S=Ct;break}catch(le){Hp(a,le)}while(!0);return i&&a.shellSuspendCounter++,Ba=yi=null,At=d,J.H=p,J.A=y,$e===null&&(rt=null,Fe=0,kd()),S}function $g(){for(;$e!==null;)Sf($e)}function Kg(a,i){var u=At;At|=2;var d=Up(),p=qx();rt!==a||Fe!==i?(xr=null,hr=In()+500,yo(a,i)):Uu=Gl(a,i);e:do try{if(ht!==0&&$e!==null){i=$e;var y=bl;t:switch(ht){case 1:ht=0,bl=null,Yu(a,i,y,1);break;case 2:if(Rx(y)){ht=0,bl=null,Gx(i);break}i=function(){ht===2&&rt===a&&(ht=7),vl(a)},y.then(i,i);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:Rx(y)?(ht=0,bl=null,Gx(i)):(ht=0,bl=null,Yu(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||To(S)){ht=0,bl=null;var D=B.sibling;if(D!==null)$e=D;else{var U=B.return;U!==null?($e=U,Af(U)):$e=null}break t}}ht=0,bl=null,Yu(a,i,y,5);break;case 6:ht=0,bl=null,Yu(a,i,y,6);break;case 8:yr(),Ct=6;break e;default:throw Error(g(462))}}jf();break}catch(le){Hp(a,le)}while(!0);return Ba=yi=null,J.H=d,J.A=p,At=u,$e!==null?0:(rt=null,Fe=0,kd(),Ct)}function jf(){for(;$e!==null&&!Ih();)Sf($e)}function Sf(a){var i=bt(a.alternate,a,Ds);a.memoizedProps=a.pendingProps,i===null?Af(a):$e=i}function Gx(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=Ap(u,i,i.pendingProps,i.type,void 0,Fe);break;case 11:i=Ap(u,i,i.pendingProps,i.type.render,i.ref,Fe);break;case 5:Ic(i);default:Ux(u,i),i=$e=ot(i,Ds),i=bt(u,i,Ds)}a.memoizedProps=a.pendingProps,i===null?Af(a):$e=i}function Yu(a,i,u,d){Ba=yi=null,Ic(i),Jt=null,lo=0;var p=i.return;try{if(co(a,p,i,u,Fe)){Ct=1,Es(a,an(u,a.current)),$e=null;return}}catch(y){if(p!==null)throw $e=p,y;Ct=1,Es(a,an(u,a.current)),$e=null;return}i.flags&32768?(Pe||d===1?a=!0:Uu||Fe&536870912?a=!1:(Oa=a=!0,(d===2||d===3||d===6)&&(d=fl.current,d!==null&&d.tag===13&&(d.flags|=16384))),qp(i,a)):Af(i)}function Af(a){var i=a;do{if(i.flags&32768){qp(i,Oa);return}a=i.return;var u=gf(i.alternate,i,Ds);if(u!==null){$e=u;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=a}while(i!==null);Ct===0&&(Ct=5)}function qp(a,i){do{var u=Hx(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);Ct=6,$e=null}function Gp(a,i,u,d,p,y,S,B,D,U){var le=J.T,fe=Ne.p;try{Ne.p=2,J.T=null,Yx(a,i,u,d,fe,p,y,S,B,D,U)}finally{J.T=le,Ne.p=fe}}function Yx(a,i,u,d,p,y,S,B){do Di();while(Ti!==null);if(At&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|=Lc,Fi(a,d,U,y,S,B),a===rt&&($e=rt=null,Fe=0),!(D.subtreeFlags&10256)&&!(D.flags&10256)||vf||(vf=!0,Op=U,qu=u,Zp(Vo,function(){return Di(),null})),u=(D.flags&15990)!==0,D.subtreeFlags&15990||u?(u=J.T,J.T=null,y=Ne.p,Ne.p=2,S=At,At|=4,Nx(a,D),rf(D,a),Ym(_f,a.containerInfo),wr=!!Mf,_f=Mf=null,a.current=D,wp(a,D.alternate,D),$h(),At=S,Ne.p=y,J.T=u):a.current=D,vf?(vf=!1,Ti=a,Vu=d):Yp(a,U),U=a.pendingLanes,U===0&&(Ms=null),Hg(D.stateNode),vl(a),i!==null)for(p=a.onRecoverableError,D=0;D<i.length;D++)U=i[D],p(U.value,{componentStack:U.stack});return Vu&3&&Di(),U=a.pendingLanes,d&4194218&&U&42?a===Rf?Gu++:(Gu=0,Rf=a):Gu=0,Qu(0),null}function Yp(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,bu(i)))}function Di(){if(Ti!==null){var a=Ti,i=Op;Op=0;var u=vc(Vu),d=J.T,p=Ne.p;try{if(Ne.p=32>u?32:u,J.T=null,Ti===null)var y=!1;else{u=qu,qu=null;var S=Ti,B=Vu;if(Ti=null,Vu=0,At&6)throw Error(g(331));var D=At;if(At|=4,Ft(S.current),mf(S,S.current,B,u),At=D,Qu(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(qo,S)}catch{}y=!0}return y}finally{Ne.p=p,J.T=d,Yp(a,i)}}return!1}function Cf(a,i,u){i=an(u,i),i=Pl(a.stateNode,i,2),a=Cs(a,i,2),a!==null&&(fa(a,2),vl(a))}function dt(a,i,u){if(a.tag===3)Cf(a,a,u);else for(;i!==null;){if(i.tag===3){Cf(i,a,u);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ms===null||!Ms.has(d))){a=an(u,a),u=Wd(2),d=Cs(i,u,2),d!==null&&(Fd(u,d,i,a),fa(d,2),vl(d));break}}i=i.return}}function Xp(a,i,u){var d=a.pingCache;if(d===null){d=a.pingCache=new Vx;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)||(_p=!0,p.add(u),a=Jg.bind(null,a,i,u),i.then(a,a))}function Jg(a,i,u){var d=a.pingCache;d!==null&&d.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,rt===a&&(Fe&u)===u&&(Ct===4||Ct===3&&(Fe&62914560)===Fe&&300>In()-bf?!(At&2)&&yo(a,0):Np|=u,go===Fe&&(go=0)),vl(a)}function Xx(a,i){i===0&&(i=Zt()),a=ha(a,i),a!==null&&(fa(a,i),vl(a))}function Wg(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),Xx(a,u)}function Qp(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),Xx(a,u)}function Zp(a,i){return Uo(a,i)}var Xu=null,Mi=null,Tf=!1,bo=!1,Ip=!1,vo=0;function vl(a){a!==Mi&&a.next===null&&(Mi===null?Xu=Mi=a:Mi=Mi.next=a),bo=!0,Tf||(Tf=!0,Kp(Fg))}function Qu(a,i){if(!Ip&&bo){Ip=!0;do for(var u=!1,d=Xu;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-$n(42|a)+1)-1,y&=p&~(S&~B),y=y&201326677?y&201326677|1:y?y|2:0}y!==0&&(u=!0,Zu(d,y))}else y=Fe,y=da(d,d===rt?y:0),!(y&3)||Gl(d,y)||(u=!0,Zu(d,y));d=d.next}while(u);Ip=!1}}function Fg(){bo=Tf=!1;var a=0;vo!==0&&(_n()&&(a=vo),vo=0);for(var i=In(),u=null,d=Xu;d!==null;){var p=d.next,y=br(d,i);y===0?(d.next=null,u===null?Xu=p:u.next=p,p===null&&(Mi=u)):(u=d,(a!==0||y&3)&&(bo=!0)),d=p}Qu(a)}function br(a,i){for(var u=a.suspendedLanes,d=a.pingedLanes,p=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var S=31-$n(y),B=1<<S,D=p[S];D===-1?(!(B&u)||B&d)&&(p[S]=bc(B,i)):D<=i&&(a.expiredLanes|=B),y&=~B}if(i=rt,u=Fe,u=da(a,a===i?u:0),d=a.callbackNode,u===0||a===i&&ht===2||a.cancelPendingCommit!==null)return d!==null&&d!==null&&Ys(d),a.callbackNode=null,a.callbackPriority=0;if(!(u&3)||Gl(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(d!==null&&Ys(d),vc(u)){case 2:case 8:u=Xs;break;case 32:u=Vo;break;case 268435456:u=Jh;break;default:u=Vo}return d=$p.bind(null,a),u=Uo(u,d),a.callbackPriority=i,a.callbackNode=u,i}return d!==null&&d!==null&&Ys(d),a.callbackPriority=2,a.callbackNode=null,2}function $p(a,i){var u=a.callbackNode;if(Di()&&a.callbackNode!==u)return null;var d=Fe;return d=da(a,a===rt?d:0),d===0?null:(zp(a,d,i),br(a,In()),a.callbackNode!=null&&a.callbackNode===u?$p.bind(null,a):null)}function Zu(a,i){if(Di())return null;zp(a,i,!0)}function Kp(a){ey(function(){At&6?Uo(Kh,a):a()})}function Iu(){return vo===0&&(vo=Go()),vo}function Jp(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:fd(""+a)}function Vt(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 Wp(a,i,u,d,p){if(i==="submit"&&u&&u.stateNode===p){var y=Jp((p[Kn]||null).action),S=d.submitter;S&&(i=(i=S[Kn]||null)?Jp(i.formAction):S.getAttribute("formAction"),i!==null&&(y=i,S=null));var B=new xd("action","action",null,d,p);a.push({event:B,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(vo!==0){var D=S?Vt(p,S):new FormData(p);vs(u,{pending:!0,data:D,method:p.method,action:y},null,D)}}else typeof y=="function"&&(B.preventDefault(),D=S?Vt(p,S):new FormData(p),vs(u,{pending:!0,data:D,method:p.method,action:y},y,D))},currentTarget:p}]})}}for(var Fp=0;Fp<_t.length;Fp++){var Pp=_t[Fp],Ro=Pp.toLowerCase(),$u=Pp[0].toUpperCase()+Pp.slice(1);dl(Ro,"on"+$u)}dl(bx,"onAnimationEnd"),dl(Td,"onAnimationIteration"),dl(Oc,"onAnimationStart"),dl("dblclick","onDoubleClick"),dl("focusin","onFocus"),dl("focusout","onBlur"),dl(vx,"onTransitionRun"),dl(Ze,"onTransitionStart"),dl(ye,"onTransitionCancel"),dl(li,"onTransitionEnd"),Qo("onMouseEnter",["mouseout","mouseover"]),Qo("onMouseLeave",["mouseout","mouseover"]),Qo("onPointerEnter",["pointerout","pointerover"]),Qo("onPointerLeave",["pointerout","pointerover"]),Qs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ha="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(" "),kf=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ha));function Bf(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){nr(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){nr(le)}p.currentTarget=null,y=D}}}}function We(a,i){var u=i[sd];u===void 0&&(u=i[sd]=new Set);var d=a+"__bubble";u.has(d)||(wf(i,a,2,!1),u.add(d))}function vr(a,i,u){var d=0;i&&(d|=4),wf(u,a,d,i)}var Rl="_reactListening"+Math.random().toString(36).slice(2);function _i(a){if(!a[Rl]){a[Rl]=!0,vm.forEach(function(u){u!=="selectionchange"&&(kf.has(u)||vr(u,!1,a),vr(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[Rl]||(i[Rl]=!0,vr("selectionchange",!1,i))}}function wf(a,i,u,d){switch(eg(i)){case 2:var p=Fx;break;case 8:p=Px;break;default:p=Hf}u=p.bind(null,i,u,a),p=void 0,!su||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 Rr(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=as(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}lu(function(){var U=y,le=wm(u),fe=[];e:{var K=zc.get(a);if(K!==void 0){var ee=xd,Ce=a;switch(a){case"keypress":if(Sc(u)===0)break e;case"keydown":case"keyup":ee=vd;break;case"focusin":Ce="focus",ee=Mm;break;case"focusout":Ce="blur",ee=Mm;break;case"beforeblur":case"afterblur":ee=Mm;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=ax;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Xg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Rd;break;case bx:case Td:case Oc:ee=sx;break;case li:ee=Nm;break;case"scroll":case"scrollend":ee=Gg;break;case"wheel":ee=fx;break;case"copy":case"cut":case"paste":ee=ix;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=gn;break;case"toggle":case"beforetoggle":ee=os}var _e=(i&4)!==0,vt=!_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=au(H,G),de!=null&&_e.push(Eo(H,de,Q))),vt)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!==Bm&&(Ce=u.relatedTarget||u.fromElement)&&(as(Ce)||Ce[ls]))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?as(Ce):null,Ce!==null&&(vt=re(Ce),_e=Ce.tag,Ce!==vt||_e!==5&&_e!==27&&_e!==6)&&(Ce=null)):(ee=null,Ce=U),ee!==Ce)){if(_e=ax,de="onMouseLeave",G="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(_e=gn,de="onPointerLeave",G="onPointerEnter",H="pointer"),vt=ee==null?K:Pi(ee),Q=Ce==null?K:Pi(Ce),K=new _e(de,H+"leave",ee,u,le),K.target=vt,K.relatedTarget=Q,de=null,as(le)===U&&(_e=new _e(G,H+"enter",Ce,u,le),_e.target=Q,_e.relatedTarget=vt,de=_e),vt=de,ee&&Ce)t:{for(_e=ee,G=Ce,H=0,Q=_e;Q;Q=Ni(Q))H++;for(Q=0,de=G;de;de=Ni(de))Q++;for(;0<H-Q;)_e=Ni(_e),H--;for(;0<Q-H;)G=Ni(G),Q--;for(;H--;){if(_e===G||G!==null&&_e===G.alternate)break t;_e=Ni(_e),G=Ni(G)}_e=null}else _e=null;ee!==null&&Qx(fe,K,ee,_e,!1),Ce!==null&&vt!==null&&Qx(fe,vt,Ce,_e,!0)}}e:{if(K=U?Pi(U):window,ee=K.nodeName&&K.nodeName.toLowerCase(),ee==="select"||ee==="input"&&K.type==="file")var Te=cu;else if(Js(K))if(ru)Te=yn;else{Te=xx;var Ge=hx}else ee=K.nodeName,!ee||ee.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?U&&$o(U.elementType)&&(Te=cu):Te=gx;if(Te&&(Te=Te(a,U))){Ws(fe,Te,u,le);break e}Ge&&Ge(a,K,U),a==="focusout"&&U&&K.type==="number"&&U.memoizedProps.value!=null&&Cm(K,"number",K.value)}switch(Ge=U?Pi(U):window,a){case"focusin":(Js(Ge)||Ge.contentEditable==="true")&&(rl=Ge,Cd=U,Ml=null);break;case"focusout":Ml=Cd=rl=null;break;case"mousedown":Il=!0;break;case"contextmenu":case"mouseup":case"dragend":Il=!1,Nc(fe,u,le);break;case"selectionchange":if(Xm)break;case"keydown":case"keyup":Nc(fe,u,le)}var we;if(Fo)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 Dl?kc(a,u)&&(De="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(De="onCompositionStart");De&&(Lm&&u.locale!=="ko"&&(Dl||De!=="onCompositionStart"?De==="onCompositionEnd"&&Dl&&(we=hd()):(ss=le,Cn="value"in ss?ss.value:ss.textContent,Dl=!0)),Ge=Mn(U,De),0<Ge.length&&(De=new yd(De,a,null,u,le),fe.push({event:De,listeners:Ge}),we?De.data=we:(we=Wn(u),we!==null&&(De.data=we)))),(we=zm?mx(a,u):Hm(a,u))&&(De=Mn(U,"onBeforeInput"),0<De.length&&(Ge=new yd("onBeforeInput","beforeinput",null,u,le),fe.push({event:Ge,listeners:De}),Ge.data=we)),Wp(fe,a,U,u,le)}Bf(fe,i)})}function Eo(a,i,u){return{instance:a,listener:i,currentTarget:u}}function Mn(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=au(a,u),p!=null&&d.unshift(Eo(a,p,y)),p=au(a,i),p!=null&&d.push(Eo(a,p,y))),a=a.return}return d}function Ni(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Qx(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=au(u,y),U!=null&&S.unshift(Eo(u,U,D))):p||(U=au(u,y),U!=null&&S.push(Eo(u,U,D)))),u=u.return}S.length!==0&&a.push({event:i,listeners:S})}var Zx=/\r\n?/g,Pg=/\u0000|\uFFFD/g;function W(a){return(typeof a=="string"?a:""+a).replace(Zx,`
|
|
93
|
-
`).replace(Pg,"")}function He(a,i){return i=W(i),W(a)===i}function jo(){}function ut(a,i,u,d,p,y){switch(u){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||ma(a,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&ma(a,""+d);break;case"className":tu(a,"class",d);break;case"tabIndex":tu(a,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":tu(a,u,d);break;case"style":km(a,d,y);break;case"data":if(i!=="object"){tu(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=fd(""+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"&&ut(a,i,"name",p.name,p,null),ut(a,i,"formEncType",p.formEncType,p,null),ut(a,i,"formMethod",p.formMethod,p,null),ut(a,i,"formTarget",p.formTarget,p,null)):(ut(a,i,"encType",p.encType,p,null),ut(a,i,"method",p.method,p,null),ut(a,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){a.removeAttribute(u);break}d=fd(""+d),a.setAttribute(u,d);break;case"onClick":d!=null&&(a.onclick=jo);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=fd(""+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),Zo(a,"popover",d);break;case"xlinkActuate":il(a,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":il(a,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":il(a,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":il(a,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":il(a,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":il(a,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":il(a,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":il(a,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":il(a,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Zo(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=nx.get(u)||u,Zo(a,u,d))}}function Df(a,i,u,d,p,y){switch(u){case"style":km(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"?ma(a,d):(typeof d=="number"||typeof d=="bigint")&&ma(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=jo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rm.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[Kn]||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,""):Zo(a,u,d)}}}function rn(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:ut(a,i,y,S,u,null)}}p&&ut(a,i,"srcSet",u.srcSet,u,null),d&&ut(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:ut(a,i,d,le,u,null)}}Am(a,y,B,D,U,S,p,!1),cd(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:ut(a,i,p,B,u,null)}i=y,u=S,a.multiple=!!d,i!=null?Io(a,!!d,i,!1):u!=null&&Io(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:ut(a,i,S,B,u,null)}jc(a,d,p,y),cd(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:ut(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<Ha.length;d++)We(Ha[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:ut(a,i,U,d,u,null)}return;default:if($o(i)){for(le in u)u.hasOwnProperty(le)&&(d=u[le],d!==void 0&&Df(a,i,le,d,u,void 0));return}}for(B in u)u.hasOwnProperty(B)&&(d=u[B],d!=null&&ut(a,i,B,d,u,null))}function Ix(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)||ut(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&&ut(a,i,K,ee,d,fe)}}rd(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)||ut(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&&ut(a,i,p,y,d,D)}i=B,u=S,d=ee,K!=null?Io(a,!!u,K,!1):!!d!=!!u&&(i!=null?Io(a,!!u,i,!0):Io(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:ut(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&&ut(a,i,S,p,d,y)}dd(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:ut(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:ut(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)&&ut(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:ut(a,i,U,K,d,ee)}return;default:if($o(i)){for(var vt in u)K=u[vt],u.hasOwnProperty(vt)&&K!==void 0&&!d.hasOwnProperty(vt)&&Df(a,i,vt,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||Df(a,i,le,K,d,ee);return}}for(var G in u)K=u[G],u.hasOwnProperty(G)&&K!=null&&!d.hasOwnProperty(G)&&ut(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||ut(a,i,fe,K,d,ee)}var Mf=null,_f=null;function Er(a){return a.nodeType===9?a:a.ownerDocument}function Nf(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 eh(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 jr(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 Sr=null;function _n(){var a=window.event;return a&&a.type==="popstate"?a===Sr?!1:(Sr=a,!0):(Sr=null,!1)}var El=typeof setTimeout=="function"?setTimeout:void 0,Rn=typeof clearTimeout=="function"?clearTimeout:void 0,xt=typeof Promise=="function"?Promise:void 0,ey=typeof queueMicrotask=="function"?queueMicrotask:typeof xt<"u"?function(a){return xt.resolve(null).then(a).catch(th)}:El;function th(a){setTimeout(function(){throw a})}function Ar(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),tc(i);return}d--}else u!=="$"&&u!=="$?"&&u!=="$!"||d++;u=p}while(u);tc(i)}function aa(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":aa(u),id(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function So(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[Yo])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=dn(a.nextSibling),a===null)break}return null}function Cr(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=dn(a.nextSibling),a===null))return null;return a}function dn(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 Tr(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 Ua(a,i,u){switch(i=Er(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 nl=new Map,$x=new Set;function Of(a){return typeof a.getRootNode=="function"?a.getRootNode():a.ownerDocument}var _s=Ne.d;Ne.d={f:Va,r:ty,D:Ku,C:ny,L:nh,m:ly,X:Ju,S:ay,M:Nn};function Va(){var a=_s.f(),i=wi();return a||i}function ty(a){var i=Xo(a);i!==null&&i.tag===5&&i.type==="form"?rp(i):_s.r(a)}var Ao=typeof document>"u"?null:document;function zf(a,i,u){var d=Ao;if(d&&typeof i=="string"&&i){var p=ul(i);p='link[rel="'+a+'"][href="'+p+'"]',typeof u=="string"&&(p+='[crossorigin="'+u+'"]'),$x.has(p)||($x.add(p),a={rel:a,crossOrigin:u,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),rn(i,"link",a),$t(i),d.head.appendChild(i)))}}function Ku(a){_s.D(a),zf("dns-prefetch",a,null)}function ny(a,i){_s.C(a,i),zf("preconnect",a,i)}function nh(a,i,u){_s.L(a,i,u);var d=Ao;if(d&&a&&i){var p='link[rel="preload"][as="'+ul(i)+'"]';i==="image"&&u&&u.imageSrcSet?(p+='[imagesrcset="'+ul(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(p+='[imagesizes="'+ul(u.imageSizes)+'"]')):p+='[href="'+ul(a)+'"]';var y=p;switch(i){case"style":y=qn(a);break;case"script":y=Wu(a)}nl.has(y)||(a=xe({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),nl.set(y,a),d.querySelector(p)!==null||i==="style"&&d.querySelector(Gn(y))||i==="script"&&d.querySelector(Co(y))||(i=d.createElement("link"),rn(i,"link",a),$t(i),d.head.appendChild(i)))}}function ly(a,i){_s.m(a,i);var u=Ao;if(u&&a){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+ul(d)+'"][href="'+ul(a)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Wu(a)}if(!nl.has(y)&&(a=xe({rel:"modulepreload",href:a},i),nl.set(y,a),u.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Co(y)))return}d=u.createElement("link"),rn(d,"link",a),$t(d),u.head.appendChild(d)}}}function ay(a,i,u){_s.S(a,i,u);var d=Ao;if(d&&a){var p=Yl(d).hoistableStyles,y=qn(a);i=i||"default";var S=p.get(y);if(!S){var B={loading:0,preload:null};if(S=d.querySelector(Gn(y)))B.loading=5;else{a=xe({rel:"stylesheet",href:a,"data-precedence":i},u),(u=nl.get(y))&&Hl(a,u);var D=S=d.createElement("link");$t(D),rn(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,jl(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:B},p.set(y,S)}}}function Ju(a,i){_s.X(a,i);var u=Ao;if(u&&a){var d=Yl(u).hoistableScripts,p=Wu(a),y=d.get(p);y||(y=u.querySelector(Co(p)),y||(a=xe({src:a,async:!0},i),(i=nl.get(p))&&sa(a,i),y=u.createElement("script"),$t(y),rn(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function Nn(a,i){_s.M(a,i);var u=Ao;if(u&&a){var d=Yl(u).hoistableScripts,p=Wu(a),y=d.get(p);y||(y=u.querySelector(Co(p)),y||(a=xe({src:a,async:!0,type:"module"},i),(i=nl.get(p))&&sa(a,i),y=u.createElement("script"),$t(y),rn(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=ra.current)?Of(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=qn(u.href),u=Yl(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=qn(u.href);var y=Yl(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(Gn(a)))&&!y._p&&(S.instance=y,S.state.loading=5),nl.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},nl.set(a,u),y||sy(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=Wu(u),u=Yl(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 qn(a){return'href="'+ul(a)+'"'}function Gn(a){return'link[rel="stylesheet"]['+a+"]"}function On(a){return xe({},a,{"data-precedence":a.precedence,precedence:null})}function sy(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}),rn(i,"link",u),$t(i),a.head.appendChild(i))}function Wu(a){return'[src="'+ul(a)+'"]'}function Co(a){return"script[async]"+a}function kr(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var d=a.querySelector('style[data-href~="'+ul(u.href)+'"]');if(d)return i.instance=d,$t(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"),$t(d),rn(d,"style",p),jl(d,u.precedence,a),i.instance=d;case"stylesheet":p=qn(u.href);var y=a.querySelector(Gn(p));if(y)return i.state.loading|=4,i.instance=y,$t(y),y;d=On(u),(p=nl.get(p))&&Hl(d,p),y=(a.ownerDocument||a).createElement("link"),$t(y);var S=y;return S._p=new Promise(function(B,D){S.onload=B,S.onerror=D}),rn(y,"link",d),i.state.loading|=4,jl(y,u.precedence,a),i.instance=y;case"script":return y=Wu(u.src),(p=a.querySelector(Co(y)))?(i.instance=p,$t(p),p):(d=u,(p=nl.get(y))&&(d=xe({},u),sa(d,p)),a=a.ownerDocument||a,p=a.createElement("script"),$t(p),rn(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,jl(d,u.precedence,a));return i.instance}function jl(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 Hl(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function sa(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var Oi=null;function Ns(a,i,u){if(Oi===null){var d=new Map,p=Oi=new Map;p.set(u,d)}else p=Oi,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[Yo]||y[hn]||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 En(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function ll(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 To(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}var zi=null;function oy(){}function iy(a,i,u){if(zi===null)throw Error(g(475));var d=zi;if(i.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var p=qn(u.href),y=a.querySelector(Gn(p));if(y){a=y._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(d.count++,d=ko.bind(d),a.then(d,d)),i.state.loading|=4,i.instance=y,$t(y);return}y=a.ownerDocument||a,u=On(u),(p=nl.get(p))&&Hl(u,p),y=y.createElement("link"),$t(y);var S=y;S._p=new Promise(function(B,D){S.onload=B,S.onerror=D}),rn(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=ko.bind(d),a.addEventListener("load",i),a.addEventListener("error",i))}}function Kx(){if(zi===null)throw Error(g(475));var a=zi;return a.stylesheets&&a.count===0&&Os(a,a.stylesheets),0<a.count?function(i){var u=setTimeout(function(){if(a.stylesheets&&Os(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 ko(){if(this.count--,this.count===0){if(this.stylesheets)Os(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Br=null;function Os(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Br=new Map,i.forEach(lh,a),Br=null,ko.call(a))}function lh(a,i){if(!(i.state.loading&4)){var u=Br.get(a);if(u)var d=u.get(null);else{u=new Map,Br.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=ko.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 al={$$typeof:Z,Provider:null,Consumer:null,_currentValue:Mt,_currentValue2:Mt,_threadCount:0};function uy(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=ts(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ts(0),this.hiddenUpdates=ts(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 Jx(a,i,u,d,p,y,S,B,D,U,le,fe){return a=new uy(a,i,u,S,B,D,U,fe),i=1,y===!0&&(i|=24),y=Pt(3,null,null,i),a.current=y,y.stateNode=a,i=Pm(),i.refCount++,a.pooledCache=i,i.refCount++,y.memoizedState={element:d,isDehydrated:u,cache:i},ir(y),a}function ah(a){return a?(a=xa,a):xa}function sh(a,i,u,d,p,y){p=ah(p),d.context===null?d.context=p:d.pendingContext=p,d=As(i),d.payload={element:u},y=y===void 0?null:y,y!==null&&(d.callback=y),u=Cs(a,d,i),u!==null&&(en(u,a,i),Nu(u,a,i))}function Wx(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function Lf(a,i){Wx(a,i),(a=a.alternate)&&Wx(a,i)}function oh(a){if(a.tag===13){var i=ha(a,67108864);i!==null&&en(i,a,67108864),Lf(a,67108864)}}var wr=!0;function Fx(a,i,u,d){var p=J.T;J.T=null;var y=Ne.p;try{Ne.p=2,Hf(a,i,u,d)}finally{Ne.p=y,J.T=p}}function Px(a,i,u,d){var p=J.T;J.T=null;var y=Ne.p;try{Ne.p=8,Hf(a,i,u,d)}finally{Ne.p=y,J.T=p}}function Hf(a,i,u,d){if(wr){var p=Uf(d);if(p===null)Rr(a,i,d,Dr,u),uh(a,d);else if(cy(p,a,i,u,d))d.stopPropagation();else if(uh(a,d),i&4&&-1<ih.indexOf(a)){for(;p!==null;){var y=Xo(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=es(y.pendingLanes);if(S!==0){var B=y;for(B.pendingLanes|=2,B.entangledLanes|=2;S;){var D=1<<31-$n(S);B.entanglements[1]|=D,S&=~D}vl(y),!(At&6)&&(hr=In()+500,Qu(0))}}break;case 13:B=ha(y,2),B!==null&&en(B,y,2),wi(),Lf(y,2)}if(y=Uf(d),y===null&&Rr(a,i,d,Dr,u),y===p)break;p=y}p!==null&&d.stopPropagation()}else Rr(a,i,d,null,u)}}function Uf(a){return a=wm(a),Vf(a)}var Dr=null;function Vf(a){if(Dr=null,a=as(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 Dr=a,null}function eg(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(Lg()){case Kh:return 2;case Xs:return 8;case Vo:case gc:return 32;case Jh:return 268435456;default:return 32}default:return 32}}var qf=!1,Bo=null,wo=null,zs=null,Do=new Map,Mo=new Map,Sl=[],ih="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 uh(a,i){switch(a){case"focusin":case"focusout":Bo=null;break;case"dragenter":case"dragleave":wo=null;break;case"mouseover":case"mouseout":zs=null;break;case"pointerover":case"pointerout":Do.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mo.delete(i.pointerId)}}function Fu(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=Xo(i),i!==null&&oh(i)),a):(a.eventSystemFlags|=d,i=a.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),a)}function cy(a,i,u,d,p){switch(i){case"focusin":return Bo=Fu(Bo,a,i,u,d,p),!0;case"dragenter":return wo=Fu(wo,a,i,u,d,p),!0;case"mouseover":return zs=Fu(zs,a,i,u,d,p),!0;case"pointerover":var y=p.pointerId;return Do.set(y,Fu(Do.get(y)||null,a,i,u,d,p)),!0;case"gotpointercapture":return y=p.pointerId,Mo.set(y,Fu(Mo.get(y)||null,a,i,u,d,p)),!0}return!1}function tg(a){var i=as(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,ns(a.priority,function(){if(u.tag===13){var d=Dn(),p=ha(u,d);p!==null&&en(p,u,d),Lf(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 Gf(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=Uf(a.nativeEvent);if(u===null){u=a.nativeEvent;var d=new u.constructor(u.type,u);Bm=d,u.target.dispatchEvent(d),Bm=null}else return i=Xo(u),i!==null&&oh(i),a.blockedOn=u,!1;i.shift()}return!0}function ch(a,i,u){Gf(a)&&u.delete(i)}function Pu(){qf=!1,Bo!==null&&Gf(Bo)&&(Bo=null),wo!==null&&Gf(wo)&&(wo=null),zs!==null&&Gf(zs)&&(zs=null),Do.forEach(ch),Mo.forEach(ch)}function ec(a,i){a.blockedOn===i&&(a.blockedOn=null,qf||(qf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Pu)))}var Mr=null;function rh(a){Mr!==a&&(Mr=a,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Mr===a&&(Mr=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(Vf(d||u)===null)continue;break}var y=Xo(u);y!==null&&(a.splice(i,3),i-=3,vs(y,{pending:!0,data:p,method:u.method,action:d},d,p))}}))}function tc(a){function i(D){return ec(D,a)}Bo!==null&&ec(Bo,a),wo!==null&&ec(wo,a),zs!==null&&ec(zs,a),Do.forEach(i),Mo.forEach(i);for(var u=0;u<Sl.length;u++){var d=Sl[u];d.blockedOn===a&&(d.blockedOn=null)}for(;0<Sl.length&&(u=Sl[0],u.blockedOn===null);)tg(u),u.blockedOn===null&&Sl.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[Kn]||null;if(typeof y=="function")S||rh(u);else if(S){var B=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[Kn]||null)B=S.formAction;else if(Vf(p)!==null)continue}else B=S.action;typeof B=="function"?u[d+1]=B:(u.splice(d,3),d-=3),rh(u)}}}function dh(a){this._internalRoot=a}Li.prototype.render=dh.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(g(409));var u=i.current,d=Dn();sh(u,d,a,i,null,null)},Li.prototype.unmount=dh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;a.tag===0&&Di(),sh(a.current,2,null,a,null,null),wi(),i[ls]=null}};function Li(a){this._internalRoot=a}Li.prototype.unstable_scheduleHydration=function(a){if(a){var i=Rc();a={blockedOn:null,target:a,priority:i};for(var u=0;u<Sl.length&&i!==0&&i<Sl[u].priority;u++);Sl.splice(u,0,a),u===0&&tg(a)}};var fh=h.version;if(fh!=="19.0.0")throw Error(g(527,fh,"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 nc={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:J,findFiberByHostInstance:as,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yf.isDisabled&&Yf.supportsFiber)try{qo=Yf.inject(nc),pn=Yf}catch{}}return reactDomClient_production.createRoot=function(a,i){if(!v(a))throw Error(g(299));var u=!1,d="",p=kx,y=Fl,S=vp,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=Jx(a,1,!1,null,null,u,d,p,y,S,B,null),a[ls]=i.current,_i(a.nodeType===8?a.parentNode:a),new dh(i)},reactDomClient_production.hydrateRoot=function(a,i,u){if(!v(a))throw Error(g(299));var d=!1,p="",y=kx,S=Fl,B=vp,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=Jx(a,1,!0,i,u??null,d,p,y,S,B,D,U),i.context=ah(null),u=i.current,d=Dn(),p=As(d),p.callback=null,Cs(u,p,d),i.current.lanes=d,fa(i,d),vl(i),a[ls]=i.current,_i(a),new Li(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=Rn(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=Rn(n)?n.slice():He({},n);return c+1===l.length?(m[o[c]]=m[f],Rn(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=Rn(n)?n.slice():He({},n);return o+1===l.length?(Rn(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 Bx(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 O(){}function N(){}function z(n){var l=[];return n.forEach(function(o){l.push(o)}),l.sort().join(", ")}function Z(n,l){n.context===lc&&(Yx(l,n,null,null),pl())}function q(n,l){if(Ga!==null){var o=l.staleFamilies;l=l.updatedFamilies,Ts(),Om(n.current,l,o),pl()}}function Y(n){Ga=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=Zx&&n[Zx]||n["@@iterator"],typeof n=="function"?n:null)}function te(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Pg?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Ha:return"Fragment";case $u:return"Portal";case Bf:return"Profiler";case kf:return"StrictMode";case wf:return"Suspense";case Rr: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 Rl:return(n.displayName||"Context")+".Provider";case vr:return(n._context.displayName||"Context")+".Consumer";case _i:var l=n.render;return n=n.displayName,n||(n=l.displayName||l.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Eo:return l=n.displayName||null,l!==null?l:te(n.type)||"Memo";case Mn: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===kf?"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 oe(){}function pe(){if(jo===0){ut=console.log,Df=console.info,rn=console.warn,Ix=console.error,Mf=console.group,_f=console.groupCollapsed,Er=console.groupEnd;var n={configurable:!0,enumerable:!0,value:oe,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}jo++}function ve(){if(jo--,jo===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:He({},n,{value:ut}),info:He({},n,{value:Df}),warn:He({},n,{value:rn}),error:He({},n,{value:Ix}),group:He({},n,{value:Mf}),groupCollapsed:He({},n,{value:_f}),groupEnd:He({},n,{value:Er})})}0>jo&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Me(n){if(Nf===void 0)try{throw Error()}catch(o){var l=o.stack.trim().match(/\n( *(at )?)/);Nf=l&&l[1]||"",eh=-1<o.stack.indexOf(`
|
|
102
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
103
|
-
`+Nf+n+eh}function J(n,l){if(!n||jr)return"";var o=Sr.get(n);if(o!==void 0)return o;jr=!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"&&Sr.set(n,ae),ae}while(1<=m&&0<=b);break}}}finally{jr=!1,W.H=c,ve(),Error.prepareStackTrace=o}return w=(w=n?n.displayName||n.name:"")?Me(w):"",typeof n=="function"&&Sr.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(_n===null)return null;var n=_n._debugOwner;return n!=null?ue(n):null}function je(){return _n===null?"":be(_n)}function se(n,l,o,c,f,m,b){var E=_n;W.getCurrentStack=n===null?null:je,El=!1,_n=n;try{return l(o,c,f,m,b)}finally{_n=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>aa?console.error("Unexpected pop."):(l!==Ar[aa]&&console.error("Unexpected Fiber popped."),n.current=th[aa],th[aa]=null,Ar[aa]=null,aa--)}function qe(n,l,o){aa++,th[aa]=n.current,Ar[aa]=o,n.current=l}function Qt(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(dn,l,n),qe(Cr,n,n),qe(So,null,n);var o=l.nodeType;switch(o){case 9:case 11:o=o===9?"#document":"#fragment",l=(l=l.documentElement)&&(l=l.namespaceURI)?Vx(l):$i;break;default:if(l=o===8?l.parentNode:l,o=l.tagName,l=l.namespaceURI)l=Vx(l),l=At(l,o);else switch(o){case"svg":l=hm;break;case"math":l=wg;break;default:l=$i}}o=o.toLowerCase(),o=rd(null,o),o={context:l,ancestorInfo:o},Ve(So,n),qe(So,o,n)}function Mt(n){Ve(So,n),Ve(Cr,n),Ve(dn,n)}function Fa(){return Qt(So.current)}function Gs(n){n.memoizedState!==null&&qe(Tr,n,n);var l=Qt(So.current),o=n.type,c=At(l.context,o);o=rd(l.ancestorInfo,o),c={context:c,ancestorInfo:o},l!==c&&(qe(Cr,n,n),qe(So,c,n))}function ol(n){Cr.current===n&&(Ve(So,n),Ve(Cr,n)),Tr.current===n&&(Ve(Tr,n),Xh._currentValue=Pr)}function Lt(n){return typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object"}function ft(n){try{return Zn(n),!1}catch{return!0}}function Zn(n){return""+n}function at(n,l){if(ft(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,Lt(n)),Zn(n)}function ra(n,l){if(ft(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,Lt(n)),Zn(n)}function Ho(n){if(ft(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.",Lt(n)),Zn(n)}function ed(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{Ju=l.inject(n),Nn=l}catch(o){console.error("React instrumentation encountered an error: %s.",o)}return!!l.checkDCE}function Wi(n,l){if(Nn&&typeof Nn.onCommitFiberRoot=="function")try{var o=(n.current.flags&128)===128;switch(l){case jl:var c=Ao;break;case Hl:c=zf;break;case sa:c=Ku;break;case Oi:c=nh;break;default:c=Ku}Nn.onCommitFiberRoot(Ju,n,c,o)}catch(f){qn||(qn=!0,console.error("React instrumentation encountered an error: %s",f))}}function pt(n){if(typeof ly=="function"&&ay(n),Nn&&typeof Nn.setStrictMode=="function")try{Nn.setStrictMode(Ju,n)}catch(l){qn||(qn=!0,console.error("React instrumentation encountered an error: %s",l))}}function td(n){Se=n}function nd(){Se!==null&&typeof Se.markCommitStopped=="function"&&Se.markCommitStopped()}function Uo(n){Se!==null&&typeof Se.markComponentRenderStarted=="function"&&Se.markComponentRenderStarted(n)}function Ys(){Se!==null&&typeof Se.markComponentRenderStopped=="function"&&Se.markComponentRenderStopped()}function Ih(n){Se!==null&&typeof Se.markRenderStarted=="function"&&Se.markRenderStarted(n)}function $h(){Se!==null&&typeof Se.markRenderStopped=="function"&&Se.markRenderStopped()}function In(n,l){Se!==null&&typeof Se.markStateUpdateScheduled=="function"&&Se.markStateUpdateScheduled(n,l)}function Lg(n){return n>>>=0,n===0?32:31-(sy(n)/Wu|0)|0}function Kh(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 Xs(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 Vo(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=Xs(o):(m&=E,m!==0?c=Xs(m):n||(b=E&~b,b!==0&&(c=Xs(b))))):(E=o&~f,E!==0?c=Xs(E):m!==0?c=Xs(m):n||(b=o&~b,b!==0&&(c=Xs(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 gc(n,l){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&l)===0}function Jh(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 Wh(){var n=Co;return Co<<=1,!(Co&4194176)&&(Co=128),n}function Fh(){var n=kr;return kr<<=1,!(kr&62914560)&&(kr=4194304),n}function qo(n){for(var l=[],o=0;31>o;o++)l.push(n);return l}function pn(n,l){n.pendingLanes|=l,l!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Hg(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-On(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&&Pa(n,c,0),m!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=m&~(b&~l))}function Pa(n,l,o){n.pendingLanes|=l,n.suspendedLanes&=~l;var c=31-On(l);n.entangledLanes|=l,n.entanglements[c]=n.entanglements[c]|1073741824|o&4194218}function $n(n,l){var o=n.entangledLanes|=l;for(n=n.entanglements;o;){var c=31-On(o),f=1<<c;f&l|n[c]&l&&(n[c]|=l),o&=~f}}function Ph(n,l,o){if(Gn)for(n=n.pendingUpdatersLaneMap;0<o;){var c=31-On(o),f=1<<c;n[c].add(l),o&=~f}}function ex(n,l){if(Gn)for(var o=n.pendingUpdatersLaneMap,c=n.memoizedUpdaters;0<l;){var f=31-On(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 tx(n){return n&=-n,jl<n?Hl<n?n&134217727?sa:Oi:Hl:jl}function yc(){var n=xt.p;return n!==0?n:(n=window.event,n===void 0?sa:Mi(n.type))}function ld(n,l){var o=xt.p;try{return xt.p=n,l()}finally{xt.p=o}}function es(n){delete n[En],delete n[ll],delete n[zi],delete n[oy],delete n[iy]}function da(n){var l=n[En];if(l)return l;for(var o=n.parentNode;o;){if(l=o[To]||o[En]){if(o=l.alternate,l.child!==null||o!==null&&o.child!==null)for(n=Ms(n);n!==null;){if(o=n[En])return o;n=Ms(n)}return l}n=o,o=n.parentNode}return null}function Gl(n){if(n=n[En]||n[To]){var l=n.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return n}return null}function bc(n){var l=n.tag;if(l===5||l===26||l===27||l===6)return n.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function Go(n){var l=n[Kx];return l||(l=n[Kx]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Zt(n){n[ko]=!0}function ts(n,l){fa(n,l),fa(n+"Capture",l)}function fa(n,l){Os[n]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",n),Os[n]=l;var o=n.toLowerCase();for(lh[o]=n,n==="onDoubleClick"&&(lh.ondblclick=n),n=0;n<l.length;n++)Br.add(l[n])}function Fi(n,l){uy[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 ad(n){return Ua.call(sh,n)?!0:Ua.call(ah,n)?!1:Jx.test(n)?sh[n]=!0:(ah[n]=!0,console.error("Invalid attribute name: `%s`",n),!1)}function ym(n,l,o){if(ad(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 vc(n,l,o){if(ad(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 Rc(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 ns(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 It(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return Ho(n),n;default:return""}}function hn(n){var l=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Kn(n){var l=hn(n)?"checked":"value",o=Object.getOwnPropertyDescriptor(n.constructor.prototype,l);Ho(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){Ho(b),c=""+b,m.call(this,b)}}),Object.defineProperty(n,l,{enumerable:o.enumerable}),{getValue:function(){return c},setValue:function(b){Ho(b),c=""+b},stopTracking:function(){n._valueTracker=null,delete n[l]}}}}function ls(n){n._valueTracker||(n._valueTracker=Kn(n))}function sd(n){if(!n)return!1;var l=n._valueTracker;if(!l)return!0;var o=l.getValue(),c="";return n&&(c=hn(n)?n.checked?"true":"false":n.value),n=c,n!==o?(l.setValue(n),!0):!1}function od(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 wl(n){return n.replace(Wx,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function bm(n,l){l.checked===void 0||l.defaultChecked===void 0||oh||(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),oh=!0),l.value===void 0||l.defaultValue===void 0||Lf||(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),Lf=!0)}function Yo(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=""+It(l)):n.value!==""+It(l)&&(n.value=""+It(l)):b!=="submit"&&b!=="reset"||n.removeAttribute("value"),l!=null?as(n,b,It(l)):o!=null?as(n,b,It(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=""+It(E)):n.removeAttribute("name")}function id(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?""+It(o):"",l=l!=null?""+It(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 as(n,l,o){l==="number"&&od(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Xo(n,l){l.value==null&&(typeof l.children=="object"&&l.children!==null?Wp.Children.forEach(l.children,function(o){o==null||typeof o=="string"||typeof o=="number"||typeof o=="bigint"||Fx||(Fx=!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||Px||(Px=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),l.selected==null||wr||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),wr=!0)}function Pi(){var n=ge();return n?`
|
|
109
|
-
|
|
110
|
-
Check the render method of \``+n+"`.":""}function Yl(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=""+It(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 $t(n,l){for(n=0;n<Uf.length;n++){var o=Uf[n];if(l[o]!=null){var c=Rn(l[o]);l.multiple&&!c?console.error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",o,Pi()):!l.multiple&&c&&console.error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",o,Pi())}}l.value===void 0||l.defaultValue===void 0||Hf||(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"),Hf=!0)}function vm(n,l){l.value===void 0||l.defaultValue===void 0||Dr||(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"),Dr=!0),l.children!=null&&l.value==null&&console.error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.")}function Rm(n,l,o){if(l!=null&&(l=""+It(l),l!==n.value&&(n.value=l),o==null)){n.defaultValue!==l&&(n.defaultValue=l);return}n.defaultValue=o!=null?""+It(o):""}function Qs(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(Rn(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=It(l),n.defaultValue=o,c=n.textContent,c===o&&c!==""&&c!==null&&(n.value=c)}function Qo(n,l){return n.serverProps===void 0&&n.serverTail.length===0&&n.children.length===1&&3<n.distanceFromLeaf&&n.distanceFromLeaf>15-l?Qo(n.children[0],l):n}function Ht(n){return" "+" ".repeat(n)}function eu(n){return"+ "+" ".repeat(n)}function Zs(n){return"- "+" ".repeat(n)}function Em(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 Ec(n,l){return Vf.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 Zo(n,l,o){var c=120-2*o;if(l===null)return eu(o)+Ec(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)),eu(o)+Ec(n,c)+`
|
|
112
|
-
`+Zs(o)+Ec(l,c)+`
|
|
113
|
-
`}return Ht(o)+Ec(n,c)+`
|
|
114
|
-
`}function tu(n){return Object.prototype.toString.call(n).replace(/^\[object (.*)\]$/,function(l,o){return o})}function il(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(Rn(n))return"[...]";if(n.$$typeof===Ro)return(l=te(n.type))?"<"+l+">":"<...>";var o=tu(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=il(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 xn(n,l){return typeof n!="string"||Vf.test(n)?"{"+il(n,l-2)+"}":n.length>l-2?5>l?'"..."':'"'+n.slice(0,l-5)+'..."':'"'+n+'"'}function ud(n,l,o){var c=120-o.length-n.length,f=[],m;for(m in l)if(l.hasOwnProperty(m)&&m!=="children"){var b=xn(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 Ug(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=il(n[m],b);l.hasOwnProperty(m)?(b=il(l[m],b),c+=eu(o)+m+": "+E+`
|
|
121
|
-
`,c+=Zs(o)+m+": "+b+`
|
|
122
|
-
`):c+=eu(o)+m+": "+E+`
|
|
123
|
-
`}for(var k in f)f.hasOwnProperty(k)&&(n=il(f[k],120-2*o-k.length-2),c+=Zs(o)+k+": "+n+`
|
|
124
|
-
`);return c}function cd(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+=ud(n,l,Ht(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=xn(w,E);E=xn(k,E),typeof w=="object"&&w!==null&&typeof k=="object"&&k!==null&&tu(w)==="Object"&&tu(k)==="Object"&&(2<Object.keys(w).length||2<Object.keys(k).length||-1<I.indexOf("...")||-1<E.indexOf("..."))?f+=Ht(c+1)+b+`={{
|
|
125
|
-
`+Ug(w,k,c+2)+Ht(c+1)+`}}
|
|
126
|
-
`:(f+=eu(c+1)+b+"="+I+`
|
|
127
|
-
`,f+=Zs(c+1)+b+"="+E+`
|
|
128
|
-
`)}else f+=Ht(c+1)+b+"="+xn(l[b],E)+`
|
|
129
|
-
`}m.forEach(function(ae){if(ae!=="children"){var $=120-2*(c+1)-ae.length-1;f+=Zs(c+1)+ae+"="+xn(o[ae],$)+`
|
|
130
|
-
`}}),f=f===""?Ht(c)+"<"+n+`>
|
|
131
|
-
`:Ht(c)+"<"+n+`
|
|
132
|
-
`+f+Ht(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+=Zo(m,""+n,c+1)):(typeof l=="string"||typeof l=="number"||typeof l=="bigint")&&(f=n==null?f+Zo(""+l,null,c+1):f+Zo(""+l,void 0,c+1)),f}function jm(n,l){var o=Em(n);if(o===null){for(o="",n=n.child;n;)o+=jm(n,l),n=n.sibling;return o}return Ht(l)+"<"+o+`>
|
|
134
|
-
`}function nu(n,l){var o=Qo(n,l);if(o!==n&&(n.children.length!==1||n.children[0]!==o))return Ht(l)+`...
|
|
135
|
-
`+nu(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+=Ht(l)+"<"+m+`>
|
|
136
|
-
`,l++)}if(c="",f=n.fiber.pendingProps,n.fiber.tag===6)c=Zo(f,n.serverProps,l),l++;else if(m=Em(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=xn(f[w],15);if(b-=w.length+k.length+2,0>b){E+=" ...";break}E+=" "+w+"="+k}c=Ht(c)+"<"+m+E+`>
|
|
137
|
-
`,l++}else n.serverProps===null?(c=ud(m,f,eu(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=cd(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+=nu(b,l),m++):w+=jm(f,l),f=f.sibling;for(f&&0<n.children.length&&(w+=Ht(l)+`...
|
|
138
|
-
`),f=n.serverTail,n.serverProps===null&&l--,n=0;n<f.length;n++)m=f[n],w=typeof m=="string"?w+(Zs(l)+Ec(m,120-2*l)+`
|
|
139
|
-
`):w+ud(m.type,m.props,Zs(l));return o+c+w}function Sm(n){try{return`
|
|
140
|
-
|
|
141
|
-
`+nu(n,0)}catch{return""}}function ul(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?Sm(f).replaceAll(/^[+-]/gm,">"):""}function rd(n,l){n=He({},n||zs);var o={tag:l};return qf.indexOf(l)!==-1&&(n.aTagInScope=null,n.buttonTagInScope=null,n.nobrTagInScope=null),Bo.indexOf(l)!==-1&&(n.pTagInButtonScope=null),eg.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 Am(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 wo.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 Cm(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 Io(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 dd(n,l){l=l||zs;var o=l.current;if(l=(o=Am(n,o&&o.tag)?null:o)?null:Cm(n,l),l=o||l,!l)return!0;l=l.tag;var c=String(!!o)+"|"+n+"|"+l;if(Do[c])return!1;Do[c]=!0;var f=(c=_n)?Io(c.return,l):null;return c=c!==null&&f!==null?ul(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 jc(n,l){if(Am("#text",l))return!0;var o="#text|"+l;if(Do[o])return!1;Do[o]=!0;var c=(o=_n)?Io(o,l):null;return o=o!==null&&c!==null?ul(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 ma(n,l){if(l){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=l;return}}n.textContent=l}function Vg(n){return n.replace(Gf,function(l,o){return o.toUpperCase()})}function Tm(n,l,o){var c=l.indexOf("--")===0;c||(-1<l.indexOf("-")?Pu.hasOwnProperty(l)&&Pu[l]||(Pu[l]=!0,console.error("Unsupported style property %s. Did you mean %s?",l,Vg(l.replace(tg,"ms-")))):cy.test(l)?Pu.hasOwnProperty(l)&&Pu[l]||(Pu[l]=!0,console.error("Unsupported vendor-prefixed style property %s. Did you mean %s?",l,l.charAt(0).toUpperCase()+l.slice(1))):!ch.test(o)||ec.hasOwnProperty(o)&&ec[o]||(ec[o]=!0,console.error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,l,o.replace(ch,""))),typeof o=="number"&&(isNaN(o)?Mr||(Mr=!0,console.error("`NaN` is an invalid value for the `%s` css style property.",l)):isFinite(o)||rh||(rh=!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||tc.has(l)?l==="float"?n.cssFloat=o:(ra(o,l),n[l]=(""+o).trim()):n[l]=o+"px"}function km(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=ih[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=ih[E]||[E],m=0;m<f.length;m++)c[f[m]]=E;E={};for(var k in l)for(f=ih[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&&Tm(n,$,w)}else for(c in l)l.hasOwnProperty(c)&&Tm(n,c,l[c])}function $o(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 nx(n){return dh.get(n)||n}function qg(n,l){if(Ua.call(nc,l)&&nc[l])return!0;if(a.test(l)){if(n="aria-"+l.slice(4).toLowerCase(),n=fh.hasOwnProperty(n)?n:null,n==null)return console.error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",l),nc[l]=!0;if(l!==n)return console.error("Invalid ARIA attribute `%s`. Did you mean `%s`?",l,n),nc[l]=!0}if(Yf.test(l)){if(n=l.toLowerCase(),n=fh.hasOwnProperty(n)?n:null,n==null)return nc[l]=!0,!1;l!==n&&(console.error("Unknown ARIA attribute `%s`. Did you mean `%s`?",l,n),nc[l]=!0)}return!0}function fd(n,l){var o=[],c;for(c in l)qg(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 Bm(n,l,o,c){if(Ua.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(Li.hasOwnProperty(f)){if(f=Li[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 wm(n,l,o){var c=[],f;for(f in l)Bm(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 pa(n){return B.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Is(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}function Dm(n){var l=Gl(n);if(l&&(n=l.stateNode)){var o=n[ll]||null;e:switch(n=l.stateNode,l.type){case"input":if(Yo(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="'+wl(""+l)+'"][type="radio"]'),l=0;l<o.length;l++){var c=o[l];if(c!==n&&c.form===n.form){var f=c[ll]||null;if(!f)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");Yo(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&&sd(c)}break e;case"textarea":Rm(n,o.value,o.defaultValue);break e;case"select":l=o.value,l!=null&&Yl(n,!!o.multiple,l,!1)}}}function md(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)&&(pl(),U&&(l=U,n=le,le=U=null,Dm(l),n)))for(l=0;l<n.length;l++)Dm(n[l])}}function lu(n,l){var o=n.stateNode;if(o===null)return null;var c=o[ll]||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 au(){if(vt)return vt;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 vt=f.slice(n,1<c?1-c:void 0)}function su(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 $s(){return!0}function ss(){return!1}function Cn(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)?$s:ss,this.isPropagationStopped=ss,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=$s)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=$s)},persist:function(){},isPersistent:$s}),l}function pd(n){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(n):(n=ov[n])?!!l[n]:!1}function hd(){return pd}function Sc(n,l){switch(n){case"keyup":return yv.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==u0;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ac(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}function lx(n,l){switch(n){case"compositionend":return Ac(l);case"keypress":return l.which!==r0?null:(f0=!0,d0);case"textInput":return n=l.data,n===d0&&f0?null:n;default:return null}}function Jn(n,l){if(Xf)return n==="compositionend"||!fy&&Sc(n,l)?(n=au(),vt=_e=Ce=null,Xf=!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 c0&&l.locale!=="ko"?null:l.data;default:return null}}function Ks(n){var l=n&&n.nodeName&&n.nodeName.toLowerCase();return l==="input"?!!vv[n.type]:l==="textarea"}function xd(n){if(!al)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 ou(n,l,o,c){U?le?le.push(c):le=[c]:U=c,l=ws(l,"onChange"),0<l.length&&(o=new H("onChange","change",null,o,c),n.push({event:o,listeners:l}))}function Gg(n){ff(n,0)}function iu(n){var l=bc(n);if(sd(l))return n}function gd(n,l){if(n==="change")return l}function uu(){ph&&(ph.detachEvent("onpropertychange",Cc),hh=ph=null)}function Cc(n){if(n.propertyName==="value"&&iu(hh)){var l=[];ou(l,hh,n,Is(n)),md(Gg,l)}}function ax(n,l,o){n==="focusin"?(uu(),ph=l,hh=o,ph.attachEvent("onpropertychange",Cc)):n==="focusout"&&uu()}function Yg(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return iu(hh)}function Xg(n,l){if(n==="click")return iu(l)}function Qg(n,l){if(n==="input"||n==="change")return iu(l)}function Mm(n,l){return n===l&&(n!==0||1/n===1/l)||n!==n&&l!==l}function Tc(n,l){if(Al(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(!Ua.call(l,f)||!Al(n[f],l[f]))return!1}return!0}function sx(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function ox(n,l){var o=sx(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=sx(o)}}function ix(n,l){return n&&l?n===l?!0:n&&n.nodeType===3?!1:l&&l.nodeType===3?ix(n,l.parentNode):"contains"in n?n.contains(l):n.compareDocumentPosition?!!(n.compareDocumentPosition(l)&16):!1:!1}function ux(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var l=od(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=od(n.document)}return l}function yd(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 Zg(n,l){var o=ux(l);l=n.focusedElem;var c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&ix(l.ownerDocument.documentElement,l)){if(c!==null&&yd(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=ox(l,m);var b=ox(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 cx(n,l,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;py||Qf==null||Qf!==od(c)||(c=Qf,"selectionStart"in c&&yd(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}),xh&&Tc(xh,c)||(xh=c,c=ws(my,"onSelect"),0<c.length&&(l=new H("onSelect","select",null,l,o),n.push({event:l,listeners:c}),l.target=Qf)))}function Ko(n,l){var o={};return o[n.toLowerCase()]=l.toLowerCase(),o["Webkit"+n]="webkit"+l,o["Moz"+n]="moz"+l,o}function Jo(n){if(hy[n])return hy[n];if(!Zf[n])return n;var l=Zf[n],o;for(o in l)if(l.hasOwnProperty(o)&&o in p0)return hy[n]=l[o];return n}function cl(n,l){b0.set(n,l),ts(l,[n])}function bd(){for(var n=If,l=xy=If=0;l<n;){var o=qa[l];qa[l++]=null;var c=qa[l];qa[l++]=null;var f=qa[l];qa[l++]=null;var m=qa[l];if(qa[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&&rx(o,f,m)}}function vd(n,l,o,c){qa[If++]=n,qa[If++]=l,qa[If++]=o,qa[If++]=c,xy|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function _m(n,l,o,c){return vd(n,l,o,c),Rd(n)}function gn(n,l){return vd(n,null,null,l),Rd(n)}function rx(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&gh||(f=!0)),n=m,m=m.return;f&&l!==null&&n.tag===3&&(m=n.stateNode,f=31-On(o),m=m.hiddenUpdates,n=m[f],n===null?m[f]=[l]:n.push(l),l.lane=o|536870912)}function Rd(n){if(Uh>Lv)throw Ir=Uh=0,Vh=Qy=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.");Ir>Hv&&(Ir=0,Vh=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&&Dp(n);for(var l=n,o=l.return;o!==null;)l.alternate===null&&l.flags&4098&&Dp(n),l=o,o=l.return;return l.tag===3?l.stateNode:null}function Wo(n){if(Ga===null)return n;var l=Ga(n);return l===void 0?n:l.current}function Nm(n){if(Ga===null)return n;var l=Ga(n);return l===void 0?n!=null&&typeof n.render=="function"&&(l=Wo(n.render),n.render!==l)?(l={$$typeof:_i,render:l},n.displayName!==void 0&&(l.displayName=n.displayName),l):n:l.current}function dx(n,l){if(Ga===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===Mn)&&(c=!0);break;case 11:(f===_i||f===Mn)&&(c=!0);break;case 14:case 15:(f===Eo||f===Mn)&&(c=!0);break;default:return!1}return!!(c&&(n=Ga(o),n!==void 0&&n===Ga(l)))}function fx(n){Ga!==null&&typeof WeakSet=="function"&&($f===null&&($f=new WeakSet),$f.add(n))}function Om(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(Ga===null)throw Error("Expected resolveFamily to be set during hot reload.");var w=!1;E=!1,k!==null&&(k=Ga(k),k!==void 0&&(o.has(k)?E=!0:l.has(k)&&(b===1?E=!0:w=!0))),$f!==null&&($f.has(n)||c!==null&&$f.has(c))&&(E=!0),E&&(n._debugNeedsRemount=!0),(E||w)&&(c=gn(n,2),c!==null&&mt(c,n,2)),f===null||E||Om(f,l,o),m!==null&&Om(m,l,o)}function os(){var n=Nr;return Nr=0,n}function Ed(n){var l=Nr;return Nr=n,l}function Fo(n){var l=Nr;return Nr+=n,l}function Po(n){Ul=Kf(),0>n.actualStartTime&&(n.actualStartTime=Ul)}function zm(n){if(0<=Ul){var l=Kf()-Ul;n.actualDuration+=l,n.selfBaseDuration=l,Ul=-1}}function Lm(n){if(0<=Ul){var l=Kf()-Ul;n.actualDuration+=l,Ul=-1}}function Xl(){if(0<=Ul){var n=Kf()-Ul;Ul=-1,Nr+=n}}function Ql(){Ul=Kf()}function kc(n){for(var l=n.child;l;)n.actualDuration+=l.actualDuration,l=l.sibling}function Wn(n,l){if(typeof n=="object"&&n!==null){var o=yy.get(n);return o!==void 0?o:(l={value:n,source:l,stack:be(l)},yy.set(n,l),l)}return{value:n,source:l,stack:be(l)}}function Dl(n,l){Js(),Jf[Wf++]=ig,Jf[Wf++]=og,og=n,ig=l}function mx(n,l,o){Js(),Ya[Xa++]=Ui,Ya[Xa++]=Vi,Ya[Xa++]=zr,zr=n;var c=Ui;n=Vi;var f=32-On(c)-1;c&=~(1<<f),o+=1;var m=32-On(l)+f;if(30<m){var b=f-f%5;m=(c&(1<<b)-1).toString(32),c>>=b,f-=b,Ui=1<<32-On(l)+f|o<<f|c,Vi=m+n}else Ui=1<<m|o<<f|c,Vi=n}function Hm(n){Js(),n.return!==null&&(Dl(n,1),mx(n,1,0))}function Um(n){for(;n===og;)og=Jf[--Wf],Jf[Wf]=null,ig=Jf[--Wf],Jf[Wf]=null;for(;n===zr;)zr=Ya[--Xa],Ya[Xa]=null,Vi=Ya[--Xa],Ya[Xa]=null,Ui=Ya[--Xa],Ya[Xa]=null}function Js(){et||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function Ws(n,l){if(n.return===null){if(Qa===null)Qa={fiber:n,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:l};else{if(Qa.fiber!==n)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");Qa.distanceFromLeaf>l&&(Qa.distanceFromLeaf=l)}return Qa}var o=Ws(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 ei(n,l){qi||(n=Ws(n,0),n.serverProps=null,l!==null&&(l=bf(l),n.serverTail.push(l)))}function Zl(n){var l="",o=Qa;throw o!==null&&(Qa=null,l=Sm(o)),ti(Wn(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)),by}function px(n){var l=n.stateNode,o=n.type,c=n.memoizedProps;switch(l[En]=n,l[ll]=c,Si(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<qh.length;o++)Ie(qh[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":Fi("input",c),Ie("invalid",l),bm(l,c),id(l,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0),ls(l);break;case"option":Xo(l,c);break;case"select":Fi("select",c),Ie("invalid",l),$t(l,c);break;case"textarea":Fi("textarea",c),Ie("invalid",l),vm(l,c),Qs(l,c.value,c.defaultValue,c.children),ls(l)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||l.textContent===""+o||c.suppressHydrationWarning===!0||hf(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=la),l=!0):l=!1,l||Zl(n)}function Bc(n){for(Cl=n.return;Cl;)switch(Cl.tag){case 3:case 27:No=!0;return;case 5:case 13:No=!1;return;default:Cl=Cl.return}}function cu(n){if(n!==Cl)return!1;if(!et)return Bc(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")||rt(n.type,n.memoizedProps)),o=!o),o&&(l=!0),l&&Xn){for(l=Xn;l;){o=Ws(n,0);var c=bf(l);o.serverTail.push(c),l=c.type==="Suspense"?xr(l):tl(l.nextSibling)}Zl(n)}if(Bc(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.");Xn=xr(n)}else Xn=Cl?tl(n.stateNode.nextSibling):null;return!0}function ru(){Xn=Cl=null,qi=et=!1}function ti(n){Us===null?Us=[n]:Us.push(n)}function jd(){var n=Qa;n!==null&&(Qa=null,n=Sm(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 Vm(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function qm(n){return n=n.status,n==="fulfilled"||n==="rejected"}function wc(){}function hx(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(wc,wc),l=o),l.status){case"fulfilled":return l.value;case"rejected":throw n=l.reason,gx(n),n;default:if(typeof l.status=="string")l.then(wc,wc);else{if(n=Rt,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,gx(n),n}throw Sh=l,cg=!0,ug}}function xx(){if(Sh===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var n=Sh;return Sh=null,cg=!1,n}function gx(n){if(n===ug)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 yn(n){var l=Qe;return n!=null&&(Qe=l===null?n:l.concat(n)),l}function Sd(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=Mu(n,o.mode,0),l._debugInfo=Qe,l.return=o),se(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 Tn(n){var l=Ah;return Ah+=1,Ff===null&&(Ff=Vm()),hx(Ff,n,l)}function is(n,l){l=l.props.ref,n.ref=l!==void 0?l:null}function Dc(n,l){throw l.$$typeof===Pp?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 Mc(n,l){var o=X(n)||"Component";H0[o]||(H0[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 _c(n,l){var o=X(n)||"Component";U0[o]||(U0[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 Gm(n){function l(_,M){if(n){var L=_.deletions;L===null?(_.deletions=[M],_.flags|=16):L.push(M)}}function o(_,M){if(!n)return null;for(;M!==null;)l(_,M),M=M.sibling;return null}function c(_){for(var M=new Map;_!==null;)_.key!==null?M.set(_.key,_):M.set(_.index,_),_=_.sibling;return M}function f(_,M){return _=Ca(_,M),_.index=0,_.sibling=null,_}function m(_,M,L){return _.index=L,n?(L=_.alternate,L!==null?(L=L.index,L<M?(_.flags|=33554434,M):L):(_.flags|=33554434,M)):(_.flags|=1048576,M)}function b(_){return n&&_.alternate===null&&(_.flags|=33554434),_}function E(_,M,L,ne){return M===null||M.tag!==6?(M=nf(L,_.mode,ne),M.return=_,M._debugOwner=_,M._debugInfo=Qe,M):(M=f(M,L),M.return=_,M._debugInfo=Qe,M)}function k(_,M,L,ne){var Ee=L.type;return Ee===Ha?(M=I(_,M,L.props.children,ne,L.key),Sd(L,M,_),M):M!==null&&(M.elementType===Ee||dx(M,L)||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Mn&&ac(Ee)===M.type)?(M=f(M,L.props),is(M,L),M.return=_,M._debugOwner=L._owner,M._debugInfo=Qe,M):(M=Mu(L,_.mode,ne),is(M,L),M.return=_,M._debugInfo=Qe,M)}function w(_,M,L,ne){return M===null||M.tag!==4||M.stateNode.containerInfo!==L.containerInfo||M.stateNode.implementation!==L.implementation?(M=ar(L,_.mode,ne),M.return=_,M._debugInfo=Qe,M):(M=f(M,L.children||[]),M.return=_,M._debugInfo=Qe,M)}function I(_,M,L,ne,Ee){return M===null||M.tag!==7?(M=js(L,_.mode,ne,Ee),M.return=_,M._debugOwner=_,M._debugInfo=Qe,M):(M=f(M,L),M.return=_,M._debugInfo=Qe,M)}function ae(_,M,L){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=nf(""+M,_.mode,L),M.return=_,M._debugOwner=_,M._debugInfo=Qe,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case Ro:return L=Mu(M,_.mode,L),is(L,M),L.return=_,_=yn(M._debugInfo),L._debugInfo=Qe,Qe=_,L;case $u:return M=ar(M,_.mode,L),M.return=_,M._debugInfo=Qe,M;case Mn:var ne=yn(M._debugInfo);return M=ac(M),_=ae(_,M,L),Qe=ne,_}if(Rn(M)||he(M))return L=js(M,_.mode,L,null),L.return=_,L._debugOwner=_,_=yn(M._debugInfo),L._debugInfo=Qe,Qe=_,L;if(typeof M.then=="function")return ne=yn(M._debugInfo),_=ae(_,Tn(M),L),Qe=ne,_;if(M.$$typeof===Rl)return ae(_,Au(_,M),L);Dc(_,M)}return typeof M=="function"&&Mc(_,M),typeof M=="symbol"&&_c(_,M),null}function $(_,M,L,ne){var Ee=M!==null?M.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return Ee!==null?null:E(_,M,""+L,ne);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case Ro:return L.key===Ee?(Ee=yn(L._debugInfo),_=k(_,M,L,ne),Qe=Ee,_):null;case $u:return L.key===Ee?w(_,M,L,ne):null;case Mn:return Ee=yn(L._debugInfo),L=ac(L),_=$(_,M,L,ne),Qe=Ee,_}if(Rn(L)||he(L))return Ee!==null?null:(Ee=yn(L._debugInfo),_=I(_,M,L,ne,null),Qe=Ee,_);if(typeof L.then=="function")return Ee=yn(L._debugInfo),_=$(_,M,Tn(L),ne),Qe=Ee,_;if(L.$$typeof===Rl)return $(_,M,Au(_,L),ne);Dc(_,L)}return typeof L=="function"&&Mc(_,L),typeof L=="symbol"&&_c(_,L),null}function ce(_,M,L,ne,Ee){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return _=_.get(L)||null,E(M,_,""+ne,Ee);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case Ro:return L=_.get(ne.key===null?L:ne.key)||null,_=yn(ne._debugInfo),M=k(M,L,ne,Ee),Qe=_,M;case $u:return _=_.get(ne.key===null?L:ne.key)||null,w(M,_,ne,Ee);case Mn:var Le=yn(ne._debugInfo);return ne=ac(ne),M=ce(_,M,L,ne,Ee),Qe=Le,M}if(Rn(ne)||he(ne))return L=_.get(L)||null,_=yn(ne._debugInfo),M=I(M,L,ne,Ee,null),Qe=_,M;if(typeof ne.then=="function")return Le=yn(ne._debugInfo),M=ce(_,M,L,Tn(ne),Ee),Qe=Le,M;if(ne.$$typeof===Rl)return ce(_,M,L,Au(M,ne),Ee);Dc(M,ne)}return typeof ne=="function"&&Mc(M,ne),typeof ne=="symbol"&&_c(M,ne),null}function Be(_,M,L,ne){if(typeof L!="object"||L===null)return ne;switch(L.$$typeof){case Ro:case $u:N(_,M,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}se(M,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 Mn:L=ac(L),Be(_,M,L,ne)}return ne}function Ye(_,M,L,ne){for(var Ee=null,Le=null,ke=null,Ue=M,Xe=M=0,Dt=null;Ue!==null&&Xe<L.length;Xe++){Ue.index>Xe?(Dt=Ue,Ue=null):Dt=Ue.sibling;var ln=$(_,Ue,L[Xe],ne);if(ln===null){Ue===null&&(Ue=Dt);break}Ee=Be(_,ln,L[Xe],Ee),n&&Ue&&ln.alternate===null&&l(_,Ue),M=m(ln,M,Xe),ke===null?Le=ln:ke.sibling=ln,ke=ln,Ue=Dt}if(Xe===L.length)return o(_,Ue),et&&Dl(_,Xe),Le;if(Ue===null){for(;Xe<L.length;Xe++)Ue=ae(_,L[Xe],ne),Ue!==null&&(Ee=Be(_,Ue,L[Xe],Ee),M=m(Ue,M,Xe),ke===null?Le=Ue:ke.sibling=Ue,ke=Ue);return et&&Dl(_,Xe),Le}for(Ue=c(Ue);Xe<L.length;Xe++)Dt=ce(Ue,_,Xe,L[Xe],ne),Dt!==null&&(Ee=Be(_,Dt,L[Xe],Ee),n&&Dt.alternate!==null&&Ue.delete(Dt.key===null?Xe:Dt.key),M=m(Dt,M,Xe),ke===null?Le=Dt:ke.sibling=Dt,ke=Dt);return n&&Ue.forEach(function(Ji){return l(_,Ji)}),et&&Dl(_,Xe),Le}function nn(_,M,L,ne){if(L==null)throw Error("An iterable object provided no iterator.");for(var Ee=null,Le=null,ke=M,Ue=M=0,Xe=null,Dt=null,ln=L.next();ke!==null&&!ln.done;Ue++,ln=L.next()){ke.index>Ue?(Xe=ke,ke=null):Xe=ke.sibling;var Ji=$(_,ke,ln.value,ne);if(Ji===null){ke===null&&(ke=Xe);break}Dt=Be(_,Ji,ln.value,Dt),n&&ke&&Ji.alternate===null&&l(_,ke),M=m(Ji,M,Ue),Le===null?Ee=Ji:Le.sibling=Ji,Le=Ji,ke=Xe}if(ln.done)return o(_,ke),et&&Dl(_,Ue),Ee;if(ke===null){for(;!ln.done;Ue++,ln=L.next())ke=ae(_,ln.value,ne),ke!==null&&(Dt=Be(_,ke,ln.value,Dt),M=m(ke,M,Ue),Le===null?Ee=ke:Le.sibling=ke,Le=ke);return et&&Dl(_,Ue),Ee}for(ke=c(ke);!ln.done;Ue++,ln=L.next())Xe=ce(ke,_,Ue,ln.value,ne),Xe!==null&&(Dt=Be(_,Xe,ln.value,Dt),n&&Xe.alternate!==null&&ke.delete(Xe.key===null?Ue:Xe.key),M=m(Xe,M,Ue),Le===null?Ee=Xe:Le.sibling=Xe,Le=Xe);return n&&ke.forEach(function(Jv){return l(_,Jv)}),et&&Dl(_,Ue),Ee}function ct(_,M,L,ne){if(typeof L=="object"&&L!==null&&L.type===Ha&&L.key===null&&(Sd(L,null,_),L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case Ro:var Ee=yn(L._debugInfo);e:{for(var Le=L.key;M!==null;){if(M.key===Le){if(Le=L.type,Le===Ha){if(M.tag===7){o(_,M.sibling),ne=f(M,L.props.children),ne.return=_,ne._debugOwner=L._owner,ne._debugInfo=Qe,Sd(L,ne,_),_=ne;break e}}else if(M.elementType===Le||dx(M,L)||typeof Le=="object"&&Le!==null&&Le.$$typeof===Mn&&ac(Le)===M.type){o(_,M.sibling),ne=f(M,L.props),is(ne,L),ne.return=_,ne._debugOwner=L._owner,ne._debugInfo=Qe,_=ne;break e}o(_,M);break}else l(_,M);M=M.sibling}L.type===Ha?(ne=js(L.props.children,_.mode,ne,L.key),ne.return=_,ne._debugOwner=_,ne._debugInfo=Qe,Sd(L,ne,_),_=ne):(ne=Mu(L,_.mode,ne),is(ne,L),ne.return=_,ne._debugInfo=Qe,_=ne)}return _=b(_),Qe=Ee,_;case $u:e:{for(Ee=L,L=Ee.key;M!==null;){if(M.key===L)if(M.tag===4&&M.stateNode.containerInfo===Ee.containerInfo&&M.stateNode.implementation===Ee.implementation){o(_,M.sibling),ne=f(M,Ee.children||[]),ne.return=_,_=ne;break e}else{o(_,M);break}else l(_,M);M=M.sibling}ne=ar(Ee,_.mode,ne),ne.return=_,_=ne}return b(_);case Mn:return Ee=yn(L._debugInfo),L=ac(L),_=ct(_,M,L,ne),Qe=Ee,_}if(Rn(L))return Ee=yn(L._debugInfo),_=Ye(_,M,L,ne),Qe=Ee,_;if(he(L)){if(Ee=yn(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?(_.tag!==0||Object.prototype.toString.call(_.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(ke)!=="[object Generator]")&&(z0||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."),z0=!0):L.entries!==Le||jy||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),jy=!0),_=nn(_,M,ke,ne),Qe=Ee,_}if(typeof L.then=="function")return Ee=yn(L._debugInfo),_=ct(_,M,Tn(L),ne),Qe=Ee,_;if(L.$$typeof===Rl)return ct(_,M,Au(_,L),ne);Dc(_,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(Ee=""+L,M!==null&&M.tag===6?(o(_,M.sibling),ne=f(M,Ee),ne.return=_,_=ne):(o(_,M),ne=nf(Ee,_.mode,ne),ne.return=_,ne._debugOwner=_,ne._debugInfo=Qe,_=ne),b(_)):(typeof L=="function"&&Mc(_,L),typeof L=="symbol"&&_c(_,L),o(_,M))}return function(_,M,L,ne){var Ee=Qe;Qe=null;try{Ah=0;var Le=ct(_,M,L,ne);return Ff=null,Le}catch(Dt){if(Dt===ug)throw Dt;var ke=j(29,Dt,null,_.mode);ke.lanes=ne,ke.return=_;var Ue=ke._debugInfo=Qe;if(ke._debugOwner=_._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 Ad(n,l){var o=Lo;qe(rg,o,n),qe(Pf,l,n),Lo=o|l.baseLanes}function Ym(n){qe(rg,Lo,n),qe(Pf,Pf.current,n)}function Xm(n){Lo=rg.current,Ve(Pf,n),Ve(rg,n)}function rl(n){var l=n.alternate;qe(jn,jn.current&em,n),qe(Za,n,n),Oo===null&&(l===null||Pf.current!==null||l.memoizedState!==null)&&(Oo=n)}function Cd(n){if(n.tag===22){if(qe(jn,jn.current,n),qe(Za,n,n),Oo===null){var l=n.alternate;l!==null&&l.memoizedState!==null&&(Oo=n)}}else Ml(n)}function Ml(n){qe(jn,jn.current,n),qe(Za,Za.current,n)}function Il(n){Ve(Za,n),Oo===n&&(Oo=null),Ve(jn,n)}function Nc(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===Jr||o.data===Wr))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 us(){return{controller:new Bv,data:new Map,refCount:0}}function _l(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 ni(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&&wv(Dv,function(){n.controller.abort()})}function yx(n,l){if(Th===null){var o=Th=[];Sy=0,Hr=df(),tm={status:"pending",value:void 0,then:function(c){o.push(c)}}}return Sy++,l.then(Fs,Fs),l}function Fs(){if(--Sy===0&&Th!==null){tm!==null&&(tm.status="fulfilled");var n=Th;Th=null,Hr=0,tm=null;for(var l=0;l<n.length;l++)(0,n[l])()}}function bx(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 Td(){var n=Ur.current;return n!==null?n:Rt.pooledCache}function Oc(n,l){l===null?qe(Ur,Ur.current,n):qe(Ur,l.pool,n)}function vx(){var n=Td();return n===null?null:{parent:An._currentValue,pool:n}}function Ze(){var n=F;Ka===null?Ka=[n]:Ka.push(n)}function ye(){var n=F;if(Ka!==null&&(Yi++,Ka[Yi]!==n)){var l=X(Oe);if(!G0.has(l)&&(G0.add(l),Ka!==null)){for(var o="",c=0;c<=Yi;c++){var f=Ka[c],m=c===Yi?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 li(n){n==null||Rn(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 zc(){var n=X(Oe);X0.has(n)||(X0.add(n),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",n))}function _t(){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 dl(n,l){if(Bh)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(!Al(n[o],l[o]))return!1;return!0}function Fn(n,l,o,c,f,m){sc=m,Oe=l,Ka=n!==null?n._debugHookTypes:null,Yi=-1,Bh=n!==null&&n.type!==l.type,(Object.prototype.toString.call(o)==="[object AsyncFunction]"||Object.prototype.toString.call(o)==="[object AsyncGeneratorFunction]")&&(m=X(Oe),Ay.has(m)||(Ay.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?ic:Ka!==null?qr:oc,Vr=m=(l.mode&sl)!==Tt;var b=Ry(o,c,f);if(Vr=!1,lm&&(b=Lc(l,o,c,f)),m){pt(!0);try{b=Lc(l,o,c,f)}finally{pt(!1)}}return ai(n,l),b}function ai(n,l){l._debugHookTypes=Ka,l.dependencies===null?Gi!==null&&(l.dependencies={lanes:0,firstContext:null,_debugThenableState:Gi}):l.dependencies._debugThenableState=Gi,W.H=zo;var o=gt!==null&>.next!==null;if(sc=0,Ka=F=fn=gt=Oe=null,Yi=-1,n!==null&&(n.flags&31457280)!==(l.flags&31457280)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),dg=!1,kh=0,Gi=null,o)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");n===null||zn||(n=n.dependencies,n!==null&&Wc(n)&&(zn=!0)),cg?(cg=!1,n=!0):n=!1,n&&(l=X(l)||"Unknown",Y0.has(l)||Ay.has(l)||(Y0.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 Lc(n,l,o,c){Oe=n;var f=0;do{if(lm&&(Gi=null),kh=0,lm=!1,f>=_v)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(f+=1,Bh=!1,fn=gt=null,n.updateQueue!=null){var m=n.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}Yi=-1,W.H=Gr,m=Ry(l,o,c)}while(lm);return m}function kd(){var n=W.H,l=n.useState()[0];return l=typeof l.then=="function"?xa(l):l,n=n.useState()[0],(gt!==null?gt.memoizedState:null)!==n&&(Oe.flags|=1024),l}function du(){var n=fg!==0;return fg=0,n}function Hc(n,l,o){l.updateQueue=n.updateQueue,l.flags=(l.mode&Ls)!==Tt?l.flags&-201328645:l.flags&-2053,n.lanes&=~o}function ha(n){if(dg){for(n=n.memoizedState;n!==null;){var l=n.queue;l!==null&&(l.pending=null),n=n.next}dg=!1}sc=0,Ka=fn=gt=Oe=null,Yi=-1,F=null,lm=!1,kh=fg=0,Gi=null}function Hn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?Oe.memoizedState=fn=n:fn=fn.next=n,fn}function tt(){if(gt===null){var n=Oe.alternate;n=n!==null?n.memoizedState:null}else n=gt.next;var l=fn===null?Oe.memoizedState:fn.next;if(l!==null)fn=l,gt=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.");gt=n,n={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},fn===null?Oe.memoizedState=fn=n:fn=fn.next=n}return fn}function xa(n){var l=kh;return kh+=1,Gi===null&&(Gi=Vm()),n=hx(Gi,n,l),l=Oe,(fn===null?l.memoizedState:fn.next)===null&&(l=l.alternate,W.H=l!==null&&l.memoizedState!==null?ic:oc),n}function cs(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return xa(n);if(n.$$typeof===Rl)return yt(n)}throw Error("An unsupported type was passed to use(): "+String(n))}function an(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=Cy(),Oe.updateQueue=o),o.memoCache=l,o=l.data[l.index],o===void 0||Bh)for(o=l.data[l.index]=Array(n),c=0;c<n;c++)o[c]=Qx;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 kn(n,l){return typeof l=="function"?l(n):l}function Ps(n,l,o){var c=Hn();if(o!==void 0){var f=o(l);if(Vr){pt(!0);try{o(l)}finally{pt(!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=Pm.bind(null,Oe,n),[c.memoizedState,n]}function rs(n){var l=tt();return fu(l,gt,n)}function fu(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:(sc&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===Hr&&(I=!0);else if((sc&$)===$){w=w.next,$===Hr&&(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|=$,rc|=$;ae=w.action,Vr&&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,rc|=ae;w=w.next}while(w!==null&&w!==l);if(k===null?b=m:k.next=E,!Al(m,n.memoizedState)&&(zn=!0,I&&(o=tm,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 Bn(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);Al(m,l.memoizedState)||(zn=!0),l.memoizedState=m,l.baseQueue===null&&(l.baseState=m),o.lastRenderedState=m}return[m,c]}function Pn(n,l,o){var c=Oe,f=Hn();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();nm||m===o()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),nm=!0)}else{if(m=l(),nm||(o=l(),Al(m,o)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),nm=!0)),Rt===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");Je&60||ya(c,l,m)}return f.memoizedState=m,o={value:m,getSnapshot:l},f.queue=o,lo(eo.bind(null,c,o,n),[n]),c.flags|=2048,ii($a|Sn,ba.bind(null,c,o,m,l),{destroy:void 0},null),m}function ga(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(),!nm){var b=l();Al(o,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),nm=!0)}(b=!Al((gt||f).memoizedState,o))&&(f.memoizedState=o,zn=!0),f=f.queue;var E=eo.bind(null,c,f,n);if(Jt(2048,Sn,E,[n]),f.getSnapshot!==l||b||fn!==null&&fn.memoizedState.tag&$a){if(c.flags|=2048,ii($a|Sn,ba.bind(null,c,f,o,l),{destroy:void 0},null),Rt===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");m||sc&60||ya(c,l,o)}return o}function ya(n,l,o){n.flags|=16384,n={getSnapshot:l,value:o},l=Oe.updateQueue,l===null?(l=Cy(),Oe.updateQueue=l,l.stores=[n]):(o=l.stores,o===null?l.stores=[n]:o.push(n))}function ba(n,l,o,c){l.value=o,l.getSnapshot=c,Qm(l)&&Bd(n)}function eo(n,l,o){return o(function(){Qm(l)&&Bd(n)})}function Qm(n){var l=n.getSnapshot;n=n.value;try{var o=l();return!Al(n,o)}catch{return!0}}function Bd(n){var l=gn(n,2);l!==null&&mt(l,n,2)}function Uc(n){var l=Hn();if(typeof n=="function"){var o=n;if(n=o(),Vr){pt(!0);try{o()}finally{pt(!1)}}}return l.memoizedState=l.baseState=n,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:n},l}function bn(n){n=Uc(n);var l=n.queue,o=bu.bind(null,Oe,l);return l.dispatch=o,[n.memoizedState,o]}function Kt(n){var l=Hn();l.memoizedState=l.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=o,l=Xc.bind(null,Oe,!0,o),o.dispatch=l,[n,l]}function Pe(n,l){var o=tt();return Nl(o,gt,n,l)}function Nl(n,l,o,c){return n.baseState=o,fu(n,gt,typeof c=="function"?c:kn)}function $l(n,l){var o=tt();return gt!==null?Nl(o,gt,n,l):(o.baseState=n,[n,o.queue.dispatch])}function Zm(n,l,o,c,f){if(ps(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,to(l,m)):(m.next=o.next,l.pending=o.next=m)}}function to(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),Im(n,l,E)}catch(w){si(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),Im(n,l,b)}catch(w){si(n,l,w)}}function Im(n,l,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?(o.then(function(c){$m(n,l,c)},function(c){return si(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`")):$m(n,l,o)}function $m(n,l,o){l.status="fulfilled",l.value=o,mu(l),n.state=o,l=n.pending,l!==null&&(o=l.next,o===l?n.pending=null:(o=o.next,l.next=o,to(n,o)))}function si(n,l,o){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do l.status="rejected",l.reason=o,mu(l),l=l.next;while(l!==c)}n.action=null}function mu(n){n=n.listeners;for(var l=0;l<n.length;l++)(0,n[l])()}function pu(n,l){return l}function va(n,l){if(et){var o=Rt.formState;if(o!==null){e:{var c=Oe;if(et){if(Xn){t:{for(var f=Xn,m=No;f.nodeType!==8;){if(!m){f=null;break t}if(f=tl(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m===Py||m===wb?f:null}if(f){Xn=tl(f.nextSibling),c=f.data===Py;break e}}Zl(c)}c=!1}c&&(l=o[0])}}return o=Hn(),o.memoizedState=o.baseState=l,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pu,lastRenderedState:l},o.queue=c,o=bu.bind(null,Oe,c),c.dispatch=o,c=Uc(!1),m=Xc.bind(null,Oe,!1,c.queue),c=Hn(),f={state:l,dispatch:null,action:n,pending:null},c.queue=f,o=Zm.bind(null,Oe,f,m,o),f.dispatch=o,c.memoizedState=n,[l,o,!1]}function Vc(n){var l=tt();return wd(l,gt,n)}function wd(n,l,o){l=fu(n,l,pu)[0],n=rs(kn)[0],l=typeof l=="object"&&l!==null&&typeof l.then=="function"?xa(l):l;var c=tt(),f=c.queue,m=f.dispatch;return o!==c.memoizedState&&(Oe.flags|=2048,ii($a|Sn,Rx.bind(null,f,o),{destroy:void 0},null)),[l,m,n]}function Rx(n,l){n.action=l}function oi(n){var l=tt(),o=gt;if(o!==null)return wd(l,o,n);tt(),l=l.memoizedState,o=tt();var c=o.queue.dispatch;return o.memoizedState=n,[l,c,!1]}function ii(n,l,o,c){return n={tag:n,create:l,inst:o,deps:c,next:null},l=Oe.updateQueue,l===null&&(l=Cy(),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 ui(n){var l=Hn();return n={current:n},l.memoizedState=n}function no(n,l,o,c){var f=Hn();Oe.flags|=n,f.memoizedState=ii($a|l,o,{destroy:void 0},c===void 0?null:c)}function Jt(n,l,o,c){var f=tt();c=c===void 0?null:c;var m=f.memoizedState.inst;gt!==null&&c!==null&&dl(c,gt.memoizedState.deps)?f.memoizedState=ii(l,o,m,c):(Oe.flags|=n,f.memoizedState=ii($a|l,o,m,c))}function lo(n,l){(Oe.mode&Ls)!==Tt&&(Oe.mode&R0)===Tt?no(142608384,Sn,n,l):no(8390656,Sn,n,l)}function hu(n,l){var o=4194308;return(Oe.mode&Ls)!==Tt&&(o|=67108864),no(o,Qn,n,l)}function xu(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 gu(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&Ls)!==Tt&&(c|=67108864),no(c,Qn,xu.bind(null,l,n),o)}function qc(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,Jt(4,Qn,xu.bind(null,l,n),o)}function Dd(n,l){return Hn().memoizedState=[n,l===void 0?null:l],n}function Ra(n,l){var o=tt();l=l===void 0?null:l;var c=o.memoizedState;return l!==null&&dl(l,c[1])?c[0]:(o.memoizedState=[n,l],n)}function Md(n,l){var o=Hn();l=l===void 0?null:l;var c=n();if(Vr){pt(!0);try{n()}finally{pt(!1)}}return o.memoizedState=[c,l],c}function ds(n,l){var o=tt();l=l===void 0?null:l;var c=o.memoizedState;if(l!==null&&dl(l,c[1]))return c[0];if(c=n(),Vr){pt(!0);try{n()}finally{pt(!1)}}return o.memoizedState=[c,l],c}function yu(n,l){var o=Hn();return Gc(o,n,l)}function Km(n,l){var o=tt();return fl(o,gt.memoizedState,n,l)}function _d(n,l){var o=tt();return gt===null?Gc(o,n,l):fl(o,gt.memoizedState,n,l)}function Gc(n,l,o){return o===void 0||sc&1073741824?n.memoizedState=l:(n.memoizedState=o,n=lf(),Oe.lanes|=n,rc|=n,o)}function fl(n,l,o,c){return Al(o,l)?o:Pf.current!==null?(n=Gc(n,o,c),Al(n,l)||(zn=!0),n):sc&42?(n=lf(),Oe.lanes|=n,rc|=n,l):(zn=!0,n.memoizedState=o)}function Kl(n,l,o,c,f){var m=xt.p;xt.p=m!==0&&m<Hl?m:Hl;var b=W.T,E={};W.T=E,Xc(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=bx(k,c);ms(n,l,I,Un(n))}else ms(n,l,c,Un(n))}catch(ae){ms(n,l,{then:function(){},status:"rejected",reason:ae},Un(n))}finally{xt.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 Ea(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=Jm(n).queue;Kl(n,f,l,Pr,o===null?O:function(){return fs(n),o(c)})}function Jm(n){var l=n.memoizedState;if(l!==null)return l;l={memoizedState:Pr,baseState:Pr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:Pr},next:null};var o={};return l.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:o},next:null},n.memoizedState=l,n=n.alternate,n!==null&&(n.memoizedState=l),l}function fs(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=Jm(n).next.queue;ms(n,l,{},Un(n))}function Jl(){var n=Uc(!1);return n=Kl.bind(null,Oe,n.queue,!0,!1),Hn().memoizedState=n,[!1,n]}function qt(){var n=rs(kn)[0],l=tt().memoizedState;return[typeof n=="boolean"?n:xa(n),l]}function Yc(){var n=Bn(kn)[0],l=tt().memoizedState;return[typeof n=="boolean"?n:xa(n),l]}function ci(){return yt(Xh)}function Wm(){var n=Hn(),l=Rt.identifierPrefix;if(et){var o=Vi,c=Ui;o=(c&~(1<<32-On(c)-1)).toString(32)+o,l=":"+l+"R"+o,o=fg++,0<o&&(l+="H"+o.toString(32)),l+=":"}else o=Mv++,l=":"+l+"r"+o.toString(32)+":";return n.memoizedState=l}function Fm(){return Hn().memoizedState=Wt.bind(null,Oe)}function Wt(n,l){for(var o=n.return;o!==null;){switch(o.tag){case 24:case 3:var c=Un(o);n=ys(c);var f=bs(o,n,c);f!==null&&(mt(f,o,c),Fc(f,o,c)),o=us(),l!=null&&f!==null&&console.error("The seed argument is not enabled outside experimental channels."),n.payload={cache:o};return}o=o.return}}function Pm(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=Un(n),o={lane:c,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},ps(n)?ri(l,o):(o=_m(n,l,o,c),o!==null&&(mt(o,n,c),Ex(o,l,c))),In(n,c)}function bu(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=Un(n),ms(n,l,o,c),In(n,c)}function ms(n,l,o,c){var f={lane:c,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(ps(n))ri(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=kl;try{var E=l.lastRenderedState,k=m(E,o);if(f.hasEagerState=!0,f.eagerState=k,Al(k,E))return vd(n,l,f,0),Rt===null&&bd(),!1}catch{}finally{W.H=b}}if(o=_m(n,l,f,c),o!==null)return mt(o,n,c),Ex(o,l,c),!0}return!1}function Xc(n,l,o,c){if(W.T===null&&Hr===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:df(),action:c,hasEagerState:!1,eagerState:null,next:null},ps(n)){if(l)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else l=_m(n,o,c,2),l!==null&&mt(l,n,2);In(n,2)}function ps(n){var l=n.alternate;return n===Oe||l!==null&&l===Oe}function ri(n,l){lm=dg=!0;var o=n.pending;o===null?l.next=l:(l.next=o.next,o.next=l),n.pending=l}function Ex(n,l,o){if(o&4194176){var c=l.lanes;c&=n.pendingLanes,o|=c,l.lanes=o,$n(n,o)}}function Nd(n){if(n!==null&&typeof n!="function"){var l=String(n);tb.has(l)||(tb.add(l),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",n))}}function ep(n,l,o,c){var f=n.memoizedState,m=o(c,f);if(n.mode&sl){pt(!0);try{m=o(c,f)}finally{pt(!1)}}m===void 0&&(l=te(l)||"Component",W0.has(l)||(W0.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 tp(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&sl){pt(!0);try{o=E.shouldComponentUpdate(c,m,b)}finally{pt(!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?!Tc(o,c)||!Tc(f,m):!0}function ao(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",Z0.has(n)||(Z0.add(n),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",n)),Ty.enqueueReplaceState(l,l.state,null))}function hs(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 Qc(n,l){mg(n),n=am?"An error occurred in the <"+am+"> 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 np(n,l){var o=am?"The above error occurred in the <"+am+"> 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, "+((ky||"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"?Yu("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 xs(n){mg(n)}function ze(n,l){try{am=l.source?X(l.source):null,ky=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{am=o.source?X(o.source):null,ky=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 Nt(n,l,o){return o=ys(o),o.tag=_y,o.payload={element:null},o.callback=function(){se(l.source,ze,n,l)},o}function vu(n){return n=ys(n),n.tag=_y,n}function so(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(){fx(o),se(c.source,st,l,o,c)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(n.callback=function(){fx(o),se(c.source,st,l,o,c),typeof f!="function"&&(fc===null?fc=new Set([this]):fc.add(this)),Cv(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 di(n,l,o,c,f){if(o.flags|=32768,Gn&&jt(n,f),c!==null&&typeof c=="object"&&typeof c.then=="function"){if(l=o.alternate,l!==null&&Jc(l,o,f,!0),et&&(qi=!0),o=Za.current,o!==null){switch(o.tag){case 13:return Oo===null?ur():o.alternate===null&&Xt===Zi&&(Xt=Ly),o.flags&=-257,o.flags|=65536,o.lanes=f,c===vy?o.flags|=16384:(l=o.updateQueue,l===null?o.updateQueue=new Set([c]):l.add(c),ea(n,c,f)),!1;case 22:return o.flags|=65536,c===vy?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)),ea(n,c,f)),!1}throw Error("Unexpected Suspense handler tag ("+o.tag+"). This is a bug in React.")}return ea(n,c,f),ur(),!1}if(et)return qi=!0,l=Za.current,l!==null?(!(l.flags&65536)&&(l.flags|=256),l.flags|=65536,l.lanes=f,c!==by&&ti(Wn(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!==by&&ti(Wn(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=Wn(c,o),f=Nt(n.stateNode,c,f),Pc(n,f),Xt!==Yr&&(Xt=rm)),!1;var m=Wn(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(zh===null?zh=[m]:zh.push(m),Xt!==Yr&&(Xt=rm),l===null)return!0;c=Wn(c,o),o=l;do{switch(o.tag){case 3:return o.flags|=65536,n=f&-f,o.lanes|=n,n=Nt(o.stateNode,c,n),Pc(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"&&(fc===null||!fc.has(m))))return o.flags|=65536,f&=-f,o.lanes|=f,f=vu(f),so(f,n,o,c),Pc(o,f),!1}o=o.return}while(o!==null);return!1}function Gt(n,l,o,c){l.child=n===null?V0(l,null,o,c):Lr(l,n.child,o,c)}function Ru(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 oo(l),Uo(l),c=Fn(n,l,o,b,m,f),E=du(),Ys(),n!==null&&!zn?(Hc(n,l,f),Wl(n,l,f)):(et&&E&&Hm(l),l.flags|=1,Gt(n,l,c,f),l.child)}function fi(n,l,o,c,f){if(n===null){var m=o.type;return typeof m=="function"&&!lr(m)&&m.defaultProps===void 0&&o.compare===null?(o=Wo(m),l.tag=15,l.type=o,Zc(l,m),jx(n,l,o,c,f)):(n=ef(o.type,null,c,l,l.mode,f),n.ref=l.ref,n.return=l,l.child=n)}if(m=n.child,!Vd(n,f)){var b=m.memoizedProps;if(o=o.compare,o=o!==null?o:Tc,o(b,c)&&n.ref===l.ref)return Wl(n,l,f)}return l.flags|=1,n=Ca(m,c),n.ref=l.ref,n.return=l,l.child=n}function jx(n,l,o,c,f){if(n!==null){var m=n.memoizedProps;if(Tc(m,c)&&n.ref===l.ref&&l.type===n.type)if(zn=!1,l.pendingProps=c=m,Vd(n,f))n.flags&131072&&(zn=!0);else return l.lanes=n.lanes,Wl(n,l,f)}return zd(n,l,o,c,f)}function Ot(n,l,o){var c=l.pendingProps,f=c.children,m=(l.stateNode._pendingVisibility&_r)!==0,b=n!==null?n.memoizedState:null;if(mi(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 Od(n,l,c,o)}if(o&536870912)l.memoizedState={baseLanes:0,cachePool:null},n!==null&&Oc(l,b!==null?b.cachePool:null),b!==null?Ad(l,b):Ym(l),Cd(l);else return l.lanes=l.childLanes=536870912,Od(n,l,b!==null?b.baseLanes|o:o,o)}else b!==null?(Oc(l,b.cachePool),Ad(l,b),Ml(l),l.memoizedState=null):(n!==null&&Oc(l,null),Ym(l),Ml(l));return Gt(n,l,f,o),l.child}function Od(n,l,o,c){var f=Td();return f=f===null?null:{parent:An._currentValue,pool:f},l.memoizedState={baseLanes:o,cachePool:f},n!==null&&Oc(l,null),Ym(l),Cd(l),n!==null&&Jc(n,l,c,!0),null}function mi(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 zd(n,l,o,c,f){if(o.prototype&&typeof o.prototype.render=="function"){var m=te(o)||"Unknown";lb[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),lb[m]=!0)}return l.mode&sl&&Hs.recordLegacyContextWarning(l,null),n===null&&(Zc(l,l.type),o.contextTypes&&(m=te(o)||"Unknown",sb[m]||(sb[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)))),oo(l),Uo(l),o=Fn(n,l,o,c,void 0,f),c=du(),Ys(),n!==null&&!zn?(Hc(n,l,f),Wl(n,l,f)):(et&&c&&Hm(l),l.flags|=1,Gt(n,l,o,f),l.child)}function lp(n,l,o,c,f,m){return oo(l),Uo(l),Yi=-1,Bh=n!==null&&n.type!==l.type,l.updateQueue=null,o=Lc(l,c,o,f),ai(n,l),c=du(),Ys(),n!==null&&!zn?(Hc(n,l,m),Wl(n,l,m)):(et&&c&&Hm(l),l.flags|=1,Gt(n,l,o,m),l.child)}function Sx(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=Rt,b===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");E=vu(E),so(E,b,l,Wn(m,l)),Pc(l,E)}if(oo(l),l.stateNode===null){if(b=lc,m=o.contextType,"contextType"in o&&m!==null&&(m===void 0||m.$$typeof!==Rl)&&!eb.has(o)&&(eb.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===vr?" 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=yt(m)),m=new o(c,b),l.mode&sl){pt(!0);try{m=new o(c,b)}finally{pt(!1)}}if(b=l.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Ty,l.stateNode=m,m._reactInternals=l,m._reactInternalInstance=Q0,typeof o.getDerivedStateFromProps=="function"&&b===null&&(b=te(o)||"Component",I0.has(b)||(I0.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()";K0.has(m)||(K0.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&&!P0.has(o)&&(P0.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&&!F0.has(o)&&(F0.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"||$0.has(o)||($0.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"||Rn(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={},Yd(l),b=o.contextType,m.context=typeof b=="object"&&b!==null?yt(b):lc,m.state===c&&(b=te(o)||"Component",J0.has(b)||(J0.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&sl&&Hs.recordLegacyContextWarning(l,m),Hs.recordUnsafeLifecycleWarnings(l,m),m.state=l.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(ep(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"),Ty.enqueueReplaceState(m,m.state,null)),Cu(l,c,m,f),Aa(),m.state=l.memoizedState),typeof m.componentDidMount=="function"&&(l.flags|=4194308),(l.mode&Ls)!==Tt&&(l.flags|=67108864),m=!0}else if(n===null){m=l.stateNode;var I=l.memoizedProps;E=hs(o,I),m.props=E;var ae=m.context;k=o.contextType,b=lc,typeof k=="object"&&k!==null&&(b=yt(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)&&ao(l,m,c,b),cc=!1;var $=l.memoizedState;m.state=$,Cu(l,c,m,f),Aa(),ae=l.memoizedState,I||$!==ae||cc?(typeof w=="function"&&(ep(l,o,w,c),ae=l.memoizedState),(E=cc||tp(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&Ls)!==Tt&&(l.flags|=67108864)):(typeof m.componentDidMount=="function"&&(l.flags|=4194308),(l.mode&Ls)!==Tt&&(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&Ls)!==Tt&&(l.flags|=67108864),m=!1)}else{m=l.stateNode,Xd(n,l),b=l.memoizedProps,k=hs(o,b),m.props=k,w=l.pendingProps,$=m.context,ae=o.contextType,E=lc,typeof ae=="object"&&ae!==null&&(E=yt(ae)),I=o.getDerivedStateFromProps,(ae=typeof I=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==w||$!==E)&&ao(l,m,c,E),cc=!1,$=l.memoizedState,m.state=$,Cu(l,c,m,f),Aa();var ce=l.memoizedState;b!==w||$!==ce||cc||n!==null&&n.dependencies!==null&&Wc(n.dependencies)?(typeof I=="function"&&(ep(l,o,I,c),ce=l.memoizedState),(k=cc||tp(l,o,k,c,$,ce,E)||n!==null&&n.dependencies!==null&&Wc(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,mi(n,l),b=(l.flags&128)!==0,E||b){if(E=l.stateNode,W.getCurrentStack=l===null?null:je,El=!1,_n=l,b&&typeof o.getDerivedStateFromError!="function")o=null,Ul=-1;else{if(Uo(l),o=C0(E),l.mode&sl){pt(!0);try{C0(E)}finally{pt(!1)}}Ys()}l.flags|=1,n!==null&&b?(l.child=Lr(l,n.child,null,f),l.child=Lr(l,null,o,f)):Gt(n,l,o,f),l.memoizedState=E.state,n=l.child}else n=Wl(n,l,f);return f=l.stateNode,m&&f.props!==c&&(sm||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"),sm=!0),n}function Ld(n,l,o,c){return ru(),l.flags|=256,Gt(n,l,o,c),l.child}function Zc(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",ob[n]||(console.error("%s: Function components do not support getDerivedStateFromProps.",n),ob[n]=!0)),typeof l.contextType=="object"&&l.contextType!==null&&(l=te(l)||"Unknown",ab[l]||(console.error("%s: Function components do not support contextType.",l),ab[l]=!0))}function Ic(n){return{baseLanes:n,cachePool:vx()}}function wn(n,l,o){return n=n!==null?n.childLanes&~o:0,l&&(n|=ca),n}function Ut(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:(jn.current&Ch)!==0),c&&(m=!0,l.flags&=-129),c=(l.flags&32)!==0,l.flags&=-33,n===null){if(et){if(m?rl(l):Ml(l),et){var E=Xn,k;if(!(k=!E)){e:{var w=E;for(k=No;w.nodeType!==8;){if(!k){k=null;break e}if(w=tl(w.nextSibling),w===null){k=null;break e}}k=w}k!==null?(Js(),l.memoizedState={dehydrated:k,treeContext:zr!==null?{id:Ui,overflow:Vi}:null,retryLane:536870912},w=j(18,null,null,Tt),w.stateNode=k,w.return=l,l.child=w,Cl=l,Xn=null,k=!0):k=!1,k=!k}k&&(ei(l,E),Zl(l))}if(E=l.memoizedState,E!==null&&(E=E.dehydrated,E!==null))return E.data===Wr?l.lanes=16:l.lanes=536870912,null;Il(l)}return E=f.children,f=f.fallback,m?(Ml(l),m=l.mode,E=pi({mode:"hidden",children:E},m),f=js(f,m,o,null),E.return=l,f.return=l,E.sibling=f,l.child=E,m=l.child,m.memoizedState=Ic(o),m.childLanes=wn(n,c,o),l.memoizedState=wy,f):(rl(l),Eu(l,E))}var I=n.memoizedState;if(I!==null&&(E=I.dehydrated,E!==null)){if(b)l.flags&256?(rl(l),l.flags&=-257,l=ju(n,l,o)):l.memoizedState!==null?(Ml(l),l.child=n.child,l.flags|=128,l=null):(Ml(l),m=f.fallback,E=l.mode,f=pi({mode:"visible",children:f.children},E),m=js(m,E,o,null),m.flags|=2,f.return=l,m.return=l,f.sibling=m,l.child=f,Lr(l,n.child,null,o),f=l.child,f.memoizedState=Ic(o),f.childLanes=wn(n,c,o),l.memoizedState=wy,l=m);else if(rl(l),et&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug."),E.data===Wr){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"&&yy.set(m,f),ti(f),l=ju(n,l,o)}else if(zn||Jc(n,l,o,!1),c=(o&n.childLanes)!==0,zn||c){if(c=Rt,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,gn(n,f),mt(c,n,f),nb}E.data===Jr||ur(),l=ju(n,l,o)}else E.data===Jr?(l.flags|=128,l.child=n.child,l=_x.bind(null,n),E._reactRetry=l,l=null):(n=I.treeContext,Xn=tl(E.nextSibling),Cl=l,et=!0,Us=null,qi=!1,Qa=null,No=!1,n!==null&&(Js(),Ya[Xa++]=Ui,Ya[Xa++]=Vi,Ya[Xa++]=zr,Ui=n.id,Vi=n.overflow,zr=l),l=Eu(l,f.children),l.flags|=4096);return l}return m?(Ml(l),m=f.fallback,E=l.mode,k=n.child,w=k.sibling,f=Ca(k,{mode:"hidden",children:f.children}),f.subtreeFlags=k.subtreeFlags&31457280,w!==null?m=Ca(w,m):(m=js(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=Ic(o):(k=E.cachePool,k!==null?(w=An._currentValue,k=k.parent!==w?{parent:w,pool:w}:k):k=vx(),E={baseLanes:E.baseLanes|o,cachePool:k}),m.memoizedState=E,m.childLanes=wn(n,c,o),l.memoizedState=wy,f):(rl(l),o=n.child,n=o.sibling,o=Ca(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 Eu(n,l){return l=pi({mode:"visible",children:l},n.mode),l.return=n,n.child=l}function pi(n,l){return tf(n,l,0,null)}function ju(n,l,o){return Lr(l,n.child,null,o),n=Eu(l,l.pendingProps.children),n.flags|=2,l.memoizedState=null,n}function Hd(n,l,o){n.lanes|=l;var c=n.alternate;c!==null&&(c.lanes|=l),Kc(n.return,l,o)}function ja(n,l){var o=Rn(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 Su(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 Ud(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"&&!ib[f])if(ib[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||By[m]||(m!=="collapsed"&&m!=="hidden"?(By[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"&&(By[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(Rn(c)){for(var b=0;b<c.length;b++)if(!ja(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(!ja(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(Gt(n,l,c,o),c=jn.current,c&Ch)c=c&em|Ch,l.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=l.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Hd(n,o,l);else if(n.tag===19)Hd(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&=em}switch(qe(jn,c,l),f){case"forwards":for(o=l.child,f=null;o!==null;)n=o.alternate,n!==null&&Nc(n)===null&&(f=o),o=o.sibling;o=f,o===null?(f=l.child,l.child=null):(f=o.sibling,o.sibling=null),Su(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&&Nc(n)===null){l.child=f;break}n=f.sibling,f.sibling=o,o=f,f=n}Su(l,!0,o,null,m);break;case"together":Su(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Wl(n,l,o){if(n!==null&&(l.dependencies=n.dependencies),Ul=-1,rc|=l.lanes,!(o&l.childLanes))if(n!==null){if(Jc(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=Ca(n,n.pendingProps),l.child=o,o.return=l;n.sibling!==null;)n=n.sibling,o=o.sibling=Ca(n,n.pendingProps),o.return=l;o.sibling=null}return l.child}function Vd(n,l){return n.lanes&l?!0:(n=n.dependencies,!!(n!==null&&Wc(n)))}function Ax(n,l,o){switch(l.tag){case 3:Ne(l,l.stateNode.containerInfo),gs(l,An,n.memoizedState.cache),ru();break;case 27:case 5:Gs(l);break;case 4:Ne(l,l.stateNode.containerInfo);break;case 10:gs(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?(rl(l),l.flags|=128,null):o&l.child.childLanes?Ut(n,l,o):(rl(l),n=Wl(n,l,o),n!==null?n.sibling:null);rl(l);break;case 19:var f=(n.flags&128)!==0;if(c=(o&l.childLanes)!==0,c||(Jc(n,l,o,!1),c=(o&l.childLanes)!==0),f){if(c)return Ud(n,l,o);l.flags|=128}if(f=l.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),qe(jn,jn.current,l),c)break;return null;case 22:case 23:return l.lanes=0,Ot(n,l,o);case 24:gs(l,An,n.memoizedState.cache)}return Wl(n,l,o)}function qd(n,l,o){if(l._debugNeedsRemount&&n!==null){o=ef(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)zn=!0;else{if(!Vd(n,o)&&!(l.flags&128))return zn=!1,Ax(n,l,o);zn=!!(n.flags&131072)}else zn=!1,(c=et)&&(Js(),c=(l.flags&1048576)!==0),c&&(c=l.index,Js(),mx(l,ig,c));switch(l.lanes=0,l.tag){case 16:e:if(c=l.pendingProps,n=ac(l.elementType),l.type=n,typeof n=="function")lr(n)?(c=hs(n,c),l.tag=1,l.type=n=Wo(n),l=Sx(null,l,n,c,o)):(l.tag=0,Zc(l,n),l.type=n=Wo(n),l=zd(null,l,n,c,o));else{if(n!=null){if(f=n.$$typeof,f===_i){l.tag=11,l.type=n=Nm(n),l=Ru(null,l,n,c,o);break e}else if(f===Eo){l.tag=14,l=fi(null,l,n,c,o);break e}}throw l="",n!==null&&typeof n=="object"&&n.$$typeof===Mn&&(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 zd(n,l,l.type,l.pendingProps,o);case 1:return c=l.type,f=hs(c,l.pendingProps),Sx(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,Xd(n,l),Cu(l,m,null,o);var b=l.memoizedState;if(m=b.cache,gs(l,An,m),m!==f.cache&&Gd(l,[An],o,!0),Aa(),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=Ld(n,l,m,o);break e}else if(m!==c){c=Wn(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),l),ti(c),l=Ld(n,l,m,o);break e}else for(Xn=tl(l.stateNode.containerInfo.firstChild),Cl=l,et=!0,Us=null,qi=!1,Qa=null,No=!0,n=V0(l,null,m,o),l.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ru(),m===c){l=Wl(n,l,o);break e}Gt(n,l,m,o)}l=l.child}return l;case 26:return mi(n,l),n===null?(n=Rf(l.type,null,l.pendingProps,null))?l.memoizedState=n:et||(n=l.type,o=l.pendingProps,c=Qt(dn.current),c=yf(c).createElement(n),c[En]=l,c[ll]=o,Bt(c,n,o),Zt(c),l.stateNode=c):l.memoizedState=Rf(l.type,n.memoizedProps,l.pendingProps,n.memoizedState),null;case 27:return Gs(l),n===null&&et&&(f=Qt(dn.current),c=Fa(),f=l.stateNode=Vu(l.type,l.pendingProps,f,c,!1),qi||(c=Hx(f,l.type,l.pendingProps,c),c!==null&&(Ws(l,0).serverProps=c)),Cl=l,No=!0,Xn=tl(f.firstChild)),c=l.pendingProps.children,n!==null||et?Gt(n,l,c,o):l.child=Lr(l,null,c,o),mi(n,l),l.child;case 5:return n===null&&et&&(m=Fa(),c=dd(l.type,m.ancestorInfo),f=Xn,(b=!f)||(b=pr(f,l.type,l.pendingProps,No),b!==null?(l.stateNode=b,qi||(m=Hx(b,l.type,l.pendingProps,m),m!==null&&(Ws(l,0).serverProps=m)),Cl=l,Xn=tl(b.firstChild),No=!1,m=!0):m=!1,b=!m),b&&(c&&ei(l,f),Zl(l))),Gs(l),f=l.type,m=l.pendingProps,b=n!==null?n.memoizedProps:null,c=m.children,rt(f,m)?c=null:b!==null&&rt(f,b)&&(l.flags|=32),l.memoizedState!==null&&(f=Fn(n,l,kd,null,null,o),Xh._currentValue=f),mi(n,l),Gt(n,l,c,o),l.child;case 6:return n===null&&et&&(n=l.pendingProps,o=Fa().ancestorInfo.current,n=o!=null?jc(n,o.tag):!0,o=Xn,(c=!o)||(c=za(o,l.pendingProps,No),c!==null?(l.stateNode=c,Cl=l,Xn=null,c=!0):c=!1,c=!c),c&&(n&&ei(l,o),Zl(l))),null;case 13:return Ut(n,l,o);case 4:return Ne(l,l.stateNode.containerInfo),c=l.pendingProps,n===null?l.child=Lr(l,null,c,o):Gt(n,l,c,o),l.child;case 11:return Ru(n,l,l.type,l.pendingProps,o);case 7:return Gt(n,l,l.pendingProps,o),l.child;case 8:return Gt(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,Gt(n,l,l.pendingProps.children,o),l.child;case 10:return c=l.type,f=l.pendingProps,m=f.value,"value"in f||ub||(ub=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),gs(l,c,m),Gt(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."),oo(l),f=yt(f),Uo(l),c=Ry(c,f,void 0),Ys(),l.flags|=1,Gt(n,l,c,o),l.child;case 14:return fi(n,l,l.type,l.pendingProps,o);case 15:return jx(n,l,l.type,l.pendingProps,o);case 19:return Ud(n,l,o);case 22:return Ot(n,l,o);case 24:return oo(l),c=yt(An),n===null?(f=Td(),f===null&&(f=Rt,m=us(),f.pooledCache=m,_l(m),m!==null&&(f.pooledCacheLanes|=o),f=m),l.memoizedState={parent:c,cache:f},Yd(l),gs(l,An,f)):(n.lanes&o&&(Xd(n,l),Cu(l,null,null,o),Aa()),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),gs(l,An,c)):(c=m.cache,gs(l,An,c),c!==f.cache&&Gd(l,[An],o,!0))),Gt(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 $c(){om=pg=null,im=!1}function gs(n,l,o){qe(Dy,l._currentValue,n),l._currentValue=o,qe(My,l._currentRenderer,n),l._currentRenderer!==void 0&&l._currentRenderer!==null&&l._currentRenderer!==cb&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),l._currentRenderer=cb}function Sa(n,l){n._currentValue=Dy.current;var o=My.current;Ve(My,l),n._currentRenderer=o,Ve(Dy,l)}function Kc(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 Gd(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),Kc(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),Kc(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 Jc(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;Al(f.pendingProps.value,b.value)||(n!==null?n.push(E):n=[E])}}else if(f===Tr.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(Xh):n=[Xh])}f=f.return}n!==null&&Gd(l,n,o,c),l.flags|=262144}function Wc(n){for(n=n.firstContext;n!==null;){if(!Al(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function oo(n){pg=n,om=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function yt(n){return im&&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()."),ap(pg,n)}function Au(n,l){return pg===null&&oo(n),ap(n,l)}function ap(n,l){var o=l._currentValue;if(l={context:l,memoizedValue:o,next:null},om===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().");om=l,n.dependencies={lanes:0,firstContext:l,_debugThenableState:null},n.flags|=524288}else om=om.next=l;return o}function Yd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xd(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 ys(n){return{lane:n,tag:rb,payload:null,callback:null,next:null}}function bs(n,l,o){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,Ny===c&&!mb){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),mb=!0}return(wt&Bl)!==ia?(f=c.pending,f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l,l=Rd(n),rx(n,null,o),l):(vd(n,c,l,o),Rd(n))}function Fc(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,$n(n,o)}}function Pc(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 Aa(){if(Oy){var n=tm;if(n!==null)throw n}}function Cu(n,l,o,c){Oy=!1;var f=n.updateQueue;cc=!1,Ny=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&&$===Hr&&(Oy=!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,nn=o;switch(Be.tag){case db:if(Be=Be.payload,typeof Be=="function"){im=!0;var ct=Be.call(nn,ae,Ye);if($.mode&sl){pt(!0);try{Be.call(nn,ae,Ye)}finally{pt(!1)}}im=!1,ae=ct;break e}ae=Be;break e;case _y:$.flags=$.flags&-65537|128;case rb:if(ct=Be.payload,typeof ct=="function"){if(im=!0,Be=ct.call(nn,ae,Ye),$.mode&sl){pt(!0);try{ct.call(nn,ae,Ye)}finally{pt(!1)}}im=!1}else Be=ct;if(Be==null)break e;ae=He({},ae,Be);break e;case fb:cc=!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),rc|=b,n.lanes=b,n.memoizedState=ae}Ny=null}function er(n,l){if(typeof n!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+n);n.call(l)}function Qd(n,l){var o=n.shared.hiddenCallbacks;if(o!==null)for(n.shared.hiddenCallbacks=null,n=0;n<o.length;n++)er(o[n],l)}function sp(n,l){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)er(o[n],l)}function Ol(n){return(n.mode&Yn)!==Tt}function op(n,l){Ol(n)?(Ql(),Tu(l,n),Xl()):Tu(l,n)}function Zd(n,l,o){Ol(n)?(Ql(),hi(o,n,l),Xl()):hi(o,n,l)}function Tu(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&Sn)!==Ia?Se!==null&&typeof Se.markComponentPassiveEffectMountStarted=="function"&&Se.markComponentPassiveEffectMountStarted(l):(n&Qn)!==Ia&&Se!==null&&typeof Se.markComponentLayoutEffectMountStarted=="function"&&Se.markComponentLayoutEffectMountStarted(l),c=void 0,(n&Tl)!==Ia&&(mm=!0),c=se(l,Tv,o),(n&Tl)!==Ia&&(mm=!1),(n&Sn)!==Ia?Se!==null&&typeof Se.markComponentPassiveEffectMountStopped=="function"&&Se.markComponentPassiveEffectMountStopped():(n&Qn)!==Ia&&Se!==null&&typeof Se.markComponentLayoutEffectMountStopped=="function"&&Se.markComponentLayoutEffectMountStopped(),c!==void 0&&typeof c!="function")){var m=void 0;m=o.tag&Qn?"useLayoutEffect":o.tag&Tl?"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,se(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 hi(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&Sn)!==Ia?Se!==null&&typeof Se.markComponentPassiveEffectUnmountStarted=="function"&&Se.markComponentPassiveEffectUnmountStarted(l):(n&Qn)!==Ia&&Se!==null&&typeof Se.markComponentLayoutEffectUnmountStarted=="function"&&Se.markComponentLayoutEffectUnmountStarted(l),(n&Tl)!==Ia&&(mm=!0),se(l,kv,l,o,E),(n&Tl)!==Ia&&(mm=!1),(n&Sn)!==Ia?Se!==null&&typeof Se.markComponentPassiveEffectUnmountStopped=="function"&&Se.markComponentPassiveEffectUnmountStopped():(n&Qn)!==Ia&&Se!==null&&typeof Se.markComponentLayoutEffectUnmountStopped=="function"&&Se.markComponentLayoutEffectUnmountStopped())}c=c.next}while(c!==m)}}catch(k){lt(l,l.return,k)}}function Id(n,l){Ol(n)?(Ql(),Tu(l,n),Xl()):Tu(l,n)}function $d(n,l,o){Ol(n)?(Ql(),hi(o,n,l),Xl()):hi(o,n,l)}function ip(n){var l=n.updateQueue;if(l!==null){var o=n.stateNode;n.type.defaultProps||"ref"in n.memoizedProps||sm||(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{se(n,sp,l,o)}catch(c){lt(n,n.return,c)}}}function up(n,l,o){return n.getSnapshotBeforeUpdate(l,o)}function Cx(n,l){var o=l.memoizedProps,c=l.memoizedState;l=n.stateNode,n.type.defaultProps||"ref"in n.memoizedProps||sm||(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=hs(n.type,o,n.elementType===n.type),m=se(n,up,l,f,c);o=pb,m!==void 0||o.has(n.type)||(o.add(n.type),se(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 cp(n,l,o){o.props=hs(n.type,n.memoizedProps),o.state=n.memoizedState,Ol(n)?(Ql(),se(n,M0,n,l,o),Xl()):se(n,M0,n,l,o)}function Ig(n){var l=n.ref;if(l!==null){var o=n.stateNode;if(typeof l=="function")if(Ol(n))try{Ql(),n.refCleanup=l(o)}finally{Xl()}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 vs(n,l){try{se(n,Ig,n)}catch(o){lt(n,l,o)}}function el(n,l){var o=n.ref,c=n.refCleanup;if(o!==null)if(typeof c=="function")try{if(Ol(n))try{Ql(),se(n,c)}finally{Xl(n)}else se(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(Ol(n))try{Ql(),se(n,o,null)}finally{Xl(n)}else se(n,o,null)}catch(f){lt(n,l,f)}else o.current=null}function rp(n,l,o,c){var f=n.memoizedProps,m=f.id,b=f.onCommit;f=f.onRender,l=l===null?"mount":"update",lg&&(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 dp(n,l,o,c){var f=n.memoizedProps;n=f.id,f=f.onPostCommit,l=l===null?"mount":"update",lg&&(l="nested-update"),typeof f=="function"&&f(n,l,c,o)}function fp(n){var l=n.type,o=n.memoizedProps,c=n.stateNode;try{se(n,ht,c,l,o,n)}catch(f){lt(n,n.return,f)}}function mp(n,l,o){try{se(n,bl,n.stateNode,n.type,o,l,n)}catch(c){lt(n,n.return,c)}}function Tx(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27||n.tag===4}function pp(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Tx(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 Kd(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=la));else if(c!==4&&c!==27&&(n=n.child,n!==null))for(Kd(n,l,o),n=n.sibling;n!==null;)Kd(n,l,o),n=n.sibling}function io(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(io(n,l,o),n=n.sibling;n!==null;)io(n,l,o),n=n.sibling}function hp(n){if(n.tag!==27){e:{for(var l=n.return;l!==null;){if(Tx(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=pp(n),io(n,o,l);break;case 5:l=o.stateNode,o.flags&32&&(Oa(l),o.flags&=-33),o=pp(n),io(n,o,l);break;case 3:case 4:l=o.stateNode.containerInfo,o=pp(n),Kd(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 Jd(n,l){if(n=n.containerInfo,e0=Ng,n=ux(n),yd(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(t0={focusedElem:n,selectionRange:o},Ng=!1,Ln=l;Ln!==null;)if(l=Ln,n=l.child,(l.subtreeFlags&1028)!==0&&n!==null)n.return=l,Ln=n;else for(;Ln!==null;){switch(n=l=Ln,o=n.alternate,f=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:f&1024&&o!==null&&Cx(n,o);break;case 3:if(f&1024){if(n=n.stateNode.containerInfo,o=n.nodeType,o===9)go(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":go(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,Ln=n;break}Ln=l.return}return l=xb,xb=!1,l}function xp(n,l,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Fl(n,o),c&4&&op(o,Qn|$a);break;case 1:if(Fl(n,o),c&4)if(n=o.stateNode,l===null)o.type.defaultProps||"ref"in o.memoizedProps||sm||(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")),Ol(o)?(Ql(),se(o,Ey,o,n),Xl()):se(o,Ey,o,n);else{var f=hs(o.type,l.memoizedProps);l=l.memoizedState,o.type.defaultProps||"ref"in o.memoizedProps||sm||(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")),Ol(o)?(Ql(),se(o,B0,o,n,f,l,n.__reactInternalSnapshotBeforeUpdate),Xl()):se(o,B0,o,n,f,l,n.__reactInternalSnapshotBeforeUpdate)}c&64&&ip(o),c&512&&vs(o,o.return);break;case 3:if(l=os(),Fl(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{se(o,sp,c,f)}catch(E){lt(o,o.return,E)}}n.effectDuration+=Ed(l);break;case 26:Fl(n,o),c&512&&vs(o,o.return);break;case 27:case 5:Fl(n,o),l===null&&c&4&&fp(o),c&512&&vs(o,o.return);break;case 12:if(c&4){c=os(),Fl(n,o),n=o.stateNode,n.effectDuration+=Fo(c);try{se(o,rp,o,l,ng,n.effectDuration)}catch(E){lt(o,o.return,E)}}else Fl(n,o);break;case 13:Fl(n,o),c&4&&Rs(n,o);break;case 22:if(f=o.memoizedState!==null||Xi,!f){l=l!==null&&l.memoizedState!==null||Yt;var m=Xi,b=Yt;Xi=f,(Yt=l)&&!b?Pl(n,o,(o.subtreeFlags&8772)!==0):Fl(n,o),Xi=m,Yt=b}c&512&&(o.memoizedProps.mode==="manual"?vs(o,o.return):el(o,o.return));break;default:Fl(n,o)}}function gp(n){var l=n.alternate;l!==null&&(n.alternate=null,gp(l)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(l=n.stateNode,l!==null&&es(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 sn(n,l,o){for(o=o.child;o!==null;)uo(n,l,o),o=o.sibling}function uo(n,l,o){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(Ju,o)}catch(m){qn||(qn=!0,console.error("React instrumentation encountered an error: %s",m))}switch(o.tag){case 26:Yt||el(o,l),sn(n,l,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Yt||el(o,l);var c=mn,f=oa;for(mn=o.stateNode,sn(n,l,o),o=o.stateNode,n=o.attributes;n.length;)o.removeAttributeNode(n[0]);es(o),mn=c,oa=f;break;case 5:Yt||el(o,l);case 6:if(c=mn,f=oa,mn=null,sn(n,l,o),mn=c,oa=f,mn!==null)if(oa)try{se(o,Ds,mn,o.stateNode)}catch(m){lt(o,l,m)}else try{se(o,_p,mn,o.stateNode)}catch(m){lt(o,l,m)}break;case 18:mn!==null&&(oa?(n=mn,o=o.stateNode,n.nodeType===8?Ct(n.parentNode,o):n.nodeType===1&&Ct(n,o),Zu(n)):Ct(mn,o.stateNode));break;case 4:c=mn,f=oa,mn=o.stateNode.containerInfo,oa=!0,sn(n,l,o),mn=c,oa=f;break;case 0:case 11:case 14:case 15:Yt||hi(Tl,o,l),Yt||Zd(o,l,Qn),sn(n,l,o);break;case 1:Yt||(el(o,l),c=o.stateNode,typeof c.componentWillUnmount=="function"&&cp(o,l,c)),sn(n,l,o);break;case 21:sn(n,l,o);break;case 22:Yt||el(o,l),Yt=(c=Yt)||o.memoizedState!==null,sn(n,l,o),Yt=c;break;default:sn(n,l,o)}}function Rs(n,l){if(l.memoizedState===null&&(n=l.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{se(l,Ti,n)}catch(o){lt(l,l.return,o)}}function xi(n){switch(n.tag){case 13:case 19:var l=n.stateNode;return l===null&&(l=n.stateNode=new hb),l;case 22:return n=n.stateNode,l=n._retryCache,l===null&&(l=n._retryCache=new hb),l;default:throw Error("Unexpected Suspense handler tag ("+n.tag+"). This is a bug in React.")}}function tr(n,l){var o=xi(n);l.forEach(function(c){var f=cn.bind(null,n,c);if(!o.has(c)){if(o.add(c),Gn)if(um!==null&&cm!==null)jt(cm,um);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");c.then(f,f)}})}function yp(n,l,o){um=o,cm=n,bp(l,n),cm=um=null}function ml(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:mn=E.stateNode,oa=!1;break e;case 3:mn=E.stateNode.containerInfo,oa=!0;break e;case 4:mn=E.stateNode.containerInfo,oa=!0;break e}E=E.return}if(mn===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");uo(f,m,b),mn=null,oa=!1,f=b,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)bp(l,n),l=l.sibling}function bp(n,l){var o=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:ml(l,n),on(n),c&4&&(hi(Tl|$a,n,n.return),Tu(Tl|$a,n),Zd(n,n.return,Qn|$a));break;case 1:ml(l,n),on(n),c&512&&(Yt||o===null||el(o,o.return)),c&64&&Xi&&(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=Vs;if(ml(l,n),on(n),c&512&&(Yt||o===null||el(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[ko]||f[En]||f.namespaceURI===Sl||f.hasAttribute("itemprop"))&&(f=l.createElement(c),l.head.insertBefore(f,l.querySelector("head > title"))),Bt(f,c,o),f[En]=n,Zt(f),c=f;break e;case"link":var m=Hp("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),Bt(f,c,o),l.head.appendChild(f);break;case"meta":if(m=Hp("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),Bt(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[En]=n,Zt(f),c=f}n.stateNode=c}else Up(f,n.type,n.stateNode);else n.stateNode=La(f,c,n.memoizedProps);else l!==c?(l===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):l.count--,c===null?Up(f,n.type,n.stateNode):La(f,c,n.memoizedProps)):c===null&&n.stateNode!==null&&mp(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[ko]||k==="HEAD"||k==="BODY"||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&b.rel.toLowerCase()==="stylesheet"||f.removeChild(b),b=E}se(n,Op,n.type,m,f,n)}catch(I){lt(n,n.return,I)}}case 5:if(ml(l,n),on(n),c&512&&(Yt||o===null||el(o,o.return)),n.flags&32){l=n.stateNode;try{se(n,Oa,l)}catch(I){lt(n,n.return,I)}}c&4&&n.stateNode!=null&&(l=n.memoizedProps,mp(n,l,o!==null?o.memoizedProps:l)),c&1024&&(zy=!0,n.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."));break;case 6:if(ml(l,n),on(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{se(n,Uu,l,o,c)}catch(I){lt(n,n.return,I)}}break;case 3:if(f=os(),Dg=null,m=Vs,Vs=qu(l.containerInfo),ml(l,n),Vs=m,on(n),c&4&&o!==null&&o.memoizedState.isDehydrated)try{se(n,vf,l.containerInfo)}catch(I){lt(n,n.return,I)}zy&&(zy=!1,nr(n)),l.effectDuration+=Ed(f);break;case 4:c=Vs,Vs=qu(n.stateNode.containerInfo),ml(l,n),on(n),Vs=c;break;case 12:c=os(),ml(l,n),on(n),n.stateNode.effectDuration+=Fo(c);break;case 13:ml(l,n),on(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Gy=Va()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,tr(n,c)));break;case 22:c&512&&(Yt||o===null||el(o,o.return)),b=n.memoizedState!==null,E=o!==null&&o.memoizedState!==null,k=Xi;var w=Yt;if(Xi=k||b,Yt=w||E,ml(l,n),Yt=w,Xi=k,on(n),l=n.stateNode,l._current=n,l._visibility&=~_r,l._visibility|=l._pendingVisibility&_r,c&8192&&(l._visibility=b?l._visibility&~gh:l._visibility|gh,b&&(l=Xi||Yt,o===null||E||l||Es(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?se(E,xo,f):se(E,Np,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?se(E,Ci,m):se(E,Ll,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,tr(n,o))));break;case 19:ml(l,n),on(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,tr(n,c)));break;case 21:break;default:ml(l,n),on(n)}}function on(n){var l=n.flags;if(l&2){try{se(n,hp,n)}catch(o){lt(n,n.return,o)}n.flags&=-3}l&4096&&(n.flags&=-4097)}function nr(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var l=n;nr(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),n=n.sibling}}function kx(n,l,o){um=o,cm=l,xp(l,n.alternate,n),cm=um=null}function Fl(n,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)xp(n,l.alternate,l),l=l.sibling}function vp(n){switch(n.tag){case 0:case 11:case 14:case 15:Zd(n,n.return,Qn),Es(n);break;case 1:el(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&cp(n,n.return,l),Es(n);break;case 26:case 27:case 5:el(n,n.return),Es(n);break;case 22:el(n,n.return),n.memoizedState===null&&Es(n);break;default:Es(n)}}function Es(n){for(n=n.child;n!==null;)vp(n),n=n.sibling}function Rp(n,l,o,c){var f=o.flags;switch(o.tag){case 0:case 11:case 15:Pl(n,o,c),op(o,Qn);break;case 1:if(Pl(n,o,c),l=o.stateNode,typeof l.componentDidMount=="function"&&se(o,Ey,o,l),l=o.updateQueue,l!==null){n=o.stateNode;try{se(o,Qd,l,n)}catch(m){lt(o,o.return,m)}}c&&f&64&&ip(o),vs(o,o.return);break;case 26:case 27:case 5:Pl(n,o,c),c&&l===null&&f&4&&fp(o),vs(o,o.return);break;case 12:if(c&&f&4){f=os(),Pl(n,o,c),c=o.stateNode,c.effectDuration+=Fo(f);try{se(o,rp,o,l,ng,c.effectDuration)}catch(m){lt(o,o.return,m)}}else Pl(n,o,c);break;case 13:Pl(n,o,c),c&&f&4&&Rs(n,o);break;case 22:o.memoizedState===null&&Pl(n,o,c),vs(o,o.return);break;default:Pl(n,o,c)}}function Pl(n,l,o){for(o=o&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;)Rp(n,l.alternate,l,o),l=l.sibling}function Wd(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&&_l(n),o!=null&&ni(o))}function Fd(n,l){n=null,l.alternate!==null&&(n=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==n&&(_l(l),n!=null&&ni(n))}function co(n,l,o,c){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Ep(n,l,o,c),l=l.sibling}function Ep(n,l,o,c){var f=l.flags;switch(l.tag){case 0:case 11:case 15:co(n,l,o,c),f&2048&&Id(l,Sn|$a);break;case 3:var m=os();co(n,l,o,c),f&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(_l(l),o!=null&&ni(o))),n.passiveEffectDuration+=Ed(m);break;case 12:if(f&2048){m=os(),co(n,l,o,c),n=l.stateNode,n.passiveEffectDuration+=Fo(m);try{se(l,dp,l,l.alternate,ng,n.passiveEffectDuration)}catch(b){lt(l,l.return,b)}}else co(n,l,o,c);break;case 23:break;case 22:m=l.stateNode,l.memoizedState!==null?m._visibility&Hi?co(n,l,o,c):ku(n,l):m._visibility&Hi?co(n,l,o,c):(m._visibility|=Hi,kt(n,l,o,c,(l.subtreeFlags&10256)!==0)),f&2048&&Wd(l.alternate,l);break;case 24:co(n,l,o,c),f&2048&&Fd(l.alternate,l);break;default:co(n,l,o,c)}}function kt(n,l,o,c,f){for(f=f&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;)un(n,l,o,c,f),l=l.sibling}function un(n,l,o,c,f){var m=l.flags;switch(l.tag){case 0:case 11:case 15:kt(n,l,o,c,f),Id(l,Sn);break;case 23:break;case 22:var b=l.stateNode;l.memoizedState!==null?b._visibility&Hi?kt(n,l,o,c,f):ku(n,l):(b._visibility|=Hi,kt(n,l,o,c,f)),f&&m&2048&&Wd(l.alternate,l);break;case 24:kt(n,l,o,c,f),f&&m&2048&&Fd(l.alternate,l);break;default:kt(n,l,o,c,f)}}function ku(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:ku(o,c),f&2048&&Wd(c.alternate,c);break;case 24:ku(o,c),f&2048&&Fd(c.alternate,c);break;default:ku(o,c)}l=l.sibling}}function gi(n){if(n.subtreeFlags&wh)for(n=n.child;n!==null;)jp(n),n=n.sibling}function jp(n){switch(n.tag){case 26:gi(n),n.flags&wh&&n.memoizedState!==null&&$g(Vs,n.memoizedState,n.memoizedProps);break;case 5:gi(n);break;case 3:case 4:var l=Vs;Vs=qu(n.stateNode.containerInfo),gi(n),Vs=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=wh,wh=16777216,gi(n),wh=l):gi(n));break;default:gi(n)}}function Sp(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 Bu(n){var l=n.deletions;if(n.flags&16){if(l!==null)for(var o=0;o<l.length;o++){var c=l[o];Ln=c,Cp(c,n)}Sp(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)wu(n),n=n.sibling}function wu(n){switch(n.tag){case 0:case 11:case 15:Bu(n),n.flags&2048&&$d(n,n.return,Sn|$a);break;case 3:var l=os();Bu(n),n.stateNode.passiveEffectDuration+=Ed(l);break;case 12:l=os(),Bu(n),n.stateNode.passiveEffectDuration+=Fo(l);break;case 22:l=n.stateNode,n.memoizedState!==null&&l._visibility&Hi&&(n.return===null||n.return.tag!==13)?(l._visibility&=~Hi,Du(n)):Bu(n);break;default:Bu(n)}}function Du(n){var l=n.deletions;if(n.flags&16){if(l!==null)for(var o=0;o<l.length;o++){var c=l[o];Ln=c,Cp(c,n)}Sp(n)}for(n=n.child;n!==null;)Ap(n),n=n.sibling}function Ap(n){switch(n.tag){case 0:case 11:case 15:$d(n,n.return,Sn),Du(n);break;case 22:var l=n.stateNode;l._visibility&Hi&&(l._visibility&=~Hi,Du(n));break;default:Du(n)}}function Cp(n,l){for(;Ln!==null;){var o=Ln,c=o;switch(c.tag){case 0:case 11:case 15:$d(c,l,Sn);break;case 23:case 22:c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(c=c.memoizedState.cachePool.pool,c!=null&&_l(c));break;case 24:ni(c.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,Ln=c;else e:for(o=n;Ln!==null;){c=Ln;var f=c.sibling,m=c.return;if(gp(c),c===o){Ln=null;break e}if(f!==null){f.return=m,Ln=f;break e}Ln=m}}}function Bx(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,gb||typeof Object.preventExtensions!="function"||Object.preventExtensions(this)}function lr(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Ca(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=Wo(n.type);break;case 1:o.type=Wo(n.type);break;case 11:o.type=Nm(n.type)}return o}function Pd(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 ef(n,l,o,c,f,m){var b=0,E=n;if(typeof n=="function")lr(n)&&(b=1),E=Wo(E);else if(typeof n=="string")b=Fa(),b=qx(n,o,b)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case Ha:return js(o.children,f,m,l);case kf:b=8,f|=sl,f|=Ls;break;case Bf: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|Yn),l.elementType=Bf,l.lanes=m,l.stateNode={effectDuration:0,passiveEffectDuration:0},l;case wf:return l=j(13,o,l,f),l.elementType=wf,l.lanes=m,l;case Rr:return l=j(19,o,l,f),l.elementType=Rr,l.lanes=m,l;case Ni:return tf(o,f,m,l);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case We:case Rl:b=10;break e;case vr:b=9;break e;case _i:b=11,E=Nm(E);break e;case Eo:b=14;break e;case Mn: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":Rn(n)?o="array":n!==void 0&&n.$$typeof===Ro?(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 Mu(n,l,o){return l=ef(n.type,n.key,n.props,n._owner,l,o),l._debugOwner=n._owner,l}function js(n,l,o,c){return n=j(7,n,c,l),n.lanes=o,n}function tf(n,l,o,c){n=j(22,n,c,l),n.elementType=Ni,n.lanes=o;var f={_visibility:gh,_pendingVisibility:gh,_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&_r)){var E=gn(b,2);E!==null&&(m._pendingVisibility|=_r,mt(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&_r){var E=gn(b,2);E!==null&&(m._pendingVisibility&=~_r,mt(E,b,2))}}};return n.stateNode=f,n}function nf(n,l,o){return n=j(6,n,null,l),n.lanes=o,n}function ar(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 Ta(n){n.flags|=4}function ka(n,l){if(l.type!=="stylesheet"||(l.state.loading&Ja)!==Fr)n.flags&=-16777217;else if(n.flags|=16777216,!Ef(l)){if(l=Za.current,l!==null&&((Je&4194176)===Je?Oo!==null:(Je&62914560)!==Je&&!(Je&536870912)||l!==Oo))throw Sh=vy,j0;n.flags|=8192}}function _u(n,l){l!==null&&(n.flags|=4),n.flags&16384&&(l=n.tag!==22?Fh():536870912,n.lanes|=l,Qr|=l)}function sr(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 bt(n){var l=n.alternate!==null&&n.alternate.child===n.child,o=0,c=0;if(l)if((n.mode&Yn)!==Tt){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&Yn)!==Tt){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 Tp(n,l,o){var c=l.pendingProps;switch(Um(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(l),null;case 1:return bt(l),null;case 3:return c=l.stateNode,o=null,n!==null&&(o=n.memoizedState.cache),l.memoizedState.cache!==o&&(l.flags|=2048),Sa(An,l),Mt(l),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(n===null||n.child===null)&&(cu(l)?(jd(),Ta(l)):n===null||n.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,Us!==null&&(Ss(Us),Us=null))),bt(l),null;case 26:return o=l.memoizedState,n===null?(Ta(l),o!==null?(bt(l),ka(l,o)):(bt(l),l.flags&=-16777217)):o?o!==n.memoizedState?(Ta(l),bt(l),ka(l,o)):(bt(l),l.flags&=-16777217):(n.memoizedProps!==c&&Ta(l),bt(l),l.flags&=-16777217),null;case 27:ol(l),o=Qt(dn.current);var f=l.type;if(n!==null&&l.stateNode!=null)n.memoizedProps!==c&&Ta(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 bt(l),null}n=Fa(),cu(l)?px(l):(n=Vu(f,c,o,n,!0),l.stateNode=n,Ta(l))}return bt(l),null;case 5:if(ol(l),o=l.type,n!==null&&l.stateNode!=null)n.memoizedProps!==c&&Ta(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 bt(l),null}if(f=Fa(),cu(l))px(l);else{switch(n=Qt(dn.current),dd(o,f.ancestorInfo),f=f.context,n=yf(n),f){case hm:n=n.createElementNS(Sl,o);break;case wg:n=n.createElementNS(Mo,o);break;default:switch(o){case"svg":n=n.createElementNS(Sl,o);break;case"math":n=n.createElementNS(Mo,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]"||Ua.call(Db,o)||(Db[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[En]=l,n[ll]=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(Bt(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&&Ta(l)}}return bt(l),l.flags&=-16777217,null;case 6:if(n&&l.stateNode!=null)n.memoizedProps!==c&&Ta(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=Qt(dn.current),o=Fa(),cu(l)){n=l.stateNode,c=l.memoizedProps,f=!qi,o=null;var m=Cl;if(m!==null)switch(m.tag){case 3:f&&(f=hr(n,c,o),f!==null&&(Ws(l,0).serverProps=f));break;case 27:case 5:o=m.memoizedProps,f&&(f=hr(n,c,o),f!==null&&(Ws(l,0).serverProps=f))}n[En]=l,n=!!(n.nodeValue===c||o!==null&&o.suppressHydrationWarning===!0||hf(n.nodeValue,c)),n||Zl(l)}else o=o.ancestorInfo.current,o!=null&&jc(c,o.tag),n=yf(n).createTextNode(c),n[En]=l,l.stateNode=n}return bt(l),null;case 13:if(c=l.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=cu(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[En]=l,bt(l),(l.mode&Yn)!==Tt&&c!==null&&(f=l.child,f!==null&&(l.treeBaseDuration-=f.treeBaseDuration))}else jd(),ru(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4,bt(l),(l.mode&Yn)!==Tt&&c!==null&&(f=l.child,f!==null&&(l.treeBaseDuration-=f.treeBaseDuration));f=!1}else Us!==null&&(Ss(Us),Us=null),f=!0;if(!f)return l.flags&256?(Il(l),l):(Il(l),null)}return Il(l),l.flags&128?(l.lanes=o,(l.mode&Yn)!==Tt&&kc(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),_u(l,l.updateQueue),bt(l),(l.mode&Yn)!==Tt&&c&&(n=l.child,n!==null&&(l.treeBaseDuration-=n.treeBaseDuration)),null);case 4:return Mt(l),n===null&&mf(l.stateNode.containerInfo),bt(l),null;case 10:return Sa(l.type,l),bt(l),null;case 19:if(Ve(jn,l),f=l.memoizedState,f===null)return bt(l),null;if(c=(l.flags&128)!==0,m=f.rendering,m===null)if(c)sr(f,!1);else{if(Xt!==Zi||n!==null&&n.flags&128)for(n=l.child;n!==null;){if(m=Nc(n),m!==null){for(l.flags|=128,sr(f,!1),n=m.updateQueue,l.updateQueue=n,_u(l,n),l.subtreeFlags=0,n=o,c=l.child;c!==null;)Pd(c,n),c=c.sibling;return qe(jn,jn.current&em|Ch,l),l.child}n=n.sibling}f.tail!==null&&Va()>gg&&(l.flags|=128,c=!0,sr(f,!1),l.lanes=4194304)}else{if(!c)if(n=Nc(m),n!==null){if(l.flags|=128,c=!0,n=n.updateQueue,l.updateQueue=n,_u(l,n),sr(f,!0),f.tail===null&&f.tailMode==="hidden"&&!m.alternate&&!et)return bt(l),null}else 2*Va()-f.renderingStartTime>gg&&o!==536870912&&(l.flags|=128,c=!0,sr(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=Va(),n.sibling=null,o=jn.current,o=c?o&em|Ch:o&em,qe(jn,o,l),n):(bt(l),null);case 22:case 23:return Il(l),Xm(l),c=l.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(l.flags|=8192):c&&(l.flags|=8192),c?o&536870912&&!(l.flags&128)&&(bt(l),l.subtreeFlags&6&&(l.flags|=8192)):bt(l),c=l.updateQueue,c!==null&&_u(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(Ur,l),null;case 24:return c=null,n!==null&&(c=n.memoizedState.cache),l.memoizedState.cache!==c&&(l.flags|=2048),Sa(An,l),bt(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 yi(n,l){switch(Um(l),l.tag){case 1:return n=l.flags,n&65536?(l.flags=n&-65537|128,(l.mode&Yn)!==Tt&&kc(l),l):null;case 3:return Sa(An,l),Mt(l),n=l.flags,n&65536&&!(n&128)?(l.flags=n&-65537|128,l):null;case 26:case 27:case 5:return ol(l),null;case 13:if(Il(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.");ru()}return n=l.flags,n&65536?(l.flags=n&-65537|128,(l.mode&Yn)!==Tt&&kc(l),l):null;case 19:return Ve(jn,l),null;case 4:return Mt(l),null;case 10:return Sa(l.type,l),null;case 22:case 23:return Il(l),Xm(l),n!==null&&Ve(Ur,l),n=l.flags,n&65536?(l.flags=n&-65537|128,(l.mode&Yn)!==Tt&&kc(l),l):null;case 24:return Sa(An,l),null;case 25:return null;default:return null}}function Ba(n,l){switch(Um(l),l.tag){case 3:Sa(An,l),Mt(l);break;case 26:case 27:case 5:ol(l);break;case 4:Mt(l);break;case 13:Il(l);break;case 19:Ve(jn,l);break;case 10:Sa(l.type,l);break;case 22:case 23:Il(l),Xm(l),n!==null&&Ve(Ur,l);break;case 24:Sa(An,l)}}function ro(){Ov.forEach(function(n){return n()})}function wa(){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 Un(n){if((wt&Bl)!==ia&&Je!==0)return Je&-Je;var l=W.T;return l!==null?(l._updatedFibers||(l._updatedFibers=new Set),l._updatedFibers.add(n),n=Hr,n!==0?n:df()):yc()}function lf(){ca===0&&(ca=!(Je&536870912)||et?Wh():536870912);var n=Za.current;return n!==null&&(n.flags|=32),ca}function mt(n,l,o){if(mm&&console.error("useInsertionEffect must not schedule updates."),Zy&&(bg=!0),(n===Rt&&Et===Xr||n.cancelPendingCommit!==null)&&(fo(n,0),Da(n,Je,ca,!1)),pn(n,o),wt&Bl&&n===Rt){if(El)switch(l.tag){case 0:case 11:case 15:n=Ke&&X(Ke)||"Unknown",Ab.has(n)||(Ab.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:Sb||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),Sb=!0)}}else Gn&&Ph(n,l,o),ks(l),n===Rt&&((wt&Bl)===ia&&(dc|=o),Xt===Yr&&Da(n,Je,ca,!1)),ta(n)}function or(n,l,o){if((wt&(Bl|Qi))!==ia)throw Error("Should not already be working.");var c=!o&&(l&60)===0&&(l&n.expiredLanes)===0||gc(n,l),f=c?rr(n,l):cr(n,l,!0),m=c;do{if(f===Zi){fm&&!c&&Da(n,l,0,!1);break}else if(f===hg)Da(n,l,0,!Ii);else{if(o=n.current.alternate,m&&!af(o)){f=cr(n,l,!1),m=!1;continue}if(f===rm){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=zh;var k=f.current.memoizedState.isDehydrated;if(k&&(fo(f,E).flags|=256),E=cr(f,E,!1),E!==rm){if(Vy&&!k){f.errorRecoveryDisabledLanes|=m,dc|=m,f=Yr;break e}f=qs,qs=b,f!==null&&Ss(f)}f=E}if(m=!1,f!==rm)continue}}if(f===Mh){fo(n,0),Da(n,l,0,!0);break}e:{switch(c=n,f){case Zi:case Mh:throw Error("Root did not complete. This is a bug in React.");case Yr:if((l&4194176)===l){Da(c,l,ca,!Ii);break e}break;case rm:qs=null;break;case Ly:case bb:break;default:throw Error("Unknown root exit status.")}if(c.finishedWork=o,c.finishedLanes=l,W.actQueue!==null)Vn(c,qs,Lh,xg,ca,dc,Qr,jb,gy,0);else{if((l&62914560)===l&&(f=Gy+Rb-Va(),10<f)){if(Da(c,l,ca,!Ii),Vo(c,0)!==0)break e;c.timeoutHandle=Mb(vn.bind(null,c,o,qs,Lh,xg,l,ca,dc,Qr,Ii,Vv,gy,0),f);break e}vn(c,o,qs,Lh,xg,l,ca,dc,Qr,Ii,jb,gy,0)}}}break}while(!0);ta(n)}function Ss(n){qs===null?qs=n:qs.push.apply(qs,n)}function vn(n,l,o,c,f,m,b,E,k,w,I,ae,$){var ce=l.subtreeFlags;if((ce&8192||(ce&16785408)===16785408)&&(Yh={stylesheets:null,count:0,unsuspend:Vp},jp(l),l=Kg(),l!==null)){n.cancelPendingCommit=l(Vn.bind(null,n,o,c,f,b,E,k,Uv,ae,$)),Da(n,m,b,!w);return}Vn(n,o,c,f,b,E,k,I,ae,$)}function af(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(!Al(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 Da(n,l,o,c){l&=~qy,l&=~dc,n.suspendedLanes|=l,n.pingedLanes&=~l,c&&(n.warmLanes|=l),c=n.expirationTimes;for(var f=l;0<f;){var m=31-On(f),b=1<<m;c[m]=-1,f&=~b}o!==0&&Pa(n,o,l)}function pl(){return(wt&(Bl|Qi))===ia?(Lu(0),!1):!0}function ir(){if(Ke!==null){if(Et===ql)var n=Ke.return;else n=Ke,$c(),ha(n),Ff=null,Ah=0,n=Ke;for(;n!==null;)Ba(n.alternate,n),n=n.return;Ke=null}}function fo(n,l){n.finishedWork=null,n.finishedLanes=0;var o=n.timeoutHandle;o!==l0&&(n.timeoutHandle=l0,Iv(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),ir(),Rt=n,Ke=o=Ca(n.current,null),Je=l,Et=ql,ua=null,Ii=!1,fm=gc(n,l),Vy=!1,Xt=Zi,Qr=ca=qy=dc=rc=0,qs=zh=null,xg=!1,l&8&&(l|=l&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=l;0<c;){var f=31-On(c),m=1<<f;l|=n[f],c&=~m}return Lo=l,bd(),Hs.discardPendingWarnings(),o}function As(n,l){Oe=null,W.H=zo,W.getCurrentStack=null,El=!1,_n=null,l===ug?(l=xx(),Et=Nh):l===j0?(l=xx(),Et=vb):Et=l===nb?Uy:l!==null&&typeof l=="object"&&typeof l.then=="function"?dm:_h,ua=l;var o=Ke;if(o===null)Xt=Mh,ze(n,Wn(l,n.current));else switch(o.mode&Yn&&zm(o),Ys(),Et){case _h:Se!==null&&typeof Se.markComponentErrored=="function"&&Se.markComponentErrored(o,l,Je);break;case Xr:case Nh:case dm:case Oh:Se!==null&&typeof Se.markComponentSuspended=="function"&&Se.markComponentSuspended(o,l,Je)}}function Cs(){var n=W.H;return W.H=zo,n===null?zo:n}function Nu(){var n=W.A;return W.A=Nv,n}function ur(){Xt=Yr,Ii||(Je&4194176)!==Je&&Za.current!==null||(fm=!0),!(rc&134217727)&&!(dc&134217727)||Rt===null||Da(Rt,Je,ca,!1)}function cr(n,l,o){var c=wt;wt|=Bl;var f=Cs(),m=Nu();if(Rt!==n||Je!==l){if(Gn){var b=n.memoizedUpdaters;0<b.size&&(jt(n,Je),b.clear()),ex(n,l)}Lh=null,fo(n,l)}Ih(l),l=!1,b=Xt;e:do try{if(Et!==ql&&Ke!==null){var E=Ke,k=ua;switch(Et){case Uy:ir(),b=hg;break e;case Nh:case Xr:case dm:Za.current===null&&(l=!0);var w=Et;if(Et=ql,ua=null,bi(n,E,k,w),o&&fm){b=Zi;break e}break;default:w=Et,Et=ql,ua=null,bi(n,E,k,w)}}Ou(),b=Xt;break}catch(I){As(n,I)}while(!0);return l&&n.shellSuspendCounter++,$c(),wt=c,W.H=f,W.A=m,$h(),Ke===null&&(Rt=null,Je=0,bd()),b}function Ou(){for(;Ke!==null;)kp(Ke)}function rr(n,l){var o=wt;wt|=Bl;var c=Cs(),f=Nu();if(Rt!==n||Je!==l){if(Gn){var m=n.memoizedUpdaters;0<m.size&&(jt(n,Je),m.clear()),ex(n,l)}Lh=null,gg=Va()+Eb,fo(n,l)}else fm=gc(n,l);Ih(l);e:do try{if(Et!==ql&&Ke!==null)t:switch(l=Ke,m=ua,Et){case _h:Et=ql,ua=null,bi(n,l,m,_h);break;case Xr:if(qm(m)){Et=ql,ua=null,zu(l);break}l=function(){Et===Xr&&Rt===n&&(Et=Oh),ta(n)},m.then(l,l);break e;case Nh:Et=Oh;break e;case vb:Et=Hy;break e;case Oh:qm(m)?(Et=ql,ua=null,zu(l)):(Et=ql,ua=null,bi(n,l,m,Oh));break;case Hy:var b=null;switch(Ke.tag){case 26:b=Ke.memoizedState;case 5:case 27:var E=Ke;if(!b||Ef(b)){Et=ql,ua=null;var k=E.sibling;if(k!==null)Ke=k;else{var w=E.return;w!==null?(Ke=w,dr(w)):Ke=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}Et=ql,ua=null,bi(n,l,m,Hy);break;case dm:Et=ql,ua=null,bi(n,l,m,dm);break;case Uy:ir(),Xt=hg;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}W.actQueue!==null?Ou():wx();break}catch(I){As(n,I)}while(!0);return $c(),W.H=c,W.A=f,wt=o,Ke!==null?(Se!==null&&typeof Se.markRenderYielded=="function"&&Se.markRenderYielded(),Zi):($h(),Rt=null,Je=0,bd(),Xt)}function wx(){for(;Ke!==null&&!Of();)kp(Ke)}function kp(n){var l=n.alternate;(n.mode&Yn)!==Tt?(Po(n),l=se(n,qd,l,n,Lo),zm(n)):l=se(n,qd,l,n,Lo),n.memoizedProps=n.pendingProps,l===null?dr(n):Ke=l}function zu(n){var l=se(n,mo,n);n.memoizedProps=n.pendingProps,l===null?dr(n):Ke=l}function mo(n){var l=n.alternate,o=(n.mode&Yn)!==Tt;switch(o&&Po(n),n.tag){case 15:case 0:l=lp(l,n,n.pendingProps,n.type,void 0,Je);break;case 11:l=lp(l,n,n.pendingProps,n.type.render,n.ref,Je);break;case 5:ha(n);default:Ba(l,n),n=Ke=Pd(n,Lo),l=qd(l,n,Lo)}return o&&zm(n),l}function bi(n,l,o,c){$c(),ha(l),Ff=null,Ah=0;var f=l.return;try{if(di(n,f,l,o,Je)){Xt=Mh,ze(n,Wn(o,n.current)),Ke=null;return}}catch(m){if(f!==null)throw Ke=f,m;Xt=Mh,ze(n,Wn(o,n.current)),Ke=null;return}l.flags&32768?(et||c===_h?n=!0:fm||Je&536870912?n=!1:(Ii=n=!0,(c===Xr||c===Nh||c===dm)&&(c=Za.current,c!==null&&c.tag===13&&(c.flags|=16384))),po(l,n)):dr(l)}function dr(n){var l=n;do{if(l.flags&32768){po(l,Ii);return}var o=l.alternate;if(n=l.return,Po(l),o=se(l,Tp,o,l,Lo),(l.mode&Yn)!==Tt&&Lm(l),o!==null){Ke=o;return}if(l=l.sibling,l!==null){Ke=l;return}Ke=l=n}while(l!==null);Xt===Zi&&(Xt=bb)}function po(n,l){do{var o=yi(n.alternate,n);if(o!==null){o.flags&=32767,Ke=o;return}if((n.mode&Yn)!==Tt){Lm(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);Xt=hg,Ke=null}function Vn(n,l,o,c,f,m,b,E,k,w){var I=W.T,ae=xt.p;try{xt.p=jl,W.T=null,Dx(n,l,o,c,ae,f,m,b,E,k,w)}finally{W.T=I,xt.p=ae}}function Dx(n,l,o,c,f,m,b,E){do Ts();while(Zr!==null);if(Hs.flushLegacyContextWarning(),Hs.flushPendingUnsafeLifecycleWarnings(),(wt&(Bl|Qi))!==ia)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 nd(),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|=xy,Hg(n,c,w,m,b,E),n===Rt&&(Ke=Rt=null,Je=0),!(k.subtreeFlags&10256)&&!(k.flags&10256)||yg||(yg=!0,Yy=w,Xy=o,hl(Ku,function(){return Ts(),null})),ng=Kf(),o=(k.flags&15990)!==0,k.subtreeFlags&15990||o?(o=W.T,W.T=null,m=xt.p,xt.p=jl,b=wt,wt|=Qi,Jd(n,k),yp(n,k,c),Zg(t0,n.containerInfo),Ng=!!e0,t0=e0=null,n.current=k,Se!==null&&typeof Se.markLayoutEffectsStarted=="function"&&Se.markLayoutEffectsStarted(c),kx(k,n,c),Se!==null&&typeof Se.markLayoutEffectsStopped=="function"&&Se.markLayoutEffectsStopped(),_s(),wt=b,xt.p=m,W.T=o):n.current=k,(o=yg)?(yg=!1,Zr=n,Hh=c):(Bp(n,w),Ir=0,Vh=null),w=n.pendingLanes,w===0&&(fc=null),o||wp(n),Wi(k.stateNode,f),Gn&&n.memoizedUpdaters.clear(),ro(),ta(n),l!==null)for(f=n.onRecoverableError,k=0;k<l.length;k++)w=l[k],o=Mx(w.stack),se(w.source,f,w.value,o);return Hh&3&&Ts(),w=n.pendingLanes,c&4194218&&w&42?(ag=!0,n===Qy?Uh++:(Uh=0,Qy=n)):Uh=0,Lu(0),nd(),null}function Mx(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 Bp(n,l){(n.pooledCacheLanes&=l)===0&&(l=n.pooledCache,l!=null&&(n.pooledCache=null,ni(l)))}function Ts(){if(Zr!==null){var n=Zr,l=Yy;Yy=0;var o=tx(Hh),c=sa>o?sa:o;o=W.T;var f=xt.p;try{if(xt.p=c,W.T=null,Zr===null)var m=!1;else{c=Xy,Xy=null;var b=Zr,E=Hh;if(Zr=null,Hh=0,(wt&(Bl|Qi))!==ia)throw Error("Cannot flush passive effects while already rendering.");Zy=!0,bg=!1,Se!==null&&typeof Se.markPassiveEffectsStarted=="function"&&Se.markPassiveEffectsStarted(E);var k=wt;if(wt|=Qi,wu(b.current),Ep(b,b.current,E,c),Se!==null&&typeof Se.markPassiveEffectsStopped=="function"&&Se.markPassiveEffectsStopped(),wp(b),wt=k,Lu(0,!1),bg?b===Vh?Ir++:(Ir=0,Vh=b):Ir=0,bg=Zy=!1,Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(Ju,b)}catch(I){qn||(qn=!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{xt.p=f,W.T=o,Bp(n,l)}}return!1}function sf(n,l,o){l=Wn(o,l),l=Nt(n.stateNode,l,2),n=bs(n,l,2),n!==null&&(pn(n,2),ta(n))}function lt(n,l,o){if(mm=!1,n.tag===3)sf(n,n,o);else{for(;l!==null;){if(l.tag===3){sf(l,n,o);return}if(l.tag===1){var c=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(fc===null||!fc.has(c))){n=Wn(o,n),o=vu(2),c=bs(l,o,2),c!==null&&(so(o,c,l,n),pn(c,2),ta(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 ea(n,l,o){var c=n.pingCache;if(c===null){c=n.pingCache=new zv;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)||(Vy=!0,f.add(o),c=zt.bind(null,n,l,o),Gn&&jt(n,o),l.then(c,c))}function zt(n,l,o){var c=n.pingCache;c!==null&&c.delete(l),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,wa()&&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`),Rt===n&&(Je&o)===o&&(Xt===Yr||Xt===Ly&&(Je&62914560)===Je&&Va()-Gy<Rb?(wt&Bl)===ia&&fo(n,0):qy|=o,Qr===Je&&(Qr=0)),ta(n)}function of(n,l){l===0&&(l=Fh()),n=gn(n,l),n!==null&&(pn(n,l),ta(n))}function _x(n){var l=n.memoizedState,o=0;l!==null&&(o=l.retryLane),of(n,o)}function cn(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),of(n,o)}function uf(n,l,o){if(l.subtreeFlags&33562624)for(l=l.child;l!==null;){var c=n,f=l,m=f.type===kf;m=o||m,f.tag!==22?f.flags&33554432?m&&se(f,Nx,c,f,(f.mode&R0)===Tt):uf(c,f,m):f.memoizedState===null&&(m&&f.flags&8192?se(f,Nx,c,f):f.subtreeFlags&33554432&&se(f,uf,c,f,m)),l=l.sibling}}function Nx(n,l){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;pt(!0);try{vp(l),o&&Ap(l),Rp(n,l.alternate,l,!1),o&&un(n,l,0,null,!1)}finally{pt(!1)}}function wp(n){var l=!0;n.current.mode&(sl|Ls)||(l=!1),uf(n,n.current,l)}function Dp(n){if((wt&Bl)===ia){var l=n.tag;if(l===3||l===1||l===0||l===11||l===14||l===15){if(l=X(n)||"ReactComponent",vg!==null){if(vg.has(l))return;vg.add(l)}else vg=new Set([l]);se(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 jt(n,l){Gn&&n.memoizedUpdaters.forEach(function(o){Ph(n,o,l)})}function hl(n,l){var o=W.actQueue;return o!==null?(o.push(l),qv):nl(n,l)}function ks(n){wa()&&W.actQueue===null&&se(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 ta(n){n!==pm&&n.next===null&&(pm===null?Rg=pm=n:pm=pm.next=n),Eg=!0,W.actQueue!==null?$y||($y=!0,gl(Ox)):Iy||(Iy=!0,gl(Ox))}function Lu(n,l){if(!Ky&&Eg){Ky=!0;do for(var o=!1,c=Rg;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-On(42|n)+1)-1,m&=f&~(b&~E),m=m&201326677?m&201326677|1:m?m|2:0}m!==0&&(o=!0,zl(c,m))}else m=Je,m=Vo(c,c===Rt?m:0),!(m&3)||gc(c,m)||(o=!0,zl(c,m));c=c.next}while(o);Ky=!1}}function Ox(){Eg=$y=Iy=!1;var n=0;$r!==0&&($e()&&(n=$r),$r=0);for(var l=Va(),o=null,c=Rg;c!==null;){var f=c.next,m=cf(c,l);m===0?(c.next=null,o===null?Rg=f:o.next=f,f===null&&(pm=o)):(o=c,(n!==0||m&3)&&(Eg=!0)),c=f}Lu(n)}function cf(n,l){for(var o=n.suspendedLanes,c=n.pingedLanes,f=n.expirationTimes,m=n.pendingLanes&-62914561;0<m;){var b=31-On(m),E=1<<b,k=f[b];k===-1?(!(E&o)||E&c)&&(f[b]=Jh(E,l)):k<=l&&(n.expiredLanes|=E),m&=~E}if(l=Rt,o=Je,o=Vo(n,n===l?o:0),c=n.callbackNode,o===0||n===l&&Et===Xr||n.cancelPendingCommit!==null)return c!==null&&rf(c),n.callbackNode=null,n.callbackPriority=0;if(!(o&3)||gc(n,o)){if(l=o&-o,l!==n.callbackPriority||W.actQueue!==null&&c!==Jy)rf(c);else return l;switch(tx(o)){case jl:case Hl:o=zf;break;case sa:o=Ku;break;case Oi:o=nh;break;default:o=Ku}return c=xl.bind(null,n),W.actQueue!==null?(W.actQueue.push(c),o=Jy):o=nl(o,c),n.callbackPriority=l,n.callbackNode=o,l}return c!==null&&rf(c),n.callbackPriority=2,n.callbackNode=null,2}function xl(n,l){ag=lg=!1;var o=n.callbackNode;if(Ts()&&n.callbackNode!==o)return null;var c=Je;return c=Vo(n,n===Rt?c:0),c===0?null:(or(n,c,l),cf(n,Va()),n.callbackNode!=null&&n.callbackNode===o?xl.bind(null,n):null)}function zl(n,l){if(Ts())return null;lg=ag,ag=!1,or(n,l,!0)}function rf(n){n!==Jy&&n!==null&&$x(n)}function gl(n){W.actQueue!==null&&W.actQueue.push(function(){return n(),null}),$v(function(){(wt&(Bl|Qi))!==ia?nl(Ao,n):n()})}function df(){return $r===0&&($r=Wh()),$r}function Ma(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:(at(n,"action"),pa(""+n))}function vi(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 ho(n,l,o,c,f){if(l==="submit"&&o&&o.stateNode===f){var m=Ma((f[ll]||null).action),b=c.submitter;b&&(l=(l=b[ll]||null)?Ma(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($r!==0){var k=b?vi(f,b):new FormData(f),w={pending:!0,data:k,method:f.method,action:m};Object.freeze(w),Ea(o,w,null,k)}}else typeof m=="function"&&(E.preventDefault(),k=b?vi(f,b):new FormData(f),w={pending:!0,data:k,method:f.method,action:m},Object.freeze(w),Ea(o,w,m,k))},currentTarget:f}]})}}function ff(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){mg(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){mg(I)}f.currentTarget=null,f=k}}}}function Ie(n,l){Wy.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[zi];o===void 0&&(o=l[zi]=new Set);var c=n+"__bubble";o.has(c)||(Ri(l,n,2,!1),o.add(c))}function _a(n,l,o){Wy.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),Ri(o,n,c,l)}function mf(n){if(!n[jg]){n[jg]=!0,Br.forEach(function(o){o!=="selectionchange"&&(Wy.has(o)||_a(o,!1,n),_a(o,!0,n))});var l=n.nodeType===9?n:n.ownerDocument;l===null||l[jg]||(l[jg]=!0,_a("selectionchange",!1,l))}}function Ri(n,l,o,c){switch(Mi(l)){case jl:var f=Xx;break;case Hl:f=Wg;break;default:f=Qp}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 Ei(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=da(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}md(function(){var w=m,I=Is(o),ae=[];e:{var $=b0.get(n);if($!==void 0){var ce=H,Be=n;switch(n){case"keypress":if(su(o)===0)break e;case"keydown":case"keyup":ce=uv;break;case"focusin":Be="focus",ce=dy;break;case"focusout":Be="blur",ce=dy;break;case"beforeblur":case"afterblur":ce=dy;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=tn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=_o;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=dv;break;case h0:case x0:case g0:ce=Pb;break;case y0:ce=mv;break;case"scroll":case"scrollend":ce=de;break;case"wheel":ce=hv;break;case"copy":case"cut":case"paste":ce=tv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=i0;break;case"toggle":case"beforetoggle":ce=gv}var Ye=(l&4)!==0,nn=!Ye&&(n==="scroll"||n==="scrollend"),ct=Ye?$!==null?$+"Capture":null:$;Ye=[];for(var _=w,M;_!==null;){var L=_;if(M=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||M===null||ct===null||(L=lu(_,ct),L!=null&&Ye.push(Bs(_,L,M))),nn)break;_=_.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)&&(da(Be)||Be[To]))break e;if((ce||$)&&($=I.window===I?I:($=I.ownerDocument)?$.defaultView||$.parentWindow:window,ce?(Be=o.relatedTarget||o.toElement,ce=w,Be=Be?da(Be):null,Be!==null&&(nn=me(Be),Ye=Be.tag,Be!==nn||Ye!==5&&Ye!==27&&Ye!==6)&&(Be=null)):(ce=null,Be=w),ce!==Be)){if(Ye=tn,L="onMouseLeave",ct="onMouseEnter",_="mouse",(n==="pointerout"||n==="pointerover")&&(Ye=i0,L="onPointerLeave",ct="onPointerEnter",_="pointer"),nn=ce==null?$:bc(ce),M=Be==null?$:bc(Be),$=new Ye(L,_+"leave",ce,o,I),$.target=nn,$.relatedTarget=M,L=null,da(I)===w&&(Ye=new Ye(ct,_+"enter",Be,o,I),Ye.target=M,Ye.relatedTarget=nn,L=Ye),nn=L,ce&&Be)t:{for(Ye=ce,ct=Be,_=0,M=Ye;M;M=ji(M))_++;for(M=0,L=ct;L;L=ji(L))M++;for(;0<_-M;)Ye=ji(Ye),_--;for(;0<M-_;)ct=ji(ct),M--;for(;_--;){if(Ye===ct||ct!==null&&Ye===ct.alternate)break t;Ye=ji(Ye),ct=ji(ct)}Ye=null}else Ye=null;ce!==null&&Mp(ae,$,ce,Ye,!1),Be!==null&&nn!==null&&Mp(ae,nn,Be,Ye,!0)}}e:{if($=w?bc(w):window,ce=$.nodeName&&$.nodeName.toLowerCase(),ce==="select"||ce==="input"&&$.type==="file")var ne=gd;else if(Ks($))if(m0)ne=Qg;else{ne=Yg;var Ee=ax}else ce=$.nodeName,!ce||ce.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?w&&$o(w.elementType)&&(ne=gd):ne=Xg;if(ne&&(ne=ne(n,w))){ou(ae,ne,o,I);break e}Ee&&Ee(n,$,w),n==="focusout"&&w&&$.type==="number"&&w.memoizedProps.value!=null&&as($,"number",$.value)}switch(Ee=w?bc(w):window,n){case"focusin":(Ks(Ee)||Ee.contentEditable==="true")&&(Qf=Ee,my=w,xh=null);break;case"focusout":xh=my=Qf=null;break;case"mousedown":py=!0;break;case"contextmenu":case"mouseup":case"dragend":py=!1,cx(ae,o,I);break;case"selectionchange":if(Rv)break;case"keydown":case"keyup":cx(ae,o,I)}var Le;if(fy)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 Xf?Sc(n,o)&&(ke="onCompositionEnd"):n==="keydown"&&o.keyCode===u0&&(ke="onCompositionStart");ke&&(c0&&o.locale!=="ko"&&(Xf||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Xf&&(Le=au()):(Ce=I,_e="value"in Ce?Ce.value:Ce.textContent,Xf=!0)),Ee=ws(w,ke),0<Ee.length&&(ke=new o0(ke,n,null,o,I),ae.push({event:ke,listeners:Ee}),Le?ke.data=Le:(Le=Ac(o),Le!==null&&(ke.data=Le)))),(Le=bv?lx(n,o):Jn(n,o))&&(ke=ws(w,"onBeforeInput"),0<ke.length&&(Ee=new lv("onBeforeInput","beforeinput",null,o,I),ae.push({event:Ee,listeners:ke}),Ee.data=Le)),ho(ae,n,w,o,I)}ff(ae,l)})}function Bs(n,l,o){return{instance:n,listener:l,currentTarget:o}}function ws(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=lu(n,o),f!=null&&c.unshift(Bs(n,f,m)),f=lu(n,l),f!=null&&c.push(Bs(n,f,m))),n=n.return}return c}function ji(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Mp(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=lu(o,m),w!=null&&b.unshift(Bs(o,w,k))):f||(w=lu(o,m),w!=null&&b.push(Bs(o,w,k)))),o=o.return}b.length!==0&&n.push({event:l,listeners:b})}function Si(n,l){fd(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:Os,possibleRegistrationNames:lh};$o(n)||typeof l.is=="string"||wm(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 Ft(n,l,o,c){l!==o&&(o=Pt(o),Pt(l)!==o&&(c[n]=l))}function pf(n,l,o){l.forEach(function(c){o[xf(c)]=c==="style"?fr(n):n.getAttribute(c)})}function na(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 zx(n,l){return n=n.namespaceURI===Mo||n.namespaceURI===Sl?n.ownerDocument.createElementNS(n.namespaceURI,n.tagName):n.ownerDocument.createElement(n.tagName),n.innerHTML=l,n.innerHTML}function Pt(n){return ft(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.",Lt(n)),Zn(n)),(typeof n=="string"?n:""+n).replace(Gv,`
|
|
248
|
-
`).replace(Yv,"")}function hf(n,l){return l=Pt(l),Pt(n)===l}function la(){}function ot(n,l,o,c,f,m){switch(o){case"children":typeof c=="string"?(jc(c,l),l==="body"||l==="textarea"&&c===""||ma(n,c)):(typeof c=="number"||typeof c=="bigint")&&(jc(""+c,l),l!=="body"&&ma(n,""+c));break;case"className":Rc(n,"class",c);break;case"tabIndex":Rc(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Rc(n,o,c);break;case"style":km(n,c,m);break;case"data":if(l!=="object"){Rc(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=pa(""+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||Cg||(Cg=!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||Ag||(Ag=!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"||Sg?l!=="button"||f.type==null||f.type==="submit"||Sg?typeof c=="function"&&(f.name==null||kb||(kb=!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||Cg||(Cg=!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||Ag||(Ag=!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."))):(Sg=!0,console.error('A button can only specify a formAction along with type="submit" or no type.')):(Sg=!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=pa(""+c),n.setAttribute(o,c);break;case"onClick":c!=null&&(typeof c!="function"&&na(o,c),n.onclick=la);break;case"onScroll":c!=null&&(typeof c!="function"&&na(o,c),Ie("scroll",n));break;case"onScrollEnd":c!=null&&(typeof c!="function"&&na(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=pa(""+c),n.setAttributeNS(Kr,"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!==""||Tg[o]||(Tg[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),vc(n,"popover",c);break;case"xlinkActuate":ns(n,Kr,"xlink:actuate",c);break;case"xlinkArcrole":ns(n,Kr,"xlink:arcrole",c);break;case"xlinkRole":ns(n,Kr,"xlink:role",c);break;case"xlinkShow":ns(n,Kr,"xlink:show",c);break;case"xlinkTitle":ns(n,Kr,"xlink:title",c);break;case"xlinkType":ns(n,Kr,"xlink:type",c);break;case"xmlBase":ns(n,Fy,"xml:base",c);break;case"xmlLang":ns(n,Fy,"xml:lang",c);break;case"xmlSpace":ns(n,Fy,"xml:space",c);break;case"is":m!=null&&console.error('Cannot update the "is" prop after it has been initialized.'),vc(n,"is",c);break;case"innerText":case"textContent":break;case"popoverTarget":Bb||c==null||typeof c!="object"||(Bb=!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=nx(o),vc(n,o,c)):Os.hasOwnProperty(o)&&c!=null&&typeof c!="function"&&na(o,c)}}function Hu(n,l,o,c,f,m){switch(o){case"style":km(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"?ma(n,c):(typeof c=="number"||typeof c=="bigint")&&ma(n,""+c);break;case"onScroll":c!=null&&(typeof c!="function"&&na(o,c),Ie("scroll",n));break;case"onScrollEnd":c!=null&&(typeof c!="function"&&na(o,c),Ie("scrollend",n));break;case"onClick":c!=null&&(typeof c!="function"&&na(o,c),n.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(Os.hasOwnProperty(o))c!=null&&typeof c!="function"&&na(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[ll]||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,""):vc(n,o,c)}}}function Bt(n,l,o){switch(Si(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":Fi("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)}}bm(n,o),id(n,m,E,k,w,b,f,!1),ls(n);return;case"select":Fi("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)}$t(n,o),l=m,o=b,n.multiple=!!c,l!=null?Yl(n,!!c,l,!1):o!=null&&Yl(n,!!c,o,!0);return;case"textarea":Fi("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)}vm(n,o),Qs(n,c,f,m),ls(n);return;case"option":Xo(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<qh.length;c++)Ie(qh[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($o(l)){for(I in o)o.hasOwnProperty(I)&&(c=o[I],c!==void 0&&Hu(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 Lx(n,l,o,c){switch(Si(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||Tb||(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"),Tb=!0),!l||c||Cb||(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"),Cb=!0),Yo(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?Yl(n,!!l,$,!1):!!o!=!!l&&(c!=null?Yl(n,!!l,c,!0):Yl(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)}Rm(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($o(l)){for(var nn in o)$=o[nn],o.hasOwnProperty(nn)&&$!==void 0&&!c.hasOwnProperty(nn)&&Hu(n,l,nn,void 0,c,$);for(I in c)$=c[I],ce=o[I],!c.hasOwnProperty(I)||$===ce||$===void 0&&ce===void 0||Hu(n,l,I,$,c,ce);return}}for(var ct in o)$=o[ct],o.hasOwnProperty(ct)&&$!=null&&!c.hasOwnProperty(ct)&&ot(n,l,ct,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 xf(n){switch(n){case"class":return"className";case"for":return"htmlFor";default:return n}}function fr(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 Na(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?(ra(b,m),c+=f+m+":"+(""+b).trim()):typeof b!="number"||b===0||tc.has(m)?(ra(b,m),c+=f+m.replace(uh,"-$1").toLowerCase().replace(Fu,"-ms-")+":"+(""+b).trim()):c+=f+m.replace(uh,"-$1").toLowerCase().replace(Fu,"-ms-")+":"+b+"px",f=";")}c=c||null,l=n.getAttribute("style"),l!==c&&(c=Pt(c),Pt(l)!==c&&(o.style=fr(n)))}}function yl(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}Ft(l,n,c,m)}function mr(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}Ft(l,n,c,m)}function Ai(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}Ft(l,n,c,m)}function St(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}Ft(l,n,c,m)}function gf(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=pa(""+c),n===o)return}Ft(l,n,c,m)}function Hx(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($o(l)){for(var k in o)if(o.hasOwnProperty(k)){var w=o[k];if(w!=null){if(Os.hasOwnProperty(k))typeof w!="function"&&na(k,w);else if(o.suppressHydrationWarning!==!0)switch(k){case"children":typeof w!="string"&&typeof w!="number"||Ft("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=zx(n,w),Ft(k,b,w,f));continue;case"style":m.delete(k),Na(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=ym(n,"class",w),Ft("className",b,w,f);continue;default:c.context===$i&&l!=="svg"&&l!=="math"?m.delete(k.toLowerCase()):m.delete(k),b=ym(n,k,w),Ft(k,b,w,f)}}}}else for(w in o)if(o.hasOwnProperty(w)&&(k=o[w],k!=null)){if(Os.hasOwnProperty(w))typeof k!="function"&&na(w,k);else if(o.suppressHydrationWarning!==!0)switch(w){case"children":typeof k!="string"&&typeof k!="number"||Ft("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=zx(n,k),b!==k&&(f[w]={__html:b}));continue;case"className":yl(n,w,"class",k,m,f);continue;case"tabIndex":yl(n,w,"tabindex",k,m,f);continue;case"style":m.delete(w),Na(n,k,f);continue;case"multiple":m.delete(w),Ft(w,n.multiple,k,f);continue;case"muted":m.delete(w),Ft(w,n.muted,k,f);continue;case"autoFocus":m.delete("autofocus"),Ft(w,n.autofocus,k,f);continue;case"data":if(l!=="object"){m.delete(w),b=n.getAttribute("data"),Ft(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),gf(n,w,w,null,m,f);continue}gf(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===Xv){m.delete(w.toLowerCase()),Ft(w,"function",k,f);continue}gf(n,w,w.toLowerCase(),k,m,f);continue;case"xlinkHref":gf(n,w,"xlink:href",k,m,f);continue;case"contentEditable":Ai(n,w,"contenteditable",k,m,f);continue;case"spellCheck":Ai(n,w,"spellcheck",k,m,f);continue;case"draggable":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":Ai(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":mr(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}Ft(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}Ft(b,E,k,ae)}continue;case"rowSpan":St(n,w,"rowspan",k,m,f);continue;case"start":St(n,w,w,k,m,f);continue;case"xHeight":yl(n,w,"x-height",k,m,f);continue;case"xlinkActuate":yl(n,w,"xlink:actuate",k,m,f);continue;case"xlinkArcrole":yl(n,w,"xlink:arcrole",k,m,f);continue;case"xlinkRole":yl(n,w,"xlink:role",k,m,f);continue;case"xlinkShow":yl(n,w,"xlink:show",k,m,f);continue;case"xlinkTitle":yl(n,w,"xlink:title",k,m,f);continue;case"xlinkType":yl(n,w,"xlink:type",k,m,f);continue;case"xmlBase":yl(n,w,"xml:base",k,m,f);continue;case"xmlLang":yl(n,w,"xml:lang",k,m,f);continue;case"xmlSpace":yl(n,w,"xml:space",k,m,f);continue;case"inert":k!==""||Tg[w]||(Tg[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)),mr(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=nx(w),b=!1,c.context===$i&&l!=="svg"&&l!=="math"?m.delete(E.toLowerCase()):(I=w.toLowerCase(),I=Li.hasOwnProperty(I)&&Li[I]||null,I!==null&&I!==w&&(b=!0,m.delete(I)),m.delete(E));e:if(I=n,ae=E,E=k,ad(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||Ft(w,E,k,f)}}}return 0<m.size&&o.suppressHydrationWarning!==!0&&pf(n,m,f),Object.keys(f).length===0?null:f}function Ux(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 yf(n){return n.nodeType===9?n:n.ownerDocument}function Vx(n){switch(n){case Sl:return hm;case Mo:return wg;default:return $i}}function At(n,l){if(n===$i)switch(l){case"svg":return hm;case"math":return wg;default:return $i}return n===hm&&l==="foreignObject"?$i:n}function rt(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===n0?!1:(n0=n,!0):(n0=null,!1)}function Fe(n){setTimeout(function(){throw n})}function ht(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 bl(n,l,o,c){Lx(n,l,o,c),n[ll]=c}function Oa(n){ma(n,"")}function Uu(n,l,o){n.nodeValue=o}function _p(n,l){n.removeChild(l)}function Ds(n,l){n.nodeType===8?n.parentNode.removeChild(l):n.removeChild(l)}function Ct(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===Bg){if(c===0){n.removeChild(f),Zu(l);return}c--}else o!==kg&&o!==Jr&&o!==Wr||c++;o=f}while(o);Zu(l)}function xo(n){n=n.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"}function Ci(n){n.nodeValue=""}function Np(n,l){l=l[Zv],l=l!=null&&l.hasOwnProperty("display")?l.display:null,n.style.display=l==null||typeof l=="boolean"?"":(""+l).trim()}function Ll(n,l){n.nodeValue=l}function go(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":go(o),es(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function pr(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[ko])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=tl(n.nextSibling),n===null)break}return null}function za(n,l,o){if(l==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=tl(n.nextSibling),n===null))return null;return n}function tl(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===kg||l===Wr||l===Jr||l===Py||l===wb)break;if(l===Bg)return null}}return n}function bf(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[xf(m.name)]=m.name.toLowerCase()==="style"?fr(n):m.value}return{type:l,props:o}}return n.nodeType===8?{type:"Suspense",props:{}}:n.nodeValue}function hr(n,l,o){return o===null||o[Qv]!==!0?(n.nodeValue===l?n=null:(l=Pt(l),n=Pt(n.nodeValue)===l?null:n.nodeValue),n):null}function xr(n){n=n.nextSibling;for(var l=0;n;){if(n.nodeType===8){var o=n.data;if(o===Bg){if(l===0)return tl(n.nextSibling);l--}else o!==kg&&o!==Wr&&o!==Jr||l++}n=n.nextSibling}return null}function Ms(n){n=n.previousSibling;for(var l=0;n;){if(n.nodeType===8){var o=n.data;if(o===kg||o===Wr||o===Jr){if(l===0)return n;l--}else o===Bg&&l++}n=n.previousSibling}return null}function vf(n){Zu(n)}function Ti(n){Zu(n)}function Vu(n,l,o,c,f){switch(f&&dd(n,c.ancestorInfo),l=yf(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 Op(n,l,o,c){if(Gl(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]);Bt(o,n,l),o[En]=c,o[ll]=l}function qu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.ownerDocument}function Gu(n,l,o){var c=xm;if(c&&typeof l=="string"&&l){var f=wl(l);f='link[rel="'+n+'"][href="'+f+'"]',typeof o=="string"&&(f+='[crossorigin="'+o+'"]'),zb.has(f)||(zb.add(f),n={rel:n,crossOrigin:o,href:l},c.querySelector(f)===null&&(l=c.createElement("link"),Bt(l,"link",n),Zt(l),c.head.appendChild(l)))}}function Rf(n,l,o,c){var f=(f=dn.current)?qu(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=ki(o.href),l=Go(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=ki(o.href);var m=Go(f).hoistableStyles,b=m.get(n);if(!b&&(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:Fr,preload:null}},m.set(n,b),(m=f.querySelector(en(n)))&&!m._p&&(b.instance=m,b.state.loading=Gh|Ja),!Wa.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};Wa.set(n,E),m||Lp(f,n,E,b.state)}if(l&&c===null)throw o=`
|
|
249
|
-
|
|
250
|
-
- `+Dn(l)+`
|
|
251
|
-
+ `+Dn(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
|
-
- `+Dn(l)+`
|
|
254
|
-
+ `+Dn(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=Bi(o),l=Go(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 Dn(n){var l=0,o="<link";return typeof n.rel=="string"?(l++,o+=' rel="'+n.rel+'"'):Ua.call(n,"rel")&&(l++,o+=' rel="'+(n.rel===null?"null":"invalid type "+typeof n.rel)+'"'),typeof n.href=="string"?(l++,o+=' href="'+n.href+'"'):Ua.call(n,"href")&&(l++,o+=' href="'+(n.href===null?"null":"invalid type "+typeof n.href)+'"'),typeof n.precedence=="string"?(l++,o+=' precedence="'+n.precedence+'"'):Ua.call(n,"precedence")&&(l++,o+=" precedence={"+(n.precedence===null?"null":"invalid type "+typeof n.precedence)+"}"),Object.getOwnPropertyNames(n).length>l&&(o+=" ..."),o+" />"}function ki(n){return'href="'+wl(n)+'"'}function en(n){return'link[rel="stylesheet"]['+n+"]"}function zp(n){return He({},n,{"data-precedence":n.precedence,precedence:null})}function Lp(n,l,o,c){n.querySelector('link[rel="preload"][as="style"]['+l+"]")?c.loading=Gh:(l=n.createElement("link"),c.preload=l,l.addEventListener("load",function(){return c.loading|=Gh}),l.addEventListener("error",function(){return c.loading|=Nb}),Bt(l,"link",o),Zt(l),n.head.appendChild(l))}function Bi(n){return'[src="'+wl(n)+'"]'}function gr(n){return"script[async]"+n}function La(n,l,o){if(l.count++,l.instance===null)switch(l.type){case"style":var c=n.querySelector('style[data-href~="'+wl(o.href)+'"]');if(c)return l.instance=c,Zt(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"),Zt(c),Bt(c,"style",f),wi(c,o.precedence,n),l.instance=c;case"stylesheet":f=ki(o.href);var m=n.querySelector(en(f));if(m)return l.state.loading|=Ja,l.instance=m,Zt(m),m;c=zp(o),(f=Wa.get(f))&&yr(c,f),m=(n.ownerDocument||n).createElement("link"),Zt(m);var b=m;return b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),Bt(m,"link",c),l.state.loading|=Ja,wi(m,o.precedence,n),l.instance=m;case"script":return m=Bi(o.src),(f=n.querySelector(gr(m)))?(l.instance=f,Zt(f),f):(c=o,(f=Wa.get(m))&&(c=He({},o),yo(c,f)),n=n.ownerDocument||n,f=n.createElement("script"),Zt(f),Bt(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&Ja)===Fr&&(c=l.instance,l.state.loading|=Ja,wi(c,o.precedence,n));return l.instance}function wi(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 yr(n,l){n.crossOrigin==null&&(n.crossOrigin=l.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=l.referrerPolicy),n.title==null&&(n.title=l.title)}function yo(n,l){n.crossOrigin==null&&(n.crossOrigin=l.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=l.referrerPolicy),n.integrity==null&&(n.integrity=l.integrity)}function Hp(n,l,o){if(Dg===null){var c=new Map,f=Dg=new Map;f.set(o,c)}else f=Dg,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[ko]||m[En]||n==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!==Sl){var b=m.getAttribute(l)||"";b=n+b;var E=c.get(b);E?E.push(m):c.set(b,[m])}}return c}function Up(n,l,o){n=n.ownerDocument||n,n.head.insertBefore(o,l==="title"?n.querySelector("head > title"):null)}function qx(n,l,o){var c=!o.ancestorInfo.containerTagInScope;if(o.context===hm||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=Ux(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 Ef(n){return!(n.type==="stylesheet"&&(n.state.loading&Ob)===Fr)}function Vp(){}function $g(n,l,o){if(Yh===null)throw Error("Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug.");var c=Yh;if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&Ja)===Fr){if(l.instance===null){var f=ki(o.href),m=n.querySelector(en(f));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(c.count++,c=jf.bind(c),n.then(c,c)),l.state.loading|=Ja,l.instance=m,Zt(m);return}m=n.ownerDocument||n,o=zp(o),(f=Wa.get(f))&&yr(o,f),m=m.createElement("link"),Zt(m);var b=m;b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),Bt(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&Ob)===Fr&&(c.count++,l=jf.bind(c),n.addEventListener("load",l),n.addEventListener("error",l))}}function Kg(){if(Yh===null)throw Error("Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug.");var n=Yh;return n.stylesheets&&n.count===0&&Sf(n,n.stylesheets),0<n.count?function(l){var o=setTimeout(function(){if(n.stylesheets&&Sf(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 jf(){if(this.count--,this.count===0){if(this.stylesheets)Sf(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}function Sf(n,l){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Mg=new Map,l.forEach(Gx,n),Mg=null,jf.call(n))}function Gx(n,l){if(!(l.state.loading&Ja)){var o=Mg.get(n);if(o)var c=o.get(a0);else{o=new Map,Mg.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(a0,c)}f=l.instance,b=f.getAttribute("data-precedence"),m=o.get(b)||c,m===c&&o.set(a0,f),o.set(b,f),this.count++,c=jf.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|=Ja}}function Yu(n,l,o){var c=0;switch(n){case"dir":case"dirxml":case"groupEnd":case"table":return Vb.apply(console[n],[console].concat(l));case"assert":c=1}return l=l.slice(0),typeof l[c]=="string"?l.splice(c,1,Lb+l[c],Hb,_g+o+_g,Ub):l.splice(c,0,Lb,Hb,_g+o+_g,Ub),l.unshift(console),Vb.apply(console[n],l)}function Af(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=l0,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=qo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qo(0),this.hiddenUpdates=qo(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 qp(n,l,o,c,f,m,b,E,k,w,I,ae){return n=new Af(n,l,o,b,E,k,w,ae),l=Av,m===!0&&(l|=sl|Ls),Gn&&(l|=Yn),m=j(3,null,null,l),n.current=m,m.stateNode=n,l=us(),_l(l),n.pooledCache=l,_l(l),m.memoizedState={element:c,isDehydrated:o,cache:l},Yd(m),n}function Gp(n){return n?(n=lc,n):lc}function Yx(n,l,o,c){return l.tag===0&&Ts(),Yp(l.current,2,n,l,o,c),2}function Yp(n,l,o,c,f,m){if(Nn&&typeof Nn.onScheduleFiberRoot=="function")try{Nn.onScheduleFiberRoot(Ju,c,o)}catch(b){qn||(qn=!0,console.error("React instrumentation encountered an error: %s",b))}Se!==null&&typeof Se.markRenderScheduled=="function"&&Se.markRenderScheduled(l),f=Gp(f),c.context===null?c.context=f:c.pendingContext=f,El&&_n!==null&&!qb&&(qb=!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(_n)||"Unknown")),c=ys(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=bs(n,c,l),o!==null&&(mt(o,n,l),Fc(o,n,l))}function Di(n,l){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<l?o:l}}function Cf(n,l){Di(n,l),(n=n.alternate)&&Di(n,l)}function dt(n){if(n.tag===13){var l=gn(n,67108864);l!==null&&mt(l,n,67108864),Cf(n,67108864)}}function Xp(){return _n}function Jg(){for(var n=new Map,l=1,o=0;31>o;o++){var c=Kh(l);n.set(l,c),l*=2}return n}function Xx(n,l,o,c){var f=W.T;W.T=null;var m=xt.p;try{xt.p=jl,Qp(n,l,o,c)}finally{xt.p=m,W.T=f}}function Wg(n,l,o,c){var f=W.T;W.T=null;var m=xt.p;try{xt.p=Hl,Qp(n,l,o,c)}finally{xt.p=m,W.T=f}}function Qp(n,l,o,c){if(Ng){var f=Zp(c);if(f===null)Ei(n,l,c,Og,o),Tf(n,c);else if(Ip(f,n,l,o,c))c.stopPropagation();else if(Tf(n,c),l&4&&-1<Kv.indexOf(n)){for(;f!==null;){var m=Gl(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Xs(m.pendingLanes);if(b!==0){var E=m;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var k=1<<31-On(b);E.entanglements[1]|=k,b&=~k}ta(m),(wt&(Bl|Qi))===ia&&(gg=Va()+Eb,Lu(0))}}break;case 13:E=gn(m,2),E!==null&&mt(E,m,2),pl(),Cf(m,2)}if(m=Zp(c),m===null&&Ei(n,l,c,Og,o),m===f)break;f=m}f!==null&&c.stopPropagation()}else Ei(n,l,c,null,o)}}function Zp(n){return n=Is(n),Xu(n)}function Xu(n){if(Og=null,n=da(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 Og=n,null}function Mi(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 jl;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 Hl;case"message":switch(ty()){case Ao:return jl;case zf:return Hl;case Ku:case ny:return sa;case nh:return Oi;default:return sa}default:return sa}}function Tf(n,l){switch(n){case"focusin":case"focusout":mc=null;break;case"dragenter":case"dragleave":pc=null;break;case"mouseover":case"mouseout":hc=null;break;case"pointerover":case"pointerout":Qh.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zh.delete(l.pointerId)}}function bo(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=Gl(l),l!==null&&dt(l)),n):(n.eventSystemFlags|=c,l=n.targetContainers,f!==null&&l.indexOf(f)===-1&&l.push(f),n)}function Ip(n,l,o,c,f){switch(l){case"focusin":return mc=bo(mc,n,l,o,c,f),!0;case"dragenter":return pc=bo(pc,n,l,o,c,f),!0;case"mouseover":return hc=bo(hc,n,l,o,c,f),!0;case"pointerover":var m=f.pointerId;return Qh.set(m,bo(Qh.get(m)||null,n,l,o,c,f)),!0;case"gotpointercapture":return m=f.pointerId,Zh.set(m,bo(Zh.get(m)||null,n,l,o,c,f)),!0}return!1}function vo(n){var l=da(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,ld(n.priority,function(){if(o.tag===13){var c=Un(o),f=gn(o,c);f!==null&&mt(f,o,c),Cf(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 vl(n){if(n.blockedOn!==null)return!1;for(var l=n.targetContainers;0<l.length;){var o=Zp(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=Gl(o),l!==null&&dt(l),n.blockedOn=o,!1;l.shift()}return!0}function Qu(n,l,o){vl(n)&&o.delete(l)}function Fg(){s0=!1,mc!==null&&vl(mc)&&(mc=null),pc!==null&&vl(pc)&&(pc=null),hc!==null&&vl(hc)&&(hc=null),Qh.forEach(Qu),Zh.forEach(Qu)}function br(n,l){n.blockedOn===l&&(n.blockedOn=null,s0||(s0=!0,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,Fg)))}function $p(n){zg!==n&&(zg=n,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,function(){zg===n&&(zg=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(Xu(c||o)===null)continue;break}var m=Gl(o);m!==null&&(n.splice(l,3),l-=3,o={pending:!0,data:f,method:o.method,action:c},Object.freeze(o),Ea(m,o,c,f))}}))}function Zu(n){function l(k){return br(k,n)}mc!==null&&br(mc,n),pc!==null&&br(pc,n),hc!==null&&br(hc,n),Qh.forEach(l),Zh.forEach(l);for(var o=0;o<xc.length;o++){var c=xc[o];c.blockedOn===n&&(c.blockedOn=null)}for(;0<xc.length&&(o=xc[0],o.blockedOn===null);)vo(o),o.blockedOn===null&&xc.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[ll]||null;if(typeof m=="function")b||$p(o);else if(b){var E=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[ll]||null)E=b.formAction;else if(Xu(f)!==null)continue}else E=b.action;typeof E=="function"?o[c+1]=E:(o.splice(c,3),c-=3),$p(o)}}}function Kp(n){this._internalRoot=n}function Iu(n){this._internalRoot=n}function Jp(n){n[To]&&(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 Vt=requireScheduler(),Wp=React,Fp=ReactDOM,Pp=Symbol.for("react.element"),Ro=Symbol.for("react.transitional.element"),$u=Symbol.for("react.portal"),Ha=Symbol.for("react.fragment"),kf=Symbol.for("react.strict_mode"),Bf=Symbol.for("react.profiler"),We=Symbol.for("react.provider"),vr=Symbol.for("react.consumer"),Rl=Symbol.for("react.context"),_i=Symbol.for("react.forward_ref"),wf=Symbol.for("react.suspense"),Rr=Symbol.for("react.suspense_list"),Eo=Symbol.for("react.memo"),Mn=Symbol.for("react.lazy"),Ni=Symbol.for("react.offscreen"),Qx=Symbol.for("react.memo_cache_sentinel"),Zx=Symbol.iterator,Pg=Symbol.for("react.client.reference"),W=Wp.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,He=Object.assign,jo=0,ut,Df,rn,Ix,Mf,_f,Er;oe.__reactDisabledLog=!0;var Nf,eh,jr=!1,Sr=new(typeof WeakMap=="function"?WeakMap:Map),_n=null,El=!1,Rn=Array.isArray,xt=Fp.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ey=Object.freeze({pending:!1,data:null,method:null,action:null}),th=[],Ar=[],aa=-1,So=Re(null),Cr=Re(null),dn=Re(null),Tr=Re(null),Ua=Object.prototype.hasOwnProperty,nl=Vt.unstable_scheduleCallback,$x=Vt.unstable_cancelCallback,Of=Vt.unstable_shouldYield,_s=Vt.unstable_requestPaint,Va=Vt.unstable_now,ty=Vt.unstable_getCurrentPriorityLevel,Ao=Vt.unstable_ImmediatePriority,zf=Vt.unstable_UserBlockingPriority,Ku=Vt.unstable_NormalPriority,ny=Vt.unstable_LowPriority,nh=Vt.unstable_IdlePriority,ly=Vt.log,ay=Vt.unstable_setDisableYieldValue,Ju=null,Nn=null,Se=null,qn=!1,Gn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",On=Math.clz32?Math.clz32:Lg,sy=Math.log,Wu=Math.LN2,Co=128,kr=4194304,jl=2,Hl=8,sa=32,Oi=268435456,Ns=Math.random().toString(36).slice(2),En="__reactFiber$"+Ns,ll="__reactProps$"+Ns,To="__reactContainer$"+Ns,zi="__reactEvents$"+Ns,oy="__reactListeners$"+Ns,iy="__reactHandles$"+Ns,Kx="__reactResources$"+Ns,ko="__reactMarker$"+Ns,Br=new Set,Os={},lh={},al=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uy={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},Jx=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]*$"),ah={},sh={},Wx=/[\n"\\]/g,Lf=!1,oh=!1,wr=!1,Fx=!1,Px=!1,Hf=!1,Uf=["value","defaultValue"],Dr=!1,Vf=/["'&<>\n\t]|^\s|\s$/,eg="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(" "),qf="applet caption html table td th marquee object template foreignObject desc title".split(" "),Bo=qf.concat(["button"]),wo="dd dt li option optgroup p rp rt".split(" "),zs={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null,containerTagInScope:null},Do={},Mo="http://www.w3.org/1998/Math/MathML",Sl="http://www.w3.org/2000/svg",ih={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"]},uh=/([A-Z])/g,Fu=/^ms-/,cy=/^(?:webkit|moz|o)[A-Z]/,tg=/^-ms-/,Gf=/-(.)/g,ch=/;\s*$/,Pu={},ec={},Mr=!1,rh=!1,tc=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(" ")),dh=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"]]),Li={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"},fh={"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},nc={},Yf=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(al)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,vt=null,G={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},H=Cn(G),Q=He({},G,{view:0,detail:0}),de=Cn(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:hd,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}}),tn=Cn(De),nt=He({},De,{dataTransfer:0}),_o=Cn(nt),ry=He({},Q,{relatedTarget:0}),dy=Cn(ry),Fb=He({},G,{animationName:0,elapsedTime:0,pseudoElement:0}),Pb=Cn(Fb),ev=He({},G,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),tv=Cn(ev),nv=He({},G,{data:0}),o0=Cn(nv),lv=o0,av={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sv={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"},ov={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},iv=He({},Q,{key:function(n){if(n.key){var l=av[n.key]||n.key;if(l!=="Unidentified")return l}return n.type==="keypress"?(n=su(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?sv[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hd,charCode:function(n){return n.type==="keypress"?su(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?su(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),uv=Cn(iv),cv=He({},De,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i0=Cn(cv),rv=He({},Q,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hd}),dv=Cn(rv),fv=He({},G,{propertyName:0,elapsedTime:0,pseudoElement:0}),mv=Cn(fv),pv=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}),hv=Cn(pv),xv=He({},G,{newState:0,oldState:0}),gv=Cn(xv),yv=[9,13,27,32],u0=229,fy=al&&"CompositionEvent"in window,mh=null;al&&"documentMode"in document&&(mh=document.documentMode);var bv=al&&"TextEvent"in window&&!mh,c0=al&&(!fy||mh&&8<mh&&11>=mh),r0=32,d0=String.fromCharCode(r0),f0=!1,Xf=!1,vv={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},ph=null,hh=null,m0=!1;al&&(m0=xd("input")&&(!document.documentMode||9<document.documentMode));var Al=typeof Object.is=="function"?Object.is:Mm,Rv=al&&"documentMode"in document&&11>=document.documentMode,Qf=null,my=null,xh=null,py=!1,Zf={animationend:Ko("Animation","AnimationEnd"),animationiteration:Ko("Animation","AnimationIteration"),animationstart:Ko("Animation","AnimationStart"),transitionrun:Ko("Transition","TransitionRun"),transitionstart:Ko("Transition","TransitionStart"),transitioncancel:Ko("Transition","TransitionCancel"),transitionend:Ko("Transition","TransitionEnd")},hy={},p0={};al&&(p0=document.createElement("div").style,"AnimationEvent"in window||(delete Zf.animationend.animation,delete Zf.animationiteration.animation,delete Zf.animationstart.animation),"TransitionEvent"in window||delete Zf.transitionend.transition);var h0=Jo("animationend"),x0=Jo("animationiteration"),g0=Jo("animationstart"),Ev=Jo("transitionrun"),jv=Jo("transitionstart"),Sv=Jo("transitioncancel"),y0=Jo("transitionend"),b0=new Map,v0="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(" "),gh=1,_r=2,Hi=4,qa=[],If=0,xy=0,lc={};Object.freeze(lc);var Ga=null,$f=null,Tt=0,Av=1,Yn=2,sl=8,Ls=16,R0=64,Kf=Vt.unstable_now,gy=-0,ng=-0,Ul=-1.1,Nr=-0,lg=!1,ag=!1,Hs={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},yh=[],bh=[],vh=[],Rh=[],Eh=[],jh=[],Or=new Set;Hs.recordUnsafeLifecycleWarnings=function(n,l){Or.has(n.type)||(typeof l.componentWillMount=="function"&&l.componentWillMount.__suppressDeprecationWarning!==!0&&yh.push(n),n.mode&sl&&typeof l.UNSAFE_componentWillMount=="function"&&bh.push(n),typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&vh.push(n),n.mode&sl&&typeof l.UNSAFE_componentWillReceiveProps=="function"&&Rh.push(n),typeof l.componentWillUpdate=="function"&&l.componentWillUpdate.__suppressDeprecationWarning!==!0&&Eh.push(n),n.mode&sl&&typeof l.UNSAFE_componentWillUpdate=="function"&&jh.push(n))},Hs.flushPendingUnsafeLifecycleWarnings=function(){var n=new Set;0<yh.length&&(yh.forEach(function(E){n.add(X(E)||"Component"),Or.add(E.type)}),yh=[]);var l=new Set;0<bh.length&&(bh.forEach(function(E){l.add(X(E)||"Component"),Or.add(E.type)}),bh=[]);var o=new Set;0<vh.length&&(vh.forEach(function(E){o.add(X(E)||"Component"),Or.add(E.type)}),vh=[]);var c=new Set;0<Rh.length&&(Rh.forEach(function(E){c.add(X(E)||"Component"),Or.add(E.type)}),Rh=[]);var f=new Set;0<Eh.length&&(Eh.forEach(function(E){f.add(X(E)||"Component"),Or.add(E.type)}),Eh=[]);var m=new Set;if(0<jh.length&&(jh.forEach(function(E){m.add(X(E)||"Component"),Or.add(E.type)}),jh=[]),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 sg=new Map,E0=new Set;Hs.recordLegacyContextWarning=function(n,l){for(var o=null,c=n;c!==null;)c.mode&sl&&(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."):!E0.has(n.type)&&(c=sg.get(o),n.type.contextTypes!=null||n.type.childContextTypes!=null||l!==null&&typeof l.getChildContext=="function")&&(c===void 0&&(c=[],sg.set(o,c)),c.push(n))},Hs.flushLegacyContextWarning=function(){sg.forEach(function(n){if(n.length!==0){var l=n[0],o=new Set;n.forEach(function(f){o.add(X(f)||"Component"),E0.add(f.type)});var c=z(o);se(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)})}})},Hs.discardPendingWarnings=function(){yh=[],bh=[],vh=[],Rh=[],Eh=[],jh=[],sg=new Map};var yy=new WeakMap,Jf=[],Wf=0,og=null,ig=0,Ya=[],Xa=0,zr=null,Ui=1,Vi="",Cl=null,Xn=null,et=!1,qi=!1,Qa=null,Us=null,No=!1,by=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."),ug=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`"),j0=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."),vy={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.')}},Sh=null,cg=!1,S0={"react-stack-bottom-frame":function(n,l,o){var c=El;El=!0;try{return n(l,o)}finally{El=c}}},Ry=S0["react-stack-bottom-frame"].bind(S0),A0={"react-stack-bottom-frame":function(n){var l=El;El=!0;try{return n.render()}finally{El=l}}},C0=A0["react-stack-bottom-frame"].bind(A0),T0={"react-stack-bottom-frame":function(n,l){try{l.componentDidMount()}catch(o){lt(n,n.return,o)}}},Ey=T0["react-stack-bottom-frame"].bind(T0),k0={"react-stack-bottom-frame":function(n,l,o,c,f){try{l.componentDidUpdate(o,c,f)}catch(m){lt(n,n.return,m)}}},B0=k0["react-stack-bottom-frame"].bind(k0),w0={"react-stack-bottom-frame":function(n,l){var o=l.stack;n.componentDidCatch(l.value,{componentStack:o!==null?o:""})}},Cv=w0["react-stack-bottom-frame"].bind(w0),D0={"react-stack-bottom-frame":function(n,l,o){try{o.componentWillUnmount()}catch(c){lt(n,l,c)}}},M0=D0["react-stack-bottom-frame"].bind(D0),_0={"react-stack-bottom-frame":function(n){var l=n.create;return n=n.inst,l=l(),n.destroy=l}},Tv=_0["react-stack-bottom-frame"].bind(_0),N0={"react-stack-bottom-frame":function(n,l,o){try{o()}catch(c){lt(n,l,c)}}},kv=N0["react-stack-bottom-frame"].bind(N0),O0={"react-stack-bottom-frame":function(n){var l=n._init;return l(n._payload)}},ac=O0["react-stack-bottom-frame"].bind(O0),Ff=null,Ah=0,Qe=null,jy,z0=jy=!1,L0={},H0={},U0={};N=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(!L0[f]){L0[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+".")),se(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 Lr=Gm(!0),V0=Gm(!1),Pf=Re(null),rg=Re(0),Za=Re(null),Oo=null,em=1,Ch=2,jn=Re(0),Ia=0,$a=1,Tl=2,Qn=4,Sn=8,Bv=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()})}},wv=Vt.unstable_scheduleCallback,Dv=Vt.unstable_NormalPriority,An={$$typeof:Rl,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},Th=null,Sy=0,Hr=0,tm=null,q0=W.S;W.S=function(n,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&yx(n,l),q0!==null&&q0(n,l)};var Ur=Re(null),nm,G0=new Set,Y0=new Set,Ay=new Set,X0=new Set,sc=0,Oe=null,gt=null,fn=null,dg=!1,lm=!1,Vr=!1,fg=0,kh=0,Gi=null,Mv=0,_v=25,F=null,Ka=null,Yi=-1,Bh=!1,Cy=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},zo={readContext:yt,use:cs,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t};zo.useCacheRefresh=_t,zo.useMemoCache=_t,zo.useHostTransitionStatus=_t,zo.useFormState=_t,zo.useActionState=_t,zo.useOptimistic=_t;var oc=null,qr=null,ic=null,Gr=null,Vl=null,kl=null,uc=null;oc={readContext:function(n){return yt(n)},use:cs,useCallback:function(n,l){return F="useCallback",Ze(),li(l),Dd(n,l)},useContext:function(n){return F="useContext",Ze(),yt(n)},useEffect:function(n,l){return F="useEffect",Ze(),li(l),lo(n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",Ze(),li(o),gu(n,l,o)},useInsertionEffect:function(n,l){F="useInsertionEffect",Ze(),li(l),no(4,Tl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",Ze(),li(l),hu(n,l)},useMemo:function(n,l){F="useMemo",Ze(),li(l);var o=W.H;W.H=Vl;try{return Md(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",Ze();var c=W.H;W.H=Vl;try{return Ps(n,l,o)}finally{W.H=c}},useRef:function(n){return F="useRef",Ze(),ui(n)},useState:function(n){F="useState",Ze();var l=W.H;W.H=Vl;try{return bn(n)}finally{W.H=l}},useDebugValue:function(){F="useDebugValue",Ze()},useDeferredValue:function(n,l){return F="useDeferredValue",Ze(),yu(n,l)},useTransition:function(){return F="useTransition",Ze(),Jl()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",Ze(),Pn(n,l,o)},useId:function(){return F="useId",Ze(),Wm()},useCacheRefresh:function(){return F="useCacheRefresh",Ze(),Fm()}},oc.useMemoCache=an,oc.useHostTransitionStatus=ci,oc.useFormState=function(n,l){return F="useFormState",Ze(),zc(),va(n,l)},oc.useActionState=function(n,l){return F="useActionState",Ze(),va(n,l)},oc.useOptimistic=function(n){return F="useOptimistic",Ze(),Kt(n)},qr={readContext:function(n){return yt(n)},use:cs,useCallback:function(n,l){return F="useCallback",ye(),Dd(n,l)},useContext:function(n){return F="useContext",ye(),yt(n)},useEffect:function(n,l){return F="useEffect",ye(),lo(n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",ye(),gu(n,l,o)},useInsertionEffect:function(n,l){F="useInsertionEffect",ye(),no(4,Tl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",ye(),hu(n,l)},useMemo:function(n,l){F="useMemo",ye();var o=W.H;W.H=Vl;try{return Md(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",ye();var c=W.H;W.H=Vl;try{return Ps(n,l,o)}finally{W.H=c}},useRef:function(n){return F="useRef",ye(),ui(n)},useState:function(n){F="useState",ye();var l=W.H;W.H=Vl;try{return bn(n)}finally{W.H=l}},useDebugValue:function(){F="useDebugValue",ye()},useDeferredValue:function(n,l){return F="useDeferredValue",ye(),yu(n,l)},useTransition:function(){return F="useTransition",ye(),Jl()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",ye(),Pn(n,l,o)},useId:function(){return F="useId",ye(),Wm()},useCacheRefresh:function(){return F="useCacheRefresh",ye(),Fm()}},qr.useMemoCache=an,qr.useHostTransitionStatus=ci,qr.useFormState=function(n,l){return F="useFormState",ye(),zc(),va(n,l)},qr.useActionState=function(n,l){return F="useActionState",ye(),va(n,l)},qr.useOptimistic=function(n){return F="useOptimistic",ye(),Kt(n)},ic={readContext:function(n){return yt(n)},use:cs,useCallback:function(n,l){return F="useCallback",ye(),Ra(n,l)},useContext:function(n){return F="useContext",ye(),yt(n)},useEffect:function(n,l){F="useEffect",ye(),Jt(2048,Sn,n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",ye(),qc(n,l,o)},useInsertionEffect:function(n,l){return F="useInsertionEffect",ye(),Jt(4,Tl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",ye(),Jt(4,Qn,n,l)},useMemo:function(n,l){F="useMemo",ye();var o=W.H;W.H=kl;try{return ds(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",ye();var c=W.H;W.H=kl;try{return rs(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=kl;try{return rs(kn)}finally{W.H=n}},useDebugValue:function(){F="useDebugValue",ye()},useDeferredValue:function(n,l){return F="useDeferredValue",ye(),Km(n,l)},useTransition:function(){return F="useTransition",ye(),qt()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",ye(),ga(n,l,o)},useId:function(){return F="useId",ye(),tt().memoizedState},useCacheRefresh:function(){return F="useCacheRefresh",ye(),tt().memoizedState}},ic.useMemoCache=an,ic.useHostTransitionStatus=ci,ic.useFormState=function(n){return F="useFormState",ye(),zc(),Vc(n)},ic.useActionState=function(n){return F="useActionState",ye(),Vc(n)},ic.useOptimistic=function(n,l){return F="useOptimistic",ye(),Pe(n,l)},Gr={readContext:function(n){return yt(n)},use:cs,useCallback:function(n,l){return F="useCallback",ye(),Ra(n,l)},useContext:function(n){return F="useContext",ye(),yt(n)},useEffect:function(n,l){F="useEffect",ye(),Jt(2048,Sn,n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",ye(),qc(n,l,o)},useInsertionEffect:function(n,l){return F="useInsertionEffect",ye(),Jt(4,Tl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",ye(),Jt(4,Qn,n,l)},useMemo:function(n,l){F="useMemo",ye();var o=W.H;W.H=uc;try{return ds(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",ye();var c=W.H;W.H=uc;try{return Bn(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=uc;try{return Bn(kn)}finally{W.H=n}},useDebugValue:function(){F="useDebugValue",ye()},useDeferredValue:function(n,l){return F="useDeferredValue",ye(),_d(n,l)},useTransition:function(){return F="useTransition",ye(),Yc()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",ye(),ga(n,l,o)},useId:function(){return F="useId",ye(),tt().memoizedState},useCacheRefresh:function(){return F="useCacheRefresh",ye(),tt().memoizedState}},Gr.useMemoCache=an,Gr.useHostTransitionStatus=ci,Gr.useFormState=function(n){return F="useFormState",ye(),zc(),oi(n)},Gr.useActionState=function(n){return F="useActionState",ye(),oi(n)},Gr.useOptimistic=function(n,l){return F="useOptimistic",ye(),$l(n,l)},Vl={readContext:function(n){return T(),yt(n)},use:function(n){return C(),cs(n)},useCallback:function(n,l){return F="useCallback",C(),Ze(),Dd(n,l)},useContext:function(n){return F="useContext",C(),Ze(),yt(n)},useEffect:function(n,l){return F="useEffect",C(),Ze(),lo(n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",C(),Ze(),gu(n,l,o)},useInsertionEffect:function(n,l){F="useInsertionEffect",C(),Ze(),no(4,Tl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",C(),Ze(),hu(n,l)},useMemo:function(n,l){F="useMemo",C(),Ze();var o=W.H;W.H=Vl;try{return Md(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",C(),Ze();var c=W.H;W.H=Vl;try{return Ps(n,l,o)}finally{W.H=c}},useRef:function(n){return F="useRef",C(),Ze(),ui(n)},useState:function(n){F="useState",C(),Ze();var l=W.H;W.H=Vl;try{return bn(n)}finally{W.H=l}},useDebugValue:function(){F="useDebugValue",C(),Ze()},useDeferredValue:function(n,l){return F="useDeferredValue",C(),Ze(),yu(n,l)},useTransition:function(){return F="useTransition",C(),Ze(),Jl()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",C(),Ze(),Pn(n,l,o)},useId:function(){return F="useId",C(),Ze(),Wm()},useCacheRefresh:function(){return F="useCacheRefresh",Ze(),Fm()},useMemoCache:function(n){return C(),an(n)}},Vl.useHostTransitionStatus=ci,Vl.useFormState=function(n,l){return F="useFormState",C(),Ze(),va(n,l)},Vl.useActionState=function(n,l){return F="useActionState",C(),Ze(),va(n,l)},Vl.useOptimistic=function(n){return F="useOptimistic",C(),Ze(),Kt(n)},kl={readContext:function(n){return T(),yt(n)},use:function(n){return C(),cs(n)},useCallback:function(n,l){return F="useCallback",C(),ye(),Ra(n,l)},useContext:function(n){return F="useContext",C(),ye(),yt(n)},useEffect:function(n,l){F="useEffect",C(),ye(),Jt(2048,Sn,n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",C(),ye(),qc(n,l,o)},useInsertionEffect:function(n,l){return F="useInsertionEffect",C(),ye(),Jt(4,Tl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",C(),ye(),Jt(4,Qn,n,l)},useMemo:function(n,l){F="useMemo",C(),ye();var o=W.H;W.H=kl;try{return ds(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",C(),ye();var c=W.H;W.H=kl;try{return rs(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=kl;try{return rs(kn)}finally{W.H=n}},useDebugValue:function(){F="useDebugValue",C(),ye()},useDeferredValue:function(n,l){return F="useDeferredValue",C(),ye(),Km(n,l)},useTransition:function(){return F="useTransition",C(),ye(),qt()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",C(),ye(),ga(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(),an(n)}},kl.useHostTransitionStatus=ci,kl.useFormState=function(n){return F="useFormState",C(),ye(),Vc(n)},kl.useActionState=function(n){return F="useActionState",C(),ye(),Vc(n)},kl.useOptimistic=function(n,l){return F="useOptimistic",C(),ye(),Pe(n,l)},uc={readContext:function(n){return T(),yt(n)},use:function(n){return C(),cs(n)},useCallback:function(n,l){return F="useCallback",C(),ye(),Ra(n,l)},useContext:function(n){return F="useContext",C(),ye(),yt(n)},useEffect:function(n,l){F="useEffect",C(),ye(),Jt(2048,Sn,n,l)},useImperativeHandle:function(n,l,o){return F="useImperativeHandle",C(),ye(),qc(n,l,o)},useInsertionEffect:function(n,l){return F="useInsertionEffect",C(),ye(),Jt(4,Tl,n,l)},useLayoutEffect:function(n,l){return F="useLayoutEffect",C(),ye(),Jt(4,Qn,n,l)},useMemo:function(n,l){F="useMemo",C(),ye();var o=W.H;W.H=kl;try{return ds(n,l)}finally{W.H=o}},useReducer:function(n,l,o){F="useReducer",C(),ye();var c=W.H;W.H=kl;try{return Bn(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=kl;try{return Bn(kn)}finally{W.H=n}},useDebugValue:function(){F="useDebugValue",C(),ye()},useDeferredValue:function(n,l){return F="useDeferredValue",C(),ye(),_d(n,l)},useTransition:function(){return F="useTransition",C(),ye(),Yc()},useSyncExternalStore:function(n,l,o){return F="useSyncExternalStore",C(),ye(),ga(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(),an(n)}},uc.useHostTransitionStatus=ci,uc.useFormState=function(n){return F="useFormState",C(),ye(),oi(n)},uc.useActionState=function(n){return F="useActionState",C(),ye(),oi(n)},uc.useOptimistic=function(n,l){return F="useOptimistic",C(),ye(),$l(n,l)};var Q0={},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,tb=new Set;Object.freeze(Q0);var Ty={isMounted:function(n){var l=_n;if(l!==null&&El&&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=Un(n),f=ys(c);f.payload=l,o!=null&&(Nd(o),f.callback=o),l=bs(n,f,c),l!==null&&(mt(l,n,c),Fc(l,n,c)),In(n,c)},enqueueReplaceState:function(n,l,o){n=n._reactInternals;var c=Un(n),f=ys(c);f.tag=db,f.payload=l,o!=null&&(Nd(o),f.callback=o),l=bs(n,f,c),l!==null&&(mt(l,n,c),Fc(l,n,c)),In(n,c)},enqueueForceUpdate:function(n,l){n=n._reactInternals;var o=Un(n),c=ys(o);c.tag=fb,l!=null&&(Nd(l),c.callback=l),l=bs(n,c,o),l!==null&&(mt(l,n,o),Fc(l,n,o)),Se!==null&&typeof Se.markForceUpdateScheduled=="function"&&Se.markForceUpdateScheduled(n,o)}},mg=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)},am=null,ky=null,nb=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."),zn=!1,lb={},ab={},sb={},ob={},sm=!1,ib={},By={},wy={dehydrated:null,treeContext:null,retryLane:0},ub=!1,Dy=Re(null),My=Re(null),cb={},pg=null,om=null,im=!1,rb=0,db=1,fb=2,_y=3,cc=!1,mb=!1,Ny=null,Oy=!1,pb=null;pb=new Set;var Xi=!1,Yt=!1,zy=!1,hb=typeof WeakSet=="function"?WeakSet:Set,Ln=null,um=null,cm=null,xb=!1,mn=null,oa=!1,Vs=null,wh=8192,gb=!1;try{var yb=Object.preventExtensions({})}catch{gb=!0}var Nv={getCacheForType:function(n){var l=yt(An),o=l.data.get(n);return o===void 0&&(o=n(),l.data.set(n,o)),o},getOwner:function(){return _n}};if(typeof Symbol=="function"&&Symbol.for){var Dh=Symbol.for;Dh("selector.component"),Dh("selector.has_pseudo_class"),Dh("selector.role"),Dh("selector.test_id"),Dh("selector.text")}var Ov=[],zv=typeof WeakMap=="function"?WeakMap:Map,ia=0,Bl=2,Qi=4,Zi=0,Mh=1,rm=2,Ly=3,Yr=4,bb=5,hg=6,wt=ia,Rt=null,Ke=null,Je=0,ql=0,_h=1,Xr=2,Nh=3,vb=4,Hy=5,dm=6,Oh=7,Uy=8,Et=ql,ua=null,Ii=!1,fm=!1,Vy=!1,Lo=0,Xt=Zi,rc=0,dc=0,qy=0,ca=0,Qr=0,zh=null,qs=null,xg=!1,Gy=0,Rb=300,gg=1/0,Eb=500,Lh=null,fc=null,yg=!1,Zr=null,Hh=0,Yy=0,Xy=null,Lv=50,Uh=0,Qy=null,Zy=!1,bg=!1,Hv=50,Ir=0,Vh=null,mm=!1,jb=0,Uv=1,Vv=2,vg=null,Sb=!1,Ab=new Set,qv={},Rg=null,pm=null,Iy=!1,$y=!1,Eg=!1,Ky=!1,$r=0,Jy={};(function(){for(var n=0;n<v0.length;n++){var l=v0[n],o=l.toLowerCase();l=l[0].toUpperCase()+l.slice(1),cl(o,"on"+l)}cl(h0,"onAnimationEnd"),cl(x0,"onAnimationIteration"),cl(g0,"onAnimationStart"),cl("dblclick","onDoubleClick"),cl("focusin","onFocus"),cl("focusout","onBlur"),cl(Ev,"onTransitionRun"),cl(jv,"onTransitionStart"),cl(Sv,"onTransitionCancel"),cl(y0,"onTransitionEnd")})(),fa("onMouseEnter",["mouseout","mouseover"]),fa("onMouseLeave",["mouseout","mouseover"]),fa("onPointerEnter",["pointerout","pointerover"]),fa("onPointerLeave",["pointerout","pointerover"]),ts("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ts("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ts("onBeforeInput",["compositionend","keypress","textInput","paste"]),ts("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ts("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ts("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qh="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(" "),Wy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qh)),jg="_reactListening"+Math.random().toString(36).slice(2),Cb=!1,Tb=!1,Sg=!1,kb=!1,Ag=!1,Cg=!1,Bb=!1,Tg={},Gv=/\r\n?/g,Yv=/\u0000|\uFFFD/g,Kr="http://www.w3.org/1999/xlink",Fy="http://www.w3.org/XML/1998/namespace",Xv="javascript:throw new Error('React form unexpectedly submitted.')",Qv="suppressHydrationWarning",kg="$",Bg="/$",Jr="$?",Wr="$!",Py="F!",wb="F",Zv="style",$i=0,hm=1,wg=2,e0=null,t0=null,Db={dialog:!0,webview:!0},n0=null,Mb=typeof setTimeout=="function"?setTimeout:void 0,Iv=typeof clearTimeout=="function"?clearTimeout:void 0,l0=-1,_b=typeof Promise=="function"?Promise:void 0,$v=typeof queueMicrotask=="function"?queueMicrotask:typeof _b<"u"?function(n){return _b.resolve(null).then(n).catch(Fe)}:Mb,Fr=0,Gh=1,Nb=2,Ob=3,Ja=4,Wa=new Map,zb=new Set,Ki=xt.d;xt.d={f:function(){var n=Ki.f(),l=pl();return n||l},r:function(n){var l=Gl(n);l!==null&&l.tag===5&&l.type==="form"?fs(l):Ki.r(n)},D:function(n){Ki.D(n),Gu("dns-prefetch",n,null)},C:function(n,l){Ki.C(n,l),Gu("preconnect",n,l)},L:function(n,l,o){Ki.L(n,l,o);var c=xm;if(c&&n&&l){var f='link[rel="preload"][as="'+wl(l)+'"]';l==="image"&&o&&o.imageSrcSet?(f+='[imagesrcset="'+wl(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(f+='[imagesizes="'+wl(o.imageSizes)+'"]')):f+='[href="'+wl(n)+'"]';var m=f;switch(l){case"style":m=ki(n);break;case"script":m=Bi(n)}Wa.has(m)||(n=He({rel:"preload",href:l==="image"&&o&&o.imageSrcSet?void 0:n,as:l},o),Wa.set(m,n),c.querySelector(f)!==null||l==="style"&&c.querySelector(en(m))||l==="script"&&c.querySelector(gr(m))||(l=c.createElement("link"),Bt(l,"link",n),Zt(l),c.head.appendChild(l)))}},m:function(n,l){Ki.m(n,l);var o=xm;if(o&&n){var c=l&&typeof l.as=="string"?l.as:"script",f='link[rel="modulepreload"][as="'+wl(c)+'"][href="'+wl(n)+'"]',m=f;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Bi(n)}if(!Wa.has(m)&&(n=He({rel:"modulepreload",href:n},l),Wa.set(m,n),o.querySelector(f)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(gr(m)))return}c=o.createElement("link"),Bt(c,"link",n),Zt(c),o.head.appendChild(c)}}},X:function(n,l){Ki.X(n,l);var o=xm;if(o&&n){var c=Go(o).hoistableScripts,f=Bi(n),m=c.get(f);m||(m=o.querySelector(gr(f)),m||(n=He({src:n,async:!0},l),(l=Wa.get(f))&&yo(n,l),m=o.createElement("script"),Zt(m),Bt(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){Ki.S(n,l,o);var c=xm;if(c&&n){var f=Go(c).hoistableStyles,m=ki(n);l=l||"default";var b=f.get(m);if(!b){var E={loading:Fr,preload:null};if(b=c.querySelector(en(m)))E.loading=Gh|Ja;else{n=He({rel:"stylesheet",href:n,"data-precedence":l},o),(o=Wa.get(m))&&yr(n,o);var k=b=c.createElement("link");Zt(k),Bt(k,"link",n),k._p=new Promise(function(w,I){k.onload=w,k.onerror=I}),k.addEventListener("load",function(){E.loading|=Gh}),k.addEventListener("error",function(){E.loading|=Nb}),E.loading|=Ja,wi(b,l,c)}b={type:"stylesheet",instance:b,count:1,state:E},f.set(m,b)}}},M:function(n,l){Ki.M(n,l);var o=xm;if(o&&n){var c=Go(o).hoistableScripts,f=Bi(n),m=c.get(f);m||(m=o.querySelector(gr(f)),m||(n=He({src:n,async:!0,type:"module"},l),(l=Wa.get(f))&&yo(n,l),m=o.createElement("script"),Zt(m),Bt(m,"link",n),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(f,m))}}};var xm=typeof document>"u"?null:document,Dg=null,Yh=null,a0=null,Mg=null,Pr=ey,Xh={$$typeof:Rl,Provider:null,Consumer:null,_currentValue:Pr,_currentValue2:Pr,_threadCount:0},Lb="%c%s%c ",Hb="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",Ub="",_g=" ",Vb=Function.prototype.bind,qb=!1,Gb=null,Yb=null,Xb=null,Qb=null,Zb=null,Ib=null,$b=null,Kb=null,Jb=null;Gb=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=gn(n,2),o!==null&&mt(o,n,2))},Yb=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=gn(n,2),o!==null&&mt(o,n,2))},Xb=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=gn(n,2),o!==null&&mt(o,n,2))},Qb=function(n,l,o){n.pendingProps=h(n.memoizedProps,l,0,o),n.alternate&&(n.alternate.pendingProps=n.pendingProps),l=gn(n,2),l!==null&&mt(l,n,2)},Zb=function(n,l){n.pendingProps=v(n.memoizedProps,l,0),n.alternate&&(n.alternate.pendingProps=n.pendingProps),l=gn(n,2),l!==null&&mt(l,n,2)},Ib=function(n,l,o){n.pendingProps=x(n.memoizedProps,l,o),n.alternate&&(n.alternate.pendingProps=n.pendingProps),l=gn(n,2),l!==null&&mt(l,n,2)},$b=function(n){var l=gn(n,2);l!==null&&mt(l,n,2)},Kb=function(n){A=n},Jb=function(n){R=n};var Ng=!0,Og=null,s0=!1,mc=null,pc=null,hc=null,Qh=new Map,Zh=new Map,xc=[],Kv="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(" "),zg=null;if(Iu.prototype.render=Kp.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=Un(l);Yp(l,c,n,o,null,null)},Iu.prototype.unmount=Kp.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;(wt&(Bl|Qi))!==ia&&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."),Yx(null,n,null,null),pl(),l[To]=null}},Iu.prototype.unstable_scheduleHydration=function(n){if(n){var l=yc();n={blockedOn:null,target:n,priority:l};for(var o=0;o<xc.length&&l!==0&&l<xc[o].priority;o++);xc.splice(o,0,n),o===0&&vo(n)}},function(){var n=Wp.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"),xt.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:da,reconcilerVersion:"19.0.0"};return n.overrideHookState=Gb,n.overrideHookStateDeletePath=Yb,n.overrideHookStateRenamePath=Xb,n.overrideProps=Qb,n.overridePropsDeletePath=Zb,n.overridePropsRenamePath=Ib,n.scheduleUpdate=$b,n.setErrorHandler=Kb,n.setSuspenseHandler=Jb,n.scheduleRefresh=q,n.scheduleRoot=Z,n.setRefreshHandler=Y,n.getCurrentFiber=Xp,n.getLaneLabelMap=Jg,n.injectProfilingHooks=td,ed(n)}()&&al&&window.top===window.self&&(-1<navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Edge")===-1||-1<navigator.userAgent.indexOf("Firefox"))){var Wb=window.location.protocol;/^(https?|file):$/.test(Wb)&&console.info("%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools"+(Wb==="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.");Jp(n);var o=!1,c="",f=Qc,m=np,b=xs,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===Ro&&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=qp(n,1,!1,null,null,o,c,f,m,b,E,null),n[To]=l.current,mf(n.nodeType===8?n.parentNode:n),new Kp(l)},reactDomClient_development.hydrateRoot=function(n,l,o){if(!P(n))throw Error("Target container is not a DOM element.");Jp(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=Qc,b=np,E=xs,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=qp(n,1,!0,l,o??null,c,f,m,b,E,k,w),l.context=Gp(null),o=l.current,c=Un(o),f=ys(c),f.callback=null,bs(o,f,c),l.current.lanes=c,pn(l,c),ta(l),n[To]=l.current,mf(n),new Iu(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:v?jsxRuntime.jsxRuntimeExports.jsx(v,{onSelect:R}):null})})]})};MediaManagerModal.displayName="MediaManagerModal";const ImagePickerField=({value:r,onChange:h,id:x,onBlur:g})=>{const v=useBuilderProp("mediaManagerComponent",null),{t:R}=reactI18next.useTranslation(),A=!lodashEs.isEmpty(v);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,O]=React.useState("page"),[N,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";O(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))},oe=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=>O(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:N,onChange:J=>ve(J.target.value),onKeyDown:oe,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:N&&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"),' "',N,'"']}):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"]})})},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"}),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:O})=>{const{selectedLang:N,fallbackLang:z,languages:Z}=useLanguages(),q=lodashEs.isEmpty(Z)?"":lodashEs.isEmpty(N)?z:N,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:O==null?void 0:O.length})})]}),(O==null?void 0:O.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(),[C]=jotai.useAtom(chaiRjsfWidgetsAtom),[T]=jotai.useAtom(chaiRjsfFieldsAtom),[O]=jotai.useAtom(chaiRjsfTemplatesAtom);React.useEffect(()=>{A(g)},[r,j]);const N=web.useThrottledCallback(async({formData:z},Z)=>{v({formData:z},Z)},[v,j],1e3);return jsxRuntime.jsxRuntimeExports.jsx(RjForm,{widgets:{binding:BindingWidget,richtext:RichTextEditorField,icon:IconPickerField,image:ImagePickerField,code:CodeEditor,colCount:RowColField,...C},fields:{link:LinkField,...T},templates:{FieldTemplate:CustomFieldTemplate,ButtonTemplates:{AddButton:CustomAddButton},...O},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator,uiSchema:x,schema:h,formData:R,onChange:({formData:z},Z)=>{Z&&(A(z),N({formData:z},Z))}},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),O=useWrapperBlock(),N=runtime.getRegisteredChaiBlock(O==null?void 0:O._type),z=formDataWithSelectedLang(O,r,N),Z=({formData:oe},pe,ve)=>{if(pe&&(A==null?void 0:A._id)===h._id){const Me=pe.replace("root.","");g([h._id],{[Me]:lodashEs.get(oe,Me)},ve)}},q=React.useCallback(lodashEs.debounce(({formData:oe},pe,ve)=>{Z({formData:oe},pe,ve),j(oe)},1500),[h==null?void 0:h._id,r]),Y=({formData:oe},pe)=>{if(pe){const ve=pe.replace("root.","");x([h._id],convertDotNotationToObject(ve,lodashEs.get(oe,ve.split(".")))),q({formData:oe},pe,{[ve]:lodashEs.get(A,ve)})}},P=({formData:oe},pe)=>{if(pe){const ve=pe.replace("root.","");x([O._id],convertDotNotationToObject(ve,lodashEs.get(oe,ve.split(".")))),q({formData:oe},pe,{[ve]:lodashEs.get(A,ve)})}};lodashEs.keys(lodashEs.get(R,"_bindings",{}));const{schema:he,uiSchema:te}=React.useMemo(()=>{const oe=h==null?void 0:h._type;if(oe)return runtime.getBlockFormSchemas(oe)},[h]),{wrapperSchema:ue,wrapperUiSchema:X}=React.useMemo(()=>{if(!O||!(O!=null&&O._type))return{wrapperSchema:{},wrapperUiSchema:{}};const oe=O==null?void 0:O._type,{schema:pe={},uiSchema:ve={}}=runtime.getBlockFormSchemas(oe);return{wrapperSchema:pe,wrapperUiSchema:ve}},[O]);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar overflow-x-hidden px-px",children:[!lodashEs.isEmpty(O)&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mb-4 rounded border bg-zinc-100 px-1",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:()=>T(oe=>!oe),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(O._type)," settings"," ",O._name&&jsxRuntime.jsxRuntimeExports.jsxs("span",{className:"text-[11px] font-light text-slate-400",children:["(",O._name,")"]})]}),C&&jsxRuntime.jsxRuntimeExports.jsx(JSONForm,{id:O==null?void 0:O._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,O]=React.useState();React.useEffect(()=>{var z;(z=j.current)==null||z.focus()},[]);const N=z=>{const{usage:Z}=z||{};!v&&Z&&O(Z),C.current=setTimeout(()=>O(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),O(void 0),x("styles",r,R,N))}}),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),O(void 0),x("styles",r,R,N)},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:O}=contextMenu.useToast(),N=(pe=lodashEs.first(x))==null?void 0:pe.prop,z=lodashEs.reject((lodashEs.get(g,N,"").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(se=>({...se,item:{...se.item,name:be+se.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"},oe=()=>{if(navigator.clipboard===void 0){O({title:h("Clipboard not supported"),description:h("Please use Chrome, Firefox or Safari"),variant:"destructive"});return}navigator.clipboard.writeText(z.join(" ")),O({title:h("Copied"),description:h("Classes copied to clipboard")})};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex 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:oe,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: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("-"),O=lodashEs.get(T,"1",""),N=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(O))return A([]);A(["50","100","200","300","400","500","600","700","800","900"])},[O]);const Z=React.useCallback(Y=>{C({color:O,shade:Y})},[O]);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:O,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:N,disabled:!O||!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:O}=r,[N,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 oe=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"):N;if(be==="auto"||be==="none"){oe(`${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):oe(je)},[oe,pe,g,N,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"){oe(`${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}]`;oe(je)},[oe,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:N==="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(N)!==-1?null:jsxRuntime.jsxRuntimeExports.jsx("input",{readOnly:N==="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}`,se=`${ge.startsWith("-")?"-":""}${j}[${ge.replace("-","")}${N==="-"?"":N}]`;pe(se)},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:N}),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:N,onSelect:J=>{x(!1),z(J),Me(J)}})})})]})]}),["none","auto"].indexOf(N)!==-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("-","")}${N==="-"?"":N}]`;oe(ge)},onDrag:J=>{if(lodashEs.isEmpty(J))return;P(J);const xe=`${J}`,ge=`${xe.startsWith("-")?"-":""}${j}[${xe.replace("-","")}${N==="-"?"":N}]`;pe(ge)},currentValue:g,unit:N,negative:O,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(),[,O]=useCanvasWidth(),N=useCurrentClassByProperty(v),z=useAddClassesToBlocks(),Z=useRemoveClassesFromBlocks(),[q]=useSelectedBlockIds(),Y=React.useMemo(()=>lodashEs.get(N,"fullCls",""),[N]),P=React.useCallback((pe,ve=!0)=>{const Me={dark:C,mq:O,mod:T,cls:pe,property:v,fullCls:""};(C||T!=="")&&(Me.mq="xs");const J=generateFullClsName(Me);z(q,[J],ve)},[q,C,O,T,v,z]),he=React.useCallback(()=>{Z(q,[Y])},[q,Y,Z]),te=React.useMemo(()=>canChangeClass(N,O),[N,O]);React.useEffect(()=>{R(te,N)},[te,R,N]);const[,,ue]=useCanvasWidth(),X=React.useCallback(pe=>{ue({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[pe])},[ue]),oe=lodashEs.get(N,"dark",null)===C&&lodashEs.get(N,"mod",null)===T&&lodashEs.get(N,"mq",null)===O;return jsxRuntime.jsxRuntimeExports.jsx(BlockStyleProvider,{canChange:te,canReset:N&&oe,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] ${N&&!oe?"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(N,"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:oe?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&&N?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(N,"mq")),C&&!N.dark?"(Light mode)":""]}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>X(lodashEs.get(N,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",lodashEs.get(N,"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),O=useSelectedBlockCurrentClasses(),N=React.useCallback(z=>lodashEs.map(O,"property").includes(z),[O]);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:N(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 O=!lodashEs.get(R,"negative",!1),N=lodashEs.get(R,"cssProperty","");let z=parseFloat(R.dragStartValue);z=isNaN(z)?0:z;let Z=MAPPER[R.dragUnit];(lodashEs.startsWith(N,"scale")||N==="opacity")&&(Z=10);let Y=(R.dragStartY-T.pageY)/Z+z;O&&Y<0&&(Y=0),N==="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 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(),[,O]=useSelectedBlockIds(),{clearHighlight:N}=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(()=>{O([]),N()},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)})})]})})},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 N,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:((N=v.find(X=>X.key==="href"))==null?void 0:N.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||[],oe=>(oe==null?void 0:oe.tagName)!=="span");g.content=getTextContent(ue);const X=lodashEs.find(x.children||[],oe=>(oe==null?void 0:oe.tagName)==="span"&&lodashEs.some(oe.children||[],pe=>(pe==null?void 0:pe.tagName)==="svg"));if(X){const oe=lodashEs.find(X.children||[],pe=>(pe==null?void 0:pe.tagName)==="svg");if(oe){g.icon=himalaya.stringify([oe]);const{height:pe,width:ve}=getSvgDimensions(oe,"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"}),oe=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-${oe}`,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 O=traverseNodes(x.children,{block:g,node:x});return[g,...O]}),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")})})]})},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(O=>jsxRuntime.jsxRuntimeExports.jsx(CoreBlock,{parentId:x,position:g,block:O,disabled:!canAcceptChildBlock(j,O.type)||!canBeNestedInside(j,O.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",[]),O=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:N=>{j(""),A(N)},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,N=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsTrigger,{value:N.key,children:React.createElement(N.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,N=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TabsContent,{value:N.key,children:React.createElement(N.tabContent,{close:O,parentId:x,position:g})}))]})]})},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:O}=useBlockHighlight(),N=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 oe=new Image;oe.src=r.preview,oe.onload=()=>{he.dataTransfer.setDragImage(oe,0,0)}}else he.dataTransfer.setDragImage(new Image,0,0);Z(X),setTimeout(()=>{T([]),O(),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:N}):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:N})})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:N})})]})},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),O=lodashEs.groupBy([...C,...A],"group"),[N,z]=React.useState("Hero"),Z=lodashEs.get(O,N,[]),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(O,(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===N?"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}),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(O=>O._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 se;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:O,clearHighlight:N}=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())},oe=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:()=>O(z),onMouseLeave:()=>N(),onClick:xe,style:h,"data-node-id":z,ref:R.includes(z)?null:x,onDragStart:()=>X(r),onDragEnd:()=>oe(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"))||((se=r==null?void 0:r.parent)==null?void 0:se.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})]})},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}});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,O]=React.useState(),N=React.useRef(null),z=React.useRef(null);React.useEffect(()=>{var q;(q=N.current)==null||q.focus()},[]);const Z=q=>{const{usage:Y}=q||{};!v&&Y&&O(Y),z.current=setTimeout(()=>O(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:N,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),O(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),O(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),O(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),[,O]=React.useState(!1),{toast:N}=contextMenu.useToast(),z=React.useRef(null);React.useEffect(()=>{h&&g(h)},[h]);const Z=async()=>{try{j(!0),T(null),await R(x),N({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=>{O(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)})]})},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))]})]})]})};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 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 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])};function usePubSub(r,h){React.useEffect(()=>{const x=pubsub.subscribe(r,h);return()=>x()},[r,h])}const 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,{})]})]})},AttrsEditor=React.memo(function r({preloadedAttributes:h=[],onAttributesChange:x}){const[g,v]=React.useState([]),[R,A]=React.useState(""),[j,C]=React.useState(""),[T,O]=React.useState(null),[N,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 oe=g.filter((pe,ve)=>ve!==X);x(oe),v(oe)},he=X=>{O(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),O(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"})}),N&&jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs text-red-500",children:N})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"space-y-1 py-4",children:g.map((X,oe)=>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(oe),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(oe),children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.X,{className:"h-3 w-3"})})]})]},oe))})]})}),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 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",{})]})]})})},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 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-Zby0BmoN.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)},O=useSidebarMenuItems(),{t:N}=reactI18next.useTranslation(),z=[...O,...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:N(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:N(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"})," ",N("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"}),N("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","rjsfFields","rjsfWidgets","rjsfTemplates"]))},[r]),React.useEffect(()=>{builderStore.set(chaiRjsfFieldsAtom,r.rjsfFields||{}),builderStore.set(chaiRjsfWidgetsAtom,r.rjsfWidgets||{}),builderStore.set(chaiRjsfTemplatesAtom,r.rjsfTemplates||{})},[r.rjsfFields,r.rjsfWidgets,r.rjsfTemplates]),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:"h-screen w-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;
|
|
61
|
+
}`)},[i,m]),React.useEffect(()=>{c.querySelector("#drop-target-block").innerHTML=u?`[data-block-id="${u}"]{ outline: 1px dashed orange !important; outline-offset: -1px;}`:""},[u,c]);const f=React.useMemo(()=>ChaiThemeFn.getChaiThemeCssVariables(o),[o]),g=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:f}),jsxRuntime.jsxRuntimeExports.jsx("span",{id:"chai-fonts",dangerouslySetInnerHTML:{__html:g}})]})},ResizableCanvasWrapper=({children:o,onMount:n,onResize:r})=>{const[,a]=useSelectedBlockIds(),[,i]=useSelectedStylingBlocks(),l=React.useRef(null),u=web.useDebouncedCallback(()=>{const{clientWidth:x}=l.current;r(x)},[l.current],100);web.useResizeObserver(l.current,u,l.current!==null),React.useEffect(()=>{const{clientWidth:x}=l.current;n(x)},[]);const c=()=>{a([]),i([])};return jsxRuntime.jsxRuntimeExports.jsx("div",{id:"main-content",onClick:c,className:"h-full w-full p-8 pb-0",ref:l,children:o})};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 u=lodashEs.find(n,{_type:l.block});return u&&(a[i]=lodashEs.get(u,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),[u]=useHiddenBlockIds(),{getGlobalBlocks:c}=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||u.includes(m._id))return null;const f={},g=lodashEs.filter(n,{_parent:m._id});if(f.children=g.length>0?jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:n,blocks:g}):null,m._type==="GlobalBlock"){const S=c(m);f.children=jsxRuntime.jsxRuntimeExports.jsx(RenderGlobalBlock,{blocks:lodashEs.filter(S,A=>!A._parent),allBlocks:S})}const j=runtime.getRegisteredChaiBlock(m._type),R=lodashEs.get(j,"component",null);if(lodashEs.isNull(R))return jsxRuntime.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${m==null?void 0:m._type} not registered -->`});const _=x(m),w=i&&isDescendant(i._id,m._id,n),b={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||w?"yes":"no"}:{},...l===m._id&&!w?{"data-drop":"yes"}:{},...lodashEs.includes(a,m._id)?{"data-cut-block":"yes"}:{}},index:h,...applyBindings(applyLanguage(m,r,j),d),..._,...f,inBuilder:!0,lang:r};if(lodashEs.has(j,"dataProvider"))return jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntime.jsxRuntimeExports.jsx(AsyncPropsBlock,{lang:r,dataProvider:j.dataProvider,block:m,component:R,props:b})});const E=getRuntimeProps(m._type);return E?jsxRuntime.jsxRuntimeExports.jsx(RuntimePropsBlock,{runtimeProps:E,block:m,component:R,props:b},m._id):jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{children:React.createElement(R,b)})}))})}const StaticBlocksRenderer=()=>{const[o]=useBlocksStore(),n=lodashEs.isEmpty(o)?null:jsxRuntime.jsxRuntimeExports.jsx(BlocksRendererStatic,{allBlocks:o,blocks:lodashEs.filter(o,r=>lodashEs.isEmpty(r._parent))});return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:n})},useCanvasScale=o=>{const[n]=useCanvasWidth(),[,r]=useCanvasZoom(),a=useBuilderProp("htmlDir","ltr"),[i,l]=React.useState({}),u=React.useCallback(()=>{const{width:c,height:x}=o;if(c<n){const d=parseFloat((c/n).toFixed(2).toString());let p={};const m=x*d,h=c*d;x&&(p={height:100+(x-m)/m*100+"%",width:100+(c-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(()=>{u()},[n,o,r,u]),i},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),u=React.useRef(null),[c,x]=React.useState({width:0,height:0}),d=useCanvasScale(c),[p,m]=React.useState([]),[,h]=React.useState([]),[,f]=jotai.useAtom(canvasIframeAtom),[g,j]=useSelectedStylingBlocks(),R=useBuilderProp("loading",!1),_=useBuilderProp("htmlDir","ltr"),w=E=>{x(S=>({...S,width:E}))};React.useEffect(()=>{if(!u.current)return;const{clientWidth:E,clientHeight:S}=u.current;x({width:E,height:S})},[u,n]);const y=(E,S=0)=>{const{top:A}=E.getBoundingClientRect();return A+S>=0&&A-S<=window.innerHeight};React.useEffect(()=>{var E,S;if(a&&a.type!=="Multiple"&&l.current){const A=getElementByDataBlockId(l.current.contentDocument,a._id);A&&(y(A)||(S=(E=l.current)==null?void 0:E.contentWindow)==null||S.scrollTo({top:A.offsetTop,behavior:"smooth"}),m([A]))}},[a]),React.useEffect(()=>{if(!lodashEs.isEmpty(g)&&l.current){const E=getElementByStyleId(l.current.contentDocument,lodashEs.first(g).id);h(E?[E]:[null])}else h([null])},[g]);const b=React.useMemo(()=>{let E=IframeInitialContent;return E=E.replace("__HTML_DIR__",_),o==="offline"&&(E=E.replace("https://chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js")),E},[o,_]);return jsxRuntime.jsxRuntimeExports.jsx(ResizableCanvasWrapper,{onMount:w,onResize:w,children:jsxRuntime.jsxRuntimeExports.jsx("div",{onClick:()=>{r([]),j([])},onMouseLeave:()=>setTimeout(()=>i(""),300),className:"relative mx-auto h-full w-full overflow-hidden",ref:u,children:jsxRuntime.jsxRuntimeExports.jsxs(ChaiFrame,{contentDidMount:()=>f(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:b,children:[jsxRuntime.jsxRuntimeExports.jsx(KeyboardHandler,{}),jsxRuntime.jsxRuntimeExports.jsx(BlockFloatingSelector,{block:a,selectedBlockElement:lodashEs.first(p)}),jsxRuntime.jsxRuntimeExports.jsx(HeadTags,{}),jsxRuntime.jsxRuntimeExports.jsx(reactWrapBalancer.Provider,{children:jsxRuntime.jsxRuntimeExports.jsxs(Canvas,{children:[R?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-CJhjQonw.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=React__namespace.memo(({className:o=""})=>{const[n]=useDarkMode(),[r,a]=React__namespace.useState(""),i=useBuilderProp("themePresets",[]),[l,u]=useTheme(),c=useThemeOptions(),{t:x}=reactI18next.useTranslation(),d=j=>{a(j)},p=()=>{const j=i.find(R=>Object.keys(R)[0]===r);if(j){const R=Object.values(j)[0];R&&typeof R=="object"&&"fontFamily"in R&&"borderRadius"in R&&"colors"in R?u(R):console.error("Invalid preset structure:",R)}else console.error("Preset not found:",r)},m=web.useDebouncedCallback((j,R)=>{u(()=>({...l,fontFamily:{...l.fontFamily,[j.replace(/font-/g,"")]:R}}))},[l],200),h=web.useDebouncedCallback(j=>{u(()=>({...l,borderRadius:`${j}px`}))},[l],200),f=web.useDebouncedCallback((j,R)=>{u(()=>{const _=lodashEs.get(l,`colors.${j}`);return n?lodashEs.set(_,1,R):lodashEs.set(_,0,R),{...l,colors:{...l.colors,[j]:_}}})},[l],200),g=j=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-1",children:Object.entries(j.items).map(([R])=>{const _=lodashEs.get(l,`colors.${R}.${n?1:0}`);return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex items-center gap-x-2",children:[jsxRuntime.jsxRuntimeExports.jsx(ColorPickerInput,{value:_,onChange:w=>f(R,w)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Label,{className:"text-xs font-normal leading-tight text-slate-600",children:R.split(/(?=[A-Z])/).join(" ").replace(/-/g," ").split(" ").map(w=>w.charAt(0).toUpperCase()+w.slice(1)).join(" ")+(!R.toLowerCase().includes("foreground")&&!R.toLowerCase().includes("border")&&!R.toLowerCase().includes("input")&&!R.toLowerCase().includes("ring")&&!R.toLowerCase().includes("background")?" Background":"")})]},R)})});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:j=>d(j.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(j=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:Object.keys(j)[0],children:lodashEs.capitalize(Object.keys(j)[0])},Object.keys(j)[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:[(c==null?void 0:c.fontFamily)&&jsxRuntime.jsxRuntimeExports.jsx("div",{className:"grid gap-4",children:Object.entries(c.fontFamily).map(([j,R])=>jsxRuntime.jsxRuntimeExports.jsx(FontSelector,{label:j,value:l.fontFamily[j.replace(/font-/g,"")]||R[Object.keys(R)[0]],onChange:_=>m(j,_)},j))}),(c==null?void 0:c.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})]})]}),(c==null?void 0:c.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:c.colors.map(j=>g(j))},n?"dark":"light")]})]}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{}),jsxRuntime.jsxRuntimeExports.jsx("br",{})]})}),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 u;i([o._id],{globalBlock:l.target.value,_name:`Global: ${lodashEs.startCase((u=lodashEs.get(n,l.target.value,""))==null?void 0:u.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"})})]})};var client={},hasRequiredClient;function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1;var o=ReactDOM;if(process.env.NODE_ENV==="production")client.createRoot=o.createRoot,client.hydrateRoot=o.hydrateRoot;else{var n=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;client.createRoot=function(r,a){n.usingClientEntryPoint=!0;try{return o.createRoot(r,a)}finally{n.usingClientEntryPoint=!1}},client.hydrateRoot=function(r,a,i){n.usingClientEntryPoint=!0;try{return o.hydrateRoot(r,a,i)}finally{n.usingClientEntryPoint=!1}}}return client}var clientExports=requireClient();const getSvgMarkup=o=>{try{const n=document.getElementById("icon-picker-field"),r=document.createElement("div");clientExports.createRoot(r).render(jsxRuntime.jsxRuntimeExports.jsx(IconPicker.IconPickerItem,{value:o})),n.appendChild(r),r.hidden=!0;const i=r.innerHTML;setTimeout(()=>n.removeChild(r),100);const u=new DOMParser().parseFromString(i,"image/svg+xml"),c=u.querySelector("svg");return c&&(c.removeAttribute("width"),c.removeAttribute("height")),new XMLSerializer().serializeToString(u)}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=(...u)=>{n.call(void 0,...u),a(!1)};return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Dialog,{open:r,onOpenChange:u=>a(u),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:i?jsxRuntime.jsxRuntimeExports.jsx(i,{onSelect:l}):null})})]})};MediaManagerModal.displayName="MediaManagerModal";const ImagePickerField=({value:o,onChange:n,id:r,onBlur:a})=>{const i=useBuilderProp("mediaManagerComponent",null),{t:l}=reactI18next.useTranslation(),u=!lodashEs.isEmpty(i);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:[u&&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:c}})=>a(r,c),onChange:c=>n(c.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"]]},u=["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:c=>i(o,c),onChange:c=>a(c),modules:l,formats:u,placeholder:n,className:"mt-1 rounded-md"})},PageTypeField=({href:o,pageTypes:n,onChange:r})=>{var D;const{t:a}=reactI18next.useTranslation(),i=useBuilderProp("searchPageTypeItems",(k,N)=>[]),[l,u]=React.useState(!1),[c,x]=React.useState(!1),[d,p]=React.useState("page"),[m,h]=React.useState(""),[f,g]=React.useState([]),[j,R]=React.useState(-1),_=React.useRef(null),w=(D=n==null?void 0:n.find(k=>k.key===d))==null?void 0:D.name;React.useEffect(()=>{if(h(""),g([]),R(-1),x(!1),!o||l||!lodashEs.startsWith(o,"pageType:"))return;const k=lodashEs.split(o,":"),N=lodashEs.get(k,1,"page")||"page";p(N),(async()=>{const B=await i(N,[lodashEs.get(k,2,"page")]);B&&Array.isArray(B)&&h(lodashEs.get(B,[0,"name"],""))})()},[o]);const y=web.useDebouncedCallback(async k=>{if(lodashEs.isEmpty(k))g([]);else{const N=await i(d,k);g(N)}u(!1),R(-1)},[d],300),b=k=>{const N=["pageType",d,k.id];N[1]&&(r(N.join(":")),h(k.name),x(!1),g([]),R(-1))},E=k=>{switch(k.key){case"ArrowDown":k.preventDefault(),R(N=>N<f.length-1?N+1:N);break;case"ArrowUp":k.preventDefault(),R(N=>N>0?N-1:N);break;case"Enter":if(k.preventDefault(),f.length===0)return;j>=0&&b(f[j]);break;case"Escape":k.preventDefault(),S();break}};React.useEffect(()=>{if(j>=0&&_.current){const k=_.current.children[j];k==null||k.scrollIntoView({block:"nearest"})}},[j]);const S=()=>{h(""),g([]),R(-1),x(!1),r("")},A=k=>{h(k),x(!lodashEs.isEmpty(k)),u(!0),y(k)};return jsxRuntime.jsxRuntimeExports.jsxs("div",{children:[jsxRuntime.jsxRuntimeExports.jsx("select",{name:"pageType",value:d,onChange:k=>p(k.target.value),children:lodashEs.map(n,k=>jsxRuntime.jsxRuntimeExports.jsx("option",{value:k.key,children:k.name},k.key))}),d&&jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"group relative mt-2 flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx("input",{type:"text",value:m,onChange:k=>A(k.target.value),onKeyDown:E,placeholder:a(`Search ${w??""}`),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:S,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(f)||c&&lodashEs.isEmpty(f))&&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"})]}):c&&lodashEs.isEmpty(f)?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(f==null?void 0:f.slice(0,20),(k,N)=>jsxRuntime.jsxRuntimeExports.jsxs("li",{onClick:()=>b(k),className:`cursor-pointer p-2 text-xs ${o!=null&&o.includes(k.id)?"bg-blue-200":N===j?"bg-gray-100":"hover:bg-gray-100"}`,children:[k.name," ",k.slug&&jsxRuntime.jsxRuntimeExports.jsxs("small",{className:"font-light text-gray-500",children:["( ",k.slug," )"]})]},k.id))})})]})},LinkField=({schema:o,formData:n,onChange:r})=>{const{t:a}=reactI18next.useTranslation(),{type:i="pageType",href:l="",target:u="self"}=n,c=useBuilderProp("pageTypes",[]),x=i==="pageType"&&lodashEs.isEmpty(c)?"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(c)?[]:[{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(c)?jsxRuntime.jsxRuntimeExports.jsx(PageTypeField,{href:l,pageTypes:c,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:u==="_blank",className:"!w-fit cursor-pointer rounded-md border border-border",onChange:()=>r({...n,target:u==="_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"]})})},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"}),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.",""),u=lodashEs.get(i,l,""),c=()=>{const x=i==null?void 0:i._id;a({blockId:x,blockProp:l,placeholder:n,initialCode:lodashEs.get(i,l,u)})};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2 flex flex-col gap-y-1",children:[jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:c,className:"text-pretty w-[90%] max-w-full cursor-default truncate rounded border border-border bg-background p-2 text-left text-[10px]",children:u.trim().length>0?u.substring(0,46):n||"Eg: <script>console.log('Hello, world!');<\/script>"}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:c,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:u,hidden:c,required:x,schema:d,formData:p})=>{const{selectedLang:m,fallbackLang:h,languages:f}=useLanguages(),g=lodashEs.isEmpty(f)?"":lodashEs.isEmpty(m)?h:m,j=lodashEs.get(LANGUAGES,g,g),R=useSelectedBlock(),_=runtime.useRegisteredChaiBlocks(),w=lodashEs.get(_,[R==null?void 0:R._type,"i18nProps"],[])||[],[y,b]=React.useState(null);if(c)return null;if(d.type==="boolean")return jsxRuntime.jsxRuntimeExports.jsx("div",{className:n,children:a});const S=w==null?void 0:w.includes(o.replace("root.",""));if(d.type==="array"){const A=y===o;return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:`${n} relative`,children:[d.title&&jsxRuntime.jsxRuntimeExports.jsxs("label",{htmlFor:o,onClick:()=>b(A?null:o),className:"flex cursor-pointer items-center gap-x-1 py-1 leading-tight duration-200 hover:bg-slate-100",children:[A?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:`${A?"pt-0.5":"h-0 overflow-hidden"}`,children:[u,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," ",S&&jsxRuntime.jsxRuntimeExports.jsxs("small",{className:"text-[9px] text-zinc-400",children:[" ",j]}),x&&d.type!=="object"?" *":null]}),u,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,u]=React.useState(a),{selectedLang:c}=useLanguages(),[x]=jotai.useAtom(chaiRjsfWidgetsAtom),[d]=jotai.useAtom(chaiRjsfFieldsAtom),[p]=jotai.useAtom(chaiRjsfTemplatesAtom);React.useEffect(()=>{u(a)},[o,c]);const m=web.useThrottledCallback(async({formData:h},f)=>{i({formData:h},f)},[i,c],1e3);return jsxRuntime.jsxRuntimeExports.jsx(RjForm,{widgets:{binding:BindingWidget,richtext:RichTextEditorField,icon:IconPickerField,image:ImagePickerField,code:CodeEditor,colCount:RowColField,...x},fields:{link:LinkField,...d},templates:{FieldTemplate:CustomFieldTemplate,ButtonTemplates:{AddButton:CustomAddButton},...p},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator,uiSchema:r,schema:n,formData:l,onChange:({formData:h},f)=>{f&&(u(h),m({formData:h},f))}},c)}),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),[u,c]=React.useState(l),[x,d]=React.useState(!1),p=useWrapperBlock(),m=runtime.getRegisteredChaiBlock(p==null?void 0:p._type),h=formDataWithSelectedLang(p,o,m),f=({formData:E},S,A)=>{if(S&&(u==null?void 0:u._id)===n._id){const D=S.replace("root.","");a([n._id],{[D]:lodashEs.get(E,D)},A)}},g=React.useCallback(lodashEs.debounce(({formData:E},S,A)=>{f({formData:E},S,A),c(E)},1500),[n==null?void 0:n._id,o]),j=({formData:E},S)=>{if(S){const A=S.replace("root.","");r([n._id],convertDotNotationToObject(A,lodashEs.get(E,A.split(".")))),g({formData:E},S,{[A]:lodashEs.get(u,A)})}},R=({formData:E},S)=>{if(S){const A=S.replace("root.","");r([p._id],convertDotNotationToObject(A,lodashEs.get(E,A.split(".")))),g({formData:E},S,{[A]:lodashEs.get(u,A)})}};lodashEs.keys(lodashEs.get(l,"_bindings",{}));const{schema:_,uiSchema:w}=React.useMemo(()=>{const E=n==null?void 0:n._type;if(E)return runtime.getBlockFormSchemas(E)},[n]),{wrapperSchema:y,wrapperUiSchema:b}=React.useMemo(()=>{if(!p||!(p!=null&&p._type))return{wrapperSchema:{},wrapperUiSchema:{}};const E=p==null?void 0:p._type,{schema:S={},uiSchema:A={}}=runtime.getBlockFormSchemas(E);return{wrapperSchema:S,wrapperUiSchema:A}},[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(E=>!E),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:R,formData:h,schema:y,uiSchema:b})]}),lodashEs.isEmpty(_)?null:jsxRuntime.jsxRuntimeExports.jsx(JSONForm,{id:n==null?void 0:n._id,onChange:j,formData:l,schema:_,uiSchema:w}),(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,u=2*Math.PI*l,c=u*(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:u,strokeDashoffset:c,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,u]=React.useState(""),c=React.useRef(null),x=React.useRef(null),[d,p]=React.useState();React.useEffect(()=>{var h;(h=c.current)==null||h.focus()},[]);const m=h=>{const{usage:f}=h||{};!i&&f&&p(f),x.current=setTimeout(()=>p(void 0),1e4),i||u("")};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:c,value:l,onChange:h=>u(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 S;const o=useFuseSearch(),{t:n}=reactI18next.useTranslation(),[r]=useSelectedStylingBlocks(),a=useSelectedBlock(),i=useAddClassesToBlocks(),l=useRemoveClassesFromBlocks(),[u]=useSelectedBlockIds(),c=useBuilderProp("askAiCallBack",null),[x,d]=React.useState(""),{toast:p}=contextMenu.useToast(),m=(S=lodashEs.first(r))==null?void 0:S.prop,h=lodashEs.reject((lodashEs.get(a,m,"").replace(STRINGS.STYLES_KEY,"").split(",").pop()||"").split(" "),lodashEs.isEmpty),f=()=>{const A=x.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");i(u,A,!0),d("")},[g,j]=React.useState([]),R=({value:A})=>{const D=A.trim().toLowerCase(),k=D.match(/.+:/g);let N=[];if(k&&k.length>0){const[B]=k,C=D.replace(B,"");N=o.search(C).map(T=>({...T,item:{...T.item,name:B+T.item.name}}))}else N=o.search(D);return j(lodashEs.map(N,"item"))},_=()=>{j([])},w=A=>A.name,y=A=>jsxRuntime.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:A.name}),b={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:n("Enter classes separated by space"),value:x,onKeyDown:A=>{A.key==="Enter"&&x.trim()!==""&&f()},onChange:(A,{newValue:D})=>d(D),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"},E=()=>{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 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:E,className:"cursor-pointer"})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:n("Copy classes to clipboard")})})]})]}),c?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:g,onSuggestionsFetchRequested:R,onSuggestionsClearRequested:_,getSuggestionValue:w,renderSuggestion:y,inputProps:b,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:f,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:h.map(A=>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:[A,jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Cross2Icon,{onClick:()=>l(u,[A]),className:"invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},A))})]})}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),u=React.useMemo(()=>lodashEs.get(l,"cls",""),[l]),{canChange:c}=React.useContext(StyleContext),x=/\[.*\]/g.test(u);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:u}),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:u,options:i,disabled:!c})})};function DropDown({selected:o,onChange:n,rounded:r=!1,options:a,disabled:i=!1}){const l=o.replace(/.*:/g,"").trim(),{undo:u,redo:c}=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"&&u(),x.key==="y"&&c())},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:u}=useTailwindClassList(),c=u(o,[""]),x=c.indexOf(l)>-1?c.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(c,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>=c.length),onClick:()=>n(lodashEs.nth(c,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>=c.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),u=React.useMemo(()=>lodashEs.get(l,"cls",""),[l]);return jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:lodashEs.map(a,c=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx("button",{type:"button",disabled:!i,onClick:()=>n(c,o),className:`cursor-pointer rounded border border-border p-1 disabled:cursor-not-allowed ${u===c?"bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:React.createElement(lodashEs.get(EDITOR_ICONS,c,reactIcons.BoxIcon))})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:lodashEs.startCase(lodashEs.toLower(c))})]}))})},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,u]=React.useState([]),[c,x]=React.useState({color:"",shade:""}),d=a.split("-"),p=lodashEs.get(d,"1",""),m=lodashEs.get(d,"2",""),h=React.useCallback(j=>{["current","inherit","transparent","black","white"].includes(j)?(u([]),x({color:j})):(u(["50","100","200","300","400","500","600","700","800","900"]),x(R=>({...R,color:j,shade:R.shade?R.shade:"500"})))},[u,x]);React.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(p))return u([]);u(["50","100","200","300","400","500","600","700","800","900"])},[p]);const f=React.useCallback(j=>{x({color:p,shade:j})},[p]);React.useEffect(()=>{x({color:"",shade:""})},[r]);const{match:g}=useTailwindClassList();return React.useEffect(()=>{const R=`${lodashEs.get(COLOR_PROP,o,"")}-${c.color}${c.shade?`-${c.shade}`:""}`;g(o,R)&&n(R,o)},[g,c,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:f,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,u=!lodashEs.isEmpty(r)&&Number.isNaN(Number(r));return l||u?{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:u})=>{const{setDragData:c}=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:u};i(d),c(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:u,classPrefix:c,cssProperty:x,units:d,negative:p}=o,[m,h]=React.useState(x!=null&&x.toLowerCase().includes("width")?"%":d[0]),[f,g]=React.useState(!1),[j,R]=React.useState(""),[_,w]=React.useState(!1),[y,b]=React.useState(!1);React.useEffect(()=>{const{value:k,unit:N}=getClassValueAndUnit(l);if(N===""){i(k),h(x!=null&&x.toLowerCase().includes("width")?"%":lodashEs.first(d));return}h(N),i(N==="class"||lodashEs.isEmpty(k)?"":k)},[l,x,d]);const E=web.useThrottledCallback(k=>u(k),[u],THROTTLE_TIME),S=web.useThrottledCallback(k=>u(k,!1),[u],THROTTLE_TIME),A=React.useCallback((k=!1)=>{const N=getUserInputValues(`${a}`,d);if(lodashEs.get(N,"error",!1)){g(!0);return}const B=lodashEs.get(N,"unit")!==""?lodashEs.get(N,"unit"):m;if(B==="auto"||B==="none"){E(`${c}${B}`);return}if(lodashEs.get(N,"value")==="")return;const I=`${lodashEs.get(N,"value","").startsWith("-")?"-":""}${c}[${lodashEs.get(N,"value","").replace("-","")}${B==="-"?"":B}]`;k?S(I):E(I)},[E,S,a,m,c,d]),D=React.useCallback(k=>{const N=getUserInputValues(`${a}`,d);if(lodashEs.get(N,"error",!1)){g(!0);return}if(k==="auto"||k==="none"){E(`${c}${k}`);return}if(lodashEs.get(N,"value")==="")return;const B=lodashEs.get(N,"unit")!==""?lodashEs.get(N,"unit"):k,I=`${lodashEs.get(N,"value","").startsWith("-")?"-":""}${c}[${lodashEs.get(N,"value","").replace("-","")}${B==="-"?"":B}]`;E(I)},[E,a,c,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:k=>{k.key==="Enter"&&A()},onKeyDown:k=>{if(k.keyCode!==38&&k.keyCode!==40)return;k.preventDefault(),b(!0);const N=lodashEs.parseInt(k.target.value);let B=lodashEs.isNaN(N)?0:N;k.keyCode===38&&(B+=1),k.keyCode===40&&(B-=1);const C=`${B}`,T=`${C.startsWith("-")?"-":""}${c}[${C.replace("-","")}${m==="-"?"":m}]`;S(T)},onKeyUp:k=>{y&&(k.preventDefault(),b(!1))},onBlur:()=>A(),onChange:k=>{g(!1),i(k.target.value)},onClick:k=>{var N;(N=k==null?void 0:k.target)==null||N.select(),r(!1)},value:_?j:a,className:"h-6 w-14 rounded rounded-r-none border border-transparent bg-background pl-2 text-sm focus-visible:outline-0".concat(" ",f?"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:k=>{r(!1),h(k),D(k)}})})})]})]}),["none","auto"].indexOf(m)!==-1||_?null:jsxRuntime.jsxRuntimeExports.jsx(DragStyleButton,{onDragStart:()=>w(!0),onDragEnd:k=>{if(R(()=>""),w(!1),lodashEs.isEmpty(k))return;const N=`${k}`,C=`${N.startsWith("-")?"-":""}${c}[${N.replace("-","")}${m==="-"?"":m}]`;E(C)},onDrag:k=>{if(lodashEs.isEmpty(k))return;R(k);const N=`${k}`,C=`${N.startsWith("-")?"-":""}${c}[${N.replace("-","")}${m==="-"?"":m}]`;S(C)},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:u,negative:c=!1}=o,[x]=useDarkMode(),[d]=useStylingState(),[,p]=useCanvasWidth(),m=useCurrentClassByProperty(i),h=useAddClassesToBlocks(),f=useRemoveClassesFromBlocks(),[g]=useSelectedBlockIds(),j=React.useMemo(()=>lodashEs.get(m,"fullCls",""),[m]),R=React.useCallback((S,A=!0)=>{const D={dark:x,mq:p,mod:d,cls:S,property:i,fullCls:""};(x||d!=="")&&(D.mq="xs");const k=generateFullClsName(D);h(g,[k],A)},[g,x,p,d,i,h]),_=React.useCallback(()=>{f(g,[j])},[g,j,f]),w=React.useMemo(()=>canChangeClass(m,p),[m,p]);React.useEffect(()=>{l(w,m)},[w,l,m]);const[,,y]=useCanvasWidth(),b=React.useCallback(S=>{y({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[S])},[y]),E=lodashEs.get(m,"dark",null)===x&&lodashEs.get(m,"mod",null)===d&&lodashEs.get(m,"mq",null)===p;return jsxRuntime.jsxRuntimeExports.jsx(BlockStyleProvider,{canChange:w,canReset:m&&E,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&&!E?"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:u||[],onChange:R,negative:c,cssProperty:i}):null,r==="icons"&&jsxRuntime.jsxRuntimeExports.jsx(IconChoices,{property:i,onChange:R}),r==="range"&&jsxRuntime.jsxRuntimeExports.jsx(RangeChoices,{property:i,onChange:R}),r==="color"&&jsxRuntime.jsxRuntimeExports.jsx(ColorChoice,{property:i,onChange:R}),r==="dropdown"&&jsxRuntime.jsxRuntimeExports.jsx(DropDownChoices,{label:a,property:i,onChange:R})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${j?"visible":"invisible"}`,children:E?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"})}):w&&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:()=>b(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:u=!1})=>{const{t:c}=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:c(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:f})=>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(f),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${f===x?"bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[React.createElement("div",{className:m(f)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),React.createElement(lodashEs.get(EDITOR_ICONS,f,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:u})})]})},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)),u=lodashEs.flatten(n.map(x=>x.styleType==="accordion"?l(x.items):x.styleType==="multiple"?lodashEs.map(x.options,"key"):x.property)),c=lodashEs.map(a,"property");return lodashEs.intersection(u,c).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((u=[])=>{const c={};for(let d=0;d<a.length;d++)c[a[d].property]=a[d].cls;let x=!0;for(const d in u)if(!lodashEs.has(c,d)||c[d]!==u[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(u=>lodashEs.has(u,"component")?React.createElement(u.component,{key:u.label}):lodashEs.has(u,"styleType")?u.styleType==="multiple"?jsxRuntime.jsxRuntimeExports.jsx(MultipleChoices,{...u},u.label):u.styleType==="accordion"&&i(u==null?void 0:u.conditions)?jsxRuntime.jsxRuntimeExports.jsx(NestedOptions,{...u},u.label):null:jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{...u},u.label)))})]}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"py-2",children:React.Children.toArray(o.items.map(u=>lodashEs.has(u,"component")?React.createElement(u.component,{key:u.label}):lodashEs.has(u,"styleType")?u.styleType==="multiple"?jsxRuntime.jsxRuntimeExports.jsx(MultipleChoices,{...u},u.label):u.styleType==="accordion"&&i(u==null?void 0:u.conditions)?jsxRuntime.jsxRuntimeExports.jsx(NestedOptions,{...u},u.label):null:jsxRuntime.jsxRuntimeExports.jsx(BlockStyle,{...u},u.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"),u=lodashEs.get(i.props,`${l}.presets`,{});if(!lodashEs.has(i,"props")||lodashEs.isEmpty(u))return null;const c=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(u)?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(u).map(x=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.DropdownMenuItem,{className:"group text-xs",onClick:()=>c(u[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(u=>typeof o[u]=="string"&&o[u].startsWith("#styles:"));if(lodashEs.isEmpty(i)||i.length<=1)return null;const l=u=>lodashEs.find(n,c=>c.prop===u);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,u=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Badge,{className:"cursor-pointer",onClick:()=>{r([{id:`${u}-${o._id}`,blockId:o._id,prop:u}])},variant:l(u)?"default":"secondary",children:lodashEs.startCase(u)},u))}),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,u]=React.useState({onDrag:d=>d,onDragEnd:d=>d,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),c=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 f=MAPPER[l.dragUnit];(lodashEs.startsWith(m,"scale")||m==="opacity")&&(f=10);let j=(l.dragStartY-d.pageY)/f+h;p&&j<0&&(j=0),m==="opacity"&&j>1&&(j=1),l.onDrag(`${j}`),i(`${j}`)},[l],50),x=React.useCallback(()=>{setTimeout(()=>l.onDragEnd(`${a}`),100),u({onDrag:d=>d,onDragEnd:d=>d,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[l,a,u]);return lodashEs.isEmpty(r)?null:jsxRuntime.jsxRuntimeExports.jsxs(BlockSettingsContext.Provider,{value:{setDragData:u},children:[l.dragging?jsxRuntime.jsxRuntimeExports.jsx("div",{onMouseMove:c,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 CoreBlock=({block:o,disabled:n,parentId:r,position:a})=>{const[,i]=jotai.useAtom(draggedBlockAtom),{type:l,icon:u,label:c}=o,{addCoreBlock:x,addPredefinedBlock:d}=useAddBlock(),[,p]=useSelectedBlockIds(),{clearHighlight:m}=useBlockHighlight(),h=()=>{if(lodashEs.has(o,"blocks")){const j=lodashEs.isFunction(o.blocks)?o.blocks():o.blocks;d(runtime.syncBlocksWithDefaults(j),r||null,a)}else x(o,r||null,a);pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},f=flagged.useFeature("dnd"),{t:g}=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:j=>{j.dataTransfer.setData("text/plain",JSON.stringify(lodashEs.omit(o,["component","icon"]))),j.dataTransfer.setDragImage(new Image,0,0),i(lodashEs.omit(o,["component","icon"])),setTimeout(()=>{p([]),m()},200)},draggable:f?"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(u||reactIcons.BoxIcon,{className:"w-4 h-4 mx-auto"}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:lodashEs.capitalize(g(c||l))})]})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:g(c||l)})})]})})},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,u=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,c=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return l&&(u.test(l)||c.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 u=lodashEs.find(o.attributes,{key:"width"}),c=lodashEs.find(o.attributes,{key:"height"});u&&c?l=`https://via.placeholder.com/${u==null?void 0:u.value}x${c==null?void 0:c.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(c=>c.key==="data-chai-richtext"||c.key==="chai-richtext"),a=n.find(c=>c.key==="data-chai-lightbox"||c.key==="chai-lightbox"),i=n.find(c=>c.key==="data-chai-dropdown"||c.key==="chai-dropdown"),l=n.find(c=>c.key==="data-chai-dropdown-button"||c.key==="chai-dropdown-button"),u=n.find(c=>c.key==="data-chai-dropdown-content"||c.key==="chai-dropdown-content");if(i)return{_type:"Dropdown"};if(l)return{_type:"DropdownButton"};if(u)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 c=lodashEs.get(o,"children",[]).length>0?"Box":"EmptyBox";return{_type:c,tag:o.tagName,_name:c=="EmptyBox"||o.tagName==="div"?c:lodashEs.capitalize(o.tagName)}}}},traverseNodes=(o,n=null)=>lodashEs.flatMapDeep(o,r=>{var m,h,f,g,j,R,_,w;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(y=>y.key==="data-chai-richtext"||y.key==="chai-richtext"),u=i.find(y=>y.key==="data-chai-lightbox"||y.key==="chai-lightbox"),c=i.find(y=>y.key==="data-chai-dropdown"||y.key==="chai-dropdown"),x=i.find(y=>y.key==="data-chai-dropdown-button"||y.key==="chai-dropdown-button"),d=i.find(y=>y.key==="data-chai-dropdown-content"||y.key==="chai-dropdown-content");if(a={...a,...getBlockProps(r),...getAttrs(r),...getStyles(r)},r.attributes){const y=r.attributes.find(b=>lodashEs.includes(NAME_ATTRIBUTES,b.key));y&&(a._name=y.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(u){const y=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];a={...a,href:((m=i.find(b=>b.key==="href"))==null?void 0:m.value)||"",hrefType:((h=i.find(b=>b.key==="data-vbtype"))==null?void 0:h.value)||"video",autoplay:((f=i.find(b=>b.key==="data-autoplay"))==null?void 0:f.value)==="true"?"true":"false",maxWidth:((j=(g=i.find(b=>b.key==="data-maxwidth"))==null?void 0:g.value)==null?void 0:j.replace("px",""))||"",backdropColor:((R=i.find(b=>b.key==="data-overlay"))==null?void 0:R.value)||"",galleryName:((_=i.find(b=>b.key==="data-gall"))==null?void 0:_.value)||""},lodashEs.forEach(y,b=>{lodashEs.has(a,`styles_attrs.${b}`)&&delete a.styles_attrs[b]})}if(c&&(delete a.styles_attrs,a.showDropdown=!1),d&&delete a.styles_attrs,x){delete a.styles_attrs;const y=lodashEs.filter(r.children||[],E=>(E==null?void 0:E.tagName)!=="span");a.content=getTextContent(y);const b=lodashEs.find(r.children||[],E=>(E==null?void 0:E.tagName)==="span"&&lodashEs.some(E.children||[],S=>(S==null?void 0:S.tagName)==="svg"));if(b){const E=lodashEs.find(b.children||[],S=>(S==null?void 0:S.tagName)==="svg");if(E){a.icon=himalaya.stringify([E]);const{height:S,width:A}=getSvgDimensions(E,"16px","16px");a.iconHeight=S,a.iconWidth=A}}return[a]}if(a._type==="Input"){const y=a.inputType||"text";y==="checkbox"?lodashEs.set(a,"_type","Checkbox"):y==="radio"&&lodashEs.set(a,"_type","Radio")}else if(r.tagName==="video"||r.tagName==="iframe"){const y=himalaya.stringify([r]);return hasVideoEmbed(y)&&(lodashEs.set(a,"_type","Video"),lodashEs.set(a,"url",getVideoURLFromHTML(y)),lodashEs.set(a,"styles",`${STRINGS.STYLES_KEY},`),lodashEs.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=y,[a]}else if(r.tagName==="svg"){const y=lodashEs.find(r.attributes,{key:"height"}),b=lodashEs.find(r.attributes,{key:"width"}),E=lodashEs.get(y,"value")?`[${lodashEs.get(y,"value")}px]`:"24px",S=lodashEs.get(b,"value")?`[${lodashEs.get(b,"value")}px]`:"24px",A=lodashEs.get(lodashEs.find(r.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${STRINGS.STYLES_KEY}, ${iconBase.cn(`w-${S} h-${E}`,A)}`.trim(),r.attributes=lodashEs.filter(r.attributes,D=>!lodashEs.includes(["style","width","height","class"],D.key)),a.icon=himalaya.stringify([r]),[a]}else if(r.tagName=="option"&&n&&((w=n.block)==null?void 0:w._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 u=l.replace(/\\"/g,'"');return u=u.replace(/{([^}]+)}/g,c=>c.replace(/"/g,'\\"')),`${i}="${u.replace(/\\"/g,'"')}"`}),o=o.replace(/\\n/g,"").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g,""),o=o.replace(/\$name="[^"]*"/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(),u=()=>{const c=getBlocksFromHTML(a);l([...c],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:c=>c&&c.focus(),onChange:c=>i(c.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:()=>u(),size:"sm",className:"w-fit",children:r("Import HTML")})})]})},DefaultChaiBlocks=({parentId:o,position:n,gridCols:r="grid-cols-2"})=>{const a=runtime.useRegisteredChaiBlocks(),i=useBuilderProp("filterChaiBlock",()=>!0),l=lodashEs.filter(a,i),u=lodashEs.groupBy(l,"category"),c=lodashEs.uniq(lodashEs.map(u.core,"group"));return jsxRuntime.jsxRuntimeExports.jsx(ChaiBuilderBlocks,{gridCols:r,parentId:o,position:n,groups:c,blocks:u.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(),[u]=useBlocksStore(),c=(x=lodashEs.find(u,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(c,p.type)||!canBeNestedInside(c,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,u]=jotai.useAtom(addBlockTabAtom),[,c]=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=>{c(""),u(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})}))]})]})},ChaiSelect=({defaultValue:o="",onValueChange:n,options:r,placeholder:a="Select",className:i=""})=>{const[l,u]=React.useState(o),c=x=>{const d=x.target.value;u(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:c,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),u=useBuilderProp("getUILibraryBlock",lodashEs.noop),{addCoreBlock:c,addPredefinedBlock:x}=useAddBlock(),[,d]=useSelectedBlockIds(),{clearHighlight:p}=useBlockHighlight(),m=lodashEs.get(o,"name",lodashEs.get(o,"label")),h=flagged.useFeature("dnd"),[,f]=jotai.useAtom(draggedBlockAtom),g=_=>{const w=lodashEs.has(_,"styles_attrs.data-page-section");return _._type==="Box"&&w},j=React.useCallback(async _=>{if(_.stopPropagation(),lodashEs.has(o,"component")){c(o,r,a),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);return}l(!0);const w=await u(n,o);lodashEs.isEmpty(w)||x(runtime.syncBlocksWithDefaults(w),r,a),pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK)},[c,x,o,u,n,r,a]),R=async _=>{const w=await u(n,o);let y=r;if(g(lodashEs.first(w))&&(y=null),!lodashEs.isEmpty(w)){const b={blocks:w,uiLibrary:!0,parent:y};if(_.dataTransfer.setData("text/plain",JSON.stringify(b)),o.preview){const E=new Image;E.src=o.preview,E.onload=()=>{_.dataTransfer.setDragImage(E,0,0)}}else _.dataTransfer.setDragImage(new Image,0,0);f(b),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?()=>{}:j,draggable:h?"true":"false",onDragStart:R,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"),u=React.useRef("idle");return React.useEffect(()=>{(async()=>{if(l==="complete"||u.current==="loading")return;u.current="loading",r(x=>({...x,[o==null?void 0:o.uuid]:{loading:"loading",blocks:[]}}));const c=await a(o);u.current="idle",r(x=>({...x,[o==null?void 0:o.uuid]:{loading:"complete",blocks:c||[]}}))})()},[o,i,l,u,r,a]),{data:i||[],isLoading:l==="loading"}},UILibrarySection=({parentId:o,position:n})=>{const[r,a]=jotai.useAtom(selectedLibraryAtom),i=useBuilderProp("uiLibraries",[]),l=runtime.useRegisteredChaiBlocks(),u=lodashEs.values(l).filter(y=>y.category==="custom"),c=i.find(y=>y.uuid===r)||lodashEs.first(i),{data:x,isLoading:d}=useLibraryBlocks(c),p=lodashEs.groupBy([...x,...u],"group"),[m,h]=React.useState("Hero"),f=lodashEs.get(p,m,[]),g=React.useRef(null),{t:j}=reactI18next.useTranslation(),R=y=>{g.current&&(clearTimeout(g.current),g.current=null),g.current=setTimeout(()=>{g.current&&h(y)},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(f,(y,b)=>b%2===0),w=lodashEs.filter(f,(y,b)=>b%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:c==null?void 0:c.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:j("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,(y,b)=>jsxRuntime.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>R(b),onMouseLeave:()=>clearTimeout(g.current),onClick:()=>h(b),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",b===m?"bg-blue-500 text-white hover:bg-blue-600":""),children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:lodashEs.capitalize(j(b.toLowerCase()))}),jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},b)))})]})]}),jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.ScrollArea,{onMouseEnter:()=>g.current?clearTimeout(g.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(y=>jsxRuntime.jsxRuntimeExports.jsx(BlockCard,{parentId:o,position:n,block:y,library:c})))}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-1",children:React.Children.toArray(w.map(y=>jsxRuntime.jsxRuntimeExports.jsx(BlockCard,{parentId:o,position:n,block:y,library:c})))})]}),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}),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(u=>u._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(),u=React.useCallback(()=>{const c=n.map(x=>{const d=o.find(p=>p._id===x);return{id:x,data:d}});a(c.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:u,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,,u]=useHiddenBlockIds(),[c]=jotai.useAtom(canvasIframeAtom);let x=null;const d=o.children.length>0,{highlightBlock:p,clearHighlight:m}=useBlockHighlight(),{id:h,data:f,isSelected:g,willReceiveDrop:j,isDragging:R,isEditing:_,handleClick:w}=o,y=v=>{v.stopPropagation(),!l.includes(h)&&o.toggle()},b=v=>{v.isInternal&&(x=v.isOpen,v.isOpen&&v.close())},E=v=>{v.isInternal&&x!==null&&(x?v.open():v.close(),x=null)},[S,A]=jotai.useAtom(currentAddSelection),D=()=>{var v;k(),o.parent.isSelected||A((v=o==null?void 0:o.parent)==null?void 0:v.id)},k=()=>{A(null)},N=v=>{k(),v.stopPropagation(),!o.isOpen&&!l.includes(h)&&o.toggle(),w(v)};React.useEffect(()=>{const v=setTimeout(()=>{j&&!o.isOpen&&!R&&!l.includes(h)&&o.toggle()},500);return()=>clearTimeout(v)},[j,o,R]);const B=React.useMemo(()=>{const v=Object.keys(f),L=[];for(let M=0;M<v.length;M++)if(v[M].endsWith("_attrs")){const H=f[v[M]],O=Object.keys(H).join("|");O.match(/x-data/)&&L.push("data"),O.match(/x-on/)&&L.push("event"),O.match(/x-show|x-if/)&&L.push("show")}return L},[f]),C=(v,L)=>{const M=c.contentDocument||c.contentWindow.document,H=M.querySelector(`[data-block-id=${v}]`);H&&H.setAttribute("data-drop",L);const O=H.getBoundingClientRect(),P=c.getBoundingClientRect();O.top>=P.top&&O.left>=P.left&&O.bottom<=P.bottom&&O.right<=P.right||(M.documentElement.scrollTop=H.offsetTop-P.top)},I=v=>{k();const L=lodashEs.get(o,"parent.id");L!=="__REACT_ARBORIST_INTERNAL_ROOT__"?pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{_id:L,position:v}):pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,{position:v})};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:()=>I(-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:N,style:n,"data-node-id":h,ref:l.includes(h)?null:r,onDragStart:()=>b(o),onDragEnd:()=>E(o),onDragOver:v=>{v.preventDefault(),C(h,"yes")},onDragLeave:v=>{v.preventDefault(),C(h,"no")},onDrop:v=>{v.preventDefault(),C(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:v=>{v.stopPropagation(),I(o.childIndex)},onMouseEnter:D,onMouseLeave:k,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",g?"bg-blue-500 text-white":"hover:bg-slate-200 dark:hover:bg-gray-800",j&&canAcceptChildBlock(f._type,"Icon")?"bg-green-200":"",(o==null?void 0:o.id)===S?"bg-purple-100":"",R&&"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:y,type:"button",children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.ChevronRight,{className:`h-3 w-3 stroke-[3] ${g?"text-slate-200":"text-slate-400"}`})})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"leading-1 flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:f==null?void 0:f._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:v=>{v.stopPropagation(),o.edit(),o.deselect()},children:[jsxRuntime.jsxRuntimeExports.jsx("span",{children:(f==null?void 0:f._name)||(f==null?void 0:f._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(v=>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(v.item,{blockId:h})}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{className:"isolate z-10",children:v.tooltip})]})),canAddChildBlock(f==null?void 0:f._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:v=>{v.stopPropagation(),u(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(u=>{var c;return(c=lodashEs.find(o,{_id:u}))==null?void 0:c._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})]})},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}});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 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:[]}]})(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:u,icon:c,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(c,{className:"h-4 w-4"}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:u})]},u)}),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(c,{className:"h-4 w-4"}),jsxRuntime.jsxRuntimeExports.jsx("span",{children:r(u)})]},u))})})}const AIUserPrompt=({blockId:o})=>{const{t:n}=reactI18next.useTranslation(),{askAi:r,loading:a,error:i}=useAskAi(),[l,u]=React.useState(""),[c,x]=React.useState(!0),[d,p]=React.useState(),m=React.useRef(null),h=React.useRef(null);React.useEffect(()=>{var g;(g=m.current)==null||g.focus()},[]);const f=g=>{const{usage:j}=g||{};!i&&j&&p(j),h.current=setTimeout(()=>p(void 0),1e4),i||u("")};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"",children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:()=>x(!c),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 "+(c?"rotate-180":"")})})]}),c&&o?jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Textarea,{ref:m,value:l,onChange:g=>u(g.target.value),placeholder:n("Ask AI to edit content"),className:"w-full",rows:3,onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),h.current&&clearTimeout(h.current),p(void 0),r("content",o,l,f))}}),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,f)},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:g=>{h.current&&clearTimeout(h.current),p(void 0),r("content",o,g,f)}})]}):c?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),[u,c]=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 f=async()=>{try{c(!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(g){d(g)}finally{c(!1)}};return jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Accordion,{onValueChange:g=>{p(g!=="")},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:g=>a(g.target.value),placeholder:o("Tell about this page eg this page is about"),className:"mt-1 w-full",rows:10,onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),f())}}),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:()=>f(),variant:"default",className:"w-fit",size:"sm",children:u?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:u?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(""),f()},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)})]})},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:u})=>{const{t:c}=reactI18next.useTranslation();return jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.HoverCard,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.HoverCardTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{onClick:()=>u(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:c(o)}),jsxRuntime.jsxRuntimeExports.jsx("p",{className:"text-xs",children:c(n)})]})})})]})},Breakpoints=()=>{const[,o,n]=useCanvasWidth(),[r,a]=useSelectedBreakpoints(),{t:i}=reactI18next.useTranslation(),l=useBuilderProp("breakpoints",WEB_BREAKPOINTS),u=c=>{r.includes(c)?r.length>2&&a(r.filter(x=>x!==c)):a(x=>[...x,c])};return l.length<4?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:lodashEs.map(l,c=>React.createElement(BreakpointCard,{...c,onClick:n,key:c.breakpoint,currentBreakpoint:o}))}):jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[lodashEs.map(l.filter(c=>lodashEs.includes(r,lodashEs.toUpper(c.breakpoint))),c=>React.createElement(BreakpointCard,{...c,onClick:n,key:c.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,c=>jsxRuntime.jsxRuntimeExports.jsx(contextMenu.DropdownMenuCheckboxItem,{disabled:c.breakpoint==="xs",onCheckedChange:()=>u(lodashEs.toUpper(c.breakpoint)),checked:lodashEs.includes(r,lodashEs.toUpper(c.breakpoint)),children:i(c.title)},c.breakpoint))]})]})]})};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 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 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])};function usePubSub(o,n){React.useEffect(()=>{const r=pubsub.subscribe(o,n);return()=>r()},[o,n])}const 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,{})]})]})},AttrsEditor=React.memo(function o({preloadedAttributes:n=[],onAttributesChange:r}){const[a,i]=React.useState([]),[l,u]=React.useState(""),[c,x]=React.useState(""),[d,p]=React.useState(null),[m,h]=React.useState(""),f=React.useRef(null),g=React.useRef(null);React.useEffect(()=>{i(n)},[n]);const j=()=>{if(l.startsWith("@")){h("Attribute keys cannot start with '@'");return}if(l){const b=[...a,{key:l,value:c}];r(b),i(a),u(""),x(""),h("")}},R=b=>{const E=a.filter((S,A)=>A!==b);r(E),i(E)},_=b=>{p(b),u(a[b].key),x(a[b].value)},w=()=>{if(l.startsWith("@")){h("Attribute keys cannot start with '@'");return}if(d!==null&&l){const b=[...a];b[d]={key:l,value:c},r(b),i(b),p(null),u(""),x(""),h("")}},y=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),d!==null?w():j())};return jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex max-h-full flex-1 flex-col",children:[jsxRuntime.jsxRuntimeExports.jsxs("form",{onSubmit:b=>{b.preventDefault(),d!==null?w():j()},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:f,value:l,onChange:b=>u(b.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:g,value:c,onChange:b=>x(b.target.value),onKeyDown:y,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((b,E)=>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:b.key}),jsxRuntime.jsxRuntimeExports.jsx("span",{className:"text-wrap max-w-[200px] font-normal",children:b.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:()=>_(E),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:()=>R(E),children:jsxRuntime.jsxRuntimeExports.jsx(lucideReact.X,{className:"h-3 w-3"})})]})]},E))})]})}),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 c=lodashEs.map(lodashEs.get(o,l),(x,d)=>({key:d,value:x}));lodashEs.isEmpty(c)?r([]):r(c)},[lodashEs.get(o,l)]);const u=React__namespace.useCallback((c=[])=>{const x={};lodashEs.forEach(c,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:u})})})})});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",{})]})]})})},AddBlocksDialog=()=>{const{t:o}=reactI18next.useTranslation(),[n,r]=React.useState(""),[a,i]=React.useState(-1),[l,u]=React.useState(!1);return usePubSub(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK,c=>{r(c?c._id:null),i(isNaN(c==null?void 0:c.position)?-1:c==null?void 0:c.position),u(!0)}),usePubSub(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK,()=>{r(""),i(-1),u(!1)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.AlertDialog,{open:l,onOpenChange:()=>l?u(!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:()=>u(!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 LayoutCard({disabled:o=!1,description:n,title:r,selected:a,onSelect:i,children:l}){const{t:u}=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:u(o?"Coming soon":a?"Selected":"Select")})]})})}const ChooseLayout=({open:o,close:n})=>{const{t:r}=reactI18next.useTranslation(),[a,i]=useLayoutVariant(),l=u=>{i(u),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-pFV2NO8v.cjs")));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 u=useBuilderProp("sideBarComponents.top",[]),c=useBuilderProp("sideBarComponents.bottom",[]),x=g=>{g.preventDefault()},d=g=>{n(o===g?null:g)},p=useSidebarMenuItems(),{t:m}=reactI18next.useTranslation(),h=[...p,...u],f=useBuilderProp("htmlDir","ltr");return jsxRuntime.jsxRuntimeExports.jsx("div",{dir:f,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((g,j)=>jsxRuntime.jsxRuntimeExports.jsxs(contextMenu.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxRuntimeExports.jsx(contextMenu.Button,{variant:o===j?"default":"ghost",className:"mb-2 rounded-lg p-2 transition-colors",onClick:()=>d(j),children:lodashEs.get(g,"icon",null)},j)}),jsxRuntime.jsxRuntimeExports.jsx(contextMenu.TooltipContent,{side:"right",children:jsxRuntime.jsxRuntimeExports.jsx("p",{children:m(g.label)})})]},"button"+j))}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1"}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"flex flex-col",children:c==null?void 0:c.map((g,j)=>jsxRuntime.jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntime.jsxRuntimeExports.jsx("div",{}),children:React.createElement(g,{key:j})}))})]}),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","rjsfFields","rjsfWidgets","rjsfTemplates"]))},[o]),React.useEffect(()=>{builderStore.set(chaiRjsfFieldsAtom,o.rjsfFields||{}),builderStore.set(chaiRjsfWidgetsAtom,o.rjsfWidgets||{}),builderStore.set(chaiRjsfTemplatesAtom,o.rjsfTemplates||{})},[o.rjsfFields,o.rjsfWidgets,o.rjsfTemplates]),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,(u,c)=>{i18n.addResourceBundle(c,"translation",u,!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:"h-screen w-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;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;
|