efficient-easel 24.0.0 → 24.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/{chunk-CMMR6CJS.js → chunk-4ESG53BH.js} +1 -1
- package/dist/{chunk-PDJ5ZALV.js → chunk-75C6WFNF.js} +1 -1
- package/dist/chunk-7RSE6KKY.js +1 -0
- package/dist/{chunk-4RJBW7VC.js → chunk-CMPFUJ26.js} +6 -6
- package/dist/chunk-FJTCSQWK.js +16 -0
- package/dist/{chunk-2AV62DEP.js → chunk-G67G63O5.js} +1 -1
- package/dist/{chunk-ZYHKXEND.js → chunk-JMAOCKB2.js} +3 -3
- package/dist/{chunk-D5GQEUKM.js → chunk-OITNWE52.js} +1 -1
- package/dist/{chunk-Z5BPY2VG.js → chunk-QORC32JO.js} +5 -5
- package/dist/chunk-UKPZ2YWE.js +64 -0
- package/dist/easel/index.d.ts +20 -1
- package/dist/easel/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document/box-fields.js +9 -9
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +15 -2
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/strings/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7BW74Y55.js +0 -1
- package/dist/chunk-HHQZB6IE.js +0 -64
- package/dist/chunk-VBOSOH5M.js +0 -16
package/README.md
CHANGED
|
@@ -780,6 +780,16 @@ top-level block down to a node, by id) and `nextInChain` (what a click on that
|
|
|
780
780
|
chain picks, given the selection), for a host that adds rungs of its own.
|
|
781
781
|
Both take a `passThrough` (8.2.0): nodes a click walks past, no step of the
|
|
782
782
|
chain; the canvas reads it from `CanvasPassThroughContext` or its own prop.
|
|
783
|
+
CHROME the host drew outside every block (the site's chat bubble; issue list C8,
|
|
784
|
+
2026-10-28) is framed by the canvas too. An element with an owner block is a
|
|
785
|
+
part (`CanvasParts`), not chrome. The host marks the element with `CHROME_ATTR`
|
|
786
|
+
(`data-es-chrome="<id>"`, imported, never typed) and provides `CanvasChromeContext` (a
|
|
787
|
+
`CanvasChrome`: `selected()`, `select(id)`). The canvas draws the one hover frame
|
|
788
|
+
and the one selected frame on the element's own box (a `position: fixed` element
|
|
789
|
+
keeps its frame after a scroll), a click calls `select(id)` and changes no block
|
|
790
|
+
selection, and the selected block's own box stands down. A host hands a new
|
|
791
|
+
`chrome` object when its selection changes, as it does for `parts`. A host never
|
|
792
|
+
draws an outline of its own for it.
|
|
783
793
|
A node many pages use live has a green outline: the canvas asks
|
|
784
794
|
`CanvasSharedContext` (`(id) => boolean`) of each node it outlines, and the
|
|
785
795
|
screen provides it from the layer's `pinned.sharedReach`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScreenPartsProvider as t}from"./chunk-
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-QORC32JO.js";import{useEaselHost as e}from"./chunk-LX23TCTP.js";import{createEasel as r,EaselProvider as o}from"./chunk-FJTCSQWK.js";import{useState as n,useEffect as s}from"react";import{jsx as a}from"react/jsx-runtime";function i({config:i,data:c,onChange:m,permissions:p,parts:f,children:u}){const[d]=n(()=>r({config:i,data:c,permissions:p}));s(()=>{d.setConfig(i)},[d,i]),s(()=>{if(!m)return;let t=d.getState().appState.data,e=!1;return d.subscribe(()=>{const r=d.getState().appState.data;r!==t&&(t=r,(e||r!==d.loaded)&&(e=!0,m(r)))})},[d,m]),s(()=>{p&&d.setPermissions(p)},[d,p]);const h=e();/* @__PURE__ */
|
|
2
2
|
return a(o,{easel:d,hotkeys:h.ownsDocument,children:/* @__PURE__ */a(t,{parts:f,children:u})})}export{i as ScreenStoreProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEaselHost as n}from"./chunk-LX23TCTP.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-
|
|
1
|
+
import{useEaselHost as n}from"./chunk-LX23TCTP.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-FJTCSQWK.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSectionOps as o}from"./chunk-OITNWE52.js";import{SELECTION_MODE as e}from"./chunk-QORC32JO.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-FJTCSQWK.js";import{usePreviewParts as p}from"./chunk-467WWV4I.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&I.select(r)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-VKPOH6MK.js";import{blockTypesIn as o}from"./chunk-IZGFJWH4.js";import{sectionTemplatesOf as l}from"./chunk-N7E6264U.js";import{sharedSectionsOf as r}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-5PXVT7JY.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as d,useScreenPinned as p}from"./chunk-
|
|
2
|
-
return x(
|
|
1
|
+
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-VKPOH6MK.js";import{blockTypesIn as o}from"./chunk-IZGFJWH4.js";import{sectionTemplatesOf as l}from"./chunk-N7E6264U.js";import{sharedSectionsOf as r}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-5PXVT7JY.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as d,useScreenPinned as p}from"./chunk-QORC32JO.js";import{useEaselSession as m}from"./chunk-YM4UEGBV.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-IYHO4XQX.js";import{useEasel as u}from"./chunk-FJTCSQWK.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-LN43DP2A.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-TQ5Y6S2X.js";import{useState as b,useEffect as v,useMemo as j,useRef as C}from"react";import{SharedIcon as O,AddIcon as w}from"efficient-shell/icons/efficient";import{ContextMenu as I,toast as F,Dialog as T,Button as $}from"efficient-shell/ui";import{jsx as x,jsxs as E,Fragment as H}from"react/jsx-runtime";function M({name:e,pages:t,onDelete:n,onCancel:o}){const l=h("screen",f).shared,[r,i]=b(!1),s=C(null);/* @__PURE__ */
|
|
2
|
+
return x(T,{open:!0,role:"alertdialog",size:"sm",title:l.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */E(H,{children:[
|
|
3
3
|
/* @__PURE__ */x($,{ref:s,variant:"secondary",onClick:o,children:l.cancel}),
|
|
4
|
-
/* @__PURE__ */x($,{variant:"danger",loading:r,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:l.deleteShared})]}),children:l.deleteMessage({count:t})})}var
|
|
5
|
-
return E(
|
|
6
|
-
/* @__PURE__ */x(i,{icon:/* @__PURE__ */x(
|
|
4
|
+
/* @__PURE__ */x($,{variant:"danger",loading:r,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:l.deleteShared})]}),children:l.deleteMessage({count:t})})}var Q=e=>`section:${e}`,S=e=>`block:${e}`,W=e=>`template:${e}`,A=e=>`shared:${e}`;function J({at:C,placeBlocks:T,canTake:$,onPick:J,itemFor:L,session:N,siteWide:P,onClose:Y,onHide:z,readOnly:B}){const D=u(e=>e.config),G=a(),{labelAtLevel:R,categoryLabel:U,firstSection:V,Icon:X,Thumbnail:K}=G,{blockIsOffered:_,canAddTo:Z}=d(),q=h("screen",f).add,ee=h("drag",g).add,te=m(),[ne,oe]=b([]);v(()=>{let e=!1;const t=e=>_(e,te);return l(te).list().then(n=>{if(e)return;const l=D.components;oe(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[D,te]);const le=p().shared,re=h("screen",f).shared,[ie,se]=b([]),[ce,ae]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>_(e,te);return r(te).list().then(n=>{if(e)return;const l=D.components;se(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[D,te,ce]);const[de,pe]=b(null),[me,fe]=b(null),ue=j(()=>e(D,G),[D]),ye=e=>R(e,"section",D.components[e]?.label??e),he=e=>({type:Q(e.type),label:e.name,cover:/* @__PURE__ */x(K,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:q.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ke=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=ne.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=ie.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}return null},ge=e=>/* @__PURE__ */x("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */x(X,{type:e,size:26})}),be=j(()=>{const e=t(ue,V),o=/* @__PURE__ */new Map,l=e=>{e.retired||o.has(e.type)||!_(e.type,te)||o.set(e.type,e)};for(const t of e?[e]:ue){const e=Z(t.type)?.choices??[];e.forEach(l),e.forEach(e=>Z(e.type,1)?.choices?.forEach(l))}T?.forEach(l);const r=new Set(ue.map(e=>e.type)),i=[...o.values()].filter(e=>!r.has(e.type)),s=e=>({type:S(e.type),label:e.label,cover:ge(e.type),title:q.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>o.has(e.type)?{...he(e),cover:ge(e.type)}:he(e),d=[];ie.length>0&&d.push({key:"shared",title:re.group,tiles:ie.map(e=>({type:A(e.id),label:e.title,cover:/* @__PURE__ */x(K,{type:e.node.type}),mark:/* @__PURE__ */x(O,{size:12}),title:re.onPages({count:e.used_on.length}),keywords:[ye(e.node.type),e.node.type]}))}),ne.length>0&&d.push({key:"templates",title:q.templates,tiles:ne.map(e=>({type:W(e.id),label:e.name,cover:/* @__PURE__ */x(K,{type:e.node.type}),keywords:[ye(e.node.type),e.node.type]}))});const p=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(D.categories??{})){const o=ue.filter(e=>e.cat===t);if(0===o.length)continue;const l=e&&o.some(t=>t.type===e.type)?e:null,r=(l?[l,...o.filter(e=>e.type!==l.type)]:o).map(a);l&&!m&&(r.splice(1,0,...p.map(s)),m=!0),d.push({key:`category:${t}`,title:n(D,t,U),tiles:r})}const f=d.find(e=>e.key?.startsWith("category:"));if(!m&&f&&p.length>0&&(f.tiles=[...f.tiles,...p.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{d.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!$)return d;const u=d.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ke(e.type),n=t?$(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[ne,ie,re,ue,D,q,$,T,te]);/* @__PURE__ */
|
|
5
|
+
return E(H,{children:[
|
|
6
|
+
/* @__PURE__ */x(i,{icon:/* @__PURE__ */x(w,{size:15}),title:q.title,context:q.contextAll,actions:/* @__PURE__ */x(s,{label:q.done,description:q.doneDescription,onClick:Y}),onHide:z}),
|
|
7
7
|
/* @__PURE__ */E("div",{className:"sf-addside sf-scroll",children:[
|
|
8
|
-
/* @__PURE__ */x(k,{groups:be,session:
|
|
8
|
+
/* @__PURE__ */x(k,{groups:be,session:N,itemFor:e=>L(ke(e)??{kind:"section",type:e}),onInsert:J?e=>{const t=ke(e);t&&J(t)}:void 0,onTileMenu:(e,t)=>{const n=ke(e);return"shared"===n?.kind&&!B&&(pe({section:n.section,...t}),!0)},at:C,hint:q.hint,searchLabel:q.search,readOnly:B,words:ee}),P??null]}),de?/* @__PURE__ */x(I,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>pe(null),"aria-label":de.section.title,items:y([{label:re.deleteShared,danger:!0,onClick:()=>{fe(de.section),pe(null)}}])}):null,me?/* @__PURE__ */x(M,{name:me.title,pages:me.used_on.length,onDelete:()=>(async e=>{try{await r(te).remove(e.id)}catch{return void F.error(re.deleteFailed)}fe(null),le?.removed?.(e),se(t=>t.filter(t=>t.id!==e.id)),ae(e=>e+1)})(me),onCancel:()=>fe(null)}):null]})}export{J as AddSidePanel,S as blockKey,Q as sectionKey,A as sharedKey,W as templateKey};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{DEFAULT_CANVAS_WORDS as e}from"./chunk-TBY3DFKS.js";import{useResolvedFields as t}from"./chunk-AGWKB77Q.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r,parentStep as l,clickPickPart as i,clickPick as s}from"./chunk-RPMSET77.js";import{selectionBox as a,placeWindow as c,offsetOrigin as u,colorRunOf as d,ColorWindow as p,startCanvasTyping as f,textMap as h}from"./chunk-HZSZT3BE.js";import{DEFAULT_COPY_WORDS as m}from"./chunk-KRL3IUV3.js";import{useWords as g}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as v,CANVAS_TYPABLE_EVENT as y,related as w,isTypingTarget as b,upsertCanvasStyle as k,removeCanvasStyle as S,WORDS_CLEAR as C,frameRectToHost as I,CANVAS_TYPING_EVENT as E,drawnBox as D}from"./chunk-YU3WHLGI.js";import{queryAllCopies as x}from"./chunk-LF3FUSCQ.js";import{find as A,ROOT_ID as O,getList as M,remove as $,parseZoneKey as R,move as z,duplicate as P,replaceNode as L,createNode as V,insert as j,normalizeData as N,createResolveCache as B,slotsOf as K,resolveNodeData as Z,ROOT_SLOT as F}from"./chunk-TGZCD6IP.js";import{topLevelSlotKeys as T,fieldsFrom as H,drawnBlockCount as W,defaultsFrom as Y}from"./chunk-KXM6YRG2.js";import{createContext as q,useEffect as U,useContext as G,useRef as Q,useSyncExternalStore as X,useState as J,useReducer as _,useMemo as ee,useCallback as te,useLayoutEffect as ne}from"react";import{jsx as oe,jsxs as re,Fragment as le}from"react/jsx-runtime";import{createPortal as ie}from"react-dom";import{registerModalEscapeInterceptor as se,FloatingBar as ae,TextToolbar as ce,LinkPicker as ue}from"efficient-shell/ui";function de(e){return!["setData","setUi","set"].includes(e.type)}var pe=(e,t,n,o)=>{const r=M(e,t,R(n));return r?.[o]??null},fe=(e,t,n,o,r)=>{const l=pe(e,t,n,o);if(!l)throw new Error(`${r}: nothing at ${n}[${o}]`);return l};function he(e,t){const{selection:o}=e;return{...e.ui,itemSelector:n(e.data,t,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function me(e,t,n){return n?"node"===n.kind?A(e,t,n.id)?n:null:n.parentId===O?M(e,t,n)?n:null:A(e,t,n.parentId)&&M(e,t,n)?n:null:null}function ge(e,t,n,r=!1){const{itemSelector:l,selectedSlot:i,...s}=n;let a=e.selection;var c;return"itemSelector"in n&&(a=o(e.data,t,l??null)),"selectedSlot"in n&&(i?a=(c=i)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===a?.kind&&(a=null)),{...e,selection:a,ui:r?s:{...e.ui,...s}}}function ve(e,t,n){const o=ye(e,t,n);if(o===e)return e;const r=me(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function ye(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return ge(e,n,"function"==typeof t.ui?t.ui(he(e,n)):t.ui);case"set":{const r={data:o,ui:he(e,n)},l="function"==typeof t.state?t.state(r):t.state;let i=l.data?{...e,data:l.data}:e;return l.ui&&(i=ge(i,n,l.ui,!0)),i}case"insert":{const r={...R(t.destinationZone),index:t.destinationIndex},l=V(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:j(o,n,r,l)}}case"replace":{const r=fe(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:L(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=fe(o,n,t.sourceZone,t.sourceIndex,"duplicate"),l=P(o,n,r.props.id),i=pe(l,n,t.sourceZone,t.sourceIndex+1);return{...e,data:l,selection:i?{kind:"node",id:i.props.id}:e.selection}}case"reorder":return ye(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=pe(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const l={...R(t.destinationZone),index:t.destinationIndex};return{...e,data:z(o,n,r.props.id,l)}}case"remove":{const r=fe(o,n,t.zone,t.index,"remove");return{...e,data:$(o,n,r.props.id)}}default:return e}}var we={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},be={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},ke=0,Se=()=>`history-${ke+=1}`;function Ce(e){let t=e.config;const r=e.now??(()=>Date.now()),l=e.historyCoalesceMs??250;let i=e.permissions??{};const s=N(e.data,t);let a=s,c={data:s,selection:null,ui:{...be}};if(e.ui){const{itemSelector:n,selectedSlot:r,...l}=e.ui;c={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...be,...l}}}let u=[{core:c,at:-1/0,sealed:!0,id:Se()}],d=0;const p=e=>{const t=u[d],n=r();!e&&d===u.length-1&&d>0&&!t.sealed&&n-t.at<l?u=[...u.slice(0,d),{...t,core:c,at:n}]:(u=[...u.slice(0,d+1),{core:c,at:n,sealed:e,id:Se()}],d=u.length-1)},f=/* @__PURE__ */new Set;let h=null,m=null,g=0,v=null,y=!1;const w=()=>{for(const e of[...f])e()},b=()=>{u=[...u.slice(0,d),{...u[d],core:c},...u.slice(d+1)]},k=(t,n)=>{g>0?y=y||n:(n?p(!1):c!==t&&b(),c.data!==t.data&&e.onChange?.(c.data),c!==t&&w())},S=e=>{const n=c;if(c=ve(c,e,t),c===n)return;const o=e.recordHistory??de(e);k(n,o&&c.data!==n.data)},C=t=>{0===g&&(v=c,y=!1),g+=1;try{t()}catch(e){throw g-=1,0===g&&v&&(c=v,v=null),e}if(g-=1,g>0||!v)return;const n=v;v=null,y&&c.data!==n.data?p(!0):c!==n&&b(),c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},I=e=>{const n=c,o=me(c.data,t,e);var r,l;(r=o,l=c.selection,r===l||r&&l&&r.kind===l.kind&&("node"===r.kind&&"node"===l.kind?r.id===l.id:"slot"===r.kind&&"slot"===l.kind&&r.parentId===l.parentId&&r.slot===l.slot))||(c={...c,selection:o},k(n,!1))},E=t=>{const n=c;d=t,c=u[d].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},D=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...we,...i,...n}};let x=D();const O=B(),$={resolveCache:O,async resolveAll({trigger:e="load",metadata:n}={}){const o=c.data,r={type:"root",props:{...o.root.props??{}}},l=[...o.content,...Object.values(o.zones??{}).flat()],[i,...s]=await Promise.all([Z(r,t,{cache:O,trigger:e,metadata:n}),...l.map(o=>Z(o,t,{cache:O,trigger:e,metadata:n}))]);C(()=>{const n=c;let r=c.data;s.forEach((e,n)=>{if(!e.didChange)return;const i=l[n].props.id,s=A(r,t,i)?.node;s&&s===A(o,t,i)?.node&&(r=L(r,t,i,e.node))}),i.didChange&&r.root===o.root&&(r={...r,root:{...r.root,props:i.node.props,readOnly:i.node.readOnly??r.root.readOnly}}),r!==c.data&&("load"===e&&c.data===a&&(a=r),c={...c,data:r,selection:me(r,t,c.selection)},k(n,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=A(c.data,t,e)?.node;if(!r)return!1;const l=await Z(r,t,{cache:O,trigger:n,metadata:o});if(!l.didChange)return!1;let i=!1;return C(()=>{const n=c;if(A(c.data,t,e)?.node!==r)return;const o=L(c.data,t,e,l.node);o!==c.data&&(c={...c,data:o,selection:me(o,t,c.selection)},k(n,!1),i=!0)}),i},get config(){return t},get loaded(){return a},getState(){if(h&&m===c)return h;const e=c,o={data:e.data,ui:he(e,t)},r="node"===e.selection?.kind?A(e.data,t,e.selection.id)?.node??null:null;return h={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:S,history:{back:()=>$.undo(),forward:()=>$.redo(),hasPast:d>0,hasFuture:d<u.length-1,histories:u.map(e=>({id:e.id,state:{data:e.core.data,ui:he(e.core,t)}})),index:d,setHistoryIndex:e=>{e>=0&&e<u.length&&e!==d&&E(e)}},getPermissions:x,getItemById:n=>A(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return M(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:o=>{const r=n(e.data,t,{kind:"node",id:o});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},m=e,h},subscribe:e=>(f.add(e),()=>{f.delete(e)}),dispatch:S,batch:C,group:()=>{const e=d,t=u[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,u[e]?.id!==t)return;if(d<=e+1)return void(d===e+1&&(u=[...u.slice(0,d),{...u[d],sealed:!0},...u.slice(d+1)]));const o=u[d];u=[...u.slice(0,e+1),{...o,sealed:!0},...u.slice(d+1)],d=e+1}}},select:e=>I(e?{kind:"node",id:e}:null),selectSlot:e=>I(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){C(()=>{const n=c,o=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:me(e.data,t,o)},k(n,e.data!==n.data)})},load(e,n={}){const o=c,r=N(e,t);c={...c,data:r,selection:me(r,t,n.selection??c.selection)},a=r,n.keepHistory||(u=[{core:c,at:-1/0,sealed:!0,id:Se()}],d=0),c!==o&&w()},undo(){d>0&&E(d-1)},redo(){d<u.length-1&&E(d+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,i)||(i=e,x=D(),h=null,w())},setConfig(e){e!==t&&(t=e,x=D(),h=null,w())}};return $}function Ie(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&b(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var Ee=q(null),De=q(!0);function xe({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return U(()=>{n&&e.resolveAll()},[e,n]),U(()=>{if(t&&"undefined"!=typeof document)return Ie(document,e)},[e,t]),/* @__PURE__ */oe(Ee.Provider,{value:e,children:/* @__PURE__ */oe(De.Provider,{value:t,children:o})})}function Ae(){const e=G(Ee);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function Oe(e){const t=Ae(),n=Q({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const l=e(o);return r.has&&Object.is(r.value,l)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:l,has:!0},l)};return X(t.subscribe,o,o)}function Me(){return function(e){return Oe(e)}}var $e=["--es-accent","--es-accent-tint","--es-accent-tint-strong","--es-accent-line","--es-accent-text","--es-accent-ring","--es-accent-shadow","--es-on-accent","--status-success-solid","--elevation-panel"],Re="host-tokens";function ze(e,t){const n=function(e){const t=e.ownerDocument.defaultView;if(!t)return"";const n=t.getComputedStyle(e),o=[];for(const e of $e){const t=n.getPropertyValue(e).trim();t&&o.push(`${e}: ${t};`)}return o.length?`:root { ${o.join(" ")} }`:""}(e);n?k(t,Re,n):S(t,Re)}var Pe="data-easel-block",Le="data-easel-dropzone",Ve={},je="data-es-mirror",Ne="undefined"==typeof window?U:ne;function Be(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${je}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(je,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function Ke({children:t,id:n="preview-frame",title:o,className:r,style:l,mirrorStyles:i=!0,onDocument:s,height:a="auto",nonce:c}){const u=g("canvas",e),d=Q(null),[p,f]=J(null);return Ne(()=>{const e=d.current,t=p?.ownerDocument.defaultView;if("auto"!==a||!e||!p||!t)return;const n=()=>{e.style.height=`${Math.ceil(p.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(p),()=>r?.disconnect()},[p,a]),Ne(()=>{let e=d.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=d.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-easel-entry",""),t.id="frame-root","fill"===a&&t.classList.add("es-frame-fill"),e.body.appendChild(t),v(e,c),f(t),s?.(e);let n=null;const o=d.current?.ownerDocument;if(i&&o){Be(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>Be(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}let r=null;const l=d.current;if(l&&o){ze(l,e);const t=o.defaultView;if(t&&"MutationObserver"in t){r=new t.MutationObserver(()=>ze(l,e)),r.observe(o.head,{childList:!0,subtree:!0,characterData:!0});const n={attributes:!0,attributeFilter:["class","style","data-theme"]};for(const e of[o.documentElement,o.body,l.closest(".es-editor")])e&&r.observe(e,n)}}return()=>{n?.disconnect(),r?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */oe("iframe",{ref:d,id:n,title:o??u.frame,className:["es-canvas-frame","fill"===a?"is-fill":"",r??""].filter(Boolean).join(" "),style:l,children:p?ie(t,p):null})}var Ze=q(null),Fe=q(Ve),Te=[];function He({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:l=120}){const i=Ae(),s=Oe(n=>M(n.appState.data,i.config,{parentId:e,slot:t})??Te),a=Oe(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==O),c=Oe(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),u=G(Ze),d=["es-zone"];return s.length&&d.push("has-children"),e===O&&d.push("is-root"),(a||c)&&d.push("is-area-selected"),null!==u&&u===e&&e!==O&&d.push("is-hovering-area"),n&&d.push(n),/* @__PURE__ */oe("div",{className:d.join(" "),[Le]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${l}px`},children:s.map(e=>/* @__PURE__ */oe(Je,{node:e},e.props.id))})}function We(e,t,n,o){const r=ee(()=>{const n={};for(const o of T(H(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
|
|
2
|
+
return oe(He,{parentId:t,slot:o,...e})},{blockCount:0});return n},[e,t]);for(const e of Object.keys(r))r[e].blockCount=W(n[e],o);return r}function Ye(e){return ee(()=>function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
+
return oe(He,{parentId:e,slot:t,...n})},[e])}var qe=["top","bottom","zIndex"];function Ue(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function Ge(e){const t=function(e){const t=e?.ownerDocument.defaultView?.getComputedStyle(e);if(!t||"sticky"!==t.position)return null;const n=e=>"auto"===e?"":e;return{top:n(t.top),bottom:n(t.bottom),zIndex:n(t.zIndex)}}(function(e){const t=e.ownerDocument.defaultView;let n=null;for(const o of Array.from(e.children))if("none"!==t?.getComputedStyle(o).display){if(n)return null;n=o}return n}(e));Ue(e,"position",t?"sticky":"relative");for(const n of qe)Ue(e,n,t?.[n]??"");return!!t}var Qe="data-es-canvas-relative";function Xe(e){e.hasAttribute(Qe)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(Qe));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(Qe,"")),!1)}function Je({node:e}){const t=Ae().config,n=t.components[e.type],o=e.props.id,r=Q(null),l=function(e,t){return ee(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(Pe),o.removeAttribute("data-easel-dnd")),t.current=n,n&&(n.setAttribute(Pe,e),n.setAttribute("data-easel-dnd",e),Xe(n))},[e,t])}(o,r),i=Q(null),s=!!n?.inline;!function(e,t){const n=Q(!1),o=Q(()=>{});o.current=()=>{const o=e(),l=n.current;n.current=!!o&&t(o),l!==n.current&&r.current()};const r=Q(()=>{});Ne(()=>o.current()),Ne(()=>{const t=e(),l=t?.ownerDocument.defaultView;if(!t||!l)return;const i=()=>o.current();l.addEventListener("resize",i);const s=l.ResizeObserver,a=s?new s(i):null;a?.observe(t);let c=null;return r.current=()=>{c?.disconnect(),c=null;const e=t.ownerDocument.documentElement;n.current&&e&&l.MutationObserver&&(c=new l.MutationObserver(i),c.observe(e,{attributes:!0}))},r.current(),()=>{l.removeEventListener("resize",i),a?.disconnect(),c?.disconnect(),r.current=()=>{}}},[])}(()=>s?r.current:i.current,e=>s?Xe(e):Ge(e));const a=G(Fe),c=We(n,o,e.props,t.components),u=Ye(o);if(!n?.render)return null;const d=n.render,p={...Y(n),...e.props,...c},f={renderDropZone:u,isEditing:!0,dragRef:n.inline?l:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */oe(d,{...p,editor:f,editMode:!0}):
|
|
4
|
+
/* @__PURE__ */oe("div",{ref:i,[Pe]:o,"data-easel-dnd":o,style:{position:"relative"},children:/* @__PURE__ */oe(d,{...p,editor:f,editMode:!0})})}function _e({metadata:e}){const t=Oe(e=>e.config),n=Oe(e=>e.appState.data.root).props??{},o=t.root?.render,r=We(t.root,O,n,t.components),l=Ye(O),i=/* @__PURE__ */oe(He,{parentId:O,slot:F}),s=o?/* @__PURE__ */oe(o,{id:"page-root",...n,...r,editor:{renderDropZone:l,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:i}):i;/* @__PURE__ */
|
|
5
|
+
return oe(Fe.Provider,{value:e??Ve,children:s})}var et=q(void 0),tt=q(void 0);function nt(e,t,n,o){const r=A(e,t,n);return!!r&&(K(r.node,t).length>0||!1===o.whole)}var ot=q(void 0),rt="data-es-chrome",lt=q(void 0);function it(e){const t=e?.closest?.(`[${rt}]`)??null,n=t?.getAttribute(rt);return t&&n?{id:n,element:t}:null}function st({element:e}){const t=Q(null),n=ut(t,e?()=>e:null,e);/* @__PURE__ */
|
|
6
|
+
return oe("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-hover is-hover-part",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}var at={"--es-words-clear":`${C}px`};function ct({element:e,words:t=!1}){const n=Q(null),o=ut(n,e?()=>e:null,e);/* @__PURE__ */
|
|
7
|
+
return oe("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-selected is-selected-part"+(t?" is-words":""),style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,...at}:{display:"none"}})}function ut(e,t,n){return pt(e,t?e=>{const n=t(e);return n?[n]:[]}:null,n)[0]??null}var dt=[];function pt(e,t,n){const[o,r]=J(dt),l=Q(t);return l.current=t,Ne(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!l.current)return void r(dt);let o=0;const i=()=>{o=0;const n=e.current?.parentElement??null,i=(l.current?l.current(t):[]).map(e=>function(e,t){if(!e||!t)return null;const n=D(e),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(e,n)).filter(e=>null!==e);r(e=>{return(t=e)===(n=i)||t.length===n.length&&t.every((e,t)=>function(e,t){return e===t||!!e&&!!t&&e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height}(e,n[t]))?e:i.length?i:dt;var t,n})},s=()=>{o||(o=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(i))};i();const a="MutationObserver"in n?new n.MutationObserver(s):null;a?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const c="ResizeObserver"in n?new n.ResizeObserver(s):null;return c?.observe(t.documentElement),n.addEventListener("resize",s),n.addEventListener("scroll",s,{capture:!0,passive:!0}),()=>{a?.disconnect(),c?.disconnect(),n.removeEventListener("resize",s),n.removeEventListener("scroll",s,{capture:!0}),o&&(n.cancelAnimationFrame??n.clearTimeout)(o)}},[n]),o}function ft({id:e,kind:t,overlay:n}){const o=Q(null),r=G(tt),l=null!==e&&!0===r?.(e),i=pt(o,e?t=>x(t,`[${Pe}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),[s,...a]=i,c=`es-canvas-outline is-${t}${l?" is-shared":""}`,u=e=>({position:"absolute",top:e.top,left:e.left,width:e.width,height:e.height}),d=/* @__PURE__ */re(le,{children:[
|
|
8
|
+
/* @__PURE__ */oe("div",{ref:o,"aria-hidden":"true",className:c,style:s?u(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */oe("div",{"aria-hidden":"true",className:c,style:u(e)},t))]});return n&&e?/* @__PURE__ */oe(n,{componentId:e,kind:t,children:d}):d}function ht(e,t,n){const o=h(e,n),r=o.text.length,l=e.ownerDocument;if(!t)return[r,r];let i=null;const s=l.caretPositionFromPoint?.(t.x,t.y);if(s&&e.contains(s.offsetNode))i=o.at(s.offsetNode,s.offset);else{const n=l.caretRangeFromPoint?.(t.x,t.y);n&&e.contains(n.startContainer)&&(i=o.at(n.startContainer,n.startOffset))}if(null===i)return[r,r];const a=o.text;let c=i,u=i;for(;c>0&&!/\s/.test(a[c-1]);)c-=1;for(;u<a.length&&!/\s/.test(a[u]);)u+=1;return[c,u]}function mt({s:e,element:t,toolbar:n,label:o,keys:r}){const l=g("copy",m),i=e.pressed(),s=new Set(n.offered),f=n.colors&&n.colors.length>0?n.colors:null,h=Q(null),[v,y]=J(!1),[w,b]=J(null),k=v||null!==w,S=()=>{e.hold(),y(!1),b({href:e.pressed().href})},C=()=>{y(!1),b(null),e.resume()};ne(()=>{r.current={escape:()=>!!k&&(C(),!0),link:()=>!!s.has("link")&&(S(),!0)}}),ne(()=>()=>{r.current=null},[r]);const E=Q(C);E.current=C,U(()=>{if(v)return se(e=>{const t=h.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(E.current(),!0)},()=>h.current?.querySelector(".es-copy-colors"))},[v]),U(()=>{const n=h.current;if(!k||!n)return;const o=/* @__PURE__ */new Set([n.ownerDocument]),r=t();r&&o.add(r.ownerDocument);const l=o=>{const r=o.target;if(r&&n.contains(r))return;y(!1),b(null);const l=t();r&&l&&l.contains(r)?e.release():e.stop("outside")};for(const e of o)e.addEventListener("pointerdown",l,!0);return()=>{for(const e of o)e.removeEventListener("pointerdown",l,!0)}},[k,e,t]),ne(()=>{const e=h.current,n=e?.querySelector(".rosh-tb-wrap > .es-copy-pop"),o=t();if(!(k&&e&&n&&o))return;const r=o.ownerDocument.defaultView?.getSelection()??null,l=r&&r.rangeCount>0&&o.contains(r.getRangeAt(0).startContainer)?r.getRangeAt(0):null,i=(l?a(l,o):null)??(()=>{const e=o.getBoundingClientRect();return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}})(),s=o.ownerDocument.defaultView?.frameElement,d=s?I(s,{left:i.left,top:i.top,width:i.right-i.left,height:i.bottom-i.top}):{left:i.left,top:i.top,width:i.right-i.left,height:i.bottom-i.top},p=o.getBoundingClientRect(),f=s?I(s,{left:p.left,top:p.top,width:p.width,height:p.height}):{left:p.left,top:p.top,width:p.width,height:p.height},m=(e.closest("[data-floating-bar]")??e).getBoundingClientRect(),g={left:d.left,right:d.left+d.width,top:Math.min(d.top,f.top-6,m.top),bottom:Math.max(d.top+d.height,f.top+f.height+6,m.bottom)},v=e.ownerDocument.documentElement,y=(s??o.closest(".es-canvas")??o).getBoundingClientRect(),w={left:Math.max(0,y.left),top:Math.max(0,y.top),right:Math.min(v.clientWidth||y.right,y.right),bottom:Math.min(v.clientHeight||y.bottom,y.bottom)};if(w.right<=w.left||w.bottom<=w.top||0===n.offsetWidth)return;const b=c({anchor:g,size:{width:n.offsetWidth,height:n.offsetHeight},within:{left:y.left,top:y.top,right:y.right,bottom:y.bottom},clip:w,parent:u(n)});n.style.top=`${b.top}px`,n.style.left=`${b.left}px`,n.style.setProperty("--es-pop-point",`${b.point}px`),n.dataset.side=b.above?"above":"below"});const D=f?{run:d(i.color,f),open:v,onToggle:()=>{b(null),v?C():(e.hold(),y(!0))}}:void 0;/* @__PURE__ */
|
|
9
|
+
return oe(ae,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?I(o,{left:n.left,top:n.top,width:n.width,height:n.height}):{left:n.left,top:n.top,width:n.width,height:n.height};return{left:r.left-6,top:r.top-6,right:r.left+r.width+6,bottom:r.top+r.height+6}},bounds:()=>{const e=t(),n=e?.ownerDocument.defaultView?.frameElement,o=(n??e?.closest(".es-canvas")??e)?.getBoundingClientRect();return o?{left:o.left,top:o.top,right:o.right,bottom:o.bottom}:{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}},"aria-label":o,children:/* @__PURE__ */oe("div",{ref:h,children:/* @__PURE__ */oe(ce,{layout:"row",offered:s,pressed:i.marks,onMark:t=>{"link"===t?S():e.press(t)},color:D,linkOpen:null!==w,list:{pressed:i.list,onList:t=>e.list(t)},clear:i.clearable?{onClear:()=>e.clear()}:void 0,alignment:n.alignment,letterCase:n.letterCase,last:n.lastTool?.({className:"rosh-tb-btn",disabled:!1,selected:i.selected,keepCaret:t=>{t.preventDefault(),e.hold()},insert:t=>e.insert(t)}),windows:/* @__PURE__ */re(le,{children:[v&&f?/* @__PURE__ */oe(p,{colors:f,current:i.color,words:l.colors??m.colors,onPick:t=>e.color(t)}):null,w?
|
|
10
|
+
/* @__PURE__ */oe(ue,{className:"es-copy-link es-copy-pop",value:w.href??"",onApply:t=>{b(null),e.link(t)},onRemove:null!==w.href?()=>{b(null),e.link(null)}:void 0,onCancel:C}):null]})})})})}function gt({element:e,which:t}){const n=Q(null),o=ut(n,()=>e(),t);/* @__PURE__ */
|
|
11
|
+
return oe("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,...at}:{display:"none"}})}function vt({frame:t=!0,className:n,style:o,metadata:r,mirrorStyles:a,onDocument:c,height:u,title:d,nonce:p,hotkeys:h,frameWrapper:m,overlay:v,children:b,typing:k,passThrough:S}){const C=Ae(),I=G(et),D=S??I,x=G(De),O=g("canvas",e),M=h??x,[$,R]=J(void 0),z=Oe(e=>"node"===e.selection?.kind?e.selection.id:null),[P,L]=J(null),[V,j]=J(null),N=G(ot),B=G(lt),[Z,F]=J(null),[,T]=_(e=>e+1,0),[,H]=_(e=>e+1,0),W=e=>{N?.select(e),H()},[Y,q]=J(null),X=Q(null),[,ee]=J(0),te=Q(k);te.current=k;const ne=Q(null),le=Q(null),ie=()=>{if(!z)return null;const e=te.current?.atSelection?.()?.element()??null;if(!e)return null;const t=le.current?.ownerDocument;if(N){const n=N.selected()&&t?N.selectedPart?.(t)??null:null;return n&&w(n.element,e)?n.element:null}const n=A(C.getState().appState.data,C.config,z);return n&&0===K(n.node,C.config).length?e:null},se=Oe(e=>e.appState.data),ae=N?.selected()??null;U(()=>{const e=le.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=z&&!Y&&te.current?.atSelection?.()?z:null,o=n?ie():null;e.dispatchEvent(new t(y,{detail:o?{id:n,words:o}:{id:n}}))},[z,Y,se,ae]);const ce=e=>{const t=le.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(E,{detail:{typing:e}}))},ue=(e,t)=>{X.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=C.group(),r=e.element,l=f({element:r,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:ht(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>ee(e=>e+1),onEscape:()=>ne.current?.escape()??!1,onLinkKey:()=>ne.current?.link()??!1,end:e=>{o.close(),X.current?.element===r&&(X.current=null),q(null),ce(!1),te.current?.onChange?.({typing:!1,why:e})}});if(!l)return o.close(),!1;const i=n.closest?.(`[${Pe}]`)?.getAttribute(Pe);return i&&C.select(i),X.current={s:l,element:r,target:e},q(()=>r),L(null),ce(!0),te.current?.onChange?.({typing:!0,element:n}),!0};U(()=>()=>X.current?.s.stop("stop"),[]);const de=e=>{const t=X.current?.element();return Boolean(t&&t.contains(e))},pe=(e,t)=>nt(C.getState().appState.data,C.config,e,t),fe=e=>{const t=e.closest?.(`[${Pe}]`)?.getAttribute(Pe);if(!t)return;const n=C.getState(),o="node"===n.selection?.kind?n.selection.id:null,r=N?.partAt(e,t)??null;if(r){const e=i(n.appState.data,C.config,t,r.id,o,N?.selected()??null,D);if(e)return{node:e.node,part:e.part?r:null}}return{node:s(n.appState.data,C.config,t,o,D)??t,part:null}},he=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(X.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=te.current?.atSelection?.();n&&ue(n,null)&&e.preventDefault()},me=le.current?.ownerDocument??null,ge=N?.selected()&&me&&z?N.selectedPart?.(me)??null:null,ve=ge&&z&&pe(z,ge)?ge.element:null,ye=B?.selected()??null,we=ye&&me?Array.from(me.querySelectorAll(`[${rt}]`)).find(e=>e.getAttribute(rt)===ye)??null:null,be=Y?null:ie(),ke=/* @__PURE__ */re("div",{ref:le,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),X.current){if(de(t))return;X.current.s.stop("outside")}const n=t.ownerDocument?.getSelection?.();n&&n.rangeCount>0&&n.isCollapsed&&n.removeAllRanges();const o=B?it(t):null;if(B&&o)return B.select(o.id),F(null),void T();const r=fe(t);if(void 0!==r)return C.select(r.node),void(N&&(r.part?.id??null)!==N.selected()&&W(r.part?.id??null));t.hasAttribute?.(Le)||(C.select(null),N?.selected()&&W(null))},onDoubleClick:e=>{const t=te.current;if(!t||de(e.target))return;const n=t.at(e.target);n&&ue(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>he(e),onMouseOver:e=>{if(X.current)return;const t=B?it(e.target):null;if(t?.element!==Z?.element&&F(t),t)return null!==P&&L(null),void(null!==V&&j(null));const n=fe(e.target),o=!!n?.part&&pe(n.node,n.part),r=n?.part&&o&&n.part.id!==N?.selected()?n.part:null,l=!n||n.part&&o?null:n.node;l!==P&&L(l),r?.id===V?.id&&r?.element===V?.element||j(r)},onMouseLeave:()=>{L(null),j(null),F(null)},children:[
|
|
12
|
+
/* @__PURE__ */oe(Ze.Provider,{value:P,children:/* @__PURE__ */oe(_e,{metadata:r})}),
|
|
13
|
+
/* @__PURE__ */re("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
14
|
+
/* @__PURE__ */oe(ft,{id:!Y&&P&&P!==z?P:null,kind:"hover",overlay:v}),N?/* @__PURE__ */oe(st,{element:Y||!V||V.id===N.selected()?null:V.element}):null,be||ve?/* @__PURE__ */oe(ct,{element:Y?null:be??ve,words:null!==be}):null,B?/* @__PURE__ */oe(st,{element:Y||!Z||Z.element===we?null:Z.element}):null,we?/* @__PURE__ */oe(ct,{element:Y?null:we}):null,
|
|
15
|
+
/* @__PURE__ */oe(ft,{id:Y||ve||be||we?null:z,kind:"selected",overlay:v}),Y?/* @__PURE__ */oe(gt,{element:()=>{const e=Y?.()??null;return e?ge&&w(ge.element,e)?ge.element:e:null},which:ge?.element??Y}):null]}),b]}),Se=m?/* @__PURE__ */oe(m,{document:$,children:ke}):ke;U(()=>{if($&&M)return Ie($,C)},[$,M,C]),U(()=>{if(!$)return;const e=e=>{if("Enter"===e.key)return void he(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=C.getState();if("node"!==n.selection?.kind)return;if(N?.selected())return void W(null);const o=l(n.appState.data,C.config,n.selection);"node"===o?.kind&&C.select(o.id)};return $.addEventListener("keydown",e),()=>$.removeEventListener("keydown",e)},[$,C,N]);/* @__PURE__ */
|
|
16
|
+
return re("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-easel-preview":"","data-es-typing":Y?"":void 0,children:[Y&&X.current?.target.toolbar?/* @__PURE__ */oe(mt,{s:X.current.s,element:X.current.element,toolbar:X.current.target.toolbar,label:O.textTools,keys:ne}):null,t?/* @__PURE__ */oe(Ke,{mirrorStyles:a,onDocument:e=>{R(e??void 0),c?.(e)},height:u,title:d,nonce:p,children:Se}):/* @__PURE__ */oe("div",{id:"preview-frame","data-easel-entry":"",children:Se})]})}function yt(e={}){const t=Ae(),n=Oe(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function wt(){return kt(Oe(e=>e.selectedItem))}function bt(){return kt(null)}function kt(e){const n=Ae(),o=Oe(e=>e.config),r=n.resolveCache,l=Oe(e=>e.appState.data.root),i=e?e.props.id:"root",s=l.props??{},a=ee(()=>e||{type:"root",props:s},[e,s]),c=e?o.components[e.type]:o.root,u=n.getState(),d=e?A(u.appState.data,o,i):null,p=d&&"root"!==d.place.parentId?d.place.parentId:null,f=p?u.getItemById(p)??null:null,{fields:h}=t({id:i,node:a,block:c,parent:f,appState:u.appState}),m=Oe(t=>!1===t.getPermissions(e?{item:e}:{root:!0}).edit),g=te(e=>{(async()=>{const t=n.getState();if("root"!==i){const l=t.getItemById(i),s=t.getSelectorForId(i);if(!l||!s)return;const a={...l,props:{...l.props,...e}},{node:c}=await Z(a,o,{cache:r,trigger:"replace"}),u=n.getState().getSelectorForId(i);if(!u)return;return void n.dispatch({type:"replace",destinationZone:u.zone??"root:default-zone",destinationIndex:u.index,data:c})}const l=t.appState.data.root.props??{},{node:s}=await Z({type:"root",props:{...l,...e}},o,{cache:r,trigger:"replace"});n.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[n,o,r,i]),v=te((e,t)=>g({[e]:t}),[g]);return{id:i,node:a,fields:h,values:a.props,readOnly:m,onChange:v,onChangeMany:g}}export{rt as CHROME_ATTR,lt as CanvasChromeContext,Ke as CanvasFrame,ot as CanvasPartsContext,et as CanvasPassThroughContext,tt as CanvasSharedContext,be as DEFAULT_UI,vt as EaselCanvas,xe as EaselProvider,_e as EditDocument,Ie as bindUndoKeys,Ce as createEasel,Me as createUseEasel,nt as partHasOwnBox,de as recordsByDefault,ve as reduce,he as uiView,Oe as useEasel,Ae as useEaselApi,yt as useEaselNodeOps,bt as useRootFields,wt as useSelectedFields,me as validSelection};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-
|
|
1
|
+
import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-QORC32JO.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-IYHO4XQX.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{ItemCount as n,DropdownMenu as c}from"efficient-shell/ui";import{jsxs as a,jsx as o,Fragment as i}from"react/jsx-runtime";function m({choices:m,onPick:p}){const{Icon:u}=t(),f=r("screen",l),h=e(s(m)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */a("span",{className:"flex w-full items-center gap-2",children:[
|
|
2
2
|
/* @__PURE__ */o("span",{children:e.group}),
|
|
3
3
|
/* @__PURE__ */o(n,{count:e.items.length,label:f.blockCount({count:e.items.length}),className:"ml-auto"})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(u,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
|
|
4
4
|
return o(c,{align:"start",triggerClassName:"sf-add-card",items:h,trigger:/* @__PURE__ */a(i,{children:[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-
|
|
1
|
+
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-UKPZ2YWE.js";import{ScreenStoreProvider as e}from"./chunk-4ESG53BH.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-K7MMLCTT.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-IYHO4XQX.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var k=r(e),C=r(n);function j({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const k=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
|
|
2
2
|
return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
|
|
3
3
|
/* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
|
|
4
4
|
/* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
|
|
5
|
-
/* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{
|
|
5
|
+
/* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function y({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
|
|
6
6
|
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var N=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=N}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:y}=a(),H=t(()=>s(!g),[g]),M=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
|
|
7
|
-
/* @__PURE__ */u(
|
|
7
|
+
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(j,{onCancel:p,onDiscard:v,onSave:y})):/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:M.waitingForAuthorization})}export{H as DocumentScreen,y as ScreenMount};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-QORC32JO.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-TCAAOYQY.js";import{useEasel as o,useEaselApi as r}from"./chunk-FJTCSQWK.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{usePickFollowsSelection as n}from"./chunk-NCXYC7WI.js";import{slotFieldsOf as e,slotChildrenIn as t}from"./chunk-TCAAOYQY.js";import{EaselCanvas as r,useSelectedFields as o}from"./chunk-
|
|
2
|
-
return f(r,{height:"fill"})}function
|
|
3
|
-
return f("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */f(i,{fields:e,values:t,onChange:u,readOnly:r,idPrefix:n})})}var
|
|
4
|
-
return f(
|
|
5
|
-
return f(nn.Provider,{value:n,children:e})}function tn(){return s(nn)}function rn(){return
|
|
1
|
+
import{usePickFollowsSelection as n}from"./chunk-NCXYC7WI.js";import{slotFieldsOf as e,slotChildrenIn as t}from"./chunk-TCAAOYQY.js";import{EaselCanvas as r,useSelectedFields as o}from"./chunk-FJTCSQWK.js";import{Inspector as i}from"./chunk-H4Z2V56N.js";import{fieldIsShown as u}from"./chunk-BPXEFVSQ.js";import{createContext as l,useContext as s}from"react";import{DesktopIcon as c}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";var a={kind:"selection"};function d(n){return"selection"===n.kind}function p(n,e){if(d(n)&&d(e))return!0;const t=n,r=e,o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(n=>Object.is(t[n],r[n]))}function m(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function k(n,t){const r=n.components?.[t.type]?.fields??{};return e(n,t.type).filter(n=>u(r[n],{values:t.props}))}function h(n,e){return k(n,e).flatMap(n=>t(e,n))}function v(n,e,t){const r=n.slotsOf?.(t);return r||k(e,t).map(n=>({slot:n,label:n,rung:!1}))}function y(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function g(n,e){return n.isLast?n.isLast(e):e.type===n.last}var b={},O=()=>b,j=()=>"",C=()=>null,S=()=>{},w={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},L={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},N={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */f(c,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},P={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},B={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function D(){/* @__PURE__ */
|
|
2
|
+
return f(r,{height:"fill"})}function F(){const{id:n,fields:e,values:t,readOnly:r,onChange:u}=o();/* @__PURE__ */
|
|
3
|
+
return f("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */f(i,{fields:e,values:t,onChange:u,readOnly:r,idPrefix:n})})}var I=l({});function T({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
+
return f(I.Provider,{value:n,children:e})}function x(){return s(I)}function A(){return(x().useOwnerName??j)()}function G(){return(x().useDocumentLabel??C)()}function Q(n,e,t,r){return(x().useBridges??O)(n,e,t,r)}function V(n){return(x().useStandaloneBridges??O)(n)}function Y(n,e){(x().useDocumentPass??S)(n,e)}function H(){return x().blockRules??w}function K(){return x().blockLook??L}function R(){return x().devices??N}function W(){return x().leftView??P}function X(){return x().pinned??B}function Z(){return x().saveSwitch??!0}function E(e){n(!0===x().pickFollowsSelection,e)}function J(){return x().storageNamespace||void 0}function M(){return x().styleClipboard??null}function q(){return x().nodeKeys??!0}function z(){return x().notify??null}function U(){return x().Canvas??D}function $(){return x().CanvasHead??null}function _(){return x().canvasDrag??null}var nn=l(null);function en({target:n,children:e}){/* @__PURE__ */
|
|
5
|
+
return f(nn.Provider,{value:n,children:e})}function tn(){return s(nn)}function rn(){return x().Inspector??F}export{a as SELECTION_MODE,en as ScreenCanvasTargetProvider,T as ScreenPartsProvider,y as isPinnedFirst,g as isPinnedLast,d as isSelectionMode,m as isSlotMode,p as sameInspectorMode,v as screenSlotsOf,h as shownChildSlotsOf,k as shownSlotFieldsOf,K as useScreenBlockLook,H as useScreenBlockRules,Q as useScreenBridges,_ as useScreenCanvasDrag,U as useScreenCanvasFrame,$ as useScreenCanvasHead,tn as useScreenCanvasTarget,R as useScreenDevices,G as useScreenDocumentLabel,Y as useScreenDocumentPass,rn as useScreenInspectorPanel,W as useScreenLeftView,q as useScreenNodeKeys,z as useScreenNotify,A as useScreenOwnerName,x as useScreenParts,E as useScreenPickFollowsSelection,X as useScreenPinned,Z as useScreenSaveSwitch,J as useScreenStorageNamespace,M as useScreenStyleClipboard,V as useStandaloneScreenBridges};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import{cloneNodeWithFreshIds as e}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as n}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as t}from"./chunk-DSKNJXB4.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-UMBNBCL4.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-DDH2DYQP.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-75C6WFNF.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as h,DEFAULT_PANEL_W as f,clampPanelWidth as m}from"./chunk-Y53EKN35.js";import{usePartBridge as g}from"./chunk-7RSE6KKY.js";import{useSectionOps as y}from"./chunk-OITNWE52.js";import{ScreenSaveIcon as v,ScreenMainButton as b}from"./chunk-55KKGABA.js";import{useBrowserOffline as k}from"./chunk-RKTF5XLP.js";import{AddChildRow as S}from"./chunk-5545A3PC.js";import{AddSidePanel as w}from"./chunk-CMPFUJ26.js";import{keepsSharedSections as x,sharedSectionsOf as z}from"./chunk-N3MJOHAG.js";import{PanelHideButton as C,SidePanelHead as N,PanelShowStrip as I}from"./chunk-5PXVT7JY.js";import{offeredChoices as O}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as B,useScreenNodeKeys as P,useScreenPinned as $,useScreenDocumentLabel as T,useScreenCanvasFrame as M,useScreenInspectorPanel as j,useScreenDevices as A,useScreenPickFollowsSelection as L,useScreenLeftView as E,SELECTION_MODE as R,isSelectionMode as F,sameInspectorMode as D,useScreenBridges as W,useScreenBlockRules as H,useScreenBlockLook as V,useScreenStorageNamespace as Y,useScreenNotify as U,useScreenCanvasHead as J,isSlotMode as X,useScreenStyleClipboard as K,useScreenDocumentPass as G,useScreenCanvasDrag as Q,ScreenCanvasTargetProvider as _,isPinnedFirst as Z,isPinnedLast as q,screenSlotsOf as ee,shownChildSlotsOf as ne}from"./chunk-QORC32JO.js";import{MediaPopup as te}from"./chunk-T2RINM7R.js";import{useNodeClipboard as oe,useNodeContextMenu as re}from"./chunk-G7ISR6DI.js";import{PageEditGuardNotices as ie}from"./chunk-FRAIEWRC.js";import{useScreenDocument as le}from"./chunk-K7MMLCTT.js";import{requestMediaPick as se}from"./chunk-3FIS2FRS.js";import{useMediaPanel as de,usePanelPick as ae,useMediaBrowsing as ce,useOpenMediaBrowse as pe,useMediaPlace as ue}from"./chunk-NCXYC7WI.js";import{useEaselSession as he}from"./chunk-YM4UEGBV.js";import{useEaselHost as fe,useHostEscape as me}from"./chunk-LX23TCTP.js";import{LayersIcon as ge,MediaIcon as ye}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-IYHO4XQX.js";import{heldStyle as be,styleShortcut as ke}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{rootRowName as we,slotChildRowName as xe,slotChildRenameProp as ze,sectionRenameProp as Ce}from"./chunk-5NHQ452C.js";import{ROOT_ZONE as Ne,blockNodeActions as Ie,TREE_MAX_DEPTH as Oe,childSlotsOf as Be,slotFieldsOf as Pe,newNodeId as $e,slotChildrenIn as Te,nestsInTree as Me}from"./chunk-TCAAOYQY.js";import{useEasel as je,useEaselApi as Ae,CanvasPartsContext as Le,partHasOwnBox as Ee,CanvasPassThroughContext as Re,CanvasSharedContext as Fe}from"./chunk-FJTCSQWK.js";import{TreeRow as De,Subtree as We,LayersTree as He,TreeGroupLabel as Ve,TreeRowAction as Ye,TreeSeam as Ue}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Je}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Xe}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ke,useNodeOps as Ge,clickPick as Qe}from"./chunk-RPMSET77.js";import{EaselTopBar as _e,EaselIconButton as Ze,TopBarCluster as qe,DeviceSwitch as en,InspectorIconButton as nn,PanelResizeHandle as tn,MAX_PANEL_W as on,MIN_PANEL_W_BY_SIDE as rn,panelWidthVars as ln}from"./chunk-WYTPBF3Q.js";import{DEFAULT_NOTICE_WORDS as sn,DEFAULT_CHROME_WORDS as dn}from"./chunk-AJSDWWJW.js";import{holderOf as an,nameOrSomeone as cn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as pn}from"./chunk-RE4LP46F.js";import{useWords as un}from"./chunk-MFIRYGHW.js";import{insertSeams as hn,CanvasDragLayer as fn,CanvasInsert as mn}from"./chunk-LN43DP2A.js";import{DEFAULT_DRAG_WORDS as gn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as yn,useTreeDrag as vn,gapToMoveIndex as bn}from"./chunk-6NJHYXJM.js";import{useCanvasFrame as kn,LIST_SELECTOR as Sn,BLOCK_SELECTOR as wn,useCanvasTyping as xn,useCanvasEvent as zn,nodeIdAt as Cn,frameRectToHost as Nn,BLOCK_ATTRIBUTE as In,drawnBox as On}from"./chunk-YU3WHLGI.js";import{queryMainCopy as Bn}from"./chunk-LF3FUSCQ.js";import{ROOT_ID as Pn,ROOT_SLOT as $n,zoneKey as Tn,parseZoneKey as Mn,find as jn,DataError as An}from"./chunk-TGZCD6IP.js";import{useRef as Ln,useMemo as En,useState as Rn,useEffect as Fn,useCallback as Dn,useLayoutEffect as Wn,useContext as Hn,Fragment as Vn,useId as Yn}from"react";import{ColoredBadge as Un,Button as Jn,Tabs as Xn,toast as Kn,readMediaFileDrag as Gn,Tooltip as Qn,groupColors as _n,Dialog as Zn,FormField as qn,Input as et,MEDIA_FILE_DRAG_TYPE as nt}from"efficient-shell/ui";import{UndoIcon as tt,RedoIcon as ot,RefreshIcon as rt,AddIcon as it,TrashIcon as lt,EyeOffIcon as st,EyeIcon as dt,SharedIcon as at,DuplicateIcon as ct}from"efficient-shell/icons/efficient";import{jsx as pt,jsxs as ut,Fragment as ht}from"react/jsx-runtime";var ft="media-file";function mt({name:e,onMake:n,onCancel:t}){const o=un("screen",ve).shared,[r,i]=Rn(e),[l,s]=Rn(!1),d=Yn(),a=Ln(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
+
return pt(Zn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */ut(ht,{children:[
|
|
3
|
+
/* @__PURE__ */pt(Jn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
+
/* @__PURE__ */pt(Jn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */pt("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */pt(qn,{label:o.name,htmlFor:d,children:/* @__PURE__ */pt(et,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var gt=/* @__PURE__ */new WeakSet;function yt(e,n,t){const o=jn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function vt({canvas:e,tabs:n,onSelect:t}){const o=Ln(null),[r,i]=Rn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Wn(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=Nn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=Bn(t,`[${In}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?On(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=Nn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),c=s.top+s.height;if(c<d.top||s.top>d.top+d.height){a[o.id]=null;continue}const p=o.below?c+4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(a)},a=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",a,!0),r.addEventListener("resize",a);const c=new r.MutationObserver(a);return c.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a),c.disconnect()}},[e,l]),/* @__PURE__ */pt("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */pt("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
5
|
+
/* @__PURE__ */pt(Qn,{content:e.reach,children:/* @__PURE__ */ut(Un,{colorClass:_n("success","solid"),size:"sm",children:[
|
|
6
|
+
/* @__PURE__ */pt("span",{className:"es-band-tab-mark",children:/* @__PURE__ */pt(at,{size:12})}),e.label]})}):/* @__PURE__ */pt(Un,{colorClass:_n("info","solid"),size:"sm",children:e.label})},e.id):null})})}function bt({expand:e}){/* @__PURE__ */
|
|
7
|
+
return pt("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */ut(ht,e?{children:[
|
|
8
|
+
/* @__PURE__ */pt("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
+
/* @__PURE__ */pt("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
+
/* @__PURE__ */pt("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
+
/* @__PURE__ */pt("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
+
/* @__PURE__ */pt("path",{d:"M5 12h14"})]})})}var kt=`${Sn}, ${wn}`;function St(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var wt="__rungs";var xt="screen:band",zt={duplicate:!0,delete:!0},Ct=()=>null;function Nt(){const Sn=fe(),Nn=Sn.panels?.Toolbar,In=(Sn.panels?.useRight??Ct)(),{target:On,docId:Yn,capabilities:Qn,currentSlug:_n,siteId:Zn,onPublish:qn,saveState:et,saveConflict:at,retrySave:Nt,toggleAutoSave:It,flushSave:Ot,access:Bt,saveUnreachable:Pt=!1,readOnly:$t,readOnlyReason:Tt=null}=le(),Mt=B(),jt=P(),{mediaEditing:At,hasEditGuard:Lt,hasPinnedChrome:Et}=Qn,{appState:Rt,dispatch:Ft,history:Dt,selectedItem:Wt,getSelectorForId:Ht,config:Vt}=je(e=>e),Yt=$(),{first:Ut,firstGroup:Jt,lastGroup:Xt,isSectionGroup:Kt,sectionGroupZone:Gt,panelOf:Qt}=Yt,_t=Qt(Ut),Zt=e=>Z(Yt,e),qt=e=>q(Yt,e),eo="node"===Yt.firstRow,no=Yt.band??null,to=un("screen",ve),oo=un("tree",Je),ro=un("drag",gn),io=un("notice",sn),lo=un("lock",pn),so=un("menu",Xe),ao=un("styleClipboard",Se),co=un("chrome",dn),po=T()??`/${_n}`,uo=M(),ho=j(),fo=y({readOnly:$t}),mo=y({readOnly:$t,foldIntoHistory:!0}),go=Ln(null),yo=Ae(),vo=En(()=>({...fo,select:e=>{go.current=e,fo.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=yo.config;go.current=Ke(e,t,n)}fo.commitDocument(e,n)}}),[fo,yo]),bo=Rt.ui,ko=bo.leftSideBarVisible,So=bo.rightSideBarVisible,{options:wo,widths:xo,initial:zo,fluid:Co,fit:No}=A(),[Io,Oo]=Rn(zo),Bo=de(),Po=At&&null!==Bo;ae(),ce();const $o=pe();L(Wt?.props.id);const{read:To,write:Mo,forSelection:jo}=E(),[Ao,Lo]=Rn(To);Fn(()=>{Mo(Ao)},[Ao]);const[Eo,Ro]=Rn(0),Fo=Ln(null),Do=Ln(null),Wo=kn(Do,{readySelector:kt}),Ho=xn(Wo),Vo=d(Do);a(Do,Wo);const Yo=k(),Uo=an(Bt),Jo={state:et,offline:Yo||et.failed&&Pt,readOnlyReason:Tt,editing:Uo?io.editing({name:cn(Uo.name,lo),noun:to.noun}):null,conflict:null!=at,notSaving:to.bar.notSaving},Xo=()=>{$t||(et.failed?Nt():Ot())};c(Do,Wo,Xo);const[Ko,Go]=Rn(!1),Qo=Ln(!1),[_o,Zo]=Rn(null),[qo,er]=Rn([]),[nr,tr]=Rn(R);F(nr);const or=o(nr,Wt?.props.id),[rr,ir]=Rn(null);Fn(()=>{rr&&(r(),ir(null))},[rr]);const lr=Ln(Ht);lr.current=Ht;const sr=Dn((e,{scroll:n})=>{Lo(n=>jo(e,n)),n&&ir(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=lr.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Er(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),dr=Ln(null);Fn(()=>{const e=dr.current;dr.current=null;const n=null==Wt?.props.id?null:String(Wt.props.id);tr(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Qt(Wt?.type)??R);const t=Wt?.props.id,o=go.current;if(go.current=null,!t)return;const r=Ht(t);sr(String(t),{scroll:!i(o,r??null,Ne)})},[Wt?.props.id,sr]);const ar=Dn(e=>{tr(n=>D(n,e)?n:e),Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ft]),cr=Ln(()=>{});cr.current=(e,n)=>{const t=e?Ti(e.zone??Ne)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Wt?.props.id?null:String(Wt.props.id);tr(e=>D(e,n)?e:n),o!==r&&(dr.current={id:o,mode:n},vo.select(e))};const pr=Dn((e,n)=>cr.current(e,n),[]),ur={kind:nr.kind,mode:nr,open:ar,show:e=>tr(e),reveal:()=>{So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},select:pr},hr=W(ur,{data:Rt.data,selected:Wt??null,zoneOf:e=>Ht(e)?.zone,readOnly:Boolean($t),select:e=>{tr(R),vo.select({index:e})},replace:(e,n)=>vo.replaceComponent(Ne,e,n),scrollTo:e=>l(e)},{device:Io,refreshes:Eo},{setView:Lo,reveal:()=>{ko||Ft({type:"setUi",ui:{leftSideBarVisible:!0}})}}),fr=hr.resolveLeftView?hr.resolveLeftView(Ao):"sections",mr=H(),{isLockedBlock:gr,duplicateBlocked:yr,nestDepth:vr,newSectionNode:br,canAddTo:kr,blockIsOffered:Sr}=mr,wr=e=>({id:String(e.props.id??""),data:Rt?.data}),xr=V(),{labelAtLevel:zr,Icon:Cr,useProducts:Nr}=xr,Ir=xr.rowName?(e,n,t)=>xr.rowName(e,n,t):void 0,Or=Dn(e=>{Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),sr(e,{scroll:!0})},[Ft,sr]),{selectNode:Br,openPartId:Pr}=g({mode:nr,setMode:tr,onOpenPart:Or}),[$r,Tr]=Rn(null);me(null!==$r,()=>Tr(null));const Mr=h(Y()),jr=Mr.collapsed,Ar=Mr.panelWidths,[Lr,Er]=Rn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(jr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
+
return new Set}});Fn(()=>{try{window.localStorage.setItem(jr,JSON.stringify([...Lr]))}catch{}},[Lr]);const[Rr,Fr]=Rn(()=>{if("undefined"==typeof window)return{...f};try{const e=window.localStorage.getItem(Ar);if(!e)return{...f};const n=JSON.parse(e);return{left:m(Number(n.left)||f.left,"left"),right:m(Number(n.right)||f.right,"right")}}catch{return{...f}}});Fn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Ar,JSON.stringify(Rr))}catch{}},300);return()=>clearTimeout(e)},[Rr]);const Dr=Dn((e,n)=>Fr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Wr=Dn(e=>Dr("left",e),[Dr]),Hr=Dn(e=>Dr("right",e),[Dr]),Vr=e=>Lr.has(e),Yr=e=>Er(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Ur=Ln(!1),Jr=Ln(null);Fn(()=>{if(Ur.current&&!Ko){const e=Jr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Do.current?.querySelector(`button[aria-label="${CSS.escape(to.add.title)}"]`))?.focus(),Jr.current=null}Ur.current=Ko},[Ko]),Fn(()=>{if(!Ko||!Vo)return;const e=e=>{"Escape"===e.key&&cl()};return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Ko,Vo]),me(Ko,()=>cl()),Fn(()=>{!ko&&Ko&&(Go(!1),Zo(null),Qo.current=!1)},[ko]);const Xr=U(),Kr=(e,n="success",t)=>{if(Xr)return void(t?Xr(e,"error"===n?"error":"info",t):Xr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Kn.error(e,{...o,duration:t?.duration??3200}):Kn.success(e,{...o,duration:t?.duration??1900})},Gr=Ln(null),[Qr,_r]=Rn(0),[Zr,qr]=Rn(0),ei=J(),ni=Ln(null),ti=e=>Math.max(0,e.clientHeight-(ni.current?.offsetHeight??0));Fn(()=>{const e=Gr.current;if(!e)return;const n=()=>{_r(e.clientWidth),qr(ti(e))};n();const t=new ResizeObserver(n);return t.observe(e),ni.current&&t.observe(ni.current),()=>t.disconnect()},[]),Wn(()=>{Gr.current&&(_r(Gr.current.clientWidth),qr(ti(Gr.current)))},[Rr,ko,So]);const oi=Io===Co?Qr>0?Qr:xo[Co]:xo[Io],ri=Qr>0?Math.min(Qr/oi,"shrink"===No?1:2):1,ii=oi*ri,li=Qr>0&&ii>Qr+1,si={width:ii,height:Zr||"100%",flex:"none",position:"relative"},di={width:oi,height:Zr?Zr/ri:"100%",maxHeight:"none",transform:1!==ri?`scale(${ri})`:void 0,transformOrigin:"top left"},ai=()=>Ft({type:"setUi",ui:{leftSideBarVisible:!ko}}),ci=()=>Ft({type:"setUi",ui:{rightSideBarVisible:!So}}),pi=e=>{Ko&&(Go(!1),Zo(null),Qo.current=!1,ko&&Ao===e)||(Lo(e),ko||Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},ui=()=>{tr(_t??R),So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},hi=Rt.data.content??[],fi=()=>{const e=hi.findIndex(Zt),n=hi.findIndex(qt);return{floor:e>=0?e+1:0,cap:n>=0?n:hi.length}},mi=Vt,gi=mr.stripCopy,yi=n=>e(n,gi),vi=oe(),bi=Ge({data:Rt.data,config:mi,readOnly:Boolean($t),clipboard:vi,strip:gi?e=>gi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Pn||e.slot!==$n)return{min:0,max:n-1};const{floor:t,cap:o}=fi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&tr(R);const t=void 0===n||"node"===n?.kind?n:null;vo.commitDocument(e,t)}}),ki=he(),[Si,wi]=Rn(null),xi=e=>{const n=hi.find(n=>String(n.props.id)===e),t=Yt.shared;n&&t&&bi.swap(e,t.detach(n))},zi=e=>{const n=jn(Rt.data,Vt,e);if(!n)return!1;const t=Tn(n.place),o=n.node,r=t===Ne?Bi(o):Vi(o),i=t===Ne?Yt.shared?.usedOn(o):null;return!!bi.remove(e)&&(Kr(i?to.shared.removed({count:Math.max(0,i.length-1)}):to.deleted({name:r}),"success",{duration:8e3,action:{label:to.bar.undo,onClick:()=>{bi.restore(n.node,n.place)}}}),!0)},Ci={...bi,remove:zi},Ni=e=>zr(e,"block",Vt.components[e]?.label??e),Ii=Dn(e=>Vt.components[e]?.defaultProps??{},[Vt]),Oi=e=>zr(e,"section",Ni(e)),Bi=e=>we({type:e.type,props:e.props??{}},Oi(e.type),Ir),{nodeAddresses:Pi,zoneItems:$i}=En(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=Oe)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Be(Vt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(hi,Ne,0),{nodeAddresses:e,zoneItems:n}},[hi,Vt]),Ti=Dn(e=>$i.get(e)??[],[$i]),Mi=e=>{const n=Pi.get(e);return n?Ti(n.zone)[n.index]:void 0},ji=e=>ee(mr,Vt,e),Ai=e=>{if(!mr.slotsOf||e===Ne)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Mi(e.slice(0,n));if(!t)return null;const o=ji(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},Li=(()=>{if(!X(nr))return null;const e=`${nr.nodeId}:${nr.slot}`;return Ai(e)?.slot.panel===nr.kind?e:null})(),Ei=Ln(null);Fn(()=>{const e=Ei.current;if(Ei.current=null,!Li||!X(nr))return;const n=nr.nodeId;sr(n,{scroll:e!==Li}),Er(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[nr]);const Ri=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Pi.get(e);n&&(n.zone===Ne?ol(n.index):Pl(n.zone,n.index,e,Mi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Li!==i&&(Ei.current=i),pr(null,r),So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Fi=(e,n,t)=>{const o=`${e}:${n}`;if(Er(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;Li!==o&&(Ei.current=o);pr(null,{kind:t,nodeId:e,slot:n})},Di=(e,n,t)=>{if($t||!mr.moveSlot)return;const o=Mi(e),r=o?ji(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:wt,index:n},s=bn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=mr.moveSlot(e,n,s);"string"==typeof d&&Fi(e,d,i.panel)},Wi=Nr(),Hi=En(()=>{const e=/* @__PURE__ */new Map;for(const n of Wi??[])e.set(n.slug,n.name);return e},[Wi]),Vi=e=>xe(e,Ni,xr.plainText,e=>Hi.get(e),xr.rowName),Yi=(e,n)=>{const t=Vt.components[e.type]?.fields,o=n===Ne||ts(n)?"section":"block",r=n===Ne&&(Zt(e)||qt(e)||Kt(e.type)),i="block"===o?ze(t):r?null:Ce(t);return xr.renamePropOf?xr.renamePropOf(e,o,i):i},Ui=(e,n,t,o)=>{if(!(!$t&&$r?.zone===e&&$r.index===n))return;const r=(t,o)=>{Tr(null),o&&((e,n,t)=>{const o=Ti(e)[n];if(!o)return;const r=Yi(o,e);r&&vo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
+
return pt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":to.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Ji=t(K(),ao),Xi=Ji.scope({target:On,siteId:Zn,docId:Yn}),Ki=Vt,Gi=(e,n)=>n===Ne?Oi(e):Ni(e),Qi=(e,n,t)=>{const o=Ji.plan(Xi,t,Gi(t.type,e),Ki);o&&(o.changed&&vo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Kr(o.message))},_i=re({nodesIn:Ti,nodeAt:(e,n)=>Ti(e)[n]??null,labelOf:(e,n)=>n===Ne?Oi(e):Ni(e),renamePropOf:Yi,beginRename:(e,n)=>Tr({zone:e,index:n}),history:{hasPast:Dt.hasPast,hasFuture:Dt.hasFuture,back:()=>Dt.back(),forward:()=>Dt.forward()},openPageStyles:hr.openPageStyles,pageStylesLabel:to.pageStyles,words:{menu:so,styleClipboard:ao,screen:to.menu},readOnly:Boolean($t),collapseAll:()=>Er(new Set(Ti(Ne).map(e=>String(e.props.id)))),onPasteRefused:e=>Kr(e?to.pasteRefused({name:e.label}):to.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>is(e,n),menuRows:(e,n,t)=>{const o=hr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Yt.shared;if(!t||n!==Ne)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:to.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return $t||gr(e.type,e)?n:{...n,change:[{label:to.shared.detach,onClick:()=>xi(e.props.id)}],remove:[{label:to.shared.removeFromPage,danger:!0,onClick:()=>{zi(e.props.id)}}]}}return $t||Zt(e)||qt(e)||Kt(e.type)?null:x(ki)?{change:[{label:to.shared.makeShared,onClick:()=>wi({id:e.props.id,name:Bi(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>gr(e.type,e),duplicateBlocked:e=>yr(Rt.data,e),permits:e=>{const n=Ie(Vt,e.type);return Yt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:Ci,isPinned:(e,n)=>n===Ne&&(Zt(e)||qt(e)),sectionBand:fi,locate:e=>Pi.get(e)??null,rowNameOf:(e,n)=>n===Ne?Bi(e):Vi(e),selectAt:(e,n,t,o)=>{e===Ne?ol(n):Pl(e,n,t,o??"")},slotRung:e=>{const n=Ai(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ri(n.node,n.slot,!1)}:null},style:{held:()=>be(Xi),canCopy:e=>Ji.rows(Ki,e).some(e=>!1!==e.counted),copy:(e,n)=>Ji.copy(Xi,e,Gi(e.type,n),Ki),paste:(e,n,t)=>Qi(e,n,t)},keys:jt?{target:Vo,selected:()=>{const e=Rt.ui.itemSelector;return e?{zone:e.zone??Ne,index:e.index}:null},held:()=>vi.get(),readOnly:Boolean($t),onDone:({done:e,name:n})=>{"copied"===e&&Kr(to.copied({name:n}))}}:void 0},Wo),Zi=Ln({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Fn(()=>{Zi.current={copy:(e,n)=>Ji.copy(Xi,e,Gi(e.type,n),Ki),paste:Qi,at:()=>{const e=Rt.ui.itemSelector;if(!e)return null;const n=e.zone??Ne,t=Ti(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean($t)}});const qi=Dn(e=>{const n=ke(e);if(!n)return;const t=Zi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);Fn(()=>{if(!Vo)return;const e=e=>qi(e);return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[qi,Vo]),zn(Wo,"keydown",qi);const el=hi.map(e=>e.props.id).join("|");Fn(()=>{const e=Wo?.document??null,n=Wo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void er(e=>e.length?[]:e);const n=hi.findIndex(qt),t=n>=0?n:hi.length,o=n=>{const t=hi[n]?.props?.id;return null==t?null:Bn(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(wn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=hi.length>0&&!Zt(hi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=St(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}er(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Wo,el,Io,ri,ko,So,Wt?.props.id]);const nl=Wo?.document??null,tl=Wo?.window??null;Fn(()=>{const e=Fo.current;if(!e||!nl||!tl)return;const n=[],t=()=>{const n=Bn(nl,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&tl.scrollTo({left:tl.scrollX,top:tl.scrollY+t,behavior:"instant"}),!0};return Fo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[nl,tl]);const ol=e=>{tr(R),vo.select({index:e}),hr.sectionPressed?.(hi[e]);const n=hi[e]?.props?.id;n&&l(n)},rl=e=>{const{floor:n,cap:t}=fi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Wt&&nr.kind!==_t?.kind?hi.findIndex(e=>e.props.id===Wt.props.id):-1;return o(r>=0?r+1:t)},il=(e,n)=>{const{floor:t,cap:o}=fi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(vo.reorderComponent(Ne,e,i),vo.select({index:i}),{moved:!0,dest:i})},ll=(e,n,t,o)=>{tr(R),vo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Kr(to.sectionAdded({name:t}))},sl=(e,n)=>{const t=rl(n),o=br(e,{nodeDefaults:Ii,newNodeId:$e,sectionLabel:Oi,blockIsOffered:Sr}),r=o?vo.insertNode(Ne,t,o):vo.insertSection(e,t);return ll(t,r,Oi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:a}of Be(Vt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=kr(e.type,l,d.slice(d.lastIndexOf(":")+1),wr(e)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:a,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},dl=e=>al(Ne,e),al=(e,n)=>{Jr.current=document.activeElement??null,Zo(null===n?null:{zone:e,index:n}),Go(!0),ko||(Qo.current=!0,Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},cl=()=>{Go(!1),Zo(null),Qo.current&&Ft({type:"setUi",ui:{leftSideBarVisible:!1}}),Qo.current=!1},pl=(e,n)=>xr.rowName?n?Zt(e)?xr.rowName(e,"section",to.header):qt(e)?xr.rowName(e,"section",to.footer):Kt(e.type)?xr.rowName(e,"section",Ni(e.type)):Bi(e):Vi(e):n?Oi(e.type):Ni(e.type),ul=e=>n=>{e()},hl=(e,n,t)=>{if($t)return null;const o=Ti(e)[n];return o&&!Ie(Vt,o.type).delete||o&&gr(o.type,o)?null:/* @__PURE__ */pt(Ye,{kind:"delete",label:e===Ne&&o&&Yt.shared?.usedOn(o)?to.shared.removeFromPage:to.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Ti(e)[n]?.props?.id;null!=t&&zi(String(t))})(e,n),children:/* @__PURE__ */pt(lt,{size:15})})},fl=e=>xr.rowPreview?.(e)||void 0,ml=e=>xr.rowMarks?.(e)??void 0,gl=(e,n,t)=>xr.rowActions?.(e,n,t)??null,yl=(e,n,t,o)=>{if($t)return null;if(gr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
+
return pt(Ye,{kind:"eye",label:r?to.showNamed({name:o}):to.hideNamed({name:o}),onClick:()=>bl(e,n,t),children:/* @__PURE__ */pt(r?st:dt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},vl=e=>Qs(Ne,e),bl=(e,n,t)=>{vo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},kl=e=>Pe(Vt,e),Sl=e=>Be(Vt,e),wl=e=>mr.slotsOf?ji(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Te(e,n.slot)})):[{slot:null,rung:null,kids:ne(Vt,e)}],xl=e=>mr.slotsOf?wl(e).flatMap(e=>e.kids):ne(Vt,e),zl=e=>Boolean(mr.slotsOf)&&ji(e).some(e=>e.rung),Cl=(e,n,t)=>kr(e.type,n,t??void 0,wr(e)),Nl=(e,n,t)=>{const o=Me(Vt,e.type,n)&&(t||xl(e).length>0||zl(e));return{collapsible:o,folded:o&&Vr(String(e.props.id))}},Il=(e,n,t)=>wl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Nl(e,r,t(e.type)).collapsible?[String(e.props.id),...Il(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ol=e=>xl(e).length>0||zl(e)||Boolean(kr(e.type)),Bl=e=>Boolean(kr(e)),Pl=(e,n,t,o)=>{if(tr(R),kr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),vo.select({index:n,zone:e}),l(t)}else vo.select({index:n,zone:e}),l(t)},$l=(e,n,t,o,r)=>{const i=`${e}:${n}`;vo.insertComponent(i,t,o),kr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),vo.select({index:o,zone:i})}):vo.select({index:o,zone:i})},Tl=Ln(/* @__PURE__ */new Set);Fn(()=>{hi.forEach(e=>{const n=kr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Tl.current.has(t))return;Tl.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(Ii)).forEach((e,t)=>mo.seedChild(o,t,n.childType,e))})},[hi,mo,Ii]);const Ml=Ln(/* @__PURE__ */new Set);Fn(()=>{hi.forEach((e,t)=>{const o=e.props.id;if(Ml.current.has(o))return;const r=n(e,kl(e.type));Ml.current.add(o),r&&mo.replaceComponent(Ne,t,{...e,props:r})})},[hi,mo]),G(mo,Vt);const jl=hi.findIndex(qt),Al=jl>=0?hi[jl]:null,Ll=eo?hi.findIndex(Zt):-1,El=Ll>=0?hi[Ll]:null,Rl=Yt.groupTab,Fl=En(()=>Rl?e=>Kt(e.type):void 0,[Rl]),Dl=Boolean(Yt.groupBadge),Wl=Yt.sharedReach,Hl=e=>Wl?.(e)??void 0,Vl=En(()=>Wl?new Set(hi.filter(e=>Hl(e)).map(e=>String(e.props.id))):null,[hi,Wl]),Yl=En(()=>Vl?e=>Vl.has(e):void 0,[Vl]),Ul=Yt.first?Wl?.({type:Yt.first,props:{id:""}})??void 0:void 0,Jl=Yt.groupBadge?/* @__PURE__ */pt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */pt(Un,{tone:"info",size:"xs",children:Yt.groupBadge})}):void 0,Xl=hi.find(e=>e.type===Jt)??null,Kl=hi.find(e=>e.type===Xt)??null,Gl=jl>=0?jl:hi.length,Ql=[];hi.forEach(e=>{qt(e)||(Ol(e)&&Ql.push(String(e.props.id)),Ql.push(...Il(e,1,Bl)))}),Al&&(Ql.push(String(Al.props.id)),Ql.push(...Il(Al,1,Bl)));const _l=Ql.length>0&&Ql.every(e=>Lr.has(e)),Zl=e=>{const n=xr.blockRowName(e,Ni);return xr.rowName?xr.rowName(e,"block",n):n},ql=(e,n,t,o)=>{const r=Ti(e)[t];if(!r)return;const i={...Mn(e),index:t},l={...Mn(n),index:Math.min(Math.max(o,0),Ti(n).length)},s=bn(i,l);if(e!==n||s!==t)try{bi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof An))throw e}},es=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Sl(e))n.add(r),t(o)};for(const t of kl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ns=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Pi.get(n);if(!e)return null;if(e.zone===Ne)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ts=e=>{const n=e.slice(0,e.indexOf(":")),t=hi.find(e=>Kt(e.type)&&String(e.props.id)===n);return t&&Gt(n)===e?t:null},os=(e,n)=>{const t=ts(e);return!t||(!Yt.groupAccepts||Yt.groupAccepts(t.type,n,Ti(e).length))},rs=(e,n,t)=>{if(e.rung){const t=Mi(e.rung.nodeId),o=t?ji(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===wt&&n.index>=0&&n.index<=o}if(n.slot===wt)return!1;if(e.add)return ds(e.add,n);const o=Tn(n);if(Kt(e.type))return!1;const r=ts(o),i=ts(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!os(o,e.type))&&(n.index>=0&&n.index<=Ti(o).length));if(e.zone===Ne||o===Ne){if(e.zone!==o)return!1;const{floor:t,cap:r}=fi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Ti(o).length)return!1;if(e.zone===o)return!0;const l=Al&&!Yt.lastIsOpen?String(Al.props.id):null;return(!l||ns(e.zone)!==l&&ns(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Ti(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Pi.get(i),s=l?Ti(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&es(r).has(n))return!1;const d=kr(s.type,vr(Rt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1),wr(s));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Ti(n),r))})(e.zone,o,e.index,t)},is=(e,n)=>{const t=Tn(e.from),o=e.node;return t===Tn(n)?os(t,o.type):rs({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},ls=e=>{const n=e.slice(0,e.indexOf(":")),t=Pi.get(n),o=t?Ti(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=kr(o.type,vr(Rt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1),wr(o));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=O(r.choices??(r.spec?[{type:r.spec.childType,label:Ni(r.spec.childType)}]:[])),l=Ai(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:pl(o,t.zone===Ne)}},ss=(e,n)=>{if("section"!==e.kind)return e;const t=Tn(n);return t===Ne||ts(t)?e:ls(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ds=(e,n)=>{const t=ss(e,n),o=Tn(n);if("shared"===t.kind){if(o!==Ne||!Yt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=fi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ts(o)){const e="section"===t.kind?t.type:t.template.node.type;return os(o,e)&&n.index>=0&&n.index<=Ti(o).length}if(o!==Ne)return!1;const{floor:e,cap:r}=fi();return n.index>=e&&n.index<=r}if(o===Ne)return!1;const r=ls(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Ti(o))},as=(e,n)=>{const t=ss(e,n);if("block"!==t.kind&&ts(Tn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&os(n,o)){if("section"===e.kind)vo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;vo.insertNode(n,t,yi(e.template.node))}tr(R),vo.select({index:t,zone:n})}})(t,Tn(n),n.index);if("section"===t.kind)return void sl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=rl(t),r=vo.insertNode(Ne,o,n);ll(o,r,e)})(t.template.name,yi(t.template.node),n.index);if("shared"===t.kind){const e=Yt.shared?.nodeOf(t.section);if(!e)return;const o=rl(n.index);return void(bi.restore(e,{parentId:Pn,slot:$n,index:o})&&ll(o,e.props.id,t.section.title))}const o=Tn(n),r=ls(o);r&&(r.target.spec?$l(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{vo.insertComponent(e,n,t),tr(R),vo.select({index:t,zone:e})})(o,t.type,n.index))},cs=(e,n)=>{e.media?function(e){const n=Us();if(!n||!Hs)return;Xs(n).then(n=>{n&&function(e,n){if(!Hs)return;const t=Hs.create(e,{nodeDefaults:Ii,newNodeId:$e,sectionLabel:Oi,blockIsOffered:Sr}),o=Tn(n);if(o===Ne){const e=rl(n.index),o=vo.insertNode(Ne,e,t);return void ll(e,o,Oi(t.type))}vo.insertNode(o,n.index,t),tr(R),vo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Di(e.rung.nodeId,e.index,n.index):e.add?as(e.add,n):e.zone===Ne?il(e.index,n.index):ql(e.zone,Tn(n),e.index,n.index)},[ps]=Rn(()=>yn()),us=vn({keyOf:e=>e.id,readOnly:Boolean($t),session:ps,canDrop:rs,onDrop:cs,onStep:(e,n)=>{e.rung?Di(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Ne?((e,n)=>{const t=Oi(hi[e]?.type??""),o=il(e,n<0?e-1:e+2);if(!o.moved)return void Kr(n<0?to.sectionFirst({name:t}):to.sectionLast({name:t}));const{floor:r,cap:i}=fi();Kr(to.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):ql(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),hs=Dn(e=>{const{floor:n,cap:t}=fi(),o=[];for(const r of e.nodes){const e=Tn(r.place),i=Ti(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Zt(i)||qt(i)||gr(i.type,i))continue;if(Kt(i.type))continue;const l=Boolean(ts(e)),s=e===Ne||l;e===Ne&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Oi(i.type):Vi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Tn(e.list);if(n===Ne&&0===e.children.length)return[{...e,addLabel:to.addSection,addAlways:!0}];const t=ls(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ts(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Tn(e.list),t=n===Ne||ts(n)?null:ls(n);return t?.choices.length?hn(e,t.target.spec?.addLabel??to.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Rt.data]),fs=null==Wt?.props.id?null:String(Wt.props.id),ms=Hn(Le),gs=ms?.selected()&&Wo?.document&&fs?ms.selectedPart?.(Wo.document)??null:null,ys=gs&&fs&&Ee(Rt.data,Vt,fs,gs)?gs:null,vs=ys?.label?{element:ys.element,label:ys.label}:null,bs=null!==ys,ks=Dn(e=>{const n=Vt,t=e=>!e.item.rung&&null!==jn(Rt.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(fs);return i?bs?null:i:r(Qe(Rt.data,n,o.item.id,fs,Fl))??o},[Rt.data,Vt,fs,Fl,bs]),[Ss,ws]=Rn(null),xs=Boolean(Rl||Wl);zn(Wo,"mouseover",e=>{if(!xs)return;const n=Cn(e.target),t=n?yt(Rt.data,Vt,n):null;t!==Ss&&ws(t)}),zn(Wo,"mouseout",e=>{xs&&!e.relatedTarget&&ws(null)});const zs=e=>Zt(e)||qt(e)||Kt(e.type),Cs=e=>{const n=Kt(e.type)?Ni(e.type):Zt(e)?to.header:qt(e)?to.footer:null;return null===n?Bi(e):xr.rowName?xr.rowName(e,"section",n):n},Ns=[];if(xs){const e=fs?yt(Rt.data,Vt,fs):null;for(const n of/* @__PURE__ */new Set([e,Ss])){const e=n?hi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Zt(e)||e.type===Jt,o=Hl(e);if(o){Ns.push({id:String(e.props.id),label:Cs(e),below:t,reach:o});continue}if(!Rl||!zs(e))continue;const r=Rl(e);r&&Ns.push({id:String(e.props.id),label:r,below:t})}}const Is=he(),Os=Ln(null);Fn(()=>{const e=Yt.changeNotice;if(!e)return;const n=JSON.stringify(hi.filter(zs)),t=Os.current;if(Os.current={doc:Yn,bands:n,index:Dt.index},!t||t.doc!==Yn||t.bands===n)return;Dt.hasPast&&Dt.index>=t.index&&!gt.has(Is)&&(gt.add(Is),Kr(e,"success",{action:{label:to.bar.undo,onClick:()=>Dt.back()},duration:8e3}))},[hi]);const Bs=e=>{tr(R),vo.select(e.zone===Ne?{index:e.index}:{index:e.index,zone:e.zone})},Ps=Q(),$s=()=>({data:Rt.data,device:Io,ops:vo,inspector:ur}),Ts=Ps?.model,Ms=En(()=>Ts?e=>Ts(e,hs(e),$s()):hs,[Ts,hs,Io]),js=Ps?.measure,As=js?(e,n)=>js(e,n,$s()):void 0,Ls=Ps?.canDrop,Es=Ls?(e,n)=>Ls(e,n,rs,$s()):rs,Rs=Ps?.drop,Fs=Rs?(e,n)=>Rs(e,n,cs,$s()):cs,Ds=Ps?.pick,Ws=Ds?e=>Ds(e,Bs,$s()):Bs,Hs=Ps?.media??null,Vs=Ln(null),Ys=En(()=>Hs?{id:ft,zone:"",index:-1,type:Hs.adds.type,add:{kind:Hs.adds.kind,type:Hs.adds.type},media:!0}:null,[Hs]);Fn(()=>{if(!Ys||$t||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(nt))(e)&&(Vs.current=null,ps.start({key:ft,item:Ys}))},n=e=>{ps.get()?.item.media&&(Vs.current=Gn(e.dataTransfer))},t=()=>{ps.get()?.item.media&&ps.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[Ys,$t,ps]);const Us=()=>{const e=Vs.current;return Vs.current=null,e},Js=ue(),Xs=async e=>{if(!Js)return e;const n=await Js(e);return n?{...e,id:n.id,url:n.url}:null};const Ks=(e,n)=>{if(!Hs)return;const t=jn(yo.getState().appState.data,mi,n);if(!t)return;const o=t.node;vo.replaceComponent(Tn(t.place),t.place.index,{...o,props:{...Hs.replace(o,e),id:o.props.id}})},Gs=e=>{const n=Tn(e),t=Ai(n);t&&Ri(t.node,t.slot,!1),al(n,e.index)},Qs=(e,n)=>/* @__PURE__ */pt(Ue,{...$t?{}:us.seam({place:{...Mn(e),index:n}})},`seam:${e}:${n}`),_s={rowClick:ul,isCollapsed:Vr,toggleCollapse:Yr},Zs=e=>{const n=String(e.props.id),t=hi.findIndex(e=>String(e.props.id)===n),o=Gt(n),r=Ti(o),i=Vr(n),l=Ni(e.type),s=xr.rowName?xr.rowName(e,"section",l):l,d=e=>Qs(o,e);/* @__PURE__ */
|
|
16
|
+
return ut(ht,{children:[
|
|
17
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:e.type,size:13}),name:s,preview:fl(e),marks:ml(e),onSelect:()=>ol(t),nameSlot:Ui(Ne,t,n,s),selected:or===n,badge:Hl(e)?void 0:Jl,shared:Hl(e),actions:gl(e,Ne,t)??void 0,rowProps:{"data-node-id":n,onClick:ul(()=>ol(t))},fold:{open:!i,label:"section",onToggle:()=>Yr(n)}}),!i&&/* @__PURE__ */ut(We,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Bi(n),l=Ol(n),s=l&&Vr(r),a=()=>Pl(o,t,r,e.type),{rowProps:c,...p}=us.row({item:{id:r,zone:o,index:t,type:n.type},place:{...Mn(o),index:t}},{"data-node-id":r,onClick:ul(a)});/* @__PURE__ */
|
|
18
|
+
return ut(Vn,{children:[d(t),
|
|
19
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:n.type,size:13}),name:i,preview:fl(n),marks:ml(n),onSelect:a,nameSlot:Ui(o,t,r,i),selected:or===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Yr(r)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[hl(o,t,i),gl(n,o,t),yl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */pt(We,{children:nd(n,2)})]},r)}),d(r.length)]})]})},qs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=us.dragging,d=!Vr(l)&&s?.rung?.nodeId!==i,a={...Mn(l),index:0},c=s&&!s.rung&&rs(s,a)?a:void 0,p=()=>Ri(e,n,!0),{rowProps:u,...h}=us.row({item:{id:`rung:${l}`,zone:`${i}:${wt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:wt,index:t},into:c,canDrag:Boolean(mr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:ul(p)}),f=$t?null:mr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
+
return ut(Vn,{children:[n.heading,
|
|
21
|
+
/* @__PURE__ */pt(De,{words:oo,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Li===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Yr(l)},actions:f&&f.length>0?/* @__PURE__ */pt(ht,{children:f.map((t,o)=>/* @__PURE__ */pt(Ye,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if($t||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Fi(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */pt(lt,{size:15}):/* @__PURE__ */pt(ct,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */pt(We,{children:r})]},l)},ed=(e,n)=>{const t=wl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
+
return pt(ht,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Cl(e,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>Qs(e,n),p=/* @__PURE__ */ut(ht,{children:[i.map(({child:n,zone:t,index:o})=>{const r=or===String(n.props.id),{collapsible:i,folded:s}=Nl(n,l,Bl(n.type)),d=String(n.props.id),a=Zl(n),p=()=>Pl(t,o,d,e.type),{rowProps:u,...h}=us.row({item:{id:d,zone:t,index:o,type:n.type},place:{...Mn(t),index:o}},{"data-node-id":d,onClick:ul(p)});/* @__PURE__ */
|
|
23
|
+
return ut(Vn,{children:[0===o&&c(t,0),
|
|
24
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:n.type,size:13}),name:a,preview:fl(n),marks:ml(n),onSelect:p,nameSlot:Ui(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Yr(d)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[hl(t,o,a),gl(n,t,o),yl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */pt(We,{children:ed(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?qs(e,t.rung,r++,o,p):/* @__PURE__ */pt(Vn,{children:p},t.slot??"")})})},nd=(e,n)=>{const t=vr(Rt?.data,e.type,String(e.props.id)),o=wl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
+
return pt(ht,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Cl(e,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),h=a&&!a.fixed?`${u}:${a.slot}`:null,f=p?`${u}:${p.slot}`:null,m=(e,n)=>Qs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */ut(ht,{children:[l.map(({child:n,zone:t,index:o})=>{const r=or===String(n.props.id),i=Vi(n),l=String(n.props.id),{collapsible:d,folded:a}=Nl(n,s,Bl(n.type)),c=kl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...Mn(p),index:Ti(p).length}:void 0,h=us.dragging,f=u&&h&&rs(h,u)?u:void 0,g=()=>Pl(t,o,l,e.type),{rowProps:y,...v}=us.row({item:{id:l,zone:t,index:o,type:n.type},place:{...Mn(t),index:o},into:f,canDrag:!gr(n.type,n)},{"data-node-id":l,onClick:ul(g)});/* @__PURE__ */
|
|
26
|
+
return ut(Vn,{children:[0===o&&m(t,0),
|
|
27
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:n.type,size:13}),name:i,preview:fl(n),marks:ml(n),onSelect:g,nameSlot:Ui(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Yr(l)}:void 0,actions:gr(n.type,n)?gl(n,t,o)??void 0:/* @__PURE__ */ut(ht,{children:[hl(t,o,i),gl(n,t,o),yl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */pt(We,{children:nd(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
+
/* @__PURE__ */pt(S,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>$l(e.props.id,a.slot,a.childType,c.length,e.type)}),null===g?f&&!l.some(e=>e.zone===f)?m(f,0):null:0!==l.length||(o.rung?y:g!==f)?null:m(g,0)]});return o.rung?qs(e,o.rung,i++,r,v):/* @__PURE__ */pt(Vn,{children:v},o.slot??"")})})},td=Ko,od=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:ko&&!td&&fr===e.id,onSelect:()=>pi(e.id)}:e,rd=[...(hr.railLead??[]).map(od),{id:"sections",label:to.layers,icon:/* @__PURE__ */pt(ge,{}),active:ko&&!td&&"sections"===fr,onSelect:()=>pi("sections")},...(hr.railTrail??[]).map(od)],id=Po?{onPress:$o}:At?{onPress:()=>{se(Sn,{accept:"image/*",title:co.mediaLibrary})}}:null,ld={value:rd.find(e=>!0===e.active)?.id??"",press:e=>{const n=rd.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:rd.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */pt("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},sd=[...hr.railLead??[],...hr.railTrail??[]].find(e=>"panel"in e&&e.id===fr),dd=Boolean(no?.foldable),ad=no?.label??(Lt?to.pageSections:to.templateSections),cd=dd&&Vr(xt),pd=/* @__PURE__ */ut(ht,{children:[hi.map((e,n)=>{if(Zt(e)||qt(e)||Kt(e.type))return null;const t=or===String(e.props.id),o=Boolean(e.props._hidden);Sl(e);const r=String(e.props.id),i=hr.hasOwnRows?.(e)??!1,l=Ol(e)||i,s=l&&Vr(r),d=kl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...Mn(a),index:Ti(a).length}:void 0,p=us.dragging,u=c&&p&&rs(p,c)?c:void 0,{rowProps:h,...f}=us.row({item:{id:r,zone:Ne,index:n,type:e.type},place:{...Mn(Ne),index:n},into:u,canDrag:!gr(e.type,e)},{"data-node-id":r,onClick:ul(()=>ol(n))});/* @__PURE__ */
|
|
29
|
+
return ut(Vn,{children:[n>0&&vl(n),
|
|
30
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:e.type,size:13}),name:Bi(e),preview:fl(e),marks:ml(e),shared:Hl(e),onSelect:()=>ol(n),nameSlot:Ui(Ne,n,r,Bi(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Yr(r)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[hl(Ne,n,Bi(e)),gl(e,Ne,n),yl(Ne,n,e,Bi(e))]}),rowProps:h}),Ol(e)&&!s&&/* @__PURE__ */ut(We,{children:[nd(e,1),hr.partRows?.(e,_s)]}),i&&!s&&/* @__PURE__ */pt(We,{children:hr.ownRows?.(e,n,_s)})]},String(e.props.id??n))}),Gl>0&&vl(Gl)]}),ud=(e,n,t)=>{const o=String(e.props.id),r=xl(e).length>0||zl(e)||Boolean(kr(e.type)),i=r&&Vr(o),l="header"===t?to.header:to.footer,s=xr.rowName?xr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
+
return ut(ht,{children:[
|
|
32
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:t,size:13}),name:s,preview:fl(e),marks:ml(e),badge:Hl(e)?void 0:Jl,shared:Hl(e),onSelect:()=>ol(n),nameSlot:Ui(Ne,n,o,s),selected:or===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Yr(o)}:void 0,actions:gl(e,Ne,n)??void 0,rowProps:{"data-node-id":o,onClick:ul(()=>ol(n))}}),r&&!i&&/* @__PURE__ */pt(We,{children:ed(e,1)})]})};return(hr.wrap??(e=>e))(
|
|
33
|
+
/* @__PURE__ */pt(_,{target:Wo,children:/* @__PURE__ */ut("div",{ref:Do,className:"sf-editor es-editor",style:ln(Rr),onContextMenu:_i.onEditorContextMenu,...p(Sn),children:[
|
|
34
|
+
/* @__PURE__ */ut(_e,{children:[
|
|
35
|
+
/* @__PURE__ */ut("div",{className:"es-cluster es-cluster--left",children:[id?/* @__PURE__ */pt(Jn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */pt(ye,{}),onClick:id.onPress,children:to.railMedia}):null,
|
|
36
|
+
/* @__PURE__ */pt(Ze,{label:to.bar.undo,disabled:Boolean($t)||!Dt.hasPast,onClick:()=>Dt.back(),children:/* @__PURE__ */pt(tt,{})}),
|
|
37
|
+
/* @__PURE__ */pt(Ze,{label:to.bar.redo,disabled:Boolean($t)||!Dt.hasFuture,onClick:()=>Dt.forward(),children:/* @__PURE__ */pt(ot,{})})]}),
|
|
38
|
+
/* @__PURE__ */ut(qe,{children:[
|
|
39
|
+
/* @__PURE__ */pt(en,{devices:wo,value:Io,onChange:Oo}),
|
|
40
|
+
/* @__PURE__ */pt(Ze,{label:to.bar.refresh,tip:to.bar.refreshTip,onClick:()=>{Fo.current=(()=>{const e=Wo?.document;if(!e)return null;const n=hi.findIndex(qt),t=n>=0?n:hi.length;let o=null;for(let n=0;n<t;n++){const t=hi[n]?.props?.id;if(null==t)continue;const r=Bn(e,`[data-easel-block="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Wt?.props?.id??hi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Ro(e=>e+1)},children:/* @__PURE__ */pt(rt,{})}),hr.barView?.()]}),
|
|
41
|
+
/* @__PURE__ */ut(qe,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
+
/* @__PURE__ */pt(v,{input:Jo,words:to.saveStatus}),Nn?/* @__PURE__ */pt(Nn,{}):null,hr.barLead?.(),hr.barTrail?.(),hr.mainAction||!hr.barMain?/* @__PURE__ */pt(b,{input:Jo,action:hr.mainAction??{label:to.done,onPress:()=>{qn(Rt.data)}},readOnly:Boolean($t),saveSwitch:Mt,onToggleAutoSave:It,onSaveNow:Xo,bar:to.bar,words:to.saveStatus}):hr.barMain()]})]}),
|
|
43
|
+
/* @__PURE__ */pt(ie,{}),
|
|
44
|
+
/* @__PURE__ */ut("div",{className:"sf-body",children:[ko?/* @__PURE__ */ut(ht,{children:[
|
|
45
|
+
/* @__PURE__ */ut("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":to.leftPanel,children:[
|
|
46
|
+
/* @__PURE__ */ut("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
+
/* @__PURE__ */pt(C,{side:"left",onHide:ai}),
|
|
48
|
+
/* @__PURE__ */pt("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
+
/* @__PURE__ */pt(Xn,{variant:"underline",block:!0,"aria-label":to.bar.views,value:ld.value,onChange:ld.press,items:ld.items})]}),Ko?/* @__PURE__ */pt(w,{at:_o?{label:(e=>{const n=ts(e.zone);if(n)return to.add.addingTo({name:xr.rowName?pl(n,!0):Ni(n.type)});if(e.zone===Ne){const n=hi[e.index];return n&&!qt(n)?to.add.addingBefore({name:pl(n,!0)}):to.add.addingAtEnd}const t=ls(e.zone);return t?to.add.addingTo({name:t.parentName}):to.add.addingHere})(_o),onClear:()=>Zo(null)}:void 0,placeBlocks:_o&&_o.zone!==Ne?ls(_o.zone)?.choices:void 0,canTake:_o?e=>{if(!_o)return null;const n={...Mn(_o.zone),index:_o.index};if(ds(e,n))return null;if("shared"===e.kind&&_o.zone===Ne&&!Yt.shared?.nodeOf(e.section))return to.shared.alreadyHere;const t=ts(_o.zone);if(t)return to.add.notInside({name:pl(t,!0)});if(_o.zone===Ne)return to.add.onlySections;const o=ls(_o.zone);return o?to.add.notInside({name:o.parentName}):to.add.onlySections}:void 0,onPick:_o?e=>{if(!_o)return;const n={...Mn(_o.zone),index:_o.index};ds(e,n)&&(as(e,n),cl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:e.type,add:e}),session:ps,siteWide:hr.addPanelRow?.(cl),onClose:cl,readOnly:Boolean($t)}):sd?sd.panel({onHide:ai,notify:Kr}):/* @__PURE__ */ut(ht,{children:[
|
|
50
|
+
/* @__PURE__ */pt(N,{icon:/* @__PURE__ */pt(ge,{}),title:to.layers,context:po,actions:/* @__PURE__ */ut(ht,{children:[!$t&&/* @__PURE__ */pt(nn,{label:to.add.title,onClick:()=>dl(null),children:/* @__PURE__ */pt(it,{size:15})}),
|
|
51
|
+
/* @__PURE__ */pt(nn,{label:_l?to.expandAll:to.collapseAll,title:0===Ql.length?to.nothingToFold:void 0,disabled:0===Ql.length,onClick:()=>Er(e=>{const n=new Set(Ql);return _l?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ql])}),children:/* @__PURE__ */pt(bt,{expand:_l})})]})}),
|
|
52
|
+
/* @__PURE__ */ut(He,{className:"sf-tree sf-scroll",words:oo,children:[Xl&&/* @__PURE__ */ut(ht,{children:[!Dl&&/* @__PURE__ */pt(Ve,{children:to.header}),Zs(Xl)]}),Et&&!(Dl&&Xl)&&/* @__PURE__ */ut(ht,{children:[!Dl&&/* @__PURE__ */pt(Ve,{children:to.header}),!eo&&/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:"header",size:13}),name:to.header,badge:Ul?void 0:Jl,shared:Ul,onSelect:ui,selected:nr.kind===_t?.kind,rowProps:{onClick:ul(ui)}})]}),El&&!(Dl&&Xl)&&ud(El,Ll,"header"),!dd&&/* @__PURE__ */pt(Ve,{children:ad}),dd?/* @__PURE__ */ut(ht,{children:[
|
|
53
|
+
/* @__PURE__ */pt(De,{words:oo,icon:null,name:ad,fold:{open:!cd,label:ad,onToggle:()=>Yr(xt)}}),!cd&&/* @__PURE__ */pt(We,{children:pd})]}):pd,Et&&!Dl&&/* @__PURE__ */pt(Ve,{children:to.footer}),Al&&!(Dl&&Kl)&&ud(Al,jl,"footer"),Kl&&Zs(Kl),hr.treeFoot?.()]})]})]}),
|
|
54
|
+
/* @__PURE__ */pt(tn,{side:"left",width:Rr.left,min:rn.left,max:on,defaultWidth:f.left,label:to.resizeLeftPanel,onResize:Wr})]}):/* @__PURE__ */pt(I,{side:"left",onShow:ai}),
|
|
55
|
+
/* @__PURE__ */ut("div",{ref:Gr,className:"sf-center sf-scroll","data-sf-canvas-head":ei?"":void 0,style:{overflowX:li?"auto":"hidden",overflowY:"hidden"},children:[ei&&/* @__PURE__ */pt("div",{ref:ni,className:"sf-canvas-head",children:/* @__PURE__ */pt(ei,{device:Io})}),
|
|
56
|
+
/* @__PURE__ */ut("div",{className:"sf-frame-scaler",style:si,children:[
|
|
57
|
+
/* @__PURE__ */pt("div",{className:"sf-frame "+(Io===Co?"":`sf-frame--${Io}`),style:di,children:/* @__PURE__ */ut("div",{className:"sf-preview-host",children:[
|
|
58
|
+
/* @__PURE__ */pt(Re.Provider,{value:Fl,children:/* @__PURE__ */pt(Fe.Provider,{value:Yl,children:/* @__PURE__ */pt(uo,{},Eo)})}),
|
|
59
|
+
/* @__PURE__ */pt(fn,{canvas:Wo,session:ps,model:Ms,measure:As,canDrop:Es,onDrop:Fs,choose:ks,tag:vs,onPick:Ws,dropOn:Hs?{accepts:(e,n)=>{if(!e.media||!Hs||n.item.rung)return!1;const t=jn(Rt.data,mi,n.item.id);return null!==t&&Hs.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Us();n&&Hs&&Xs(n).then(n=>{n&&Ks(n,e.item.id)})})(n),label:()=>to.canvasReplaceImage}:void 0,onZoneAdd:Gs,onSeamAdd:Gs,zoneAddLabel:to.canvasAddBlock,words:ro.canvas,readOnly:Boolean($t),revision:Rt.data}),qo.length>0&&!Ho&&/* @__PURE__ */pt("div",{className:"sf-preview-gaps",children:qo.map(e=>
|
|
60
|
+
/* @__PURE__ */pt(mn,{index:e.index,label:to.addSectionHere,onInsert:()=>dl(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),xs?/* @__PURE__ */pt(vt,{canvas:Wo,tabs:Ns,onSelect:e=>{const n=hi.findIndex(n=>String(n.props.id)===e);n>=0&&ol(n)}}):null]})]}),So?/* @__PURE__ */ut(ht,{children:[In?
|
|
61
|
+
/* @__PURE__ */pt("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:In}):/* @__PURE__ */pt(ht,{children:/* @__PURE__ */pt(u,{value:{selectChild:Pl,addChild:$l,childRowName:Vi,blockRowName:Zl},children:/* @__PURE__ */pt(ho,{mode:nr,onOpenWebsiteSettings:hr.openSettings??(()=>{}),onOpenSiteStyles:hr.openStyles,onOpenPageStyles:hr.openPageStyles,onSelectNode:Br,onNotify:Kr,onHidePanel:ci,nodeActions:Wt?Ie(Vt,Wt.type):zt})})}),
|
|
62
|
+
/* @__PURE__ */pt(tn,{side:"right",width:Rr.right,min:rn.right,max:on,defaultWidth:f.right,label:to.resizeSettingsPanel,onResize:Hr})]}):
|
|
63
|
+
/* @__PURE__ */pt(I,{side:"right",onShow:ci})]}),_i.menu,
|
|
64
|
+
/* @__PURE__ */pt(te,{}),Si?/* @__PURE__ */pt(mt,{name:Si.name,onMake:e=>(async(e,n)=>{const t=hi.find(n=>String(n.props.id)===e),o=Yt.shared;if(!t||!o)return;let r;try{r=await z(ki).create(n,t)}catch{return void Kr(to.shared.makeFailed,"error")}o.adopt(t,r),wi(null)})(Si.id,e),onCancel:()=>wi(null)}):null]})}))}export{Nt as ScreenChrome};
|
package/dist/easel/index.d.ts
CHANGED
|
@@ -411,6 +411,25 @@ interface CanvasParts {
|
|
|
411
411
|
selectedPart?(doc: Document): CanvasPart | null;
|
|
412
412
|
}
|
|
413
413
|
declare const CanvasPartsContext: react.Context<CanvasParts | undefined>;
|
|
414
|
+
/** The attribute a host puts on the element it drew outside every block (the site's chat bubble): `data-es-chrome="<id>"`. A host imports this name and never writes the string. */
|
|
415
|
+
declare const CHROME_ATTR = "data-es-chrome";
|
|
416
|
+
/**
|
|
417
|
+
* CHROME THE HOST DREW OUTSIDE EVERY BLOCK (issue list C8, 2026-10-28).
|
|
418
|
+
* An element with an owner block is a part (`CanvasParts`), not chrome. No
|
|
419
|
+
* block owns chrome (the site's chat bubble), so the canvas could not frame it and each host drew its
|
|
420
|
+
* own outline and caught its own click. The host marks the element
|
|
421
|
+
* (`data-es-chrome`) and says which one is selected; the canvas draws the ONE
|
|
422
|
+
* hover frame and the ONE selected frame, on the element's own box, and a
|
|
423
|
+
* click calls `select`. The canvas changes no block selection: the host's
|
|
424
|
+
* answer (its panel opens) is the selection. Absent: a marked element is page.
|
|
425
|
+
*/
|
|
426
|
+
interface CanvasChrome {
|
|
427
|
+
/** The id of the chrome the host has selected now, or null. */
|
|
428
|
+
selected(): string | null;
|
|
429
|
+
/** The person picked chrome `id` on the canvas. */
|
|
430
|
+
select(id: string): void;
|
|
431
|
+
}
|
|
432
|
+
declare const CanvasChromeContext: react.Context<CanvasChrome | undefined>;
|
|
414
433
|
/** What a host may wrap an outline in — the old library's `componentOverlay`: render
|
|
415
434
|
* `children` to draw it, or nothing to hide it (a text part open on the
|
|
416
435
|
* block, say). */
|
|
@@ -660,4 +679,4 @@ declare function bindUndoKeys(doc: Document, easel: Pick<Easel, 'undo' | 'redo'>
|
|
|
660
679
|
leaveTyping?: boolean;
|
|
661
680
|
}): () => void;
|
|
662
681
|
|
|
663
|
-
export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasPart, type CanvasParts, CanvasPartsContext, CanvasPassThroughContext, CanvasSharedContext, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, partHasOwnBox, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useRootFields, useSelectedFields, validSelection };
|
|
682
|
+
export { CHROME_ATTR, type CanvasChrome, CanvasChromeContext, CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasPart, type CanvasParts, CanvasPartsContext, CanvasPassThroughContext, CanvasSharedContext, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, partHasOwnBox, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useRootFields, useSelectedFields, validSelection };
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CHROME_ATTR,CanvasChromeContext,CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,validSelection}from"../chunk-FJTCSQWK.js";import"../chunk-TBY3DFKS.js";import"../chunk-AGWKB77Q.js";import"../chunk-RPMSET77.js";import"../chunk-HZSZT3BE.js";import"../chunk-KRL3IUV3.js";import"../chunk-MFIRYGHW.js";import"../chunk-YU3WHLGI.js";import"../chunk-LF3FUSCQ.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-G67G63O5.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-QORC32JO.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-CMPFUJ26.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-QORC32JO.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-UKPZ2YWE.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-75C6WFNF.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-Y53EKN35.js";import"../../chunk-7RSE6KKY.js";import"../../chunk-OITNWE52.js";import"../../chunk-55KKGABA.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-CMPFUJ26.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-QORC32JO.js";import"../../chunk-T2RINM7R.js";import"../../chunk-G7ISR6DI.js";import"../../chunk-FRAIEWRC.js";import"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-XFYFKITX.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5NHQ452C.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-JMAOCKB2.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-UKPZ2YWE.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-75C6WFNF.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-Y53EKN35.js";import"../../chunk-7RSE6KKY.js";import"../../chunk-OITNWE52.js";import"../../chunk-55KKGABA.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-4ESG53BH.js";import"../../chunk-5545A3PC.js";import"../../chunk-CMPFUJ26.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-QORC32JO.js";import"../../chunk-T2RINM7R.js";import"../../chunk-G7ISR6DI.js";import"../../chunk-FRAIEWRC.js";import"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-XFYFKITX.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5NHQ452C.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
|