@eigenpal/docx-js-editor 0.0.31 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +10 -2
  2. package/dist/FindReplaceDialog-KNJETYJX.js +1 -0
  3. package/dist/{FindReplaceDialog-N4J5OB7O.mjs → FindReplaceDialog-YW3R4FHM.mjs} +1 -1
  4. package/dist/FootnotePropertiesDialog-7QX54WQT.js +1 -0
  5. package/dist/FootnotePropertiesDialog-LNFJXQUG.mjs +1 -0
  6. package/dist/HyperlinkDialog-GBAYMTUE.js +1 -0
  7. package/dist/{HyperlinkDialog-YQSQFHOP.mjs → HyperlinkDialog-HNYTXDCB.mjs} +1 -1
  8. package/dist/ImagePositionDialog-B4RLP2W5.mjs +1 -0
  9. package/dist/ImagePositionDialog-M65BYQQE.js +1 -0
  10. package/dist/ImagePropertiesDialog-JOGW3WDU.mjs +1 -0
  11. package/dist/ImagePropertiesDialog-O4WQSF5M.js +1 -0
  12. package/dist/PageSetupDialog-2GIBTKMJ.js +1 -0
  13. package/dist/PageSetupDialog-Q7SHEZIJ.mjs +1 -0
  14. package/dist/TablePropertiesDialog-LMXWX3FI.mjs +1 -0
  15. package/dist/TablePropertiesDialog-WOZ4ES3H.js +1 -0
  16. package/dist/{chunk-CQR767EJ.mjs → chunk-2HDYCD2Q.mjs} +1 -1
  17. package/dist/chunk-377ZVTSE.js +2 -0
  18. package/dist/chunk-37SLIJPH.mjs +58 -0
  19. package/dist/chunk-3OKYQQQ5.js +111 -0
  20. package/dist/chunk-7MGFEP2R.mjs +26 -0
  21. package/dist/chunk-7QTNB64A.mjs +9 -0
  22. package/dist/chunk-AU5NVRHP.js +2 -0
  23. package/dist/chunk-DC65PJYE.js +4 -0
  24. package/dist/{chunk-ZKKL54FH.js → chunk-EV3CM6TU.js} +1 -1
  25. package/dist/chunk-FW5LYOOZ.mjs +111 -0
  26. package/dist/chunk-GZOCOWWB.mjs +2 -0
  27. package/dist/{chunk-N2UPYG75.js → chunk-KCOGY3V2.js} +2 -2
  28. package/dist/chunk-KUL2SDYC.js +26 -0
  29. package/dist/chunk-N6RUBUT2.js +261 -0
  30. package/dist/chunk-P7WEP4JU.js +9 -0
  31. package/dist/chunk-QSUPYUOP.js +2 -0
  32. package/dist/{chunk-FFNGY4AB.mjs → chunk-RTFUE3KK.mjs} +1 -1
  33. package/dist/chunk-SZHPMPSO.mjs +261 -0
  34. package/dist/chunk-X5A54T6S.mjs +4 -0
  35. package/dist/chunk-YKBSKEBS.mjs +2 -0
  36. package/dist/chunk-Z26WOH6R.mjs +2 -0
  37. package/dist/chunk-ZJNGMDRE.js +58 -0
  38. package/dist/clipboard-Cu80iVDh.d.ts +1181 -0
  39. package/dist/clipboard-dFROLI95.d.mts +1181 -0
  40. package/dist/core-plugins-reexport.js +1 -1
  41. package/dist/core-plugins-reexport.mjs +1 -1
  42. package/dist/core-reexport.js +1 -1
  43. package/dist/core-reexport.mjs +1 -1
  44. package/dist/headless-reexport.js +2 -2
  45. package/dist/headless-reexport.mjs +1 -1
  46. package/dist/index.css +1 -1
  47. package/dist/index.d.mts +15 -5
  48. package/dist/index.d.ts +15 -5
  49. package/dist/index.js +9 -9
  50. package/dist/index.mjs +9 -9
  51. package/dist/mcp-reexport.js +3 -3
  52. package/dist/mcp-reexport.mjs +2 -2
  53. package/dist/{react-CAc4htNH.d.ts → react-1nBq3zH9.d.ts} +3 -1
  54. package/dist/{react-B2h6vE3D.d.mts → react-Dr8Nm-0u.d.mts} +3 -1
  55. package/dist/react.css +1 -1
  56. package/dist/react.d.mts +2 -2
  57. package/dist/react.d.ts +2 -2
  58. package/dist/react.js +1 -1
  59. package/dist/react.mjs +1 -1
  60. package/dist/selectionRects-DEX5THEG.js +1 -0
  61. package/dist/selectionRects-SQTAHMCH.mjs +1 -0
  62. package/dist/styles.css +1 -1
  63. package/dist/ui.d.mts +22 -20
  64. package/dist/ui.d.ts +22 -20
  65. package/dist/ui.js +1 -1
  66. package/dist/ui.mjs +1 -1
  67. package/i18n/de.json +745 -0
  68. package/i18n/en.json +745 -0
  69. package/i18n/pl.json +745 -0
  70. package/package.json +6 -3
  71. package/dist/FindReplaceDialog-AQFR4OCT.js +0 -1
  72. package/dist/FootnotePropertiesDialog-UFUIHLDW.mjs +0 -1
  73. package/dist/FootnotePropertiesDialog-YYIZU5U6.js +0 -1
  74. package/dist/HyperlinkDialog-HGZ2S37Z.js +0 -1
  75. package/dist/ImagePositionDialog-DQ4JWS4F.js +0 -1
  76. package/dist/ImagePositionDialog-HT6J2SHV.mjs +0 -1
  77. package/dist/ImagePropertiesDialog-3VK2S2AF.mjs +0 -1
  78. package/dist/ImagePropertiesDialog-GJMGLM6G.js +0 -1
  79. package/dist/PageSetupDialog-2SKHDRTF.js +0 -1
  80. package/dist/PageSetupDialog-SMQJXEBL.mjs +0 -1
  81. package/dist/TablePropertiesDialog-FI5E3RCB.mjs +0 -1
  82. package/dist/TablePropertiesDialog-STZOGHJB.js +0 -1
  83. package/dist/chunk-2KHL5RSD.js +0 -4
  84. package/dist/chunk-3Y6ZBC3P.js +0 -9
  85. package/dist/chunk-6CSL7T4S.mjs +0 -9
  86. package/dist/chunk-7HZRJTOL.mjs +0 -4
  87. package/dist/chunk-A2DPBJHE.mjs +0 -258
  88. package/dist/chunk-AZRYS2WF.mjs +0 -2
  89. package/dist/chunk-CTYOM6BE.js +0 -2
  90. package/dist/chunk-DJI7XTMH.js +0 -59
  91. package/dist/chunk-HIITS47V.js +0 -258
  92. package/dist/chunk-KCUPCJFL.mjs +0 -111
  93. package/dist/chunk-NKJBKWYY.js +0 -26
  94. package/dist/chunk-OBTGZZLM.mjs +0 -26
  95. package/dist/chunk-PJVI53AH.js +0 -2
  96. package/dist/chunk-TQATISQV.mjs +0 -59
  97. package/dist/chunk-XGL3EGKF.js +0 -111
  98. package/dist/chunk-XWBCP563.mjs +0 -2
  99. package/dist/clipboard-B7N7Kx2X.d.ts +0 -386
  100. package/dist/clipboard-BkM7Zvgs.d.mts +0 -386
  101. package/dist/selectionRects-D45BP6HQ.js +0 -1
  102. package/dist/selectionRects-Z72BKRLU.mjs +0 -1
@@ -0,0 +1,111 @@
1
+ 'use strict';var chunkDC65PJYE_js=require('./chunk-DC65PJYE.js'),chunkQSUPYUOP_js=require('./chunk-QSUPYUOP.js'),chunkQVPR2W5S_js=require('./chunk-QVPR2W5S.js'),chunk4VUZBV2S_js=require('./chunk-4VUZBV2S.js'),ir=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ir__default=/*#__PURE__*/_interopDefault(ir);var Zt={askAI:"contextMenu.aiActions.askAi",rewrite:"contextMenu.aiActions.rewrite",expand:"contextMenu.aiActions.expand",summarize:"contextMenu.aiActions.summarize",translate:"contextMenu.aiActions.translate",explain:"contextMenu.aiActions.explain",fixGrammar:"contextMenu.aiActions.fixGrammar",makeFormal:"contextMenu.aiActions.makeFormal",makeCasual:"contextMenu.aiActions.makeCasual",custom:"contextMenu.aiActions.custom"},Xt=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M8 4v4M8 10v1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Qt=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M13 3L3 13M3 3h4v4M13 13h-4v-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Jt=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),qt=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 4h10M3 8h7M3 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),eo=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 3h6M5 3v6M3 5c0 2 1 4 2 4s2-2 2-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M9 7l3 6M15 7l-3 6M10 11h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),to=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M6 6c0-1.1.9-2 2-2s2 .9 2 2c0 1.5-2 1.5-2 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"8",cy:"12",r:"0.5",fill:"currentColor"})]}),oo=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M4 12l3-8 3 8M5 10h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M12 6l2 2-2 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),ro=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M6 7h4M6 9h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),no=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"5",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M6 9c.5.5 1 1 2 1s1.5-.5 2-1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"6",cy:"7",r:"0.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"10",cy:"7",r:"0.5",fill:"currentColor"})]}),io=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function so(e){switch(e){case "askAI":return jsxRuntime.jsx(Xt,{});case "rewrite":return jsxRuntime.jsx(Qt,{});case "expand":return jsxRuntime.jsx(Jt,{});case "summarize":return jsxRuntime.jsx(qt,{});case "translate":return jsxRuntime.jsx(eo,{});case "explain":return jsxRuntime.jsx(to,{});case "fixGrammar":return jsxRuntime.jsx(oo,{});case "makeFormal":return jsxRuntime.jsx(ro,{});case "makeCasual":return jsxRuntime.jsx(no,{});case "custom":return jsxRuntime.jsx(io,{});default:return null}}var ao=({action:e,onClick:t,isHighlighted:o,onMouseEnter:i})=>{let{t:n}=chunkQSUPYUOP_js.b(),r=n(Zt[e]),s=chunkQVPR2W5S_js.f(e),c=so(e);return jsxRuntime.jsxs("button",{type:"button",className:`docx-context-menu-item ${o?"docx-context-menu-item-highlighted":""}`,onClick:t,onMouseEnter:i,title:s,role:"menuitem",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"8px 12px",border:"none",background:o?"var(--doc-primary-light)":"transparent",cursor:"pointer",fontSize:"13px",color:"var(--doc-text)",textAlign:"left"},children:[jsxRuntime.jsx("span",{style:{display:"flex",color:"var(--doc-text-muted)"},children:c}),jsxRuntime.jsx("span",{children:r})]})},lo=({isOpen:e,onSubmit:t,onClose:o,selectedText:i})=>{let[n,r]=ir.useState(""),s=ir.useRef(null),{t:c}=chunkQSUPYUOP_js.b();ir.useEffect(()=>{e&&s.current&&s.current.focus();},[e]);let l=m=>{m.preventDefault(),n.trim()&&(t(n.trim()),r(""));},a=m=>{m.key==="Escape"&&o();};return e?jsxRuntime.jsx("div",{className:"docx-custom-prompt-dialog",style:{position:"absolute",top:"100%",left:0,right:0,padding:"8px",background:"white",borderTop:"1px solid var(--doc-border)"},children:jsxRuntime.jsxs("form",{onSubmit:l,children:[jsxRuntime.jsxs("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:['Selected: "',i.slice(0,50),i.length>50?"...":"",'"']}),jsxRuntime.jsx("input",{ref:s,type:"text",value:n,onChange:m=>r(m.target.value),onKeyDown:a,placeholder:c("contextMenu.customPromptPlaceholder"),style:{width:"100%",padding:"8px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",fontSize:"13px"}}),jsxRuntime.jsxs("div",{style:{marginTop:"8px",display:"flex",gap:"8px",justifyContent:"flex-end"},children:[jsxRuntime.jsx("button",{type:"button",onClick:o,style:{padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px"},children:c("common.cancel")}),jsxRuntime.jsx("button",{type:"submit",disabled:!n.trim(),style:{padding:"6px 12px",border:"none",borderRadius:"4px",background:n.trim()?"var(--doc-primary)":"var(--doc-border)",color:n.trim()?"white":"var(--doc-text-placeholder)",cursor:n.trim()?"pointer":"not-allowed",fontSize:"12px"},children:c("common.send")})]})]})}):null},On=({isOpen:e,position:t,selectedText:o,selectionContext:i,onAction:n,onClose:r,actions:s=chunkQVPR2W5S_js.g,showCustomPrompt:c=true,className:l=""})=>{let a=ir.useRef(null),[m,b]=ir.useState(0),[h,p]=ir.useState(false),{t:u}=chunkQSUPYUOP_js.b(),g=c?[...s,"custom"]:s;ir.useEffect(()=>{if(!e)return;let d=y=>{a.current&&!a.current.contains(y.target)&&r();};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[e,r]),ir.useEffect(()=>{if(!e)return;let d=y=>{switch(y.key){case "Escape":h?p(false):r();break;case "ArrowDown":y.preventDefault(),b(L=>(L+1)%g.length);break;case "ArrowUp":y.preventDefault(),b(L=>(L-1+g.length)%g.length);break;case "Enter":y.preventDefault();let C=g[m];C==="custom"?p(true):(n(C),r());break}};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,m,g,n,r,h]),ir.useEffect(()=>{e&&(b(0),p(false));},[e]);let x=ir.useCallback(()=>{let y=g.length*36+16,C=t.x,L=t.y;return typeof window<"u"&&(C+200>window.innerWidth&&(C=window.innerWidth-200-10),L+y>window.innerHeight&&(L=window.innerHeight-y-10),C<10&&(C=10),L<10&&(L=10)),{position:"fixed",top:L,left:C,minWidth:200,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,g.length]),k=d=>{d==="custom"?p(true):(n(d),r());},f=d=>{n("custom",d),r();};return !e||!o?null:jsxRuntime.jsxs("div",{ref:a,className:`docx-context-menu ${l}`,style:x(),role:"menu","aria-label":u("contextMenu.ariaLabel"),children:[jsxRuntime.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:"11px",color:"var(--doc-text-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:['"',o.slice(0,30),o.length>30?"...":"",'"']}),jsxRuntime.jsx("div",{role:"group",children:g.map((d,y)=>jsxRuntime.jsx(ao,{action:d,onClick:()=>k(d),isHighlighted:y===m,onMouseEnter:()=>b(y)},d))}),c&&jsxRuntime.jsx(lo,{isOpen:h,onSubmit:f,onClose:()=>p(false),selectedText:o})]})};function An(){let[e,t]=ir.useState(false),[o,i]=ir.useState({x:0,y:0}),[n,r]=ir.useState(""),[s,c]=ir.useState(),l=ir.useCallback((m,b,h)=>{m.preventDefault(),i({x:m.clientX,y:m.clientY}),r(b),c(h),t(true);},[]),a=ir.useCallback(()=>{t(false);},[]);return {isOpen:e,position:o,selectedText:n,selectionContext:s,openMenu:l,closeMenu:a}}function Mn(e){return {rewrite:"Ctrl+Shift+R",summarize:"Ctrl+Shift+S",translate:"Ctrl+Shift+T",fixGrammar:"Ctrl+Shift+G"}[e]}function _n(e,t,o){return !(!t||t.trim().length===0)}function Nn(){return [...chunkQVPR2W5S_js.g]}function Bn(){return ["askAI","rewrite","expand","summarize","translate","explain","fixGrammar","makeFormal","makeCasual","custom"]}var co=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 8l4 4 6-8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),dt=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),po=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 8a6 6 0 0111.318-2.828M14 8a6 6 0 01-11.318 2.828",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M13 2v4h-4M3 14v-4h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),uo=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11 2l3 3-9 9H2v-3l9-9z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),go=()=>jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"spin 1s linear infinite"},children:[jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"8",stroke:"var(--doc-border)",strokeWidth:"2",fill:"none"}),jsxRuntime.jsx("path",{d:"M10 2a8 8 0 018 8",stroke:"var(--doc-primary)",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),jsxRuntime.jsx("style",{children:`
2
+ @keyframes spin {
3
+ from { transform: rotate(0deg); }
4
+ to { transform: rotate(360deg); }
5
+ }
6
+ `})]});function mo(e,t){let o=[],i=e.split(/(\s+)/),n=t.split(/(\s+)/),r=0,s=0;for(;r<i.length||s<n.length;){if(r>=i.length){o.push({type:"added",text:n.slice(s).join("")});break}if(s>=n.length){o.push({type:"removed",text:i.slice(r).join("")});break}if(i[r]===n[s])o.push({type:"same",text:i[r]}),r++,s++;else {let l=n.indexOf(i[r],s),a=i.indexOf(n[s],r);l===-1&&a===-1?(o.push({type:"removed",text:i[r]}),o.push({type:"added",text:n[s]}),r++,s++):a!==-1&&(l===-1||a-r<=l-s)?(o.push({type:"added",text:n[s]}),s++):(o.push({type:"removed",text:i[r]}),r++);}}let c=[];for(let l of o)c.length>0&&c[c.length-1].type===l.type?c[c.length-1].text+=l.text:c.push(l);return c}var ho=({original:e,modified:t})=>{let o=mo(e,t);return jsxRuntime.jsx("div",{className:"docx-response-diff",style:{lineHeight:1.6,fontSize:"14px"},children:o.map((i,n)=>{let r={};switch(i.type){case "removed":r={textDecoration:"line-through",color:"#d32f2f",backgroundColor:"#ffebee"};break;case "added":r={color:"#2e7d32",backgroundColor:"#e8f5e9"};break;}return jsxRuntime.jsx("span",{style:r,children:i.text},n)})})},Vn=({originalText:e,response:t,action:o,isLoading:i,error:n,onAccept:r,onReject:s,onRetry:c,allowEdit:l=true,showDiff:a=true,className:m="",position:b})=>{let{t:h}=chunkQSUPYUOP_js.b(),[p,u]=ir.useState(false),[g,x]=ir.useState(""),k=ir.useRef(null),f=ir.useRef(null),d=t?.newText||"";ir.useEffect(()=>{d&&x(d);},[d]),ir.useEffect(()=>{p&&k.current&&(k.current.focus(),k.current.select());},[p]),ir.useEffect(()=>{let D=R=>{R.key==="Escape"?p?(u(false),x(d)):s():R.key==="Enter"&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),y());};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[p,d,s]);let y=ir.useCallback(()=>{r(p?g:d);},[p,g,d,r]),C=ir.useCallback(()=>{u(true);},[]),L=ir.useCallback(()=>{u(false),x(d);},[d]),Y={position:b?"fixed":"relative",...b&&{left:b.x,top:b.y},width:"400px",maxWidth:"90vw",maxHeight:"80vh",background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",zIndex:1e4,overflow:"hidden",display:"flex",flexDirection:"column"};return i?jsxRuntime.jsx("div",{ref:f,className:`docx-response-preview docx-response-preview-loading ${m}`,style:Y,children:jsxRuntime.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[jsxRuntime.jsx(go,{}),jsxRuntime.jsx("div",{style:{color:"var(--doc-text-muted)",fontSize:"14px"},children:h("responsePreview.loading",{action:chunkQVPR2W5S_js.e(o)})})]})}):n?jsxRuntime.jsx("div",{ref:f,className:`docx-response-preview docx-response-preview-error ${m}`,style:Y,children:jsxRuntime.jsxs("div",{style:{padding:"16px"},children:[jsxRuntime.jsx("div",{style:{padding:"12px",background:"var(--doc-error-bg)",borderRadius:"4px",color:"var(--doc-error)",fontSize:"13px",marginBottom:"16px"},children:n}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[c&&jsxRuntime.jsxs("button",{type:"button",onClick:c,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"13px"},children:[jsxRuntime.jsx(po,{}),h("common.retry")]}),jsxRuntime.jsx("button",{type:"button",onClick:s,style:{padding:"8px 16px",border:"none",borderRadius:"4px",background:"var(--doc-border)",cursor:"pointer",fontSize:"13px"},children:h("common.close")})]})]})}):!t||!d?null:jsxRuntime.jsxs("div",{ref:f,className:`docx-response-preview ${m}`,style:Y,children:[jsxRuntime.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx("div",{style:{fontWeight:500,fontSize:"14px",color:"var(--doc-text)"},children:h("responsePreview.result",{action:chunkQVPR2W5S_js.e(o)})}),jsxRuntime.jsx("button",{type:"button",onClick:s,style:{display:"flex",padding:"4px",border:"none",background:"transparent",cursor:"pointer",color:"var(--doc-text-muted)"},title:h("responsePreview.closeEsc"),children:jsxRuntime.jsx(dt,{})})]}),jsxRuntime.jsxs("div",{style:{padding:"16px",overflowY:"auto",flex:1},children:[p?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:h("responsePreview.editPrompt")}),jsxRuntime.jsx("textarea",{ref:k,value:g,onChange:D=>x(D.target.value),style:{width:"100%",minHeight:"120px",padding:"12px",border:"1px solid var(--doc-primary)",borderRadius:"4px",fontSize:"14px",lineHeight:1.6,resize:"vertical",fontFamily:"inherit"}})]}):a?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:h("responsePreview.changes")}),jsxRuntime.jsx(ho,{original:e,modified:d})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:h("responsePreview.original")}),jsxRuntime.jsx("div",{style:{padding:"8px 12px",background:"var(--doc-bg-subtle)",borderRadius:"4px",marginBottom:"16px",textDecoration:"line-through",color:"var(--doc-text-placeholder)",fontSize:"13px"},children:e}),jsxRuntime.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:h("responsePreview.new")}),jsxRuntime.jsx("div",{style:{padding:"8px 12px",background:"#e8f5e9",borderRadius:"4px",color:"#2e7d32",fontSize:"13px"},children:d})]}),t.warnings&&t.warnings.length>0&&jsxRuntime.jsx("div",{style:{marginTop:"16px",padding:"8px 12px",background:"var(--doc-warning-bg)",borderRadius:"4px",fontSize:"12px",color:"var(--doc-warning)"},children:t.warnings.map((D,R)=>jsxRuntime.jsx("div",{children:D},R))})]}),jsxRuntime.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsxs("div",{children:[l&&!p&&jsxRuntime.jsxs("button",{type:"button",onClick:C,style:{display:"flex",alignItems:"center",gap:"4px",padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px",color:"var(--doc-text-muted)"},children:[jsxRuntime.jsx(uo,{}),h("common.edit")]}),p&&jsxRuntime.jsx("button",{type:"button",onClick:L,style:{padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px",color:"var(--doc-text-muted)"},children:h("responsePreview.cancelEdit")})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxRuntime.jsxs("button",{type:"button",onClick:s,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"13px",color:"var(--doc-text-muted)"},children:[jsxRuntime.jsx(dt,{}),h("common.reject")]}),jsxRuntime.jsxs("button",{type:"button",onClick:y,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"none",borderRadius:"4px",background:"var(--doc-primary)",cursor:"pointer",fontSize:"13px",color:"white"},children:[jsxRuntime.jsx(co,{}),h("common.accept")]})]})]})]})};function $n(){let[e,t]=ir.useState({isVisible:false,originalText:"",response:null,action:"rewrite",isLoading:false}),o=ir.useCallback((s,c,l)=>{t({isVisible:true,originalText:s,response:null,action:c,isLoading:true,position:l});},[]),i=ir.useCallback(s=>{t(c=>({...c,response:s,isLoading:false}));},[]),n=ir.useCallback(s=>{t(c=>({...c,error:s,isLoading:false}));},[]),r=ir.useCallback(()=>{t(s=>({...s,isVisible:false}));},[]);return {state:e,showPreview:o,setResponse:i,setError:n,hidePreview:r}}function Gn(e,t){return {success:true,newText:e,warnings:t}}function jn(e){return {success:false,error:e}}var xo=[{name:"Black",nameKey:"colorPicker.colors.black",hex:"000000"},{name:"Dark Red",nameKey:"colorPicker.colors.darkRed",hex:"7F0000"},{name:"Dark Orange",nameKey:"colorPicker.colors.darkOrange",hex:"FF6600"},{name:"Dark Yellow",nameKey:"colorPicker.colors.darkYellow",hex:"808000"},{name:"Dark Green",nameKey:"colorPicker.colors.darkGreen",hex:"006400"},{name:"Dark Teal",nameKey:"colorPicker.colors.darkTeal",hex:"008080"},{name:"Dark Blue",nameKey:"colorPicker.colors.darkBlue",hex:"000080"},{name:"Dark Purple",nameKey:"colorPicker.colors.darkPurple",hex:"4B0082"},{name:"Dark Gray",nameKey:"colorPicker.colors.darkGray",hex:"404040"},{name:"Gray",nameKey:"colorPicker.colors.gray",hex:"808080"},{name:"Red",nameKey:"colorPicker.colors.red",hex:"FF0000"},{name:"Orange",nameKey:"colorPicker.colors.orange",hex:"FF9900"},{name:"Yellow",nameKey:"colorPicker.colors.yellow",hex:"FFFF00"},{name:"Light Green",nameKey:"colorPicker.colors.lightGreen",hex:"00FF00"},{name:"Cyan",nameKey:"colorPicker.colors.cyan",hex:"00FFFF"},{name:"Light Blue",nameKey:"colorPicker.colors.lightBlue",hex:"0066FF"},{name:"Blue",nameKey:"colorPicker.colors.blue",hex:"0000FF"},{name:"Purple",nameKey:"colorPicker.colors.purple",hex:"9900FF"},{name:"Magenta",nameKey:"colorPicker.colors.magenta",hex:"FF00FF"},{name:"Pink",nameKey:"colorPicker.colors.pink",hex:"FF66FF"},{name:"Light Red",nameKey:"colorPicker.colors.lightRed",hex:"FFCCCC"},{name:"Light Orange",nameKey:"colorPicker.colors.lightOrange",hex:"FFE5CC"},{name:"Light Yellow",nameKey:"colorPicker.colors.lightYellow",hex:"FFFFCC"},{name:"Pale Green",nameKey:"colorPicker.colors.paleGreen",hex:"CCFFCC"},{name:"Light Cyan",nameKey:"colorPicker.colors.lightCyan",hex:"CCFFFF"},{name:"Sky Blue",nameKey:"colorPicker.colors.skyBlue",hex:"CCE5FF"},{name:"Light Blue 2",nameKey:"colorPicker.colors.lightBlue2",hex:"CCCCFF"},{name:"Lavender",nameKey:"colorPicker.colors.lavender",hex:"E5CCFF"},{name:"Light Magenta",nameKey:"colorPicker.colors.lightMagenta",hex:"FFCCFF"},{name:"White",nameKey:"colorPicker.colors.white",hex:"FFFFFF"}],bo=[{name:"No Color",nameKey:"colorPicker.noColor",hex:""},{name:"Yellow",nameKey:"colorPicker.colors.yellow",hex:"FFFF00"},{name:"Bright Green",nameKey:"colorPicker.colors.brightGreen",hex:"00FF00"},{name:"Cyan",nameKey:"colorPicker.colors.cyan",hex:"00FFFF"},{name:"Magenta",nameKey:"colorPicker.colors.magenta",hex:"FF00FF"},{name:"Blue",nameKey:"colorPicker.colors.blue",hex:"0000FF"},{name:"Red",nameKey:"colorPicker.colors.red",hex:"FF0000"},{name:"Dark Blue",nameKey:"colorPicker.colors.darkBlue",hex:"00008B"},{name:"Teal",nameKey:"colorPicker.colors.teal",hex:"008080"},{name:"Green",nameKey:"colorPicker.colors.green",hex:"008000"},{name:"Violet",nameKey:"colorPicker.colors.violet",hex:"800080"},{name:"Dark Red",nameKey:"colorPicker.colors.darkRed",hex:"8B0000"},{name:"Dark Yellow",nameKey:"colorPicker.colors.darkYellow",hex:"808000"},{name:"Gray 50%",nameKey:"colorPicker.colors.grey50",hex:"808080"},{name:"Gray 25%",nameKey:"colorPicker.colors.grey25",hex:"C0C0C0"},{name:"Black",nameKey:"colorPicker.colors.black",hex:"000000"}],fo={position:"relative",display:"inline-block"},Ie={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)"},yo={...Ie,backgroundColor:"var(--doc-bg-hover)"},vo={...Ie,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},So={...Ie,cursor:"default",opacity:.38},Co={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"0"},ko={width:"14px",height:"3px",borderRadius:"0",marginTop:"-2px"},wo={display:"grid",gap:"2px"},Le={width:"20px",height:"20px",border:"1px solid #ccc",borderRadius:"2px",cursor:"pointer",transition:"transform 0.1s, border-color 0.1s",padding:0},To={...Le,transform:"scale(1.1)",borderColor:"#333",zIndex:1},Po={...Le,borderWidth:"2px",borderColor:"#0066cc",boxShadow:"0 0 0 1px #0066cc"},Eo={...Le,position:"relative",backgroundColor:"#fff"},Io={position:"absolute",top:"50%",left:"-2px",right:"-2px",height:"2px",backgroundColor:"#ff0000",transform:"rotate(-45deg)"},ut={fontSize:"11px",color:"#666",marginBottom:"4px",marginTop:"8px"},Lo={marginTop:"8px",paddingTop:"8px",borderTop:"1px solid #eee"},Ro={display:"flex",alignItems:"center",gap:"8px"},Do={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid #ccc",borderRadius:"3px",fontSize:"12px"},Ko={height:"24px",padding:"0 8px",border:"1px solid #ccc",borderRadius:"3px",backgroundColor:"#f5f5f5",fontSize:"12px",cursor:"pointer"},Oo=()=>jsxRuntime.jsx(chunkDC65PJYE_js.d,{name:"format_color_text",size:18}),Ao=()=>jsxRuntime.jsx(chunkDC65PJYE_js.d,{name:"ink_highlighter",size:18}),Mo=()=>jsxRuntime.jsx(chunkDC65PJYE_js.d,{name:"arrow_drop_down",size:14});function _o({colors:e,selectedColor:t,onSelect:o,columns:i=10,cellSize:n=20}){let[r,s]=ir.useState(null),{t:c}=chunkQSUPYUOP_js.b(),l={...wo,gridTemplateColumns:`repeat(${i}, ${n}px)`};return jsxRuntime.jsx("div",{style:l,className:"docx-color-grid",role:"grid",children:e.map((a,m)=>{let b=t?.toUpperCase()===a.hex.toUpperCase(),h=r===m,p=a.hex==="",u=a.nameKey?c(a.nameKey):a.name,g={...b?Po:h?To:Le,width:`${n}px`,height:`${n}px`};return p||(g.backgroundColor=`#${a.hex}`),jsxRuntime.jsx("button",{type:"button",style:p?{...Eo,...g}:g,onClick:()=>o(a),onMouseDown:x=>x.preventDefault(),onMouseEnter:()=>s(m),onMouseLeave:()=>s(null),title:u,role:"gridcell","aria-label":u,"aria-selected":b,children:p&&jsxRuntime.jsx("span",{style:Io})},`${a.hex}-${m}`)})})}function oi({value:e,onChange:t,type:o="text",theme:i,colors:n,disabled:r=false,className:s,style:c,title:l,children:a,dropdownWidth:m=230,showNoColor:b=true,showMoreColors:h=true}){let[p,u]=ir.useState(false),[g,x]=ir.useState(false),[k,f]=ir.useState(""),{t:d}=chunkQSUPYUOP_js.b(),y=ir.useCallback(()=>u(false),[]),{containerRef:C,dropdownRef:L,dropdownStyle:Y}=chunkDC65PJYE_js.h({isOpen:p,onClose:y}),D=ir.useMemo(()=>{if(o==="highlight")return bo;let A=[...xo];return b&&A.unshift({name:"Automatic",nameKey:"colorPicker.automatic",hex:"000000"}),A},[o,b]),R=n||D,X=ir.useMemo(()=>e?e.startsWith("#")?e:o==="highlight"?chunk4VUZBV2S_js.b(e)||"transparent":`#${e}`:o==="text"?"#000000":"transparent",[e,o]),G=ir.useCallback(A=>{t?.(A.hex),u(false);},[t]),v=ir.useCallback(()=>{let A=k.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/i.test(A)&&(t?.(A),u(false),f(""));},[k,t]),T=ir.useCallback(()=>{r||u(A=>!A);},[r]),K=r?So:p?vo:g?yo:Ie,V=d(o==="text"?"formattingBar.fontColor":"formattingBar.highlightColor");return jsxRuntime.jsxs("div",{ref:C,className:`docx-color-picker docx-color-picker-${o} ${s||""}`,style:{...fo,...c},children:[jsxRuntime.jsxs("button",{type:"button",className:"docx-color-picker-button",style:K,onClick:T,onMouseDown:A=>A.preventDefault(),onMouseEnter:()=>x(true),onMouseLeave:()=>x(false),disabled:r,title:l||V,"aria-label":l||V,"aria-haspopup":"true","aria-expanded":p,children:[a||jsxRuntime.jsxs("div",{style:Co,children:[o==="text"?jsxRuntime.jsx(Oo,{}):jsxRuntime.jsx(Ao,{}),jsxRuntime.jsx("div",{style:{...ko,backgroundColor:X==="transparent"?"#fff":X,border:X==="transparent"?"1px solid #ccc":"none"}})]}),jsxRuntime.jsx(Mo,{})]}),p&&jsxRuntime.jsxs("div",{ref:L,className:"docx-color-picker-dropdown",style:{...Y,padding:"8px",backgroundColor:"#fff",border:"1px solid #ccc",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",width:m},role:"dialog","aria-label":d("colorPicker.ariaLabel",{type:o==="text"?"Font":"Highlight"}),onMouseDown:A=>A.preventDefault(),children:[o==="highlight"&&jsxRuntime.jsx("div",{style:ut,children:d("colorPicker.highlightColors")}),jsxRuntime.jsx(_o,{colors:R,selectedColor:e,onSelect:G,columns:o==="highlight"?8:10}),h&&o==="text"&&jsxRuntime.jsxs("div",{style:Lo,children:[jsxRuntime.jsx("div",{style:ut,children:d("colorPicker.customColor")}),jsxRuntime.jsxs("div",{style:Ro,children:[jsxRuntime.jsx("span",{style:{fontSize:"12px",color:"#666"},children:"#"}),jsxRuntime.jsx("input",{type:"text",style:Do,value:k,onChange:A=>f(A.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:A=>{A.key==="Enter"&&v();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsxRuntime.jsx("button",{type:"button",style:Ko,onClick:v,disabled:!/^[0-9A-Fa-f]{6}$/.test(k),children:d("common.apply")})]})]})]})]})}var No={includeHeaders:true,includeFooters:true,includePageNumbers:true,pageRange:null,scale:1,printBackground:true,margins:"default"};function si({onPrint:e,disabled:t=false,label:o,className:i="",style:n,showIcon:r=true,compact:s=false}){let{t:c}=chunkQSUPYUOP_js.b(),l=o??c("print.label"),a={display:"flex",alignItems:"center",gap:s?"4px":"6px",padding:s?"4px 8px":"6px 12px",fontSize:s?"13px":"14px",backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:"4px",cursor:t?"not-allowed":"pointer",color:t?"var(--doc-text-muted)":"var(--doc-text)",opacity:t?.6:1,transition:"background-color 0.15s, border-color 0.15s",...n};return jsxRuntime.jsxs("button",{className:`docx-print-button ${i}`.trim(),style:a,onClick:e,disabled:t,"aria-label":l,title:l,children:[r&&jsxRuntime.jsx(Bo,{size:s?14:16}),!s&&jsxRuntime.jsx("span",{children:l})]})}function ai(){return jsxRuntime.jsx("style",{children:`
7
+ @media print {
8
+ /* Hide everything except print content */
9
+ body * {
10
+ visibility: hidden;
11
+ }
12
+
13
+ .docx-print-pages,
14
+ .docx-print-pages * {
15
+ visibility: visible;
16
+ }
17
+
18
+ .docx-print-pages {
19
+ position: absolute;
20
+ left: 0;
21
+ top: 0;
22
+ }
23
+
24
+ /* Remove shadows and margins in print */
25
+ .docx-print-page {
26
+ box-shadow: none !important;
27
+ margin: 0 !important;
28
+ page-break-after: always;
29
+ page-break-inside: avoid;
30
+ }
31
+
32
+ /* Ensure images print */
33
+ img {
34
+ max-width: 100%;
35
+ page-break-inside: avoid;
36
+ }
37
+
38
+ /* Ensure tables don't break badly */
39
+ table {
40
+ page-break-inside: avoid;
41
+ }
42
+
43
+ tr {
44
+ page-break-inside: avoid;
45
+ }
46
+
47
+ /* Keep headings with content */
48
+ h1, h2, h3, h4, h5, h6 {
49
+ page-break-after: avoid;
50
+ }
51
+
52
+ /* Avoid orphan lines */
53
+ p {
54
+ orphans: 3;
55
+ widows: 3;
56
+ }
57
+ }
58
+
59
+ @page {
60
+ margin: 0;
61
+ size: auto;
62
+ }
63
+ `})}function Bo({size:e=18}){return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("polyline",{points:"6 9 6 2 18 2 18 9"}),jsxRuntime.jsx("path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}),jsxRuntime.jsx("rect",{x:"6",y:"14",width:"12",height:"8"})]})}function li(){window.print();}function ci(e="Document",t){let o=window.open("","_blank");return o?(o.document.write(`
64
+ <!DOCTYPE html>
65
+ <html>
66
+ <head>
67
+ <title>${e}</title>
68
+ <style>
69
+ @media print {
70
+ body {
71
+ margin: 0;
72
+ padding: 0;
73
+ }
74
+ @page {
75
+ margin: 0;
76
+ }
77
+ }
78
+ </style>
79
+ </head>
80
+ <body>
81
+ ${t}
82
+ </body>
83
+ </html>
84
+ `),o.document.close(),o):null}function di(){return {...No}}function pi(e,t){if(!e||!e.trim())return null;let o=e.trim();if(/^\d+$/.test(o)){let n=parseInt(o,10);return n>=1&&n<=t?{start:n,end:n}:null}let i=o.match(/^(\d+)-(\d+)$/);if(i){let n=parseInt(i[1],10),r=parseInt(i[2],10);return n>=1&&r<=t&&n<=r?{start:n,end:r}:null}return null}function ui(e,t){return e?e.start===e.end?`Page ${e.start}`:`Pages ${e.start}-${e.end}`:`All (${t} pages)`}function gi(){return typeof window<"u"&&typeof window.print=="function"}function ki({onAction:e,disabled:t=false,canMerge:o=false,canSplit:i=false}){let{t:n}=chunkQSUPYUOP_js.b(),r=ir.useCallback(m=>{m.preventDefault(),m.stopPropagation();},[]),s=ir.useCallback(()=>{o&&e("mergeCells");},[e,o]),c=ir.useCallback(()=>{i&&e("splitCell");},[e,i]),l=jsxRuntime.jsx(chunkDC65PJYE_js.c,{content:n("table.mergeCells"),children:jsxRuntime.jsx(chunkDC65PJYE_js.b,{variant:"ghost",size:"icon-sm",className:chunkDC65PJYE_js.a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",(t||!o)&&"opacity-30 cursor-not-allowed"),onMouseDown:r,onClick:s,disabled:t||!o,"aria-label":n("table.mergeCells"),"data-testid":"toolbar-table-merge",children:jsxRuntime.jsx(chunkDC65PJYE_js.d,{name:"call_merge",size:20})})}),a=jsxRuntime.jsx(chunkDC65PJYE_js.c,{content:n("table.splitCell"),children:jsxRuntime.jsx(chunkDC65PJYE_js.b,{variant:"ghost",size:"icon-sm",className:chunkDC65PJYE_js.a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",(t||!i)&&"opacity-30 cursor-not-allowed"),onMouseDown:r,onClick:c,disabled:t||!i,"aria-label":n("table.splitCell"),"data-testid":"toolbar-table-split",children:jsxRuntime.jsx(chunkDC65PJYE_js.d,{name:"call_split",size:20})})});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l,a]})}var Yo=[{action:"addRowAbove",icon:"keyboard_arrow_up",labelKey:"table.insertRowAbove",testId:"toolbar-table-add-row-above"},{action:"addRowBelow",icon:"keyboard_arrow_down",labelKey:"table.insertRowBelow",testId:"toolbar-table-add-row-below"},{action:"addColumnLeft",icon:"keyboard_arrow_left",labelKey:"table.insertColumnLeft",testId:"toolbar-table-add-col-left"},{action:"addColumnRight",icon:"keyboard_arrow_right",labelKey:"table.insertColumnRight",testId:"toolbar-table-add-col-right"}];function Oi({onAction:e,disabled:t=false}){let{t:o}=chunkQSUPYUOP_js.b(),i=ir.useCallback(n=>{n.preventDefault(),n.stopPropagation();},[]);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Yo.map(({action:n,icon:r,labelKey:s,testId:c})=>{let l=o(s);return jsxRuntime.jsx(chunkDC65PJYE_js.c,{content:l,children:jsxRuntime.jsx(chunkDC65PJYE_js.b,{variant:"ghost",size:"icon-sm",className:chunkDC65PJYE_js.a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",t&&"opacity-30 cursor-not-allowed"),onMouseDown:i,onClick:()=>!t&&e(n),disabled:t,"aria-label":l,"data-testid":c,children:jsxRuntime.jsx(chunkDC65PJYE_js.d,{name:r,size:20})})},typeof n=="string"?n:n.type)})})}var Ho="var(--doc-error)",Vo="var(--doc-success)",$o=({size:e=16})=>jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M3 2h8l2 2v9a1 1 0 01-1 1H3a1 1 0 01-1-1V3a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M5 2v4h5V2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M5 14v-4h6v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Go=({size:e=16})=>jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M8 5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor"})]}),jo=`
85
+ @keyframes docx-unsaved-pulse {
86
+ 0%, 100% { opacity: 1; }
87
+ 50% { opacity: 0.6; }
88
+ }
89
+ `,Zo=(e,t,o,i,n,r,s)=>{let c={display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",animation:o&&i?"docx-unsaved-pulse 2s ease-in-out infinite":"none"};switch(t==="absolute-top-right"?(c.position="absolute",c.top="4px",c.right="4px"):t==="absolute-top-left"&&(c.position="absolute",c.top="4px",c.left="4px"),e){case "dot":return {...c,width:`${s}px`,height:`${s}px`,borderRadius:"50%",backgroundColor:o?n:r};case "badge":return {...c,padding:"2px 8px",borderRadius:"10px",fontSize:"11px",fontWeight:500,backgroundColor:o?n:r,color:"white"};case "text":return {...c,fontSize:"12px",color:o?n:r,fontWeight:500};case "icon":return {...c,color:o?n:r};default:return c}},Fi=({hasUnsavedChanges:e,variant:t="dot",position:o="inline",showPulse:i=true,label:n,savedLabel:r,showWhenSaved:s=false,unsavedColor:c=Ho,savedColor:l=Vo,size:a=8,className:m="",style:b,onClick:h,title:p})=>{let{t:u}=chunkQSUPYUOP_js.b(),g=n??u("unsaved.unsaved"),x=r??u("unsaved.saved");if(ir.useEffect(()=>{if(!i||!e)return;let C="docx-unsaved-pulse-keyframes";if(!document.getElementById(C)){let L=document.createElement("style");L.id=C,L.textContent=jo,document.head.appendChild(L);}},[i,e]),!e&&!s)return null;let f={...Zo(t,o,e,i,c,l,a),...b,cursor:h?"pointer":void 0},d=u(e?"unsaved.unsavedTitle":"unsaved.savedTitle"),y=()=>{switch(t){case "dot":return null;case "badge":return e?g:x;case "text":return e?g:x;case "icon":return e?jsxRuntime.jsx(Go,{size:a}):jsxRuntime.jsx($o,{size:a});default:return null}};return jsxRuntime.jsx("span",{className:`docx-unsaved-indicator docx-unsaved-indicator-${t} ${e?"docx-unsaved":"docx-saved"} ${m}`,style:f,onClick:h,title:p??d,role:h?"button":"status","aria-label":u(e?"unsaved.unsavedAriaLabel":"unsaved.savedAriaLabel"),children:y()})};function zi(e={}){let{t}=chunkQSUPYUOP_js.b(),{document:o,warnBeforeLeave:i=true,warningMessage:n=t("errors.unsavedChanges"),enabled:r=true,onChangeStatusChange:s}=e,[c,l]=ir.useState(false),[a,m]=ir.useState(0),[b,h]=ir.useState(null),p=ir.useRef(null),u=ir.useRef(false),g=ir.useCallback(d=>{if(!d)return null;try{return JSON.stringify(d.package)}catch{return null}},[]),x=ir.useCallback(()=>{r&&(l(false),m(0),h(o??null),p.current=g(o));},[r,o,g]),k=ir.useCallback(()=>{r&&(c||(l(true),s?.(true)),m(d=>d+1));},[r,c,s]),f=ir.useCallback(d=>{let y=d!==void 0?d:o;l(false),m(0),h(y??null),p.current=g(y),u.current=true;},[o,g]);return ir.useEffect(()=>{!r||!o||u.current||f(o);},[r,o,f]),ir.useEffect(()=>{if(!r||!o||!u.current)return;let d=g(o),y=p.current;if(d!==y){let C=g(b);d!==C?(c||(l(true),s?.(true)),m(L=>L+1)):c&&(l(false),s?.(false)),p.current=d;}},[r,o,b,c,g,s]),ir.useEffect(()=>{if(!r||!i||!c)return;let d=y=>(y.preventDefault(),y.returnValue=n,n);return window.addEventListener("beforeunload",d),()=>window.removeEventListener("beforeunload",d)},[r,i,c,n]),{hasUnsavedChanges:c,markAsSaved:x,markAsChanged:k,resetTracking:f,lastSavedDocument:b,changeCount:a}}function Wi(e){return {dot:"Dot",badge:"Badge",text:"Text",icon:"Icon"}[e]}function Yi(){return ["dot","badge","text","icon"]}function Ui(){return ["inline","absolute-top-right","absolute-top-left"]}function Hi(){let e=0,t=null,o=false;return {markChanged:()=>{e++,o=true;},markSaved:()=>{o=false,t=new Date;},getState:()=>({changeCount:e,lastSaveTime:t,hasUnsavedChanges:o}),reset:()=>{e=0,t=null,o=false;}}}var Xo={small:{size:16,strokeWidth:2,fontSize:11},medium:{size:32,strokeWidth:3,fontSize:13},large:{size:48,strokeWidth:4,fontSize:14}},Qo="var(--doc-primary)",Jo=300,qo=`
90
+ @keyframes docx-loading-spin {
91
+ 0% { transform: rotate(0deg); }
92
+ 100% { transform: rotate(360deg); }
93
+ }
94
+
95
+ @keyframes docx-loading-pulse {
96
+ 0%, 100% { opacity: 1; transform: scale(1); }
97
+ 50% { opacity: 0.5; transform: scale(0.95); }
98
+ }
99
+
100
+ @keyframes docx-loading-dots {
101
+ 0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
102
+ 40% { transform: scale(1); opacity: 1; }
103
+ }
104
+
105
+ @keyframes docx-loading-bar {
106
+ 0% { left: -35%; right: 100%; }
107
+ 60% { left: 100%; right: -90%; }
108
+ 100% { left: 100%; right: -90%; }
109
+ }
110
+ `,er=({size:e,strokeWidth:t,color:o})=>{let i=(e-t)/2,n=i*2*Math.PI;return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,style:{animation:"docx-loading-spin 1s linear infinite"},children:[jsxRuntime.jsx("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:o,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${n*.75} ${n}`,opacity:.25}),jsxRuntime.jsx("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:o,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${n*.25} ${n}`,transform:`rotate(-90 ${e/2} ${e/2})`})]})},tr=({size:e,color:t})=>{let o=e/4,i=o/2;return jsxRuntime.jsx("div",{style:{display:"flex",gap:`${i}px`},children:[0,1,2].map(n=>jsxRuntime.jsx("div",{style:{width:o,height:o,borderRadius:"50%",backgroundColor:t,animation:`docx-loading-dots 1.4s ease-in-out ${n*.16}s infinite both`}},n))})},or=({size:e,color:t})=>jsxRuntime.jsx("div",{style:{width:e*3,height:e/4,backgroundColor:`${t}20`,borderRadius:e/8,overflow:"hidden",position:"relative"},children:jsxRuntime.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:0,right:0,backgroundColor:t,borderRadius:e/8,animation:"docx-loading-bar 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"}})}),rr=({size:e,color:t})=>jsxRuntime.jsx("div",{style:{width:e,height:e,borderRadius:"50%",backgroundColor:t,animation:"docx-loading-pulse 1.5s ease-in-out infinite"}}),nr=({size:e,color:t,progress:o,showText:i,fontSize:n})=>{let r=Math.max(0,Math.min(100,o));return jsxRuntime.jsxs("div",{style:{width:e*3,height:e/4,backgroundColor:`${t}20`,borderRadius:e/8,overflow:"hidden",position:"relative"},children:[jsxRuntime.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:0,width:`${r}%`,backgroundColor:t,borderRadius:e/8,transition:"width 0.3s ease"}}),i&&jsxRuntime.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:n,fontWeight:500,color:r>50?"#fff":t},children:[Math.round(r),"%"]})]})},Xi=({isLoading:e,variant:t="spinner",size:o="medium",message:i,overlay:n=false,overlayOpacity:r=.5,progress:s=0,showProgressText:c=true,color:l=Qo,className:a="",style:m})=>{let{t:b}=chunkQSUPYUOP_js.b(),h=Xo[o];if(ir.useEffect(()=>{let g="docx-loading-keyframes";if(!document.getElementById(g)){let x=document.createElement("style");x.id=g,x.textContent=qo,document.head.appendChild(x);}},[]),!e)return null;let p=()=>{switch(t){case "spinner":return jsxRuntime.jsx(er,{size:h.size,strokeWidth:h.strokeWidth,color:l});case "dots":return jsxRuntime.jsx(tr,{size:h.size,color:l});case "bar":return jsxRuntime.jsx(or,{size:h.size,color:l});case "pulse":return jsxRuntime.jsx(rr,{size:h.size,color:l});case "progress":return jsxRuntime.jsx(nr,{size:h.size,color:l,progress:s,showText:c,fontSize:h.fontSize});default:return null}},u=jsxRuntime.jsxs("div",{className:`docx-loading-content ${a}`,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",...m},children:[p(),i&&jsxRuntime.jsx("div",{style:{fontSize:h.fontSize,color:n?"white":"var(--doc-text-muted)",textAlign:"center"},children:i})]});return n?jsxRuntime.jsx("div",{className:`docx-loading-overlay ${a}`,style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`rgba(0, 0, 0, ${r})`,zIndex:1e4,...m},role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t==="progress"?s:void 0,"aria-busy":"true","aria-label":i||b("loading.label"),children:u}):jsxRuntime.jsx("div",{className:`docx-loading-inline ${a}`,style:{display:"inline-flex",alignItems:"center",...m},role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t==="progress"?s:void 0,"aria-busy":"true","aria-label":i||"Loading",children:u})};function Qi(e={}){let{initialLoading:t=false,minDuration:o=Jo,onStart:i,onEnd:n}=e,[r,s]=ir.useState(t),[c,l]=ir.useState(null),[a,m]=ir.useState(0),b=ir.useRef(null),h=ir.useRef(null),p=ir.useCallback(x=>{b.current=Date.now(),s(true),l(x||null),m(0),i?.();},[i]),u=ir.useCallback(()=>{let x=b.current,k=Date.now(),f=x?k-x:0,d=Math.max(0,o-f);d>0?h.current=setTimeout(()=>{s(false),l(null),m(0),b.current=null,n?.();},d):(s(false),l(null),m(0),b.current=null,n?.());},[o,n]),g=ir.useCallback(async(x,k)=>{p(k);try{let f=await x();return u(),f}catch(f){throw u(),f}},[p,u]);return ir.useEffect(()=>()=>{h.current&&clearTimeout(h.current);},[]),{isLoading:r,message:c,progress:a,startLoading:p,stopLoading:u,setProgress:m,setMessage:l,withLoading:g}}function Ji(){let[e,t]=ir.useState(new Map),o=ir.useCallback((c,l)=>{t(a=>{let m=new Map(a);return m.set(c,{id:c,message:l,startTime:Date.now()}),m});},[]),i=ir.useCallback((c,l)=>{t(a=>{let m=a.get(c);if(!m)return a;let b=new Map(a);return b.set(c,{...m,...l}),b});},[]),n=ir.useCallback(c=>{t(l=>{let a=new Map(l);return a.delete(c),a});},[]),r=e.size>0;return {operations:Array.from(e.values()),isAnyLoading:r,startOperation:o,updateOperation:i,endOperation:n,getOperation:c=>e.get(c)}}function qi(e){return {spinner:"Spinner",dots:"Dots",bar:"Bar",pulse:"Pulse",progress:"Progress"}[e]}function es(){return ["spinner","dots","bar","pulse","progress"]}function ts(){return ["small","medium","large"]}function os(e){return new Promise(t=>setTimeout(t,e))}var yt=4,vt=36,lr=32,cr=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"3",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"13",cy:"8",r:"1.5",fill:"currentColor"})]});function dr(e){let{containerRef:t,items:o,itemGap:i=yt,overflowButtonWidth:n=vt}=e,[r,s]=ir.useState(o.length),c=ir.useRef(new Map),l=ir.useCallback(()=>{let b=t.current;if(!b){s(o.length);return}let h=b.offsetWidth;if(h===0)return;let p=[...o].sort((x,k)=>x.alwaysVisible&&!k.alwaysVisible?-1:!x.alwaysVisible&&k.alwaysVisible?1:(x.priority||3)-(k.priority||3)),u=0,g=0;for(let x of p){let f=(x.minWidth||c.current.get(x.id)||lr)+(g>0?i:0),d=g<o.length-1?n+i:0;if(u+f+d<=h)u+=f,g++;else if(x.alwaysVisible)u+=f,g++;else break}s(Math.max(0,g));},[t,o,i,n]);ir.useLayoutEffect(()=>{let b=t.current;if(!b)return;l();let h=new ResizeObserver(()=>{l();});return h.observe(b),()=>{h.disconnect();}},[t,l]),ir.useEffect(()=>{l();},[o,l]);let{visibleItems:a,overflowItems:m}=ir.useMemo(()=>{let b=[...o].sort((h,p)=>h.alwaysVisible&&!p.alwaysVisible?-1:!h.alwaysVisible&&p.alwaysVisible?1:(h.priority||3)-(p.priority||3));return {visibleItems:b.slice(0,r),overflowItems:b.slice(r)}},[o,r]);return {visibleItems:a,overflowItems:m,hasOverflow:m.length>0,recalculate:l}}var pr=({items:e,isOpen:t,onClose:o,anchorRef:i})=>{let n=ir.useRef(null);return ir.useEffect(()=>{if(!t)return;let r=s=>{n.current&&!n.current.contains(s.target)&&i.current&&!i.current.contains(s.target)&&o();};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[t,o,i]),ir.useEffect(()=>{if(!t)return;let r=s=>{s.key==="Escape"&&o();};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,o]),!t||e.length===0?null:jsxRuntime.jsx("div",{ref:n,className:"docx-responsive-toolbar-overflow-menu",style:{position:"absolute",top:"100%",right:0,marginTop:"4px",backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",padding:"8px",zIndex:1e3,display:"flex",flexWrap:"wrap",gap:"4px",maxWidth:"300px"},role:"menu",children:e.map(r=>jsxRuntime.jsx("div",{className:"docx-responsive-toolbar-overflow-item",role:"menuitem",children:r.content},r.id))})},ss=({items:e,overflowItems:t=[],alwaysShowOverflow:o=false,renderOverflowButton:i,renderOverflowMenu:n,itemGap:r=yt,padding:s="8px 12px",overflowButtonWidth:c=vt,className:l="",style:a,height:m=44,backgroundColor:b="var(--doc-toolbar-bg)",borderBottom:h="1px solid var(--doc-border)"})=>{let p=ir.useRef(null),u=ir.useRef(null),[g,x]=ir.useState(false),{visibleItems:k,overflowItems:f,hasOverflow:d}=dr({containerRef:p,items:e,itemGap:r,overflowButtonWidth:c}),y=[...f,...t],C=d||o||t.length>0,L=ir.useCallback(()=>{x(R=>!R);},[]),Y=ir.useCallback(()=>{x(false);},[]),D=jsxRuntime.jsx("button",{ref:u,type:"button",className:"docx-responsive-toolbar-overflow-button",onClick:L,"aria-label":`Show ${y.length} more options`,"aria-expanded":g,"aria-haspopup":"menu",style:{display:"flex",alignItems:"center",justifyContent:"center",width:`${c}px`,height:"32px",border:"none",borderRadius:"4px",backgroundColor:g?"var(--doc-primary-light)":"transparent",color:"var(--doc-text-muted)",cursor:"pointer",transition:"background-color 0.15s ease"},children:jsxRuntime.jsx(cr,{})});return jsxRuntime.jsxs("div",{ref:p,className:`docx-responsive-toolbar ${l}`,style:{display:"flex",alignItems:"center",gap:`${r}px`,height:typeof m=="number"?`${m}px`:m,padding:s,backgroundColor:b,borderBottom:h,position:"relative",...a},children:[k.map(R=>jsxRuntime.jsxs(ir__default.default.Fragment,{children:[jsxRuntime.jsx("div",{className:"docx-responsive-toolbar-item","data-item-id":R.id,style:{flexShrink:0},children:R.content}),R.separatorAfter&&jsxRuntime.jsx("div",{className:"docx-responsive-toolbar-separator",style:{width:"1px",height:"24px",backgroundColor:"var(--doc-border)",margin:"0 4px"}})]},R.id)),C&&jsxRuntime.jsx("div",{style:{flex:1,minWidth:0}}),C&&jsxRuntime.jsxs("div",{style:{position:"relative",flexShrink:0},children:[i?i(y.length,g,L):D,n?g&&n(y,Y):jsxRuntime.jsx(pr,{items:y,isOpen:g,onClose:Y,anchorRef:u})]})]})},as=({children:e,gap:t=2,separatorAfter:o=false,className:i="",style:n})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:`docx-toolbar-group ${i}`,style:{display:"flex",alignItems:"center",gap:`${t}px`,...n},children:e}),o&&jsxRuntime.jsx("div",{className:"docx-toolbar-group-separator",style:{width:"1px",height:"24px",backgroundColor:"var(--doc-border)",margin:"0 4px"}})]});function ls(e,t,o){return {id:e,content:t,priority:3,...o}}function cs(e){return e.map(t=>({...t,priority:t.priority||3}))}function ds(e){return {undo:1,redo:1,bold:1,italic:1,underline:2,fontFamily:2,fontSize:2,textColor:3,highlightColor:3,alignment:3,lists:4,indent:4,lineSpacing:5,styles:5}[e]||3}var mr={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},hr={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"320px",maxWidth:"400px",width:"100%",margin:"20px"},xr={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},br={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},fr={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},yr={padding:"20px"},vr={display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"16px"},Sr={display:"grid",gap:"2px",padding:"4px",backgroundColor:"var(--doc-bg-hover)",borderRadius:"4px",cursor:"pointer"},Pt={width:"24px",height:"24px",backgroundColor:"white",border:"1px solid var(--doc-border-dark)",borderRadius:"2px",transition:"background-color 0.1s, border-color 0.1s"},Cr={...Pt,backgroundColor:"var(--doc-primary)",borderColor:"var(--doc-primary)"},kr={marginTop:"8px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},wr={display:"flex",alignItems:"center",gap:"12px",margin:"16px 0",color:"var(--doc-text-muted)",fontSize:"12px"},Ct={flex:1,height:"1px",backgroundColor:"var(--doc-border)"},kt={display:"flex",alignItems:"center",gap:"12px",marginBottom:"12px"},wt={fontSize:"14px",fontWeight:500,color:"var(--doc-text)",minWidth:"80px"},Tt={width:"80px",padding:"8px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",textAlign:"center"},Tr={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},Ze={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},Pr={...Ze,backgroundColor:"var(--doc-primary)",color:"white"},Er={...Ze,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},Ir={...Ze,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function Lr(){return jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"2",width:"16",height:"16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",rx:"1"}),jsxRuntime.jsx("line",{x1:"2",y1:"7",x2:"18",y2:"7",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("line",{x1:"2",y1:"12",x2:"18",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"18",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("line",{x1:"13",y1:"2",x2:"13",y2:"18",stroke:"currentColor",strokeWidth:"1.5"})]})}function xs({isOpen:e,onClose:t,onInsert:o,maxGridRows:i=8,maxGridColumns:n=10,maxRows:r=100,maxColumns:s=20,className:c,style:l}){let{t:a}=chunkQSUPYUOP_js.b(),[m,b]=ir.useState(0),[h,p]=ir.useState(0),[u,g]=ir.useState(3),[x,k]=ir.useState(3),f=ir.useRef(null);ir.useEffect(()=>{e&&(b(0),p(0),g(3),k(3));},[e]),ir.useEffect(()=>{e&&f.current?.focus();},[e]);let d=ir.useCallback((T,K)=>{b(T),p(K);},[]),y=ir.useCallback(()=>{m>0&&h>0&&o({rows:m,columns:h});},[m,h,o]),C=ir.useCallback(()=>{let T=Math.min(Math.max(1,u),r),K=Math.min(Math.max(1,x),s);o({rows:T,columns:K});},[u,x,r,s,o]),L=ir.useCallback(T=>{T.key==="Escape"?t():T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),C());},[t,C]),Y=ir.useCallback(T=>{T.target===T.currentTarget&&t();},[t]),D=ir.useCallback(T=>{let K=parseInt(T.target.value,10);isNaN(K)?T.target.value===""&&g(1):g(Math.min(Math.max(1,K),r));},[r]),R=ir.useCallback(T=>{let K=parseInt(T.target.value,10);isNaN(K)?T.target.value===""&&k(1):k(Math.min(Math.max(1,K),s));},[s]);if(!e)return null;let X=[];for(let T=1;T<=i;T++)for(let K=1;K<=n;K++){let V=T<=m&&K<=h;X.push(jsxRuntime.jsx("div",{style:V?Cr:Pt,onMouseEnter:()=>d(T,K),onClick:y,role:"gridcell","aria-selected":V},`${T}-${K}`));}let G=u>=1&&x>=1,v=m>0&&h>0?a("dialogs.insertTable.tableSize",{cols:h,rows:m}):a("dialogs.insertTable.hoverToSelect");return jsxRuntime.jsx("div",{className:`docx-insert-table-dialog-overlay ${c||""}`,style:{...mr,...l},onClick:Y,onKeyDown:L,role:"dialog","aria-modal":"true","aria-labelledby":"insert-table-dialog-title",children:jsxRuntime.jsxs("div",{ref:f,className:"docx-insert-table-dialog",style:hr,tabIndex:-1,children:[jsxRuntime.jsxs("div",{className:"docx-insert-table-dialog-header",style:xr,children:[jsxRuntime.jsx("h2",{id:"insert-table-dialog-title",style:br,children:jsxRuntime.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[jsxRuntime.jsx(Lr,{}),a("dialogs.insertTable.title")]})}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-table-dialog-close",style:fr,onClick:t,"aria-label":a("common.closeDialog"),children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"docx-insert-table-dialog-body",style:yr,children:[jsxRuntime.jsxs("div",{className:"docx-insert-table-grid-container",style:vr,children:[jsxRuntime.jsx("div",{className:"docx-insert-table-grid",style:{...Sr,gridTemplateColumns:`repeat(${n}, 1fr)`},onMouseLeave:()=>{b(0),p(0);},role:"grid","aria-label":"Table size selector",children:X}),jsxRuntime.jsx("div",{className:"docx-insert-table-grid-label",style:kr,children:v})]}),jsxRuntime.jsxs("div",{className:"docx-insert-table-separator",style:wr,children:[jsxRuntime.jsx("div",{style:Ct}),jsxRuntime.jsx("span",{children:a("dialogs.insertTable.orSpecifySize")}),jsxRuntime.jsx("div",{style:Ct})]}),jsxRuntime.jsxs("div",{className:"docx-insert-table-inputs",children:[jsxRuntime.jsxs("div",{style:kt,children:[jsxRuntime.jsx("label",{htmlFor:"insert-table-rows",style:wt,children:a("dialogs.insertTable.rowsLabel")}),jsxRuntime.jsx("input",{id:"insert-table-rows",type:"number",min:1,max:r,value:u,onChange:D,style:Tt})]}),jsxRuntime.jsxs("div",{style:kt,children:[jsxRuntime.jsx("label",{htmlFor:"insert-table-cols",style:wt,children:a("dialogs.insertTable.columnsLabel")}),jsxRuntime.jsx("input",{id:"insert-table-cols",type:"number",min:1,max:s,value:x,onChange:R,style:Tt})]})]})]}),jsxRuntime.jsxs("div",{className:"docx-insert-table-dialog-footer",style:Tr,children:[jsxRuntime.jsx("button",{type:"button",className:"docx-insert-table-dialog-cancel",style:Er,onClick:t,children:a("common.cancel")}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-table-dialog-insert",style:G?Pr:Ir,onClick:C,disabled:!G,children:a("dialogs.insertTable.insertButton")})]})]})})}function bs(){let[e,t]=ir.useState(false),o=ir.useCallback(()=>t(true),[]),i=ir.useCallback(()=>t(false),[]),n=ir.useCallback(()=>t(r=>!r),[]);return {isOpen:e,open:o,close:i,toggle:n}}function fs(e=3,t=3){return {rows:e,columns:t}}function ys(e,t=100,o=20){return e.rows>=1&&e.rows<=t&&e.columns>=1&&e.columns<=o}function vs(e,t=100,o=20){return {rows:Math.min(Math.max(1,e.rows),t),columns:Math.min(Math.max(1,e.columns),o)}}function Ss(e){return `${e.columns} x ${e.rows}`}function Cs(){return [{label:"2 x 2",config:{rows:2,columns:2}},{label:"3 x 3",config:{rows:3,columns:3}},{label:"4 x 4",config:{rows:4,columns:4}},{label:"2 x 4",config:{rows:2,columns:4}},{label:"4 x 2",config:{rows:4,columns:2}},{label:"5 x 5",config:{rows:5,columns:5}}]}var Dr={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},Kr={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"450px",maxWidth:"600px",width:"100%",margin:"20px",maxHeight:"90vh",overflow:"auto"},Or={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},Ar={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},Mr={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},_r={padding:"20px"},Xe={border:"2px dashed var(--doc-border-input)",borderRadius:"8px",padding:"40px 20px",textAlign:"center",cursor:"pointer",transition:"border-color 0.2s, background-color 0.2s",marginBottom:"16px"},Nr={...Xe,borderColor:"var(--doc-primary)",backgroundColor:"var(--doc-primary-light)"},Br={...Xe,padding:"20px",borderStyle:"solid",borderColor:"var(--doc-primary)"},Fr={display:"flex",justifyContent:"center",alignItems:"center",maxHeight:"250px",overflow:"hidden"},zr={maxWidth:"100%",maxHeight:"250px",objectFit:"contain",borderRadius:"4px"},Wr={fontSize:"48px",color:"var(--doc-text-placeholder)",marginBottom:"12px"},Yr={fontSize:"14px",color:"var(--doc-text-muted)",marginBottom:"8px"},Ur={fontSize:"12px",color:"var(--doc-text-placeholder)"},It={marginBottom:"16px"},Lt={display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},Hr={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",boxSizing:"border-box"},Vr={display:"flex",alignItems:"center",gap:"12px"},Rt={width:"100px",padding:"8px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",textAlign:"center"},Kt={padding:"6px 10px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",backgroundColor:"white",cursor:"pointer",fontSize:"16px"},$r={...Kt,backgroundColor:"var(--doc-primary)",borderColor:"var(--doc-primary)",color:"white"},Gr={fontSize:"12px",color:"var(--doc-text-muted)",marginTop:"8px",textAlign:"center"},jr={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},Qe={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},Zr={...Qe,backgroundColor:"var(--doc-primary)",color:"white"},Xr={...Qe,backgroundColor:"var(--doc-bg-subtle)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},Qr={...Qe,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function Jr(){return jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"6",y:"10",width:"36",height:"28",rx:"2",stroke:"var(--doc-text-placeholder)",strokeWidth:"2",fill:"none"}),jsxRuntime.jsx("circle",{cx:"16",cy:"20",r:"4",stroke:"var(--doc-text-placeholder)",strokeWidth:"2",fill:"none"}),jsxRuntime.jsx("path",{d:"M6 32L16 24L26 34L36 22L42 28",stroke:"var(--doc-text-placeholder)",strokeWidth:"2",fill:"none"})]})}function qr({locked:e}){return e?jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M12 6V4a4 4 0 0 0-8 0v2H3v8h10V6h-1zm-6-2a2 2 0 0 1 4 0v2H6V4zm6 8H4V8h8v4z"})}):jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M10 6V4a2 2 0 0 0-4 0v2H4v8h8V6h-2zM6 4a2 2 0 0 1 4 0v2h-2V4H6v2H4v2H6V4zm4 8H6V8h4v4z"})})}function Is({isOpen:e,onClose:t,onInsert:o,maxWidth:i=800,maxHeight:n=600,accept:r="image/*",className:s,style:c}){let{t:l}=chunkQSUPYUOP_js.b(),[a,m]=ir.useState(null),[b,h]=ir.useState(false),[p,u]=ir.useState(0),[g,x]=ir.useState(0),[k,f]=ir.useState(""),[d,y]=ir.useState(true),[C,L]=ir.useState(1),[Y,D]=ir.useState(null),R=ir.useRef(null),X=ir.useRef(null);ir.useEffect(()=>{e&&(m(null),h(false),u(0),x(0),f(""),y(true),L(1),D(null));},[e]);let G=ir.useCallback(E=>{if(!E.type.startsWith("image/")){D(l("dialogs.insertImage.invalidFile"));return}if(E.size>10*1024*1024){D(l("dialogs.insertImage.fileTooLarge"));return}D(null);let z=new FileReader;z.onload=$t=>{let rt=$t.target?.result,ae=new Image;ae.onload=()=>{let le=ae.width,ce=ae.height;if(le>i||ce>n){let Gt=i/le,jt=n/ce,nt=Math.min(Gt,jt);le=Math.round(le*nt),ce=Math.round(ce*nt);}u(le),x(ce),L(ae.width/ae.height),m({src:rt,width:le,height:ce,fileName:E.name,mimeType:E.type});},ae.src=rt;},z.onerror=()=>{D("Failed to read image file");},z.readAsDataURL(E);},[i,n]),v=ir.useCallback(E=>{let z=E.target.files?.[0];z&&G(z);},[G]),T=ir.useCallback(()=>{R.current?.click();},[]),K=ir.useCallback(E=>{E.preventDefault(),h(true);},[]),V=ir.useCallback(E=>{E.preventDefault(),h(false);},[]),A=ir.useCallback(E=>{E.preventDefault(),h(false);let z=E.dataTransfer.files?.[0];z&&G(z);},[G]),zt=ir.useCallback(E=>{let z=parseInt(E.target.value,10)||0;u(z),d&&C&&x(Math.round(z/C));},[d,C]),Wt=ir.useCallback(E=>{let z=parseInt(E.target.value,10)||0;x(z),d&&C&&u(Math.round(z*C));},[d,C]),Be=ir.useCallback(()=>{a&&o({...a,width:p,height:g,alt:k||void 0});},[a,p,g,k,o]),Yt=ir.useCallback(E=>{E.key==="Escape"?t():E.key==="Enter"&&a&&!E.shiftKey&&(E.preventDefault(),Be());},[t,a,Be]),Ut=ir.useCallback(E=>{E.target===E.currentTarget&&t();},[t]),Ht=ir.useCallback(()=>{m(null),u(0),x(0),f(""),D(null),R.current&&(R.current.value="");},[]);if(!e)return null;let ot=a!==null&&p>0&&g>0,Vt=()=>a?Br:b?Nr:Xe;return jsxRuntime.jsx("div",{className:`docx-insert-image-dialog-overlay ${s||""}`,style:{...Dr,...c},onClick:Ut,onKeyDown:Yt,role:"dialog","aria-modal":"true","aria-labelledby":"insert-image-dialog-title",children:jsxRuntime.jsxs("div",{ref:X,className:"docx-insert-image-dialog",style:Kr,tabIndex:-1,children:[jsxRuntime.jsxs("div",{className:"docx-insert-image-dialog-header",style:Or,children:[jsxRuntime.jsx("h2",{id:"insert-image-dialog-title",style:Ar,children:l("dialogs.insertImage.title")}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-image-dialog-close",style:Mr,onClick:t,"aria-label":l("common.closeDialog"),children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"docx-insert-image-dialog-body",style:_r,children:[jsxRuntime.jsx("input",{ref:R,type:"file",accept:r,onChange:v,style:{display:"none"}}),jsxRuntime.jsx("div",{className:"docx-insert-image-dropzone",style:Vt(),onClick:T,onDragOver:K,onDragLeave:V,onDrop:A,role:"button",tabIndex:0,"aria-label":l("dialogs.insertImage.uploadAriaLabel"),children:a?jsxRuntime.jsx("div",{style:Fr,children:jsxRuntime.jsx("img",{src:a.src,alt:k||"Preview",style:zr})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:Wr,children:jsxRuntime.jsx(Jr,{})}),jsxRuntime.jsx("div",{style:Yr,children:l("dialogs.insertImage.uploadText")}),jsxRuntime.jsx("div",{style:Ur,children:l("dialogs.insertImage.uploadSubtext")})]})}),a?.fileName&&jsxRuntime.jsxs("div",{style:Gr,children:[a.fileName,jsxRuntime.jsx("button",{type:"button",onClick:E=>{E.stopPropagation(),Ht();},style:{marginLeft:"8px",background:"none",border:"none",color:"var(--doc-primary)",cursor:"pointer",fontSize:"12px"},children:l("common.change")})]}),Y&&jsxRuntime.jsx("div",{style:{color:"var(--doc-error)",fontSize:"14px",marginBottom:"16px",textAlign:"center"},children:Y}),a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{style:It,children:[jsxRuntime.jsx("label",{style:Lt,children:l("dialogs.insertImage.dimensions")}),jsxRuntime.jsxs("div",{style:Vr,children:[jsxRuntime.jsx("span",{style:{fontSize:"14px",color:"var(--doc-text-muted)"},children:l("dialogs.insertImage.widthLabel")}),jsxRuntime.jsx("input",{type:"number",value:p,onChange:zt,min:1,max:i,style:Rt}),jsxRuntime.jsx("span",{style:{fontSize:"14px",color:"var(--doc-text-muted)"},children:l("common.px")}),jsxRuntime.jsx("button",{type:"button",onClick:()=>y(!d),style:d?$r:Kt,title:l(d?"dialogs.insertImage.aspectRatioLocked":"dialogs.insertImage.aspectRatioUnlocked"),children:jsxRuntime.jsx(qr,{locked:d})}),jsxRuntime.jsx("span",{style:{fontSize:"14px",color:"var(--doc-text-muted)"},children:l("dialogs.insertImage.heightLabel")}),jsxRuntime.jsx("input",{type:"number",value:g,onChange:Wt,min:1,max:n,style:Rt}),jsxRuntime.jsx("span",{style:{fontSize:"14px",color:"var(--doc-text-muted)"},children:l("common.px")})]})]}),jsxRuntime.jsxs("div",{style:It,children:[jsxRuntime.jsx("label",{htmlFor:"insert-image-alt",style:Lt,children:l("dialogs.insertImage.altTextLabel")}),jsxRuntime.jsx("input",{id:"insert-image-alt",type:"text",value:k,onChange:E=>f(E.target.value),placeholder:l("dialogs.insertImage.altTextPlaceholder"),style:Hr})]})]})]}),jsxRuntime.jsxs("div",{className:"docx-insert-image-dialog-footer",style:jr,children:[jsxRuntime.jsx("button",{type:"button",className:"docx-insert-image-dialog-cancel",style:Xr,onClick:t,children:l("common.cancel")}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-image-dialog-insert",style:ot?Zr:Qr,onClick:Be,disabled:!ot,children:l("dialogs.insertImage.insertButton")})]})]})})}function Ls(){let[e,t]=ir.useState(false),o=ir.useCallback(()=>t(true),[]),i=ir.useCallback(()=>t(false),[]),n=ir.useCallback(()=>t(r=>!r),[]);return {isOpen:e,open:o,close:i,toggle:n}}function Rs(e){return e.type.startsWith("image/")}function Ds(){return [".png",".jpg",".jpeg",".gif",".webp",".bmp",".svg"]}function Ks(){return "image/png,image/jpeg,image/gif,image/webp,image/bmp,image/svg+xml"}function Os(e,t,o,i){if(e<=o&&t<=i)return {width:e,height:t};let n=o/e,r=i/t,s=Math.min(n,r);return {width:Math.round(e*s),height:Math.round(t*s)}}function As(e){let t=e.split(","),o=t[0].match(/:(.*?);/)?.[1]||"image/png",i=atob(t[1]),n=new Uint8Array(i.length);for(let r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return new Blob([n],{type:o})}function Ms(e){return new Promise((t,o)=>{let i=new Image;i.onload=()=>t({width:i.width,height:i.height}),i.onerror=()=>o(new Error("Failed to load image")),i.src=e;})}function _s(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var rn={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},nn={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"450px",maxWidth:"550px",width:"100%",margin:"20px",maxHeight:"80vh",display:"flex",flexDirection:"column"},sn={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},an={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},ln={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},cn={padding:"20px",flex:1,overflow:"auto"},dn={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",marginBottom:"16px",boxSizing:"border-box"},pn={display:"flex",flexWrap:"wrap",gap:"4px",marginBottom:"16px"},Ot={padding:"6px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",backgroundColor:"white",cursor:"pointer",fontSize:"12px",transition:"all 0.15s"},un={...Ot,backgroundColor:"var(--doc-primary)",borderColor:"var(--doc-primary)",color:"white"},gn={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",maxHeight:"250px",overflow:"auto"},mn={width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--doc-border)",borderRadius:"4px",backgroundColor:"white",cursor:"pointer",fontSize:"18px",transition:"all 0.15s"},hn={marginTop:"16px",padding:"12px",backgroundColor:"var(--doc-bg-subtle)",borderRadius:"4px",display:"flex",alignItems:"center",gap:"16px"},xn={fontSize:"36px",width:"60px",height:"60px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"white",borderRadius:"4px",border:"1px solid var(--doc-border)"},bn={flex:1},fn={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},Je={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},yn={...Je,backgroundColor:"var(--doc-primary)",color:"white"},vn={...Je,backgroundColor:"var(--doc-bg-subtle)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},Sn={...Je,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"},Ce=[{name:"common",label:"Common",symbols:["\xA9","\xAE","\u2122","\u2022","\u2026","\u2014","\u2013","\xB0","\xB1","\xD7","\xF7","\u2260","\u2264","\u2265","\u221E","\u221A","\u2211","\u220F","\u222B","\u03C0","\u20AC","\xA3","\xA5","\xA2","\xA7","\xB6","\u2020","\u2021","\u2030","\u2116"]},{name:"arrows",label:"Arrows",symbols:["\u2190","\u2191","\u2192","\u2193","\u2194","\u2195","\u2196","\u2197","\u2198","\u2199","\u21D0","\u21D1","\u21D2","\u21D3","\u21D4","\u21D5","\u27F5","\u27F6","\u27F7","\u2794","\u279C","\u279E","\u27A1","\u27A2","\u27A3","\u27A4","\u27A5","\u27A6","\u27A7","\u27A8"]},{name:"math",label:"Math",symbols:["+","\u2212","\xD7","\xF7","=","\u2260","<",">","\u2264","\u2265","\xB1","\u2213","\u221E","\u221A","\u221B","\u221C","\u2211","\u220F","\u222B","\u2202","\u2206","\u2207","\u2208","\u2209","\u220B","\u2205","\u2200","\u2203","\u2204","\u2282","\u2283","\u2286","\u2287","\u222A","\u2229","\u2295","\u2297","\u22A5","\u2220","\u221F"]},{name:"greek",label:"Greek",symbols:["\u03B1","\u03B2","\u03B3","\u03B4","\u03B5","\u03B6","\u03B7","\u03B8","\u03B9","\u03BA","\u03BB","\u03BC","\u03BD","\u03BE","\u03BF","\u03C0","\u03C1","\u03C3","\u03C4","\u03C5","\u03C6","\u03C7","\u03C8","\u03C9","\u0391","\u0392","\u0393","\u0394","\u0395","\u0396","\u0397","\u0398","\u0399","\u039A","\u039B","\u039C","\u039D","\u039E","\u039F","\u03A0"]},{name:"shapes",label:"Shapes",symbols:["\u25A0","\u25A1","\u25AA","\u25AB","\u25AC","\u25AD","\u25AE","\u25AF","\u25B0","\u25B1","\u25B2","\u25B3","\u25B4","\u25B5","\u25B6","\u25B7","\u25B8","\u25B9","\u25BA","\u25BB","\u25BC","\u25BD","\u25BE","\u25BF","\u25C0","\u25C1","\u25C2","\u25C3","\u25C4","\u25C5","\u25CF","\u25CB","\u25CE","\u25C9","\u25CC","\u25CD","\u25D0","\u25D1","\u25D2","\u25D3"]},{name:"punctuation",label:"Punctuation",symbols:["\u2013","\u2014","\u2018","\u2019","\u201C","\u201D","\xAB","\xBB","\u2039","\u203A","\u2026","\xB7","\u2022","\u2023","\u2043","\u2010","\u2011","\u2012","\u2015","\u2016","\u2032","\u2033","\u2034","\u2057","\u2035","\u2036","\u2037","\u203B","\u203D","\u2042"]},{name:"currency",label:"Currency",symbols:["$","\xA2","\xA3","\xA4","\xA5","\u20A0","\u20A1","\u20A2","\u20A3","\u20A4","\u20A5","\u20A6","\u20A7","\u20A8","\u20A9","\u20AA","\u20AB","\u20AC","\u20AD","\u20AE","\u20AF","\u20B0","\u20B1","\u20B2","\u20B3","\u20B4","\u20B5","\u20B6","\u20B7","\u20B8"]},{name:"music",label:"Music",symbols:["\u2669","\u266A","\u266B","\u266C","\u266D","\u266E","\u266F","\u{1D11E}","\u{1D122}","\u{1D12A}","\u{1D12B}","\u{1D157}\u{1D165}","\u{1D158}\u{1D165}","\u{1D158}\u{1D165}\u{1D16E}","\u{1D158}\u{1D165}\u{1D16F}","\u{1D158}\u{1D165}\u{1D170}","\u{1D192}","\u{1D193}","\u{1D110}","\u{1D111}"]},{name:"emoji",label:"Emoji",symbols:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A","\u{1F61A}","\u2764","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F494}","\u2763","\u{1F44D}","\u{1F44E}","\u{1F44C}","\u270C","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F44B}","\u{1F64F}","\u2705"]}];function At(){return Ce.flatMap(e=>e.symbols)}function Ys({isOpen:e,onClose:t,onInsert:o,recentSymbols:i=[],className:n,style:r}){let{t:s}=chunkQSUPYUOP_js.b(),[c,l]=ir.useState("common"),[a,m]=ir.useState(null),[b,h]=ir.useState(""),[p,u]=ir.useState(null),g=ir.useRef(null);ir.useEffect(()=>{e&&(m(null),h(""),u(null),setTimeout(()=>g.current?.focus(),100));},[e]);let x=ir.useMemo(()=>{if(!b.trim())return c==="recent"?i:Ce.find(V=>V.name===c)?.symbols||[];let v=b.toLowerCase();return At().filter(K=>{let V=K.codePointAt(0)?.toString(16).toUpperCase()||"";return K.includes(v)||V.includes(v.toUpperCase())||`U+${V}`.toLowerCase().includes(v)})},[b,c,i]),k=ir.useCallback(v=>{m(v);},[]),f=ir.useCallback(v=>{o(v);},[o]),d=ir.useCallback(()=>{a&&o(a);},[a,o]),y=ir.useCallback(v=>{v.key==="Escape"?t():v.key==="Enter"&&a&&(v.preventDefault(),d());},[t,a,d]),C=ir.useCallback(v=>{v.target===v.currentTarget&&t();},[t]),L=v=>{if(!v)return null;let T=v.codePointAt(0);return {character:v,codePoint:T?`U+${T.toString(16).toUpperCase().padStart(4,"0")}`:"",decimal:T||0}};if(!e)return null;let D=L(p||a),R=a!==null,X={common:s("dialogs.insertSymbol.categories.common"),arrows:s("dialogs.insertSymbol.categories.arrows"),math:s("dialogs.insertSymbol.categories.math"),greek:s("dialogs.insertSymbol.categories.greek"),shapes:s("dialogs.insertSymbol.categories.shapes"),punctuation:s("dialogs.insertSymbol.categories.punctuation"),currency:s("dialogs.insertSymbol.categories.currency"),music:s("dialogs.insertSymbol.categories.music"),emoji:s("dialogs.insertSymbol.categories.emoji")},G=[...i.length>0?[{name:"recent",label:"Recent"}]:[],...Ce.map(v=>({name:v.name,label:X[v.name]||v.label}))];return jsxRuntime.jsx("div",{className:`docx-insert-symbol-dialog-overlay ${n||""}`,style:{...rn,...r},onClick:C,onKeyDown:y,role:"dialog","aria-modal":"true","aria-labelledby":"insert-symbol-dialog-title",children:jsxRuntime.jsxs("div",{className:"docx-insert-symbol-dialog",style:nn,children:[jsxRuntime.jsxs("div",{className:"docx-insert-symbol-dialog-header",style:sn,children:[jsxRuntime.jsx("h2",{id:"insert-symbol-dialog-title",style:an,children:s("dialogs.insertSymbol.title")}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-symbol-dialog-close",style:ln,onClick:t,"aria-label":s("common.closeDialog"),children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"docx-insert-symbol-dialog-body",style:cn,children:[jsxRuntime.jsx("input",{ref:g,type:"text",placeholder:s("dialogs.insertSymbol.searchPlaceholder"),value:b,onChange:v=>h(v.target.value),style:dn}),!b&&jsxRuntime.jsx("div",{className:"docx-insert-symbol-categories",style:pn,children:G.map(v=>jsxRuntime.jsx("button",{type:"button",onClick:()=>l(v.name),style:c===v.name?un:Ot,children:v.label},v.name))}),jsxRuntime.jsx("div",{className:"docx-insert-symbol-grid",style:gn,children:x.map((v,T)=>jsxRuntime.jsx("button",{type:"button",onClick:()=>k(v),onDoubleClick:()=>f(v),onMouseEnter:()=>u(v),onMouseLeave:()=>u(null),style:{...mn,...a===v?{backgroundColor:"var(--doc-primary-light)",borderColor:"var(--doc-primary)"}:{}},title:`${v} - U+${v.codePointAt(0)?.toString(16).toUpperCase()}`,children:v},`${v}-${T}`))}),x.length===0&&jsxRuntime.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--doc-text-muted)"},children:s("dialogs.insertSymbol.noResults",{query:b})}),D&&jsxRuntime.jsxs("div",{className:"docx-insert-symbol-preview",style:hn,children:[jsxRuntime.jsx("div",{style:xn,children:D.character}),jsxRuntime.jsxs("div",{style:bn,children:[jsxRuntime.jsx("div",{style:{fontSize:"14px",fontWeight:500,marginBottom:"4px"},children:D.codePoint}),jsxRuntime.jsx("div",{style:{fontSize:"12px",color:"var(--doc-text-muted)"},children:s("dialogs.insertSymbol.decimal",{value:D.decimal})})]})]})]}),jsxRuntime.jsxs("div",{className:"docx-insert-symbol-dialog-footer",style:fn,children:[jsxRuntime.jsx("button",{type:"button",className:"docx-insert-symbol-dialog-cancel",style:vn,onClick:t,children:s("common.cancel")}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-symbol-dialog-insert",style:R?yn:Sn,onClick:d,disabled:!R,children:s("common.insert")})]})]})})}function Us(e=20){let[t,o]=ir.useState(false),[i,n]=ir.useState([]),r=ir.useCallback(()=>o(true),[]),s=ir.useCallback(()=>o(false),[]),c=ir.useCallback(()=>o(a=>!a),[]),l=ir.useCallback(a=>{n(m=>{let b=m.filter(h=>h!==a);return [a,...b].slice(0,e)});},[e]);return {isOpen:t,recentSymbols:i,open:r,close:s,toggle:c,addRecent:l}}function Hs(){return Ce}function Vs(e){return Ce.find(o=>o.name===e)?.symbols||[]}function $s(e){let t=e.codePointAt(0)||0;return {character:e,codePoint:`U+${t.toString(16).toUpperCase().padStart(4,"0")}`,decimal:t,hex:t.toString(16).toUpperCase()}}function Gs(e){if(!e.trim())return [];let t=e.toLowerCase();return At().filter(o=>{let i=o.codePointAt(0)?.toString(16).toUpperCase()||"";return o.includes(e)||i.includes(t.toUpperCase())||`U+${i}`.toLowerCase().includes(t)})}function js(e){let t=e.replace(/^U\+/i,"").replace(/^0x/i,""),o=parseInt(t,16);return isNaN(o)||o<0||o>1114111?null:String.fromCodePoint(o)}var ie=[{id:"formatted",labelKey:"dialogs.pasteSpecial.keepFormatting",descriptionKey:"dialogs.pasteSpecial.keepFormattingDescription",shortcutKey:"dialogs.pasteSpecial.keepFormattingShortcut"},{id:"plainText",labelKey:"dialogs.pasteSpecial.plainText",descriptionKey:"dialogs.pasteSpecial.plainTextDescription",shortcutKey:"dialogs.pasteSpecial.plainTextShortcut"}],kn=()=>jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M4 4h12v2H4V4zM4 8h8v2H4V8zM4 12h10v2H4v-2zM4 16h6v2H4v-2z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M14 10l3 3-3 3v-2h-2v-2h2v-2z",fill:"currentColor",opacity:"0.6"})]}),wn=()=>jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M4 4h12v1H4V4zM4 7h12v1H4V7zM4 10h12v1H4v-1zM4 13h12v1H4v-1zM4 16h8v1H4v-1z",fill:"currentColor"})});function Tn(e){switch(e){case "formatted":return jsxRuntime.jsx(kn,{});case "plainText":return jsxRuntime.jsx(wn,{});default:return null}}var Pn=({option:e,isSelected:t,onClick:o,onMouseEnter:i})=>jsxRuntime.jsxs("button",{type:"button",className:`docx-paste-special-option ${t?"docx-paste-special-option-selected":""}`,onClick:o,onMouseEnter:i,role:"menuitem","aria-selected":t,style:{display:"flex",alignItems:"center",gap:"12px",width:"100%",padding:"12px 16px",border:"none",background:t?"var(--doc-primary-light)":"transparent",cursor:"pointer",textAlign:"left",borderRadius:"4px",transition:"background-color 0.15s ease"},children:[jsxRuntime.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",background:t?"var(--doc-primary)":"var(--doc-bg-hover)",color:t?"white":"var(--doc-text-muted)"},children:Tn(e.id)}),jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:"var(--doc-text)",marginBottom:"2px"},children:e.label}),jsxRuntime.jsx("div",{style:{fontSize:"12px",color:"var(--doc-text-muted)"},children:e.description})]}),jsxRuntime.jsx("span",{style:{fontSize:"11px",color:"var(--doc-text-subtle)",fontFamily:"monospace"},children:e.shortcut})]}),ta=({isOpen:e,onClose:t,onPaste:o,position:i,className:n=""})=>{let{t:r}=chunkQSUPYUOP_js.b(),s=ir.useRef(null),[c,l]=ir.useState(0),[a,m]=ir.useState(null),[b,h]=ir.useState(false),[p,u]=ir.useState(null),g=ie.map(f=>({id:f.id,label:r(f.labelKey),description:r(f.descriptionKey),shortcut:r(f.shortcutKey)}));ir.useEffect(()=>{if(!e){m(null),u(null),l(0);return}(async()=>{h(true),u(null);try{let d=await chunkDC65PJYE_js.R({cleanWordFormatting:!0});m(d),d||u(r("dialogs.pasteSpecial.noContent"));}catch{u(r("dialogs.pasteSpecial.clipboardError"));}finally{h(false);}})();},[e]),ir.useEffect(()=>{if(!e)return;let f=d=>{s.current&&!s.current.contains(d.target)&&t();};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[e,t]),ir.useEffect(()=>{if(!e)return;let f=d=>{switch(d.key){case "Escape":d.preventDefault(),t();break;case "ArrowDown":d.preventDefault(),l(y=>(y+1)%ie.length);break;case "ArrowUp":d.preventDefault(),l(y=>(y-1+ie.length)%ie.length);break;case "Enter":d.preventDefault(),x(ie[c].id);break}};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,c,t]);let x=ir.useCallback(f=>{if(!a){u(r("dialogs.pasteSpecial.noContent"));return}o(a,f==="plainText"),t();},[a,o,t]),k=ir.useCallback(()=>{let y=i?.x??(typeof window<"u"?window.innerWidth/2-160:100),C=i?.y??(typeof window<"u"?window.innerHeight/2-200/2:100);return typeof window<"u"&&(y+320>window.innerWidth&&(y=window.innerWidth-320-10),C+200>window.innerHeight&&(C=window.innerHeight-200-10),y<10&&(y=10),C<10&&(C=10)),{position:"fixed",top:C,left:y,width:320,background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",zIndex:10001,overflow:"hidden"}},[i]);return e?jsxRuntime.jsxs("div",{ref:s,className:`docx-paste-special-dialog ${n}`,style:k(),role:"dialog","aria-label":r("dialogs.pasteSpecial.title"),children:[jsxRuntime.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[jsxRuntime.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--doc-text)"},children:r("dialogs.pasteSpecial.title")}),jsxRuntime.jsx("button",{type:"button",onClick:t,"aria-label":r("common.closeDialog"),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"var(--doc-text-muted)"},children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{style:{padding:"8px"},children:b?jsxRuntime.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--doc-text-muted)",fontSize:"13px"},children:r("dialogs.pasteSpecial.readingClipboard")}):p?jsxRuntime.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--doc-error)",fontSize:"13px"},children:p}):jsxRuntime.jsx("div",{role:"menu",children:g.map((f,d)=>jsxRuntime.jsx(Pn,{option:f,isSelected:d===c,onClick:()=>x(f.id),onMouseEnter:()=>l(d)},f.id))})}),a&&!b&&!p&&jsxRuntime.jsxs("div",{style:{padding:"8px 16px 12px",borderTop:"1px solid var(--doc-border)"},children:[jsxRuntime.jsx("div",{style:{fontSize:"11px",color:"var(--doc-text-muted)",marginBottom:"4px"},children:r("dialogs.pasteSpecial.preview")}),jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"var(--doc-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"6px 8px",background:"var(--doc-bg)",borderRadius:"4px"},children:['"',a.plainText.slice(0,50),a.plainText.length>50?"...":"",'"']})]})]}):null};function oa(e={}){let{onPaste:t,enabled:o=true}=e,[i,n]=ir.useState(false),r=ir.useCallback(()=>{o&&n(true);},[o]),s=ir.useCallback(()=>{n(false);},[]),c=ir.useCallback(async()=>{if(!(!o||!t))try{let a=await chunkDC65PJYE_js.R({cleanWordFormatting:!0});a&&t(a,!0);}catch(a){console.error("Failed to paste as plain text:",a);}},[o,t]),l=ir.useCallback(a=>o&&(a.ctrlKey||a.metaKey)&&a.shiftKey&&a.key.toLowerCase()==="v"?(a.preventDefault(),r(),true):false,[o,r]);return {isOpen:i,openDialog:r,closeDialog:s,handleKeyDown:l,pasteAsPlainText:c}}function ra(e){return ie.find(t=>t.id===e)}function na(){return [...ie]}function ia(){return "formatted"}function sa(e){return (e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key.toLowerCase()==="v"}var Nt={editing:"dialogs.keyboardShortcuts.categories.editing",formatting:"dialogs.keyboardShortcuts.categories.formatting",navigation:"dialogs.keyboardShortcuts.categories.navigation",clipboard:"dialogs.keyboardShortcuts.categories.clipboard",selection:"dialogs.keyboardShortcuts.categories.selection",view:"dialogs.keyboardShortcuts.categories.view",file:"dialogs.keyboardShortcuts.categories.file",other:"dialogs.keyboardShortcuts.categories.other"},Bt=["file","editing","clipboard","formatting","selection","navigation","view","other"],Ne=[{id:"save",name:"Save",nameKey:"dialogs.keyboardShortcuts.shortcuts.save",description:"Save document",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.saveDescription",keys:"Ctrl+S",category:"file",common:true},{id:"print",name:"Print",nameKey:"dialogs.keyboardShortcuts.shortcuts.print",description:"Print document",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.printDescription",keys:"Ctrl+P",category:"file"},{id:"undo",name:"Undo",nameKey:"dialogs.keyboardShortcuts.shortcuts.undo",description:"Undo last action",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.undoDescription",keys:"Ctrl+Z",category:"editing",common:true},{id:"redo",name:"Redo",nameKey:"dialogs.keyboardShortcuts.shortcuts.redo",description:"Redo last action",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.redoDescription",keys:"Ctrl+Y",altKeys:"Ctrl+Shift+Z",category:"editing",common:true},{id:"delete",name:"Delete",nameKey:"dialogs.keyboardShortcuts.shortcuts.delete",description:"Delete selected text",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.deleteDescription",keys:"Del",altKeys:"Backspace",category:"editing"},{id:"find",name:"Find",nameKey:"dialogs.keyboardShortcuts.shortcuts.find",description:"Find text in document",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.findDescription",keys:"Ctrl+F",category:"editing",common:true},{id:"replace",name:"Find & Replace",nameKey:"dialogs.keyboardShortcuts.shortcuts.findReplace",description:"Find and replace text",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.findReplaceDescription",keys:"Ctrl+H",category:"editing"},{id:"cut",name:"Cut",nameKey:"dialogs.keyboardShortcuts.shortcuts.cut",description:"Cut selected text",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.cutDescription",keys:"Ctrl+X",category:"clipboard",common:true},{id:"copy",name:"Copy",nameKey:"dialogs.keyboardShortcuts.shortcuts.copy",description:"Copy selected text",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.copyDescription",keys:"Ctrl+C",category:"clipboard",common:true},{id:"paste",name:"Paste",nameKey:"dialogs.keyboardShortcuts.shortcuts.paste",description:"Paste from clipboard",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.pasteDescription",keys:"Ctrl+V",category:"clipboard",common:true},{id:"paste-plain",name:"Paste as Plain Text",nameKey:"dialogs.keyboardShortcuts.shortcuts.pastePlainText",description:"Paste without formatting",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.pastePlainTextDescription",keys:"Ctrl+Shift+V",category:"clipboard"},{id:"bold",name:"Bold",nameKey:"dialogs.keyboardShortcuts.shortcuts.bold",description:"Toggle bold formatting",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.boldDescription",keys:"Ctrl+B",category:"formatting",common:true},{id:"italic",name:"Italic",nameKey:"dialogs.keyboardShortcuts.shortcuts.italic",description:"Toggle italic formatting",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.italicDescription",keys:"Ctrl+I",category:"formatting",common:true},{id:"underline",name:"Underline",nameKey:"dialogs.keyboardShortcuts.shortcuts.underline",description:"Toggle underline formatting",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.underlineDescription",keys:"Ctrl+U",category:"formatting",common:true},{id:"strikethrough",name:"Strikethrough",nameKey:"dialogs.keyboardShortcuts.shortcuts.strikethrough",description:"Toggle strikethrough",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.strikethroughDescription",keys:"Ctrl+Shift+X",category:"formatting"},{id:"subscript",name:"Subscript",nameKey:"dialogs.keyboardShortcuts.shortcuts.subscript",description:"Toggle subscript",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.subscriptDescription",keys:"Ctrl+=",category:"formatting"},{id:"superscript",name:"Superscript",nameKey:"dialogs.keyboardShortcuts.shortcuts.superscript",description:"Toggle superscript",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.superscriptDescription",keys:"Ctrl+Shift+=",category:"formatting"},{id:"align-left",name:"Align Left",nameKey:"dialogs.keyboardShortcuts.shortcuts.alignLeft",description:"Left align paragraph",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.alignLeftDescription",keys:"Ctrl+L",category:"formatting"},{id:"align-center",name:"Align Center",nameKey:"dialogs.keyboardShortcuts.shortcuts.alignCenter",description:"Center align paragraph",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.alignCenterDescription",keys:"Ctrl+E",category:"formatting"},{id:"align-right",name:"Align Right",nameKey:"dialogs.keyboardShortcuts.shortcuts.alignRight",description:"Right align paragraph",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.alignRightDescription",keys:"Ctrl+R",category:"formatting"},{id:"align-justify",name:"Justify",nameKey:"dialogs.keyboardShortcuts.shortcuts.justify",description:"Justify paragraph",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.justifyDescription",keys:"Ctrl+J",category:"formatting"},{id:"indent",name:"Increase Indent",nameKey:"dialogs.keyboardShortcuts.shortcuts.increaseIndent",description:"Increase paragraph indent",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.increaseIndentDescription",keys:"Tab",category:"formatting"},{id:"outdent",name:"Decrease Indent",nameKey:"dialogs.keyboardShortcuts.shortcuts.decreaseIndent",description:"Decrease paragraph indent",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.decreaseIndentDescription",keys:"Shift+Tab",category:"formatting"},{id:"select-all",name:"Select All",nameKey:"dialogs.keyboardShortcuts.shortcuts.selectAll",description:"Select all content",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.selectAllDescription",keys:"Ctrl+A",category:"selection",common:true},{id:"select-word",name:"Select Word",nameKey:"dialogs.keyboardShortcuts.shortcuts.selectWord",description:"Select current word",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.selectWordDescription",keys:"Double-click",category:"selection"},{id:"select-paragraph",name:"Select Paragraph",nameKey:"dialogs.keyboardShortcuts.shortcuts.selectParagraph",description:"Select current paragraph",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.selectParagraphDescription",keys:"Triple-click",category:"selection"},{id:"extend-selection-word",name:"Extend Selection by Word",nameKey:"dialogs.keyboardShortcuts.shortcuts.extendSelectionByWord",description:"Extend selection to next/previous word",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.extendSelectionByWordDescription",keys:"Ctrl+Shift+Arrow",category:"selection"},{id:"extend-selection-line",name:"Extend Selection to Line Edge",nameKey:"dialogs.keyboardShortcuts.shortcuts.extendSelectionToLineEdge",description:"Extend selection to line start/end",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.extendSelectionToLineEdgeDescription",keys:"Shift+Home/End",category:"selection"},{id:"move-word",name:"Move by Word",nameKey:"dialogs.keyboardShortcuts.shortcuts.moveByWord",description:"Move cursor to next/previous word",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.moveByWordDescription",keys:"Ctrl+Arrow",category:"navigation"},{id:"move-line-start",name:"Move to Line Start",nameKey:"dialogs.keyboardShortcuts.shortcuts.moveToLineStart",description:"Move cursor to start of line",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.moveToLineStartDescription",keys:"Home",category:"navigation"},{id:"move-line-end",name:"Move to Line End",nameKey:"dialogs.keyboardShortcuts.shortcuts.moveToLineEnd",description:"Move cursor to end of line",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.moveToLineEndDescription",keys:"End",category:"navigation"},{id:"move-doc-start",name:"Move to Document Start",nameKey:"dialogs.keyboardShortcuts.shortcuts.moveToDocumentStart",description:"Move cursor to start of document",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.moveToDocumentStartDescription",keys:"Ctrl+Home",category:"navigation"},{id:"move-doc-end",name:"Move to Document End",nameKey:"dialogs.keyboardShortcuts.shortcuts.moveToDocumentEnd",description:"Move cursor to end of document",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.moveToDocumentEndDescription",keys:"Ctrl+End",category:"navigation"},{id:"page-up",name:"Page Up",nameKey:"dialogs.keyboardShortcuts.shortcuts.pageUp",description:"Scroll up one page",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.pageUpDescription",keys:"Page Up",category:"navigation"},{id:"page-down",name:"Page Down",nameKey:"dialogs.keyboardShortcuts.shortcuts.pageDown",description:"Scroll down one page",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.pageDownDescription",keys:"Page Down",category:"navigation"},{id:"zoom-in",name:"Zoom In",nameKey:"dialogs.keyboardShortcuts.shortcuts.zoomIn",description:"Increase zoom level",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.zoomInDescription",keys:"Ctrl++",altKeys:"Ctrl+Scroll Up",category:"view"},{id:"zoom-out",name:"Zoom Out",nameKey:"dialogs.keyboardShortcuts.shortcuts.zoomOut",description:"Decrease zoom level",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.zoomOutDescription",keys:"Ctrl+-",altKeys:"Ctrl+Scroll Down",category:"view"},{id:"zoom-reset",name:"Reset Zoom",nameKey:"dialogs.keyboardShortcuts.shortcuts.resetZoom",description:"Reset zoom to 100%",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.resetZoomDescription",keys:"Ctrl+0",category:"view"},{id:"shortcuts",name:"Keyboard Shortcuts",nameKey:"dialogs.keyboardShortcuts.shortcuts.keyboardShortcuts",description:"Show this help dialog",descriptionKey:"dialogs.keyboardShortcuts.shortcuts.keyboardShortcutsDescription",keys:"Ctrl+/",altKeys:"F1",category:"view"}];function En(){return typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)}function tt(e){return En()?e.replace(/Ctrl\+/g,"\u2318").replace(/Alt\+/g,"\u2325").replace(/Shift\+/g,"\u21E7"):e}var In=({shortcut:e,translatedName:t,translatedDescription:o})=>{let i=tt(e.keys),n=e.altKeys?tt(e.altKeys):null;return jsxRuntime.jsxs("div",{className:"docx-shortcut-item",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",borderBottom:"1px solid var(--doc-border-light)"},children:[jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("div",{style:{fontSize:"13px",fontWeight:500,color:"var(--doc-text)"},children:t}),jsxRuntime.jsx("div",{style:{fontSize:"11px",color:"var(--doc-text-muted)",marginTop:"2px"},children:o})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[jsxRuntime.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",color:"var(--doc-text)",backgroundColor:"var(--doc-bg-hover)",borderRadius:"4px",border:"1px solid var(--doc-border-light)",boxShadow:"0 1px 1px rgba(0,0,0,0.1)"},children:i}),n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{style:{color:"var(--doc-text-subtle)",fontSize:"11px"},children:"or"}),jsxRuntime.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",color:"var(--doc-text)",backgroundColor:"var(--doc-bg-hover)",borderRadius:"4px",border:"1px solid var(--doc-border-light)",boxShadow:"0 1px 1px rgba(0,0,0,0.1)"},children:n})]})]})]})},ua=({isOpen:e,onClose:t,customShortcuts:o=[],showSearch:i=true,className:n=""})=>{let{t:r}=chunkQSUPYUOP_js.b(),s=ir.useRef(null),c=ir.useRef(null),[l,a]=ir.useState(""),m=ir.useMemo(()=>{let p=[...Ne];for(let u of o){let g=p.findIndex(x=>x.id===u.id);g>=0?p[g]=u:p.push(u);}return p},[o]),b=ir.useMemo(()=>{if(!l.trim())return m;let p=l.toLowerCase();return m.filter(u=>{let g=u.nameKey?r(u.nameKey):u.name,x=u.descriptionKey?r(u.descriptionKey):u.description;return g.toLowerCase().includes(p)||x.toLowerCase().includes(p)||u.keys.toLowerCase().includes(p)||u.altKeys&&u.altKeys.toLowerCase().includes(p)})},[m,l,r]),h=ir.useMemo(()=>{let p=new Map;for(let g of b){let x=p.get(g.category)||[];x.push(g),p.set(g.category,x);}let u=[];for(let g of Bt){let x=p.get(g);x&&x.length>0&&u.push({category:g,shortcuts:x});}return u},[b]);return ir.useEffect(()=>{e&&i&&c.current&&setTimeout(()=>c.current?.focus(),0);},[e,i]),ir.useEffect(()=>{e||a("");},[e]),ir.useEffect(()=>{if(!e)return;let p=u=>{s.current&&!s.current.contains(u.target)&&t();};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[e,t]),ir.useEffect(()=>{if(!e)return;let p=u=>{u.key==="Escape"&&t();};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,t]),e?jsxRuntime.jsx("div",{className:"docx-shortcuts-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10001},children:jsxRuntime.jsxs("div",{ref:s,className:`docx-shortcuts-dialog ${n}`,style:{width:"600px",maxWidth:"90vw",maxHeight:"80vh",backgroundColor:"white",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.2)",display:"flex",flexDirection:"column",overflow:"hidden"},role:"dialog","aria-label":r("dialogs.keyboardShortcuts.ariaLabel"),children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},children:[jsxRuntime.jsx("h2",{style:{margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},children:r("dialogs.keyboardShortcuts.ariaLabel")}),jsxRuntime.jsx("button",{type:"button",onClick:t,"aria-label":r("common.closeDialog"),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"50%",color:"var(--doc-text-muted)"},children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M5 5l10 10M15 5L5 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),i&&jsxRuntime.jsx("div",{style:{padding:"12px 20px",borderBottom:"1px solid var(--doc-border)"},children:jsxRuntime.jsx("input",{ref:c,type:"text",value:l,onChange:p=>a(p.target.value),placeholder:r("dialogs.keyboardShortcuts.searchPlaceholder"),style:{width:"100%",padding:"10px 12px",fontSize:"14px",border:"1px solid var(--doc-border-light)",borderRadius:"6px",outline:"none"}})}),jsxRuntime.jsx("div",{style:{flex:1,overflowY:"auto",padding:"16px 20px"},children:h.length===0?jsxRuntime.jsx("div",{style:{textAlign:"center",padding:"32px",color:"var(--doc-text-muted)"},children:r("dialogs.keyboardShortcuts.noResults",{query:l})}):h.map(({category:p,shortcuts:u})=>jsxRuntime.jsxs("div",{style:{marginBottom:"24px"},children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"13px",fontWeight:600,color:"var(--doc-primary)",textTransform:"uppercase",letterSpacing:"0.5px"},children:r(Nt[p])}),jsxRuntime.jsx("div",{children:u.map(g=>jsxRuntime.jsx(In,{shortcut:g,translatedName:g.nameKey?r(g.nameKey):g.name,translatedDescription:g.descriptionKey?r(g.descriptionKey):g.description},g.id))})]},p))}),jsxRuntime.jsx("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--doc-border)",backgroundColor:"var(--doc-bg)",fontSize:"12px",color:"var(--doc-text-muted)",textAlign:"center"},children:(()=>{let u=r("dialogs.keyboardShortcuts.pressEscToClose",{key:"Esc"}).split("Esc");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u[0],jsxRuntime.jsx("kbd",{style:{padding:"2px 6px",backgroundColor:"white",borderRadius:"4px",border:"1px solid var(--doc-border-light)"},children:"Esc"}),u[1]]})})()})]})}):null};function ga(e={}){let{enabled:t=true,openShortcut:o="Ctrl+/"}=e,[i,n]=ir.useState(false),r=ir.useCallback(()=>{t&&n(true);},[t]),s=ir.useCallback(()=>{n(false);},[]),c=ir.useCallback(()=>{n(a=>!a);},[]),l=ir.useCallback(a=>{if(!t)return;if((a.ctrlKey||a.metaKey)&&(a.key==="/"||a.key==="?")){a.preventDefault(),c();return}if(a.key==="F1"){a.preventDefault(),r();return}},[t,c,r]);return ir.useEffect(()=>{if(t)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,l]),{isOpen:i,open:r,close:s,toggle:c,handleKeyDown:l}}function ma(){return [...Ne]}function ha(e){return Ne.filter(t=>t.category===e)}function xa(){return Ne.filter(e=>e.common)}function ba(e){return Nt[e]}function fa(){return [...Bt]}function ya(e){return tt(e)}
111
+ exports.$=As;exports.A=Hi;exports.B=Xi;exports.C=Qi;exports.D=Ji;exports.E=qi;exports.F=es;exports.G=ts;exports.H=os;exports.I=dr;exports.J=ss;exports.K=as;exports.L=ls;exports.M=cs;exports.N=ds;exports.O=xs;exports.P=bs;exports.Q=fs;exports.R=ys;exports.S=vs;exports.T=Ss;exports.U=Cs;exports.V=Is;exports.W=Ls;exports.X=Rs;exports.Y=Ds;exports.Z=Ks;exports._=Os;exports.a=On;exports.aa=Ms;exports.b=An;exports.ba=_s;exports.c=Mn;exports.ca=Ce;exports.d=_n;exports.da=Ys;exports.e=Nn;exports.ea=Us;exports.f=Bn;exports.fa=Hs;exports.g=Vn;exports.ga=Vs;exports.h=$n;exports.ha=$s;exports.i=Gn;exports.ia=Gs;exports.j=jn;exports.ja=js;exports.k=oi;exports.ka=ta;exports.l=si;exports.la=oa;exports.m=ai;exports.ma=ra;exports.n=li;exports.na=na;exports.o=ci;exports.oa=ia;exports.p=di;exports.pa=sa;exports.q=pi;exports.qa=ua;exports.r=ui;exports.ra=ga;exports.s=gi;exports.sa=ma;exports.t=ki;exports.ta=ha;exports.u=Oi;exports.ua=xa;exports.v=Fi;exports.va=ba;exports.w=zi;exports.wa=fa;exports.x=Wi;exports.xa=ya;exports.y=Yi;exports.z=Ui;