import{a as E}from"https://app.framerstatic.com/chunk-PKJVDKZN.mjs";import{a as co,b as po,c as fo,d as ho}from"https://app.framerstatic.com/chunk-ILTXS4C4.mjs";import{a as uo,h as mo}from"https://app.framerstatic.com/chunk-4W2OJCZI.mjs";import{a as lo}from"https://app.framerstatic.com/chunk-ABHKVANM.mjs";import"https://app.framerstatic.com/chunk-5LBBN5VN.mjs";import{A as ao,B as so,b as Zt,c as Kt,d as jt,f as _t,h as $t,i as Jt,j as Xt,l as Yt,r as eo,s as to,t as oo,u as he,v as ro,w as no,x as io,y as Ce,z as ve}from"https://app.framerstatic.com/chunk-I22AKSBB.mjs";import{a as Gt}from"https://app.framerstatic.com/chunk-O7IZQXMB.mjs";import"https://app.framerstatic.com/chunk-NLAKERIY.mjs";import{a as wt,b as Ut,c as Ht,e as K}from"https://app.framerstatic.com/chunk-BQWQQNFE.mjs";import{b as me,c as fe,d as kt,f as Wt,l as At}from"https://app.framerstatic.com/chunk-5TPKLVJQ.mjs";import{a as Tt,i as Dt,k as Ot}from"https://app.framerstatic.com/chunk-LOZ5RNLK.mjs";import{a as St}from"https://app.framerstatic.com/chunk-SQYA4H27.mjs";import{Kg as xt,Lg as Lt}from"https://app.framerstatic.com/chunk-NJPEX32F.mjs";import{k as Nt}from"https://app.framerstatic.com/chunk-FQWDYW2U.mjs";import{b as Ft}from"https://app.framerstatic.com/chunk-7GSEC7H4.mjs";import"https://app.framerstatic.com/chunk-UH4PEA5S.mjs";import"https://app.framerstatic.com/chunk-Y4KSD2WZ.mjs";import"https://app.framerstatic.com/chunk-AKHXPLFB.mjs";import{a as zt,b as Qt,c as qt}from"https://app.framerstatic.com/chunk-CTKJD4ES.mjs";import{h as Bt}from"https://app.framerstatic.com/chunk-3IF5XHXW.mjs";import{bh as Mt,o as gt,q as Pt}from"https://app.framerstatic.com/chunk-VON542VF.mjs";import{$g as ce,$i as ht,Ab as Ae,Ag as ot,D as Fe,Dh as ft,Eb as He,Ee as ze,F as De,Fa as ne,Gb as de,Gf as Ye,Hg as G,Ie as Qe,Je as qe,Oe as B,Og as rt,Q as Oe,Rg as nt,Sg as it,Te as Ge,Ue as se,Ve as Q,We as Ze,Wg as at,Xe as Ke,Xn as It,Yo as pe,Ze as je,Zl as vt,_e,bg as q,br as Z,cg as tt,ch as dt,dh as st,ee as z,eh as lt,ew as Rt,fh as ct,gb as ae,hb as Ue,io as yt,jr as ue,mh as pt,pf as $e,ph as ut,qf as Je,qh as mt,rf as Xe,rj as Ct,wv as bt,xb as Be}from"https://app.framerstatic.com/chunk-5GLCHXYR.mjs";import"https://app.framerstatic.com/chunk-VXJAAVJQ.mjs";import"https://app.framerstatic.com/chunk-6C6VSETA.mjs";import"https://app.framerstatic.com/chunk-FYUJQV6J.mjs";import"https://app.framerstatic.com/chunk-KYPY4QS7.mjs";import{b as Et}from"https://app.framerstatic.com/chunk-2XUYJW3A.mjs";import"https://app.framerstatic.com/chunk-XFC6OVIX.mjs";import{K as w,g as re,n as Te,s as Ee}from"https://app.framerstatic.com/chunk-UGAGW2LG.mjs";import"https://app.framerstatic.com/chunk-XFC6OVIX.mjs";import"https://app.framerstatic.com/chunk-LH43QRIB.mjs";import"https://app.framerstatic.com/chunk-4AQCMAAQ.mjs";import{e as Vt}from"https://app.framerstatic.com/chunk-4X6QV4YI.mjs";import"https://app.framerstatic.com/chunk-426RYG63.mjs";import"https://app.framerstatic.com/chunk-YYMJ766K.mjs";import"https://app.framerstatic.com/chunk-AYPWLPKM.mjs";import"https://app.framerstatic.com/chunk-POQKH4YA.mjs";import{p as Do}from"https://app.framerstatic.com/chunk-34F2KRU3.mjs";import"https://app.framerstatic.com/chunk-AUNF3KWQ.mjs";import{p as le,r as et}from"https://app.framerstatic.com/chunk-6ELJJXEU.mjs";import{b as F,e as ke,f as We,i as ie}from"https://app.framerstatic.com/chunk-ZQUNXESX.mjs";import{Ic as we,a as O,b as V}from"https://app.framerstatic.com/chunk-NIDOI5EE.mjs";import{j as Ve}from"https://app.framerstatic.com/chunk-7MIOU3NE.mjs";import"https://app.framerstatic.com/chunk-BNISFP5B.mjs";import{B as Me,G as Ne,K as xe,O as Le,P as Se,ca as H,i as Pe,l as U}from"https://app.framerstatic.com/chunk-6JNYDX3D.mjs";import{a as h,b as ge}from"https://app.framerstatic.com/chunk-WNSBRACC.mjs";import{a as Re}from"https://app.framerstatic.com/chunk-LQILWJHN.mjs";import{e as M,j as c}from"https://app.framerstatic.com/chunk-AHQIRSXG.mjs";var Co=new WeakMap;function Ie(o){let e=Co.get(o);if(e)return e;let t=new Set;if((gt(o)||Pt(o))&&t.add(o),o.children)for(let r of o.children){let n=Ie(r);for(let a of n)t.add(a)}return Co.set(o,t),t}var T=M(O()),Vo=M(Do());var D=M(O()),bo=M(V()),j=(0,D.createContext)({nodeInTextEditorId:void 0,clipPath:void 0});j.displayName="NodeInTextEditorContext";function vo({children:o,nodeInTextEditorId:e,clipPath:t}){let r=(0,D.useMemo)(()=>({nodeInTextEditorId:e,clipPath:t??void 0}),[e,t]);return(0,bo.jsx)(j.Provider,{value:r,children:o})}function Io(){let{nodeInTextEditorId:o}=(0,D.useContext)(j);return o}function yo(){let{clipPath:o}=(0,D.useContext)(j);return o}var b=M(O());var _=M(O()),k=M(V());function $({context:o,children:e,fallback:t}){return(0,k.jsx)(_.Suspense,{fallback:(0,k.jsx)(Oo,{context:o,children:t}),children:e})}function Oo({context:o,children:e}){return(0,_.useLayoutEffect)(()=>o.loadingStateTracker.trackSuspense(),[o]),(0,k.jsx)(k.Fragment,{children:e})}function A(o,e){let t=new Set;t.add(e);let r=Z(o,e);if(r){let n=io(r);for(let a of n)t.add(a)}return t}var u=M(V());Fe({target:De.canvas});function Po({context:o,webPageNode:e,collectionItemNode:t,breakpointNode:r,temporaryCollectionItemNodeId:n}){let a=(0,b.useContext)(q).activeLocale??void 0;if(e&&r)return z(e)&&t?(0,u.jsx)($,{context:o,children:(0,u.jsx)(wo,{context:o,webPageNode:e,collectionItemNode:t,breakpointNode:r,activeLocale:a,temporaryCollectionItemNodeId:n})}):(0,u.jsx)(Ro,{context:o,webPageNode:e,breakpointNode:r,combinedControlMap:void 0,combinedValueMap:void 0,placeholderVariableIds:void 0,activeLocale:a})}function wo({context:o,webPageNode:e,collectionItemNode:t,breakpointNode:r,activeLocale:n,temporaryCollectionItemNodeId:a}){let i=e.tree();h(i,"Must have a tree");let l=e.dataIdentifier,d=A(i,l);o.modulesRuntime.usePreloadedModules(...d);let[s,p]=o.modulesRuntime.useComponentLoader(),I=s.dataForIdentifier(l);h(I,"Data definition must exist after preloading module");let m=e.getVariableControlMap(i,s,p);h(m,"Control map must exist");let N=no(e,i,m,r,n,t.id,"public-and-private"),x=ce(N);o.sandboxCollectionData.set(e.id,x,m);let g=e.getVariableValueMap(i,s,o.sandboxCollectionData,p);h(g,"Value map must exist");let R=Z(i,l),{patchedValueMap:L,placeholderVariableIds:y}=(0,b.useMemo)(()=>!!R&&t.id===a?ko(R,g):{patchedValueMap:g,placeholderVariableIds:new Set},[R,g,t.id,a]),f=(0,b.useMemo)(()=>{let v=new Map;return v.set(e.id,m),v},[m,e.id]),C=(0,b.useMemo)(()=>{let v=new Map;return v.set(e.id,L),v},[L,e.id]);return(0,u.jsx)(Ro,{context:o,webPageNode:e,breakpointNode:r,combinedControlMap:f,combinedValueMap:C,placeholderVariableIds:y,activeLocale:n})}function ko(o,e){let t=new Map(e),r=new Set;for(let[n,a]of e){let i=o.getVariable(n);if(i){if(i.type==="string"){if(!(!a||F(a)&&a.trim()===""))continue;let d=i.options?.placeholder||i.description||i.name;t.set(n,d),r.add(n)}if(i.type==="richtext"){if(!(!a||F(a)&&Ot(a)))continue;t.set(n,`
${i.description||i.name}
`),r.add(n)}}}return{patchedValueMap:t,placeholderVariableIds:r}}function Ro({context:o,webPageNode:e,breakpointNode:t,combinedControlMap:r,combinedValueMap:n,placeholderVariableIds:a,activeLocale:i}){return pe(e)?(0,u.jsx)($,{context:o,children:(0,u.jsx)(Uo,{context:o,webPageNode:e,breakpointNode:t,combinedControlMap:r,combinedValueMap:n,placeholderVariableIds:a,activeLocale:i})}):(0,u.jsx)(W,{context:o,parentRenderId:e.id,node:t,parent:e,combinedControlMap:r,combinedValueMap:n,placeholderVariableIds:a,activeLocale:i,nodePropOverrides:void 0})}var Mo={minHeight:"100vh",width:"auto"},Wo=Jt();function Uo({context:o,webPageNode:e,breakpointNode:t,combinedControlMap:r,combinedValueMap:n,placeholderVariableIds:a,activeLocale:i}){let l=(0,b.useRef)(null),d=(0,b.useRef)(null);o.modulesRuntime.usePreloadedModules(e.layoutTemplateIdentifier);let[s]=o.modulesRuntime.useComponentLoader(),p=K(),I=J(o.fetchClient,e),m=e.getResolvedControlPropValues(s,p,n,i,I);m.style??={},Object.assign(m.style,Mo);let N=s.reactComponentForIdentifier(e.layoutTemplateIdentifier);h(N,"Component definition not found");let x=N.class,g=It(t)&&vt(t)?t.width:void 0,{activeVariant:R,className:L,selectors:y}=Xt(e.layoutTemplateIdentifier,g,Wo)||{};(0,b.useLayoutEffect)(()=>{if(!l.current||!d.current)return;let C=$t(d.current);if(o.layoutMeasureQueue.add(t.id,l.current,C),!!y)for(let v of y){let S=l.current.querySelector(v);S&&o.layoutMeasureQueue.add(t.id,S,[],v)}},[o.layoutMeasureQueue,t.id,y]);let f=(0,b.useMemo)(()=>({ref:d}),[]);return(0,u.jsx)("div",{ref:l,className:L,children:(0,u.jsx)(x,{...m,variant:R,children:(0,u.jsx)(W,{context:o,parentRenderId:e.id,node:t,parent:e,combinedControlMap:r,combinedValueMap:n,placeholderVariableIds:a,activeLocale:i,nodePropOverrides:f})})})}var W=(0,b.memo)(function({context:e,parentRenderId:t,node:r,parent:n,combinedControlMap:a,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:s}){let p=me(t,r.id),I=r.tree();return r.cache.resetForRendering(),r.cache.setVariableValueAndControlMap(i,i,a,d),At(n,r),bt(r)||r.resolveValue("visible",i)===!1?(e.sandboxVisibility.setVisible(p,!1),null):(e.sandboxVisibility.setVisible(p,!0),(0,u.jsx)($,{context:e,children:(0,u.jsx)(Ao,{context:e,renderId:p,tree:I,node:r,parent:n,combinedControlMap:a,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:s})}))});function Bo(o,e,t,r,n,a,i){let l=J(o.fetchClient,t),d=t.getProps(n,a,l);if(B(r)&&(d.style??={},d.style.position="relative",d.style.width="100%",pe(r)?(d.style.display="contents",d.style.position="relative",d._needsMeasure=!1,d["data-layout-template-root"]=!0):Object.assign(d.style,Mo)),se(t)){let s=so(t,a);s&&(d.viewBox=s)}if(d.id=e,i)for(let s in i){let p=i[s];s==="style"&&d.style?Object.assign(d.style,p):d[s]=p}return d}function Ao({context:o,renderId:e,tree:t,node:r,parent:n,combinedControlMap:a,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:s}){let p=Bo(o,e,r,n,i,d,s);if(Ke(r))return(0,u.jsx)(ut,{...p});if(_e(r))return ve(r),(0,u.jsx)(ne,{...p,as:"svg",children:r.children.map(I=>{let m=me(e,I.id);return Ce(I,i,o.sandboxVisibility,m,!1)})});if(ht(r))return ve(r),Ce(r,i,o.sandboxVisibility,e,!0);if(Ge(r))return(0,u.jsx)(mt,{...p});if(se(r))return(0,u.jsx)(Ho,{context:o,node:r,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d,nodeProps:p,renderId:e});if(ze(r)){let I=Rt(t,r);return(0,u.jsx)(ne,{...p,children:r.getChildrenInVisualOrder().map(m=>m.id===I?.id?(0,u.jsx)(Ko,{context:o,parentRenderId:e,tree:t,node:m,parent:r,combinedControlMap:a,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d},"repeated-child"):(0,u.jsx)(W,{context:o,parentRenderId:e,node:m,parent:r,combinedControlMap:a,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:void 0},m.id))})}return $e(r)?(0,u.jsx)(st,{...p}):Xe(r)?(0,u.jsx)(ct,{...p}):Je(r)?(0,u.jsx)(lt,{...p}):Ze(r)?null:Q(r)?r.isVectorInstance?(0,u.jsx)(qo,{node:r,context:o,nodeProps:p,combinedValueMap:i,activeLocale:d}):(0,u.jsx)(Qo,{context:o,renderId:e,node:r,combinedControlMap:a,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d,nodeProps:p}):(Ye(r),null)}var Ho=(0,b.memo)(function({context:e,node:t,combinedValueMap:r,placeholderVariableIds:n,activeLocale:a,nodeProps:i,renderId:l}){let d=t.getFontsForLoading();e.fontLoader.usePreloadedFonts(...d),i={...i};let s=Io(),p=yo();if(s===l)if(p){let m=i.style??{};i.style={...m,clipPath:p}}else i.isEditable=!0;zo(t,n)&&(i.opacity=.3);let I=(0,b.useMemo)(()=>ao(t,r,a),[t,r,a]);if(de(t.htmlContent)&&t.getComponentPresets().size>0){let m=t.tree();return h(m,"Must have a tree"),(0,u.jsx)(_t,{tree:m,node:t,...i,children:I})}return(0,u.jsx)(pt,{...i,children:I})});function zo(o,e){return e?go(o.htmlContent,e)||go(o.textContent,e):!1}function go(o,e){return de(o)?e.has(o.id):!1}function Qo({context:o,renderId:e,node:t,combinedControlMap:r,combinedValueMap:n,placeholderVariableIds:a,activeLocale:i,nodeProps:l}){let d=t.tree();h(d,"Must have a tree"),o.modulesRuntime.usePreloadedModules(t.codeComponentIdentifier);let[s]=o.modulesRuntime.useComponentLoader(),p=s.reactComponentForIdentifier(t.codeComponentIdentifier);h(p,"Component definition not found");let I=K(),m=J(o.fetchClient,t),N=t.getCodeComponentProps(s,I,n,i,m),x=xt(d,t,s);x.children=Lt(d,t,s);for(let f in x){let C=x[f];C&&(N[f]=C.map(v=>{let S=kt(e,t.id,f,v.key);return(0,u.jsx)(W,{context:o,parentRenderId:S,node:v.node,parent:t,combinedControlMap:r,combinedValueMap:n,placeholderVariableIds:a,activeLocale:i,nodePropOverrides:Zo},v.key)}))}let g=t.getRichTextControlKeys(s);for(let f of g){let C=N[f];F(C)&&(N[f]=Bt(C))}let R=t.getComponentVectorSetChildren(s,n),L=new Set;for(let f in R){let C=R[f];ie(C)||(L.add(C),o.modulesRuntime.preloadModule(C))}o.modulesRuntime.usePreloadedModules(...L);for(let f in R){let C=R[f];if(ie(C))continue;let v=s.reactComponentForIdentifier(C);h(v,"Vector definition not found"),N[f]=v.class}let y=p.class;return(0,u.jsx)(Yt,{...l,children:(0,u.jsx)(y,{...N})})}function qo({context:o,node:e,nodeProps:t,combinedValueMap:r,activeLocale:n}){let[a]=o.modulesRuntime.useComponentLoader(),i=K(),l=J(o.fetchClient,e);return eo({node:e,frameProps:t,getCodeComponentProps(){return e.getCodeComponentProps(a,i,r,n,l)},combinedValueMap:r,renderVectorWithIdentifier(d,s){return(0,u.jsx)(Go,{context:o,identifier:d,getProps:s})}})}function Go({context:o,identifier:e,getProps:t}){o.modulesRuntime.preloadModule(e),o.modulesRuntime.usePreloadedModules(e);let[r]=o.modulesRuntime.useComponentLoader(),n=r.reactComponentForIdentifier(e);h(n,"Component definition not found");let a=t(),i=n.class;return(0,u.jsx)(i,{...a})}var Zo={position:"relative"};function Ko({parent:o,...e}){if(Qe(o))return(0,u.jsx)(jo,{...e,parent:o});if(qe(o))return(0,u.jsx)(_o,{...e,parent:o});ge(o,"Unsupported repeater type")}function jo({context:o,parentRenderId:e,tree:t,node:r,parent:n,combinedControlMap:a,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d}){let s=A(t,n.dataIdentifier);o.modulesRuntime.usePreloadedModules(...s);let[p,I]=o.modulesRuntime.useComponentLoader(),m=n.getVariableControlMap(t,p,I);h(m,"Control map must exist");let N=Dt(n,m,to(t,n),y=>({type:"LiteralValue",value:r.cache.getVariableReferenceValue(y,i)}),y=>ro(t,n,y,d));Mt(n)&&oo(N,n);let x=ce(N);o.sandboxCollectionData.set(e,x,m);let g=n.originalid??n.id,R=(0,b.useMemo)(()=>{let y=new Map(a);return y.set(g,m),y},[m,a,g]),L=(0,b.useMemo)(()=>x.map((y,f)=>{let C=new Map(i),v=he(t,m,y,f);return C.set(g,v),C}),[t,m,i,g,x]);return x.map((y,f)=>{let C=F(y.id)?y.id:f,v=L[f],S=fe(e,n.id,C,f);return(0,u.jsx)(W,{context:o,parentRenderId:S,node:r,parent:n,combinedControlMap:R,combinedValueMap:v,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:void 0},C)})}function _o({context:o,parentRenderId:e,tree:t,node:r,parent:n,combinedControlMap:a,combinedValueMap:i,placeholderVariableIds:l,activeLocale:d}){h(i,"Combined value map must exist");let[s,p]=o.modulesRuntime.useComponentLoader(),I=n.getVariableControlMap(t,s,p);h(I,"Control map must exist");let m=n.dataRepeaterArray,N=m.providerId;h(N,"Variable must have providerId");let x=i.get(N);h(x,"Provider value map must exist");let g=x.get(m.id);h(We(g)&&g.every(ke),"Invalid array value");let R=n.originalid??n.id,L=(0,b.useMemo)(()=>{let f=new Map(a);return f.set(R,I),f},[I,a,R]),y=(0,b.useMemo)(()=>g.map((f,C)=>{let v=new Map(i),S=he(t,I,f,C);return v.set(R,S),v}),[t,I,i,R,g]);return g.map((f,C)=>{let v=F(f.id)?f.id:C,S=y[C],Fo=fe(e,n.id,v,C);return(0,u.jsx)(W,{context:o,parentRenderId:Fo,node:r,parent:n,combinedControlMap:L,combinedValueMap:S,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:void 0},v)})}function J(o,e){return t=>{let r=Be(t);if(!Zt(r))return Kt(e,r.controlProp);let n=Ae(r,l=>e.cache.getVariableReferenceValue(l)),a=rt({url:n,credentials:r.credentials}),i=o.getValue(a);if(i)return jt(e,r,i);throw o.fetchWithCache({url:n,cacheDuration:r.cacheDuration,credentials:r.credentials})}}var X=M(O());var xo=M(V());function No({tree:o,children:e}){let t=lo();(0,X.useLayoutEffect)(()=>{let n=t?"dark":"light";document.body.setAttribute("data-framer-theme",n)},[t]);let r=(0,X.useMemo)(()=>Ct(o,t),[o,t]);return(0,xo.jsx)(dt,{customProperties:r,children:e})}var Y=class{constructor(){c(this,"loaders",new Map)}preloadFonts(...e){for(let t of e){if(this.loaders.has(t))continue;let r=new G(async()=>{await w.loadFonts([t])});r.preload(),this.loaders.set(t,r)}}usePreloadedFonts(...e){for(let t of e){let r=this.loaders.get(t);h(r,"Font not preloaded"),r.use()}}};var ee=class{constructor(){c(this,"promises",new Set)}trackSuspense(){let e=new H;return this.promises.add(e),()=>{e.resolve(),this.promises.delete(e)}}async waitForSuspense(){this.promises.size!==0&&(await Promise.all(this.promises),await this.waitForSuspense())}};var So=M(O());var be=class{constructor(e,t){this.modulesRuntime=e;this.identifier=t;c(this,"loaderPromise",new H);c(this,"loader",new G(()=>this.loaderPromise))}async evaluate(e){let t=await mo(e),r=[],n=this.modulesRuntime.getLocales();await uo(this.modulesRuntime.queryEngine,n,this.identifier,t,r,void 0,0),await this.modulesRuntime.updateComponentLoader(r),this.loaderPromise.resolve(),this.modulesRuntime.notifyReactComponents()}},te=class{constructor(e){this.sandbox=e;c(this,"componentLoaderHash",0);c(this,"reactComponentListeners",new Set);c(this,"localModules",new Map);c(this,"loadedModules",new Map);c(this,"queryEngine",new at);c(this,"reactExternalStore",{subscribe:e=>(this.reactComponentListeners.add(e),()=>{this.reactComponentListeners.delete(e)}),getSnapshot:()=>this.componentLoaderHash})}getLocales(){return this.sandbox.getLocales()}useComponentLoader(){let e=(0,So.useSyncExternalStore)(this.reactExternalStore.subscribe,this.reactExternalStore.getSnapshot);return[ae,String(e)]}async updateComponentLoader(e){ae.updateModuleEntities(e),await this.sandbox.remoteComponentsStore.updateComponentLoader(fo(e),this.componentLoaderHash++)}notifyReactComponents(){for(let e of this.reactComponentListeners)e()}getLocalModuleURL(e){let t=this.localModules.get(e.localId);if(t)return t.moduleURL}getExternalModuleURL(e){return`${Re().modulesCDN}/${e.moduleId}/${e.saveId}/${e.file}`}getModuleURL(e){return Me(e)?this.getExternalModuleURL(e):this.getLocalModuleURL(e)}async loadModule(e){this.preloadModule(e),await this.getPreloadedModule(e).loader.readAsync()}preloadModule(e){let t=Lo(e);if(this.loadedModules.get(t.value))return;let n=new be(this,t);this.loadedModules.set(t.value,n);let a=this.getModuleURL(t);a&&n.evaluate(a).catch(U)}getPreloadedModule(e){let t=Lo(e),r=this.loadedModules.get(t.value);return h(r,"Module not preloaded"),r}usePreloadedModules(...e){let t=[];for(let r of e){let a=this.getPreloadedModule(r).loader.preload();a&&t.push(a)}if(t.length>0)throw Promise.all(t)}updateDependenciesModule(e){let t=JSON.parse(e.importMapContent);ye(t,"framer-user-importmap")}updateLocalModules(e){let t=new Map,r=new Set;for(let[,n]of e){h(n.kind!=="fast-refresh","Fast-refresh is not supported");let a=n.localId;t.set(a,n),this.localModules.get(a)?.moduleURL!==n.moduleURL&&r.add(a)}this.localModules=t,this.updateLocalModulesImportMap();for(let n of r){let a=Ne(n),i=this.loadedModules.get(a.value);if(i){let l=this.getLocalModuleURL(a);l&&i.evaluate(l).catch(U)}}}updateLocalModulesImportMap(){let e={imports:{},scopes:{}};for(let[t,r]of this.localModules){let n=r.files.module;if(!n)continue;let a=Se(t,n);e.imports[a]=r.moduleURL}ye(e,"framer-local-modules")}insertTemporaryImportMap(e){let t=crypto.randomUUID();ye(e,t)}};function Lo(o){let e=xe(o);return h(e,"Invalid module identifier"),Le(e)}function ye(o,e){let t=document.createElement("script");t.type="importmap-shim",t.id=e,t.innerHTML=JSON.stringify(o);let r=document.getElementById(e);r?r.replaceWith(t):document.body.appendChild(t)}var P=M(V()),$o=He(o=>o?ue(o,{includeDrafts:!1}):Pe()),oe=class{constructor(e){this.container=e;c(this,"reactRoot");c(this,"needsRender",!1);c(this,"assetMap",new Te);c(this,"fontLoader",new Y);c(this,"modulesRuntime",new te(this));c(this,"fetchClient",new nt);c(this,"loadingStateTracker",new ee);c(this,"sandboxCollectionData",new Wt("sandbox"));c(this,"sandboxVisibility",new Ut("sandbox"));c(this,"partialTreeReceiver",new co);c(this,"controlsVisibility",new wt(this.partialTreeReceiver));c(this,"presetsListNode");c(this,"webPageNodeId");c(this,"webPageNode");c(this,"collectionItemNodeId");c(this,"collectionItemNode");c(this,"breakpointNodeId");c(this,"breakpointNode");c(this,"nodeInTextEditorId");c(this,"nodeInTextEditorClipPath",null);c(this,"temporaryCollectionItemNodeId");c(this,"remoteComponentsStore");c(this,"remoteSandboxStore");c(this,"remoteTreeStore");c(this,"layoutMeasureQueue",new ho({shouldMeasureCallback:()=>{let e=this.measureLayout();e&&this.remoteTreeStore.onLayoutMeasure(e)},shouldMeasureCallbackDelayMs:0}));this.reactRoot=(0,Vo.createRoot)(this.container);let t=new Tt(E);t.setLocal(E.channels.sandbox,this),t.setLocal(E.channels.controlsVisibility,this.controlsVisibility),t.setLocal(E.channels.modulesRuntime,this.modulesRuntime),t.setLocal(E.channels.flags,this),this.remoteComponentsStore=t.getRemote(E.channels.componentsStore),this.remoteSandboxStore=t.getRemote(E.channels.sandboxStore),this.remoteTreeStore=t.getRemote(E.channels.treeStore),this.connectRpc(t).catch(U)}get tree(){return this.partialTreeReceiver.tree}getLocales(){return $o(this.tree?.root?.locales)}async connectRpc(e){await e.connect({target:window.parent,url:Vt(document.referrer).origin}),new ResizeObserver(r=>{h(r.length===1,"Invalid length");let n=r[0];h(n,"Invalid entry"),h(n.target===this.container,"Invalid target"),this.breakpointNode&&this.layoutMeasureQueue.remeasureNode(this.breakpointNode),this.remoteSandboxStore.oneway.onHeightChange(n.contentRect.height)}).observe(this.container)}measureLayout(){if(!this.webPageNode||!this.breakpointNode)return;let e=new Set;e.add(this.breakpointNode.id);let t=this.layoutMeasureQueue.process({groundNodesInViewport:e,offsetX:0,offsetY:0,scopeId:this.webPageNode.id,tree:this.tree,zoom:1});if(t.length!==0)return t}scrollTo(e){if(window.scrollTo(e),this.breakpointNode){for(let t of Ie(this.breakpointNode))this.layoutMeasureQueue.remeasureNode(t);this.layoutMeasureQueue.remeasureNode(this.breakpointNode)}}update(e){let t=e.partialTreeUpdate;t&&(this.partialTreeReceiver.update(t),this.preloadTree());let r=e.webPageNodeId;r&&(this.webPageNodeId=r);let n=e.collectionItemNodeId;n&&(this.collectionItemNodeId=n);let a=e.breakpointNodeId;a&&(this.breakpointNodeId=a);let i=e.stylePresetBreakpointClassNames;F(i)&&(this.container.className=i);let l=e.dependenciesModule;l&&this.modulesRuntime.updateDependenciesModule(l);let d=e.localModules;d&&this.modulesRuntime.updateLocalModules(d);let s=e.assets;s&&(this.assetMap.set(s),w.importCustomFonts(s,le.isOn("customFontGrouping"))),this.nodeInTextEditorId!==e.nodeInTextEditorId&&e.nodeInTextEditorId!==void 0&&(this.nodeInTextEditorId=e.nodeInTextEditorId,this.needsRender=!0),e.nodeInTextEditorClipPath!==void 0&&this.nodeInTextEditorClipPath!==e.nodeInTextEditorClipPath&&(this.nodeInTextEditorClipPath=e.nodeInTextEditorClipPath,this.needsRender=!0),this.temporaryCollectionItemNodeId!==e.temporaryCollectionItemNodeId&&e.temporaryCollectionItemNodeId!==void 0&&(this.temporaryCollectionItemNodeId=e.temporaryCollectionItemNodeId,this.needsRender=!0),this.updateWebPageNode(),this.updateCollectionItemNode(),this.updateBreakpointNode(),this.updatePresetsListNode(),this.render()}preloadWebPage(){if(this.webPageNode){for(let e of this.webPageNode.walk())if(Q(e)&&this.modulesRuntime.preloadModule(e.codeComponentIdentifier),B(e)&&e.layoutTemplateIdentifier&&this.modulesRuntime.preloadModule(e.layoutTemplateIdentifier),z(e)&&this.modulesRuntime.preloadModule(e.dataIdentifier),po(e)){let t=e.getFontsForLoading();this.fontLoader.preloadFonts(...t)}}}preloadTree(){let e=this.tree.getContentManagementNode()?.loaded;if(e)for(let r of e.children){let n=A(this.tree,r.instanceIdentifier);for(let a of n)this.modulesRuntime.preloadModule(a)}let t=this.tree.getPresetsListNode();if(t){for(let r of t.children)if(Nt(r)){let n=r.getFontsForCodeGeneration();this.fontLoader.preloadFonts(...n)}}}updateWebPageNode(){let e=this.tree.getNodeWithTrait(this.webPageNodeId,B)?.loaded;this.webPageNode!==e&&(this.needsRender=!0,this.webPageNode=e,this.preloadWebPage())}updateCollectionItemNode(){let e=this.tree.getNodeWithTrait(this.collectionItemNodeId,je)??void 0;this.collectionItemNode!==e&&(this.needsRender=!0,this.collectionItemNode=e)}updateBreakpointNode(){let e=this.tree.get(this.breakpointNodeId)??void 0;this.breakpointNode!==e&&(this.needsRender=!0,this.breakpointNode=e)}updatePresetsListNode(){let e=this.tree.getPresetsListNode()??void 0;this.presetsListNode!==e&&(this.needsRender=!0,this.presetsListNode=e)}async onRendered(e){await this.loadingStateTracker.waitForSuspense(),this.breakpointNode&&e&&this.remoteSandboxStore.onInitialLoadComplete(e),this.remoteTreeStore.onSandboxRendered({layoutMeasurements:this.measureLayout(),collectionUpdates:this.sandboxCollectionData.export(),visibilityUpdates:this.sandboxVisibility.export()})}render(){this.needsRender&&((0,T.startTransition)(()=>{this.reactRoot.render((0,P.jsx)(T.StrictMode,{children:(0,P.jsxs)(Jo,{webPageNodeId:this.webPageNodeId,onRendered:this.onRendered.bind(this),children:[(0,P.jsx)(No,{tree:this.tree,children:(0,P.jsx)(ot,{children:(0,P.jsx)(we,{isStatic:!0,children:(0,P.jsx)(Xo,{tree:this.tree,children:(0,P.jsx)(it,{client:this.fetchClient,children:(0,P.jsx)(Oe,{parentSize:1,children:(0,P.jsx)(vo,{nodeInTextEditorId:this.nodeInTextEditorId,clipPath:this.nodeInTextEditorClipPath,children:(0,P.jsx)(Po,{context:this,webPageNode:this.webPageNode,collectionItemNode:this.collectionItemNode,breakpointNode:this.breakpointNode,temporaryCollectionItemNodeId:this.temporaryCollectionItemNodeId})})})})})})})}),(0,P.jsx)(Gt,{presetsListNode:this.presetsListNode})]})}))}),this.needsRender=!1)}updateExperiments(e){le.update(e)}updateProjectFeatures(e){Et.update(e)}updateEmployeesOnlySettings(e){St.update(e)}};function Jo({children:o,webPageNodeId:e,onRendered:t}){return(0,T.useEffect)(()=>{t(e)}),(0,P.jsx)(P.Fragment,{children:o})}function Xo({tree:o,children:e}){let t=o.root.getDefaultLocale(),r=(0,T.useMemo)(()=>{let d=[t];o.root.locales&&d.push(...o.root.locales);let s=ue(d,{includeDrafts:!1}),p=s[0];return h(p),{activeLocale:p,locales:s,setLocale:Ft}},[t,o.root.locales]),n=et("adaptLayoutToTextDirectionSetting"),a=o.root.adaptLayoutToTextDirection&&n,i=r.activeLocale?.textDirection??"ltr",l=a?i:"ltr";return(0,T.useLayoutEffect)(()=>{a?document.documentElement.setAttribute("dir",i):document.documentElement.removeAttribute("dir")},[a,i]),(0,P.jsx)(q.Provider,{value:r,children:(0,P.jsx)(tt.Provider,{value:l,children:e})})}Object.assign(window,{Framer:ft});Ve({name:"canvas",security:{}});var To=document.querySelector("main");h(To,"Container element not found");var Eo=new oe(To),Yo=Ht(Eo.assetMap);w.importFramerFonts(yt);Ue({isOnPageCanvas:!0,assetResolver:Yo,queueMeasureRequest(...o){Eo.layoutMeasureQueue.add(...o)},enableFontStore:!0,fetchGoogleFontsList:qt,fetchFontshareFontsList:Qt,fetchBuiltInFontsList:zt,imagePlaceholderSvg:'',useImageSource(o){if(!o.src)return"";let e=Ee(o.src);return e?re(e.identifier):re(o.src)}}); //# sourceMappingURL=https://app.framerstatic.com/canvas-sandbox-on-page.Y3CP4PZC.mjs.map