@eigenpal/docx-js-editor 0.0.13 → 0.0.14

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 (79) hide show
  1. package/README.md +0 -3
  2. package/dist/FindReplaceDialog-46BE7Q2G.cjs +1 -0
  3. package/dist/{FindReplaceDialog-RWYDRWHF.js → FindReplaceDialog-UMXCBBST.js} +1 -1
  4. package/dist/{FootnotePropertiesDialog-BC6JIPDA.cjs → FootnotePropertiesDialog-OBQXOBJE.cjs} +1 -1
  5. package/dist/{FootnotePropertiesDialog-CWQF5EBK.js → FootnotePropertiesDialog-TYQGPWPX.js} +1 -1
  6. package/dist/{HyperlinkDialog-EG2BSLPD.cjs → HyperlinkDialog-22NH7ZLP.cjs} +1 -1
  7. package/dist/{HyperlinkDialog-YAVK64F4.js → HyperlinkDialog-UOERZIBM.js} +1 -1
  8. package/dist/{ImagePositionDialog-S6SMH7XH.js → ImagePositionDialog-52FDANUK.js} +1 -1
  9. package/dist/{ImagePositionDialog-IGYS5KMK.cjs → ImagePositionDialog-ZK5WFBRC.cjs} +1 -1
  10. package/dist/{ImagePropertiesDialog-VGV4E4SN.cjs → ImagePropertiesDialog-LU44RDIY.cjs} +1 -1
  11. package/dist/{ImagePropertiesDialog-UO5QUIBS.js → ImagePropertiesDialog-YPSLPSF6.js} +1 -1
  12. package/dist/{TablePropertiesDialog-WRM47JI6.cjs → TablePropertiesDialog-KMOYHPGF.cjs} +1 -1
  13. package/dist/{TablePropertiesDialog-VBOU4DID.js → TablePropertiesDialog-OUUJAA7D.js} +1 -1
  14. package/dist/{chunk-M7F2CUUD.js → chunk-3VOXZKGT.js} +1 -1
  15. package/dist/{chunk-OTG4NABM.js → chunk-5MWH4N7I.js} +1 -1
  16. package/dist/chunk-5WBRHVOE.js +258 -0
  17. package/dist/chunk-6YFGCUHU.js +4 -0
  18. package/dist/{chunk-MDPDH7KS.js → chunk-7H2HP242.js} +1 -1
  19. package/dist/{chunk-KVAT5SVD.js → chunk-CTYOM6BE.js} +1 -1
  20. package/dist/{chunk-A7VY2V4X.cjs → chunk-FYAWM7MP.cjs} +1 -1
  21. package/dist/{chunk-EPCZ24TY.cjs → chunk-IHZIA6JP.cjs} +1 -1
  22. package/dist/{chunk-PNMZPPPI.cjs → chunk-JGPRSZPI.cjs} +1 -1
  23. package/dist/chunk-JS7TPZTF.cjs +10 -0
  24. package/dist/chunk-L7UKJGRK.js +10 -0
  25. package/dist/{chunk-6MBDPZVD.js → chunk-MLSHZVL7.js} +2 -2
  26. package/dist/chunk-O7QVCJN6.cjs +4 -0
  27. package/dist/{chunk-W4DUKACP.cjs → chunk-OEOUMSWH.cjs} +3 -3
  28. package/dist/chunk-OWMXCVKB.js +1 -0
  29. package/dist/{chunk-XVFMG77A.cjs → chunk-PXC7ARQB.cjs} +1 -1
  30. package/dist/chunk-QVVLXLRZ.cjs +258 -0
  31. package/dist/{chunk-QHWHCIUW.js → chunk-R5SKERM2.js} +1 -1
  32. package/dist/{chunk-FLECKDK4.cjs → chunk-UAME5JHZ.cjs} +2 -2
  33. package/dist/chunk-VOWKSURW.cjs +1 -0
  34. package/dist/{chunk-CZ7W7MCM.cjs → chunk-VTAS7VZ6.cjs} +1 -1
  35. package/dist/{chunk-MMJD2DLL.js → chunk-WFWLPKQA.js} +1 -1
  36. package/dist/core-plugins.cjs +1 -1
  37. package/dist/core-plugins.d.cts +7 -4
  38. package/dist/core-plugins.d.ts +7 -4
  39. package/dist/core-plugins.js +1 -1
  40. package/dist/core.cjs +1 -1
  41. package/dist/core.js +1 -1
  42. package/dist/executor-ITYZTNSH.cjs +1 -0
  43. package/dist/executor-TC7CLATE.js +1 -0
  44. package/dist/headless.cjs +2 -2
  45. package/dist/headless.js +1 -1
  46. package/dist/index.cjs +5 -5
  47. package/dist/index.d.cts +3 -3
  48. package/dist/index.d.ts +3 -3
  49. package/dist/index.js +5 -5
  50. package/dist/mcp-cli.js +21 -21
  51. package/dist/mcp.cjs +8 -8
  52. package/dist/mcp.js +1 -1
  53. package/dist/{processTemplate-QOEAXCKA.cjs → processTemplate-525HZL4S.cjs} +1 -1
  54. package/dist/{processTemplate-BHBTDAIC.js → processTemplate-RJN6452W.js} +1 -1
  55. package/dist/{react-Be1YOl4z.d.ts → react-BZxD04XV.d.ts} +2 -8
  56. package/dist/{react-DPuSVbgY.d.cts → react-D8eAYckC.d.cts} +2 -8
  57. package/dist/react.cjs +1 -1
  58. package/dist/react.d.cts +1 -1
  59. package/dist/react.d.ts +1 -1
  60. package/dist/react.js +1 -1
  61. package/dist/{selectionRects-LO3FJT47.js → selectionRects-42JURU6D.js} +1 -1
  62. package/dist/{selectionRects-I5JVL73G.cjs → selectionRects-XGMQBMC5.cjs} +1 -1
  63. package/dist/styles.css +1 -1
  64. package/dist/ui.cjs +1 -1
  65. package/dist/ui.d.cts +1 -53
  66. package/dist/ui.d.ts +1 -53
  67. package/dist/ui.js +1 -1
  68. package/package.json +1 -2
  69. package/dist/FindReplaceDialog-BAACAU67.cjs +0 -1
  70. package/dist/chunk-3IYNTJO5.js +0 -1
  71. package/dist/chunk-6YLNNCRZ.cjs +0 -10
  72. package/dist/chunk-BVQ2QRHA.cjs +0 -4
  73. package/dist/chunk-COP5BIBZ.js +0 -10
  74. package/dist/chunk-E6XDMUAM.js +0 -4
  75. package/dist/chunk-MTX3EEBJ.js +0 -258
  76. package/dist/chunk-RTESADL3.cjs +0 -1
  77. package/dist/chunk-VN7XH644.cjs +0 -258
  78. package/dist/executor-44OB3DFD.js +0 -1
  79. package/dist/executor-U3BZPPGN.cjs +0 -1
@@ -0,0 +1,4 @@
1
+ 'use strict';var chunkSF53KLDZ_cjs=require('./chunk-SF53KLDZ.cjs'),chunkVOWKSURW_cjs=require('./chunk-VOWKSURW.cjs'),Q=require('react'),H=require('@radix-ui/react-select'),clsx=require('clsx'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Q__namespace=/*#__PURE__*/_interopNamespace(Q);var H__namespace=/*#__PURE__*/_interopNamespace(H);var El={};chunkVOWKSURW_cjs.b(El,{CLIPBOARD_TYPES:()=>exports.ba,INTERNAL_CLIPBOARD_TYPE:()=>exports.aa,cleanWordHtml:()=>eo,copyParagraphs:()=>xn,copyRuns:()=>Mt,createClipboardHandlers:()=>Tn,default:()=>Hl,handlePasteEvent:()=>jt,htmlToRuns:()=>to,isEditorHtml:()=>Qt,isWordHtml:()=>Jt,paragraphsToClipboardContent:()=>Sn,parseClipboardHtml:()=>Xt,readFromClipboard:()=>yn,runsToClipboardContent:()=>kt,writeToClipboard:()=>tt});async function Mt(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let i=kt(e,o);return await tt(i)}catch(i){return n?.(i),false}}async function xn(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let i=Sn(e,o);return await tt(i)}catch(i){return n?.(i),false}}function kt(e,t=true){let o=e.map(oo).join(""),n=t?Cn(e):no(o),i=JSON.stringify(e);return {plainText:o,html:n,internal:i}}function Sn(e,t=true){let o=e.map(Ll).join(`
2
+ `),n=t?Rl(e):no(o),i=JSON.stringify(e);return {plainText:o,html:n,internal:i}}async function tt(e){try{if(navigator.clipboard&&navigator.clipboard.write){let t=[new ClipboardItem({[exports.ba.PLAIN]:new Blob([e.plainText],{type:exports.ba.PLAIN}),[exports.ba.HTML]:new Blob([e.html],{type:exports.ba.HTML})})];return await navigator.clipboard.write(t),!0}return gn(e)}catch{return gn(e)}}function gn(e){let t=document.createElement("div");t.innerHTML=e.html,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t);try{let o=window.getSelection();if(!o)return !1;let n=document.createRange();n.selectNodeContents(t),o.removeAllRanges(),o.addRange(n);let i=document.execCommand("copy");return o.removeAllRanges(),i}finally{document.body.removeChild(t);}}async function yn(e={}){let{cleanWordFormatting:t=true,onError:o}=e;try{if(navigator.clipboard&&navigator.clipboard.read){let n=await navigator.clipboard.read();return await Ml(n,t)}return null}catch(n){return o?.(n),null}}async function Ml(e,t){let o="",n="";for(let i of e)i.types.includes(exports.ba.HTML)&&(o=await(await i.getType(exports.ba.HTML)).text()),i.types.includes(exports.ba.PLAIN)&&(n=await(await i.getType(exports.ba.PLAIN)).text());return Xt(o,n,t)}function jt(e,t={}){let{cleanWordFormatting:o=true}=t,n=e.clipboardData;if(!n)return null;let i=n.getData(exports.ba.HTML),a=n.getData(exports.ba.PLAIN);return Xt(i,a,o)}function Xt(e,t,o=true){let n=Jt(e),i=Qt(e);if(i){let p=e.match(/data-docx-editor-content="([^"]+)"/);if(p)try{return {runs:JSON.parse(decodeURIComponent(p[1])),fromWord:!1,fromEditor:!0,plainText:t}}catch{}}let a=e;return n&&o&&(a=eo(e)),{runs:to(a,t),fromWord:n,fromEditor:i,plainText:t}}function Jt(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("MsoNormal")||e.includes('class="Mso')||e.includes("<!--[if gte mso")}function Qt(e){return e.includes("data-docx-editor")||e.includes("docx-run")||e.includes("docx-paragraph")}function eo(e){let t=e;return t=t.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,""),t=t.replace(/<!--[\s\S]*?-->/g,""),t=t.replace(/<\?xml[^>]*>/gi,""),t=t.replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,""),t=t.replace(/<o:[^>]*\/>/gi,""),t=t.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,""),t=t.replace(/<w:[^>]*\/>/gi,""),t=t.replace(/\s*mso-[^:;]+:[^;]+;?/gi,""),t=t.replace(/\s*style="\s*"/gi,""),t=t.replace(/\s*class="[^"]*Mso[^"]*"/gi,""),t=t.replace(/<span[^>]*>\s*<\/span>/gi,""),t=t.replace(/<\/?font[^>]*>/gi,""),t=t.replace(/\s+/g," ").trim(),t}function to(e,t){if(!e||e.trim()==="")return t?[Kt(t)]:[];let o=document.createElement("div");o.innerHTML=e;let n=[];return Yt(o,n,{}),n.length===0&&t?[Kt(t)]:n}function Yt(e,t,o){if(e.nodeType===Node.TEXT_NODE){let r=e.textContent||"";(r.trim()||r.includes(" "))&&t.push(Kt(r,o));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e,i=n.tagName.toLowerCase(),a={...o,...kl(n)};switch(i){case "br":t.push(vn(a));return;case "p":case "div":for(let r of n.childNodes)Yt(r,t,a);n.nextSibling&&t.push(vn(a));return;case "b":case "strong":a.bold=true;break;case "i":case "em":a.italic=true;break;case "u":a.underline={style:"single"};break;case "s":case "strike":case "del":a.strike=true;break;case "sup":a.vertAlign="superscript";break;case "sub":a.vertAlign="subscript";break;case "code":case "pre":a.fontFamily={ascii:"Courier New"};break}for(let r of n.childNodes)Yt(r,t,a);}function kl(e){let t={},o=e.style;(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(t.bold=true),o.fontStyle==="italic"&&(t.italic=true);let n=o.textDecoration||o.textDecorationLine;if(n&&(n.includes("underline")&&(t.underline={style:"single"}),n.includes("line-through")&&(t.strike=true)),o.fontSize){let i=parseFloat(o.fontSize);isNaN(i)||(t.fontSize=Math.round(i/1.333*2));}if(o.fontFamily){let i=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();i&&(t.fontFamily={ascii:i});}if(o.color){let i=bn(o.color);i&&(t.color={rgb:i});}if(o.backgroundColor&&o.backgroundColor!=="transparent"){let i=bn(o.backgroundColor);i&&(t.shading={fill:{rgb:i}});}return t}function bn(e){if(!e||e==="transparent"||e==="inherit")return null;if(e.startsWith("#"))return e.slice(1).toUpperCase();let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t){let o=parseInt(t[1]).toString(16).padStart(2,"0"),n=parseInt(t[2]).toString(16).padStart(2,"0"),i=parseInt(t[3]).toString(16).padStart(2,"0");return (o+n+i).toUpperCase()}return null}function oo(e){return e.content.map(t=>t.type==="text"?t.text:t.type==="tab"?" ":t.type==="break"&&t.breakType==="textWrapping"?`
3
+ `:"").join("")}function Ll(e){return (e.content||[]).map(t=>t.type==="run"?oo(t):"").join("")}function Cn(e){return e.map(Zl).join("")}function Rl(e){return e.map(t=>`<p>${Cn(t.content?.filter(o=>o.type==="run")||[])}</p>`).join("")}function Zl(e){let t=oo(e);if(!t)return "";let o=no(t),n=e.formatting;if(!n)return o;n.bold&&(o=`<strong>${o}</strong>`),n.italic&&(o=`<em>${o}</em>`),n.underline&&(o=`<u>${o}</u>`),n.strike&&(o=`<s>${o}</s>`),n.vertAlign==="superscript"&&(o=`<sup>${o}</sup>`),n.vertAlign==="subscript"&&(o=`<sub>${o}</sub>`);let i=[];if(n.fontSize){let a=n.fontSize/2;i.push(`font-size: ${a}pt`);}return n.fontFamily?.ascii&&i.push(`font-family: "${n.fontFamily.ascii}"`),n.color?.rgb&&i.push(`color: #${n.color.rgb}`),n.shading?.fill?.rgb&&i.push(`background-color: #${n.shading.fill.rgb}`),i.length>0&&(o=`<span style="${i.join("; ")}">${o}</span>`),o}function no(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Kt(e,t){return {type:"run",formatting:t,content:[{type:"text",text:e}]}}function vn(e){return {type:"run",formatting:e,content:[{type:"break",breakType:"textWrapping"}]}}function Tn(e){let{onCopy:t,onCut:o,onPaste:n,clipboardOptions:i={}}=e;return {handleCopy:async c=>{if(!t)return;let u=t();if(!u)return;c.preventDefault();let l=kt(u.runs);c.clipboardData?(c.clipboardData.setData(exports.ba.PLAIN,l.plainText),c.clipboardData.setData(exports.ba.HTML,l.html)):await tt(l);},handleCut:async c=>{if(!o)return;let u=o();if(!u)return;c.preventDefault();let l=kt(u.runs);c.clipboardData?(c.clipboardData.setData(exports.ba.PLAIN,l.plainText),c.clipboardData.setData(exports.ba.HTML,l.html)):await tt(l);},handlePaste:c=>{if(!n)return;c.preventDefault();let u=jt(c,i);u&&n(u);},handleKeyDown:async c=>{let u=c.ctrlKey||c.metaKey;if(u&&c.key==="c"&&!c.shiftKey&&t){let l=t();l&&await Mt(l.runs,i);}if(u&&c.key==="x"&&!c.shiftKey&&o){let l=o();l&&await Mt(l.runs,i);}}}}exports.aa=void 0;exports.ba=void 0;var Hl,_l=chunkVOWKSURW_cjs.a(()=>{exports.aa="application/x-docx-editor",exports.ba={HTML:"text/html",PLAIN:"text/plain"};Hl={copyRuns:Mt,copyParagraphs:xn,readFromClipboard:yn,handlePasteEvent:jt,htmlToRuns:to,cleanWordHtml:eo,isWordHtml:Jt,isEditorHtml:Qt,createClipboardHandlers:Tn};});function T(...e){return clsx.clsx(e)}var xe=H__namespace.Root,qe=H__namespace.Group,lt=H__namespace.Value;function Se({className:e,children:t,onMouseDown:o,...n}){return jsxRuntime.jsxs(H__namespace.Trigger,{className:T("flex h-8 items-center justify-between gap-1 rounded px-2 py-1","text-sm text-slate-700 bg-transparent","hover:bg-slate-100/80 focus:outline-none focus:bg-slate-100/80","disabled:cursor-not-allowed disabled:opacity-50","transition-colors duration-150","[&>span]:truncate",e),onMouseDown:i=>{i.preventDefault(),o?.(i);},...n,children:[t,jsxRuntime.jsx(H__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(_n,{className:"h-4 w-4 text-slate-400 shrink-0"})})]})}function ye({className:e,children:t,position:o="popper",onCloseAutoFocus:n,...i}){return jsxRuntime.jsx(H__namespace.Portal,{children:jsxRuntime.jsx("div",{className:"ep-root",children:jsxRuntime.jsx(H__namespace.Content,{className:T("relative z-50 max-h-72 min-w-[8rem] overflow-hidden","rounded-lg border border-slate-200 bg-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",e),position:o,onCloseAutoFocus:a=>{a.preventDefault(),n?.(a);},...i,children:jsxRuntime.jsx(H__namespace.Viewport,{className:T("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),onMouseDown:a=>a.preventDefault(),children:t})})})})}function Fe({className:e,...t}){return jsxRuntime.jsx(H__namespace.Label,{className:T("px-2 py-1.5 text-xs font-medium text-slate-500",e),...t})}function se({className:e,children:t,onMouseDown:o,...n}){return jsxRuntime.jsxs(H__namespace.Item,{className:T("relative flex w-full cursor-pointer select-none items-center","rounded px-2 py-1.5 text-sm text-slate-700 outline-none","hover:bg-slate-100 focus:bg-slate-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onMouseDown:i=>{i.preventDefault(),o?.(i);},...n,children:[jsxRuntime.jsx(H__namespace.ItemText,{children:t}),jsxRuntime.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(H__namespace.ItemIndicator,{children:jsxRuntime.jsx(Dn,{className:"h-4 w-4"})})})]})}function Xe({className:e,...t}){return jsxRuntime.jsx(H__namespace.Separator,{className:T("-mx-1 my-1 h-px bg-slate-100",e),...t})}function _n({className:e}){return jsxRuntime.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})}function Dn({className:e}){return jsxRuntime.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})}var Nn=[{name:"Arial",fontFamily:"Arial, Helvetica, sans-serif",category:"sans-serif"},{name:"Calibri",fontFamily:'"Calibri", Arial, sans-serif',category:"sans-serif"},{name:"Helvetica",fontFamily:"Helvetica, Arial, sans-serif",category:"sans-serif"},{name:"Verdana",fontFamily:"Verdana, Geneva, sans-serif",category:"sans-serif"},{name:"Open Sans",fontFamily:'"Open Sans", sans-serif',category:"sans-serif"},{name:"Roboto",fontFamily:"Roboto, sans-serif",category:"sans-serif"},{name:"Times New Roman",fontFamily:'"Times New Roman", Times, serif',category:"serif"},{name:"Georgia",fontFamily:"Georgia, serif",category:"serif"},{name:"Cambria",fontFamily:"Cambria, Georgia, serif",category:"serif"},{name:"Garamond",fontFamily:"Garamond, serif",category:"serif"},{name:"Courier New",fontFamily:'"Courier New", Courier, monospace',category:"monospace"},{name:"Consolas",fontFamily:"Consolas, monospace",category:"monospace"}];function so({value:e,onChange:t,fonts:o=Nn,disabled:n=false,className:i,placeholder:a="Arial",width:r=120,showPreview:p=true}){let d=Q__namespace.useMemo(()=>e?o.find(h=>h.fontFamily===e||h.name.toLowerCase()===e.toLowerCase())?.name||e:a,[e,o,a]),c=Q__namespace.useCallback(l=>{let h=o.find(m=>m.name===l);h&&t?.(h.fontFamily);},[t,o]),u=Q__namespace.useMemo(()=>{let l={"sans-serif":[],serif:[],monospace:[],other:[]};return o.forEach(h=>{let m=h.category||"other";l[m].push(h);}),l},[o]);return jsxRuntime.jsxs(xe,{value:d,onValueChange:c,disabled:n,children:[jsxRuntime.jsx(Se,{className:T("h-8 text-sm",i),style:{minWidth:typeof r=="number"?`${r}px`:r},"aria-label":"Select font family",children:jsxRuntime.jsx(lt,{placeholder:a,children:d})}),jsxRuntime.jsxs(ye,{className:"max-h-[300px]",children:[u["sans-serif"].length>0&&jsxRuntime.jsxs(qe,{children:[jsxRuntime.jsx(Fe,{children:"Sans Serif"}),u["sans-serif"].map(l=>jsxRuntime.jsx(se,{value:l.name,style:p?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]}),u.serif.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Xe,{}),jsxRuntime.jsxs(qe,{children:[jsxRuntime.jsx(Fe,{children:"Serif"}),u.serif.map(l=>jsxRuntime.jsx(se,{value:l.name,style:p?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]})]}),u.monospace.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Xe,{}),jsxRuntime.jsxs(qe,{children:[jsxRuntime.jsx(Fe,{children:"Monospace"}),u.monospace.map(l=>jsxRuntime.jsx(se,{value:l.name,style:p?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]})]})]})]})}var co=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,po=clsx.clsx,uo=(e,t)=>o=>{var n;if(t?.variants==null)return po(e,o?.class,o?.className);let{variants:i,defaultVariants:a}=t,r=Object.keys(i).map(c=>{let u=o?.[c],l=a?.[c];if(u===null)return null;let h=co(u)||co(l);return i[c][h]}),p=o&&Object.entries(o).reduce((c,u)=>{let[l,h]=u;return h===void 0||(c[l]=h),c},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:l,className:h,...m}=u;return Object.entries(m).every(f=>{let[v,x]=f;return Array.isArray(x)?x.includes({...a,...p}[v]):{...a,...p}[v]===x})?[...c,l,h]:c},[]);return po(e,r,d,o?.class,o?.className)};var Fn=uo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),F=Q__namespace.forwardRef(({className:e,variant:t,size:o,...n},i)=>jsxRuntime.jsx("button",{className:T(Fn({variant:t,size:o,className:e})),ref:i,...n}));F.displayName="Button";function g({size:e=20,className:t="",style:o,children:n}){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 -960 960 960",fill:"currentColor",className:t,style:{display:"inline-flex",flexShrink:0,...o},"aria-hidden":"true",children:n})}function Bn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"})})}function On(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"})})}function zn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"})})}function Vn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"})})}function $n(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"})})}function Wn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"})})}function Gn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"})})}function Un(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"})})}function Yn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"})})}function Kn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"})})}function jn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"})})}function Xn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"})})}function Jn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"})})}function Qn(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"})})}function er(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"})})}function Rt(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"})})}function tr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"})})}function or(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"})})}function nr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"})})}function rr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"})})}function ir(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"})})}function ar(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"})})}function lr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"})})}function sr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M480-360 280-560h400L480-360Z"})})}function cr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"})})}function pr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"})})}function ur(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"})})}function dr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})})}function mr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"})})}function fr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"})})}function hr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"})})}function gr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"})})}function br(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function vr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"})})}function xr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M200-440v-80h560v80H200Z"})})}function Sr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"})})}function yr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"})})}function Cr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"})})}function Tr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"})})}function wr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"})})}function Ir(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"})})}function Pr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"})})}function Mr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"})})}function kr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M160-440v-80h640v80H160Z"})})}function Lr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Rr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function Zr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"})})}function Hr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"})})}function Er(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"})})}function _r(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"})})}function Dr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"})})}function Nr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"})})}function qr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"})})}function Fr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"})})}function Ar(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"})})}function Br(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"})})}function Or(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function zr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Vr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function $r(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"})})}function Wr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"})})}function Gr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"})})}function Ur(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"})})}function Yr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"})})}function Kr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function jr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"})})}function Xr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"})})}function Jr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"})})}function Qr(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"})})}function ei(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"})})}function ti(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"})})}function oi(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"})})}function ni(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"})})}function ri(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"})})}function ii(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"})})}function ai(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"})})}function li(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"})})}function si(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"})})}function ci(e){return jsxRuntime.jsx(g,{...e,children:jsxRuntime.jsx("path",{d:"M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})})}var pi={undo:Bn,redo:On,print:zn,format_bold:Vn,format_italic:$n,format_underlined:Wn,strikethrough_s:Gn,superscript:Un,subscript:Yn,link:Kn,format_clear:jn,format_align_left:Xn,format_align_center:Jn,format_align_right:Qn,format_align_justify:er,format_line_spacing:Rt,format_list_bulleted:tr,format_list_numbered:or,format_indent_increase:nr,format_indent_decrease:rr,format_color_text:ir,ink_highlighter:ar,format_color_reset:lr,arrow_drop_down:sr,table:cr,table_chart:pr,grid_on:ur,table_rows:dr,view_column:mr,border_all:fr,border_outer:hr,border_inner:gr,border_clear:br,add:vr,remove:xr,delete:Sr,delete_sweep:yr,call_merge:Cr,call_split:Tr,drag_indicator:wr,image:Ir,format_image_left:Pr,format_image_right:Mr,horizontal_rule:kr,flip_to_back:Lr,flip_to_front:Rr,open_with:Zr,tune:Hr,rotate_right:Er,rotate_left:_r,swap_horiz:Dr,swap_vert:Nr,shapes:qr,format_paint:Fr,expand_more:Ar,expand_less:Br,border_top:Or,border_bottom:zr,border_left:Vr,border_right:$r,padding:Wr,text_rotation_none:Gr,wrap_text:Ur,height:Yr,fit_width:Kr,settings:jr,border_color:Xr,format_color_fill:Jr,vertical_align_top:Qr,vertical_align_center:ei,vertical_align_bottom:ti,line_weight:oi,keyboard_arrow_up:ni,keyboard_arrow_down:ri,keyboard_arrow_left:ii,keyboard_arrow_right:ai,more_vert:li,page_break:si,arrow_back:ci};function b({name:e,size:t=20,className:o="",style:n}){let i=pi[e];return i?jsxRuntime.jsx(i,{size:t,className:o,style:n}):(console.warn(`Icon not found: ${e}`),jsxRuntime.jsx("span",{className:o,style:{fontSize:t,width:t,height:t,...n},children:e}))}function z({isOpen:e,onClose:t,align:o="left"}){let n=Q.useRef(null),i=Q.useRef(null),[a,r]=Q.useState({top:0,left:0});Q.useEffect(()=>{if(!e||!n.current)return;let c=n.current.getBoundingClientRect();o==="right"?requestAnimationFrame(()=>{if(i.current){let u=i.current.getBoundingClientRect();r({top:c.bottom+4,left:c.right-u.width});}else r({top:c.bottom+4,left:c.left});}):r({top:c.bottom+4,left:c.left});},[e,o]),Q.useEffect(()=>{if(!e)return;let c=h=>{let m=h.target;n.current&&!n.current.contains(m)&&i.current&&!i.current.contains(m)&&t();},u=h=>{h.key==="Escape"&&t();},l=()=>t();return document.addEventListener("mousedown",c),document.addEventListener("keydown",u),window.addEventListener("scroll",l,true),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",u),window.removeEventListener("scroll",l,true);}},[e,t]);let p=Q.useCallback(c=>{c.preventDefault(),c.stopPropagation();},[]),d={position:"fixed",top:a.top,left:a.left,zIndex:1e4};return {containerRef:n,dropdownRef:i,dropdownStyle:d,handleMouseDown:p}}var fi=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],hi=1,gi=400;function vo(e){return e/2}function s0(e){return e*2}function go(e,t,o){for(let n of t)if(n>e)return n;return Math.min(e+1,o)}function bo(e,t,o){for(let n=t.length-1;n>=0;n--)if(t[n]<e)return t[n];return Math.max(e-1,o)}function xo({value:e,onChange:t,sizes:o=fi,disabled:n=false,className:i,placeholder:a="11",minSize:r=hi,maxSize:p=gi}){let[d,c]=Q.useState(false),[u,l]=Q.useState(""),[h,m]=Q.useState(false),f=Q.useRef(null),v=Q.useCallback(()=>{m(false),c(false);},[]),{containerRef:x,dropdownRef:I,dropdownStyle:S}=z({isOpen:h,onClose:v}),w=e??(parseInt(a,10)||11),_=e!==void 0?e.toString():a,E=Q.useCallback(C=>{if(C.preventDefault(),n)return;let D=bo(w,o,r);t?.(D);},[w,o,r,n,t]),G=Q.useCallback(C=>{if(C.preventDefault(),n)return;let D=go(w,o,p);t?.(D);},[w,o,p,n,t]),k=Q.useCallback(C=>{C.preventDefault(),!n&&(c(true),l(_),m(true),requestAnimationFrame(()=>{f.current?.focus(),f.current?.select();}));},[n,_]),A=Q.useCallback(C=>{l(C.target.value);},[]),U=Q.useCallback(()=>{c(false);let C=parseInt(u,10);!isNaN(C)&&C>=r&&C<=p&&t?.(C);},[u,r,p,t]),te=Q.useCallback(C=>{if(C.key==="Enter")C.preventDefault(),U(),m(false);else if(C.key==="Escape")c(false),m(false);else if(C.key==="ArrowUp"){C.preventDefault();let D=go(w,o,p);l(D.toString()),t?.(D);}else if(C.key==="ArrowDown"){C.preventDefault();let D=bo(w,o,r);l(D.toString()),t?.(D);}},[U,w,o,p,r,t]),M=Q.useCallback(C=>{t?.(C),m(false),c(false);},[t]),O=Q.useCallback(C=>{C.target.tagName!=="INPUT"&&C.preventDefault();},[]);return jsxRuntime.jsxs("div",{ref:x,className:T("flex items-center",i),onMouseDown:O,children:[jsxRuntime.jsx(F,{variant:"ghost",size:"icon-sm",className:T("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-r-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:E,disabled:n||w<=r,"aria-label":"Decrease font size","data-testid":"font-size-decrease",children:jsxRuntime.jsx(b,{name:"remove",size:18})}),jsxRuntime.jsx("div",{className:"relative",children:d?jsxRuntime.jsx("input",{ref:f,type:"text",value:u,onChange:A,onBlur:U,onKeyDown:te,className:T("h-7 w-10 text-center text-sm border border-slate-300 bg-white","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none"),"aria-label":"Font size","data-testid":"font-size-input"}):jsxRuntime.jsx("button",{type:"button",onClick:k,className:T("h-7 w-10 text-center text-sm border border-slate-200 bg-white","hover:border-slate-300 hover:bg-slate-50","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none",n&&"opacity-50 cursor-not-allowed"),disabled:n,"aria-label":"Font size","aria-haspopup":"listbox","aria-expanded":h,"data-testid":"font-size-display",children:_})}),h&&jsxRuntime.jsx("div",{ref:I,style:{...S,backgroundColor:"white",border:"1px solid #e2e8f0",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",maxHeight:240,overflowY:"auto",minWidth:60},role:"listbox","aria-label":"Font sizes",children:o.map(C=>jsxRuntime.jsx("button",{type:"button",onClick:()=>M(C),className:T("w-full px-3 py-1.5 text-sm text-left","hover:bg-slate-100",C===w&&"bg-slate-100 font-medium"),role:"option","aria-selected":C===w,children:C},C))}),jsxRuntime.jsx(F,{variant:"ghost",size:"icon-sm",className:T("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-l-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:G,disabled:n||w>=p,"aria-label":"Increase font size","data-testid":"font-size-increase",children:jsxRuntime.jsx(b,{name:"add",size:18})})]})}var vi=[{name:"Black",hex:"000000"},{name:"Dark Red",hex:"7F0000"},{name:"Dark Orange",hex:"FF6600"},{name:"Dark Yellow",hex:"808000"},{name:"Dark Green",hex:"006400"},{name:"Dark Teal",hex:"008080"},{name:"Dark Blue",hex:"000080"},{name:"Dark Purple",hex:"4B0082"},{name:"Dark Gray",hex:"404040"},{name:"Gray",hex:"808080"},{name:"Red",hex:"FF0000"},{name:"Orange",hex:"FF9900"},{name:"Yellow",hex:"FFFF00"},{name:"Light Green",hex:"00FF00"},{name:"Cyan",hex:"00FFFF"},{name:"Light Blue",hex:"0066FF"},{name:"Blue",hex:"0000FF"},{name:"Purple",hex:"9900FF"},{name:"Magenta",hex:"FF00FF"},{name:"Pink",hex:"FF66FF"},{name:"Light Red",hex:"FFCCCC"},{name:"Light Orange",hex:"FFE5CC"},{name:"Light Yellow",hex:"FFFFCC"},{name:"Pale Green",hex:"CCFFCC"},{name:"Light Cyan",hex:"CCFFFF"},{name:"Sky Blue",hex:"CCE5FF"},{name:"Light Blue 2",hex:"CCCCFF"},{name:"Lavender",hex:"E5CCFF"},{name:"Light Magenta",hex:"FFCCFF"},{name:"White",hex:"FFFFFF"}],xi=[{name:"No Color",hex:""},{name:"Yellow",hex:"FFFF00"},{name:"Bright Green",hex:"00FF00"},{name:"Cyan",hex:"00FFFF"},{name:"Magenta",hex:"FF00FF"},{name:"Blue",hex:"0000FF"},{name:"Red",hex:"FF0000"},{name:"Dark Blue",hex:"00008B"},{name:"Teal",hex:"008080"},{name:"Green",hex:"008000"},{name:"Violet",hex:"800080"},{name:"Dark Red",hex:"8B0000"},{name:"Dark Yellow",hex:"808000"},{name:"Gray 50%",hex:"808080"},{name:"Gray 25%",hex:"C0C0C0"},{name:"Black",hex:"000000"}],Si={position:"relative",display:"inline-block"},pt={display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"32px",padding:"2px 6px",border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"},yi={...pt,backgroundColor:"var(--doc-bg-hover)"},Ci={...pt,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Ti={...pt,cursor:"default",opacity:.38},wi={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"0"},Ii={width:"14px",height:"3px",borderRadius:"0",marginTop:"-2px"},Pi={display:"grid",gap:"2px"},ut={width:"20px",height:"20px",border:"1px solid #ccc",borderRadius:"2px",cursor:"pointer",transition:"transform 0.1s, border-color 0.1s",padding:0},Mi={...ut,transform:"scale(1.1)",borderColor:"#333",zIndex:1},ki={...ut,borderWidth:"2px",borderColor:"#0066cc",boxShadow:"0 0 0 1px #0066cc"},Li={...ut,position:"relative",backgroundColor:"#fff"},Ri={position:"absolute",top:"50%",left:"-2px",right:"-2px",height:"2px",backgroundColor:"#ff0000",transform:"rotate(-45deg)"},yo={fontSize:"11px",color:"#666",marginBottom:"4px",marginTop:"8px"},Zi={marginTop:"8px",paddingTop:"8px",borderTop:"1px solid #eee"},Hi={display:"flex",alignItems:"center",gap:"8px"},Ei={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid #ccc",borderRadius:"3px",fontSize:"12px"},_i={height:"24px",padding:"0 8px",border:"1px solid #ccc",borderRadius:"3px",backgroundColor:"#f5f5f5",fontSize:"12px",cursor:"pointer"},Di=()=>jsxRuntime.jsx(b,{name:"format_color_text",size:18}),Ni=()=>jsxRuntime.jsx(b,{name:"ink_highlighter",size:18}),qi=()=>jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14});function Fi({colors:e,selectedColor:t,onSelect:o,columns:n=10,cellSize:i=20}){let[a,r]=Q.useState(null),p={...Pi,gridTemplateColumns:`repeat(${n}, ${i}px)`};return jsxRuntime.jsx("div",{style:p,className:"docx-color-grid",role:"grid",children:e.map((d,c)=>{let u=t?.toUpperCase()===d.hex.toUpperCase(),l=a===c,h=d.hex==="",m={...u?ki:l?Mi:ut,width:`${i}px`,height:`${i}px`};return h||(m.backgroundColor=`#${d.hex}`),jsxRuntime.jsx("button",{type:"button",style:h?{...Li,...m}:m,onClick:()=>o(d),onMouseDown:f=>f.preventDefault(),onMouseEnter:()=>r(c),onMouseLeave:()=>r(null),title:d.name,role:"gridcell","aria-label":d.name,"aria-selected":u,children:h&&jsxRuntime.jsx("span",{style:Ri})},`${d.hex}-${c}`)})})}function Co({value:e,onChange:t,type:o="text",theme:n,colors:i,disabled:a=false,className:r,style:p,title:d,children:c,dropdownWidth:u=230,showNoColor:l=true,showMoreColors:h=true}){let[m,f]=Q.useState(false),[v,x]=Q.useState(false),[I,S]=Q.useState(""),w=Q.useCallback(()=>f(false),[]),{containerRef:_,dropdownRef:E,dropdownStyle:G}=z({isOpen:m,onClose:w}),k=Q.useMemo(()=>{if(o==="highlight")return xi;let P=[...vi];return l&&P.unshift({name:"Automatic",hex:"000000"}),P},[o,l]),A=i||k,U=Q.useMemo(()=>e?e.startsWith("#")?e:o==="highlight"?chunkSF53KLDZ_cjs.b(e)||"transparent":`#${e}`:o==="text"?"#000000":"transparent",[e,o]),te=Q.useCallback(P=>{t?.(P.hex),f(false);},[t]),M=Q.useCallback(()=>{let P=I.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/i.test(P)&&(t?.(P),f(false),S(""));},[I,t]),O=Q.useCallback(()=>{a||f(P=>!P);},[a]),C=a?Ti:m?Ci:v?yi:pt,D=o==="text"?"Font Color":"Text Highlight Color";return jsxRuntime.jsxs("div",{ref:_,className:`docx-color-picker docx-color-picker-${o} ${r||""}`,style:{...Si,...p},children:[jsxRuntime.jsxs("button",{type:"button",className:"docx-color-picker-button",style:C,onClick:O,onMouseDown:P=>P.preventDefault(),onMouseEnter:()=>x(true),onMouseLeave:()=>x(false),disabled:a,title:d||D,"aria-label":d||D,"aria-haspopup":"true","aria-expanded":m,children:[c||jsxRuntime.jsxs("div",{style:wi,children:[o==="text"?jsxRuntime.jsx(Di,{}):jsxRuntime.jsx(Ni,{}),jsxRuntime.jsx("div",{style:{...Ii,backgroundColor:U==="transparent"?"#fff":U,border:U==="transparent"?"1px solid #ccc":"none"}})]}),jsxRuntime.jsx(qi,{})]}),m&&jsxRuntime.jsxs("div",{ref:E,className:"docx-color-picker-dropdown",style:{...G,padding:"8px",backgroundColor:"#fff",border:"1px solid #ccc",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",width:u},role:"dialog","aria-label":`${o==="text"?"Font":"Highlight"} color picker`,onMouseDown:P=>P.preventDefault(),children:[o==="highlight"&&jsxRuntime.jsx("div",{style:yo,children:"Highlight Colors"}),jsxRuntime.jsx(Fi,{colors:A,selectedColor:e,onSelect:te,columns:o==="highlight"?8:10}),h&&o==="text"&&jsxRuntime.jsxs("div",{style:Zi,children:[jsxRuntime.jsx("div",{style:yo,children:"Custom Color"}),jsxRuntime.jsxs("div",{style:Hi,children:[jsxRuntime.jsx("span",{style:{fontSize:"12px",color:"#666"},children:"#"}),jsxRuntime.jsx("input",{type:"text",style:Ei,value:I,onChange:P=>S(P.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:P=>{P.key==="Enter"&&M();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsxRuntime.jsx("button",{type:"button",style:_i,onClick:M,disabled:!/^[0-9A-Fa-f]{6}$/.test(I),children:"Apply"})]})]})]})]})}function To(e){return jsxRuntime.jsx(Co,{...e,type:"text"})}function wo(e){return jsxRuntime.jsx(Co,{...e,type:"highlight",showMoreColors:false})}function K({content:e,children:t,side:o="bottom",delayMs:n=400}){let[i,a]=Q__namespace.useState(false),[r,p]=Q__namespace.useState({x:0,y:0}),d=Q__namespace.useRef(null),c=Q__namespace.useRef(null),u=Q__namespace.useCallback(()=>{c.current=setTimeout(()=>{if(d.current){let f=d.current.getBoundingClientRect(),v=f.left+f.width/2,x=o==="top"?f.top-8:f.bottom+8;p({x:v,y:x});}a(true);},n);},[n,o]),l=Q__namespace.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),a(false);},[]);Q__namespace.useEffect(()=>()=>{c.current&&clearTimeout(c.current);},[]);let h=t.props,m=Q__namespace.cloneElement(t,{ref:d,onMouseEnter:f=>{u(),h.onMouseEnter?.(f);},onMouseLeave:f=>{l(),h.onMouseLeave?.(f);}});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[m,i&&jsxRuntime.jsx("div",{className:T("fixed z-50 px-2 py-1 text-xs font-medium text-white bg-slate-900 rounded-md shadow-lg","animate-in fade-in-0 zoom-in-95 duration-150",o==="top"&&"-translate-x-1/2 -translate-y-full",o==="bottom"&&"-translate-x-1/2"),style:{left:r.x,top:r.y,transform:o==="top"?"translate(-50%, -100%)":o==="bottom"?"translate(-50%, 0)":void 0},children:e})]})}var Qe=20,Ht=[{value:"left",label:"Align Left",icon:jsxRuntime.jsx(b,{name:"format_align_left",size:Qe}),iconName:"format_align_left",shortcut:"Ctrl+L"},{value:"center",label:"Center",icon:jsxRuntime.jsx(b,{name:"format_align_center",size:Qe}),iconName:"format_align_center",shortcut:"Ctrl+E"},{value:"right",label:"Align Right",icon:jsxRuntime.jsx(b,{name:"format_align_right",size:Qe}),iconName:"format_align_right",shortcut:"Ctrl+R"},{value:"both",label:"Justify",icon:jsxRuntime.jsx(b,{name:"format_align_justify",size:Qe}),iconName:"format_align_justify",shortcut:"Ctrl+J"}];function Mo({value:e="left",onChange:t,disabled:o=false}){let[n,i]=Q.useState(false),a=Q.useCallback(()=>i(false),[]),{containerRef:r,dropdownRef:p,dropdownStyle:d,handleMouseDown:c}=z({isOpen:n,onClose:a}),u=Q.useCallback(m=>{o||t?.(m),i(false);},[o,t]),l=Ht.find(m=>m.value===e)||Ht[0],h=jsxRuntime.jsxs(F,{variant:"ghost",size:"icon-sm",className:T("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",o&&"opacity-30 cursor-not-allowed"),onMouseDown:c,onClick:()=>!o&&i(m=>!m),disabled:o,"aria-label":`${l.label}${l.shortcut?` (${l.shortcut})`:""}`,"aria-expanded":n,"aria-haspopup":"true","data-testid":"toolbar-alignment",children:[jsxRuntime.jsx(b,{name:l.iconName,size:Qe}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxRuntime.jsxs("div",{ref:r,style:{position:"relative",display:"inline-block"},children:[n?h:jsxRuntime.jsx(K,{content:`${l.label}${l.shortcut?` (${l.shortcut})`:""}`,children:h}),n&&!o&&jsxRuntime.jsx("div",{ref:p,style:{...d,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:m=>m.stopPropagation(),children:jsxRuntime.jsx("div",{style:{display:"flex",gap:2},children:Ht.map(m=>{let f=e===m.value;return jsxRuntime.jsx("button",{type:"button",title:`${m.label}${m.shortcut?` (${m.shortcut})`:""}`,"data-testid":`alignment-${m.value}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:f?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:f?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:v=>v.preventDefault(),onMouseEnter:v=>{f||(v.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:v=>{v.currentTarget.style.backgroundColor=f?"var(--doc-primary-light)":"transparent";},onClick:()=>u(m.value),children:jsxRuntime.jsx(b,{name:m.iconName,size:18})},m.value)})})})]})}var Wi={display:"inline-flex",alignItems:"center",gap:"4px"},ko={display:"inline-flex",alignItems:"center",gap:"4px"},ht={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",padding:"4px",border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"},Gi={...ht,backgroundColor:"var(--doc-bg-hover)"},Ui={...ht,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Yi={...ht,cursor:"default",opacity:.38},Ki={width:"28px",height:"28px",padding:"2px"},ji={width:"1px",height:"20px",backgroundColor:"var(--doc-border)",margin:"0 6px"},dt=20;function mt({active:e=false,disabled:t=false,title:o,onClick:n,children:i,className:a,style:r}){let[p,d]=Q.useState(false),c={...t?Yi:e?Ui:p?Gi:ht,...r},u=l=>{l.preventDefault();};return jsxRuntime.jsx("button",{type:"button",className:`docx-list-button ${e?"docx-list-button-active":""} ${t?"docx-list-button-disabled":""} ${a||""}`,style:c,onMouseDown:u,onClick:t?void 0:n,onMouseEnter:()=>d(true),onMouseLeave:()=>d(false),disabled:t,title:o,"aria-label":o,"aria-pressed":e,role:"button",children:i})}function Lo({listState:e,onBulletList:t,onNumberedList:o,onIndent:n,onOutdent:i,disabled:a=false,className:r,style:p,showIndentButtons:d=true,compact:c=false,hasIndent:u=false}){let l=Q.useCallback(()=>c?{...Ki}:{},[c]),h=e?.type==="bullet",m=e?.type==="numbered",v=(e?.isInList||h||m)&&(e?.level??0)>0||u;return jsxRuntime.jsxs("div",{className:`docx-list-buttons ${r||""}`,style:{...Wi,...p},role:"group","aria-label":"List formatting",children:[jsxRuntime.jsxs("div",{style:ko,role:"group","aria-label":"List type",children:[jsxRuntime.jsx(mt,{active:h,disabled:a,title:"Bullet List",onClick:t,style:l(),children:jsxRuntime.jsx(b,{name:"format_list_bulleted",size:dt})}),jsxRuntime.jsx(mt,{active:m,disabled:a,title:"Numbered List",onClick:o,style:l(),children:jsxRuntime.jsx(b,{name:"format_list_numbered",size:dt})})]}),d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:ji,role:"separator"}),jsxRuntime.jsxs("div",{style:ko,role:"group","aria-label":"List indentation",children:[jsxRuntime.jsx(mt,{active:false,disabled:a||!v,title:"Decrease Indent",onClick:i,style:l(),children:jsxRuntime.jsx(b,{name:"format_indent_decrease",size:dt})}),jsxRuntime.jsx(mt,{active:false,disabled:a,title:"Increase Indent",onClick:n,style:l(),children:jsxRuntime.jsx(b,{name:"format_indent_increase",size:dt})})]})]})]})}function Ro(){return {type:"none",level:0,isInList:false}}var Ji=[{label:"Single",value:1,twipsValue:240},{label:"1.15",value:1.15,twipsValue:276},{label:"1.5",value:1.5,twipsValue:360},{label:"Double",value:2,twipsValue:480}];function Ho({value:e,onChange:t,options:o=Ji,disabled:n=false,className:i}){let a=Q__namespace.useMemo(()=>e===void 0?o[0]:o.find(p=>p.twipsValue===e)||o[0],[e,o]),r=Q__namespace.useCallback(p=>{let d=parseInt(p,10);isNaN(d)||t?.(d);},[t]);return jsxRuntime.jsxs(xe,{value:a.twipsValue.toString(),onValueChange:r,disabled:n,children:[jsxRuntime.jsx(Se,{className:T("h-8 text-sm gap-0.5 px-2",i),style:{width:"auto"},title:`Line spacing: ${a.label}`,children:jsxRuntime.jsx(Rt,{className:"h-5 w-5 shrink-0"})}),jsxRuntime.jsxs(ye,{children:[o.map(p=>jsxRuntime.jsx(se,{value:p.twipsValue.toString(),children:p.label},p.twipsValue)),jsxRuntime.jsx(Xe,{}),jsxRuntime.jsx(qe,{children:jsxRuntime.jsx(Fe,{children:"Paragraph spacing"})})]})]})}var Eo=[{styleId:"Normal",name:"Normal text",type:"paragraph",isDefault:true,priority:0,qFormat:true,fontSize:22},{styleId:"Title",name:"Title",type:"paragraph",priority:1,qFormat:true,fontSize:52,bold:true},{styleId:"Subtitle",name:"Subtitle",type:"paragraph",priority:2,qFormat:true,fontSize:30,color:"666666"},{styleId:"Heading1",name:"Heading 1",type:"paragraph",priority:3,qFormat:true,fontSize:40,bold:true},{styleId:"Heading2",name:"Heading 2",type:"paragraph",priority:4,qFormat:true,fontSize:32,bold:true},{styleId:"Heading3",name:"Heading 3",type:"paragraph",priority:5,qFormat:true,fontSize:28,bold:true}],Qi="#4a6c8c",ea={Title:26,Subtitle:18,Heading1:24,Heading2:18,Heading3:16,Heading4:14,Heading5:13,Heading6:13,Normal:14};function ta(e){let t={},o=ea[e.styleId];if(o)t.fontSize=`${o}px`;else {let n=e.fontSize?e.fontSize/2:11,i=Math.min(Math.max(n,11),20);t.fontSize=`${i}px`;}return t.lineHeight="1.3",e.bold&&(t.fontWeight="bold"),e.italic&&(t.fontStyle="italic"),e.color?t.color=`#${e.color}`:e.styleId.startsWith("Heading")&&(t.color=Qi),t}function _o({value:e,onChange:t,styles:o,disabled:n=false,className:i,width:a=120}){let r=Q__namespace.useMemo(()=>!o||o.length===0?Eo:o.filter(l=>l.type==="paragraph").filter(l=>l.qFormat?true:!(l.hidden||l.semiHidden)).map(l=>{let h=Eo.find(m=>m.styleId===l.styleId);return {styleId:l.styleId,name:l.name||l.styleId,type:l.type,isDefault:l.default,qFormat:l.qFormat,priority:l.uiPriority??99,fontSize:l.rPr?.fontSize??h?.fontSize,bold:l.rPr?.bold??h?.bold,italic:l.rPr?.italic??h?.italic,color:l.rPr?.color?.rgb??h?.color}}).sort((l,h)=>(l.priority??99)-(h.priority??99)),[o]),p=Q__namespace.useCallback(u=>{t?.(u);},[t]),d=e||"Normal",c=r.find(u=>u.styleId===d)?.name||d;return jsxRuntime.jsxs(xe,{value:d,onValueChange:p,disabled:n,children:[jsxRuntime.jsx(Se,{className:T("h-8 text-sm",i),style:{width:typeof a=="number"?`${a}px`:a},"aria-label":"Select paragraph style",children:jsxRuntime.jsx("span",{className:"truncate",children:c})}),jsxRuntime.jsx(ye,{className:"min-w-[260px] max-h-[400px]",children:r.map(u=>jsxRuntime.jsx(se,{value:u.styleId,className:"py-2.5 px-3",children:jsxRuntime.jsx("span",{style:ta(u),children:u.name})},u.styleId))})]})}var na=[{value:.5,label:"50%"},{value:.75,label:"75%"},{value:1,label:"100%"},{value:1.25,label:"125%"},{value:1.5,label:"150%"},{value:2,label:"200%"}];function Do({value:e=1,onChange:t,levels:o=na,disabled:n=false,className:i,compact:a=false}){let r=Q__namespace.useMemo(()=>{let d=o.find(c=>Math.abs(c.value-e)<.001);return d?d.label:`${Math.round(e*100)}%`},[o,e]),p=Q__namespace.useCallback(d=>{let c=parseFloat(d);isNaN(c)||t?.(c);},[t]);return jsxRuntime.jsxs(xe,{value:e.toString(),onValueChange:p,disabled:n,children:[jsxRuntime.jsx(Se,{className:T(a?"h-7 min-w-[55px] text-xs":"h-8 min-w-[70px] text-sm",i),"aria-label":`Zoom: ${r}`,children:jsxRuntime.jsx(lt,{placeholder:"100%",children:r})}),jsxRuntime.jsx(ye,{children:o.map(d=>jsxRuntime.jsx(se,{value:d.value.toString(),children:d.label},d.value))})]})}var aa=[{action:"borderAll",icon:"border_all",label:"All borders"},{action:"borderOutside",icon:"border_outer",label:"Outside borders"},{action:"borderInside",icon:"border_inner",label:"Inside borders"},{action:"borderTop",icon:"border_top",label:"Top border"},{action:"borderBottom",icon:"border_bottom",label:"Bottom border"},{action:"borderLeft",icon:"border_left",label:"Left border"},{action:"borderRight",icon:"border_right",label:"Right border"},{action:"borderNone",icon:"border_clear",label:"No borders"}];function Fo({onAction:e,disabled:t=false}){let[o,n]=Q.useState(false),i=Q.useCallback(()=>n(false),[]),{containerRef:a,dropdownRef:r,dropdownStyle:p,handleMouseDown:d}=z({isOpen:o,onClose:i}),c=Q.useCallback(l=>{e(l),n(false);},[e]),u=jsxRuntime.jsxs(F,{variant:"ghost",size:"icon-sm",className:T("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:d,onClick:()=>!t&&n(l=>!l),disabled:t,"aria-label":"Border style","aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-borders",children:[jsxRuntime.jsx(b,{name:"border_all",size:20}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxRuntime.jsxs("div",{ref:a,style:{position:"relative",display:"inline-block"},children:[o?u:jsxRuntime.jsx(K,{content:"Borders",children:u}),o&&!t&&jsxRuntime.jsx("div",{ref:r,style:{...p,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:l=>l.stopPropagation(),children:jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:aa.map(({action:l,icon:h,label:m})=>jsxRuntime.jsx("button",{type:"button",title:m,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:"transparent",cursor:"pointer",color:"var(--doc-text)"},onMouseDown:f=>f.preventDefault(),onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(l),children:jsxRuntime.jsx(b,{name:h,size:18})},typeof l=="string"?l:l.type))})})]})}var la=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff"],sa={width:18,height:18,borderRadius:2,border:"1px solid var(--doc-border)",cursor:"pointer",padding:0,backgroundColor:"transparent"};function zo({onAction:e,disabled:t=false}){let[o,n]=Q.useState(false),[i,a]=Q.useState("#000000"),r=Q.useCallback(()=>n(false),[]),{containerRef:p,dropdownRef:d,dropdownStyle:c,handleMouseDown:u}=z({isOpen:o,onClose:r}),l=Q.useCallback(m=>{a(m),e({type:"borderColor",color:m.replace(/^#/,"")}),n(false);},[e]),h=jsxRuntime.jsxs(F,{variant:"ghost",size:"icon-sm",className:T("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 flex-col gap-0 !p-0.5",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:u,onClick:()=>!t&&n(m=>!m),disabled:t,"aria-label":"Border color","aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-border-color",children:[jsxRuntime.jsx(b,{name:"border_color",size:18}),jsxRuntime.jsx("div",{style:{width:16,height:3,backgroundColor:i,borderRadius:0,marginTop:-2}})]});return jsxRuntime.jsxs("div",{ref:p,style:{position:"relative",display:"inline-block"},children:[o?h:jsxRuntime.jsx(K,{content:"Border color",children:h}),o&&!t&&jsxRuntime.jsx("div",{ref:d,style:{...c,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:8},onMouseDown:m=>m.stopPropagation(),children:jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:2},children:la.map(m=>jsxRuntime.jsx("button",{type:"button",style:{...sa,backgroundColor:m,outline:i===m?"2px solid var(--doc-primary)":"none",outlineOffset:1},title:m,onMouseDown:f=>f.preventDefault(),onClick:()=>l(m)},m))})})]})}var pa=[{size:4,label:"0.5 pt",thickness:.5},{size:8,label:"1 pt",thickness:1},{size:12,label:"1.5 pt",thickness:1.5},{size:16,label:"2 pt",thickness:2},{size:24,label:"3 pt",thickness:3}];function $o({onAction:e,disabled:t=false}){let[o,n]=Q.useState(false),i=Q.useCallback(()=>n(false),[]),{containerRef:a,dropdownRef:r,dropdownStyle:p,handleMouseDown:d}=z({isOpen:o,onClose:i}),c=Q.useCallback(l=>{e({type:"borderWidth",size:l}),n(false);},[e]),u=jsxRuntime.jsxs(F,{variant:"ghost",size:"icon-sm",className:T("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:d,onClick:()=>!t&&n(l=>!l),disabled:t,"aria-label":"Border width","aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-border-width",children:[jsxRuntime.jsx(b,{name:"line_weight",size:20}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxRuntime.jsxs("div",{ref:a,style:{position:"relative",display:"inline-block"},children:[o?u:jsxRuntime.jsx(K,{content:"Border width",children:u}),o&&!t&&jsxRuntime.jsx("div",{ref:r,style:{...p,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:120},onMouseDown:l=>l.stopPropagation(),children:pa.map(({size:l,label:h,thickness:m})=>jsxRuntime.jsxs("button",{type:"button",style:{display:"flex",alignItems:"center",gap:10,padding:"6px 12px",width:"100%",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:12,color:"var(--doc-text)"},onMouseDown:f=>f.preventDefault(),onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(l),children:[jsxRuntime.jsx("div",{style:{width:50,height:Math.max(m,1),backgroundColor:"#000",borderRadius:m>2?1:0}}),jsxRuntime.jsx("span",{children:h})]},l))})]})}var ua=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff"],da={width:18,height:18,borderRadius:2,border:"1px solid var(--doc-border)",cursor:"pointer",padding:0,backgroundColor:"transparent"};function Go({onAction:e,disabled:t=false}){let[o,n]=Q.useState(false),[i,a]=Q.useState(null),r=Q.useCallback(()=>n(false),[]),{containerRef:p,dropdownRef:d,dropdownStyle:c,handleMouseDown:u}=z({isOpen:o,onClose:r}),l=Q.useCallback(f=>{a(f),e({type:"cellFillColor",color:f}),n(false);},[e]),h=Q.useCallback(()=>{a(null),e({type:"cellFillColor",color:null}),n(false);},[e]),m=jsxRuntime.jsxs(F,{variant:"ghost",size:"icon-sm",className:T("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 flex-col gap-0 !p-0.5",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:u,onClick:()=>!t&&n(f=>!f),disabled:t,"aria-label":"Cell fill color","aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-cell-fill",children:[jsxRuntime.jsx(b,{name:"format_color_fill",size:18}),jsxRuntime.jsx("div",{style:{width:16,height:3,backgroundColor:i||"transparent",borderRadius:0,marginTop:-2,border:i?"none":"1px solid var(--doc-border)"}})]});return jsxRuntime.jsxs("div",{ref:p,style:{position:"relative",display:"inline-block"},children:[o?m:jsxRuntime.jsx(K,{content:"Cell fill color",children:m}),o&&!t&&jsxRuntime.jsxs("div",{ref:d,style:{...c,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:8},onMouseDown:f=>f.stopPropagation(),children:[jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:2},children:ua.map(f=>jsxRuntime.jsx("button",{type:"button",style:{...da,backgroundColor:f,outline:i===f?"2px solid var(--doc-primary)":"none",outlineOffset:1},title:f,onMouseDown:v=>v.preventDefault(),onClick:()=>l(f)},f))}),jsxRuntime.jsxs("button",{type:"button",style:{display:"flex",alignItems:"center",gap:6,marginTop:6,padding:"4px 8px",width:"100%",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:12,color:"var(--doc-text-muted)",borderRadius:4},onMouseDown:f=>f.preventDefault(),onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},onClick:h,children:[jsxRuntime.jsx(b,{name:"format_color_reset",size:14}),jsxRuntime.jsx("span",{children:"No fill"})]})]})]})}var ma={display:"flex",alignItems:"center",gap:10,padding:"7px 14px",fontSize:13,color:"var(--doc-text)",cursor:"pointer",border:"none",backgroundColor:"transparent",width:"100%",textAlign:"left"},Ve={height:1,backgroundColor:"var(--doc-border)",margin:"4px 0"},Ko={padding:"6px 14px 2px",fontSize:11,color:"var(--doc-text-muted)",fontWeight:500};function jo({onAction:e,disabled:t=false,tableContext:o}){let[n,i]=Q.useState(false),[a,r]=Q.useState(null),p=Q.useCallback(()=>i(false),[]),{containerRef:d,dropdownRef:c,dropdownStyle:u,handleMouseDown:l}=z({isOpen:n,onClose:p,align:"right"}),h=o?.table?.attrs?.justification??"left",m=Q.useCallback(x=>{e(x),i(false);},[e]),f=(x,I,S,w,_)=>{let E=t||_?.itemDisabled;return jsxRuntime.jsxs("button",{type:"button",role:"menuitem",style:{...ma,backgroundColor:a===x&&!E?"var(--doc-bg-hover)":"transparent",color:E?"var(--doc-text-muted)":_?.danger?"var(--doc-error)":"var(--doc-text)",cursor:E?"not-allowed":"pointer"},onClick:()=>!E&&m(w),onMouseEnter:()=>r(x),onMouseLeave:()=>r(null),disabled:E,children:[jsxRuntime.jsx(b,{name:I,size:16,className:_?.danger&&!E?"text-red-600":""}),jsxRuntime.jsx("span",{style:{flex:1},children:S})]},x)},v=jsxRuntime.jsx(F,{variant:"ghost",size:"icon-sm",className:T("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:l,onClick:()=>!t&&i(x=>!x),disabled:t,"aria-label":"More table options","aria-expanded":n,"aria-haspopup":"menu","data-testid":"toolbar-table-more",children:jsxRuntime.jsx(b,{name:"more_vert",size:20})});return jsxRuntime.jsxs("div",{ref:d,style:{position:"relative",display:"inline-block"},children:[n?v:jsxRuntime.jsx(K,{content:"More table options",children:v}),n&&!t&&jsxRuntime.jsxs("div",{ref:c,style:{...u,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:200,maxHeight:"70vh",overflowY:"auto"},role:"menu",onMouseDown:x=>x.stopPropagation(),children:[f("addRowAbove","add","Insert row above","addRowAbove"),f("addRowBelow","add","Insert row below","addRowBelow"),f("addColumnLeft","add","Insert column left","addColumnLeft"),f("addColumnRight","add","Insert column right","addColumnRight"),jsxRuntime.jsx("div",{style:Ve,role:"separator"}),f("mergeCells","call_merge","Merge cells","mergeCells",{itemDisabled:!o?.hasMultiCellSelection}),f("splitCell","call_split","Split cell","splitCell",{itemDisabled:!o?.canSplitCell}),jsxRuntime.jsx("div",{style:Ve,role:"separator"}),f("deleteRow","delete","Delete row","deleteRow",{danger:true,itemDisabled:(o?.rowCount??0)<=1}),f("deleteColumn","delete","Delete column","deleteColumn",{danger:true,itemDisabled:(o?.columnCount??0)<=1}),f("deleteTable","delete","Delete table","deleteTable",{danger:true}),jsxRuntime.jsx("div",{style:Ve,role:"separator"}),jsxRuntime.jsx("div",{style:Ko,children:"Vertical alignment"}),jsxRuntime.jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["top","center","bottom"].map(x=>{let I={top:"vertical_align_top",center:"vertical_align_center",bottom:"vertical_align_bottom"};return jsxRuntime.jsx("button",{type:"button",title:{top:"Top",center:"Middle",bottom:"Bottom"}[x],style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:"transparent",cursor:"pointer"},onMouseDown:w=>w.preventDefault(),onMouseEnter:w=>{w.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent";},onClick:()=>m({type:"cellVerticalAlign",align:x}),children:jsxRuntime.jsx(b,{name:I[x],size:16})},x)})}),jsxRuntime.jsx("div",{style:Ve,role:"separator"}),jsxRuntime.jsx("div",{style:Ko,children:"Table alignment"}),jsxRuntime.jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["left","center","right"].map(x=>{let I={left:"format_align_left",center:"format_align_center",right:"format_align_right"},S=h===x;return jsxRuntime.jsx("button",{type:"button",title:`Align table ${x}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:S?"var(--doc-primary-light)":"transparent",borderColor:S?"var(--doc-primary)":"var(--doc-border)",color:S?"var(--doc-primary)":"var(--doc-text)",cursor:"pointer"},onMouseDown:w=>w.preventDefault(),onClick:()=>m({type:"tableProperties",props:{justification:x}}),children:jsxRuntime.jsx(b,{name:I[x],size:16})},x)})}),jsxRuntime.jsx("div",{style:Ve,role:"separator"}),f("headerRow","table_rows","Toggle header row",{type:"toggleHeaderRow"}),f("distribute","view_column","Distribute columns evenly",{type:"distributeColumns"}),f("autoFit","fit_width","Auto-fit to contents",{type:"autoFitContents"}),f("noWrap","wrap_text","Toggle no-wrap",{type:"toggleNoWrap"}),jsxRuntime.jsx("div",{style:Ve,role:"separator"}),f("properties","settings","Table properties...",{type:"openTableProperties"})]})]})}var qt=18,ha=2,Jo={width:qt,height:qt,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:2,transition:"background-color 0.1s, border-color 0.1s",cursor:"pointer"},ga={...Jo,backgroundColor:"var(--doc-primary, #3b82f6)",border:"1px solid var(--doc-primary, #3b82f6)"},ba={marginTop:6,fontSize:11,fontWeight:500,color:"var(--doc-text, #374151)",textAlign:"center"};function Qo({onInsert:e,gridRows:t=6,gridColumns:o=6}){let[n,i]=Q.useState(0),[a,r]=Q.useState(0),p=Q.useCallback(()=>{n>0&&a>0&&e(n,a);},[n,a,e]),d=[];for(let u=1;u<=t;u++)for(let l=1;l<=o;l++){let h=u<=n&&l<=a;d.push(jsxRuntime.jsx("div",{style:h?ga:Jo,onMouseEnter:()=>{i(u),r(l);},onClick:p,role:"gridcell","aria-selected":h},`${u}-${l}`));}let c=n>0&&a>0?`${a} \xD7 ${n}`:"Select size";return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{display:"grid",gap:ha,gridTemplateColumns:`repeat(${o}, ${qt}px)`},onMouseLeave:()=>{i(0),r(0);},role:"grid","aria-label":"Table size selector",children:d}),jsxRuntime.jsx("div",{style:ba,children:c})]})}function Sa(e){return "type"in e&&e.type==="separator"}var on={display:"flex",alignItems:"center",gap:2,padding:"2px 8px",border:"none",background:"transparent",borderRadius:4,cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--doc-text, #374151)",whiteSpace:"nowrap",height:28,lineHeight:"28px"},ya={...on,background:"var(--doc-hover, #f3f4f6)"},nn={display:"flex",alignItems:"center",gap:8,padding:"6px 12px",border:"none",background:"transparent",cursor:"pointer",fontSize:13,color:"var(--doc-text, #374151)",width:"100%",textAlign:"left",whiteSpace:"nowrap"},Ca={...nn,opacity:.4,cursor:"default"},Ta={height:1,backgroundColor:"var(--doc-border, #e5e7eb)",margin:"4px 0"},wa={marginLeft:"auto",fontSize:12,color:"var(--doc-text-muted, #9ca3af)"},Ia={position:"absolute",left:"100%",top:-4,marginLeft:2,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:8,zIndex:1001};function At({label:e,items:t,disabled:o}){let[n,i]=Q.useState(false),[a,r]=Q.useState(null),p=Q.useRef(null),d=Q.useRef(null),[c,u]=Q.useState({top:0,left:0}),l=Q.useCallback(()=>{i(false),r(null);},[]);Q.useEffect(()=>{if(!n||!p.current)return;let m=p.current.getBoundingClientRect();u({top:m.bottom+2,left:m.left});},[n]),Q.useEffect(()=>{if(!n)return;function m(x){let I=x.target;p.current&&!p.current.contains(I)&&d.current&&!d.current.contains(I)&&l();}function f(x){x.key==="Escape"&&l();}function v(){l();}return document.addEventListener("mousedown",m),document.addEventListener("keydown",f),window.addEventListener("scroll",v,true),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",f),window.removeEventListener("scroll",v,true);}},[n,l]);let h=m=>{m.disabled||m.submenuContent||m.onClick&&(m.onClick(),l());};return jsxRuntime.jsxs("div",{style:{position:"relative"},children:[jsxRuntime.jsxs("button",{ref:p,type:"button",onClick:()=>!o&&i(!n),onMouseDown:m=>m.preventDefault(),disabled:o,style:n?ya:on,children:[e,jsxRuntime.jsx(b,{name:"arrow_drop_down",size:16})]}),n&&jsxRuntime.jsx("div",{ref:d,style:{position:"fixed",top:c.top,left:c.left,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:"4px 0",zIndex:1e4,minWidth:200},onMouseDown:m=>m.preventDefault(),children:t.map((m,f)=>{if(Sa(m))return jsxRuntime.jsx("div",{style:Ta},`sep-${f}`);let v=m;if(v.customContent)return jsxRuntime.jsx("div",{onMouseDown:S=>S.preventDefault(),children:v.customContent},v.label);let x=!!v.submenuContent,I=a===v.label;return jsxRuntime.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>x&&r(v.label),onMouseLeave:()=>x&&r(null),children:[jsxRuntime.jsxs("button",{type:"button",style:v.disabled?Ca:nn,onClick:()=>h(v),onMouseDown:S=>S.preventDefault(),onMouseOver:S=>{v.disabled||(S.currentTarget.style.backgroundColor="var(--doc-hover, #f3f4f6)");},onMouseOut:S=>{S.currentTarget.style.backgroundColor="transparent";},disabled:v.disabled,children:[v.icon&&jsxRuntime.jsx(b,{name:v.icon,size:18}),jsxRuntime.jsx("span",{children:v.label}),v.shortcut&&jsxRuntime.jsx("span",{style:wa,children:v.shortcut}),x&&jsxRuntime.jsx("span",{style:{marginLeft:"auto"},children:jsxRuntime.jsx(b,{name:"keyboard_arrow_right",size:16})})]}),x&&I&&jsxRuntime.jsx("div",{style:Ia,onMouseDown:S=>S.preventDefault(),children:v.submenuContent(l)})]},v.label)})})]})}var Ma=20;function Ct({options:e,activeValue:t,triggerIcon:o,tooltipContent:n,onSelect:i,disabled:a=false,ariaLabel:r,testId:p}){let[d,c]=Q.useState(false),u=Q.useCallback(()=>c(false),[]),{containerRef:l,dropdownRef:h,dropdownStyle:m,handleMouseDown:f}=z({isOpen:d,onClose:u}),v=Q.useCallback(I=>{a||i(I),c(false);},[a,i]),x=jsxRuntime.jsxs(F,{variant:"ghost",size:"icon-sm",className:T("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",d&&"bg-slate-100",a&&"opacity-30 cursor-not-allowed"),onMouseDown:f,onClick:()=>!a&&c(I=>!I),disabled:a,"aria-label":r??n,"aria-expanded":d,"aria-haspopup":"true","data-testid":p,children:[jsxRuntime.jsx(b,{name:o,size:Ma}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxRuntime.jsxs("div",{ref:l,style:{position:"relative",display:"inline-block"},children:[d?x:jsxRuntime.jsx(K,{content:n,children:x}),d&&!a&&jsxRuntime.jsx("div",{ref:h,style:{...m,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:I=>I.stopPropagation(),children:jsxRuntime.jsx("div",{style:{display:"flex",gap:2},children:e.map(I=>{let S=t===I.value;return jsxRuntime.jsx("button",{type:"button",title:I.label,"data-testid":p?`${p}-${I.value}`:void 0,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:S?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:S?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:w=>w.preventDefault(),onMouseEnter:w=>{S||(w.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:w=>{w.currentTarget.style.backgroundColor=S?"var(--doc-primary-light)":"transparent";},onClick:()=>v(I.value),children:jsxRuntime.jsx(b,{name:I.iconName,size:18})},I.value)})})})]})}var Bt=[{value:"inline",label:"Inline with text",iconName:"format_image_left"},{value:"wrapRight",label:"Float left (wrap right)",iconName:"format_image_right"},{value:"wrapLeft",label:"Float right (wrap left)",iconName:"format_image_left"},{value:"topAndBottom",label:"Top and bottom",iconName:"horizontal_rule"},{value:"behind",label:"Behind text",iconName:"flip_to_back"},{value:"inFront",label:"In front of text",iconName:"flip_to_front"}];function ka(e){return e.displayMode==="float"&&e.cssFloat==="left"?"wrapRight":e.displayMode==="float"&&e.cssFloat==="right"?"wrapLeft":e.wrapType}function ln({imageContext:e,onChange:t,disabled:o=false}){let n=ka(e),i=Bt.find(a=>a.value===n)||Bt[0];return jsxRuntime.jsx(Ct,{options:Bt,activeValue:n,triggerIcon:i.iconName,tooltipContent:`Wrap: ${i.label}`,onSelect:t,disabled:o,testId:"toolbar-image-wrap"})}var Ra=[{value:"rotateCW",label:"Rotate clockwise",iconName:"rotate_right"},{value:"rotateCCW",label:"Rotate counter-clockwise",iconName:"rotate_left"},{value:"flipH",label:"Flip horizontal",iconName:"swap_horiz"},{value:"flipV",label:"Flip vertical",iconName:"swap_vert"}];function sn({onTransform:e,disabled:t=false}){return jsxRuntime.jsx(Ct,{options:Ra,triggerIcon:"rotate_right",tooltipContent:"Transform",onSelect:e,disabled:t,testId:"toolbar-image-transform"})}var Ha={FFFF00:"yellow","00FF00":"green","00FFFF":"cyan",FF00FF:"magenta","0000FF":"blue",FF0000:"red","00008B":"darkBlue","008080":"darkCyan","008000":"darkGreen",800080:"darkMagenta","8B0000":"darkRed",808e3:"darkYellow",808080:"darkGray",C0C0C0:"lightGray","000000":"black",FFFFFF:"white"};function ec(e){let t=e.replace(/^#/,"").toUpperCase();return Ha[t]||null}function re({active:e=false,disabled:t=false,title:o,onClick:n,children:i,className:a,ariaLabel:r}){let p=r?.toLowerCase().replace(/\s+/g,"-")||o?.toLowerCase().replace(/\s+/g,"-").replace(/\([^)]*\)/g,"").trim(),d=u=>{u.preventDefault();},c=jsxRuntime.jsx(F,{variant:"ghost",size:"icon-sm",className:T("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",e&&"bg-slate-900 text-white hover:bg-slate-800 hover:text-white",t&&"opacity-30 cursor-not-allowed",a),onMouseDown:d,onClick:t?void 0:n,disabled:t,"aria-pressed":e,"aria-label":r||o,"data-testid":p?`toolbar-${p}`:void 0,children:i});return o?jsxRuntime.jsx(K,{content:o,children:c}):c}function he({label:e,children:t,className:o}){return jsxRuntime.jsx("div",{className:T("flex items-center gap-0.5 px-1 border-r border-slate-200/50 last:border-r-0",o),role:"group","aria-label":e,children:t})}function Ic(){return jsxRuntime.jsx("div",{className:"w-px h-6 bg-slate-200 mx-1.5",role:"separator"})}var ie=20;function Pc({currentFormatting:e={},onFormat:t,onUndo:o,onRedo:n,canUndo:i=false,canRedo:a=false,disabled:r=false,className:p,style:d,enableShortcuts:c=true,editorRef:u,children:l,showFontPicker:h=true,showFontSizePicker:m=true,showTextColorPicker:f=true,showHighlightColorPicker:v=true,showAlignmentButtons:x=true,showListButtons:I=true,showLineSpacingPicker:S=true,showStylePicker:w=true,documentStyles:_,theme:E,onPrint:G,showPrintButton:k=true,showZoomControl:A=true,zoom:U,onZoomChange:te,onRefocusEditor:M,onInsertTable:O,showTableInsert:C=true,onInsertImage:D,onInsertPageBreak:P,onInsertTOC:De,imageContext:Ge,onImageWrapType:Ue,onImageTransform:ot,onOpenImageProperties:nt,tableContext:rt,onTableAction:Ne}){let it=Q.useRef(null),W=Q.useCallback(R=>{!r&&t&&t(R);},[r,t]),we=Q.useCallback(()=>{!r&&i&&o&&o();},[r,i,o]),Ye=Q.useCallback(()=>{!r&&a&&n&&n();},[r,a,n]),Ke=Q.useCallback(R=>{!r&&t&&(t({type:"fontFamily",value:R}),requestAnimationFrame(()=>M?.()));},[r,t,M]),Lt=Q.useCallback(R=>{!r&&t&&(t({type:"fontSize",value:R}),requestAnimationFrame(()=>M?.()));},[r,t,M]),N=Q.useCallback(R=>{!r&&t&&(t({type:"textColor",value:R}),requestAnimationFrame(()=>M?.()));},[r,t,M]),Ie=Q.useCallback(R=>{!r&&t&&(t({type:"highlightColor",value:R}),requestAnimationFrame(()=>M?.()));},[r,t,M]),ve=Q.useCallback(R=>{!r&&t&&t({type:"alignment",value:R});},[r,t]),Pe=Q.useCallback(()=>{!r&&t&&t("bulletList");},[r,t]),le=Q.useCallback(()=>{!r&&t&&t("numberedList");},[r,t]),ee=Q.useCallback(()=>{!r&&t&&t("indent");},[r,t]),oe=Q.useCallback(()=>{!r&&t&&t("outdent");},[r,t]),Me=Q.useCallback(R=>{!r&&t&&(t({type:"lineSpacing",value:R}),requestAnimationFrame(()=>M?.()));},[r,t,M]),wn=Q.useCallback(R=>{!r&&t&&(t({type:"applyStyle",value:R}),requestAnimationFrame(()=>M?.()));},[r,t,M]),In=Q.useCallback((R,Z)=>{!r&&O&&(O(R,Z),requestAnimationFrame(()=>M?.()));},[r,O,M]),je=Q.useCallback(R=>{!r&&Ne&&(Ne(R),requestAnimationFrame(()=>M?.()));},[r,Ne,M]);Q.useEffect(()=>{if(!c)return;let R=Z=>{let ke=Z.target,ro=u?.current,kn=it.current,Ln=ro?.contains(ke),Rn=kn?.contains(ke);if(!Ln&&!Rn)return;if((Z.ctrlKey||Z.metaKey)&&!Z.altKey)switch(Z.key.toLowerCase()){case "b":Z.preventDefault(),W("bold");break;case "i":Z.preventDefault(),W("italic");break;case "u":Z.preventDefault(),W("underline");break;case "=":Z.shiftKey?(Z.preventDefault(),W("superscript")):(Z.preventDefault(),W("subscript"));break;case "l":Z.preventDefault(),ve("left");break;case "e":Z.preventDefault(),ve("center");break;case "r":Z.preventDefault(),ve("right");break;case "j":Z.preventDefault(),ve("both");break;case "k":Z.preventDefault(),W("insertLink");break}};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R);}},[c,W,u]);let Pn=Q.useCallback(R=>{let Z=R.target;Z.tagName==="INPUT"||Z.tagName==="TEXTAREA"||Z.tagName==="SELECT"||Z.tagName==="OPTION"||R.preventDefault();},[]),Mn=Q.useCallback(R=>{let Z=R.target,ke=document.activeElement;Z.tagName==="SELECT"||Z.tagName==="OPTION"||ke?.tagName==="SELECT"||requestAnimationFrame(()=>{M?.();});},[M]);return jsxRuntime.jsxs("div",{ref:it,className:T("flex items-center gap-0 px-2 py-2 bg-white border-b border-slate-100 min-h-[44px] overflow-x-auto",p),style:d,role:"toolbar","aria-label":"Formatting toolbar","data-testid":"toolbar",onMouseDown:Pn,onMouseUp:Mn,children:[k&&G&&jsxRuntime.jsx(At,{label:"File",disabled:r,items:[{icon:"print",label:"Print",shortcut:"Ctrl+P",onClick:G}]}),jsxRuntime.jsx(At,{label:"Insert",disabled:r,items:[...D?[{icon:"image",label:"Image",onClick:D}]:[],...C&&O?[{icon:"grid_on",label:"Table",submenuContent:R=>jsxRuntime.jsx(Qo,{onInsert:(Z,ke)=>{In(Z,ke),R();}})}]:[],...D||C&&O?[{type:"separator"}]:[],{icon:"page_break",label:"Page break",onClick:P,disabled:!P},{icon:"format_list_numbered",label:"Table of contents",onClick:De,disabled:!De}]}),jsxRuntime.jsxs(he,{label:"History",children:[jsxRuntime.jsx(re,{onClick:we,disabled:r||!i,title:"Undo (Ctrl+Z)",ariaLabel:"Undo",children:jsxRuntime.jsx(b,{name:"undo",size:ie})}),jsxRuntime.jsx(re,{onClick:Ye,disabled:r||!a,title:"Redo (Ctrl+Y)",ariaLabel:"Redo",children:jsxRuntime.jsx(b,{name:"redo",size:ie})})]}),A&&jsxRuntime.jsx(he,{label:"Zoom",children:jsxRuntime.jsx(Do,{value:U,onChange:te,minZoom:.5,maxZoom:2,disabled:r,compact:true,showButtons:false})}),w&&jsxRuntime.jsx(he,{label:"Styles",children:jsxRuntime.jsx(_o,{value:e.styleId||"Normal",onChange:wn,styles:_,theme:E,disabled:r,width:150})}),(h||m)&&jsxRuntime.jsxs(he,{label:"Font",children:[h&&jsxRuntime.jsx(so,{value:e.fontFamily||"Arial",onChange:Ke,disabled:r,width:70,placeholder:"Arial"}),m&&jsxRuntime.jsx(xo,{value:e.fontSize!==void 0?vo(e.fontSize):11,onChange:Lt,disabled:r,width:50,placeholder:"11"})]}),jsxRuntime.jsxs(he,{label:"Text formatting",children:[jsxRuntime.jsx(re,{onClick:()=>W("bold"),active:e.bold,disabled:r,title:"Bold (Ctrl+B)",ariaLabel:"Bold",children:jsxRuntime.jsx(b,{name:"format_bold",size:ie})}),jsxRuntime.jsx(re,{onClick:()=>W("italic"),active:e.italic,disabled:r,title:"Italic (Ctrl+I)",ariaLabel:"Italic",children:jsxRuntime.jsx(b,{name:"format_italic",size:ie})}),jsxRuntime.jsx(re,{onClick:()=>W("underline"),active:e.underline,disabled:r,title:"Underline (Ctrl+U)",ariaLabel:"Underline",children:jsxRuntime.jsx(b,{name:"format_underlined",size:ie})}),jsxRuntime.jsx(re,{onClick:()=>W("strikethrough"),active:e.strike,disabled:r,title:"Strikethrough",ariaLabel:"Strikethrough",children:jsxRuntime.jsx(b,{name:"strikethrough_s",size:ie})}),f&&jsxRuntime.jsx(To,{value:e.color?.replace(/^#/,""),onChange:N,disabled:r,title:"Font Color"}),v&&jsxRuntime.jsx(wo,{value:e.highlight,onChange:Ie,disabled:r,title:"Text Highlight Color"}),jsxRuntime.jsx(re,{onClick:()=>W("insertLink"),disabled:r,title:"Insert link (Ctrl+K)",ariaLabel:"Insert link",children:jsxRuntime.jsx(b,{name:"link",size:ie})})]}),jsxRuntime.jsxs(he,{label:"Script",children:[jsxRuntime.jsx(re,{onClick:()=>W("superscript"),active:e.superscript,disabled:r,title:"Superscript (Ctrl+Shift+=)",ariaLabel:"Superscript",children:jsxRuntime.jsx(b,{name:"superscript",size:ie})}),jsxRuntime.jsx(re,{onClick:()=>W("subscript"),active:e.subscript,disabled:r,title:"Subscript (Ctrl+=)",ariaLabel:"Subscript",children:jsxRuntime.jsx(b,{name:"subscript",size:ie})})]}),x&&jsxRuntime.jsx(Mo,{value:e.alignment||"left",onChange:ve,disabled:r}),(I||S)&&jsxRuntime.jsxs(he,{label:"List formatting",children:[I&&jsxRuntime.jsx(Lo,{listState:e.listState||Ro(),onBulletList:Pe,onNumberedList:le,onIndent:ee,onOutdent:oe,disabled:r,showIndentButtons:true,compact:true,hasIndent:(e.indentLeft??0)>0}),S&&jsxRuntime.jsx(Ho,{value:e.lineSpacing,onChange:Me,disabled:r})]}),Ge&&Ue&&jsxRuntime.jsxs(he,{label:"Image",children:[jsxRuntime.jsx(ln,{imageContext:Ge,onChange:Ue,disabled:r}),ot&&jsxRuntime.jsx(sn,{onTransform:ot,disabled:r}),nt&&jsxRuntime.jsx(re,{onClick:nt,disabled:r,title:"Image properties (alt text, border)...",ariaLabel:"Image properties",children:jsxRuntime.jsx(b,{name:"tune",size:ie})})]}),rt?.isInTable&&Ne&&jsxRuntime.jsxs(he,{label:"Table",children:[jsxRuntime.jsx(Fo,{onAction:je,disabled:r}),jsxRuntime.jsx(zo,{onAction:je,disabled:r}),jsxRuntime.jsx($o,{onAction:je,disabled:r}),jsxRuntime.jsx(Go,{onAction:je,disabled:r}),jsxRuntime.jsx(jo,{onAction:je,disabled:r,tableContext:rt})]}),jsxRuntime.jsx(re,{onClick:()=>W("clearFormatting"),disabled:r,title:"Clear formatting",ariaLabel:"Clear formatting",children:jsxRuntime.jsx(b,{name:"format_clear",size:ie})}),l]})}var Na={display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"13px",userSelect:"none",transition:"opacity 0.2s, transform 0.2s"},qa={position:"absolute",zIndex:100,pointerEvents:"auto"},Fa={default:{backgroundColor:"rgba(255, 255, 255, 0.95)",color:"var(--doc-text)",padding:"6px 12px",borderRadius:"4px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",border:"1px solid rgba(0, 0, 0, 0.1)"},minimal:{backgroundColor:"transparent",color:"var(--doc-text-muted)",padding:"4px 8px"},badge:{backgroundColor:"var(--doc-primary)",color:"white",padding:"4px 10px",borderRadius:"4px",fontWeight:500,fontSize:"12px"},pill:{backgroundColor:"rgba(0, 0, 0, 0.7)",color:"white",padding:"6px 14px",borderRadius:"16px",fontSize:"12px",fontWeight:500}},Aa={"bottom-left":{bottom:"16px",left:"16px"},"bottom-center":{bottom:"16px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"16px",right:"16px"},"top-left":{top:"16px",left:"16px"},"top-center":{top:"16px",left:"50%",transform:"translateX(-50%)"},"top-right":{top:"16px",right:"16px"}};function Zc({currentPage:e,totalPages:t,position:o="bottom-center",variant:n="default",floating:i=true,showPrefix:a=true,formatText:r,onClick:p,disabled:d=false,className:c="",style:u,children:l}){let h=Q.useMemo(()=>r?r(e,t):a?`Page ${e} of ${t}`:`${e} / ${t}`,[e,t,r,a]),m={...Na,...Fa[n],...i?qa:{},...i?Aa[o]:{},...p&&!d?{cursor:"pointer"}:{},...d?{opacity:.5,pointerEvents:"none"}:{},...u},f=()=>{!d&&p&&p();};return jsxRuntime.jsx("div",{className:`docx-page-indicator docx-page-indicator-${n} ${c}`,style:m,onClick:f,role:p?"button":"status","aria-label":`Page ${e} of ${t}`,"aria-live":"polite",tabIndex:p&&!d?0:void 0,onKeyDown:v=>{p&&!d&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),p());},children:l||h})}function Ba(e){let t=["th","st","nd","rd"],o=e%100;return e+(t[(o-20)%10]||t[o]||t[0])}function Hc(e){return (t,o)=>e.replace("{current}",String(t)).replace("{total}",String(o)).replace("{ordinal}",Ba(t))}function Ec(e,t){return t<=1?100:Math.round((e-1)/(t-1)*100)}function _c(e){return e===1}function Dc(e,t){return e===t}function Nc(e,t,o=20){let n=0;for(let i=0;i<t.length;i++){let a=n,r=n+t[i],p=(a+r)/2;if(e<p)return i+1;n=r+o;}return t.length}function qc(e,t,o,n=20){if(e<1||e>t.length)return 0;let i=0;for(let p=0;p<e-1;p++)i+=t[p]+n;let a=t[e-1],r=Math.max(0,(o-a)/2);return Math.max(0,i-r)}function za(){return jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Va(){return jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"9 18 15 12 9 6"})})}function $a(){return jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"18 15 12 9 6 15"})})}function Wa(){return jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}var Ga={display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"13px",userSelect:"none",transition:"opacity 0.2s"},Ua={position:"absolute",zIndex:100,pointerEvents:"auto"},Ya={default:{backgroundColor:"rgba(255, 255, 255, 0.95)",color:"var(--doc-text)",padding:"4px 8px",borderRadius:"6px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",border:"1px solid rgba(0, 0, 0, 0.1)"},compact:{backgroundColor:"rgba(255, 255, 255, 0.95)",color:"var(--doc-text)",padding:"2px 4px",borderRadius:"4px",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.1)",border:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"12px"},minimal:{backgroundColor:"transparent",color:"var(--doc-text-muted)",padding:"4px"}},Ka={"bottom-left":{bottom:"16px",left:"16px"},"bottom-center":{bottom:"16px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"16px",right:"16px"},"top-left":{top:"16px",left:"16px"},"top-center":{top:"16px",left:"50%",transform:"translateX(-50%)"},"top-right":{top:"16px",right:"16px"}},cn={display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",padding:0,border:"none",borderRadius:"4px",backgroundColor:"transparent",color:"var(--doc-text-muted)",cursor:"pointer",transition:"background-color 0.15s, color 0.15s"},pn={backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text)"},un={opacity:.4,cursor:"not-allowed"},ja={display:"flex",alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.15s",minWidth:"80px",justifyContent:"center"},Xa={backgroundColor:"rgba(0, 0, 0, 0.04)"};function Ja({currentPage:e,totalPages:t,onNavigate:o,onClose:n,anchorRef:i}){let[a,r]=Q.useState(String(e)),[p,d]=Q.useState(null),c=Q.useRef(null),u=Q.useRef(null);Q.useEffect(()=>{c.current?.focus(),c.current?.select();},[]),Q.useEffect(()=>{let k=A=>{u.current&&!u.current.contains(A.target)&&i.current&&!i.current.contains(A.target)&&n();};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[n,i]),Q.useEffect(()=>{let k=A=>{A.key==="Escape"&&n();};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[n]);let l=Q.useCallback(()=>{let k=parseInt(a,10);if(isNaN(k)){d("Please enter a number");return}if(k<1||k>t){d(`Page must be 1-${t}`);return}o(k),n();},[a,t,o,n]),h=k=>{r(k.target.value),d(null);},m=k=>{if(k.key==="Enter")k.preventDefault(),l();else if(k.key==="ArrowUp"){k.preventDefault();let A=Math.min(parseInt(a,10)+1||1,t);r(String(A)),d(null);}else if(k.key==="ArrowDown"){k.preventDefault();let A=Math.max(parseInt(a,10)-1||1,1);r(String(A)),d(null);}},f=()=>{o(1),n();},v=()=>{o(t),n();},x={position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.2)",border:"1px solid rgba(0, 0, 0, 0.1)",padding:"12px",minWidth:"200px",zIndex:1e3},I={display:"flex",alignItems:"center",gap:"8px",marginBottom:p?"4px":"12px"},S={flex:1,padding:"8px 12px",fontSize:"14px",border:p?"1px solid var(--doc-error)":"1px solid var(--doc-border)",borderRadius:"4px",outline:"none",textAlign:"center",fontFamily:"inherit"},w={padding:"8px 16px",fontSize:"14px",fontWeight:500,backgroundColor:"var(--doc-primary)",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"},_={color:"var(--doc-error)",fontSize:"12px",marginBottom:"8px"},E={display:"flex",justifyContent:"space-between",gap:"8px"},G={flex:1,padding:"6px 12px",fontSize:"12px",backgroundColor:"var(--doc-bg-muted)",color:"var(--doc-text)",border:"1px solid var(--doc-border-light)",borderRadius:"4px",cursor:"pointer"};return jsxRuntime.jsxs("div",{ref:u,style:x,role:"dialog","aria-label":"Go to page",children:[jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"var(--doc-text-muted)",marginBottom:"8px",textAlign:"center"},children:["Go to page (1-",t,")"]}),jsxRuntime.jsxs("div",{style:I,children:[jsxRuntime.jsx("input",{ref:c,type:"text",value:a,onChange:h,onKeyDown:m,style:S,"aria-label":"Page number","aria-invalid":!!p}),jsxRuntime.jsx("button",{onClick:l,style:w,type:"button",children:"Go"})]}),p&&jsxRuntime.jsx("div",{style:_,children:p}),jsxRuntime.jsxs("div",{style:E,children:[jsxRuntime.jsx("button",{onClick:f,style:G,disabled:e===1,type:"button",children:"First"}),jsxRuntime.jsx("button",{onClick:v,style:G,disabled:e===t,type:"button",children:"Last"})]})]})}function zc({currentPage:e,totalPages:t,onNavigate:o,position:n="bottom-center",variant:i="default",floating:a=true,showButtons:r=true,disabled:p=false,className:d="",style:c}){let[u,l]=Q.useState(false),[h,m]=Q.useState(false),[f,v]=Q.useState(false),[x,I]=Q.useState(false),S=Q.useRef(null),w=e>1,_=e<t,E=Q.useCallback(()=>{w&&!p&&o(e-1);},[w,p,e,o]),G=Q.useCallback(()=>{_&&!p&&o(e+1);},[_,p,e,o]),k=Q.useCallback(P=>{p||(P.key==="ArrowLeft"||P.key==="PageUp"?(P.preventDefault(),E()):P.key==="ArrowRight"||P.key==="PageDown"?(P.preventDefault(),G()):P.key==="Home"?(P.preventDefault(),o(1)):P.key==="End"&&(P.preventDefault(),o(t)));},[p,E,G,o,t]),A=Q.useCallback(()=>{p||l(P=>!P);},[p]),U=Q.useCallback(()=>{l(false);},[]),te=Q.useCallback(P=>{o(P),U();},[o,U]),M={...Ga,...Ya[i],...a?Ua:{},...a?Ka[n]:{},...p?{opacity:.5,pointerEvents:"none"}:{},...c},O={...cn,...i==="compact"?{width:"24px",height:"24px"}:{},...h&&w?pn:{},...w?{}:un},C={...cn,...i==="compact"?{width:"24px",height:"24px"}:{},...f&&_?pn:{},..._?{}:un},D={...ja,...i==="compact"?{padding:"2px 6px",minWidth:"60px"}:{},...x&&!p?Xa:{},...p?{cursor:"not-allowed"}:{}};return jsxRuntime.jsxs("div",{className:`docx-page-navigator docx-page-navigator-${i} ${d}`,style:M,role:"navigation","aria-label":"Page navigation",onKeyDown:k,tabIndex:0,children:[r&&jsxRuntime.jsx("button",{onClick:E,disabled:!w||p,style:O,onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),"aria-label":"Previous page",title:"Previous page (\u2190)",type:"button",children:jsxRuntime.jsx(za,{})}),jsxRuntime.jsxs("div",{style:{position:"relative"},children:[jsxRuntime.jsxs("button",{ref:S,onClick:A,style:D,onMouseEnter:()=>I(true),onMouseLeave:()=>I(false),"aria-haspopup":"dialog","aria-expanded":u,"aria-label":`Page ${e} of ${t}. Click to go to a specific page.`,title:"Click to go to a specific page",disabled:p,type:"button",children:[jsxRuntime.jsxs("span",{children:["Page ",jsxRuntime.jsx("strong",{children:e})," of ",t]}),u?jsxRuntime.jsx($a,{}):jsxRuntime.jsx(Wa,{})]}),u&&jsxRuntime.jsx(Ja,{currentPage:e,totalPages:t,onNavigate:te,onClose:U,anchorRef:S})]}),r&&jsxRuntime.jsx("button",{onClick:G,disabled:!_||p,style:C,onMouseEnter:()=>v(true),onMouseLeave:()=>v(false),"aria-label":"Next page",title:"Next page (\u2192)",type:"button",children:jsxRuntime.jsx(Va,{})})]})}function Vc(e){let t=e.trim(),o=parseInt(t,10);return isNaN(o)?null:o}function $c(e,t){return Number.isInteger(e)&&e>=1&&e<=t}function Wc(e,t){return Math.min(Math.max(1,Math.round(e)),t)}function Gc(){return [{key:"\u2190 or PageUp",description:"Previous page"},{key:"\u2192 or PageDown",description:"Next page"},{key:"Home",description:"First page"},{key:"End",description:"Last page"},{key:"Enter (in input)",description:"Go to page"}]}function Uc(e,t,o){return e===t?`Page ${e} of ${o}`:`Pages ${e}-${t} of ${o}`}function Yc(e,t){return t<=1?100:Math.round((e-1)/(t-1)*100)}var mn=12240,wt=1440,It=1440,Pt=567,$t=22,tl="var(--doc-text-muted)",ol="var(--doc-text-subtle)",dn="rgba(0, 0, 0, 0.06)",nl="#4285f4",rl="#3367d6",il="#2a56c6",_e=5;function al(e,t){return t==="inch"?(e/It).toFixed(2)+'"':(e/Pt).toFixed(1)+" cm"}function ep({sectionProps:e,zoom:t=1,editable:o=false,onLeftMarginChange:n,onRightMarginChange:i,onFirstLineIndentChange:a,showFirstLineIndent:r=false,firstLineIndent:p=0,hangingIndent:d=false,indentLeft:c=0,indentRight:u=0,onIndentLeftChange:l,onIndentRightChange:h,unit:m="inch",className:f="",style:v,tabStops:x,onTabStopRemove:I}){let[S,w]=Q.useState(null),[_,E]=Q.useState(null),[G,k]=Q.useState(null),[A,U]=Q.useState(null),te=Q.useRef(null),M=e?.pageWidth??mn,O=e?.marginLeft??wt,C=e?.marginRight??wt,D=M-O-C,P=chunkSF53KLDZ_cjs.n(M)*t,De=chunkSF53KLDZ_cjs.n(O)*t,Ge=chunkSF53KLDZ_cjs.n(C)*t,Ue=chunkSF53KLDZ_cjs.n(c)*t,ot=chunkSF53KLDZ_cjs.n(u)*t,nt=d?-p:p,rt=chunkSF53KLDZ_cjs.n(nt)*t,Ne=De+Ue,it=P-Ge-ot,W=De+Ue+rt,we=Q.useCallback((N,Ie)=>{o&&(N.preventDefault(),N.stopPropagation(),w(Ie));},[o]),Ye=Q.useCallback(N=>{if(!S||!te.current)return;let Ie=te.current.getBoundingClientRect(),ve=N.clientX-Ie.left;U(ve);let Pe=chunkSF53KLDZ_cjs.o(ve/t);if(S==="leftMargin"){let le=M-C-720,ee=Math.round(Math.max(0,Math.min(Pe,le)));k(ee),n?.(ee);}else if(S==="rightMargin"){let le=M-Pe,ee=M-O-720,oe=Math.round(Math.max(0,Math.min(le,ee)));k(oe),i?.(oe);}else if(S==="firstLineIndent"){let le=O+c,ee=Pe-le,oe=D-c-u-720,Me=Math.round(Math.max(-c,Math.min(ee,oe)));k(Me),a?.(Me);}else if(S==="leftIndent"){let le=Pe-O,ee=D-u-720,oe=Math.round(Math.max(0,Math.min(le,ee)));k(oe),l?.(oe);}else if(S==="rightIndent"){let ee=M-C-Pe,oe=D-c-720,Me=Math.round(Math.max(0,Math.min(ee,oe)));k(Me),h?.(Me);}},[S,t,M,O,C,D,c,u,n,i,a,l,h]),Ke=Q.useCallback(()=>{w(null),k(null),U(null);},[]);Q.useEffect(()=>{if(S)return document.addEventListener("mousemove",Ye),document.addEventListener("mouseup",Ke),()=>{document.removeEventListener("mousemove",Ye),document.removeEventListener("mouseup",Ke);}},[S,Ye,Ke]);let Lt=ul(M,t,m);return jsxRuntime.jsxs("div",{ref:te,className:`docx-horizontal-ruler ${f}`,style:{position:"relative",width:chunkSF53KLDZ_cjs.x(P),height:$t,backgroundColor:"transparent",overflow:"visible",userSelect:"none",cursor:S?"ew-resize":"default",...v},role:"slider","aria-label":"Horizontal ruler","aria-valuemin":0,"aria-valuemax":M,children:[jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:chunkSF53KLDZ_cjs.x(De),height:$t,backgroundColor:dn,borderRight:"1px solid rgba(0,0,0,0.12)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&n?N=>we(N,"leftMargin"):void 0}),jsxRuntime.jsx("div",{style:{position:"absolute",top:0,right:0,width:chunkSF53KLDZ_cjs.x(Ge),height:$t,backgroundColor:dn,borderLeft:"1px solid rgba(0,0,0,0.12)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&i?N=>we(N,"rightMargin"):void 0}),jsxRuntime.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:Lt.map((N,Ie)=>jsxRuntime.jsx(ll,{tick:N},Ie))}),r&&jsxRuntime.jsx(Wt,{direction:"down",positionPx:W,editable:o,isDragging:S==="firstLineIndent",isHovered:_==="firstLineIndent",onMouseEnter:()=>E("firstLineIndent"),onMouseLeave:()=>E(null),onMouseDown:N=>we(N,"firstLineIndent"),label:"First line indent"}),o&&l&&jsxRuntime.jsx(Wt,{direction:"up",positionPx:Ne,editable:o,isDragging:S==="leftIndent",isHovered:_==="leftIndent",onMouseEnter:()=>E("leftIndent"),onMouseLeave:()=>E(null),onMouseDown:N=>we(N,"leftIndent"),label:"Left indent"}),o&&h&&jsxRuntime.jsx(Wt,{direction:"down",positionPx:it,editable:o,isDragging:S==="rightIndent",isHovered:_==="rightIndent",onMouseEnter:()=>E("rightIndent"),onMouseLeave:()=>E(null),onMouseDown:N=>we(N,"rightIndent"),label:"Right indent"}),x?.map(N=>jsxRuntime.jsx(pl,{tabStop:N,positionPx:chunkSF53KLDZ_cjs.n(N.position)*t,onDoubleClick:()=>I?.(N.position)},N.position)),S&&G!==null&&A!==null&&jsxRuntime.jsx(sl,{value:al(G,m),positionPx:A})]})}function ll({tick:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:{position:"absolute",left:chunkSF53KLDZ_cjs.x(e.position),bottom:0,width:1,height:e.height,backgroundColor:ol}}),e.label&&jsxRuntime.jsx("div",{style:{position:"absolute",left:chunkSF53KLDZ_cjs.x(e.position),top:3,transform:"translateX(-50%)",fontSize:"9px",color:tl,fontFamily:"sans-serif",whiteSpace:"nowrap"},children:e.label})]})}function Wt({direction:e,positionPx:t,editable:o,isDragging:n,isHovered:i,onMouseEnter:a,onMouseLeave:r,onMouseDown:p,label:d}){let c=n?il:i?rl:nl,u=Math.round(_e*1.6),l={position:"absolute",left:chunkSF53KLDZ_cjs.x(t-_e),width:_e*2,height:u+2,cursor:o?"ew-resize":"default",zIndex:n?10:4,...e==="down"?{top:0}:{bottom:0}},h=e==="down"?{position:"absolute",top:1,left:0,width:0,height:0,borderLeft:`${_e}px solid transparent`,borderRight:`${_e}px solid transparent`,borderTop:`${u}px solid ${c}`,transition:"border-top-color 0.1s"}:{position:"absolute",bottom:1,left:0,width:0,height:0,borderLeft:`${_e}px solid transparent`,borderRight:`${_e}px solid transparent`,borderBottom:`${u}px solid ${c}`,transition:"border-bottom-color 0.1s"};return jsxRuntime.jsx("div",{className:"docx-ruler-indent",style:l,onMouseEnter:a,onMouseLeave:r,onMouseDown:p,role:"slider","aria-label":d,"aria-orientation":"horizontal",tabIndex:o?0:-1,children:jsxRuntime.jsx("div",{style:h})})}function sl({value:e,positionPx:t}){return jsxRuntime.jsx("div",{style:{position:"absolute",left:chunkSF53KLDZ_cjs.x(t),top:-22,transform:"translateX(-50%)",backgroundColor:"#333",color:"#fff",fontSize:"10px",fontFamily:"sans-serif",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap",pointerEvents:"none",zIndex:20},children:e})}var cl={left:"L",center:"C",right:"R",decimal:"D",bar:"|"};function pl({tabStop:e,positionPx:t,onDoubleClick:o}){return jsxRuntime.jsx("div",{style:{position:"absolute",left:chunkSF53KLDZ_cjs.x(t-5),bottom:0,width:10,height:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:8,fontWeight:700,color:"#555",cursor:"pointer",userSelect:"none"},onDoubleClick:n=>{n.stopPropagation(),o();},title:`${e.alignment} tab at ${(e.position/1440).toFixed(2)}"`,children:cl[e.alignment]||"L"})}function ul(e,t,o){let n=[];if(o==="inch"){let i=It/8,a=Math.ceil(e/i);for(let r=0;r<=a;r++){let p=r*i;if(p>e)break;let d=chunkSF53KLDZ_cjs.n(p)*t;r%8===0?n.push({position:d,height:10,label:r/8>0?String(r/8):void 0}):r%4===0?n.push({position:d,height:6}):r%2===0?n.push({position:d,height:4}):n.push({position:d,height:2});}}else {let i=Pt/10,a=Math.ceil(e/i);for(let r=0;r<=a;r++){let p=r*i;if(p>e)break;let d=chunkSF53KLDZ_cjs.n(p)*t;r%10===0?n.push({position:d,height:10,label:r/10>0?String(r/10):void 0}):r%5===0?n.push({position:d,height:6}):n.push({position:d,height:3});}}return n}function tp(e,t,o,n){let i=chunkSF53KLDZ_cjs.o(e/n);return t==="left"?Math.max(0,i):Math.max(0,chunkSF53KLDZ_cjs.o(o/n)-i)}function op(e,t=1){let o=e?.pageWidth??mn,n=e?.marginLeft??wt,i=e?.marginRight??wt,a=chunkSF53KLDZ_cjs.n(o)*t,r=chunkSF53KLDZ_cjs.n(n)*t,p=chunkSF53KLDZ_cjs.n(i)*t;return {width:a,leftMargin:r,rightMargin:p,contentWidth:a-r-p}}function np(e,t){return t==="inch"?(e/It).toFixed(2)+'"':(e/Pt).toFixed(1)+" cm"}function rp(e,t){let o=parseFloat(e.replace(/[^\d.]/g,""));return isNaN(o)?null:Math.round(o*(t==="inch"?It:Pt))}var be=16;function fl(){return jsxRuntime.jsx(b,{name:"table_rows",size:be,style:{transform:"scaleY(-1)"}})}function hl(){return jsxRuntime.jsx(b,{name:"table_rows",size:be})}function gl(){return jsxRuntime.jsx(b,{name:"view_column",size:be,style:{transform:"scaleX(-1)"}})}function bl(){return jsxRuntime.jsx(b,{name:"view_column",size:be})}function vl(){return jsxRuntime.jsx(b,{name:"delete_sweep",size:be})}function xl(){return jsxRuntime.jsx(b,{name:"delete_sweep",size:be,style:{transform:"rotate(90deg)"}})}function Sl(){return jsxRuntime.jsx(b,{name:"call_merge",size:be})}function yl(){return jsxRuntime.jsx(b,{name:"call_split",size:be})}function Cl(){return jsxRuntime.jsx(b,{name:"delete",size:be,className:"text-red-600"})}var ae={container:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",backgroundColor:"var(--doc-bg-subtle)",borderRadius:"4px",border:"1px solid var(--doc-border)",fontSize:"12px"},containerCompact:{padding:"2px 4px",gap:"2px"},containerFloating:{position:"absolute",zIndex:1e3,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},group:{display:"flex",alignItems:"center",gap:"2px"},separator:{width:"1px",height:"20px",backgroundColor:"var(--doc-border-dark)",margin:"0 4px"},button:{display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"4px 8px",border:"none",borderRadius:"3px",backgroundColor:"transparent",color:"var(--doc-text)",cursor:"pointer",fontSize:"12px",lineHeight:"1",transition:"background-color 0.15s, color 0.15s"},buttonCompact:{padding:"3px 5px"},buttonHover:{backgroundColor:"var(--doc-border)"},buttonDisabled:{color:"var(--doc-text-subtle)",cursor:"not-allowed"},buttonDelete:{color:"var(--doc-error)"},label:{fontSize:"11px",fontWeight:500,color:"var(--doc-text-muted)",marginRight:"8px",whiteSpace:"nowrap"}};function ge({action:e,label:t,icon:o,disabled:n=false,onClick:i,showLabel:a=false,compact:r=false,shortcut:p}){let[d,c]=Q__namespace.default.useState(false),u=typeof e=="string"&&e.startsWith("delete"),l={...ae.button,...r?ae.buttonCompact:{},...d&&!n?ae.buttonHover:{},...n?ae.buttonDisabled:{},...u&&!n?ae.buttonDelete:{}},h=p?`${t} (${p})`:t;return jsxRuntime.jsxs("button",{type:"button",className:`docx-table-toolbar-button docx-table-toolbar-${typeof e=="string"?e:e.type}`,style:l,disabled:n,onClick:i,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),title:h,"aria-label":t,children:[o,a&&jsxRuntime.jsx("span",{children:t})]})}function Gt({children:e,showSeparator:t=true}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:ae.group,children:e}),t&&jsxRuntime.jsx("div",{style:ae.separator})]})}function cp({context:e,onAction:t,disabled:o=false,className:n,style:i,showLabels:a=false,compact:r=false,position:p="top",children:d}){if(!e)return null;let c=x=>{!o&&t&&e&&t(x,e);},u=e.rowCount>1,l=e.columnCount>1,h=e.hasMultiCellSelection,m=e.canSplitCell,f={...ae.container,...r?ae.containerCompact:{},...p==="floating"?ae.containerFloating:{},...i},v=["docx-table-toolbar"];return n&&v.push(n),r&&v.push("docx-table-toolbar-compact"),p==="floating"&&v.push("docx-table-toolbar-floating"),jsxRuntime.jsxs("div",{className:v.join(" "),style:f,role:"toolbar","aria-label":"Table editing tools",children:[jsxRuntime.jsx("span",{style:ae.label,children:"Table:"}),jsxRuntime.jsxs(Gt,{children:[jsxRuntime.jsx(ge,{action:"addRowAbove",label:"Insert Row Above",icon:jsxRuntime.jsx(fl,{}),disabled:o,onClick:()=>c("addRowAbove"),showLabel:a,compact:r}),jsxRuntime.jsx(ge,{action:"addRowBelow",label:"Insert Row Below",icon:jsxRuntime.jsx(hl,{}),disabled:o,onClick:()=>c("addRowBelow"),showLabel:a,compact:r}),jsxRuntime.jsx(ge,{action:"deleteRow",label:"Delete Row",icon:jsxRuntime.jsx(vl,{}),disabled:o||!u,onClick:()=>c("deleteRow"),showLabel:a,compact:r})]}),jsxRuntime.jsxs(Gt,{children:[jsxRuntime.jsx(ge,{action:"addColumnLeft",label:"Insert Column Left",icon:jsxRuntime.jsx(gl,{}),disabled:o,onClick:()=>c("addColumnLeft"),showLabel:a,compact:r}),jsxRuntime.jsx(ge,{action:"addColumnRight",label:"Insert Column Right",icon:jsxRuntime.jsx(bl,{}),disabled:o,onClick:()=>c("addColumnRight"),showLabel:a,compact:r}),jsxRuntime.jsx(ge,{action:"deleteColumn",label:"Delete Column",icon:jsxRuntime.jsx(xl,{}),disabled:o||!l,onClick:()=>c("deleteColumn"),showLabel:a,compact:r})]}),jsxRuntime.jsxs(Gt,{showSeparator:false,children:[jsxRuntime.jsx(ge,{action:"mergeCells",label:"Merge Cells",icon:jsxRuntime.jsx(Sl,{}),disabled:o||!h,onClick:()=>c("mergeCells"),showLabel:a,compact:r}),jsxRuntime.jsx(ge,{action:"splitCell",label:"Split Cell",icon:jsxRuntime.jsx(yl,{}),disabled:o||!m,onClick:()=>c("splitCell"),showLabel:a,compact:r}),jsxRuntime.jsx(ge,{action:"deleteTable",label:"Delete Table",icon:jsxRuntime.jsx(Cl,{}),disabled:o,onClick:()=>c("deleteTable"),showLabel:a,compact:r})]}),d]})}function pp(e,t){let o=e.rows.length,n=Ut(e),i=!!(t.selectedCells&&(t.selectedCells.startRow!==t.selectedCells.endRow||t.selectedCells.startCol!==t.selectedCells.endCol)),a=hn(e,t.rowIndex,t.columnIndex),r=!!(a&&((a.formatting?.gridSpan??1)>1||a.formatting?.vMerge==="restart"));return {table:e,selection:t,hasMultiCellSelection:i,canSplitCell:r,rowCount:o,columnCount:n}}function Ut(e){if(!e.rows.length)return 0;let t=0;for(let o of e.rows){let n=0;for(let i of o.cells)n+=i.formatting?.gridSpan??1;t=Math.max(t,n);}return t}function hn(e,t,o){let n=e.rows[t];if(!n)return null;let i=0;for(let a of n.cells){let r=a.formatting?.gridSpan??1;if(o>=i&&o<i+r)return a;i+=r;}return null}function Tl(e,t){let o=[],n=0;for(let i of e.cells){let a=i.formatting?.gridSpan??1;o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...i.formatting,vMerge:void 0}}),n+=a;}for(;n<t;)o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}),n++;return {type:"tableRow",cells:o,formatting:{...e.formatting,header:false}}}function wl(){return {type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}}function up(e,t,o="after"){let n=[...e.rows],i=o==="before"?t:t+1,a=e.rows[t]||e.rows[0],r=Ut(e),p=Tl(a,r);return n.splice(i,0,p),{...e,rows:n}}function dp(e,t){if(e.rows.length<=1)return e;let o=e.rows.filter((n,i)=>i!==t);return {...e,rows:o}}function mp(e,t,o="after"){let n=o==="before"?t:t+1,i=e.rows.map(r=>{let p=[...r.cells],d=0,c=0;for(let u=0;u<r.cells.length;u++){let h=r.cells[u].formatting?.gridSpan??1;if(n<=d+h){c=o==="before"?u:u+1;break}d+=h,c=u+1;}return p.splice(c,0,wl()),{...r,cells:p}}),a=e.columnWidths;if(e.columnWidths&&e.columnWidths.length>0){a=[...e.columnWidths];let r=e.columnWidths[t]||e.columnWidths[0]||1440;a.splice(n,0,r);}return {...e,rows:i,columnWidths:a}}function fp(e,t){if(Ut(e)<=1)return e;let n=e.rows.map(a=>{let r=0,p=[];for(let d of a.cells){let c=d.formatting?.gridSpan??1;t>=r&&t<r+c?c>1&&p.push({...d,formatting:{...d.formatting,gridSpan:c-1}}):p.push(d),r+=c;}return {...a,cells:p}}),i=e.columnWidths;return e.columnWidths&&e.columnWidths.length>t&&(i=e.columnWidths.filter((a,r)=>r!==t)),{...e,rows:n,columnWidths:i}}function hp(e,t){if(!t.selectedCells)return e;let{startRow:o,startCol:n,endRow:i,endCol:a}=t.selectedCells,r=i-o+1,p=a-n+1,d=e.rows.map((c,u)=>{if(u<o||u>i)return c;let l=[],h=0;for(let m of c.cells){let f=m.formatting?.gridSpan??1,v=h+f-1;h<=a&&v>=n?u===o&&h===n?l.push({...m,formatting:{...m.formatting,gridSpan:p,vMerge:r>1?"restart":void 0}}):u>o&&h===n&&l.push({...m,formatting:{...m.formatting,gridSpan:p,vMerge:"continue"}}):l.push(m),h+=f;}return {...c,cells:l}});return {...e,rows:d}}function gp(e,t,o){let n=hn(e,t,o);if(!n)return e;let i=n.formatting?.gridSpan??1,a=n.formatting?.vMerge==="restart";if(i<=1&&!a)return e;let r=e.rows.map((p,d)=>{if(d!==t&&!a)return p;let c=[],u=0;for(let l of p.cells){let h=l.formatting?.gridSpan??1;if(u===o||u<=o&&o<u+h)if(i>1)for(let m=0;m<i;m++)c.push({type:"tableCell",content:m===0?l.content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...l.formatting,gridSpan:void 0,vMerge:void 0}});else a&&d===t?c.push({...l,formatting:{...l.formatting,vMerge:void 0}}):l.formatting?.vMerge==="continue"?c.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...l.formatting,vMerge:void 0}}):c.push(l);else c.push(l);u+=h;}return {...p,cells:c}});return {...e,rows:r}}
4
+ exports.$=gp;exports.A=Hc;exports.B=Ec;exports.C=_c;exports.D=Dc;exports.E=Nc;exports.F=qc;exports.G=zc;exports.H=Vc;exports.I=$c;exports.J=Wc;exports.K=Gc;exports.L=Uc;exports.M=Yc;exports.N=ep;exports.O=tp;exports.P=op;exports.Q=np;exports.R=rp;exports.S=cp;exports.T=pp;exports.U=Ut;exports.V=hn;exports.W=up;exports.X=dp;exports.Y=mp;exports.Z=fp;exports._=hp;exports.a=T;exports.b=so;exports.c=F;exports.ca=Mt;exports.d=b;exports.da=xn;exports.e=s0;exports.ea=kt;exports.f=xo;exports.fa=Sn;exports.g=Co;exports.ga=tt;exports.h=K;exports.ha=yn;exports.i=Mo;exports.ia=jt;exports.j=Lo;exports.ja=Xt;exports.k=Ro;exports.ka=Jt;exports.l=Ho;exports.la=Qt;exports.m=_o;exports.ma=eo;exports.n=Do;exports.na=to;exports.o=Fo;exports.oa=Tn;exports.p=zo;exports.pa=El;exports.q=$o;exports.qa=_l;exports.r=Go;exports.s=jo;exports.t=ec;exports.u=re;exports.v=he;exports.w=Ic;exports.x=Pc;exports.y=Zc;exports.z=Ba;