efficient-easel 6.3.0 → 6.5.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.
Files changed (45) hide show
  1. package/dist/{canvas-typing-Dec_zyuM.d.ts → canvas-typing-U7TV-iax.d.ts} +16 -1
  2. package/dist/{chunk-H3WBX7FN.js → chunk-4UJ6CPLO.js} +1 -1
  3. package/dist/{chunk-I6U2G7L4.js → chunk-57NRNFLO.js} +1 -1
  4. package/dist/chunk-5PUEZ22M.js +1 -0
  5. package/dist/chunk-CIHKZMNR.js +1 -0
  6. package/dist/{chunk-X4OF36J2.js → chunk-CRWFB7MU.js} +11 -11
  7. package/dist/{chunk-CJBU4E4L.js → chunk-ESQZG7B3.js} +1 -1
  8. package/dist/{chunk-HAUTMX4H.js → chunk-GIP45GWF.js} +48 -48
  9. package/dist/{chunk-AYNU4FYF.js → chunk-HFW6D46X.js} +1 -1
  10. package/dist/chunk-M5VRWM7M.js +11 -0
  11. package/dist/chunk-NAGDOIW4.js +5 -0
  12. package/dist/{chunk-DQLK3QQ2.js → chunk-Q2L6YTII.js} +1 -1
  13. package/dist/{chunk-PRRFBVJ2.js → chunk-T5ORM737.js} +3 -3
  14. package/dist/chunk-TBY3DFKS.js +1 -0
  15. package/dist/{chunk-FXJBKKGI.js → chunk-TCVTMNYE.js} +1 -1
  16. package/dist/{chunk-QPQXKKSC.js → chunk-UY7BCB32.js} +1 -1
  17. package/dist/chunk-ZR4CFNMW.js +5 -0
  18. package/dist/copy/index.d.ts +1 -1
  19. package/dist/copy/index.js +18 -18
  20. package/dist/drag/index.js +1 -1
  21. package/dist/easel/index.d.ts +13 -1
  22. package/dist/easel/index.js +1 -1
  23. package/dist/fields/index.js +1 -1
  24. package/dist/screen/components/AddBlockRow.js +1 -1
  25. package/dist/screen/components/AddSidePanel.js +1 -1
  26. package/dist/screen/components/MediaSidePanel.js +1 -1
  27. package/dist/screen/components/ScreenChrome.js +1 -1
  28. package/dist/screen/components/ScreenMount.js +1 -1
  29. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  30. package/dist/screen/components/SectionScreenShell.js +16 -16
  31. package/dist/screen/components/usePartBridge.js +1 -1
  32. package/dist/screen/index.js +1 -1
  33. package/dist/screen/lib/key-scope.js +1 -1
  34. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  35. package/dist/screen/lib/screen-parts.js +1 -1
  36. package/dist/strings/catalogue.d.ts +5 -2
  37. package/dist/strings/catalogue.js +1 -1
  38. package/dist/strings/index.js +1 -1
  39. package/package.json +1 -1
  40. package/dist/chunk-AELNNAFM.js +0 -1
  41. package/dist/chunk-B4ZNYLZX.js +0 -5
  42. package/dist/chunk-DSUMM2WF.js +0 -10
  43. package/dist/chunk-EXCKAZKN.js +0 -5
  44. package/dist/chunk-JIWPANGM.js +0 -1
  45. package/dist/chunk-T5HFGW57.js +0 -1
@@ -1,4 +1,4 @@
1
- import{DEFAULT_DRAG_WORDS as e}from"./chunk-O2NLQBFX.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as r,isNoOpDrop as a}from"./chunk-67GNT6PF.js";import{useCanvasLayout as o,useCanvasEvent as s,CANVAS_TYPING_EVENT as i,framePointToHost as c,elementScale as d,frameRectToLayer as u,clientPointToLayer as h}from"./chunk-AWJUYMX7.js";import{withTip as f}from"./chunk-P2VEMZH5.js";import{parseZoneKey as p}from"./chunk-KRXQM65X.js";import{useRef as m,useEffect as g,useState as y,useCallback as b,useMemo as v,useSyncExternalStore as x,useId as k,useLayoutEffect as w}from"react";import{Tooltip as N,Input as A,IconButton as z}from"efficient-shell/ui";import{jsxs as D,jsx as T}from"react/jsx-runtime";import{CloseIcon as C,SearchIcon as $}from"efficient-shell/icons/efficient";var S=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,E=e=>e.width*e.height;function L(e,t,n){return e.map((e,t)=>({s:e,at:t})).filter(({s:e})=>S(e.box,t,n)).sort((e,t)=>E(t.s.box)-E(e.s.box)||e.at-t.at).map(({s:e})=>e)}function M(e,t,n){return L(e,t,n).at(-1)??null}function j(e,t,n){const l="x"===e.axis?t:n;let r=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(r+=1)}return r}function B(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],r=n[t],a=l&&r?(l.left+l.width+r.left)/2:l?l.left+l.width:r?r.left:e.box.left,o=r??l??e.box;return{left:a-1,top:o.top,width:2,height:o.height}}const l=n[t-1],r=n[t],a=l&&r?(l.top+l.height+r.top)/2:l?l.top+l.height:r?r.top:e.box.top;return{left:e.box.left,top:a-1,width:e.box.width,height:2}}function K(e,t,n,l,r=()=>!1,a=()=>!0){const o=e.filter(e=>S(e.box,t,n)).sort((e,t)=>E(e.box)-E(t.box));for(const e of o){const o=j(e,t,n),s={...e.list,index:o};if(r(s))return null;if(l(s))return{zone:e,to:s,line:B(e,o)};if(!a(s))return null}return null}function X(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const r=e.children[l-1],a=e.children[l],o=r.top+r.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(a.top-o,0)}})}return n}var q={nodes:[],zones:[]},O="data-puck-dropzone",P="data-puck-component";function F(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function R(e,t){const{frame:n,document:l}=e,r=e=>u(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),a=[],o=[];for(const e of l.querySelectorAll(`[${O}]`)){const t=e.getAttribute(O)??"";let n;try{n=p(t)}catch{continue}const l=[...e.querySelectorAll(`[${P}]`)].filter(t=>t.parentElement?.closest(`[${O}]`)===e),s=l.map(r);o.push({key:t,list:n,box:r(e),axis:F(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(P);l&&a.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:a,zones:o}}var Y="data-es-empty-cell",Z="data-puck-dropzone",I=140;var Q=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function V(u){const{canvas:f,session:p,readOnly:k,words:A=e.canvas}=u,z=m(u);g(()=>{z.current=u});const C=m(null),$=o(f),[S,E]=y(0),M=b(()=>E(e=>e+1),[]),[j,B]=y(q);g(()=>{const e=C.current;f&&e&&B((z.current.measure??R)(f,e))},[f,$,u.revision,S]);const X=u.model,O=v(()=>X(j),[X,j]),P=x(p.subscribe,p.shown,p.shown),F=u.choose,I=(e,t)=>{const n=L(O.sources,e,t);return 0===n.length?null:F?F(n):n[n.length-1]},[V,W]=y(null),[G,H]=y(null),J=m(null),U=()=>{J.current&&clearTimeout(J.current),J.current=null},_=()=>{U(),J.current=setTimeout(()=>{p.get()||W(null)},140)};g(()=>U,[]);const ee=m(null),te=m(!1);s(f,i,e=>{te.current=Boolean(e.detail?.typing),te.current&&(U(),W(null))}),s(f,"mousemove",e=>{const t=C.current;if(!f||!t)return;const n=c(f.frame,e.clientX,e.clientY,t),l=d(t),r={x:n.x/l,y:n.y/l};if(ee.current=r,z.current.readOnly||p.get()||te.current)return;U();const a=I(r.x,r.y);W(e=>e?.key===a?.key&&e?.box===a?.box?e:a)}),s(f,"mouseout",e=>{e.relatedTarget||(ee.current=null,_())}),s(f,"mouseover",e=>{e.relatedTarget||M()});const ne=m(null),le=b(()=>{ne.current?.(),ne.current=null,H(null)},[]);g(()=>p.subscribe(()=>{p.get()?M():le()}),[p,le,M]),g(()=>le,[le]),("undefined"==typeof document?g:w)(()=>{if(p.get())return;const e=ee.current;W(t=>k?null:e?I(e.x,e.y):t?O.sources.find(e=>e.key===t.key)??null:null)},[O,P,p,k,F]);const re=e=>{const t=p.get(),n=C.current;if(!t||!n)return null;const l=h(n,e.clientX,e.clientY);ee.current=l;const r=K(O.zones,l.x,l.y,e=>z.current.canDrop(t.item,e),e=>!!t.from&&a(t.from,e),e=>z.current.fallThrough?.(t.item,e,t.from)??!0);return r?{h:t,t:r}:null},ae={onDragEnter:e=>{if(ne.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),a=f?l(f.document):null,o=[];t&&o.push(r(t)),a&&f&&o.push(r(a,f.frame)),ne.current=o.length?()=>o.forEach(e=>e()):null},onDragOver:e=>{const n=re(e);if(!n)return void H(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const l={zoneKey:n.t.zone.key,line:n.t.line,axis:n.t.zone.axis};H(e=>e&&e.zoneKey===l.zoneKey&&e.line.left===l.line.left&&e.line.top===l.line.top?e:l)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(ee.current=null,H(null))},onDrop:e=>{const t=re(e);t&&(e.preventDefault(),p.end(),le(),z.current.onDrop(t.h.item,t.t.to))}},oe={draggable:!k&&!!V,onMouseEnter:U,onMouseLeave:()=>!p.get()&&_(),onDragStart:e=>{if(V&&!k){p.start({key:V.key,item:V.item,from:V.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",V.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{p.end(),le()},onClick:()=>{V&&!k&&z.current.onPick?.(V.item)}},{seams:se=[]}=O,ie=O.zones.filter(e=>0===e.children.length),ce=u.onZoneAdd&&!k?ie:[],de=ce.map(e=>e.key).join("\n");return g(()=>{const e=f?.document;if(!e)return;const t=new Set(de?de.split("\n"):[]);for(const n of e.querySelectorAll(`[${Z}]`))n.toggleAttribute(Y,t.has(n.getAttribute(Z)??""));return()=>{for(const t of e.querySelectorAll(`[${Y}]`))t.removeAttribute(Y)}},[f,de,j,$,S]),/* @__PURE__ */D("div",{ref:C,className:"es-canvas-layer",children:[P||!u.onSeamAdd||k?null:se.map(e=>/* @__PURE__ */T("div",{className:"es-canvas-seam",style:{left:e.box.left,top:e.box.top+e.box.height/2-8,width:e.box.width,height:16},children:/* @__PURE__ */T("button",{type:"button",className:"es-canvas-seam-add",onClick:()=>u.onSeamAdd?.(e.place),children:A.addButton({label:u.seamLabel??A.addSection})})},e.key)),ce.length?ce.map(e=>/* @__PURE__ */T("button",{type:"button",className:["es-canvas-empty",e.addAlways?"is-always":"",G?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:Q(e.box),onClick:()=>u.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */T("span",{className:"es-canvas-empty-add",children:A.addButton({label:e.addLabel??u.zoneAddLabel??A.addBlock})})},e.key)):null,P?/* @__PURE__ */T("div",{className:"es-canvas-catch",...ae}):null,G&&!ie.some(e=>e.key===G.zoneKey)?/* @__PURE__ */T("div",{className:`es-canvas-line is-${G.axis}`,style:Q(G.line)}):null,
1
+ import{DEFAULT_DRAG_WORDS as e}from"./chunk-O2NLQBFX.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as r,isNoOpDrop as a}from"./chunk-67GNT6PF.js";import{useCanvasLayout as o,useCanvasEvent as s,CANVAS_TYPING_EVENT as i,framePointToHost as c,elementScale as d,frameRectToLayer as u,clientPointToLayer as h}from"./chunk-AWJUYMX7.js";import{withTip as f}from"./chunk-P2VEMZH5.js";import{parseZoneKey as p}from"./chunk-KRXQM65X.js";import{useRef as m,useEffect as g,useState as y,useCallback as b,useMemo as v,useSyncExternalStore as x,useId as k,useLayoutEffect as w}from"react";import{Tooltip as N,Input as A,IconButton as z}from"efficient-shell/ui";import{jsxs as D,jsx as T}from"react/jsx-runtime";import{CloseIcon as C,SearchIcon as $}from"efficient-shell/icons/efficient";var S=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,E=e=>e.width*e.height;function L(e,t,n){return e.map((e,t)=>({s:e,at:t})).filter(({s:e})=>S(e.box,t,n)).sort((e,t)=>E(t.s.box)-E(e.s.box)||e.at-t.at).map(({s:e})=>e)}function M(e,t,n){return L(e,t,n).at(-1)??null}function j(e,t,n){const l="x"===e.axis?t:n;let r=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(r+=1)}return r}function B(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],r=n[t],a=l&&r?(l.left+l.width+r.left)/2:l?l.left+l.width:r?r.left:e.box.left,o=r??l??e.box;return{left:a-1,top:o.top,width:2,height:o.height}}const l=n[t-1],r=n[t],a=l&&r?(l.top+l.height+r.top)/2:l?l.top+l.height:r?r.top:e.box.top;return{left:e.box.left,top:a-1,width:e.box.width,height:2}}function K(e,t,n,l,r=()=>!1,a=()=>!0){const o=e.filter(e=>S(e.box,t,n)).sort((e,t)=>E(e.box)-E(t.box));for(const e of o){const o=j(e,t,n),s={...e.list,index:o};if(r(s))return null;if(l(s))return{zone:e,to:s,line:B(e,o)};if(!a(s))return null}return null}function X(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const r=e.children[l-1],a=e.children[l],o=r.top+r.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(a.top-o,0)}})}return n}var q={nodes:[],zones:[]},O="data-puck-dropzone",P="data-puck-component";function F(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function R(e,t){const{frame:n,document:l}=e,r=e=>u(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),a=[],o=[];for(const e of l.querySelectorAll(`[${O}]`)){const t=e.getAttribute(O)??"";let n;try{n=p(t)}catch{continue}const l=[...e.querySelectorAll(`[${P}]`)].filter(t=>t.parentElement?.closest(`[${O}]`)===e),s=l.map(r);o.push({key:t,list:n,box:r(e),axis:F(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(P);l&&a.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:a,zones:o}}var Y="data-es-empty-cell",Z="data-puck-dropzone",I=140;var Q=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function V(u){const{canvas:f,session:p,readOnly:k,words:A=e.canvas}=u,z=m(u);g(()=>{z.current=u});const C=m(null),$=o(f),[S,E]=y(0),M=b(()=>E(e=>e+1),[]),[j,B]=y(q);g(()=>{const e=C.current;f&&e&&B((z.current.measure??R)(f,e))},[f,$,u.revision,S]);const X=u.model,O=v(()=>X(j),[X,j]),P=x(p.subscribe,p.shown,p.shown),F=u.choose,I=(e,t)=>{const n=L(O.sources,e,t);return 0===n.length?null:F?F(n):n[n.length-1]},[V,W]=y(null),[G,H]=y(null),J=m(null),U=()=>{J.current&&clearTimeout(J.current),J.current=null},_=()=>{U(),J.current=setTimeout(()=>{p.get()||W(null)},140)};g(()=>U,[]);const ee=m(null),te=m(!1);s(f,i,e=>{te.current=Boolean(e.detail?.typing),te.current&&(U(),W(null))}),s(f,"mousemove",e=>{const t=C.current;if(!f||!t)return;const n=c(f.frame,e.clientX,e.clientY,t),l=d(t),r={x:n.x/l,y:n.y/l};if(ee.current=r,z.current.readOnly||p.get()||te.current)return;U();const a=I(r.x,r.y);W(e=>e?.key===a?.key&&e?.box===a?.box?e:a)}),s(f,"mouseout",e=>{e.relatedTarget||(ee.current=null,_())}),s(f,"mouseover",e=>{e.relatedTarget||M()});const ne=m(null),le=b(()=>{ne.current?.(),ne.current=null,H(null)},[]);g(()=>p.subscribe(()=>{p.get()?M():le()}),[p,le,M]),g(()=>le,[le]),("undefined"==typeof document?g:w)(()=>{if(p.get())return;const e=ee.current;W(t=>k||te.current?null:e?I(e.x,e.y):t?O.sources.find(e=>e.key===t.key)??null:null)},[O,P,p,k,F]);const re=e=>{const t=p.get(),n=C.current;if(!t||!n)return null;const l=h(n,e.clientX,e.clientY);ee.current=l;const r=K(O.zones,l.x,l.y,e=>z.current.canDrop(t.item,e),e=>!!t.from&&a(t.from,e),e=>z.current.fallThrough?.(t.item,e,t.from)??!0);return r?{h:t,t:r}:null},ae={onDragEnter:e=>{if(ne.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),a=f?l(f.document):null,o=[];t&&o.push(r(t)),a&&f&&o.push(r(a,f.frame)),ne.current=o.length?()=>o.forEach(e=>e()):null},onDragOver:e=>{const n=re(e);if(!n)return void H(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const l={zoneKey:n.t.zone.key,line:n.t.line,axis:n.t.zone.axis};H(e=>e&&e.zoneKey===l.zoneKey&&e.line.left===l.line.left&&e.line.top===l.line.top?e:l)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(ee.current=null,H(null))},onDrop:e=>{const t=re(e);t&&(e.preventDefault(),p.end(),le(),z.current.onDrop(t.h.item,t.t.to))}},oe={draggable:!k&&!!V,onMouseEnter:U,onMouseLeave:()=>!p.get()&&_(),onDragStart:e=>{if(V&&!k){p.start({key:V.key,item:V.item,from:V.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",V.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{p.end(),le()},onClick:()=>{V&&!k&&z.current.onPick?.(V.item)}},{seams:se=[]}=O,ie=O.zones.filter(e=>0===e.children.length),ce=u.onZoneAdd&&!k?ie:[],de=ce.map(e=>e.key).join("\n");return g(()=>{const e=f?.document;if(!e)return;const t=new Set(de?de.split("\n"):[]);for(const n of e.querySelectorAll(`[${Z}]`))n.toggleAttribute(Y,t.has(n.getAttribute(Z)??""));return()=>{for(const t of e.querySelectorAll(`[${Y}]`))t.removeAttribute(Y)}},[f,de,j,$,S]),/* @__PURE__ */D("div",{ref:C,className:"es-canvas-layer",children:[P||!u.onSeamAdd||k?null:se.map(e=>/* @__PURE__ */T("div",{className:"es-canvas-seam",style:{left:e.box.left,top:e.box.top+e.box.height/2-8,width:e.box.width,height:16},children:/* @__PURE__ */T("button",{type:"button",className:"es-canvas-seam-add",onClick:()=>u.onSeamAdd?.(e.place),children:A.addButton({label:u.seamLabel??A.addSection})})},e.key)),ce.length?ce.map(e=>/* @__PURE__ */T("button",{type:"button",className:["es-canvas-empty",e.addAlways?"is-always":"",G?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:Q(e.box),onClick:()=>u.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */T("span",{className:"es-canvas-empty-add",children:A.addButton({label:e.addLabel??u.zoneAddLabel??A.addBlock})})},e.key)):null,P?/* @__PURE__ */T("div",{className:"es-canvas-catch",...ae}):null,G&&!ie.some(e=>e.key===G.zoneKey)?/* @__PURE__ */T("div",{className:`es-canvas-line is-${G.axis}`,style:Q(G.line)}):null,
2
2
  /* @__PURE__ */T("div",{className:"es-canvas-handle-spot",style:V?{"--es-handle-x":`${V.box.left+2}px`,"--es-handle-y":`${Math.max(V.box.top-11,0)}px`}:void 0,children:/* @__PURE__ */T(N,{className:"es-canvas-handle-tip",side:"top",content:!V||k||P?null:V.title??A.handle({label:V.label}),children:/* @__PURE__ */D("div",{className:["es-canvas-handle",V&&!k?"is-shown":"",P?"is-dragging":""].filter(Boolean).join(" "),...oe,children:[
3
3
  /* @__PURE__ */T("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),V?.label]})})})]})}var W=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function G({groups:t,session:n,itemFor:l,onInsert:r,at:a,hint:o,searchLabel:s,readOnly:i,words:c=e.add}){const d=o??c.hint,u=s??c.search,[h,p]=y(""),m=k(),g=h.trim().toLowerCase(),b=function(e){const t=/* @__PURE__ */new Map;return e.map(e=>{const n=e.key??e.title,l=t.get(n)??0;return t.set(n,l+1),0===l?n:`${n}\0${l}`})}(t),v=t.map((e,t)=>({...e,key:b[t],tiles:g?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,g)):e.tiles})).filter(e=>e.tiles.length>0),x=(e,t)=>r=>{if(t)r.preventDefault();else{n.start({key:`new:${e}`,item:l(e)}),r.dataTransfer.effectAllowed="copy";try{r.dataTransfer.setData("text/plain",e)}catch{}}};/* @__PURE__ */
4
4
  return D("div",{className:"es-add",children:[a?/* @__PURE__ */D("div",{className:"es-add-at",role:"status",children:[
@@ -0,0 +1,11 @@
1
+ import{DEFAULT_CANVAS_WORDS as e}from"./chunk-TBY3DFKS.js";import{useResolvedFields as t}from"./chunk-YRLPFZW3.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r,parentStep as i,clickPick as a}from"./chunk-UK2FQOUT.js";import{startCanvasTyping as s,textMap as l}from"./chunk-CIHKZMNR.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as d,isTypingTarget as u,frameRectToHost as p,CANVAS_TYPING_EVENT as f}from"./chunk-AWJUYMX7.js";import{find as h,ROOT_ID as m,getList as g,remove as v,parseZoneKey as y,move as w,duplicate as k,replaceNode as b,createNode as S,insert as I,normalizeData as C,createResolveCache as E,resolveNodeData as x,ROOT_SLOT as D}from"./chunk-KRXQM65X.js";import{topLevelSlotKeys as O,fieldsFrom as A,defaultsFrom as M}from"./chunk-NKB3KVAB.js";import{createContext as K,useEffect as P,useContext as z,useRef as R,useSyncExternalStore as B,useState as N,useMemo as Z,useCallback as $,useLayoutEffect as j}from"react";import{jsx as L,jsxs as F}from"react/jsx-runtime";import{createPortal as V}from"react-dom";import{FloatingBar as H,TextToolbar as T}from"efficient-shell/ui";function Y(e){return!["setData","setUi","set"].includes(e.type)}var U=(e,t,n,o)=>{const r=g(e,t,y(n));return r?.[o]??null},W=(e,t,n,o,r)=>{const i=U(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function q(e,t){const{selection:o}=e;return{...e.ui,itemSelector:n(e.data,t,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function X(e,t,n){return n?"node"===n.kind?h(e,t,n.id)?n:null:n.parentId===m?g(e,t,n)?n:null:h(e,t,n.parentId)&&g(e,t,n)?n:null:null}function Q(e,t,n,r=!1){const{itemSelector:i,selectedSlot:a,...s}=n;let l=e.selection;var c;return"itemSelector"in n&&(l=o(e.data,t,i??null)),"selectedSlot"in n&&(a?l=(c=a)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===l?.kind&&(l=null)),{...e,selection:l,ui:r?s:{...e.ui,...s}}}function G(e,t,n){const o=J(e,t,n);if(o===e)return e;const r=X(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function J(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return Q(e,n,"function"==typeof t.ui?t.ui(q(e,n)):t.ui);case"set":{const r={data:o,ui:q(e,n)},i="function"==typeof t.state?t.state(r):t.state;let a=i.data?{...e,data:i.data}:e;return i.ui&&(a=Q(a,n,i.ui,!0)),a}case"insert":{const r={...y(t.destinationZone),index:t.destinationIndex},i=S(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:I(o,n,r,i)}}case"replace":{const r=W(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:b(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=W(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=k(o,n,r.props.id),a=U(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:a?{kind:"node",id:a.props.id}:e.selection}}case"reorder":return J(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=U(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...y(t.destinationZone),index:t.destinationIndex};return{...e,data:w(o,n,r.props.id,i)}}case"remove":{const r=W(o,n,t.zone,t.index,"remove");return{...e,data:v(o,n,r.props.id)}}default:return e}}var _={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},ee={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},te=0,ne=()=>`history-${te+=1}`;function oe(e){let t=e.config;const r=e.now??(()=>Date.now()),i=e.historyCoalesceMs??250;let a=e.permissions??{};const s=C(e.data,t);let l={data:s,selection:null,ui:{...ee}};if(e.ui){const{itemSelector:n,selectedSlot:r,...i}=e.ui;l={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...ee,...i}}}let c=[{core:l,at:-1/0,sealed:!0,id:ne()}],d=0;const u=e=>{const t=c[d],n=r();!e&&d===c.length-1&&d>0&&!t.sealed&&n-t.at<i?c=[...c.slice(0,d),{...t,core:l,at:n}]:(c=[...c.slice(0,d+1),{core:l,at:n,sealed:e,id:ne()}],d=c.length-1)},p=/* @__PURE__ */new Set;let f=null,m=null,v=0,y=null,w=!1;const k=()=>{for(const e of[...p])e()},S=()=>{c=[...c.slice(0,d),{...c[d],core:l},...c.slice(d+1)]},I=(t,n)=>{v>0?w=w||n:(n?u(!1):l!==t&&S(),l.data!==t.data&&e.onChange?.(l.data),l!==t&&k())},D=e=>{const n=l;if(l=G(l,e,t),l===n)return;const o=e.recordHistory??Y(e);I(n,o&&l.data!==n.data)},O=t=>{0===v&&(y=l,w=!1),v+=1;try{t()}catch(e){throw v-=1,0===v&&y&&(l=y,y=null),e}if(v-=1,v>0||!y)return;const n=y;y=null,w&&l.data!==n.data?u(!0):l!==n&&S(),l.data!==n.data&&e.onChange?.(l.data),l!==n&&k()},A=e=>{const n=l,o=X(l.data,t,e);var r,i;(r=o,i=l.selection,r===i||r&&i&&r.kind===i.kind&&("node"===r.kind&&"node"===i.kind?r.id===i.id:"slot"===r.kind&&"slot"===i.kind&&r.parentId===i.parentId&&r.slot===i.slot))||(l={...l,selection:o},I(n,!1))},M=t=>{const n=l;d=t,l=c[d].core,l.data!==n.data&&e.onChange?.(l.data),l!==n&&k()},K=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{..._,...a,...n}};let P=K();const z=E(),R={resolveCache:z,async resolveAll({trigger:e="load",metadata:n}={}){const o=l.data,r={type:"root",props:{...o.root.props??{}}},i=[...o.content,...Object.values(o.zones??{}).flat()],[a,...s]=await Promise.all([x(r,t,{cache:z,trigger:e,metadata:n}),...i.map(o=>x(o,t,{cache:z,trigger:e,metadata:n}))]);O(()=>{const e=l;let n=l.data;s.forEach((e,r)=>{if(!e.didChange)return;const a=i[r].props.id,s=h(n,t,a)?.node;s&&s===h(o,t,a)?.node&&(n=b(n,t,a,e.node))}),a.didChange&&n.root===o.root&&(n={...n,root:{...n.root,props:a.node.props,readOnly:a.node.readOnly??n.root.readOnly}}),n!==l.data&&(l={...l,data:n,selection:X(n,t,l.selection)},I(e,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=h(l.data,t,e)?.node;if(!r)return!1;const i=await x(r,t,{cache:z,trigger:n,metadata:o});if(!i.didChange)return!1;let a=!1;return O(()=>{const n=l;if(h(l.data,t,e)?.node!==r)return;const o=b(l.data,t,e,i.node);o!==l.data&&(l={...l,data:o,selection:X(o,t,l.selection)},I(n,!1),a=!0)}),a},get config(){return t},getState(){if(f&&m===l)return f;const e=l,o={data:e.data,ui:q(e,t)},r="node"===e.selection?.kind?h(e.data,t,e.selection.id)?.node??null:null;return f={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:D,history:{back:()=>R.undo(),forward:()=>R.redo(),hasPast:d>0,hasFuture:d<c.length-1,histories:c.map(e=>({id:e.id,state:{data:e.core.data,ui:q(e.core,t)}})),index:d,setHistoryIndex:e=>{e>=0&&e<c.length&&e!==d&&M(e)}},getPermissions:P,getItemById:n=>h(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return g(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:o=>{const r=n(e.data,t,{kind:"node",id:o});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},m=e,f},subscribe:e=>(p.add(e),()=>{p.delete(e)}),dispatch:D,batch:O,group:()=>{const e=d,t=c[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,c[e]?.id!==t)return;if(d<=e+1)return void(d===e+1&&(c=[...c.slice(0,d),{...c[d],sealed:!0},...c.slice(d+1)]));const o=c[d];c=[...c.slice(0,e+1),{...o,sealed:!0},...c.slice(d+1)],d=e+1}}},select:e=>A(e?{kind:"node",id:e}:null),selectSlot:e=>A(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){O(()=>{const n=l,o=void 0===e.select?l.selection:e.select;l={...l,data:e.data,selection:X(e.data,t,o)},I(n,e.data!==n.data)})},load(e,n={}){const o=l,r=C(e,t);l={...l,data:r,selection:X(r,t,n.selection??l.selection)},n.keepHistory||(c=[{core:l,at:-1/0,sealed:!0,id:ne()}],d=0),l!==o&&k()},undo(){d>0&&M(d-1)},redo(){d<c.length-1&&M(d+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,a)||(a=e,P=K(),f=null,k())},setConfig(e){e!==t&&(t=e,P=K(),f=null,k())}};return R}function re(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&u(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var ie=K(null),ae=K(!0);function se({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return P(()=>{n&&e.resolveAll()},[e,n]),P(()=>{if(t&&"undefined"!=typeof document)return re(document,e)},[e,t]),/* @__PURE__ */L(ie.Provider,{value:e,children:/* @__PURE__ */L(ae.Provider,{value:t,children:o})})}function le(){const e=z(ie);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function ce(e){const t=le(),n=R({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const i=e(o);return r.has&&Object.is(r.value,i)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:i,has:!0},i)};return B(t.subscribe,o,o)}function de(){return function(e){return ce(e)}}var ue="data-puck-component",pe="data-puck-dropzone",fe={},he="data-es-mirror",me="undefined"==typeof window?P:j;function ge(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${he}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(he,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function ve({children:t,id:n="preview-frame",title:o,className:r,style:i,mirrorStyles:a=!0,onDocument:s,height:l="auto",nonce:u}){const p=c("canvas",e),f=R(null),[h,m]=N(null);return me(()=>{const e=f.current,t=h?.ownerDocument.defaultView;if("auto"!==l||!e||!h||!t)return;const n=()=>{e.style.height=`${Math.ceil(h.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(h),()=>r?.disconnect()},[h,l]),me(()=>{let e=f.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=f.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-puck-entry",""),t.id="frame-root","fill"===l&&t.classList.add("es-frame-fill"),e.body.appendChild(t),d(e,u),m(t),s?.(e);let n=null;const o=f.current?.ownerDocument;if(a&&o){ge(o,e,u);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>ge(o,e,u)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),m(null),s?.(null)}},[]),/* @__PURE__ */L("iframe",{ref:f,id:n,title:o??p.frame,className:["es-canvas-frame","fill"===l?"is-fill":"",r??""].filter(Boolean).join(" "),style:i,children:h?V(t,h):null})}var ye=K(null),we=K(fe),ke=[];function be({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const a=le(),s=ce(n=>g(n.appState.data,a.config,{parentId:e,slot:t})??ke),l=ce(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==m),c=ce(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=z(ye),u=["es-zone"];return s.length&&u.push("has-children"),e===m&&u.push("is-root"),(l||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==m&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */L("div",{className:u.join(" "),[pe]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */L(Ce,{node:e},e.props.id))})}function Se(e,t,n,o){const r="root"===t?e.root:e.components[t],i={...o};for(const e of O(A(r)))i[e]=function(t={}){/* @__PURE__ */
2
+ return L(be,{parentId:n,slot:e,...t})};return i}function Ie(e){return function({zone:t,...n}){/* @__PURE__ */
3
+ return L(be,{parentId:e,slot:t,...n})}}function Ce({node:e}){const t=le().config,n=t.components[e.type],o=e.props.id,r=function(e){const t=R(null);return Z(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(ue),o.removeAttribute("data-puck-dnd")),t.current=n,n&&(n.setAttribute(ue,e),n.setAttribute("data-puck-dnd",e),n.style.position="relative")},[e])}(o),i=z(we);if(!n?.render)return null;const a=n.render,s=Se(t,e.type,o,{...M(n),...e.props}),l={renderDropZone:Ie(o),isEditing:!0,dragRef:n.inline?r:null,metadata:{...i,...n.metadata}};return n.inline?/* @__PURE__ */L(a,{...s,puck:l,editMode:!0}):/* @__PURE__ */L("div",{[ue]:o,"data-puck-dnd":o,style:{position:"relative"},children:/* @__PURE__ */L(a,{...s,puck:l,editMode:!0})})}function Ee({metadata:e}){const t=ce(e=>e.config),n=ce(e=>e.appState.data.root).props??{},o=t.root?.render,r=/* @__PURE__ */L(be,{parentId:m,slot:D}),i=o?/* @__PURE__ */L(o,{id:"puck-root",...Se(t,"root",m,n),puck:{renderDropZone:Ie(m),isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:r}):r;/* @__PURE__ */
4
+ return L(we.Provider,{value:e??fe,children:i})}function xe(e,t,n){const[o,r]=N(null),i=R(t);return i.current=t,me(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!i.current)return void r(null);let o=0;const a=()=>{o=0;const n=function(e,t){if(!e||!t)return null;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(i.current?i.current(t):null,e.current?.parentElement??null);r(e=>{return(t=e)===(o=n)||t&&o&&t.top===o.top&&t.left===o.left&&t.width===o.width&&t.height===o.height?e:n;var t,o})},s=()=>{o||(o=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(a))};a();const l="MutationObserver"in n?new n.MutationObserver(s):null;l?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const c="ResizeObserver"in n?new n.ResizeObserver(s):null;return c?.observe(t.documentElement),n.addEventListener("resize",s),()=>{l?.disconnect(),c?.disconnect(),n.removeEventListener("resize",s),o&&(n.cancelAnimationFrame??n.clearTimeout)(o)}},[n]),o}function De({id:e,kind:t,overlay:n}){const o=R(null),r=xe(o,e?t=>t.querySelector(`[${ue}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),i=/* @__PURE__ */L("div",{ref:o,"aria-hidden":"true",className:`es-canvas-outline is-${t}`,style:r?{position:"absolute",top:r.top,left:r.left,width:r.width,height:r.height}:{display:"none"}});return n&&e?/* @__PURE__ */L(n,{componentId:e,kind:t,children:i}):i}function Oe(e,t){const n=l(e),o=n.text.length,r=e.ownerDocument;if(!t)return[o,o];let i=null;const a=r.caretPositionFromPoint?.(t.x,t.y);if(a&&e.contains(a.offsetNode))i=n.at(a.offsetNode,a.offset);else{const o=r.caretRangeFromPoint?.(t.x,t.y);o&&e.contains(o.startContainer)&&(i=n.at(o.startContainer,o.startOffset))}if(null===i)return[o,o];const s=n.text;let c=i,d=i;for(;c>0&&!/\s/.test(s[c-1]);)c-=1;for(;d<s.length&&!/\s/.test(s[d]);)d+=1;return[c,d]}function Ae({s:e,element:t,toolbar:n,label:o}){const r=e.pressed(),i=new Set(n.offered.filter(e=>"link"!==e));/* @__PURE__ */
5
+ return L(H,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?p(o,{left:n.left,top:n.top,width:n.width,height:n.height}):{left:n.left,top:n.top,width:n.width,height:n.height};return{left:r.left-6,top:r.top-6,right:r.left+r.width+6,bottom:r.top+r.height+6}},bounds:()=>{const e=t(),n=e?.ownerDocument.defaultView?.frameElement,o=(n??e?.closest(".es-canvas")??e)?.getBoundingClientRect();return o?{left:o.left,top:o.top,right:o.right,bottom:o.bottom}:{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}},"aria-label":o,children:/* @__PURE__ */L("div",{style:{width:"18rem"},children:/* @__PURE__ */L(T,{offered:i,pressed:r.marks,onMark:t=>{"link"!==t&&e.press(t)},list:{pressed:r.list,onList:t=>e.list(t)},alignment:n.alignment,letterCase:n.letterCase})})})}function Me({element:e}){const t=R(null),n=xe(t,()=>e(),e);/* @__PURE__ */
6
+ return L("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}function Ke({frame:t=!0,className:n,style:o,metadata:r,mirrorStyles:l,onDocument:d,height:u,title:p,nonce:h,hotkeys:m,frameWrapper:g,overlay:v,children:y,typing:w}){const k=le(),b=z(ae),S=c("canvas",e),I=m??b,[C,E]=N(void 0),x=ce(e=>"node"===e.selection?.kind?e.selection.id:null),[D,O]=N(null),[A,M]=N(null),K=R(null),[,B]=N(0),Z=R(w);Z.current=w;const $=R(null),j=e=>{const t=$.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(f,{detail:{typing:e}}))},V=(e,t)=>{K.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=k.group(),r=e.element,i=s({element:r,value:e.value,rules:e.rules,multiline:e.multiline,caret:Oe(n,t),write:e.write,remount:e.remount,onSelect:()=>B(e=>e+1),end:e=>{o.close(),K.current?.element===r&&(K.current=null),M(null),j(!1),Z.current?.onChange?.({typing:!1,why:e})}});if(!i)return o.close(),!1;const a=n.closest?.(`[${ue}]`)?.getAttribute(ue);return a&&k.select(a),K.current={s:i,element:r,target:e},M(()=>r),O(null),j(!0),Z.current?.onChange?.({typing:!0,element:n}),!0};P(()=>()=>K.current?.s.stop("stop"),[]);const H=e=>{const t=K.current?.element();return Boolean(t&&t.contains(e))},T=e=>{const t=e.closest?.(`[${ue}]`)?.getAttribute(ue);if(!t)return;const n=k.getState(),o="node"===n.selection?.kind?n.selection.id:null;return a(n.appState.data,k.config,t,o)??t},Y=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(K.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button, a[href]"))return;const n=Z.current?.atSelection?.();n&&V(n,null)&&e.preventDefault()},U=/* @__PURE__ */F("div",{ref:$,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),K.current){if(H(t))return;K.current.s.stop("outside")}const n=T(t);void 0===n?t.hasAttribute?.(pe)||k.select(null):k.select(n)},onDoubleClick:e=>{const t=Z.current;if(!t||H(e.target))return;const n=t.at(e.target);n&&V(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>Y(e),onMouseOver:e=>{if(K.current)return;const t=T(e.target)??null;t!==D&&O(t)},onMouseLeave:()=>O(null),children:[
7
+ /* @__PURE__ */L(ye.Provider,{value:D,children:/* @__PURE__ */L(Ee,{metadata:r})}),
8
+ /* @__PURE__ */F("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
9
+ /* @__PURE__ */L(De,{id:!A&&D&&D!==x?D:null,kind:"hover",overlay:v}),
10
+ /* @__PURE__ */L(De,{id:A?null:x,kind:"selected",overlay:v}),A?/* @__PURE__ */L(Me,{element:A}):null]}),y]}),W=g?/* @__PURE__ */L(g,{document:C,children:U}):U;P(()=>{if(C&&I)return re(C,k)},[C,I,k]),P(()=>{if(!C)return;const e=e=>{if("Enter"===e.key)return void Y(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=k.getState();if("node"!==n.selection?.kind)return;const o=i(n.appState.data,k.config,n.selection);"node"===o?.kind&&k.select(o.id)};return C.addEventListener("keydown",e),()=>C.removeEventListener("keydown",e)},[C,k]);/* @__PURE__ */
11
+ return F("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-puck-preview":"","data-es-typing":A?"":void 0,children:[A&&K.current?.target.toolbar?/* @__PURE__ */L(Ae,{s:K.current.s,element:K.current.element,toolbar:K.current.target.toolbar,label:S.textTools}):null,t?/* @__PURE__ */L(ve,{mirrorStyles:l,onDocument:e=>{E(e??void 0),d?.(e)},height:u,title:p,nonce:h,children:W}):/* @__PURE__ */L("div",{id:"preview-frame","data-puck-entry":"",children:W})]})}function Pe(e={}){const t=le(),n=ce(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function ze(){const e=le(),n=ce(e=>e.config),o=e.resolveCache,r=ce(e=>e.selectedItem),i=ce(e=>e.appState.data.root),a=r?r.props.id:"root",s=i.props??{},l=Z(()=>r||{type:"root",props:s},[r,s]),c=r?n.components[r.type]:n.root,d=e.getState(),u=r?h(d.appState.data,n,a):null,p=u&&"root"!==u.place.parentId?u.place.parentId:null,f=p?d.getItemById(p)??null:null,{fields:m}=t({id:a,node:l,block:c,parent:f,appState:d.appState}),g=ce(e=>!1===e.getPermissions(r?{item:r}:{root:!0}).edit),v=$((t,r)=>{(async()=>{const i=e.getState();if("root"!==a){const s=i.getItemById(a),l=i.getSelectorForId(a);if(!s||!l)return;const c={...s,props:{...s.props,[t]:r}},{node:d}=await x(c,n,{cache:o,trigger:"replace"}),u=e.getState().getSelectorForId(a);if(!u)return;return void e.dispatch({type:"replace",destinationZone:u.zone??"root:default-zone",destinationIndex:u.index,data:d})}const s=i.appState.data.root.props??{},{node:l}=await x({type:"root",props:{...s,[t]:r}},n,{cache:o,trigger:"replace"});e.dispatch({type:"replaceRoot",root:{props:l.props,readOnly:l.readOnly},recordHistory:!0})})()},[e,n,o,a]);return{id:a,node:l,fields:m,values:l.props,readOnly:g,onChange:v}}export{ve as CanvasFrame,ee as DEFAULT_UI,Ke as EaselCanvas,se as EaselProvider,Ee as EditDocument,re as bindUndoKeys,oe as createEasel,de as createUseEasel,Y as recordsByDefault,G as reduce,q as uiView,ce as useEasel,le as useEaselApi,Pe as useEaselNodeOps,ze as useSelectedFields,X as validSelection};
@@ -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-PFNIVZPN.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-ZR4CFNMW.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-MCHMF32I.js";import{useEasel as f}from"./chunk-M5VRWM7M.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-HFW6D46X.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 $,jsxs as B,Fragment as F}from"react/jsx-runtime";var N=e=>`section:${e}`,O=e=>`block:${e}`,v=e=>`template:${e}`;function I({blocks:I,blocksOnly:M,at:V,onAdd:x,itemFor:H,session:C,siteWide:L,onClose:R,onHide:W,readOnly:A}){const D=f(e=>e.config),P=p(),{labelAtLevel:w,categoryLabel:Q,firstSection:T,Icon:Z,Thumbnail:z}=P,{blockIsOffered:S}=m(),X=u("screen",d).add,Y=u("drag",h).add,E=l(),[G,J]=y([]);b(()=>{let t=!1;const o=e=>S(e,E);return s(E).list().then(n=>{if(t)return;const i=D.components;J(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[D,E]);const K=j(()=>t(D,P),[D]),q=e=>({type:N(e.type),label:e.name,cover:/* @__PURE__ */$(z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:X.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),U=j(()=>{const e=[];if(I&&I.choices.length>0&&a(I.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${X.inside({name:I.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:O(e.type),label:e.label,icon:/* @__PURE__ */$(Z,{type:e.type,size:18}),title:X.tile({name:e.label})}))})}),M)return e;const t=o(K,T);t&&e.push({key:"start",title:X.startBlank,tiles:[q(t)]}),G.length>0&&e.push({key:"templates",title:X.templates,tiles:G.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */$(z,{type:e.node.type}),keywords:[(t=e.node.type,w(t,"section",D.components[t]?.label??t)),e.node.type]};var t})});const s=n(K,T);for(const t of Object.keys(D.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(D,t,Q),tiles:o.map(q)})}return e},[I,M,G,K,D,X]),_=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 B(F,{children:[
3
+ /* @__PURE__ */$(r,{icon:/* @__PURE__ */$(g,{size:15}),title:X.title,context:M?X.contextBlocks:X.contextAll,actions:/* @__PURE__ */$(c,{label:X.done,description:X.doneDescription,onClick:R}),onHide:W}),
4
+ /* @__PURE__ */B("div",{className:"sf-addside sf-scroll",children:[
5
+ /* @__PURE__ */$(k,{groups:U,session:C,itemFor:e=>H(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&x(t)},at:V,hint:M?X.hintBlocks:X.hint,searchLabel:M?X.searchBlocks:X.searchSections,readOnly:A,words:Y}),L&&!M?L:null]})]})}export{I as AddSidePanel,O as blockKey,N as sectionKey,v as templateKey};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-EXCKAZKN.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-UB4TLWVJ.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-ZR4CFNMW.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-UB4TLWVJ.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
@@ -1,7 +1,7 @@
1
- import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-H3WBX7FN.js";import{ScreenChrome as e}from"./chunk-HAUTMX4H.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__ */
1
+ import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-4UJ6CPLO.js";import{ScreenChrome as e}from"./chunk-GIP45GWF.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:H,saveAndNavigate:M}=a(),y=t(()=>o(!u),[u]),A=c("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:A.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:y,parts:r,children:/* @__PURE__ */m(v,{})}),N&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:j,onDiscard:H,onSave:()=>{M()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:A.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:A.waitingForAuthorization})}export{C as DocumentScreen,u as ScreenMount};
6
+ return m(i,{target:n,addressing:r,onHostMessage:e,children:a})}var C=(n,r)=>/* @__PURE__ */g(h,{children:[n,r]});function k({config:n,parts:r,wrap:e=C}){const{data:i,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:k,pendingNav:j,cancelPendingNav:N,discardAndNavigate:M,saveAndNavigate:y}=a(),H=t(()=>o(!u),[u]),F=c("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:F.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:k,permissions:H,parts:r,children:/* @__PURE__ */m(v,{})}),j&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:N,onDiscard:M,onSave:()=>{y()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:F.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:F.waitingForAuthorization})}export{k as DocumentScreen,u as ScreenMount};
@@ -0,0 +1 @@
1
+ var o={frame:"Canvas",textTools:"Text tools"};export{o as DEFAULT_CANVAS_WORDS};
@@ -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-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-KFV7N2DJ.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-AUT242JK.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={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},A=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:A(n)?t[m]=A(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{F 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-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.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-AUT242JK.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={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},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
@@ -1 +1 @@
1
- import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as o,bindUndoKeys as t}from"./chunk-DSUMM2WF.js";import{useState as e,useEffect as u}from"react";function r(o){const t=n(),[r,c]=e(null);return u(()=>c(o.current),[o]),t.ownsDocument?"undefined"==typeof document?null:document:r}function c(e,c){const m=n(),i=o(),f=r(e);u(()=>{if(!m.ownsDocument&&f)return t(f,i,{leaveTyping:!0})},[m,i,f]);const s=c?.document??null;u(()=>{if(!m.ownsDocument&&s)return t(s,i,{leaveTyping:!0})},[m,i,s])}function m(n){return n.ownsDocument?{}:{tabIndex:-1}}export{m as editorRootFocus,r as useEaselKeyTarget,c as useEaselUndoKeys};
1
+ import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as o,bindUndoKeys as t}from"./chunk-M5VRWM7M.js";import{useState as e,useEffect as u}from"react";function r(o){const t=n(),[r,c]=e(null);return u(()=>c(o.current),[o]),t.ownsDocument?"undefined"==typeof document?null:document:r}function c(e,c){const m=n(),i=o(),f=r(e);u(()=>{if(!m.ownsDocument&&f)return t(f,i,{leaveTyping:!0})},[m,i,f]);const s=c?.document??null;u(()=>{if(!m.ownsDocument&&s)return t(s,i,{leaveTyping:!0})},[m,i,s])}function m(n){return n.ownsDocument?{}:{tabIndex:-1}}export{m as editorRootFocus,r as useEaselKeyTarget,c as useEaselUndoKeys};
@@ -0,0 +1,5 @@
1
+ import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-M5VRWM7M.js";import{Inspector as i}from"./chunk-CRWFB7MU.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},w={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},L={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},C={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
2
+ return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
3
+ return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var B=o({});function D({parts:n,children:e}){/* @__PURE__ */
4
+ return s(B.Provider,{value:n,children:e})}function G(){return u(B)}function N(){return(G().useOwnerName??g)()}function R(){return(G().useDocumentLabel??y)()}function x(n,e,t,r){return(G().useBridges??v)(n,e,t,r)}function F(n){return(G().useStandaloneBridges??v)(n)}function I(n,e){(G().useDocumentPass??b)(n,e)}function M(){return G().blockRules??O}function T(){return G().blockLook??j}function W(){return G().devices??w}function A(){return G().leftView??L}function V(){return G().pinned??C}function K(){return G().saveSwitch??!0}function E(n){e(!0===G().pickFollowsSelection,n)}function H(){return G().add??h}function Q(){return G().storageNamespace||void 0}function U(){return G().styleClipboard??null}function Y(){return G().nodeKeys??!0}function Z(){return G().notify??null}function q(){return G().Canvas??S}function z(){return G().CanvasHead??null}function J(){return G().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
+ return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return G().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,D as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenAdd,T as useScreenBlockLook,M as useScreenBlockRules,x as useScreenBridges,J as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,_ as useScreenCanvasTarget,W as useScreenDevices,R as useScreenDocumentLabel,I as useScreenDocumentPass,nn as useScreenInspectorPanel,A as useScreenLeftView,Y as useScreenNodeKeys,Z as useScreenNotify,N as useScreenOwnerName,G as useScreenParts,E as useScreenPickFollowsSelection,V as useScreenPinned,K as useScreenSaveSwitch,Q as useScreenStorageNamespace,U as useScreenStyleClipboard,F as useStandaloneScreenBridges};
@@ -5,7 +5,7 @@ import { C as CopyWords, a as CopyAlign } from '../words-BAnsDT16.js';
5
5
  export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-BAnsDT16.js';
6
6
  import { TextToolbarCase, TextToolbarMark } from 'efficient-shell/ui';
7
7
  export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
8
- export { C as CanvasTypingEnd, a as CanvasTypingOptions, b as CanvasTypingSession, T as TextMap, s as startCanvasTyping, t as textMap } from '../canvas-typing-Dec_zyuM.js';
8
+ export { C as CanvasTypingEnd, a as CanvasTypingOptions, b as CanvasTypingSession, T as TextMap, s as startCanvasTyping, t as textMap } from '../canvas-typing-U7TV-iax.js';
9
9
 
10
10
  type CellWords = NonNullable<CopyWords['cells']>;
11
11
  interface CopyCell {
@@ -1,18 +1,18 @@
1
- import{DEFAULT_COPY_WORDS as e}from"../chunk-AUT242JK.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,pasteToMarkup as o,richInput as a,editVisible as s,MARKUP_CLIPBOARD_TYPE as i,markupOfRange as c}from"../chunk-JIWPANGM.js";export{MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-JIWPANGM.js";import{FieldNumber as u}from"../chunk-66LWADFP.js";import{SettingsSegmented as d,SettingsSwitch as p}from"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import{GoldTextInput as f}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as h,applyMark as m,markupTools as g,marksIn as y,STANDARD_MARKUP as v,findLink as b,markedAt as k,listIn as x,colorIn as w,spanFor as S,clearStyle as E,toggleMark as C,colorOver as D,setList as N,unlinkAt as L,removeLink as T,linkOver as M,writeLink as P}from"../chunk-546BBOPE.js";import{useWords as R}from"../chunk-MFIRYGHW.js";import{withTip as B}from"../chunk-P2VEMZH5.js";import{Tooltip as O,ColorSwatch as z,ColorPickerPanel as K,Button as F,IconButton as W,registerModalEscapeInterceptor as $,textToolbarRows as j,TextToolbar as H,LinkPicker as A}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as I,useState as V,useLayoutEffect as U,useEffect as q,useId as Y}from"react";import{AlignJustifyIcon as G,AlignRightIcon as J,AlignCenterIcon as _,AlignLeftIcon as Z,ParagraphSpacingIcon as X,LetterSpacingIcon as Q,TextLinesIcon as ee,TextSizeIcon as te,ClearMarksIcon as ne,LinkIcon as re,QuietIcon as le,EmphasisIcon as oe,StrikeIcon as ae,ItalicIcon as se,BoldIcon as ie}from"efficient-shell/icons/efficient";import{jsx as ce,jsxs as ue,Fragment as de}from"react/jsx-runtime";var pe=["left","center","right","justify"],fe=e.align,he={left:/* @__PURE__ */ce(Z,{}),center:/* @__PURE__ */ce(_,{}),right:/* @__PURE__ */ce(J,{}),justify:/* @__PURE__ */ce(G,{})},me={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function ge(e,t=fe){return pe.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:he[e],title:t[e]}))}var ye=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function ve(e){if(e.every(e=>e.label===fe[e.id]))return e.length>3?me.four:me.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(ye.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function be(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function ke(e,t,n,r=m){const{start:l,end:o}=be(e,n);return r(e,l,o,t)}function xe(e,t,n){const{start:r,end:l}=be(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function we(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Se(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Ee(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Ce({value:e,rules:l,multiline:u,readOnly:d=!1,placeholder:p,ariaLabel:f,handle:h,onEdit:m,onSelect:g,onHistory:y,onFormat:v,pending:b,onCommit:k,onCancel:x}){const w=I(null),S=I(null),E=I(null),C=I(null),D=I(null),N=I(e),[L,T]=V(0),M=I({value:e,rules:l,multiline:u,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v});M.current={value:e,rules:l,multiline:u,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v};const P=()=>{const e=w.current,t=S.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Se(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Se(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},R=(e,t)=>{const n=w.current,r=S.current;if(!n||!r)return;const[l,o]=Ee(r,e),[a,s]=Ee(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};h.current={getSource(){const e=P(),t=S.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},T(e=>e+1)},focus(){w.current?.focus()},rangeOf(e,n){const r=w.current,l=S.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,i]=Ee(l,o),[c,u]=Ee(l,a),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},U(()=>{const n=w.current;if(!n||D.current)return;const o=C.current?null:P();S.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=we(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&R(o[0],Math.min(o[1],S.current.layout.text.length)));C.current=null;const s=S.current.layout,[i,c]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),R(i,c)},[e,l,L]);const B=(e,t,r)=>{const l=S.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==M.current.value?M.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};q(()=>{const e=w.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:s}=M.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const i=S.current,c=P();if(!i||!c)return;const u="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,d=u&&!u.collapsed?[Se(i,e,u.startContainer,u.startOffset),Se(i,e,u.endContainer,u.endOffset)]:null,p=a({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:d,pending:s});p&&("history"!==p.kind?"format"!==p.kind?B(p.edit,p.range,p.kind):M.current.onFormat(p.style):M.current.onHistory(p.dir))},n=()=>{D.current||T(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),q(()=>{const e=w.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=h.current?.getSource();e&&g(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const O=(t,n=!1)=>{const r=P();if(!r||r[0]===r[1])return;t.preventDefault();const o=S.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(i,c(e,l,r[0],r[1])),n&&!d&&B(s(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
2
- return ue("div",{className:"es-rich-wrap",children:[p&&""===e?/* @__PURE__ */ce("div",{className:"es-rich-placeholder","aria-hidden":"true",children:p}):null,
3
- /* @__PURE__ */ce("div",{ref:w,className:`es-rich${u?" is-multiline":" is-single"}${d?" is-off":""}`,contentEditable:!d,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":u,"aria-label":f,"aria-readonly":d||void 0,"aria-placeholder":p,tabIndex:d?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||u||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=P()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=M.current;e.data?B(s(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):T(e=>e+1)},onCopy:e=>O(e),onCut:e=>O(e,!0),onPaste:t=>{if(t.preventDefault(),d)return;const n=P();if(!n)return;const r=t.clipboardData.getData(i),a=r?u?r:r.replace(/\s*\r?\n\s*/g," "):o({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:u,rules:l});B(s(e,l,n[0],n[1],{markup:a}),n,"edit")}})]})}var De={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ce(te,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ce(ee,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ce(Q,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ce(X,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ne(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Le({cells:t,words:n,readOnly:r=!1}){const l=n??e.cells;/* @__PURE__ */
4
- return ce("div",{className:"es-copy-cells",children:t.map(e=>{const t=e.scale??1,n=e.name??(e.nameKey?l[e.nameKey]:e.key),o=e.unit??"",a=e.step??1;/* @__PURE__ */
5
- return ce(u,{value:Ne(e.value,t),styleValue:Ne(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:a,shiftStep:e.shiftStep,icon:e.icon,unit:o||void 0,steppers:"compact",readOnly:r,ariaLabel:n,title:l.tip({name:n,step:a,unit:o})},e.key)})})}var Te=e=>e.preventDefault();function Me({colors:e,current:t,words:n,onPick:r}){const l=null===t?null:t.startsWith("#")?t.toLowerCase():e.find(e=>e.name===t)?.value.toLowerCase()??null;/* @__PURE__ */
6
- return ue("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:[
7
- /* @__PURE__ */ce("span",{className:"es-copy-pop-label",children:n.theme}),
8
- /* @__PURE__ */ce("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:e.map(e=>/* @__PURE__ */ce(O,{content:`${e.label} · ${e.value.toUpperCase()}`,children:/* @__PURE__ */ce(z,{color:e.value,size:"sm",className:"es-copy-theme-swatch","data-color":e.name,"aria-label":e.label,selected:t===e.name,onMouseDown:Te,onClick:()=>r(e.name)})},e.name))}),
9
- /* @__PURE__ */ce("span",{className:"es-copy-pop-label",children:n.any}),
10
- /* @__PURE__ */ce(K,{className:"es-copy-any",value:l??"",onChange:e=>{e!==t&&r(e)},label:n.title,dragWrites:"end"}),
11
- /* @__PURE__ */ce("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */ce(F,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:Te,onClick:()=>r(null),children:n.remove})})]})}var Pe=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var Re=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function Be(e){const t=e.ownerDocument,n=t.documentElement,r={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},l=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=l?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;r.left=Math.max(r.left,n),r.top=Math.max(r.top,a),r.right=Math.min(r.right,n+(o.clientWidth||t.width)),r.bottom=Math.min(r.bottom,a+(o.clientHeight||t.height))}return r}function Oe(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var ze=/* @__PURE__ */new Set([...h,"clear"]),Ke={bold:/* @__PURE__ */ce(ie,{size:16}),italic:/* @__PURE__ */ce(se,{size:16}),strike:/* @__PURE__ */ce(ae,{size:16}),highlight:/* @__PURE__ */ce(oe,{size:16}),quiet:/* @__PURE__ */ce(le,{size:16}),link:/* @__PURE__ */ce(re,{size:16}),clear:/* @__PURE__ */ce(ne,{size:16})};function Fe(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var We={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function $e({tools:t,onApply:n,disabled:r=!1,actions:l,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=R("copy",e),d=("string"==typeof t[0]?g(t).map(e=>({...e,...u.marks[e.style]})):t).filter(e=>!ze.has(e.style));return 0!==d.length||l||o?/* @__PURE__ */ue("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??Ke[e.style],l=c===e.style||Boolean(i?.[e.style]),o="link"===e.style&&Boolean(i);return B(e.title,/* @__PURE__ */ce(W,{onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:r,"aria-label":e.name??e.title,"aria-keyshortcuts":Fe(e.shortcut),"aria-pressed":o||!i&&!c?void 0:l,pressed:o?l:void 0,"aria-haspopup":o?"dialog":void 0,"aria-expanded":o?"link"===c:void 0,className:`es-copy-mark${t?" has-glyph":We[e.style]?` ${We[e.style]}`:""}${l?" is-active":""}`,children:t??e.label},e.style))}),l?/* @__PURE__ */ue(de,{children:[
12
- /* @__PURE__ */ce("span",{className:"es-copy-bar-split","aria-hidden":"true"}),l]}):null,o?/* @__PURE__ */ce("span",{className:"es-copy-bar-end",children:o}):null]}):null}function je({target:e,onChange:t}){const n=I(null);return U(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var He=["bold","italic","underline","strike","sup","sub"];function Ae({value:t,onChange:n,onCommit:r,onCancel:a,multiline:s=!1,placeholder:i,ariaLabel:c,className:u,readOnly:h=!1,rules:O,tools:z=[],writeMark:K,actions:W,align:G,glyphs:J,barLabel:_,renderFooter:Z,inputRef:X,barShows:Q="always",richText:ee=!0,defaultShowMarks:te=!1,toolbar:re="final",colors:le,cells:oe,letterCase:ae,lastTool:se}){const ie="final"===re,pe=R("copy",e),fe=I(null),he=X??fe,[me,ye]=V(!1),[be,we]=V(null),Se=I(l()).current,Ee=I(null);q(()=>{const e=Ee.current;e&&t===e.to?Ee.current=null:e&&t===e.from||(Ee.current=null,Se.reset())},[t,Se]);const De=e=>{Ee.current={from:Ee.current?.from??t,to:e},n(e)},Ne=e=>({text:t,start:e?.selectionStart??be?.start??t.length,end:e?.selectionEnd??be?.end??t.length}),[Te,Ke]=V(te),Fe=ee&&!(s&&Te),We=I(null),Ae=Y(),[Ie,Ve]=V(null),[Ue,qe]=V(!1),Ye=()=>{if(!Fe)return he.current;const e=We.current?.getSource()??be;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Ge=je({target:he,onChange:De}),Je=e=>(we({start:e.selectionStart,end:e.selectionEnd}),e),_e=(e,n)=>{if(!Fe)return void Ge(t=>(n&&Se.record(Ne(t),"edit",Date.now()),Je(e(t))));const r=Ye(),l=Je(e(r));n&&Se.record(Ne(r),"edit",Date.now()),Ve(null),l.text!==t&&De(l.text),We.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Ze=e=>_e(e,!0),Xe=e=>_e(t=>{const n=Ne(t),r=Se[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Qe=I(null);U(()=>{const e=Qe.current;e&&(Qe.current=null,Fe?We.current?.setSource(e.start,e.end,t):(he.current?.focus(),he.current?.setSelectionRange(e.start,e.end),we(e)))},[Fe]);const[et,tt]=V(null),nt=O??v,rt=("string"==typeof z[0]?g(z):z).filter(e=>!ze.has(e.style)),lt=ie?("string"==typeof z[0]?z:z.map(e=>e.style)).filter(e=>!ze.has(e)):rt.map(e=>e.style),ot={};if(be&&(Fe||ie)){const e=y(t,be.start,be.end,nt);for(const t of lt){const n=e.has(t)||"highlight"===t&&e.has("accent");ot[t]=!!Ie?.add.includes(t)||!Ie?.drop.includes(t)&&n}ie&&(ot.link=e.has("link"))}else if(be)for(const e of lt)ot[e]="link"===e?null!==b(t,be.start,be.end):k(t,be.start,be.end,e);const at=()=>{const e=Ye(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},st={sup:"sub",sub:"sup"},it=e=>{if(ie&&"link"!==e&&S(0,e)){const{start:n,end:r}=at(),l=st[e];if(n===r){if(!Fe)return void Ze(n=>ke(t,e,n,(e,t,n,r)=>m(e,t,n,r,nt,pe.placeholders)));const o=y(t,n,r,nt),a=Ie&&Ie.at===n?Ie:null,s=o.has(e),i=!!a?.add.includes(e)||!a?.drop.includes(e)&&s;let c=(a?.add??[]).filter(t=>t!==e),u=(a?.drop??[]).filter(t=>t!==e);return i&&s?u.push(e):i||s||c.push(e),!i&&l&&(c=c.filter(e=>e!==l),o.has(l)&&(u=[...u.filter(e=>e!==l),l])),void Ve(c.length||u.length||void 0!==a?.color?{add:c,drop:u,color:a?.color,at:n}:null)}return void Ze(()=>{let o=t,a=n,s=r;if(l&&!y(o,a,s,nt).has(e)&&y(o,a,s,nt).has(l)){const e=C(o,a,s,l,nt);({text:o,selectionStart:a,selectionEnd:s}=e)}return C(o,a,s,e,nt)})}if("clear"===e)return void Ze(n=>ke(t,e,n,(e,t,n)=>m(e,t,n,"clear",nt)));if("link"!==e&&Fe&&S(0,e)){const n=Ye(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;if(r===l){const n=y(t,r,l,nt),o=n.has(e)||"highlight"===e&&n.has("accent"),a=Ie&&Ie.at===r?Ie:null,s=!!a?.add.includes(e)||!a?.drop.includes(e)&&o,i=(a?.add??[]).filter(t=>t!==e),c=(a?.drop??[]).filter(t=>t!==e);return s&&o?c.push(e):s||o||i.push(e),void Ve(i.length||c.length?{add:i,drop:c,at:r}:null)}return void Ze(n=>C(t,n?.selectionStart??r,n?.selectionEnd??l,e,nt))}if("link"!==e){const n=K??((e,t,n,r)=>m(e,t,n,r,v,pe.placeholders));return void Ze(r=>ke(t,e,r,n))}const n=Ye(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;qe(!1),tt({start:r,end:l,link:b(t,r,l)})},ct=Boolean(be&&be.start!==be.end),ut=be?x(t,be.start,be.end,nt):null,dt=be?Ie&&void 0!==Ie.color&&Ie.at===be.start?Ie.color:w(t,be.start,be.end,nt):null,pt=dt?dt.startsWith("#")?dt:le?.find(e=>e.name===dt)?.value:void 0,ft=e=>{Fe?e?We.current?.setSource(e.start,e.end,t):We.current?.focus():(he.current?.focus(),e&&he.current?.setSelectionRange(e.start,e.end))},ht=()=>{const e=et;tt(null),ft(e?{start:e.start,end:e.end}:be)},mt=()=>{const e=yt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));qe(!1),t&&ft(be)},gt=I(mt);gt.current=mt,q(()=>{if(Ue)return $(e=>{const t=yt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(gt.current(),!0)},()=>yt.current?.querySelector(".es-copy-colors"))},[Ue]);const yt=I(null),vt=Ue||null!==et;q(()=>{const e=yt.current;if(!vt||!e)return;const t=e.ownerDocument,n=()=>{qe(!1),tt(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[vt]);const bt=et??(Ue?be??{start:t.length,end:t.length}:null),kt=I(()=>{});kt.current=()=>{const e=yt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!bt)return;const n=Fe?null:e.querySelector(".es-gold-layer"),r=Fe?We.current?.rangeOf(bt.start,bt.end)??null:n?function(e,t,n){const r=e.ownerDocument,l=r.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=l.nextNode();e;e=l.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);l.currentNode=e;const s=o(n);if(!a||!s)return null;const i=r.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,bt.start,bt.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?Re(t):Re(n[0])}if(!t)return null;const r=t.getBoundingClientRect();return{left:r.left,top:r.top,right:r.left,bottom:r.bottom}}(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:r,parent:l,gap:o=8}){const a=Math.max(n.left,r.left),s=Math.min(n.right,r.right)-t.width,i=Pe(e.left,a,s),c=r.bottom-(e.bottom+o),u=e.top-o-r.top,d=t.height>c&&(t.height<=u||u>c),p=d?e.top-o-t.height:e.bottom+o,f=e.left+Math.min((e.right-e.left)/2,10),h=Pe(f-5-i,10,t.width-10-10);return{top:p-l.top,left:i-l.left,above:d,point:h}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:Be(e),parent:Oe(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},U(()=>{const e=yt.current;if(!vt||!e)return;const t=()=>kt.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[vt,Ue,et,bt?.start,bt?.end,Fe]);const xt=e=>et&&/* @__PURE__ */ce(A,{className:e?"es-copy-link es-copy-pop":"es-copy-link",value:et.link?.href??"",onApply:e=>{const n=et;tt(null),Ze(()=>Fe?M(t,n.start,n.end,e,nt):P(t,n.start,n.end,e))},onRemove:et.link?()=>{const e=et.link,n=et;tt(null),e&&Ze(()=>Fe?L(t,n.start,n.end,nt):T(t,e))}:void 0,onCancel:ht}),wt=G?ge(G.allow,pe.align):[],St="always"===Q||me||null!==et||Ue,Et=le&&le.length>0?{run:pt,open:Ue,onToggle:()=>{tt(null),Ue?mt():qe(!0)}}:void 0,Ct=St&&ie&&se?se({className:"rosh-tb-btn",disabled:h,selected:ct,keepCaret:e=>e.preventDefault(),insert:e=>Ze(n=>xe(t,e,n))}):void 0,Dt=new Set(lt),Nt=G?{value:G.value,allow:G.allow,onChange:G.onChange,disabled:G.disabled}:void 0,Lt={pressed:ut,onList:e=>{const{start:n,end:r}=at(),l=x(t,n,r,nt);Ze(()=>N(t,n,r,l===e?null:e,nt))}},Tt=j({offered:Dt,color:Et,last:Ct,alignment:Nt,list:Lt,letterCase:ae}),Mt=ie&&St&&(He.some(e=>Dt.has(e))||Boolean(Et));/* @__PURE__ */
13
- return ue("div",{ref:yt,className:"es-copy"+(u?` ${u}`:""),onFocus:()=>ye(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ye(!1)},onKeyDown:e=>{const t=e.target===he.current||Boolean(e.target.closest?.(".es-rich"));if(h||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Xe(l||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(ie){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!lt.includes(t))return;return e.preventDefault(),e.stopPropagation(),void it(t)}const a=rt.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),it(a.style))},onPaste:e=>{const n=he.current;if(h||!n||e.target!==n)return;e.preventDefault();const r=o({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:s,rules:nt});Ze(e=>xe(t,r,e))},style:le&&le.length>0?Object.fromEntries(le.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=he.current;e&&e.ownerDocument.activeElement===e&&we({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[St&&ie&&(Tt.words||Tt.paragraph)?
14
- /* @__PURE__ */ce(H,{className:"es-copy-toolbar","aria-label":_??pe.formatting,offered:Dt,pressed:ot,onMark:e=>it(e),color:Et,linkOpen:null!==et,last:Ct,alignment:Nt,list:Lt,letterCase:ae,disabled:h,windows:/* @__PURE__ */ue(de,{children:[Ue&&le&&le.length>0?/* @__PURE__ */ce(Me,{colors:le,current:dt,words:pe.colors??e.colors,onPick:e=>{const{start:n,end:r}=at();if(n!==r)Ze(()=>D(t,n,r,e,nt));else{if(!Fe)return;Ve({add:Ie?.add??[],drop:Ie?.drop??[],color:e,at:n})}}}):null,et?xt(!0):null]})}):null,ie&&oe&&oe.length>0?/* @__PURE__ */ce(Le,{cells:oe,words:pe.cells??e.cells,readOnly:h}):null,St&&!ie?/* @__PURE__ */ce($e,{tools:z,disabled:h,actions:W,glyphs:J,ariaLabel:_,pressed:ot,open:et?"link":null,onApply:it,align:G?/* @__PURE__ */ce(d,{options:wt,value:G.value,onChange:G.onChange,ariaLabel:pe.alignment,disabled:h||G.disabled,fit:ve(wt)}):null}):null,Fe?/* @__PURE__ */ce(Ce,{value:t,rules:nt,multiline:s,readOnly:h,placeholder:i,ariaLabel:c,handle:We,pending:Ie??void 0,onEdit:(e,n,r)=>{Se.record({text:t,start:n.start,end:n.end},r,Date.now()),Ve(null),De(e)},onSelect:e=>{we(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Ie||e.start===Ie.at&&e.end===Ie.at||Ve(null)},onHistory:Xe,onFormat:e=>{lt.includes(e)&&it(e)},onCommit:r,onCancel:a}):/* @__PURE__ */ce(f,{value:t,onInput:e=>{Se.record(Ne(null),"type",Date.now()),De(e)},onCommit:r,onCancel:a,multiline:s,placeholder:i,ariaLabel:c,rules:O,disabled:h,inputRef:he,className:"es-copy-box"}),et&&!ie?xt(!1):null,Z?Z({focused:me,insert:e=>Ze(n=>xe(t,e,n))}):null,ee&&s||Mt?
15
- /* @__PURE__ */ue("div",{className:"es-copy-marks",children:[ee&&s?/* @__PURE__ */ue(de,{children:[
16
- /* @__PURE__ */ce(p,{checked:Te,onChange:()=>{const e=Ye();Qe.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:be,Ve(null),Ke(e=>!e)},ariaLabelledBy:Ae,disabled:h}),
17
- /* @__PURE__ */ce("span",{id:Ae,className:"es-copy-marks-label",children:pe.showMarks??"Show marks"})]}):null,Mt?B(ct?void 0:pe.clearStyleEmpty??"Select words first",/* @__PURE__ */ue(F,{variant:"secondary",size:"sm",className:"es-copy-clear",disabled:h||!ct,onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:e,end:n}=at();if(e===n)return;const r=E(t,e,n,nt);r.text!==t&&Ze(()=>r)},children:[
18
- /* @__PURE__ */ce(ne,{size:16}),pe.clearStyle??"Clear style"]})):null]}):null]})}export{pe as COPY_ALIGNS,me as COPY_ALIGN_FIT,he as COPY_ALIGN_GLYPHS,fe as COPY_ALIGN_LABELS,De as COPY_CELLS,Me as ColorWindow,Ae as CopyBox,Le as CopyCells,$e as MarkBar,Ce as RichBox,Fe as ariaShortcut,ge as copyAlignOptions,xe as insertSelection,ke as markSelection,je as useCaretEdit};
1
+ import{DEFAULT_COPY_WORDS as e}from"../chunk-AUT242JK.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,markPress as o,pasteToMarkup as a,richInput as s,editVisible as i,MARKUP_CLIPBOARD_TYPE as c,markupOfRange as u}from"../chunk-CIHKZMNR.js";export{MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-CIHKZMNR.js";import{FieldNumber as d}from"../chunk-66LWADFP.js";import{SettingsSegmented as p,SettingsSwitch as f}from"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import{GoldTextInput as h}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as m,applyMark as g,markupTools as y,marksIn as v,STANDARD_MARKUP as b,findLink as k,markedAt as x,listIn as w,colorIn as S,spanFor as E,clearStyle as C,toggleMark as D,colorOver as N,setList as L,unlinkAt as T,removeLink as M,linkOver as R,writeLink as B}from"../chunk-546BBOPE.js";import{useWords as P}from"../chunk-MFIRYGHW.js";import{withTip as O}from"../chunk-P2VEMZH5.js";import{Tooltip as z,ColorSwatch as K,ColorPickerPanel as H,Button as F,IconButton as $,registerModalEscapeInterceptor as j,textToolbarRows as W,TextToolbar as A,LinkPicker as I}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as V,useState as U,useLayoutEffect as q,useEffect as Y,useId as Z}from"react";import{AlignJustifyIcon as _,AlignRightIcon as G,AlignCenterIcon as J,AlignLeftIcon as X,ParagraphSpacingIcon as Q,LetterSpacingIcon as ee,TextLinesIcon as te,TextSizeIcon as ne,ClearMarksIcon as re,LinkIcon as le,QuietIcon as oe,EmphasisIcon as ae,StrikeIcon as se,ItalicIcon as ie,BoldIcon as ce}from"efficient-shell/icons/efficient";import{jsx as ue,jsxs as de,Fragment as pe}from"react/jsx-runtime";var fe=["left","center","right","justify"],he=e.align,me={left:/* @__PURE__ */ue(X,{}),center:/* @__PURE__ */ue(J,{}),right:/* @__PURE__ */ue(G,{}),justify:/* @__PURE__ */ue(_,{})},ge={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function ye(e,t=he){return fe.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:me[e],title:t[e]}))}var ve=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function be(e){if(e.every(e=>e.label===he[e.id]))return e.length>3?ge.four:ge.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(ve.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function ke(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function xe(e,t,n,r=g){const{start:l,end:o}=ke(e,n);return r(e,l,o,t)}function we(e,t,n){const{start:r,end:l}=ke(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Se(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Ee(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Ce(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function De({value:e,rules:l,multiline:o,readOnly:d=!1,placeholder:p,ariaLabel:f,handle:h,onEdit:m,onSelect:g,onHistory:y,onFormat:v,pending:b,onCommit:k,onCancel:x}){const w=V(null),S=V(null),E=V(null),C=V(null),D=V(null),N=V(e),[L,T]=U(0),M=V({value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v});M.current={value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v};const R=()=>{const e=w.current,t=S.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ee(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ee(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},B=(e,t)=>{const n=w.current,r=S.current;if(!n||!r)return;const[l,o]=Ce(r,e),[a,s]=Ce(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};h.current={getSource(){const e=R(),t=S.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},T(e=>e+1)},focus(){w.current?.focus()},rangeOf(e,n){const r=w.current,l=S.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,i]=Ce(l,o),[c,u]=Ce(l,a),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},q(()=>{const n=w.current;if(!n||D.current)return;const o=C.current?null:R();S.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Se(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&B(o[0],Math.min(o[1],S.current.layout.text.length)));C.current=null;const s=S.current.layout,[i,c]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),B(i,c)},[e,l,L]);const P=(e,t,r)=>{const l=S.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==M.current.value?M.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};Y(()=>{const e=w.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=M.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const i=S.current,c=R();if(!i||!c)return;const u="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,d=u&&!u.collapsed?[Ee(i,e,u.startContainer,u.startOffset),Ee(i,e,u.endContainer,u.endOffset)]:null,p=s({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:d,pending:a});p&&("history"!==p.kind?"format"!==p.kind?P(p.edit,p.range,p.kind):M.current.onFormat(p.style):M.current.onHistory(p.dir))},n=()=>{D.current||T(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),Y(()=>{const e=w.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=h.current?.getSource();e&&g(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const O=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=S.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(c,u(e,l,r[0],r[1])),n&&!d&&P(i(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
2
+ return de("div",{className:"es-rich-wrap",children:[p&&""===e?/* @__PURE__ */ue("div",{className:"es-rich-placeholder","aria-hidden":"true",children:p}):null,
3
+ /* @__PURE__ */ue("div",{ref:w,className:`es-rich${o?" is-multiline":" is-single"}${d?" is-off":""}`,contentEditable:!d,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":f,"aria-readonly":d||void 0,"aria-placeholder":p,tabIndex:d?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=R()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=M.current;e.data?P(i(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):T(e=>e+1)},onCopy:e=>O(e),onCut:e=>O(e,!0),onPaste:t=>{if(t.preventDefault(),d)return;const n=R();if(!n)return;const r=t.clipboardData.getData(c),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):a({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});P(i(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Ne={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ue(ne,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ue(te,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ue(ee,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ue(Q,{}),unit:"px",step:1,shiftStep:10,min:0}};function Le(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Te({cells:t,words:n,readOnly:r=!1}){const l=n??e.cells;/* @__PURE__ */
4
+ return ue("div",{className:"es-copy-cells",children:t.map(e=>{const t=e.scale??1,n=e.name??(e.nameKey?l[e.nameKey]:e.key),o=e.unit??"",a=e.step??1;/* @__PURE__ */
5
+ return ue(d,{value:Le(e.value,t),styleValue:Le(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:a,shiftStep:e.shiftStep,icon:e.icon,unit:o||void 0,steppers:"compact",readOnly:r,ariaLabel:n,title:l.tip({name:n,step:a,unit:o})},e.key)})})}var Me=e=>e.preventDefault();function Re({colors:e,current:t,words:n,onPick:r}){const l=null===t?null:t.startsWith("#")?t.toLowerCase():e.find(e=>e.name===t)?.value.toLowerCase()??null;/* @__PURE__ */
6
+ return de("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:[
7
+ /* @__PURE__ */ue("span",{className:"es-copy-pop-label",children:n.theme}),
8
+ /* @__PURE__ */ue("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:e.map(e=>/* @__PURE__ */ue(z,{content:`${e.label} · ${e.value.toUpperCase()}`,children:/* @__PURE__ */ue(K,{color:e.value,size:"sm",className:"es-copy-theme-swatch","data-color":e.name,"aria-label":e.label,selected:t===e.name,onMouseDown:Me,onClick:()=>r(e.name)})},e.name))}),
9
+ /* @__PURE__ */ue("span",{className:"es-copy-pop-label",children:n.any}),
10
+ /* @__PURE__ */ue(H,{className:"es-copy-any",value:l??"",onChange:e=>{e!==t&&r(e)},label:n.title,dragWrites:"end"}),
11
+ /* @__PURE__ */ue("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */ue(F,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:Me,onClick:()=>r(null),children:n.remove})})]})}var Be=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var Pe=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function Oe(e){const t=e.ownerDocument,n=t.documentElement,r={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},l=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=l?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;r.left=Math.max(r.left,n),r.top=Math.max(r.top,a),r.right=Math.min(r.right,n+(o.clientWidth||t.width)),r.bottom=Math.min(r.bottom,a+(o.clientHeight||t.height))}return r}function ze(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var Ke=/* @__PURE__ */new Set([...m,"clear"]),He={bold:/* @__PURE__ */ue(ce,{size:16}),italic:/* @__PURE__ */ue(ie,{size:16}),strike:/* @__PURE__ */ue(se,{size:16}),highlight:/* @__PURE__ */ue(ae,{size:16}),quiet:/* @__PURE__ */ue(oe,{size:16}),link:/* @__PURE__ */ue(le,{size:16}),clear:/* @__PURE__ */ue(re,{size:16})};function Fe(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var $e={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function je({tools:t,onApply:n,disabled:r=!1,actions:l,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=P("copy",e),d=("string"==typeof t[0]?y(t).map(e=>({...e,...u.marks[e.style]})):t).filter(e=>!Ke.has(e.style));return 0!==d.length||l||o?/* @__PURE__ */de("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??He[e.style],l=c===e.style||Boolean(i?.[e.style]),o="link"===e.style&&Boolean(i);return O(e.title,/* @__PURE__ */ue($,{onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:r,"aria-label":e.name??e.title,"aria-keyshortcuts":Fe(e.shortcut),"aria-pressed":o||!i&&!c?void 0:l,pressed:o?l:void 0,"aria-haspopup":o?"dialog":void 0,"aria-expanded":o?"link"===c:void 0,className:`es-copy-mark${t?" has-glyph":$e[e.style]?` ${$e[e.style]}`:""}${l?" is-active":""}`,children:t??e.label},e.style))}),l?/* @__PURE__ */de(pe,{children:[
12
+ /* @__PURE__ */ue("span",{className:"es-copy-bar-split","aria-hidden":"true"}),l]}):null,o?/* @__PURE__ */ue("span",{className:"es-copy-bar-end",children:o}):null]}):null}function We({target:e,onChange:t}){const n=V(null);return q(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var Ae=["bold","italic","underline","strike","sup","sub"];function Ie({value:t,onChange:n,onCommit:r,onCancel:s,multiline:i=!1,placeholder:c,ariaLabel:u,className:d,readOnly:m=!1,rules:z,tools:K=[],writeMark:H,actions:$,align:_,glyphs:G,barLabel:J,renderFooter:X,inputRef:Q,barShows:ee="always",richText:te=!0,defaultShowMarks:ne=!1,toolbar:le="final",colors:oe,cells:ae,letterCase:se,lastTool:ie}){const ce="final"===le,fe=P("copy",e),he=V(null),me=Q??he,[ge,ve]=U(!1),[ke,Se]=U(null),Ee=V(l()).current,Ce=V(null);Y(()=>{const e=Ce.current;e&&t===e.to?Ce.current=null:e&&t===e.from||(Ce.current=null,Ee.reset())},[t,Ee]);const Ne=e=>{Ce.current={from:Ce.current?.from??t,to:e},n(e)},Le=e=>({text:t,start:e?.selectionStart??ke?.start??t.length,end:e?.selectionEnd??ke?.end??t.length}),[Me,He]=U(ne),Fe=te&&!(i&&Me),$e=V(null),Ie=Z(),[Ve,Ue]=U(null),[qe,Ye]=U(!1),Ze=()=>{if(!Fe)return me.current;const e=$e.current?.getSource()??ke;return e?{selectionStart:e.start,selectionEnd:e.end}:null},_e=We({target:me,onChange:Ne}),Ge=e=>(Se({start:e.selectionStart,end:e.selectionEnd}),e),Je=(e,n)=>{if(!Fe)return void _e(t=>(n&&Ee.record(Le(t),"edit",Date.now()),Ge(e(t))));const r=Ze(),l=Ge(e(r));n&&Ee.record(Le(r),"edit",Date.now()),Ue(null),l.text!==t&&Ne(l.text),$e.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Xe=e=>Je(e,!0),Qe=e=>Je(t=>{const n=Le(t),r=Ee[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),et=V(null);q(()=>{const e=et.current;e&&(et.current=null,Fe?$e.current?.setSource(e.start,e.end,t):(me.current?.focus(),me.current?.setSelectionRange(e.start,e.end),Se(e)))},[Fe]);const[tt,nt]=U(null),rt=z??b,lt=("string"==typeof K[0]?y(K):K).filter(e=>!Ke.has(e.style)),ot=ce?("string"==typeof K[0]?K:K.map(e=>e.style)).filter(e=>!Ke.has(e)):lt.map(e=>e.style),at={};if(ke&&(Fe||ce)){const e=v(t,ke.start,ke.end,rt);for(const t of ot){const n=e.has(t)||"highlight"===t&&e.has("accent");at[t]=!!Ve?.add.includes(t)||!Ve?.drop.includes(t)&&n}ce&&(at.link=e.has("link"))}else if(ke)for(const e of ot)at[e]="link"===e?null!==k(t,ke.start,ke.end):x(t,ke.start,ke.end,e);const st=()=>{const e=Ze(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},it=e=>{if(ce&&"link"!==e&&E(0,e)){const{start:n,end:r}=st();if(n===r&&!Fe)return void Xe(n=>xe(t,e,n,(e,t,n,r)=>g(e,t,n,r,rt,fe.placeholders)));const l=o({value:t,rules:rt,start:n,end:r,style:e,pending:Ve});return void("pending"===l.kind?Ue(l.pending):Xe(()=>l.result))}if("clear"===e)return void Xe(n=>xe(t,e,n,(e,t,n)=>g(e,t,n,"clear",rt)));if("link"!==e&&Fe&&E(0,e)){const n=Ze(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;if(r===l){const n=v(t,r,l,rt),o=n.has(e)||"highlight"===e&&n.has("accent"),a=Ve&&Ve.at===r?Ve:null,s=!!a?.add.includes(e)||!a?.drop.includes(e)&&o,i=(a?.add??[]).filter(t=>t!==e),c=(a?.drop??[]).filter(t=>t!==e);return s&&o?c.push(e):s||o||i.push(e),void Ue(i.length||c.length?{add:i,drop:c,at:r}:null)}return void Xe(n=>D(t,n?.selectionStart??r,n?.selectionEnd??l,e,rt))}if("link"!==e){const n=H??((e,t,n,r)=>g(e,t,n,r,b,fe.placeholders));return void Xe(r=>xe(t,e,r,n))}const n=Ze(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;Ye(!1),nt({start:r,end:l,link:k(t,r,l)})},ct=Boolean(ke&&ke.start!==ke.end),ut=ke?w(t,ke.start,ke.end,rt):null,dt=ke?Ve&&void 0!==Ve.color&&Ve.at===ke.start?Ve.color:S(t,ke.start,ke.end,rt):null,pt=dt?dt.startsWith("#")?dt:oe?.find(e=>e.name===dt)?.value:void 0,ft=e=>{Fe?e?$e.current?.setSource(e.start,e.end,t):$e.current?.focus():(me.current?.focus(),e&&me.current?.setSelectionRange(e.start,e.end))},ht=()=>{const e=tt;nt(null),ft(e?{start:e.start,end:e.end}:ke)},mt=()=>{const e=yt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Ye(!1),t&&ft(ke)},gt=V(mt);gt.current=mt,Y(()=>{if(qe)return j(e=>{const t=yt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(gt.current(),!0)},()=>yt.current?.querySelector(".es-copy-colors"))},[qe]);const yt=V(null),vt=qe||null!==tt;Y(()=>{const e=yt.current;if(!vt||!e)return;const t=e.ownerDocument,n=()=>{Ye(!1),nt(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[vt]);const bt=tt??(qe?ke??{start:t.length,end:t.length}:null),kt=V(()=>{});kt.current=()=>{const e=yt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!bt)return;const n=Fe?null:e.querySelector(".es-gold-layer"),r=Fe?$e.current?.rangeOf(bt.start,bt.end)??null:n?function(e,t,n){const r=e.ownerDocument,l=r.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=l.nextNode();e;e=l.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);l.currentNode=e;const s=o(n);if(!a||!s)return null;const i=r.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,bt.start,bt.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?Pe(t):Pe(n[0])}if(!t)return null;const r=t.getBoundingClientRect();return{left:r.left,top:r.top,right:r.left,bottom:r.bottom}}(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:r,parent:l,gap:o=8}){const a=Math.max(n.left,r.left),s=Math.min(n.right,r.right)-t.width,i=Be(e.left,a,s),c=r.bottom-(e.bottom+o),u=e.top-o-r.top,d=t.height>c&&(t.height<=u||u>c),p=d?e.top-o-t.height:e.bottom+o,f=e.left+Math.min((e.right-e.left)/2,10),h=Be(f-5-i,10,t.width-10-10);return{top:p-l.top,left:i-l.left,above:d,point:h}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:Oe(e),parent:ze(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},q(()=>{const e=yt.current;if(!vt||!e)return;const t=()=>kt.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[vt,qe,tt,bt?.start,bt?.end,Fe]);const xt=e=>tt&&/* @__PURE__ */ue(I,{className:e?"es-copy-link es-copy-pop":"es-copy-link",value:tt.link?.href??"",onApply:e=>{const n=tt;nt(null),Xe(()=>Fe?R(t,n.start,n.end,e,rt):B(t,n.start,n.end,e))},onRemove:tt.link?()=>{const e=tt.link,n=tt;nt(null),e&&Xe(()=>Fe?T(t,n.start,n.end,rt):M(t,e))}:void 0,onCancel:ht}),wt=_?ye(_.allow,fe.align):[],St="always"===ee||ge||null!==tt||qe,Et=oe&&oe.length>0?{run:pt,open:qe,onToggle:()=>{nt(null),qe?mt():Ye(!0)}}:void 0,Ct=St&&ce&&ie?ie({className:"rosh-tb-btn",disabled:m,selected:ct,keepCaret:e=>e.preventDefault(),insert:e=>Xe(n=>we(t,e,n))}):void 0,Dt=new Set(ot),Nt=_?{value:_.value,allow:_.allow,onChange:_.onChange,disabled:_.disabled}:void 0,Lt={pressed:ut,onList:e=>{const{start:n,end:r}=st(),l=w(t,n,r,rt);Xe(()=>L(t,n,r,l===e?null:e,rt))}},Tt=W({offered:Dt,color:Et,last:Ct,alignment:Nt,list:Lt,letterCase:se}),Mt=ce&&St&&(Ae.some(e=>Dt.has(e))||Boolean(Et));/* @__PURE__ */
13
+ return de("div",{ref:yt,className:"es-copy"+(d?` ${d}`:""),onFocus:()=>ve(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ve(!1)},onKeyDown:e=>{const t=e.target===me.current||Boolean(e.target.closest?.(".es-rich"));if(m||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Qe(l||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(ce){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!ot.includes(t))return;return e.preventDefault(),e.stopPropagation(),void it(t)}const a=lt.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),it(a.style))},onPaste:e=>{const n=me.current;if(m||!n||e.target!==n)return;e.preventDefault();const r=a({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:i,rules:rt});Xe(e=>we(t,r,e))},style:oe&&oe.length>0?Object.fromEntries(oe.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=me.current;e&&e.ownerDocument.activeElement===e&&Se({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[St&&ce&&(Tt.words||Tt.paragraph)?
14
+ /* @__PURE__ */ue(A,{className:"es-copy-toolbar","aria-label":J??fe.formatting,offered:Dt,pressed:at,onMark:e=>it(e),color:Et,linkOpen:null!==tt,last:Ct,alignment:Nt,list:Lt,letterCase:se,disabled:m,windows:/* @__PURE__ */de(pe,{children:[qe&&oe&&oe.length>0?/* @__PURE__ */ue(Re,{colors:oe,current:dt,words:fe.colors??e.colors,onPick:e=>{const{start:n,end:r}=st();if(n!==r)Xe(()=>N(t,n,r,e,rt));else{if(!Fe)return;Ue({add:Ve?.add??[],drop:Ve?.drop??[],color:e,at:n})}}}):null,tt?xt(!0):null]})}):null,ce&&ae&&ae.length>0?/* @__PURE__ */ue(Te,{cells:ae,words:fe.cells??e.cells,readOnly:m}):null,St&&!ce?/* @__PURE__ */ue(je,{tools:K,disabled:m,actions:$,glyphs:G,ariaLabel:J,pressed:at,open:tt?"link":null,onApply:it,align:_?/* @__PURE__ */ue(p,{options:wt,value:_.value,onChange:_.onChange,ariaLabel:fe.alignment,disabled:m||_.disabled,fit:be(wt)}):null}):null,Fe?/* @__PURE__ */ue(De,{value:t,rules:rt,multiline:i,readOnly:m,placeholder:c,ariaLabel:u,handle:$e,pending:Ve??void 0,onEdit:(e,n,r)=>{Ee.record({text:t,start:n.start,end:n.end},r,Date.now()),Ue(null),Ne(e)},onSelect:e=>{Se(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Ve||e.start===Ve.at&&e.end===Ve.at||Ue(null)},onHistory:Qe,onFormat:e=>{ot.includes(e)&&it(e)},onCommit:r,onCancel:s}):/* @__PURE__ */ue(h,{value:t,onInput:e=>{Ee.record(Le(null),"type",Date.now()),Ne(e)},onCommit:r,onCancel:s,multiline:i,placeholder:c,ariaLabel:u,rules:z,disabled:m,inputRef:me,className:"es-copy-box"}),tt&&!ce?xt(!1):null,X?X({focused:ge,insert:e=>Xe(n=>we(t,e,n))}):null,te&&i||Mt?
15
+ /* @__PURE__ */de("div",{className:"es-copy-marks",children:[te&&i?/* @__PURE__ */de(pe,{children:[
16
+ /* @__PURE__ */ue(f,{checked:Me,onChange:()=>{const e=Ze();et.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ke,Ue(null),He(e=>!e)},ariaLabelledBy:Ie,disabled:m}),
17
+ /* @__PURE__ */ue("span",{id:Ie,className:"es-copy-marks-label",children:fe.showMarks??"Show marks"})]}):null,Mt?O(ct?void 0:fe.clearStyleEmpty??"Select words first",/* @__PURE__ */de(F,{variant:"secondary",size:"sm",className:"es-copy-clear",disabled:m||!ct,onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:e,end:n}=st();if(e===n)return;const r=C(t,e,n,rt);r.text!==t&&Xe(()=>r)},children:[
18
+ /* @__PURE__ */ue(re,{size:16}),fe.clearStyle??"Clear style"]})):null]}):null]})}export{fe as COPY_ALIGNS,ge as COPY_ALIGN_FIT,me as COPY_ALIGN_GLYPHS,he as COPY_ALIGN_LABELS,Ne as COPY_CELLS,Re as ColorWindow,Ie as CopyBox,Te as CopyCells,je as MarkBar,De as RichBox,Fe as ariaShortcut,ye as copyAlignOptions,we as insertSelection,xe as markSelection,We as useCaretEdit};
@@ -1 +1 @@
1
- export{AddPanel,CanvasDragLayer,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-AYNU4FYF.js";import"../chunk-O2NLQBFX.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-AWJUYMX7.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{AddPanel,CanvasDragLayer,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-HFW6D46X.js";import"../chunk-O2NLQBFX.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-AWJUYMX7.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -7,7 +7,8 @@ import { S as SlotAddress, D as Data, P as Place } from '../types-41704JE4.js';
7
7
  import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-D68pb3Bx.js';
8
8
  import * as react from 'react';
9
9
  import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
10
- import { C as CanvasTypingEnd } from '../canvas-typing-Dec_zyuM.js';
10
+ import { TextToolbarProps } from 'efficient-shell/ui';
11
+ import { C as CanvasTypingEnd } from '../canvas-typing-U7TV-iax.js';
11
12
  import { InlineRule } from '../markup/index.js';
12
13
  import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-CLbZyd43.js';
13
14
  import { I as InspectorFields } from '../types-OUl0mK1k.js';
@@ -341,6 +342,17 @@ interface CanvasTypingTarget {
341
342
  write: (next: string) => void;
342
343
  /** Draw the words afresh (after an IME composition wrote into them). */
343
344
  remount?: () => void;
345
+ /**
346
+ * The text toolbar these words get while they are typed: the tools the
347
+ * panel's text box offers for the same field (its `tools`, and the field's
348
+ * alignment and letter case). The ONE toolbar (efficient-shell `TextToolbar`)
349
+ * floats above the words in the shell's `FloatingBar`. Left out, no bar.
350
+ */
351
+ toolbar?: {
352
+ offered: readonly string[];
353
+ alignment?: TextToolbarProps['alignment'];
354
+ letterCase?: TextToolbarProps['letterCase'];
355
+ };
344
356
  }
345
357
  type CanvasTypingState = {
346
358
  typing: true;
@@ -1 +1 @@
1
- export{CanvasFrame,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-DSUMM2WF.js";import"../chunk-AELNNAFM.js";import"../chunk-YRLPFZW3.js";import"../chunk-UK2FQOUT.js";import"../chunk-JIWPANGM.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-AWJUYMX7.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{CanvasFrame,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-M5VRWM7M.js";import"../chunk-TBY3DFKS.js";import"../chunk-YRLPFZW3.js";import"../chunk-UK2FQOUT.js";import"../chunk-CIHKZMNR.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-AWJUYMX7.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-X4OF36J2.js";import"../chunk-4JSBIW5H.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-3ZJSLHHI.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-CRWFB7MU.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-4JSBIW5H.js";import"../chunk-3ZJSLHHI.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-CJBU4E4L.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-EXCKAZKN.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-X4OF36J2.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-ESQZG7B3.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.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-B4ZNYLZX.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-EXCKAZKN.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-X4OF36J2.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-NAGDOIW4.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-HFW6D46X.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-DQLK3QQ2.js";import"../../chunk-EXCKAZKN.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-X4OF36J2.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-Q2L6YTII.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-HAUTMX4H.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BXQBCW3P.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-QPQXKKSC.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-T5HFGW57.js";import"../../chunk-I6U2G7L4.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-LVUDUQNL.js";import"../../chunk-HQWQLDCB.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-B4ZNYLZX.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-DQLK3QQ2.js";import"../../chunk-EXCKAZKN.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-X4OF36J2.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenChrome as default}from"../../chunk-GIP45GWF.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BXQBCW3P.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-UY7BCB32.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-5PUEZ22M.js";import"../../chunk-57NRNFLO.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-LVUDUQNL.js";import"../../chunk-HQWQLDCB.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-NAGDOIW4.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-Q2L6YTII.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-HFW6D46X.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{DocumentScreen,ScreenMount as default}from"../../chunk-PRRFBVJ2.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-H3WBX7FN.js";import"../../chunk-HAUTMX4H.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BXQBCW3P.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-QPQXKKSC.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-T5HFGW57.js";import"../../chunk-I6U2G7L4.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-LVUDUQNL.js";import"../../chunk-HQWQLDCB.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-B4ZNYLZX.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-DQLK3QQ2.js";import"../../chunk-EXCKAZKN.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-X4OF36J2.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{DocumentScreen,ScreenMount as default}from"../../chunk-T5ORM737.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-4UJ6CPLO.js";import"../../chunk-GIP45GWF.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BXQBCW3P.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-UY7BCB32.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-5PUEZ22M.js";import"../../chunk-57NRNFLO.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-LVUDUQNL.js";import"../../chunk-HQWQLDCB.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-NAGDOIW4.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-Q2L6YTII.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-HFW6D46X.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenStoreProvider as default}from"../../chunk-H3WBX7FN.js";import"../../chunk-EXCKAZKN.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-X4OF36J2.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenStoreProvider as default}from"../../chunk-4UJ6CPLO.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";