@eigenpal/docx-editor-agents 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bridge.d.mts +1 -1
- package/dist/bridge.d.ts +1 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/chunk-6NWAUIGY.js +1 -0
- package/dist/{chunk-MREPAMXX.js → chunk-A6ANAWKH.js} +1 -1
- package/dist/{chunk-H7HNGCMH.mjs → chunk-BDHS4WRJ.mjs} +1 -1
- package/dist/chunk-CPJV53R6.mjs +5 -0
- package/dist/chunk-G46D3GDJ.js +71 -0
- package/dist/{chunk-YCUXBRD7.js → chunk-LVRKZUG4.js} +3 -3
- package/dist/{chunk-NLYXACTI.js → chunk-N2TKFYHU.js} +2 -2
- package/dist/{chunk-74RQEWM7.mjs → chunk-QALBLABE.mjs} +1 -1
- package/dist/chunk-U7BWZ7DG.mjs +1 -0
- package/dist/chunk-XZHZXQO5.mjs +71 -0
- package/dist/executor-OYRPTNBR.mjs +1 -0
- package/dist/executor-SJAFSXKL.js +1 -0
- package/dist/headless-FE3K7ABO.js +1 -0
- package/dist/headless-JRF2KBID.mjs +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/{server-CLaXsEC8.d.mts → server-DH5eszkm.d.mts} +41 -1
- package/dist/{server-CLaXsEC8.d.ts → server-DH5eszkm.d.ts} +41 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-2AF2FRMM.js +0 -1
- package/dist/chunk-HSAYNLBS.mjs +0 -5
- package/dist/chunk-OVPN5UGH.js +0 -71
- package/dist/chunk-PNONETA3.mjs +0 -71
- package/dist/chunk-X57U3ESM.mjs +0 -1
- package/dist/executor-O3426NM3.mjs +0 -1
- package/dist/executor-WY7D4C5O.js +0 -1
- package/dist/headless-ASQ6WVGY.mjs +0 -1
- package/dist/headless-VE2YU7ZB.js +0 -1
package/dist/chunk-OVPN5UGH.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use strict';var chunk2AF2FRMM_js=require('./chunk-2AF2FRMM.js'),Oe=require('jszip'),xmlJs=require('xml-js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Oe__default=/*#__PURE__*/_interopDefault(Oe);function R(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Gt=1e5;function Zt(){Gt=1e5;}function qt(e){return e!=null&&e!==""&&e!==0?String(e):String(Gt++)}var xo=new Set(["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","white","yellow"]);function yo(e){if(!e)return "";let t=[];return e.auto?t.push('w:val="auto"'):e.rgb&&t.push(`w:val="${e.rgb}"`),e.themeColor&&t.push(`w:themeColor="${e.themeColor}"`),e.themeTint&&t.push(`w:themeTint="${e.themeTint}"`),e.themeShade&&t.push(`w:themeShade="${e.themeShade}"`),t.length===0?"":`<w:color ${t.join(" ")}/>`}function bo(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function pe(e){if(!e)return "";let t=[];if(e.styleId&&t.push(`<w:rStyle w:val="${R(e.styleId)}"/>`),e.fontFamily){let o=[];e.fontFamily.ascii&&o.push(`w:ascii="${R(e.fontFamily.ascii)}"`),e.fontFamily.hAnsi&&o.push(`w:hAnsi="${R(e.fontFamily.hAnsi)}"`),e.fontFamily.eastAsia&&o.push(`w:eastAsia="${R(e.fontFamily.eastAsia)}"`),e.fontFamily.cs&&o.push(`w:cs="${R(e.fontFamily.cs)}"`),e.fontFamily.asciiTheme&&o.push(`w:asciiTheme="${e.fontFamily.asciiTheme}"`),e.fontFamily.hAnsiTheme&&o.push(`w:hAnsiTheme="${e.fontFamily.hAnsiTheme}"`),e.fontFamily.eastAsiaTheme&&o.push(`w:eastAsiaTheme="${e.fontFamily.eastAsiaTheme}"`),e.fontFamily.csTheme&&o.push(`w:csTheme="${e.fontFamily.csTheme}"`),o.length>0&&t.push(`<w:rFonts ${o.join(" ")}/>`);}e.bold===true?t.push("<w:b/>"):e.bold===false&&t.push('<w:b w:val="0"/>'),e.boldCs===true?t.push("<w:bCs/>"):e.boldCs===false&&t.push('<w:bCs w:val="0"/>'),e.italic===true?t.push("<w:i/>"):e.italic===false&&t.push('<w:i w:val="0"/>'),e.italicCs===true?t.push("<w:iCs/>"):e.italicCs===false&&t.push('<w:iCs w:val="0"/>'),e.allCaps&&t.push("<w:caps/>"),e.smallCaps&&t.push("<w:smallCaps/>"),e.strike&&t.push("<w:strike/>"),e.doubleStrike&&t.push("<w:dstrike/>"),e.outline&&t.push("<w:outline/>"),e.shadow&&t.push("<w:shadow/>"),e.emboss&&t.push("<w:emboss/>"),e.imprint&&t.push("<w:imprint/>"),e.hidden&&t.push("<w:vanish/>");let n=yo(e.color);if(n&&t.push(n),e.spacing!==void 0&&t.push(`<w:spacing w:val="${e.spacing}"/>`),e.scale!==void 0&&t.push(`<w:w w:val="${e.scale}"/>`),e.kerning!==void 0&&t.push(`<w:kern w:val="${e.kerning}"/>`),e.position!==void 0&&t.push(`<w:position w:val="${e.position}"/>`),e.fontSize!==void 0&&t.push(`<w:sz w:val="${e.fontSize}"/>`),e.fontSizeCs!==void 0&&t.push(`<w:szCs w:val="${e.fontSizeCs}"/>`),e.highlight&&e.highlight!=="none"){if(xo.has(e.highlight))t.push(`<w:highlight w:val="${e.highlight}"/>`);else if(!e.shading){let o=e.highlight.replace(/^#/,"");/^[0-9a-fA-F]{6}$/.test(o)&&t.push(`<w:shd w:val="clear" w:color="auto" w:fill="${o}"/>`);}}if(e.underline){let o=[`w:val="${e.underline.style}"`];e.underline.color&&(e.underline.color.rgb&&o.push(`w:color="${e.underline.color.rgb}"`),e.underline.color.themeColor&&o.push(`w:themeColor="${e.underline.color.themeColor}"`),e.underline.color.themeTint&&o.push(`w:themeTint="${e.underline.color.themeTint}"`),e.underline.color.themeShade&&o.push(`w:themeShade="${e.underline.color.themeShade}"`)),t.push(`<w:u ${o.join(" ")}/>`);}e.effect&&e.effect!=="none"&&t.push(`<w:effect w:val="${e.effect}"/>`),e.emphasisMark&&e.emphasisMark!=="none"&&t.push(`<w:em w:val="${e.emphasisMark}"/>`);let r=bo(e.shading);return r&&t.push(r),e.vertAlign&&e.vertAlign!=="baseline"&&t.push(`<w:vertAlign w:val="${e.vertAlign}"/>`),e.rtl&&t.push("<w:rtl/>"),e.cs&&t.push("<w:cs/>"),t.length===0?"":`<w:rPr>${t.join("")}</w:rPr>`}function To(e){return !e.startsWith("<w:rPr>")||!e.endsWith("</w:rPr>")?"":e.slice(7,-8)}function Co(e){let t=Number.isInteger(e.info.id)&&e.info.id>=0?e.info.id:0,n=typeof e.info.author=="string"?e.info.author.trim():"",r=n.length>0?n:"Unknown",o=typeof e.info.date=="string"?e.info.date.trim():void 0,i=typeof e.info.rsid=="string"?e.info.rsid.trim():void 0,a=[`w:id="${t}"`,`w:author="${R(r)}"`];o&&a.push(`w:date="${R(o)}"`),i&&a.push(`w:rsid="${R(i)}"`);let s=pe(e.previousFormatting)||"<w:rPr/>";return `<w:rPrChange ${a.join(" ")}>${s}</w:rPrChange>`}function Po(e,t){let n=pe(e),r=n?To(n):"",o=(t??[]).map(Co).join(""),i=`${r}${o}`;return i?`<w:rPr>${i}</w:rPr>`:""}function Fo(e){return `<w:t${e.preserveSpace||e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${R(e.text)}</w:t>`}function So(e){return "<w:tab/>"}function ko(e){let t=[];return e.breakType==="page"?t.push('w:type="page"'):e.breakType==="column"?t.push('w:type="column"'):e.breakType==="textWrapping"&&(t.push('w:type="textWrapping"'),e.clear&&e.clear!=="none"&&t.push(`w:clear="${e.clear}"`)),t.length===0?"<w:br/>":`<w:br ${t.join(" ")}/>`}function vo(e){return `<w:sym w:font="${R(e.font)}" w:char="${R(e.char)}"/>`}function Ro(e){return e.type==="footnoteRef"?`<w:footnoteReference w:id="${e.id}"/>`:`<w:endnoteReference w:id="${e.id}"/>`}function Io(e){let t=[`w:fldCharType="${e.charType}"`];return e.fldLock&&t.push('w:fldLock="true"'),e.dirty&&t.push('w:dirty="true"'),`<w:fldChar ${t.join(" ")}/>`}function Eo(e){return `<w:instrText${e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${R(e.text)}</w:instrText>`}function Ao(e){return "<w:softHyphen/>"}function Mo(e){return "<w:noBreakHyphen/>"}function lt(e){if(!e)return "";if(e.rgb)return `<a:srgbClr val="${e.rgb.replace("#","")}"/>`;if(e.themeColor){let t=`<a:schemeClr val="${e.themeColor}"`;return e.themeTint?t+=`><a:tint val="${e.themeTint}"/></a:schemeClr>`:e.themeShade?t+=`><a:shade val="${e.themeShade}"/></a:schemeClr>`:t+="/>",t}return ""}function Bo(e){if(!e||e.type==="none")return "<a:noFill/>";if(e.type==="solid"&&e.color)return `<a:solidFill>${lt(e.color)}</a:solidFill>`;if(e.type==="gradient"&&e.gradient){let t=e.gradient,n=t.stops.map(o=>`<a:gs pos="${o.position}">${lt(o.color)}</a:gs>`).join(""),r=t.type==="linear"?`<a:lin ang="${(t.angle||0)*6e4}" scaled="1"/>`:"";return `<a:gradFill><a:gsLst>${n}</a:gsLst>${r}</a:gradFill>`}return ""}function Yt(e){if(!e)return "";let t=[];e.width!=null&&t.push(`w="${e.width}"`),e.cap&&t.push(`cap="${e.cap}"`);let n=[];return e.color&&n.push(`<a:solidFill>${lt(e.color)}</a:solidFill>`),e.style&&e.style!=="solid"&&n.push(`<a:prstDash val="${e.style}"/>`),e.headEnd&&n.push(`<a:headEnd type="${e.headEnd.type}"${e.headEnd.width?` w="${e.headEnd.width}"`:""}${e.headEnd.length?` len="${e.headEnd.length}"`:""}/>`),e.tailEnd&&n.push(`<a:tailEnd type="${e.tailEnd.type}"${e.tailEnd.width?` w="${e.tailEnd.width}"`:""}${e.tailEnd.length?` len="${e.tailEnd.length}"`:""}/>`),n.length===0&&t.length===0?"":`<a:ln${t.length?" "+t.join(" "):""}>${n.join("")}</a:ln>`}function Jt(e){let t=[],n=e.horizontal;t.push(`<wp:positionH relativeFrom="${n.relativeTo}">`),n.alignment?t.push(`<wp:align>${n.alignment}</wp:align>`):t.push(`<wp:posOffset>${n.posOffset||0}</wp:posOffset>`),t.push("</wp:positionH>");let r=e.vertical;return t.push(`<wp:positionV relativeFrom="${r.relativeTo}">`),r.alignment?t.push(`<wp:align>${r.alignment}</wp:align>`):t.push(`<wp:posOffset>${r.posOffset||0}</wp:posOffset>`),t.push("</wp:positionV>"),t.join("")}function Kt(e){let t=e.wrapText?` wrapText="${e.wrapText}"`:' wrapText="bothSides"';switch(e.type){case "square":return `<wp:wrapSquare${t}/>`;case "tight":return `<wp:wrapTight${t}><wp:wrapPolygon edited="0"><wp:start x="0" y="0"/><wp:lineTo x="0" y="21600"/><wp:lineTo x="21600" y="21600"/><wp:lineTo x="21600" y="0"/><wp:lineTo x="0" y="0"/></wp:wrapPolygon></wp:wrapTight>`;case "through":return `<wp:wrapThrough${t}><wp:wrapPolygon edited="0"><wp:start x="0" y="0"/><wp:lineTo x="0" y="21600"/><wp:lineTo x="21600" y="21600"/><wp:lineTo x="21600" y="0"/><wp:lineTo x="0" y="0"/></wp:wrapPolygon></wp:wrapThrough>`;case "topAndBottom":return "<wp:wrapTopAndBottom/>";case "behind":case "inFront":return "<wp:wrapNone/>";default:return "<wp:wrapNone/>"}}function $o(e,t){let n=e.size.width,r=e.size.height,o=e.rId||"rId1",i=t,a=e.filename||`image${i}`,s="";return e.transform?.rotation&&(s+=` rot="${Math.round(e.transform.rotation*6e4)}"`),e.transform?.flipH&&(s+=' flipH="1"'),e.transform?.flipV&&(s+=' flipV="1"'),['<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">','<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">','<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">',"<pic:nvPicPr>",`<pic:cNvPr id="${i}" name="${R(a)}"${e.alt?` descr="${R(e.alt)}"`:""}/>`,"<pic:cNvPicPr/>","</pic:nvPicPr>","<pic:blipFill>",`<a:blip r:embed="${o}"/>`,"<a:stretch><a:fillRect/></a:stretch>","</pic:blipFill>","<pic:spPr>",`<a:xfrm${s}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${n}" cy="${r}"/>`,"</a:xfrm>",'<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>',e.outline?Yt(e.outline):"","</pic:spPr>","</pic:pic>","</a:graphicData>","</a:graphic>"].join("")}function Do(e){let t=e.image,n=t.wrap.type!=="inline",r=t.size.width,o=t.size.height,i=t.padding?.top??t.wrap.distT??0,a=t.padding?.bottom??t.wrap.distB??0,s=t.padding?.left??t.wrap.distL??0,c=t.padding?.right??t.wrap.distR??0,f=qt(t.id),p=t.title||t.filename||`Picture ${f}`,m=$o(t,f);if(!n)return ["<w:drawing>",`<wp:inline distT="${i}" distB="${a}" distL="${s}" distR="${c}">`,`<wp:extent cx="${r}" cy="${o}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${f}" name="${R(p)}"${t.alt?` descr="${R(t.alt)}"`:""}${t.decorative?' hidden="1"':""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',m,"</wp:inline>","</w:drawing>"].join("");let g=t.wrap.type==="behind"?"1":"0",b=t.position?Jt(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',d=Kt(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${i}" distB="${a}" distL="${s}" distR="${c}" simplePos="0" relativeHeight="251658240" behindDoc="${g}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',b,`<wp:extent cx="${r}" cy="${o}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',d,`<wp:docPr id="${f}" name="${R(p)}"${t.alt?` descr="${R(t.alt)}"`:""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',m,"</wp:anchor>","</w:drawing>"].join("")}function No(e){return e.map(t=>oe(t)).join("")}function Ho(e){let t=e.shape,n=t.size.width,r=t.size.height,o=t.shapeType==="textBox",i=t.wrap&&t.wrap.type!=="inline",a=t.wrap?.distT??0,s=t.wrap?.distB??0,c=t.wrap?.distL??0,f=t.wrap?.distR??0,p=qt(t.id),m=t.name||(o?`TextBox ${p}`:`Shape ${p}`),g="";t.transform?.rotation&&(g+=` rot="${Math.round(t.transform.rotation*6e4)}"`),t.transform?.flipH&&(g+=' flipH="1"'),t.transform?.flipV&&(g+=' flipV="1"');let b=["<wps:spPr>",`<a:xfrm${g}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${n}" cy="${r}"/>`,"</a:xfrm>",`<a:prstGeom prst="${t.shapeType==="textBox"?"rect":t.shapeType}"><a:avLst/></a:prstGeom>`,Bo(t.fill),Yt(t.outline),"</wps:spPr>"].join(""),d="";if(t.textBody){let h=t.textBody,y=['rot="0"','vert="horz"'];h.anchor&&y.push(`anchor="${h.anchor==="middle"?"ctr":h.anchor}"`),h.anchorCenter&&y.push('anchorCtr="1"'),h.margins&&(h.margins.left!=null&&y.push(`lIns="${h.margins.left}"`),h.margins.top!=null&&y.push(`tIns="${h.margins.top}"`),h.margins.right!=null&&y.push(`rIns="${h.margins.right}"`),h.margins.bottom!=null&&y.push(`bIns="${h.margins.bottom}"`)),o?d=["<wps:txbx><w:txbxContent>",No(h.content),"</w:txbxContent></wps:txbx>",`<wps:bodyPr ${y.join(" ")}/>`].join(""):d=[`<wps:bodyPr ${y.join(" ")}/>`].join("");}let C=['<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">','<a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">',["<wps:wsp>",`<wps:cNvSpPr${o?' txBox="1"':""}/>`,b,d,"</wps:wsp>"].join(""),"</a:graphicData>","</a:graphic>"].join("");if(!i)return ["<w:drawing>",`<wp:inline distT="${a}" distB="${s}" distL="${c}" distR="${f}">`,`<wp:extent cx="${n}" cy="${r}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${p}" name="${R(m)}"/>`,"<wp:cNvGraphicFramePr/>",C,"</wp:inline>","</w:drawing>"].join("");let I=t.wrap?.type==="behind"?"1":"0",F=t.position?Jt(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',P=Kt(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${a}" distB="${s}" distL="${c}" distR="${f}" simplePos="0" relativeHeight="251658240" behindDoc="${I}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',F,`<wp:extent cx="${n}" cy="${r}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',P,`<wp:docPr id="${p}" name="${R(m)}"/>`,"<wp:cNvGraphicFramePr/>",C,"</wp:anchor>","</w:drawing>"].join("")}function Lo(e){switch(e.type){case "text":return Fo(e);case "tab":return So();case "break":return ko(e);case "symbol":return vo(e);case "footnoteRef":case "endnoteRef":return Ro(e);case "fieldChar":return Io(e);case "instrText":return Eo(e);case "softHyphen":return Ao();case "noBreakHyphen":return Mo();case "drawing":return Do(e);case "shape":return Ho(e);default:return ""}}function ee(e){let t=[],n=Po(e.formatting,e.propertyChanges);n&&t.push(n);for(let r of e.content){let o=Lo(r);o&&t.push(o);}return `<w:r>${t.join("")}</w:r>`}function de(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${e.size}"`),e.space!==void 0&&n.push(`w:space="${e.space}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function Xo(e){if(!e)return "";let t=[];if(e.top){let n=de(e.top,"top");n&&t.push(n);}if(e.left){let n=de(e.left,"left");n&&t.push(n);}if(e.bottom){let n=de(e.bottom,"bottom");n&&t.push(n);}if(e.right){let n=de(e.right,"right");n&&t.push(n);}if(e.between){let n=de(e.between,"between");n&&t.push(n);}if(e.bar){let n=de(e.bar,"bar");n&&t.push(n);}return t.length===0?"":`<w:pBdr>${t.join("")}</w:pBdr>`}function Oo(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function zo(e){return !e||e.length===0?"":`<w:tabs>${e.map(n=>{let r=[`w:val="${n.alignment}"`,`w:pos="${n.position}"`];return n.leader&&n.leader!=="none"&&r.push(`w:leader="${n.leader}"`),`<w:tab ${r.join(" ")}/>`}).join("")}</w:tabs>`}function jo(e){let t=[];return e.spaceBefore!==void 0&&t.push(`w:before="${e.spaceBefore}"`),e.spaceAfter!==void 0&&t.push(`w:after="${e.spaceAfter}"`),e.lineSpacing!==void 0&&t.push(`w:line="${e.lineSpacing}"`),e.lineSpacingRule&&t.push(`w:lineRule="${e.lineSpacingRule}"`),e.beforeAutospacing&&t.push('w:beforeAutospacing="1"'),e.afterAutospacing&&t.push('w:afterAutospacing="1"'),t.length===0?"":`<w:spacing ${t.join(" ")}/>`}function Vo(e){let t=[];return e.indentLeft!==void 0&&t.push(`w:left="${e.indentLeft}"`),e.indentRight!==void 0&&t.push(`w:right="${e.indentRight}"`),e.indentFirstLine!==void 0&&(e.hangingIndent?t.push(`w:hanging="${Math.abs(e.indentFirstLine)}"`):e.indentFirstLine!==0&&t.push(`w:firstLine="${e.indentFirstLine}"`)),t.length===0?"":`<w:ind ${t.join(" ")}/>`}function _o(e){if(!e)return "";let t=[];return e.ilvl!==void 0&&t.push(`<w:ilvl w:val="${e.ilvl}"/>`),e.numId!==void 0&&t.push(`<w:numId w:val="${e.numId}"/>`),t.length===0?"":`<w:numPr>${t.join("")}</w:numPr>`}function Wo(e){if(!e)return "";let t=[];return e.width!==void 0&&t.push(`w:w="${e.width}"`),e.height!==void 0&&t.push(`w:h="${e.height}"`),e.hAnchor&&t.push(`w:hAnchor="${e.hAnchor}"`),e.vAnchor&&t.push(`w:vAnchor="${e.vAnchor}"`),e.x!==void 0&&t.push(`w:x="${e.x}"`),e.y!==void 0&&t.push(`w:y="${e.y}"`),e.xAlign&&t.push(`w:xAlign="${e.xAlign}"`),e.yAlign&&t.push(`w:yAlign="${e.yAlign}"`),e.wrap&&t.push(`w:wrap="${e.wrap}"`),t.length===0?"":`<w:framePr ${t.join(" ")}/>`}function en(e,t){let n=[];if(e){e.styleId&&n.push(`<w:pStyle w:val="${R(e.styleId)}"/>`),e.keepNext&&n.push("<w:keepNext/>"),e.keepLines&&n.push("<w:keepLines/>"),e.contextualSpacing&&n.push("<w:contextualSpacing/>"),e.pageBreakBefore&&n.push("<w:pageBreakBefore/>");let r=Wo(e.frame);r&&n.push(r),e.widowControl===false?n.push('<w:widowControl w:val="0"/>'):e.widowControl===true&&n.push("<w:widowControl/>");let o=_o(e.numPr);o&&n.push(o);let i=Xo(e.borders);i&&n.push(i);let a=Oo(e.shading);a&&n.push(a);let s=zo(e.tabs);s&&n.push(s),e.suppressLineNumbers&&n.push("<w:suppressLineNumbers/>"),e.suppressAutoHyphens&&n.push("<w:suppressAutoHyphens/>");let c=jo(e);c&&n.push(c);let f=Vo(e);if(f&&n.push(f),e.bidi&&n.push("<w:bidi/>"),e.alignment&&n.push(`<w:jc w:val="${e.alignment}"/>`),e.outlineLevel!==void 0&&n.push(`<w:outlineLvl w:val="${e.outlineLevel}"/>`),e.runProperties){let p=pe(e.runProperties);p&&n.push(p);}}return t&&t.length>0&&n.push(...t.map(r=>Go(r))),n.length===0?"":`<w:pPr>${n.join("")}</w:pPr>`}function Uo(e){return !e.startsWith("<w:pPr>")||!e.endsWith("</w:pPr>")?"":e.slice(7,-8)}function Go(e){let t=Number.isInteger(e.info.id)&&e.info.id>=0?e.info.id:0,n=typeof e.info.author=="string"?e.info.author.trim():"",r=n.length>0?n:"Unknown",o=typeof e.info.date=="string"?e.info.date.trim():void 0,i=typeof e.info.rsid=="string"?e.info.rsid.trim():void 0,a=[`w:id="${t}"`,`w:author="${R(r)}"`];o&&a.push(`w:date="${R(o)}"`),i&&a.push(`w:rsid="${R(i)}"`);let s=en(e.previousFormatting)||"<w:pPr/>",c=Uo(s),f=c.length>0?`<w:pPr>${c}</w:pPr>`:"<w:pPr/>";return `<w:pPrChange ${a.join(" ")}>${f}</w:pPrChange>`}function ct(e){let t=[];e.rId&&t.push(`r:id="${e.rId}"`),e.anchor&&t.push(`w:anchor="${R(e.anchor)}"`),e.tooltip&&t.push(`w:tooltip="${R(e.tooltip)}"`),e.target&&t.push(`w:tgtFrame="${R(e.target)}"`),e.history===false&&t.push('w:history="0"'),e.docLocation&&t.push(`w:docLocation="${R(e.docLocation)}"`);let n=e.children.map(o=>o.type==="run"?ee(o):o.type==="bookmarkStart"?tn(o):o.type==="bookmarkEnd"?nn(o):"").join("");return `<w:hyperlink${t.length>0?" "+t.join(" "):""}>${n}</w:hyperlink>`}function tn(e){let t=[`w:id="${e.id}"`,`w:name="${R(e.name)}"`];return e.colFirst!==void 0&&t.push(`w:colFirst="${e.colFirst}"`),e.colLast!==void 0&&t.push(`w:colLast="${e.colLast}"`),`<w:bookmarkStart ${t.join(" ")}/>`}function nn(e){return `<w:bookmarkEnd w:id="${e.id}"/>`}function Zo(e){let t=[],n=e.content.find(s=>s.type==="run"),r=n?.formatting?pe(n.formatting):"",o=['w:fldCharType="begin"'];e.fldLock&&o.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${o.join(" ")}/></w:r>`);let a=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${a}>${R(e.instruction)}</w:instrText></w:r>`),t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`);for(let s of e.content)s.type==="run"&&t.push(ee(s));return t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function qo(e){let t=[],n=e.fieldResult?.[0]?.formatting,r=n?pe(n):"",o=['w:fldCharType="begin"'];if(e.fldLock&&o.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${o.join(" ")}/></w:r>`),e.fieldCode.length>0)t.push(...e.fieldCode.map(i=>ee(i)));else {let a=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${a}>${R(e.instruction)}</w:instrText></w:r>`);}return t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`),t.push(...e.fieldResult.map(i=>ee(i))),t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function Yo(e){let t=e.properties,n=[];switch(t.alias&&n.push(`<w:alias w:val="${R(t.alias)}"/>`),t.tag&&n.push(`<w:tag w:val="${R(t.tag)}"/>`),t.lock&&t.lock!=="unlocked"&&n.push(`<w:lock w:val="${t.lock}"/>`),t.showingPlaceholder&&n.push("<w:showingPlcHdr/>"),t.sdtType){case "plainText":n.push("<w:text/>");break;case "date":t.dateFormat?n.push(`<w:date w:fullDate="${R(t.dateFormat)}"/>`):n.push("<w:date/>");break;case "dropdown":{let o=(t.listItems??[]).map(i=>`<w:listItem w:displayText="${R(i.displayText)}" w:value="${R(i.value)}"/>`).join("");n.push(`<w:dropDownList>${o}</w:dropDownList>`);break}case "comboBox":{let o=(t.listItems??[]).map(i=>`<w:listItem w:displayText="${R(i.displayText)}" w:value="${R(i.value)}"/>`).join("");n.push(`<w:comboBox>${o}</w:comboBox>`);break}case "checkbox":n.push(`<w14:checkbox><w14:checked w14:val="${t.checked?"1":"0"}"/></w14:checkbox>`);break;case "picture":n.push("<w:picture/>");break}let r=e.content.map(o=>o.type==="run"?ee(o):o.type==="hyperlink"?ct(o):"").join("");return `<w:sdt><w:sdtPr>${n.join("")}</w:sdtPr><w:sdtContent>${r}</w:sdtContent></w:sdt>`}function Qt(e,t){let n=[`w:id="${t.id}"`,`w:name="${R(t.name)}"`];return `<w:${e} ${n.join(" ")}/>`}function Ae(e,t){let n=t.info,r=Number.isInteger(n.id)&&n.id>=0?n.id:0,o=typeof n.author=="string"?n.author.trim():"",i=o.length>0?o:"Unknown",a=typeof n.date=="string"?n.date.trim():void 0,s=[`w:id="${r}"`,`w:author="${R(i)}"`];a&&s.push(`w:date="${R(a)}"`);let c=t.content.map(f=>f.type==="run"?e==="del"||e==="moveFrom"?ee(f).replace(/<w:t\b/g,"<w:delText").replace(/<\/w:t>/g,"</w:delText>").replace(/<w:instrText\b/g,"<w:delInstrText").replace(/<\/w:instrText>/g,"</w:delInstrText>"):ee(f):f.type==="hyperlink"?ct(f):"").join("");return `<w:${e} ${s.join(" ")}>${c}</w:${e}>`}function Jo(e){switch(e.type){case "run":return ee(e);case "hyperlink":return ct(e);case "bookmarkStart":return tn(e);case "bookmarkEnd":return nn(e);case "simpleField":return Zo(e);case "complexField":return qo(e);case "inlineSdt":return Yo(e);case "commentRangeStart":return `<w:commentRangeStart w:id="${e.id}"/>`;case "commentRangeEnd":return `<w:commentRangeEnd w:id="${e.id}"/><w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="${e.id}"/></w:r>`;case "insertion":return Ae("ins",e);case "deletion":return Ae("del",e);case "moveFrom":return Ae("moveFrom",e);case "moveTo":return Ae("moveTo",e);case "moveFromRangeStart":return Qt("moveFromRangeStart",e);case "moveFromRangeEnd":return `<w:moveFromRangeEnd w:id="${e.id}"/>`;case "moveToRangeStart":return Qt("moveToRangeStart",e);case "moveToRangeEnd":return `<w:moveToRangeEnd w:id="${e.id}"/>`;case "mathEquation":return e.ommlXml||"";default:return ""}}function oe(e){let t=[],n=[];e.paraId&&n.push(`w14:paraId="${e.paraId}"`),e.textId&&n.push(`w14:textId="${e.textId}"`);let r=n.length>0?" "+n.join(" "):"",o=en(e.formatting,e.propertyChanges);o&&t.push(o);let i=!!e.renderedPageBreakBefore;for(let a of e.content){let s=Jo(a);if(s){if(i){let c=Ko(s);c&&(s=c,i=false);}t.push(s);}}return `<w:p${r}>${t.join("")}</w:p>`}function Ko(e){let t=/<w:r(?=[\s>/])[^>]*>/;return t.test(e)?e.replace(t,n=>`${n}<w:lastRenderedPageBreak/>`):null}function Qo(e){let t=Number.isInteger(e.id)&&e.id>=0?e.id:0,n=typeof e.author=="string"?e.author.trim():"",r=n.length>0?n:"Unknown",o=typeof e.date=="string"?e.date.trim():void 0;return {id:t,author:r,date:o}}function ae(e,t){let n=Qo(e),r=[`w:id="${n.id}"`,`w:author="${R(n.author)}"`];return n.date&&r.push(`w:date="${R(n.date)}"`),t&&t.trim().length>0&&r.push(`w:rsid="${R(t.trim())}"`),r.join(" ")}function ie(e,t){if(!e)return "";let n=[`w:w="${e.value}"`,`w:type="${e.type}"`];return `<w:${t} ${n.join(" ")}/>`}function me(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${e.size}"`),e.space!==void 0&&n.push(`w:space="${e.space}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function rn(e,t){if(!e)return "";let n=[];if(e.top){let r=me(e.top,"top");r&&n.push(r);}if(e.left){let r=me(e.left,"left");r&&n.push(r);}if(e.bottom){let r=me(e.bottom,"bottom");r&&n.push(r);}if(e.right){let r=me(e.right,"right");r&&n.push(r);}if(e.insideH){let r=me(e.insideH,"insideH");r&&n.push(r);}if(e.insideV){let r=me(e.insideV,"insideV");r&&n.push(r);}return n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function on(e,t){if(!e)return "";let n=[];return e.top&&n.push(ie(e.top,"top")),e.left&&n.push(ie(e.left,"left")),e.bottom&&n.push(ie(e.bottom,"bottom")),e.right&&n.push(ie(e.right,"right")),n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function an(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function ei(e){if(!e)return "";let t=[];return e.firstRow&&t.push('w:firstRow="1"'),e.lastRow&&t.push('w:lastRow="1"'),e.firstColumn&&t.push('w:firstColumn="1"'),e.lastColumn&&t.push('w:lastColumn="1"'),e.noHBand&&t.push('w:noHBand="1"'),e.noVBand&&t.push('w:noVBand="1"'),t.length===0?"":`<w:tblLook ${t.join(" ")}/>`}function ti(e){if(!e)return "";let t=[];return e.horzAnchor&&t.push(`w:horzAnchor="${e.horzAnchor}"`),e.vertAnchor&&t.push(`w:vertAnchor="${e.vertAnchor}"`),e.tblpX!==void 0&&t.push(`w:tblpX="${e.tblpX}"`),e.tblpXSpec&&t.push(`w:tblpXSpec="${e.tblpXSpec}"`),e.tblpY!==void 0&&t.push(`w:tblpY="${e.tblpY}"`),e.tblpYSpec&&t.push(`w:tblpYSpec="${e.tblpYSpec}"`),e.topFromText!==void 0&&t.push(`w:topFromText="${e.topFromText}"`),e.bottomFromText!==void 0&&t.push(`w:bottomFromText="${e.bottomFromText}"`),e.leftFromText!==void 0&&t.push(`w:leftFromText="${e.leftFromText}"`),e.rightFromText!==void 0&&t.push(`w:rightFromText="${e.rightFromText}"`),t.length===0?"":`<w:tblpPr ${t.join(" ")}/>`}function sn(e,t){let n=[];if(e){e.styleId&&n.push(`<w:tblStyle w:val="${R(e.styleId)}"/>`);let r=ti(e.floating);r&&n.push(r),e.bidi&&n.push("<w:bidiVisual/>");let o=ie(e.width,"tblW");o&&n.push(o),e.justification&&n.push(`<w:jc w:val="${e.justification}"/>`);let i=ie(e.cellSpacing,"tblCellSpacing");i&&n.push(i);let a=ie(e.indent,"tblInd");a&&n.push(a);let s=rn(e.borders,"tblBorders");s&&n.push(s);let c=on(e.cellMargins,"tblCellMar");c&&n.push(c),e.layout&&n.push(`<w:tblLayout w:type="${e.layout}"/>`);let f=an(e.shading);f&&n.push(f);let p=ei(e.look);p&&n.push(p),e.overlap&&n.push(`<w:tblOverlap w:val="${e.overlap}"/>`);}return t&&t.length>0&&n.push(...t.map(r=>ri(r))),n.length===0?"":`<w:tblPr>${n.join("")}</w:tblPr>`}function ni(e){return !e.startsWith("<w:tblPr>")||!e.endsWith("</w:tblPr>")?"":e.slice(9,-10)}function ri(e){let t=ae(e.info,e.info.rsid),n=sn(e.previousFormatting)||"<w:tblPr/>",r=ni(n),o=r.length>0?`<w:tblPr>${r}</w:tblPr>`:"<w:tblPr/>";return `<w:tblPrChange ${t}>${o}</w:tblPrChange>`}function ln(e,t,n){let r=[];if(e){if(e.cantSplit&&r.push("<w:cantSplit/>"),e.header&&r.push("<w:tblHeader/>"),e.height){let o=[`w:val="${e.height.value}"`];e.heightRule&&o.push(`w:hRule="${e.heightRule}"`),r.push(`<w:trHeight ${o.join(" ")}/>`);}e.justification&&r.push(`<w:jc w:val="${e.justification}"/>`),e.hidden&&r.push("<w:hidden/>");}return n&&(n.type==="tableRowInsertion"?r.push(`<w:ins ${ae(n.info)}/>`):n.type==="tableRowDeletion"&&r.push(`<w:del ${ae(n.info)}/>`)),t&&t.length>0&&r.push(...t.map(o=>ii(o))),r.length===0?"":`<w:trPr>${r.join("")}</w:trPr>`}function oi(e){return !e.startsWith("<w:trPr>")||!e.endsWith("</w:trPr>")?"":e.slice(8,-9)}function ii(e){let t=ae(e.info,e.info.rsid),n=ln(e.previousFormatting)||"<w:trPr/>",r=oi(n),o=r.length>0?`<w:trPr>${r}</w:trPr>`:"<w:trPr/>";return `<w:trPrChange ${t}>${o}</w:trPrChange>`}function ai(e){if(!e)return "";let n=[e.firstRow?"1":"0",e.lastRow?"1":"0",e.firstColumn?"1":"0",e.lastColumn?"1":"0",e.oddVBand?"1":"0",e.evenVBand?"1":"0",e.oddHBand?"1":"0",e.evenHBand?"1":"0",e.nwCell?"1":"0",e.neCell?"1":"0",e.swCell?"1":"0",e.seCell?"1":"0"].join("");return n==="000000000000"?"":`<w:cnfStyle w:val="${n}"/>`}function cn(e,t,n){let r=[];if(e){let o=ai(e.conditionalFormat);o&&r.push(o);let i=ie(e.width,"tcW");i&&r.push(i),e.gridSpan&&e.gridSpan>1&&r.push(`<w:gridSpan w:val="${e.gridSpan}"/>`),e.vMerge&&(e.vMerge==="restart"?r.push('<w:vMerge w:val="restart"/>'):r.push("<w:vMerge/>"));let a=rn(e.borders,"tcBorders");a&&r.push(a);let s=an(e.shading);s&&r.push(s),e.noWrap&&r.push("<w:noWrap/>");let c=on(e.margins,"tcMar");c&&r.push(c),e.textDirection&&r.push(`<w:textDirection w:val="${e.textDirection}"/>`),e.fitText&&r.push("<w:tcFitText/>"),e.verticalAlign&&r.push(`<w:vAlign w:val="${e.verticalAlign}"/>`),e.hideMark&&r.push("<w:hideMark/>");}return n&&(n.type==="tableCellInsertion"?r.push(`<w:cellIns ${ae(n.info)}/>`):n.type==="tableCellDeletion"?r.push(`<w:cellDel ${ae(n.info)}/>`):n.type==="tableCellMerge"&&r.push(`<w:cellMerge ${ae(n.info)}/>`)),t&&t.length>0&&r.push(...t.map(o=>li(o))),r.length===0?"":`<w:tcPr>${r.join("")}</w:tcPr>`}function si(e){return !e.startsWith("<w:tcPr>")||!e.endsWith("</w:tcPr>")?"":e.slice(8,-9)}function li(e){let t=ae(e.info,e.info.rsid),n=cn(e.previousFormatting)||"<w:tcPr/>",r=si(n),o=r.length>0?`<w:tcPr>${r}</w:tcPr>`:"<w:tcPr/>";return `<w:tcPrChange ${t}>${o}</w:tcPrChange>`}function ci(e){return !e||e.length===0?"":`<w:tblGrid>${e.map(n=>`<w:gridCol w:w="${n}"/>`).join("")}</w:tblGrid>`}function ui(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(oe(n)):n.type==="table"&&t.push(Te(n));return t.length===0&&t.push("<w:p/>"),t.join("")}function fi(e){let t=[],n=cn(e.formatting,e.propertyChanges,e.structuralChange);return n&&t.push(n),t.push(ui(e.content)),`<w:tc>${t.join("")}</w:tc>`}function pi(e){let t=[],n=ln(e.formatting,e.propertyChanges,e.structuralChange);n&&t.push(n);for(let r of e.cells)t.push(fi(r));return `<w:tr>${t.join("")}</w:tr>`}function Te(e){let t=[],n=sn(e.formatting,e.propertyChanges);n&&t.push(n);let r=ci(e.columnWidths);r&&t.push(r);for(let o of e.rows)t.push(pi(o));return `<w:tbl>${t.join("")}</w:tbl>`}var _={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"};function di(){let e={wpc:_.wpc,mc:_.mc,o:_.o,r:_.r,m:_.m,v:_.v,wp14:_.wp14,wp:_.wp,w10:_.w10,w:_.w,w14:_.w14,w15:_.w15,wpg:_.wpg,wps:_.wps};return Object.entries(e).map(([t,n])=>`xmlns:${t}="${n}"`).join(" ")}function Me(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${e.size}"`),e.space!==void 0&&n.push(`w:space="${e.space}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function mi(e){return `<w:headerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function gi(e){return `<w:footerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function hi(e){if(!e)return "";let t=[];return e.position&&t.push(`<w:pos w:val="${e.position}"/>`),e.numFmt&&t.push(`<w:numFmt w:val="${e.numFmt}"/>`),e.numStart!==void 0&&t.push(`<w:numStart w:val="${e.numStart}"/>`),e.numRestart&&t.push(`<w:numRestart w:val="${e.numRestart}"/>`),t.length===0?"":`<w:footnotePr>${t.join("")}</w:footnotePr>`}function wi(e){if(!e)return "";let t=[];return e.position&&t.push(`<w:pos w:val="${e.position}"/>`),e.numFmt&&t.push(`<w:numFmt w:val="${e.numFmt}"/>`),e.numStart!==void 0&&t.push(`<w:numStart w:val="${e.numStart}"/>`),e.numRestart&&t.push(`<w:numRestart w:val="${e.numRestart}"/>`),t.length===0?"":`<w:endnotePr>${t.join("")}</w:endnotePr>`}function xi(e){let t=[];return e.pageWidth!==void 0&&t.push(`w:w="${e.pageWidth}"`),e.pageHeight!==void 0&&t.push(`w:h="${e.pageHeight}"`),e.orientation==="landscape"&&t.push('w:orient="landscape"'),t.length===0?"":`<w:pgSz ${t.join(" ")}/>`}function yi(e){let t=[];return e.marginTop!==void 0&&t.push(`w:top="${e.marginTop}"`),e.marginRight!==void 0&&t.push(`w:right="${e.marginRight}"`),e.marginBottom!==void 0&&t.push(`w:bottom="${e.marginBottom}"`),e.marginLeft!==void 0&&t.push(`w:left="${e.marginLeft}"`),e.headerDistance!==void 0&&t.push(`w:header="${e.headerDistance}"`),e.footerDistance!==void 0&&t.push(`w:footer="${e.footerDistance}"`),e.gutter!==void 0&&t.push(`w:gutter="${e.gutter}"`),t.length===0?"":`<w:pgMar ${t.join(" ")}/>`}function bi(e){if(!e.columnCount&&!e.columns?.length)return "";let t=[];e.columnCount!==void 0&&e.columnCount>1&&t.push(`w:num="${e.columnCount}"`),e.columnSpace!==void 0&&t.push(`w:space="${e.columnSpace}"`),e.equalWidth!==void 0&&t.push(`w:equalWidth="${e.equalWidth?"1":"0"}"`),e.separator&&t.push('w:sep="1"');let n="";return e.columns&&e.columns.length>0&&(n=e.columns.map(o=>{let i=[];return o.width!==void 0&&i.push(`w:w="${o.width}"`),o.space!==void 0&&i.push(`w:space="${o.space}"`),`<w:col ${i.join(" ")}/>`}).join("")),t.length===0&&!n?"":`<w:cols${t.length>0?" "+t.join(" "):""}>${n}</w:cols>`}function Ti(e){if(!e.lineNumbers)return "";let t=e.lineNumbers,n=[];return t.countBy!==void 0&&n.push(`w:countBy="${t.countBy}"`),t.start!==void 0&&n.push(`w:start="${t.start}"`),t.distance!==void 0&&n.push(`w:distance="${t.distance}"`),t.restart&&n.push(`w:restart="${t.restart}"`),n.length===0?"":`<w:lnNumType ${n.join(" ")}/>`}function Ci(e){if(!e.pageBorders)return "";let t=e.pageBorders,n=[],r=[];if(t.display&&n.push(`w:display="${t.display}"`),t.offsetFrom&&n.push(`w:offsetFrom="${t.offsetFrom}"`),t.zOrder&&n.push(`w:zOrder="${t.zOrder}"`),t.top){let i=Me(t.top,"top");i&&r.push(i);}if(t.left){let i=Me(t.left,"left");i&&r.push(i);}if(t.bottom){let i=Me(t.bottom,"bottom");i&&r.push(i);}if(t.right){let i=Me(t.right,"right");i&&r.push(i);}return r.length===0?"":`<w:pgBorders${n.length>0?" "+n.join(" "):""}>${r.join("")}</w:pgBorders>`}function Pi(e){if(!e.docGrid)return "";let t=e.docGrid,n=[];return t.type&&n.push(`w:type="${t.type}"`),t.linePitch!==void 0&&n.push(`w:linePitch="${t.linePitch}"`),t.charSpace!==void 0&&n.push(`w:charSpace="${t.charSpace}"`),n.length===0?"":`<w:docGrid ${n.join(" ")}/>`}function un(e){if(!e)return "";let t=[];if(e.headerReferences)for(let p of e.headerReferences)t.push(mi(p));if(e.footerReferences)for(let p of e.footerReferences)t.push(gi(p));let n=hi(e.footnotePr);n&&t.push(n);let r=wi(e.endnotePr);r&&t.push(r),e.sectionStart&&t.push(`<w:type w:val="${e.sectionStart}"/>`);let o=xi(e);o&&t.push(o);let i=yi(e);if(i&&t.push(i),e.paperSrcFirst!==void 0||e.paperSrcOther!==void 0){let p=[];e.paperSrcFirst!==void 0&&p.push(`w:first="${e.paperSrcFirst}"`),e.paperSrcOther!==void 0&&p.push(`w:other="${e.paperSrcOther}"`),t.push(`<w:paperSrc ${p.join(" ")}/>`);}let a=Ci(e);a&&t.push(a);let s=Ti(e);s&&t.push(s);let c=bi(e);c&&t.push(c);let f=Pi(e);return f&&t.push(f),e.verticalAlign&&t.push(`<w:vAlign w:val="${e.verticalAlign}"/>`),e.bidi&&t.push("<w:bidi/>"),e.titlePg&&t.push("<w:titlePg/>"),e.evenAndOddHeaders&&t.push("<w:evenAndOddHeaders/>"),t.length===0?"":`<w:sectPr>${t.join("")}</w:sectPr>`}function fn(e){if(e.type==="paragraph")return oe(e);if(e.type==="table")return Te(e);if(e.type==="blockSdt"){let t=e.content.map(o=>fn(o)).join(""),n=e.properties,r=[];return n.alias&&r.push(`<w:alias w:val="${n.alias}"/>`),n.tag&&r.push(`<w:tag w:val="${n.tag}"/>`),`<w:sdt><w:sdtPr>${r.join("")}</w:sdtPr><w:sdtContent>${t}</w:sdtContent></w:sdt>`}return ""}function Fi(e){return e.map(t=>fn(t)).join("")}function pn(e){let t=[];return t.push(Fi(e.content)),e.finalSectionProperties&&t.push(un(e.finalSectionProperties)),t.join("")}function Ce(e){Zt();let t=[];t.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');let n=di();return t.push(`<w:document ${n} mc:Ignorable="w14 w15 wp14">`),t.push("<w:body>"),t.push(pn(e.package.document)),t.push("</w:body>"),t.push("</w:document>"),t.join("")}var Si={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"};function ki(){return Object.entries(Si).map(([e,t])=>`xmlns:${e}="${t}"`).join(" ")}function vi(e){return e.type==="paragraph"?oe(e):e.type==="table"?Te(e):""}function dn(e){let t=e.type==="header"?"w:hdr":"w:ftr",n=ki(),r=e.content.map(o=>vi(o)).join("");return r||(r="<w:p><w:pPr/></w:p>"),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
-
<${t} ${n}>${r}</${t}>`}function ut(){return Math.floor(Math.random()*4294967296).toString(16).toUpperCase().padStart(8,"0")}var Be='xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oel="http://schemas.microsoft.com/office/2019/extlst" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16du="http://schemas.microsoft.com/office/word/2023/wordml/word16du" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16sdtfl="http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"',$e='mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"';function wn(e){let t="<w:r>",n=[];e.formatting?.bold&&n.push("<w:b/>"),e.formatting?.italic&&n.push("<w:i/>"),n.length>0&&(t+=`<w:rPr>${n.join("")}</w:rPr>`);for(let r of e.content)if(r.type==="text"){let o=r.text!==r.text.trim()||r.text.includes(" ");t+=o?`<w:t xml:space="preserve">${R(r.text)}</w:t>`:`<w:t>${R(r.text)}</w:t>`;}else r.type==="break"&&(t+="<w:br/>");return t+="</w:r>",t}function mn(e,t){let n=t?`<w:p w14:paraId="${t}">`:"<w:p>";for(let r of e.content)r.type==="run"&&(n+=wn(r));return n+="</w:p>",n}function gn(e,t){let n=t?`<w:p w14:paraId="${t}">`:"<w:p>";n+='<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:annotationRef/></w:r>';for(let r of e.content)r.type==="run"&&(n+=wn(r));return n+="</w:p>",n}function hn(e,t){let n=ut(),r=[`w:id="${e.id}"`];if(e.author&&r.push(`w:author="${R(e.author)}"`),e.initials?r.push(`w:initials="${R(e.initials)}"`):r.push('w:initials=""'),e.date){let i=e.date.replace(/\.\d{3}Z$/,"Z");r.push(`w:date="${R(i)}"`);}let o=`<w:comment ${r.join(" ")}>`;if(e.content&&e.content.length>0)if(e.content.length===1)o+=gn(e.content[0],n);else {o+=gn(e.content[0]);for(let i=1;i<e.content.length-1;i++)o+=mn(e.content[i]);o+=mn(e.content[e.content.length-1],n);}else o+=`<w:p w14:paraId="${n}"><w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:annotationRef/></w:r></w:p>`;return o+="</w:comment>",t.push({commentId:e.id,lastParaId:n,durableId:ut(),parentId:e.parentId,done:e.done}),o}function De(e){if(!e||e.length===0)return {xml:"",paraInfos:[]};let t=[],n=[];for(let i of e)(i.parentId==null?t:n).push(i);let r=[],o=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:comments ${Be} ${$e}>`;for(let i of t)o+=hn(i,r);for(let i of n)o+=hn(i,r);return o+="</w:comments>",{xml:o,paraInfos:r}}function Ne(e){if(e.length===0)return "";let t=new Map;for(let r of e)t.set(r.commentId,r.lastParaId);let n=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w15:commentsEx ${Be} ${$e}>`;for(let r of e){let o=`w15:paraId="${r.lastParaId}" w15:done="${r.done?"1":"0"}"`;if(r.parentId!=null){let i=t.get(r.parentId);i&&(o+=` w15:paraIdParent="${i}"`);}n+=`<w15:commentEx ${o} />`;}return n+="</w15:commentsEx>",n}function He(e){if(e.length===0)return "";let t=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w16cid:commentsIds ${Be} ${$e}>`;for(let n of e)t+=`<w16cid:commentId w16cid:paraId="${n.lastParaId}" w16cid:durableId="${n.durableId}" />`;return t+="</w16cid:commentsIds>",t}function Le(e,t){if(e.length===0)return "";let n=new Map;for(let o of t)n.set(o.id,o);let r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w16cex:commentsExtensible ${Be} ${$e}>`;for(let o of e){let i=n.get(o.commentId);if(!i?.date)continue;let a=o.durableId,s=(i.date.endsWith("Z")?i.date:i.date+"Z").replace(/\.\d{3}Z$/,"Z");r+=`<w16cex:commentExtensible w16cex:durableId="${a}" w16cex:dateUtc="${s}"/>`;}return r+="</w16cex:commentsExtensible>",r}function U(e){return xmlJs.xml2js(e,{compact:false,ignoreComment:true,ignoreInstruction:true,ignoreDoctype:true,alwaysArray:false,trim:false,captureSpacesBetweenElements:true,attributesKey:"attributes",textKey:"text"})}function xn(e){return xmlJs.js2xml({elements:[e]},{compact:false,spaces:0})}function te(e){try{let t=U(e);return t.elements&&t.elements.length>0?t.elements.find(n=>n.type==="element")??null:t}catch(t){return console.warn("Failed to parse XML:",t),null}}function se(e){let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function Ei(e,t,n){if(!e.name)return false;let r=`${t}:${n}`;return e.name===r||se(e.name)===n}function u(e,t,n){if(!e||!e.elements)return null;let r=`${t}:${n}`;for(let o of e.elements)if(o.type==="element"&&(o.name===r||se(o.name||"")===n))return o;return null}function N(e,t,n){if(!e||!e.elements)return [];let r=`${t}:${n}`,o=[];for(let i of e.elements)i.type==="element"&&(i.name===r||se(i.name||"")===n)&&o.push(i);return o}function D(e,t){if(!e||!e.elements)return null;for(let n of e.elements)if(n.type==="element"&&n.name===t)return n;return null}function $(e){return !e||!e.elements?[]:e.elements.filter(t=>t.type==="element")}function l(e,t,n){if(!e||!e.attributes)return null;let r=e.attributes;if(t){let o=`${t}:${n}`;if(o in r)return r[o]}return n in r?r[n]:null}function ne(e){if(!e)return "";if("text"in e&&typeof e.text=="string")return e.text;if(!e.elements)return "";let t="";for(let n of e.elements)n.type==="text"&&"text"in n?t+=n.text??"":n.type==="element"&&(t+=ne(n));return t}function w(e,t,n,r=1){let o=l(e,t,n);if(o===null)return;let i=parseInt(o,10);if(!isNaN(i))return i*r}function k(e,t="w"){if(!e)return false;let n=l(e,t,"val");return n===null?true:!(n==="0"||n==="false"||n==="off")}function ft(e,t,n){if(!e)return null;if(Ei(e,t,n))return e;if(e.elements)for(let r of e.elements){if(r.type!=="element")continue;let o=ft(r,t,n);if(o)return o}return null}var O={image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",header:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",footer:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",commentsExtended:"http://schemas.microsoft.com/office/2011/relationships/commentsExtended",commentsIds:"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds",commentsExtensible:"http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible"};function Xe(e){let t=new Map;if(!e||e.trim().length===0)return t;let n=te(e);if(!n)return console.warn("Failed to parse relationships XML"),t;let r=$(n);for(let o of r){let i=o.name||"";if(!i.endsWith("Relationship")&&!i.includes(":Relationship"))continue;let a=l(o,null,"Id"),s=l(o,null,"Type"),c=l(o,null,"Target"),f=l(o,null,"TargetMode");if(!a||!s||!c){console.warn("Relationship missing required attributes:",{id:a,type:s,target:c});continue}let p={id:a,type:s,target:c};f==="External"?p.targetMode="External":f==="Internal"&&(p.targetMode="Internal"),t.set(a,p);}return t}function pt(e,t){return e.get(t)?.target}function Pe(e){let t=0;for(let n of e.matchAll(/Id="rId(\d+)"/g)){let r=parseInt(n[1],10);r>t&&(t=r);}return t}async function Ai(e,t,n){let r=e.package.document.comments;if(!r||r.length===0)return;let{xml:o,paraInfos:i}=De(r);t.file("word/comments.xml",o,{compression:"DEFLATE",compressionOptions:{level:n}});let a=Ne(i);a&&t.file("word/commentsExtended.xml",a,{compression:"DEFLATE",compressionOptions:{level:n}});let s=He(i);s&&t.file("word/commentsIds.xml",s,{compression:"DEFLATE",compressionOptions:{level:n}});let c=Le(i,r);c&&t.file("word/commentsExtensible.xml",c,{compression:"DEFLATE",compressionOptions:{level:n}}),await Vi(t,n);}function bn(e){let t=[];for(let n of e)if(n.type==="paragraph"){for(let r of n.content)if(r.type==="run")for(let o of r.content)o.type==="drawing"&&o.image.src?.startsWith("data:")&&t.push(o.image);}else if(n.type==="table")for(let r of n.rows)for(let o of r.cells)t.push(...bn(o.content));return t}var Mi={"image/png":"png","image/jpeg":"jpeg","image/gif":"gif","image/bmp":"bmp","image/tiff":"tiff","image/webp":"webp","image/svg+xml":"svg"};function Bi(e){let t=e.match(/^data:([^;]+);base64,(.+)$/);if(!t)throw new Error("Invalid data URL");let n=atob(t[2]),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return {data:r.buffer,extension:Mi[t[1]]||"png"}}var $i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>`;function Tn(e){return e.startsWith("/")?e.slice(1):`word/${e}`}function Di(e){let t=[{relsPath:"word/_rels/document.xml.rels",blocks:e.package.document.content}],n=e.package.relationships;if(!n)return t;let r=(o,i)=>{if(o)for(let[a,s]of o.entries()){let c=n.get(a);if(!c||c.type!==i||!c.target)continue;let p=Tn(c.target).replace(/^word\//,"");t.push({relsPath:`word/_rels/${p}.rels`,blocks:s.content});}};return r(e.package.headers,O.header),r(e.package.footers,O.footer),t}async function dt(e,t){let n=e.file(t);return (n?await n.async("text"):$i).replace(/<Relationships([^>]*)\/>/,"<Relationships$1></Relationships>")}async function Ni(e,t,n){if(t.size===0)return;let r=e.file("[Content_Types].xml");if(!r)return;let o=await r.async("text"),i=false;for(let a of t)if(!o.includes(`Extension="${a}"`)){let s=Ui(a);o=o.replace("</Types>",`<Default Extension="${a}" ContentType="${s}"/></Types>`),i=true;}i&&e.file("[Content_Types].xml",o,{compression:"DEFLATE",compressionOptions:{level:n}});}function Hi(e){let t=0;return e.forEach(n=>{let r=n.match(/^word\/media\/image(\d+)\./);if(r){let o=parseInt(r[1],10);o>t&&(t=o);}}),t}async function Li(e,t,n){let r=Hi(t),o=new Set;for(let{relsPath:i,blocks:a}of e){let s=bn(a);if(s.length===0)continue;let c=await dt(t,i),f=Pe(c),p=[];for(let g of s){let{data:b,extension:d}=Bi(g.src);r++,f++;let x=`image${r}.${d}`,C=`rId${f}`;t.file(`word/media/${x}`,b,{compression:"DEFLATE",compressionOptions:{level:n}}),p.push(`<Relationship Id="${C}" Type="${O.image}" Target="media/${x}"/>`),o.add(d),g.rId=C;}let m=c.replace("</Relationships>",p.join("")+"</Relationships>");t.file(i,m,{compression:"DEFLATE",compressionOptions:{level:n}});}await Ni(t,o,n);}function Cn(e){let t=[];for(let n of e)if(n.type==="paragraph")for(let r of n.content)r.type==="hyperlink"&&r.href&&!r.rId&&!r.anchor&&t.push(r);else if(n.type==="table")for(let r of n.rows)for(let o of r.cells)t.push(...Cn(o.content));return t}async function Xi(e,t,n){for(let{relsPath:r,blocks:o}of e){let i=Cn(o);if(i.length===0)continue;let a=await dt(t,r),s=Pe(a),c=[];for(let p of i){s++;let m=`rId${s}`;c.push(`<Relationship Id="${m}" Type="${O.hyperlink}" Target="${R(p.href)}" TargetMode="External"/>`),p.rId=m;}let f=a.replace("</Relationships>",c.join("")+"</Relationships>");t.file(r,f,{compression:"DEFLATE",compressionOptions:{level:n}});}}async function ze(e,t={}){if(!e.originalBuffer)throw new Error("Cannot repack document: no original buffer for round-trip. Use createDocx() for new documents.");let{compressionLevel:n=6,updateModifiedDate:r=true,modifiedBy:o}=t,i=e,a=await Oe__default.default.loadAsync(e.originalBuffer),s=new Oe__default.default;for(let[m,g]of Object.entries(a.files)){if(g.dir){s.folder(m.replace(/\/$/,""));continue}let b=await g.async("arraybuffer");s.file(m,b,{compression:"DEFLATE",compressionOptions:{level:n}});}let c=Di(i);await Li(c,s,n),await Xi(c,s,n);let f=Ce(i);if(s.file("word/document.xml",f,{compression:"DEFLATE",compressionOptions:{level:n}}),Wi(i,s,n),await ji(i,s,n),await Ai(i,s,n),r){let m="docProps/core.xml",g=a.file(m);if(g){let b=await g.async("text"),d=bt(b,{updateModifiedDate:r,modifiedBy:o});s.file(m,d,{compression:"DEFLATE",compressionOptions:{level:n}});}}return await s.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:n}})}var Oi="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",zi="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",mt="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",gt="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",ht="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml",wt="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml";async function ji(e,t,n){let r=e.package.relationships;if(!r)return;let o=[];for(let[f,p]of r){if(!p.target)continue;let m=p.type===O.header?Oi:p.type===O.footer?zi:null;m&&o.push({rId:f,target:p.target.replace(/^(\/?word\/)/,""),contentType:m,relType:p.type});}if(o.length===0)return;let i=t.file("[Content_Types].xml");if(i){let f=await i.async("text"),p=false;for(let{target:m,contentType:g}of o){let b=`/word/${m}`;f.includes(`PartName="${b}"`)||(f=f.replace("</Types>",`<Override PartName="${b}" ContentType="${g}"/></Types>`),p=true);}p&&t.file("[Content_Types].xml",f,{compression:"DEFLATE",compressionOptions:{level:n}});}let a="word/_rels/document.xml.rels",s=await dt(t,a),c=false;for(let{rId:f,relType:p,target:m}of o)s.includes(`Id="${f}"`)||(s=s.replace("</Relationships>",`<Relationship Id="${f}" Type="${p}" Target="${m}"/></Relationships>`),c=true);c&&t.file(a,s,{compression:"DEFLATE",compressionOptions:{level:n}});}async function Vi(e,t){let n=[{partName:"/word/comments.xml",contentType:mt,target:"comments.xml",relType:O.comments},{partName:"/word/commentsExtended.xml",contentType:gt,target:"commentsExtended.xml",relType:O.commentsExtended},{partName:"/word/commentsIds.xml",contentType:ht,target:"commentsIds.xml",relType:O.commentsIds},{partName:"/word/commentsExtensible.xml",contentType:wt,target:"commentsExtensible.xml",relType:O.commentsExtensible}],r=e.file("[Content_Types].xml");if(r){let a=await r.async("text"),s=false;for(let{partName:c,contentType:f}of n)a.includes(c)||(a=a.replace("</Types>",`<Override PartName="${c}" ContentType="${f}"/></Types>`),s=true);s&&e.file("[Content_Types].xml",a,{compression:"DEFLATE",compressionOptions:{level:t}});}let o="word/_rels/document.xml.rels",i=e.file(o);if(i){let a=await i.async("text"),s=false;for(let{target:c,relType:f}of n)if(!a.includes(c)){let p=`rId${Pe(a)+1}`;a=a.replace("</Relationships>",`<Relationship Id="${p}" Type="${f}" Target="${c}"/></Relationships>`),s=true;}s&&e.file(o,a,{compression:"DEFLATE",compressionOptions:{level:t}});}}async function _i(e,t,n={}){let r=await Oe__default.default.loadAsync(e);return xt(r,t,n)}async function xt(e,t,n={}){let{compressionLevel:r=6}=n;for(let[o,i]of t)e.file(o,i,{compression:"DEFLATE",compressionOptions:{level:r}});return e.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:r}})}function yt(e){let t=new Map,n=e.package.relationships;if(!n)return t;let r=[{map:e.package.headers,type:O.header},{map:e.package.footers,type:O.footer}];for(let{map:o,type:i}of r)if(o)for(let[a,s]of o.entries()){let c=n.get(a);c&&c.type===i&&c.target&&t.set(Tn(c.target),dn(s));}return t}function Wi(e,t,n){let r={level:n};for(let[o,i]of yt(e))t.file(o,i,{compression:"DEFLATE",compressionOptions:r});}function bt(e,t){let n=e;if(t.updateModifiedDate){let r=new Date().toISOString();n.includes("<dcterms:modified")?n=n.replace(/<dcterms:modified[^>]*>[^<]*<\/dcterms:modified>/,`<dcterms:modified xsi:type="dcterms:W3CDTF">${r}</dcterms:modified>`):n=n.replace("</cp:coreProperties>",`<dcterms:modified xsi:type="dcterms:W3CDTF">${r}</dcterms:modified></cp:coreProperties>`);}return t.modifiedBy&&(n.includes("<cp:lastModifiedBy")?n=n.replace(/<cp:lastModifiedBy>[^<]*<\/cp:lastModifiedBy>/,`<cp:lastModifiedBy>${R(t.modifiedBy)}</cp:lastModifiedBy>`):n=n.replace("</cp:coreProperties>",`<cp:lastModifiedBy>${R(t.modifiedBy)}</cp:lastModifiedBy></cp:coreProperties>`)),n}function Ui(e,t){return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",wmf:"image/x-wmf",emf:"image/x-emf"}[e]||"application/octet-stream"}async function Gi(){let e=new Oe__default.default;e.file("[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
4
|
-
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
5
|
-
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
6
|
-
<Default Extension="xml" ContentType="application/xml"/>
|
|
7
|
-
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
|
|
8
|
-
<Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
|
|
9
|
-
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
|
|
10
|
-
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
|
|
11
|
-
</Types>`),e.file("_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
12
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
13
|
-
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
|
|
14
|
-
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
|
|
15
|
-
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
|
|
16
|
-
</Relationships>`),e.file("word/_rels/document.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
17
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
18
|
-
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
|
|
19
|
-
</Relationships>`),e.file("word/document.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
20
|
-
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
21
|
-
<w:body>
|
|
22
|
-
<w:p>
|
|
23
|
-
<w:r>
|
|
24
|
-
<w:t></w:t>
|
|
25
|
-
</w:r>
|
|
26
|
-
</w:p>
|
|
27
|
-
<w:sectPr>
|
|
28
|
-
<w:pgSz w:w="12240" w:h="15840"/>
|
|
29
|
-
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
|
|
30
|
-
</w:sectPr>
|
|
31
|
-
</w:body>
|
|
32
|
-
</w:document>`),e.file("word/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
33
|
-
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
|
|
34
|
-
<w:docDefaults>
|
|
35
|
-
<w:rPrDefault>
|
|
36
|
-
<w:rPr>
|
|
37
|
-
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
|
|
38
|
-
<w:sz w:val="22"/>
|
|
39
|
-
</w:rPr>
|
|
40
|
-
</w:rPrDefault>
|
|
41
|
-
<w:pPrDefault>
|
|
42
|
-
<w:pPr>
|
|
43
|
-
<w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
|
|
44
|
-
</w:pPr>
|
|
45
|
-
</w:pPrDefault>
|
|
46
|
-
</w:docDefaults>
|
|
47
|
-
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
|
|
48
|
-
<w:name w:val="Normal"/>
|
|
49
|
-
</w:style>
|
|
50
|
-
</w:styles>`);let t=new Date().toISOString();return e.file("docProps/core.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
51
|
-
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
52
|
-
<dc:creator>EigenPal DOCX Editor</dc:creator>
|
|
53
|
-
<dcterms:created xsi:type="dcterms:W3CDTF">${t}</dcterms:created>
|
|
54
|
-
<dcterms:modified xsi:type="dcterms:W3CDTF">${t}</dcterms:modified>
|
|
55
|
-
</cp:coreProperties>`),e.file("docProps/app.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
56
|
-
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
|
|
57
|
-
<Application>EigenPal DOCX Editor</Application>
|
|
58
|
-
<AppVersion>1.0.0</AppVersion>
|
|
59
|
-
</Properties>`),e.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}})}async function Tt(e){let t=await Gi(),n={...e,originalBuffer:t};return ze(n)}function Sn(e,t){let n=qi(t),r=new RegExp(`<w:p[\\s][^>]*w14:paraId="${n}"`,"g"),o=[],i;for(;(i=r.exec(e))!==null;)o.push(i.index);if(o.length===0||o.length>1)return null;let a=o[0],s=a,c=0;for(;s<e.length;){let f=e.indexOf("<",s);if(f===-1)break;if(e.startsWith("<w:p",f)){let p=e[f+4];if(p===">"||p===" "||p==="/"){let m=e.indexOf(">",f);if(m===-1)break;if(e[m-1]==="/"){if(c===0)return {start:a,end:m+1};s=m+1;}else c++,s=m+1;}else s=f+1;}else if(e.startsWith("</w:p>",f)){if(c--,c===0)return {start:a,end:f+6};s=f+6;}else s=f+1;}return null}function Zi(e,t){let n=Sn(e,t);return n?e.substring(n.start,n.end):null}function Pn(e){let t=0,n=/<w:p[\s>]/g,r;for(;(r=n.exec(e))!==null;){let o=r.index,i=e[o+4];(i===">"||i===" ")&&t++;}return t}function Fn(e){let t=new Map,n=/w14:paraId="([^"]+)"/g,r;for(;(r=n.exec(e))!==null;){let o=r[1];t.set(o,(t.get(o)||0)+1);}return t}function kn(e,t,n){if(n.size===0)return {safe:true};let r=Fn(e),o=Fn(t);for(let s of n){let c=r.get(s)||0;if(c===0)return {safe:false,reason:`paraId-not-found-in-original: ${s}`};if(c>1)return {safe:false,reason:`duplicate-paraId-in-original: ${s}`}}for(let s of n){let c=o.get(s)||0;if(c===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${s}`};if(c>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${s}`}}let i=Pn(e),a=Pn(t);return i!==a?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${a}`}:{safe:true}}function Ct(e,t,n){if(n.size===0)return e;if(!kn(e,t,n).safe)return null;let o=[];for(let a of n){let s=Sn(e,a);if(!s)return null;let c=Zi(t,a);if(!c)return null;o.push({start:s.start,end:s.end,newXml:c});}o.sort((a,s)=>s.start-a.start);let i=e;for(let{start:a,end:s,newXml:c}of o)i=i.substring(0,a)+c+i.substring(s);return i}function qi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vn(e){for(let t of e)if(t.type==="paragraph"){for(let n of t.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing"&&r.image?.src?.startsWith("data:")&&!r.image?.rId)return true}else if(n.type==="hyperlink"&&n.href&&!n.rId&&!n.anchor)return true}else if(t.type==="table"){for(let n of t.rows)for(let r of n.cells)if(vn(r.content))return true}return false}async function Pt(e,t,n){let{changedParaIds:r,structuralChange:o,hasUntrackedChanges:i}=n;if(o||i||!t)return null;let a=e.package.document.content;if(vn(a))return null;let s=e.package.document.comments,c=s&&s.length>0,f=yt(e);try{let m=await(await import('jszip')).default.loadAsync(t),g=new Map;if(r.size>0){let d=m.file("word/document.xml");if(!d)return null;let x=await d.async("text"),C=Ce(e),I=Ct(x,C,r);if(!I)return null;g.set("word/document.xml",I);}if(c){let{xml:d,paraInfos:x}=De(s);g.set("word/comments.xml",d);let C=Ne(x);C&&g.set("word/commentsExtended.xml",C);let I=He(x);I&&g.set("word/commentsIds.xml",I);let F=Le(x,s);F&&g.set("word/commentsExtensible.xml",F);let P=m.file("[Content_Types].xml");if(P){let S=g.get("[Content_Types].xml")??await P.async("text"),T=false,v=[["/word/comments.xml",mt],["/word/commentsExtended.xml",gt],["/word/commentsIds.xml",ht],["/word/commentsExtensible.xml",wt]];for(let[A,M]of v)S.includes(A)||(S=S.replace("</Types>",`<Override PartName="${A}" ContentType="${M}"/></Types>`),T=true);T&&g.set("[Content_Types].xml",S);}let h="word/_rels/document.xml.rels",y=m.file(h);if(y){let S=g.get(h)??await y.async("text"),T=false,v=[["comments.xml",O.comments],["commentsExtended.xml",O.commentsExtended],["commentsIds.xml",O.commentsIds],["commentsExtensible.xml",O.commentsExtensible]];for(let[A,M]of v)if(!S.includes(A)){let H=Pe(S);S=S.replace("</Relationships>",`<Relationship Id="rId${H+1}" Type="${M}" Target="${A}"/></Relationships>`),T=true;}T&&g.set(h,S);}}for(let[d,x]of f)g.set(d,x);let b=m.file("docProps/core.xml");if(b){let d=await b.async("text");g.set("docProps/core.xml",bt(d,{updateModifiedDate:true}));}return await xt(m,g)}catch{return null}}function ge(e){return En(e).variables}function En(e){let t=[],n={body:[],headers:[],footers:[],footnotes:[],endnotes:[],textBoxes:[]};if(e.package?.document){let o=An(e.package.document);o.forEach(i=>{t.push({name:i,location:"body"});}),n.body=Array.from(new Set(o)).sort();}if(e.package?.document?.sections&&e.package.document.sections.forEach((o,i)=>{o.properties.headerReferences&&o.properties.headerReferences.forEach(a=>{});}),e.package?.footnotes){let o=In(e.package.footnotes);o.forEach(i=>{t.push({name:i,location:"footnote"});}),n.footnotes=Array.from(new Set(o)).sort();}if(e.package?.endnotes){let o=In(e.package.endnotes);o.forEach(i=>{t.push({name:i,location:"endnote"});}),n.endnotes=Array.from(new Set(o)).sort();}e.templateVariables&&e.templateVariables.forEach(o=>{t.some(i=>i.name===o)||t.push({name:o,location:"body"});});let r=new Set;return t.forEach(o=>r.add(o.name)),{variables:Array.from(r).sort(),totalOccurrences:t.length,byLocation:n,occurrences:t}}function An(e){let t=[];if(e.content&&t.push(...Rn(e.content)),e.sections)for(let n of e.sections)n.content&&t.push(...Rn(n.content));return t}function Rn(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(...je(n)):n.type==="table"&&t.push(...Mn(n));return t}function je(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="run"?t.push(...Fe(n)):n.type==="hyperlink"?t.push(...Yi(n)):n.type==="simpleField"?t.push(...Ji(n)):n.type==="complexField"&&t.push(...Ki(n));return t}function Fe(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="text"&&n.text&&t.push(...Ft(n.text));return t}function Yi(e){let t=[];if(!e.children)return t;for(let n of e.children)n.type==="run"&&t.push(...Fe(n));return t}function Ji(e){let t=[];if(e.instruction&&t.push(...Ft(e.instruction)),e.content)for(let n of e.content)n.type==="run"&&t.push(...Fe(n));return t}function Ki(e){let t=[];if(e.fieldCode)for(let n of e.fieldCode)n.type==="run"&&t.push(...Fe(n));if(e.fieldResult)for(let n of e.fieldResult)n.type==="run"&&t.push(...Fe(n));return t}function Mn(e){let t=[];if(!e.rows)return t;for(let n of e.rows)if(n.cells)for(let r of n.cells)t.push(...Qi(r));return t}function Qi(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="paragraph"?t.push(...je(n)):n.type==="table"&&t.push(...Mn(n));return t}function In(e){let t=[];for(let n of e)if(n.content)for(let r of n.content)r.type==="paragraph"&&t.push(...je(r));return t}var Bn=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g,$n=/\{(.+?)\}/g;function Ft(e){if(!e)return [];let t=[],n=new RegExp(Bn),r;for(;(r=n.exec(e))!==null;)t.push(r[1]);return t}function ea(e){return Bn.test(e)}function ta(e){return !(!e||typeof e!="string"||e.length===0||e.length>100||!/^[a-zA-Z_]/.test(e)||!/^[a-zA-Z_][a-zA-Z0-9_\-\.]*$/.test(e))}function na(e){if(!e)return "";let t=e.replace(/\s+/g,"_");return t=t.replace(/[^a-zA-Z0-9_\-\.]/g,""),t&&!/^[a-zA-Z_]/.test(t)&&(t="_"+t),t.substring(0,100)}function ra(e){return `{${e}}`}function oa(e){let t=e.match(/^\{(.+?)\}$/);return t?t[1]:null}function ia(e,t){return e&&e.replace($n,(n,r)=>{let o=r.trim();return o in t?t[o]:n})}function aa(e,t=""){return e&&e.replace($n,t)}function sa(e){return ge(e).length>0}async function Dn(e){let t=await Oe__default.default.loadAsync(e),n={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:t,originalBuffer:e};for(let[r,o]of Object.entries(t.files)){if(o.dir)continue;let i=r.toLowerCase();if(i.endsWith(".xml")||i.endsWith(".rels")){let a=await o.async("text");if(n.allXml.set(r,a),i==="word/document.xml")n.documentXml=a;else if(i==="word/styles.xml")n.stylesXml=a;else if(i==="word/theme/theme1.xml")n.themeXml=a;else if(i==="word/numbering.xml")n.numberingXml=a;else if(i==="word/fonttable.xml")n.fontTableXml=a;else if(i==="word/settings.xml")n.settingsXml=a;else if(i==="word/websettings.xml")n.webSettingsXml=a;else if(i==="word/footnotes.xml")n.footnotesXml=a;else if(i==="word/endnotes.xml")n.endnotesXml=a;else if(i==="word/comments.xml")n.commentsXml=a;else if(i==="word/commentsextensible.xml")n.commentsExtensibleXml=a;else if(i==="word/commentsextended.xml")n.commentsExtendedXml=a;else if(i==="word/_rels/document.xml.rels")n.documentRels=a;else if(i==="_rels/.rels")n.packageRels=a;else if(i==="[content_types].xml")n.contentTypesXml=a;else if(i==="docprops/core.xml")n.corePropsXml=a;else if(i==="docprops/app.xml")n.appPropsXml=a;else if(i==="docprops/custom.xml")n.customPropsXml=a;else if(i.match(/^word\/header\d+\.xml$/)){let s=r.split("/").pop()||r;n.headers.set(s,a);}else if(i.match(/^word\/footer\d+\.xml$/)){let s=r.split("/").pop()||r;n.footers.set(s,a);}}else if(i.startsWith("word/media/")){let a=await o.async("arraybuffer");n.media.set(r,a);}else if(i.startsWith("word/fonts/")){let a=await o.async("arraybuffer");n.fonts.set(r,a);}}return n}function Nn(e){switch(e.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}var Xn={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},Ve={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},St={name:"Office Theme",colorScheme:Xn,fontScheme:Ve},ca=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function ua(e){if(!e)return null;switch(se(e.name||"")){case "srgbClr":return l(e,"a","val")??l(e,null,"val")??null;case "sysClr":{let n=l(e,"a","lastClr")??l(e,null,"lastClr");if(n)return n;switch(l(e,"a","val")??l(e,null,"val")){case "windowText":case "menuText":case "captionText":case "btnText":return "000000";case "window":case "menu":case "btnFace":case "btnHighlight":return "FFFFFF";case "highlight":return "0078D7";case "highlightText":return "FFFFFF";case "grayText":return "808080";default:return null}}case "schemeClr":{return null}default:return null}}function fa(e){let t={...Xn};if(!e)return t;for(let n of ca){let r=u(e,"a",n);if(r){let o=$(r);if(o.length>0){let i=ua(o[0]);i&&(t[n]=i);}}}return t}function Hn(e){let t={latin:"",ea:"",cs:"",fonts:{}};if(!e)return t;let n=u(e,"a","latin");n&&(t.latin=l(n,"a","typeface")??l(n,null,"typeface")??"");let r=u(e,"a","ea");r&&(t.ea=l(r,"a","typeface")??l(r,null,"typeface")??"");let o=u(e,"a","cs");o&&(t.cs=l(o,"a","typeface")??l(o,null,"typeface")??"");let i=N(e,"a","font");for(let a of i){let s=l(a,"a","script")??l(a,null,"script"),c=l(a,"a","typeface")??l(a,null,"typeface");s&&c&&(t.fonts=t.fonts||{},t.fonts[s]=c);}return t}function pa(e){let t={...Ve};if(!e)return t;let n=u(e,"a","majorFont");n&&(t.majorFont=Hn(n));let r=u(e,"a","minorFont");return r&&(t.minorFont=Hn(r)),t}function On(e){if(!e)return {...St};try{let t=te(e);if(!t)return {...St};let n=l(t,"a","name")??l(t,null,"name")??"Office Theme",r=u(t,"a","themeElements"),o=u(r,"a","clrScheme"),i=fa(o),a=u(r,"a","fontScheme"),s=pa(a);return {name:n,colorScheme:i,fontScheme:s}}catch(t){return console.warn("Failed to parse theme:",t),{...St}}}function da(e,t="latin"){if(!e?.fontScheme?.majorFont)return Ve.majorFont?.latin??"Calibri Light";let n=e.fontScheme.majorFont;return t==="latin"?n.latin||"Calibri Light":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri Light"}function Ln(e,t="latin"){if(!e?.fontScheme?.minorFont)return Ve.minorFont?.latin??"Calibri";let n=e.fontScheme.minorFont;return t==="latin"?n.latin||"Calibri":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri"}function Q(e,t){if(!t)return "Calibri";let n=t.toLowerCase().includes("major"),r=t.toLowerCase().includes("minor"),o="latin",i=t.toLowerCase();return i.includes("eastasia")?o="ea":(i.includes("bidi")||i.includes("cs"))&&(o="cs"),n?da(e,o):r?Ln(e,o):Ln(e,"latin")}function zn(e,t){let n=e?{...e}:{},r=t,o=[["ascii","asciiTheme"],["hAnsi","hAnsiTheme"],["eastAsia","eastAsiaTheme"],["cs","csTheme"]],i=new Set;for(let[a,s]of o)i.add(a),i.add(s),(r[a]!==void 0||r[s]!==void 0)&&(delete n[a],delete n[s],r[a]!==void 0&&(n[a]=r[a]),r[s]!==void 0&&(n[s]=r[s]));for(let a of Object.keys(r))!i.has(a)&&r[a]!==void 0&&(n[a]=r[a]);return n}function kt(e,t){if(!t&&!e)return;if(!t)return e;if(!e)return {...t};let n={...e};for(let r of Object.keys(t)){let o=t[r];if(o!==void 0){if(r==="fontFamily"&&typeof o=="object"&&o!==null){n.fontFamily=zn(e.fontFamily,o);continue}if(r==="color"&&typeof o=="object"&&o!==null){let i=o,a=!!(i.rgb||i.themeColor||i.themeTint||i.themeShade);(!i.auto||a)&&(n.color=i);continue}if(typeof o=="object"&&o!==null&&!Array.isArray(o)){n[r]={...e[r]??{},...o};continue}n[r]=o;}}return n}function _e(e,t){if(!e)return;let n={},r=u(e,"w","b");r&&(n.bold=k(r));let o=u(e,"w","bCs");o&&(n.boldCs=k(o));let i=u(e,"w","i");i&&(n.italic=k(i));let a=u(e,"w","iCs");a&&(n.italicCs=k(a));let s=u(e,"w","u");if(s){let B=l(s,"w","val");if(B){n.underline={style:B};let E=l(s,"w","color"),z=l(s,"w","themeColor");(E||z)&&(n.underline.color=vt(E,z,l(s,"w","themeTint"),l(s,"w","themeShade")));}}let c=u(e,"w","strike");c&&(n.strike=k(c));let f=u(e,"w","dstrike");f&&(n.doubleStrike=k(f));let p=u(e,"w","vertAlign");if(p){let B=l(p,"w","val");(B==="superscript"||B==="subscript"||B==="baseline")&&(n.vertAlign=B);}let m=u(e,"w","smallCaps");m&&(n.smallCaps=k(m));let g=u(e,"w","caps");g&&(n.allCaps=k(g));let b=u(e,"w","vanish");b&&(n.hidden=k(b));let d=u(e,"w","color");d&&(n.color=vt(l(d,"w","val"),l(d,"w","themeColor"),l(d,"w","themeTint"),l(d,"w","themeShade")));let x=u(e,"w","highlight");if(x){let B=l(x,"w","val");B&&(n.highlight=B);}let C=u(e,"w","shd");C&&(n.shading=We(C));let I=u(e,"w","sz");if(I){let B=w(I,"w","val");B!==void 0&&(n.fontSize=B);}let F=u(e,"w","szCs");if(F){let B=w(F,"w","val");B!==void 0&&(n.fontSizeCs=B);}let P=u(e,"w","rFonts");if(P){n.fontFamily={ascii:l(P,"w","ascii")??void 0,hAnsi:l(P,"w","hAnsi")??void 0,eastAsia:l(P,"w","eastAsia")??void 0,cs:l(P,"w","cs")??void 0};let B=l(P,"w","asciiTheme");B&&(n.fontFamily.asciiTheme=B,t&&!n.fontFamily.ascii&&(n.fontFamily.ascii=Q(t,B)));let E=l(P,"w","hAnsiTheme");E&&(n.fontFamily.hAnsiTheme=E,t&&!n.fontFamily.hAnsi&&(n.fontFamily.hAnsi=Q(t,E)));let z=l(P,"w","eastAsiaTheme");z&&(n.fontFamily.eastAsiaTheme=z,t&&!n.fontFamily.eastAsia&&(n.fontFamily.eastAsia=Q(t,z)));let K=l(P,"w","cstheme");K&&(n.fontFamily.csTheme=K,t&&!n.fontFamily.cs&&(n.fontFamily.cs=Q(t,K)));}let h=u(e,"w","spacing");if(h){let B=w(h,"w","val");B!==void 0&&(n.spacing=B);}let y=u(e,"w","position");if(y){let B=w(y,"w","val");B!==void 0&&(n.position=B);}let S=u(e,"w","w");if(S){let B=w(S,"w","val");B!==void 0&&(n.scale=B);}let T=u(e,"w","kern");if(T){let B=w(T,"w","val");B!==void 0&&(n.kerning=B);}let v=u(e,"w","effect");if(v){let B=l(v,"w","val");B&&(n.effect=B);}let A=u(e,"w","em");if(A){let B=l(A,"w","val");B&&(n.emphasisMark=B);}let M=u(e,"w","emboss");M&&(n.emboss=k(M));let H=u(e,"w","imprint");H&&(n.imprint=k(H));let X=u(e,"w","outline");X&&(n.outline=k(X));let j=u(e,"w","shadow");j&&(n.shadow=k(j));let W=u(e,"w","rtl");W&&(n.rtl=k(W));let L=u(e,"w","cs");L&&(n.cs=k(L));let V=u(e,"w","rStyle");if(V){let B=l(V,"w","val");B&&(n.styleId=B);}return Object.keys(n).length>0?n:void 0}function vt(e,t,n,r){let o={};return e&&e!=="auto"?o.rgb=e:e==="auto"&&(o.auto=true),t&&(o.themeColor=t),n&&(o.themeTint=n),r&&(o.themeShade=r),o}function We(e){if(!e)return;let t={},n=l(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let r=l(e,"w","fill");r&&r!=="auto"&&(t.fill={rgb:r});let o=l(e,"w","themeFill");o&&(t.fill=t.fill||{},t.fill.themeColor=o);let i=l(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=l(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let s=l(e,"w","val");return s&&(t.pattern=s),Object.keys(t).length>0?t:void 0}function G(e){if(!e)return;let t=l(e,"w","val");if(!t)return;let n={style:t},r=l(e,"w","color"),o=l(e,"w","themeColor");(r||o)&&(n.color=vt(r,o,l(e,"w","themeTint"),l(e,"w","themeShade")));let i=w(e,"w","sz");i!==void 0&&(n.size=i);let a=w(e,"w","space");a!==void 0&&(n.space=a);let s=l(e,"w","shadow");s&&(n.shadow=s==="1"||s==="true");let c=l(e,"w","frame");return c&&(n.frame=c==="1"||c==="true"),n}function ma(e){if(!e)return;let t=N(e,"w","tab");if(t.length===0)return;let n=[];for(let r of t){let o=w(r,"w","pos"),i=l(r,"w","val");if(o!==void 0&&i){let a={position:o,alignment:i},s=l(r,"w","leader");s&&(a.leader=s),n.push(a);}}return n.length>0?n:void 0}function Rt(e,t){if(!e)return;let n={},r=u(e,"w","jc");if(r){let y=l(r,"w","val");y&&(n.alignment=y);}let o=u(e,"w","bidi");o&&(n.bidi=k(o));let i=u(e,"w","spacing");if(i){let y=w(i,"w","before");y!==void 0&&(n.spaceBefore=y);let S=w(i,"w","after");S!==void 0&&(n.spaceAfter=S);let T=w(i,"w","line");T!==void 0&&(n.lineSpacing=T);let v=l(i,"w","lineRule");v&&(n.lineSpacingRule=v);let A=l(i,"w","beforeAutospacing");A&&(n.beforeAutospacing=A==="1"||A==="true");let M=l(i,"w","afterAutospacing");M&&(n.afterAutospacing=M==="1"||M==="true");}let a=u(e,"w","ind");if(a){let y=w(a,"w","left");y!==void 0&&(n.indentLeft=y);let S=w(a,"w","right");S!==void 0&&(n.indentRight=S);let T=w(a,"w","firstLine");T!==void 0&&(n.indentFirstLine=T);let v=w(a,"w","hanging");v!==void 0&&(n.indentFirstLine=-v,n.hangingIndent=true);}let s=u(e,"w","pBdr");if(s){let y={},S=G(u(s,"w","top"));S&&(y.top=S);let T=G(u(s,"w","bottom"));T&&(y.bottom=T);let v=G(u(s,"w","left"));v&&(y.left=v);let A=G(u(s,"w","right"));A&&(y.right=A);let M=G(u(s,"w","between"));M&&(y.between=M);let H=G(u(s,"w","bar"));H&&(y.bar=H),Object.keys(y).length>0&&(n.borders=y);}let c=u(e,"w","shd");c&&(n.shading=We(c));let f=u(e,"w","tabs");f&&(n.tabs=ma(f));let p=u(e,"w","keepNext");p&&(n.keepNext=k(p));let m=u(e,"w","keepLines");m&&(n.keepLines=k(m));let g=u(e,"w","widowControl");g&&(n.widowControl=k(g));let b=u(e,"w","pageBreakBefore");b&&(n.pageBreakBefore=k(b));let d=u(e,"w","contextualSpacing");d&&(n.contextualSpacing=k(d));let x=u(e,"w","numPr");if(x){let y=u(x,"w","numId"),S=u(x,"w","ilvl");if(y||S){if(n.numPr={},y){let T=w(y,"w","val");T!==void 0&&(n.numPr.numId=T);}if(S){let T=w(S,"w","val");T!==void 0&&(n.numPr.ilvl=T);}}}let C=u(e,"w","outlineLvl");if(C){let y=w(C,"w","val");y!==void 0&&(n.outlineLevel=y);}let I=u(e,"w","pStyle");if(I){let y=l(I,"w","val");y&&(n.styleId=y);}let F=u(e,"w","suppressLineNumbers");F&&(n.suppressLineNumbers=k(F));let P=u(e,"w","suppressAutoHyphens");P&&(n.suppressAutoHyphens=k(P));let h=u(e,"w","rPr");return h&&(n.runProperties=_e(h,t)),Object.keys(n).length>0?n:void 0}function re(e){if(!e)return;let t=w(e,"w","w"),n=l(e,"w","type");if(t!==void 0&&n)return {value:t,type:n}}function Wn(e){if(!e)return;let t={},n=G(u(e,"w","top"));n&&(t.top=n);let r=G(u(e,"w","bottom"));r&&(t.bottom=r);let o=G(u(e,"w","left"));o&&(t.left=o);let i=G(u(e,"w","right"));i&&(t.right=i);let a=G(u(e,"w","insideH"));a&&(t.insideH=a);let s=G(u(e,"w","insideV"));return s&&(t.insideV=s),Object.keys(t).length>0?t:void 0}function Un(e){if(!e)return;let t={},n=re(u(e,"w","top"));n&&(t.top=n);let r=re(u(e,"w","bottom"));r&&(t.bottom=r);let o=re(u(e,"w","left"));o&&(t.left=o);let i=re(u(e,"w","right"));return i&&(t.right=i),Object.keys(t).length>0?t:void 0}function ga(e){if(!e)return;let t={},n=l(e,"w","val");if(n){let f=parseInt(n,16);isNaN(f)||(t.firstRow=(f&32)!==0,t.lastRow=(f&64)!==0,t.firstColumn=(f&128)!==0,t.lastColumn=(f&256)!==0,t.noHBand=(f&512)!==0,t.noVBand=(f&1024)!==0);}let r=l(e,"w","firstColumn");r&&(t.firstColumn=r==="1");let o=l(e,"w","firstRow");o&&(t.firstRow=o==="1");let i=l(e,"w","lastColumn");i&&(t.lastColumn=i==="1");let a=l(e,"w","lastRow");a&&(t.lastRow=a==="1");let s=l(e,"w","noHBand");s&&(t.noHBand=s==="1");let c=l(e,"w","noVBand");return c&&(t.noVBand=c==="1"),Object.keys(t).length>0?t:void 0}function jn(e,t){if(!e)return;let n={},r=u(e,"w","tblW");r&&(n.width=re(r));let o=u(e,"w","jc");if(o){let d=l(o,"w","val");(d==="left"||d==="center"||d==="right")&&(n.justification=d);}let i=u(e,"w","tblCellSpacing");i&&(n.cellSpacing=re(i));let a=u(e,"w","tblInd");a&&(n.indent=re(a));let s=u(e,"w","tblBorders");s&&(n.borders=Wn(s));let c=u(e,"w","tblCellMar");c&&(n.cellMargins=Un(c));let f=u(e,"w","tblLayout");if(f){let d=l(f,"w","type");(d==="fixed"||d==="autofit")&&(n.layout=d);}let p=u(e,"w","tblStyle");if(p){let d=l(p,"w","val");d&&(n.styleId=d);}let m=u(e,"w","tblLook");m&&(n.look=ga(m));let g=u(e,"w","shd");g&&(n.shading=We(g));let b=u(e,"w","bidiVisual");return b&&(n.bidi=k(b)),Object.keys(n).length>0?n:void 0}function Vn(e){if(!e)return;let t={},n=u(e,"w","trHeight");if(n){t.height=re(n);let s=l(n,"w","hRule");s&&(t.heightRule=s);}let r=u(e,"w","tblHeader");r&&(t.header=k(r));let o=u(e,"w","cantSplit");o&&(t.cantSplit=k(o));let i=u(e,"w","jc");if(i){let s=l(i,"w","val");(s==="left"||s==="center"||s==="right")&&(t.justification=s);}let a=u(e,"w","hidden");return a&&(t.hidden=k(a)),Object.keys(t).length>0?t:void 0}function _n(e,t){if(!e)return;let n={},r=u(e,"w","tcW");r&&(n.width=re(r));let o=u(e,"w","tcBorders");o&&(n.borders=Wn(o));let i=u(e,"w","tcMar");i&&(n.margins=Un(i));let a=u(e,"w","shd");a&&(n.shading=We(a));let s=u(e,"w","vAlign");if(s){let d=l(s,"w","val");(d==="top"||d==="center"||d==="bottom")&&(n.verticalAlign=d);}let c=u(e,"w","textDirection");if(c){let d=l(c,"w","val");d&&(n.textDirection=d);}let f=u(e,"w","gridSpan");if(f){let d=w(f,"w","val");d!==void 0&&(n.gridSpan=d);}let p=u(e,"w","vMerge");if(p){let d=l(p,"w","val");n.vMerge=d==="restart"?"restart":"continue";}let m=u(e,"w","tcFitText");m&&(n.fitText=k(m));let g=u(e,"w","noWrap");g&&(n.noWrap=k(g));let b=u(e,"w","hideMark");return b&&(n.hideMark=k(b)),Object.keys(n).length>0?n:void 0}function ha(e,t){let n={styleId:l(e,"w","styleId")??"",type:l(e,"w","type")??"paragraph"},r=l(e,"w","default");r&&(n.default=r==="1"||r==="true");let o=u(e,"w","name");o&&(n.name=l(o,"w","val")??void 0);let i=u(e,"w","basedOn");i&&(n.basedOn=l(i,"w","val")??void 0);let a=u(e,"w","next");a&&(n.next=l(a,"w","val")??void 0);let s=u(e,"w","link");s&&(n.link=l(s,"w","val")??void 0);let c=u(e,"w","uiPriority");if(c){let h=w(c,"w","val");h!==void 0&&(n.uiPriority=h);}let f=u(e,"w","hidden");f&&(n.hidden=k(f));let p=u(e,"w","semiHidden");p&&(n.semiHidden=k(p));let m=u(e,"w","unhideWhenUsed");m&&(n.unhideWhenUsed=k(m));let g=u(e,"w","qFormat");g&&(n.qFormat=k(g));let b=u(e,"w","personal");b&&(n.personal=k(b));let d=u(e,"w","pPr");d&&(n.pPr=Rt(d,t));let x=u(e,"w","rPr");x&&(n.rPr=_e(x,t));let C=u(e,"w","tblPr");C&&(n.tblPr=jn(C));let I=u(e,"w","trPr");I&&(n.trPr=Vn(I));let F=u(e,"w","tcPr");F&&(n.tcPr=_n(F));let P=N(e,"w","tblStylePr");if(P.length>0){n.tblStylePr=[];for(let h of P){let y=l(h,"w","type");if(y){let S={type:y},T=u(h,"w","pPr");T&&(S.pPr=Rt(T,t));let v=u(h,"w","rPr");v&&(S.rPr=_e(v,t));let A=u(h,"w","tblPr");A&&(S.tblPr=jn(A));let M=u(h,"w","trPr");M&&(S.trPr=Vn(M));let H=u(h,"w","tcPr");H&&(S.tcPr=_n(H)),n.tblStylePr.push(S);}}}return n}function wa(e,t){if(!e)return;let n={},r=u(e,"w","rPrDefault");if(r){let i=u(r,"w","rPr");i&&(n.rPr=_e(i,t));}let o=u(e,"w","pPrDefault");if(o){let i=u(o,"w","pPr");i&&(n.pPr=Rt(i,t));}return n.rPr||n.pPr?n:void 0}function xa(e,t){if(!t)return e;if(!e)return t?{...t}:void 0;let n={...e};for(let r of Object.keys(t)){let o=t[r];if(o!==void 0)if(r==="runProperties")n.runProperties=kt(n.runProperties,t.runProperties);else if(r==="borders"||r==="numPr"||r==="frame"){let i=n[r],a=o;n[r]={...i||{},...a||{}};}else r==="tabs"&&Array.isArray(o)?n.tabs=[...o]:n[r]=o;}return n}function Gn(e,t,n,r=new Set){if(r.has(e.styleId)||(r.add(e.styleId),!e.basedOn))return e;let o=t.get(e.basedOn);if(!o)return e;let i=Gn(o,t,n,r),a={...e,pPr:xa(i.pPr,e.pPr),rPr:kt(i.rPr,e.rPr)};return e.type==="table"&&((i.tblPr||e.tblPr)&&(a.tblPr={...i.tblPr||{},...e.tblPr||{}}),(i.trPr||e.trPr)&&(a.trPr={...i.trPr||{},...e.trPr||{}}),(i.tcPr||e.tcPr)&&(a.tcPr={...i.tcPr||{},...e.tcPr||{}})),a}function It(e,t){let n=new Map;try{let r=te(e);if(!r)return n;let o=N(r,"w","style");for(let i of o){let a=ha(i,t);a.styleId&&n.set(a.styleId,a);}for(let[i,a]of n){let s=Gn(a,n,t);n.set(i,s);}}catch(r){console.warn("Failed to parse styles:",r);}return n}function Zn(e,t){let n={styles:[]};try{let r=te(e);if(!r)return n;let o=u(r,"w","docDefaults");n.docDefaults=wa(o,t);let i=u(r,"w","latentStyles");i&&(n.latentStyles={defLockedState:l(i,"w","defLockedState")==="1",defUIPriority:w(i,"w","defUIPriority"),defSemiHidden:l(i,"w","defSemiHidden")==="1",defUnhideWhenUsed:l(i,"w","defUnhideWhenUsed")==="1",defQFormat:l(i,"w","defQFormat")==="1",count:w(i,"w","count")});let a=It(e,t);n.styles=Array.from(a.values());}catch(r){console.warn("Failed to parse style definitions:",r);}return n}function qn(e){let t={abstractNums:[],nums:[]};if(!e)return Et(t);let n=te(e);if(!n)return Et(t);let r=N(n,"w","abstractNum");for(let i of r){let a=ya(i);a&&t.abstractNums.push(a);}let o=N(n,"w","num");for(let i of o){let a=ba(i);a&&t.nums.push(a);}return Et(t)}function ya(e){let t=l(e,"w","abstractNumId");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n))return null;let r={abstractNumId:n,levels:[]},o=u(e,"w","multiLevelType");if(o){let f=l(o,"w","val");(f==="hybridMultilevel"||f==="multilevel"||f==="singleLevel")&&(r.multiLevelType=f);}let i=u(e,"w","name");i&&(r.name=l(i,"w","val")??void 0);let a=u(e,"w","numStyleLink");a&&(r.numStyleLink=l(a,"w","val")??void 0);let s=u(e,"w","styleLink");s&&(r.styleLink=l(s,"w","val")??void 0);let c=N(e,"w","lvl");for(let f of c){let p=Yn(f);p&&r.levels.push(p);}return r.levels.sort((f,p)=>f.ilvl-p.ilvl),r}function ba(e){let t=l(e,"w","numId");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n))return null;let r=u(e,"w","abstractNumId");if(!r)return null;let o=l(r,"w","val");if(o===null)return null;let i=parseInt(o,10);if(isNaN(i))return null;let a={numId:n,abstractNumId:i},s=N(e,"w","lvlOverride");if(s.length>0){a.levelOverrides=[];for(let c of s){let f=l(c,"w","ilvl");if(f===null)continue;let p=parseInt(f,10);if(isNaN(p))continue;let m={ilvl:p},g=u(c,"w","startOverride");if(g){let d=l(g,"w","val");if(d!==null){let x=parseInt(d,10);isNaN(x)||(m.startOverride=x);}}let b=u(c,"w","lvl");b&&(m.lvl=Yn(b)??void 0),a.levelOverrides.push(m);}}return a}function Yn(e){let t=l(e,"w","ilvl");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n)||n<0||n>8)return null;let r={ilvl:n,numFmt:"decimal",lvlText:""},o=u(e,"w","start");if(o){let d=l(o,"w","val");if(d!==null){let x=parseInt(d,10);isNaN(x)||(r.start=x);}}let i=u(e,"w","numFmt");if(i){let d=l(i,"w","val");d&&(r.numFmt=Ta(d));}let a=u(e,"w","lvlText");a&&(r.lvlText=l(a,"w","val")??"");let s=u(e,"w","lvlJc");if(s){let d=l(s,"w","val");(d==="left"||d==="center"||d==="right")&&(r.lvlJc=d);}let c=u(e,"w","suff");if(c){let d=l(c,"w","val");(d==="tab"||d==="space"||d==="nothing")&&(r.suffix=d);}let f=u(e,"w","isLgl");f&&(r.isLgl=k(f));let p=u(e,"w","lvlRestart");if(p){let d=l(p,"w","val");if(d!==null){let x=parseInt(d,10);isNaN(x)||(r.lvlRestart=x);}}let m=u(e,"w","legacy");m&&(r.legacy={legacy:k(m),legacySpace:w(m,"w","legacySpace"),legacyIndent:w(m,"w","legacyIndent")});let g=u(e,"w","pPr");g&&(r.pPr=Ca(g));let b=u(e,"w","rPr");return b&&(r.rPr=Sa(b)),r}function Ta(e){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[e]??"decimal"}function Ca(e){let t={},n=u(e,"w","ind");if(n){let o=w(n,"w","left"),i=w(n,"w","right"),a=w(n,"w","start"),s=w(n,"w","end"),c=w(n,"w","firstLine"),f=w(n,"w","hanging"),p=o??a,m=i??s;p!==void 0&&(t.indentLeft=p),m!==void 0&&(t.indentRight=m),f!==void 0?(t.indentFirstLine=-f,t.hangingIndent=true):c!==void 0&&(t.indentFirstLine=c);}let r=u(e,"w","tabs");if(r){t.tabs=[];let o=N(r,"w","tab");for(let i of o){let a=w(i,"w","pos"),s=l(i,"w","val"),c=l(i,"w","leader");a!==void 0&&s&&t.tabs.push({position:a,alignment:Pa(s),leader:Fa(c)});}}return t}function Pa(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function Fa(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function Sa(e){let t={},n=u(e,"w","rFonts");n&&(t.fontFamily={ascii:l(n,"w","ascii")??void 0,hAnsi:l(n,"w","hAnsi")??void 0,eastAsia:l(n,"w","eastAsia")??void 0,cs:l(n,"w","cs")??void 0});let r=u(e,"w","sz");if(r){let c=w(r,"w","val");c!==void 0&&(t.fontSize=c);}let o=u(e,"w","color");if(o){let c=l(o,"w","val"),f=l(o,"w","themeColor");c==="auto"?t.color={auto:true}:f?t.color={themeColor:f,themeTint:l(o,"w","themeTint")??void 0,themeShade:l(o,"w","themeShade")??void 0}:c&&(t.color={rgb:c});}let i=u(e,"w","b");i&&(t.bold=k(i));let a=u(e,"w","i");a&&(t.italic=k(a));let s=u(e,"w","vanish");return s&&(t.hidden=k(s)),t}function Et(e){let t=new Map;for(let r of e.abstractNums)t.set(r.abstractNumId,r);let n=new Map;for(let r of e.nums)n.set(r.numId,r);return {definitions:e,getLevel(r,o){let i=n.get(r);if(!i)return null;if(i.levelOverrides){let s=i.levelOverrides.find(c=>c.ilvl===o);if(s){if(s.lvl)return s.lvl;let c=t.get(i.abstractNumId);if(c){let f=c.levels.find(p=>p.ilvl===o);if(f&&s.startOverride!==void 0)return {...f,start:s.startOverride}}}}let a=t.get(i.abstractNumId);if(!a)return null;if(a.numStyleLink&&a.levels.length===0){for(let s of t.values())if(s.styleLink===a.numStyleLink&&s.levels.length>0){a=s;break}}return a.levels.find(s=>s.ilvl===o)??null},getAbstract(r){return t.get(r)??null},getInstance(r){return n.get(r)??null},hasNumbering(r){return n.has(r)}}}var ka={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",tx1:"text1",tx2:"text2",bg1:"background1",bg2:"background2",hlink:"hlink",folHlink:"folHlink"},Jn={black:"000000",white:"FFFFFF",red:"FF0000",green:"00FF00",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF"};function Kn(e,t){let n=$(t),r=n.find(i=>i.name==="a:shade");if(r){let i=l(r,null,"val");i&&(e.themeShade=Math.round(parseInt(i,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}let o=n.find(i=>i.name==="a:tint");if(o){let i=l(o,null,"val");i&&(e.themeTint=Math.round(parseInt(i,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}return e}function Qn(e){if(!e)return;let t=$(e),n=t.find(a=>a.name==="a:srgbClr");if(n){let a=l(n,null,"val");if(a)return Kn({rgb:a},n)}let r=t.find(a=>a.name==="a:schemeClr");if(r){let a=l(r,null,"val");if(a){let s={themeColor:ka[a]??"dk1"};return Kn(s,r)}}let o=t.find(a=>a.name==="a:sysClr");if(o)return {rgb:l(o,null,"lastClr")??"000000"};let i=t.find(a=>a.name==="a:prstClr");if(i){let a=l(i,null,"val");if(a&&Jn[a])return {rgb:Jn[a]}}}function er(e){if(!e)return;let t=$(e);if(t.find(r=>r.name==="a:noFill"))return {type:"none"};let n=t.find(r=>r.name==="a:solidFill");if(n)return {type:"solid",color:Qn(n)};if(t.find(r=>r.name==="a:gradFill"))return {type:"gradient"}}function tr(e){let t=e?D(e,"a:ln"):null;if(!t)return;let n=$(t);if(n.find(s=>s.name==="a:noFill"))return;let r={},o=l(t,null,"w");o&&(r.width=parseInt(o,10));let i=n.find(s=>s.name==="a:solidFill");i&&(r.color=Qn(i));let a=n.find(s=>s.name==="a:prstDash");if(a){let s=l(a,null,"val");s&&(r.style=s);}return r}function At(e){if(!e)return;let t=l(e,null,"relativeFrom")??"column",n=D(e,"wp:align");if(n){let o=ne(n);return {relativeTo:t,alignment:o}}let r=D(e,"wp:posOffset");if(r){let o=ne(r),i=parseInt(o,10);return {relativeTo:t,posOffset:isNaN(i)?0:i}}return {relativeTo:t}}function Mt(e){if(!e)return;let t=l(e,null,"relativeFrom")??"paragraph",n=D(e,"wp:align");if(n){let o=ne(n);return {relativeTo:t,alignment:o}}let r=D(e,"wp:posOffset");if(r){let o=ne(r),i=parseInt(o,10);return {relativeTo:t,posOffset:isNaN(i)?0:i}}return {relativeTo:t}}function nr(e){let t=D(e,"wp:positionH"),n=D(e,"wp:positionV");if(!(!t&&!n))return {horizontal:At(t)??{relativeTo:"column"},vertical:Mt(n)??{relativeTo:"paragraph"}}}var Bt=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function $t(e,t,n){if(!e){let g={type:t?"behind":"inFront"};return n?.distT!==void 0&&(g.distT=n.distT),n?.distB!==void 0&&(g.distB=n.distB),n?.distL!==void 0&&(g.distL=n.distL),n?.distR!==void 0&&(g.distR=n.distR),g}let o=(e.name||"").replace("wp:",""),i;switch(o){case "wrapNone":i=t?"behind":"inFront";break;case "wrapSquare":i="square";break;case "wrapTight":i="tight";break;case "wrapThrough":i="through";break;case "wrapTopAndBottom":i="topAndBottom";break;default:i="square";}let a={type:i},s=l(e,null,"wrapText");s&&(a.wrapText=s);let c=w(e,null,"distT")??n?.distT,f=w(e,null,"distB")??n?.distB,p=w(e,null,"distL")??n?.distL,m=w(e,null,"distR")??n?.distR;return c!==void 0&&(a.distT=c),f!==void 0&&(a.distB=f),p!==void 0&&(a.distL=p),m!==void 0&&(a.distR=m),a}function rr(e){let t=$(e),n=l(e,null,"behindDoc")==="1",r=t.find(i=>Bt.includes(i.name??"")),o={distT:w(e,null,"distT")??void 0,distB:w(e,null,"distB")??void 0,distL:w(e,null,"distL")??void 0,distR:w(e,null,"distR")??void 0};return $t(r??null,n,o)}function va(e){return e/1440*96}function Ra(e){return e/96*1440}function Ia(e){return e==null||isNaN(e)?0:Math.round(e*96/914400)}function Ea(e){return e/96*914400}function Aa(e){return e/914400*1440}function Ma(e){return e/1440*914400}function Ba(e){return e/72*96}function $a(e){return e/144*96}function Da(e,t=2){let n=Math.pow(10,t);return Math.round(e*n)/n}function Na(e){return `${Da(e)}px`}function Ha(e){if(!e)return {};let t={},n=w(e,null,"lIns"),r=w(e,null,"rIns"),o=w(e,null,"tIns"),i=w(e,null,"bIns");return (n!==void 0||r!==void 0||o!==void 0||i!==void 0)&&(t.margins={left:n,right:r,top:o,bottom:i}),t}function or(e,t,n,r,o,i,a,s){if(!e)return [];let c=[],f=$(e);for(let p of f){let m=p.name||"",g=m.indexOf(":"),b=g>=0?m.substring(g+1):m;if(b==="p"){let d=t(p,r,o,i,a);c.push(d);}}return c}function Ue(e){let n=$(e).find(s=>s.name==="wp:inline"||s.name==="wp:anchor");if(!n)return false;let r=D(n,"a:graphic");if(!r)return false;let o=D(r,"a:graphicData");if(!o)return false;let i=D(o,"wps:wsp");return i?D(i,"wps:txbx")!==null:false}function ir(e){let n=$(e).find(y=>y.name==="wp:inline"||y.name==="wp:anchor");if(!n)return null;let r=n.name==="wp:anchor",o=D(n,"a:graphic");if(!o)return null;let i=D(o,"a:graphicData");if(!i)return null;let a=D(i,"wps:wsp");if(!a||!D(a,"wps:txbx"))return null;let c=$(a),f=c.find(y=>y.name==="wps:spPr"),p=c.find(y=>y.name==="wps:bodyPr"),m=D(n,"wp:extent"),g=w(m,null,"cx")??0,b=w(m,null,"cy")??0,d={width:g,height:b},x=D(n,"wp:docPr"),C=x?l(x,null,"id")??void 0:void 0,I=er(f??null),F=tr(f??null),P=Ha(p??null),h={type:"textBox",size:d,content:[]};if(C&&(h.id=C),I&&(h.fill=I),F&&(h.outline=F),P.margins&&(h.margins=P.margins),r){let y=nr(n);y&&(h.position=y);let S=rr(n);S&&(h.wrap=S);}return h}function ar(e){let t=D(e,"wps:txbx");return t?D(t,"w:txbxContent"):null}function La(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Xa(e,t){let n=$(e);for(let r of n)if(t.includes(r.name||""))return r;return null}function sr(e){if(!e)return {width:0,height:0};let t=w(e,null,"cx")??0,n=w(e,null,"cy")??0;return {width:t,height:n}}function lr(e){if(!e)return;let t=w(e,null,"l")??0,n=w(e,null,"t")??0,r=w(e,null,"r")??0,o=w(e,null,"b")??0;if(!(t===0&&n===0&&r===0&&o===0))return {left:t,top:n,right:r,bottom:o}}function cr(e){if(!e)return {};let t=l(e,null,"id")??void 0,n=l(e,null,"name")??void 0,r=l(e,null,"descr")??void 0,o=l(e,null,"title")??void 0,i=l(e,null,"decorative")==="1",a=u(e,"a","hlinkClick"),s=a?l(a,"r","id")??void 0:void 0;return {id:t,name:n,alt:r,title:o,decorative:i||void 0,hlinkRId:s}}function ur(e){if(!e)return;let t=l(e,null,"rot"),n=l(e,null,"flipH")==="1",r=l(e,null,"flipV")==="1",o=La(t);if(o===void 0&&!n&&!r)return;let i={};return o!==void 0&&(i.rotation=o),n&&(i.flipH=true),r&&(i.flipV=true),i}function fr(e){let t=D(e,"a:graphic");if(!t)return null;let n=D(t,"a:graphicData");if(!n)return null;let r=D(n,"pic:pic");if(!r)return null;let o=D(r,"pic:blipFill");return o?D(o,"a:blip"):null}function pr(e){if(!e)return "";let t=l(e,"r","embed");if(t)return t;let n=l(e,null,"embed");if(n)return n;let r=l(e,"r","link");return r||""}function dr(e){let t=D(e,"a:graphic");if(!t)return null;let n=D(t,"a:graphicData");if(!n)return null;let r=D(n,"pic:pic");if(!r)return null;let o=D(r,"pic:spPr");return o?D(o,"a:xfrm"):null}function Oa(e){if(!e)return e;let t=e.replace(/^\/+/,"");return t.startsWith("media/")?t=`word/${t}`:t.startsWith("word/")||(t=`word/${t}`),t}function za(e){let t=e.split(".").pop()?.toLowerCase()??"";return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[t]??"application/octet-stream"}function mr(e,t,n){if(!e||!t)return {};let r=t.get(e);if(!r)return {};let o=r.target;if(!o)return {};let i=Oa(o),a=o.split("/").pop(),s=(c,f)=>{let p=f.toLowerCase();for(let[m,g]of c.entries())if(m.toLowerCase()===p)return g};if(n){let c=s(n,i);if(c)return {src:c.dataUrl||c.base64,mimeType:c.mimeType,filename:a};let f=o.replace(/^\/+/,""),p=s(n,f);if(p)return {src:p.dataUrl||p.base64,mimeType:p.mimeType,filename:a};let m=`word/${f}`,g=s(n,m);if(g)return {src:g.dataUrl||g.base64,mimeType:g.mimeType,filename:a}}return {mimeType:za(o),filename:a}}function ja(e,t,n){let r=D(e,"wp:extent"),o=sr(r),i=D(e,"wp:effectExtent"),a=lr(i),s=D(e,"wp:docPr"),c=cr(s),f=fr(e),p=pr(f),m=mr(p,t,n),g=dr(e),b=ur(g),d=w(e,null,"distT")??void 0,x=w(e,null,"distB")??void 0,C=w(e,null,"distL")??void 0,I=w(e,null,"distR")??void 0,F={type:"inline"};d!==void 0&&(F.distT=d),x!==void 0&&(F.distB=x),C!==void 0&&(F.distL=C),I!==void 0&&(F.distR=I);let P={type:"image",rId:p,size:o,wrap:F};if(c.id&&(P.id=c.id),c.alt&&(P.alt=c.alt),c.title&&(P.title=c.title),c.decorative&&(P.decorative=true),m.src&&(P.src=m.src),m.mimeType&&(P.mimeType=m.mimeType),m.filename&&(P.filename=m.filename),a&&(P.padding=a),b&&(P.transform=b),c.hlinkRId&&t){let h=pt(t,c.hlinkRId);h&&(P.hlinkHref=h);}return P}function Va(e,t,n){let r=D(e,"wp:extent"),o=sr(r),i=D(e,"wp:effectExtent"),a=lr(i),s=D(e,"wp:docPr"),c=cr(s),f=l(e,null,"behindDoc")==="1",p={distT:w(e,null,"distT")??void 0,distB:w(e,null,"distB")??void 0,distL:w(e,null,"distL")??void 0,distR:w(e,null,"distR")??void 0},m=Xa(e,Bt),g=$t(m,f,p),b=D(e,"wp:positionH"),d=D(e,"wp:positionV"),x=At(b),C=Mt(d),I;(x||C)&&(I={horizontal:x??{relativeTo:"column"},vertical:C??{relativeTo:"paragraph"}});let F=fr(e),P=pr(F),h=mr(P,t,n),y=dr(e),S=ur(y),T={type:"image",rId:P,size:o,wrap:g};if(c.id&&(T.id=c.id),c.alt&&(T.alt=c.alt),c.title&&(T.title=c.title),c.decorative&&(T.decorative=true),h.src&&(T.src=h.src),h.mimeType&&(T.mimeType=h.mimeType),h.filename&&(T.filename=h.filename),I&&(T.position=I),a&&(T.padding=a),S&&(T.transform=S),c.hlinkRId&&t){let v=pt(t,c.hlinkRId);v&&(T.hlinkHref=v);}return T}function _a(e,t,n){if(Ue(e))return null;let r=$(e);for(let o of r){let i=o.name||"";if(i==="wp:inline"||i==="wp:anchor")return i==="wp:inline"?ja(o,t,n):Va(o,t,n)}return null}function gr(e,t,n){return _a(e,t,n)}function hr(e,t,n,r){let o={};return e&&e!=="auto"?o.rgb=e:e==="auto"&&(o.auto=true),t&&(o.themeColor=t),n&&(o.themeTint=n),r&&(o.themeShade=r),o}function Wa(e){if(!e)return;let t={},n=l(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let r=l(e,"w","fill");r&&r!=="auto"&&(t.fill={rgb:r});let o=l(e,"w","themeFill");o&&(t.fill=t.fill||{},t.fill.themeColor=o);let i=l(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=l(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let s=l(e,"w","val");return s&&(t.pattern=s),Object.keys(t).length>0?t:void 0}function Ze(e,t,n){if(!e)return;let r={},o=u(e,"w","b");o&&(r.bold=k(o));let i=u(e,"w","bCs");i&&(r.boldCs=k(i));let a=u(e,"w","i");a&&(r.italic=k(a));let s=u(e,"w","iCs");s&&(r.italicCs=k(s));let c=u(e,"w","u");if(c){let E=l(c,"w","val");if(E){r.underline={style:E};let z=l(c,"w","color"),K=l(c,"w","themeColor");(z||K)&&(r.underline.color=hr(z,K,l(c,"w","themeTint"),l(c,"w","themeShade")));}}let f=u(e,"w","strike");f&&(r.strike=k(f));let p=u(e,"w","dstrike");p&&(r.doubleStrike=k(p));let m=u(e,"w","vertAlign");if(m){let E=l(m,"w","val");(E==="superscript"||E==="subscript"||E==="baseline")&&(r.vertAlign=E);}let g=u(e,"w","smallCaps");g&&(r.smallCaps=k(g));let b=u(e,"w","caps");b&&(r.allCaps=k(b));let d=u(e,"w","vanish");d&&(r.hidden=k(d));let x=u(e,"w","color");x&&(r.color=hr(l(x,"w","val"),l(x,"w","themeColor"),l(x,"w","themeTint"),l(x,"w","themeShade")));let C=u(e,"w","highlight");if(C){let E=l(C,"w","val");E&&(r.highlight=E);}let I=u(e,"w","shd");I&&(r.shading=Wa(I));let F=u(e,"w","sz");if(F){let E=w(F,"w","val");E!==void 0&&(r.fontSize=E);}let P=u(e,"w","szCs");if(P){let E=w(P,"w","val");E!==void 0&&(r.fontSizeCs=E);}let h=u(e,"w","rFonts");if(h){r.fontFamily={ascii:l(h,"w","ascii")??void 0,hAnsi:l(h,"w","hAnsi")??void 0,eastAsia:l(h,"w","eastAsia")??void 0,cs:l(h,"w","cs")??void 0};let E=l(h,"w","asciiTheme");E&&(r.fontFamily.asciiTheme=E,t&&!r.fontFamily.ascii&&(r.fontFamily.ascii=Q(t,E)));let z=l(h,"w","hAnsiTheme");z&&(r.fontFamily.hAnsiTheme=z,t&&!r.fontFamily.hAnsi&&(r.fontFamily.hAnsi=Q(t,z)));let K=l(h,"w","eastAsiaTheme");K&&(r.fontFamily.eastAsiaTheme=K,t&&!r.fontFamily.eastAsia&&(r.fontFamily.eastAsia=Q(t,K)));let it=l(h,"w","cstheme");it&&(r.fontFamily.csTheme=it,t&&!r.fontFamily.cs&&(r.fontFamily.cs=Q(t,it)));}let y=u(e,"w","spacing");if(y){let E=w(y,"w","val");E!==void 0&&(r.spacing=E);}let S=u(e,"w","position");if(S){let E=w(S,"w","val");E!==void 0&&(r.position=E);}let T=u(e,"w","w");if(T){let E=w(T,"w","val");E!==void 0&&(r.scale=E);}let v=u(e,"w","kern");if(v){let E=w(v,"w","val");E!==void 0&&(r.kerning=E);}let A=u(e,"w","effect");if(A){let E=l(A,"w","val");E&&(r.effect=E);}let M=u(e,"w","em");if(M){let E=l(M,"w","val");E&&(r.emphasisMark=E);}let H=u(e,"w","emboss");H&&(r.emboss=k(H));let X=u(e,"w","imprint");X&&(r.imprint=k(X));let j=u(e,"w","outline");j&&(r.outline=k(j));let W=u(e,"w","shadow");W&&(r.shadow=k(W));let L=u(e,"w","rtl");L&&(r.rtl=k(L));let V=u(e,"w","cs");V&&(r.cs=k(V));let B=u(e,"w","rStyle");if(B){let E=l(B,"w","val");E&&(r.styleId=E);}return Object.keys(r).length>0?r:void 0}function Ua(e){let t=l(e,"w","id"),n=t?parseInt(t,10):0,r=(l(e,"w","author")??"").trim(),o=(l(e,"w","date")??"").trim(),i=(l(e,"w","rsid")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:r.length>0?r:"Unknown",date:o.length>0?o:void 0,rsid:i.length>0?i:void 0}}function Ga(e,t,n,r){if(!e)return;let o=N(e,"w","rPrChange").map(i=>{let a=u(i,"w","rPr");return {type:"runPropertyChange",info:Ua(i),previousFormatting:Ze(a,t),currentFormatting:r}}).filter(i=>i.previousFormatting||i.currentFormatting);return o.length>0?o:void 0}function Za(e){let t=ne(e),n=l(e,"xml","space")==="preserve";return {type:"text",text:t,preserveSpace:n||void 0}}function qa(){return {type:"tab"}}function Ya(e){let t=l(e,"w","type"),n=l(e,"w","clear"),r={type:"break"};return (t==="page"||t==="column"||t==="textWrapping")&&(r.breakType=t),(n==="none"||n==="left"||n==="right"||n==="all")&&(r.clear=n),r}function Ja(e){let t=l(e,"w","font")??"",n=l(e,"w","char")??"";return {type:"symbol",font:t,char:n}}function Ka(e){return {type:"footnoteRef",id:w(e,"w","id")??0}}function Qa(e){return {type:"endnoteRef",id:w(e,"w","id")??0}}function es(e){let t=l(e,"w","fldCharType"),n=l(e,"w","fldLock")==="true"||l(e,"w","fldLock")==="1",r=l(e,"w","dirty")==="true"||l(e,"w","dirty")==="1",o="begin";return t==="separate"?o="separate":t==="end"&&(o="end"),{type:"fieldChar",charType:o,fldLock:n||void 0,dirty:r||void 0}}function ts(e){return {type:"instrText",text:ne(e)}}function wr(e,t,n){let r=gr(e,t??void 0,n??void 0);return r?{type:"drawing",image:r}:null}function Ge(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function ns(e,t,n){let r=[],o=$(e);for(let i of o)switch(Ge(i.name)){case "t":r.push(Za(i));break;case "tab":r.push(qa());break;case "br":r.push(Ya(i));break;case "sym":r.push(Ja(i));break;case "footnoteReference":r.push(Ka(i));break;case "endnoteReference":r.push(Qa(i));break;case "fldChar":r.push(es(i));break;case "instrText":r.push(ts(i));break;case "softHyphen":r.push({type:"softHyphen"});break;case "noBreakHyphen":r.push({type:"noBreakHyphen"});break;case "drawing":let s=wr(i,t,n);s&&r.push(s);break;case "pict":case "object":break;case "rPr":break;case "lastRenderedPageBreak":break;case "cr":r.push({type:"break",breakType:"textWrapping"});break;case "AlternateContent":{let f=$(i).find(p=>Ge(p.name)==="Choice")??$(i).find(p=>Ge(p.name)==="Fallback");if(f){for(let p of $(f))if(Ge(p.name)==="drawing"){let g=wr(p,t,n);g?.image?.src&&r.push(g);}}break}}return r}function Se(e,t,n,r=null,o=null){let i={type:"run",content:[]},a=u(e,"w","rPr");return a&&(i.formatting=Ze(a,n),i.propertyChanges=Ga(a,n,t,i.formatting)),i.content=ns(e,r,o),i}function rs(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function os(e){let t=w(e,"w","id")??0,n=l(e,"w","name")??"",r={type:"bookmarkStart",id:t,name:n},o=w(e,"w","colFirst");o!==void 0&&(r.colFirst=o);let i=w(e,"w","colLast");return i!==void 0&&(r.colLast=i),r}function is(e){return {type:"bookmarkEnd",id:w(e,"w","id")??0}}function xr(e,t,n=null,r=null,o=null){let i={type:"hyperlink",children:[]},a=l(e,"r","id");if(a&&(i.rId=a,t)){let b=t.get(a);b&&(i.href=b.target);}let s=l(e,"w","anchor");s&&(i.anchor=s,i.href||(i.href=`#${s}`));let c=l(e,"w","tooltip");c&&(i.tooltip=c);let f=l(e,"w","tgtFrame");f&&(i.target=f);let p=l(e,"w","history");(p==="1"||p==="true")&&(i.history=true);let m=l(e,"w","docLocation");m&&(i.docLocation=m);let g=$(e);for(let b of g)switch(rs(b.name)){case "r":i.children.push(Se(b,n,r,t,o));break;case "bookmarkStart":i.children.push(os(b));break;case "bookmarkEnd":i.children.push(is(b));break}return i}function yr(e){let t=w(e,"w","id")??0,n=l(e,"w","name")??"",r={type:"bookmarkStart",id:t,name:n},o=w(e,"w","colFirst");o!==void 0&&(r.colFirst=o);let i=w(e,"w","colLast");return i!==void 0&&(r.colLast=i),r}function br(e){return {type:"bookmarkEnd",id:w(e,"w","id")??0}}function as(e){if(!e)return;let t=w(e,"w","w")??0,n=l(e,"w","type")??"dxa",r="dxa";return (n==="auto"||n==="dxa"||n==="nil"||n==="pct")&&(r=n),{value:t,type:r}}function le(e){return as(e)}function we(e){let t=l(e,"w","id"),n=t?parseInt(t,10):0,r=(l(e,"w","author")??"").trim(),o=(l(e,"w","date")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:r.length>0?r:"Unknown",date:o.length>0?o:void 0}}function Dt(e){let t=we(e),n=(l(e,"w","rsid")??"").trim();return n.length>0?{...t,rsid:n}:t}function he(e){if(!e)return;let r={style:l(e,"w","val")??"none"},o=w(e,"w","sz");o!==void 0&&(r.size=o);let i=w(e,"w","space");i!==void 0&&(r.space=i);let a=l(e,"w","color"),s=l(e,"w","themeColor"),c=l(e,"w","themeTint"),f=l(e,"w","themeShade");(a||s||c||f)&&(r.color={rgb:a??void 0,themeColor:s,themeTint:c??void 0,themeShade:f??void 0});let p=l(e,"w","shadow");(p==="1"||p==="true")&&(r.shadow=true);let m=l(e,"w","frame");return (m==="1"||m==="true")&&(r.frame=true),r}function Tr(e){if(!e)return;let t={},n=he(u(e,"w","top"));n&&(t.top=n);let r=he(u(e,"w","bottom"));r&&(t.bottom=r);let o=he(u(e,"w","left")??u(e,"w","start"));o&&(t.left=o);let i=he(u(e,"w","right")??u(e,"w","end"));i&&(t.right=i);let a=he(u(e,"w","insideH"));a&&(t.insideH=a);let s=he(u(e,"w","insideV"));if(s&&(t.insideV=s),Object.keys(t).length!==0)return t}function Cr(e){if(!e)return;let t={},n=le(u(e,"w","top"));n&&(t.top=n);let r=le(u(e,"w","bottom"));r&&(t.bottom=r);let o=le(u(e,"w","left")??u(e,"w","start"));o&&(t.left=o);let i=le(u(e,"w","right")??u(e,"w","end"));if(i&&(t.right=i),Object.keys(t).length!==0)return t}function Pr(e){if(!e)return;let t={},n=l(e,"w","fill");n&&n!=="auto"&&(t.fill={rgb:n});let r=l(e,"w","themeFill");if(r){t.fill={themeColor:r};let a=l(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let s=l(e,"w","themeFillShade");s&&t.fill&&(t.fill.themeShade=s);}let o=l(e,"w","color");o&&o!=="auto"&&(t.color={rgb:o});let i=l(e,"w","val");if(i&&(t.pattern=i),Object.keys(t).length!==0)return t}function ss(e){if(!e)return;let t={},n=l(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let r=l(e,"w","lastRow");(r==="1"||r==="true")&&(t.lastRow=true);let o=l(e,"w","firstColumn");(o==="1"||o==="true")&&(t.firstColumn=true);let i=l(e,"w","lastColumn");(i==="1"||i==="true")&&(t.lastColumn=true);let a=l(e,"w","noHBand");(a==="1"||a==="true")&&(t.noHBand=true);let s=l(e,"w","noVBand");(s==="1"||s==="true")&&(t.noVBand=true);let c=l(e,"w","val");if(c){let f=parseInt(c,16);isNaN(f)||(f&32&&(t.firstRow=true),f&64&&(t.lastRow=true),f&128&&(t.firstColumn=true),f&256&&(t.lastColumn=true),f&512&&(t.noHBand=true),f&1024&&(t.noVBand=true));}if(Object.keys(t).length!==0)return t}function ls(e){if(!e)return;let t={},n=l(e,"w","horzAnchor");(n==="margin"||n==="page"||n==="text")&&(t.horzAnchor=n);let r=l(e,"w","vertAnchor");(r==="margin"||r==="page"||r==="text")&&(t.vertAnchor=r);let o=w(e,"w","tblpX");o!==void 0&&(t.tblpX=o);let i=l(e,"w","tblpXSpec");i&&(t.tblpXSpec=i);let a=w(e,"w","tblpY");a!==void 0&&(t.tblpY=a);let s=l(e,"w","tblpYSpec");s&&(t.tblpYSpec=s);let c=w(e,"w","topFromText");c!==void 0&&(t.topFromText=c);let f=w(e,"w","bottomFromText");f!==void 0&&(t.bottomFromText=f);let p=w(e,"w","leftFromText");p!==void 0&&(t.leftFromText=p);let m=w(e,"w","rightFromText");if(m!==void 0&&(t.rightFromText=m),Object.keys(t).length!==0)return t}function Fr(e){if(!e)return;let t={},n=le(u(e,"w","tblW"));n&&(t.width=n);let r=u(e,"w","jc");if(r){let x=l(r,"w","val");(x==="left"||x==="center"||x==="right"||x==="start")&&(t.justification=x==="start"?"left":x);}let o=le(u(e,"w","tblCellSpacing"));o&&(t.cellSpacing=o);let i=le(u(e,"w","tblInd"));i&&(t.indent=i);let a=Tr(u(e,"w","tblBorders"));a&&(t.borders=a);let s=Cr(u(e,"w","tblCellMar"));s&&(t.cellMargins=s);let c=u(e,"w","tblLayout");if(c){let x=l(c,"w","type");(x==="fixed"||x==="autofit")&&(t.layout=x);}let f=u(e,"w","tblStyle");if(f){let x=l(f,"w","val");x&&(t.styleId=x);}let p=ss(u(e,"w","tblLook"));p&&(t.look=p);let m=Pr(u(e,"w","shd"));m&&(t.shading=m);let g=u(e,"w","tblOverlap");if(g){let x=l(g,"w","val");(x==="never"||x==="overlap")&&(t.overlap=x);}let b=ls(u(e,"w","tblpPr"));if(b&&(t.floating=b),k(u(e,"w","bidiVisual"))&&(t.bidi=true),Object.keys(t).length!==0)return t}function cs(e,t){if(!e)return;let n=N(e,"w","tblPrChange").map(r=>{let o=u(r,"w","tblPr");return {type:"tablePropertyChange",info:Dt(r),previousFormatting:Fr(o),currentFormatting:t}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function us(e,t){if(!e)return;let n=N(e,"w","trPrChange").map(r=>{let o=u(r,"w","trPr");return {type:"tableRowPropertyChange",info:Dt(r),previousFormatting:Sr(o),currentFormatting:t}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function fs(e,t){if(!e)return;let n=N(e,"w","tcPrChange").map(r=>{let o=u(r,"w","tcPr");return {type:"tableCellPropertyChange",info:Dt(r),previousFormatting:vr(o),currentFormatting:t}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function ps(e){if(!e)return;let t=u(e,"w","ins");if(t)return {type:"tableRowInsertion",info:we(t)};let n=u(e,"w","del");if(n)return {type:"tableRowDeletion",info:we(n)}}function ds(e){if(!e)return;let t=u(e,"w","cellIns");if(t)return {type:"tableCellInsertion",info:we(t)};let n=u(e,"w","cellDel");if(n)return {type:"tableCellDeletion",info:we(n)};let r=u(e,"w","cellMerge");if(r)return {type:"tableCellMerge",info:we(r)}}function Sr(e){if(!e)return;let t={},n=u(e,"w","trHeight");if(n){let c=w(n,"w","val");c!==void 0&&c>0&&(t.height={value:c,type:"dxa"});let f=l(n,"w","hRule");(f==="auto"||f==="atLeast"||f==="exact")&&(t.heightRule=f);}k(u(e,"w","tblHeader"))&&(t.header=true),k(u(e,"w","cantSplit"))&&(t.cantSplit=true);let i=u(e,"w","jc");if(i){let c=l(i,"w","val");(c==="left"||c==="center"||c==="right")&&(t.justification=c);}k(u(e,"w","hidden"))&&(t.hidden=true);let s=kr(u(e,"w","cnfStyle"));if(s&&(t.conditionalFormat=s),Object.keys(t).length!==0)return t}function kr(e){if(!e)return;let t={},n=l(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let r=l(e,"w","lastRow");(r==="1"||r==="true")&&(t.lastRow=true);let o=l(e,"w","firstColumn");(o==="1"||o==="true")&&(t.firstColumn=true);let i=l(e,"w","lastColumn");(i==="1"||i==="true")&&(t.lastColumn=true);let a=l(e,"w","oddHBand");(a==="1"||a==="true")&&(t.oddHBand=true);let s=l(e,"w","evenHBand");(s==="1"||s==="true")&&(t.evenHBand=true);let c=l(e,"w","oddVBand");(c==="1"||c==="true")&&(t.oddVBand=true);let f=l(e,"w","evenVBand");(f==="1"||f==="true")&&(t.evenVBand=true);let p=l(e,"w","firstRowFirstColumn");(p==="1"||p==="true")&&(t.nwCell=true);let m=l(e,"w","firstRowLastColumn");(m==="1"||m==="true")&&(t.neCell=true);let g=l(e,"w","lastRowFirstColumn");(g==="1"||g==="true")&&(t.swCell=true);let b=l(e,"w","lastRowLastColumn");(b==="1"||b==="true")&&(t.seCell=true);let d=l(e,"w","val");if(d&&d.length===12&&(d[0]==="1"&&(t.firstRow=true),d[1]==="1"&&(t.lastRow=true),d[2]==="1"&&(t.firstColumn=true),d[3]==="1"&&(t.lastColumn=true),d[4]==="1"&&(t.oddVBand=true),d[5]==="1"&&(t.evenVBand=true),d[6]==="1"&&(t.oddHBand=true),d[7]==="1"&&(t.evenHBand=true),d[8]==="1"&&(t.nwCell=true),d[9]==="1"&&(t.neCell=true),d[10]==="1"&&(t.swCell=true),d[11]==="1"&&(t.seCell=true)),Object.keys(t).length!==0)return t}function vr(e){if(!e)return;let t={},n=le(u(e,"w","tcW"));n&&(t.width=n);let r=Tr(u(e,"w","tcBorders"));r&&(t.borders=r);let o=Cr(u(e,"w","tcMar"));o&&(t.margins=o);let i=Pr(u(e,"w","shd"));i&&(t.shading=i);let a=u(e,"w","vAlign");if(a){let d=l(a,"w","val");(d==="top"||d==="center"||d==="bottom")&&(t.verticalAlign=d);}let s=u(e,"w","textDirection");if(s){let d=l(s,"w","val");d&&(t.textDirection=d);}let c=u(e,"w","gridSpan");if(c){let d=w(c,"w","val");d!==void 0&&d>1&&(t.gridSpan=d);}let f=u(e,"w","vMerge");f&&(l(f,"w","val")==="restart"?t.vMerge="restart":t.vMerge="continue"),k(u(e,"w","tcFitText"))&&(t.fitText=true),k(u(e,"w","noWrap"))&&(t.noWrap=true),k(u(e,"w","hideMark"))&&(t.hideMark=true);let b=kr(u(e,"w","cnfStyle"));if(b&&(t.conditionalFormat=b),Object.keys(t).length!==0)return t}function ms(e,t,n,r,o,i,a){let s=[],c=e.elements||[];for(let f of c){if(!f.name)continue;let p=f.name.split(":").pop();if(p==="p"){let m=Z(f,t,n,r,o,i,a);s.push(m);}else if(p==="tbl"){let m=ue(f,t,n,r,o,i,a);s.push(m);}}return s.length===0&&s.push({type:"paragraph",content:[]}),s}function gs(e,t,n,r,o,i,a){let s={type:"tableCell",content:[]},c=u(e,"w","tcPr"),f=vr(c);return f&&(s.formatting=f),s.propertyChanges=fs(c,f),s.structuralChange=ds(c),s.content=ms(e,t,n,r,o,i,a),s}function hs(e,t,n,r,o,i,a){let s={type:"tableRow",cells:[]},c=u(e,"w","trPr"),f=Sr(c);f&&(s.formatting=f),s.propertyChanges=us(c,f),s.structuralChange=ps(c);let p=N(e,"w","tc");for(let m of p){let g=gs(m,t,n,r,o,i,a);s.cells.push(g);}return s}function ws(e){if(!e)return;let t=[],n=N(e,"w","gridCol");for(let r of n){let o=w(r,"w","w")??0;t.push(o);}if(!(t.length>0&&t.every(r=>r<=0)))return t.length>0?t:void 0}function xs(e){return e.cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function ys(e){let t=Math.max(e.columnWidths?.length??0,...e.rows.map(n=>xs(n)));if(!(t<=1))for(let n of e.rows){if(n.cells.length!==1)continue;let r=n.cells[0];(r.formatting?.gridSpan??1)>=t||r.formatting?.vMerge||r.formatting?.gridSpan==null&&(r.formatting={...r.formatting??{},gridSpan:t});}}function ue(e,t,n,r,o,i,a){let s={type:"table",rows:[]},c=u(e,"w","tblPr"),f=Fr(c);f&&(s.formatting=f),s.propertyChanges=cs(c,f);let p=ws(u(e,"w","tblGrid"));p&&(s.columnWidths=p);let m=N(e,"w","tr");for(let g of m){let b=hs(g,t,n,r,o,i,a);s.rows.push(b);}return ys(s),s}function Rr(e){switch(e){case "first":return "first";case "even":return "even";default:return "default"}}function Ir(e){let t=l(e,"w","type"),n=l(e,"r","id")??"";return {type:Rr(t),rId:n}}function Er(e){let t=l(e,"w","type"),n=l(e,"r","id")??"";return {type:Rr(t),rId:n}}function Nt(e,t,n,r,o,i){let a=[],s=e.elements??[],c={inHeaderFooter:true};for(let f of s){if(f.type!=="element")continue;let p=f.name??"";if(p==="w:p"||p.endsWith(":p"))a.push(Z(f,t,n,r,o,i,c));else if(p==="w:tbl"||p.endsWith(":tbl")){let m=ue(f,t,n,r,o,i,c);a.push(m);}else if(p==="w:sdt"||p.endsWith(":sdt")){let m=(f.elements??[]).find(g=>g.type==="element"&&(g.name==="w:sdtContent"||g.name?.endsWith(":sdtContent")));if(m){let g=Nt(m,t,n,r,o,i);a.push(...g);}}}return a}function Ar(e,t="default",n=null,r=null,o=null,i=null,a=null){let s={type:"header",hdrFtrType:t,content:[]};if(!e)return s;let c=U(e);if(!c)return s;let f=c.elements?.find(p=>p.type==="element"&&(p.name==="w:hdr"||p.name?.endsWith(":hdr")));return f&&(s.content=Nt(f,n,r,o,i,a)),s}function Mr(e,t="default",n=null,r=null,o=null,i=null,a=null){let s={type:"footer",hdrFtrType:t,content:[]};if(!e)return s;let c=U(e);if(!c)return s;let f=c.elements?.find(p=>p.type==="element"&&(p.name==="w:ftr"||p.name?.endsWith(":ftr")));return f&&(s.content=Nt(f,n,r,o,i,a)),s}function Br(e){switch(e){case "separator":return "separator";case "continuationSeparator":return "continuationSeparator";case "continuationNotice":return "continuationNotice";default:return "normal"}}function $r(e,t,n,r,o,i){let a=[];for(let s of $(e)){let c=s.name??"";c==="w:p"?a.push(Z(s,t,n,r,o)):c==="w:tbl"&&a.push(ue(s,t,n,r,o,i));}return a}function bs(e,t,n,r,o,i){let a=w(e,"w","id")??0,s=l(e,"w","type"),c=Br(s),f=$r(e,t,n,r,o,i);return {type:"footnote",id:a,noteType:c,content:f}}function Dr(e,t=null,n=null,r=null,o=null,i=null){let a=new Map,s=[];if(!e)return qe(a,s);let c=U(e);if(!c)return qe(a,s);let f=c.elements?.find(m=>m.type==="element"&&(m.name==="w:footnotes"||m.name?.endsWith(":footnotes")));if(!f)return qe(a,s);let p=N(f,"w","footnote");for(let m of p){let g=bs(m,t,n,r,o,i);a.set(g.id,g),s.push(g);}return qe(a,s)}function qe(e,t){return {byId:e,footnotes:t,getFootnote(n){return e.get(n)},hasFootnote(n){return e.has(n)},getNormalFootnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function Ts(e,t,n,r,o,i){let a=w(e,"w","id")??0,s=l(e,"w","type"),c=Br(s),f=$r(e,t,n,r,o,i);return {type:"endnote",id:a,noteType:c,content:f}}function Nr(e,t=null,n=null,r=null,o=null,i=null){let a=new Map,s=[];if(!e)return Ye(a,s);let c=U(e);if(!c)return Ye(a,s);let f=c.elements?.find(m=>m.type==="element"&&(m.name==="w:endnotes"||m.name?.endsWith(":endnotes")));if(!f)return Ye(a,s);let p=N(f,"w","endnote");for(let m of p){let g=Ts(m,t,n,r,o,i);a.set(g.id,g),s.push(g);}return Ye(a,s)}function Ye(e,t){return {byId:e,endnotes:t,getEndnote(n){return e.get(n)},hasEndnote(n){return e.has(n)},getNormalEndnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function Hr(e){return e?{decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",bullet:"bullet",chicago:"chicago",none:"none"}[e]:void 0}function Cs(e){switch(e){case "pageBottom":return "pageBottom";case "beneathText":return "beneathText";case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Ps(e){switch(e){case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Lr(e){switch(e){case "continuous":return "continuous";case "eachSect":return "eachSect";case "eachPage":return "eachPage";default:return}}function Xr(e){let t={};if(!e)return t;let n=u(e,"w","pos");if(n){let a=l(n,"w","val");t.position=Cs(a);}let r=u(e,"w","numFmt");if(r){let a=l(r,"w","val");t.numFmt=Hr(a);}let o=u(e,"w","numStart");o&&(t.numStart=w(o,"w","val")??void 0);let i=u(e,"w","numRestart");if(i){let a=l(i,"w","val");t.numRestart=Lr(a);}return t}function Or(e){let t={};if(!e)return t;let n=u(e,"w","pos");if(n){let a=l(n,"w","val");t.position=Ps(a);}let r=u(e,"w","numFmt");if(r){let a=l(r,"w","val");t.numFmt=Hr(a);}let o=u(e,"w","numStart");o&&(t.numStart=w(o,"w","val")??void 0);let i=u(e,"w","numRestart");if(i){let a=l(i,"w","val");t.numRestart=Lr(a);}return t}function Fs(e,t,n,r){if(!e&&!t)return;let o={};return e&&e!=="auto"?o.rgb=e:e==="auto"&&(o.auto=true),t&&(o.themeColor=t),n&&(o.themeTint=n),r&&(o.themeShade=r),Object.keys(o).length>0?o:void 0}function Je(e){if(!e)return;let r={style:l(e,"w","val")??"none"},o=w(e,"w","sz");o!==void 0&&(r.size=o);let i=w(e,"w","space");i!==void 0&&(r.space=i);let a=l(e,"w","color"),s=l(e,"w","themeColor"),c=l(e,"w","themeTint"),f=l(e,"w","themeShade"),p=Fs(a,s,c,f);p&&(r.color=p);let m=l(e,"w","shadow");(m==="1"||m==="true")&&(r.shadow=true);let g=l(e,"w","frame");return (g==="1"||g==="true")&&(r.frame=true),r}function Ss(e){switch(e){case "landscape":return "landscape";case "portrait":return "portrait";default:return}}function ks(e){switch(e){case "continuous":return "continuous";case "nextPage":return "nextPage";case "oddPage":return "oddPage";case "evenPage":return "evenPage";case "nextColumn":return "nextColumn";default:return}}function vs(e){switch(e){case "top":return "top";case "center":return "center";case "both":return "both";case "bottom":return "bottom";default:return}}function Rs(e){switch(e){case "continuous":return "continuous";case "newPage":return "newPage";case "newSection":return "newSection";default:return}}function Ke(e,t){let n={};if(!e)return n;let r=u(e,"w","pgSz");if(r){let h=w(r,"w","w");h!==void 0&&(n.pageWidth=h);let y=w(r,"w","h");y!==void 0&&(n.pageHeight=y);let S=l(r,"w","orient"),T=Ss(S);T&&(n.orientation=T);}let o=u(e,"w","pgMar");if(o){let h=w(o,"w","top");h!==void 0&&(n.marginTop=h);let y=w(o,"w","bottom");y!==void 0&&(n.marginBottom=y);let S=w(o,"w","left");S!==void 0&&(n.marginLeft=S);let T=w(o,"w","right");T!==void 0&&(n.marginRight=T);let v=w(o,"w","header");v!==void 0&&(n.headerDistance=v);let A=w(o,"w","footer");A!==void 0&&(n.footerDistance=A);let M=w(o,"w","gutter");M!==void 0&&(n.gutter=M);}let i=u(e,"w","cols");if(i){let h=w(i,"w","num");h!==void 0&&(n.columnCount=h);let y=w(i,"w","space");y!==void 0&&(n.columnSpace=y);let S=l(i,"w","equalWidth");S==="1"||S==="true"?n.equalWidth=true:(S==="0"||S==="false")&&(n.equalWidth=false);let T=l(i,"w","sep");(T==="1"||T==="true")&&(n.separator=true);let v=N(i,"w","col");if(v.length>0){n.columns=[];for(let A of v){let M={},H=w(A,"w","w");H!==void 0&&(M.width=H);let X=w(A,"w","space");X!==void 0&&(M.space=X),n.columns.push(M);}n.columnCount===void 0&&(n.columnCount=v.length);}}let a=u(e,"w","type");if(a){let h=l(a,"w","val"),y=ks(h);y&&(n.sectionStart=y);}let s=u(e,"w","vAlign");if(s){let h=l(s,"w","val"),y=vs(h);y&&(n.verticalAlign=y);}let c=u(e,"w","bidi");c&&(n.bidi=k(c));let f=N(e,"w","headerReference");f.length>0&&(n.headerReferences=f.map(h=>Ir(h)));let p=N(e,"w","footerReference");p.length>0&&(n.footerReferences=p.map(h=>Er(h)));let m=u(e,"w","titlePg");m&&(n.titlePg=k(m));let g=u(e,"w","evenAndOddHeaders");g&&(n.evenAndOddHeaders=k(g));let b=u(e,"w","lnNumType");if(b){n.lineNumbers={};let h=w(b,"w","start");h!==void 0&&(n.lineNumbers.start=h);let y=w(b,"w","countBy");y!==void 0&&(n.lineNumbers.countBy=y);let S=w(b,"w","distance");S!==void 0&&(n.lineNumbers.distance=S);let T=l(b,"w","restart"),v=Rs(T);v&&(n.lineNumbers.restart=v);}let d=u(e,"w","pgBorders");if(d){n.pageBorders={};let h=Je(u(d,"w","top"));h&&(n.pageBorders.top=h);let y=Je(u(d,"w","bottom"));y&&(n.pageBorders.bottom=y);let S=Je(u(d,"w","left"));S&&(n.pageBorders.left=S);let T=Je(u(d,"w","right"));T&&(n.pageBorders.right=T);let v=l(d,"w","display");(v==="allPages"||v==="firstPage"||v==="notFirstPage")&&(n.pageBorders.display=v);let A=l(d,"w","offsetFrom");(A==="page"||A==="text")&&(n.pageBorders.offsetFrom=A);let M=l(d,"w","zOrder");(M==="front"||M==="back")&&(n.pageBorders.zOrder=M);}let x=u(e,"w","background");if(x){n.background={};let h=l(x,"w","color");h&&h!=="auto"&&(n.background.color={rgb:h});let y=l(x,"w","themeColor");y&&(n.background.themeColor=y);let S=l(x,"w","themeTint");S&&(n.background.themeTint=S);let T=l(x,"w","themeShade");T&&(n.background.themeShade=T);}let C=u(e,"w","footnotePr");if(C){let h=Xr(C);Object.keys(h).length>0&&(n.footnotePr=h);}let I=u(e,"w","endnotePr");if(I){let h=Or(I);Object.keys(h).length>0&&(n.endnotePr=h);}let F=u(e,"w","docGrid");if(F){n.docGrid={};let h=l(F,"w","type");(h==="default"||h==="lines"||h==="linesAndChars"||h==="snapToChars")&&(n.docGrid.type=h);let y=w(F,"w","linePitch");y!==void 0&&(n.docGrid.linePitch=y);let S=w(F,"w","charSpace");S!==void 0&&(n.docGrid.charSpace=S);}let P=u(e,"w","paperSrc");if(P){let h=w(P,"w","first");h!==void 0&&(n.paperSrcFirst=h);let y=w(P,"w","other");y!==void 0&&(n.paperSrcOther=y);}return n}function zr(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function Is(e,t){return !e&&!t?true:!(!e||!t||e.bold!==t.bold||e.boldCs!==t.boldCs||e.italic!==t.italic||e.italicCs!==t.italicCs||e.strike!==t.strike||e.doubleStrike!==t.doubleStrike||e.smallCaps!==t.smallCaps||e.allCaps!==t.allCaps||e.hidden!==t.hidden||e.emboss!==t.emboss||e.imprint!==t.imprint||e.outline!==t.outline||e.shadow!==t.shadow||e.rtl!==t.rtl||e.cs!==t.cs||e.fontSize!==t.fontSize||e.fontSizeCs!==t.fontSizeCs||e.spacing!==t.spacing||e.position!==t.position||e.scale!==t.scale||e.kerning!==t.kerning||e.vertAlign!==t.vertAlign||e.highlight!==t.highlight||e.effect!==t.effect||e.emphasisMark!==t.emphasisMark||e.styleId!==t.styleId||!Es(e.underline,t.underline)||!Qe(e.color,t.color)||!As(e.shading,t.shading)||!Ms(e.fontFamily,t.fontFamily))}function Es(e,t){return !e&&!t?true:!e||!t||e.style!==t.style?false:Qe(e.color,t.color)}function Qe(e,t){return !e&&!t?true:!e||!t?false:e.rgb===t.rgb&&e.auto===t.auto&&e.themeColor===t.themeColor&&e.themeTint===t.themeTint&&e.themeShade===t.themeShade}function As(e,t){return !e&&!t?true:!(!e||!t||e.pattern!==t.pattern||!Qe(e.color,t.color)||!Qe(e.fill,t.fill))}function Ms(e,t){return !e&&!t?true:!e||!t?false:e.ascii===t.ascii&&e.hAnsi===t.hAnsi&&e.eastAsia===t.eastAsia&&e.cs===t.cs&&e.asciiTheme===t.asciiTheme&&e.hAnsiTheme===t.hAnsiTheme&&e.eastAsiaTheme===t.eastAsiaTheme&&e.csTheme===t.csTheme}function Bs(e){return e.type==="text"||e.type==="softHyphen"||e.type==="noBreakHyphen"}function jr(e){return e.content.length===0?true:e.content.every(Bs)}function $s(e,t){let n=[];for(let r of e)n.push(r);if(n.length>0&&t.length>0&&n[n.length-1].type==="text"&&t[0].type==="text"){let r=n[n.length-1],o=t[0];n[n.length-1]={type:"text",text:r.text+o.text,preserveSpace:r.preserveSpace||o.preserveSpace||void 0};for(let i=1;i<t.length;i++)n.push(t[i]);}else for(let r of t)n.push(r);return n}function Ds(e){if(e.length<=1)return e;let t=[],n=null;for(let r of e)if(r.content.length!==0){if(n===null){n={...r,content:[...r.content]};continue}jr(n)&&jr(r)&&Is(n.formatting,r.formatting)?n={type:"run",formatting:n.formatting,content:$s(n.content,r.content)}:(t.push(n),n={...r,content:[...r.content]});}return n!==null&&t.push(n),t}function Ht(e){if(e.length<=1)return e;let t=[],n=[];function r(){if(n.length>0){let o=Ds(n);t.push(...o),n.length=0;}}for(let o of e)if(o.type==="run")n.push(o);else if(r(),o.type==="hyperlink"){let i={...o,children:Ht(o.children)};t.push(i);}else t.push(o);return r(),t}function Ns(e){let t={sdtType:"richText"};if(!e||!e.elements)return t;for(let n of e.elements){if(n.type!=="element")continue;switch(n.name?.replace(/^w:/,"")??""){case "alias":t.alias=l(n,"w","val")??void 0;break;case "tag":t.tag=l(n,"w","val")??void 0;break;case "lock":t.lock=l(n,"w","val")??"unlocked";break;case "placeholder":{let o=u(n,"w","docPart");if(o){let i=u(o,"w","val");t.placeholder=i?l(i,"w","val")??void 0:void 0;}break}case "showingPlcHdr":t.showingPlaceholder=true;break;case "text":t.sdtType="plainText";break;case "date":t.sdtType="date",t.dateFormat=l(n,"w","fullDate")??void 0;break;case "dropDownList":t.sdtType="dropdown",t.listItems=Vr(n);break;case "comboBox":t.sdtType="comboBox",t.listItems=Vr(n);break;case "checkbox":{t.sdtType="checkbox";let o=u(n,"w14","checked")??u(n,"w","checked");t.checked=o?l(o,"w14","val")==="1"||l(o,"w","val")==="1":false;break}case "picture":t.sdtType="picture";break;case "docPartObj":t.sdtType="buildingBlockGallery";break;case "group":t.sdtType="group";break}}return t}function Vr(e){let t=[];for(let n of e.elements??[])n.type==="element"&&(n.name==="w:listItem"||n.name?.endsWith(":listItem"))&&t.push({displayText:l(n,"w","displayText")??"",value:l(n,"w","value")??""});return t}function Wr(e){let t="";if(e.type==="text"&&typeof e.text=="string")return e.text;if(e.elements)for(let n of e.elements)if((n.name?.replace(/^.*:/,"")??"")==="t"&&n.elements)for(let o of n.elements)o.type==="text"&&typeof o.text=="string"&&(t+=o.text);else t+=Wr(n);return t}function Hs(e,t,n,r){let o={};return e&&e!=="auto"?o.rgb=e:e==="auto"&&(o.auto=true),t&&(o.themeColor=t),n&&(o.themeTint=n),r&&(o.themeShade=r),o}function Ls(e){if(!e)return;let t={},n=l(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let r=l(e,"w","fill");r&&r!=="auto"&&(t.fill={rgb:r});let o=l(e,"w","themeFill");o&&(t.fill=t.fill||{},t.fill.themeColor=o);let i=l(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=l(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let s=l(e,"w","val");return s&&(t.pattern=s),Object.keys(t).length>0?t:void 0}function xe(e){if(!e)return;let t=l(e,"w","val");if(!t)return;let n={style:t},r=l(e,"w","color"),o=l(e,"w","themeColor");(r||o)&&(n.color=Hs(r,o,l(e,"w","themeTint"),l(e,"w","themeShade")));let i=w(e,"w","sz");i!==void 0&&(n.size=i);let a=w(e,"w","space");a!==void 0&&(n.space=a);let s=l(e,"w","shadow");s&&(n.shadow=s==="1"||s==="true");let c=l(e,"w","frame");return c&&(n.frame=c==="1"||c==="true"),n}function Xs(e){if(!e)return;let t=N(e,"w","tab");if(t.length===0)return;let n=[];for(let r of t){let o=w(r,"w","pos"),i=l(r,"w","val");if(o!==void 0&&i){let a={position:o,alignment:i},s=l(r,"w","leader");s&&(a.leader=s),n.push(a);}}return n.length>0?n:void 0}function Os(e){if(!e)return;let t={},n=w(e,"w","w");n!==void 0&&(t.width=n);let r=w(e,"w","h");r!==void 0&&(t.height=r);let o=l(e,"w","hAnchor");(o==="text"||o==="margin"||o==="page")&&(t.hAnchor=o);let i=l(e,"w","vAnchor");(i==="text"||i==="margin"||i==="page")&&(t.vAnchor=i);let a=w(e,"w","x");a!==void 0&&(t.x=a);let s=w(e,"w","y");s!==void 0&&(t.y=s);let c=l(e,"w","xAlign");c&&(t.xAlign=c);let f=l(e,"w","yAlign");f&&(t.yAlign=f);let p=l(e,"w","wrap");return p&&(t.wrap=p),Object.keys(t).length>0?t:void 0}function Ur(e,t,n){if(!e)return;let r={},o=u(e,"w","jc");if(o){let T=l(o,"w","val");T&&(r.alignment=T);}let i=u(e,"w","bidi");i&&(r.bidi=k(i));let a=u(e,"w","spacing");if(a){let T=w(a,"w","before");T!==void 0&&(r.spaceBefore=T);let v=w(a,"w","after");v!==void 0&&(r.spaceAfter=v);let A=w(a,"w","line");A!==void 0&&(r.lineSpacing=A);let M={};T!==void 0&&(M.before=true),v!==void 0&&(M.after=true),(M.before||M.after)&&(r.spacingExplicit=M);let H=l(a,"w","lineRule");H&&(r.lineSpacingRule=H);let X=l(a,"w","beforeAutospacing");X&&(r.beforeAutospacing=X==="1"||X==="true");let j=l(a,"w","afterAutospacing");j&&(r.afterAutospacing=j==="1"||j==="true");}let s=u(e,"w","ind");if(s){let T=w(s,"w","left");T!==void 0&&(r.indentLeft=T);let v=w(s,"w","right");v!==void 0&&(r.indentRight=v);let A=w(s,"w","firstLine");A!==void 0&&(r.indentFirstLine=A);let M=w(s,"w","hanging");M!==void 0&&(r.indentFirstLine=-M,r.hangingIndent=true);let H=w(s,"w","start");H!==void 0&&r.indentLeft===void 0&&(r.indentLeft=H);let X=w(s,"w","end");X!==void 0&&r.indentRight===void 0&&(r.indentRight=X);}let c=u(e,"w","pBdr");if(c){let T={},v=xe(u(c,"w","top"));v&&(T.top=v);let A=xe(u(c,"w","bottom"));A&&(T.bottom=A);let M=xe(u(c,"w","left"));M&&(T.left=M);let H=xe(u(c,"w","right"));H&&(T.right=H);let X=xe(u(c,"w","between"));X&&(T.between=X);let j=xe(u(c,"w","bar"));j&&(T.bar=j),Object.keys(T).length>0&&(r.borders=T);}let f=u(e,"w","shd");f&&(r.shading=Ls(f));let p=u(e,"w","tabs");p&&(r.tabs=Xs(p));let m=u(e,"w","keepNext");m&&(r.keepNext=k(m));let g=u(e,"w","keepLines");g&&(r.keepLines=k(g));let b=u(e,"w","widowControl");b&&(r.widowControl=k(b));let d=u(e,"w","pageBreakBefore");d&&(r.pageBreakBefore=k(d));let x=u(e,"w","contextualSpacing");x&&(r.contextualSpacing=k(x));let C=u(e,"w","numPr");if(C){let T=u(C,"w","numId"),v=u(C,"w","ilvl");if(T||v){if(r.numPr={},T){let A=w(T,"w","val");A!==void 0&&(r.numPr.numId=A);}if(v){let A=w(v,"w","val");A!==void 0&&(r.numPr.ilvl=A);}}}let I=u(e,"w","outlineLvl");if(I){let T=w(I,"w","val");T!==void 0&&(r.outlineLevel=T);}let F=u(e,"w","pStyle");if(F){let T=l(F,"w","val");T&&(r.styleId=T);}let P=u(e,"w","framePr");P&&(r.frame=Os(P));let h=u(e,"w","suppressLineNumbers");h&&(r.suppressLineNumbers=k(h));let y=u(e,"w","suppressAutoHyphens");y&&(r.suppressAutoHyphens=k(y));let S=u(e,"w","rPr");return S&&(r.runProperties=Ze(S,t)),Object.keys(r).length>0?r:void 0}function ve(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function zs(e){let t=new Set(["hyperlink","smartTag","sdt","sdtContent","fldSimple","customXml","ins","del","moveFrom","moveTo"]),n=new Set(["pPr","proofErr","bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","commentReference","permStart","permEnd","rsidR"]),r=new Set(["t","tab","br","cr","sym","drawing","pict","object","softHyphen","noBreakHyphen","fldChar","instrText","pgNum","separator","continuationSeparator","footnoteRef","endnoteRef","footnoteReference","endnoteReference","ptab","monthShort","monthLong","yearShort","yearLong","dayShort","dayLong"]),o=false;function i(s){for(let c of $(s)){let f=ve(c.name);if(!n.has(f)){if(f==="lastRenderedPageBreak"){o=true;continue}if(f==="r"){for(let p of $(c)){let m=ve(p.name);if(m!=="rPr"){if(m==="lastRenderedPageBreak"){o=true;continue}if(m==="br"&&l(p,"w","type")==="page")return "forced";if(r.has(m))return "visible"}}continue}if(t.has(f)){let p=i(c);if(p!=="continue")return p;continue}return "continue"}}return "continue"}let a=i(e);return a==="forced"?true:a==="visible"?o:false}function _r(e,t){if(!e)return `w:${t}`;let n=e.indexOf(":");return n<0?t:`${e.substring(0,n+1)}${t}`}function Gr(e){if(e.type!=="element")return e;let t=ve(e.name),n=e.name;return t==="delText"?n=_r(e.name,"t"):t==="delInstrText"&&(n=_r(e.name,"instrText")),{...e,name:n,elements:e.elements?.map(Gr)}}function ke(e){let t=l(e,"w","id"),n=t?parseInt(t,10):0,r=l(e,"w","author"),o=l(e,"w","date"),i=r?.trim()??"",a=o?.trim()??"";return {id:Number.isInteger(n)&&n>=0?n:0,author:i.length>0?i:"Unknown",date:a.length>0?a:void 0}}function js(e){let t=ke(e),n=(l(e,"w","rsid")??"").trim();return n.length>0?{...t,rsid:n}:t}function Vs(e,t,n,r){if(!e)return;let o=N(e,"w","pPrChange").map(i=>{let a=u(i,"w","pPr");return {type:"paragraphPropertyChange",info:js(i),previousFormatting:Ur(a,t),currentFormatting:r}}).filter(i=>i.previousFormatting||i.currentFormatting);return o.length>0?o:void 0}function _s(e,t,n,r,o){return xr(e,t,n,r,o)}function Ws(e){return yr(e)}function Us(e){return br(e)}function Zr(e){let t=e.trim().match(/^\\?([A-Z]+)/i);if(!t)return "UNKNOWN";let n=t[1].toUpperCase();return ["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE","EDITTIME","REVNUM","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS"].includes(n)?n:"UNKNOWN"}function Gs(e,t,n,r,o){let i=l(e,"w","instr")??"",a=Zr(i),s={type:"simpleField",instruction:i,fieldType:a,content:[]},c=l(e,"w","fldLock");(c==="1"||c==="true")&&(s.fldLock=true);let f=l(e,"w","dirty");(f==="1"||f==="true")&&(s.dirty=true);let p=$(e);for(let m of p)ve(m.name)==="r"&&s.content.push(Se(m,t,n,r,o));return s}function ye(e,t,n,r,o,i,a="default"){let s=[],c=$(e),f=false,p="",m=[],g=[],b=false,d=false,x=false;for(let C of c){let I=ve(C.name);switch(I){case "r":{let F=a==="deletion"?Gr(C):C,P=Se(F,t,n,o,i),h=false,y=false,S=false,T="";for(let v of P.content)v.type==="fieldChar"?v.charType==="begin"?(h=true,v.fldLock&&(d=true),v.dirty&&(x=true)):v.charType==="separate"?y=true:v.charType==="end"&&(S=true):v.type==="instrText"&&(T+=v.text);if(h&&(f=true,b=false,p="",m=[],g=[],d=false,x=false),f){if(T&&(p+=T),y&&(b=true),b&&!S?y||g.push(P):!b&&!h&&m.push(P),S){let v={type:"complexField",instruction:p.trim(),fieldType:Zr(p),fieldCode:m,fieldResult:g};d&&(v.fldLock=true),x&&(v.dirty=true),s.push(v),f=false;}}else s.push(P);break}case "hyperlink":s.push(_s(C,o,t,n,i));break;case "bookmarkStart":s.push(Ws(C));break;case "bookmarkEnd":s.push(Us(C));break;case "fldSimple":s.push(Gs(C,t,n,o,i));break;case "pPr":break;case "proofErr":case "permStart":case "permEnd":case "customXml":break;case "sdt":{let F=(C.elements??[]).find(h=>h.type==="element"&&(h.name==="w:sdtPr"||h.name?.endsWith(":sdtPr"))),P=(C.elements??[]).find(h=>h.type==="element"&&(h.name==="w:sdtContent"||h.name?.endsWith(":sdtContent")));if(P){let h=ye(P,t,n,null,o,i,a),S={type:"inlineSdt",properties:Ns(F??null),content:h.filter(T=>T.type==="run"||T.type==="hyperlink")};s.push(S);}break}case "ins":{let F=ke(C),P=ye(C,t,n,null,o,i),h={type:"insertion",info:F,content:P.filter(y=>y.type==="run"||y.type==="hyperlink")};s.push(h);break}case "del":{let F=ke(C),P=ye(C,t,n,null,o,i,"deletion"),h={type:"deletion",info:F,content:P.filter(y=>y.type==="run"||y.type==="hyperlink")};s.push(h);break}case "moveFrom":{let F=ke(C),P=ye(C,t,n,null,o,i,"deletion"),h={type:"moveFrom",info:F,content:P.filter(y=>y.type==="run"||y.type==="hyperlink")};s.push(h);break}case "moveTo":{let F=ke(C),P=ye(C,t,n,null,o,i),h={type:"moveTo",info:F,content:P.filter(y=>y.type==="run"||y.type==="hyperlink")};s.push(h);break}case "smartTag":break;case "moveFromRangeStart":{let F=parseInt(l(C,"w","id")??"0",10),P=l(C,"w","name")??"";s.push({type:"moveFromRangeStart",id:F,name:P});break}case "moveFromRangeEnd":{let F=parseInt(l(C,"w","id")??"0",10);s.push({type:"moveFromRangeEnd",id:F});break}case "moveToRangeStart":{let F=parseInt(l(C,"w","id")??"0",10),P=l(C,"w","name")??"";s.push({type:"moveToRangeStart",id:F,name:P});break}case "moveToRangeEnd":{let F=parseInt(l(C,"w","id")??"0",10);s.push({type:"moveToRangeEnd",id:F});break}case "commentRangeStart":{let F=parseInt(l(C,"w","id")??"0",10);s.push({type:"commentRangeStart",id:F});break}case "commentRangeEnd":{let F=parseInt(l(C,"w","id")??"0",10);s.push({type:"commentRangeEnd",id:F});break}case "oMath":case "oMathPara":{let F=I==="oMathPara",P=xn(C),h=Wr(C),y={type:"mathEquation",display:F?"block":"inline",ommlXml:P,plainText:h||void 0};s.push(y);break}}}return s}function Z(e,t,n,r,o=null,i=null,a){let s={type:"paragraph",content:[]},c=l(e,"w14","paraId")??l(e,"w","paraId");c&&(s.paraId=c);let f=l(e,"w14","textId")??l(e,"w","textId");f&&(s.textId=f),!a?.inHeaderFooter&&zs(e)&&(s.renderedPageBreakBefore=true);let p=u(e,"w","pPr");if(p){s.formatting=Ur(p,n),s.propertyChanges=Vs(p,n,t,s.formatting);let b=u(p,"w","sectPr");b&&(s.sectionProperties=Ke(b));}let m=ye(e,t,n,r,o,i);s.content=Ht(m);let g=s.formatting?.numPr;if(!g&&s.formatting?.styleId&&t){let b=t.get(s.formatting.styleId);b?.pPr?.numPr&&(g=b.pPr.numPr,s.formatting||(s.formatting={}),s.formatting.numPr=g);}if(g&&r){let{numId:b,ilvl:d=0}=g;if(b!==void 0&&b!==0){let x=r.getLevel(b,d);if(x){let C=[];for(let P=0;P<=d;P+=1){let h=r.getLevel(b,P);C.push(h?.numFmt??"decimal");}let I=r.getInstance(b),F=I?.levelOverrides?.find(P=>P.ilvl===d);if(s.listRendering={level:d,numId:b,marker:x.lvlText,isBullet:x.numFmt==="bullet",numFmt:x.numFmt,markerHidden:x.rPr?.hidden||void 0,markerFontFamily:x.rPr?.fontFamily?.ascii||x.rPr?.fontFamily?.hAnsi||void 0,markerFontSize:x.rPr?.fontSize?x.rPr.fontSize/2:void 0,levelNumFmts:C,abstractNumId:I?.abstractNumId,startOverride:F?.startOverride},x.pPr){s.formatting||(s.formatting={});let P=p?u(p,"w","ind"):null,h=P!=null&&(l(P,"w","left")!==null||l(P,"w","start")!==null),y=P!=null&&(l(P,"w","firstLine")!==null||l(P,"w","hanging")!==null);!h&&x.pPr.indentLeft!==void 0&&(s.formatting.indentLeft=x.pPr.indentLeft),y||(x.pPr.indentFirstLine!==void 0&&(s.formatting.indentFirstLine=x.pPr.indentFirstLine),x.pPr.hangingIndent!==void 0&&(s.formatting.hangingIndent=x.pPr.hangingIndent));}}}}return s}function Lt(e){let t="";for(let n of e.content)if(n.type==="run")for(let r of n.content)r.type==="text"?t+=r.text:r.type==="tab"?t+=" ":r.type==="break"&&(r.breakType==="page"?t+="\f":t+=`
|
|
60
|
-
`);else if(n.type==="hyperlink"){for(let r of n.children)if(r.type==="run")for(let o of r.content)o.type==="text"&&(t+=o.text);}else if(n.type==="simpleField"){for(let r of n.content)if(r.type==="run")for(let o of r.content)o.type==="text"&&(t+=o.text);}else if(n.type==="complexField")for(let r of n.fieldResult)for(let o of r.content)o.type==="text"&&(t+=o.text);return t}function Zs(e){if(!e||e.trim()==="")return "\u2022";let t=e.charCodeAt(0),n={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};return n[t]?n[t]:t>=57344&&t<=63743||t<32||t>=127&&t<160?"\u2022":e}function qs(e){let t=e.listRendering;t&&t.isBullet&&(t.marker=Zs(t.marker||""));}var qr=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function Yr(e){let t=[],n;for(qr.lastIndex=0;(n=qr.exec(e))!==null;){let r=n[1].trim();r&&!t.includes(r)&&t.push(r);}return t}function Jr(e){let t=[];for(let n of e)if(n.type==="paragraph"){let r=Lt(n),o=Yr(r);for(let i of o)t.includes(i)||t.push(i);}else if(n.type==="table"){let r=Kr(n);for(let o of r)t.includes(o)||t.push(o);}return t}function Kr(e){let t=[];for(let n of e.rows)for(let r of n.cells)for(let o of r.content)if(o.type==="paragraph"){let i=Lt(o),a=Yr(i);for(let s of a)t.includes(s)||t.push(s);}else if(o.type==="table"){let i=Kr(o);for(let a of i)t.includes(a)||t.push(a);}return t}function Ys(e,t,n,r,o,i,a){if(e.content.length===0)return;let s=$(t),c=0;for(let f of s){if(se(f.name??"")!=="r")continue;let p=$(f);for(let m of p)if(se(m.name??"")==="drawing"&&Ue(m)){let g=ir(m);if(g){let b=ft(m,"wps","wsp");if(b){let C=ar(b);C&&(g.content=or(C,Z,null,n,r,o,i??void 0));}let d={type:"shape",shapeType:"rect",size:g.size,position:g.position,wrap:g.wrap,fill:g.fill,outline:g.outline,textBody:{content:g.content,margins:g.margins}};g.id&&(d.id=g.id);let x={type:"shape",shape:d};if(c<e.content.length){let C=e.content[c];C.type==="run"&&C.content.push(x);}}}c++;}}function Qr(e,t,n,r,o,i){let a=[],s=$(e);for(let c of s){let f=c.name??"";if(f==="w:p"||f.endsWith(":p")){let p=Z(c,t,n,r,o,i);Ys(p,c,t,n,r,o),qs(p),a.push(p);}else if(f==="w:tbl"||f.endsWith(":tbl")){let p=ue(c,t,n,r,o,i);a.push(p);}else if(f==="w:sdt"||f.endsWith(":sdt")){let p=(c.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtContent"||m.name?.endsWith(":sdtContent")));if(p){let m=Qr(p,t,n,r,o,i);a.push(...m);}}}return a}function Js(e,t){let n=[],r=[];for(let o of e)r.push(o),o.type==="paragraph"&&o.sectionProperties&&(n.push({properties:o.sectionProperties,content:r}),r=[]);return (r.length>0||n.length===0)&&n.push({properties:t??zr(),content:r}),n}function eo(e,t=null,n=null,r=null,o=null,i=null){let a={content:[]};if(!e)return a;let s=U(e);if(!s)return a;let c=(s.elements??[]).find(m=>m.type==="element"&&(m.name==="w:document"||m.name?.endsWith(":document")));if(!c)return a;let f=u(c,"w","body");if(!f)return a;a.content=Qr(f,t,n,r,o,i);let p=u(f,"w","sectPr");return p&&(a.finalSectionProperties=Ke(p)),a.sections=Js(a.content,a.finalSectionProperties),a}function Ks(e){let t=new Map,n=U(e);if(!n)return t;let r=u(n,"w16cex","commentsExtensible")??n;for(let o of $(r)){if((o.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=l(o,"w16cex","paraId")??l(o,"w15","paraId")??o.attributes?.["w16cex:paraId"]??o.attributes?.["w15:paraId"],s=l(o,"w16cex","dateUtc")??l(o,"w15","dateUtc")??o.attributes?.["w16cex:dateUtc"]??o.attributes?.["w15:dateUtc"];a&&s&&t.set(String(a).toUpperCase(),String(s));}return t}function Qs(e){let t=new Map,n=new Map,r=U(e);if(!r)return {parentByParaId:t,doneByParaId:n};let o=u(r,"w15","commentsEx")??r;for(let i of $(o)){if((i.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let s=l(i,"w15","paraId")??i.attributes?.["w15:paraId"],c=l(i,"w15","paraIdParent")??i.attributes?.["w15:paraIdParent"],f=l(i,"w15","done")??i.attributes?.["w15:done"];if(s){let p=String(s).toUpperCase();c&&t.set(p,String(c).toUpperCase()),f==="1"&&n.set(p,true);}}return {parentByParaId:t,doneByParaId:n}}function to(e,t,n,r,o,i,a){if(!e)return [];let s=U(e);if(!s)return [];let c=i?Ks(i):new Map,f=a?Qs(a):null,p=u(s,"w","comments")??s,m=$(p),g=[],b=[];for(let d of m){if((d.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(l(d,"w","id")??"0",10),I=l(d,"w","author")??"Unknown",F=l(d,"w","initials"),P=F!=null?String(F):void 0,h=l(d,"w","date"),y=h!=null?String(h):void 0,S=l(d,"w14","paraId")??d.attributes?.["w14:paraId"]??l(d,"w","paraId"),v=(S?c.get(String(S).toUpperCase()):void 0)??y,A=l(d,"w","done")??d.attributes?.["w:done"],M=A==="1"||A==="true"?true:void 0,H=l(d,"w16cid","parentId")??l(d,"w","parentId")??d.attributes?.["w16cid:parentId"]??d.attributes?.["w:parentId"],X=H!=null?parseInt(String(H),10):void 0,j=[],W="";for(let L of $(d))if((L.name?.replace(/^.*:/,"")??"")==="p"){let B=Z(L,t,n,null,r,o);j.push(B);let E=l(L,"w14","paraId")??L.attributes?.["w14:paraId"];E&&(W=String(E).toUpperCase());}M==null&&f&&W&&f.doneByParaId.get(W)&&(M=true),b.push(W),g.push({id:C,author:I,initials:P,date:v,content:j,...M!=null?{done:M}:{},...X!=null&&!isNaN(X)?{parentId:X}:{}});}if(f&&f.parentByParaId.size>0){let d=new Map;for(let x=0;x<g.length;x++){let C=b[x];C&&d.set(C,g[x].id);}for(let x=0;x<g.length;x++){if(g[x].parentId!=null)continue;let C=b[x];if(!C)continue;let I=f.parentByParaId.get(C);if(!I)continue;let F=d.get(I);F!=null&&(g[x]={...g[x],parentId:F});}}return g}var Xt=new Set,et=new Map,el=new Set;function tl(e,t=[400,700],n=["normal","italic"]){let r=encodeURIComponent(e),o=[];for(let a of n){let s=a==="italic"?1:0;for(let c of t)o.push(`${s},${c}`);}o.sort();let i=o.join(";");return `https://fonts.googleapis.com/css2?family=${r}:ital,wght@${i}&display=swap`}async function ro(e,t){if(typeof document>"u")return false;let n=e.trim();if(Xt.has(n))return true;let r=et.get(n);if(r)return r;let o=(async()=>{try{let i=tl(n,t?.weights,t?.styles),a=document.createElement("link");return a.rel="stylesheet",a.href=i,await new Promise(c=>{a.onload=()=>c(true),a.onerror=()=>c(false),document.head.appendChild(a),setTimeout(()=>c(false),5e3);})?(await rl(n,3e3),Xt.add(n),nl([n]),true):false}catch(i){return console.warn(`Failed to load font "${n}":`,i),false}finally{et.delete(n);}})();return et.set(n,o),o}function nl(e){for(let t of el)try{t(e);}catch(n){console.warn("Font load callback error:",n);}}async function rl(e,t){if("fonts"in document)try{let n=`400 16px "${e}"`;return await Promise.race([document.fonts.load(n),new Promise(r=>setTimeout(r,t))]),document.fonts.check(n)}catch{}return await new Promise(n=>setTimeout(n,100)),true}var ol={Calibri:"Carlito",Cambria:"Caladea",Arial:"Arimo","Times New Roman":"Tinos","Courier New":"Cousine",Garamond:"EB Garamond","Book Antiqua":"EB Garamond",Georgia:"Tinos",Verdana:"Open Sans",Tahoma:"Open Sans","Trebuchet MS":"Source Sans Pro","Century Gothic":"Poppins","Franklin Gothic":"Libre Franklin",Palatino:"EB Garamond","Palatino Linotype":"EB Garamond","Lucida Sans":"Open Sans","Segoe UI":"Open Sans",Impact:"Anton","Comic Sans MS":"Comic Neue",Consolas:"Inconsolata","Lucida Console":"Inconsolata",Monaco:"Fira Code"};function il(e){let t=e.trim();return ol[t]||t}async function al(e){let t=e.trim(),n=il(t);if(n!==t){let r=await ro(n);return r&&Xt.add(t),r}return ro(n)}async function oo(e){let t=[...new Set(e.map(n=>n.trim()))];await Promise.all(t.map(n=>al(n)));}async function io(e){if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}if(e instanceof Blob)return e.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof e}`)}async function nt(e,t={}){let n=e instanceof ArrayBuffer?e:await io(e),{onProgress:r=()=>{},preloadFonts:o=true,parseHeadersFooters:i=true,parseNotes:a=true,detectVariables:s=true}=t,c=[];try{let g=function(L,V){let B=performance.now(),E=V(),z=performance.now()-B;return m.push({stage:L,ms:z}),z>1e3&&console.warn(`[parseDocx] ${L} took ${Math.round(z)}ms`),E};let p=performance.now(),m=[];async function b(L,V){let B=performance.now(),E=await V(),z=performance.now()-B;return m.push({stage:L,ms:z}),z>1e3&&console.warn(`[parseDocx] ${L} took ${Math.round(z)}ms`),E}r("Extracting DOCX...",0);let d=await b("unzip",()=>Dn(n));r("Extracted DOCX",10),r("Parsing relationships...",10);let x=g("relationships",()=>d.documentRels?Xe(d.documentRels):new Map);r("Parsed relationships",15),r("Parsing theme...",15);let C=g("theme",()=>On(d.themeXml));r("Parsed theme",20),r("Parsing styles...",20);let I=null,F;g("styles",()=>{d.stylesXml&&(I=It(d.stylesXml,C),F=Zn(d.stylesXml,C));}),r("Parsed styles",30),r("Parsing numbering...",30);let P=g("numbering",()=>qn(d.numberingXml));r("Parsed numbering",35),r("Processing media files...",35);let h=g("media",()=>sl(d));r("Processed media",40),r("Parsing document body...",40);let y={content:[]};g("documentBody",()=>{d.documentXml?y=eo(d.documentXml,I,C,P,x,h):c.push("No document.xml found in DOCX");}),r("Parsed document body",55);let S,T;if(i){r("Parsing headers/footers...",55);let L=g("headersFooters",()=>ll(d,I,C,P,x,h));S=L.headers,T=L.footers,r("Parsed headers/footers",65);}else r("Skipping headers/footers",65);let v,A;if(a){r("Parsing footnotes/endnotes...",65);let L=g("footnotesEndnotes",()=>cl(d,I,C,P,x,h));v=L.footnotes,A=L.endnotes,r("Parsed footnotes/endnotes",75);}else r("Skipping footnotes/endnotes",75);r("Parsing comments...",75);let M=g("comments",()=>to(d.commentsXml,I,C,x,h,d.commentsExtensibleXml,d.commentsExtendedXml));M.length>0&&(y.comments=M);let H;s?(r("Detecting template variables...",75),H=g("variables",()=>Jr(y.content)),r("Detected variables",80)):r("Skipping variable detection",80),o?(r("Loading fonts...",80),await b("fonts",()=>ul(C,F,y)),r("Loaded fonts",95)):r("Skipping font loading",95),r("Assembling document...",95);let j={package:{document:y,styles:F,theme:C,numbering:P.definitions,headers:S,footers:T,footnotes:v,endnotes:A,relationships:x,media:h},originalBuffer:n,templateVariables:H,warnings:c.length>0?c:void 0},W=performance.now()-p;if(W>2e3){let L=m.filter(V=>V.ms>100).map(V=>`${V.stage}: ${Math.round(V.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(W)}ms`+(L?` (${L})`:""));}return r("Complete",100),j}catch(p){let m=p instanceof Error?p.message:String(p);throw console.error("[parseDocx] Failed to parse DOCX:",m,p),new Error(`Failed to parse DOCX: ${m}`)}}function sl(e,t){let n=new Map;for(let[r,o]of e.media.entries()){let i=r.split("/").pop()||r,a=Nn(r),s=new Uint8Array(o),c="";for(let b=0;b<s.length;b++)c+=String.fromCharCode(s[b]);let f=btoa(c),p=`data:${a};base64,${f}`,m={path:r,filename:i,mimeType:a,data:o,dataUrl:p};n.set(r,m);let g=r.replace(/^word\//,"");g!==r&&n.set(g,m);}return n}function tt(e,t){let n=t.toLowerCase();for(let[r,o]of e.entries())if(r.toLowerCase()===n)return o}function ll(e,t,n,r,o,i){let a=new Map,s=new Map;for(let[c,f]of o.entries())if(f.type===O.header&&f.target){let p=f.target.split("/").pop()||f.target,m=tt(e.headers,p);if(m){let g=`word/_rels/${p}.rels`,b=tt(e.allXml,g),d=b?Xe(b):o,x=Ar(m,"default",t,n,r,d,i);a.set(c,x);}}else if(f.type===O.footer&&f.target){let p=f.target.split("/").pop()||f.target,m=tt(e.footers,p);if(m){let g=`word/_rels/${p}.rels`,b=tt(e.allXml,g),d=b?Xe(b):o,x=Mr(m,"default",t,n,r,d,i);s.set(c,x);}}return {headers:a,footers:s}}function cl(e,t,n,r,o,i){let a=Dr(e.footnotesXml,t,n,r,o,i),s=Nr(e.endnotesXml,t,n,r,o,i);return {footnotes:a.getNormalFootnotes(),endnotes:s.getNormalEndnotes()}}async function ul(e,t,n){let r=new Set;if(e?.fontScheme){let{majorFont:o,minorFont:i}=e.fontScheme;o?.latin&&r.add(o.latin),i?.latin&&r.add(i.latin);}if(t?.docDefaults?.rPr?.fontFamily?.ascii&&r.add(t.docDefaults.rPr.fontFamily.ascii),t?.styles)for(let o of t.styles)o.rPr?.fontFamily?.ascii&&r.add(o.rPr.fontFamily.ascii),o.rPr?.fontFamily?.hAnsi&&r.add(o.rPr.fontFamily.hAnsi);if(n.content){for(let o of n.content)if(o.type==="paragraph")for(let i of o.content)i.type==="run"&&i.formatting?.fontFamily&&(i.formatting.fontFamily.ascii&&r.add(i.formatting.fontFamily.ascii),i.formatting.fontFamily.hAnsi&&r.add(i.formatting.fontFamily.hAnsi));}if(r.size>0)try{await oo(Array.from(r));}catch(o){console.warn("Failed to load some fonts:",o);}}var Re=class e{constructor(t){t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let n=await nt(t);return new e(n)}static fromDocument(t){return new e(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],n=this._document.package.document;for(let r of n.content)r.type==="paragraph"&&this._extractParagraphSegments(r,t);return t}getVariables(){return ge(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let n=[];for(let[r,o]of Object.entries(t.styles))if(typeof o=="object"&&o!==null){let i=o;n.push({id:r,name:i.name||r,type:i.type==="numbering"?"paragraph":i.type||"paragraph",builtIn:i.default});}return n}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(r=>r.length>0).length}getCharacterCount(t=true){let n=this.getText();return t?n.length:n.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let n=this._document.package.document,r=n.content.filter(a=>a.type==="paragraph"),o=r.map((a,s)=>{let c=this._getParagraphText(a),f=a.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:f,isHeading:f?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(f),isListItem:!!a.listRendering,isEmpty:c.trim().length===0}}),i=(n.sections||[]).map((a,s)=>({index:s,paragraphCount:a.content?.length||0,pageSize:a.properties?.pageWidth&&a.properties?.pageHeight?{width:a.properties.pageWidth,height:a.properties.pageHeight}:void 0,isLandscape:a.properties?.orientation==="landscape",hasHeader:!!a.properties?.headerReferences?.length,hasFooter:!!a.properties?.footerReferences?.length}));return {paragraphCount:r.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:o,sections:i,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,n,r={}){let o={type:"insertText",position:t,text:n,formatting:r.formatting};return this._executeCommand(o)}replaceRange(t,n,r={}){let o={type:"replaceText",range:t,text:n,formatting:r.formatting};return this._executeCommand(o)}deleteRange(t){let n={type:"deleteText",range:t};return this._executeCommand(n)}applyFormatting(t,n){let r={type:"formatText",range:t,formatting:n};return this._executeCommand(r)}applyStyle(t,n){let r={type:"applyStyle",paragraphIndex:t,styleId:n};return this._executeCommand(r)}applyParagraphFormatting(t,n){let r={type:"formatParagraph",paragraphIndex:t,formatting:n};return this._executeCommand(r)}insertTable(t,n,r,o={}){let i={type:"insertTable",position:t,rows:n,columns:r,data:o.data,hasHeader:o.hasHeader};return this._executeCommand(i)}insertImage(t,n,r={}){let o={type:"insertImage",position:t,src:n,width:r.width,height:r.height,alt:r.alt};return this._executeCommand(o)}insertHyperlink(t,n,r={}){let o={type:"insertHyperlink",range:t,url:n,displayText:r.displayText,tooltip:r.tooltip};return this._executeCommand(o)}removeHyperlink(t){let n={type:"removeHyperlink",range:t};return this._executeCommand(n)}insertParagraphBreak(t){let n={type:"insertParagraphBreak",position:t};return this._executeCommand(n)}mergeParagraphs(t,n){let r={type:"mergeParagraphs",paragraphIndex:t,count:n};return this._executeCommand(r)}setVariable(t,n){return this._pendingVariables[t]=n,this}setVariables(t){for(let[n,r]of Object.entries(t))this._pendingVariables[n]=r;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let n={...this._pendingVariables,...t};if(Object.keys(n).length===0)return this;let r=this._document.originalBuffer;if(!r)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:o}=await import('./processTemplate-3P7VLW5K.js'),i=o(r,n),a=await nt(i),s=new e(a);return s._pendingVariables={},s}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let r=await Pt(this._document,this._document.originalBuffer,t.selective);if(r)return this._document.originalBuffer=r,r}let n=await ze(this._document);return this._document.originalBuffer=n,n}return Tt(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let n=await this.toBuffer();return new Blob([n],{type:t})}executeCommands(t){return new e(chunk2AF2FRMM_js.f(this._document,t))}_executeCommand(t){let n=new e(chunk2AF2FRMM_js.e(this._document,t));return n._pendingVariables={...this._pendingVariables},n}_getBodyText(t){let n=[];for(let r of t.content)r.type==="paragraph"?n.push(this._getParagraphText(r)):r.type==="table"&&n.push(this._getTableText(r));return n.join(`
|
|
61
|
-
`)}_getParagraphText(t){let n=[];for(let r of t.content)r.type==="run"?n.push(this._getRunText(r)):r.type==="hyperlink"&&n.push(this._getHyperlinkText(r));return n.join("")}_getRunText(t){return t.content.filter(n=>n.type==="text").map(n=>n.text).join("")}_getHyperlinkText(t){let n=[];for(let r of t.children)r.type==="run"&&n.push(this._getRunText(r));return n.join("")}_getTableText(t){let n=[];for(let r of t.rows)for(let o of r.cells)for(let i of o.content)i.type==="paragraph"&&n.push(this._getParagraphText(i));return n.join(" ")}_extractParagraphSegments(t,n){for(let r of t.content)if(r.type==="run"){let o=this._getRunText(r);o&&n.push({text:o,formatting:r.formatting});}else if(r.type==="hyperlink"){let o=r.href||"";for(let i of r.children)if(i.type==="run"){let a=this._getRunText(i);a&&n.push({text:a,formatting:i.formatting,isHyperlink:true,hyperlinkUrl:o});}}}_parseHeadingLevel(t){if(!t)return;let n=t.match(/heading\s*(\d)/i);if(n)return parseInt(n[1],10)}_hasImages(){let t=this._document.package.document;for(let n of t.content)if(n.type==="paragraph"){for(let r of n.content)if(r.type==="run"){for(let o of r.content)if(o.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let n of t.content)if(n.type==="paragraph"){for(let r of n.content)if(r.type==="hyperlink")return true}return false}};async function fl(e){return Re.fromBuffer(e)}function pl(e){return Re.fromDocument(e)}function ao(e,t={}){let{outlineMaxChars:n=100,maxOutlineParagraphs:r=50}=t,o=e.package.document,i=o.content.filter(x=>x.type==="paragraph"),a=ml(i,n,r),s=ge(e),c=gl(e),f=hl(o),p=wl(o),m=xl(o),g=o.content.some(x=>x.type==="table"),b=Tl(o),d=Cl(o);return {paragraphCount:i.length,wordCount:p,characterCount:m,variables:s,variableCount:s.length,availableStyles:c,outline:a,sections:f,hasTables:g,hasImages:b,hasHyperlinks:d}}function dl(e,t,n={}){let{contextChars:r=200,includeSuggestions:o=true}=n,a=e.package.document.content.filter(F=>F.type==="paragraph"),s=a[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=q(s),f="";if(t.start.paragraphIndex===t.end.paragraphIndex)f=c.slice(t.start.offset,t.end.offset);else {let F=[];for(let P=t.start.paragraphIndex;P<=t.end.paragraphIndex;P++){let h=a[P];if(!h)continue;let y=q(h);P===t.start.paragraphIndex?F.push(y.slice(t.start.offset)):P===t.end.paragraphIndex?F.push(y.slice(0,t.end.offset)):F.push(y);}f=F.join(`
|
|
62
|
-
`);}let p=Sl(a,t.start.paragraphIndex,t.start.offset,r),m=kl(a,t.end.paragraphIndex,t.end.offset,r),g=vl(s,t.start.offset),b=s.formatting||{},d={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:zt(c)},x=false,C=Rl(s,t.start.offset),I=o?Il(f):[];return {selectedText:f,range:t,formatting:g,paragraphFormatting:b,textBefore:p,textAfter:m,paragraph:d,inTable:x,inHyperlink:C,suggestedActions:I}}function Ot(e){let t=ao(e,{outlineMaxChars:50,maxOutlineParagraphs:10}),n=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&n.push("Contains tables."),t.hasImages&&n.push("Contains images."),t.hasHyperlinks&&n.push("Contains hyperlinks."),t.variableCount>0&&n.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let r=t.outline.filter(o=>o.isHeading);if(r.length>0){n.push(`
|
|
63
|
-
Headings:`);for(let o of r.slice(0,5)){let i=o.headingLevel||1;n.push(`${" ".repeat(i-1)}- ${o.preview}`);}r.length>5&&n.push(` ... and ${r.length-5} more headings`);}return n.join(" ")}function ml(e,t,n){let r=[];for(let o=0;o<Math.min(e.length,n);o++){let i=e[o],a=q(i),s=i.formatting?.styleId;r.push({index:o,preview:a.slice(0,t),style:s,isHeading:Pl(s),headingLevel:Fl(s),isListItem:!!i.listRendering,isEmpty:a.trim().length===0});}return r}function gl(e){let t=e.package.styles;if(!t?.styles)return [];let n=[];for(let[r,o]of Object.entries(t.styles))if(typeof o=="object"&&o!==null){let i=o;n.push({id:r,name:i.name||r,type:i.type==="numbering"?"paragraph":i.type||"paragraph",builtIn:i.default});}return n}function hl(e){return e.sections?e.sections.map((t,n)=>({index:n,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function wl(e){let t=0;for(let n of e.content)if(n.type==="paragraph"){let r=q(n);t+=zt(r);}else n.type==="table"&&(t+=yl(n));return t}function zt(e){return e.split(/\s+/).filter(n=>n.length>0).length}function xl(e){let t=0;for(let n of e.content)if(n.type==="paragraph"){let r=q(n);t+=r.length;}else n.type==="table"&&(t+=bl(n));return t}function yl(e){let t=0;for(let n of e.rows)for(let r of n.cells)for(let o of r.content)if(o.type==="paragraph"){let i=q(o);t+=zt(i);}return t}function bl(e){let t=0;for(let n of e.rows)for(let r of n.cells)for(let o of r.content)if(o.type==="paragraph"){let i=q(o);t+=i.length;}return t}function q(e){let t=[];for(let n of e.content)n.type==="run"?t.push(rt(n)):n.type==="hyperlink"&&t.push(jt(n));return t.join("")}function rt(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function jt(e){let t=[];for(let n of e.children)n.type==="run"&&t.push(rt(n));return t.join("")}function Tl(e){for(let t of e.content)if(t.type==="paragraph"){for(let n of t.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}function Cl(e){for(let t of e.content)if(t.type==="paragraph"){for(let n of t.content)if(n.type==="hyperlink")return true}return false}function Pl(e){return e?e.toLowerCase().includes("heading"):false}function Fl(e){if(!e)return;let t=e.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function Sl(e,t,n,r){let o=[],i=0,a=e[t];if(a){let f=q(a).slice(0,n);o.unshift(f),i+=f.length;}for(let c=t-1;c>=0&&i<r;c--){let f=e[c];if(!f)continue;let p=q(f);o.unshift(p),i+=p.length;}let s=o.join(`
|
|
64
|
-
`);return s.length>r?"..."+s.slice(-r):s}function kl(e,t,n,r){let o=[],i=0,a=e[t];if(a){let f=q(a).slice(n);o.push(f),i+=f.length;}for(let c=t+1;c<e.length&&i<r;c++){let f=e[c];if(!f)continue;let p=q(f);o.push(p),i+=p.length;}let s=o.join(`
|
|
65
|
-
`);return s.length>r?s.slice(0,r)+"...":s}function vl(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=rt(r),i=n,a=n+o.length;if(t>=i&&t<a)return r.formatting||{};n=a;}else if(r.type==="hyperlink"){let o=jt(r),i=n,a=n+o.length;if(t>=i&&t<a){for(let s of r.children)if(s.type==="run")return s.formatting||{}}n=a;}return {}}function Rl(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=rt(r);n+=o.length;}else if(r.type==="hyperlink"){let o=jt(r),i=n,a=n+o.length;if(t>=i&&t<a)return true;n=a;}return false}function Il(e,t,n){let r=[];return e.length>0&&(r.push({id:"rewrite",label:"Rewrite",description:"Rewrite this text",priority:10},{id:"summarize",label:"Summarize",description:"Summarize this text",priority:9}),e.length>200&&r.push({id:"summarize",label:"Summarize",description:"Create a shorter version",priority:8}),e.length<50&&e.split(/\s+/).length<10&&r.push({id:"expand",label:"Expand",description:"Add more details",priority:8}),r.push({id:"fixGrammar",label:"Fix Grammar",description:"Fix grammar and spelling",priority:7}),r.push({id:"translate",label:"Translate",description:"Translate to another language",priority:6}),r.push({id:"makeFormal",label:"Make Formal",description:"Use formal tone",priority:5},{id:"makeCasual",label:"Make Casual",description:"Use casual tone",priority:4})),r.sort((o,i)=>(i.priority||0)-(o.priority||0)),r}function so(e,t,n={}){let{contextCharsBefore:r=200,contextCharsAfter:o=200,includeSuggestions:i=true}=n,a=e.package.document,s=a.content.filter(F=>F.type==="paragraph");if(t.start.paragraphIndex>=s.length)throw new Error(`Invalid start paragraph index: ${t.start.paragraphIndex}`);let c=s[t.start.paragraphIndex],f=Ml(s,t),p=Bl(s,t.start,r),m=$l(s,t.end,o),g=Dl(c,t.start.offset),b=c.formatting||{},d={index:t.start.paragraphIndex,fullText:ce(c),style:c.formatting?.styleId,wordCount:Vt(ce(c))},x=Hl(),C=Ll(c,t.start.offset),I=i?Xl(f):[];return {selectedText:f,range:t,formatting:g,paragraphFormatting:b,textBefore:p,textAfter:m,paragraph:d,inTable:x,inHyperlink:C,suggestedActions:I}}function El(e,t,n={}){let r=so(e,t,n),{includeDocumentSummary:o=true}=n,a=e.package.document.content.filter(d=>d.type==="paragraph"),s=Vt(r.selectedText),c=r.selectedText.length,f=t.start.paragraphIndex!==t.end.paragraphIndex,p=[];for(let d=t.start.paragraphIndex;d<=t.end.paragraphIndex;d++)p.push(d);let m=Ol(a,t),g=o?Ot(e):void 0,b=zl(r.selectedText);return {...r,documentSummary:g,wordCount:s,characterCount:c,isMultiParagraph:f,paragraphIndices:p,detectedLanguage:b,contentType:m}}function Al(e,t){let r=e.package.document.content.filter(s=>s.type==="paragraph"),o=[];for(let s=t.start.paragraphIndex;s<=t.end.paragraphIndex;s++){let c=r[s];if(!c)continue;let f=s===t.start.paragraphIndex?t.start.offset:0,p=s===t.end.paragraphIndex?t.end.offset:1/0;Nl(c,f,p,o);}let i=o.length<=1||o.every(s=>jl(s,o[0]));return {predominant:o.length>0?o[0]:{},isConsistent:i,allFormatting:o}}function Ml(e,t){if(t.start.paragraphIndex===t.end.paragraphIndex){let r=e[t.start.paragraphIndex];return r?ce(r).slice(t.start.offset,t.end.offset):""}let n=[];for(let r=t.start.paragraphIndex;r<=t.end.paragraphIndex;r++){let o=e[r];if(!o)continue;let i=ce(o);r===t.start.paragraphIndex?n.push(i.slice(t.start.offset)):r===t.end.paragraphIndex?n.push(i.slice(0,t.end.offset)):n.push(i);}return n.join(`
|
|
66
|
-
`)}function Bl(e,t,n){let r=[],o=0,i=e[t.paragraphIndex];if(i){let c=ce(i).slice(0,t.offset);r.unshift(c),o+=c.length;}for(let s=t.paragraphIndex-1;s>=0&&o<n;s--){let c=e[s];if(!c)continue;let f=ce(c);r.unshift(f),o+=f.length;}let a=r.join(`
|
|
67
|
-
`);return a.length>n?"..."+a.slice(-n):a}function $l(e,t,n){let r=[],o=0,i=e[t.paragraphIndex];if(i){let c=ce(i).slice(t.offset);r.push(c),o+=c.length;}for(let s=t.paragraphIndex+1;s<e.length&&o<n;s++){let c=e[s];if(!c)continue;let f=ce(c);r.push(f),o+=f.length;}let a=r.join(`
|
|
68
|
-
`);return a.length>n?a.slice(0,n)+"...":a}function Dl(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=Ie(r),i=n+o.length;if(t>=n&&t<i)return r.formatting||{};n=i;}else if(r.type==="hyperlink"){let o=ot(r),i=n+o.length;if(t>=n&&t<i){for(let a of r.children)if(a.type==="run")return a.formatting||{}}n=i;}return {}}function Nl(e,t,n,r){let o=0;for(let i of e.content)if(i.type==="run"){let a=Ie(i),s=o,c=o+a.length;c>t&&s<n&&i.formatting&&r.push({...i.formatting}),o=c;}else if(i.type==="hyperlink"){let a=ot(i),s=o,c=o+a.length;if(c>t&&s<n)for(let f of i.children)f.type==="run"&&f.formatting&&r.push({...f.formatting});o=c;}}function Hl(e,t){return false}function Ll(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=Ie(r);n+=o.length;}else if(r.type==="hyperlink"){let o=ot(r),i=n,a=n+o.length;if(t>=i&&t<a)return true;n=a;}return false}function Xl(e,t,n){let r=[];if(!e||e.trim().length===0)return r;r.push({id:"askAI",label:"Ask AI",description:"Ask AI about this text",priority:11},{id:"rewrite",label:"Rewrite",description:"Rewrite this text differently",priority:10});let o=Vt(e);return o>50&&r.push({id:"summarize",label:"Summarize",description:"Create a shorter version",priority:9}),o<20&&r.push({id:"expand",label:"Expand",description:"Add more details",priority:9}),r.push({id:"fixGrammar",label:"Fix Grammar",description:"Fix grammar and spelling",priority:7},{id:"translate",label:"Translate",description:"Translate to another language",priority:6},{id:"explain",label:"Explain",description:"Explain what this means",priority:5}),r.push({id:"makeFormal",label:"Make Formal",description:"Use formal tone",priority:4},{id:"makeCasual",label:"Make Casual",description:"Use casual tone",priority:3}),r.sort((i,a)=>(a.priority||0)-(i.priority||0)),r}function Ol(e,t){let n=new Set;for(let r=t.start.paragraphIndex;r<=t.end.paragraphIndex;r++){let o=e[r];o&&(o.listRendering?n.add("list"):o.formatting?.styleId?.toLowerCase().includes("heading")?n.add("heading"):n.add("prose"));}return n.size>1?"mixed":n.has("list")?"list":n.has("heading")?"heading":"prose"}function zl(e){return /[а-яА-ЯёЁ]/.test(e)?"ru":/[一-龯]/.test(e)?"zh":/[ひらがなカタカナ]/.test(e)||/[\u3040-\u309F\u30A0-\u30FF]/.test(e)?"ja":/[가-힣]/.test(e)?"ko":/[àâäéèêëïîôùûüç]/i.test(e)?"fr":/[äöüß]/i.test(e)?"de":/[áéíóúñ]/i.test(e)?"es":"en"}function ce(e){let t=[];for(let n of e.content)n.type==="run"?t.push(Ie(n)):n.type==="hyperlink"&&t.push(ot(n));return t.join("")}function Ie(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function ot(e){let t=[];for(let n of e.children)n.type==="run"&&t.push(Ie(n));return t.join("")}function Vt(e){return e.split(/\s+/).filter(t=>t.length>0).length}function jl(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?false:n.every(o=>{let i=e[o],a=t[o];return i===a})}function Y(e){let t=[];for(let n of e.content)n.type==="run"?t.push(be(n)):n.type==="hyperlink"&&t.push(Ee(n));return t.join("")}function be(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function Ee(e){let t=[];for(let n of e.children)n.type==="run"&&t.push(be(n));return t.join("")}function lo(e){let t=[];for(let n of e.rows)for(let r of n.cells)for(let o of r.content)o.type==="paragraph"&&t.push(Y(o));return t.join(" ")}function Vl(e){let t=[];for(let n of e.content)n.type==="paragraph"?t.push(Y(n)):n.type==="table"&&t.push(lo(n));return t.join(`
|
|
69
|
-
`)}function _t(e){return e.split(/\s+/).filter(n=>n.length>0).length}function _l(e,t=true){return t?e.length:e.replace(/\s/g,"").length}function Wl(e){let t=0;for(let n of e.content)n.type==="paragraph"?t+=_t(Y(n)):n.type==="table"&&(t+=Ul(n));return t}function Ul(e){let t=0;for(let n of e.rows)for(let r of n.cells)for(let o of r.content)o.type==="paragraph"&&(t+=_t(Y(o)));return t}function Gl(e){let t=0;for(let n of e.content)n.type==="paragraph"?t+=Y(n).length:n.type==="table"&&(t+=Zl(n));return t}function Zl(e){let t=0;for(let n of e.rows)for(let r of n.cells)for(let o of r.content)o.type==="paragraph"&&(t+=Y(o).length);return t}function ql(e,t,n){let r=[],o=0,i=e[t.paragraphIndex];if(i){let c=Y(i).slice(0,t.offset);r.unshift(c),o+=c.length;}for(let s=t.paragraphIndex-1;s>=0&&o<n;s--){let c=e[s];if(!c)continue;let f=Y(c);r.unshift(f),o+=f.length;}let a=r.join(`
|
|
70
|
-
`);return a.length>n?"..."+a.slice(-n):a}function Yl(e,t,n){let r=[],o=0,i=e[t.paragraphIndex];if(i){let c=Y(i).slice(t.offset);r.push(c),o+=c.length;}for(let s=t.paragraphIndex+1;s<e.length&&o<n;s++){let c=e[s];if(!c)continue;let f=Y(c);r.push(f),o+=f.length;}let a=r.join(`
|
|
71
|
-
`);return a.length>n?a.slice(0,n)+"...":a}function Jl(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=be(r),i=n+o.length;if(t>=n&&t<i)return r.formatting||{};n=i;}else if(r.type==="hyperlink"){let o=Ee(r),i=n+o.length;if(t>=n&&t<i){for(let a of r.children)if(a.type==="run")return a.formatting||{}}n=i;}return {}}function Kl(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=be(r);n+=o.length;}else if(r.type==="hyperlink"){let o=Ee(r),i=n,a=n+o.length;if(t>=i&&t<a)return true;n=a;}return false}function Ql(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=be(r);n+=o.length;}else if(r.type==="hyperlink"){let o=Ee(r),i=n,a=n+o.length;if(t>=i&&t<a)return r;n=a;}}function ec(e){return e?e.toLowerCase().includes("heading"):false}function tc(e){if(!e)return;let t=e.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function nc(e){for(let t of e.content)if(t.type==="paragraph"){for(let n of t.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}function rc(e){for(let t of e.content)if(t.type==="paragraph"){for(let n of t.content)if(n.type==="hyperlink")return true}return false}function oc(e){return e.content.some(t=>t.type==="table")}function co(e){return e.content.filter(t=>t.type==="paragraph")}function ic(e,t){return co(e)[t]}function ac(e,t){let n=0;for(let r=0;r<e.content.length;r++)if(e.content[r].type==="paragraph"){if(n===t)return r;n++;}return -1}function sc(){return [{styleId:"Normal",type:"paragraph",name:"Normal",default:true,qFormat:true,uiPriority:0,rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},{styleId:"Title",type:"paragraph",name:"Title",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:10,rPr:{fontSize:52,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Subtitle",type:"paragraph",name:"Subtitle",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:11,rPr:{fontSize:30,color:{rgb:"666666"},fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Heading1",type:"paragraph",name:"Heading 1",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:40,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:400,spaceAfter:120,lineSpacing:240}},{styleId:"Heading2",type:"paragraph",name:"Heading 2",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:32,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:360,spaceAfter:80,lineSpacing:240}},{styleId:"Heading3",type:"paragraph",name:"Heading 3",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:28,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:320,spaceAfter:80,lineSpacing:240}},{styleId:"Heading4",type:"paragraph",name:"Heading 4",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:24,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:280,spaceAfter:80,lineSpacing:240}}]}function lc(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function uo(e={}){let t=lc();e.pageWidth!==void 0&&(t.pageWidth=e.pageWidth),e.pageHeight!==void 0&&(t.pageHeight=e.pageHeight),e.orientation!==void 0&&(t.orientation=e.orientation),e.marginTop!==void 0&&(t.marginTop=e.marginTop),e.marginBottom!==void 0&&(t.marginBottom=e.marginBottom),e.marginLeft!==void 0&&(t.marginLeft=e.marginLeft),e.marginRight!==void 0&&(t.marginRight=e.marginRight);let n={type:"text",text:e.initialText||""};return {package:{document:{content:[{type:"paragraph",content:[{type:"run",content:e.initialText?[n]:[],formatting:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}}}],formatting:{lineSpacing:276}}],finalSectionProperties:t},styles:{docDefaults:{rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},styles:sc()}},templateVariables:[],warnings:[]}}function cc(e,t={}){return uo({...t,initialText:e})}var fo={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},uc={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:""},Wt={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 po(e){if(!e)return 1;let t=parseInt(e,16);return isNaN(t)?1:t/255}function fe(e){let t=e.padStart(6,"0").slice(0,6),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16);return {r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(o)?0:o}}function Ut(e,t,n){let r=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return `${r(e)}${r(t)}${r(n)}`.toUpperCase()}function mo(e,t){if(t>=1)return e;if(t<=0)return "FFFFFF";let n=fe(e);return Ut(Math.min(255,Math.max(0,Math.round(n.r*t+255*(1-t)))),Math.min(255,Math.max(0,Math.round(n.g*t+255*(1-t)))),Math.min(255,Math.max(0,Math.round(n.b*t+255*(1-t)))))}function go(e,t){if(t>=1)return e;if(t<=0)return "000000";let n=fe(e);return Ut(Math.min(255,Math.max(0,Math.round(n.r*t))),Math.min(255,Math.max(0,Math.round(n.g*t))),Math.min(255,Math.max(0,Math.round(n.b*t))))}function fc(e,t){let n=Wt[t]??t,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],o=i=>r.includes(i);return e?.colorScheme?o(n)?e.colorScheme[n]??fo[n]??"000000":"000000":o(n)?fo[n]??"000000":"000000"}function ho(e){if(!e)return null;let t=e.toLowerCase();return Wt[e]??Wt[t]??null}function J(e,t,n="000000"){if(!e)return `#${n}`;if(e.auto)return `#${n}`;let r;if(e.themeColor){let o=ho(e.themeColor);if(o?r=fc(t,o):r=e.rgb??n,e.themeTint){let i=po(e.themeTint);r=mo(r,i);}else if(e.themeShade){let i=po(e.themeShade);r=go(r,i);}}else e.rgb?r=e.rgb==="auto"?n:e.rgb:r=n;return `#${r.toUpperCase().replace(/^#/,"")}`}function pc(e){if(!e||e==="none")return "";let t=uc[e];return t?`#${t}`:""}function dc(e,t){return e?e.auto?"transparent":J(e,t):""}function mc(e,t){if(!e)return false;if(e.auto)return true;let r=J(e,t).replace(/^#/,"").toLowerCase(),o=fe(r);return (o.r+o.g+o.b)/3<20}function gc(e,t){if(!e)return false;let r=J(e,t).replace(/^#/,"").toLowerCase(),o=fe(r);return (o.r+o.g+o.b)/3>235}function hc(e,t){if(!e)return "#000000";let r=J(e,t).replace(/^#/,""),o=fe(r);return (.299*o.r+.587*o.g+.114*o.b)/255>.5?"#000000":"#FFFFFF"}function wc(e){if(!e)return;let t=e.trim();if(t.toLowerCase()==="auto")return {auto:true};let n=ho(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(i=>i+i).join("")}:{rgb:r.padStart(6,"0").slice(0,6)}}function xc(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 yc(e){return {rgb:e.replace(/^#/,"").toUpperCase()}}function bc(e,t,n){let o=J(e,t).replace(/^#/,""),i=1-n/100;return `#${go(o,i)}`}function Tc(e,t,n){let o=J(e,t).replace(/^#/,""),i=1-n/100;return `#${mo(o,i)}`}function Cc(e,t,n,r){let o=J(e,r).replace(/^#/,""),i=J(t,r).replace(/^#/,""),a=fe(o),s=fe(i),c={r:Math.round(a.r*(1-n)+s.r*n),g:Math.round(a.g*(1-n)+s.g*n),b:Math.round(a.b*(1-n)+s.b*n)};return `#${Ut(c.r,c.g,c.b)}`}function Pc(e,t,n){if(!e&&!t)return true;if(!e||!t)return false;let r=J(e,n).toUpperCase(),o=J(t,n).toUpperCase();return r===o}function wo(e){return typeof e=="object"&&e!==null&&("_def"in e||"parse"in e||"safeParse"in e)}function Rc(e){return {start:e,end:e,collapsed:true}}function Ic(e,t){return {start:e,end:t,collapsed:e.paragraphIndex===t.paragraphIndex&&e.offset===t.offset}}function Ec(e,t){return !(e.paragraphIndex<t.start.paragraphIndex||e.paragraphIndex===t.start.paragraphIndex&&e.offset<t.start.offset||e.paragraphIndex>t.end.paragraphIndex||e.paragraphIndex===t.end.paragraphIndex&&e.offset>t.end.offset)}function Ac(e,t){return e.paragraphIndex<t.paragraphIndex?-1:e.paragraphIndex>t.paragraphIndex?1:e.offset<t.offset?-1:e.offset>t.offset?1:0}function Mc(e){return {askAI:"Ask AI",rewrite:"Rewrite",expand:"Expand",summarize:"Summarize",translate:"Translate",explain:"Explain",fixGrammar:"Fix Grammar",makeFormal:"Make Formal",makeCasual:"Make Casual",custom:"Custom Prompt"}[e]}function Bc(e){return {askAI:"Ask AI a question about this text",rewrite:"Rewrite this text in a different way",expand:"Expand this text with more details",summarize:"Summarize this text to be shorter",translate:"Translate this text to another language",explain:"Explain what this text means",fixGrammar:"Fix grammar and spelling errors",makeFormal:"Make the tone more formal",makeCasual:"Make the tone more casual",custom:"Enter a custom prompt"}[e]}var $c=["askAI","rewrite","expand","summarize","translate","explain"];function Dc(e){return {...e,id:Nc()}}function Nc(){return `cmd_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}var Sp="0.0.2";exports.$=Kl;exports.A=Aa;exports.Aa=Ic;exports.B=Ma;exports.Ba=Ec;exports.C=Ba;exports.Ca=Ac;exports.D=$a;exports.Da=Mc;exports.E=Na;exports.Ea=Bc;exports.F=nt;exports.Fa=$c;exports.G=Re;exports.Ga=Dc;exports.H=fl;exports.Ha=Sp;exports.I=pl;exports.J=ao;exports.K=dl;exports.L=Ot;exports.M=so;exports.N=El;exports.O=Al;exports.P=Y;exports.Q=be;exports.R=Ee;exports.S=lo;exports.T=Vl;exports.U=_t;exports.V=_l;exports.W=Wl;exports.X=Gl;exports.Y=ql;exports.Z=Yl;exports._=Jl;exports.a=un;exports.aa=Ql;exports.b=pn;exports.ba=ec;exports.c=Ce;exports.ca=tc;exports.d=ze;exports.da=nc;exports.e=_i;exports.ea=rc;exports.f=Tt;exports.fa=oc;exports.g=kn;exports.ga=co;exports.h=Ct;exports.ha=ic;exports.i=Pt;exports.ia=ac;exports.j=ge;exports.ja=uo;exports.k=En;exports.ka=cc;exports.l=An;exports.la=J;exports.m=je;exports.ma=pc;exports.n=Ft;exports.na=dc;exports.o=ea;exports.oa=mc;exports.p=ta;exports.pa=gc;exports.q=na;exports.qa=hc;exports.r=ra;exports.ra=wc;exports.s=oa;exports.sa=xc;exports.t=ia;exports.ta=yc;exports.u=aa;exports.ua=bc;exports.v=sa;exports.va=Tc;exports.w=va;exports.wa=Cc;exports.x=Ra;exports.xa=Pc;exports.y=Ia;exports.ya=wo;exports.z=Ea;exports.za=Rc;
|