@zeke-02/docx-editor 0.0.34 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -29
- package/dist/{ClipboardManager-C1l58nzE.d.ts → ClipboardManager-CVKX0v9q.d.ts} +1 -1
- package/dist/{ClipboardManager-Cjb_v74d.d.mts → ClipboardManager-V3aaMnWE.d.mts} +1 -1
- package/dist/{DocumentAgent-E8OX_8j0.d.mts → DocumentAgent-BWflKHpH.d.mts} +1 -1
- package/dist/{DocumentAgent-iedmc_8s.d.ts → DocumentAgent-DsdXtetF.d.ts} +1 -1
- package/dist/{FindReplaceDialog-YW3R4FHM.mjs → FindReplaceDialog-L3YF5HIS.mjs} +1 -1
- package/dist/FindReplaceDialog-SEBWC5P7.js +1 -0
- package/dist/{FootnotePropertiesDialog-LNFJXQUG.mjs → FootnotePropertiesDialog-TNVJJCY6.mjs} +1 -1
- package/dist/{FootnotePropertiesDialog-7QX54WQT.js → FootnotePropertiesDialog-XQ7NIFIU.js} +1 -1
- package/dist/{HyperlinkDialog-HNYTXDCB.mjs → HyperlinkDialog-FR4IZZ7E.mjs} +1 -1
- package/dist/HyperlinkDialog-WEK6JSAC.js +1 -0
- package/dist/{ImagePositionDialog-M65BYQQE.js → ImagePositionDialog-2YXRAGZS.js} +1 -1
- package/dist/{ImagePositionDialog-B4RLP2W5.mjs → ImagePositionDialog-JSZSIKF5.mjs} +1 -1
- package/dist/ImagePropertiesDialog-527MFLQO.mjs +1 -0
- package/dist/{ImagePropertiesDialog-O4WQSF5M.js → ImagePropertiesDialog-HG4K3IE7.js} +1 -1
- package/dist/PageSetupDialog-GALVJMUB.js +1 -0
- package/dist/PageSetupDialog-TGQIAMI7.mjs +1 -0
- package/dist/SplitCellDialog-JIAC3RYV.js +1 -0
- package/dist/SplitCellDialog-NP3JJYHD.mjs +1 -0
- package/dist/{TablePropertiesDialog-WOZ4ES3H.js → TablePropertiesDialog-T7D4HSVP.js} +1 -1
- package/dist/TablePropertiesDialog-TIK4AA5M.mjs +1 -0
- package/dist/{clipboard-BWhM0CRj.d.mts → TableToolbar-DUgmob2I.d.ts} +227 -135
- package/dist/{clipboard-BvkuNZub.d.ts → TableToolbar-YL74HNS1.d.mts} +227 -135
- package/dist/{agentApi-mv532p8I.d.mts → agentApi-DLt94vXk.d.mts} +83 -5
- package/dist/{agentApi-mv532p8I.d.ts → agentApi-DLt94vXk.d.ts} +83 -5
- package/dist/chunk-23SXXIZS.js +111 -0
- package/dist/chunk-3F52AP2Q.js +1 -0
- package/dist/chunk-42O5GXM5.mjs +82 -0
- package/dist/chunk-54ULJEHM.mjs +1 -0
- package/dist/chunk-5XK326FI.mjs +1 -0
- package/dist/chunk-76IYR7C7.mjs +1 -0
- package/dist/chunk-7BG7QY7I.js +182 -0
- package/dist/chunk-AGRIVA4G.js +1 -0
- package/dist/chunk-BTCQ2QI3.mjs +3 -0
- package/dist/chunk-BXRC4U3X.mjs +2 -0
- package/dist/chunk-CPAYKE6X.mjs +1 -0
- package/dist/chunk-DACWLFKI.mjs +1 -0
- package/dist/{chunk-377ZVTSE.js → chunk-EHFEG3TX.js} +1 -1
- package/dist/chunk-EPBFWE36.js +2 -0
- package/dist/chunk-FXES3YDB.js +82 -0
- package/dist/chunk-HI66BSGS.mjs +9 -0
- package/dist/chunk-INTPVEO6.mjs +9 -0
- package/dist/chunk-IOAGVW6Q.mjs +2 -0
- package/dist/chunk-JCEWC5QL.mjs +4 -0
- package/dist/chunk-JTIUFACT.js +1 -0
- package/dist/chunk-KUTCCI4X.mjs +182 -0
- package/dist/{chunk-KCOGY3V2.js → chunk-LUF7PWIC.js} +4 -4
- package/dist/chunk-LVGJKS7Y.mjs +24 -0
- package/dist/chunk-MGEN6GOE.mjs +2 -0
- package/dist/chunk-MOE2ZGUE.js +18 -0
- package/dist/chunk-MWLHJWB6.js +9 -0
- package/dist/chunk-OFYVDN3U.mjs +2 -0
- package/dist/chunk-P4VSHBGZ.js +2 -0
- package/dist/chunk-P5FQHIES.mjs +1 -0
- package/dist/chunk-PBC7XAYZ.js +3 -0
- package/dist/chunk-PEMB6SZT.js +2 -0
- package/dist/chunk-PKEOQIQO.mjs +2 -0
- package/dist/chunk-PQMSZTBB.js +9 -0
- package/dist/chunk-Q7UDQXAF.js +1 -0
- package/dist/chunk-QGTAIC5E.js +1 -0
- package/dist/chunk-R3QMYPL5.mjs +59 -0
- package/dist/chunk-RBUTXXQJ.mjs +18 -0
- package/dist/chunk-RRWYZ2TS.mjs +111 -0
- package/dist/{chunk-AU5NVRHP.js → chunk-SFUM35DH.js} +2 -2
- package/dist/chunk-SNLC6EK2.js +1 -0
- package/dist/chunk-TMTLIGLZ.js +59 -0
- package/dist/{chunk-RTFUE3KK.mjs → chunk-TSE2PWFX.mjs} +3 -3
- package/dist/chunk-UWYD42WV.js +4 -0
- package/dist/chunk-UXVACQCY.mjs +1 -0
- package/dist/{chunk-Z26WOH6R.mjs → chunk-W4EIKDM6.mjs} +2 -2
- package/dist/chunk-WNS2RBQD.js +2 -0
- package/dist/chunk-YC5KZSYD.js +24 -0
- package/dist/chunk-Z3KMSHUP.js +1 -0
- package/dist/core-plugins-reexport.d.mts +4 -4
- package/dist/core-plugins-reexport.d.ts +4 -4
- package/dist/core-plugins-reexport.js +1 -1
- package/dist/core-plugins-reexport.mjs +1 -1
- package/dist/core-reexport.d.mts +47 -16
- package/dist/core-reexport.d.ts +47 -16
- package/dist/core-reexport.js +1 -1
- package/dist/core-reexport.mjs +1 -1
- package/dist/{colorResolver-C5fQ4fxP.d.mts → documentSerializer-DtS_-oGA.d.mts} +378 -376
- package/dist/{colorResolver-Bp9flT3l.d.ts → documentSerializer-Wj1p2ASa.d.ts} +378 -376
- package/dist/executor-C3VXF7QA.mjs +1 -0
- package/dist/executor-GDBV3AGV.js +1 -0
- package/dist/headless-reexport.d.mts +14 -12
- package/dist/headless-reexport.d.ts +14 -12
- package/dist/headless-reexport.js +1 -4
- package/dist/headless-reexport.mjs +1 -4
- package/dist/index.css +1 -1
- package/dist/index.d.mts +284 -172
- package/dist/index.d.ts +284 -172
- package/dist/index.js +17 -9
- package/dist/index.mjs +17 -9
- package/dist/{fontLoader-0G00frKD.d.mts → insertOperations-BTH1Asas.d.mts} +86 -86
- package/dist/{fontLoader-DPdt4JvW.d.ts → insertOperations-CbUnXAXH.d.ts} +86 -86
- package/dist/layout-bridge-EA4DJ227.js +1 -0
- package/dist/layout-bridge-XDPSO6GO.mjs +1 -0
- package/dist/mcp-reexport.d.mts +2 -2
- package/dist/mcp-reexport.d.ts +2 -2
- package/dist/mcp-reexport.js +8 -8
- package/dist/mcp-reexport.mjs +7 -7
- package/dist/processTemplate-MJ2PCSO5.js +1 -0
- package/dist/{processTemplate-LRHXOWMZ.mjs → processTemplate-W2C5PXZB.mjs} +1 -1
- package/dist/{react-8budV7xv.d.mts → react-B0W16SV6.d.ts} +401 -166
- package/dist/{react-D6tMLo0R.d.ts → react-D0Pn1nww.d.mts} +401 -166
- package/dist/react.css +1 -1
- package/dist/react.d.mts +5 -5
- package/dist/react.d.ts +5 -5
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/{registry-BWGKcKc1.d.ts → registry-CH9V-IX0.d.ts} +1 -1
- package/dist/{registry-8XOdjHGC.d.mts → registry-CWBKYlNW.d.mts} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{types-DIBvJ7AJ.d.mts → types-UDsUq8D3.d.mts} +1 -1
- package/dist/{types-CfAiObQo.d.ts → types-jbivc9Lj.d.ts} +1 -1
- package/dist/ui.d.mts +33 -83
- package/dist/ui.d.ts +33 -83
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/dist/{variableDetector-DNO18eZ1.d.mts → variableDetector-CdQ7ZTzA.d.mts} +1 -1
- package/dist/{variableDetector-BIJFVpkl.d.ts → variableDetector-DsRV3A9z.d.ts} +1 -1
- package/i18n/de.json +49 -2
- package/i18n/en.json +55 -8
- package/i18n/he.json +792 -0
- package/i18n/pl.json +49 -2
- package/i18n/pt-BR.json +792 -0
- package/i18n/tr.json +792 -0
- package/i18n/zh-CN.json +792 -0
- package/package.json +17 -5
- package/dist/FindReplaceDialog-KNJETYJX.js +0 -1
- package/dist/HyperlinkDialog-GBAYMTUE.js +0 -1
- package/dist/ImagePropertiesDialog-JOGW3WDU.mjs +0 -1
- package/dist/PageSetupDialog-2GIBTKMJ.js +0 -1
- package/dist/PageSetupDialog-Q7SHEZIJ.mjs +0 -1
- package/dist/TablePropertiesDialog-LMXWX3FI.mjs +0 -1
- package/dist/chunk-2HDYCD2Q.mjs +0 -1
- package/dist/chunk-37SLIJPH.mjs +0 -58
- package/dist/chunk-3OKYQQQ5.js +0 -111
- package/dist/chunk-4VUZBV2S.js +0 -1
- package/dist/chunk-7MGFEP2R.mjs +0 -26
- package/dist/chunk-7QTNB64A.mjs +0 -9
- package/dist/chunk-AARNCPWR.js +0 -1
- package/dist/chunk-DC65PJYE.js +0 -4
- package/dist/chunk-DLNS7XC2.js +0 -261
- package/dist/chunk-DLVLK5FT.mjs +0 -24
- package/dist/chunk-EV3CM6TU.js +0 -1
- package/dist/chunk-FVUGBRDD.js +0 -1
- package/dist/chunk-FW5LYOOZ.mjs +0 -111
- package/dist/chunk-GZOCOWWB.mjs +0 -2
- package/dist/chunk-KUL2SDYC.js +0 -26
- package/dist/chunk-LYBG4YI7.mjs +0 -1
- package/dist/chunk-M5F4SK3W.mjs +0 -1
- package/dist/chunk-P7WEP4JU.js +0 -9
- package/dist/chunk-PB7VMDDP.js +0 -24
- package/dist/chunk-QAZ4233N.mjs +0 -1
- package/dist/chunk-QSUPYUOP.js +0 -2
- package/dist/chunk-QTSXJRP6.mjs +0 -1
- package/dist/chunk-SE5EN2QL.js +0 -1
- package/dist/chunk-X5A54T6S.mjs +0 -4
- package/dist/chunk-YKBSKEBS.mjs +0 -2
- package/dist/chunk-Z7ZLARCQ.mjs +0 -261
- package/dist/chunk-ZJNGMDRE.js +0 -58
- package/dist/executor-L2MVKMXO.js +0 -1
- package/dist/executor-XKBCCVNY.mjs +0 -1
- package/dist/processTemplate-5ZST2Q5L.js +0 -1
- package/dist/selectionRects-DEX5THEG.js +0 -1
- package/dist/selectionRects-SQTAHMCH.mjs +0 -1
package/dist/chunk-QAZ4233N.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},T={black:"000000",blue:"0000FF",cyan:"00FFFF",darkBlue:"00008B",darkCyan:"008B8B",darkGray:"A9A9A9",darkGreen:"006400",darkMagenta:"8B008B",darkRed:"8B0000",darkYellow:"808000",green:"00FF00",lightGray:"D3D3D3",magenta:"FF00FF",red:"FF0000",white:"FFFFFF",yellow:"FFFF00",none:""},h={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedHyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"};function b(e){if(!e)return 1;let t=parseInt(e,16);return isNaN(t)?1:t/255}function c(e){let t=e.padStart(6,"0").slice(0,6),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),l=parseInt(t.slice(4,6),16);return {r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(l)?0:l}}function g(e,t,n){let r=l=>Math.max(0,Math.min(255,Math.round(l))).toString(16).padStart(2,"0");return `${r(e)}${r(t)}${r(n)}`.toUpperCase()}function p(e,t,n){e/=255,t/=255,n/=255;let r=Math.max(e,t,n),l=Math.min(e,t,n),o=(r+l)/2;if(r===l)return {h:0,s:0,l:o};let u=r-l,i=o>.5?u/(2-r-l):u/(r+l),a;switch(r){case e:a=((t-n)/u+(t<n?6:0))/6;break;case t:a=((n-e)/u+2)/6;break;case n:a=((e-t)/u+4)/6;break;default:a=0;}return {h:a*360,s:i,l:o}}function C(e,t,n){if(e=e/360,t===0){let u=Math.round(n*255);return {r:u,g:u,b:u}}let r=(u,i,a)=>(a<0&&(a+=1),a>1&&(a-=1),a<1/6?u+(i-u)*6*a:a<1/2?i:a<2/3?u+(i-u)*(2/3-a)*6:u),l=n<.5?n*(1+t):n+t-n*t,o=2*n-l;return {r:Math.round(r(o,l,e+1/3)*255),g:Math.round(r(o,l,e)*255),b:Math.round(r(o,l,e-1/3)*255)}}function f(e,t){if(t<=0||t>=1)return t>=1?"FFFFFF":e;let n=c(e),r=p(n.r,n.g,n.b);r.l=r.l+(1-r.l)*t;let l=C(r.h,r.s,r.l);return g(l.r,l.g,l.b)}function m(e,t){if(t<=0||t>=1)return t<=0?"000000":e;let n=c(e),r=p(n.r,n.g,n.b);r.l=r.l*t;let l=C(r.h,r.s,r.l);return g(l.r,l.g,l.b)}function k(e,t){let n=h[t]??t,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],l=o=>r.includes(o);return e?.colorScheme?l(n)?e.colorScheme[n]??d[n]??"000000":"000000":l(n)?d[n]??"000000":"000000"}function x(e){if(!e)return null;let t=e.toLowerCase();return h[e]??h[t]??null}function s(e,t,n="000000"){if(!e)return `#${n}`;if(e.auto)return `#${n}`;let r;if(e.themeColor){let l=x(e.themeColor);if(l?r=k(t,l):r=e.rgb??n,e.themeTint){let o=b(e.themeTint);r=f(r,o);}else if(e.themeShade){let o=b(e.themeShade);r=m(r,o);}}else e.rgb?r=e.rgb==="auto"?n:e.rgb:r=n;return `#${r.toUpperCase().replace(/^#/,"")}`}function S(e){if(!e||e==="none")return "";let t=T[e];return t?`#${t}`:""}function v(e,t){return e?e.auto?"transparent":s(e,t):""}function M(e,t){if(!e)return false;if(e.auto)return true;let r=s(e,t).replace(/^#/,"").toLowerCase(),l=c(r);return (l.r+l.g+l.b)/3<20}function A(e,t){if(!e)return false;let r=s(e,t).replace(/^#/,"").toLowerCase(),l=c(r);return (l.r+l.g+l.b)/3>235}function H(e,t){if(!e)return "#000000";let r=s(e,t).replace(/^#/,""),l=c(r);return (.299*l.r+.587*l.g+.114*l.b)/255>.5?"#000000":"#FFFFFF"}function R(e){if(!e)return;let t=e.trim();if(t.toLowerCase()==="auto")return {auto:true};let n=x(t);if(n)return {themeColor:n};let r=t.replace(/^#/,"").toUpperCase();return /^[0-9A-F]{6}$/i.test(r)?{rgb:r}:/^[0-9A-F]{3}$/i.test(r)?{rgb:r.split("").map(o=>o+o).join("")}:{rgb:r.padStart(6,"0").slice(0,6)}}function E(e,t,n){let r={themeColor:e};return t!==void 0&&t>0&&t<1&&(r.themeTint=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")),n!==void 0&&n>0&&n<1&&(r.themeShade=Math.round(n*255).toString(16).toUpperCase().padStart(2,"0")),r}function $(e){return {rgb:e.replace(/^#/,"").toUpperCase()}}function L(e,t,n){let l=s(e,t).replace(/^#/,""),o=1-n/100;return `#${m(l,o)}`}function B(e,t,n){let l=s(e,t).replace(/^#/,""),o=n/100;return `#${f(l,o)}`}function U(e,t,n,r){let l=s(e,r).replace(/^#/,""),o=s(t,r).replace(/^#/,""),u=c(l),i=c(o),a={r:Math.round(u.r*(1-n)+i.r*n),g:Math.round(u.g*(1-n)+i.g*n),b:Math.round(u.b*(1-n)+i.b*n)};return `#${g(a.r,a.g,a.b)}`}function F(e){return e.startsWith("#")?e:`#${e}`}function D(e){return S(e)||F(e)}var y=[{slot:"lt1",name:"Background 1"},{slot:"dk1",name:"Text 1"},{slot:"lt2",name:"Background 2"},{slot:"dk2",name:"Text 2"},{slot:"accent1",name:"Accent 1"},{slot:"accent2",name:"Accent 2"},{slot:"accent3",name:"Accent 3"},{slot:"accent4",name:"Accent 4"},{slot:"accent5",name:"Accent 5"},{slot:"accent6",name:"Accent 6"}],V=[{type:"base",value:0,hexValue:"",labelSuffix:""},{type:"tint",value:.8,hexValue:"CC",labelSuffix:", Lighter 80%"},{type:"tint",value:.6,hexValue:"99",labelSuffix:", Lighter 60%"},{type:"tint",value:.4,hexValue:"66",labelSuffix:", Lighter 40%"},{type:"shade",value:.75,hexValue:"BF",labelSuffix:", Darker 25%"},{type:"shade",value:.5,hexValue:"80",labelSuffix:", Darker 50%"}];function I(e,t,n){return t==="tint"?f(e,n):m(e,n)}function _(e){let t=e??d;return V.map(n=>y.map(r=>{let l=t[r.slot]??d[r.slot]??"000000",o;n.type==="base"?o=l.toUpperCase():n.type==="tint"?o=f(l,n.value):o=m(l,n.value);let u={hex:o,themeSlot:r.slot,label:`${r.name}${n.labelSuffix}`};return n.type==="tint"&&n.hexValue?u.tint=n.hexValue:n.type==="shade"&&n.hexValue&&(u.shade=n.hexValue),u}))}function O(e,t,n){if(!e&&!t)return true;if(!e||!t)return false;let r=s(e,n).toUpperCase(),l=s(t,n).toUpperCase();return r===l}export{s as a,S as b,v as c,M as d,A as e,H as f,R as g,E as h,$ as i,L as j,B as k,U as l,F as m,D as n,I as o,_ as p,O as q};
|
package/dist/chunk-QSUPYUOP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var p={_lang:"en",common:{cancel:"Cancel",insert:"Insert",apply:"Apply",close:"Close",delete:"Delete",update:"Update",save:"Save",retry:"Retry",send:"Send",edit:"Edit",comment:"Comment",reply:"Reply",accept:"Accept",reject:"Reject",dismiss:"Dismiss",change:"Change",px:"px",closeDialog:"Close dialog"},toolbar:{ariaLabel:"Formatting toolbar",file:"File",format:"Format",insert:"Insert",print:"Print",printShortcut:"Ctrl+P",pageSetup:"Page setup",leftToRight:"Left-to-right text",rightToLeft:"Right-to-left text",image:"Image",table:"Table",pageBreak:"Page break",tableOfContents:"Table of contents",symbol:"Symbol"},formattingBar:{groups:{history:"History",zoom:"Zoom",styles:"Styles",font:"Font",textFormatting:"Text formatting",script:"Script",alignment:"Alignment",listFormatting:"List formatting",image:"Image",table:"Table"},undo:"Undo",undoShortcut:"Undo (Ctrl+Z)",redo:"Redo",redoShortcut:"Redo (Ctrl+Y)",bold:"Bold",boldShortcut:"Bold (Ctrl+B)",italic:"Italic",italicShortcut:"Italic (Ctrl+I)",underline:"Underline",underlineShortcut:"Underline (Ctrl+U)",strikethrough:"Strikethrough",fontColor:"Font Color",highlightColor:"Text Highlight Color",insertLink:"Insert link",insertLinkShortcut:"Insert link (Ctrl+K)",superscript:"Superscript",superscriptShortcut:"Superscript (Ctrl+Shift+=)",subscript:"Subscript",subscriptShortcut:"Subscript (Ctrl+=)",imageProperties:"Image properties",imagePropertiesShortcut:"Image properties (alt text, border)...",clearFormatting:"Clear formatting"},alignment:{alignLeft:"Align Left",alignLeftShortcut:"Ctrl+L",center:"Center",centerShortcut:"Ctrl+E",alignRight:"Align Right",alignRightShortcut:"Ctrl+R",justify:"Justify",justifyShortcut:"Ctrl+J"},lists:{ariaLabel:"List formatting",typeAriaLabel:"List type",indentationAriaLabel:"List indentation",bulletList:"Bullet List",numberedList:"Numbered List",decreaseIndent:"Decrease Indent",increaseIndent:"Increase Indent"},lineSpacing:{single:"Single",double:"Double",lineSpacingTitle:"Line spacing: {label}",paragraphSpacing:"Paragraph spacing"},styles:{selectAriaLabel:"Select paragraph style",normalText:"Normal text",title:"Title",subtitle:"Subtitle",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3"},font:{selectAriaLabel:"Select font family",sansSerif:"Sans Serif",serif:"Serif",monospace:"Monospace"},fontSize:{decrease:"Decrease font size",increase:"Increase font size",label:"Font size",listLabel:"Font sizes"},zoom:{ariaLabel:"Zoom: {label}"},colorPicker:{ariaLabel:"{type} color picker",highlightColors:"Highlight Colors",customColor:"Custom Color",noColor:"No Color",automatic:"Automatic",themeColors:"Theme Colors",standardColors:"Standard Colors",colors:{black:"Black",darkRed:"Dark Red",red:"Red",orange:"Orange",yellow:"Yellow",darkYellow:"Dark Yellow",green:"Green",darkGreen:"Dark Green",teal:"Teal",darkTeal:"Dark Teal",blue:"Blue",darkBlue:"Dark Blue",purple:"Purple",darkPurple:"Dark Purple",brown:"Brown",grey50:"Grey 50%",grey25:"Grey 25%",grey10:"Grey 10%",white:"White",lightRed:"Light Red",lightOrange:"Light Orange",lightYellow:"Light Yellow",lightGreen:"Light Green",lightBlue:"Light Blue",lightPurple:"Light Purple",pink:"Pink",rose:"Rose",gold:"Gold",aqua:"Aqua",lavender:"Lavender",silver:"Silver",darkOrange:"Dark Orange",darkGray:"Dark Gray",gray:"Gray",cyan:"Cyan",magenta:"Magenta",paleGreen:"Pale Green",lightCyan:"Light Cyan",skyBlue:"Sky Blue",lightBlue2:"Light Blue 2",lightMagenta:"Light Magenta",brightGreen:"Bright Green",violet:"Violet"}},dialogs:{findReplace:{titleFind:"Find",titleFindReplace:"Find and Replace",findLabel:"Find:",findPlaceholder:"Enter text to find...",findAriaLabel:"Find text",findPrevious:"Find previous",findPreviousTitle:"Find Previous (Shift+Enter)",findNext:"Find next",findNextTitle:"Find Next (Enter)",matchCount:"{current} of {total} matches",noResults:"No results found",replaceLabel:"Replace:",replacePlaceholder:"Enter replacement text...",replaceAriaLabel:"Replace text",replaceButton:"Replace",replaceCurrentTitle:"Replace current match",replaceAllButton:"Replace All",replaceAllTitle:"Replace all matches",matchCase:"Match case",wholeWords:"Whole words",toggleReplace:"+ Replace"},hyperlink:{titleEdit:"Edit Hyperlink",titleInsert:"Insert Hyperlink",tabWebAddress:"Web Address",tabBookmark:"Bookmark",urlLabel:"URL",urlPlaceholder:"https://example.com",urlHint:"Enter a web address, email (mailto:), or phone (tel:)",bookmarkLabel:"Bookmark",bookmarkPlaceholder:"Select a bookmark...",displayTextLabel:"Display Text",displayTextPlaceholder:"Text to display (optional)",displayTextHint:"Leave empty to use the selected text",tooltipLabel:"Tooltip (optional)",tooltipPlaceholder:"Text shown on hover",removeLink:"Remove Link",invalidUrl:"Please enter a valid URL",urlRequired:"URL is required"},insertTable:{title:"Insert Table",hoverToSelect:"Hover to select size",tableSize:"{cols} x {rows} Table",orSpecifySize:"or specify size",rowsLabel:"Rows:",columnsLabel:"Columns:",insertButton:"Insert Table",sizeSelector:"Table size selector"},insertImage:{title:"Insert Image",uploadAriaLabel:"Click or drag to upload image",uploadText:"Click to select or drag and drop an image",uploadSubtext:"PNG, JPG, GIF up to 10MB",dimensions:"Dimensions",widthLabel:"Width:",heightLabel:"Height:",aspectRatioLocked:"Aspect ratio locked",aspectRatioUnlocked:"Aspect ratio unlocked",altTextLabel:"Alt Text (optional)",altTextPlaceholder:"Describe the image for accessibility",insertButton:"Insert Image",invalidFile:"Please select a valid image file",fileTooLarge:"Image file is too large (max 10MB)",readFailed:"Failed to read image file",loadFailed:"Failed to load image",preview:"Preview"},insertSymbol:{title:"Insert Symbol",searchPlaceholder:"Search symbols (character or Unicode)...",noResults:'No symbols found for "{query}"',decimal:"Decimal: {value}",categories:{common:"Common",arrows:"Arrows",math:"Math",greek:"Greek",shapes:"Shapes",punctuation:"Punctuation",currency:"Currency",music:"Music",emoji:"Emoji"}},imageProperties:{title:"Image Properties",altText:"Alt Text",altTextPlaceholder:"Describe this image for accessibility...",border:"Border",width:"Width",style:"Style",color:"Color",preview:"Preview",borderStyles:{solid:"Solid",dashed:"Dashed",dotted:"Dotted",double:"Double",groove:"Groove",ridge:"Ridge",inset:"Inset",outset:"Outset"}},imagePosition:{title:"Image Position",horizontal:"Horizontal",vertical:"Vertical",position:"Position",alignment:"Alignment",offset:"Offset",offsetPx:"Offset (px)",align:"Align",relativeTo:"Relative to",alignOptions:{left:"Left",center:"Center",right:"Right",top:"Top",bottom:"Bottom"},relativeOptions:{page:"Page",column:"Column",margin:"Margin",character:"Character",paragraph:"Paragraph",line:"Line"}},pageSetup:{title:"Page Setup",pageSize:"PAGE SIZE",sizeLabel:"Size",custom:"Custom",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",margins:"MARGINS",top:"Top",bottom:"Bottom",left:"Left",right:"Right",pageSizes:{letter:'Letter (8.5" \xD7 11")',a4:'A4 (8.27" \xD7 11.69")',legal:'Legal (8.5" \xD7 14")',a3:'A3 (11.69" \xD7 16.54")',a5:'A5 (5.83" \xD7 8.27")',b5:'B5 (6.93" \xD7 9.84")',executive:'Executive (7.25" \xD7 10.5")'}},tableProperties:{title:"Table Properties",widthType:"Width type",widthLabel:"Width",alignmentLabel:"Alignment",widthTypes:{auto:"Auto",fixed:"Fixed (twips)",percentage:"Percentage"},units:{fiftiethsPercent:"(50ths of %)",twips:"tw"},alignOptions:{left:"Left",center:"Center",right:"Right"}},pasteSpecial:{title:"Paste Special",keepFormatting:"Keep Source Formatting",keepFormattingDescription:"Paste with original formatting",keepFormattingShortcut:"Ctrl+V",plainText:"Paste as Plain Text",plainTextDescription:"Paste without any formatting",plainTextShortcut:"Ctrl+Shift+V",readingClipboard:"Reading clipboard...",preview:"Preview:",noContent:"No content available to paste",clipboardError:"Unable to read clipboard. Please use Ctrl+V to paste."},footnoteProperties:{title:"Footnote & Endnote Properties",footnotes:"Footnotes",endnotes:"Endnotes",position:"Position",numberFormat:"Number format",startAt:"Start at",numbering:"Numbering",footnotePositions:{bottomOfPage:"Bottom of page",belowText:"Below text"},endnotePositions:{endOfDocument:"End of document",endOfSection:"End of section"},numberingOptions:{continuous:"Continuous",restartSection:"Restart each section",restartPage:"Restart each page"},formats:{decimal:"1, 2, 3, ...",lowerRoman:"i, ii, iii, ...",upperRoman:"I, II, III, ...",lowerAlpha:"a, b, c, ...",upperAlpha:"A, B, C, ...",symbols:"*, \u2020, \u2021, ..."}},keyboardShortcuts:{ariaLabel:"Keyboard Shortcuts",searchPlaceholder:"Search shortcuts...",categories:{editing:"Editing",formatting:"Formatting",navigation:"Navigation",clipboard:"Clipboard",selection:"Selection",view:"View",file:"File",other:"Other"},shortcuts:{save:"Save",saveDescription:"Save document",print:"Print",printDescription:"Print document",undo:"Undo",undoDescription:"Undo last action",redo:"Redo",redoDescription:"Redo last action",delete:"Delete",deleteDescription:"Delete selected text",find:"Find",findDescription:"Find text in document",findReplace:"Find & Replace",findReplaceDescription:"Find and replace text",cut:"Cut",cutDescription:"Cut selected text",copy:"Copy",copyDescription:"Copy selected text",paste:"Paste",pasteDescription:"Paste from clipboard",pastePlainText:"Paste as Plain Text",pastePlainTextDescription:"Paste without formatting",bold:"Bold",boldDescription:"Toggle bold formatting",italic:"Italic",italicDescription:"Toggle italic formatting",underline:"Underline",underlineDescription:"Toggle underline formatting",strikethrough:"Strikethrough",strikethroughDescription:"Toggle strikethrough",subscript:"Subscript",subscriptDescription:"Toggle subscript",superscript:"Superscript",superscriptDescription:"Toggle superscript",alignLeft:"Align Left",alignLeftDescription:"Left align paragraph",alignCenter:"Align Center",alignCenterDescription:"Center align paragraph",alignRight:"Align Right",alignRightDescription:"Right align paragraph",justify:"Justify",justifyDescription:"Justify paragraph",increaseIndent:"Increase Indent",increaseIndentDescription:"Increase paragraph indent",decreaseIndent:"Decrease Indent",decreaseIndentDescription:"Decrease paragraph indent",selectAll:"Select All",selectAllDescription:"Select all content",selectWord:"Select Word",selectWordDescription:"Select current word",selectParagraph:"Select Paragraph",selectParagraphDescription:"Select current paragraph",extendSelectionByWord:"Extend Selection by Word",extendSelectionByWordDescription:"Extend selection to next/previous word",extendSelectionToLineEdge:"Extend Selection to Line Edge",extendSelectionToLineEdgeDescription:"Extend selection to line start/end",moveByWord:"Move by Word",moveByWordDescription:"Move cursor to next/previous word",moveToLineStart:"Move to Line Start",moveToLineStartDescription:"Move cursor to start of line",moveToLineEnd:"Move to Line End",moveToLineEndDescription:"Move cursor to end of line",moveToDocumentStart:"Move to Document Start",moveToDocumentStartDescription:"Move cursor to start of document",moveToDocumentEnd:"Move to Document End",moveToDocumentEndDescription:"Move cursor to end of document",pageUp:"Page Up",pageUpDescription:"Scroll up one page",pageDown:"Page Down",pageDownDescription:"Scroll down one page",zoomIn:"Zoom In",zoomInDescription:"Increase zoom level",zoomOut:"Zoom Out",zoomOutDescription:"Decrease zoom level",resetZoom:"Reset Zoom",resetZoomDescription:"Reset zoom to 100%",keyboardShortcuts:"Keyboard Shortcuts",keyboardShortcutsDescription:"Show this help dialog"},noResults:'No shortcuts found matching "{query}"',pressEscToClose:"Press {key} to close",or:"or"}},comments:{resolved:"Resolved",resolve:"Resolve",reopen:"Reopen",moreOptions:"More options",unknown:"Unknown",addComment:"Add a comment...",replyPlaceholder:"Reply or add others with @",replyCount:"{count, plural, one {# reply} other {# replies}}"},trackedChanges:{unknown:"Unknown",replaced:"Replaced",with:"with",added:"Added",deleted:"Deleted"},contextMenu:{ariaLabel:"AI actions menu",textMenuAriaLabel:"Text editing menu",customPromptPlaceholder:"Enter custom prompt...",cut:"Cut",cutShortcut:"Ctrl+X",copy:"Copy",copyShortcut:"Ctrl+C",paste:"Paste",pasteShortcut:"Ctrl+V",pastePlainText:"Paste as Plain Text",pastePlainTextShortcut:"Ctrl+Shift+V",delete:"Delete",deleteShortcut:"Del",selectAll:"Select All",selectAllShortcut:"Ctrl+A",selected:"Selected:",aiActions:{askAi:"Ask AI",rewrite:"Rewrite",expand:"Expand",summarize:"Summarize",translate:"Translate",explain:"Explain",fixGrammar:"Fix Grammar",makeFormal:"Make Formal",makeCasual:"Make Casual",custom:"Custom"}},documentOutline:{ariaLabel:"Document outline",closeAriaLabel:"Close outline",closeTitle:"Close outline",title:"Outline",noHeadings:"No headings found. Add headings to your document to see them here."},sidebar:{ariaLabel:"Annotations sidebar"},titleBar:{untitled:"Untitled",documentNameAriaLabel:"Document name",menuBarAriaLabel:"Menu bar"},errors:{loadingDocument:"Loading document...",noDocumentLoaded:"No document loaded",failedToLoad:"Failed to Load Document",unableToParse:"Unable to Parse Document",somethingWentWrong:"Something went wrong",errorDescription:"An error occurred while rendering this component. Please try again or contact support if the problem persists.",errorLabel:"Error:",componentStack:"Component Stack:",tryAgain:"Try Again",showDetails:"Show details",hideDetails:"Hide details",unsavedChanges:"You have unsaved changes. Are you sure you want to leave?"},table:{insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table",mergeCells:"Merge cells",splitCell:"Split cell",editingTools:"Table editing tools",label:"Table:",cellFillColor:"Cell Fill Color",borderColor:"Border Color",borderWidth:"Border width",unknownAction:"Unknown Action",borders:{all:"All borders",outside:"Outside borders",inside:"Inside borders",none:"No borders",remove:"Remove borders",top:"Top border",bottom:"Bottom border",left:"Left border",right:"Right border",styleAriaLabel:"Border style",tooltip:"Borders"},moreOptions:"More table options",styles:{title:"Table Styles",label:"Styles",normalTable:"Normal Table",tableGrid:"Table Grid",gridTableLight:"Grid Table Light",plainTable1:"Plain Table 1",plainTable2:"Plain Table 2",plainTable3:"Plain Table 3",plainTable4:"Plain Table 4",gridTable1Light:"Grid Table 1 Light",gridTable4Accent1:"Grid Table 4 Accent 1",gridTable5Dark:"Grid Table 5 Dark",listTable3Accent2:"List Table 3 Accent 2",listTable4Accent3:"List Table 4 Accent 3",gridTable4Accent5:"Grid Table 4 Accent 5",gridTable4Accent6:"Grid Table 4 Accent 6"}},tableAdvanced:{verticalAlignment:"Vertical alignment",top:"Top",middle:"Middle",bottom:"Bottom",cellMargins:"Cell margins",textDirection:"Text direction",textDirections:{horizontal:"Horizontal (LR)",verticalRL:"Vertical (top-bottom, RL)",verticalLR:"Vertical (bottom-top, LR)"},toggleNoWrap:"Toggle no-wrap",rowHeight:"Row height",heightRules:{auto:"Auto",atLeast:"At least",exact:"Exact"},rule:"Rule",height:"Height",toggleHeaderRow:"Toggle header row",distributeColumns:"Distribute columns evenly",autoFit:"Auto-fit to contents",tableProperties:"Table properties...",tableAlignment:"Table alignment",alignTableLeft:"Align table left",alignTableCenter:"Align table center",alignTableRight:"Align table right",tableOptionsMenu:"Table options menu",tableOptions:"Table options"},imageTransform:{tooltip:"Transform",rotateClockwise:"Rotate clockwise",rotateCounterClockwise:"Rotate counter-clockwise",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical"},imageWrap:{inline:"Inline with text",floatLeft:"Float left (wrap right)",floatRight:"Float right (wrap left)",topAndBottom:"Top and bottom",behindText:"Behind text",inFrontOfText:"In front of text",tooltipPrefix:"Wrap: {label}"},responsePreview:{loading:"{action}...",result:"{action} Result",closeEsc:"Close (Esc)",editPrompt:"Edit the result before accepting:",changes:"Changes:",original:"Original:",new:"New:",cancelEdit:"Cancel Edit"},commentMarkers:{resolvedComment:"Resolved comment",comment:"Comment"},editor:{toggleCommentsSidebar:"Toggle comments sidebar",showDocumentOutline:"Show document outline",editing:"Editing",editingDescription:"Edit document directly",suggesting:"Suggesting",suggestingDescription:"Edits become suggestions",viewing:"Viewing",viewingDescription:"Read-only, no edits",failedToParse:"Failed to parse document",linkRemoved:"Link removed",linkCopied:"Link copied to clipboard",failedToSave:"Failed to save document"},hyperlinkPopup:{displayTextPlaceholder:"Display text",urlPlaceholder:"https://example.com",copyLink:"Copy link",editLink:"Edit link",removeLink:"Remove link"},headerFooter:{header:"Header",footer:"Footer",options:"Options",insertPageNumber:"Insert current page number",insertTotalPages:"Insert total page count",remove:"Remove {label}",closeEditing:"Close {label} editing"},image:{placeholder:"Image placeholder",placeholderText:"[Image]",editableAriaLabel:"Editable image"},ruler:{horizontal:"Horizontal ruler",vertical:"Vertical ruler",firstLineIndent:"First line indent",leftIndent:"Left indent",rightIndent:"Right indent",topMargin:"Top margin",bottomMargin:"Bottom margin"},print:{label:"Print",allPages:"All ({totalPages} pages)",singlePage:"Page {start}",pageRange:"Pages {start}-{end}"},unsaved:{unsaved:"Unsaved",saved:"Saved",unsavedTitle:"Document has unsaved changes",savedTitle:"All changes saved",unsavedAriaLabel:"Unsaved changes",savedAriaLabel:"All changes saved"},loading:{label:"Loading"}};var b=p,f=react.createContext(b),T=react.createContext("en");function d(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function y(e,o){if(!o)return e;let t={...e};for(let r of Object.keys(o)){let i=o[r];i!==null&&(d(e[r])&&d(i)?t[r]=y(e[r],i):i!==void 0&&(t[r]=i));}return t}function v(e,o){let t=e;for(let r of o.split(".")){if(!d(t))return;t=t[r];}return typeof t=="string"?t:void 0}function C(e){let o={},t=/(=\d+|\w+)\s*\{([^}]*)\}/g,r;for(;(r=t.exec(e))!==null;)o[r[1]]=r[2];return o}function R(e,o,t){return o?e.replace(/\{(\w+),\s*plural,\s*((?:[^{}]|\{[^{}]*\})*)\}/g,(i,n,l)=>{let a=Number(o[n]);if(isNaN(a))return i;let s=C(l),g=s[`=${a}`];if(g!==void 0)return g.replace(/#/g,String(a));let c;try{c=new Intl.PluralRules(t||"en").select(a);}catch{c=a===1?"one":"other";}return (s[c]??s.other??"").replace(/#/g,String(a))}).replace(/\{(\w+)\}/g,(i,n)=>{let l=o[n];return l!==void 0?String(l):`{${n}}`}):e}function x({i18n:e,children:o}){let t=e,r=typeof t?._lang=="string"?t._lang:"en",i=react.useMemo(()=>y(b,t),[t]);return jsxRuntime.jsx(T.Provider,{value:r,children:jsxRuntime.jsx(f.Provider,{value:i,children:o})})}function A(){let e=react.useContext(f),o=react.useContext(T);return {t:react.useCallback((r,i)=>{let n=v(e,r);return R(n??r,i,o)},[e,o])}}
|
|
2
|
-
exports.a=x;exports.b=A;
|
package/dist/chunk-QTSXJRP6.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {d as d$1}from'./chunk-TAUMSKRE.mjs';function E(){return {type:"break",breakType:"page"}}function K(){return {type:"break",breakType:"column"}}function j(t){return {type:"break",breakType:"textWrapping",clear:t}}function Z(){return {type:"run",content:[E()]}}function R(){return {type:"paragraph",content:[],formatting:{pageBreakBefore:true}}}function I(t){return t.content.filter(n=>n.type==="run")}function q(t,n){let{paragraphIndex:e}=n,o=[...t.package.document.content||[]],r=R();return o.splice(e+1,0,r),{...t,package:{...t.package,document:{...t.package.document,content:o}}}}function k(){return {type:"paragraph",content:[],formatting:{borders:{bottom:{style:"single",color:{rgb:"000000"},size:12,space:1}},spaceBefore:120,spaceAfter:120}}}function G(t,n){let{paragraphIndex:e}=n,o=[...t.package.document.content||[]],r=k();return o.splice(e+1,0,r),{...t,package:{...t.package,document:{...t.package.document,content:o}}}}function d(t){return t.type==="break"&&t.breakType==="page"}function Y(t){return t.type==="break"&&t.breakType==="column"}function Q(t){return t.type==="break"&&t.breakType==="textWrapping"}function ee(t){return t.type==="break"}function g(t){return t.formatting?.pageBreakBefore===true}function te(t){let n=0;for(let e of t.package.document.content||[])if(e.type==="paragraph"){let o=e;g(o)&&n++;let r=I(o);for(let a of r)for(let s of a.content)d(s)&&n++;}return n}function ne(t){let n=[],e=t.package.document.content||[];for(let o=0;o<e.length;o++){let r=e[o];if(r.type==="paragraph"){let a=r;g(a)&&n.push({paragraphIndex:o});let s=I(a);for(let l=0;l<s.length;l++){let c=s[l];for(let p of c.content)d(p)&&n.push({paragraphIndex:o,runIndex:l});}}}return n}function oe(t,n){let{paragraphIndex:e,runIndex:o}=n,r=[...t.package.document.content||[]],a=r[e];if(a.type!=="paragraph")return t;let s=a;if(g(s)&&o===void 0)return r[e]={...s,formatting:{...s.formatting,pageBreakBefore:false}},{...t,package:{...t.package,document:{...t.package.document,content:r}}};if(o!==void 0){let l=[],c=0;for(let p of s.content)if(p.type==="run"){if(c===o){let D=p.content.filter(X=>!d(X));D.length>0&&l.push({...p,content:D});}else l.push(p);c++;}else l.push(p);return r[e]={...s,content:l},{...t,package:{...t.package,document:{...t.package.document,content:r}}}}return t}var u=class{constructor(n){d$1(this,"listeners",new Set);d$1(this,"snapshot");d$1(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n);}));d$1(this,"getSnapshot",()=>this.snapshot);this.snapshot=n;}setSnapshot(n){this.snapshot=n,this.notify();}notify(){for(let n of this.listeners)n();}};var _="docx-editor-autosave",re=3e4,ae=1440*60*1e3,ie=2e3,A=1;function L(){try{let t="__docx_editor_test__";return localStorage.setItem(t,"test"),localStorage.removeItem(t),!0}catch{return false}}function P(t){return JSON.stringify({...t,originalBuffer:null})}function se(t){try{let n=JSON.parse(t);return !n||typeof n!="object"||!n.document||!n.savedAt?null:(n.version!==A&&console.warn("Auto-save data version mismatch, may need migration"),n)}catch{return null}}function le(t,n){let e=new Date(t).getTime();return Date.now()-e>n}var h=class extends u{constructor(e={}){super({status:"idle",lastSaveTime:null,hasRecoveryData:false,isEnabled:true});d$1(this,"storageKey");d$1(this,"interval");d$1(this,"maxAge");d$1(this,"saveOnChange");d$1(this,"debounceDelay");d$1(this,"onSaveCallback");d$1(this,"onErrorCallback");d$1(this,"onRecoveryAvailableCallback");d$1(this,"storageAvailable");d$1(this,"currentDocument",null);d$1(this,"lastSavedJson",null);d$1(this,"intervalTimer",null);d$1(this,"debounceTimer",null);d$1(this,"status","idle");d$1(this,"lastSaveTime",null);d$1(this,"_hasRecoveryData",false);d$1(this,"_isEnabled");this.storageKey=e.storageKey??_,this.interval=e.interval??re,this.maxAge=e.maxAge??ae,this.saveOnChange=e.saveOnChange??true,this.debounceDelay=e.debounceDelay??ie,this.onSaveCallback=e.onSave,this.onErrorCallback=e.onError,this.onRecoveryAvailableCallback=e.onRecoveryAvailable,this._isEnabled=true,this.storageAvailable=L(),this.checkRecoveryData();}onDocumentChanged(e){this.currentDocument=e,this._isEnabled&&this.saveOnChange&&e&&this.storageAvailable&&this.debounceSave();}async save(){if(!this.storageAvailable)return this.onErrorCallback?.(new Error("localStorage is not available")),false;let e=this.currentDocument;if(!e)return false;this.updateStatus("saving");try{let o=P(e);if(o===this.lastSavedJson)return this.updateStatus("saved"),!0;this.persistToStorage(o),this.lastSavedJson=o;let r=new Date;return this.lastSaveTime=r,this.updateStatus("saved"),this.onSaveCallback?.(r),!0}catch(o){return console.error("Auto-save failed:",o),this.updateStatus("error"),this.onErrorCallback?.(o),false}}clear(){if(this.storageAvailable)try{localStorage.removeItem(this.storageKey),this._hasRecoveryData=!1,this.lastSavedJson=null,this.emitSnapshot();}catch(e){console.error("Failed to clear auto-save:",e);}}getRecoveryData(){if(!this.storageAvailable)return null;try{let e=localStorage.getItem(this.storageKey);if(!e)return null;let o=se(e);return o?le(o.savedAt,this.maxAge)?(this.clear(),null):o:null}catch{return null}}acceptRecovery(){let e=this.getRecoveryData();return e?(this._hasRecoveryData=false,this.emitSnapshot(),e.document):null}dismissRecovery(){this.clear(),this._hasRecoveryData=false,this.emitSnapshot();}enable(){this._isEnabled=true,this.startInterval(),this.emitSnapshot();}disable(){this._isEnabled=false,this.stopTimers(),this.emitSnapshot();}startInterval(){this.stopTimers(),!(!this._isEnabled||!this.storageAvailable)&&(this.intervalTimer=setInterval(()=>{this.save();},this.interval));}destroy(){if(this.stopTimers(),this._isEnabled&&this.currentDocument&&this.storageAvailable)try{this.persistToStorage(P(this.currentDocument));}catch(e){console.error("Failed to save on destroy:",e);}}checkRecoveryData(){if(!this.storageAvailable)return;let e=this.getRecoveryData();e&&(this._hasRecoveryData=true,this.emitSnapshot(),this.onRecoveryAvailableCallback?.(e));}persistToStorage(e){let o={document:JSON.parse(e),savedAt:new Date().toISOString(),version:A};localStorage.setItem(this.storageKey,JSON.stringify(o));}debounceSave(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.save();},this.debounceDelay);}stopTimers(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null);}updateStatus(e){this.status=e,this.emitSnapshot();}emitSnapshot(){this.setSnapshot({status:this.status,lastSaveTime:this.lastSaveTime,hasRecoveryData:this._hasRecoveryData,isEnabled:this._isEnabled});}};function B(t){if(!t)return "Never";let e=new Date().getTime()-t.getTime(),o=Math.floor(e/1e3),r=Math.floor(o/60),a=Math.floor(r/60);return o<10?"Just now":o<60?`${o} seconds ago`:r<60?`${r} minute${r===1?"":"s"} ago`:a<24?`${a} hour${a===1?"":"s"} ago`:t.toLocaleDateString()}function F(t){return {idle:"Ready",saving:"Saving...",saved:"Saved",error:"Save failed"}[t]}function z(t=_){try{let n=localStorage.getItem(t);return n?new Blob([n]).size:0}catch{return 0}}function w(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function N(){return L()}var m={TABLE_INDEX:"data-table-index",ROW_INDEX:"data-row",COLUMN_INDEX:"data-col",TABLE_CELL:"data-table-cell"};function O(t,n){if(!(t instanceof Element))return null;let e=t;for(;e&&e!==n;){if(e.tagName==="TD"||e.tagName==="TH"){let o=e.getAttribute(m.ROW_INDEX),r=e.getAttribute(m.COLUMN_INDEX);if(o!==null&&r!==null){let a=e;for(;a&&a!==n;){if(a.tagName==="TABLE"){let s=a.getAttribute(m.TABLE_INDEX);if(s!==null)return {tableIndex:parseInt(s,10),rowIndex:parseInt(o,10),columnIndex:parseInt(r,10)};break}a=a.parentElement;}}break}e=e.parentElement;}return null}function M(t,n){if(!t.package?.document?.content)return null;let e=0;for(let o of t.package.document.content)if(o.type==="table"){if(e===n)return o;e++;}return null}function H(t,n,e){if(!t.package?.document?.content)return t;let o=0,r=t.package.document.content.map(a=>{if(a.type==="table"){if(o===n)return o++,e;o++;}return a});return {...t,package:{...t.package,document:{...t.package.document,content:r}}}}function V(t,n){if(!t.package?.document?.content)return t;let e=0,o=t.package.document.content.filter(r=>{if(r.type==="table"){let a=e===n;return e++,!a}return true});return {...t,package:{...t.package,document:{...t.package.document,content:o}}}}var f=class extends u{constructor(){super({selectedCell:null});}selectCell(n){this.setSnapshot({selectedCell:n});}clearSelection(){this.setSnapshot({selectedCell:null});}isCellSelected(n,e,o){let{selectedCell:r}=this.getSnapshot();return r?r.tableIndex===n&&r.rowIndex===e&&r.columnIndex===o:false}getSelectedCell(){return this.getSnapshot().selectedCell}};function W(t){if(!t||t==="transparent"||t==="inherit")return null;if(t.startsWith("#"))return t.slice(1).toUpperCase();let n=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(n){let e=parseInt(n[1]).toString(16).padStart(2,"0"),o=parseInt(n[2]).toString(16).padStart(2,"0"),r=parseInt(n[3]).toString(16).padStart(2,"0");return (e+o+r).toUpperCase()}return null}function y(t){let n=window.getComputedStyle(t),e={};(n.fontWeight==="bold"||parseInt(n.fontWeight)>=700)&&(e.bold=true),n.fontStyle==="italic"&&(e.italic=true);let o=n.textDecoration||n.textDecorationLine;o&&o.includes("underline")&&(e.underline={style:"single"}),o&&o.includes("line-through")&&(e.strike=true);let r=parseFloat(n.fontSize);!isNaN(r)&&r>0&&(e.fontSize=Math.round(r/1.333*2));let a=n.fontFamily.replace(/["']/g,"").split(",")[0].trim();a&&(e.fontFamily={ascii:a});let s=n.color;if(s&&s!=="rgb(0, 0, 0)"){let c=W(s);c&&(e.color={rgb:c});}let l=n.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=T(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function ue(t,n){let e=document.createRange();e.selectNodeContents(t);let o=n.compareBoundaryPoints(Range.START_TO_START,e)>=0&&n.compareBoundaryPoints(Range.START_TO_END,e)<=0,r=n.compareBoundaryPoints(Range.END_TO_START,e)>=0&&n.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(o&&r)return n.toString();if(o){let a=document.createRange();return a.setStart(n.startContainer,n.startOffset),a.selectNodeContents(t),a.setEnd(e.endContainer,e.endOffset),a.toString()}else if(r){let a=document.createRange();return a.selectNodeContents(t),a.setEnd(n.endContainer,n.endOffset),a.setStart(e.startContainer,e.startOffset),a.toString()}else if(n.intersectsNode(t))return t.textContent||"";return ""}function U(t){let n=t;for(;n;){if(n.nodeType===Node.ELEMENT_NODE){let e=n;if(e.hasAttribute("data-paragraph-index"))return e}n=n.parentNode;}return null}function C(){let t=window.getSelection();if(!t||t.isCollapsed)return [];let n=[],e=t.getRangeAt(0),o=e.commonAncestorContainer,r=o.nodeType===Node.ELEMENT_NODE?o:o.parentElement;if(!r)return n;if(r.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=ue(s,e);if(l){let c=y(s);n.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),n.length===0){let s=t.toString();s&&n.push({type:"run",content:[{type:"text",text:s}]});}return n}function $(){let t=window.getSelection();if(!t||t.isCollapsed)return null;let n=C();if(n.length===0)return null;let e=t.toString(),o=t.getRangeAt(0),r=U(o.startContainer),a=U(o.endContainer),s=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0,l=a?parseInt(a.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:n,startParagraphIndex:s,startRunIndex:0,startOffset:o.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:o.endOffset,isMultiParagraph:s!==l}}var T=W;var S=class extends u{constructor(){super({notifications:[]});d$1(this,"notifications",[]);d$1(this,"idCounter",0);d$1(this,"timers",new Set);}showError(e,o){return this.addNotification(e,"error",o)}showWarning(e,o){return this.addNotification(e,"warning",o)}showInfo(e,o){return this.addNotification(e,"info",o)}dismiss(e){this.notifications=this.notifications.map(r=>r.id===e?{...r,dismissed:true}:r),this.emitSnapshot();let o=setTimeout(()=>{this.timers.delete(o),this.notifications=this.notifications.filter(r=>r.id!==e),this.emitSnapshot();},300);this.timers.add(o);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,o,r){let a=`error-${++this.idCounter}-${Date.now()}`,s={id:a,message:e,severity:o,details:r,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),o!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(a);},5e3);this.timers.add(l);}return a}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function J(t,n){let e=`plugin-styles-${t}`,o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");return r.id=e,r.textContent=n,document.head.appendChild(r),()=>{let a=document.getElementById(e);a&&a.remove();}}var v=class extends u{constructor(){super({states:new Map,version:0});d$1(this,"plugins",[]);d$1(this,"pluginStates",new Map);d$1(this,"version",0);}initialize(e,o){this.destroyPlugins(),this.plugins=e;for(let r of e)r.initialize&&!this.pluginStates.has(r.id)&&this.pluginStates.set(r.id,r.initialize(o));this.emitSnapshot();}updateStates(e){let o=false;for(let r of this.plugins)if(r.onStateChange){let a=r.onStateChange(e);a!==void 0&&(this.pluginStates.set(r.id,a),o=true);}return o&&(this.version++,this.emitSnapshot()),o}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,o){this.pluginStates.set(e,o),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var b=class extends u{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});d$1(this,"_hasLayout",false);d$1(this,"_selectionRects",[]);d$1(this,"_caretPosition",null);d$1(this,"_isDragging",false);d$1(this,"_dragAnchor",null);d$1(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});d$1(this,"_selectedImageInfo",null);d$1(this,"_isImageInteracting",false);d$1(this,"_isFocused",false);d$1(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,o){this._selectionRects=e,this._caretPosition=o,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,o,r,a){this._columnResize={isResizing:true,startX:r,columnIndex:o,tablePmStart:e,originalWidths:a},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var x=class extends u{constructor(e={}){let o=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:o,fontsLoaded:false,version:0});d$1(this,"_loadingState","idle");d$1(this,"_parseError",null);d$1(this,"_zoom");d$1(this,"_fontsLoaded",false);d$1(this,"_document",null);d$1(this,"_version",0);d$1(this,"onChangeCallback");d$1(this,"onErrorCallback");this._zoom=o,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var pn="0.0.2";export{H as A,V as B,f as C,y as D,C as E,$ as F,T as G,S as H,J as I,v as J,b as K,x as L,pn as M,E as a,K as b,j as c,Z as d,R as e,q as f,k as g,G as h,d as i,Y as j,Q as k,ee as l,g as m,te as n,ne as o,oe as p,u as q,h as r,B as s,F as t,z as u,w as v,N as w,m as x,O as y,M as z};
|
package/dist/chunk-SE5EN2QL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';function u(n){return n/1440*96}function o(n){return n/96*1440}function P(n){return n==null||isNaN(n)?0:Math.round(n*96/914400)}function _(n){return n/96*914400}function I(n){return n/914400*1440}function E(n){return n/1440*914400}function i(n){return n/72*96}function m(n){return n/144*96}function N(n){return n/2}function H(n){return n/576*96}function t(n,e=2){let r=Math.pow(10,e);return Math.round(n*r)/r}function b(n){return `${t(n)}px`}exports.a=u;exports.b=o;exports.c=P;exports.d=_;exports.e=I;exports.f=E;exports.g=i;exports.h=m;exports.i=N;exports.j=H;exports.k=b;
|
package/dist/chunk-X5A54T6S.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-GZOCOWWB.mjs';import {p,a,b as b$2}from'./chunk-QAZ4233N.mjs';import {a as a$1,b as b$1,k}from'./chunk-LYBG4YI7.mjs';import*as ee from'react';import ee__default,{createContext,useRef,useState,useEffect,useCallback,useMemo,useContext}from'react';import*as q from'@radix-ui/react-select';import {clsx}from'clsx';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function L(...e){return clsx(e)}var Ie=q.Root,Fe=q.Group,at=q.Value;function Me({className:e,children:t,onMouseDown:o,...n}){return jsxs(q.Trigger,{className:L("flex h-8 items-center justify-between gap-1 rounded px-2 py-1","text-sm text-slate-700 bg-transparent","hover:bg-slate-100/80 focus:outline-none focus:bg-slate-100/80","disabled:cursor-not-allowed disabled:opacity-50","transition-colors duration-150","[&>span]:truncate",e),onMouseDown:r=>{r.preventDefault(),o?.(r);},...n,children:[t,jsx(q.Icon,{asChild:true,children:jsx(vn,{className:"h-4 w-4 text-slate-400 shrink-0"})})]})}function Pe({className:e,children:t,position:o="popper",onCloseAutoFocus:n,...r}){return jsx(q.Portal,{children:jsx("div",{className:"ep-root",children:jsx(q.Content,{className:L("relative z-50 max-h-72 min-w-[8rem] overflow-hidden","rounded-lg border border-slate-200 bg-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",e),position:o,onCloseAutoFocus:l=>{l.preventDefault(),n?.(l);},...r,children:jsx(q.Viewport,{className:L("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),onMouseDown:l=>l.preventDefault(),children:t})})})})}function Be({className:e,...t}){return jsx(q.Label,{className:L("px-2 py-1.5 text-xs font-medium text-slate-500",e),...t})}function me({className:e,children:t,onMouseDown:o,...n}){return jsxs(q.Item,{className:L("relative flex w-full cursor-pointer select-none items-center","rounded px-2 py-1.5 text-sm text-slate-700 outline-none","hover:bg-slate-100 focus:bg-slate-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onMouseDown:r=>{r.preventDefault(),o?.(r);},...n,children:[jsx(q.ItemText,{children:t}),jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsx(q.ItemIndicator,{children:jsx(xn,{className:"h-4 w-4"})})})]})}function Xe({className:e,...t}){return jsx(q.Separator,{className:L("-mx-1 my-1 h-px bg-slate-100",e),...t})}function vn({className:e}){return jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})}function xn({className:e}){return jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})}var yn=[{name:"Arial",fontFamily:"Arial, Helvetica, sans-serif",category:"sans-serif"},{name:"Calibri",fontFamily:'"Calibri", Arial, sans-serif',category:"sans-serif"},{name:"Helvetica",fontFamily:"Helvetica, Arial, sans-serif",category:"sans-serif"},{name:"Verdana",fontFamily:"Verdana, Geneva, sans-serif",category:"sans-serif"},{name:"Open Sans",fontFamily:'"Open Sans", sans-serif',category:"sans-serif"},{name:"Roboto",fontFamily:"Roboto, sans-serif",category:"sans-serif"},{name:"Times New Roman",fontFamily:'"Times New Roman", Times, serif',category:"serif"},{name:"Georgia",fontFamily:"Georgia, serif",category:"serif"},{name:"Cambria",fontFamily:"Cambria, Georgia, serif",category:"serif"},{name:"Garamond",fontFamily:"Garamond, serif",category:"serif"},{name:"Courier New",fontFamily:'"Courier New", Courier, monospace',category:"monospace"},{name:"Consolas",fontFamily:"Consolas, monospace",category:"monospace"}];function ro({value:e,onChange:t,fonts:o=yn,disabled:n=false,className:r,placeholder:l="Arial",width:s=120,showPreview:p=true}){let{t:m}=b(),a=ee.useMemo(()=>e?o.find(h=>h.fontFamily===e||h.name.toLowerCase()===e.toLowerCase())?.name||e:l,[e,o,l]),c=ee.useCallback(d=>{let h=o.find(b=>b.name===d);h&&t?.(h.fontFamily);},[t,o]),u=ee.useMemo(()=>{let d={"sans-serif":[],serif:[],monospace:[],other:[]};return o.forEach(h=>{let b=h.category||"other";d[b].push(h);}),d},[o]);return jsxs(Ie,{value:a,onValueChange:c,disabled:n,children:[jsx(Me,{className:L("h-8 text-sm",r),style:{minWidth:typeof s=="number"?`${s}px`:s},"aria-label":m("font.selectAriaLabel"),children:jsx(at,{placeholder:l,children:a})}),jsxs(Pe,{className:"max-h-[300px]",children:[u["sans-serif"].length>0&&jsxs(Fe,{children:[jsx(Be,{children:m("font.sansSerif")}),u["sans-serif"].map(d=>jsx(me,{value:d.name,style:p?{fontFamily:d.fontFamily}:void 0,children:d.name},d.name))]}),u.serif.length>0&&jsxs(Fragment,{children:[jsx(Xe,{}),jsxs(Fe,{children:[jsx(Be,{children:m("font.serif")}),u.serif.map(d=>jsx(me,{value:d.name,style:p?{fontFamily:d.fontFamily}:void 0,children:d.name},d.name))]})]}),u.monospace.length>0&&jsxs(Fragment,{children:[jsx(Xe,{}),jsxs(Fe,{children:[jsx(Be,{children:m("font.monospace")}),u.monospace.map(d=>jsx(me,{value:d.name,style:p?{fontFamily:d.fontFamily}:void 0,children:d.name},d.name))]})]})]})]})}var ao=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,io=clsx,lo=(e,t)=>o=>{var n;if(t?.variants==null)return io(e,o?.class,o?.className);let{variants:r,defaultVariants:l}=t,s=Object.keys(r).map(a=>{let c=o?.[a],u=l?.[a];if(c===null)return null;let d=ao(c)||ao(u);return r[a][d]}),p=o&&Object.entries(o).reduce((a,c)=>{let[u,d]=c;return d===void 0||(a[u]=d),a},{}),m=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((a,c)=>{let{class:u,className:d,...h}=c;return Object.entries(h).every(b=>{let[f,x]=b;return Array.isArray(x)?x.includes({...l,...p}[f]):{...l,...p}[f]===x})?[...a,u,d]:a},[]);return io(e,s,m,o?.class,o?.className)};var Cn=lo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),G=ee.forwardRef(({className:e,variant:t,size:o,...n},r)=>jsx("button",{className:L(Cn({variant:t,size:o,className:e})),ref:r,...n}));G.displayName="Button";function g({size:e=20,className:t="",style:o,children:n}){return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 -960 960 960",fill:"currentColor",className:t,style:{display:"inline-flex",flexShrink:0,...o},"aria-hidden":"true",children:n})}function wn(e){return jsx(g,{...e,children:jsx("path",{d:"M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"})})}function In(e){return jsx(g,{...e,children:jsx("path",{d:"M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"})})}function Mn(e){return jsx(g,{...e,children:jsx("path",{d:"M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"})})}function Pn(e){return jsx(g,{...e,children:jsx("path",{d:"M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"})})}function kn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"})})}function Rn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"})})}function Zn(e){return jsx(g,{...e,children:jsx("path",{d:"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"})})}function Ln(e){return jsx(g,{...e,children:jsx("path",{d:"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"})})}function Hn(e){return jsx(g,{...e,children:jsx("path",{d:"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"})})}function An(e){return jsx(g,{...e,children:jsx("path",{d:"M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"})})}function En(e){return jsx(g,{...e,children:jsx("path",{d:"m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"})})}function qn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"})})}function _n(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"})})}function Dn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"})})}function Nn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"})})}function Ht(e){return jsx(g,{...e,children:jsx("path",{d:"M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"})})}function Fn(e){return jsx(g,{...e,children:jsx("path",{d:"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"})})}function Bn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"})})}function On(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"})})}function zn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"})})}function Kn(e){return jsx(g,{...e,children:jsx("path",{d:"M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"})})}function Wn(e){return jsx(g,{...e,children:jsx("path",{d:"M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"})})}function Vn(e){return jsx(g,{...e,children:jsx("path",{d:"M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"})})}function $n(e){return jsx(g,{...e,children:jsx("path",{d:"M480-360 280-560h400L480-360Z"})})}function Gn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"})})}function Un(e){return jsx(g,{...e,children:jsx("path",{d:"M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"})})}function Yn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"})})}function jn(e){return jsx(g,{...e,children:jsx("path",{d:"M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})})}function Xn(e){return jsx(g,{...e,children:jsx("path",{d:"M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"})})}function Jn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"})})}function Qn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"})})}function er(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"})})}function tr(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function or(e){return jsx(g,{...e,children:jsx("path",{d:"M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"})})}function nr(e){return jsx(g,{...e,children:jsx("path",{d:"M200-440v-80h560v80H200Z"})})}function rr(e){return jsx(g,{...e,children:jsx("path",{d:"M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"})})}function ar(e){return jsx(g,{...e,children:jsx("path",{d:"M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"})})}function ir(e){return jsx(g,{...e,children:jsx("path",{d:"m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"})})}function lr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"})})}function sr(e){return jsx(g,{...e,children:jsx("path",{d:"M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"})})}function cr(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"})})}function ur(e){return jsx(g,{...e,children:jsx("path",{d:"M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"})})}function dr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"})})}function pr(e){return jsx(g,{...e,children:jsx("path",{d:"M160-440v-80h640v80H160Z"})})}function mr(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function hr(e){return jsx(g,{...e,children:jsx("path",{d:"M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function fr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"})})}function gr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"})})}function br(e){return jsx(g,{...e,children:jsx("path",{d:"M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"})})}function vr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"})})}function xr(e){return jsx(g,{...e,children:jsx("path",{d:"M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"})})}function yr(e){return jsx(g,{...e,children:jsx("path",{d:"M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"})})}function Tr(e){return jsx(g,{...e,children:jsx("path",{d:"M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"})})}function Cr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"})})}function Sr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"})})}function wr(e){return jsx(g,{...e,children:jsx("path",{d:"m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"})})}function Ir(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Mr(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Pr(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function kr(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"})})}function Rr(e){return jsx(g,{...e,children:jsx("path",{d:"M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"})})}function Zr(e){return jsx(g,{...e,children:jsx("path",{d:"M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"})})}function Lr(e){return jsx(g,{...e,children:jsx("path",{d:"M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"})})}function Hr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"})})}function Ar(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function Er(e){return jsx(g,{...e,children:jsx("path",{d:"m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"})})}function qr(e){return jsx(g,{...e,children:jsx("path",{d:"M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"})})}function _r(e){return jsx(g,{...e,children:jsx("path",{d:"m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"})})}function Dr(e){return jsx(g,{...e,children:jsx("path",{d:"M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"})})}function Nr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"})})}function Fr(e){return jsx(g,{...e,children:jsx("path",{d:"M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"})})}function Br(e){return jsx(g,{...e,children:jsx("path",{d:"M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"})})}function Or(e){return jsx(g,{...e,children:jsx("path",{d:"M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"})})}function zr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"})})}function Kr(e){return jsx(g,{...e,children:jsx("path",{d:"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"})})}function Wr(e){return jsx(g,{...e,children:jsx("path",{d:"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"})})}function Vr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"})})}function $r(e){return jsx(g,{...e,children:jsx("path",{d:"M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"})})}function Gr(e){return jsx(g,{...e,children:jsx("path",{d:"M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})})}function Ur(e){return jsx(g,{...e,children:jsx("path",{d:"M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"})})}function Yr(e){return jsx(g,{...e,children:jsx("path",{d:"m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"})})}function jr(e){return jsx(g,{...e,children:jsx("path",{d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function Xr(e){return jsxs(g,{...e,children:[jsx("path",{d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"}),jsx("path",{fill:"#188038",d:"m421-380 227-227-45-45-182 182-92-91-45 45 137 136Z"})]})}function Jr(e){return jsx(g,{...e,children:jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})})}function Qr(e){return jsx(g,{...e,children:jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})})}function ea(e){return jsx(g,{...e,children:jsx("path",{d:"M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function ta(e){return jsx(g,{...e,children:jsx("path",{d:"M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function oa(e){return jsx(g,{...e,children:jsx("path",{d:"M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"})})}function na(e){return jsx(g,{...e,children:jsx("path",{d:"M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function ra(e){return jsx(g,{...e,children:jsx("path",{d:"M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"})})}function aa(e){return jsx(g,{...e,children:jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"})})}function ia(e){return jsx(g,{...e,children:jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"})})}var la={undo:wn,redo:In,print:Mn,format_bold:Pn,format_italic:kn,format_underlined:Rn,strikethrough_s:Zn,superscript:Ln,subscript:Hn,link:An,format_clear:En,format_align_left:qn,format_align_center:_n,format_align_right:Dn,format_align_justify:Nn,format_line_spacing:Ht,format_list_bulleted:Fn,format_list_numbered:Bn,format_indent_increase:On,format_indent_decrease:zn,format_color_text:Kn,ink_highlighter:Wn,format_color_reset:Vn,arrow_drop_down:$n,table:Gn,table_chart:Un,grid_on:Yn,table_rows:jn,view_column:Xn,border_all:Jn,border_outer:Qn,border_inner:er,border_clear:tr,add:or,remove:nr,delete:rr,delete_sweep:ar,call_merge:ir,call_split:lr,drag_indicator:sr,image:cr,format_image_left:ur,format_image_right:dr,horizontal_rule:pr,flip_to_back:mr,flip_to_front:hr,open_with:fr,tune:gr,rotate_right:br,rotate_left:vr,swap_horiz:xr,swap_vert:yr,shapes:Tr,format_paint:Cr,expand_more:Sr,expand_less:wr,border_top:Ir,border_bottom:Mr,border_left:Pr,border_right:kr,padding:Rr,text_rotation_none:Zr,wrap_text:Lr,height:Hr,fit_width:Ar,settings:Er,border_color:qr,format_color_fill:_r,vertical_align_top:Dr,vertical_align_center:Nr,vertical_align_bottom:Fr,line_weight:Br,keyboard_arrow_up:Or,keyboard_arrow_down:zr,keyboard_arrow_left:Kr,keyboard_arrow_right:Wr,more_vert:Vr,page_break:$r,arrow_back:Gr,done_all:Ur,check_circle:Yr,chat_bubble_outline:jr,chat_bubble_check:Xr,check:Jr,close:Qr,add_comment:ea,comment:ta,edit_note:oa,rate_review:na,visibility:ra,format_textdirection_l_to_r:aa,format_textdirection_r_to_l:ia};function T({name:e,size:t=20,className:o="",style:n}){let r=la[e];return r?jsx(r,{size:t,className:o,style:n}):(console.warn(`Icon not found: ${e}`),jsx("span",{className:o,style:{fontSize:t,width:t,height:t,...n},children:e}))}function Y({isOpen:e,onClose:t,align:o="left"}){let n=useRef(null),r=useRef(null),[l,s]=useState({top:0,left:0});useEffect(()=>{if(!e||!n.current)return;let a=n.current.getBoundingClientRect();o==="right"?requestAnimationFrame(()=>{if(r.current){let c=r.current.getBoundingClientRect();s({top:a.bottom+4,left:a.right-c.width});}else s({top:a.bottom+4,left:a.left});}):s({top:a.bottom+4,left:a.left});},[e,o]),useEffect(()=>{if(!e)return;let a=d=>{let h=d.target;n.current&&!n.current.contains(h)&&r.current&&!r.current.contains(h)&&t();},c=d=>{d.key==="Escape"&&t();},u=()=>t();return document.addEventListener("mousedown",a),document.addEventListener("keydown",c),window.addEventListener("scroll",u,true),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",c),window.removeEventListener("scroll",u,true);}},[e,t]);let p=useCallback(a=>{a.preventDefault(),a.stopPropagation();},[]),m={position:"fixed",top:l.top,left:l.left,zIndex:1e4};return {containerRef:n,dropdownRef:r,dropdownStyle:m,handleMouseDown:p}}var pa=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],ma=1,ha=400;function ho(e){return e/2}function ds(e){return e*2}function po(e,t,o){for(let n of t)if(n>e)return n;return Math.min(e+1,o)}function mo(e,t,o){for(let n=t.length-1;n>=0;n--)if(t[n]<e)return t[n];return Math.max(e-1,o)}function fo({value:e,onChange:t,sizes:o=pa,disabled:n=false,className:r,placeholder:l="11",minSize:s=ma,maxSize:p=ha}){let{t:m}=b(),[a,c]=useState(false),[u,d]=useState(""),[h,b$1]=useState(false),f=useRef(null),x=useCallback(()=>{b$1(false),c(false);},[]),{containerRef:v,dropdownRef:y,dropdownStyle:S}=Y({isOpen:h,onClose:x}),w=e??(parseInt(l,10)||11),I=e!==void 0?e.toString():l,P=useCallback(M=>{if(M.preventDefault(),n)return;let F=mo(w,o,s);t?.(F);},[w,o,s,n,t]),W=useCallback(M=>{if(M.preventDefault(),n)return;let F=po(w,o,p);t?.(F);},[w,o,p,n,t]),O=useCallback(M=>{M.preventDefault(),!n&&(c(true),d(I),b$1(true),requestAnimationFrame(()=>{f.current?.focus(),f.current?.select();}));},[n,I]),we=useCallback(M=>{d(M.target.value);},[]),ce=useCallback(()=>{c(false);let M=parseFloat(u);if(!isNaN(M)&&M>=s&&M<=p){let F=Math.round(M*2)/2;t?.(F);}},[u,s,p,t]),be=useCallback(M=>{if(M.key==="Enter")M.preventDefault(),ce(),b$1(false);else if(M.key==="Escape")c(false),b$1(false);else if(M.key==="ArrowUp"){M.preventDefault();let F=po(w,o,p);d(F.toString()),t?.(F);}else if(M.key==="ArrowDown"){M.preventDefault();let F=mo(w,o,s);d(F.toString()),t?.(F);}},[ce,w,o,p,s,t]),H=useCallback(M=>{t?.(M),b$1(false),c(false);},[t]),X=useCallback(M=>{M.target.tagName!=="INPUT"&&M.preventDefault();},[]);return jsxs("div",{ref:v,className:L("flex items-center",r),onMouseDown:X,children:[jsx(G,{variant:"ghost",size:"icon-sm",className:L("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-r-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:P,disabled:n||w<=s,"aria-label":m("fontSize.decrease"),"data-testid":"font-size-decrease",children:jsx(T,{name:"remove",size:18})}),jsx("div",{className:"relative",children:a?jsx("input",{ref:f,type:"text",value:u,onChange:we,onBlur:ce,onKeyDown:be,className:L("h-7 w-10 text-center text-sm border border-slate-300 bg-white","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none"),"aria-label":m("fontSize.label"),"data-testid":"font-size-input"}):jsx("button",{type:"button",onClick:O,className:L("h-7 w-10 text-center text-sm border border-slate-200 bg-white","hover:border-slate-300 hover:bg-slate-50","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none",n&&"opacity-50 cursor-not-allowed"),disabled:n,"aria-label":m("fontSize.label"),"aria-haspopup":"listbox","aria-expanded":h,"data-testid":"font-size-display",children:I})}),h&&jsx("div",{ref:y,style:{...S,backgroundColor:"white",border:"1px solid #e2e8f0",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",maxHeight:240,overflowY:"auto",minWidth:60},role:"listbox","aria-label":m("fontSize.listLabel"),children:o.map(M=>jsx("button",{type:"button",onClick:()=>H(M),className:L("w-full px-3 py-1.5 text-sm text-left","hover:bg-slate-100",M===w&&"bg-slate-100 font-medium"),role:"option","aria-selected":M===w,children:M},M))}),jsx(G,{variant:"ghost",size:"icon-sm",className:L("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-l-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:W,disabled:n||w>=p,"aria-label":m("fontSize.increase"),"data-testid":"font-size-increase",children:jsx(T,{name:"add",size:18})})]})}var ba=[{name:"Dark Red",nameKey:"colorPicker.colors.darkRed",hex:"C00000"},{name:"Red",nameKey:"colorPicker.colors.red",hex:"FF0000"},{name:"Orange",nameKey:"colorPicker.colors.orange",hex:"FFC000"},{name:"Yellow",nameKey:"colorPicker.colors.yellow",hex:"FFFF00"},{name:"Light Green",nameKey:"colorPicker.colors.lightGreen",hex:"92D050"},{name:"Green",nameKey:"colorPicker.colors.green",hex:"00B050"},{name:"Light Blue",nameKey:"colorPicker.colors.lightBlue",hex:"00B0F0"},{name:"Blue",nameKey:"colorPicker.colors.blue",hex:"0070C0"},{name:"Dark Blue",nameKey:"colorPicker.colors.darkBlue",hex:"002060"},{name:"Purple",nameKey:"colorPicker.colors.purple",hex:"7030A0"}],it=18,va=2,xa={position:"relative",display:"inline-block"},ya={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)"},Ta={padding:"10px",backgroundColor:"#fff",border:"1px solid #d0d0d0",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.15)",width:"auto"},Et={fontSize:"11px",color:"#666",marginBottom:"4px",fontWeight:500},qt={height:"1px",backgroundColor:"#e0e0e0",margin:"8px 0"},vo={display:"grid",gap:`${va}px`},lt={width:`${it}px`,height:`${it}px`,border:"1px solid #c0c0c0",borderRadius:"2px",cursor:"pointer",padding:0,transition:"transform 0.1s, border-color 0.1s"},xo={...lt,transform:"scale(1.15)",borderColor:"#333",zIndex:1},yo={...lt,borderWidth:"2px",borderColor:"#0066cc",boxShadow:"0 0 0 1px #0066cc"},Ca={display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"5px 8px",border:"1px solid #d0d0d0",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"12px",color:"#333"},Sa={display:"flex",alignItems:"center",gap:"6px"},wa={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid #ccc",borderRadius:"3px",fontSize:"12px"},Ia={height:"24px",padding:"0 10px",border:"1px solid #ccc",borderRadius:"3px",backgroundColor:"#f5f5f5",fontSize:"12px",cursor:"pointer"},Ma={width:"16px",height:"4px",borderRadius:"1px",marginTop:"-2px"};function bo(e,t,o){if(!e)return t==="text"||t==="border"?"#000000":"transparent";if(typeof e=="string"){if(t==="highlight"){let n=b$2(e);return n||(e==="none"?"transparent":e.startsWith("#")?e:`#${e}`)}return e.startsWith("#")?e:`#${e}`}return a(e,o)}function Pa(e){let t=e.replace(/^#/,"");if(t.length!==6)return false;let o=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return (o*299+n*587+r*114)/1e3>230}function To(e,t,o){return e?(typeof e=="string"?e.replace(/^#/,"").toUpperCase():a(e,o).replace(/^#/,"").toUpperCase())===t.toUpperCase():false}function ka({matrix:e,selectedColor:t,theme:o,onSelect:n}){let[r,l]=useState(null);return jsx("div",{style:{...vo,gridTemplateColumns:`repeat(10, ${it}px)`},children:e.flatMap((s,p)=>s.map((m,a)=>{let c=`${p}-${a}`,u=r===c,d=To(t,m.hex,o);return jsx("button",{type:"button",style:{...d?yo:u?xo:lt,backgroundColor:`#${m.hex}`},title:m.label,"aria-label":m.label,"aria-selected":d,onClick:()=>n(m),onMouseDown:h=>h.preventDefault(),onMouseEnter:()=>l(c),onMouseLeave:()=>l(null)},c)}))})}function Ra({selectedColor:e,theme:t,onSelect:o}){let[n,r]=useState(null),{t:l}=b();return jsx("div",{style:{...vo,gridTemplateColumns:`repeat(10, ${it}px)`},children:ba.map((s,p)=>{let m=n===p,a=To(e,s.hex,t),c=l(s.nameKey);return jsx("button",{type:"button",style:{...a?yo:m?xo:lt,backgroundColor:`#${s.hex}`},title:c,"aria-label":c,"aria-selected":a,onClick:()=>o(s.hex),onMouseDown:u=>u.preventDefault(),onMouseEnter:()=>r(p),onMouseLeave:()=>r(null)},s.hex)})})}function qe({mode:e,value:t,onChange:o,theme:n,disabled:r=false,className:l,style:s,title:p$1,icon:m,autoLabel:a}){let[c,u]=useState(false),[d,h]=useState(false),[b$1,f]=useState(""),{t:x}=b();useEffect(()=>{let Z=bo(t,e,n).replace(/^#/,"");/^[0-9A-Fa-f]{6}$/.test(Z)&&f(Z.toUpperCase());},[t,e,n]);let v=useCallback(()=>u(false),[]),{containerRef:y,dropdownRef:S,dropdownStyle:w}=Y({isOpen:c,onClose:v}),I=n?.colorScheme??null,P=useMemo(()=>p(I),[I]),W=useMemo(()=>bo(t,e,n),[t,e,n]),O=useCallback(()=>{r||u(Z=>!Z);},[r]),we=useCallback(Z=>{if(e==="highlight")o?.(Z.hex);else {let J={themeColor:Z.themeSlot,rgb:Z.hex};Z.tint&&(J.themeTint=Z.tint),Z.shade&&(J.themeShade=Z.shade),o?.(J);}u(false);},[e,o]),ce=useCallback(Z=>{o?.(e==="highlight"?Z:{rgb:Z}),u(false);},[e,o]),be=useCallback(()=>{o?.(e==="highlight"?"none":{auto:true}),u(false);},[e,o]),H=useCallback(()=>{let Z=b$1.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/i.test(Z)&&(o?.(e==="highlight"?Z:{rgb:Z}),u(false),f(""));},[e,b$1,o]),X={...ya,...r?{cursor:"default",opacity:.38}:c?{backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"}:d?{backgroundColor:"var(--doc-bg-hover)"}:{}},M=x(e==="text"?"formattingBar.fontColor":e==="highlight"?"formattingBar.highlightColor":"table.borderColor"),F=m??(e==="text"?"format_color_text":e==="highlight"?"ink_highlighter":"border_color");return jsxs("div",{ref:y,className:`docx-advanced-color-picker ${l||""}`,style:{...xa,...s},children:[jsxs("button",{type:"button",className:"docx-advanced-color-picker-button",style:X,onClick:O,onMouseDown:Z=>Z.preventDefault(),onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),disabled:r,title:p$1||M,"aria-label":p$1||M,"aria-haspopup":"true","aria-expanded":c,children:[jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:0},children:[jsx(T,{name:F,size:18}),jsx("div",{style:{...Ma,backgroundColor:W==="transparent"?"#fff":W,outline:W==="transparent"||Pa(W)?"1px solid #bbb":"none"}})]}),jsx(T,{name:"arrow_drop_down",size:14})]}),c&&jsx("div",{ref:S,className:"docx-advanced-color-picker-dropdown",style:{...w,...Ta},role:"dialog","aria-label":`${M} picker`,onMouseDown:Z=>{Z.target.tagName!=="INPUT"&&Z.preventDefault();},children:jsxs(Fragment,{children:[jsxs("button",{type:"button",style:Ca,onClick:be,onMouseDown:Z=>Z.preventDefault(),children:[e==="highlight"?jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",border:"1px solid #ccc",borderRadius:"2px",position:"relative",backgroundColor:"#fff"},children:jsx("span",{style:{position:"absolute",top:"50%",left:"-1px",right:"-1px",height:"2px",backgroundColor:"#ff0000",transform:"rotate(-45deg)"}})}):jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",backgroundColor:"#000",borderRadius:"2px"}}),a??x(e==="highlight"?"colorPicker.noColor":"colorPicker.automatic")]}),jsx("div",{style:qt}),jsx("div",{style:Et,children:x("colorPicker.themeColors")}),jsx(ka,{matrix:P,selectedColor:t,theme:n,onSelect:we}),jsx("div",{style:qt}),jsx("div",{style:Et,children:x("colorPicker.standardColors")}),jsx(Ra,{selectedColor:t,theme:n,onSelect:ce}),jsx("div",{style:qt}),jsx("div",{style:Et,children:x("colorPicker.customColor")}),jsxs("div",{style:Sa,children:[jsx("span",{style:{fontSize:"12px",color:"#666"},children:"#"}),jsx("input",{type:"text",style:wa,value:b$1,onChange:Z=>f(Z.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:Z=>{Z.key==="Enter"&&H();},onMouseDown:Z=>{Z.stopPropagation();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsx("button",{type:"button",style:{...Ia,opacity:/^[0-9A-Fa-f]{6}$/.test(b$1)?1:.4,cursor:/^[0-9A-Fa-f]{6}$/.test(b$1)?"pointer":"default"},onClick:H,onMouseDown:Z=>Z.preventDefault(),disabled:!/^[0-9A-Fa-f]{6}$/.test(b$1),children:x("common.apply")})]})]})})]})}function oe({content:e,children:t,side:o="bottom",delayMs:n=400}){let[r,l]=ee.useState(false),[s,p]=ee.useState({x:0,y:0}),m=ee.useRef(null),a=ee.useRef(null),c=ee.useCallback(()=>{a.current=setTimeout(()=>{if(m.current){let b=m.current.getBoundingClientRect(),f=b.left+b.width/2,x=o==="top"?b.top-8:b.bottom+8;p({x:f,y:x});}l(true);},n);},[n,o]),u=ee.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),l(false);},[]);ee.useEffect(()=>()=>{a.current&&clearTimeout(a.current);},[]);let d=t.props,h=ee.cloneElement(t,{ref:m,onMouseEnter:b=>{c(),d.onMouseEnter?.(b);},onMouseLeave:b=>{u(),d.onMouseLeave?.(b);}});return jsxs(Fragment,{children:[h,r&&jsx("div",{className:"fixed z-50 px-2 py-1 text-xs font-medium text-white bg-slate-900 rounded-md shadow-lg",style:{left:s.x,top:s.y,transform:o==="top"?"translate(-50%, -100%)":o==="bottom"?"translate(-50%, 0)":void 0},children:e})]})}var et=20,_t=[{value:"left",label:"Align Left",labelKey:"alignment.alignLeft",shortcutKey:"alignment.alignLeftShortcut",icon:jsx(T,{name:"format_align_left",size:et}),iconName:"format_align_left",shortcut:"Ctrl+L"},{value:"center",label:"Center",labelKey:"alignment.center",shortcutKey:"alignment.centerShortcut",icon:jsx(T,{name:"format_align_center",size:et}),iconName:"format_align_center",shortcut:"Ctrl+E"},{value:"right",label:"Align Right",labelKey:"alignment.alignRight",shortcutKey:"alignment.alignRightShortcut",icon:jsx(T,{name:"format_align_right",size:et}),iconName:"format_align_right",shortcut:"Ctrl+R"},{value:"both",label:"Justify",labelKey:"alignment.justify",shortcutKey:"alignment.justifyShortcut",icon:jsx(T,{name:"format_align_justify",size:et}),iconName:"format_align_justify",shortcut:"Ctrl+J"}];function wo({value:e="left",onChange:t,disabled:o=false}){let{t:n}=b(),[r,l]=useState(false),s=useCallback(()=>l(false),[]),{containerRef:p,dropdownRef:m,dropdownStyle:a,handleMouseDown:c}=Y({isOpen:r,onClose:s}),u=useCallback(v=>{o||t?.(v),l(false);},[o,t]),d=_t.find(v=>v.value===e)||_t[0],h=n(d.labelKey),b$1=d.shortcutKey?n(d.shortcutKey):void 0,f=`${h}${b$1?` (${b$1})`:""}`,x=jsxs(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",r&&"bg-slate-100",o&&"opacity-30 cursor-not-allowed"),onMouseDown:c,onClick:()=>!o&&l(v=>!v),disabled:o,"aria-label":f,"aria-expanded":r,"aria-haspopup":"true","data-testid":"toolbar-alignment",children:[jsx(T,{name:d.iconName,size:et}),jsx(T,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:p,style:{position:"relative",display:"inline-block"},children:[r?x:jsx(oe,{content:f,children:x}),r&&!o&&jsx("div",{ref:m,style:{...a,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:v=>v.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:_t.map(v=>{let y=e===v.value,S=n(v.labelKey),w=v.shortcutKey?n(v.shortcutKey):void 0;return jsx("button",{type:"button",title:`${S}${w?` (${w})`:""}`,"data-testid":`alignment-${v.value}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:y?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:y?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:I=>I.preventDefault(),onMouseEnter:I=>{y||(I.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:I=>{I.currentTarget.style.backgroundColor=y?"var(--doc-primary-light)":"transparent";},onClick:()=>u(v.value),children:jsx(T,{name:v.iconName,size:18})},v.value)})})})]})}var Da={display:"inline-flex",alignItems:"center",gap:"4px"},Io={display:"inline-flex",alignItems:"center",gap:"4px"},dt={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",padding:"4px",border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"},Na={...dt,backgroundColor:"var(--doc-bg-hover)"},Fa={...dt,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Ba={...dt,cursor:"default",opacity:.38},Oa={width:"28px",height:"28px",padding:"2px"},za={width:"1px",height:"20px",backgroundColor:"var(--doc-border)",margin:"0 6px"},st=20;function ct({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:l,style:s}){let[p,m]=useState(false),a={...t?Ba:e?Fa:p?Na:dt,...s},c=u=>{u.preventDefault();};return jsx("button",{type:"button",className:`docx-list-button ${e?"docx-list-button-active":""} ${t?"docx-list-button-disabled":""} ${l||""}`,style:a,onMouseDown:c,onClick:t?void 0:n,onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),disabled:t,title:o,"aria-label":o,"aria-pressed":e,role:"button",children:r})}function Mo({listState:e,onBulletList:t,onNumberedList:o,onIndent:n,onOutdent:r,disabled:l=false,className:s,style:p,showIndentButtons:m=true,compact:a=false,hasIndent:c=false}){let{t:u}=b(),d=useCallback(()=>a?{...Oa}:{},[a]),h=e?.type==="bullet",b$1=e?.type==="numbered",x=(e?.isInList||h||b$1)&&(e?.level??0)>0||c;return jsxs("div",{className:`docx-list-buttons ${s||""}`,style:{...Da,...p},role:"group","aria-label":u("lists.ariaLabel"),children:[jsxs("div",{style:Io,role:"group","aria-label":u("lists.typeAriaLabel"),children:[jsx(ct,{active:h,disabled:l,title:u("lists.bulletList"),onClick:t,style:d(),children:jsx(T,{name:"format_list_bulleted",size:st})}),jsx(ct,{active:b$1,disabled:l,title:u("lists.numberedList"),onClick:o,style:d(),children:jsx(T,{name:"format_list_numbered",size:st})})]}),m&&jsxs(Fragment,{children:[jsx("div",{style:za,role:"separator"}),jsxs("div",{style:Io,role:"group","aria-label":u("lists.indentationAriaLabel"),children:[jsx(ct,{active:false,disabled:l||!x,title:u("lists.decreaseIndent"),onClick:r,style:d(),children:jsx(T,{name:"format_indent_decrease",size:st})}),jsx(ct,{active:false,disabled:l,title:u("lists.increaseIndent"),onClick:n,style:d(),children:jsx(T,{name:"format_indent_increase",size:st})})]})]})]})}function Po(){return {type:"none",level:0,isInList:false}}var Wa=[{label:"Single",labelKey:"lineSpacing.single",value:1,twipsValue:240},{label:"1.15",value:1.15,twipsValue:276},{label:"1.5",value:1.5,twipsValue:360},{label:"Double",labelKey:"lineSpacing.double",value:2,twipsValue:480}];function Ro({value:e,onChange:t,options:o=Wa,disabled:n=false,className:r}){let{t:l}=b(),s=ee.useMemo(()=>e===void 0?o[0]:o.find(a=>a.twipsValue===e)||o[0],[e,o]),p=ee.useCallback(a=>{let c=parseInt(a,10);isNaN(c)||t?.(c);},[t]),m=a=>a.labelKey?l(a.labelKey):a.label;return jsxs(Ie,{value:s.twipsValue.toString(),onValueChange:p,disabled:n,children:[jsx(Me,{className:L("h-8 text-sm gap-0.5 px-2",r),style:{width:"auto"},title:l("lineSpacing.lineSpacingTitle",{label:m(s)}),children:jsx(Ht,{className:"h-5 w-5 shrink-0"})}),jsxs(Pe,{children:[o.map(a=>jsx(me,{value:a.twipsValue.toString(),children:m(a)},a.twipsValue)),jsx(Xe,{}),jsx(Fe,{children:jsx(Be,{children:l("lineSpacing.paragraphSpacing")})})]})]})}var Zo=[{styleId:"Normal",name:"Normal text",nameKey:"styles.normalText",type:"paragraph",isDefault:true,priority:0,qFormat:true,fontSize:22},{styleId:"Title",name:"Title",nameKey:"styles.title",type:"paragraph",priority:1,qFormat:true,fontSize:52,bold:true},{styleId:"Subtitle",name:"Subtitle",nameKey:"styles.subtitle",type:"paragraph",priority:2,qFormat:true,fontSize:30,color:"666666"},{styleId:"Heading1",name:"Heading 1",nameKey:"styles.heading1",type:"paragraph",priority:3,qFormat:true,fontSize:40,bold:true},{styleId:"Heading2",name:"Heading 2",nameKey:"styles.heading2",type:"paragraph",priority:4,qFormat:true,fontSize:32,bold:true},{styleId:"Heading3",name:"Heading 3",nameKey:"styles.heading3",type:"paragraph",priority:5,qFormat:true,fontSize:28,bold:true}],Va="#4a6c8c",$a={Title:26,Subtitle:18,Heading1:24,Heading2:18,Heading3:16,Heading4:14,Heading5:13,Heading6:13,Normal:14};function Ga(e){let t={},o=$a[e.styleId];if(o)t.fontSize=`${o}px`;else {let n=e.fontSize?e.fontSize/2:11,r=Math.min(Math.max(n,11),20);t.fontSize=`${r}px`;}return t.lineHeight="1.3",e.bold&&(t.fontWeight="bold"),e.italic&&(t.fontStyle="italic"),e.color?t.color=`#${e.color}`:e.styleId.startsWith("Heading")&&(t.color=Va),t}function Lo({value:e,onChange:t,styles:o,disabled:n=false,className:r,width:l=120}){let{t:s}=b(),p=ee.useMemo(()=>!o||o.length===0?Zo:o.filter(b=>b.type==="paragraph").filter(b=>b.qFormat?true:!(b.hidden||b.semiHidden)).map(b=>{let f=Zo.find(x=>x.styleId===b.styleId);return {styleId:b.styleId,name:b.name||b.styleId,nameKey:f?.nameKey,type:b.type,isDefault:b.default,qFormat:b.qFormat,priority:b.uiPriority??99,fontSize:b.rPr?.fontSize??f?.fontSize,bold:b.rPr?.bold??f?.bold,italic:b.rPr?.italic??f?.italic,color:b.rPr?.color?.rgb??f?.color}}).sort((b,f)=>(b.priority??99)-(f.priority??99)),[o]),m=ee.useCallback(h=>{t?.(h);},[t]),a=h=>h.nameKey?s(h.nameKey):h.name,c=e||"Normal",u=p.find(h=>h.styleId===c),d=u?a(u):c;return jsxs(Ie,{value:c,onValueChange:m,disabled:n,children:[jsx(Me,{className:L("h-8 text-sm",r),style:{width:typeof l=="number"?`${l}px`:l},"aria-label":s("styles.selectAriaLabel"),children:jsx("span",{className:"truncate",children:d})}),jsx(Pe,{className:"min-w-[260px] max-h-[400px]",children:p.map(h=>jsx(me,{value:h.styleId,className:"py-2.5 px-3",children:jsx("span",{style:Ga(h),children:a(h)})},h.styleId))})]})}var Ya=[{value:.5,label:"50%"},{value:.75,label:"75%"},{value:1,label:"100%"},{value:1.25,label:"125%"},{value:1.5,label:"150%"},{value:2,label:"200%"}];function Ho({value:e=1,onChange:t,levels:o=Ya,disabled:n=false,className:r,compact:l=false}){let{t:s}=b(),p=ee.useMemo(()=>{let a=o.find(c=>Math.abs(c.value-e)<.001);return a?a.label:`${Math.round(e*100)}%`},[o,e]),m=ee.useCallback(a=>{let c=parseFloat(a);isNaN(c)||t?.(c);},[t]);return jsxs(Ie,{value:e.toString(),onValueChange:m,disabled:n,children:[jsx(Me,{className:L(l?"h-7 min-w-[55px] text-xs":"h-8 min-w-[70px] text-sm",r),"aria-label":s("zoom.ariaLabel",{label:p}),children:jsx(at,{placeholder:"100%",children:p})}),jsx(Pe,{children:o.map(a=>jsx(me,{value:a.value.toString(),children:a.label},a.value))})]})}var Ja=[{action:"borderAll",icon:"border_all",labelKey:"table.borders.all"},{action:"borderOutside",icon:"border_outer",labelKey:"table.borders.outside"},{action:"borderInside",icon:"border_inner",labelKey:"table.borders.inside"},{action:"borderTop",icon:"border_top",labelKey:"table.borders.top"},{action:"borderBottom",icon:"border_bottom",labelKey:"table.borders.bottom"},{action:"borderLeft",icon:"border_left",labelKey:"table.borders.left"},{action:"borderRight",icon:"border_right",labelKey:"table.borders.right"},{action:"borderNone",icon:"border_clear",labelKey:"table.borders.none"}];function qo({onAction:e,disabled:t=false}){let{t:o}=b(),[n,r]=useState(false),l=useCallback(()=>r(false),[]),{containerRef:s,dropdownRef:p,dropdownStyle:m,handleMouseDown:a}=Y({isOpen:n,onClose:l}),c=useCallback(d=>{e(d),r(false);},[e]),u=jsxs(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:a,onClick:()=>!t&&r(d=>!d),disabled:t,"aria-label":o("table.borders.styleAriaLabel"),"aria-expanded":n,"aria-haspopup":"true","data-testid":"toolbar-table-borders",children:[jsx(T,{name:"border_all",size:20}),jsx(T,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:s,style:{position:"relative",display:"inline-block"},children:[n?u:jsx(oe,{content:o("table.borders.tooltip"),children:u}),n&&!t&&jsx("div",{ref:p,style:{...m,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:d=>d.stopPropagation(),children:jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:Ja.map(({action:d,icon:h,labelKey:b})=>jsx("button",{type:"button",title:o(b),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:"transparent",cursor:"pointer",color:"var(--doc-text)"},onMouseDown:f=>f.preventDefault(),onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(d),children:jsx(T,{name:h,size:18})},typeof d=="string"?d:d.type))})})]})}function _o({onAction:e,disabled:t=false,theme:o,value:n}){let{t:r}=b(),l=useCallback(s=>{typeof s=="string"?e({type:"borderColor",color:s.replace(/^#/,"")}):s.rgb?e({type:"borderColor",color:s.rgb.replace(/^#/,"")}):s.auto&&e({type:"borderColor",color:"000000"});},[e]);return jsx(qe,{mode:"border",value:n,onChange:l,theme:o,disabled:t,title:r("table.borderColor")})}var oi=[{size:4,label:"0.5 pt",thickness:.5},{size:8,label:"1 pt",thickness:1},{size:12,label:"1.5 pt",thickness:1.5},{size:16,label:"2 pt",thickness:2},{size:24,label:"3 pt",thickness:3}];function No({onAction:e,disabled:t=false}){let[o,n]=useState(false),{t:r}=b(),l=useCallback(()=>n(false),[]),{containerRef:s,dropdownRef:p,dropdownStyle:m,handleMouseDown:a}=Y({isOpen:o,onClose:l}),c=useCallback(d=>{e({type:"borderWidth",size:d}),n(false);},[e]),u=jsxs(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:a,onClick:()=>!t&&n(d=>!d),disabled:t,"aria-label":r("table.borderWidth"),"aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-border-width",children:[jsx(T,{name:"line_weight",size:20}),jsx(T,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:s,style:{position:"relative",display:"inline-block"},children:[o?u:jsx(oe,{content:r("table.borderWidth"),children:u}),o&&!t&&jsx("div",{ref:p,style:{...m,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:120},onMouseDown:d=>d.stopPropagation(),children:oi.map(({size:d,label:h,thickness:b})=>jsxs("button",{type:"button",style:{display:"flex",alignItems:"center",gap:10,padding:"6px 12px",width:"100%",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:12,color:"var(--doc-text)"},onMouseDown:f=>f.preventDefault(),onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(d),children:[jsx("div",{style:{width:50,height:Math.max(b,1),backgroundColor:"#000",borderRadius:b>2?1:0}}),jsx("span",{children:h})]},d))})]})}function Fo({onAction:e,disabled:t=false,theme:o,value:n}){let{t:r}=b(),l=useCallback(s=>{typeof s=="string"&&e(s==="none"?{type:"cellFillColor",color:null}:{type:"cellFillColor",color:s.replace(/^#/,"")});},[e]);return jsx(qe,{mode:"highlight",value:n,onChange:l,theme:o,disabled:t,title:r("table.cellFillColor"),icon:"format_color_fill",autoLabel:r("colorPicker.noColor")})}var ai={display:"flex",alignItems:"center",gap:10,padding:"7px 14px",fontSize:13,color:"var(--doc-text)",cursor:"pointer",border:"none",backgroundColor:"transparent",width:"100%",textAlign:"left"},Ve={height:1,backgroundColor:"var(--doc-border)",margin:"4px 0"},zo={padding:"6px 14px 2px",fontSize:11,color:"var(--doc-text-muted)",fontWeight:500};function Ko({onAction:e,disabled:t=false,tableContext:o}){let{t:n}=b(),[r,l]=useState(false),[s,p]=useState(null),m=useCallback(()=>l(false),[]),{containerRef:a,dropdownRef:c,dropdownStyle:u,handleMouseDown:d}=Y({isOpen:r,onClose:m,align:"right"}),h=o?.table?.attrs?.justification??"left",b$1=useCallback(v=>{e(v),l(false);},[e]),f=(v,y,S,w,I)=>{let P=t||I?.itemDisabled;return jsxs("button",{type:"button",role:"menuitem",style:{...ai,backgroundColor:s===v&&!P?"var(--doc-bg-hover)":"transparent",color:P?"var(--doc-text-muted)":I?.danger?"var(--doc-error)":"var(--doc-text)",cursor:P?"not-allowed":"pointer"},onClick:()=>!P&&b$1(w),onMouseEnter:()=>p(v),onMouseLeave:()=>p(null),disabled:P,children:[jsx(T,{name:y,size:16,className:I?.danger&&!P?"text-red-600":""}),jsx("span",{style:{flex:1},children:S})]},v)},x=jsx(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",r&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:d,onClick:()=>!t&&l(v=>!v),disabled:t,"aria-label":n("table.moreOptions"),"aria-expanded":r,"aria-haspopup":"menu","data-testid":"toolbar-table-more",children:jsx(T,{name:"more_vert",size:20})});return jsxs("div",{ref:a,style:{position:"relative",display:"inline-block"},children:[r?x:jsx(oe,{content:n("table.moreOptions"),children:x}),r&&!t&&jsxs("div",{ref:c,style:{...u,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:200,maxHeight:"70vh",overflowY:"auto"},role:"menu",onMouseDown:v=>v.stopPropagation(),children:[f("addRowAbove","add",n("table.insertRowAbove"),"addRowAbove"),f("addRowBelow","add",n("table.insertRowBelow"),"addRowBelow"),f("addColumnLeft","add",n("table.insertColumnLeft"),"addColumnLeft"),f("addColumnRight","add",n("table.insertColumnRight"),"addColumnRight"),jsx("div",{style:Ve,role:"separator"}),f("mergeCells","call_merge",n("table.mergeCells"),"mergeCells",{itemDisabled:!o?.hasMultiCellSelection}),f("splitCell","call_split",n("table.splitCell"),"splitCell",{itemDisabled:!o?.canSplitCell}),jsx("div",{style:Ve,role:"separator"}),f("deleteRow","delete",n("table.deleteRow"),"deleteRow",{danger:true,itemDisabled:(o?.rowCount??0)<=1}),f("deleteColumn","delete",n("table.deleteColumn"),"deleteColumn",{danger:true,itemDisabled:(o?.columnCount??0)<=1}),f("deleteTable","delete",n("table.deleteTable"),"deleteTable",{danger:true}),jsx("div",{style:Ve,role:"separator"}),jsx("div",{style:zo,children:n("tableAdvanced.verticalAlignment")}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["top","center","bottom"].map(v=>{let y={top:"vertical_align_top",center:"vertical_align_center",bottom:"vertical_align_bottom"};return jsx("button",{type:"button",title:n({top:"tableAdvanced.top",center:"tableAdvanced.middle",bottom:"tableAdvanced.bottom"}[v]),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:"transparent",cursor:"pointer"},onMouseDown:w=>w.preventDefault(),onMouseEnter:w=>{w.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent";},onClick:()=>b$1({type:"cellVerticalAlign",align:v}),children:jsx(T,{name:y[v],size:16})},v)})}),jsx("div",{style:Ve,role:"separator"}),jsx("div",{style:zo,children:n("tableAdvanced.tableAlignment")}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["left","center","right"].map(v=>{let y={left:"format_align_left",center:"format_align_center",right:"format_align_right"},S=h===v;return jsx("button",{type:"button",title:n({left:"tableAdvanced.alignTableLeft",center:"tableAdvanced.alignTableCenter",right:"tableAdvanced.alignTableRight"}[v]),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:S?"var(--doc-primary-light)":"transparent",borderColor:S?"var(--doc-primary)":"var(--doc-border)",color:S?"var(--doc-primary)":"var(--doc-text)",cursor:"pointer"},onMouseDown:w=>w.preventDefault(),onClick:()=>b$1({type:"tableProperties",props:{justification:v}}),children:jsx(T,{name:y[v],size:16})},v)})}),jsx("div",{style:Ve,role:"separator"}),f("headerRow","table_rows",n("tableAdvanced.toggleHeaderRow"),{type:"toggleHeaderRow"}),f("distribute","view_column",n("tableAdvanced.distributeColumns"),{type:"distributeColumns"}),f("autoFit","fit_width",n("tableAdvanced.autoFit"),{type:"autoFitContents"}),f("noWrap","wrap_text",n("tableAdvanced.toggleNoWrap"),{type:"toggleNoWrap"}),jsx("div",{style:Ve,role:"separator"}),f("properties","settings",n("tableAdvanced.tableProperties"),{type:"openTableProperties"})]})]})}var li=20;function gt({options:e,activeValue:t,triggerIcon:o,tooltipContent:n,onSelect:r,disabled:l=false,ariaLabel:s,testId:p}){let[m,a]=useState(false),c=useCallback(()=>a(false),[]),{containerRef:u,dropdownRef:d,dropdownStyle:h,handleMouseDown:b}=Y({isOpen:m,onClose:c}),f=useCallback(v=>{l||r(v),a(false);},[l,r]),x=jsxs(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",m&&"bg-slate-100",l&&"opacity-30 cursor-not-allowed"),onMouseDown:b,onClick:()=>!l&&a(v=>!v),disabled:l,"aria-label":s??n,"aria-expanded":m,"aria-haspopup":"true","data-testid":p,children:[jsx(T,{name:o,size:li}),jsx(T,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:u,style:{position:"relative",display:"inline-block"},children:[m?x:jsx(oe,{content:n,children:x}),m&&!l&&jsx("div",{ref:d,style:{...h,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:v=>v.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:e.map(v=>{let y=t===v.value;return jsx("button",{type:"button",title:v.label,"data-testid":p?`${p}-${v.value}`:void 0,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:y?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:y?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:S=>S.preventDefault(),onMouseEnter:S=>{y||(S.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:S=>{S.currentTarget.style.backgroundColor=y?"var(--doc-primary-light)":"transparent";},onClick:()=>f(v.value),children:jsx(T,{name:v.iconName,size:18})},v.value)})})})]})}var si=[{value:"inline",labelKey:"imageWrap.inline",iconName:"format_image_left"},{value:"wrapRight",labelKey:"imageWrap.floatLeft",iconName:"format_image_right"},{value:"wrapLeft",labelKey:"imageWrap.floatRight",iconName:"format_image_left"},{value:"topAndBottom",labelKey:"imageWrap.topAndBottom",iconName:"horizontal_rule"},{value:"behind",labelKey:"imageWrap.behindText",iconName:"flip_to_back"},{value:"inFront",labelKey:"imageWrap.inFrontOfText",iconName:"flip_to_front"}];function ci(e){return e.displayMode==="float"&&e.cssFloat==="left"?"wrapRight":e.displayMode==="float"&&e.cssFloat==="right"?"wrapLeft":e.wrapType}function $o({imageContext:e,onChange:t,disabled:o=false}){let{t:n}=b(),r=si.map(p=>({...p,label:n(p.labelKey)})),l=ci(e),s=r.find(p=>p.value===l)||r[0];return jsx(gt,{options:r,activeValue:l,triggerIcon:s.iconName,tooltipContent:`Wrap: ${s.label}`,onSelect:t,disabled:o,testId:"toolbar-image-wrap"})}var di=[{value:"rotateCW",labelKey:"imageTransform.rotateClockwise",iconName:"rotate_right"},{value:"rotateCCW",labelKey:"imageTransform.rotateCounterClockwise",iconName:"rotate_left"},{value:"flipH",labelKey:"imageTransform.flipHorizontal",iconName:"swap_horiz"},{value:"flipV",labelKey:"imageTransform.flipVertical",iconName:"swap_vert"}];function Go({onTransform:e,disabled:t=false}){let{t:o}=b(),n=di.map(r=>({...r,label:o(r.labelKey)}));return jsx(gt,{options:n,triggerIcon:"rotate_right",tooltipContent:o("imageTransform.tooltip"),onSelect:e,disabled:t,testId:"toolbar-image-transform"})}function hi(e){return "type"in e&&e.type==="separator"}var jo={display:"flex",alignItems:"center",gap:2,padding:"2px 8px",border:"none",background:"transparent",borderRadius:4,cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--doc-text, #374151)",whiteSpace:"nowrap",height:28,lineHeight:"28px"},fi={...jo,background:"var(--doc-hover, #f3f4f6)"},Xo={display:"flex",alignItems:"center",gap:8,padding:"6px 12px",border:"none",background:"transparent",cursor:"pointer",fontSize:13,color:"var(--doc-text, #374151)",width:"100%",textAlign:"left",whiteSpace:"nowrap"},gi={...Xo,opacity:.4,cursor:"default"},bi={height:1,backgroundColor:"var(--doc-border, #e5e7eb)",margin:"4px 0"},vi={marginLeft:"auto",fontSize:12,color:"var(--doc-text-muted, #9ca3af)"},xi={position:"absolute",left:"100%",top:-4,marginLeft:2,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:8,zIndex:1001};function vt({label:e,items:t,disabled:o}){let[n,r]=useState(false),[l,s]=useState(null),p=useRef(null),m=useRef(null),[a,c]=useState({top:0,left:0}),u=useCallback(()=>{r(false),s(null);},[]);useEffect(()=>{if(!n||!p.current)return;let h=p.current.getBoundingClientRect();c({top:h.bottom+2,left:h.left});},[n]),useEffect(()=>{if(!n)return;function h(x){let v=x.target;p.current&&!p.current.contains(v)&&m.current&&!m.current.contains(v)&&u();}function b(x){x.key==="Escape"&&u();}function f(){u();}return document.addEventListener("mousedown",h),document.addEventListener("keydown",b),window.addEventListener("scroll",f,true),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",b),window.removeEventListener("scroll",f,true);}},[n,u]);let d=h=>{h.disabled||h.submenuContent||h.onClick&&(h.onClick(),u());};return jsxs("div",{style:{position:"relative"},children:[jsxs("button",{ref:p,type:"button",onClick:()=>!o&&r(!n),onMouseDown:h=>h.preventDefault(),disabled:o,style:n?fi:jo,children:[e,jsx(T,{name:"arrow_drop_down",size:16})]}),n&&jsx("div",{ref:m,style:{position:"fixed",top:a.top,left:a.left,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:"4px 0",zIndex:1e4,minWidth:200},onMouseDown:h=>h.preventDefault(),children:t.map((h,b)=>{if(hi(h))return jsx("div",{style:bi},`sep-${b}`);let f=h;if(f.customContent)return jsx("div",{onMouseDown:y=>y.preventDefault(),children:f.customContent},f.label);let x=!!f.submenuContent,v=l===f.label;return jsxs("div",{style:{position:"relative"},onMouseEnter:()=>x&&s(f.label),onMouseLeave:()=>x&&s(null),children:[jsxs("button",{type:"button",style:f.disabled?gi:Xo,onClick:()=>d(f),onMouseDown:y=>y.preventDefault(),onMouseOver:y=>{f.disabled||(y.currentTarget.style.backgroundColor="var(--doc-hover, #f3f4f6)");},onMouseOut:y=>{y.currentTarget.style.backgroundColor="transparent";},disabled:f.disabled,children:[f.icon&&jsx(T,{name:f.icon,size:18}),jsx("span",{children:f.label}),f.shortcut&&jsx("span",{style:vi,children:f.shortcut}),x&&jsx("span",{style:{marginLeft:"auto"},children:jsx(T,{name:"keyboard_arrow_right",size:16})})]}),x&&v&&jsx("div",{style:xi,onMouseDown:y=>y.preventDefault(),children:f.submenuContent(u)})]},f.label)})})]})}var Ot=18,Ti=2,Qo={width:Ot,height:Ot,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:2,transition:"background-color 0.1s, border-color 0.1s",cursor:"pointer"},Ci={...Qo,backgroundColor:"var(--doc-primary, #3b82f6)",border:"1px solid var(--doc-primary, #3b82f6)"},Si={marginTop:6,fontSize:11,fontWeight:500,color:"var(--doc-text, #374151)",textAlign:"center"};function en({onInsert:e,gridRows:t=6,gridColumns:o=6}){let[n,r]=useState(0),[l,s]=useState(0),p=useCallback(()=>{n>0&&l>0&&e(n,l);},[n,l,e]),m=[];for(let c=1;c<=t;c++)for(let u=1;u<=o;u++){let d=c<=n&&u<=l;m.push(jsx("div",{style:d?Ci:Qo,onMouseEnter:()=>{r(c),s(u);},onClick:p,role:"gridcell","aria-selected":d},`${c}-${u}`));}let a=n>0&&l>0?`${l} \xD7 ${n}`:"Select size";return jsxs("div",{children:[jsx("div",{style:{display:"grid",gap:Ti,gridTemplateColumns:`repeat(${o}, ${Ot}px)`},onMouseLeave:()=>{r(0),s(0);},role:"grid","aria-label":"Table size selector",children:m}),jsx("div",{style:Si,children:a})]})}var Ii={FFFF00:"yellow","00FF00":"green","00FFFF":"cyan",FF00FF:"magenta","0000FF":"blue",FF0000:"red","00008B":"darkBlue","008080":"darkCyan","008000":"darkGreen",800080:"darkMagenta","8B0000":"darkRed",808e3:"darkYellow",808080:"darkGray",C0C0C0:"lightGray","000000":"black",FFFFFF:"white"};function lc(e){let t=e.replace(/^#/,"").toUpperCase();return Ii[t]||null}function ne({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:l,ariaLabel:s}){let p=s?.toLowerCase().replace(/\s+/g,"-")||o?.toLowerCase().replace(/\s+/g,"-").replace(/\([^)]*\)/g,"").trim(),m=c=>{c.preventDefault();},a=jsx(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",e&&"bg-slate-900 text-white hover:bg-slate-800 hover:text-white",t&&"opacity-30 cursor-not-allowed",l),onMouseDown:m,onClick:t?void 0:n,disabled:t,"aria-pressed":e,"aria-label":s||o,"data-testid":p?`toolbar-${p}`:void 0,children:r});return o?jsx(oe,{content:o,children:a}):a}function ie({label:e,children:t,className:o}){return jsx("div",{className:L("flex items-center gap-px px-1.5 border-r border-slate-200/50 last:border-r-0 first:pl-0",o),role:"group","aria-label":e,children:t})}function vc(){return jsx("div",{className:"w-px h-6 bg-slate-200 mx-1.5",role:"separator"})}function xc({children:e,className:t,style:o,disabled:n=false,onFormat:r,onPrint:l,showPrintButton:s=true,onPageSetup:p,onInsertImage:m,onInsertTable:a,showTableInsert:c=true,onInsertPageBreak:u,onInsertTOC:d,onRefocusEditor:h,...b$1}){let{t:f}=b(),x=useRef(null),v=useCallback(I=>{!n&&r&&r(I);},[n,r]),y=useCallback((I,P)=>{!n&&a&&(a(I,P),requestAnimationFrame(()=>h?.()));},[n,a,h]),S=useCallback(I=>{let P=I.target;P.tagName==="INPUT"||P.tagName==="TEXTAREA"||P.tagName==="SELECT"||P.tagName==="OPTION"||I.preventDefault();},[]),w=useCallback(I=>{let P=I.target,W=document.activeElement;P.tagName==="SELECT"||P.tagName==="OPTION"||W?.tagName==="SELECT"||requestAnimationFrame(()=>{h?.();});},[h]);return jsxs("div",{ref:x,className:L("flex items-center px-1 py-1 bg-white border-b border-slate-100 min-h-[36px] overflow-x-auto",t),style:o,role:"toolbar","aria-label":f("toolbar.ariaLabel"),"data-testid":"toolbar",onMouseDown:S,onMouseUp:w,children:[s&&l||p?jsx(vt,{label:f("toolbar.file"),disabled:n,items:[...s&&l?[{icon:"print",label:f("toolbar.print"),shortcut:f("toolbar.printShortcut"),onClick:l}]:[],...p?[{icon:"settings",label:f("toolbar.pageSetup"),onClick:p}]:[]]}):null,jsx(vt,{label:f("toolbar.format"),disabled:n,items:[{icon:"format_textdirection_l_to_r",label:f("toolbar.leftToRight"),onClick:()=>v("setLtr")},{icon:"format_textdirection_r_to_l",label:f("toolbar.rightToLeft"),onClick:()=>v("setRtl")}]}),jsx(vt,{label:f("toolbar.insert"),disabled:n,items:[...m?[{icon:"image",label:f("toolbar.image"),onClick:m}]:[],...c&&a?[{icon:"grid_on",label:f("toolbar.table"),submenuContent:I=>jsx(en,{onInsert:(P,W)=>{y(P,W),I();}})}]:[],...m||c&&a?[{type:"separator"}]:[],{icon:"page_break",label:f("toolbar.pageBreak"),onClick:u,disabled:!u},{icon:"format_list_numbered",label:f("toolbar.tableOfContents"),onClick:d,disabled:!d}]}),jsx(tn,{...b$1,disabled:n,onFormat:r,onRefocusEditor:h,onInsertTable:a,showTableInsert:c,onInsertImage:m,onInsertPageBreak:u,onInsertTOC:d,onPrint:l,showPrintButton:s,onPageSetup:p,inline:true,children:e})]})}var zt=createContext(null);function Sc(){let e=useContext(zt);if(!e)throw new Error("useEditorToolbar must be used within an <EditorToolbar> component");return e}var le=18;function Ai(e){let t=ee__default.useContext(zt);return t?{...t,...Ei(e)}:e}function Ei(e){let t={};for(let o of Object.keys(e))e[o]!==void 0&&(t[o]=e[o]);return t}function tn(e){let{t}=b(),o=Ai(e),{currentFormatting:n={},onFormat:r,onUndo:l,onRedo:s,canUndo:p=false,canRedo:m=false,disabled:a$1=false,className:c,style:u,enableShortcuts:d=true,editorRef:h,children:b$1,showFontPicker:f=true,showFontSizePicker:x=true,showTextColorPicker:v=true,showHighlightColorPicker:y=true,showAlignmentButtons:S=true,showListButtons:w=true,showLineSpacingPicker:I=true,showStylePicker:P=true,documentStyles:W,theme:O,showZoomControl:we=true,zoom:ce,onZoomChange:be,onRefocusEditor:H,imageContext:X,onImageWrapType:M,onImageTransform:F,onOpenImageProperties:Z,tableContext:J,onTableAction:Re,inline:ue=false}=o,ot=useRef(null),z=useCallback(E=>{!a$1&&r&&r(E);},[a$1,r]),Pt=useCallback(()=>{!a$1&&p&&l&&l();},[a$1,p,l]),kt=useCallback(()=>{!a$1&&m&&s&&s();},[a$1,m,s]),Rt=useCallback(E=>{!a$1&&r&&(r({type:"fontFamily",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),Zt=useCallback(E=>{!a$1&&r&&(r({type:"fontSize",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),Ze=useCallback(E=>{!a$1&&r&&(r({type:"textColor",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),Ue=useCallback(E=>{!a$1&&r&&(r({type:"highlightColor",value:typeof E=="string"?E:""}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),de=useCallback(E=>{!a$1&&r&&r({type:"alignment",value:E});},[a$1,r]),Lt=useCallback(()=>{!a$1&&r&&r("bulletList");},[a$1,r]),D=useCallback(()=>{!a$1&&r&&r("numberedList");},[a$1,r]),Le=useCallback(()=>{!a$1&&r&&r("indent");},[a$1,r]),nt=useCallback(()=>{!a$1&&r&&r("outdent");},[a$1,r]),He=useCallback(E=>{!a$1&&r&&(r({type:"lineSpacing",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),pe=useCallback(E=>{!a$1&&r&&(r({type:"applyStyle",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),V=useCallback(E=>{!a$1&&Re&&(Re(E),requestAnimationFrame(()=>H?.()));},[a$1,Re,H]);useEffect(()=>{if(!d)return;let E=_=>{let Ye=_.target,Qt=h?.current,hn=ot.current,fn=Qt?.contains(Ye),gn=hn?.contains(Ye);if(!fn&&!gn)return;if((_.ctrlKey||_.metaKey)&&!_.altKey)switch(_.key.toLowerCase()){case "b":_.preventDefault(),z("bold");break;case "i":_.preventDefault(),z("italic");break;case "u":_.preventDefault(),z("underline");break;case "=":_.shiftKey?(_.preventDefault(),z("superscript")):(_.preventDefault(),z("subscript"));break;case "l":_.preventDefault(),de("left");break;case "e":_.preventDefault(),de("center");break;case "r":_.preventDefault(),de("right");break;case "j":_.preventDefault(),de("both");break;case "k":_.preventDefault(),z("insertLink");break}};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E);}},[d,z,de,h]);let re=useCallback(E=>{let _=E.target;_.tagName==="INPUT"||_.tagName==="TEXTAREA"||_.tagName==="SELECT"||_.tagName==="OPTION"||E.preventDefault();},[]),Ae=useCallback(E=>{let _=E.target,Ye=document.activeElement;_.tagName==="SELECT"||_.tagName==="OPTION"||Ye?.tagName==="SELECT"||requestAnimationFrame(()=>{H?.();});},[H]);return jsxs("div",{ref:ot,className:L(!ue&&"flex items-center px-2 py-1 bg-[#f1f5f9] rounded-full min-h-[36px] overflow-x-auto mx-2 mb-1",c),style:ue?{display:"contents",...u}:u,role:ue?void 0:"toolbar","aria-label":ue?void 0:t("toolbar.ariaLabel"),"data-testid":ue?void 0:"formatting-bar",onMouseDown:ue?void 0:re,onMouseUp:ue?void 0:Ae,children:[jsxs(ie,{label:t("formattingBar.groups.history"),children:[jsx(ne,{onClick:Pt,disabled:a$1||!p,title:t("formattingBar.undoShortcut"),ariaLabel:t("formattingBar.undo"),children:jsx(T,{name:"undo",size:le})}),jsx(ne,{onClick:kt,disabled:a$1||!m,title:t("formattingBar.redoShortcut"),ariaLabel:t("formattingBar.redo"),children:jsx(T,{name:"redo",size:le})})]}),we&&jsx(ie,{label:t("formattingBar.groups.zoom"),children:jsx(Ho,{value:ce,onChange:be,minZoom:.5,maxZoom:2,disabled:a$1,compact:true,showButtons:false})}),P&&jsx(ie,{label:t("formattingBar.groups.styles"),children:jsx(Lo,{value:n.styleId||"Normal",onChange:pe,styles:W,theme:O,disabled:a$1,width:120})}),(f||x)&&jsxs(ie,{label:t("formattingBar.groups.font"),children:[f&&jsx(ro,{value:n.fontFamily||"Arial",onChange:Rt,disabled:a$1,width:60,placeholder:"Arial"}),x&&jsx(fo,{value:n.fontSize!==void 0?ho(n.fontSize):11,onChange:Zt,disabled:a$1,width:42,placeholder:"11"})]}),jsxs(ie,{label:t("formattingBar.groups.textFormatting"),children:[jsx(ne,{onClick:()=>z("bold"),active:n.bold,disabled:a$1,title:t("formattingBar.boldShortcut"),ariaLabel:t("formattingBar.bold"),children:jsx(T,{name:"format_bold",size:le})}),jsx(ne,{onClick:()=>z("italic"),active:n.italic,disabled:a$1,title:t("formattingBar.italicShortcut"),ariaLabel:t("formattingBar.italic"),children:jsx(T,{name:"format_italic",size:le})}),jsx(ne,{onClick:()=>z("underline"),active:n.underline,disabled:a$1,title:t("formattingBar.underlineShortcut"),ariaLabel:t("formattingBar.underline"),children:jsx(T,{name:"format_underlined",size:le})}),jsx(ne,{onClick:()=>z("strikethrough"),active:n.strike,disabled:a$1,title:t("formattingBar.strikethrough"),ariaLabel:t("formattingBar.strikethrough"),children:jsx(T,{name:"strikethrough_s",size:le})}),v&&jsx(qe,{mode:"text",value:n.color?.replace(/^#/,""),onChange:Ze,theme:O,disabled:a$1,title:t("formattingBar.fontColor")}),y&&jsx(qe,{mode:"highlight",value:n.highlight,onChange:Ue,theme:O,disabled:a$1,title:t("formattingBar.highlightColor")}),jsx(ne,{onClick:()=>z("insertLink"),disabled:a$1,title:t("formattingBar.insertLinkShortcut"),ariaLabel:t("formattingBar.insertLink"),children:jsx(T,{name:"link",size:le})})]}),jsxs(ie,{label:t("formattingBar.groups.script"),children:[jsx(ne,{onClick:()=>z("superscript"),active:n.superscript,disabled:a$1,title:t("formattingBar.superscriptShortcut"),ariaLabel:t("formattingBar.superscript"),children:jsx(T,{name:"superscript",size:le})}),jsx(ne,{onClick:()=>z("subscript"),active:n.subscript,disabled:a$1,title:t("formattingBar.subscriptShortcut"),ariaLabel:t("formattingBar.subscript"),children:jsx(T,{name:"subscript",size:le})})]}),S&&jsx(ie,{label:t("formattingBar.groups.alignment"),children:jsx(wo,{value:n.alignment||"left",onChange:de,disabled:a$1})}),(w||I)&&jsxs(ie,{label:t("formattingBar.groups.listFormatting"),children:[w&&jsx(Mo,{listState:n.listState||Po(),onBulletList:Lt,onNumberedList:D,onIndent:Le,onOutdent:nt,disabled:a$1,showIndentButtons:true,compact:true,hasIndent:(n.indentLeft??0)>0}),I&&jsx(Ro,{value:n.lineSpacing,onChange:He,disabled:a$1})]}),X&&M&&jsxs(ie,{label:t("formattingBar.groups.image"),children:[jsx($o,{imageContext:X,onChange:M,disabled:a$1}),F&&jsx(Go,{onTransform:F,disabled:a$1}),Z&&jsx(ne,{onClick:Z,disabled:a$1,title:t("formattingBar.imagePropertiesShortcut"),ariaLabel:t("formattingBar.imageProperties"),children:jsx(T,{name:"tune",size:le})})]}),J?.isInTable&&Re&&jsxs(ie,{label:t("formattingBar.groups.table"),children:[jsx(qo,{onAction:V,disabled:a$1}),jsx(_o,{onAction:V,disabled:a$1,theme:O,value:J?.cellBorderColor?a(J.cellBorderColor,O).replace(/^#/,""):void 0}),jsx(No,{onAction:V,disabled:a$1}),jsx(Fo,{onAction:V,disabled:a$1,theme:O,value:J?.cellBackgroundColor}),jsx(Ko,{onAction:V,disabled:a$1,tableContext:J})]}),jsx(ne,{onClick:()=>z("clearFormatting"),disabled:a$1,title:t("formattingBar.clearFormatting"),ariaLabel:t("formattingBar.clearFormatting"),children:jsx(T,{name:"format_clear",size:le})}),b$1]})}var nn=12240,Tt=1440,Ct=1440,St=567,Wt=22,Di="var(--doc-text-muted)",Ni="var(--doc-text-subtle)",on="rgba(0, 0, 0, 0.02)",Fi="#4285f4",Bi="#3367d6",Oi="#2a56c6",Ne=5;function zi(e,t){return t==="inch"?(e/Ct).toFixed(2)+'"':(e/St).toFixed(1)+" cm"}function Qc({sectionProps:e,zoom:t=1,editable:o=false,onLeftMarginChange:n,onRightMarginChange:r,onFirstLineIndentChange:l,showFirstLineIndent:s=false,firstLineIndent:p=0,hangingIndent:m=false,indentLeft:a=0,indentRight:c=0,onIndentLeftChange:u,onIndentRightChange:d,unit:h="inch",className:b$2="",style:f,tabStops:x,onTabStopRemove:v}){let{t:y}=b(),[S,w]=useState(null),[I,P]=useState(null),[W,O]=useState(null),[we,ce]=useState(null),be=useRef(null),H=e?.pageWidth??nn,X=e?.marginLeft??Tt,M=e?.marginRight??Tt,F=H-X-M,Z=a$1(H)*t,J=a$1(X)*t,Re=a$1(M)*t,ue=a$1(a)*t,ot=a$1(c)*t,z=m?-p:p,Pt=a$1(z)*t,kt=J+ue,Rt=Z-Re-ot,Zt=J+ue+Pt,Ze=useCallback((D,Le)=>{o&&(D.preventDefault(),D.stopPropagation(),w(Le));},[o]),Ue=useCallback(D=>{if(!S||!be.current)return;let Le=be.current.getBoundingClientRect(),nt=D.clientX-Le.left;ce(nt);let He=b$1(nt/t);if(S==="leftMargin"){let pe=H-M-720,V=Math.round(Math.max(0,Math.min(He,pe)));O(V),n?.(V);}else if(S==="rightMargin"){let pe=H-He,V=H-X-720,re=Math.round(Math.max(0,Math.min(pe,V)));O(re),r?.(re);}else if(S==="firstLineIndent"){let pe=X+a,V=He-pe,re=F-a-c-720,Ae=Math.round(Math.max(-a,Math.min(V,re)));O(Ae),l?.(Ae);}else if(S==="leftIndent"){let pe=He-X,V=F-c-720,re=Math.round(Math.max(0,Math.min(pe,V)));O(re),u?.(re);}else if(S==="rightIndent"){let V=H-M-He,re=F-a-720,Ae=Math.round(Math.max(0,Math.min(V,re)));O(Ae),d?.(Ae);}},[S,t,H,X,M,F,a,c,n,r,l,u,d]),de=useCallback(()=>{w(null),O(null),ce(null);},[]);useEffect(()=>{if(S)return document.addEventListener("mousemove",Ue),document.addEventListener("mouseup",de),()=>{document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",de);}},[S,Ue,de]);let Lt=Gi(H,t,h);return jsxs("div",{ref:be,className:`docx-horizontal-ruler ${b$2}`,style:{position:"relative",width:k(Z),height:Wt,backgroundColor:"transparent",overflow:"visible",userSelect:"none",cursor:S?"ew-resize":"default",...f},role:"slider","aria-label":y("ruler.horizontal"),"aria-valuemin":0,"aria-valuemax":H,children:[jsx("div",{style:{position:"absolute",top:0,left:0,width:k(J),height:Wt,backgroundColor:on,borderRight:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&n?D=>Ze(D,"leftMargin"):void 0}),jsx("div",{style:{position:"absolute",top:0,right:0,width:k(Re),height:Wt,backgroundColor:on,borderLeft:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&r?D=>Ze(D,"rightMargin"):void 0}),jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:Lt.map((D,Le)=>jsx(Ki,{tick:D},Le))}),s&&jsx(Vt,{direction:"down",positionPx:Zt,editable:o,isDragging:S==="firstLineIndent",isHovered:I==="firstLineIndent",onMouseEnter:()=>P("firstLineIndent"),onMouseLeave:()=>P(null),onMouseDown:D=>Ze(D,"firstLineIndent"),label:y("ruler.firstLineIndent")}),o&&u&&jsx(Vt,{direction:"up",positionPx:kt,editable:o,isDragging:S==="leftIndent",isHovered:I==="leftIndent",onMouseEnter:()=>P("leftIndent"),onMouseLeave:()=>P(null),onMouseDown:D=>Ze(D,"leftIndent"),label:y("ruler.leftIndent")}),o&&d&&jsx(Vt,{direction:"down",positionPx:Rt,editable:o,isDragging:S==="rightIndent",isHovered:I==="rightIndent",onMouseEnter:()=>P("rightIndent"),onMouseLeave:()=>P(null),onMouseDown:D=>Ze(D,"rightIndent"),label:y("ruler.rightIndent")}),x?.map(D=>jsx($i,{tabStop:D,positionPx:a$1(D.position)*t,onDoubleClick:()=>v?.(D.position)},D.position)),S&&W!==null&&we!==null&&jsx(Wi,{value:zi(W,h),positionPx:we})]})}function Ki({tick:e}){return jsxs(Fragment,{children:[jsx("div",{style:{position:"absolute",left:k(e.position),bottom:0,width:1,height:e.height,backgroundColor:Ni}}),e.label&&jsx("div",{style:{position:"absolute",left:k(e.position),top:3,transform:"translateX(-50%)",fontSize:"9px",color:Di,fontFamily:"sans-serif",whiteSpace:"nowrap"},children:e.label})]})}function Vt({direction:e,positionPx:t,editable:o,isDragging:n,isHovered:r,onMouseEnter:l,onMouseLeave:s,onMouseDown:p,label:m}){let a=n?Oi:r?Bi:Fi,c=Math.round(Ne*1.6),u={position:"absolute",left:k(t-Ne),width:Ne*2,height:c+2,cursor:o?"ew-resize":"default",zIndex:n?10:4,...e==="down"?{top:0}:{bottom:0}},d=e==="down"?{position:"absolute",top:1,left:0,width:0,height:0,borderLeft:`${Ne}px solid transparent`,borderRight:`${Ne}px solid transparent`,borderTop:`${c}px solid ${a}`,transition:"border-top-color 0.1s"}:{position:"absolute",bottom:1,left:0,width:0,height:0,borderLeft:`${Ne}px solid transparent`,borderRight:`${Ne}px solid transparent`,borderBottom:`${c}px solid ${a}`,transition:"border-bottom-color 0.1s"};return jsx("div",{className:"docx-ruler-indent",style:u,onMouseEnter:l,onMouseLeave:s,onMouseDown:p,role:"slider","aria-label":m,"aria-orientation":"horizontal",tabIndex:o?0:-1,children:jsx("div",{style:d})})}function Wi({value:e,positionPx:t}){return jsx("div",{style:{position:"absolute",left:k(t),top:-22,transform:"translateX(-50%)",backgroundColor:"#333",color:"#fff",fontSize:"10px",fontFamily:"sans-serif",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap",pointerEvents:"none",zIndex:20},children:e})}var Vi={left:"L",center:"C",right:"R",decimal:"D",bar:"|"};function $i({tabStop:e,positionPx:t,onDoubleClick:o}){return jsx("div",{style:{position:"absolute",left:k(t-5),bottom:0,width:10,height:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:8,fontWeight:700,color:"#555",cursor:"pointer",userSelect:"none"},onDoubleClick:n=>{n.stopPropagation(),o();},title:`${e.alignment} tab at ${(e.position/1440).toFixed(2)}"`,children:Vi[e.alignment]||"L"})}function Gi(e,t,o){let n=[];if(o==="inch"){let r=Ct/8,l=Math.ceil(e/r);for(let s=0;s<=l;s++){let p=s*r;if(p>e)break;let m=a$1(p)*t;s%8===0?n.push({position:m,height:10,label:s/8>0?String(s/8):void 0}):s%4===0?n.push({position:m,height:6}):s%2===0?n.push({position:m,height:4}):n.push({position:m,height:2});}}else {let r=St/10,l=Math.ceil(e/r);for(let s=0;s<=l;s++){let p=s*r;if(p>e)break;let m=a$1(p)*t;s%10===0?n.push({position:m,height:10,label:s/10>0?String(s/10):void 0}):s%5===0?n.push({position:m,height:6}):n.push({position:m,height:3});}}return n}function eu(e,t,o,n){let r=b$1(e/n);return t==="left"?Math.max(0,r):Math.max(0,b$1(o/n)-r)}function tu(e,t=1){let o=e?.pageWidth??nn,n=e?.marginLeft??Tt,r=e?.marginRight??Tt,l=a$1(o)*t,s=a$1(n)*t,p=a$1(r)*t;return {width:l,leftMargin:s,rightMargin:p,contentWidth:l-s-p}}function ou(e,t){return t==="inch"?(e/Ct).toFixed(2)+'"':(e/St).toFixed(1)+" cm"}function nu(e,t){let o=parseFloat(e.replace(/[^\d.]/g,""));return isNaN(o)?null:Math.round(o*(t==="inch"?Ct:St))}var iu="application/x-docx-editor",j={HTML:"text/html",PLAIN:"text/plain"};function lu(e){if(!e)return [];let t=()=>{if(!e.items||e.items.length===0)return [];let a=[];for(let c of Array.from(e.items)){if(c.kind!=="file"||!c.type.startsWith("image/"))continue;let u=c.getAsFile();u&&a.push(u);}return a},o=()=>!e.files||e.files.length===0?[]:Array.from(e.files).filter(a=>a.type.startsWith("image/")),n=t(),r=n.length?n:o();if(r.length<=1)return r;let l=["image/png","image/jpeg","image/webp","image/gif","image/svg+xml","image/bmp","image/tiff"],s=a=>{let c=a[0],u=l.indexOf(c.type);u<0&&(u=Number.MAX_SAFE_INTEGER);for(let d of a.slice(1)){let h=l.indexOf(d.type);if(h<0&&(h=Number.MAX_SAFE_INTEGER),h<u){c=d,u=h;continue}h===u&&d.size>c.size&&(c=d);}return c},p=new Map;for(let a of r){let c=a.name?.trim()??"",d=(c?c.replace(/\.[^/.]+$/,"").toLowerCase():"")||`size:${a.size}`,h=p.get(d);h?h.push(a):p.set(d,[a]);}let m=[];for(let a of p.values())m.push(s(a));return m}async function an(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=$t(e,o);return await wt(r)}catch(r){return n?.(r),false}}async function su(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=Yi(e,o);return await wt(r)}catch(r){return n?.(r),false}}function $t(e,t=true){let o=e.map(Yt).join(""),n=t?dn(e):jt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}function Yi(e,t=true){let o=e.map(nl).join(`
|
|
2
|
-
`),n=t?rl(e):jt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}async function wt(e){try{if(navigator.clipboard&&navigator.clipboard.write){let t=[new ClipboardItem({[j.PLAIN]:new Blob([e.plainText],{type:j.PLAIN}),[j.HTML]:new Blob([e.html],{type:j.HTML})})];return await navigator.clipboard.write(t),!0}return ln(e)}catch{return ln(e)}}function ln(e){let t=document.createElement("div");t.innerHTML=e.html,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t);try{let o=window.getSelection();if(!o)return !1;let n=document.createRange();n.selectNodeContents(t),o.removeAllRanges(),o.addRange(n);let r=document.execCommand("copy");return o.removeAllRanges(),r}finally{document.body.removeChild(t);}}async function cu(e={}){let{cleanWordFormatting:t=true,onError:o}=e;try{if(navigator.clipboard&&navigator.clipboard.read){let n=await navigator.clipboard.read();return await ji(n,t)}return null}catch(n){return o?.(n),null}}async function ji(e,t){let o="",n="";for(let r of e)r.types.includes(j.HTML)&&(o=await(await r.getType(j.HTML)).text()),r.types.includes(j.PLAIN)&&(n=await(await r.getType(j.PLAIN)).text());return un(o,n,t)}function Xi(e,t={}){let{cleanWordFormatting:o=true}=t,n=e.clipboardData;if(!n)return null;let r=n.getData(j.HTML),l=n.getData(j.PLAIN);return un(r,l,o)}function un(e,t,o=true){let n=Ji(e),r=Qi(e);if(r){let p=e.match(/data-docx-editor-content="([^"]+)"/);if(p)try{return {runs:JSON.parse(decodeURIComponent(p[1])),fromWord:!1,fromEditor:!0,plainText:t}}catch{}}let l=e;return n&&o&&(l=el(e)),{runs:tl(l,t),fromWord:n,fromEditor:r,plainText:t}}function Ji(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("MsoNormal")||e.includes('class="Mso')||e.includes("<!--[if gte mso")}function Qi(e){return e.includes("data-docx-editor")||e.includes("docx-run")||e.includes("docx-paragraph")}function el(e){let t=e;return t=t.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,""),t=t.replace(/<!--[\s\S]*?-->/g,""),t=t.replace(/<\?xml[^>]*>/gi,""),t=t.replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,""),t=t.replace(/<o:[^>]*\/>/gi,""),t=t.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,""),t=t.replace(/<w:[^>]*\/>/gi,""),t=t.replace(/\s*mso-[^:;]+:[^;]+;?/gi,""),t=t.replace(/\s*style="\s*"/gi,""),t=t.replace(/\s*class="[^"]*Mso[^"]*"/gi,""),t=t.replace(/<span[^>]*>\s*<\/span>/gi,""),t=t.replace(/<\/?font[^>]*>/gi,""),t=t.replace(/\s+/g," ").trim(),t}function tl(e,t){if(!e||e.trim()==="")return t?[Ut(t)]:[];let o=document.createElement("div");o.innerHTML=e;let n=[];return Gt(o,n,{}),n.length===0&&t?[Ut(t)]:n}function Gt(e,t,o){if(e.nodeType===Node.TEXT_NODE){let s=e.textContent||"";(s.trim()||s.includes(" "))&&t.push(Ut(s,o));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e,r=n.tagName.toLowerCase(),l={...o,...ol(n)};switch(r){case "br":t.push(cn(l));return;case "p":case "div":for(let s of n.childNodes)Gt(s,t,l);n.nextSibling&&t.push(cn(l));return;case "b":case "strong":l.bold=true;break;case "i":case "em":l.italic=true;break;case "u":l.underline={style:"single"};break;case "s":case "strike":case "del":l.strike=true;break;case "sup":l.vertAlign="superscript";break;case "sub":l.vertAlign="subscript";break;case "code":case "pre":l.fontFamily={ascii:"Courier New"};break}for(let s of n.childNodes)Gt(s,t,l);}function ol(e){let t={},o=e.style;(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(t.bold=true),o.fontStyle==="italic"&&(t.italic=true);let n=o.textDecoration||o.textDecorationLine;if(n&&(n.includes("underline")&&(t.underline={style:"single"}),n.includes("line-through")&&(t.strike=true)),o.fontSize){let r=parseFloat(o.fontSize);isNaN(r)||(t.fontSize=Math.round(r/1.333*2));}if(o.fontFamily){let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(t.fontFamily={ascii:r});}if(o.color){let r=sn(o.color);r&&(t.color={rgb:r});}if(o.backgroundColor&&o.backgroundColor!=="transparent"){let r=sn(o.backgroundColor);r&&(t.shading={fill:{rgb:r}});}return t}function sn(e){if(!e||e==="transparent"||e==="inherit")return null;if(e.startsWith("#"))return e.slice(1).toUpperCase();let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t){let o=parseInt(t[1]).toString(16).padStart(2,"0"),n=parseInt(t[2]).toString(16).padStart(2,"0"),r=parseInt(t[3]).toString(16).padStart(2,"0");return (o+n+r).toUpperCase()}return null}function Yt(e){return e.content.map(t=>t.type==="text"?t.text:t.type==="tab"?" ":t.type==="break"&&t.breakType==="textWrapping"?`
|
|
3
|
-
`:"").join("")}function nl(e){return (e.content||[]).map(t=>t.type==="run"?Yt(t):"").join("")}function dn(e){return e.map(al).join("")}function rl(e){return e.map(t=>`<p>${dn(t.content?.filter(o=>o.type==="run")||[])}</p>`).join("")}function al(e){let t=Yt(e);if(!t)return "";let o=jt(t),n=e.formatting;if(!n)return o;n.bold&&(o=`<strong>${o}</strong>`),n.italic&&(o=`<em>${o}</em>`),n.underline&&(o=`<u>${o}</u>`),n.strike&&(o=`<s>${o}</s>`),n.vertAlign==="superscript"&&(o=`<sup>${o}</sup>`),n.vertAlign==="subscript"&&(o=`<sub>${o}</sub>`);let r=[];if(n.fontSize){let l=n.fontSize/2;r.push(`font-size: ${l}pt`);}return n.fontFamily?.ascii&&r.push(`font-family: "${n.fontFamily.ascii}"`),n.color?.rgb&&r.push(`color: #${n.color.rgb}`),n.shading?.fill?.rgb&&r.push(`background-color: #${n.shading.fill.rgb}`),r.length>0&&(o=`<span style="${r.join("; ")}">${o}</span>`),o}function jt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ut(e,t){return {type:"run",formatting:t,content:[{type:"text",text:e}]}}function cn(e){return {type:"run",formatting:e,content:[{type:"break",breakType:"textWrapping"}]}}function uu(e){let{onCopy:t,onCut:o,onPaste:n,clipboardOptions:r={}}=e;return {handleCopy:async a=>{if(!t)return;let c=t();if(!c)return;a.preventDefault();let u=$t(c.runs);a.clipboardData?(a.clipboardData.setData(j.PLAIN,u.plainText),a.clipboardData.setData(j.HTML,u.html)):await wt(u);},handleCut:async a=>{if(!o)return;let c=o();if(!c)return;a.preventDefault();let u=$t(c.runs);a.clipboardData?(a.clipboardData.setData(j.PLAIN,u.plainText),a.clipboardData.setData(j.HTML,u.html)):await wt(u);},handlePaste:a=>{if(!n)return;a.preventDefault();let c=Xi(a,r);c&&n(c);},handleKeyDown:async a=>{let c=a.ctrlKey||a.metaKey;if(c&&a.key==="c"&&!a.shiftKey&&t){let u=t();u&&await an(u.runs,r);}if(c&&a.key==="x"&&!a.shiftKey&&o){let u=o();u&&await an(u.runs,r);}}}}var pn=[{action:"cut",labelKey:"contextMenu.cut",shortcutKey:"contextMenu.cutShortcut"},{action:"copy",labelKey:"contextMenu.copy",shortcutKey:"contextMenu.copyShortcut"},{action:"paste",labelKey:"contextMenu.paste",shortcutKey:"contextMenu.pasteShortcut"},{action:"pasteAsPlainText",labelKey:"contextMenu.pastePlainText",shortcutKey:"contextMenu.pastePlainTextShortcut",dividerAfter:true},{action:"delete",labelKey:"contextMenu.delete",shortcutKey:"contextMenu.deleteShortcut",dividerAfter:true},{action:"selectAll",labelKey:"contextMenu.selectAll",shortcutKey:"contextMenu.selectAllShortcut"}],sl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"4",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsx("circle",{cx:"12",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M5.5 10.5L10.5 3M10.5 10.5L5.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),cl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"5",y:"5",width:"8",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M11 5V3a1 1 0 00-1-1H4a1 1 0 00-1 1v8a1 1 0 001 1h2",stroke:"currentColor",strokeWidth:"1.5"})]}),ul=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"3",y:"3",width:"10",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 3V2a1 1 0 011-1h2a1 1 0 011 1v1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 8h4M6 11h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),dl=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),pl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2 2"}),jsx("rect",{x:"4",y:"4",width:"8",height:"8",fill:"currentColor",opacity:"0.3"})]}),ml=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"10",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 1v3M6.5 2.5h3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),hl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 12v3M6.5 13.5h3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),fl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.3"}),jsx("rect",{x:"2",y:"10",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M5 8h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),gl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"10",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M3 8H0.5M1.75 6.5v3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),bl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M13 8h2.5M14.25 6.5v3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),vl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.3"}),jsx("rect",{x:"10",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),xl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M3 3h10a1 1 0 011 1v6a1 1 0 01-1 1H6l-3 2.5V11H3a1 1 0 01-1-1V4a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.3"}),jsx("path",{d:"M5 6h6M5 8.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});function yl(e){switch(e){case "cut":return jsx(sl,{});case "copy":return jsx(cl,{});case "paste":case "pasteAsPlainText":return jsx(ul,{});case "delete":return jsx(dl,{});case "selectAll":return jsx(pl,{});case "addRowAbove":return jsx(ml,{});case "addRowBelow":return jsx(hl,{});case "deleteRow":return jsx(fl,{});case "addColumnLeft":return jsx(gl,{});case "addColumnRight":return jsx(bl,{});case "deleteColumn":return jsx(vl,{});case "addComment":return jsx(xl,{});default:return null}}var Tl=({item:e,onClick:t,isHighlighted:o,onMouseEnter:n})=>e.action==="separator"?jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}}):jsxs(Fragment,{children:[jsxs("button",{type:"button",className:`docx-text-context-menu-item ${o?"docx-text-context-menu-item-highlighted":""} ${e.disabled?"docx-text-context-menu-item-disabled":""}`,onClick:t,onMouseEnter:n,disabled:e.disabled,role:"menuitem","aria-disabled":e.disabled,style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"8px 12px",border:"none",background:o&&!e.disabled?"var(--doc-primary-light)":"transparent",cursor:e.disabled?"not-allowed":"pointer",fontSize:"13px",color:e.disabled?"var(--doc-text-subtle)":"var(--doc-text)",textAlign:"left",opacity:e.disabled?.6:1},children:[jsx("span",{style:{display:"flex",color:e.disabled?"var(--doc-border)":"var(--doc-text-muted)"},children:yl(e.action)}),jsx("span",{style:{flex:1},children:e.label}),e.shortcut&&jsx("span",{style:{fontSize:"11px",color:"var(--doc-text-subtle)",fontFamily:"monospace"},children:e.shortcut})]}),e.dividerAfter&&jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}})]}),fu=({isOpen:e,position:t,hasSelection:o,isEditable:n,hasClipboardContent:r=true,onAction:l,onClose:s,items:p,className:m=""})=>{let a=useRef(null),[c,u]=useState(0),{t:d}=b(),h=useMemo(()=>pn.map(y=>({action:y.action,label:d(y.labelKey),shortcut:y.shortcutKey?d(y.shortcutKey):void 0,dividerAfter:y.dividerAfter})),[d]),b$1=(p||h).map(y=>{let S=(()=>{if(y.disabled!==void 0)return y.disabled;switch(y.action){case "cut":case "copy":case "delete":return !o;case "paste":case "pasteAsPlainText":return !n||!r;default:return false}})();return {...y,disabled:S}}),f=b$1.filter(y=>y.action!=="separator");useEffect(()=>{if(!e)return;let y=w=>{a.current&&!a.current.contains(w.target)&&s();},S=setTimeout(()=>{document.addEventListener("mousedown",y);},0);return ()=>{clearTimeout(S),document.removeEventListener("mousedown",y);}},[e,s]),useEffect(()=>{if(!e)return;let y=S=>{switch(S.key){case "Escape":S.preventDefault(),s();break;case "ArrowDown":S.preventDefault(),u(I=>{let P=(I+1)%f.length;for(;f[P]?.disabled&&P!==I;)P=(P+1)%f.length;return P});break;case "ArrowUp":S.preventDefault(),u(I=>{let P=(I-1+f.length)%f.length;for(;f[P]?.disabled&&P!==I;)P=(P-1+f.length)%f.length;return P});break;case "Enter":S.preventDefault();let w=f[c];w&&!w.disabled&&(l(w.action),s());break}};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,c,f,l,s]),useEffect(()=>{e&&u(0);},[e]);let x=useCallback(()=>{let S=b$1.length*36+16,w=t.x,I=t.y;return typeof window<"u"&&(w+220>window.innerWidth&&(w=window.innerWidth-220-10),I+S>window.innerHeight&&(I=window.innerHeight-S-10),w<10&&(w=10),I<10&&(I=10)),{position:"fixed",top:I,left:w,minWidth:220,background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",zIndex:1e4,padding:"4px 0",overflow:"hidden"}},[t,b$1.length]),v=y=>{y.disabled||(l(y.action),s());};return e?jsx("div",{ref:a,className:`docx-text-context-menu ${m}`,style:x(),role:"menu","aria-label":d("contextMenu.textMenuAriaLabel"),children:b$1.map((y,S)=>{let w=f.findIndex(I=>I===y);return jsx(Tl,{item:y,onClick:()=>v(y),isHighlighted:w===c,onMouseEnter:()=>{w>=0&&!y.disabled&&u(w);}},`${y.action}-${S}`)})}):null};function gu(e={}){let{enabled:t=true,isEditable:o=true,containerRef:n,onAction:r}=e,[l,s]=useState(false),[p,m]=useState({x:0,y:0}),[a,c]=useState(false),u=useCallback(()=>{let x=window.getSelection(),v=x&&!x.isCollapsed&&x.toString().length>0;return c(!!v),!!v},[]),d=useCallback(x=>{t&&(x.preventDefault(),x.stopPropagation(),u(),m({x:x.clientX,y:x.clientY}),s(true));},[t,u]),h=useCallback(()=>{s(false);},[]),b=useCallback(x=>{switch(h(),x){case "cut":document.execCommand("cut");break;case "copy":document.execCommand("copy");break;case "paste":document.execCommand("paste");break;case "pasteAsPlainText":navigator.clipboard.readText?.().then(v=>{document.execCommand("insertText",false,v);}).catch(()=>{document.execCommand("paste");});break;case "delete":document.execCommand("delete");break;case "selectAll":document.execCommand("selectAll");break}r?.(x);},[h,r]),f=useCallback(x=>{d(x);},[d]);return useEffect(()=>{if(!l)return;let x=v=>{v.key==="Escape"&&h();};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[l,h]),{isOpen:l,position:p,hasSelection:a,openMenu:d,closeMenu:h,handleAction:b,onContextMenu:f}}function bu(e){return {cut:"Cut",copy:"Copy",paste:"Paste",pasteAsPlainText:"Paste as Plain Text",selectAll:"Select All",delete:"Delete",separator:"",addRowAbove:"Insert row above",addRowBelow:"Insert row below",deleteRow:"Delete row",addColumnLeft:"Insert column left",addColumnRight:"Insert column right",deleteColumn:"Delete column",addComment:"Comment"}[e]}function vu(e){return {cut:"Ctrl+X",copy:"Ctrl+C",paste:"Ctrl+V",pasteAsPlainText:"Ctrl+Shift+V",selectAll:"Ctrl+A",delete:"Del",separator:"",addRowAbove:"",addRowBelow:"",deleteRow:"",addColumnLeft:"",addColumnRight:"",deleteColumn:"",addComment:""}[e]}function xu(){return pn.map(e=>({action:e.action,label:e.labelKey,shortcut:e.shortcutKey,dividerAfter:e.dividerAfter}))}function yu(e,t,o){switch(e){case "cut":case "copy":case "delete":return t;case "paste":case "pasteAsPlainText":return o;case "addComment":return t;case "selectAll":return true;default:return true}}var Se=16;function wl(){return jsx(T,{name:"table_rows",size:Se,style:{transform:"scaleY(-1)"}})}function Il(){return jsx(T,{name:"table_rows",size:Se})}function Ml(){return jsx(T,{name:"view_column",size:Se,style:{transform:"scaleX(-1)"}})}function Pl(){return jsx(T,{name:"view_column",size:Se})}function kl(){return jsx(T,{name:"delete_sweep",size:Se})}function Rl(){return jsx(T,{name:"delete_sweep",size:Se,style:{transform:"rotate(90deg)"}})}function Zl(){return jsx(T,{name:"call_merge",size:Se})}function Ll(){return jsx(T,{name:"call_split",size:Se})}function Hl(){return jsx(T,{name:"delete",size:Se,className:"text-red-600"})}var se={container:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",backgroundColor:"var(--doc-bg-subtle)",borderRadius:"4px",border:"1px solid var(--doc-border)",fontSize:"12px"},containerCompact:{padding:"2px 4px",gap:"2px"},containerFloating:{position:"absolute",zIndex:1e3,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},group:{display:"flex",alignItems:"center",gap:"2px"},separator:{width:"1px",height:"20px",backgroundColor:"var(--doc-border-dark)",margin:"0 4px"},button:{display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"4px 8px",border:"none",borderRadius:"3px",backgroundColor:"transparent",color:"var(--doc-text)",cursor:"pointer",fontSize:"12px",lineHeight:"1",transition:"background-color 0.15s, color 0.15s"},buttonCompact:{padding:"3px 5px"},buttonHover:{backgroundColor:"var(--doc-border)"},buttonDisabled:{color:"var(--doc-text-subtle)",cursor:"not-allowed"},buttonDelete:{color:"var(--doc-error)"},label:{fontSize:"11px",fontWeight:500,color:"var(--doc-text-muted)",marginRight:"8px",whiteSpace:"nowrap"}};function Ce({action:e,label:t,icon:o,disabled:n=false,onClick:r,showLabel:l=false,compact:s=false,shortcut:p}){let[m,a]=ee__default.useState(false),c=typeof e=="string"&&e.startsWith("delete"),u={...se.button,...s?se.buttonCompact:{},...m&&!n?se.buttonHover:{},...n?se.buttonDisabled:{},...c&&!n?se.buttonDelete:{}},d=p?`${t} (${p})`:t;return jsxs("button",{type:"button",className:`docx-table-toolbar-button docx-table-toolbar-${typeof e=="string"?e:e.type}`,style:u,disabled:n,onClick:r,onMouseEnter:()=>a(true),onMouseLeave:()=>a(false),title:d,"aria-label":t,children:[o,l&&jsx("span",{children:t})]})}function Xt({children:e,showSeparator:t=true}){return jsxs(Fragment,{children:[jsx("div",{style:se.group,children:e}),t&&jsx("div",{style:se.separator})]})}function Mu({context:e,onAction:t,disabled:o=false,className:n,style:r,showLabels:l=false,compact:s=false,position:p="top",children:m}){let{t:a}=b();if(!e)return null;let c=v=>{!o&&t&&e&&t(v,e);},u=e.rowCount>1,d=e.columnCount>1,h=e.hasMultiCellSelection,b$1=e.canSplitCell,f={...se.container,...s?se.containerCompact:{},...p==="floating"?se.containerFloating:{},...r},x=["docx-table-toolbar"];return n&&x.push(n),s&&x.push("docx-table-toolbar-compact"),p==="floating"&&x.push("docx-table-toolbar-floating"),jsxs("div",{className:x.join(" "),style:f,role:"toolbar","aria-label":a("table.editingTools"),children:[jsx("span",{style:se.label,children:a("table.label")}),jsxs(Xt,{children:[jsx(Ce,{action:"addRowAbove",label:a("table.insertRowAbove"),icon:jsx(wl,{}),disabled:o,onClick:()=>c("addRowAbove"),showLabel:l,compact:s}),jsx(Ce,{action:"addRowBelow",label:a("table.insertRowBelow"),icon:jsx(Il,{}),disabled:o,onClick:()=>c("addRowBelow"),showLabel:l,compact:s}),jsx(Ce,{action:"deleteRow",label:a("table.deleteRow"),icon:jsx(kl,{}),disabled:o||!u,onClick:()=>c("deleteRow"),showLabel:l,compact:s})]}),jsxs(Xt,{children:[jsx(Ce,{action:"addColumnLeft",label:a("table.insertColumnLeft"),icon:jsx(Ml,{}),disabled:o,onClick:()=>c("addColumnLeft"),showLabel:l,compact:s}),jsx(Ce,{action:"addColumnRight",label:a("table.insertColumnRight"),icon:jsx(Pl,{}),disabled:o,onClick:()=>c("addColumnRight"),showLabel:l,compact:s}),jsx(Ce,{action:"deleteColumn",label:a("table.deleteColumn"),icon:jsx(Rl,{}),disabled:o||!d,onClick:()=>c("deleteColumn"),showLabel:l,compact:s})]}),jsxs(Xt,{showSeparator:false,children:[jsx(Ce,{action:"mergeCells",label:a("table.mergeCells"),icon:jsx(Zl,{}),disabled:o||!h,onClick:()=>c("mergeCells"),showLabel:l,compact:s}),jsx(Ce,{action:"splitCell",label:a("table.splitCell"),icon:jsx(Ll,{}),disabled:o||!b$1,onClick:()=>c("splitCell"),showLabel:l,compact:s}),jsx(Ce,{action:"deleteTable",label:a("table.deleteTable"),icon:jsx(Hl,{}),disabled:o,onClick:()=>c("deleteTable"),showLabel:l,compact:s})]}),m]})}function Pu(e,t){let o=e.rows.length,n=Jt(e),r=!!(t.selectedCells&&(t.selectedCells.startRow!==t.selectedCells.endRow||t.selectedCells.startCol!==t.selectedCells.endCol)),l=mn(e,t.rowIndex,t.columnIndex),s=!!(l&&((l.formatting?.gridSpan??1)>1||l.formatting?.vMerge==="restart"));return {table:e,selection:t,hasMultiCellSelection:r,canSplitCell:s,rowCount:o,columnCount:n}}function Jt(e){if(!e.rows.length)return 0;let t=0;for(let o of e.rows){let n=0;for(let r of o.cells)n+=r.formatting?.gridSpan??1;t=Math.max(t,n);}return t}function mn(e,t,o){let n=e.rows[t];if(!n)return null;let r=0;for(let l of n.cells){let s=l.formatting?.gridSpan??1;if(o>=r&&o<r+s)return l;r+=s;}return null}function Al(e,t){let o=[],n=0;for(let r of e.cells){let l=r.formatting?.gridSpan??1;o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...r.formatting,vMerge:void 0}}),n+=l;}for(;n<t;)o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}),n++;return {type:"tableRow",cells:o,formatting:{...e.formatting,header:false}}}function El(){return {type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}}function ku(e,t,o="after"){let n=[...e.rows],r=o==="before"?t:t+1,l=e.rows[t]||e.rows[0],s=Jt(e),p=Al(l,s);return n.splice(r,0,p),{...e,rows:n}}function Ru(e,t){if(e.rows.length<=1)return e;let o=e.rows.filter((n,r)=>r!==t);return {...e,rows:o}}function Zu(e,t,o="after"){let n=o==="before"?t:t+1,r=e.rows.map(s=>{let p=[...s.cells],m=0,a=0;for(let c=0;c<s.cells.length;c++){let d=s.cells[c].formatting?.gridSpan??1;if(n<=m+d){a=o==="before"?c:c+1;break}m+=d,a=c+1;}return p.splice(a,0,El()),{...s,cells:p}}),l=e.columnWidths;if(e.columnWidths&&e.columnWidths.length>0){l=[...e.columnWidths];let s=e.columnWidths[t]||e.columnWidths[0]||1440;l.splice(n,0,s);}return {...e,rows:r,columnWidths:l}}function Lu(e,t){if(Jt(e)<=1)return e;let n=e.rows.map(l=>{let s=0,p=[];for(let m of l.cells){let a=m.formatting?.gridSpan??1;t>=s&&t<s+a?a>1&&p.push({...m,formatting:{...m.formatting,gridSpan:a-1}}):p.push(m),s+=a;}return {...l,cells:p}}),r=e.columnWidths;return e.columnWidths&&e.columnWidths.length>t&&(r=e.columnWidths.filter((l,s)=>s!==t)),{...e,rows:n,columnWidths:r}}function Hu(e,t){if(!t.selectedCells)return e;let{startRow:o,startCol:n,endRow:r,endCol:l}=t.selectedCells,s=r-o+1,p=l-n+1,m=e.rows.map((a,c)=>{if(c<o||c>r)return a;let u=[],d=0;for(let h of a.cells){let b=h.formatting?.gridSpan??1,f=d+b-1;d<=l&&f>=n?c===o&&d===n?u.push({...h,formatting:{...h.formatting,gridSpan:p,vMerge:s>1?"restart":void 0}}):c>o&&d===n&&u.push({...h,formatting:{...h.formatting,gridSpan:p,vMerge:"continue"}}):u.push(h),d+=b;}return {...a,cells:u}});return {...e,rows:m}}function Au(e,t,o){let n=mn(e,t,o);if(!n)return e;let r=n.formatting?.gridSpan??1,l=n.formatting?.vMerge==="restart";if(r<=1&&!l)return e;let s=e.rows.map((p,m)=>{if(m!==t&&!l)return p;let a=[],c=0;for(let u of p.cells){let d=u.formatting?.gridSpan??1;if(c===o||c<=o&&o<c+d)if(r>1)for(let h=0;h<r;h++)a.push({type:"tableCell",content:h===0?u.content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...u.formatting,gridSpan:void 0,vMerge:void 0}});else l&&m===t?a.push({...u,formatting:{...u.formatting,vMerge:void 0}}):u.formatting?.vMerge==="continue"?a.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...u.formatting,vMerge:void 0}}):a.push(u);else a.push(u);c+=d;}return {...p,cells:a}});return {...e,rows:s}}
|
|
4
|
-
export{bu as $,ne as A,ie as B,vc as C,xc as D,Qc as E,eu as F,tu as G,ou as H,nu as I,iu as J,j as K,lu as L,an as M,su as N,$t as O,Yi as P,wt as Q,cu as R,Xi as S,un as T,Ji as U,Qi as V,el as W,tl as X,uu as Y,fu as Z,gu as _,L as a,vu as aa,G as b,xu as ba,oe as c,yu as ca,T as d,Mu as da,vt as e,Pu as ea,en as f,Jt as fa,ro as g,mn as ga,Y as h,ku as ha,ds as i,Ru as ia,fo as j,Zu as ja,qe as k,Lu as ka,wo as l,Hu as la,Mo as m,Au as ma,Po as n,Ro as o,Lo as p,Ho as q,qo as r,_o as s,No as t,Fo as u,Ko as v,zt as w,Sc as x,tn as y,lc as z};
|
package/dist/chunk-YKBSKEBS.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-GZOCOWWB.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var J={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},Q={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"400px",maxWidth:"500px",width:"100%",margin:"20px"},Z={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},ee={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},te={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},re={padding:"20px"},v={marginBottom:"16px"},E={display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},x={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",boxSizing:"border-box",outline:"none"},oe={...x,borderColor:"var(--doc-error)"},ie={...x,cursor:"pointer"},le={color:"var(--doc-error)",fontSize:"12px",marginTop:"4px"},z={color:"var(--doc-text-muted)",fontSize:"12px",marginTop:"4px"},ne={display:"flex",borderBottom:"1px solid var(--doc-border)",marginBottom:"16px"},H={padding:"10px 16px",border:"none",background:"none",cursor:"pointer",fontSize:"14px",color:"var(--doc-text-muted)",borderBottom:"2px solid transparent",marginBottom:"-1px"},F={...H,color:"var(--doc-link)",borderBottomColor:"var(--doc-link)",fontWeight:500},ae={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},C={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},se={...C,backgroundColor:"var(--doc-link)",color:"white"},pe={...C,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},de={...C,backgroundColor:"var(--doc-error)",color:"white"},ce={...C,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function G(t){if(!t||t.trim()==="")return false;let e=t.trim();if(e.startsWith("mailto:")||e.startsWith("tel:"))return e.length>7;if(e.startsWith("ftp://"))return e.length>6;try{let d=e.match(/^https?:\/\//)?e:`https://${e}`,k=new URL(d);return k.protocol==="http:"||k.protocol==="https:"}catch{return false}}function M(t){if(!t)return "";let e=t.trim();return e.startsWith("mailto:")||e.startsWith("tel:")||e.startsWith("ftp://")||e.match(/^https?:\/\//)?e:`https://${e}`}function ge(t){if(!t)return "unknown";let e=t.trim().toLowerCase();return e.startsWith("mailto:")?"email":e.startsWith("tel:")?"phone":e.startsWith("ftp://")?"ftp":e.startsWith("http://")||e.startsWith("https://")?"web":e.includes("@")&&!e.includes(" ")?"email":"web"}function ue({isOpen:t,onClose:e,onSubmit:d,onRemove:k,initialData:s,selectedText:h="",isEditing:n=false,bookmarks:R=[],className:$,style:K}){let{t:r}=b(),[l,g]=useState("url"),[p,L]=useState(""),[D,_]=useState(""),[b$1,N]=useState(""),[O,P]=useState(""),[y,m]=useState(""),[B,f]=useState(false),Y=useRef(null),U=useRef(null);useEffect(()=>{t&&(s?(s.bookmark?(g("bookmark"),N(s.bookmark)):(g("url"),L(s.url||"")),_(s.displayText||""),P(s.tooltip||"")):(g("url"),L(""),_(h),N(""),P("")),m(""),f(false));},[t,s,h]),useEffect(()=>{t&&setTimeout(()=>{l==="url"?Y.current?.focus():U.current?.focus();},100);},[t,l]);let V=useCallback(()=>{l==="url"&&p.trim()?G(p)?m(""):m(r("dialogs.hyperlink.invalidUrl")):m("");},[l,p,r]),S=useCallback(o=>{if(o?.preventDefault(),l==="url"){if(!p.trim()){m(r("dialogs.hyperlink.urlRequired")),f(true);return}if(!G(p)){m(r("dialogs.hyperlink.invalidUrl")),f(true);return}}else if(l==="bookmark"&&!b$1)return;let T={displayText:D.trim()||void 0,tooltip:O.trim()||void 0};l==="url"?T.url=M(p):T.bookmark=b$1,d(T);},[l,p,b$1,D,O,d]),X=useCallback(o=>{o.key==="Escape"?e():o.key==="Enter"&&!o.shiftKey&&o.target.tagName!=="TEXTAREA"&&(o.preventDefault(),S());},[e,S]),j=useCallback(o=>{o.target===o.currentTarget&&e();},[e]);if(!t)return null;let q=R.length>0,A=l==="url"&&p.trim()&&!y||l==="bookmark"&&b$1;return jsx("div",{className:`docx-hyperlink-dialog-overlay ${$||""}`,style:{...J,...K},onClick:j,onKeyDown:X,role:"dialog","aria-modal":"true","aria-labelledby":"hyperlink-dialog-title",children:jsxs("div",{className:"docx-hyperlink-dialog",style:Q,children:[jsxs("div",{className:"docx-hyperlink-dialog-header",style:Z,children:[jsx("h2",{id:"hyperlink-dialog-title",style:ee,children:r(n?"dialogs.hyperlink.titleEdit":"dialogs.hyperlink.titleInsert")}),jsx("button",{type:"button",className:"docx-hyperlink-dialog-close",style:te,onClick:e,"aria-label":r("common.closeDialog"),children:"\xD7"})]}),jsxs("form",{className:"docx-hyperlink-dialog-body",style:re,onSubmit:S,children:[q&&jsxs("div",{className:"docx-hyperlink-dialog-tabs",style:ne,children:[jsx("button",{type:"button",className:`docx-hyperlink-dialog-tab ${l==="url"?"active":""}`,style:l==="url"?F:H,onClick:()=>g("url"),"aria-selected":l==="url",children:r("dialogs.hyperlink.tabWebAddress")}),jsx("button",{type:"button",className:`docx-hyperlink-dialog-tab ${l==="bookmark"?"active":""}`,style:l==="bookmark"?F:H,onClick:()=>g("bookmark"),"aria-selected":l==="bookmark",children:r("dialogs.hyperlink.tabBookmark")})]}),l==="url"&&jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsx("label",{htmlFor:"hyperlink-url",style:E,children:r("dialogs.hyperlink.urlLabel")}),jsx("input",{ref:Y,id:"hyperlink-url",type:"text",className:"docx-hyperlink-dialog-input",style:y&&B?oe:x,value:p,onChange:o=>{L(o.target.value),B&&m("");},onBlur:()=>{f(true),V();},placeholder:r("dialogs.hyperlink.urlPlaceholder"),"aria-invalid":!!y,"aria-describedby":y?"url-error":"url-hint"}),y&&B&&jsx("div",{id:"url-error",style:le,children:y}),!y&&jsx("div",{id:"url-hint",style:z,children:r("dialogs.hyperlink.urlHint")})]}),l==="bookmark"&&jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsx("label",{htmlFor:"hyperlink-bookmark",style:E,children:r("dialogs.hyperlink.bookmarkLabel")}),jsxs("select",{ref:U,id:"hyperlink-bookmark",className:"docx-hyperlink-dialog-select",style:ie,value:b$1,onChange:o=>N(o.target.value),children:[jsx("option",{value:"",children:r("dialogs.hyperlink.bookmarkPlaceholder")}),R.map(o=>jsx("option",{value:o.name,children:o.label||o.name},o.name))]})]}),jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsx("label",{htmlFor:"hyperlink-display-text",style:E,children:r("dialogs.hyperlink.displayTextLabel")}),jsx("input",{id:"hyperlink-display-text",type:"text",className:"docx-hyperlink-dialog-input",style:x,value:D,onChange:o=>_(o.target.value),placeholder:r("dialogs.hyperlink.displayTextPlaceholder")}),jsx("div",{style:z,children:r("dialogs.hyperlink.displayTextHint")})]}),jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsx("label",{htmlFor:"hyperlink-tooltip",style:E,children:r("dialogs.hyperlink.tooltipLabel")}),jsx("input",{id:"hyperlink-tooltip",type:"text",className:"docx-hyperlink-dialog-input",style:x,value:O,onChange:o=>P(o.target.value),placeholder:r("dialogs.hyperlink.tooltipPlaceholder")})]})]}),jsxs("div",{className:"docx-hyperlink-dialog-footer",style:ae,children:[n&&k&&jsx("button",{type:"button",className:"docx-hyperlink-dialog-remove",style:de,onClick:k,children:r("dialogs.hyperlink.removeLink")}),jsx("div",{style:{flex:1}}),jsx("button",{type:"button",className:"docx-hyperlink-dialog-cancel",style:pe,onClick:e,children:r("common.cancel")}),jsx("button",{type:"submit",className:"docx-hyperlink-dialog-submit",style:A?se:ce,onClick:S,disabled:!A,children:r(n?"common.update":"common.insert")})]})]})})}function be(t,e){return {url:M(t),displayText:e}}function xe(t,e){return {bookmark:t,displayText:e}}function he(t){return !!t.url&&!t.bookmark}function fe(t){return !!t.bookmark}function Se(t){return t.displayText?t.displayText:t.url?t.url.replace(/^https?:\/\//,""):t.bookmark?t.bookmark:""}function Te(t){return t.startsWith("mailto:")?t:`mailto:${t}`}function ve(t){return t.startsWith("tel:")?t:`tel:${t.replace(/[\s\-\(\)\.]/g,"")}`}function Ee(t){return t.filter(e=>!e.name.startsWith("_")).map(e=>({name:e.name,label:e.name})).sort((e,d)=>e.name.localeCompare(d.name))}function Ce(){let[t,e]=useState({isOpen:false,isEditing:false}),d=useCallback(n=>{e({isOpen:true,selectedText:n,initialData:void 0,isEditing:false});},[]),k=useCallback(n=>{e({isOpen:true,initialData:n,selectedText:n.displayText,isEditing:true});},[]),s=useCallback(()=>{e(n=>({...n,isOpen:false}));},[]),h=useCallback(()=>{e(n=>({...n,isOpen:!n.isOpen}));},[]);return {state:t,openInsert:d,openEdit:k,close:s,toggle:h}}var Le=ue;
|
|
2
|
-
export{G as a,M as b,ge as c,ue as d,be as e,xe as f,he as g,fe as h,Se as i,Te as j,ve as k,Ee as l,Ce as m,Le as n};
|