efficient-easel 3.2.1 → 3.6.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.
@@ -1 +1 @@
1
- import{useScreenDocument as n}from"./chunk-PRSTFWUY.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-BF3PIXZD.js";import{EditNotice as r}from"./chunk-GTDLBUOC.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
1
+ import{useScreenDocument as n}from"./chunk-WZMU646D.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-MCHMF32I.js";import{EditNotice as r}from"./chunk-GTDLBUOC.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
@@ -1,7 +1,7 @@
1
- import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-6QSPOILR.js";import{ScreenChrome as e}from"./chunk-7VP5RXNO.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-PRSTFWUY.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-BF3PIXZD.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t}from"react";import{Dialog as d,Button as l}from"efficient-shell/ui";import{jsx as m,jsxs as g,Fragment as h}from"react/jsx-runtime";var f=n(r),v=n(e);function p({saving:n,onCancel:r,onDiscard:e,onSave:i}){const a=c("screen",s).leave;/* @__PURE__ */
1
+ import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-6QSPOILR.js";import{ScreenChrome as e}from"./chunk-TNTV7UZ6.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-WZMU646D.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-MCHMF32I.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t}from"react";import{Dialog as d,Button as l}from"efficient-shell/ui";import{jsx as m,jsxs as g,Fragment as h}from"react/jsx-runtime";var f=n(r),v=n(e);function p({saving:n,onCancel:r,onDiscard:e,onSave:i}){const a=c("screen",s).leave;/* @__PURE__ */
2
2
  return m(d,{open:!0,role:"alertdialog",size:"sm",title:a.title,onClose:r,footer:/* @__PURE__ */g(h,{children:[
3
3
  /* @__PURE__ */m(l,{variant:"secondary",onClick:r,children:a.cancel}),
4
4
  /* @__PURE__ */m(l,{variant:"ghost-danger",onClick:e,children:a.discard}),
5
5
  /* @__PURE__ */m(l,{variant:"primary",loading:n,onClick:i,children:n?a.saving:a.save})]}),children:a.body})}function u({target:n,addressing:r,onHostMessage:e,children:a}){/* @__PURE__ */
6
- return m(i,{target:n,addressing:r,onHostMessage:e,children:a})}var k=(n,r)=>/* @__PURE__ */g(h,{children:[n,r]});function C({config:n,parts:r,wrap:e=k}){const{data:i,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:C,pendingNav:N,cancelPendingNav:j,discardAndNavigate:P,saveAndNavigate:y}=a(),O=t(()=>o(!u),[u]),S=c("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:S.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?i?e(
7
- /* @__PURE__ */m(f,{config:n,data:i,onChange:C,permissions:O,parts:r,children:/* @__PURE__ */m(v,{})}),N&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:j,onDiscard:P,onSave:()=>{y()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:S.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:S.waitingForAuthorization})}export{C as DocumentScreen,u as ScreenMount};
6
+ return m(i,{target:n,addressing:r,onHostMessage:e,children:a})}var k=(n,r)=>/* @__PURE__ */g(h,{children:[n,r]});function C({config:n,parts:r,wrap:e=k}){const{data:i,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:C,pendingNav:N,cancelPendingNav:j,discardAndNavigate:M,saveAndNavigate:y}=a(),H=t(()=>o(!u),[u]),O=c("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:O.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?i?e(
7
+ /* @__PURE__ */m(f,{config:n,data:i,onChange:C,permissions:H,parts:r,children:/* @__PURE__ */m(v,{})}),N&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:j,onDiscard:M,onSave:()=>{y()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:O.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:O.waitingForAuthorization})}export{C as DocumentScreen,u as ScreenMount};
@@ -0,0 +1 @@
1
+ import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-PAM3NLFL.js";import{BUCKET_KEY as r}from"./chunk-R2HLPNQF.js";import{ANCHOR_FIELD_KEYS as e,foldMetaOf as s,MEDIA_FIELD_MARKER as c,TEXT_FIELD_MARKER as p,LINK_FIELD_MARKER as i}from"./chunk-DUVRZ456.js";import{STYLE_KIND as u,fieldKind as f,copyStyle as a,heldStyle as l,planPaste as m,pasteMessage as y}from"./chunk-V7U33NF2.js";var h=/* @__PURE__ */new Set([r.Style,r.Layout]),j=new Set(Object.values(r)),w=new Set(e),b=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[c,p,i];function L(t){return`site:${t??""}`}function S(t){if(!t||"object"!=typeof t)return null;const n=t,r=o(t)??t,e=n[u]??r[u];if("string"==typeof e)return e;const s=n.options??r.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(r)}function g(t){const n=t,r=o(t);return k.some(t=>t in n||r&&t in r)}function v(o,r){const e=t(o,r)??{},c=[];let p=!1;for(const[t,o]of Object.entries(e))j.has(t)?p=h.has(t):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(s(o)||w.has(t)||b.has(t)||g(o)||"slot"!==o.type&&c.push({path:[t],kind:S(o),counted:"mobile"!==n(o)?.tier}));return c}function F(t,o,n,r,e){a({scope:n,type:r.type,label:e,rows:t(o,r),props:r.props})}function d(t,o,n,r,e,s){const c=l(n);if(!c)return null;const p=m(c,{type:r.type,rows:t(o,r),props:r.props});return{...p,message:y(p,c.sourceLabel,e,s)}}function A(t,o,n,r){F(v,t,o,n,r)}function N(t,o,n,r,e){return d(v,t,o,n,r,e)}var P={scope:t=>L(t.siteId),rows:(t,o)=>v(t,o),copy:(t,o,n,r)=>A(r,t,o,n),plan:(t,o,n,r)=>N(r,t,o,n)};function I(t,o){if(!t&&!o)return P;const n=t?.rows,r=n?(t,o)=>n(t,o):v;return{scope:t?.scope??P.scope,rows:(t,o)=>r(t,o),copy:t?.copy??((t,o,n,e)=>F(r,e,t,o,n)),plan:t?.plan??((t,n,e,s)=>d(r,s,t,n,e,o))}}export{A as copyNodeStyle,v as nodeStyleRows,N as planNodePaste,S as shopFieldKind,L as siteStyleScope,I as styleClipboardOf};
@@ -1 +1 @@
1
- var e={title:"Add",contextBlocks:"Blocks for this place",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",startBlank:"Start blank",templates:"Your templates",inside:({name:e})=>`Inside ${e}`,tile:({name:e})=>`Add ${e}`,hintBlocks:"Drag into the page, or click to add.",hint:"Drag onto the page, or click to add.",searchBlocks:"Search blocks",searchSections:"Search sections",addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},t={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,canvasAddBlock:"Add block",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving…"},bar:{undo:"Undo",redo:"Redo",refresh:"Refresh",refreshTip:"Refresh the preview (reloads the canvas, keeps your place)",notSaving:"Not saving — see the notice above",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views"},menu:{undo:"Undo",redo:"Redo",addSection:"Add section",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",editFooter:"Edit the site footer",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:t,total:a})=>`Moved “${e}” to position ${t} of ${a}`,sectionAdded:({name:e})=>`Added “${e}” section`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}};export{e as DEFAULT_SCREEN_ADD_WORDS,t as DEFAULT_SCREEN_WORDS};
1
+ var e={title:"Add",contextBlocks:"Blocks for this place",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",startBlank:"Start blank",templates:"Your templates",inside:({name:e})=>`Inside ${e}`,tile:({name:e})=>`Add ${e}`,hintBlocks:"Drag into the page, or click to add.",hint:"Drag onto the page, or click to add.",searchBlocks:"Search blocks",searchSections:"Search sections",addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},t={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,canvasAddBlock:"Add block",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving…"},bar:{undo:"Undo",redo:"Redo",refresh:"Refresh",refreshTip:"Refresh the preview (reloads the canvas, keeps your place)",notSaving:"Not saving — see the notice above",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views"},menu:{undo:"Undo",redo:"Redo",addSection:"Add section",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",editFooter:"Edit the site footer",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:t,total:a})=>`Moved “${e}” to position ${t} of ${a}`,sectionAdded:({name:e})=>`Added “${e}” section`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}};export{e as DEFAULT_SCREEN_ADD_WORDS,t as DEFAULT_SCREEN_WORDS};
@@ -1 +1 @@
1
- import{styleMenuItems as e}from"./chunk-V7U33NF2.js";import{useEaselSession as n}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as t}from"./chunk-PLVEGYK6.js";import{useHostEscape as o}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-BF3PIXZD.js";import{EaselMenuItems as r,menuLabel as i}from"./chunk-EA2HTX37.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{useCanvasEvent as u}from"./chunk-PAELDYYS.js";import{isTypingTarget as d,framePointToHost as p}from"./chunk-ZNCEOSXO.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-KRXQM65X.js";import{useState as y,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,AddIcon as C,PasteIcon as P,SettingsIcon as z,LayersIcon as O,CopyIcon as A}from"efficient-shell/icons/efficient";import{jsx as S}from"react/jsx-runtime";function D(e,n){const o=[],l=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||l.has(n.props.id))break;if(l.add(n.props.id),o.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===t)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var j=c(),K=/* @__PURE__ */new WeakMap;function X(e){if(e.claimsPage)return j;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=K.get(n);return t||(t=c(),K.set(n,t)),t}function T(){return X(n())}function E(e,n,o){if(n===t){const{floor:n,cap:t}=e.sectionBand();return{parentId:h,slot:m,index:Math.min(Math.max(o,n),t)}}const l=n.lastIndexOf(":");return{parentId:n.slice(0,l),slot:n.slice(l+1),index:o}}function M(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete}}function I(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?E(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=E(e,l.zone,l.index+1);if(o(n,t))return t}return null}function L(e){if(e.defaultPrevented||e.altKey||e.shiftKey||!e.metaKey&&!e.ctrlKey)return null;if(d(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function Y(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=M(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:I(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function R(n,o){const{zone:l,index:r}=o,i=n.nodeAt(l,r);if(!i)return[];const c=i.props.id,a=n.labelOf(i.type,l),u=Boolean(i.props._hidden),d=n.nodeOps,p=n.isPinned(i,l),f=n.isLocked(i),m=!p&&!f&&!n.duplicateBlocked(i),h=n.permits?.(i)??{duplicate:!0,delete:!0},y=M(n,i,l),k=D(n,o),b=d.held,v=b&&!p?I(n,b,o):null,g=!n.readOnly,w=n.style?e({held:g?n.style.held():null,canCopy:n.style.canCopy(i,l),onCopy:()=>n.style?.copy(i,l),onPaste:()=>n.style?.paste(l,r,i),words:n.words?.styleClipboard}):[];return s({title:a,words:n.words?.menu,layer:{group:"pick",items:k.flatMap((e,o)=>{const l={label:n.rowNameOf(e.node,e.zone),checked:0===o,onClick:()=>n.selectAt(e.zone,e.index,e.node.props.id,e.parentType)},r=e.zone===t?null:n.slotRung?.(e.zone)??null;return r?[l,{label:r.label,checked:!1,onClick:r.select}]:[l]})},actions:{addInside:g&&n.canAddTo(i.type)?()=>n.openAddInside(l,r):void 0,duplicate:g&&m&&h.duplicate?()=>d.duplicate(c):void 0,moveUp:g&&d.canStep(c,-1)?()=>d.step(c,-1):void 0,moveDown:g&&d.canStep(c,1)?()=>d.step(c,1):void 0,copy:y.copy?()=>d.copy(c,a):void 0,cut:g&&y.cut?()=>d.cut(c,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&n.renamePropOf(i,l)?()=>n.beginRename(l,r):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(c,{_hidden:!u})},delete:g&&m&&h.delete?()=>d.remove(c):void 0},style:w,extras:n.menuRows?.(i,l,r)??void 0,pinnedLine:p?B(n).pinned:void 0})}var B=e=>e.words?.screen??l.menu;function N(e){const n=B(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */S(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */S(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=o?[{label:n.addSection,icon:/* @__PURE__ */S(C,{}),onClick:e.openAddSection}]:[],c=e.nodeOps.held,s=E(e,t,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===t)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */S(P,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[r,i,[{label:e.pageSettingsLabel??l.pageSettings,icon:/* @__PURE__ */S(z,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */S(O,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function U(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=B(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */S(P,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function V(e){return e.shiftKey}function F(e,n){const[t,l]=y(null),r=k(()=>l(null),[]);o(null!==t,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=L(e);if(!o)return;const l=t.selected();if(!l)return;const r=Y(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),u(n,"keydown",c);const a=k(n=>{if(V(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);u(n,"contextmenu",t=>{if(V(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=p(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),u(n,"mousedown",r),u(n,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:t?/* @__PURE__ */S(Z,{host:e,target:t,onClose:r}):null,closeMenu:r}}function Z({host:e,target:n,onClose:t}){const o="node"===n.kind?R(e,n):"input"===n.kind?U(e,n.el):N(e);return 0===o.length?null:/* @__PURE__ */S(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),children:/* @__PURE__ */S(r,{items:o,onClose:t})})}export{j as EASEL_NODE_CLIPBOARD,D as ancestorChain,X as nodeClipboardOf,M as nodeClipboardRules,R as nodeMenuItems,L as nodeShortcut,N as pageMenuItems,I as pastePlace,Y as runNodeShortcut,U as textMenuItems,T as useNodeClipboard,F as useNodeContextMenu};
1
+ import{styleMenuItems as e}from"./chunk-V7U33NF2.js";import{useEaselSession as n}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as t}from"./chunk-PLVEGYK6.js";import{useHostEscape as o}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-MCHMF32I.js";import{EaselMenuItems as r,menuLabel as i}from"./chunk-EA2HTX37.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{useCanvasEvent as u}from"./chunk-PAELDYYS.js";import{isTypingTarget as d,framePointToHost as p}from"./chunk-ZNCEOSXO.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-KRXQM65X.js";import{useState as y,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,AddIcon as C,PasteIcon as z,SettingsIcon as O,LayersIcon as P,CopyIcon as A}from"efficient-shell/icons/efficient";import{jsx as S}from"react/jsx-runtime";function j(e,n){const o=[],l=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||l.has(n.props.id))break;if(l.add(n.props.id),o.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===t)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var D=c(),K=/* @__PURE__ */new WeakMap;function M(e){if(e.claimsPage)return D;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=K.get(n);return t||(t=c(),K.set(n,t)),t}function T(){return M(n())}function X(e,n,o){if(n===t){const{floor:n,cap:t}=e.sectionBand();return{parentId:h,slot:m,index:Math.min(Math.max(o,n),t)}}const l=n.lastIndexOf(":");return{parentId:n.slice(0,l),slot:n.slice(l+1),index:o}}function E(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete}}function I(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?X(e,t.zone,t.index+1):null;for(const l of j(e,t)){const t=X(e,l.zone,l.index+1);if(o(n,t))return t}return null}function L(e){if(e.defaultPrevented||e.altKey||e.shiftKey||!e.metaKey&&!e.ctrlKey)return null;if(d(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function Y(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=E(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:I(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function R(n,o){const{zone:l,index:r}=o,i=n.nodeAt(l,r);if(!i)return[];const c=i.props.id,a=n.labelOf(i.type,l),u=Boolean(i.props._hidden),d=n.nodeOps,p=n.isPinned(i,l),f=n.isLocked(i),m=!p&&!f&&!n.duplicateBlocked(i),h=n.permits?.(i)??{duplicate:!0,delete:!0},y=E(n,i,l),k=j(n,o),b=d.held,v=b&&!p?I(n,b,o):null,g=!n.readOnly,w=n.style?e({held:g?n.style.held():null,canCopy:n.style.canCopy(i,l),onCopy:()=>n.style?.copy(i,l),onPaste:()=>n.style?.paste(l,r,i),words:n.words?.styleClipboard}):[];return s({title:a,words:n.words?.menu,layer:{group:"pick",items:k.flatMap((e,o)=>{const l={label:n.rowNameOf(e.node,e.zone),checked:0===o,onClick:()=>n.selectAt(e.zone,e.index,e.node.props.id,e.parentType)},r=e.zone===t?null:n.slotRung?.(e.zone)??null;return r?[l,{label:r.label,checked:!1,onClick:r.select}]:[l]})},actions:{addInside:g&&n.canAddTo(i.type)?()=>n.openAddInside(l,r):void 0,duplicate:g&&m&&h.duplicate?()=>d.duplicate(c):void 0,moveUp:g&&d.canStep(c,-1)?()=>d.step(c,-1):void 0,moveDown:g&&d.canStep(c,1)?()=>d.step(c,1):void 0,copy:y.copy?()=>d.copy(c,a):void 0,cut:g&&y.cut?()=>d.cut(c,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&n.renamePropOf(i,l)?()=>n.beginRename(l,r):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(c,{_hidden:!u})},delete:g&&m&&h.delete?()=>d.remove(c):void 0},style:w,extras:n.menuRows?.(i,l,r)??void 0,pinnedLine:p?N(n).pinned:void 0})}var N=e=>e.words?.screen??l.menu;function U(e){const n=N(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */S(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */S(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=o?[{label:n.addSection,icon:/* @__PURE__ */S(C,{}),onClick:e.openAddSection}]:[],c=e.nodeOps.held,s=X(e,t,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===t)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */S(z,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[r,i,[{label:e.pageSettingsLabel??l.pageSettings,icon:/* @__PURE__ */S(O,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */S(P,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function V(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=N(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */S(z,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function B(e){return e.shiftKey}function F(e,n){const[t,l]=y(null),r=k(()=>l(null),[]);o(null!==t,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=L(e);if(!o)return;const l=t.selected();if(!l)return;const r=Y(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),u(n,"keydown",c);const a=k(n=>{if(B(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);u(n,"contextmenu",t=>{if(B(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=p(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),u(n,"mousedown",r),u(n,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:t?/* @__PURE__ */S(G,{host:e,target:t,onClose:r}):null,closeMenu:r}}function G({host:e,target:n,onClose:t}){const o="node"===n.kind?R(e,n):"input"===n.kind?V(e,n.el):U(e);return 0===o.length?null:/* @__PURE__ */S(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),children:/* @__PURE__ */S(r,{items:o,onClose:t})})}export{D as EASEL_NODE_CLIPBOARD,j as ancestorChain,M as nodeClipboardOf,E as nodeClipboardRules,R as nodeMenuItems,L as nodeShortcut,U as pageMenuItems,I as pastePlace,Y as runNodeShortcut,V as textMenuItems,T as useNodeClipboard,F as useNodeContextMenu};
@@ -1,2 +1,2 @@
1
- import{noControlField as e}from"./chunk-7F52SZOI.js";import{usePreviewDevice as n}from"./chunk-BSPCSC45.js";import{DEFAULT_SCREEN_WORDS as r}from"./chunk-BF3PIXZD.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{jsx as o}from"react/jsx-runtime";function i(e){return"mobile"===e?"mobile":"desktop"}var c={desktop:null,tablet:r.deviceNote.tablet,mobile:r.deviceNote.mobile},u="data-sf-device-hidden";function d(){/* @__PURE__ */
1
+ import{noControlField as e}from"./chunk-7F52SZOI.js";import{usePreviewDevice as n}from"./chunk-BSPCSC45.js";import{DEFAULT_SCREEN_WORDS as r}from"./chunk-MCHMF32I.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{jsx as o}from"react/jsx-runtime";function i(e){return"mobile"===e?"mobile":"desktop"}var c={desktop:null,tablet:r.deviceNote.tablet,mobile:r.deviceNote.mobile},u="data-sf-device-hidden";function d(){/* @__PURE__ */
2
2
  return o("span",{hidden:!0,[u]:""})}function s({tier:e,render:r,...t}){return i(n())===e?/* @__PURE__ */o(r,{...t}):/* @__PURE__ */o(d,{})}var m="__device";function f(e){const n=e?.[m];return n??null}function l(e){return f(e)?.inner??e}function a(e,n){const r=n.render;return{...n,[m]:{tier:e,inner:n},render:n=>/* @__PURE__ */o(s,{tier:e,render:r,...n})}}function p(){const e=t("screen",r).deviceNote,i=n(),c="desktop"===i?null:e[i];return c?/* @__PURE__ */o("div",{className:"sf-device-scope",children:c}):/* @__PURE__ */o(d,{})}function v(){return e({type:"custom",render:()=>/* @__PURE__ */o(p,{})},"always")}export{m as DEVICE_FIELD_MARKER,u as DEVICE_HIDDEN_ATTR,c as DEVICE_NOTE,a as deviceField,f as deviceMetaOf,v as deviceNote,i as shownTier,l as withoutDeviceGate};
@@ -0,0 +1,5 @@
1
+ import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-5SOSVTVI.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-55IKQFBW.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-MCHMF32I.js";import{useEasel as f}from"./chunk-PDZXAFNX.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-6HHHBBSY.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as B,jsxs as $,Fragment as O}from"react/jsx-runtime";var H=e=>`section:${e}`,I=e=>`block:${e}`,v=e=>`template:${e}`;function F({blocks:F,blocksOnly:V,at:x,onAdd:N,itemFor:A,session:L,siteWide:S,onClose:C,onHide:D,readOnly:Q}){const T=f(e=>e.config),w=p(),{labelAtLevel:M,categoryLabel:P,firstSection:R,Icon:W,Thumbnail:X}=w,{blockIsOffered:Y}=m(),z=u("screen",d).add,K=u("drag",h).add,Z=l(),[E,G]=y([]);b(()=>{let t=!1;const o=e=>Y(e,Z);return s(Z).list().then(n=>{if(t)return;const i=T.components;G(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[T,Z]);const J=j(()=>t(T,w),[T]),q=e=>({type:H(e.type),label:e.name,cover:/* @__PURE__ */B(X,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:z.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),U=j(()=>{const e=[];if(F&&F.choices.length>0&&a(F.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${z.inside({name:F.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:I(e.type),label:e.label,icon:/* @__PURE__ */B(W,{type:e.type,size:18}),title:z.tile({name:e.label})}))})}),V)return e;const t=o(J,R);t&&e.push({key:"start",title:z.startBlank,tiles:[q(t)]}),E.length>0&&e.push({key:"templates",title:z.templates,tiles:E.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */B(X,{type:e.node.type}),keywords:[(t=e.node.type,M(t,"section",T.components[t]?.label??t)),e.node.type]};var t})});const s=n(J,R);for(const t of Object.keys(T.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(T,t,P),tiles:o.map(q)})}return e},[F,V,E,J,T,z]),_=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=E.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
+ return $(O,{children:[
3
+ /* @__PURE__ */B(r,{icon:/* @__PURE__ */B(g,{size:15}),title:z.title,context:V?z.contextBlocks:z.contextAll,actions:/* @__PURE__ */B(c,{label:z.done,description:z.doneDescription,onClick:C}),onHide:D}),
4
+ /* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
5
+ /* @__PURE__ */B(k,{groups:U,session:L,itemFor:e=>A(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&N(t)},at:x,hint:V?z.hintBlocks:z.hint,searchLabel:V?z.searchBlocks:z.searchSections,readOnly:Q,words:K}),S&&!V?S:null]})]})}export{F as AddSidePanel,I as blockKey,H as sectionKey,v as templateKey};
@@ -1,64 +1,65 @@
1
- import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-AVYFZZAP.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-J2JBETVO.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-42TMLDSQ.js";import{usePartBridge as v}from"./chunk-OFNXIZEP.js";import{useSectionOps as w}from"./chunk-FRGCTHDB.js";import{useNodeClipboard as x,useNodeContextMenu as b}from"./chunk-IMRJHRQ2.js";import{PageEditGuardNotices as z}from"./chunk-KNUFI3WV.js";import{useScreenDocument as B}from"./chunk-PRSTFWUY.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as N}from"./chunk-V7U33NF2.js";import{AddChildRow as I}from"./chunk-5545A3PC.js";import{AddSidePanel as P}from"./chunk-2WVZ3CK3.js";import{SidePanelHead as T,PanelShowStrip as $}from"./chunk-5SOSVTVI.js";import{MediaSidePanel as A}from"./chunk-ZN752E2O.js";import{useScreenSaveSwitch as j,useScreenNodeKeys as M,useScreenPinned as R,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as F,useScreenDevices as V,useScreenPickFollowsSelection as D,useScreenLeftView as H,useScreenAdd as W,SELECTION_MODE as U,sameInspectorMode as G,useScreenBridges as Y,useScreenBlockRules as J,useScreenBlockLook as X,useScreenStorageNamespace as K,useScreenNotify as Z,useScreenCanvasHead as Q,isSlotMode as _,useScreenStyleClipboard as q,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-55IKQFBW.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-BF3PIXZD.js";import{useEasel as we,useEaselApi as xe}from"./chunk-PDZXAFNX.js";import{TreeRow as be,Subtree as ze,LayersTree as Be,TreeGroupLabel as Ce,TreeRowAction as Oe,TreeSeam as Ne}from"./chunk-UFY6RNMT.js";import{DEFAULT_TREE_WORDS as Ie}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Pe}from"./chunk-WK3AFPXY.js";import{toItemSelector as Te,useNodeOps as $e}from"./chunk-QASZFO4S.js";import{LayersIcon as Ae,MediaIcon as je}from"./chunk-4VJATVVR.js";import{DEFAULT_SAVE_WORDS as Me,saveIndicator as Re}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Ee,TopBarRail as Le,TopBarCluster as Fe,EaselIconButton as Ve,TopBarDivider as De,DeviceSwitch as He,InspectorIconButton as We,PanelResizeHandle as Ue,MAX_PANEL_W as Ge,MIN_PANEL_W as Ye,panelWidthVars as Je,SaveState as Xe,SaveStateToggle as Ke}from"./chunk-GTDLBUOC.js";import{DEFAULT_CHROME_WORDS as Ze}from"./chunk-Y2G7CU6A.js";import{useWords as Qe}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as _e}from"./chunk-6HHHBBSY.js";import{DEFAULT_DRAG_WORDS as qe}from"./chunk-O2NLQBFX.js";import{createDragSession as en,useTreeDrag as nn,gapToMoveIndex as tn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as on,BLOCK_SELECTOR as rn,useCanvasEvent as ln}from"./chunk-PAELDYYS.js";import{zoneKey as sn,ROOT_ID as dn,ROOT_SLOT as cn,parseZoneKey as an,DataError as pn}from"./chunk-KRXQM65X.js";import{useRef as un,useMemo as fn,useState as hn,useEffect as mn,useCallback as gn,useLayoutEffect as yn,Fragment as kn}from"react";import{Tooltip as Sn,Button as vn,toast as wn}from"efficient-shell/ui";import{UndoIcon as xn,RedoIcon as bn,TrashIcon as zn,EyeOffIcon as Bn,EyeIcon as Cn,DuplicateIcon as On}from"efficient-shell/icons/efficient";import{jsx as Nn,jsxs as In,Fragment as Pn}from"react/jsx-runtime";function Tn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i,words:l,saveWords:s}){if(null!==t)/* @__PURE__ */return Nn(Xe,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
2
- return Nn(Xe,{tone:e.pending?"off-unsaved":"off",label:l.notSaving,role:"status"});const{tone:d,label:c}=Re(e,s),a=e.failed&&!e.paused&&/* @__PURE__ */Nn(vn,{variant:"secondary",size:"sm",onClick:i,children:l.retry});/* @__PURE__ */
3
- return In(Pn,o?{children:[
4
- /* @__PURE__ */Nn(Ke,{pressed:e.paused,onToggle:r,title:e.paused?l.autoSaveOff:l.autoSaveOn,children:/* @__PURE__ */Nn(Xe,{tone:d,label:c})}),a]}:{children:[
5
- /* @__PURE__ */Nn(Xe,{tone:d,label:c,role:"status"}),a]})}function $n({expand:e}){/* @__PURE__ */
6
- return Nn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */In(Pn,e?{children:[
7
- /* @__PURE__ */Nn("path",{d:"M8 9l4-4 4 4"}),
8
- /* @__PURE__ */Nn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
9
- /* @__PURE__ */Nn("path",{d:"M8 4l4 4 4-4"}),
10
- /* @__PURE__ */Nn("path",{d:"M8 20l4-4 4 4"}),
11
- /* @__PURE__ */Nn("path",{d:"M5 12h14"})]})})}function An(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var jn="__rungs";var Mn="screen:band",Rn={duplicate:!0,delete:!0};function En(){const Re=ye(),{target:Xe,docId:Ke,capabilities:En,currentSlug:Ln,siteId:Fn,onPublish:Vn,saveState:Dn,saveConflict:Hn,retrySave:Wn,toggleAutoSave:Un,readOnly:Gn,readOnlyReason:Yn=null}=B(),Jn=j(),Xn=M(),{mediaEditing:Kn,hasEditGuard:Zn,hasPinnedChrome:Qn}=En,{appState:_n,dispatch:qn,history:et,selectedItem:nt,getSelectorForId:tt,config:ot}=we(e=>e),rt=R(),{first:it,firstGroup:lt,lastGroup:st,isSectionGroup:dt,sectionGroupZone:ct,panelOf:at}=rt,pt=at(it),ut=e=>oe(rt,e),ft=e=>re(rt,e),ht="node"===rt.firstRow,mt=rt.band??null,gt=Qe("screen",ve),yt=Qe("tree",Ie),kt=Qe("drag",qe),St=Qe("save",Me),vt=Qe("menu",Pe),wt=Qe("styleClipboard",Se),xt=Qe("chrome",Ze),bt=E()??`/${Ln}`,zt=L(),Bt=F(),Ct=w({readOnly:Gn}),Ot=w({readOnly:Gn,foldIntoHistory:!0}),Nt=un(null),It=xe(),Pt=fn(()=>({...Ct,select:e=>{Nt.current=e,Ct.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=It.config;Nt.current=Te(e,t,n)}Ct.commitDocument(e,n)}}),[Ct,It]),Tt=_n.ui,$t=Tt.leftSideBarVisible,At=Tt.rightSideBarVisible,{options:jt,widths:Mt,initial:Rt,fluid:Et,fit:Lt}=V(),[Ft,Vt]=hn(Rt),Dt=he(),Ht=Kn&&null!==Dt,Wt=me(),Ut=ge();D(nt?.props.id);const{read:Gt,write:Yt,forSelection:Jt}=H(),[Xt,Kt]=hn(Gt);mn(()=>{Yt(Xt)},[Xt]);const[Zt,Qt]=hn(0),_t=un(null),qt=un(null),eo=on(qt,{readySelector:rn}),no=f(qt);h(qt,eo);const[to,oo]=hn(!1),ro=un(!1),io=un(!1),[lo,so]=hn(null),co=W(),ao=e=>so(null===e?null:{zone:le,index:e}),[po,uo]=hn([]),[fo,ho]=hn(U),mo="puck"===fo.kind,go=to&&!lo&&co.railTarget?co.railTarget(_n.data,{node:nt??null,mode:fo}):null,yo=go?{zone:sn(go),index:go.index}:null,ko=lo??yo,So=ko&&ko.zone===le?ko.index:null,vo=t(fo,nt?.props.id),[wo,xo]=hn(null);mn(()=>{wo&&(o(),xo(null))},[wo]);const bo=un(tt);bo.current=tt;const zo=gn((e,{scroll:n})=>{Kt(n=>Jt(e,n)),n&&xo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=bo.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})},[]),Bo=un(null);mn(()=>{const e=Bo.current;Bo.current=null;const n=null==nt?.props.id?null:String(nt.props.id);ho(e&&e.id===n?e.mode:at(nt?.type)??U);const t=nt?.props.id,o=Nt.current;if(Nt.current=null,!t)return;const i=tt(t);zo(String(t),{scroll:!r(o,i??null,le)})},[nt?.props.id,zo]);const Co=gn(e=>{ho(n=>G(n,e)?n:e),qn({type:"setUi",ui:{rightSideBarVisible:!0}})},[qn]),Oo=un(()=>{});Oo.current=(e,n)=>{const t=e?Gr(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==nt?.props.id?null:String(nt.props.id);ho(e=>G(e,n)?e:n),o!==r&&(Bo.current={id:o,mode:n},Pt.select(e))};const No=gn((e,n)=>Oo.current(e,n),[]),Io={kind:fo.kind,mode:fo,open:Co,show:e=>ho(e),reveal:()=>{At||qn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:No},Po=Y(Io,{data:_n.data,selected:nt??null,zoneOf:e=>tt(e)?.zone,readOnly:Boolean(Gn),select:e=>{ho(U),Pt.select({index:e})},replace:(e,n)=>Pt.replaceComponent(le,e,n),scrollTo:e=>gi(e)},{device:Ft,refreshes:Zt},{setView:Kt,reveal:()=>{$t||qn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),To=Po.pinnedSource??!1,$o=Po.resolveLeftView?Po.resolveLeftView(Xt,Ht):"media"===Xt&&Ht?Xt:"sections",Ao=J(),{isLockedBlock:jo,duplicateBlocked:Mo,nestDepth:Ro,newSectionNode:Eo,canAddTo:Lo,blockIsOffered:Fo}=Ao,Vo=X(),{labelAtLevel:Do,Icon:Ho,useProducts:Wo}=Vo,Uo=Vo.rowName?(e,n,t)=>Vo.rowName(e,n,t):void 0,Go=gn(e=>{qn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),zo(e,{scroll:!0})},[qn,zo]),{selectNode:Yo,openPartId:Jo}=v({mode:fo,setMode:ho,onOpenPart:Go}),[Xo,Ko]=hn(null);ke(null!==Xo,()=>Ko(null));const Zo=y(K()),Qo=Zo.collapsed,_o=Zo.panelWidths,[qo,er]=hn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Qo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
12
- return new Set}});mn(()=>{try{window.localStorage.setItem(Qo,JSON.stringify([...qo]))}catch{}},[qo]);const[nr,tr]=hn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(_o);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});mn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(_o,JSON.stringify(nr))}catch{}},300);return()=>clearTimeout(e)},[nr]);const or=gn((e,n)=>tr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),rr=gn(e=>or("left",e),[or]),ir=gn(e=>or("right",e),[or]),lr=e=>qo.has(e),sr=e=>er(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),dr=un(!1),cr=un(null);mn(()=>{if(dr.current&&!to){const e=cr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??qt.current?.querySelector(`button[aria-label="${CSS.escape(gt.add.title)}"]`))?.focus(),cr.current=null}dr.current=to},[to]),mn(()=>{if(!to||!no)return;const e=e=>{"Escape"===e.key&&Bi()};return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[to,no]),ke(to,()=>Bi()),mn(()=>{!$t&&to&&(oo(!1),so(null),ro.current=!1)},[$t]),mn(()=>{if(!Wt)return io.current&&qn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(io.current=!1);to&&(oo(!1),so(null),io.current=ro.current,ro.current=!1),$t||(io.current=!0,qn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Wt]),mn(()=>{!$t&&Wt&&(io.current=!1,Ut())},[$t]),mn(()=>{if(!Wt||!no)return;const e=e=>{"Escape"===e.key&&Ut()};return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[Wt,no]),ke(null!==Wt,()=>Ut());const ar=Z(),pr=(e,n="success")=>{ar?ar(e,"error"===n?"error":"info"):"error"===n?wn.error(e,{duration:3200,sound:!1}):wn.success(e,{duration:1900,sound:!1})},ur=un(null),[fr,hr]=hn(0),[mr,gr]=hn(0),yr=Q(),kr=un(null),Sr=e=>Math.max(0,e.clientHeight-(kr.current?.offsetHeight??0));mn(()=>{const e=ur.current;if(!e)return;const n=()=>{hr(e.clientWidth),gr(Sr(e))};n();const t=new ResizeObserver(n);return t.observe(e),kr.current&&t.observe(kr.current),()=>t.disconnect()},[]),yn(()=>{ur.current&&(hr(ur.current.clientWidth),gr(Sr(ur.current)))},[nr,$t,At]);const vr=Ft===Et?fr>0?fr:Mt[Et]:Mt[Ft],wr=fr>0?Math.min(fr/vr,"shrink"===Lt?1:2):1,xr=vr*wr,br=fr>0&&xr>fr+1,zr={width:xr,height:mr||"100%",flex:"none",position:"relative"},Br={width:vr,height:mr?mr/wr:"100%",maxHeight:"none",transform:1!==wr?`scale(${wr})`:void 0,transformOrigin:"top left"},Cr=()=>qn({type:"setUi",ui:{leftSideBarVisible:!$t}}),Or=()=>qn({type:"setUi",ui:{rightSideBarVisible:!At}}),Nr=e=>{to&&(oo(!1),so(null),ro.current=!1,$t&&Xt===e)||Wt&&(io.current=!1,Ut(),$t&&Xt===e)||($t&&Xt===e?Cr():(Kt(e),$t||qn({type:"setUi",ui:{leftSideBarVisible:!0}})))},Ir=()=>{C(Re,{accept:"image/*",title:xt.mediaLibrary})},Pr=()=>{ho(U),Pt.select(null),u()},Tr=()=>{ho(pt??U),At||qn({type:"setUi",ui:{rightSideBarVisible:!0}})},$r=_n.data.content??[],Ar=()=>{const e=$r.findIndex(ut),n=$r.findIndex(ft);return{floor:e>=0?e+1:0,cap:n>=0?n:$r.length}},jr=ot,Mr=Ao.stripCopy,Rr=e=>i(e,Mr),Er=x(),Lr=$e({data:_n.data,config:jr,readOnly:Boolean(Gn),clipboard:Er,strip:Mr?e=>Mr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==dn||e.slot!==cn)return{min:0,max:n-1};const{floor:t,cap:o}=Ar();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&ho(U);const t=void 0===n||"node"===n?.kind?n:null;Pt.commitDocument(e,t)}}),Fr=e=>Do(e,"block",ot.components[e]?.label??e),Vr=gn(e=>ot.components[e]?.defaultProps??{},[ot]),Dr=e=>Do(e,"section",Fr(e)),Hr=e=>l({type:e.type,props:e.props??{}},Dr(e.type),Uo),{nodeAddresses:Wr,zoneItems:Ur}=fn(()=>{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>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(ot,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t($r,le,0),{nodeAddresses:e,zoneItems:n}},[$r,ot]),Gr=gn(e=>Ur.get(e)??[],[Ur]),Yr=e=>{const n=Wr.get(e);return n?Gr(n.zone)[n.index]:void 0},Jr=e=>ie(Ao,ot,e),Xr=e=>{if(!Ao.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Yr(e.slice(0,n));if(!t)return null;const o=Jr(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}},Kr=(()=>{if(!_(fo))return null;const e=`${fo.nodeId}:${fo.slot}`;return Xr(e)?.slot.panel===fo.kind?e:null})(),Zr=un(null);mn(()=>{const e=Zr.current;if(Zr.current=null,!Kr||!_(fo))return;const n=fo.nodeId;zo(n,{scroll:e!==Kr}),er(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[fo]);const Qr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Wr.get(e);n&&(n.zone===le?yi(n.index):Ji(n.zone,n.index,e,Yr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Kr!==i&&(Zr.current=i),No(null,r),At||qn({type:"setUi",ui:{rightSideBarVisible:!0}}),gi(o)},_r=(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;Kr!==o&&(Zr.current=o);No(null,{kind:t,nodeId:e,slot:n})},qr=(e,n,t)=>{if(Gn||!Ao.moveSlot)return;const o=Yr(e),r=o?Jr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:jn,index:n},s=tn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=Ao.moveSlot(e,n,s);"string"==typeof d&&_r(e,d,i.panel)},ei=Wo(),ni=fn(()=>{const e=/* @__PURE__ */new Map;for(const n of ei??[])e.set(n.slug,n.name);return e},[ei]),ti=e=>s(e,Fr,Vo.plainText,e=>ni.get(e),Vo.rowName),oi=(e,n)=>{const t=ot.components[e.type]?.fields,o=n===le||pl(n)?"section":"block",r=n===le&&(ut(e)||ft(e)||dt(e.type)),i="block"===o?d(t):r?null:c(t);return Vo.renamePropOf?Vo.renamePropOf(e,o,i):i},ri=(e,n,t,o)=>{if(!(!Gn&&Xo?.zone===e&&Xo.index===n))return;const r=(t,o)=>{Ko(null),o&&((e,n,t)=>{const o=Gr(e)[n];if(!o)return;const r=oi(o,e);r&&Pt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
13
- return Nn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":gt.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)},ii=n(q(),wt),li=ii.scope({target:Xe,siteId:Fn,docId:Ke}),si=ot,di=(e,n)=>n===le?Dr(e):Fr(e),ci=(e,n,t)=>{const o=ii.plan(li,t,di(t.type,e),si);o&&(o.changed&&Pt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),pr(o.message))},ai=b({nodesIn:Gr,nodeAt:(e,n)=>Gr(e)[n]??null,labelOf:(e,n)=>n===le?Dr(e):Fr(e),renamePropOf:oi,beginRename:(e,n)=>Ko({zone:e,index:n}),history:{hasPast:et.hasPast,hasFuture:et.hasFuture,back:()=>et.back(),forward:()=>et.forward()},openAddSection:()=>{Pt.select(null),bi(null)},openPageSettings:()=>{Pt.select(null),ho(U)},pageSettingsLabel:gt.pageSettings,words:{menu:vt,styleClipboard:wt,screen:gt.menu},readOnly:Boolean(Gn),collapseAll:()=>er(new Set(Gr(le).map(e=>String(e.props.id)))),onPasteRefused:e=>pr(e?gt.pasteRefused({name:e.label}):gt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>fl(e,n),menuRows:Po.menuRows,isLocked:e=>jo(e.type),duplicateBlocked:e=>Mo(_n.data,e),permits:e=>se(ot,e.type),canAddTo:Lo,nodeOps:Lr,isPinned:(e,n)=>n===le&&(ut(e)||ft(e)),sectionBand:Ar,openAddInside:(e,n)=>{e===le?yi(n):Pt.select({zone:e,index:n}),bi(null)},locate:e=>Wr.get(e)??null,rowNameOf:(e,n)=>n===le?Hr(e):ti(e),selectAt:(e,n,t,o)=>{e===le?yi(n):Ji(e,n,t,o??"")},slotRung:e=>{const n=Xr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Qr(n.node,n.slot,!1)}:null},style:{held:()=>O(li),canCopy:e=>ii.rows(si,e).some(e=>!1!==e.counted),copy:(e,n)=>ii.copy(li,e,di(e.type,n),si),paste:(e,n,t)=>ci(e,n,t)},keys:Xn?{target:no,selected:()=>{const e=_n.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Er.get(),readOnly:Boolean(Gn),onDone:({done:e,name:n})=>{"copied"===e&&pr(gt.copied({name:n}))}}:void 0},eo),pi=un({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});mn(()=>{pi.current={copy:(e,n)=>ii.copy(li,e,di(e.type,n),si),paste:ci,at:()=>{const e=_n.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Gr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Gn)}});const ui=gn(e=>{const n=N(e);if(!n)return;const t=pi.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))},[]);mn(()=>{if(!no)return;const e=e=>ui(e);return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[ui,no]),ln(eo,"keydown",ui);const fi=$r.map(e=>e.props.id).join("|");mn(()=>{const e=eo?.document??null,n=eo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void uo(e=>e.length?[]:e);const n=$r.findIndex(ft),t=n>=0?n:$r.length,o=n=>{const t=$r[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(rn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=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=An(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}uo(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()}},[eo,fi,Ft,wr,$t,At,nt?.props.id]);const hi=eo?.document??null,mi=eo?.window??null;mn(()=>{const e=_t.current;if(!e||!hi||!mi)return;const n=[],t=()=>{const n=hi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&mi.scrollTo({left:mi.scrollX,top:mi.scrollY+t,behavior:"instant"}),!0};return _t.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[hi,mi]);const gi=e=>{Po.holdCanvasOn?Po.holdCanvasOn(e):a(e)},yi=e=>{ho(U),Pt.select({index:e}),Po.sectionPressed?.($r[e]);const n=$r[e]?.props?.id;n&&gi(n)},ki=e=>{const{floor:n,cap:t}=Ar(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=nt&&fo.kind!==pt?.kind?$r.findIndex(e=>e.props.id===nt.props.id):-1;return o(r>=0?r+1:t)},Si=(e,n)=>{const{floor:t,cap:o}=Ar(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(Pt.reorderComponent(le,e,i),Pt.select({index:i}),{moved:!0,dest:i})},vi=(e,n,t,o)=>{ho(U),Pt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),pr(gt.sectionAdded({name:t}))},wi=(e,n)=>{const t=ki(n),o=Eo(e,{nodeDefaults:Vr,newNodeId:fe,sectionLabel:Dr,blockIsOffered:Fo}),r=o?Pt.insertNode(le,t,o):Pt.insertSection(e,t);return vi(t,r,Dr(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:c}of ce(ot,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Lo(e.type,l,d.slice(d.lastIndexOf(":")+1)),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:c,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},xi=(e,n,t)=>{const o=ki(t),r=Pt.insertNode(le,o,n);return vi(o,r,e),o},bi=e=>zi(le,e),zi=(e,n)=>{cr.current=document.activeElement??null,Wt&&(ro.current=io.current,io.current=!1,Ut()),so(null===n?null:{zone:e,index:n}),oo(!0),$t||(ro.current=!0,qn({type:"setUi",ui:{leftSideBarVisible:!0}}))},Bi=()=>{oo(!1),so(null),ro.current&&qn({type:"setUi",ui:{leftSideBarVisible:!1}}),ro.current=!1},Ci=(e,n,t)=>{if("section"===e.kind)Pt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;Pt.insertNode(n,t,Rr(e.template.node))}ho(U),Pt.select({index:t,zone:n})},Oi=(e,n)=>Vo.rowName?n?ut(e)?Vo.rowName(e,"section",gt.header):ft(e)?Vo.rowName(e,"section",gt.footer):dt(e.type)?Vo.rowName(e,"section",Fr(e.type)):Hr(e):ti(e):n?Dr(e.type):Fr(e.type),Ni=e=>n=>{e()},Ii=()=>Po.editPinnedSource?.(),Pi=(e,n,t)=>{if(Gn)return null;const o=Gr(e)[n];return o&&!se(ot,o.type).delete?null:/* @__PURE__ */Nn(Oe,{kind:"delete",label:gt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Gr(e)[n]?.props?.id;null!=t&&Lr.remove(String(t))})(e,n),children:/* @__PURE__ */Nn(zn,{size:15})})},Ti=e=>Vo.rowPreview?.(e)||void 0,$i=e=>Vo.rowMarks?.(e)??void 0,Ai=(e,n,t)=>Vo.rowActions?.(e,n,t)??null,ji=(e,n,t,o)=>{if(Gn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
14
- return Nn(Oe,{kind:"eye",label:r?gt.showNamed({name:o}):gt.hideNamed({name:o}),onClick:()=>Ri(e,n,t),children:/* @__PURE__ */Nn(r?Bn:Cn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},Mi=e=>{const n=Dr($r[e]?.type??""),t=n?gt.addSectionBefore({name:n}):gt.addSectionHere;return Al(le,e,()=>bi(e),t)},Ri=(e,n,t)=>{Pt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Ei=e=>ae(ot,e),Li=e=>ce(ot,e),Fi=e=>Ao.slotsOf?Jr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Li(e)}],Vi=e=>Ao.slotsOf?Fi(e).flatMap(e=>e.kids):Li(e),Di=e=>Boolean(Ao.slotsOf)&&Jr(e).some(e=>e.rung),Hi=(e,n,t)=>null===t?void 0===n?Lo(e):Lo(e,n):Lo(e,n,t),Wi=(e,n,t)=>{const o=ue(ot,e.type,n)&&(t||Vi(e).length>0||Di(e));return{collapsible:o,folded:o&&lr(String(e.props.id))}},Ui=(e,n,t)=>Fi(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Wi(e,r,t(e.type)).collapsible?[String(e.props.id),...Ui(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Gi=e=>Vi(e).length>0||Di(e)||Boolean(Lo(e.type)),Yi=e=>Boolean(Lo(e)),Ji=(e,n,t,o)=>{if(ho(U),Lo(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),Pt.select({index:n,zone:e}),a(t)}else Pt.select({index:n,zone:e}),gi(t)},Xi=(e,n,t,o,r)=>{const i=`${e}:${n}`;Pt.insertComponent(i,t,o),Lo(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),Pt.select({index:o,zone:i})}):Pt.select({index:o,zone:i})},Ki=(e,n,t)=>{Pt.insertComponent(e,n,t),ho(U),Pt.select({index:t,zone:e})},Zi=un(/* @__PURE__ */new Set);mn(()=>{$r.forEach(e=>{const n=Lo(e.type)?.spec;if(!n)return;const t=e.props.id;if(Zi.current.has(t))return;Zi.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(Vr)).forEach((e,t)=>Ot.seedChild(o,t,n.childType,e))})},[$r,Ot,Vr]);const Qi=un(/* @__PURE__ */new Set);mn(()=>{$r.forEach((n,t)=>{const o=n.props.id;if(Qi.current.has(o))return;const r=e(n,Ei(n.type));Qi.current.add(o),r&&Ot.replaceComponent(le,t,{...n,props:r})})},[$r,Ot]),ee(Ot,ot);const _i=$r.findIndex(ft),qi=_i>=0?$r[_i]:null,el=ht?$r.findIndex(ut):-1,nl=el>=0?$r[el]:null,tl=$r.find(e=>e.type===lt)??null,ol=$r.find(e=>e.type===st)??null,rl=_i>=0?_i:$r.length,il=[];$r.forEach(e=>{ft(e)||(Gi(e)&&il.push(String(e.props.id)),il.push(...Ui(e,1,Yi)))}),qi&&(il.push(String(qi.props.id)),il.push(...Ui(qi,1,Yi)));const ll=il.length>0&&il.every(e=>qo.has(e)),sl=e=>{const n=Vo.blockRowName(e,Fr);return Vo.rowName?Vo.rowName(e,"block",n):n},dl=(e,n,t,o)=>{const r=Gr(e)[t];if(!r)return;const i={...an(e),index:t},l={...an(n),index:Math.min(Math.max(o,0),Gr(n).length)},s=tn(i,l);if(e!==n||s!==t)try{Lr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof pn))throw e}},cl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Li(e))n.add(r),t(o)};for(const t of Ei(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},al=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Wr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},pl=e=>{const n=e.slice(0,e.indexOf(":")),t=$r.find(e=>dt(e.type)&&String(e.props.id)===n);return t&&ct(n)===e?t:null},ul=(e,n,t)=>{if(e.rung){const t=Yr(e.rung.nodeId),o=t?Jr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===jn&&n.index>=0&&n.index<=o}if(n.slot===jn)return!1;if(e.add)return ml(e.add,n);const o=sn(n);if(dt(e.type))return!1;const r=pl(o),i=pl(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Gr(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=Ar();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Gr(o).length)return!1;if(e.zone===o)return!0;const l=qi&&!rt.lastIsOpen?String(qi.props.id):null;return(!l||al(e.zone)!==l&&al(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Gr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Wr.get(i),s=l?Gr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&cl(r).has(n))return!1;const d=Lo(s.type,Ro(_n?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Gr(n),r))})(e.zone,o,e.index,t)},fl=(e,n)=>{const t=sn(e.from);if(t===sn(n))return!0;const o=e.node;return ul({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},hl=e=>{const n=e.slice(0,e.indexOf(":")),t=Wr.get(n),o=t?Gr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Lo(o.type,Ro(_n?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:Fr(r.spec.childType)}]:[]),l=Xr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Oi(o,t.zone===le)}},ml=(e,n)=>{const t=sn(n);if("block"!==e.kind){if(pl(t))return n.index>=0&&n.index<=Gr(t).length;if(t!==le)return!1;const{floor:e,cap:o}=Ar();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=hl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Gr(t))},gl=(e,n)=>{e.rung?qr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&pl(sn(n)))return void Ci(e,sn(n),n.index);if("section"===e.kind)return void wi(e.type,n.index);if("template"===e.kind)return void xi(e.template.name,Rr(e.template.node),n.index);const t=sn(n),o=hl(t);o&&(o.target.spec?Xi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ki(t,e.type,n.index))})(e.add,n):e.zone===le?Si(e.index,n.index):dl(e.zone,sn(n),e.index,n.index)},[yl]=hn(()=>en()),kl=nn({keyOf:e=>e.id,readOnly:Boolean(Gn),session:yl,canDrop:ul,onDrop:gl,onStep:(e,n)=>{e.rung?qr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Dr($r[e]?.type??""),o=Si(e,n<0?e-1:e+2);if(!o.moved)return void pr(n<0?gt.sectionFirst({name:t}):gt.sectionLast({name:t}));const{floor:r,cap:i}=Ar();pr(gt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):dl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Sl=gn(e=>{const{floor:n,cap:t}=Ar(),o=[];for(const r of e.nodes){const e=sn(r.place),i=Gr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(ut(i)||ft(i)||jo(i.type))continue;if(dt(i.type))continue;const l=Boolean(pl(e)),s=e===le||l;e===le&&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?Dr(i.type):ti(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(hl(sn(e.list))?.choices.length)||Boolean(pl(sn(e.list))))}},[_n.data]),vl=e=>{ho(U),Pt.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},wl=ne(),xl=()=>({data:_n.data,device:Ft,ops:Pt,inspector:Io}),bl=wl?.model,zl=fn(()=>bl?e=>bl(e,Sl(e),xl()):Sl,[bl,Sl,Ft]),Bl=wl?.measure,Cl=Bl?(e,n)=>Bl(e,n,xl()):void 0,Ol=wl?.canDrop,Nl=Ol?(e,n)=>Ol(e,n,ul,xl()):ul,Il=wl?.drop,Pl=Il?(e,n)=>Il(e,n,gl,xl()):gl,Tl=wl?.pick,$l=Tl?e=>Tl(e,vl,xl()):vl,Al=(e,n,t,o)=>/* @__PURE__ */Nn(Ne,{...Gn?{}:kl.seam({place:{...an(e),index:n}}),onAdd:Gn?void 0:t,label:o},`seam:${e}:${n}`),jl={rowClick:Ni,isCollapsed:lr,toggleCollapse:sr},Ml=e=>{const n=String(e.props.id),t=$r.findIndex(e=>String(e.props.id)===n),o=ct(n),r=Gr(o),i=lr(n),l=Fr(e.type),s=Vo.rowName?Vo.rowName(e,"section",l):l,d=e=>Al(o,e,()=>zi(o,e),gt.addSectionHere);/* @__PURE__ */
15
- return In(Pn,{children:[
16
- /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:e.type,size:13}),name:s,preview:Ti(e),marks:$i(e),onSelect:()=>yi(t),nameSlot:ri(le,t,n,s),selected:vo===n,actions:Ai(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:Ni(()=>yi(t))},fold:{open:!i,label:"section",onToggle:()=>sr(n)}}),!i&&/* @__PURE__ */In(ze,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Hr(n),l=Gi(n),s=l&&lr(r),c=()=>Ji(o,t,r,e.type),{rowProps:a,...p}=kl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...an(o),index:t}},{"data-node-id":r,onClick:Ni(c)});/* @__PURE__ */
17
- return In(kn,{children:[d(t),
18
- /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:n.type,size:13}),name:i,preview:Ti(n),marks:$i(n),onSelect:c,nameSlot:ri(o,t,r,i),selected:vo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>sr(r)}:void 0,actions:/* @__PURE__ */In(Pn,{children:[Pi(o,t,i),Ai(n,o,t),ji(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Nn(ze,{children:Ll(n,2)})]},r)}),d(r.length)]})]})},Rl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=kl.dragging,d=!lr(l)&&s?.rung?.nodeId!==i,c={...an(l),index:0},a=s&&!s.rung&&ul(s,c)?c:void 0,p=()=>Qr(e,n,!0),{rowProps:u,...f}=kl.row({item:{id:`rung:${l}`,zone:`${i}:${jn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:jn,index:t},into:a,canDrag:Boolean(Ao.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Ni(p)}),h=Gn?null:Ao.slotActions?.(e,n.slot);/* @__PURE__ */
19
- return In(kn,{children:[n.heading,
20
- /* @__PURE__ */Nn(be,{words:yt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Kr===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>sr(l)},actions:h&&h.length>0?/* @__PURE__ */Nn(Pn,{children:h.map((t,o)=>/* @__PURE__ */Nn(Oe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Gn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&_r(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__ */Nn(zn,{size:15}):/* @__PURE__ */Nn(On,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Nn(ze,{children:r})]},l)},El=(e,n)=>{const t=Fi(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
21
- return Nn(Pn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Hi(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(hl(c)?.choices.length),p=(e,n)=>a?Al(e,n,()=>zi(e,n),gt.addBlockHere):Al(e,n),u=/* @__PURE__ */In(Pn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=vo===String(n.props.id),{collapsible:i,folded:s}=Wi(n,l,Yi(n.type)),d=String(n.props.id),c=sl(n),a=()=>Ji(t,o,d,e.type),{rowProps:u,...f}=kl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...an(t),index:o}},{"data-node-id":d,onClick:Ni(a)});/* @__PURE__ */
22
- return In(kn,{children:[0===o&&p(t,0),
23
- /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:n.type,size:13}),name:c,preview:Ti(n),marks:$i(n),onSelect:a,nameSlot:ri(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>sr(d)}:void 0,actions:/* @__PURE__ */In(Pn,{children:[Pi(t,o,c),Ai(n,t,o),ji(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Nn(ze,{children:El(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?Rl(e,t.rung,r++,o,u):/* @__PURE__ */Nn(kn,{children:u},t.slot??"")})})},Ll=(e,n)=>{const t=Ro(_n?.data,e.type,String(e.props.id)),o=Fi(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
24
- return Nn(Pn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Hi(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>Xi(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>zi(n,t):void 0;return Al(n,t,o,n===f&&c?c.addLabel:gt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */In(Pn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=vo===String(n.props.id),i=ti(n),l=String(n.props.id),{collapsible:d,folded:c}=Wi(n,s,Yi(n.type)),a=Ei(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...an(p),index:Gr(p).length}:void 0,f=kl.dragging,h=u&&f&&ul(f,u)?u:void 0,g=()=>Ji(t,o,l,e.type),{rowProps:y,...k}=kl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...an(t),index:o},into:h,canDrag:!jo(n.type)},{"data-node-id":l,onClick:Ni(g)});/* @__PURE__ */
25
- return In(kn,{children:[0===o&&m(t,0),
26
- /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:n.type,size:13}),name:i,preview:Ti(n),marks:$i(n),onSelect:g,nameSlot:ri(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>sr(l)}:void 0,actions:jo(n.type)?Ai(n,t,o)??void 0:/* @__PURE__ */In(Pn,{children:[Pi(t,o,i),Ai(n,t,o),ji(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Nn(ze,{children:Ll(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
27
- /* @__PURE__ */Nn(I,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>Xi(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?Rl(e,o.rung,i++,r,k):/* @__PURE__ */Nn(kn,{children:k},o.slot??"")})})},Fl=(()=>{if(!nt||!mo)return null;const e=String(nt.type),n=String(nt.props.id),t=Lo(e,Ro(_n?.data,e,n));if(!t||"footer"===t.source)return null;const o=$r.some(e=>String(e.props?.id)===n),r=Array.isArray(nt.props[t.slot])?nt.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Fr(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:Oi(nt,o),choices:i,onPick:o=>{t.spec?Xi(n,t.slot,o,r.length,e):Ki(`${n}:${t.slot}`,o,r.length)}}})(),Vl=ko&&ko.zone!==le&&!pl(ko.zone)?ko.zone:null,Dl=!0===co.blocksFirst,Hl=Vl?hl(Vl):Dl&&ko?null:Fl,Wl=Boolean(lo&&Vl)||Dl&&Boolean(Hl&&Hl.choices.length>0),Ul=to||null!==Wt,Gl=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:$t&&!Ul&&$o===e.id,onSelect:()=>Nr(e.id)}:e,Yl=[{id:"add",label:gt.add.title,icon:/* @__PURE__ */Nn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:to,onSelect:()=>to?Bi():bi(null)},...(Po.railLead??[]).map(Gl),{id:"sections",label:gt.layers,icon:/* @__PURE__ */Nn(Ae,{}),active:$t&&!Ul&&"sections"===$o,onSelect:()=>Nr("sections")},...(Po.railTrail??[]).map(Gl)];Ht?Yl.push({id:"media",label:gt.railMedia,icon:/* @__PURE__ */Nn(je,{}),active:$t&&!to&&(null!==Wt||"media"===$o),onSelect:()=>Nr("media")}):Kn&&Yl.push({id:"media",label:gt.railMedia,icon:/* @__PURE__ */Nn(je,{}),onSelect:Ir});const Jl=[...Po.railLead??[],...Po.railTrail??[]].find(e=>"panel"in e&&e.id===$o),Xl=Boolean(mt?.foldable)&&!To,Kl=mt?.label??(Zn?gt.pageSections:gt.templateSections),Zl=Xl&&lr(Mn),Ql=/* @__PURE__ */In(Pn,{children:[$r.map((e,n)=>{if(ut(e)||ft(e)||dt(e.type))return null;const t=vo===String(e.props.id),o=Boolean(e.props._hidden);Li(e);const r=String(e.props.id),i=Po.hasOwnRows?.(e)??!1,l=Gi(e)||i,s=l&&lr(r),{rowProps:d,...c}=kl.row({item:{id:r,zone:le,index:n,type:e.type},place:{...an(le),index:n}},{"data-node-id":r,onClick:Ni(()=>yi(n))});/* @__PURE__ */
28
- return In(kn,{children:[n>0&&Mi(n),
29
- /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:e.type,size:13}),name:Hr(e),preview:Ti(e),marks:$i(e),onSelect:()=>yi(n),nameSlot:ri(le,n,r,Hr(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>sr(r)}:void 0,actions:/* @__PURE__ */In(Pn,{children:[Pi(le,n,Hr(e)),Ai(e,le,n),ji(le,n,e,Hr(e))]}),rowProps:d}),Gi(e)&&!s&&/* @__PURE__ */In(ze,{children:[Ll(e,1),Po.partRows?.(e,jl)]}),i&&!s&&/* @__PURE__ */Nn(ze,{children:Po.ownRows?.(e,n,jl)})]},String(e.props.id??n))}),!To&&rl>0&&Mi(rl),mt?.addAtEnd&&!To&&!Gn&&/* @__PURE__ */Nn(I,{small:!0,label:gt.addSection,blocked:null,onAdd:()=>bi(rl)})]}),_l=(e,n,t)=>{const o=String(e.props.id),r=Vi(e).length>0||Di(e)||Boolean(Lo(e.type)),i=r&&lr(o),l="header"===t?gt.header:gt.footer,s=Vo.rowName?Vo.rowName(e,"section",l):l;/* @__PURE__ */
30
- return In(Pn,{children:[
31
- /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:t,size:13}),name:s,preview:Ti(e),marks:$i(e),onSelect:()=>yi(n),nameSlot:ri(le,n,o,s),selected:vo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>sr(o)}:void 0,actions:Ai(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:Ni(()=>yi(n))}}),r&&!i&&/* @__PURE__ */Nn(ze,{children:El(e,1)})]})};return(Po.wrap??(e=>e))(
32
- /* @__PURE__ */Nn(te,{target:eo,children:/* @__PURE__ */In("div",{ref:qt,className:"sf-editor es-editor",style:Je(nr),onContextMenu:ai.onEditorContextMenu,...m(Re),children:[
33
- /* @__PURE__ */In(Ee,{children:[
34
- /* @__PURE__ */Nn(Le,{items:Yl,ariaLabel:gt.bar.views}),
35
- /* @__PURE__ */In(Fe,{children:[
36
- /* @__PURE__ */Nn(Ve,{label:gt.bar.undo,disabled:Boolean(Gn)||!et.hasPast,onClick:()=>et.back(),children:/* @__PURE__ */Nn(xn,{})}),
37
- /* @__PURE__ */Nn(Ve,{label:gt.bar.redo,disabled:Boolean(Gn)||!et.hasFuture,onClick:()=>et.forward(),children:/* @__PURE__ */Nn(bn,{})}),
38
- /* @__PURE__ */Nn(De,{}),
39
- /* @__PURE__ */Nn(He,{devices:jt,value:Ft,onChange:Vt})]}),
40
- /* @__PURE__ */In(Fe,{kind:"right",style:{minWidth:300},children:[
41
- /* @__PURE__ */Nn(Tn,{saveState:Dn,notSaving:Boolean(Gn)||null!=Hn,readOnlyReason:Yn,toggle:Jn,onToggle:Un,onRetry:Wn,words:gt.bar,saveWords:St}),Po.barLead?.(),
42
- /* @__PURE__ */Nn(Sn,{content:gt.bar.refreshTip,side:"bottom",children:/* @__PURE__ */Nn(vn,{variant:"secondary",onClick:()=>{_t.current=(()=>{const e=eo?.document;if(!e)return null;const n=$r.findIndex(ft),t=n>=0?n:$r.length;let o=null;for(let n=0;n<t;n++){const t=$r[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${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=nt?.props?.id??$r[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Qt(e=>e+1)},children:gt.bar.refresh})}),Po.barTrail?.(),Po.barMain?Po.barMain():/* @__PURE__ */Nn(vn,{variant:"primary",disabled:null!==Yn,onClick:()=>{Vn(_n.data)},children:gt.done})]})]}),
43
- /* @__PURE__ */Nn(z,{}),
44
- /* @__PURE__ */In("div",{className:"sf-body",children:[$t?/* @__PURE__ */In(Pn,{children:[
45
- /* @__PURE__ */Nn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":gt.leftPanel,children:to?/* @__PURE__ */Nn(P,{blocks:Hl,blocksOnly:Wl,at:lo?{label:(e=>{const n=pl(e.zone);if(n)return gt.add.addingTo({name:Vo.rowName?Oi(n,!0):Fr(n.type)});if(e.zone===le){const n=$r[e.index];return n&&!ft(n)?gt.add.addingBefore({name:Oi(n,!0)}):gt.add.addingAtEnd}const t=hl(e.zone);return t?gt.add.addingTo({name:t.parentName}):gt.add.addingHere})(lo),onClear:()=>so(null)}:void 0,onAdd:e=>{const n=ko,t=(e,n)=>{lo&&so({zone:e,index:n})};if(n&&"block"!==e.kind&&pl(n.zone))return Ci(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===So)return void wi(e);const n=wi(e,So);lo&&ao(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===So)return void xi(e,n);const t=xi(e,n,So);lo&&ao(t+1)})(e.template.name,Rr(e.template.node));if(n&&n.zone!==le){const o=hl(n.zone);if(!o)return;return o.target.spec?Xi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ki(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Fl?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:yl,siteWide:Po.addPanelRow?.(Bi),onClose:Bi,onHide:Cr,readOnly:Boolean(Gn)}):Wt&&Dt?
46
- /* @__PURE__ */Nn(A,{panel:Dt,pick:Wt,onHide:Cr}):Jl?Jl.panel({onHide:Cr,notify:pr}):"media"===$o&&Dt?/* @__PURE__ */Nn(A,{panel:Dt,pick:null,onHide:Cr}):/* @__PURE__ */In(Pn,{children:[
47
- /* @__PURE__ */Nn(T,{icon:/* @__PURE__ */Nn(Ae,{}),title:gt.layers,context:bt,actions:il.length>0?/* @__PURE__ */Nn(We,{label:ll?gt.expandAll:gt.collapseAll,onClick:()=>er(e=>{const n=new Set(il);return ll?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...il])}),children:/* @__PURE__ */Nn($n,{expand:ll})}):void 0,onHide:Cr}),
48
- /* @__PURE__ */In(Be,{className:"sf-tree sf-scroll",words:yt,children:[
49
- /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:"page",size:13}),name:gt.pageSettings,onSelect:Pr,selected:!nt&&mo,rowProps:{onClick:Ni(Pr)}}),tl&&/* @__PURE__ */In(Pn,{children:[
50
- /* @__PURE__ */Nn(Ce,{children:gt.header}),Ml(tl)]}),!To&&Qn&&/* @__PURE__ */In(Pn,{children:[
51
- /* @__PURE__ */Nn(Ce,{children:gt.header}),!ht&&/* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:"header",size:13}),name:gt.header,onSelect:Tr,selected:fo.kind===pt?.kind,rowProps:{onClick:Ni(Tr)}})]}),!To&&nl&&_l(nl,el,"header"),!To&&!Xl&&/* @__PURE__ */Nn(Ce,{children:Kl}),Xl?/* @__PURE__ */In(Pn,{children:[
52
- /* @__PURE__ */Nn(be,{words:yt,icon:null,name:Kl,fold:{open:!Zl,label:Kl,onToggle:()=>sr(Mn)}}),!Zl&&/* @__PURE__ */Nn(ze,{children:Ql})]}):Ql,Qn&&/* @__PURE__ */Nn(Ce,{children:gt.footer}),qi&&_l(qi,_i,"footer"),!To&&!qi&&Qn&&/* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Ho,{type:"footer",size:13}),name:gt.footer,onSelect:Ii,rowProps:{onClick:Ni(Ii),title:gt.editFooter}}),ol&&Ml(ol),Po.treeFoot?.()]})]})}),
53
- /* @__PURE__ */Nn(Ue,{side:"left",width:nr.left,min:Ye,max:Ge,defaultWidth:k.left,label:gt.resizeLeftPanel,onResize:rr})]}):/* @__PURE__ */Nn($,{side:"left",onShow:Cr}),
54
- /* @__PURE__ */In("div",{ref:ur,className:"sf-center sf-scroll","data-sf-canvas-head":yr?"":void 0,style:{overflowX:br?"auto":"hidden",overflowY:"hidden"},children:[yr&&/* @__PURE__ */Nn("div",{ref:kr,className:"sf-canvas-head",children:/* @__PURE__ */Nn(yr,{device:Ft})}),
55
- /* @__PURE__ */Nn("div",{className:"sf-frame-scaler",style:zr,children:/* @__PURE__ */Nn("div",{className:"sf-frame "+(Ft===Et?"":`sf-frame--${Ft}`),style:Br,children:/* @__PURE__ */In("div",{className:"sf-preview-host",children:[
56
- /* @__PURE__ */Nn(zt,{},Zt),
57
- /* @__PURE__ */Nn(_e,{canvas:eo,session:yl,model:zl,measure:Cl,canDrop:Nl,onDrop:Pl,onPick:$l,onZoneAdd:e=>{const n=sn(e),t=Xr(n);t&&Qr(t.node,t.slot,!1),zi(n,0)},zoneAddLabel:gt.canvasAddBlock,words:kt.canvas,readOnly:Boolean(Gn),revision:_n.data}),po.length>0&&/* @__PURE__ */Nn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:po.map(e=>/* @__PURE__ */In("button",{type:"button",tabIndex:-1,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},onClick:()=>bi(e.index),children:[
58
- /* @__PURE__ */Nn("span",{className:"sf-preview-gap-line"}),
59
- /* @__PURE__ */In("span",{className:"sf-preview-gap-pill",children:[
60
- /* @__PURE__ */Nn("span",{className:"sf-preview-gap-plus",children:"+"}),
61
- /* @__PURE__ */Nn("span",{className:"sf-preview-gap-label",children:gt.addSection})]})]},e.index))})]})})})]}),At?/* @__PURE__ */In(Pn,{children:[
62
- /* @__PURE__ */Nn(g,{value:{selectChild:Ji,addChild:Xi,childRowName:ti,blockRowName:sl},children:/* @__PURE__ */Nn(Bt,{mode:fo,onOpenWebsiteSettings:Po.openSettings??(()=>{}),onOpenSiteStyles:Po.openStyles,onSelectNode:Yo,onNotify:pr,onHidePanel:Or,nodeActions:nt?se(ot,nt.type):Rn})}),
63
- /* @__PURE__ */Nn(Ue,{side:"right",width:nr.right,min:Ye,max:Ge,defaultWidth:k.right,label:gt.resizeSettingsPanel,onResize:ir})]}):
64
- /* @__PURE__ */Nn($,{side:"right",onShow:Or})]}),ai.menu]})}))}export{En as ScreenChrome};
1
+ import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-7P6IFCR4.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-J2JBETVO.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-42TMLDSQ.js";import{usePartBridge as v}from"./chunk-OFNXIZEP.js";import{useSectionOps as w}from"./chunk-FRGCTHDB.js";import{useNodeClipboard as x,useNodeContextMenu as b}from"./chunk-MTRFMGBO.js";import{PageEditGuardNotices as z}from"./chunk-2I7MAA2U.js";import{useScreenDocument as B}from"./chunk-WZMU646D.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as I}from"./chunk-V7U33NF2.js";import{AddChildRow as N}from"./chunk-5545A3PC.js";import{AddSidePanel as T}from"./chunk-QVWPI2FL.js";import{SidePanelHead as P,PanelShowStrip as $}from"./chunk-5SOSVTVI.js";import{MediaSidePanel as A}from"./chunk-ZN752E2O.js";import{useScreenSaveSwitch as M,useScreenNodeKeys as j,useScreenPinned as R,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as F,useScreenDevices as V,useScreenPickFollowsSelection as D,useScreenLeftView as H,useScreenAdd as W,SELECTION_MODE as U,sameInspectorMode as G,useScreenBridges as Y,useScreenBlockRules as J,useScreenBlockLook as X,useScreenStorageNamespace as K,useScreenNotify as Q,useScreenCanvasHead as _,isSlotMode as Z,useScreenStyleClipboard as q,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-55IKQFBW.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-MCHMF32I.js";import{useEasel as we,useEaselApi as xe}from"./chunk-PDZXAFNX.js";import{TreeRow as be,Subtree as ze,LayersTree as Be,TreeGroupLabel as Ce,TreeRowAction as Oe,TreeSeam as Ie}from"./chunk-UFY6RNMT.js";import{DEFAULT_TREE_WORDS as Ne}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Te}from"./chunk-WK3AFPXY.js";import{toItemSelector as Pe,useNodeOps as $e}from"./chunk-QASZFO4S.js";import{LayersIcon as Ae,MediaIcon as Me}from"./chunk-4VJATVVR.js";import{DEFAULT_SAVE_WORDS as je,saveIndicator as Re}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Ee,TopBarRail as Le,TopBarCluster as Fe,EaselIconButton as Ve,TopBarDivider as De,DeviceSwitch as He,InspectorIconButton as We,PanelResizeHandle as Ue,MAX_PANEL_W as Ge,MIN_PANEL_W as Ye,panelWidthVars as Je,SaveState as Xe,SaveStateToggle as Ke}from"./chunk-GTDLBUOC.js";import{DEFAULT_CHROME_WORDS as Qe}from"./chunk-Y2G7CU6A.js";import{useWords as _e}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as Ze}from"./chunk-6HHHBBSY.js";import{DEFAULT_DRAG_WORDS as qe}from"./chunk-O2NLQBFX.js";import{createDragSession as en,useTreeDrag as nn,gapToMoveIndex as tn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as on,BLOCK_SELECTOR as rn,useCanvasEvent as ln}from"./chunk-PAELDYYS.js";import{zoneKey as sn,ROOT_ID as dn,ROOT_SLOT as cn,parseZoneKey as an,DataError as pn}from"./chunk-KRXQM65X.js";import{useRef as un,useMemo as fn,useState as hn,useEffect as mn,useCallback as gn,useLayoutEffect as yn,Fragment as kn}from"react";import{Tooltip as Sn,Button as vn,toast as wn}from"efficient-shell/ui";import{UndoIcon as xn,RedoIcon as bn,TrashIcon as zn,EyeOffIcon as Bn,EyeIcon as Cn,DuplicateIcon as On}from"efficient-shell/icons/efficient";import{jsx as In,jsxs as Nn,Fragment as Tn}from"react/jsx-runtime";function Pn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i,words:l,saveWords:s}){if(null!==t)/* @__PURE__ */return In(Xe,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
2
+ return In(Xe,{tone:e.pending?"off-unsaved":"off",label:l.notSaving,role:"status"});const{tone:d,label:c}=Re(e,s),a=e.failed&&!e.paused&&/* @__PURE__ */In(vn,{variant:"secondary",size:"sm",onClick:i,children:l.retry});/* @__PURE__ */
3
+ return Nn(Tn,o?{children:[
4
+ /* @__PURE__ */In(Ke,{pressed:e.paused,onToggle:r,title:e.paused?l.autoSaveOff:l.autoSaveOn,children:/* @__PURE__ */In(Xe,{tone:d,label:c})}),a]}:{children:[
5
+ /* @__PURE__ */In(Xe,{tone:d,label:c,role:"status"}),a]})}function $n({expand:e}){/* @__PURE__ */
6
+ return In("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Nn(Tn,e?{children:[
7
+ /* @__PURE__ */In("path",{d:"M8 9l4-4 4 4"}),
8
+ /* @__PURE__ */In("path",{d:"M8 15l4 4 4-4"})]}:{children:[
9
+ /* @__PURE__ */In("path",{d:"M8 4l4 4 4-4"}),
10
+ /* @__PURE__ */In("path",{d:"M8 20l4-4 4 4"}),
11
+ /* @__PURE__ */In("path",{d:"M5 12h14"})]})})}function An(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var Mn="__rungs";var jn="screen:band",Rn={duplicate:!0,delete:!0};function En(){const Re=ye(),{target:Xe,docId:Ke,capabilities:En,currentSlug:Ln,siteId:Fn,onPublish:Vn,saveState:Dn,saveConflict:Hn,retrySave:Wn,toggleAutoSave:Un,readOnly:Gn,readOnlyReason:Yn=null}=B(),Jn=M(),Xn=j(),{mediaEditing:Kn,hasEditGuard:Qn,hasPinnedChrome:_n}=En,{appState:Zn,dispatch:qn,history:et,selectedItem:nt,getSelectorForId:tt,config:ot}=we(e=>e),rt=R(),{first:it,firstGroup:lt,lastGroup:st,isSectionGroup:dt,sectionGroupZone:ct,panelOf:at}=rt,pt=at(it),ut=e=>oe(rt,e),ft=e=>re(rt,e),ht="node"===rt.firstRow,mt=rt.band??null,gt=_e("screen",ve),yt=_e("tree",Ne),kt=_e("drag",qe),St=_e("save",je),vt=_e("menu",Te),wt=_e("styleClipboard",Se),xt=_e("chrome",Qe),bt=E()??`/${Ln}`,zt=L(),Bt=F(),Ct=w({readOnly:Gn}),Ot=w({readOnly:Gn,foldIntoHistory:!0}),It=un(null),Nt=xe(),Tt=fn(()=>({...Ct,select:e=>{It.current=e,Ct.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Nt.config;It.current=Pe(e,t,n)}Ct.commitDocument(e,n)}}),[Ct,Nt]),Pt=Zn.ui,$t=Pt.leftSideBarVisible,At=Pt.rightSideBarVisible,{options:Mt,widths:jt,initial:Rt,fluid:Et,fit:Lt}=V(),[Ft,Vt]=hn(Rt),Dt=he(),Ht=Kn&&null!==Dt,Wt=me(),Ut=ge();D(nt?.props.id);const{read:Gt,write:Yt,forSelection:Jt}=H(),[Xt,Kt]=hn(Gt);mn(()=>{Yt(Xt)},[Xt]);const[Qt,_t]=hn(0),Zt=un(null),qt=un(null),eo=on(qt,{readySelector:rn}),no=f(qt);h(qt,eo);const[to,oo]=hn(!1),ro=un(!1),io=un(!1),[lo,so]=hn(null),co=W(),ao=e=>so(null===e?null:{zone:le,index:e}),[po,uo]=hn([]),[fo,ho]=hn(U),mo="puck"===fo.kind,go=to&&!lo&&co.railTarget?co.railTarget(Zn.data,{node:nt??null,mode:fo}):null,yo=go?{zone:sn(go),index:go.index}:null,ko=lo??yo,So=ko&&ko.zone===le?ko.index:null,vo=t(fo,nt?.props.id),[wo,xo]=hn(null);mn(()=>{wo&&(o(),xo(null))},[wo]);const bo=un(tt);bo.current=tt;const zo=gn((e,{scroll:n})=>{Kt(n=>Jt(e,n)),n&&xo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=bo.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})},[]),Bo=un(null);mn(()=>{const e=Bo.current;Bo.current=null;const n=null==nt?.props.id?null:String(nt.props.id);ho(e&&e.id===n?e.mode:at(nt?.type)??U);const t=nt?.props.id,o=It.current;if(It.current=null,!t)return;const i=tt(t);zo(String(t),{scroll:!r(o,i??null,le)})},[nt?.props.id,zo]);const Co=gn(e=>{ho(n=>G(n,e)?n:e),qn({type:"setUi",ui:{rightSideBarVisible:!0}})},[qn]),Oo=un(()=>{});Oo.current=(e,n)=>{const t=e?Gr(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==nt?.props.id?null:String(nt.props.id);ho(e=>G(e,n)?e:n),o!==r&&(Bo.current={id:o,mode:n},Tt.select(e))};const Io=gn((e,n)=>Oo.current(e,n),[]),No={kind:fo.kind,mode:fo,open:Co,show:e=>ho(e),reveal:()=>{At||qn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Io},To=Y(No,{data:Zn.data,selected:nt??null,zoneOf:e=>tt(e)?.zone,readOnly:Boolean(Gn),select:e=>{ho(U),Tt.select({index:e})},replace:(e,n)=>Tt.replaceComponent(le,e,n),scrollTo:e=>gi(e)},{device:Ft,refreshes:Qt},{setView:Kt,reveal:()=>{$t||qn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Po=To.pinnedSource??!1,$o=To.resolveLeftView?To.resolveLeftView(Xt,Ht):"media"===Xt&&Ht?Xt:"sections",Ao=J(),{isLockedBlock:Mo,duplicateBlocked:jo,nestDepth:Ro,newSectionNode:Eo,canAddTo:Lo,blockIsOffered:Fo}=Ao,Vo=X(),{labelAtLevel:Do,Icon:Ho,useProducts:Wo}=Vo,Uo=Vo.rowName?(e,n,t)=>Vo.rowName(e,n,t):void 0,Go=gn(e=>{qn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),zo(e,{scroll:!0})},[qn,zo]),{selectNode:Yo,openPartId:Jo}=v({mode:fo,setMode:ho,onOpenPart:Go}),[Xo,Ko]=hn(null);ke(null!==Xo,()=>Ko(null));const Qo=y(K()),_o=Qo.collapsed,Zo=Qo.panelWidths,[qo,er]=hn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(_o);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
12
+ return new Set}});mn(()=>{try{window.localStorage.setItem(_o,JSON.stringify([...qo]))}catch{}},[qo]);const[nr,tr]=hn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(Zo);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});mn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Zo,JSON.stringify(nr))}catch{}},300);return()=>clearTimeout(e)},[nr]);const or=gn((e,n)=>tr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),rr=gn(e=>or("left",e),[or]),ir=gn(e=>or("right",e),[or]),lr=e=>qo.has(e),sr=e=>er(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),dr=un(!1),cr=un(null);mn(()=>{if(dr.current&&!to){const e=cr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??qt.current?.querySelector(`button[aria-label="${CSS.escape(gt.add.title)}"]`))?.focus(),cr.current=null}dr.current=to},[to]),mn(()=>{if(!to||!no)return;const e=e=>{"Escape"===e.key&&Bi()};return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[to,no]),ke(to,()=>Bi()),mn(()=>{!$t&&to&&(oo(!1),so(null),ro.current=!1)},[$t]),mn(()=>{if(!Wt)return io.current&&qn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(io.current=!1);to&&(oo(!1),so(null),io.current=ro.current,ro.current=!1),$t||(io.current=!0,qn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Wt]),mn(()=>{!$t&&Wt&&(io.current=!1,Ut())},[$t]),mn(()=>{if(!Wt||!no)return;const e=e=>{"Escape"===e.key&&Ut()};return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[Wt,no]),ke(null!==Wt,()=>Ut());const ar=Q(),pr=(e,n="success")=>{ar?ar(e,"error"===n?"error":"info"):"error"===n?wn.error(e,{duration:3200,sound:!1}):wn.success(e,{duration:1900,sound:!1})},ur=un(null),[fr,hr]=hn(0),[mr,gr]=hn(0),yr=_(),kr=un(null),Sr=e=>Math.max(0,e.clientHeight-(kr.current?.offsetHeight??0));mn(()=>{const e=ur.current;if(!e)return;const n=()=>{hr(e.clientWidth),gr(Sr(e))};n();const t=new ResizeObserver(n);return t.observe(e),kr.current&&t.observe(kr.current),()=>t.disconnect()},[]),yn(()=>{ur.current&&(hr(ur.current.clientWidth),gr(Sr(ur.current)))},[nr,$t,At]);const vr=Ft===Et?fr>0?fr:jt[Et]:jt[Ft],wr=fr>0?Math.min(fr/vr,"shrink"===Lt?1:2):1,xr=vr*wr,br=fr>0&&xr>fr+1,zr={width:xr,height:mr||"100%",flex:"none",position:"relative"},Br={width:vr,height:mr?mr/wr:"100%",maxHeight:"none",transform:1!==wr?`scale(${wr})`:void 0,transformOrigin:"top left"},Cr=()=>qn({type:"setUi",ui:{leftSideBarVisible:!$t}}),Or=()=>qn({type:"setUi",ui:{rightSideBarVisible:!At}}),Ir=e=>{to&&(oo(!1),so(null),ro.current=!1,$t&&Xt===e)||Wt&&(io.current=!1,Ut(),$t&&Xt===e)||($t&&Xt===e?Cr():(Kt(e),$t||qn({type:"setUi",ui:{leftSideBarVisible:!0}})))},Nr=()=>{C(Re,{accept:"image/*",title:xt.mediaLibrary})},Tr=()=>{ho(U),Tt.select(null),u()},Pr=()=>{ho(pt??U),At||qn({type:"setUi",ui:{rightSideBarVisible:!0}})},$r=Zn.data.content??[],Ar=()=>{const e=$r.findIndex(ut),n=$r.findIndex(ft);return{floor:e>=0?e+1:0,cap:n>=0?n:$r.length}},Mr=ot,jr=Ao.stripCopy,Rr=e=>i(e,jr),Er=x(),Lr=$e({data:Zn.data,config:Mr,readOnly:Boolean(Gn),clipboard:Er,strip:jr?e=>jr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==dn||e.slot!==cn)return{min:0,max:n-1};const{floor:t,cap:o}=Ar();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&ho(U);const t=void 0===n||"node"===n?.kind?n:null;Tt.commitDocument(e,t)}}),Fr=e=>Do(e,"block",ot.components[e]?.label??e),Vr=gn(e=>ot.components[e]?.defaultProps??{},[ot]),Dr=e=>Do(e,"section",Fr(e)),Hr=e=>l({type:e.type,props:e.props??{}},Dr(e.type),Uo),{nodeAddresses:Wr,zoneItems:Ur}=fn(()=>{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>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(ot,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t($r,le,0),{nodeAddresses:e,zoneItems:n}},[$r,ot]),Gr=gn(e=>Ur.get(e)??[],[Ur]),Yr=e=>{const n=Wr.get(e);return n?Gr(n.zone)[n.index]:void 0},Jr=e=>ie(Ao,ot,e),Xr=e=>{if(!Ao.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Yr(e.slice(0,n));if(!t)return null;const o=Jr(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}},Kr=(()=>{if(!Z(fo))return null;const e=`${fo.nodeId}:${fo.slot}`;return Xr(e)?.slot.panel===fo.kind?e:null})(),Qr=un(null);mn(()=>{const e=Qr.current;if(Qr.current=null,!Kr||!Z(fo))return;const n=fo.nodeId;zo(n,{scroll:e!==Kr}),er(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[fo]);const _r=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Wr.get(e);n&&(n.zone===le?yi(n.index):Ji(n.zone,n.index,e,Yr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Kr!==i&&(Qr.current=i),Io(null,r),At||qn({type:"setUi",ui:{rightSideBarVisible:!0}}),gi(o)},Zr=(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;Kr!==o&&(Qr.current=o);Io(null,{kind:t,nodeId:e,slot:n})},qr=(e,n,t)=>{if(Gn||!Ao.moveSlot)return;const o=Yr(e),r=o?Jr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Mn,index:n},s=tn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=Ao.moveSlot(e,n,s);"string"==typeof d&&Zr(e,d,i.panel)},ei=Wo(),ni=fn(()=>{const e=/* @__PURE__ */new Map;for(const n of ei??[])e.set(n.slug,n.name);return e},[ei]),ti=e=>s(e,Fr,Vo.plainText,e=>ni.get(e),Vo.rowName),oi=(e,n)=>{const t=ot.components[e.type]?.fields,o=n===le||pl(n)?"section":"block",r=n===le&&(ut(e)||ft(e)||dt(e.type)),i="block"===o?d(t):r?null:c(t);return Vo.renamePropOf?Vo.renamePropOf(e,o,i):i},ri=(e,n,t,o)=>{if(!(!Gn&&Xo?.zone===e&&Xo.index===n))return;const r=(t,o)=>{Ko(null),o&&((e,n,t)=>{const o=Gr(e)[n];if(!o)return;const r=oi(o,e);r&&Tt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
13
+ return In("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":gt.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)},ii=n(q(),wt),li=ii.scope({target:Xe,siteId:Fn,docId:Ke}),si=ot,di=(e,n)=>n===le?Dr(e):Fr(e),ci=(e,n,t)=>{const o=ii.plan(li,t,di(t.type,e),si);o&&(o.changed&&Tt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),pr(o.message))},ai=b({nodesIn:Gr,nodeAt:(e,n)=>Gr(e)[n]??null,labelOf:(e,n)=>n===le?Dr(e):Fr(e),renamePropOf:oi,beginRename:(e,n)=>Ko({zone:e,index:n}),history:{hasPast:et.hasPast,hasFuture:et.hasFuture,back:()=>et.back(),forward:()=>et.forward()},openAddSection:()=>{Tt.select(null),bi(null)},openPageSettings:()=>{Tt.select(null),ho(U)},pageSettingsLabel:gt.pageSettings,words:{menu:vt,styleClipboard:wt,screen:gt.menu},readOnly:Boolean(Gn),collapseAll:()=>er(new Set(Gr(le).map(e=>String(e.props.id)))),onPasteRefused:e=>pr(e?gt.pasteRefused({name:e.label}):gt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>fl(e,n),menuRows:To.menuRows,isLocked:e=>Mo(e.type),duplicateBlocked:e=>jo(Zn.data,e),permits:e=>se(ot,e.type),canAddTo:Lo,nodeOps:Lr,isPinned:(e,n)=>n===le&&(ut(e)||ft(e)),sectionBand:Ar,openAddInside:(e,n)=>{e===le?yi(n):Tt.select({zone:e,index:n}),bi(null)},locate:e=>Wr.get(e)??null,rowNameOf:(e,n)=>n===le?Hr(e):ti(e),selectAt:(e,n,t,o)=>{e===le?yi(n):Ji(e,n,t,o??"")},slotRung:e=>{const n=Xr(e);return n?.slot.panel?{label:n.slot.label,select:()=>_r(n.node,n.slot,!1)}:null},style:{held:()=>O(li),canCopy:e=>ii.rows(si,e).some(e=>!1!==e.counted),copy:(e,n)=>ii.copy(li,e,di(e.type,n),si),paste:(e,n,t)=>ci(e,n,t)},keys:Xn?{target:no,selected:()=>{const e=Zn.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Er.get(),readOnly:Boolean(Gn),onDone:({done:e,name:n})=>{"copied"===e&&pr(gt.copied({name:n}))}}:void 0},eo),pi=un({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});mn(()=>{pi.current={copy:(e,n)=>ii.copy(li,e,di(e.type,n),si),paste:ci,at:()=>{const e=Zn.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Gr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Gn)}});const ui=gn(e=>{const n=I(e);if(!n)return;const t=pi.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))},[]);mn(()=>{if(!no)return;const e=e=>ui(e);return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[ui,no]),ln(eo,"keydown",ui);const fi=$r.map(e=>e.props.id).join("|");mn(()=>{const e=eo?.document??null,n=eo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void uo(e=>e.length?[]:e);const n=$r.findIndex(ft),t=n>=0?n:$r.length,o=n=>{const t=$r[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(rn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=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=An(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}uo(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()}},[eo,fi,Ft,wr,$t,At,nt?.props.id]);const hi=eo?.document??null,mi=eo?.window??null;mn(()=>{const e=Zt.current;if(!e||!hi||!mi)return;const n=[],t=()=>{const n=hi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&mi.scrollTo({left:mi.scrollX,top:mi.scrollY+t,behavior:"instant"}),!0};return Zt.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[hi,mi]);const gi=e=>{To.holdCanvasOn?To.holdCanvasOn(e):a(e)},yi=e=>{ho(U),Tt.select({index:e}),To.sectionPressed?.($r[e]);const n=$r[e]?.props?.id;n&&gi(n)},ki=e=>{const{floor:n,cap:t}=Ar(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=nt&&fo.kind!==pt?.kind?$r.findIndex(e=>e.props.id===nt.props.id):-1;return o(r>=0?r+1:t)},Si=(e,n)=>{const{floor:t,cap:o}=Ar(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(Tt.reorderComponent(le,e,i),Tt.select({index:i}),{moved:!0,dest:i})},vi=(e,n,t,o)=>{ho(U),Tt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),pr(gt.sectionAdded({name:t}))},wi=(e,n)=>{const t=ki(n),o=Eo(e,{nodeDefaults:Vr,newNodeId:fe,sectionLabel:Dr,blockIsOffered:Fo}),r=o?Tt.insertNode(le,t,o):Tt.insertSection(e,t);return vi(t,r,Dr(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:c}of ce(ot,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Lo(e.type,l,d.slice(d.lastIndexOf(":")+1)),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:c,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},xi=(e,n,t)=>{const o=ki(t),r=Tt.insertNode(le,o,n);return vi(o,r,e),o},bi=e=>zi(le,e),zi=(e,n)=>{cr.current=document.activeElement??null,Wt&&(ro.current=io.current,io.current=!1,Ut()),so(null===n?null:{zone:e,index:n}),oo(!0),$t||(ro.current=!0,qn({type:"setUi",ui:{leftSideBarVisible:!0}}))},Bi=()=>{oo(!1),so(null),ro.current&&qn({type:"setUi",ui:{leftSideBarVisible:!1}}),ro.current=!1},Ci=(e,n,t)=>{if("section"===e.kind)Tt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;Tt.insertNode(n,t,Rr(e.template.node))}ho(U),Tt.select({index:t,zone:n})},Oi=(e,n)=>Vo.rowName?n?ut(e)?Vo.rowName(e,"section",gt.header):ft(e)?Vo.rowName(e,"section",gt.footer):dt(e.type)?Vo.rowName(e,"section",Fr(e.type)):Hr(e):ti(e):n?Dr(e.type):Fr(e.type),Ii=e=>n=>{e()},Ni=()=>To.editPinnedSource?.(),Ti=(e,n,t)=>{if(Gn)return null;const o=Gr(e)[n];return o&&!se(ot,o.type).delete?null:/* @__PURE__ */In(Oe,{kind:"delete",label:gt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Gr(e)[n]?.props?.id;null!=t&&Lr.remove(String(t))})(e,n),children:/* @__PURE__ */In(zn,{size:15})})},Pi=e=>Vo.rowPreview?.(e)||void 0,$i=e=>Vo.rowMarks?.(e)??void 0,Ai=(e,n,t)=>Vo.rowActions?.(e,n,t)??null,Mi=(e,n,t,o)=>{if(Gn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
14
+ return In(Oe,{kind:"eye",label:r?gt.showNamed({name:o}):gt.hideNamed({name:o}),onClick:()=>Ri(e,n,t),children:/* @__PURE__ */In(r?Bn:Cn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},ji=e=>{const n=Dr($r[e]?.type??""),t=n?gt.addSectionBefore({name:n}):gt.addSectionHere;return Al(le,e,()=>bi(e),t)},Ri=(e,n,t)=>{Tt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Ei=e=>ae(ot,e),Li=e=>ce(ot,e),Fi=e=>Ao.slotsOf?Jr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Li(e)}],Vi=e=>Ao.slotsOf?Fi(e).flatMap(e=>e.kids):Li(e),Di=e=>Boolean(Ao.slotsOf)&&Jr(e).some(e=>e.rung),Hi=(e,n,t)=>null===t?void 0===n?Lo(e):Lo(e,n):Lo(e,n,t),Wi=(e,n,t)=>{const o=ue(ot,e.type,n)&&(t||Vi(e).length>0||Di(e));return{collapsible:o,folded:o&&lr(String(e.props.id))}},Ui=(e,n,t)=>Fi(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Wi(e,r,t(e.type)).collapsible?[String(e.props.id),...Ui(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Gi=e=>Vi(e).length>0||Di(e)||Boolean(Lo(e.type)),Yi=e=>Boolean(Lo(e)),Ji=(e,n,t,o)=>{if(ho(U),Lo(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),Tt.select({index:n,zone:e}),a(t)}else Tt.select({index:n,zone:e}),gi(t)},Xi=(e,n,t,o,r)=>{const i=`${e}:${n}`;Tt.insertComponent(i,t,o),Lo(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),Tt.select({index:o,zone:i})}):Tt.select({index:o,zone:i})},Ki=(e,n,t)=>{Tt.insertComponent(e,n,t),ho(U),Tt.select({index:t,zone:e})},Qi=un(/* @__PURE__ */new Set);mn(()=>{$r.forEach(e=>{const n=Lo(e.type)?.spec;if(!n)return;const t=e.props.id;if(Qi.current.has(t))return;Qi.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(Vr)).forEach((e,t)=>Ot.seedChild(o,t,n.childType,e))})},[$r,Ot,Vr]);const _i=un(/* @__PURE__ */new Set);mn(()=>{$r.forEach((n,t)=>{const o=n.props.id;if(_i.current.has(o))return;const r=e(n,Ei(n.type));_i.current.add(o),r&&Ot.replaceComponent(le,t,{...n,props:r})})},[$r,Ot]),ee(Ot,ot);const Zi=$r.findIndex(ft),qi=Zi>=0?$r[Zi]:null,el=ht?$r.findIndex(ut):-1,nl=el>=0?$r[el]:null,tl=$r.find(e=>e.type===lt)??null,ol=$r.find(e=>e.type===st)??null,rl=Zi>=0?Zi:$r.length,il=[];$r.forEach(e=>{ft(e)||(Gi(e)&&il.push(String(e.props.id)),il.push(...Ui(e,1,Yi)))}),qi&&(il.push(String(qi.props.id)),il.push(...Ui(qi,1,Yi)));const ll=il.length>0&&il.every(e=>qo.has(e)),sl=e=>{const n=Vo.blockRowName(e,Fr);return Vo.rowName?Vo.rowName(e,"block",n):n},dl=(e,n,t,o)=>{const r=Gr(e)[t];if(!r)return;const i={...an(e),index:t},l={...an(n),index:Math.min(Math.max(o,0),Gr(n).length)},s=tn(i,l);if(e!==n||s!==t)try{Lr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof pn))throw e}},cl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Li(e))n.add(r),t(o)};for(const t of Ei(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},al=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Wr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},pl=e=>{const n=e.slice(0,e.indexOf(":")),t=$r.find(e=>dt(e.type)&&String(e.props.id)===n);return t&&ct(n)===e?t:null},ul=(e,n,t)=>{if(e.rung){const t=Yr(e.rung.nodeId),o=t?Jr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Mn&&n.index>=0&&n.index<=o}if(n.slot===Mn)return!1;if(e.add)return ml(e.add,n);const o=sn(n);if(dt(e.type))return!1;const r=pl(o),i=pl(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Gr(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=Ar();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Gr(o).length)return!1;if(e.zone===o)return!0;const l=qi&&!rt.lastIsOpen?String(qi.props.id):null;return(!l||al(e.zone)!==l&&al(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Gr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Wr.get(i),s=l?Gr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&cl(r).has(n))return!1;const d=Lo(s.type,Ro(Zn?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Gr(n),r))})(e.zone,o,e.index,t)},fl=(e,n)=>{const t=sn(e.from);if(t===sn(n))return!0;const o=e.node;return ul({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},hl=e=>{const n=e.slice(0,e.indexOf(":")),t=Wr.get(n),o=t?Gr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Lo(o.type,Ro(Zn?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:Fr(r.spec.childType)}]:[]),l=Xr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Oi(o,t.zone===le)}},ml=(e,n)=>{const t=sn(n);if("block"!==e.kind){if(pl(t))return n.index>=0&&n.index<=Gr(t).length;if(t!==le)return!1;const{floor:e,cap:o}=Ar();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=hl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Gr(t))},gl=(e,n)=>{e.rung?qr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&pl(sn(n)))return void Ci(e,sn(n),n.index);if("section"===e.kind)return void wi(e.type,n.index);if("template"===e.kind)return void xi(e.template.name,Rr(e.template.node),n.index);const t=sn(n),o=hl(t);o&&(o.target.spec?Xi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ki(t,e.type,n.index))})(e.add,n):e.zone===le?Si(e.index,n.index):dl(e.zone,sn(n),e.index,n.index)},[yl]=hn(()=>en()),kl=nn({keyOf:e=>e.id,readOnly:Boolean(Gn),session:yl,canDrop:ul,onDrop:gl,onStep:(e,n)=>{e.rung?qr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Dr($r[e]?.type??""),o=Si(e,n<0?e-1:e+2);if(!o.moved)return void pr(n<0?gt.sectionFirst({name:t}):gt.sectionLast({name:t}));const{floor:r,cap:i}=Ar();pr(gt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):dl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Sl=gn(e=>{const{floor:n,cap:t}=Ar(),o=[];for(const r of e.nodes){const e=sn(r.place),i=Gr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(ut(i)||ft(i)||Mo(i.type))continue;if(dt(i.type))continue;const l=Boolean(pl(e)),s=e===le||l;e===le&&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?Dr(i.type):ti(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(hl(sn(e.list))?.choices.length)||Boolean(pl(sn(e.list))))}},[Zn.data]),vl=e=>{ho(U),Tt.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},wl=ne(),xl=()=>({data:Zn.data,device:Ft,ops:Tt,inspector:No}),bl=wl?.model,zl=fn(()=>bl?e=>bl(e,Sl(e),xl()):Sl,[bl,Sl,Ft]),Bl=wl?.measure,Cl=Bl?(e,n)=>Bl(e,n,xl()):void 0,Ol=wl?.canDrop,Il=Ol?(e,n)=>Ol(e,n,ul,xl()):ul,Nl=wl?.drop,Tl=Nl?(e,n)=>Nl(e,n,gl,xl()):gl,Pl=wl?.pick,$l=Pl?e=>Pl(e,vl,xl()):vl,Al=(e,n,t,o)=>/* @__PURE__ */In(Ie,{...Gn?{}:kl.seam({place:{...an(e),index:n}}),onAdd:Gn?void 0:t,label:o},`seam:${e}:${n}`),Ml={rowClick:Ii,isCollapsed:lr,toggleCollapse:sr},jl=e=>{const n=String(e.props.id),t=$r.findIndex(e=>String(e.props.id)===n),o=ct(n),r=Gr(o),i=lr(n),l=Fr(e.type),s=Vo.rowName?Vo.rowName(e,"section",l):l,d=e=>Al(o,e,()=>zi(o,e),gt.addSectionHere);/* @__PURE__ */
15
+ return Nn(Tn,{children:[
16
+ /* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:e.type,size:13}),name:s,preview:Pi(e),marks:$i(e),onSelect:()=>yi(t),nameSlot:ri(le,t,n,s),selected:vo===n,actions:Ai(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:Ii(()=>yi(t))},fold:{open:!i,label:"section",onToggle:()=>sr(n)}}),!i&&/* @__PURE__ */Nn(ze,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Hr(n),l=Gi(n),s=l&&lr(r),c=()=>Ji(o,t,r,e.type),{rowProps:a,...p}=kl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...an(o),index:t}},{"data-node-id":r,onClick:Ii(c)});/* @__PURE__ */
17
+ return Nn(kn,{children:[d(t),
18
+ /* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:n.type,size:13}),name:i,preview:Pi(n),marks:$i(n),onSelect:c,nameSlot:ri(o,t,r,i),selected:vo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>sr(r)}:void 0,actions:/* @__PURE__ */Nn(Tn,{children:[Ti(o,t,i),Ai(n,o,t),Mi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */In(ze,{children:Ll(n,2)})]},r)}),d(r.length)]})]})},Rl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=kl.dragging,d=!lr(l)&&s?.rung?.nodeId!==i,c={...an(l),index:0},a=s&&!s.rung&&ul(s,c)?c:void 0,p=()=>_r(e,n,!0),{rowProps:u,...f}=kl.row({item:{id:`rung:${l}`,zone:`${i}:${Mn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Mn,index:t},into:a,canDrag:Boolean(Ao.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Ii(p)}),h=Gn?null:Ao.slotActions?.(e,n.slot);/* @__PURE__ */
19
+ return Nn(kn,{children:[n.heading,
20
+ /* @__PURE__ */In(be,{words:yt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Kr===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>sr(l)},actions:h&&h.length>0?/* @__PURE__ */In(Tn,{children:h.map((t,o)=>/* @__PURE__ */In(Oe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Gn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Zr(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__ */In(zn,{size:15}):/* @__PURE__ */In(On,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */In(ze,{children:r})]},l)},El=(e,n)=>{const t=Fi(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
21
+ return In(Tn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Hi(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(hl(c)?.choices.length),p=(e,n)=>a?Al(e,n,()=>zi(e,n),gt.addBlockHere):Al(e,n),u=/* @__PURE__ */Nn(Tn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=vo===String(n.props.id),{collapsible:i,folded:s}=Wi(n,l,Yi(n.type)),d=String(n.props.id),c=sl(n),a=()=>Ji(t,o,d,e.type),{rowProps:u,...f}=kl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...an(t),index:o}},{"data-node-id":d,onClick:Ii(a)});/* @__PURE__ */
22
+ return Nn(kn,{children:[0===o&&p(t,0),
23
+ /* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:n.type,size:13}),name:c,preview:Pi(n),marks:$i(n),onSelect:a,nameSlot:ri(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>sr(d)}:void 0,actions:/* @__PURE__ */Nn(Tn,{children:[Ti(t,o,c),Ai(n,t,o),Mi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */In(ze,{children:El(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?Rl(e,t.rung,r++,o,u):/* @__PURE__ */In(kn,{children:u},t.slot??"")})})},Ll=(e,n)=>{const t=Ro(Zn?.data,e.type,String(e.props.id)),o=Fi(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
24
+ return In(Tn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Hi(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>Xi(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>zi(n,t):void 0;return Al(n,t,o,n===f&&c?c.addLabel:gt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Nn(Tn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=vo===String(n.props.id),i=ti(n),l=String(n.props.id),{collapsible:d,folded:c}=Wi(n,s,Yi(n.type)),a=Ei(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...an(p),index:Gr(p).length}:void 0,f=kl.dragging,h=u&&f&&ul(f,u)?u:void 0,g=()=>Ji(t,o,l,e.type),{rowProps:y,...k}=kl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...an(t),index:o},into:h,canDrag:!Mo(n.type)},{"data-node-id":l,onClick:Ii(g)});/* @__PURE__ */
25
+ return Nn(kn,{children:[0===o&&m(t,0),
26
+ /* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:n.type,size:13}),name:i,preview:Pi(n),marks:$i(n),onSelect:g,nameSlot:ri(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>sr(l)}:void 0,actions:Mo(n.type)?Ai(n,t,o)??void 0:/* @__PURE__ */Nn(Tn,{children:[Ti(t,o,i),Ai(n,t,o),Mi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */In(ze,{children:Ll(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
27
+ /* @__PURE__ */In(N,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>Xi(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?Rl(e,o.rung,i++,r,k):/* @__PURE__ */In(kn,{children:k},o.slot??"")})})},Fl=(()=>{if(!nt||!mo)return null;const e=String(nt.type),n=String(nt.props.id),t=Lo(e,Ro(Zn?.data,e,n));if(!t||"footer"===t.source)return null;const o=$r.some(e=>String(e.props?.id)===n),r=Array.isArray(nt.props[t.slot])?nt.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Fr(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:Oi(nt,o),choices:i,onPick:o=>{t.spec?Xi(n,t.slot,o,r.length,e):Ki(`${n}:${t.slot}`,o,r.length)}}})(),Vl=ko&&ko.zone!==le&&!pl(ko.zone)?ko.zone:null,Dl=!0===co.blocksFirst,Hl=Vl?hl(Vl):Dl&&ko?null:Fl,Wl=Boolean(lo&&Vl)||Dl&&Boolean(Hl&&Hl.choices.length>0),Ul=to||null!==Wt,Gl=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:$t&&!Ul&&$o===e.id,onSelect:()=>Ir(e.id)}:e,Yl=[{id:"add",label:gt.add.title,icon:/* @__PURE__ */In("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:to,onSelect:()=>to?Bi():bi(null)},...(To.railLead??[]).map(Gl),{id:"sections",label:gt.layers,icon:/* @__PURE__ */In(Ae,{}),active:$t&&!Ul&&"sections"===$o,onSelect:()=>Ir("sections")},...(To.railTrail??[]).map(Gl)];Ht?Yl.push({id:"media",label:gt.railMedia,icon:/* @__PURE__ */In(Me,{}),active:$t&&!to&&(null!==Wt||"media"===$o),onSelect:()=>Ir("media")}):Kn&&Yl.push({id:"media",label:gt.railMedia,icon:/* @__PURE__ */In(Me,{}),onSelect:Nr});const Jl=[...To.railLead??[],...To.railTrail??[]].find(e=>"panel"in e&&e.id===$o),Xl=Boolean(mt?.foldable)&&!Po,Kl=mt?.label??(Qn?gt.pageSections:gt.templateSections),Ql=Xl&&lr(jn),_l=/* @__PURE__ */Nn(Tn,{children:[$r.map((e,n)=>{if(ut(e)||ft(e)||dt(e.type))return null;const t=vo===String(e.props.id),o=Boolean(e.props._hidden);Li(e);const r=String(e.props.id),i=To.hasOwnRows?.(e)??!1,l=Gi(e)||i,s=l&&lr(r),{rowProps:d,...c}=kl.row({item:{id:r,zone:le,index:n,type:e.type},place:{...an(le),index:n}},{"data-node-id":r,onClick:Ii(()=>yi(n))});/* @__PURE__ */
28
+ return Nn(kn,{children:[n>0&&ji(n),
29
+ /* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:e.type,size:13}),name:Hr(e),preview:Pi(e),marks:$i(e),onSelect:()=>yi(n),nameSlot:ri(le,n,r,Hr(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>sr(r)}:void 0,actions:/* @__PURE__ */Nn(Tn,{children:[Ti(le,n,Hr(e)),Ai(e,le,n),Mi(le,n,e,Hr(e))]}),rowProps:d}),Gi(e)&&!s&&/* @__PURE__ */Nn(ze,{children:[Ll(e,1),To.partRows?.(e,Ml)]}),i&&!s&&/* @__PURE__ */In(ze,{children:To.ownRows?.(e,n,Ml)})]},String(e.props.id??n))}),!Po&&rl>0&&ji(rl),mt?.addAtEnd&&!Po&&!Gn&&/* @__PURE__ */In(N,{small:!0,label:gt.addSection,blocked:null,onAdd:()=>bi(rl)})]}),Zl=(e,n,t)=>{const o=String(e.props.id),r=Vi(e).length>0||Di(e)||Boolean(Lo(e.type)),i=r&&lr(o),l="header"===t?gt.header:gt.footer,s=Vo.rowName?Vo.rowName(e,"section",l):l;/* @__PURE__ */
30
+ return Nn(Tn,{children:[
31
+ /* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:t,size:13}),name:s,preview:Pi(e),marks:$i(e),onSelect:()=>yi(n),nameSlot:ri(le,n,o,s),selected:vo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>sr(o)}:void 0,actions:Ai(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:Ii(()=>yi(n))}}),r&&!i&&/* @__PURE__ */In(ze,{children:El(e,1)})]})};return(To.wrap??(e=>e))(
32
+ /* @__PURE__ */In(te,{target:eo,children:/* @__PURE__ */Nn("div",{ref:qt,className:"sf-editor es-editor",style:Je(nr),onContextMenu:ai.onEditorContextMenu,...m(Re),children:[
33
+ /* @__PURE__ */Nn(Ee,{children:[
34
+ /* @__PURE__ */In(Le,{items:Yl,ariaLabel:gt.bar.views}),
35
+ /* @__PURE__ */Nn(Fe,{children:[
36
+ /* @__PURE__ */In(Ve,{label:gt.bar.undo,disabled:Boolean(Gn)||!et.hasPast,onClick:()=>et.back(),children:/* @__PURE__ */In(xn,{})}),
37
+ /* @__PURE__ */In(Ve,{label:gt.bar.redo,disabled:Boolean(Gn)||!et.hasFuture,onClick:()=>et.forward(),children:/* @__PURE__ */In(bn,{})}),
38
+ /* @__PURE__ */In(De,{}),
39
+ /* @__PURE__ */In(He,{devices:Mt,value:Ft,onChange:Vt})]}),
40
+ /* @__PURE__ */Nn(Fe,{kind:"right",style:{minWidth:300},children:[
41
+ /* @__PURE__ */In(Pn,{saveState:Dn,notSaving:Boolean(Gn)||null!=Hn,readOnlyReason:Yn,toggle:Jn,onToggle:Un,onRetry:Wn,words:gt.bar,saveWords:St}),To.barLead?.(),
42
+ /* @__PURE__ */In(Sn,{content:gt.bar.refreshTip,side:"bottom",children:/* @__PURE__ */In(vn,{variant:"secondary",onClick:()=>{Zt.current=(()=>{const e=eo?.document;if(!e)return null;const n=$r.findIndex(ft),t=n>=0?n:$r.length;let o=null;for(let n=0;n<t;n++){const t=$r[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${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=nt?.props?.id??$r[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),_t(e=>e+1)},children:gt.bar.refresh})}),To.barTrail?.(),To.barMain?To.barMain():/* @__PURE__ */In(vn,{variant:"primary",disabled:null!==Yn,onClick:()=>{Vn(Zn.data)},children:gt.done})]})]}),
43
+ /* @__PURE__ */In(z,{}),
44
+ /* @__PURE__ */Nn("div",{className:"sf-body",children:[$t?/* @__PURE__ */Nn(Tn,{children:[
45
+ /* @__PURE__ */In("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":gt.leftPanel,children:to?/* @__PURE__ */In(T,{blocks:Hl,blocksOnly:Wl,at:lo?{label:(e=>{const n=pl(e.zone);if(n)return gt.add.addingTo({name:Vo.rowName?Oi(n,!0):Fr(n.type)});if(e.zone===le){const n=$r[e.index];return n&&!ft(n)?gt.add.addingBefore({name:Oi(n,!0)}):gt.add.addingAtEnd}const t=hl(e.zone);return t?gt.add.addingTo({name:t.parentName}):gt.add.addingHere})(lo),onClear:()=>so(null)}:void 0,onAdd:e=>{const n=ko,t=(e,n)=>{lo&&so({zone:e,index:n})};if(n&&"block"!==e.kind&&pl(n.zone))return Ci(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===So)return void wi(e);const n=wi(e,So);lo&&ao(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===So)return void xi(e,n);const t=xi(e,n,So);lo&&ao(t+1)})(e.template.name,Rr(e.template.node));if(n&&n.zone!==le){const o=hl(n.zone);if(!o)return;return o.target.spec?Xi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ki(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Fl?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:yl,siteWide:To.addPanelRow?.(Bi),onClose:Bi,onHide:Cr,readOnly:Boolean(Gn)}):Wt&&Dt?
46
+ /* @__PURE__ */In(A,{panel:Dt,pick:Wt,onHide:Cr}):Jl?Jl.panel({onHide:Cr,notify:pr}):"media"===$o&&Dt?/* @__PURE__ */In(A,{panel:Dt,pick:null,onHide:Cr}):/* @__PURE__ */Nn(Tn,{children:[
47
+ /* @__PURE__ */In(P,{icon:/* @__PURE__ */In(Ae,{}),title:gt.layers,context:bt,actions:
48
+ /* @__PURE__ */In(We,{label:ll?gt.expandAll:gt.collapseAll,title:0===il.length?gt.nothingToFold:void 0,disabled:0===il.length,onClick:()=>er(e=>{const n=new Set(il);return ll?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...il])}),children:/* @__PURE__ */In($n,{expand:ll})}),onHide:Cr}),
49
+ /* @__PURE__ */Nn(Be,{className:"sf-tree sf-scroll",words:yt,children:[
50
+ /* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:"page",size:13}),name:gt.pageSettings,onSelect:Tr,selected:!nt&&mo,rowProps:{onClick:Ii(Tr)}}),tl&&/* @__PURE__ */Nn(Tn,{children:[
51
+ /* @__PURE__ */In(Ce,{children:gt.header}),jl(tl)]}),!Po&&_n&&/* @__PURE__ */Nn(Tn,{children:[
52
+ /* @__PURE__ */In(Ce,{children:gt.header}),!ht&&/* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:"header",size:13}),name:gt.header,onSelect:Pr,selected:fo.kind===pt?.kind,rowProps:{onClick:Ii(Pr)}})]}),!Po&&nl&&Zl(nl,el,"header"),!Po&&!Xl&&/* @__PURE__ */In(Ce,{children:Kl}),Xl?/* @__PURE__ */Nn(Tn,{children:[
53
+ /* @__PURE__ */In(be,{words:yt,icon:null,name:Kl,fold:{open:!Ql,label:Kl,onToggle:()=>sr(jn)}}),!Ql&&/* @__PURE__ */In(ze,{children:_l})]}):_l,_n&&/* @__PURE__ */In(Ce,{children:gt.footer}),qi&&Zl(qi,Zi,"footer"),!Po&&!qi&&_n&&/* @__PURE__ */In(be,{words:yt,icon:/* @__PURE__ */In(Ho,{type:"footer",size:13}),name:gt.footer,onSelect:Ni,rowProps:{onClick:Ii(Ni),title:gt.editFooter}}),ol&&jl(ol),To.treeFoot?.()]})]})}),
54
+ /* @__PURE__ */In(Ue,{side:"left",width:nr.left,min:Ye,max:Ge,defaultWidth:k.left,label:gt.resizeLeftPanel,onResize:rr})]}):/* @__PURE__ */In($,{side:"left",onShow:Cr}),
55
+ /* @__PURE__ */Nn("div",{ref:ur,className:"sf-center sf-scroll","data-sf-canvas-head":yr?"":void 0,style:{overflowX:br?"auto":"hidden",overflowY:"hidden"},children:[yr&&/* @__PURE__ */In("div",{ref:kr,className:"sf-canvas-head",children:/* @__PURE__ */In(yr,{device:Ft})}),
56
+ /* @__PURE__ */In("div",{className:"sf-frame-scaler",style:zr,children:/* @__PURE__ */In("div",{className:"sf-frame "+(Ft===Et?"":`sf-frame--${Ft}`),style:Br,children:/* @__PURE__ */Nn("div",{className:"sf-preview-host",children:[
57
+ /* @__PURE__ */In(zt,{},Qt),
58
+ /* @__PURE__ */In(Ze,{canvas:eo,session:yl,model:zl,measure:Cl,canDrop:Il,onDrop:Tl,onPick:$l,onZoneAdd:e=>{const n=sn(e),t=Xr(n);t&&_r(t.node,t.slot,!1),zi(n,0)},zoneAddLabel:gt.canvasAddBlock,words:kt.canvas,readOnly:Boolean(Gn),revision:Zn.data}),po.length>0&&/* @__PURE__ */In("div",{className:"sf-preview-gaps","aria-hidden":"true",children:po.map(e=>/* @__PURE__ */Nn("button",{type:"button",tabIndex:-1,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},onClick:()=>bi(e.index),children:[
59
+ /* @__PURE__ */In("span",{className:"sf-preview-gap-line"}),
60
+ /* @__PURE__ */Nn("span",{className:"sf-preview-gap-pill",children:[
61
+ /* @__PURE__ */In("span",{className:"sf-preview-gap-plus",children:"+"}),
62
+ /* @__PURE__ */In("span",{className:"sf-preview-gap-label",children:gt.addSection})]})]},e.index))})]})})})]}),At?/* @__PURE__ */Nn(Tn,{children:[
63
+ /* @__PURE__ */In(g,{value:{selectChild:Ji,addChild:Xi,childRowName:ti,blockRowName:sl},children:/* @__PURE__ */In(Bt,{mode:fo,onOpenWebsiteSettings:To.openSettings??(()=>{}),onOpenSiteStyles:To.openStyles,onSelectNode:Yo,onNotify:pr,onHidePanel:Or,nodeActions:nt?se(ot,nt.type):Rn})}),
64
+ /* @__PURE__ */In(Ue,{side:"right",width:nr.right,min:Ye,max:Ge,defaultWidth:k.right,label:gt.resizeSettingsPanel,onResize:ir})]}):
65
+ /* @__PURE__ */In($,{side:"right",onShow:Or})]}),ai.menu]})}))}export{En as ScreenChrome};
@@ -1,4 +1,4 @@
1
- import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-55IKQFBW.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-BF3PIXZD.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
1
+ import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-55IKQFBW.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-MCHMF32I.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
2
2
  /* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(a,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
3
3
  return o(n,{align:"start",triggerClassName:"sf-add-card",items:u,trigger:/* @__PURE__ */c(i,{children:[
4
4
  /* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),m.addBlockMenu]})})}export{l as AddBlockRow};
@@ -1 +1 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-BF3PIXZD.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-QTLAVDJE.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Y2G7CU6A.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-JZDEIRH4.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var A={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},F=o=>"object"==typeof o&&null!==o;function a(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:F(n)?t[m]=F(c)?a(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?a(o,r):o}export{A as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-MCHMF32I.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-QTLAVDJE.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Y2G7CU6A.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-JZDEIRH4.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var A={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},F=o=>"object"==typeof o&&null!==o;function a(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:F(n)?t[m]=F(c)?a(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?a(o,r):o}export{A as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
@@ -1,2 +1,2 @@
1
- import{routeSharedHostMessage as e}from"./chunk-S4AWJX4Q.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GMCZXMOV.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as s}from"./chunk-CLOS6SSX.js";import{useAdminBridge as i}from"./chunk-VPFNZ7TB.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{backendOf as c,setSessionDocumentSite as d}from"./chunk-RSCMJIWS.js";import{useEaselHost as f}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-BF3PIXZD.js";import{useAutosave as g}from"./chunk-BDTITTMW.js";import{canWriteDocument as k,newEaselClientId as v,reloadIfVersionMoved as p,openUnansweredClaim as h,FAIL_OPEN_RETRY_MS as y,CLAIM_FAIL_OPEN_MS as w,holderOf as S}from"./chunk-THWO5YVZ.js";import{useWords as b}from"./chunk-MFIRYGHW.js";import{createContext as I,useContext as P,useState as j,useMemo as B,useCallback as T,useEffect as R,useRef as O}from"react";import{jsx as C}from"react/jsx-runtime";var E={content:[],root:{},zones:{}};var H=I(null);function D(){const e=P(H);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function M({target:I,addressing:P=o,onHostMessage:D,children:M}){const A=P,{homeSlug:F,entryMayBounce:V,entryBounce:L,onSwitch:N,tellsHost:W,adapterFor:X,migrateRenamedProps:Z,describeMissing:J,onLoadFailed:Y}=A,[x,G]=j(I),U=f(),K=l(),Q=B(()=>c(K),[K]),z=B(()=>t(K),[K]),_="template"===x.kind,q="template"===x.kind?x.id:null,$="template"===x.kind?x.pageSlug??F??"":"document"===x.kind?x.slug??"":x.slug,ee="page"===x.kind?x.siteId??null:null,re=K.blocks,ne=B(()=>X(x,Q,re),[X,Q,re,x.kind,"template"===x.kind?x.id:"document"===x.kind?x.record:x.siteId]),te=ne.capabilities,oe=T(e=>K.documentHooks?.stored?.(e)??e,[K]),ue="page"===x.kind?x.originSlug??null:null;R(()=>{d(K,ee)},[K,ee]);const ae=O(x);R(()=>{ae.current=x},[x]);const{token:se,tokenRef:ie,capabilities:le}=i({onMessage:r=>{if(D?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Pr(e.target)}}}),ce=!K.usesBridgedToken||null!==se,de=ne.lock,fe=Boolean(Q.lock),[me,ge]=j(null),[ke,ve]=j(null),[pe,he]=j(null),[ye,we]=j(null),Se=b("screen",m),be=ye?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(ye,Se):null,[Ie,Pe]=j(null),je=O(null),Be=O(null),[Te,Re]=j(!1),Oe=O(null),[Ce,Ee]=j(null),He=O(null),[De,Me]=j(null),Ae=O(null);R(()=>{Ae.current=De},[De]);const[Fe,Ve]=j(te.hasEditLock?{kind:"checking"}:{kind:"editing"}),Le=O(Fe);R(()=>{Le.current=Fe},[Fe]);const Ne=O(()=>Promise.resolve(!1)),We=T(e=>{Be.current=e,Re(!0)},[]),Xe=g({save:async({id:e,data:r})=>{if(k(Le.current)){if(!await Ne.current(e,r)){if(!k(Le.current))return void We({id:e,data:r});throw new Error("page save did not land")}}else We({id:e,data:r})},onFailure:(e,r)=>{0===r&&U.send("storefront-editor:save-failed")}}),{state:Ze,push:Je,flush:Ye,pause:xe,resume:Ge,stop:Ue,reset:Ke,retryNow:Qe,hasPending:ze}=Xe,_e=O(Ze);R(()=>{_e.current=Ze},[Ze]);const qe=u(Ze),$e=T(()=>{const e=Be.current;e&&(Be.current=null,Re(!1),Je(e))},[Je]),er=O("");er.current||(er.current=v());const[rr,nr]=j(0),tr=O(!1),[or,ur]=j(V(I)),ar=O(!1);R(()=>{if(ar.current)return;ar.current=!0;const e=U.address.search(),r=L(I,e);r?U.address.load(r):V(I)&&ur(!1)},[I,U]);const sr=U.send;R(()=>{if(!ce)return;let e=!1;const t=ae.current,o=ne.resolve($),u=K.documentHooks?.opening?.({slug:$,isTemplate:_,capabilities:te});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==F&&$!==F?void U.address.load({kind:"page",slug:F,siteId:ee??void 0}):(we({target:t,slug:$,missing:!0,sentence:J?.(t)??null}),void Y?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;je.current=n,Pe(n),ge(r.id),ve(r.kind??null),He.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:E,s=Z(a),i=u?await u(s):s;e||he(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),we({target:t,slug:$,missing:!1,sentence:n(o,{slug:$},K),cause:r(o,K)}),Y?.(t,o))}),()=>{e=!0}},[ce,se,_,ne,$]);const ir=T(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=ie.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),lr=T(async e=>{const r=ie.current;if(!r&&K.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,K)){sr("storefront-editor:auth-expired");const n=r?await ir(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[sr,ir,K]),cr=T(async e=>{const r=ie.current?await lr(e):{ok:!1};return r.ok||sr("storefront-editor:save-failed"),r.ok},[sr,lr]),dr=T(async(e,r,n=!1)=>{if(null!==je.current)return!1;if(!k(Le.current))return!1;if(Ae.current)return!1;const t=await lr(()=>ne.saveLayout(e,r,He.current,er.current));if(t.ok)return He.current=t.value.version??He.current,!0;const o=z.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Le.current=e,Ve(e),!1}const u=z.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&ne.rereadVersion){const n=await lr(()=>ne.rereadVersion(e));if(n.ok&&n.value)return He.current=n.value,Ne.current(e,r,!0)}Ue(),Ae.current=u,Me(u)}return!1},[ne,lr,Ue]);R(()=>{Ne.current=dr},[dr]);const fr=T(e=>{if(null!==je.current)return;if(sr("storefront-editor:dirty"),!me)return;const r=oe(e);Oe.current=r,k(Le.current)?Je({id:me,data:r}):We({id:me,data:r})},[me,sr,We,Je,oe]),mr=T(async()=>{k(Le.current)&&$e();return await Ye()&&null==Be.current},[$e,Ye]),gr=O(mr);R(()=>{gr.current=mr},[mr]);const kr=O(lr);R(()=>{kr.current=lr},[lr]);const vr=T(()=>{U.address.reload()},[U]),pr=O(()=>Promise.resolve(!1));R(()=>{pr.current=()=>{const e=ne.rereadVersion;return me&&e?p({ours:He.current,stored:async()=>{const r=await kr.current(()=>e(me));return r.ok?r.value:null},hasPending:()=>null!=Be.current||ze(),reload:vr}):Promise.resolve(!1)}},[ne,me,ze,vr]);const hr=null!==Ie;R(()=>{if(!de||!me||!ce||hr)return;let e=!1,r=null,n=null;const t=er.current,o={claim:async e=>{const r=await kr.current(()=>de.claim(me,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Le.current,heldWrite:()=>({pending:null!=Be.current||ze(),autoSaveEnabled:!_e.current.paused,saveConflict:null!=Ae.current}),setAccess:e=>{Le.current=e,Ve(e)},releaseHeldWrite:()=>{gr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{pr.current()}},u=z.makeClaimBeat(o),a=tr.current;return tr.current=!1,a||(Ve({kind:"checking"}),n=setTimeout(()=>{n=null,h(o)&&o.startHeartbeat(y)},w)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),de.release(me,t).catch(()=>{})}},[me,de,ce,se,rr,hr]);const yr=T(()=>{de&&me&&(tr.current=!0,nr(e=>e+1))},[me,de]),wr=T(()=>{Ve(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),Sr=T(()=>{_e.current.paused?(k(Le.current)&&$e(),Ge()):xe()},[$e,xe,Ge]),br=T(()=>{Qe()},[Qe]),Ir=T(e=>{Oe.current=null,a("template"!==e.kind&&fe,{resetAutosave:()=>{Ke(),Be.current=null,Re(!1)},setVersion:e=>{He.current=e},setSaveConflict:Me,setAccess:Ve}),N(e),G(e),je.current=null,Pe(null),ge(null),ve(null),he(null),we(null),U.address.show(e),"document"!==e.kind&&W(e)&&U.send("storefront-editor:navigated",{target:e})},[Ke,U,fe,N,W]),Pr=T(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,ae.current,F))return;const r=null!=Be.current;if(!r&&!ze())return void Ir(e);const n=_e.current;r||n.paused||n.failed||n.stopped?Ee(e):Ye().then(r=>{r?Ir(e):Ee(e)})},[Ir,ze,Ye,F]),jr=T(()=>Ee(null),[]),Br=T(()=>{Ee(e=>(e&&Ir(e),null))},[Ir]),Tr=T(async()=>{const e=Ce;if(!e)return;await mr()&&(Ee(null),Ir(e))},[Ce,mr,Ir]),Rr=T(async e=>{if(null!==je.current)return;if(!me)return;if(!k(Le.current)||Ae.current)return;const r=oe(e);if(!await dr(me,r))return void(Ae.current||sr("storefront-editor:save-failed"));const n=ne.publish;if(!te.canPublish||!n)return void sr("storefront-editor:saved");const t=await lr(()=>n(me,He.current??void 0));t.ok?(He.current=t.value.version??He.current,sr("storefront-editor:published")):sr("storefront-editor:save-failed")},[me,ne,te.canPublish,sr,dr,lr,oe]);/* @__PURE__ */
2
- return C(H.Provider,{value:{target:x,adapter:ne,capabilities:te,templateId:q,currentSlug:$,currentKind:ke,siteId:ee,ready:ce,token:se,tokenRef:ie,notifyParent:sr,bridgeCapabilities:le,runAuthed:cr,docId:me,data:pe,getLiveData:()=>Oe.current??pe,footerOriginSlug:ue,error:be,redirecting:or,saveStatus:qe,saveState:Ze,autoSaveEnabled:!Ze.paused,autoSaveStoppedByConflict:Ze.stopped,hasUnsavedEdits:Ze.pending||Te,toggleAutoSave:Sr,retrySave:br,onChange:fr,flushSave:mr,onPublish:Rr,access:Fe,readOnly:null!==S(Fe)||null!==Ie||null!==De,readOnlyReason:Ie,takeOverEditing:yr,viewReadOnly:wr,saveConflict:De,reloadFromServer:vr,navigate:Pr,pendingNav:Ce,cancelPendingNav:jr,discardAndNavigate:Br,saveAndNavigate:Tr},children:M})}export{H as ScreenDocumentContext,M as ScreenDocumentProvider,D as useScreenDocument};
1
+ import{routeSharedHostMessage as e}from"./chunk-S4AWJX4Q.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GMCZXMOV.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as s}from"./chunk-CLOS6SSX.js";import{useAdminBridge as i}from"./chunk-VPFNZ7TB.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{backendOf as c,setSessionDocumentSite as d}from"./chunk-RSCMJIWS.js";import{useEaselHost as f}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-MCHMF32I.js";import{useAutosave as g}from"./chunk-BDTITTMW.js";import{canWriteDocument as k,newEaselClientId as v,reloadIfVersionMoved as p,openUnansweredClaim as h,FAIL_OPEN_RETRY_MS as y,CLAIM_FAIL_OPEN_MS as w,holderOf as S}from"./chunk-THWO5YVZ.js";import{useWords as b}from"./chunk-MFIRYGHW.js";import{createContext as I,useContext as P,useState as j,useMemo as T,useCallback as B,useEffect as R,useRef as C}from"react";import{jsx as H}from"react/jsx-runtime";var M={content:[],root:{},zones:{}};var O=I(null);function E(){const e=P(O);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function A({target:I,addressing:P=o,onHostMessage:E,children:A}){const D=P,{homeSlug:F,entryMayBounce:V,entryBounce:L,onSwitch:N,tellsHost:W,adapterFor:J,migrateRenamedProps:X,describeMissing:Y,onLoadFailed:Z}=D,[x,G]=j(I),U=f(),K=l(),Q=T(()=>c(K),[K]),z=T(()=>t(K),[K]),_="template"===x.kind,q="template"===x.kind?x.id:null,$="template"===x.kind?x.pageSlug??F??"":"document"===x.kind?x.slug??"":x.slug,ee="page"===x.kind?x.siteId??null:null,re=K.blocks,ne=T(()=>J(x,Q,re),[J,Q,re,x.kind,"template"===x.kind?x.id:"document"===x.kind?x.record:x.siteId]),te=ne.capabilities,oe=B(e=>K.documentHooks?.stored?.(e)??e,[K]),ue="page"===x.kind?x.originSlug??null:null;R(()=>{d(K,ee)},[K,ee]);const ae=C(x);R(()=>{ae.current=x},[x]);const{token:se,tokenRef:ie,capabilities:le}=i({onMessage:r=>{if(E?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Pr(e.target)}}}),ce=!K.usesBridgedToken||null!==se,de=ne.lock,fe=Boolean(Q.lock),[me,ge]=j(null),[ke,ve]=j(null),[pe,he]=j(null),[ye,we]=j(null),Se=b("screen",m),be=ye?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(ye,Se):null,[Ie,Pe]=j(null),je=C(null),Te=C(null),[Be,Re]=j(!1),Ce=C(null),[He,Me]=j(null),Oe=C(null),[Ee,Ae]=j(null),De=C(null);R(()=>{De.current=Ee},[Ee]);const[Fe,Ve]=j(te.hasEditLock?{kind:"checking"}:{kind:"editing"}),Le=C(Fe);R(()=>{Le.current=Fe},[Fe]);const Ne=C(()=>Promise.resolve(!1)),We=B(e=>{Te.current=e,Re(!0)},[]),Je=g({save:async({id:e,data:r})=>{if(k(Le.current)){if(!await Ne.current(e,r)){if(!k(Le.current))return void We({id:e,data:r});throw new Error("page save did not land")}}else We({id:e,data:r})},onFailure:(e,r)=>{0===r&&U.send("storefront-editor:save-failed")}}),{state:Xe,push:Ye,flush:Ze,pause:xe,resume:Ge,stop:Ue,reset:Ke,retryNow:Qe,hasPending:ze}=Je,_e=C(Xe);R(()=>{_e.current=Xe},[Xe]);const qe=u(Xe),$e=B(()=>{const e=Te.current;e&&(Te.current=null,Re(!1),Ye(e))},[Ye]),er=C("");er.current||(er.current=v());const[rr,nr]=j(0),tr=C(!1),[or,ur]=j(V(I)),ar=C(!1);R(()=>{if(ar.current)return;ar.current=!0;const e=U.address.search(),r=L(I,e);r?U.address.load(r):V(I)&&ur(!1)},[I,U]);const sr=U.send;R(()=>{if(!ce)return;let e=!1;const t=ae.current,o=ne.resolve($),u=K.documentHooks?.opening?.({slug:$,isTemplate:_,capabilities:te});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==F&&$!==F?void U.address.load({kind:"page",slug:F,siteId:ee??void 0}):(we({target:t,slug:$,missing:!0,sentence:Y?.(t)??null}),void Z?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;je.current=n,Pe(n),ge(r.id),ve(r.kind??null),Oe.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:M,s=X(a),i=u?await u(s):s;e||he(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),we({target:t,slug:$,missing:!1,sentence:n(o,{slug:$},K),cause:r(o,K)}),Z?.(t,o))}),()=>{e=!0}},[ce,se,_,ne,$]);const ir=B(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=ie.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),lr=B(async e=>{const r=ie.current;if(!r&&K.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,K)){sr("storefront-editor:auth-expired");const n=r?await ir(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[sr,ir,K]),cr=B(async e=>{const r=ie.current?await lr(e):{ok:!1};return r.ok||sr("storefront-editor:save-failed"),r.ok},[sr,lr]),dr=B(async(e,r,n=!1)=>{if(null!==je.current)return!1;if(!k(Le.current))return!1;if(De.current)return!1;const t=await lr(()=>ne.saveLayout(e,r,Oe.current,er.current));if(t.ok)return Oe.current=t.value.version??Oe.current,!0;const o=z.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Le.current=e,Ve(e),!1}const u=z.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&ne.rereadVersion){const n=await lr(()=>ne.rereadVersion(e));if(n.ok&&n.value)return Oe.current=n.value,Ne.current(e,r,!0)}Ue(),De.current=u,Ae(u)}return!1},[ne,lr,Ue]);R(()=>{Ne.current=dr},[dr]);const fr=B(e=>{if(null!==je.current)return;if(sr("storefront-editor:dirty"),!me)return;const r=oe(e);Ce.current=r,k(Le.current)?Ye({id:me,data:r}):We({id:me,data:r})},[me,sr,We,Ye,oe]),mr=B(async()=>{k(Le.current)&&$e();return await Ze()&&null==Te.current},[$e,Ze]),gr=C(mr);R(()=>{gr.current=mr},[mr]);const kr=C(lr);R(()=>{kr.current=lr},[lr]);const vr=B(()=>{U.address.reload()},[U]),pr=C(()=>Promise.resolve(!1));R(()=>{pr.current=()=>{const e=ne.rereadVersion;return me&&e?p({ours:Oe.current,stored:async()=>{const r=await kr.current(()=>e(me));return r.ok?r.value:null},hasPending:()=>null!=Te.current||ze(),reload:vr}):Promise.resolve(!1)}},[ne,me,ze,vr]);const hr=null!==Ie;R(()=>{if(!de||!me||!ce||hr)return;let e=!1,r=null,n=null;const t=er.current,o={claim:async e=>{const r=await kr.current(()=>de.claim(me,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Le.current,heldWrite:()=>({pending:null!=Te.current||ze(),autoSaveEnabled:!_e.current.paused,saveConflict:null!=De.current}),setAccess:e=>{Le.current=e,Ve(e)},releaseHeldWrite:()=>{gr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{pr.current()}},u=z.makeClaimBeat(o),a=tr.current;return tr.current=!1,a||(Ve({kind:"checking"}),n=setTimeout(()=>{n=null,h(o)&&o.startHeartbeat(y)},w)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),de.release(me,t).catch(()=>{})}},[me,de,ce,se,rr,hr]);const yr=B(()=>{de&&me&&(tr.current=!0,nr(e=>e+1))},[me,de]),wr=B(()=>{Ve(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),Sr=B(()=>{_e.current.paused?(k(Le.current)&&$e(),Ge()):xe()},[$e,xe,Ge]),br=B(()=>{Qe()},[Qe]),Ir=B(e=>{Ce.current=null,a("template"!==e.kind&&fe,{resetAutosave:()=>{Ke(),Te.current=null,Re(!1)},setVersion:e=>{Oe.current=e},setSaveConflict:Ae,setAccess:Ve}),N(e),G(e),je.current=null,Pe(null),ge(null),ve(null),he(null),we(null),U.address.show(e),"document"!==e.kind&&W(e)&&U.send("storefront-editor:navigated",{target:e})},[Ke,U,fe,N,W]),Pr=B(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,ae.current,F))return;const r=null!=Te.current;if(!r&&!ze())return void Ir(e);const n=_e.current;r||n.paused||n.failed||n.stopped?Me(e):Ze().then(r=>{r?Ir(e):Me(e)})},[Ir,ze,Ze,F]),jr=B(()=>Me(null),[]),Tr=B(()=>{Me(e=>(e&&Ir(e),null))},[Ir]),Br=B(async()=>{const e=He;if(!e)return;await mr()&&(Me(null),Ir(e))},[He,mr,Ir]),Rr=B(async e=>{if(null!==je.current)return;if(!me)return;if(!k(Le.current)||De.current)return;const r=oe(e);if(!await dr(me,r))return void(De.current||sr("storefront-editor:save-failed"));const n=ne.publish;if(!te.canPublish||!n)return void sr("storefront-editor:saved");const t=await lr(()=>n(me,Oe.current??void 0));t.ok?(Oe.current=t.value.version??Oe.current,sr("storefront-editor:published")):sr("storefront-editor:save-failed")},[me,ne,te.canPublish,sr,dr,lr,oe]);/* @__PURE__ */
2
+ return H(O.Provider,{value:{target:x,adapter:ne,capabilities:te,templateId:q,currentSlug:$,currentKind:ke,siteId:ee,ready:ce,token:se,tokenRef:ie,notifyParent:sr,bridgeCapabilities:le,runAuthed:cr,docId:me,data:pe,getLiveData:()=>Ce.current??pe,footerOriginSlug:ue,error:be,redirecting:or,saveStatus:qe,saveState:Xe,autoSaveEnabled:!Xe.paused,autoSaveStoppedByConflict:Xe.stopped,hasUnsavedEdits:Xe.pending||Be,toggleAutoSave:Sr,retrySave:br,onChange:fr,flushSave:mr,onPublish:Rr,access:Fe,readOnly:null!==S(Fe)||null!==Ie||null!==Ee,readOnlyReason:Ie,takeOverEditing:yr,viewReadOnly:wr,saveConflict:Ee,reloadFromServer:vr,navigate:Pr,pendingNav:He,cancelPendingNav:jr,discardAndNavigate:Tr,saveAndNavigate:Br},children:A})}export{O as ScreenDocumentContext,A as ScreenDocumentProvider,E as useScreenDocument};
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-LMHGVI5R.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-55IKQFBW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-BF3PIXZD.js";import"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-QASZFO4S.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-UVAIY7VO.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-55IKQFBW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-QASZFO4S.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-2WVZ3CK3.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5SOSVTVI.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-55IKQFBW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-BF3PIXZD.js";import"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-QASZFO4S.js";import"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-QVWPI2FL.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5SOSVTVI.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-55IKQFBW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-QASZFO4S.js";import"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-IMRJHRQ2.js";import"../../chunk-V7U33NF2.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BF3PIXZD.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-QASZFO4S.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-MTRFMGBO.js";import"../../chunk-V7U33NF2.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-QASZFO4S.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{PageEditGuardNotices as default}from"../../chunk-KNUFI3WV.js";import"../../chunk-PRSTFWUY.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-BF3PIXZD.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";
1
+ export{PageEditGuardNotices as default}from"../../chunk-2I7MAA2U.js";import"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-7VP5RXNO.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-AVYFZZAP.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-U2DVXW2H.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-J2JBETVO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-42TMLDSQ.js";import"../../chunk-OFNXIZEP.js";import"../../chunk-FRGCTHDB.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-IMRJHRQ2.js";import"../../chunk-KNUFI3WV.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-PRSTFWUY.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-2WVZ3CK3.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5SOSVTVI.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZN752E2O.js";import"../../chunk-55IKQFBW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BF3PIXZD.js";import"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-QASZFO4S.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenChrome as default}from"../../chunk-TNTV7UZ6.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-7P6IFCR4.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-J2JBETVO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-42TMLDSQ.js";import"../../chunk-OFNXIZEP.js";import"../../chunk-FRGCTHDB.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-MTRFMGBO.js";import"../../chunk-2I7MAA2U.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-QVWPI2FL.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5SOSVTVI.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZN752E2O.js";import"../../chunk-55IKQFBW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-QASZFO4S.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-PRSTFWUY.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-BF3PIXZD.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
1
+ export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
@@ -1 +1 @@
1
- export{DocumentScreen,ScreenMount as default}from"../../chunk-4WEGYBTV.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-6QSPOILR.js";import"../../chunk-7VP5RXNO.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-AVYFZZAP.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-U2DVXW2H.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-J2JBETVO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-42TMLDSQ.js";import"../../chunk-OFNXIZEP.js";import"../../chunk-FRGCTHDB.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-IMRJHRQ2.js";import"../../chunk-KNUFI3WV.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-PRSTFWUY.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-2WVZ3CK3.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5SOSVTVI.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZN752E2O.js";import"../../chunk-55IKQFBW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BF3PIXZD.js";import"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-QASZFO4S.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{DocumentScreen,ScreenMount as default}from"../../chunk-6B4276GZ.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-6QSPOILR.js";import"../../chunk-TNTV7UZ6.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-7P6IFCR4.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-J2JBETVO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-42TMLDSQ.js";import"../../chunk-OFNXIZEP.js";import"../../chunk-FRGCTHDB.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-MTRFMGBO.js";import"../../chunk-2I7MAA2U.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-QVWPI2FL.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5SOSVTVI.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZN752E2O.js";import"../../chunk-55IKQFBW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-QASZFO4S.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,16 +1,16 @@
1
- import{AddBlockRow as e}from"../../chunk-LMHGVI5R.js";import{slotChildRowName as n}from"../../chunk-TBF5CVPA.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import{useEaselUndoKeys as t}from"../../chunk-J2JBETVO.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-42TMLDSQ.js";import{usePartBridge as c}from"../../chunk-OFNXIZEP.js";import{useSectionOps as p}from"../../chunk-FRGCTHDB.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-PRSTFWUY.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-ZN752E2O.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as f,useStandaloneScreenBridges as j,useScreenBlockLook as N,useScreenBlockRules as S}from"../../chunk-55IKQFBW.js";import{nestsInTree as y,slotFieldsOf as A}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as C,usePanelPick as O,useCancelPanelPick as x}from"../../chunk-R6WTQWAC.js";import{useHostEscape as P}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as B}from"../../chunk-BF3PIXZD.js";import{useEasel as R}from"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import{LayersTree as v,Subtree as F,TreeRow as T,TreeRowAction as E,TreeSeam as L}from"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import{DEFAULT_TREE_WORDS as M}from"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-QASZFO4S.js";import"../../chunk-BDTITTMW.js";import{DEFAULT_SAVE_WORDS as g,saveIndicator as w}from"../../chunk-H6DDIBQ4.js";import{SaveState as z,panelWidthVars as D}from"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import{useWords as Y}from"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as b}from"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as H,parseZoneKey as W}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as X,useRef as Z,useEffect as G,useCallback as I,Fragment as V}from"react";import{Tooltip as J}from"efficient-shell/ui";import{TrashIcon as Q}from"efficient-shell/icons/efficient";import{jsxs as K,jsx as $,Fragment as U}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=l(),re=p(),{appState:te,selectedItem:se,config:ie}=R(e=>e),[ce,pe]=X(d),le=Y("screen",B),me=Y("tree",M),de=Y("save",g),{first:ae,last:ue,panelOf:he}=a(),ke=he(ae),fe=u(),je=h(),Ne=te.data.content?.[0]??null,Se=Ne?.props.id??null,ye=Ne?.type===ae,Ae=Ne?.type===ue,Ce=Z(null),Oe=Z(null);t(Oe);const xe=C(),Pe=O(),Be=x();k(se?.props.id),G(()=>{const e=Oe.current;if(!Pe||!e)return;const n=e=>{"Escape"===e.key&&Be()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Pe]),P(null!==Pe,()=>Be()),G(()=>{Se&&Ce.current!==Se&&(Ce.current=Se,ye?pe(ke??d):se||re.select({index:0}))},[Se,se,re,ye]);const Re=I(e=>pe(n=>f(n,e)?n:e),[]),ve=j({kind:ce.kind,mode:ce,open:Re,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>f(e,n)?e:n),re.select(e)}}),{selectNode:Fe}=c({mode:ce,setMode:pe,onOpenPart:o}),Te=N(),{labelAtLevel:Ee,Icon:Le}=Te,{canAddTo:Me}=S(),ge=e=>Ee(e,"block",ie.components[e]?.label??e),we=e=>Ee(e,"section",ge(e)),ze=!ye&&"puck"===ce.kind&&se?.props.id===Se,De=Ne?Me(Ne.type)?.spec??null:null,Ye=Ne&&De?`${Ne.props.id}:${De.slot}`:null,be=Ne&&De&&Array.isArray(Ne.props[De.slot])?Ne.props[De.slot]:[],He=e=>n(e,ge,Te.plainText),We=(e,n)=>{Ne&&De&&Ye&&(pe(d),De.slider?(r(String(Ne.props.id),e),re.select({index:e,zone:Ye}),o(String(Ne.props.id))):(re.select({index:e,zone:Ye}),o(n)))},Xe=()=>{if(!Ne||!De||!Ye)return;const e=be.length;re.insertComponent(Ye,De.childType,e),pe(d),De.slider?requestAnimationFrame(()=>{r(String(Ne.props.id),e),re.select({index:e,zone:Ye})}):re.select({index:e,zone:Ye})},Ze=e=>A(ie,e),Ge=e=>{const{parentId:n,slot:o}=W(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Ze(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(Ne)?.props[o];return Array.isArray(t)?t.length:0},Ie=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ge(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(d),re.select({index:t,zone:e}))},Ve=b({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>H(n)===e.zone&&n.index>=0&&n.index<=Ge(e.zone),onDrop:(e,n)=>Ie(e.zone,e.index,n.index),onStep:(e,n)=>Ie(e.zone,e.index,n<0?e.index-1:e.index+2)}),Je=(e,n)=>/* @__PURE__ */$(L,{...ne?{}:Ve.seam({place:{...W(e),index:n}})},`seam:${e}:${n}`),Qe=e=>Te.blockRowName(e,ge),Ke=(e,n,r)=>{pe(d),re.select({index:n,zone:e}),o(r)},$e=(e,n,o)=>{re.insertComponent(e,n,o),pe(d),re.select({index:o,zone:e})},Ue=(n,o,r)=>/* @__PURE__ */$(e,{choices:r,onPick:e=>$e(n,e,o)}),qe=(e,n)=>{const o=Ze((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=Me(e.type),s=t?.choices??null,i="footer"===t?.source?Qe:He;/* @__PURE__ */
2
- return K(U,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=y(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Ke(o,r,p),{rowProps:m,...a}=Ve.row({item:{id:p,zone:o,index:r},place:{...W(o),index:r}},{onClick:q(l)});/* @__PURE__ */
3
- return K(V,{children:[0===r&&Je(o,0),
4
- /* @__PURE__ */$(T,{words:me,icon:/* @__PURE__ */$(Le,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */$(E,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(d),void re.select(null);var e,n},children:/* @__PURE__ */$(Q,{size:13})}),rowProps:m}),s&&/* @__PURE__ */$(F,{children:qe(e,n+1)}),Je(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ue(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===Ne?.type,en=Boolean(Ne)&&(Boolean(De)||Ae||ye||_e);/* @__PURE__ */
1
+ import{AddBlockRow as e}from"../../chunk-UVAIY7VO.js";import{slotChildRowName as n}from"../../chunk-TBF5CVPA.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import{useEaselUndoKeys as t}from"../../chunk-J2JBETVO.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-42TMLDSQ.js";import{usePartBridge as c}from"../../chunk-OFNXIZEP.js";import{useSectionOps as p}from"../../chunk-FRGCTHDB.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-ZN752E2O.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as f,useStandaloneScreenBridges as j,useScreenBlockLook as N,useScreenBlockRules as S}from"../../chunk-55IKQFBW.js";import{nestsInTree as y,slotFieldsOf as A}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as C,usePanelPick as O,useCancelPanelPick as x}from"../../chunk-R6WTQWAC.js";import{useHostEscape as P}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as v}from"../../chunk-MCHMF32I.js";import{useEasel as B}from"../../chunk-PDZXAFNX.js";import"../../chunk-AELNNAFM.js";import"../../chunk-CRPJGCSO.js";import"../../chunk-OZ72A6MY.js";import{LayersTree as M,Subtree as E,TreeRow as F,TreeRowAction as R,TreeSeam as T}from"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import{DEFAULT_TREE_WORDS as L}from"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-QASZFO4S.js";import"../../chunk-BDTITTMW.js";import{DEFAULT_SAVE_WORDS as g,saveIndicator as w}from"../../chunk-H6DDIBQ4.js";import{SaveState as z,panelWidthVars as D}from"../../chunk-GTDLBUOC.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import{useWords as Y}from"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as b}from"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as H,parseZoneKey as W}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as Z,useRef as V,useEffect as X,useCallback as G,Fragment as I}from"react";import{Tooltip as J}from"efficient-shell/ui";import{TrashIcon as Q}from"efficient-shell/icons/efficient";import{jsxs as K,jsx as $,Fragment as U}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=l(),re=p(),{appState:te,selectedItem:se,config:ie}=B(e=>e),[ce,pe]=Z(d),le=Y("screen",v),me=Y("tree",L),de=Y("save",g),{first:ae,last:ue,panelOf:he}=a(),ke=he(ae),fe=u(),je=h(),Ne=te.data.content?.[0]??null,Se=Ne?.props.id??null,ye=Ne?.type===ae,Ae=Ne?.type===ue,Ce=V(null),Oe=V(null);t(Oe);const xe=C(),Pe=O(),ve=x();k(se?.props.id),X(()=>{const e=Oe.current;if(!Pe||!e)return;const n=e=>{"Escape"===e.key&&ve()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Pe]),P(null!==Pe,()=>ve()),X(()=>{Se&&Ce.current!==Se&&(Ce.current=Se,ye?pe(ke??d):se||re.select({index:0}))},[Se,se,re,ye]);const Be=G(e=>pe(n=>f(n,e)?n:e),[]),Me=j({kind:ce.kind,mode:ce,open:Be,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>f(e,n)?e:n),re.select(e)}}),{selectNode:Ee}=c({mode:ce,setMode:pe,onOpenPart:o}),Fe=N(),{labelAtLevel:Re,Icon:Te}=Fe,{canAddTo:Le}=S(),ge=e=>Re(e,"block",ie.components[e]?.label??e),we=e=>Re(e,"section",ge(e)),ze=!ye&&"puck"===ce.kind&&se?.props.id===Se,De=Ne?Le(Ne.type)?.spec??null:null,Ye=Ne&&De?`${Ne.props.id}:${De.slot}`:null,be=Ne&&De&&Array.isArray(Ne.props[De.slot])?Ne.props[De.slot]:[],He=e=>n(e,ge,Fe.plainText),We=(e,n)=>{Ne&&De&&Ye&&(pe(d),De.slider?(r(String(Ne.props.id),e),re.select({index:e,zone:Ye}),o(String(Ne.props.id))):(re.select({index:e,zone:Ye}),o(n)))},Ze=()=>{if(!Ne||!De||!Ye)return;const e=be.length;re.insertComponent(Ye,De.childType,e),pe(d),De.slider?requestAnimationFrame(()=>{r(String(Ne.props.id),e),re.select({index:e,zone:Ye})}):re.select({index:e,zone:Ye})},Ve=e=>A(ie,e),Xe=e=>{const{parentId:n,slot:o}=W(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Ve(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(Ne)?.props[o];return Array.isArray(t)?t.length:0},Ge=(e,n,o)=>{const r=Math.min(Math.max(o,0),Xe(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(d),re.select({index:t,zone:e}))},Ie=b({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>H(n)===e.zone&&n.index>=0&&n.index<=Xe(e.zone),onDrop:(e,n)=>Ge(e.zone,e.index,n.index),onStep:(e,n)=>Ge(e.zone,e.index,n<0?e.index-1:e.index+2)}),Je=(e,n)=>/* @__PURE__ */$(T,{...ne?{}:Ie.seam({place:{...W(e),index:n}})},`seam:${e}:${n}`),Qe=e=>Fe.blockRowName(e,ge),Ke=(e,n,r)=>{pe(d),re.select({index:n,zone:e}),o(r)},$e=(e,n,o)=>{re.insertComponent(e,n,o),pe(d),re.select({index:o,zone:e})},Ue=(n,o,r)=>/* @__PURE__ */$(e,{choices:r,onPick:e=>$e(n,e,o)}),qe=(e,n)=>{const o=Ve((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=Le(e.type),s=t?.choices??null,i="footer"===t?.source?Qe:He;/* @__PURE__ */
2
+ return K(U,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=y(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Ke(o,r,p),{rowProps:m,...a}=Ie.row({item:{id:p,zone:o,index:r},place:{...W(o),index:r}},{onClick:q(l)});/* @__PURE__ */
3
+ return K(I,{children:[0===r&&Je(o,0),
4
+ /* @__PURE__ */$(F,{words:me,icon:/* @__PURE__ */$(Te,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */$(R,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(d),void re.select(null);var e,n},children:/* @__PURE__ */$(Q,{size:13})}),rowProps:m}),s&&/* @__PURE__ */$(E,{children:qe(e,n+1)}),Je(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ue(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===Ne?.type,en=Boolean(Ne)&&(Boolean(De)||Ae||ye||_e);/* @__PURE__ */
5
5
  return K("div",{ref:Oe,className:"sf-editor es-editor",style:D(i),children:[
6
6
  /* @__PURE__ */$("div",{className:"sf-section-bar",children:/* @__PURE__ */$(z,null!==oe?{tone:"off",label:oe,role:"status"}:{...w(ee,de),role:"status"})}),
7
7
  /* @__PURE__ */K("div",{className:"sf-body",children:[Pe&&xe?/* @__PURE__ */$("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */$(m,{panel:xe,pick:Pe})}):en&&Ne&&/* @__PURE__ */K("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
8
8
  /* @__PURE__ */$("div",{className:"sf-panel-head",children:/* @__PURE__ */$(J,{content:ye?le.headerSettings:le.sectionSettings({name:we(Ne.type)}),side:"bottom",children:/* @__PURE__ */$("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(ze?"is-selected":""),"aria-pressed":ze,onClick:()=>{ye?pe(ke??d):(pe(d),re.select({index:0}))},children:we(Ne.type)})})}),
9
- /* @__PURE__ */$(v,{className:"sf-tree sf-scroll",rootProps:Ve.rootProps(),words:me,children:/* @__PURE__ */$(F,{children:ye?
10
- /* @__PURE__ */$(T,{words:me,icon:/* @__PURE__ */$(Le,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??d),rowProps:{onClick:q(()=>pe(ke??d))}}):De?/* @__PURE__ */K(U,{children:[be.map((e,n)=>{const o=se?.props.id===e.props.id,r=He(e),t=String(e.props.id),s=()=>We(n,t),{rowProps:i,...c}=Ve.row({item:{id:t,zone:Ye,index:n},place:{...W(Ye),index:n}},{onClick:q(s)});/* @__PURE__ */
11
- return K(V,{children:[0===n&&Je(Ye,0),
12
- /* @__PURE__ */$(T,{words:me,icon:/* @__PURE__ */$(Le,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */$(E,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Ye&&(re.removeComponent(Ye,e),pe(d),re.select(null)));var e},children:/* @__PURE__ */$(Q,{size:13})}),rowProps:i}),Je(Ye,n+1)]},String(e.props.id??n))}),
13
- /* @__PURE__ */K("button",{type:"button",className:"sf-add-card",onClick:Xe,children:[
14
- /* @__PURE__ */$("span",{className:"sf-plus sf-plus--sm",children:"+"}),De.addLabel]}),Se?ve.partRows?.(Ne,_):null]}):qe(Ne,1)})})]}),
9
+ /* @__PURE__ */$(M,{className:"sf-tree sf-scroll",rootProps:Ie.rootProps(),words:me,children:/* @__PURE__ */$(E,{children:ye?
10
+ /* @__PURE__ */$(F,{words:me,icon:/* @__PURE__ */$(Te,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??d),rowProps:{onClick:q(()=>pe(ke??d))}}):De?/* @__PURE__ */K(U,{children:[be.map((e,n)=>{const o=se?.props.id===e.props.id,r=He(e),t=String(e.props.id),s=()=>We(n,t),{rowProps:i,...c}=Ie.row({item:{id:t,zone:Ye,index:n},place:{...W(Ye),index:n}},{onClick:q(s)});/* @__PURE__ */
11
+ return K(I,{children:[0===n&&Je(Ye,0),
12
+ /* @__PURE__ */$(F,{words:me,icon:/* @__PURE__ */$(Te,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */$(R,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Ye&&(re.removeComponent(Ye,e),pe(d),re.select(null)));var e},children:/* @__PURE__ */$(Q,{size:13})}),rowProps:i}),Je(Ye,n+1)]},String(e.props.id??n))}),
13
+ /* @__PURE__ */K("button",{type:"button",className:"sf-add-card",onClick:Ze,children:[
14
+ /* @__PURE__ */$("span",{className:"sf-plus sf-plus--sm",children:"+"}),De.addLabel]}),Se?Me.partRows?.(Ne,_):null]}):qe(Ne,1)})})]}),
15
15
  /* @__PURE__ */$("div",{className:"sf-center",children:/* @__PURE__ */$("div",{className:"sf-preview-host",children:/* @__PURE__ */$(fe,{})})}),
16
- /* @__PURE__ */$(s,{value:{selectChild:(e,n,o,r)=>"section"===Me(r)?.source?We(n,o):Ke(e,n,o),addChild:(e,n,o,r,t)=>"section"===Me(t)?.source?Xe():$e(`${e}:${n}`,o,r),childRowName:He,blockRowName:Qe},children:/* @__PURE__ */$(je,{mode:ce,onOpenWebsiteSettings:ve.openSettings??(()=>{}),onSelectNode:Fe,hideNodeActions:!0})})]})]})}export{ee as default};
16
+ /* @__PURE__ */$(s,{value:{selectChild:(e,n,o,r)=>"section"===Le(r)?.source?We(n,o):Ke(e,n,o),addChild:(e,n,o,r,t)=>"section"===Le(t)?.source?Ze():$e(`${e}:${n}`,o,r),childRowName:He,blockRowName:Qe},children:/* @__PURE__ */$(je,{mode:ce,onOpenWebsiteSettings:Me.openSettings??(()=>{}),onSelectNode:Ee,hideNodeActions:!0})})]})]})}export{ee as default};
@@ -1 +1 @@
1
- import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-4WEGYBTV.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-6QSPOILR.js";import"../chunk-7VP5RXNO.js";import"../chunk-26OOWIJJ.js";import"../chunk-AVYFZZAP.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-2GVCAIPX.js";import"../chunk-U2DVXW2H.js";import"../chunk-7F52SZOI.js";import"../chunk-R2HLPNQF.js";import"../chunk-TBF5CVPA.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-J2JBETVO.js";import"../chunk-KCBEE2MC.js";import"../chunk-42TMLDSQ.js";import"../chunk-OFNXIZEP.js";import"../chunk-FRGCTHDB.js";import"../chunk-IYT6NN2J.js";import"../chunk-IMRJHRQ2.js";import"../chunk-KNUFI3WV.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-PRSTFWUY.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";import"../chunk-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-2WVZ3CK3.js";import"../chunk-5ZBY24K7.js";import"../chunk-PA3PNTVV.js";import"../chunk-BVN33R76.js";import"../chunk-5SOSVTVI.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-ZN752E2O.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-55IKQFBW.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-6WY6ZXJG.js";import"../chunk-BF3PIXZD.js";import"../chunk-PDZXAFNX.js";import"../chunk-AELNNAFM.js";import"../chunk-CRPJGCSO.js";import"../chunk-OZ72A6MY.js";import"../chunk-UFY6RNMT.js";import"../chunk-YNOZ5NXW.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-QASZFO4S.js";import"../chunk-4VJATVVR.js";import"../chunk-BDTITTMW.js";import"../chunk-H6DDIBQ4.js";import"../chunk-GTDLBUOC.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-6HHHBBSY.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-PAELDYYS.js";import"../chunk-ZNCEOSXO.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-6B4276GZ.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-6QSPOILR.js";import"../chunk-TNTV7UZ6.js";import"../chunk-26OOWIJJ.js";import"../chunk-7P6IFCR4.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-2GVCAIPX.js";import"../chunk-PAM3NLFL.js";import"../chunk-7F52SZOI.js";import"../chunk-R2HLPNQF.js";import"../chunk-TBF5CVPA.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-J2JBETVO.js";import"../chunk-KCBEE2MC.js";import"../chunk-42TMLDSQ.js";import"../chunk-OFNXIZEP.js";import"../chunk-FRGCTHDB.js";import"../chunk-IYT6NN2J.js";import"../chunk-MTRFMGBO.js";import"../chunk-2I7MAA2U.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-WZMU646D.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";import"../chunk-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-QVWPI2FL.js";import"../chunk-5ZBY24K7.js";import"../chunk-PA3PNTVV.js";import"../chunk-BVN33R76.js";import"../chunk-5SOSVTVI.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-ZN752E2O.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-55IKQFBW.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-6WY6ZXJG.js";import"../chunk-MCHMF32I.js";import"../chunk-PDZXAFNX.js";import"../chunk-AELNNAFM.js";import"../chunk-CRPJGCSO.js";import"../chunk-OZ72A6MY.js";import"../chunk-UFY6RNMT.js";import"../chunk-YNOZ5NXW.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-QASZFO4S.js";import"../chunk-4VJATVVR.js";import"../chunk-BDTITTMW.js";import"../chunk-H6DDIBQ4.js";import"../chunk-GTDLBUOC.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-6HHHBBSY.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-PAELDYYS.js";import"../chunk-ZNCEOSXO.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{DEVICE_FIELD_MARKER,DEVICE_HIDDEN_ATTR,DEVICE_NOTE,deviceField,deviceMetaOf,deviceNote,shownTier,withoutDeviceGate}from"../../../chunk-U2DVXW2H.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-BF3PIXZD.js";import"../../../chunk-MFIRYGHW.js";
1
+ export{DEVICE_FIELD_MARKER,DEVICE_HIDDEN_ATTR,DEVICE_NOTE,deviceField,deviceMetaOf,deviceNote,shownTier,withoutDeviceGate}from"../../../chunk-PAM3NLFL.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-MCHMF32I.js";import"../../../chunk-MFIRYGHW.js";
@@ -1 +1 @@
1
- export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-AVYFZZAP.js";import"../../../chunk-ZE7I3PLX.js";import"../../../chunk-U2DVXW2H.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-R2HLPNQF.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-BF3PIXZD.js";import"../../../chunk-MFIRYGHW.js";
1
+ export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-7P6IFCR4.js";import"../../../chunk-ZE7I3PLX.js";import"../../../chunk-PAM3NLFL.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-R2HLPNQF.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-MCHMF32I.js";import"../../../chunk-MFIRYGHW.js";
@@ -217,6 +217,8 @@ type ScreenWords = {
217
217
  /** The Layers head's button, while every section is folded, and while not. */
218
218
  expandAll: string;
219
219
  collapseAll: string;
220
+ /** …its tooltip while the page has nothing to fold, and the button is off. */
221
+ nothingToFold: string;
220
222
  /** The pinned Footer's row where the page has no footer of its own: its tooltip. */
221
223
  editFooter: string;
222
224
  /** The box a row's name is typed in: its accessible name. */
@@ -1 +1 @@
1
- export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-BF3PIXZD.js";
1
+ export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-MCHMF32I.js";
@@ -1 +1 @@
1
- export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-2T3ED73A.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-BF3PIXZD.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
1
+ export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-WSNVBUPL.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-MCHMF32I.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
@@ -1,2 +1,2 @@
1
- import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-2T3ED73A.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-2T3ED73A.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-BF3PIXZD.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
1
+ import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-WSNVBUPL.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-WSNVBUPL.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-MCHMF32I.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
2
2
  return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "3.2.1",
3
+ "version": "3.6.0",
4
4
  "description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -1,5 +0,0 @@
1
- import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-5SOSVTVI.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-55IKQFBW.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-BF3PIXZD.js";import{useEasel as f}from"./chunk-PDZXAFNX.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-6HHHBBSY.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as B,jsxs as $,Fragment as O}from"react/jsx-runtime";var I=e=>`section:${e}`,v=e=>`block:${e}`,F=e=>`template:${e}`;function H({blocks:H,blocksOnly:V,at:x,onAdd:N,itemFor:A,session:D,siteWide:L,onClose:S,onHide:P,readOnly:Q}){const T=f(e=>e.config),X=p(),{labelAtLevel:w,categoryLabel:C,firstSection:R,Icon:W,Thumbnail:Y}=X,{blockIsOffered:Z}=m(),z=u("screen",d).add,K=u("drag",h).add,E=l(),[G,J]=y([]);b(()=>{let t=!1;const o=e=>Z(e,E);return s(E).list().then(n=>{if(t)return;const i=T.components;J(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[T,E]);const M=j(()=>t(T,X),[T]),q=e=>({type:I(e.type),label:e.name,cover:/* @__PURE__ */B(Y,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:z.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),U=j(()=>{const e=[];if(H&&H.choices.length>0&&a(H.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${z.inside({name:H.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:v(e.type),label:e.label,icon:/* @__PURE__ */B(W,{type:e.type,size:18}),title:z.tile({name:e.label})}))})}),V)return e;const t=o(M,R);t&&e.push({key:"start",title:z.startBlank,tiles:[q(t)]}),G.length>0&&e.push({key:"templates",title:z.templates,tiles:G.map(e=>{return{type:F(e.id),label:e.name,cover:/* @__PURE__ */B(Y,{type:e.node.type}),keywords:[(t=e.node.type,w(t,"section",T.components[t]?.label??t)),e.node.type]};var t})});const s=n(M,R);for(const t of Object.keys(T.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(T,t,C),tiles:o.map(q)})}return e},[H,V,G,M,T,z]),_=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=G.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
- return $(O,{children:[
3
- /* @__PURE__ */B(r,{icon:/* @__PURE__ */B(g,{size:15}),title:z.title,context:V?z.contextBlocks:z.contextAll,actions:/* @__PURE__ */B(c,{label:z.done,description:z.doneDescription,onClick:S}),onHide:P}),
4
- /* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
5
- /* @__PURE__ */B(k,{groups:U,session:D,itemFor:e=>A(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&N(t)},at:x,hint:V?z.hintBlocks:z.hint,searchLabel:V?z.searchBlocks:z.searchSections,readOnly:Q,words:K}),L&&!V?L:null]})]})}export{H as AddSidePanel,v as blockKey,I as sectionKey,F as templateKey};
@@ -1 +0,0 @@
1
- import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-U2DVXW2H.js";import{BUCKET_KEY as r}from"./chunk-R2HLPNQF.js";import{ANCHOR_FIELD_KEYS as e,foldMetaOf as s,MEDIA_FIELD_MARKER as c,TEXT_FIELD_MARKER as p,LINK_FIELD_MARKER as i}from"./chunk-DUVRZ456.js";import{STYLE_KIND as u,fieldKind as f,copyStyle as a,heldStyle as l,planPaste as m,pasteMessage as y}from"./chunk-V7U33NF2.js";var h=/* @__PURE__ */new Set([r.Style,r.Layout]),j=new Set(Object.values(r)),w=new Set(e),b=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[c,p,i];function S(t){return`site:${t??""}`}function g(t){if(!t||"object"!=typeof t)return null;const n=t,r=o(t)??t,e=n[u]??r[u];if("string"==typeof e)return e;const s=n.options??r.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(r)}function v(t){const n=t,r=o(t);return k.some(t=>t in n||r&&t in r)}function L(o,r){const e=t(o,r)??{},c=[];let p=!1;for(const[t,o]of Object.entries(e))j.has(t)?p=h.has(t):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(s(o)||w.has(t)||b.has(t)||v(o)||"slot"!==o.type&&c.push({path:[t],kind:g(o),counted:"mobile"!==n(o)?.tier}));return c}function d(t,o,n,r,e){a({scope:n,type:r.type,label:e,rows:t(o,r),props:r.props})}function F(t,o,n,r,e,s){const c=l(n);if(!c)return null;const p=m(c,{type:r.type,rows:t(o,r),props:r.props});return{...p,message:y(p,c.sourceLabel,e,s)}}function U(t,o,n,r){d(L,t,o,n,r)}function V(t,o,n,r,e){return F(L,t,o,n,r,e)}var A={scope:t=>S(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,r)=>U(r,t,o,n),plan:(t,o,n,r)=>V(r,t,o,n)};function D(t,o){if(!t&&!o)return A;const n=t?.rows,r=n?(t,o)=>n(t,o):L;return{scope:t?.scope??A.scope,rows:(t,o)=>r(t,o),copy:t?.copy??((t,o,n,e)=>d(r,e,t,o,n)),plan:t?.plan??((t,n,e,s)=>F(r,s,t,n,e,o))}}export{U as copyNodeStyle,L as nodeStyleRows,V as planNodePaste,g as shopFieldKind,S as siteStyleScope,D as styleClipboardOf};