@eigenpal/docx-js-editor 0.0.14 → 0.0.16
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/chunk-24N3L4IL.cjs +258 -0
- package/dist/{chunk-JGPRSZPI.cjs → chunk-46OFHSPJ.cjs} +1 -1
- package/dist/{chunk-UAME5JHZ.cjs → chunk-65OFYOHF.cjs} +2 -2
- package/dist/chunk-DYQUXFE5.cjs +1 -0
- package/dist/chunk-GLFFXY2X.js +258 -0
- package/dist/chunk-JKN7TNPA.js +12 -0
- package/dist/chunk-NO7WUK5E.cjs +12 -0
- package/dist/{chunk-JS7TPZTF.cjs → chunk-RM3ITJ2H.cjs} +2 -2
- package/dist/{chunk-3VOXZKGT.js → chunk-ULNHBTYA.js} +1 -1
- package/dist/{chunk-L7UKJGRK.js → chunk-UXXV4GT6.js} +1 -1
- package/dist/chunk-WFYRA2TH.js +1 -0
- package/dist/{chunk-7H2HP242.js → chunk-YMXKVLTU.js} +1 -1
- package/dist/core-plugins.cjs +1 -1
- package/dist/core-plugins.js +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/headless.cjs +2 -2
- package/dist/headless.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/mcp-cli.js +20 -20
- package/dist/mcp.cjs +3 -3
- package/dist/mcp.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/selectionRects-PQEUEW35.cjs +1 -0
- package/dist/selectionRects-QAG5RSHD.js +1 -0
- package/package.json +10 -42
- package/dist/chunk-5MWH4N7I.js +0 -12
- package/dist/chunk-5WBRHVOE.js +0 -258
- package/dist/chunk-IHZIA6JP.cjs +0 -12
- package/dist/chunk-QVVLXLRZ.cjs +0 -258
- package/dist/chunk-S6FZ7HL6.js +0 -1
- package/dist/chunk-Y37VT37I.cjs +0 -1
- package/dist/selectionRects-42JURU6D.js +0 -1
- package/dist/selectionRects-XGMQBMC5.cjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkNT2REEAA_cjs=require('./chunk-NT2REEAA.cjs'),
|
|
1
|
+
'use strict';var chunkNT2REEAA_cjs=require('./chunk-NT2REEAA.cjs'),chunk65OFYOHF_cjs=require('./chunk-65OFYOHF.cjs'),chunkFYAWM7MP_cjs=require('./chunk-FYAWM7MP.cjs'),chunkNO7WUK5E_cjs=require('./chunk-NO7WUK5E.cjs'),chunkVOWKSURW_cjs=require('./chunk-VOWKSURW.cjs');var m=class i{constructor(t){chunkVOWKSURW_cjs.d(this,"_document");chunkVOWKSURW_cjs.d(this,"_pendingVariables");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 e=await chunkNO7WUK5E_cjs.p(t);return new i(e)}static fromDocument(t){return new i(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return chunkNT2REEAA_cjs.a(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let o=r;e.push({id:n,name:o.name||n,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.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 e=this._document.package.document,n=e.content.filter(a=>a.type==="paragraph"),r=n.map((a,s)=>{let u=this._getParagraphText(a),c=a.formatting?.styleId;return {index:s,preview:u.slice(0,t),style:c,isHeading:c?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(c),isListItem:!!a.listRendering,isEmpty:u.trim().length===0}}),o=(e.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:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:o,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let o={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(o)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-525HZL4S.cjs'),o=r(n,e),a=await chunkNO7WUK5E_cjs.p(o),s=new i(a);return s._pendingVariables={},s}async toBuffer(){return this._document.originalBuffer?chunk65OFYOHF_cjs.d(this._document):chunk65OFYOHF_cjs.e(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){let e=chunkFYAWM7MP_cjs.b(this._document,t);return new i(e)}_executeCommand(t){let e=chunkFYAWM7MP_cjs.a(this._document,t),n=new i(e);return n._pendingVariables={...this._pendingVariables},n}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
|
|
2
2
|
`)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let o of r.content)o.type==="paragraph"&&e.push(this._getParagraphText(o));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let r=this._getRunText(n);r&&e.push({text:r,formatting:n.formatting});}else if(n.type==="hyperlink"){let r=n.href||"";for(let o of n.children)if(o.type==="run"){let a=this._getRunText(o);a&&e.push({text:a,formatting:o.formatting,isHyperlink:true,hyperlinkUrl:r});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function A(i){return m.fromBuffer(i)}function T(i){return m.fromDocument(i)}exports.a=m;exports.b=A;exports.c=T;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict';var chunkIHZIA6JP_cjs=require('./chunk-IHZIA6JP.cjs'),k=require('jszip');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var k__default=/*#__PURE__*/_interopDefault(k);function h(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function J(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 K(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 v(e){if(!e)return "";let t=[];if(e.styleId&&t.push(`<w:rStyle w:val="${h(e.styleId)}"/>`),e.fontFamily){let i=[];e.fontFamily.ascii&&i.push(`w:ascii="${h(e.fontFamily.ascii)}"`),e.fontFamily.hAnsi&&i.push(`w:hAnsi="${h(e.fontFamily.hAnsi)}"`),e.fontFamily.eastAsia&&i.push(`w:eastAsia="${h(e.fontFamily.eastAsia)}"`),e.fontFamily.cs&&i.push(`w:cs="${h(e.fontFamily.cs)}"`),e.fontFamily.asciiTheme&&i.push(`w:asciiTheme="${e.fontFamily.asciiTheme}"`),e.fontFamily.hAnsiTheme&&i.push(`w:hAnsiTheme="${e.fontFamily.hAnsiTheme}"`),e.fontFamily.eastAsiaTheme&&i.push(`w:eastAsiaTheme="${e.fontFamily.eastAsiaTheme}"`),e.fontFamily.csTheme&&i.push(`w:csTheme="${e.fontFamily.csTheme}"`),i.length>0&&t.push(`<w:rFonts ${i.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=J(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"&&new Set(["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","white","yellow"]).has(e.highlight)&&t.push(`<w:highlight w:val="${e.highlight}"/>`),e.underline){let i=[`w:val="${e.underline.style}"`];e.underline.color&&(e.underline.color.rgb&&i.push(`w:color="${e.underline.color.rgb}"`),e.underline.color.themeColor&&i.push(`w:themeColor="${e.underline.color.themeColor}"`)),t.push(`<w:u ${i.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=K(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 Q(e){return `<w:t${e.preserveSpace||e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${h(e.text)}</w:t>`}function ee(e){return "<w:tab/>"}function te(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 ne(e){return `<w:sym w:font="${h(e.font)}" w:char="${h(e.char)}"/>`}function re(e){return e.type==="footnoteRef"?`<w:footnoteReference w:id="${e.id}"/>`:`<w:endnoteReference w:id="${e.id}"/>`}function ie(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 se(e){return `<w:instrText${e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${h(e.text)}</w:instrText>`}function oe(e){return "<w:softHyphen/>"}function ae(e){return "<w:noBreakHyphen/>"}function D(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 ce(e){if(!e||e.type==="none")return "<a:noFill/>";if(e.type==="solid"&&e.color)return `<a:solidFill>${D(e.color)}</a:solidFill>`;if(e.type==="gradient"&&e.gradient){let t=e.gradient,n=t.stops.map(i=>`<a:gs pos="${i.position}">${D(i.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 E(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>${D(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 I(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 X(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 le(e){let t=e.size.width,n=e.size.height,r=e.rId||"rId1",i=e.id||"0",s=e.filename||`image${i}`,o="";return e.transform?.rotation&&(o+=` rot="${Math.round(e.transform.rotation*6e4)}"`),e.transform?.flipH&&(o+=' flipH="1"'),e.transform?.flipV&&(o+=' 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="${h(s)}"${e.alt?` descr="${h(e.alt)}"`:""}/>`,"<pic:cNvPicPr/>","</pic:nvPicPr>","<pic:blipFill>",`<a:blip r:embed="${r}"/>`,"<a:stretch><a:fillRect/></a:stretch>","</pic:blipFill>","<pic:spPr>",`<a:xfrm${o}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${t}" cy="${n}"/>`,"</a:xfrm>",'<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>',e.outline?E(e.outline):"","</pic:spPr>","</pic:pic>","</a:graphicData>","</a:graphic>"].join("")}function pe(e){let t=e.image,n=t.wrap.type!=="inline",r=t.size.width,i=t.size.height,s=t.padding?.top??t.wrap.distT??0,o=t.padding?.bottom??t.wrap.distB??0,a=t.padding?.left??t.wrap.distL??0,l=t.padding?.right??t.wrap.distR??0,p=t.id||"1",c=t.title||t.filename||`Picture ${p}`,u=le(t);if(!n)return ["<w:drawing>",`<wp:inline distT="${s}" distB="${o}" distL="${a}" distR="${l}">`,`<wp:extent cx="${r}" cy="${i}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${p}" name="${h(c)}"${t.alt?` descr="${h(t.alt)}"`:""}${t.decorative?' hidden="1"':""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',u,"</wp:inline>","</w:drawing>"].join("");let f=t.wrap.type==="behind"?"1":"0",g=t.position?I(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',b=X(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${s}" distB="${o}" distL="${a}" distR="${l}" simplePos="0" relativeHeight="251658240" behindDoc="${f}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',g,`<wp:extent cx="${r}" cy="${i}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',b,`<wp:docPr id="${p}" name="${h(c)}"${t.alt?` descr="${h(t.alt)}"`:""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',u,"</wp:anchor>","</w:drawing>"].join("")}function ue(e){return e.map(t=>$(t)).join("")}function fe(e){let t=e.shape,n=t.size.width,r=t.size.height,i=t.shapeType==="textBox",s=t.wrap&&t.wrap.type!=="inline",o=t.wrap?.distT??0,a=t.wrap?.distB??0,l=t.wrap?.distL??0,p=t.wrap?.distR??0,c=t.id||"1",u=t.name||(i?`TextBox ${c}`:`Shape ${c}`),f="";t.transform?.rotation&&(f+=` rot="${Math.round(t.transform.rotation*6e4)}"`),t.transform?.flipH&&(f+=' flipH="1"'),t.transform?.flipV&&(f+=' flipV="1"');let g=["<wps:spPr>",`<a:xfrm${f}>`,'<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>`,ce(t.fill),E(t.outline),"</wps:spPr>"].join(""),b="";if(t.textBody){let d=t.textBody,y=['rot="0"','vert="horz"'];d.anchor&&y.push(`anchor="${d.anchor==="middle"?"ctr":d.anchor}"`),d.anchorCenter&&y.push('anchorCtr="1"'),d.margins&&(d.margins.left!=null&&y.push(`lIns="${d.margins.left}"`),d.margins.top!=null&&y.push(`tIns="${d.margins.top}"`),d.margins.right!=null&&y.push(`rIns="${d.margins.right}"`),d.margins.bottom!=null&&y.push(`bIns="${d.margins.bottom}"`)),i?b=["<wps:txbx><w:txbxContent>",ue(d.content),"</w:txbxContent></wps:txbx>",`<wps:bodyPr ${y.join(" ")}/>`].join(""):b=[`<wps:bodyPr ${y.join(" ")}/>`].join("");}let j=['<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${i?' txBox="1"':""}/>`,g,b,"</wps:wsp>"].join(""),"</a:graphicData>","</a:graphic>"].join("");if(!s)return ["<w:drawing>",`<wp:inline distT="${o}" distB="${a}" distL="${l}" distR="${p}">`,`<wp:extent cx="${n}" cy="${r}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${c}" name="${h(u)}"/>`,"<wp:cNvGraphicFramePr/>",j,"</wp:inline>","</w:drawing>"].join("");let q=t.wrap?.type==="behind"?"1":"0",Z=t.position?I(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',Y=X(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${o}" distB="${a}" distL="${l}" distR="${p}" simplePos="0" relativeHeight="251658240" behindDoc="${q}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',Z,`<wp:extent cx="${n}" cy="${r}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',Y,`<wp:docPr id="${c}" name="${h(u)}"/>`,"<wp:cNvGraphicFramePr/>",j,"</wp:anchor>","</w:drawing>"].join("")}function he(e){switch(e.type){case "text":return Q(e);case "tab":return ee();case "break":return te(e);case "symbol":return ne(e);case "footnoteRef":case "endnoteRef":return re(e);case "fieldChar":return ie(e);case "instrText":return se(e);case "softHyphen":return oe();case "noBreakHyphen":return ae();case "drawing":return pe(e);case "shape":return fe(e);default:return ""}}function x(e){let t=[],n=v(e.formatting);n&&t.push(n);for(let r of e.content){let i=he(r);i&&t.push(i);}return `<w:r>${t.join("")}</w:r>`}function m(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function P(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 me(e){if(!e)return "";let t=[];if(e.top){let n=P(e.top,"top");n&&t.push(n);}if(e.left){let n=P(e.left,"left");n&&t.push(n);}if(e.bottom){let n=P(e.bottom,"bottom");n&&t.push(n);}if(e.right){let n=P(e.right,"right");n&&t.push(n);}if(e.between){let n=P(e.between,"between");n&&t.push(n);}if(e.bar){let n=P(e.bar,"bar");n&&t.push(n);}return t.length===0?"":`<w:pBdr>${t.join("")}</w:pBdr>`}function de(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 we(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 ge(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 ye(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 xe(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 $e(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 Te(e){if(!e)return "";let t=[];e.styleId&&t.push(`<w:pStyle w:val="${m(e.styleId)}"/>`),e.keepNext&&t.push("<w:keepNext/>"),e.keepLines&&t.push("<w:keepLines/>"),e.contextualSpacing&&t.push("<w:contextualSpacing/>"),e.pageBreakBefore&&t.push("<w:pageBreakBefore/>");let n=$e(e.frame);n&&t.push(n),e.widowControl===false?t.push('<w:widowControl w:val="0"/>'):e.widowControl===true&&t.push("<w:widowControl/>");let r=xe(e.numPr);r&&t.push(r);let i=me(e.borders);i&&t.push(i);let s=de(e.shading);s&&t.push(s);let o=we(e.tabs);o&&t.push(o),e.suppressLineNumbers&&t.push("<w:suppressLineNumbers/>"),e.suppressAutoHyphens&&t.push("<w:suppressAutoHyphens/>");let a=ge(e);a&&t.push(a);let l=ye(e);if(l&&t.push(l),e.bidi&&t.push("<w:bidi/>"),e.alignment&&t.push(`<w:jc w:val="${e.alignment}"/>`),e.outlineLevel!==void 0&&t.push(`<w:outlineLvl w:val="${e.outlineLevel}"/>`),e.runProperties){let p=v(e.runProperties);p&&t.push(p);}return t.length===0?"":`<w:pPr>${t.join("")}</w:pPr>`}function R(e){let t=[];e.rId&&t.push(`r:id="${e.rId}"`),e.anchor&&t.push(`w:anchor="${m(e.anchor)}"`),e.tooltip&&t.push(`w:tooltip="${m(e.tooltip)}"`),e.target&&t.push(`w:tgtFrame="${m(e.target)}"`),e.history===false&&t.push('w:history="0"'),e.docLocation&&t.push(`w:docLocation="${m(e.docLocation)}"`);let n=e.children.map(i=>i.type==="run"?x(i):i.type==="bookmarkStart"?O(i):i.type==="bookmarkEnd"?M(i):"").join("");return `<w:hyperlink${t.length>0?" "+t.join(" "):""}>${n}</w:hyperlink>`}function O(e){let t=[`w:id="${e.id}"`,`w:name="${m(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 M(e){return `<w:bookmarkEnd w:id="${e.id}"/>`}function be(e){let t=[],n=e.content.find(a=>a.type==="run"),r=n?.formatting?v(n.formatting):"",i=['w:fldCharType="begin"'];e.fldLock&&i.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${i.join(" ")}/></w:r>`);let o=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${o}>${m(e.instruction)}</w:instrText></w:r>`),t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`);for(let a of e.content)a.type==="run"&&t.push(x(a));return t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function Pe(e){let t=[],n=e.fieldResult?.[0]?.formatting,r=n?v(n):"",i=['w:fldCharType="begin"'];if(e.fldLock&&i.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${i.join(" ")}/></w:r>`),e.fieldCode.length>0)t.push(...e.fieldCode.map(s=>x(s)));else {let o=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${o}>${m(e.instruction)}</w:instrText></w:r>`);}return t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`),t.push(...e.fieldResult.map(s=>x(s))),t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function Ce(e){let t=e.properties,n=[];switch(t.alias&&n.push(`<w:alias w:val="${m(t.alias)}"/>`),t.tag&&n.push(`<w:tag w:val="${m(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="${m(t.dateFormat)}"/>`):n.push("<w:date/>");break;case "dropdown":{let i=(t.listItems??[]).map(s=>`<w:listItem w:displayText="${m(s.displayText)}" w:value="${m(s.value)}"/>`).join("");n.push(`<w:dropDownList>${i}</w:dropDownList>`);break}case "comboBox":{let i=(t.listItems??[]).map(s=>`<w:listItem w:displayText="${m(s.displayText)}" w:value="${m(s.value)}"/>`).join("");n.push(`<w:comboBox>${i}</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(i=>i.type==="run"?x(i):i.type==="hyperlink"?R(i):"").join("");return `<w:sdt><w:sdtPr>${n.join("")}</w:sdtPr><w:sdtContent>${r}</w:sdtContent></w:sdt>`}function L(e,t){let n=t.info,r=[`w:id="${n.id}"`,`w:author="${m(n.author)}"`];n.date&&r.push(`w:date="${m(n.date)}"`);let i=t.content.map(s=>s.type==="run"?x(s):s.type==="hyperlink"?R(s):"").join("");return `<w:${e} ${r.join(" ")}>${i}</w:${e}>`}function ve(e){switch(e.type){case "run":return x(e);case "hyperlink":return R(e);case "bookmarkStart":return O(e);case "bookmarkEnd":return M(e);case "simpleField":return be(e);case "complexField":return Pe(e);case "inlineSdt":return Ce(e);case "commentRangeStart":return `<w:commentRangeStart w:id="${e.id}"/>`;case "commentRangeEnd":return `<w:commentRangeEnd w:id="${e.id}"/>`;case "insertion":return L("ins",e);case "deletion":return L("del",e);case "mathEquation":return e.ommlXml||"";default:return ""}}function $(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(" "):"",i=Te(e.formatting);i&&t.push(i);for(let s of e.content){let o=ve(s);o&&t.push(o);}return `<w:p${r}>${t.join("")}</w:p>`}function Fe(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function T(e,t){if(!e)return "";let n=[`w:w="${e.value}"`,`w:type="${e.type}"`];return `<w:${t} ${n.join(" ")}/>`}function C(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 H(e,t){if(!e)return "";let n=[];if(e.top){let r=C(e.top,"top");r&&n.push(r);}if(e.left){let r=C(e.left,"left");r&&n.push(r);}if(e.bottom){let r=C(e.bottom,"bottom");r&&n.push(r);}if(e.right){let r=C(e.right,"right");r&&n.push(r);}if(e.insideH){let r=C(e.insideH,"insideH");r&&n.push(r);}if(e.insideV){let r=C(e.insideV,"insideV");r&&n.push(r);}return n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function N(e,t){if(!e)return "";let n=[];return e.top&&n.push(T(e.top,"top")),e.left&&n.push(T(e.left,"left")),e.bottom&&n.push(T(e.bottom,"bottom")),e.right&&n.push(T(e.right,"right")),n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function W(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 Se(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 Ae(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 Be(e){if(!e)return "";let t=[];e.styleId&&t.push(`<w:tblStyle w:val="${Fe(e.styleId)}"/>`);let n=Ae(e.floating);n&&t.push(n),e.bidi&&t.push("<w:bidiVisual/>");let r=T(e.width,"tblW");r&&t.push(r),e.justification&&t.push(`<w:jc w:val="${e.justification}"/>`);let i=T(e.cellSpacing,"tblCellSpacing");i&&t.push(i);let s=T(e.indent,"tblInd");s&&t.push(s);let o=H(e.borders,"tblBorders");o&&t.push(o);let a=N(e.cellMargins,"tblCellMar");a&&t.push(a),e.layout&&t.push(`<w:tblLayout w:type="${e.layout}"/>`);let l=W(e.shading);l&&t.push(l);let p=Se(e.look);return p&&t.push(p),e.overlap&&t.push(`<w:tblOverlap w:val="${e.overlap}"/>`),t.length===0?"":`<w:tblPr>${t.join("")}</w:tblPr>`}function De(e){if(!e)return "";let t=[];if(e.cantSplit&&t.push("<w:cantSplit/>"),e.header&&t.push("<w:tblHeader/>"),e.height){let n=[`w:val="${e.height.value}"`];e.heightRule&&n.push(`w:hRule="${e.heightRule}"`),t.push(`<w:trHeight ${n.join(" ")}/>`);}return e.justification&&t.push(`<w:jc w:val="${e.justification}"/>`),e.hidden&&t.push("<w:hidden/>"),t.length===0?"":`<w:trPr>${t.join("")}</w:trPr>`}function Re(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 ze(e){if(!e)return "";let t=[],n=Re(e.conditionalFormat);n&&t.push(n);let r=T(e.width,"tcW");r&&t.push(r),e.gridSpan&&e.gridSpan>1&&t.push(`<w:gridSpan w:val="${e.gridSpan}"/>`),e.vMerge&&(e.vMerge==="restart"?t.push('<w:vMerge w:val="restart"/>'):t.push("<w:vMerge/>"));let i=H(e.borders,"tcBorders");i&&t.push(i);let s=W(e.shading);s&&t.push(s),e.noWrap&&t.push("<w:noWrap/>");let o=N(e.margins,"tcMar");return o&&t.push(o),e.textDirection&&t.push(`<w:textDirection w:val="${e.textDirection}"/>`),e.fitText&&t.push("<w:tcFitText/>"),e.verticalAlign&&t.push(`<w:vAlign w:val="${e.verticalAlign}"/>`),e.hideMark&&t.push("<w:hideMark/>"),t.length===0?"":`<w:tcPr>${t.join("")}</w:tcPr>`}function ke(e){return !e||e.length===0?"":`<w:tblGrid>${e.map(n=>`<w:gridCol w:w="${n}"/>`).join("")}</w:tblGrid>`}function je(e){let t=[];for(let n of e)n.type==="paragraph"?t.push($(n)):n.type==="table"&&t.push(F(n));return t.length===0&&t.push("<w:p/>"),t.join("")}function Ee(e){let t=[],n=ze(e.formatting);return n&&t.push(n),t.push(je(e.content)),`<w:tc>${t.join("")}</w:tc>`}function Ie(e){let t=[],n=De(e.formatting);n&&t.push(n);for(let r of e.cells)t.push(Ee(r));return `<w:tr>${t.join("")}</w:tr>`}function F(e){let t=[],n=Be(e.formatting);n&&t.push(n);let r=ke(e.columnWidths);r&&t.push(r);for(let i of e.rows)t.push(Ie(i));return `<w:tbl>${t.join("")}</w:tbl>`}var w={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 Xe(){let e={wpc:w.wpc,mc:w.mc,o:w.o,r:w.r,m:w.m,v:w.v,wp14:w.wp14,wp:w.wp,w10:w.w10,w:w.w,w14:w.w14,w15:w.w15,wpg:w.wpg,wps:w.wps};return Object.entries(e).map(([t,n])=>`xmlns:${t}="${n}"`).join(" ")}function S(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 Le(e){return `<w:headerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function Oe(e){return `<w:footerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function Me(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 He(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 Ne(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 We(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 Ge(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(i=>{let s=[];return i.width!==void 0&&s.push(`w:w="${i.width}"`),i.space!==void 0&&s.push(`w:space="${i.space}"`),`<w:col ${s.join(" ")}/>`}).join("")),t.length===0&&!n?"":`<w:cols${t.length>0?" "+t.join(" "):""}>${n}</w:cols>`}function Ve(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 _e(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 s=S(t.top,"top");s&&r.push(s);}if(t.left){let s=S(t.left,"left");s&&r.push(s);}if(t.bottom){let s=S(t.bottom,"bottom");s&&r.push(s);}if(t.right){let s=S(t.right,"right");s&&r.push(s);}return r.length===0?"":`<w:pgBorders${n.length>0?" "+n.join(" "):""}>${r.join("")}</w:pgBorders>`}function Ue(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 qe(e){if(!e)return "";let t=[];if(e.headerReferences)for(let c of e.headerReferences)t.push(Le(c));if(e.footerReferences)for(let c of e.footerReferences)t.push(Oe(c));let n=Me(e.footnotePr);n&&t.push(n);let r=He(e.endnotePr);r&&t.push(r),e.sectionStart&&t.push(`<w:type w:val="${e.sectionStart}"/>`);let i=Ne(e);i&&t.push(i);let s=We(e);if(s&&t.push(s),e.paperSrcFirst!==void 0||e.paperSrcOther!==void 0){let c=[];e.paperSrcFirst!==void 0&&c.push(`w:first="${e.paperSrcFirst}"`),e.paperSrcOther!==void 0&&c.push(`w:other="${e.paperSrcOther}"`),t.push(`<w:paperSrc ${c.join(" ")}/>`);}let o=_e(e);o&&t.push(o);let a=Ve(e);a&&t.push(a);let l=Ge(e);l&&t.push(l);let p=Ue(e);return p&&t.push(p),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 G(e){if(e.type==="paragraph")return $(e);if(e.type==="table")return F(e);if(e.type==="blockSdt"){let t=e.content.map(i=>G(i)).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 Ze(e){return e.map(t=>G(t)).join("")}function Ye(e){let t=[];return t.push(Ze(e.content)),e.finalSectionProperties&&t.push(qe(e.finalSectionProperties)),t.join("")}function V(e){let t=[];t.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');let n=Xe();return t.push(`<w:document ${n} mc:Ignorable="w14 w15 wp14">`),t.push("<w:body>"),t.push(Ye(e.package.document)),t.push("</w:body>"),t.push("</w:document>"),t.join("")}var Je={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 Ke(){return Object.entries(Je).map(([e,t])=>`xmlns:${e}="${t}"`).join(" ")}function Qe(e){return e.type==="paragraph"?$(e):e.type==="table"?F(e):""}function z(e){let t=e.type==="header"?"w:hdr":"w:ftr",n=Ke(),r=e.content.map(i=>Qe(i)).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 U(e){let t=[];for(let n of e)if(n.type==="paragraph"){for(let r of n.content)if(r.type==="run")for(let i of r.content)i.type==="drawing"&&i.image.src?.startsWith("data:")&&t.push(i.image);}else if(n.type==="table")for(let r of n.rows)for(let i of r.cells)t.push(...U(i.content));return t}var et={"image/png":"png","image/jpeg":"jpeg","image/gif":"gif","image/bmp":"bmp","image/tiff":"tiff","image/webp":"webp","image/svg+xml":"svg"};function tt(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 i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return {data:r.buffer,extension:et[t[1]]||"png"}}async function nt(e,t,n){if(e.length===0)return;let r="word/_rels/document.xml.rels",i=t.file(r);if(!i)return;let s=await i.async("text"),o=0;for(let c of s.matchAll(/Id="rId(\d+)"/g)){let u=parseInt(c[1],10);u>o&&(o=u);}let a=0;t.forEach(c=>{let u=c.match(/^word\/media\/image(\d+)\./);if(u){let f=parseInt(u[1],10);f>a&&(a=f);}});let l=[],p=new Set;for(let c of e){let{data:u,extension:f}=tt(c.src);a++,o++;let g=`image${a}.${f}`,b=`word/media/${g}`,A=`rId${o}`;t.file(b,u,{compression:"DEFLATE",compressionOptions:{level:n}}),l.push(`<Relationship Id="${A}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/${g}"/>`),p.add(f),c.rId=A;}if(l.length>0&&(s=s.replace("</Relationships>",l.join("")+"</Relationships>"),t.file(r,s,{compression:"DEFLATE",compressionOptions:{level:n}})),p.size>0){let c=t.file("[Content_Types].xml");if(c){let u=await c.async("text");for(let f of p)if(!u.includes(`Extension="${f}"`)){let g=ot(f);u=u.replace("</Types>",`<Default Extension="${f}" ContentType="${g}"/></Types>`);}t.file("[Content_Types].xml",u,{compression:"DEFLATE",compressionOptions:{level:n}});}}}async function rt(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:i}=t,s=await k__default.default.loadAsync(e.originalBuffer),o=new k__default.default;for(let[c,u]of Object.entries(s.files)){if(u.dir){o.folder(c.replace(/\/$/,""));continue}let f=await u.async("arraybuffer");o.file(c,f,{compression:"DEFLATE",compressionOptions:{level:n}});}let a=U(e.package.document.content);await nt(a,o,n);let l=V(e);if(o.file("word/document.xml",l,{compression:"DEFLATE",compressionOptions:{level:n}}),it(e,o,n),r){let c="docProps/core.xml",u=s.file(c);if(u){let f=await u.async("text"),g=st(f,{updateModifiedDate:r,modifiedBy:i});o.file(c,g,{compression:"DEFLATE",compressionOptions:{level:n}});}}return await o.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:n}})}function it(e,t,n){let r=e.package.relationships;if(!r)return;let i={level:n};if(e.package.headers)for(let[s,o]of e.package.headers.entries()){let a=r.get(s);if(a&&a.type===
|
|
1
|
+
'use strict';var chunkNO7WUK5E_cjs=require('./chunk-NO7WUK5E.cjs'),k=require('jszip');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var k__default=/*#__PURE__*/_interopDefault(k);function h(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function J(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 K(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 v(e){if(!e)return "";let t=[];if(e.styleId&&t.push(`<w:rStyle w:val="${h(e.styleId)}"/>`),e.fontFamily){let i=[];e.fontFamily.ascii&&i.push(`w:ascii="${h(e.fontFamily.ascii)}"`),e.fontFamily.hAnsi&&i.push(`w:hAnsi="${h(e.fontFamily.hAnsi)}"`),e.fontFamily.eastAsia&&i.push(`w:eastAsia="${h(e.fontFamily.eastAsia)}"`),e.fontFamily.cs&&i.push(`w:cs="${h(e.fontFamily.cs)}"`),e.fontFamily.asciiTheme&&i.push(`w:asciiTheme="${e.fontFamily.asciiTheme}"`),e.fontFamily.hAnsiTheme&&i.push(`w:hAnsiTheme="${e.fontFamily.hAnsiTheme}"`),e.fontFamily.eastAsiaTheme&&i.push(`w:eastAsiaTheme="${e.fontFamily.eastAsiaTheme}"`),e.fontFamily.csTheme&&i.push(`w:csTheme="${e.fontFamily.csTheme}"`),i.length>0&&t.push(`<w:rFonts ${i.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=J(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"&&new Set(["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","white","yellow"]).has(e.highlight)&&t.push(`<w:highlight w:val="${e.highlight}"/>`),e.underline){let i=[`w:val="${e.underline.style}"`];e.underline.color&&(e.underline.color.rgb&&i.push(`w:color="${e.underline.color.rgb}"`),e.underline.color.themeColor&&i.push(`w:themeColor="${e.underline.color.themeColor}"`)),t.push(`<w:u ${i.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=K(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 Q(e){return `<w:t${e.preserveSpace||e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${h(e.text)}</w:t>`}function ee(e){return "<w:tab/>"}function te(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 ne(e){return `<w:sym w:font="${h(e.font)}" w:char="${h(e.char)}"/>`}function re(e){return e.type==="footnoteRef"?`<w:footnoteReference w:id="${e.id}"/>`:`<w:endnoteReference w:id="${e.id}"/>`}function ie(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 se(e){return `<w:instrText${e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${h(e.text)}</w:instrText>`}function oe(e){return "<w:softHyphen/>"}function ae(e){return "<w:noBreakHyphen/>"}function D(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 ce(e){if(!e||e.type==="none")return "<a:noFill/>";if(e.type==="solid"&&e.color)return `<a:solidFill>${D(e.color)}</a:solidFill>`;if(e.type==="gradient"&&e.gradient){let t=e.gradient,n=t.stops.map(i=>`<a:gs pos="${i.position}">${D(i.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 E(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>${D(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 I(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 X(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 le(e){let t=e.size.width,n=e.size.height,r=e.rId||"rId1",i=e.id||"0",s=e.filename||`image${i}`,o="";return e.transform?.rotation&&(o+=` rot="${Math.round(e.transform.rotation*6e4)}"`),e.transform?.flipH&&(o+=' flipH="1"'),e.transform?.flipV&&(o+=' 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="${h(s)}"${e.alt?` descr="${h(e.alt)}"`:""}/>`,"<pic:cNvPicPr/>","</pic:nvPicPr>","<pic:blipFill>",`<a:blip r:embed="${r}"/>`,"<a:stretch><a:fillRect/></a:stretch>","</pic:blipFill>","<pic:spPr>",`<a:xfrm${o}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${t}" cy="${n}"/>`,"</a:xfrm>",'<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>',e.outline?E(e.outline):"","</pic:spPr>","</pic:pic>","</a:graphicData>","</a:graphic>"].join("")}function pe(e){let t=e.image,n=t.wrap.type!=="inline",r=t.size.width,i=t.size.height,s=t.padding?.top??t.wrap.distT??0,o=t.padding?.bottom??t.wrap.distB??0,a=t.padding?.left??t.wrap.distL??0,l=t.padding?.right??t.wrap.distR??0,p=t.id||"1",c=t.title||t.filename||`Picture ${p}`,u=le(t);if(!n)return ["<w:drawing>",`<wp:inline distT="${s}" distB="${o}" distL="${a}" distR="${l}">`,`<wp:extent cx="${r}" cy="${i}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${p}" name="${h(c)}"${t.alt?` descr="${h(t.alt)}"`:""}${t.decorative?' hidden="1"':""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',u,"</wp:inline>","</w:drawing>"].join("");let f=t.wrap.type==="behind"?"1":"0",g=t.position?I(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',b=X(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${s}" distB="${o}" distL="${a}" distR="${l}" simplePos="0" relativeHeight="251658240" behindDoc="${f}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',g,`<wp:extent cx="${r}" cy="${i}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',b,`<wp:docPr id="${p}" name="${h(c)}"${t.alt?` descr="${h(t.alt)}"`:""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',u,"</wp:anchor>","</w:drawing>"].join("")}function ue(e){return e.map(t=>$(t)).join("")}function fe(e){let t=e.shape,n=t.size.width,r=t.size.height,i=t.shapeType==="textBox",s=t.wrap&&t.wrap.type!=="inline",o=t.wrap?.distT??0,a=t.wrap?.distB??0,l=t.wrap?.distL??0,p=t.wrap?.distR??0,c=t.id||"1",u=t.name||(i?`TextBox ${c}`:`Shape ${c}`),f="";t.transform?.rotation&&(f+=` rot="${Math.round(t.transform.rotation*6e4)}"`),t.transform?.flipH&&(f+=' flipH="1"'),t.transform?.flipV&&(f+=' flipV="1"');let g=["<wps:spPr>",`<a:xfrm${f}>`,'<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>`,ce(t.fill),E(t.outline),"</wps:spPr>"].join(""),b="";if(t.textBody){let d=t.textBody,y=['rot="0"','vert="horz"'];d.anchor&&y.push(`anchor="${d.anchor==="middle"?"ctr":d.anchor}"`),d.anchorCenter&&y.push('anchorCtr="1"'),d.margins&&(d.margins.left!=null&&y.push(`lIns="${d.margins.left}"`),d.margins.top!=null&&y.push(`tIns="${d.margins.top}"`),d.margins.right!=null&&y.push(`rIns="${d.margins.right}"`),d.margins.bottom!=null&&y.push(`bIns="${d.margins.bottom}"`)),i?b=["<wps:txbx><w:txbxContent>",ue(d.content),"</w:txbxContent></wps:txbx>",`<wps:bodyPr ${y.join(" ")}/>`].join(""):b=[`<wps:bodyPr ${y.join(" ")}/>`].join("");}let j=['<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${i?' txBox="1"':""}/>`,g,b,"</wps:wsp>"].join(""),"</a:graphicData>","</a:graphic>"].join("");if(!s)return ["<w:drawing>",`<wp:inline distT="${o}" distB="${a}" distL="${l}" distR="${p}">`,`<wp:extent cx="${n}" cy="${r}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${c}" name="${h(u)}"/>`,"<wp:cNvGraphicFramePr/>",j,"</wp:inline>","</w:drawing>"].join("");let q=t.wrap?.type==="behind"?"1":"0",Z=t.position?I(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',Y=X(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${o}" distB="${a}" distL="${l}" distR="${p}" simplePos="0" relativeHeight="251658240" behindDoc="${q}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',Z,`<wp:extent cx="${n}" cy="${r}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',Y,`<wp:docPr id="${c}" name="${h(u)}"/>`,"<wp:cNvGraphicFramePr/>",j,"</wp:anchor>","</w:drawing>"].join("")}function he(e){switch(e.type){case "text":return Q(e);case "tab":return ee();case "break":return te(e);case "symbol":return ne(e);case "footnoteRef":case "endnoteRef":return re(e);case "fieldChar":return ie(e);case "instrText":return se(e);case "softHyphen":return oe();case "noBreakHyphen":return ae();case "drawing":return pe(e);case "shape":return fe(e);default:return ""}}function x(e){let t=[],n=v(e.formatting);n&&t.push(n);for(let r of e.content){let i=he(r);i&&t.push(i);}return `<w:r>${t.join("")}</w:r>`}function m(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function P(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 me(e){if(!e)return "";let t=[];if(e.top){let n=P(e.top,"top");n&&t.push(n);}if(e.left){let n=P(e.left,"left");n&&t.push(n);}if(e.bottom){let n=P(e.bottom,"bottom");n&&t.push(n);}if(e.right){let n=P(e.right,"right");n&&t.push(n);}if(e.between){let n=P(e.between,"between");n&&t.push(n);}if(e.bar){let n=P(e.bar,"bar");n&&t.push(n);}return t.length===0?"":`<w:pBdr>${t.join("")}</w:pBdr>`}function de(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 we(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 ge(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 ye(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 xe(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 $e(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 Te(e){if(!e)return "";let t=[];e.styleId&&t.push(`<w:pStyle w:val="${m(e.styleId)}"/>`),e.keepNext&&t.push("<w:keepNext/>"),e.keepLines&&t.push("<w:keepLines/>"),e.contextualSpacing&&t.push("<w:contextualSpacing/>"),e.pageBreakBefore&&t.push("<w:pageBreakBefore/>");let n=$e(e.frame);n&&t.push(n),e.widowControl===false?t.push('<w:widowControl w:val="0"/>'):e.widowControl===true&&t.push("<w:widowControl/>");let r=xe(e.numPr);r&&t.push(r);let i=me(e.borders);i&&t.push(i);let s=de(e.shading);s&&t.push(s);let o=we(e.tabs);o&&t.push(o),e.suppressLineNumbers&&t.push("<w:suppressLineNumbers/>"),e.suppressAutoHyphens&&t.push("<w:suppressAutoHyphens/>");let a=ge(e);a&&t.push(a);let l=ye(e);if(l&&t.push(l),e.bidi&&t.push("<w:bidi/>"),e.alignment&&t.push(`<w:jc w:val="${e.alignment}"/>`),e.outlineLevel!==void 0&&t.push(`<w:outlineLvl w:val="${e.outlineLevel}"/>`),e.runProperties){let p=v(e.runProperties);p&&t.push(p);}return t.length===0?"":`<w:pPr>${t.join("")}</w:pPr>`}function R(e){let t=[];e.rId&&t.push(`r:id="${e.rId}"`),e.anchor&&t.push(`w:anchor="${m(e.anchor)}"`),e.tooltip&&t.push(`w:tooltip="${m(e.tooltip)}"`),e.target&&t.push(`w:tgtFrame="${m(e.target)}"`),e.history===false&&t.push('w:history="0"'),e.docLocation&&t.push(`w:docLocation="${m(e.docLocation)}"`);let n=e.children.map(i=>i.type==="run"?x(i):i.type==="bookmarkStart"?O(i):i.type==="bookmarkEnd"?M(i):"").join("");return `<w:hyperlink${t.length>0?" "+t.join(" "):""}>${n}</w:hyperlink>`}function O(e){let t=[`w:id="${e.id}"`,`w:name="${m(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 M(e){return `<w:bookmarkEnd w:id="${e.id}"/>`}function be(e){let t=[],n=e.content.find(a=>a.type==="run"),r=n?.formatting?v(n.formatting):"",i=['w:fldCharType="begin"'];e.fldLock&&i.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${i.join(" ")}/></w:r>`);let o=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${o}>${m(e.instruction)}</w:instrText></w:r>`),t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`);for(let a of e.content)a.type==="run"&&t.push(x(a));return t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function Pe(e){let t=[],n=e.fieldResult?.[0]?.formatting,r=n?v(n):"",i=['w:fldCharType="begin"'];if(e.fldLock&&i.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${i.join(" ")}/></w:r>`),e.fieldCode.length>0)t.push(...e.fieldCode.map(s=>x(s)));else {let o=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${o}>${m(e.instruction)}</w:instrText></w:r>`);}return t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`),t.push(...e.fieldResult.map(s=>x(s))),t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function Ce(e){let t=e.properties,n=[];switch(t.alias&&n.push(`<w:alias w:val="${m(t.alias)}"/>`),t.tag&&n.push(`<w:tag w:val="${m(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="${m(t.dateFormat)}"/>`):n.push("<w:date/>");break;case "dropdown":{let i=(t.listItems??[]).map(s=>`<w:listItem w:displayText="${m(s.displayText)}" w:value="${m(s.value)}"/>`).join("");n.push(`<w:dropDownList>${i}</w:dropDownList>`);break}case "comboBox":{let i=(t.listItems??[]).map(s=>`<w:listItem w:displayText="${m(s.displayText)}" w:value="${m(s.value)}"/>`).join("");n.push(`<w:comboBox>${i}</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(i=>i.type==="run"?x(i):i.type==="hyperlink"?R(i):"").join("");return `<w:sdt><w:sdtPr>${n.join("")}</w:sdtPr><w:sdtContent>${r}</w:sdtContent></w:sdt>`}function L(e,t){let n=t.info,r=[`w:id="${n.id}"`,`w:author="${m(n.author)}"`];n.date&&r.push(`w:date="${m(n.date)}"`);let i=t.content.map(s=>s.type==="run"?x(s):s.type==="hyperlink"?R(s):"").join("");return `<w:${e} ${r.join(" ")}>${i}</w:${e}>`}function ve(e){switch(e.type){case "run":return x(e);case "hyperlink":return R(e);case "bookmarkStart":return O(e);case "bookmarkEnd":return M(e);case "simpleField":return be(e);case "complexField":return Pe(e);case "inlineSdt":return Ce(e);case "commentRangeStart":return `<w:commentRangeStart w:id="${e.id}"/>`;case "commentRangeEnd":return `<w:commentRangeEnd w:id="${e.id}"/>`;case "insertion":return L("ins",e);case "deletion":return L("del",e);case "mathEquation":return e.ommlXml||"";default:return ""}}function $(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(" "):"",i=Te(e.formatting);i&&t.push(i);for(let s of e.content){let o=ve(s);o&&t.push(o);}return `<w:p${r}>${t.join("")}</w:p>`}function Fe(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function T(e,t){if(!e)return "";let n=[`w:w="${e.value}"`,`w:type="${e.type}"`];return `<w:${t} ${n.join(" ")}/>`}function C(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 H(e,t){if(!e)return "";let n=[];if(e.top){let r=C(e.top,"top");r&&n.push(r);}if(e.left){let r=C(e.left,"left");r&&n.push(r);}if(e.bottom){let r=C(e.bottom,"bottom");r&&n.push(r);}if(e.right){let r=C(e.right,"right");r&&n.push(r);}if(e.insideH){let r=C(e.insideH,"insideH");r&&n.push(r);}if(e.insideV){let r=C(e.insideV,"insideV");r&&n.push(r);}return n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function N(e,t){if(!e)return "";let n=[];return e.top&&n.push(T(e.top,"top")),e.left&&n.push(T(e.left,"left")),e.bottom&&n.push(T(e.bottom,"bottom")),e.right&&n.push(T(e.right,"right")),n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function W(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 Se(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 Ae(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 Be(e){if(!e)return "";let t=[];e.styleId&&t.push(`<w:tblStyle w:val="${Fe(e.styleId)}"/>`);let n=Ae(e.floating);n&&t.push(n),e.bidi&&t.push("<w:bidiVisual/>");let r=T(e.width,"tblW");r&&t.push(r),e.justification&&t.push(`<w:jc w:val="${e.justification}"/>`);let i=T(e.cellSpacing,"tblCellSpacing");i&&t.push(i);let s=T(e.indent,"tblInd");s&&t.push(s);let o=H(e.borders,"tblBorders");o&&t.push(o);let a=N(e.cellMargins,"tblCellMar");a&&t.push(a),e.layout&&t.push(`<w:tblLayout w:type="${e.layout}"/>`);let l=W(e.shading);l&&t.push(l);let p=Se(e.look);return p&&t.push(p),e.overlap&&t.push(`<w:tblOverlap w:val="${e.overlap}"/>`),t.length===0?"":`<w:tblPr>${t.join("")}</w:tblPr>`}function De(e){if(!e)return "";let t=[];if(e.cantSplit&&t.push("<w:cantSplit/>"),e.header&&t.push("<w:tblHeader/>"),e.height){let n=[`w:val="${e.height.value}"`];e.heightRule&&n.push(`w:hRule="${e.heightRule}"`),t.push(`<w:trHeight ${n.join(" ")}/>`);}return e.justification&&t.push(`<w:jc w:val="${e.justification}"/>`),e.hidden&&t.push("<w:hidden/>"),t.length===0?"":`<w:trPr>${t.join("")}</w:trPr>`}function Re(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 ze(e){if(!e)return "";let t=[],n=Re(e.conditionalFormat);n&&t.push(n);let r=T(e.width,"tcW");r&&t.push(r),e.gridSpan&&e.gridSpan>1&&t.push(`<w:gridSpan w:val="${e.gridSpan}"/>`),e.vMerge&&(e.vMerge==="restart"?t.push('<w:vMerge w:val="restart"/>'):t.push("<w:vMerge/>"));let i=H(e.borders,"tcBorders");i&&t.push(i);let s=W(e.shading);s&&t.push(s),e.noWrap&&t.push("<w:noWrap/>");let o=N(e.margins,"tcMar");return o&&t.push(o),e.textDirection&&t.push(`<w:textDirection w:val="${e.textDirection}"/>`),e.fitText&&t.push("<w:tcFitText/>"),e.verticalAlign&&t.push(`<w:vAlign w:val="${e.verticalAlign}"/>`),e.hideMark&&t.push("<w:hideMark/>"),t.length===0?"":`<w:tcPr>${t.join("")}</w:tcPr>`}function ke(e){return !e||e.length===0?"":`<w:tblGrid>${e.map(n=>`<w:gridCol w:w="${n}"/>`).join("")}</w:tblGrid>`}function je(e){let t=[];for(let n of e)n.type==="paragraph"?t.push($(n)):n.type==="table"&&t.push(F(n));return t.length===0&&t.push("<w:p/>"),t.join("")}function Ee(e){let t=[],n=ze(e.formatting);return n&&t.push(n),t.push(je(e.content)),`<w:tc>${t.join("")}</w:tc>`}function Ie(e){let t=[],n=De(e.formatting);n&&t.push(n);for(let r of e.cells)t.push(Ee(r));return `<w:tr>${t.join("")}</w:tr>`}function F(e){let t=[],n=Be(e.formatting);n&&t.push(n);let r=ke(e.columnWidths);r&&t.push(r);for(let i of e.rows)t.push(Ie(i));return `<w:tbl>${t.join("")}</w:tbl>`}var w={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 Xe(){let e={wpc:w.wpc,mc:w.mc,o:w.o,r:w.r,m:w.m,v:w.v,wp14:w.wp14,wp:w.wp,w10:w.w10,w:w.w,w14:w.w14,w15:w.w15,wpg:w.wpg,wps:w.wps};return Object.entries(e).map(([t,n])=>`xmlns:${t}="${n}"`).join(" ")}function S(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 Le(e){return `<w:headerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function Oe(e){return `<w:footerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function Me(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 He(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 Ne(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 We(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 Ge(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(i=>{let s=[];return i.width!==void 0&&s.push(`w:w="${i.width}"`),i.space!==void 0&&s.push(`w:space="${i.space}"`),`<w:col ${s.join(" ")}/>`}).join("")),t.length===0&&!n?"":`<w:cols${t.length>0?" "+t.join(" "):""}>${n}</w:cols>`}function Ve(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 _e(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 s=S(t.top,"top");s&&r.push(s);}if(t.left){let s=S(t.left,"left");s&&r.push(s);}if(t.bottom){let s=S(t.bottom,"bottom");s&&r.push(s);}if(t.right){let s=S(t.right,"right");s&&r.push(s);}return r.length===0?"":`<w:pgBorders${n.length>0?" "+n.join(" "):""}>${r.join("")}</w:pgBorders>`}function Ue(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 qe(e){if(!e)return "";let t=[];if(e.headerReferences)for(let c of e.headerReferences)t.push(Le(c));if(e.footerReferences)for(let c of e.footerReferences)t.push(Oe(c));let n=Me(e.footnotePr);n&&t.push(n);let r=He(e.endnotePr);r&&t.push(r),e.sectionStart&&t.push(`<w:type w:val="${e.sectionStart}"/>`);let i=Ne(e);i&&t.push(i);let s=We(e);if(s&&t.push(s),e.paperSrcFirst!==void 0||e.paperSrcOther!==void 0){let c=[];e.paperSrcFirst!==void 0&&c.push(`w:first="${e.paperSrcFirst}"`),e.paperSrcOther!==void 0&&c.push(`w:other="${e.paperSrcOther}"`),t.push(`<w:paperSrc ${c.join(" ")}/>`);}let o=_e(e);o&&t.push(o);let a=Ve(e);a&&t.push(a);let l=Ge(e);l&&t.push(l);let p=Ue(e);return p&&t.push(p),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 G(e){if(e.type==="paragraph")return $(e);if(e.type==="table")return F(e);if(e.type==="blockSdt"){let t=e.content.map(i=>G(i)).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 Ze(e){return e.map(t=>G(t)).join("")}function Ye(e){let t=[];return t.push(Ze(e.content)),e.finalSectionProperties&&t.push(qe(e.finalSectionProperties)),t.join("")}function V(e){let t=[];t.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');let n=Xe();return t.push(`<w:document ${n} mc:Ignorable="w14 w15 wp14">`),t.push("<w:body>"),t.push(Ye(e.package.document)),t.push("</w:body>"),t.push("</w:document>"),t.join("")}var Je={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 Ke(){return Object.entries(Je).map(([e,t])=>`xmlns:${e}="${t}"`).join(" ")}function Qe(e){return e.type==="paragraph"?$(e):e.type==="table"?F(e):""}function z(e){let t=e.type==="header"?"w:hdr":"w:ftr",n=Ke(),r=e.content.map(i=>Qe(i)).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 U(e){let t=[];for(let n of e)if(n.type==="paragraph"){for(let r of n.content)if(r.type==="run")for(let i of r.content)i.type==="drawing"&&i.image.src?.startsWith("data:")&&t.push(i.image);}else if(n.type==="table")for(let r of n.rows)for(let i of r.cells)t.push(...U(i.content));return t}var et={"image/png":"png","image/jpeg":"jpeg","image/gif":"gif","image/bmp":"bmp","image/tiff":"tiff","image/webp":"webp","image/svg+xml":"svg"};function tt(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 i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return {data:r.buffer,extension:et[t[1]]||"png"}}async function nt(e,t,n){if(e.length===0)return;let r="word/_rels/document.xml.rels",i=t.file(r);if(!i)return;let s=await i.async("text"),o=0;for(let c of s.matchAll(/Id="rId(\d+)"/g)){let u=parseInt(c[1],10);u>o&&(o=u);}let a=0;t.forEach(c=>{let u=c.match(/^word\/media\/image(\d+)\./);if(u){let f=parseInt(u[1],10);f>a&&(a=f);}});let l=[],p=new Set;for(let c of e){let{data:u,extension:f}=tt(c.src);a++,o++;let g=`image${a}.${f}`,b=`word/media/${g}`,A=`rId${o}`;t.file(b,u,{compression:"DEFLATE",compressionOptions:{level:n}}),l.push(`<Relationship Id="${A}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/${g}"/>`),p.add(f),c.rId=A;}if(l.length>0&&(s=s.replace("</Relationships>",l.join("")+"</Relationships>"),t.file(r,s,{compression:"DEFLATE",compressionOptions:{level:n}})),p.size>0){let c=t.file("[Content_Types].xml");if(c){let u=await c.async("text");for(let f of p)if(!u.includes(`Extension="${f}"`)){let g=ot(f);u=u.replace("</Types>",`<Default Extension="${f}" ContentType="${g}"/></Types>`);}t.file("[Content_Types].xml",u,{compression:"DEFLATE",compressionOptions:{level:n}});}}}async function rt(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:i}=t,s=await k__default.default.loadAsync(e.originalBuffer),o=new k__default.default;for(let[c,u]of Object.entries(s.files)){if(u.dir){o.folder(c.replace(/\/$/,""));continue}let f=await u.async("arraybuffer");o.file(c,f,{compression:"DEFLATE",compressionOptions:{level:n}});}let a=U(e.package.document.content);await nt(a,o,n);let l=V(e);if(o.file("word/document.xml",l,{compression:"DEFLATE",compressionOptions:{level:n}}),it(e,o,n),r){let c="docProps/core.xml",u=s.file(c);if(u){let f=await u.async("text"),g=st(f,{updateModifiedDate:r,modifiedBy:i});o.file(c,g,{compression:"DEFLATE",compressionOptions:{level:n}});}}return await o.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:n}})}function it(e,t,n){let r=e.package.relationships;if(!r)return;let i={level:n};if(e.package.headers)for(let[s,o]of e.package.headers.entries()){let a=r.get(s);if(a&&a.type===chunkNO7WUK5E_cjs.c.header&&a.target){let l=a.target.startsWith("/")?a.target.slice(1):`word/${a.target}`,p=z(o);t.file(l,p,{compression:"DEFLATE",compressionOptions:i});}}if(e.package.footers)for(let[s,o]of e.package.footers.entries()){let a=r.get(s);if(a&&a.type===chunkNO7WUK5E_cjs.c.footer&&a.target){let l=a.target.startsWith("/")?a.target.slice(1):`word/${a.target}`,p=z(o);t.file(l,p,{compression:"DEFLATE",compressionOptions:i});}}}function st(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>${_(t.modifiedBy)}</cp:lastModifiedBy>`):n=n.replace("</cp:coreProperties>",`<cp:lastModifiedBy>${_(t.modifiedBy)}</cp:lastModifiedBy></cp:coreProperties>`)),n}function _(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ot(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 at(){let e=new k__default.default;e.file("[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
3
|
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
4
4
|
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
5
5
|
<Default Extension="xml" ContentType="application/xml"/>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var ue={calibri:{googleFont:"Carlito",category:"sans-serif",fallbackStack:["Calibri","Carlito","Arial","Helvetica","sans-serif"],singleLineRatio:1.2207},cambria:{googleFont:"Caladea",category:"serif",fallbackStack:["Cambria","Caladea","Georgia","serif"],singleLineRatio:1.2676},arial:{googleFont:"Arimo",category:"sans-serif",fallbackStack:["Arial","Arimo","Helvetica","sans-serif"],singleLineRatio:1.1499},"times new roman":{googleFont:"Tinos",category:"serif",fallbackStack:["Times New Roman","Tinos","Times","serif"],singleLineRatio:1.1499},"courier new":{googleFont:"Cousine",category:"monospace",fallbackStack:["Courier New","Cousine","Courier","monospace"],singleLineRatio:1.1328},georgia:{googleFont:"Tinos",category:"serif",fallbackStack:["Georgia","Tinos","Times New Roman","serif"],singleLineRatio:1.1362},verdana:{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Verdana","Open Sans","Arial","sans-serif"],singleLineRatio:1.2153},tahoma:{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Tahoma","Open Sans","Arial","sans-serif"],singleLineRatio:1.2075},"trebuchet ms":{googleFont:"Fira Sans",category:"sans-serif",fallbackStack:["Trebuchet MS","Fira Sans","Arial","sans-serif"],singleLineRatio:1.1431},"comic sans ms":{googleFont:"Comic Neue",category:"cursive",fallbackStack:["Comic Sans MS","Comic Neue","cursive"],singleLineRatio:1.3936},impact:{googleFont:"Anton",category:"sans-serif",fallbackStack:["Impact","Anton","Arial Black","sans-serif"],singleLineRatio:1.2197},"palatino linotype":{googleFont:"EB Garamond",category:"serif",fallbackStack:["Palatino Linotype","EB Garamond","Palatino","Georgia","serif"],singleLineRatio:1.0259},"book antiqua":{googleFont:"EB Garamond",category:"serif",fallbackStack:["Book Antiqua","EB Garamond","Palatino","Georgia","serif"],singleLineRatio:1.0259},garamond:{googleFont:"EB Garamond",category:"serif",fallbackStack:["Garamond","EB Garamond","Georgia","serif"],singleLineRatio:1.068},"century gothic":{googleFont:"Questrial",category:"sans-serif",fallbackStack:["Century Gothic","Questrial","Arial","sans-serif"],singleLineRatio:1.1611},"lucida sans":{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Lucida Sans","Open Sans","Arial","sans-serif"],singleLineRatio:1.1655},"lucida console":{googleFont:"Cousine",category:"monospace",fallbackStack:["Lucida Console","Cousine","Courier New","monospace"],singleLineRatio:1.1387},consolas:{googleFont:"Inconsolata",category:"monospace",fallbackStack:["Consolas","Inconsolata","Cousine","Courier New","monospace"],singleLineRatio:1.1626},"ms mincho":{googleFont:"Noto Serif JP",category:"serif",fallbackStack:["MS Mincho","Noto Serif JP","serif"],singleLineRatio:1.15},"ms gothic":{googleFont:"Noto Sans JP",category:"sans-serif",fallbackStack:["MS Gothic","Noto Sans JP","sans-serif"],singleLineRatio:1.15},simhei:{googleFont:"Noto Sans SC",category:"sans-serif",fallbackStack:["SimHei","Noto Sans SC","sans-serif"],singleLineRatio:1.15},simsun:{googleFont:"Noto Serif SC",category:"serif",fallbackStack:["SimSun","Noto Serif SC","serif"],singleLineRatio:1.15},"malgun gothic":{googleFont:"Noto Sans KR",category:"sans-serif",fallbackStack:["Malgun Gothic","Noto Sans KR","sans-serif"],singleLineRatio:1.15}},ge={"sans-serif":"Arial, Helvetica, sans-serif",serif:"Times New Roman, Times, serif",monospace:"Courier New, Courier, monospace",cursive:"cursive",fantasy:"fantasy","system-ui":"system-ui, sans-serif"};function fe(n){let e=n.toLowerCase();return e.includes("mono")||e.includes("courier")||e.includes("consolas")||e.includes("console")||e.includes("code")||e.includes("terminal")?"monospace":e.includes("times")||e.includes("georgia")||e.includes("garamond")||e.includes("palatino")||e.includes("baskerville")||e.includes("bodoni")||e.includes("cambria")||e.includes("mincho")||e.includes("ming")||e.includes("song")||e.includes("serif")?"serif":e.includes("script")||e.includes("cursive")||e.includes("comic")||e.includes("brush")||e.includes("hand")?"cursive":"sans-serif"}function Q(n){let e=n.trim().toLowerCase(),a=ue[e];if(a)return {googleFont:a.googleFont,cssFallback:a.fallbackStack.map(K).join(", "),originalFont:n,hasGoogleEquivalent:true,singleLineRatio:a.singleLineRatio};let t=fe(n),r=ge[t];return {googleFont:null,cssFallback:`${K(n)}, ${r}`,originalFont:n,hasGoogleEquivalent:false,singleLineRatio:1.15}}function K(n){return ["serif","sans-serif","monospace","cursive","fantasy","system-ui"].includes(n.toLowerCase())?n:/[\s,'"()]/.test(n)?`"${n.replace(/"/g,'\\"')}"`:n}function Fe(n,e){if(!e)return null;let t=n.toLowerCase().startsWith("major")?e.majorFont:e.minorFont;if(!t)return null;let r=n.toLowerCase();return r.includes("eastasia")||r.includes("ea")?t.ea??t.latin??null:r.includes("cs")||r.includes("bidi")?t.cs??t.latin??null:t.latin??null}var Z=96,ee=11,ne="Calibri",he=1.15,de=.8,pe=.2,A=null;function X(){if(!A){let n=typeof document<"u"?document.createElement("canvas"):null;if(!n)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(A=n.getContext("2d"),!A)throw new Error("Failed to get 2D context from canvas")}return A}function we(){A=null;}var V=new Map;function te(n){let e=V.get(n);if(e===void 0){let a=Q(n);e={cssFallback:a.cssFallback,singleLineRatio:a.singleLineRatio},V.set(n,e);}return e}function be(n){return te(n).cssFallback}function U(n){let e=[];n.italic&&e.push("italic"),n.bold&&e.push("bold");let a=n.fontSize??ee,t=oe(a);e.push(`${t}px`);let r=n.fontFamily??ne;return e.push(be(r)),e.join(" ")}function xe(n){let e=n.fontSize??ee,a=n.fontFamily??ne,t=oe(e),r=t*de,o=t*pe,c=t*he;try{let s=X();s.font=U(n);let g=s.measureText("Hg");typeof g.actualBoundingBoxAscent=="number"&&typeof g.actualBoundingBoxDescent=="number"&&(r=g.actualBoundingBoxAscent,o=g.actualBoundingBoxDescent);}catch{}c=Math.max(c,r+o);let i=te(a).singleLineRatio;return {fontSize:e,ascent:r,descent:o,lineHeight:c,fontFamily:a,singleLineRatio:i}}function Me(n,e){if(!n)return 0;let a=X();a.font=U(e);let r=a.measureText(n).width;return e.letterSpacing&&n.length>1&&(r+=e.letterSpacing*(n.length-1)),r}function W(n,e){let a=xe(e);if(!n)return {width:0,charWidths:[],metrics:a};let t=X();t.font=U(e);let r=e.letterSpacing??0,o=[],c=0;for(let i=0;i<n.length;i++){let s=n[i],h=t.measureText(s).width;r&&i<n.length-1&&(h+=r),o.push(h),c+=h;}return {width:c,charWidths:o,metrics:a}}function Te(n,e){if(e.length===0||n<=0)return 0;let a=0;for(let t=0;t<e.length;t++){let r=e[t],o=a+r/2;if(n<=o)return t;a+=r;}return e.length}function oe(n){return n*Z/72}function q(n,e){let a=n.pageGap??0,t=0;for(let r=0;r<e&&r<n.pages.length;r++){let c=n.pages[r].size?.h??n.pageSize.h;t+=c+a;}return t}function ae(n,e){return n.findIndex(a=>a.id===e)}function ke(n,e){let a=0;for(let t=n.fromLine;t<n.toLine&&t<e.lines.length;t++)a+=e.lines[t].lineHeight;return a}function Ie(n,e,a,t){let r=[...n.page.fragments].sort((o,c)=>{let i=o.y-c.y;return Math.abs(i)>.5?i:o.x-c.x});for(let o of r){let c=ae(e,o.blockId);if(c===-1)continue;let i=e[c],s=a[c];if(!i||!s)continue;let g;if(o.kind==="paragraph"){if(i.kind!=="paragraph"||s.kind!=="paragraph")continue;g=ke(o,s);}else if(o.kind==="table")g=o.height;else if(o.kind==="image")g=o.height;else continue;let h=t.x>=o.x&&t.x<=o.x+o.width,l=t.y>=o.y&&t.y<=o.y+g;if(h&&l)return {fragment:o,block:i,measure:s,pageIndex:n.pageIndex,localX:t.x-o.x,localY:t.y-o.y}}return null}function Ce(n,e,a,t){for(let r of n.page.fragments){if(r.kind!=="table")continue;let o=r,c=t.x>=o.x&&t.x<=o.x+o.width,i=t.y>=o.y&&t.y<=o.y+o.height;if(!c||!i)continue;let s=ae(e,o.blockId);if(s===-1)continue;let g=e[s],h=a[s];if(!g||g.kind!=="table"||!h||h.kind!=="table")continue;let l=g,f=h,d=t.x-o.x,F=t.y-o.y,x=0,p=-1;if(f.rows.length===0||l.rows.length===0)continue;for(let u=o.fromRow;u<o.toRow&&u<f.rows.length;u++){let L=f.rows[u];if(F>=x&&F<x+L.height){p=u;break}x+=L.height;}if(p===-1&&(p=Math.min(o.toRow-1,f.rows.length-1),p<o.fromRow))continue;let m=f.rows[p],S=l.rows[p];if(!m||!S)continue;let b=0,k=-1;if(m.cells.length===0||S.cells.length===0)continue;for(let u=0;u<m.cells.length;u++){let L=m.cells[u];if(d>=b&&d<b+L.width){k=u;break}b+=L.width;}if(k===-1&&(k=m.cells.length-1,k<0))continue;let y=m.cells[k],R=S.cells[k];if(!y||!R)continue;let w=0;for(let u=o.fromRow;u<p;u++)w+=f.rows[u]?.height??0;let I=0;for(let u=0;u<k;u++)I+=m.cells[u]?.width??0;let T,M;if(R.blocks&&R.blocks.length>0){let u=R.blocks[0],L=y.blocks[0];u.kind==="paragraph"&&L?.kind==="paragraph"&&(T=u,M=L);}let C=d-I,B=F-w;return {fragment:o,block:l,measure:f,pageIndex:n.pageIndex,rowIndex:p,colIndex:k,cellBlock:T,cellMeasure:M,cellLocalX:Math.max(0,C),cellLocalY:Math.max(0,B)}}return null}function re(n){return {fontFamily:n.fontFamily??"Arial",fontSize:n.fontSize??12,bold:n.bold,italic:n.italic,letterSpacing:n.letterSpacing}}function j(n,e){return n.findIndex(a=>a.id===e)}function G(n,e){let t=(n.pmStart??0)+1,r=0,o;for(let s=0;s<n.runs.length&&s<=e.toRun;s++){let g=n.runs[s];if(g){if(s<e.fromRun)g.kind==="text"?r+=(g.text??"").length:r+=1;else if(s===e.fromRun){r+=e.fromChar,o=t+r;break}}}o===void 0&&(o=t);let c=0;for(let s=e.fromRun;s<=e.toRun&&s<n.runs.length;s++){let g=n.runs[s];if(g)if(g.kind==="text"){let h=g.text??"",l=s===e.fromRun?e.fromChar:0,f=s===e.toRun?e.toChar:h.length;c+=f-l;}else c+=1;}let i=o+c;return {pmStart:o,pmEnd:i}}function ie(n,e,a,t){let r=[];for(let o=0;o<e.lines.length;o++){let c=e.lines[o],i=G(n,c);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<t&&r.push({line:c,index:o});}return r}function v(n,e,a){let t=G(n,e);return t.pmStart===void 0?0:Math.max(0,a-t.pmStart)}function _(n,e,a,t){let r=0,o=0;for(let c=e.fromRun;c<=e.toRun&&c<n.runs.length;c++){let i=n.runs[c];if(i){if(i.kind==="tab"){let s=i.width??48;if(o+1>=a)return a<=o?r:r+s;r+=s,o+=1;continue}if(i.kind==="image"){let s=i.width;if(o+1>=a)return a<=o?r:r+s;r+=s,o+=1;continue}if(i.kind==="lineBreak"){if(a<=o)return r;o+=1;continue}if(i.kind==="text"){let s=i.text??"",g=c===e.fromRun,h=c===e.toRun,l=g?e.fromChar:0,f=h?e.toChar:s.length,d=s.slice(l,f);if(o+d.length>=a){let p=a-o,m=re(i),S=W(d.slice(0,p),m);return r+S.width}let F=re(i),x=W(d,F);r+=x.width,o+=d.length;}}}return r}function N(n,e){let a=0;for(let t=0;t<e&&t<n.lines.length;t++)a+=n.lines[t].lineHeight;return a}function He(n,e,a,t,r){if(t===r)return [];let o=Math.min(t,r),c=Math.max(t,r),i=[];for(let s=0;s<n.pages.length;s++){let g=n.pages[s],h=q(n,s);for(let l of g.fragments){if(l.kind==="paragraph"){let f=j(e,l.blockId);if(f===-1)continue;let d=e[f],F=a[f];if(!d||d.kind!=="paragraph"||!F||F.kind!=="paragraph")continue;let x=d,p=F,m=l,S=ie(x,p,o,c);for(let{line:b,index:k}of S){if(k<m.fromLine||k>=m.toLine)continue;let y=G(x,b);if(y.pmStart===void 0||y.pmEnd===void 0)continue;let R=Math.max(y.pmStart,o),w=Math.min(y.pmEnd,c);if(R>=w)continue;let I=v(x,b,R),T=v(x,b,w),M=x.attrs?.indent,C=M?.left??0,B=M?.right??0,u=Math.max(0,l.width-C-B),L=_(x,b,I),z=_(x,b,T),H=x.attrs?.alignment??"left",P=0;H==="center"?P=Math.max(0,(u-b.width)/2):H==="right"&&(P=Math.max(0,u-b.width));let D=N(p,k)-N(p,m.fromLine),E=l.x+C+P+Math.min(L,z),O=Math.max(1,Math.abs(z-L)),Y=l.y+D;i.push({x:E,y:Y+h,width:O,height:b.lineHeight,pageIndex:s});}}if(l.kind==="table"){let f=j(e,l.blockId);if(f===-1)continue;let d=e[f],F=a[f];if(!d||d.kind!=="table"||!F||F.kind!=="table")continue;let x=d,p=F,m=l,S=0;for(let b=m.fromRow;b<m.toRow&&b<x.rows.length;b++){let k=x.rows[b],y=p.rows[b];if(!k||!y)continue;let R=0;for(let w=0;w<k.cells.length;w++){let I=k.cells[w],T=y.cells[w];if(!(!I||!T)){for(let M=0;M<I.blocks.length;M++){let C=I.blocks[M],B=T.blocks[M];if(!C||C.kind!=="paragraph"||!B||B.kind!=="paragraph")continue;let u=C,L=B,z=ie(u,L,o,c),H=0;for(let{line:P,index:D}of z){let E=G(u,P);if(E.pmStart===void 0||E.pmEnd===void 0)continue;let O=Math.max(E.pmStart,o),Y=Math.min(E.pmEnd,c);if(O>=Y)continue;let se=v(u,P,O),ce=v(u,P,Y),J=_(u,P,se,T.width),$=_(u,P,ce,T.width),le=N(L,D);i.push({x:m.x+R+Math.min(J,$),y:m.y+S+H+le+h,width:Math.max(1,Math.abs($-J)),height:P.lineHeight,pageIndex:s});}H+=L.totalHeight;}R+=T.width;}}S+=y.height;}}if(l.kind==="image"){let f=l.pmStart??0;(l.pmEnd??f+1)>o&&f<c&&i.push({x:l.x,y:l.y+h,width:l.width,height:l.height,pageIndex:s});}}}return i}function Ae(n,e,a,t){for(let r=0;r<n.pages.length;r++){let o=n.pages[r],c=q(n,r);for(let i of o.fragments){if(i.kind==="paragraph"){let s=j(e,i.blockId);if(s===-1)continue;let g=e[s],h=a[s];if(!g||g.kind!=="paragraph"||!h||h.kind!=="paragraph")continue;let l=g,f=h,d=i,F=l.pmStart??0,x=l.pmEnd??F;if(t<F||t>x)continue;for(let p=d.fromLine;p<d.toLine;p++){let m=f.lines[p];if(!m)continue;let S=G(l,m);if(!(S.pmStart===void 0||S.pmEnd===void 0)&&t>=S.pmStart&&t<=S.pmEnd){let b=v(l,m,t),k=l.attrs?.indent,y=k?.left??0,R=k?.right??0,w=Math.max(0,i.width-y-R),I=_(l,m,b),T=l.attrs?.alignment??"left",M=0;T==="center"?M=Math.max(0,(w-m.width)/2):T==="right"&&(M=Math.max(0,w-m.width));let C=N(f,p)-N(f,d.fromLine);return {x:i.x+y+M+I,y:i.y+C+c,height:m.lineHeight,pageIndex:r}}}}if(i.kind==="image"){let s=i.pmStart??0,g=i.pmEnd??s+1;if(t>=s&&t<=g){let h=t===s?0:i.width;return {x:i.x+h,y:i.y+c,height:i.height,pageIndex:r}}}}}return null}function ve(n){return n.length<=1?false:new Set(n.map(a=>a.pageIndex)).size>1}function _e(n){let e=new Map;for(let a of n){let t=e.get(a.pageIndex)??[];t.push(a),e.set(a.pageIndex,t);}return e}exports.a=Q;exports.b=Fe;exports.c=we;exports.d=xe;exports.e=Me;exports.f=W;exports.g=Te;exports.h=oe;exports.i=Ie;exports.j=Ce;exports.k=He;exports.l=Ae;exports.m=ve;exports.n=_e;
|