@eigenpal/docx-js-editor 0.0.30 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ClipboardManager-D0D4aUKE.d.ts → ClipboardManager-C0rTRkVQ.d.ts} +29 -1
- package/dist/{ClipboardManager-t936d0KD.d.mts → ClipboardManager-CgpKW2At.d.mts} +29 -1
- package/dist/PageSetupDialog-2SKHDRTF.js +1 -0
- package/dist/PageSetupDialog-SMQJXEBL.mjs +1 -0
- package/dist/chunk-2HDYCD2Q.mjs +1 -0
- package/dist/chunk-37SLIJPH.mjs +58 -0
- package/dist/{chunk-KCUPCJFL.mjs → chunk-6AJI5NPH.mjs} +1 -1
- package/dist/chunk-7MGFEP2R.mjs +26 -0
- package/dist/chunk-7QTNB64A.mjs +9 -0
- package/dist/chunk-EEV6TUOX.mjs +261 -0
- package/dist/chunk-EF3LLEN7.js +4 -0
- package/dist/chunk-EV3CM6TU.js +1 -0
- package/dist/chunk-HWWZOJMR.mjs +4 -0
- package/dist/{chunk-VHWEKJ35.js → chunk-KCOGY3V2.js} +5 -5
- package/dist/chunk-KUL2SDYC.js +26 -0
- package/dist/chunk-P7WEP4JU.js +9 -0
- package/dist/{chunk-Z35FA4M4.mjs → chunk-RTFUE3KK.mjs} +5 -5
- package/dist/{chunk-XGL3EGKF.js → chunk-UMDJQ3Q4.js} +4 -4
- package/dist/chunk-WH2EK2HU.js +261 -0
- package/dist/chunk-ZJNGMDRE.js +58 -0
- package/dist/core-plugins-reexport.js +1 -1
- package/dist/core-plugins-reexport.mjs +1 -1
- package/dist/core-reexport.d.mts +2 -2
- package/dist/core-reexport.d.ts +2 -2
- package/dist/core-reexport.js +1 -1
- package/dist/core-reexport.mjs +1 -1
- package/dist/headless-reexport.js +2 -2
- package/dist/headless-reexport.mjs +1 -1
- package/dist/index.d.mts +10 -27
- package/dist/index.d.ts +10 -27
- package/dist/index.js +23 -66
- package/dist/index.mjs +23 -66
- package/dist/mcp-reexport.js +10 -10
- package/dist/mcp-reexport.mjs +9 -9
- package/dist/{react-C-pJU0Y4.d.mts → react-B2h6vE3D.d.mts} +118 -83
- package/dist/{react-By80Gfi-.d.ts → react-CAc4htNH.d.ts} +118 -83
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/selectionRects-DEX5THEG.js +1 -0
- package/dist/selectionRects-SQTAHMCH.mjs +1 -0
- package/dist/styles.css +1 -1
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +2 -1
- package/dist/PageSetupDialog-3QCVUNDL.mjs +0 -1
- package/dist/PageSetupDialog-ZZTFPZKJ.js +0 -1
- package/dist/chunk-2KHL5RSD.js +0 -4
- package/dist/chunk-7HZRJTOL.mjs +0 -4
- package/dist/chunk-CQRI4YUS.mjs +0 -26
- package/dist/chunk-G72SXG7G.js +0 -258
- package/dist/chunk-I6LFWQFR.mjs +0 -59
- package/dist/chunk-IRO7KGGC.js +0 -59
- package/dist/chunk-MRWJ3GNH.js +0 -9
- package/dist/chunk-MVCTPHRR.mjs +0 -258
- package/dist/chunk-QQ63M65M.js +0 -1
- package/dist/chunk-TDEHAPMZ.mjs +0 -1
- package/dist/chunk-VR6PT4IZ.js +0 -26
- package/dist/chunk-YGTSQZRK.mjs +0 -9
- package/dist/selectionRects-6TRAXB7D.js +0 -1
- package/dist/selectionRects-IS7ZAS3A.mjs +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {p,a,b as b$1}from'./chunk-QAZ4233N.mjs';import {a as a$1,b,k as k$1}from'./chunk-LYBG4YI7.mjs';import*as J from'react';import J__default,{createContext,useRef,useState,useEffect,useCallback,useMemo,useContext}from'react';import*as E from'@radix-ui/react-select';import {clsx}from'clsx';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function k(...e){return clsx(e)}var Se=E.Root,De=E.Group,nt=E.Value;function we({className:e,children:t,onMouseDown:o,...n}){return jsxs(E.Trigger,{className:k("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:r=>{r.preventDefault(),o?.(r);},...n,children:[t,jsx(E.Icon,{asChild:true,children:jsx(gn,{className:"h-4 w-4 text-slate-400 shrink-0"})})]})}function Ie({className:e,children:t,position:o="popper",onCloseAutoFocus:n,...r}){return jsx(E.Portal,{children:jsx("div",{className:"ep-root",children:jsx(E.Content,{className:k("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:l=>{l.preventDefault(),n?.(l);},...r,children:jsx(E.Viewport,{className:k("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),onMouseDown:l=>l.preventDefault(),children:t})})})})}function Ne({className:e,...t}){return jsx(E.Label,{className:k("px-2 py-1.5 text-xs font-medium text-slate-500",e),...t})}function de({className:e,children:t,onMouseDown:o,...n}){return jsxs(E.Item,{className:k("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:r=>{r.preventDefault(),o?.(r);},...n,children:[jsx(E.ItemText,{children:t}),jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsx(E.ItemIndicator,{children:jsx(bn,{className:"h-4 w-4"})})})]})}function Ye({className:e,...t}){return jsx(E.Separator,{className:k("-mx-1 my-1 h-px bg-slate-100",e),...t})}function gn({className:e}){return jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children: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 bn({className:e}){return jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children: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 xn=[{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 no({value:e,onChange:t,fonts:o=xn,disabled:n=false,className:r,placeholder:l="Arial",width:u=120,showPreview:m=true}){let s=J.useMemo(()=>e?o.find(h=>h.fontFamily===e||h.name.toLowerCase()===e.toLowerCase())?.name||e:l,[e,o,l]),c=J.useCallback(a=>{let h=o.find(p=>p.name===a);h&&t?.(h.fontFamily);},[t,o]),d=J.useMemo(()=>{let a={"sans-serif":[],serif:[],monospace:[],other:[]};return o.forEach(h=>{let p=h.category||"other";a[p].push(h);}),a},[o]);return jsxs(Se,{value:s,onValueChange:c,disabled:n,children:[jsx(we,{className:k("h-8 text-sm",r),style:{minWidth:typeof u=="number"?`${u}px`:u},"aria-label":"Select font family",children:jsx(nt,{placeholder:l,children:s})}),jsxs(Ie,{className:"max-h-[300px]",children:[d["sans-serif"].length>0&&jsxs(De,{children:[jsx(Ne,{children:"Sans Serif"}),d["sans-serif"].map(a=>jsx(de,{value:a.name,style:m?{fontFamily:a.fontFamily}:void 0,children:a.name},a.name))]}),d.serif.length>0&&jsxs(Fragment,{children:[jsx(Ye,{}),jsxs(De,{children:[jsx(Ne,{children:"Serif"}),d.serif.map(a=>jsx(de,{value:a.name,style:m?{fontFamily:a.fontFamily}:void 0,children:a.name},a.name))]})]}),d.monospace.length>0&&jsxs(Fragment,{children:[jsx(Ye,{}),jsxs(De,{children:[jsx(Ne,{children:"Monospace"}),d.monospace.map(a=>jsx(de,{value:a.name,style:m?{fontFamily:a.fontFamily}:void 0,children:a.name},a.name))]})]})]})]})}var ro=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,io=clsx,ao=(e,t)=>o=>{var n;if(t?.variants==null)return io(e,o?.class,o?.className);let{variants:r,defaultVariants:l}=t,u=Object.keys(r).map(c=>{let d=o?.[c],a=l?.[c];if(d===null)return null;let h=ro(d)||ro(a);return r[c][h]}),m=o&&Object.entries(o).reduce((c,d)=>{let[a,h]=d;return h===void 0||(c[a]=h),c},{}),s=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:a,className:h,...p}=d;return Object.entries(p).every(g=>{let[b,f]=g;return Array.isArray(f)?f.includes({...l,...m}[b]):{...l,...m}[b]===f})?[...c,a,h]:c},[]);return io(e,u,s,o?.class,o?.className)};var yn=ao("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-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),$=J.forwardRef(({className:e,variant:t,size:o,...n},r)=>jsx("button",{className:k(yn({variant:t,size:o,className:e})),ref:r,...n}));$.displayName="Button";function v({size:e=20,className:t="",style:o,children:n}){return 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 Sn(e){return jsx(v,{...e,children: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 wn(e){return jsx(v,{...e,children: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 In(e){return jsx(v,{...e,children: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 Mn(e){return jsx(v,{...e,children: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 Pn(e){return jsx(v,{...e,children:jsx("path",{d:"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"})})}function kn(e){return jsx(v,{...e,children: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 Rn(e){return jsx(v,{...e,children: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 Zn(e){return jsx(v,{...e,children: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 Ln(e){return jsx(v,{...e,children: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 Hn(e){return jsx(v,{...e,children: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 En(e){return jsx(v,{...e,children:jsx("path",{d:"m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"})})}function qn(e){return jsx(v,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"})})}function _n(e){return jsx(v,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"})})}function An(e){return jsx(v,{...e,children:jsx("path",{d:"M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"})})}function Dn(e){return jsx(v,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"})})}function Zt(e){return jsx(v,{...e,children: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 Nn(e){return jsx(v,{...e,children: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 Fn(e){return jsx(v,{...e,children: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 Bn(e){return jsx(v,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"})})}function On(e){return jsx(v,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"})})}function zn(e){return jsx(v,{...e,children:jsx("path",{d:"M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"})})}function Wn(e){return jsx(v,{...e,children: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 Vn(e){return jsx(v,{...e,children: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 $n(e){return jsx(v,{...e,children:jsx("path",{d:"M480-360 280-560h400L480-360Z"})})}function Un(e){return jsx(v,{...e,children: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 Gn(e){return jsx(v,{...e,children: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 Kn(e){return jsx(v,{...e,children: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 Yn(e){return jsx(v,{...e,children: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 Xn(e){return jsx(v,{...e,children: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 jn(e){return jsx(v,{...e,children:jsx("path",{d:"M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"})})}function Jn(e){return jsx(v,{...e,children: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 Qn(e){return jsx(v,{...e,children: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 er(e){return jsx(v,{...e,children: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 tr(e){return jsx(v,{...e,children:jsx("path",{d:"M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"})})}function or(e){return jsx(v,{...e,children:jsx("path",{d:"M200-440v-80h560v80H200Z"})})}function nr(e){return jsx(v,{...e,children: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 rr(e){return jsx(v,{...e,children: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 ir(e){return jsx(v,{...e,children: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 ar(e){return jsx(v,{...e,children:jsx("path",{d:"M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"})})}function lr(e){return jsx(v,{...e,children: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 sr(e){return jsx(v,{...e,children: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 cr(e){return jsx(v,{...e,children:jsx("path",{d:"M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"})})}function ur(e){return jsx(v,{...e,children:jsx("path",{d:"M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"})})}function dr(e){return jsx(v,{...e,children:jsx("path",{d:"M160-440v-80h640v80H160Z"})})}function pr(e){return jsx(v,{...e,children: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 mr(e){return jsx(v,{...e,children: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 hr(e){return jsx(v,{...e,children: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 fr(e){return jsx(v,{...e,children:jsx("path",{d:"M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"})})}function vr(e){return jsx(v,{...e,children: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 gr(e){return jsx(v,{...e,children: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 br(e){return jsx(v,{...e,children: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 xr(e){return jsx(v,{...e,children: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 Cr(e){return jsx(v,{...e,children: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 yr(e){return jsx(v,{...e,children: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 Tr(e){return jsx(v,{...e,children:jsx("path",{d:"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"})})}function Sr(e){return jsx(v,{...e,children:jsx("path",{d:"m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"})})}function wr(e){return jsx(v,{...e,children: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 Ir(e){return jsx(v,{...e,children: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 Mr(e){return jsx(v,{...e,children: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 Pr(e){return jsx(v,{...e,children: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 kr(e){return jsx(v,{...e,children: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 Rr(e){return jsx(v,{...e,children: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 Zr(e){return jsx(v,{...e,children: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 Lr(e){return jsx(v,{...e,children: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 Hr(e){return jsx(v,{...e,children:jsx("path",{d:"M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function Er(e){return jsx(v,{...e,children: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 qr(e){return jsx(v,{...e,children: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 _r(e){return jsx(v,{...e,children: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 Ar(e){return jsx(v,{...e,children:jsx("path",{d:"M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"})})}function Dr(e){return jsx(v,{...e,children: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 Nr(e){return jsx(v,{...e,children:jsx("path",{d:"M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"})})}function Fr(e){return jsx(v,{...e,children:jsx("path",{d:"M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"})})}function Br(e){return jsx(v,{...e,children:jsx("path",{d:"M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"})})}function Or(e){return jsx(v,{...e,children:jsx("path",{d:"M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"})})}function zr(e){return jsx(v,{...e,children:jsx("path",{d:"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"})})}function Wr(e){return jsx(v,{...e,children:jsx("path",{d:"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"})})}function Vr(e){return jsx(v,{...e,children: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 $r(e){return jsx(v,{...e,children: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 Ur(e){return jsx(v,{...e,children:jsx("path",{d:"M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})})}function Gr(e){return jsx(v,{...e,children:jsx("path",{d:"M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"})})}function Kr(e){return jsx(v,{...e,children:jsx("path",{d:"m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"})})}function Yr(e){return jsx(v,{...e,children:jsx("path",{d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function Xr(e){return jsxs(v,{...e,children:[jsx("path",{d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"}),jsx("path",{fill:"#188038",d:"m421-380 227-227-45-45-182 182-92-91-45 45 137 136Z"})]})}function jr(e){return jsx(v,{...e,children:jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})})}function Jr(e){return jsx(v,{...e,children:jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})})}function Qr(e){return jsx(v,{...e,children:jsx("path",{d:"M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function ei(e){return jsx(v,{...e,children:jsx("path",{d:"M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function ti(e){return jsx(v,{...e,children:jsx("path",{d:"M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"})})}function oi(e){return jsx(v,{...e,children:jsx("path",{d:"M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function ni(e){return jsx(v,{...e,children:jsx("path",{d:"M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"})})}function ri(e){return jsx(v,{...e,children:jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"})})}function ii(e){return jsx(v,{...e,children:jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"})})}var ai={undo:Sn,redo:wn,print:In,format_bold:Mn,format_italic:Pn,format_underlined:kn,strikethrough_s:Rn,superscript:Zn,subscript:Ln,link:Hn,format_clear:En,format_align_left:qn,format_align_center:_n,format_align_right:An,format_align_justify:Dn,format_line_spacing:Zt,format_list_bulleted:Nn,format_list_numbered:Fn,format_indent_increase:Bn,format_indent_decrease:On,format_color_text:zn,ink_highlighter:Wn,format_color_reset:Vn,arrow_drop_down:$n,table:Un,table_chart:Gn,grid_on:Kn,table_rows:Yn,view_column:Xn,border_all:jn,border_outer:Jn,border_inner:Qn,border_clear:er,add:tr,remove:or,delete:nr,delete_sweep:rr,call_merge:ir,call_split:ar,drag_indicator:lr,image:sr,format_image_left:cr,format_image_right:ur,horizontal_rule:dr,flip_to_back:pr,flip_to_front:mr,open_with:hr,tune:fr,rotate_right:vr,rotate_left:gr,swap_horiz:br,swap_vert:xr,shapes:Cr,format_paint:yr,expand_more:Tr,expand_less:Sr,border_top:wr,border_bottom:Ir,border_left:Mr,border_right:Pr,padding:kr,text_rotation_none:Rr,wrap_text:Zr,height:Lr,fit_width:Hr,settings:Er,border_color:qr,format_color_fill:_r,vertical_align_top:Ar,vertical_align_center:Dr,vertical_align_bottom:Nr,line_weight:Fr,keyboard_arrow_up:Br,keyboard_arrow_down:Or,keyboard_arrow_left:zr,keyboard_arrow_right:Wr,more_vert:Vr,page_break:$r,arrow_back:Ur,done_all:Gr,check_circle:Kr,chat_bubble_outline:Yr,chat_bubble_check:Xr,check:jr,close:Jr,add_comment:Qr,comment:ei,edit_note:ti,rate_review:oi,visibility:ni,format_textdirection_l_to_r:ri,format_textdirection_r_to_l:ii};function x({name:e,size:t=20,className:o="",style:n}){let r=ai[e];return r?jsx(r,{size:t,className:o,style:n}):(console.warn(`Icon not found: ${e}`),jsx("span",{className:o,style:{fontSize:t,width:t,height:t,...n},children:e}))}function G({isOpen:e,onClose:t,align:o="left"}){let n=useRef(null),r=useRef(null),[l,u]=useState({top:0,left:0});useEffect(()=>{if(!e||!n.current)return;let c=n.current.getBoundingClientRect();o==="right"?requestAnimationFrame(()=>{if(r.current){let d=r.current.getBoundingClientRect();u({top:c.bottom+4,left:c.right-d.width});}else u({top:c.bottom+4,left:c.left});}):u({top:c.bottom+4,left:c.left});},[e,o]),useEffect(()=>{if(!e)return;let c=h=>{let p=h.target;n.current&&!n.current.contains(p)&&r.current&&!r.current.contains(p)&&t();},d=h=>{h.key==="Escape"&&t();},a=()=>t();return document.addEventListener("mousedown",c),document.addEventListener("keydown",d),window.addEventListener("scroll",a,true),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",d),window.removeEventListener("scroll",a,true);}},[e,t]);let m=useCallback(c=>{c.preventDefault(),c.stopPropagation();},[]),s={position:"fixed",top:l.top,left:l.left,zIndex:1e4};return {containerRef:n,dropdownRef:r,dropdownStyle:s,handleMouseDown:m}}var di=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],pi=1,mi=400;function mo(e){return e/2}function a0(e){return e*2}function uo(e,t,o){for(let n of t)if(n>e)return n;return Math.min(e+1,o)}function po(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 ho({value:e,onChange:t,sizes:o=di,disabled:n=false,className:r,placeholder:l="11",minSize:u=pi,maxSize:m=mi}){let[s,c]=useState(false),[d,a]=useState(""),[h,p]=useState(false),g=useRef(null),b=useCallback(()=>{p(false),c(false);},[]),{containerRef:f,dropdownRef:y,dropdownStyle:C}=G({isOpen:h,onClose:b}),S=e??(parseInt(l,10)||11),M=e!==void 0?e.toString():l,R=useCallback(w=>{if(w.preventDefault(),n)return;let D=po(S,o,u);t?.(D);},[S,o,u,n,t]),z=useCallback(w=>{if(w.preventDefault(),n)return;let D=uo(S,o,m);t?.(D);},[S,o,m,n,t]),F=useCallback(w=>{w.preventDefault(),!n&&(c(true),a(M),p(true),requestAnimationFrame(()=>{g.current?.focus(),g.current?.select();}));},[n,M]),Te=useCallback(w=>{a(w.target.value);},[]),le=useCallback(()=>{c(false);let w=parseFloat(d);if(!isNaN(w)&&w>=u&&w<=m){let D=Math.round(w*2)/2;t?.(D);}},[d,u,m,t]),fe=useCallback(w=>{if(w.key==="Enter")w.preventDefault(),le(),p(false);else if(w.key==="Escape")c(false),p(false);else if(w.key==="ArrowUp"){w.preventDefault();let D=uo(S,o,m);a(D.toString()),t?.(D);}else if(w.key==="ArrowDown"){w.preventDefault();let D=po(S,o,u);a(D.toString()),t?.(D);}},[le,S,o,m,u,t]),Z=useCallback(w=>{t?.(w),p(false),c(false);},[t]),Y=useCallback(w=>{w.target.tagName!=="INPUT"&&w.preventDefault();},[]);return jsxs("div",{ref:f,className:k("flex items-center",r),onMouseDown:Y,children:[jsx($,{variant:"ghost",size:"icon-sm",className:k("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:R,disabled:n||S<=u,"aria-label":"Decrease font size","data-testid":"font-size-decrease",children:jsx(x,{name:"remove",size:18})}),jsx("div",{className:"relative",children:s?jsx("input",{ref:g,type:"text",value:d,onChange:Te,onBlur:le,onKeyDown:fe,className:k("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"}):jsx("button",{type:"button",onClick:F,className:k("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:M})}),h&&jsx("div",{ref:y,style:{...C,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(w=>jsx("button",{type:"button",onClick:()=>Z(w),className:k("w-full px-3 py-1.5 text-sm text-left","hover:bg-slate-100",w===S&&"bg-slate-100 font-medium"),role:"option","aria-selected":w===S,children:w},w))}),jsx($,{variant:"ghost",size:"icon-sm",className:k("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:z,disabled:n||S>=m,"aria-label":"Increase font size","data-testid":"font-size-increase",children:jsx(x,{name:"add",size:18})})]})}var vi=[{name:"Dark Red",hex:"C00000"},{name:"Red",hex:"FF0000"},{name:"Orange",hex:"FFC000"},{name:"Yellow",hex:"FFFF00"},{name:"Light Green",hex:"92D050"},{name:"Green",hex:"00B050"},{name:"Light Blue",hex:"00B0F0"},{name:"Blue",hex:"0070C0"},{name:"Dark Blue",hex:"002060"},{name:"Purple",hex:"7030A0"}],rt=18,gi=2,bi={position:"relative",display:"inline-block"},xi={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)"},Ci={padding:"10px",backgroundColor:"#fff",border:"1px solid #d0d0d0",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.15)",width:"auto"},Ht={fontSize:"11px",color:"#666",marginBottom:"4px",fontWeight:500},Et={height:"1px",backgroundColor:"#e0e0e0",margin:"8px 0"},go={display:"grid",gap:`${gi}px`},it={width:`${rt}px`,height:`${rt}px`,border:"1px solid #c0c0c0",borderRadius:"2px",cursor:"pointer",padding:0,transition:"transform 0.1s, border-color 0.1s"},bo={...it,transform:"scale(1.15)",borderColor:"#333",zIndex:1},xo={...it,borderWidth:"2px",borderColor:"#0066cc",boxShadow:"0 0 0 1px #0066cc"},yi={display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"5px 8px",border:"1px solid #d0d0d0",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"12px",color:"#333"},Ti={display:"flex",alignItems:"center",gap:"6px"},Si={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid #ccc",borderRadius:"3px",fontSize:"12px"},wi={height:"24px",padding:"0 10px",border:"1px solid #ccc",borderRadius:"3px",backgroundColor:"#f5f5f5",fontSize:"12px",cursor:"pointer"},Ii={width:"16px",height:"4px",borderRadius:"1px",marginTop:"-2px"};function vo(e,t,o){if(!e)return t==="text"||t==="border"?"#000000":"transparent";if(typeof e=="string"){if(t==="highlight"){let n=b$1(e);return n||(e==="none"?"transparent":e.startsWith("#")?e:`#${e}`)}return e.startsWith("#")?e:`#${e}`}return a(e,o)}function Mi(e){let t=e.replace(/^#/,"");if(t.length!==6)return false;let o=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return (o*299+n*587+r*114)/1e3>230}function Co(e,t,o){return e?(typeof e=="string"?e.replace(/^#/,"").toUpperCase():a(e,o).replace(/^#/,"").toUpperCase())===t.toUpperCase():false}function Pi({matrix:e,selectedColor:t,theme:o,onSelect:n}){let[r,l]=useState(null);return jsx("div",{style:{...go,gridTemplateColumns:`repeat(10, ${rt}px)`},children:e.flatMap((u,m)=>u.map((s,c)=>{let d=`${m}-${c}`,a=r===d,h=Co(t,s.hex,o);return jsx("button",{type:"button",style:{...h?xo:a?bo:it,backgroundColor:`#${s.hex}`},title:s.label,"aria-label":s.label,"aria-selected":h,onClick:()=>n(s),onMouseDown:p=>p.preventDefault(),onMouseEnter:()=>l(d),onMouseLeave:()=>l(null)},d)}))})}function ki({selectedColor:e,theme:t,onSelect:o}){let[n,r]=useState(null);return jsx("div",{style:{...go,gridTemplateColumns:`repeat(10, ${rt}px)`},children:vi.map((l,u)=>{let m=n===u,s=Co(e,l.hex,t);return jsx("button",{type:"button",style:{...s?xo:m?bo:it,backgroundColor:`#${l.hex}`},title:l.name,"aria-label":l.name,"aria-selected":s,onClick:()=>o(l.hex),onMouseDown:c=>c.preventDefault(),onMouseEnter:()=>r(u),onMouseLeave:()=>r(null)},l.hex)})})}function Ee({mode:e,value:t,onChange:o,theme:n,disabled:r=false,className:l,style:u,title:m,icon:s,autoLabel:c}){let[d,a]=useState(false),[h,p$1]=useState(false),[g,b]=useState("");useEffect(()=>{let P=vo(t,e,n).replace(/^#/,"");/^[0-9A-Fa-f]{6}$/.test(P)&&b(P.toUpperCase());},[t,e,n]);let f=useCallback(()=>a(false),[]),{containerRef:y,dropdownRef:C,dropdownStyle:S}=G({isOpen:d,onClose:f}),M=n?.colorScheme??null,R=useMemo(()=>p(M),[M]),z=useMemo(()=>vo(t,e,n),[t,e,n]),F=useCallback(()=>{r||a(P=>!P);},[r]),Te=useCallback(P=>{if(e==="highlight")o?.(P.hex);else {let X={themeColor:P.themeSlot,rgb:P.hex};P.tint&&(X.themeTint=P.tint),P.shade&&(X.themeShade=P.shade),o?.(X);}a(false);},[e,o]),le=useCallback(P=>{o?.(e==="highlight"?P:{rgb:P}),a(false);},[e,o]),fe=useCallback(()=>{o?.(e==="highlight"?"none":{auto:true}),a(false);},[e,o]),Z=useCallback(()=>{let P=g.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/i.test(P)&&(o?.(e==="highlight"?P:{rgb:P}),a(false),b(""));},[e,g,o]),Y={...xi,...r?{cursor:"default",opacity:.38}:d?{backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"}:h?{backgroundColor:"var(--doc-bg-hover)"}:{}},w=e==="text"?"Font Color":e==="highlight"?"Text Highlight Color":"Border Color",D=s??(e==="text"?"format_color_text":e==="highlight"?"ink_highlighter":"border_color");return jsxs("div",{ref:y,className:`docx-advanced-color-picker ${l||""}`,style:{...bi,...u},children:[jsxs("button",{type:"button",className:"docx-advanced-color-picker-button",style:Y,onClick:F,onMouseDown:P=>P.preventDefault(),onMouseEnter:()=>p$1(true),onMouseLeave:()=>p$1(false),disabled:r,title:m||w,"aria-label":m||w,"aria-haspopup":"true","aria-expanded":d,children:[jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:0},children:[jsx(x,{name:D,size:18}),jsx("div",{style:{...Ii,backgroundColor:z==="transparent"?"#fff":z,outline:z==="transparent"||Mi(z)?"1px solid #bbb":"none"}})]}),jsx(x,{name:"arrow_drop_down",size:14})]}),d&&jsx("div",{ref:C,className:"docx-advanced-color-picker-dropdown",style:{...S,...Ci},role:"dialog","aria-label":`${w} picker`,onMouseDown:P=>{P.target.tagName!=="INPUT"&&P.preventDefault();},children:jsxs(Fragment,{children:[jsxs("button",{type:"button",style:yi,onClick:fe,onMouseDown:P=>P.preventDefault(),children:[e==="highlight"?jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",border:"1px solid #ccc",borderRadius:"2px",position:"relative",backgroundColor:"#fff"},children:jsx("span",{style:{position:"absolute",top:"50%",left:"-1px",right:"-1px",height:"2px",backgroundColor:"#ff0000",transform:"rotate(-45deg)"}})}):jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",backgroundColor:"#000",borderRadius:"2px"}}),c??(e==="highlight"?"No Color":"Automatic")]}),jsx("div",{style:Et}),jsx("div",{style:Ht,children:"Theme Colors"}),jsx(Pi,{matrix:R,selectedColor:t,theme:n,onSelect:Te}),jsx("div",{style:Et}),jsx("div",{style:Ht,children:"Standard Colors"}),jsx(ki,{selectedColor:t,theme:n,onSelect:le}),jsx("div",{style:Et}),jsx("div",{style:Ht,children:"Custom Color"}),jsxs("div",{style:Ti,children:[jsx("span",{style:{fontSize:"12px",color:"#666"},children:"#"}),jsx("input",{type:"text",style:Si,value:g,onChange:P=>b(P.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:P=>{P.key==="Enter"&&Z();},onMouseDown:P=>{P.stopPropagation();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsx("button",{type:"button",style:{...wi,opacity:/^[0-9A-Fa-f]{6}$/.test(g)?1:.4,cursor:/^[0-9A-Fa-f]{6}$/.test(g)?"pointer":"default"},onClick:Z,onMouseDown:P=>P.preventDefault(),disabled:!/^[0-9A-Fa-f]{6}$/.test(g),children:"Apply"})]})]})})]})}function ee({content:e,children:t,side:o="bottom",delayMs:n=400}){let[r,l]=J.useState(false),[u,m]=J.useState({x:0,y:0}),s=J.useRef(null),c=J.useRef(null),d=J.useCallback(()=>{c.current=setTimeout(()=>{if(s.current){let g=s.current.getBoundingClientRect(),b=g.left+g.width/2,f=o==="top"?g.top-8:g.bottom+8;m({x:b,y:f});}l(true);},n);},[n,o]),a=J.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),l(false);},[]);J.useEffect(()=>()=>{c.current&&clearTimeout(c.current);},[]);let h=t.props,p=J.cloneElement(t,{ref:s,onMouseEnter:g=>{d(),h.onMouseEnter?.(g);},onMouseLeave:g=>{a(),h.onMouseLeave?.(g);}});return jsxs(Fragment,{children:[p,r&&jsx("div",{className:"fixed z-50 px-2 py-1 text-xs font-medium text-white bg-slate-900 rounded-md shadow-lg",style:{left:u.x,top:u.y,transform:o==="top"?"translate(-50%, -100%)":o==="bottom"?"translate(-50%, 0)":void 0},children:e})]})}var Je=20,qt=[{value:"left",label:"Align Left",icon:jsx(x,{name:"format_align_left",size:Je}),iconName:"format_align_left",shortcut:"Ctrl+L"},{value:"center",label:"Center",icon:jsx(x,{name:"format_align_center",size:Je}),iconName:"format_align_center",shortcut:"Ctrl+E"},{value:"right",label:"Align Right",icon:jsx(x,{name:"format_align_right",size:Je}),iconName:"format_align_right",shortcut:"Ctrl+R"},{value:"both",label:"Justify",icon:jsx(x,{name:"format_align_justify",size:Je}),iconName:"format_align_justify",shortcut:"Ctrl+J"}];function So({value:e="left",onChange:t,disabled:o=false}){let[n,r]=useState(false),l=useCallback(()=>r(false),[]),{containerRef:u,dropdownRef:m,dropdownStyle:s,handleMouseDown:c}=G({isOpen:n,onClose:l}),d=useCallback(p=>{o||t?.(p),r(false);},[o,t]),a=qt.find(p=>p.value===e)||qt[0],h=jsxs($,{variant:"ghost",size:"icon-sm",className:k("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&&r(p=>!p),disabled:o,"aria-label":`${a.label}${a.shortcut?` (${a.shortcut})`:""}`,"aria-expanded":n,"aria-haspopup":"true","data-testid":"toolbar-alignment",children:[jsx(x,{name:a.iconName,size:Je}),jsx(x,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:u,style:{position:"relative",display:"inline-block"},children:[n?h:jsx(ee,{content:`${a.label}${a.shortcut?` (${a.shortcut})`:""}`,children:h}),n&&!o&&jsx("div",{ref:m,style:{...s,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:p=>p.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:qt.map(p=>{let g=e===p.value;return jsx("button",{type:"button",title:`${p.label}${p.shortcut?` (${p.shortcut})`:""}`,"data-testid":`alignment-${p.value}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:g?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:g?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:b=>b.preventDefault(),onMouseEnter:b=>{g||(b.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:b=>{b.currentTarget.style.backgroundColor=g?"var(--doc-primary-light)":"transparent";},onClick:()=>d(p.value),children:jsx(x,{name:p.iconName,size:18})},p.value)})})})]})}var Ai={display:"inline-flex",alignItems:"center",gap:"4px"},wo={display:"inline-flex",alignItems:"center",gap:"4px"},ct={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)"},Di={...ct,backgroundColor:"var(--doc-bg-hover)"},Ni={...ct,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Fi={...ct,cursor:"default",opacity:.38},Bi={width:"28px",height:"28px",padding:"2px"},Oi={width:"1px",height:"20px",backgroundColor:"var(--doc-border)",margin:"0 6px"},at=20;function lt({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:l,style:u}){let[m,s]=useState(false),c={...t?Fi:e?Ni:m?Di:ct,...u},d=a=>{a.preventDefault();};return jsx("button",{type:"button",className:`docx-list-button ${e?"docx-list-button-active":""} ${t?"docx-list-button-disabled":""} ${l||""}`,style:c,onMouseDown:d,onClick:t?void 0:n,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),disabled:t,title:o,"aria-label":o,"aria-pressed":e,role:"button",children:r})}function Io({listState:e,onBulletList:t,onNumberedList:o,onIndent:n,onOutdent:r,disabled:l=false,className:u,style:m,showIndentButtons:s=true,compact:c=false,hasIndent:d=false}){let a=useCallback(()=>c?{...Bi}:{},[c]),h=e?.type==="bullet",p=e?.type==="numbered",b=(e?.isInList||h||p)&&(e?.level??0)>0||d;return jsxs("div",{className:`docx-list-buttons ${u||""}`,style:{...Ai,...m},role:"group","aria-label":"List formatting",children:[jsxs("div",{style:wo,role:"group","aria-label":"List type",children:[jsx(lt,{active:h,disabled:l,title:"Bullet List",onClick:t,style:a(),children:jsx(x,{name:"format_list_bulleted",size:at})}),jsx(lt,{active:p,disabled:l,title:"Numbered List",onClick:o,style:a(),children:jsx(x,{name:"format_list_numbered",size:at})})]}),s&&jsxs(Fragment,{children:[jsx("div",{style:Oi,role:"separator"}),jsxs("div",{style:wo,role:"group","aria-label":"List indentation",children:[jsx(lt,{active:false,disabled:l||!b,title:"Decrease Indent",onClick:r,style:a(),children:jsx(x,{name:"format_indent_decrease",size:at})}),jsx(lt,{active:false,disabled:l,title:"Increase Indent",onClick:n,style:a(),children:jsx(x,{name:"format_indent_increase",size:at})})]})]})]})}function Mo(){return {type:"none",level:0,isInList:false}}var Wi=[{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 ko({value:e,onChange:t,options:o=Wi,disabled:n=false,className:r}){let l=J.useMemo(()=>e===void 0?o[0]:o.find(m=>m.twipsValue===e)||o[0],[e,o]),u=J.useCallback(m=>{let s=parseInt(m,10);isNaN(s)||t?.(s);},[t]);return jsxs(Se,{value:l.twipsValue.toString(),onValueChange:u,disabled:n,children:[jsx(we,{className:k("h-8 text-sm gap-0.5 px-2",r),style:{width:"auto"},title:`Line spacing: ${l.label}`,children:jsx(Zt,{className:"h-5 w-5 shrink-0"})}),jsxs(Ie,{children:[o.map(m=>jsx(de,{value:m.twipsValue.toString(),children:m.label},m.twipsValue)),jsx(Ye,{}),jsx(De,{children:jsx(Ne,{children:"Paragraph spacing"})})]})]})}var Ro=[{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}],Vi="#4a6c8c",$i={Title:26,Subtitle:18,Heading1:24,Heading2:18,Heading3:16,Heading4:14,Heading5:13,Heading6:13,Normal:14};function Ui(e){let t={},o=$i[e.styleId];if(o)t.fontSize=`${o}px`;else {let n=e.fontSize?e.fontSize/2:11,r=Math.min(Math.max(n,11),20);t.fontSize=`${r}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=Vi),t}function Zo({value:e,onChange:t,styles:o,disabled:n=false,className:r,width:l=120}){let u=J.useMemo(()=>!o||o.length===0?Ro:o.filter(a=>a.type==="paragraph").filter(a=>a.qFormat?true:!(a.hidden||a.semiHidden)).map(a=>{let h=Ro.find(p=>p.styleId===a.styleId);return {styleId:a.styleId,name:a.name||a.styleId,type:a.type,isDefault:a.default,qFormat:a.qFormat,priority:a.uiPriority??99,fontSize:a.rPr?.fontSize??h?.fontSize,bold:a.rPr?.bold??h?.bold,italic:a.rPr?.italic??h?.italic,color:a.rPr?.color?.rgb??h?.color}}).sort((a,h)=>(a.priority??99)-(h.priority??99)),[o]),m=J.useCallback(d=>{t?.(d);},[t]),s=e||"Normal",c=u.find(d=>d.styleId===s)?.name||s;return jsxs(Se,{value:s,onValueChange:m,disabled:n,children:[jsx(we,{className:k("h-8 text-sm",r),style:{width:typeof l=="number"?`${l}px`:l},"aria-label":"Select paragraph style",children:jsx("span",{className:"truncate",children:c})}),jsx(Ie,{className:"min-w-[260px] max-h-[400px]",children:u.map(d=>jsx(de,{value:d.styleId,className:"py-2.5 px-3",children:jsx("span",{style:Ui(d),children:d.name})},d.styleId))})]})}var Ki=[{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 Lo({value:e=1,onChange:t,levels:o=Ki,disabled:n=false,className:r,compact:l=false}){let u=J.useMemo(()=>{let s=o.find(c=>Math.abs(c.value-e)<.001);return s?s.label:`${Math.round(e*100)}%`},[o,e]),m=J.useCallback(s=>{let c=parseFloat(s);isNaN(c)||t?.(c);},[t]);return jsxs(Se,{value:e.toString(),onValueChange:m,disabled:n,children:[jsx(we,{className:k(l?"h-7 min-w-[55px] text-xs":"h-8 min-w-[70px] text-sm",r),"aria-label":`Zoom: ${u}`,children:jsx(nt,{placeholder:"100%",children:u})}),jsx(Ie,{children:o.map(s=>jsx(de,{value:s.value.toString(),children:s.label},s.value))})]})}var ji=[{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 qo({onAction:e,disabled:t=false}){let[o,n]=useState(false),r=useCallback(()=>n(false),[]),{containerRef:l,dropdownRef:u,dropdownStyle:m,handleMouseDown:s}=G({isOpen:o,onClose:r}),c=useCallback(a=>{e(a),n(false);},[e]),d=jsxs($,{variant:"ghost",size:"icon-sm",className:k("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:s,onClick:()=>!t&&n(a=>!a),disabled:t,"aria-label":"Border style","aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-borders",children:[jsx(x,{name:"border_all",size:20}),jsx(x,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:l,style:{position:"relative",display:"inline-block"},children:[o?d:jsx(ee,{content:"Borders",children:d}),o&&!t&&jsx("div",{ref:u,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:a=>a.stopPropagation(),children:jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:ji.map(({action:a,icon:h,label:p})=>jsx("button",{type:"button",title:p,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:g=>g.preventDefault(),onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(a),children:jsx(x,{name:h,size:18})},typeof a=="string"?a:a.type))})})]})}function _o({onAction:e,disabled:t=false,theme:o,value:n}){let r=useCallback(l=>{typeof l=="string"?e({type:"borderColor",color:l.replace(/^#/,"")}):l.rgb?e({type:"borderColor",color:l.rgb.replace(/^#/,"")}):l.auto&&e({type:"borderColor",color:"000000"});},[e]);return jsx(Ee,{mode:"border",value:n,onChange:r,theme:o,disabled:t,title:"Border Color"})}var ta=[{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 Do({onAction:e,disabled:t=false}){let[o,n]=useState(false),r=useCallback(()=>n(false),[]),{containerRef:l,dropdownRef:u,dropdownStyle:m,handleMouseDown:s}=G({isOpen:o,onClose:r}),c=useCallback(a=>{e({type:"borderWidth",size:a}),n(false);},[e]),d=jsxs($,{variant:"ghost",size:"icon-sm",className:k("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:s,onClick:()=>!t&&n(a=>!a),disabled:t,"aria-label":"Border width","aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-border-width",children:[jsx(x,{name:"line_weight",size:20}),jsx(x,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:l,style:{position:"relative",display:"inline-block"},children:[o?d:jsx(ee,{content:"Border width",children:d}),o&&!t&&jsx("div",{ref:u,style:{...m,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:a=>a.stopPropagation(),children:ta.map(({size:a,label:h,thickness:p})=>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:g=>g.preventDefault(),onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(a),children:[jsx("div",{style:{width:50,height:Math.max(p,1),backgroundColor:"#000",borderRadius:p>2?1:0}}),jsx("span",{children:h})]},a))})]})}function No({onAction:e,disabled:t=false,theme:o,value:n}){let r=useCallback(l=>{typeof l=="string"&&e(l==="none"?{type:"cellFillColor",color:null}:{type:"cellFillColor",color:l.replace(/^#/,"")});},[e]);return jsx(Ee,{mode:"highlight",value:n,onChange:r,theme:o,disabled:t,title:"Cell Fill Color",icon:"format_color_fill",autoLabel:"No fill"})}var ra={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"},We={height:1,backgroundColor:"var(--doc-border)",margin:"4px 0"},Oo={padding:"6px 14px 2px",fontSize:11,color:"var(--doc-text-muted)",fontWeight:500};function zo({onAction:e,disabled:t=false,tableContext:o}){let[n,r]=useState(false),[l,u]=useState(null),m=useCallback(()=>r(false),[]),{containerRef:s,dropdownRef:c,dropdownStyle:d,handleMouseDown:a}=G({isOpen:n,onClose:m,align:"right"}),h=o?.table?.attrs?.justification??"left",p=useCallback(f=>{e(f),r(false);},[e]),g=(f,y,C,S,M)=>{let R=t||M?.itemDisabled;return jsxs("button",{type:"button",role:"menuitem",style:{...ra,backgroundColor:l===f&&!R?"var(--doc-bg-hover)":"transparent",color:R?"var(--doc-text-muted)":M?.danger?"var(--doc-error)":"var(--doc-text)",cursor:R?"not-allowed":"pointer"},onClick:()=>!R&&p(S),onMouseEnter:()=>u(f),onMouseLeave:()=>u(null),disabled:R,children:[jsx(x,{name:y,size:16,className:M?.danger&&!R?"text-red-600":""}),jsx("span",{style:{flex:1},children:C})]},f)},b=jsx($,{variant:"ghost",size:"icon-sm",className:k("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:a,onClick:()=>!t&&r(f=>!f),disabled:t,"aria-label":"More table options","aria-expanded":n,"aria-haspopup":"menu","data-testid":"toolbar-table-more",children:jsx(x,{name:"more_vert",size:20})});return jsxs("div",{ref:s,style:{position:"relative",display:"inline-block"},children:[n?b:jsx(ee,{content:"More table options",children:b}),n&&!t&&jsxs("div",{ref:c,style:{...d,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:f=>f.stopPropagation(),children:[g("addRowAbove","add","Insert row above","addRowAbove"),g("addRowBelow","add","Insert row below","addRowBelow"),g("addColumnLeft","add","Insert column left","addColumnLeft"),g("addColumnRight","add","Insert column right","addColumnRight"),jsx("div",{style:We,role:"separator"}),g("mergeCells","call_merge","Merge cells","mergeCells",{itemDisabled:!o?.hasMultiCellSelection}),g("splitCell","call_split","Split cell","splitCell",{itemDisabled:!o?.canSplitCell}),jsx("div",{style:We,role:"separator"}),g("deleteRow","delete","Delete row","deleteRow",{danger:true,itemDisabled:(o?.rowCount??0)<=1}),g("deleteColumn","delete","Delete column","deleteColumn",{danger:true,itemDisabled:(o?.columnCount??0)<=1}),g("deleteTable","delete","Delete table","deleteTable",{danger:true}),jsx("div",{style:We,role:"separator"}),jsx("div",{style:Oo,children:"Vertical alignment"}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["top","center","bottom"].map(f=>{let y={top:"vertical_align_top",center:"vertical_align_center",bottom:"vertical_align_bottom"};return jsx("button",{type:"button",title:{top:"Top",center:"Middle",bottom:"Bottom"}[f],style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:"transparent",cursor:"pointer"},onMouseDown:S=>S.preventDefault(),onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent";},onClick:()=>p({type:"cellVerticalAlign",align:f}),children:jsx(x,{name:y[f],size:16})},f)})}),jsx("div",{style:We,role:"separator"}),jsx("div",{style:Oo,children:"Table alignment"}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["left","center","right"].map(f=>{let y={left:"format_align_left",center:"format_align_center",right:"format_align_right"},C=h===f;return jsx("button",{type:"button",title:`Align table ${f}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:C?"var(--doc-primary-light)":"transparent",borderColor:C?"var(--doc-primary)":"var(--doc-border)",color:C?"var(--doc-primary)":"var(--doc-text)",cursor:"pointer"},onMouseDown:S=>S.preventDefault(),onClick:()=>p({type:"tableProperties",props:{justification:f}}),children:jsx(x,{name:y[f],size:16})},f)})}),jsx("div",{style:We,role:"separator"}),g("headerRow","table_rows","Toggle header row",{type:"toggleHeaderRow"}),g("distribute","view_column","Distribute columns evenly",{type:"distributeColumns"}),g("autoFit","fit_width","Auto-fit to contents",{type:"autoFitContents"}),g("noWrap","wrap_text","Toggle no-wrap",{type:"toggleNoWrap"}),jsx("div",{style:We,role:"separator"}),g("properties","settings","Table properties...",{type:"openTableProperties"})]})]})}var aa=20;function ht({options:e,activeValue:t,triggerIcon:o,tooltipContent:n,onSelect:r,disabled:l=false,ariaLabel:u,testId:m}){let[s,c]=useState(false),d=useCallback(()=>c(false),[]),{containerRef:a,dropdownRef:h,dropdownStyle:p,handleMouseDown:g}=G({isOpen:s,onClose:d}),b=useCallback(y=>{l||r(y),c(false);},[l,r]),f=jsxs($,{variant:"ghost",size:"icon-sm",className:k("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",s&&"bg-slate-100",l&&"opacity-30 cursor-not-allowed"),onMouseDown:g,onClick:()=>!l&&c(y=>!y),disabled:l,"aria-label":u??n,"aria-expanded":s,"aria-haspopup":"true","data-testid":m,children:[jsx(x,{name:o,size:aa}),jsx(x,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:a,style:{position:"relative",display:"inline-block"},children:[s?f:jsx(ee,{content:n,children:f}),s&&!l&&jsx("div",{ref:h,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:y=>y.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:e.map(y=>{let C=t===y.value;return jsx("button",{type:"button",title:y.label,"data-testid":m?`${m}-${y.value}`:void 0,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:C?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:C?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:S=>S.preventDefault(),onMouseEnter:S=>{C||(S.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:S=>{S.currentTarget.style.backgroundColor=C?"var(--doc-primary-light)":"transparent";},onClick:()=>b(y.value),children:jsx(x,{name:y.iconName,size:18})},y.value)})})})]})}var Dt=[{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 la(e){return e.displayMode==="float"&&e.cssFloat==="left"?"wrapRight":e.displayMode==="float"&&e.cssFloat==="right"?"wrapLeft":e.wrapType}function $o({imageContext:e,onChange:t,disabled:o=false}){let n=la(e),r=Dt.find(l=>l.value===n)||Dt[0];return jsx(ht,{options:Dt,activeValue:n,triggerIcon:r.iconName,tooltipContent:`Wrap: ${r.label}`,onSelect:t,disabled:o,testId:"toolbar-image-wrap"})}var ca=[{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 Uo({onTransform:e,disabled:t=false}){return jsx(ht,{options:ca,triggerIcon:"rotate_right",tooltipContent:"Transform",onSelect:e,disabled:t,testId:"toolbar-image-transform"})}function pa(e){return "type"in e&&e.type==="separator"}var Yo={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"},ma={...Yo,background:"var(--doc-hover, #f3f4f6)"},Xo={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"},ha={...Xo,opacity:.4,cursor:"default"},fa={height:1,backgroundColor:"var(--doc-border, #e5e7eb)",margin:"4px 0"},va={marginLeft:"auto",fontSize:12,color:"var(--doc-text-muted, #9ca3af)"},ga={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 vt({label:e,items:t,disabled:o}){let[n,r]=useState(false),[l,u]=useState(null),m=useRef(null),s=useRef(null),[c,d]=useState({top:0,left:0}),a=useCallback(()=>{r(false),u(null);},[]);useEffect(()=>{if(!n||!m.current)return;let p=m.current.getBoundingClientRect();d({top:p.bottom+2,left:p.left});},[n]),useEffect(()=>{if(!n)return;function p(f){let y=f.target;m.current&&!m.current.contains(y)&&s.current&&!s.current.contains(y)&&a();}function g(f){f.key==="Escape"&&a();}function b(){a();}return document.addEventListener("mousedown",p),document.addEventListener("keydown",g),window.addEventListener("scroll",b,true),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",g),window.removeEventListener("scroll",b,true);}},[n,a]);let h=p=>{p.disabled||p.submenuContent||p.onClick&&(p.onClick(),a());};return jsxs("div",{style:{position:"relative"},children:[jsxs("button",{ref:m,type:"button",onClick:()=>!o&&r(!n),onMouseDown:p=>p.preventDefault(),disabled:o,style:n?ma:Yo,children:[e,jsx(x,{name:"arrow_drop_down",size:16})]}),n&&jsx("div",{ref:s,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:p=>p.preventDefault(),children:t.map((p,g)=>{if(pa(p))return jsx("div",{style:fa},`sep-${g}`);let b=p;if(b.customContent)return jsx("div",{onMouseDown:C=>C.preventDefault(),children:b.customContent},b.label);let f=!!b.submenuContent,y=l===b.label;return jsxs("div",{style:{position:"relative"},onMouseEnter:()=>f&&u(b.label),onMouseLeave:()=>f&&u(null),children:[jsxs("button",{type:"button",style:b.disabled?ha:Xo,onClick:()=>h(b),onMouseDown:C=>C.preventDefault(),onMouseOver:C=>{b.disabled||(C.currentTarget.style.backgroundColor="var(--doc-hover, #f3f4f6)");},onMouseOut:C=>{C.currentTarget.style.backgroundColor="transparent";},disabled:b.disabled,children:[b.icon&&jsx(x,{name:b.icon,size:18}),jsx("span",{children:b.label}),b.shortcut&&jsx("span",{style:va,children:b.shortcut}),f&&jsx("span",{style:{marginLeft:"auto"},children:jsx(x,{name:"keyboard_arrow_right",size:16})})]}),f&&y&&jsx("div",{style:ga,onMouseDown:C=>C.preventDefault(),children:b.submenuContent(a)})]},b.label)})})]})}var Bt=18,xa=2,Jo={width:Bt,height:Bt,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:2,transition:"background-color 0.1s, border-color 0.1s",cursor:"pointer"},Ca={...Jo,backgroundColor:"var(--doc-primary, #3b82f6)",border:"1px solid var(--doc-primary, #3b82f6)"},ya={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,r]=useState(0),[l,u]=useState(0),m=useCallback(()=>{n>0&&l>0&&e(n,l);},[n,l,e]),s=[];for(let d=1;d<=t;d++)for(let a=1;a<=o;a++){let h=d<=n&&a<=l;s.push(jsx("div",{style:h?Ca:Jo,onMouseEnter:()=>{r(d),u(a);},onClick:m,role:"gridcell","aria-selected":h},`${d}-${a}`));}let c=n>0&&l>0?`${l} \xD7 ${n}`:"Select size";return jsxs("div",{children:[jsx("div",{style:{display:"grid",gap:xa,gridTemplateColumns:`repeat(${o}, ${Bt}px)`},onMouseLeave:()=>{r(0),u(0);},role:"grid","aria-label":"Table size selector",children:s}),jsx("div",{style:ya,children:c})]})}var Sa={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 Ws(e){let t=e.replace(/^#/,"").toUpperCase();return Sa[t]||null}function te({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:l,ariaLabel:u}){let m=u?.toLowerCase().replace(/\s+/g,"-")||o?.toLowerCase().replace(/\s+/g,"-").replace(/\([^)]*\)/g,"").trim(),s=d=>{d.preventDefault();},c=jsx($,{variant:"ghost",size:"icon-sm",className:k("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",l),onMouseDown:s,onClick:t?void 0:n,disabled:t,"aria-pressed":e,"aria-label":u||o,"data-testid":m?`toolbar-${m}`:void 0,children:r});return o?jsx(ee,{content:o,children:c}):c}function re({label:e,children:t,className:o}){return jsx("div",{className:k("flex items-center gap-px px-1.5 border-r border-slate-200/50 last:border-r-0 first:pl-0",o),role:"group","aria-label":e,children:t})}function Qs(){return jsx("div",{className:"w-px h-6 bg-slate-200 mx-1.5",role:"separator"})}function ec({children:e,className:t,style:o,disabled:n=false,onFormat:r,onPrint:l,showPrintButton:u=true,onPageSetup:m,onInsertImage:s,onInsertTable:c,showTableInsert:d=true,onInsertPageBreak:a,onInsertTOC:h,onRefocusEditor:p,...g}){let b=useRef(null),f=useCallback(M=>{!n&&r&&r(M);},[n,r]),y=useCallback((M,R)=>{!n&&c&&(c(M,R),requestAnimationFrame(()=>p?.()));},[n,c,p]),C=useCallback(M=>{let R=M.target;R.tagName==="INPUT"||R.tagName==="TEXTAREA"||R.tagName==="SELECT"||R.tagName==="OPTION"||M.preventDefault();},[]),S=useCallback(M=>{let R=M.target,z=document.activeElement;R.tagName==="SELECT"||R.tagName==="OPTION"||z?.tagName==="SELECT"||requestAnimationFrame(()=>{p?.();});},[p]);return jsxs("div",{ref:b,className:k("flex items-center px-1 py-1 bg-white border-b border-slate-100 min-h-[36px] overflow-x-auto",t),style:o,role:"toolbar","aria-label":"Formatting toolbar","data-testid":"toolbar",onMouseDown:C,onMouseUp:S,children:[u&&l||m?jsx(vt,{label:"File",disabled:n,items:[...u&&l?[{icon:"print",label:"Print",shortcut:"Ctrl+P",onClick:l}]:[],...m?[{icon:"settings",label:"Page setup",onClick:m}]:[]]}):null,jsx(vt,{label:"Format",disabled:n,items:[{icon:"format_textdirection_l_to_r",label:"Left-to-right text",onClick:()=>f("setLtr")},{icon:"format_textdirection_r_to_l",label:"Right-to-left text",onClick:()=>f("setRtl")}]}),jsx(vt,{label:"Insert",disabled:n,items:[...s?[{icon:"image",label:"Image",onClick:s}]:[],...d&&c?[{icon:"grid_on",label:"Table",submenuContent:M=>jsx(Qo,{onInsert:(R,z)=>{y(R,z),M();}})}]:[],...s||d&&c?[{type:"separator"}]:[],{icon:"page_break",label:"Page break",onClick:a,disabled:!a},{icon:"format_list_numbered",label:"Table of contents",onClick:h,disabled:!h}]}),jsx(en,{...g,disabled:n,onFormat:r,onRefocusEditor:p,onInsertTable:c,showTableInsert:d,onInsertImage:s,onInsertPageBreak:a,onInsertTOC:h,onPrint:l,showPrintButton:u,onPageSetup:m,inline:true,children:e})]})}var Ot=createContext(null);function rc(){let e=useContext(Ot);if(!e)throw new Error("useEditorToolbar must be used within an <EditorToolbar> component");return e}var ie=18;function La(e){let t=J__default.useContext(Ot);return t?{...t,...Ha(e)}:e}function Ha(e){let t={};for(let o of Object.keys(e))e[o]!==void 0&&(t[o]=e[o]);return t}function en(e){let t=La(e),{currentFormatting:o={},onFormat:n,onUndo:r,onRedo:l,canUndo:u=false,canRedo:m=false,disabled:s=false,className:c,style:d,enableShortcuts:a$1=true,editorRef:h,children:p,showFontPicker:g=true,showFontSizePicker:b=true,showTextColorPicker:f=true,showHighlightColorPicker:y=true,showAlignmentButtons:C=true,showListButtons:S=true,showLineSpacingPicker:M=true,showStylePicker:R=true,documentStyles:z,theme:F,showZoomControl:Te=true,zoom:le,onZoomChange:fe,onRefocusEditor:Z,imageContext:Y,onImageWrapType:w,onImageTransform:D,onOpenImageProperties:P,tableContext:X,onTableAction:Pe,inline:se=false}=t,et=useRef(null),B=useCallback(H=>{!s&&n&&n(H);},[s,n]),It=useCallback(()=>{!s&&u&&r&&r();},[s,u,r]),Mt=useCallback(()=>{!s&&m&&l&&l();},[s,m,l]),Pt=useCallback(H=>{!s&&n&&(n({type:"fontFamily",value:H}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),kt=useCallback(H=>{!s&&n&&(n({type:"fontSize",value:H}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),ke=useCallback(H=>{!s&&n&&(n({type:"textColor",value:H}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),Ue=useCallback(H=>{!s&&n&&(n({type:"highlightColor",value:typeof H=="string"?H:""}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),ce=useCallback(H=>{!s&&n&&n({type:"alignment",value:H});},[s,n]),Rt=useCallback(()=>{!s&&n&&n("bulletList");},[s,n]),_=useCallback(()=>{!s&&n&&n("numberedList");},[s,n]),Re=useCallback(()=>{!s&&n&&n("indent");},[s,n]),tt=useCallback(()=>{!s&&n&&n("outdent");},[s,n]),Ze=useCallback(H=>{!s&&n&&(n({type:"lineSpacing",value:H}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),ue=useCallback(H=>{!s&&n&&(n({type:"applyStyle",value:H}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),W=useCallback(H=>{!s&&Pe&&(Pe(H),requestAnimationFrame(()=>Z?.()));},[s,Pe,Z]);useEffect(()=>{if(!a$1)return;let H=q=>{let Ge=q.target,Jt=h?.current,mn=et.current,hn=Jt?.contains(Ge),fn=mn?.contains(Ge);if(!hn&&!fn)return;if((q.ctrlKey||q.metaKey)&&!q.altKey)switch(q.key.toLowerCase()){case "b":q.preventDefault(),B("bold");break;case "i":q.preventDefault(),B("italic");break;case "u":q.preventDefault(),B("underline");break;case "=":q.shiftKey?(q.preventDefault(),B("superscript")):(q.preventDefault(),B("subscript"));break;case "l":q.preventDefault(),ce("left");break;case "e":q.preventDefault(),ce("center");break;case "r":q.preventDefault(),ce("right");break;case "j":q.preventDefault(),ce("both");break;case "k":q.preventDefault(),B("insertLink");break}};return document.addEventListener("keydown",H),()=>{document.removeEventListener("keydown",H);}},[a$1,B,ce,h]);let oe=useCallback(H=>{let q=H.target;q.tagName==="INPUT"||q.tagName==="TEXTAREA"||q.tagName==="SELECT"||q.tagName==="OPTION"||H.preventDefault();},[]),Le=useCallback(H=>{let q=H.target,Ge=document.activeElement;q.tagName==="SELECT"||q.tagName==="OPTION"||Ge?.tagName==="SELECT"||requestAnimationFrame(()=>{Z?.();});},[Z]);return jsxs("div",{ref:et,className:k(!se&&"flex items-center px-2 py-1 bg-[#f1f5f9] rounded-full min-h-[36px] overflow-x-auto mx-2 mb-1",c),style:se?{display:"contents",...d}:d,role:se?void 0:"toolbar","aria-label":se?void 0:"Formatting toolbar","data-testid":se?void 0:"formatting-bar",onMouseDown:se?void 0:oe,onMouseUp:se?void 0:Le,children:[jsxs(re,{label:"History",children:[jsx(te,{onClick:It,disabled:s||!u,title:"Undo (Ctrl+Z)",ariaLabel:"Undo",children:jsx(x,{name:"undo",size:ie})}),jsx(te,{onClick:Mt,disabled:s||!m,title:"Redo (Ctrl+Y)",ariaLabel:"Redo",children:jsx(x,{name:"redo",size:ie})})]}),Te&&jsx(re,{label:"Zoom",children:jsx(Lo,{value:le,onChange:fe,minZoom:.5,maxZoom:2,disabled:s,compact:true,showButtons:false})}),R&&jsx(re,{label:"Styles",children:jsx(Zo,{value:o.styleId||"Normal",onChange:ue,styles:z,theme:F,disabled:s,width:120})}),(g||b)&&jsxs(re,{label:"Font",children:[g&&jsx(no,{value:o.fontFamily||"Arial",onChange:Pt,disabled:s,width:60,placeholder:"Arial"}),b&&jsx(ho,{value:o.fontSize!==void 0?mo(o.fontSize):11,onChange:kt,disabled:s,width:42,placeholder:"11"})]}),jsxs(re,{label:"Text formatting",children:[jsx(te,{onClick:()=>B("bold"),active:o.bold,disabled:s,title:"Bold (Ctrl+B)",ariaLabel:"Bold",children:jsx(x,{name:"format_bold",size:ie})}),jsx(te,{onClick:()=>B("italic"),active:o.italic,disabled:s,title:"Italic (Ctrl+I)",ariaLabel:"Italic",children:jsx(x,{name:"format_italic",size:ie})}),jsx(te,{onClick:()=>B("underline"),active:o.underline,disabled:s,title:"Underline (Ctrl+U)",ariaLabel:"Underline",children:jsx(x,{name:"format_underlined",size:ie})}),jsx(te,{onClick:()=>B("strikethrough"),active:o.strike,disabled:s,title:"Strikethrough",ariaLabel:"Strikethrough",children:jsx(x,{name:"strikethrough_s",size:ie})}),f&&jsx(Ee,{mode:"text",value:o.color?.replace(/^#/,""),onChange:ke,theme:F,disabled:s,title:"Font Color"}),y&&jsx(Ee,{mode:"highlight",value:o.highlight,onChange:Ue,theme:F,disabled:s,title:"Text Highlight Color"}),jsx(te,{onClick:()=>B("insertLink"),disabled:s,title:"Insert link (Ctrl+K)",ariaLabel:"Insert link",children:jsx(x,{name:"link",size:ie})})]}),jsxs(re,{label:"Script",children:[jsx(te,{onClick:()=>B("superscript"),active:o.superscript,disabled:s,title:"Superscript (Ctrl+Shift+=)",ariaLabel:"Superscript",children:jsx(x,{name:"superscript",size:ie})}),jsx(te,{onClick:()=>B("subscript"),active:o.subscript,disabled:s,title:"Subscript (Ctrl+=)",ariaLabel:"Subscript",children:jsx(x,{name:"subscript",size:ie})})]}),C&&jsx(re,{label:"Alignment",children:jsx(So,{value:o.alignment||"left",onChange:ce,disabled:s})}),(S||M)&&jsxs(re,{label:"List formatting",children:[S&&jsx(Io,{listState:o.listState||Mo(),onBulletList:Rt,onNumberedList:_,onIndent:Re,onOutdent:tt,disabled:s,showIndentButtons:true,compact:true,hasIndent:(o.indentLeft??0)>0}),M&&jsx(ko,{value:o.lineSpacing,onChange:Ze,disabled:s})]}),Y&&w&&jsxs(re,{label:"Image",children:[jsx($o,{imageContext:Y,onChange:w,disabled:s}),D&&jsx(Uo,{onTransform:D,disabled:s}),P&&jsx(te,{onClick:P,disabled:s,title:"Image properties (alt text, border)...",ariaLabel:"Image properties",children:jsx(x,{name:"tune",size:ie})})]}),X?.isInTable&&Pe&&jsxs(re,{label:"Table",children:[jsx(qo,{onAction:W,disabled:s}),jsx(_o,{onAction:W,disabled:s,theme:F,value:X?.cellBorderColor?a(X.cellBorderColor,F).replace(/^#/,""):void 0}),jsx(Do,{onAction:W,disabled:s}),jsx(No,{onAction:W,disabled:s,theme:F,value:X?.cellBackgroundColor}),jsx(zo,{onAction:W,disabled:s,tableContext:X})]}),jsx(te,{onClick:()=>B("clearFormatting"),disabled:s,title:"Clear formatting",ariaLabel:"Clear formatting",children:jsx(x,{name:"format_clear",size:ie})}),p]})}var on=12240,xt=1440,Ct=1440,yt=567,Wt=22,_a="var(--doc-text-muted)",Aa="var(--doc-text-subtle)",tn="rgba(0, 0, 0, 0.02)",Da="#4285f4",Na="#3367d6",Fa="#2a56c6",Ae=5;function Ba(e,t){return t==="inch"?(e/Ct).toFixed(2)+'"':(e/yt).toFixed(1)+" cm"}function Hc({sectionProps:e,zoom:t=1,editable:o=false,onLeftMarginChange:n,onRightMarginChange:r,onFirstLineIndentChange:l,showFirstLineIndent:u=false,firstLineIndent:m=0,hangingIndent:s=false,indentLeft:c=0,indentRight:d=0,onIndentLeftChange:a,onIndentRightChange:h,unit:p="inch",className:g="",style:b$1,tabStops:f,onTabStopRemove:y}){let[C,S]=useState(null),[M,R]=useState(null),[z,F]=useState(null),[Te,le]=useState(null),fe=useRef(null),Z=e?.pageWidth??on,Y=e?.marginLeft??xt,w=e?.marginRight??xt,D=Z-Y-w,P=a$1(Z)*t,X=a$1(Y)*t,Pe=a$1(w)*t,se=a$1(c)*t,et=a$1(d)*t,B=s?-m:m,It=a$1(B)*t,Mt=X+se,Pt=P-Pe-et,kt=X+se+It,ke=useCallback((_,Re)=>{o&&(_.preventDefault(),_.stopPropagation(),S(Re));},[o]),Ue=useCallback(_=>{if(!C||!fe.current)return;let Re=fe.current.getBoundingClientRect(),tt=_.clientX-Re.left;le(tt);let Ze=b(tt/t);if(C==="leftMargin"){let ue=Z-w-720,W=Math.round(Math.max(0,Math.min(Ze,ue)));F(W),n?.(W);}else if(C==="rightMargin"){let ue=Z-Ze,W=Z-Y-720,oe=Math.round(Math.max(0,Math.min(ue,W)));F(oe),r?.(oe);}else if(C==="firstLineIndent"){let ue=Y+c,W=Ze-ue,oe=D-c-d-720,Le=Math.round(Math.max(-c,Math.min(W,oe)));F(Le),l?.(Le);}else if(C==="leftIndent"){let ue=Ze-Y,W=D-d-720,oe=Math.round(Math.max(0,Math.min(ue,W)));F(oe),a?.(oe);}else if(C==="rightIndent"){let W=Z-w-Ze,oe=D-c-720,Le=Math.round(Math.max(0,Math.min(W,oe)));F(Le),h?.(Le);}},[C,t,Z,Y,w,D,c,d,n,r,l,a,h]),ce=useCallback(()=>{S(null),F(null),le(null);},[]);useEffect(()=>{if(C)return document.addEventListener("mousemove",Ue),document.addEventListener("mouseup",ce),()=>{document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",ce);}},[C,Ue,ce]);let Rt=$a(Z,t,p);return jsxs("div",{ref:fe,className:`docx-horizontal-ruler ${g}`,style:{position:"relative",width:k$1(P),height:Wt,backgroundColor:"transparent",overflow:"visible",userSelect:"none",cursor:C?"ew-resize":"default",...b$1},role:"slider","aria-label":"Horizontal ruler","aria-valuemin":0,"aria-valuemax":Z,children:[jsx("div",{style:{position:"absolute",top:0,left:0,width:k$1(X),height:Wt,backgroundColor:tn,borderRight:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&n?_=>ke(_,"leftMargin"):void 0}),jsx("div",{style:{position:"absolute",top:0,right:0,width:k$1(Pe),height:Wt,backgroundColor:tn,borderLeft:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&r?_=>ke(_,"rightMargin"):void 0}),jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:Rt.map((_,Re)=>jsx(Oa,{tick:_},Re))}),u&&jsx(Vt,{direction:"down",positionPx:kt,editable:o,isDragging:C==="firstLineIndent",isHovered:M==="firstLineIndent",onMouseEnter:()=>R("firstLineIndent"),onMouseLeave:()=>R(null),onMouseDown:_=>ke(_,"firstLineIndent"),label:"First line indent"}),o&&a&&jsx(Vt,{direction:"up",positionPx:Mt,editable:o,isDragging:C==="leftIndent",isHovered:M==="leftIndent",onMouseEnter:()=>R("leftIndent"),onMouseLeave:()=>R(null),onMouseDown:_=>ke(_,"leftIndent"),label:"Left indent"}),o&&h&&jsx(Vt,{direction:"down",positionPx:Pt,editable:o,isDragging:C==="rightIndent",isHovered:M==="rightIndent",onMouseEnter:()=>R("rightIndent"),onMouseLeave:()=>R(null),onMouseDown:_=>ke(_,"rightIndent"),label:"Right indent"}),f?.map(_=>jsx(Va,{tabStop:_,positionPx:a$1(_.position)*t,onDoubleClick:()=>y?.(_.position)},_.position)),C&&z!==null&&Te!==null&&jsx(za,{value:Ba(z,p),positionPx:Te})]})}function Oa({tick:e}){return jsxs(Fragment,{children:[jsx("div",{style:{position:"absolute",left:k$1(e.position),bottom:0,width:1,height:e.height,backgroundColor:Aa}}),e.label&&jsx("div",{style:{position:"absolute",left:k$1(e.position),top:3,transform:"translateX(-50%)",fontSize:"9px",color:_a,fontFamily:"sans-serif",whiteSpace:"nowrap"},children:e.label})]})}function Vt({direction:e,positionPx:t,editable:o,isDragging:n,isHovered:r,onMouseEnter:l,onMouseLeave:u,onMouseDown:m,label:s}){let c=n?Fa:r?Na:Da,d=Math.round(Ae*1.6),a={position:"absolute",left:k$1(t-Ae),width:Ae*2,height:d+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:`${Ae}px solid transparent`,borderRight:`${Ae}px solid transparent`,borderTop:`${d}px solid ${c}`,transition:"border-top-color 0.1s"}:{position:"absolute",bottom:1,left:0,width:0,height:0,borderLeft:`${Ae}px solid transparent`,borderRight:`${Ae}px solid transparent`,borderBottom:`${d}px solid ${c}`,transition:"border-bottom-color 0.1s"};return jsx("div",{className:"docx-ruler-indent",style:a,onMouseEnter:l,onMouseLeave:u,onMouseDown:m,role:"slider","aria-label":s,"aria-orientation":"horizontal",tabIndex:o?0:-1,children:jsx("div",{style:h})})}function za({value:e,positionPx:t}){return jsx("div",{style:{position:"absolute",left:k$1(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 Wa={left:"L",center:"C",right:"R",decimal:"D",bar:"|"};function Va({tabStop:e,positionPx:t,onDoubleClick:o}){return jsx("div",{style:{position:"absolute",left:k$1(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:Wa[e.alignment]||"L"})}function $a(e,t,o){let n=[];if(o==="inch"){let r=Ct/8,l=Math.ceil(e/r);for(let u=0;u<=l;u++){let m=u*r;if(m>e)break;let s=a$1(m)*t;u%8===0?n.push({position:s,height:10,label:u/8>0?String(u/8):void 0}):u%4===0?n.push({position:s,height:6}):u%2===0?n.push({position:s,height:4}):n.push({position:s,height:2});}}else {let r=yt/10,l=Math.ceil(e/r);for(let u=0;u<=l;u++){let m=u*r;if(m>e)break;let s=a$1(m)*t;u%10===0?n.push({position:s,height:10,label:u/10>0?String(u/10):void 0}):u%5===0?n.push({position:s,height:6}):n.push({position:s,height:3});}}return n}function Ec(e,t,o,n){let r=b(e/n);return t==="left"?Math.max(0,r):Math.max(0,b(o/n)-r)}function qc(e,t=1){let o=e?.pageWidth??on,n=e?.marginLeft??xt,r=e?.marginRight??xt,l=a$1(o)*t,u=a$1(n)*t,m=a$1(r)*t;return {width:l,leftMargin:u,rightMargin:m,contentWidth:l-u-m}}function _c(e,t){return t==="inch"?(e/Ct).toFixed(2)+'"':(e/yt).toFixed(1)+" cm"}function Ac(e,t){let o=parseFloat(e.replace(/[^\d.]/g,""));return isNaN(o)?null:Math.round(o*(t==="inch"?Ct:yt))}var Fc="application/x-docx-editor",K={HTML:"text/html",PLAIN:"text/plain"};function Bc(e){if(!e)return [];let t=()=>{if(!e.items||e.items.length===0)return [];let c=[];for(let d of Array.from(e.items)){if(d.kind!=="file"||!d.type.startsWith("image/"))continue;let a=d.getAsFile();a&&c.push(a);}return c},o=()=>!e.files||e.files.length===0?[]:Array.from(e.files).filter(c=>c.type.startsWith("image/")),n=t(),r=n.length?n:o();if(r.length<=1)return r;let l=["image/png","image/jpeg","image/webp","image/gif","image/svg+xml","image/bmp","image/tiff"],u=c=>{let d=c[0],a=l.indexOf(d.type);a<0&&(a=Number.MAX_SAFE_INTEGER);for(let h of c.slice(1)){let p=l.indexOf(h.type);if(p<0&&(p=Number.MAX_SAFE_INTEGER),p<a){d=h,a=p;continue}p===a&&h.size>d.size&&(d=h);}return d},m=new Map;for(let c of r){let d=c.name?.trim()??"",h=(d?d.replace(/\.[^/.]+$/,"").toLowerCase():"")||`size:${c.size}`,p=m.get(h);p?p.push(c):m.set(h,[c]);}let s=[];for(let c of m.values())s.push(u(c));return s}async function rn(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=$t(e,o);return await Tt(r)}catch(r){return n?.(r),false}}async function Oc(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=Ga(e,o);return await Tt(r)}catch(r){return n?.(r),false}}function $t(e,t=true){let o=e.map(Kt).join(""),n=t?un(e):Yt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}function Ga(e,t=true){let o=e.map(tl).join(`
|
|
2
|
+
`),n=t?ol(e):Yt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}async function Tt(e){try{if(navigator.clipboard&&navigator.clipboard.write){let t=[new ClipboardItem({[K.PLAIN]:new Blob([e.plainText],{type:K.PLAIN}),[K.HTML]:new Blob([e.html],{type:K.HTML})})];return await navigator.clipboard.write(t),!0}return an(e)}catch{return an(e)}}function an(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 r=document.execCommand("copy");return o.removeAllRanges(),r}finally{document.body.removeChild(t);}}async function zc(e={}){let{cleanWordFormatting:t=true,onError:o}=e;try{if(navigator.clipboard&&navigator.clipboard.read){let n=await navigator.clipboard.read();return await Ka(n,t)}return null}catch(n){return o?.(n),null}}async function Ka(e,t){let o="",n="";for(let r of e)r.types.includes(K.HTML)&&(o=await(await r.getType(K.HTML)).text()),r.types.includes(K.PLAIN)&&(n=await(await r.getType(K.PLAIN)).text());return cn(o,n,t)}function Ya(e,t={}){let{cleanWordFormatting:o=true}=t,n=e.clipboardData;if(!n)return null;let r=n.getData(K.HTML),l=n.getData(K.PLAIN);return cn(r,l,o)}function cn(e,t,o=true){let n=Xa(e),r=ja(e);if(r){let m=e.match(/data-docx-editor-content="([^"]+)"/);if(m)try{return {runs:JSON.parse(decodeURIComponent(m[1])),fromWord:!1,fromEditor:!0,plainText:t}}catch{}}let l=e;return n&&o&&(l=Ja(e)),{runs:Qa(l,t),fromWord:n,fromEditor:r,plainText:t}}function Xa(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 ja(e){return e.includes("data-docx-editor")||e.includes("docx-run")||e.includes("docx-paragraph")}function Ja(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 Qa(e,t){if(!e||e.trim()==="")return t?[Gt(t)]:[];let o=document.createElement("div");o.innerHTML=e;let n=[];return Ut(o,n,{}),n.length===0&&t?[Gt(t)]:n}function Ut(e,t,o){if(e.nodeType===Node.TEXT_NODE){let u=e.textContent||"";(u.trim()||u.includes(" "))&&t.push(Gt(u,o));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e,r=n.tagName.toLowerCase(),l={...o,...el(n)};switch(r){case "br":t.push(sn(l));return;case "p":case "div":for(let u of n.childNodes)Ut(u,t,l);n.nextSibling&&t.push(sn(l));return;case "b":case "strong":l.bold=true;break;case "i":case "em":l.italic=true;break;case "u":l.underline={style:"single"};break;case "s":case "strike":case "del":l.strike=true;break;case "sup":l.vertAlign="superscript";break;case "sub":l.vertAlign="subscript";break;case "code":case "pre":l.fontFamily={ascii:"Courier New"};break}for(let u of n.childNodes)Ut(u,t,l);}function el(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 r=parseFloat(o.fontSize);isNaN(r)||(t.fontSize=Math.round(r/1.333*2));}if(o.fontFamily){let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(t.fontFamily={ascii:r});}if(o.color){let r=ln(o.color);r&&(t.color={rgb:r});}if(o.backgroundColor&&o.backgroundColor!=="transparent"){let r=ln(o.backgroundColor);r&&(t.shading={fill:{rgb:r}});}return t}function ln(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"),r=parseInt(t[3]).toString(16).padStart(2,"0");return (o+n+r).toUpperCase()}return null}function Kt(e){return e.content.map(t=>t.type==="text"?t.text:t.type==="tab"?" ":t.type==="break"&&t.breakType==="textWrapping"?`
|
|
3
|
+
`:"").join("")}function tl(e){return (e.content||[]).map(t=>t.type==="run"?Kt(t):"").join("")}function un(e){return e.map(nl).join("")}function ol(e){return e.map(t=>`<p>${un(t.content?.filter(o=>o.type==="run")||[])}</p>`).join("")}function nl(e){let t=Kt(e);if(!t)return "";let o=Yt(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 r=[];if(n.fontSize){let l=n.fontSize/2;r.push(`font-size: ${l}pt`);}return n.fontFamily?.ascii&&r.push(`font-family: "${n.fontFamily.ascii}"`),n.color?.rgb&&r.push(`color: #${n.color.rgb}`),n.shading?.fill?.rgb&&r.push(`background-color: #${n.shading.fill.rgb}`),r.length>0&&(o=`<span style="${r.join("; ")}">${o}</span>`),o}function Yt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Gt(e,t){return {type:"run",formatting:t,content:[{type:"text",text:e}]}}function sn(e){return {type:"run",formatting:e,content:[{type:"break",breakType:"textWrapping"}]}}function Wc(e){let{onCopy:t,onCut:o,onPaste:n,clipboardOptions:r={}}=e;return {handleCopy:async c=>{if(!t)return;let d=t();if(!d)return;c.preventDefault();let a=$t(d.runs);c.clipboardData?(c.clipboardData.setData(K.PLAIN,a.plainText),c.clipboardData.setData(K.HTML,a.html)):await Tt(a);},handleCut:async c=>{if(!o)return;let d=o();if(!d)return;c.preventDefault();let a=$t(d.runs);c.clipboardData?(c.clipboardData.setData(K.PLAIN,a.plainText),c.clipboardData.setData(K.HTML,a.html)):await Tt(a);},handlePaste:c=>{if(!n)return;c.preventDefault();let d=Ya(c,r);d&&n(d);},handleKeyDown:async c=>{let d=c.ctrlKey||c.metaKey;if(d&&c.key==="c"&&!c.shiftKey&&t){let a=t();a&&await rn(a.runs,r);}if(d&&c.key==="x"&&!c.shiftKey&&o){let a=o();a&&await rn(a.runs,r);}}}}var dn=[{action:"cut",label:"Cut",shortcut:"Ctrl+X"},{action:"copy",label:"Copy",shortcut:"Ctrl+C"},{action:"paste",label:"Paste",shortcut:"Ctrl+V"},{action:"pasteAsPlainText",label:"Paste as Plain Text",shortcut:"Ctrl+Shift+V",dividerAfter:true},{action:"delete",label:"Delete",shortcut:"Del",dividerAfter:true},{action:"selectAll",label:"Select All",shortcut:"Ctrl+A"}],il=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"4",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsx("circle",{cx:"12",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M5.5 10.5L10.5 3M10.5 10.5L5.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),al=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"5",y:"5",width:"8",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M11 5V3a1 1 0 00-1-1H4a1 1 0 00-1 1v8a1 1 0 001 1h2",stroke:"currentColor",strokeWidth:"1.5"})]}),ll=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"3",y:"3",width:"10",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 3V2a1 1 0 011-1h2a1 1 0 011 1v1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 8h4M6 11h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),sl=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),cl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2 2"}),jsx("rect",{x:"4",y:"4",width:"8",height:"8",fill:"currentColor",opacity:"0.3"})]}),ul=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"10",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 1v3M6.5 2.5h3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),dl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 12v3M6.5 13.5h3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),pl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.3"}),jsx("rect",{x:"2",y:"10",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M5 8h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),ml=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"10",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M3 8H0.5M1.75 6.5v3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),hl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M13 8h2.5M14.25 6.5v3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),fl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.3"}),jsx("rect",{x:"10",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),vl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M3 3h10a1 1 0 011 1v6a1 1 0 01-1 1H6l-3 2.5V11H3a1 1 0 01-1-1V4a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.3"}),jsx("path",{d:"M5 6h6M5 8.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});function gl(e){switch(e){case "cut":return jsx(il,{});case "copy":return jsx(al,{});case "paste":case "pasteAsPlainText":return jsx(ll,{});case "delete":return jsx(sl,{});case "selectAll":return jsx(cl,{});case "addRowAbove":return jsx(ul,{});case "addRowBelow":return jsx(dl,{});case "deleteRow":return jsx(pl,{});case "addColumnLeft":return jsx(ml,{});case "addColumnRight":return jsx(hl,{});case "deleteColumn":return jsx(fl,{});case "addComment":return jsx(vl,{});default:return null}}var bl=({item:e,onClick:t,isHighlighted:o,onMouseEnter:n})=>e.action==="separator"?jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}}):jsxs(Fragment,{children:[jsxs("button",{type:"button",className:`docx-text-context-menu-item ${o?"docx-text-context-menu-item-highlighted":""} ${e.disabled?"docx-text-context-menu-item-disabled":""}`,onClick:t,onMouseEnter:n,disabled:e.disabled,role:"menuitem","aria-disabled":e.disabled,style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"8px 12px",border:"none",background:o&&!e.disabled?"var(--doc-primary-light)":"transparent",cursor:e.disabled?"not-allowed":"pointer",fontSize:"13px",color:e.disabled?"var(--doc-text-subtle)":"var(--doc-text)",textAlign:"left",opacity:e.disabled?.6:1},children:[jsx("span",{style:{display:"flex",color:e.disabled?"var(--doc-border)":"var(--doc-text-muted)"},children:gl(e.action)}),jsx("span",{style:{flex:1},children:e.label}),e.shortcut&&jsx("span",{style:{fontSize:"11px",color:"var(--doc-text-subtle)",fontFamily:"monospace"},children:e.shortcut})]}),e.dividerAfter&&jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}})]}),Gc=({isOpen:e,position:t,hasSelection:o,isEditable:n,hasClipboardContent:r=true,onAction:l,onClose:u,items:m,className:s=""})=>{let c=useRef(null),[d,a]=useState(0),h=(m||dn).map(f=>{let y=(()=>{if(f.disabled!==void 0)return f.disabled;switch(f.action){case "cut":case "copy":case "delete":return !o;case "paste":case "pasteAsPlainText":return !n||!r;default:return false}})();return {...f,disabled:y}}),p=h.filter(f=>f.action!=="separator");useEffect(()=>{if(!e)return;let f=C=>{c.current&&!c.current.contains(C.target)&&u();},y=setTimeout(()=>{document.addEventListener("mousedown",f);},0);return ()=>{clearTimeout(y),document.removeEventListener("mousedown",f);}},[e,u]),useEffect(()=>{if(!e)return;let f=y=>{switch(y.key){case "Escape":y.preventDefault(),u();break;case "ArrowDown":y.preventDefault(),a(S=>{let M=(S+1)%p.length;for(;p[M]?.disabled&&M!==S;)M=(M+1)%p.length;return M});break;case "ArrowUp":y.preventDefault(),a(S=>{let M=(S-1+p.length)%p.length;for(;p[M]?.disabled&&M!==S;)M=(M-1+p.length)%p.length;return M});break;case "Enter":y.preventDefault();let C=p[d];C&&!C.disabled&&(l(C.action),u());break}};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,d,p,l,u]),useEffect(()=>{e&&a(0);},[e]);let g=useCallback(()=>{let y=h.length*36+16,C=t.x,S=t.y;return typeof window<"u"&&(C+220>window.innerWidth&&(C=window.innerWidth-220-10),S+y>window.innerHeight&&(S=window.innerHeight-y-10),C<10&&(C=10),S<10&&(S=10)),{position:"fixed",top:S,left:C,minWidth:220,background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",zIndex:1e4,padding:"4px 0",overflow:"hidden"}},[t,h.length]),b=f=>{f.disabled||(l(f.action),u());};return e?jsx("div",{ref:c,className:`docx-text-context-menu ${s}`,style:g(),role:"menu","aria-label":"Text editing menu",children:h.map((f,y)=>{let C=p.findIndex(S=>S===f);return jsx(bl,{item:f,onClick:()=>b(f),isHighlighted:C===d,onMouseEnter:()=>{C>=0&&!f.disabled&&a(C);}},`${f.action}-${y}`)})}):null};function Kc(e={}){let{enabled:t=true,isEditable:o=true,containerRef:n,onAction:r}=e,[l,u]=useState(false),[m,s]=useState({x:0,y:0}),[c,d]=useState(false),a=useCallback(()=>{let f=window.getSelection(),y=f&&!f.isCollapsed&&f.toString().length>0;return d(!!y),!!y},[]),h=useCallback(f=>{t&&(f.preventDefault(),f.stopPropagation(),a(),s({x:f.clientX,y:f.clientY}),u(true));},[t,a]),p=useCallback(()=>{u(false);},[]),g=useCallback(f=>{switch(p(),f){case "cut":document.execCommand("cut");break;case "copy":document.execCommand("copy");break;case "paste":document.execCommand("paste");break;case "pasteAsPlainText":navigator.clipboard.readText?.().then(y=>{document.execCommand("insertText",false,y);}).catch(()=>{document.execCommand("paste");});break;case "delete":document.execCommand("delete");break;case "selectAll":document.execCommand("selectAll");break}r?.(f);},[p,r]),b=useCallback(f=>{h(f);},[h]);return useEffect(()=>{if(!l)return;let f=y=>{y.key==="Escape"&&p();};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[l,p]),{isOpen:l,position:m,hasSelection:c,openMenu:h,closeMenu:p,handleAction:g,onContextMenu:b}}function Yc(e){return {cut:"Cut",copy:"Copy",paste:"Paste",pasteAsPlainText:"Paste as Plain Text",selectAll:"Select All",delete:"Delete",separator:"",addRowAbove:"Insert row above",addRowBelow:"Insert row below",deleteRow:"Delete row",addColumnLeft:"Insert column left",addColumnRight:"Insert column right",deleteColumn:"Delete column",addComment:"Comment"}[e]}function Xc(e){return {cut:"Ctrl+X",copy:"Ctrl+C",paste:"Ctrl+V",pasteAsPlainText:"Ctrl+Shift+V",selectAll:"Ctrl+A",delete:"Del",separator:"",addRowAbove:"",addRowBelow:"",deleteRow:"",addColumnLeft:"",addColumnRight:"",deleteColumn:"",addComment:""}[e]}function jc(){return [...dn]}function Jc(e,t,o){switch(e){case "cut":case "copy":case "delete":return t;case "paste":case "pasteAsPlainText":return o;case "addComment":return t;case "selectAll":return true;default:return true}}var ye=16;function yl(){return jsx(x,{name:"table_rows",size:ye,style:{transform:"scaleY(-1)"}})}function Tl(){return jsx(x,{name:"table_rows",size:ye})}function Sl(){return jsx(x,{name:"view_column",size:ye,style:{transform:"scaleX(-1)"}})}function wl(){return jsx(x,{name:"view_column",size:ye})}function Il(){return jsx(x,{name:"delete_sweep",size:ye})}function Ml(){return jsx(x,{name:"delete_sweep",size:ye,style:{transform:"rotate(90deg)"}})}function Pl(){return jsx(x,{name:"call_merge",size:ye})}function kl(){return jsx(x,{name:"call_split",size:ye})}function Rl(){return jsx(x,{name:"delete",size:ye,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 Ce({action:e,label:t,icon:o,disabled:n=false,onClick:r,showLabel:l=false,compact:u=false,shortcut:m}){let[s,c]=J__default.useState(false),d=typeof e=="string"&&e.startsWith("delete"),a={...ae.button,...u?ae.buttonCompact:{},...s&&!n?ae.buttonHover:{},...n?ae.buttonDisabled:{},...d&&!n?ae.buttonDelete:{}},h=m?`${t} (${m})`:t;return jsxs("button",{type:"button",className:`docx-table-toolbar-button docx-table-toolbar-${typeof e=="string"?e:e.type}`,style:a,disabled:n,onClick:r,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),title:h,"aria-label":t,children:[o,l&&jsx("span",{children:t})]})}function Xt({children:e,showSeparator:t=true}){return jsxs(Fragment,{children:[jsx("div",{style:ae.group,children:e}),t&&jsx("div",{style:ae.separator})]})}function nu({context:e,onAction:t,disabled:o=false,className:n,style:r,showLabels:l=false,compact:u=false,position:m="top",children:s}){if(!e)return null;let c=f=>{!o&&t&&e&&t(f,e);},d=e.rowCount>1,a=e.columnCount>1,h=e.hasMultiCellSelection,p=e.canSplitCell,g={...ae.container,...u?ae.containerCompact:{},...m==="floating"?ae.containerFloating:{},...r},b=["docx-table-toolbar"];return n&&b.push(n),u&&b.push("docx-table-toolbar-compact"),m==="floating"&&b.push("docx-table-toolbar-floating"),jsxs("div",{className:b.join(" "),style:g,role:"toolbar","aria-label":"Table editing tools",children:[jsx("span",{style:ae.label,children:"Table:"}),jsxs(Xt,{children:[jsx(Ce,{action:"addRowAbove",label:"Insert Row Above",icon:jsx(yl,{}),disabled:o,onClick:()=>c("addRowAbove"),showLabel:l,compact:u}),jsx(Ce,{action:"addRowBelow",label:"Insert Row Below",icon:jsx(Tl,{}),disabled:o,onClick:()=>c("addRowBelow"),showLabel:l,compact:u}),jsx(Ce,{action:"deleteRow",label:"Delete Row",icon:jsx(Il,{}),disabled:o||!d,onClick:()=>c("deleteRow"),showLabel:l,compact:u})]}),jsxs(Xt,{children:[jsx(Ce,{action:"addColumnLeft",label:"Insert Column Left",icon:jsx(Sl,{}),disabled:o,onClick:()=>c("addColumnLeft"),showLabel:l,compact:u}),jsx(Ce,{action:"addColumnRight",label:"Insert Column Right",icon:jsx(wl,{}),disabled:o,onClick:()=>c("addColumnRight"),showLabel:l,compact:u}),jsx(Ce,{action:"deleteColumn",label:"Delete Column",icon:jsx(Ml,{}),disabled:o||!a,onClick:()=>c("deleteColumn"),showLabel:l,compact:u})]}),jsxs(Xt,{showSeparator:false,children:[jsx(Ce,{action:"mergeCells",label:"Merge Cells",icon:jsx(Pl,{}),disabled:o||!h,onClick:()=>c("mergeCells"),showLabel:l,compact:u}),jsx(Ce,{action:"splitCell",label:"Split Cell",icon:jsx(kl,{}),disabled:o||!p,onClick:()=>c("splitCell"),showLabel:l,compact:u}),jsx(Ce,{action:"deleteTable",label:"Delete Table",icon:jsx(Rl,{}),disabled:o,onClick:()=>c("deleteTable"),showLabel:l,compact:u})]}),s]})}function ru(e,t){let o=e.rows.length,n=jt(e),r=!!(t.selectedCells&&(t.selectedCells.startRow!==t.selectedCells.endRow||t.selectedCells.startCol!==t.selectedCells.endCol)),l=pn(e,t.rowIndex,t.columnIndex),u=!!(l&&((l.formatting?.gridSpan??1)>1||l.formatting?.vMerge==="restart"));return {table:e,selection:t,hasMultiCellSelection:r,canSplitCell:u,rowCount:o,columnCount:n}}function jt(e){if(!e.rows.length)return 0;let t=0;for(let o of e.rows){let n=0;for(let r of o.cells)n+=r.formatting?.gridSpan??1;t=Math.max(t,n);}return t}function pn(e,t,o){let n=e.rows[t];if(!n)return null;let r=0;for(let l of n.cells){let u=l.formatting?.gridSpan??1;if(o>=r&&o<r+u)return l;r+=u;}return null}function Zl(e,t){let o=[],n=0;for(let r of e.cells){let l=r.formatting?.gridSpan??1;o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...r.formatting,vMerge:void 0}}),n+=l;}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 Ll(){return {type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}}function iu(e,t,o="after"){let n=[...e.rows],r=o==="before"?t:t+1,l=e.rows[t]||e.rows[0],u=jt(e),m=Zl(l,u);return n.splice(r,0,m),{...e,rows:n}}function au(e,t){if(e.rows.length<=1)return e;let o=e.rows.filter((n,r)=>r!==t);return {...e,rows:o}}function lu(e,t,o="after"){let n=o==="before"?t:t+1,r=e.rows.map(u=>{let m=[...u.cells],s=0,c=0;for(let d=0;d<u.cells.length;d++){let h=u.cells[d].formatting?.gridSpan??1;if(n<=s+h){c=o==="before"?d:d+1;break}s+=h,c=d+1;}return m.splice(c,0,Ll()),{...u,cells:m}}),l=e.columnWidths;if(e.columnWidths&&e.columnWidths.length>0){l=[...e.columnWidths];let u=e.columnWidths[t]||e.columnWidths[0]||1440;l.splice(n,0,u);}return {...e,rows:r,columnWidths:l}}function su(e,t){if(jt(e)<=1)return e;let n=e.rows.map(l=>{let u=0,m=[];for(let s of l.cells){let c=s.formatting?.gridSpan??1;t>=u&&t<u+c?c>1&&m.push({...s,formatting:{...s.formatting,gridSpan:c-1}}):m.push(s),u+=c;}return {...l,cells:m}}),r=e.columnWidths;return e.columnWidths&&e.columnWidths.length>t&&(r=e.columnWidths.filter((l,u)=>u!==t)),{...e,rows:n,columnWidths:r}}function cu(e,t){if(!t.selectedCells)return e;let{startRow:o,startCol:n,endRow:r,endCol:l}=t.selectedCells,u=r-o+1,m=l-n+1,s=e.rows.map((c,d)=>{if(d<o||d>r)return c;let a=[],h=0;for(let p of c.cells){let g=p.formatting?.gridSpan??1,b=h+g-1;h<=l&&b>=n?d===o&&h===n?a.push({...p,formatting:{...p.formatting,gridSpan:m,vMerge:u>1?"restart":void 0}}):d>o&&h===n&&a.push({...p,formatting:{...p.formatting,gridSpan:m,vMerge:"continue"}}):a.push(p),h+=g;}return {...c,cells:a}});return {...e,rows:s}}function uu(e,t,o){let n=pn(e,t,o);if(!n)return e;let r=n.formatting?.gridSpan??1,l=n.formatting?.vMerge==="restart";if(r<=1&&!l)return e;let u=e.rows.map((m,s)=>{if(s!==t&&!l)return m;let c=[],d=0;for(let a of m.cells){let h=a.formatting?.gridSpan??1;if(d===o||d<=o&&o<d+h)if(r>1)for(let p=0;p<r;p++)c.push({type:"tableCell",content:p===0?a.content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...a.formatting,gridSpan:void 0,vMerge:void 0}});else l&&s===t?c.push({...a,formatting:{...a.formatting,vMerge:void 0}}):a.formatting?.vMerge==="continue"?c.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...a.formatting,vMerge:void 0}}):c.push(a);else c.push(a);d+=h;}return {...m,cells:c}});return {...e,rows:u}}
|
|
4
|
+
export{Yc as $,te as A,re as B,Qs as C,ec as D,Hc as E,Ec as F,qc as G,_c as H,Ac as I,Fc as J,K,Bc as L,rn as M,Oc as N,$t as O,Ga as P,Tt as Q,zc as R,Ya as S,cn as T,Xa as U,ja as V,Ja as W,Qa as X,Wc as Y,Gc as Z,Kc as _,k as a,Xc as aa,$ as b,jc as ba,ee as c,Jc as ca,x as d,nu as da,vt as e,ru as ea,Qo as f,jt as fa,no as g,pn as ga,G as h,iu as ha,a0 as i,au as ia,ho as j,lu as ja,Ee as k,su as ka,So as l,cu as la,Io as m,uu as ma,Mo as n,ko as o,Zo as p,Lo as q,qo as r,_o as s,Do as t,No as u,zo as v,Ot as w,rc as x,en as y,Ws as z};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use strict';var chunkPB7VMDDP_js=require('./chunk-PB7VMDDP.js'),
|
|
1
|
+
'use strict';var chunkPB7VMDDP_js=require('./chunk-PB7VMDDP.js'),chunkKUL2SDYC_js=require('./chunk-KUL2SDYC.js');function _(e){return g(e).variables}function g(e){let t=[],n={body:[],headers:[],footers:[],footnotes:[],endnotes:[],textBoxes:[]};if(e.package?.document){let r=A(e.package.document);r.forEach(o=>{t.push({name:o,location:"body"});}),n.body=Array.from(new Set(r)).sort();}if(e.package?.document?.sections&&e.package.document.sections.forEach((r,o)=>{r.properties.headerReferences&&r.properties.headerReferences.forEach(i=>{});}),e.package?.footnotes){let r=C(e.package.footnotes);r.forEach(o=>{t.push({name:o,location:"footnote"});}),n.footnotes=Array.from(new Set(r)).sort();}if(e.package?.endnotes){let r=C(e.package.endnotes);r.forEach(o=>{t.push({name:o,location:"endnote"});}),n.endnotes=Array.from(new Set(r)).sort();}e.templateVariables&&e.templateVariables.forEach(r=>{t.some(o=>o.name===r)||t.push({name:r,location:"body"});});let a=new Set;return t.forEach(r=>a.add(r.name)),{variables:Array.from(a).sort(),totalOccurrences:t.length,byLocation:n,occurrences:t}}function A(e){let t=[];if(e.content&&t.push(...w(e.content)),e.sections)for(let n of e.sections)n.content&&t.push(...w(n.content));return t}function w(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(...b(n)):n.type==="table"&&t.push(...I(n));return t}function b(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="run"?t.push(...d(n)):n.type==="hyperlink"?t.push(...O(n)):n.type==="simpleField"?t.push(...N(n)):n.type==="complexField"&&t.push(...H(n));return t}function d(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="text"&&n.text&&t.push(...P(n.text));return t}function O(e){let t=[];if(!e.children)return t;for(let n of e.children)n.type==="run"&&t.push(...d(n));return t}function N(e){let t=[];if(e.instruction&&t.push(...P(e.instruction)),e.content)for(let n of e.content)n.type==="run"&&t.push(...d(n));return t}function H(e){let t=[];if(e.fieldCode)for(let n of e.fieldCode)n.type==="run"&&t.push(...d(n));if(e.fieldResult)for(let n of e.fieldResult)n.type==="run"&&t.push(...d(n));return t}function I(e){let t=[];if(!e.rows)return t;for(let n of e.rows)if(n.cells)for(let a of n.cells)t.push(...$(a));return t}function $(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="paragraph"?t.push(...b(n)):n.type==="table"&&t.push(...I(n));return t}function C(e){let t=[];for(let n of e)if(n.content)for(let a of n.content)t.push(...b(a));return t}var R=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g,D=/\{(.+?)\}/g;function P(e){if(!e)return [];let t=[],n=new RegExp(R),a;for(;(a=n.exec(e))!==null;)t.push(a[1]);return t}function q(e){return R.test(e)}function U(e){return !(!e||typeof e!="string"||e.length===0||e.length>100||!/^[a-zA-Z_]/.test(e)||!/^[a-zA-Z_][a-zA-Z0-9_\-\.]*$/.test(e))}function X(e){if(!e)return "";let t=e.replace(/\s+/g,"_");return t=t.replace(/[^a-zA-Z0-9_\-\.]/g,""),t&&!/^[a-zA-Z_]/.test(t)&&(t="_"+t),t.substring(0,100)}function G(e){return `{${e}}`}function K(e){let t=e.match(/^\{(.+?)\}$/);return t?t[1]:null}function Q(e,t){return e&&e.replace(D,(n,a)=>{let r=a.trim();return r in t?t[r]:n})}function Y(e,t=""){return e&&e.replace(D,t)}function ee(e){return _(e).length>0}function J(e){return typeof e=="object"&&e!==null&&("_def"in e||"parse"in e||"safeParse"in e)}function k(e,t){let n=t,{position:a,variableName:r}=n,o=JSON.parse(JSON.stringify(e)),s=o.package.document.content.filter(u=>u.type==="paragraph");if(a.paragraphIndex>=s.length)throw new Error(`Paragraph index ${a.paragraphIndex} out of bounds`);let c=s[a.paragraphIndex],l=`{${r}}`;return E(c,a.offset,l),o.templateVariables||(o.templateVariables=[]),o.templateVariables.includes(r)||o.templateVariables.push(r),o}function M(e,t){let n=t,{range:a,variableName:r}=n,o=JSON.parse(JSON.stringify(e)),s=o.package.document.content.filter(u=>u.type==="paragraph");if(a.start.paragraphIndex!==a.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(a.start.paragraphIndex>=s.length)throw new Error(`Paragraph index ${a.start.paragraphIndex} out of bounds`);let c=s[a.start.paragraphIndex];L(c,a.start.offset,a.end.offset);let l=`{${r}}`;return E(c,a.start.offset,l),o.templateVariables||(o.templateVariables=[]),o.templateVariables.includes(r)||o.templateVariables.push(r),o}function E(e,t,n){let a=0,r=false;for(let o=0;o<e.content.length;o++){let i=e.content[o];if(i.type==="run"){let s=x(i),c=a,l=a+s.length;if(!r&&t>=c&&t<=l){let u=t-c,h=s.slice(0,u),y=s.slice(u),m=[];for(let p=0;p<o;p++)m.push(e.content[p]);h&&m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:h}]}),m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:n}]}),y&&m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:y}]});for(let p=o+1;p<e.content.length;p++)m.push(e.content[p]);e.content=m,r=true;break}a=l;}else if(i.type==="hyperlink")for(let s of i.children)s.type==="run"&&(a+=x(s).length);}r||e.content.push({type:"run",content:[{type:"text",text:n}]});}function L(e,t,n){let a=[],r=0;for(let o of e.content)if(o.type==="run"){let i=x(o),s=r,c=r+i.length;if(c<=t||s>=n)a.push(o);else {let l="";s<t&&(l+=i.slice(0,t-s)),c>n&&(l+=i.slice(n-s)),l.length>0&&a.push({type:"run",formatting:o.formatting,content:[{type:"text",text:l}]});}r=c;}else a.push(o);e.content=a;}function x(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}var f={type:"string",description:"Document ID from a previous docx_load call"},F={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},B={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
|
|
2
2
|
Returns variable names without braces, along with their locations (body, headers, footers, etc.).
|
|
3
|
-
Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:f},required:["documentId"]},handler:async(e,t)=>{let{documentId:n}=e,a=t.session.documents.get(n);if(!a)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};try{let r=g(a.document);return {content:[{type:"text",text:JSON.stringify({variables:r.variables,count:r.variables.length,totalOccurrences:r.totalOccurrences,byLocation:r.byLocation},null,2)}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${r.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},
|
|
3
|
+
Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:f},required:["documentId"]},handler:async(e,t)=>{let{documentId:n}=e,a=t.session.documents.get(n);if(!a)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};try{let r=g(a.document);return {content:[{type:"text",text:JSON.stringify({variables:r.variables,count:r.variables.length,totalOccurrences:r.totalOccurrences,byLocation:r.byLocation},null,2)}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${r.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},Z={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
|
|
4
4
|
The variable can later be substituted with actual values using docx_apply_template.
|
|
5
|
-
Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:f,position:
|
|
5
|
+
Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:f,position:F,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(e,t)=>{let{documentId:n,position:a,variableName:r}=e,o=t.session.documents.get(n);if(!o)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(r))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${r}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:i}=await import('./executor-L2MVKMXO.js'),s=i(o.document,{type:"insertText",position:a,text:`{${r}}`});return o.document=s,o.lastModified=Date.now(),s.templateVariables||(s.templateVariables=[]),s.templateVariables.includes(r)||s.templateVariables.push(r),{content:[{type:"text",text:JSON.stringify({success:!0,variable:r,insertedAs:`{${r}}`,position:a})}]}}catch(i){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${i.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},z={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
|
|
6
6
|
Replaces all {variable} placeholders with the corresponding values provided.
|
|
7
7
|
Preserves all formatting (fonts, styles, colors, tables).
|
|
8
|
-
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:f,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(e,t)=>{let{documentId:n,variables:a,keepUnmatchedVariables:r=true}=e,o=t.session.documents.get(n);if(!o)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!o.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let i=chunkPB7VMDDP_js.b(o.buffer,a,{nullGetter:r?"keep":"empty"}),s=await
|
|
8
|
+
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:f,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(e,t)=>{let{documentId:n,variables:a,keepUnmatchedVariables:r=true}=e,o=t.session.documents.get(n);if(!o)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!o.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let i=chunkPB7VMDDP_js.b(o.buffer,a,{nullGetter:r?"keep":"empty"}),s=await chunkKUL2SDYC_js.n(i.buffer);return o.document=s,o.buffer=i.buffer,o.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:i.replacedVariables,unreplacedVariables:i.unreplacedVariables,warnings:i.warnings})}]}}catch(i){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${i.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},j={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
|
|
9
9
|
Checks for syntax errors like unclosed braces, invalid tag names, etc.
|
|
10
|
-
Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:f},required:["documentId"]},handler:async(e,t)=>{let{documentId:n}=e,a=t.session.documents.get(n);if(!a)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!a.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let r=chunkPB7VMDDP_js.f(a.buffer);return {content:[{type:"text",text:JSON.stringify({valid:r.valid,tags:r.tags,errors:r.errors.map(o=>({message:o.message,variable:o.variable,type:o.type}))},null,2)}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${r.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},
|
|
10
|
+
Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:f},required:["documentId"]},handler:async(e,t)=>{let{documentId:n}=e,a=t.session.documents.get(n);if(!a)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!a.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let r=chunkPB7VMDDP_js.f(a.buffer);return {content:[{type:"text",text:JSON.stringify({valid:r.valid,tags:r.tags,errors:r.errors.map(o=>({message:o.message,variable:o.variable,type:o.type}))},null,2)}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${r.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},S=[B,Z,z,j];var W={id:"docxtemplater",name:"Docxtemplater",version:"1.0.0",description:"Template variable support using standard docxtemplater syntax ({variable})",commandHandlers:{insertTemplateVariable:k,replaceWithTemplateVariable:M},mcpTools:S};exports.a=_;exports.b=g;exports.c=A;exports.d=b;exports.e=P;exports.f=q;exports.g=U;exports.h=X;exports.i=G;exports.j=K;exports.k=Q;exports.l=Y;exports.m=ee;exports.n=J;exports.o=W;
|