@docx-editor.dev/core 2.10.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.cts +14 -5
- package/dist/automation.d.ts +14 -5
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +12 -11
- package/dist/binding.d.ts +12 -11
- package/dist/binding.js +1 -1
- package/dist/chunk-3JON7JMD.cjs +1 -0
- package/dist/chunk-5V6FNKBE.cjs +2 -0
- package/dist/chunk-6JIJOZDW.js +1 -0
- package/dist/chunk-BTQKU64Q.cjs +1 -0
- package/dist/chunk-BXRVGHTY.cjs +18 -0
- package/dist/chunk-BXTTPJSH.js +5 -0
- package/dist/chunk-D5EHDHYV.js +1 -0
- package/dist/{chunk-PSZH2VXP.js → chunk-GOEBQ26R.js} +1 -1
- package/dist/chunk-ILTZTY3K.cjs +10 -0
- package/dist/chunk-IUM7FZPA.js +2 -0
- package/dist/chunk-JWZG4QJ5.cjs +2 -0
- package/dist/chunk-JXZYDBKU.cjs +19 -0
- package/dist/chunk-KBOOIC2Q.js +19 -0
- package/dist/chunk-L6XZTLPS.js +10 -0
- package/dist/chunk-L7OR5TJK.cjs +5 -0
- package/dist/chunk-MHQNR2OU.js +2 -0
- package/dist/chunk-MLGPISGH.js +1 -0
- package/dist/chunk-NJXQABQU.js +18 -0
- package/dist/{chunk-YMYCPY5Y.cjs → chunk-OHJQ7GPZ.cjs} +1 -1
- package/dist/chunk-TKEGK4GQ.cjs +2 -0
- package/dist/chunk-VGFMPWND.js +2 -0
- package/dist/chunk-W77HJGYX.js +1 -0
- package/dist/chunk-XCFM3G5L.cjs +1 -0
- package/dist/chunk-ZKWRCLT2.cjs +1 -0
- package/dist/collaboration/replication.cjs +1 -0
- package/dist/collaboration/replication.d.cts +216 -0
- package/dist/collaboration/replication.d.ts +216 -0
- package/dist/collaboration/replication.js +1 -0
- package/dist/collaboration.cjs +1 -0
- package/dist/collaboration.d.cts +176 -0
- package/dist/collaboration.d.ts +176 -0
- package/dist/collaboration.js +1 -0
- package/dist/contracts/editor.cjs +1 -1
- package/dist/contracts/editor.d.cts +8 -9
- package/dist/contracts/editor.d.ts +8 -9
- package/dist/contracts/editor.js +1 -1
- package/dist/contracts/interaction.d.cts +8 -9
- package/dist/contracts/interaction.d.ts +8 -9
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.cts +21 -8
- package/dist/contracts/modules.d.ts +21 -8
- package/dist/contracts/modules.js +1 -1
- package/dist/custom-node-writes-CcNeHH5C.d.ts +310 -0
- package/dist/custom-node-writes-D4rMJIES.d.cts +310 -0
- package/dist/document-properties-D6Ahr8D6.d.cts +28 -0
- package/dist/document-properties-D6Ahr8D6.d.ts +28 -0
- package/dist/{editor-CwzY2Hcg.d.cts → editor-B76SEMZw.d.cts} +145 -49
- package/dist/{editor-C0my6Uta.d.ts → editor-BcdsPdbY.d.ts} +145 -49
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -7299
- package/dist/editor.d.cts +60 -26
- package/dist/editor.d.ts +60 -26
- package/dist/editor.js +1 -1
- package/dist/failure-BnGjoXf0.d.cts +64 -0
- package/dist/failure-BnGjoXf0.d.ts +64 -0
- package/dist/{index-kID8Ymkp.d.ts → index-BYTvklN5.d.ts} +262 -81
- package/dist/{index-nLFwo_17.d.cts → index-CDGhPib1.d.cts} +262 -81
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +19 -18
- package/dist/index.d.ts +19 -18
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +82 -53
- package/dist/layout.d.ts +82 -53
- package/dist/layout.js +1 -1
- package/dist/{note-properties-jvnw_DGG.d.ts → note-properties-Bx7rXruA.d.ts} +1 -1
- package/dist/{note-properties-CQlxjic_.d.cts → note-properties-zQ8w04en.d.cts} +1 -1
- package/dist/{omml-equation-Dd3mBep-.d.ts → omml-equation-69O1Pd8G.d.ts} +1 -1
- package/dist/{omml-equation-BD-LsmWE.d.cts → omml-equation-BmV51rim.d.cts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +6 -8
- package/dist/output.d.ts +6 -8
- package/dist/output.js +1 -1
- package/dist/{protocol-C7ahrdUx.d.ts → protocol-DC7ueVuo.d.ts} +2 -2
- package/dist/{protocol-UuZOcOp7.d.cts → protocol-FTXtrAIT.d.cts} +2 -2
- package/dist/{review-items-Dw-8a6Ie.d.ts → review-items-B78OsJU2.d.ts} +1 -2
- package/dist/{review-items-CwixiHNe.d.cts → review-items-C-2WQdEb.d.cts} +1 -2
- package/dist/{review-reads-BqkiJTeR.d.cts → review-reads-CbBQlb-n.d.cts} +2 -2
- package/dist/{review-reads-C0u-IKEA.d.ts → review-reads-UexYBp-m.d.ts} +2 -2
- package/dist/{revision-projection-Cc4wz30g.d.cts → revision-projection-6u8lae9J.d.cts} +1 -1
- package/dist/{revision-projection-CILpvv4M.d.ts → revision-projection-B2v9U3qx.d.ts} +1 -1
- package/dist/{semantic-cell-selection-Utrf0lz7.d.ts → semantic-cell-selection-DsYz2Vg3.d.ts} +4 -4
- package/dist/{semantic-cell-selection-DT9x9WLf.d.cts → semantic-cell-selection-nEE7E3Z8.d.cts} +4 -4
- package/dist/{semantic-interaction-B6hFRQLy.d.ts → semantic-interaction-C00BpIyC.d.ts} +1 -1
- package/dist/{semantic-interaction-Z0xKQcB4.d.cts → semantic-interaction-DiOX0FIH.d.cts} +1 -1
- package/dist/{semantic-paint-CQEOC0Od.d.cts → semantic-paint-Cc11nrDL.d.cts} +2 -2
- package/dist/{semantic-paint-quke354p.d.ts → semantic-paint-ofuoBsYo.d.ts} +2 -2
- package/dist/{semantic-records-Do3-i5oB.d.ts → semantic-records-CRG1r6-a.d.cts} +5 -4
- package/dist/{semantic-records-CMakzQ1X.d.cts → semantic-records-CzI0ZEuR.d.ts} +5 -4
- package/dist/{shaped-measurer-BxwTUluj.d.ts → shaped-measurer-CkOGZQn9.d.ts} +1 -1
- package/dist/{shaped-measurer-DzRwWrL5.d.cts → shaped-measurer-CneACGcP.d.cts} +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +81 -17
- package/dist/store.d.ts +81 -17
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-DSJYmf5b.d.cts → tree-op-types-CA7qgAUF.d.cts} +1288 -18
- package/dist/{tree-op-types-BuOfCrkp.d.ts → tree-op-types-HKfUzt_-.d.ts} +1288 -18
- package/dist/{custom-node-writes-BvpWCnW8.d.ts → tree-package-fragment-Cz-v-0B3.d.cts} +107 -322
- package/dist/{custom-node-writes-Db8H6Z3n.d.cts → tree-package-fragment-oJZX_5iN.d.ts} +107 -322
- package/dist/{tree-session-contract-ByWx8eew.d.cts → tree-session-contract-BPDLrEPX.d.ts} +16 -10
- package/dist/{tree-session-contract-C1dfE9hy.d.ts → tree-session-contract-Cbl87xa8.d.cts} +16 -10
- package/dist/{tree-store-ASBtz7UB.d.ts → tree-store-B7hd6cEa.d.ts} +130 -25
- package/dist/{tree-store-CWOUMGN8.d.cts → tree-store-BenW0Mg_.d.cts} +130 -25
- package/package.json +14 -3
- package/dist/chunk-27APDXY2.js +0 -2
- package/dist/chunk-35MI6K7M.cjs +0 -10
- package/dist/chunk-4XL7SOWQ.cjs +0 -2
- package/dist/chunk-6K6QQVAZ.cjs +0 -18
- package/dist/chunk-7VQ7YLW3.cjs +0 -1
- package/dist/chunk-7ZJL5AEY.cjs +0 -1
- package/dist/chunk-C6LK2BYA.cjs +0 -2
- package/dist/chunk-GQQOL4PV.js +0 -1
- package/dist/chunk-HBEBUCRM.cjs +0 -5
- package/dist/chunk-LG5K46OM.js +0 -2
- package/dist/chunk-LWADHMVV.js +0 -5
- package/dist/chunk-N725IUO7.js +0 -18
- package/dist/chunk-N7DBENH4.js +0 -10
- package/dist/chunk-NVGFWMCO.js +0 -1
- package/dist/chunk-SYTWKJPJ.cjs +0 -18
- package/dist/chunk-YI6JXF7U.js +0 -18
- package/dist/hf-references-Dvk6De4Q.d.cts +0 -70
- package/dist/hf-references-z5Y4N1ab.d.ts +0 -70
- package/dist/note-nodes-BNCANoGN.d.ts +0 -108
- package/dist/note-nodes-DL-Au22P.d.cts +0 -108
- package/dist/ooxml-package-CdEy9ufK.d.cts +0 -1222
- package/dist/ooxml-package-CdEy9ufK.d.ts +0 -1222
- package/dist/tree-op-revision-attribution-CN06Xshv.d.cts +0 -24
- package/dist/tree-op-revision-attribution-CN06Xshv.d.ts +0 -24
package/dist/chunk-SYTWKJPJ.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';var chunk4XL7SOWQ_cjs=require('./chunk-4XL7SOWQ.cjs'),chunk6K6QQVAZ_cjs=require('./chunk-6K6QQVAZ.cjs'),chunk7ZJL5AEY_cjs=require('./chunk-7ZJL5AEY.cjs'),chunkHBEBUCRM_cjs=require('./chunk-HBEBUCRM.cjs'),chunkC6LK2BYA_cjs=require('./chunk-C6LK2BYA.cjs'),chunk35MI6K7M_cjs=require('./chunk-35MI6K7M.cjs'),chunkYMYCPY5Y_cjs=require('./chunk-YMYCPY5Y.cjs'),chunk7VQ7YLW3_cjs=require('./chunk-7VQ7YLW3.cjs'),fflate=require('fflate'),i18n=require('@docx-editor.dev/i18n');var Jy=Object.freeze({kern:1,liga:1});function Ba(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var tf=false;function nf(e){if(tf)return;tf=true;let t=e.diagnostic?`: ${e.diagnostic}`:".";console.error(`[@docx-editor.dev/core] text shaping is disabled${t}
|
|
2
|
-
Text is being measured with fallback metrics, so line and page breaks will not match Word.`);}function kr(e){if(e instanceof chunkYMYCPY5Y_cjs.a)return e;if(e instanceof chunk6K6QQVAZ_cjs.d)return new chunkYMYCPY5Y_cjs.a(e.code,e.message,{request:Ba(e.request),diagnostic:e.diagnostic});if(e instanceof chunk6K6QQVAZ_cjs.r){let t=e.code==="wasmUnavailable"||e.code==="shapingLibraryMismatch"?"wasmUnavailable":"initializationFailed";return new chunkYMYCPY5Y_cjs.a(t,e.message,{diagnostic:e.diagnostic??e.message,cause:e})}return new chunkYMYCPY5Y_cjs.a("initializationFailed",e instanceof Error?e.message:"Font initialization failed",{diagnostic:e instanceof Error?e.message:String(e)})}async function qa(e,t){try{if(!Number.isSafeInteger(e.maxFontBytes)||e.maxFontBytes<=0||e.maxFontBytes>chunk6K6QQVAZ_cjs.a)throw new chunkYMYCPY5Y_cjs.a("overLimit",`Font byte ceiling must not exceed the engine hard maximum of ${chunk6K6QQVAZ_cjs.a}`);if(!Number.isSafeInteger(e.sources.length)||e.sources.length===0||e.sources.length>chunk6K6QQVAZ_cjs.b)throw new chunkYMYCPY5Y_cjs.a("overLimit",`Font source count must be between 1 and ${chunk6K6QQVAZ_cjs.b}`);let n=0;for(let a of e.sources){if(!Number.isSafeInteger(a.bytes.byteLength)||a.bytes.byteLength>e.maxFontBytes||a.bytes.byteLength>chunk6K6QQVAZ_cjs.a)throw new chunkYMYCPY5Y_cjs.a("overLimit",`Font source ${a.id} exceeds the per-font byte ceiling`);if(a.bytes.byteLength>chunk6K6QQVAZ_cjs.c-n)throw new chunkYMYCPY5Y_cjs.a("overLimit",`Font sources exceed the aggregate byte ceiling of ${chunk6K6QQVAZ_cjs.c}`);n+=a.bytes.byteLength;}let r={epoch:e.epoch,maxFontBytes:e.maxFontBytes,sources:e.sources.map(a=>({request:Ba(a.request),id:a.id,bytes:a.bytes,hash:a.hash,faceIndex:a.faceIndex,availability:a.availability})),substitutions:e.substitutions?.map(a=>({from:Ba(a.from),to:Ba(a.to)})),defaultFont:Object.freeze({family:e.defaultFont.family,sizeHalfPoints:e.defaultFont.sizeHalfPoints}),language:e.language},o=chunk6K6QQVAZ_cjs.g({epoch:r.epoch,maxFontBytes:r.maxFontBytes,resources:r.sources,substitutions:r.substitutions,validateFont:chunk6K6QQVAZ_cjs.s,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});return await chunk6K6QQVAZ_cjs.p(),Object.freeze({fonts:o,shaper:chunk6K6QQVAZ_cjs.u(),defaultFont:Object.freeze({family:r.defaultFont.family,sizeHalfPoints:r.defaultFont.sizeHalfPoints}),environment:Object.freeze({variationAxes:Object.freeze({}),shapingLibrary:chunk6K6QQVAZ_cjs.o,unicodeDataVersion:"16.0.0",normalization:"none",language:r.language??"en",features:Jy,fixedPointScale:20,roundingMode:"halfAwayFromZero"}),ligatureCaretPolicy:"cluster-edges-only",operation:Object.freeze({resourceEpoch:o.epoch,configEpoch:r.epoch,extensionFingerprint:`fonts:${r.sources.map(a=>`${a.hash}#${a.faceIndex}`).join(",")}`,shapingHash:`hb:${chunk6K6QQVAZ_cjs.o.version}:kern+liga`,producerVersion:1})})}catch(n){throw kr(n)}}function wr(e){e.shaper.dispose?.();}var e0=Object.freeze({scope:Object.freeze({kind:"body"}),isLoading:true,isOpening:false,parseError:null,editable:false,zoom:1,selection:null,selectionCollapsed:true,formatting:null,table:null,tocContext:null,image:null,page:Object.freeze({current:0,total:0}),canUndo:false,canRedo:false});var Fs=64,Za=Object.freeze({family:"Calibri",sizeHalfPoints:22});function za(e,...t){let n=[e,...t],r=[],o=new Set;for(let s of n)for(let d of s.sources??[]){let c=chunk6K6QQVAZ_cjs.e(d.request);o.has(c)||(o.add(c),r.push(d));}let a=[],i=new Set;for(let s of n)for(let d of s.substitutions??[]){let c=chunk6K6QQVAZ_cjs.e(d.from);o.has(c)||i.has(c)||(i.add(c),a.push(d));}return Object.freeze({epoch:e.epoch??0,maxFontBytes:e.maxFontBytes??chunk6K6QQVAZ_cjs.a,sources:Object.freeze(r),...a.length>0?{substitutions:Object.freeze(a)}:{},defaultFont:e.defaultFont??Za,...e.language!==void 0?{language:e.language}:{}})}var rf="http://schemas.openxmlformats.org/wordprocessingml/2006/main",n0="http://schemas.openxmlformats.org/package/2006/content-types",of="http://schemas.openxmlformats.org/package/2006/relationships",r0="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",o0="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",a0=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${n0}"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/></Types>`,i0=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${of}"><Relationship Id="rId1" Type="${r0}" Target="word/document.xml"/></Relationships>`,s0=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${of}"><Relationship Id="rId1" Type="${o0}" Target="styles.xml"/></Relationships>`,l0=[{level:1,before:240,color:"2F5496",halfPoints:32,italic:false},{level:2,before:40,color:"2F5496",halfPoints:26,italic:false},{level:3,before:40,color:"1F3763",halfPoints:24,italic:false},{level:4,before:40,color:"2F5496",halfPoints:null,italic:true},{level:5,before:40,color:"2F5496",halfPoints:null,italic:false},{level:6,before:40,color:"1F3763",halfPoints:null,italic:false},{level:7,before:40,color:"1F3763",halfPoints:null,italic:true},{level:8,before:40,color:"272727",halfPoints:21,italic:false},{level:9,before:40,color:"272727",halfPoints:21,italic:true}],d0=e=>`<w:style w:type="paragraph" w:styleId="Heading${e.level}"><w:name w:val="heading ${e.level}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="9"/><w:qFormat/><w:pPr><w:keepNext/><w:keepLines/><w:spacing w:before="${e.before}" w:after="0"/><w:outlineLvl w:val="${e.level-1}"/></w:pPr><w:rPr>`+(e.italic?"<w:i/><w:iCs/>":"")+`<w:color w:val="${e.color}"/>`+(e.halfPoints===null?"":`<w:sz w:val="${e.halfPoints}"/><w:szCs w:val="${e.halfPoints}"/>`)+"</w:rPr></w:style>",c0=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="${rf}"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>`+l0.map(d0).join("")+'<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:uiPriority w:val="1"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="table" w:default="1" w:styleId="TableNormal"><w:name w:val="Normal Table"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="numbering" w:default="1" w:styleId="NoList"><w:name w:val="No List"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="10"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/><w:contextualSpacing/></w:pPr><w:rPr><w:spacing w:val="-10"/><w:kern w:val="28"/><w:sz w:val="56"/><w:szCs w:val="56"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Subtitle"><w:name w:val="Subtitle"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="11"/><w:qFormat/><w:rPr><w:color w:val="5A5A5A"/><w:spacing w:val="15"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="29"/><w:qFormat/><w:pPr><w:spacing w:before="160"/><w:jc w:val="center"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="NoSpacing"><w:name w:val="No Spacing"/><w:uiPriority w:val="1"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/></w:pPr></w:style><w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:uiPriority w:val="34"/><w:qFormat/><w:pPr><w:ind w:left="720"/><w:contextualSpacing/></w:pPr></w:style></w:styles>',u0=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="${rf}"><w:body><w:p/><w:sectPr><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/></w:sectPr></w:body></w:document>`;function As(){return fflate.zipSync({"[Content_Types].xml":fflate.strToU8(a0),"_rels/.rels":fflate.strToU8(i0),"word/_rels/document.xml.rels":fflate.strToU8(s0),"word/document.xml":fflate.strToU8(u0),"word/styles.xml":fflate.strToU8(c0)})}var f0=Object.freeze({kind:"body"});function en(e,t){let n=t?.indexOf("#")??-1;if(n===-1)return null;let r=t.slice(0,n);return r.length===0?null:e.currentPackage().parts.get(r)??null}function gt(e,t,n){let r=t?.indexOf("#")??-1,o=r===-1?"":t.slice(0,r);if(o.length===0||o===e.part().name)return {kind:"body"};for(let a of e.headerFooterResolutionBySection())for(let i of [a.headers,a.footers])for(let s of i.values())if(s.partName===o)return {kind:"headerFooter",rId:s.rId};for(let a of ["footnote","endnote"])if(e.partFor({kind:"notesPart",noteKind:a})?.name===o)return {kind:"notesPart",noteKind:a};return n}function $a(e,t){if(e)return {kind:"headerFooter",rId:e.scope.rId};if(t){let n=chunk35MI6K7M_cjs.ld(t.id);if(n)return {kind:"notesPart",noteKind:n.noteKind}}return {kind:"body"}}function sf(e,t){return e?e.scope:t||f0}function p0(e,t,n){if(n){let o=[];for(let a of [e.footnotes,e.endnotes])if(a)for(let i of a.notes)i.scopeId===n&&o.push(...af(i.fragments));return o}if(!t)return chunk6K6QQVAZ_cjs.Y(e);let r=Tr(e,t);return r?af(r.fragments):[]}function Tr(e,t){let n=t.kind==="header"?e.header:e.footer;if(n&&(n.rId&&n.rId===t.scope.rId||!n.rId&&n.partName===t.partName))return n}function lf(e,t){for(let n of e.pages)for(let r of ["header","footer"]){let o=n[r];if(o?.rId===t)return {pageIndex:n.index,kind:r,story:o}}return null}function Ms(e,t){return !!(e.rId&&e.rId===t.scope.rId||!e.rId&&e.partName===t.partName&&e.kind===t.kind)}function Ls(e,t,n){let r=chunk6K6QQVAZ_cjs.Ac(e,t.y),o=e.pages[r];if(!o)return false;let a=t.x-n(r),i=t.y,s=o.contentBox;return a>=s.x&&a<s.x+s.width&&i>=s.y&&i<s.y+s.height}function Ns(e,t,n,r,o={}){return chunk6K6QQVAZ_cjs.Dc(e,t,n.fragments,r,o)}function g0(e,t,n){let r=e.pages[t.pageIndex]??e.pages[0];if(!r)return null;let o=Tr(r,t);return o?chunk6K6QQVAZ_cjs._d(e,t.pageIndex,o.fragments,n):null}function m0(e,t,n){let r=[];for(let o of e.pages)for(let a of [o.footnotes,o.endnotes]){let i=a?.notes.find(s=>s.scopeId===t);i&&r.push(...chunk6K6QQVAZ_cjs._d(e,o.index,i.fragments,n));}return r.length>0?r:null}function df(e,t){return e.querySelector(`[data-page-index="${t}"] > [data-docx-hf-active]`)??e.querySelector("[data-docx-hf-active]")}function cf(e,t,n){let r=e.querySelectorAll("[data-docx-note-scope]"),o=null;for(let a of r){if(a.dataset.docxNoteScope!==t||!a.matches("[data-docx-note]"))continue;o??=a;let i=Number(a.closest("[data-page-index]")?.dataset.pageIndex);if(n!==null&&i===n)return a}return o}function uf(e,t,n){if((a=>{let i=e.pages[a];return !!i&&!!Tr(i,t)})(t.pageIndex)&&(n===void 0||n.has(t.pageIndex)))return t.pageIndex;let o=null;for(let a of e.pages)if(Tr(a,t)&&(o===null&&(o=a.index),n===void 0||n.has(a.index)))return a.index;return o??t.pageIndex}function ff(e){return e?{rId:e.scope.rId,pageIndex:e.pageIndex,kind:e.kind,partName:e.partName,variant:e.variant}:null}function pf(e,t,n){e.classList.toggle("docx-paginated-surface--hf-editing",n),t.classList.toggle("docx-pages--hf-editing",n);}function Ds(e,t){e.classList.toggle("docx-paginated-surface--viewing",t==="view");}function Hs(e,t,n,r,o,a,i){let s=o?g0(e,o,i):a?m0(e,a,i):null,d=chunk6K6QQVAZ_cjs.fe(e,t,n,r,{...i?{measurer:i}:{},...s?{stops:s}:{}});if(!d)return null;if(!s)return d;let c=s.find(p=>p.position.paragraphId===d.position.paragraphId&&p.position.offset===d.position.offset);return c?{...d,pageIndex:c.pageIndex}:d}function _s(e,t,n){for(let r of e.pages){let o=n(r.index);for(let a of [r.footnotes,r.endnotes])if(a)for(let i of a.notes){let s=i.box,d=s.x+o,c=s.y;if(t.x>=d&&t.x<d+s.width&&t.y>=c&&t.y<c+s.height)return {pageIndex:r.index,scopeId:i.scopeId,noteKind:i.noteKind,noteId:i.noteId,local:{x:t.x-d,y:t.y-c},fragments:i.fragments}}}return null}function gf(e,t){let n=e[t],r=e.contentBox,o=e.box;if(t==="header"){let c=o.y,p=r.y,b=n?Math.max(p,n.box.y+n.box.height):p,x=n?Math.min(c,n.box.y):c;return b<=x?null:{x:r.x,y:x,width:r.width,height:b-x}}let a=r.y+r.height,i=o.y+o.height,s=n?Math.min(a,n.box.y):a,d=n?Math.max(i,n.box.y+n.box.height):i;return d<=s?null:{x:r.x,y:s,width:r.width,height:d-s}}function Bs(e,t,n){for(let r of e.pages){let o=n(r.index);for(let a of ["header","footer"]){if(r[a])continue;let i=gf(r,a);if(!i)continue;let s=i.x+o;if(t.x>=s&&t.x<s+i.width&&t.y>=i.y&&t.y<i.y+i.height)return {pageIndex:r.index,kind:a}}}return null}function qs(e,t,n){for(let r of e.pages){let o=n(r.index);for(let a of ["header","footer"]){let i=r[a];if(!i)continue;let s=i.box,d=gf(r,a)??s,c=d.x+o,p=d.y;if(t.x>=c&&t.x<c+d.width&&t.y>=p&&t.y<p+d.height)return {pageIndex:r.index,kind:a,story:i,local:{x:t.x-(s.x+o),y:t.y-s.y}}}}return null}function Pr(e,t,n){if(!t&&!n)return chunk6K6QQVAZ_cjs.tc(e);let r=new Set,o=[];for(let a of e.pages)for(let i of p0(a,t,n)){for(let s of i.lines)for(let d of chunk6K6QQVAZ_cjs.vc(s))r.has(d.paragraphId)||(r.add(d.paragraphId),o.push(d.paragraphId));i.lines.length===0&&!r.has(i.paragraphId)&&(r.add(i.paragraphId),o.push(i.paragraphId));}return o}function ja(e,t,n,r){let o=Pr(e,n,r);if(o.length===0)return t;let a=new Set(o),i=s=>a.has(s.paragraphId)?s:{paragraphId:o[0],offset:0};return {anchor:i(t.anchor),head:i(t.head)}}function af(e){let t=[],n=r=>{for(let o of r){if(o.kind==="paragraph"){t.push(o);continue}for(let a of o.rows)if(!a.isHeaderRepeat)for(let i of a.cells)n(i.blocks);}};return n(e),t}function mf(e){return e.family.trim().length===0?"font family must not be empty":!Number.isInteger(e.weight)||e.weight<1||e.weight>1e3?"font weight must be an integer from 1 through 1000":e.style!=="normal"&&e.style!=="italic"?"font style must be normal or italic":null}function h0(e){try{return typeof caches>"u"?Promise.resolve(null):caches.open(e).catch(()=>null)}catch{return Promise.resolve(null)}}async function y0(e,t){if(!e)return null;try{let n=await e.match(t);return n?new Uint8Array(await n.arrayBuffer()):null}catch{return null}}async function b0(e,t,n){if(e)try{await e.put(t,new Response(n.slice(),{headers:{"Content-Length":String(n.byteLength)}}));}catch{}}async function v0(e,t){if(e)try{await e.delete(t);}catch{}}async function x0(e){let t=e.fetcher??fetch,n=e.maxFontBytes??chunk6K6QQVAZ_cjs.a,r=await h0(e.cacheName??"docx-editor-fonts");async function o(d){let c=Object.freeze({family:d.family,weight:d.weight,style:d.style}),p=mf(c);if(p)return {failure:{url:d.url,request:c,reason:"invalidRequest",diagnostic:p}};let b=(P,B)=>{if(P.byteLength===0)return {url:d.url,request:c,reason:"emptyResponse"};if(P.byteLength>n)return {url:d.url,request:c,reason:"overLimit"};let h=chunk6K6QQVAZ_cjs.f(P,d.faceIndex??0);if(!h.valid)return {url:d.url,request:c,reason:"malformed",diagnostic:h.diagnostic};let N=chunk35MI6K7M_cjs.a(P);return d.hash!==void 0&&d.hash!==N?{url:d.url,request:c,reason:"hashMismatch",expectedHash:d.hash,actualHash:N,...B?{diagnostic:"cached bytes failed revalidation"}:{}}:{request:c,id:`url:${d.url}`,bytes:P,hash:N,faceIndex:d.faceIndex??0}},x=await y0(r,d.url);if(x){let P=b(x,true);if(!("reason"in P))return {source:P};await v0(r,d.url);}let w;try{w=await t(d.url);}catch(P){return {failure:{url:d.url,request:c,reason:"networkError",diagnostic:P instanceof Error?P.message:String(P)}}}if(!w.ok)return {failure:{url:d.url,request:c,reason:"httpError",status:w.status}};let F;try{F=new Uint8Array(await w.arrayBuffer());}catch(P){return {failure:{url:d.url,request:c,reason:"networkError",diagnostic:P instanceof Error?P.message:String(P)}}}let T=b(F,false);return "reason"in T?{failure:T}:(await b0(r,d.url,F),{source:T})}let a=await Promise.all(e.sources.map(d=>o(d))),i=[],s=[];for(let d of a)"source"in d?i.push(d.source):s.push(d.failure);return {sources:i,failures:s}}function I0(e,t,n={}){let r=Object.freeze({family:t.family,weight:t.weight,style:t.style}),o=n.id??`bytes:${r.family}#${r.weight}#${r.style}`,a=mf(r);if(a)return {failure:{url:o,request:r,reason:"invalidRequest",diagnostic:a}};if(e.byteLength===0)return {failure:{url:o,request:r,reason:"emptyResponse"}};if(e.byteLength>(n.maxFontBytes??chunk6K6QQVAZ_cjs.a))return {failure:{url:o,request:r,reason:"overLimit"}};let i=t.faceIndex??0,s=chunk6K6QQVAZ_cjs.f(e,i);return s.valid?{source:{request:r,id:o,bytes:e,hash:chunk35MI6K7M_cjs.a(e),faceIndex:i}}:{failure:{url:o,request:r,reason:"malformed",diagnostic:s.diagnostic}}}var S0=96,hf=37.79527559055118;function k0(e,t){if(!Number.isFinite(e)||e<=0)return [];let n=[];if(t==="inch"){let i=Math.floor(e/12);for(let s=0;s<=i;s+=1){let d=s*12;if(s%8===0){let c=s/8;n.push({position:d,height:10,...c>0?{label:String(c)}:{}});}else s%4===0?n.push({position:d,height:6}):s%2===0?n.push({position:d,height:4}):n.push({position:d,height:2});}return n}let r=hf/10,o=Math.floor(e/r);for(let a=0;a<=o;a+=1){let i=a*r;if(a%10===0){let s=a/10;n.push({position:i,height:10,...s>0?{label:String(s)}:{}});}else a%5===0?n.push({position:i,height:6}):n.push({position:i,height:3});}return n}function w0(e){let t=[...e].sort((n,r)=>n.index-r.index)[0];return t?t.box:null}var T0=1440,P0=567,C0=180,R0=56.7,Ka=(e,t,n)=>n<t||e<t?t:e>n?n:e;function E0(e,t,n){switch(e){case "firstLine":return n.leftMargin+t.left+t.firstLine;case "hanging":case "left":return n.leftMargin+t.left;case "right":return n.pageWidth-n.rightMargin-t.right}}function yf(e,t,n){if(n)return Math.round(e);let r=t==="cm"?56.7:180;return Math.round(Math.round(e/r)*r)}function O0(e,t,n,r,o={}){let a=yf(t,o.unit??"inch",o.precise??false),i=r.pageWidth-r.rightMargin-n.right,s=r.leftMargin+n.left+Math.max(0,n.firstLine);switch(e){case "firstLine":{let d=Ka(a,0,i);return {...n,firstLine:d-r.leftMargin-n.left}}case "left":{let d=-r.leftMargin-Math.min(0,n.firstLine),c=i-r.leftMargin-Math.max(0,n.firstLine);return {...n,left:Ka(a-r.leftMargin,d,c)}}case "hanging":{let d=Ka(a-r.leftMargin,-r.leftMargin,i-r.leftMargin);return {...n,left:d,firstLine:n.firstLine+(n.left-d)}}case "right":{let d=Ka(a,s,r.pageWidth);return {...n,right:r.pageWidth-r.rightMargin-d}}}}function st(e){if(typeof e!="object"||e===null)return false;let t=e;return typeof t.paraId=="string"&&t.paraId.length>0&&(t.search===void 0||typeof t.search=="string"&&t.search.length>0)&&(t.occurrence===void 0||typeof t.occurrence=="number"&&Number.isInteger(t.occurrence)&&t.occurrence>=1)}function Qn(e){if(typeof e!="object"||e===null)return false;let t=e;return st(t.from)&&st(t.to)}function bf(e,t,n){let r=[],o=e.indexOf(t);for(;o>=0&&r.length<n;)r.push(o),o=e.indexOf(t,o+1);return r}function tn(e,t,n){if(typeof n.paraId!="string"||n.paraId.length===0)return {ok:false,code:"invalidArgs",reason:"paraId must be a non-empty string"};let r=n.paraId.toUpperCase();if(t.ambiguousParaIds.has(r))return {ok:false,code:"ambiguous",reason:`paraId '${n.paraId}' is claimed by more than one story`};let o=t.nodeByParaId.get(r);if(o===void 0)return {ok:false,code:"notFound",reason:`no paragraph with paraId '${n.paraId}'`};let a=chunk35MI6K7M_cjs._f(t.partByNode.get(o)??e,o)??"";if(n.search===void 0)return {ok:true,span:{nodeId:o,start:0,end:a.length}};if(n.search.length===0)return {ok:false,code:"invalidArgs",reason:"search must be a non-empty phrase"};if(n.occurrence!==void 0){if(!Number.isInteger(n.occurrence)||n.occurrence<1)return {ok:false,code:"invalidArgs",reason:"occurrence must be a positive integer (1-based)"};let s=bf(a,n.search,n.occurrence),d=s[n.occurrence-1];return d===void 0?{ok:false,code:"notFound",reason:`'${n.search}' matches ${s.length} time(s) in paragraph '${n.paraId}'; occurrence ${n.occurrence} does not exist`}:{ok:true,span:{nodeId:o,start:d,end:d+n.search.length}}}let i=bf(a,n.search,2);return i.length===0?{ok:false,code:"notFound",reason:`'${n.search}' does not occur in paragraph '${n.paraId}'`}:i.length>1?{ok:false,code:"ambiguous",reason:`'${n.search}' matches more than once in paragraph '${n.paraId}'; pass occurrence to disambiguate`}:{ok:true,span:{nodeId:o,start:i[0],end:i[0]+n.search.length}}}function vf(e,t,n){if("anchor"in n){let s=tn(e,t,n.anchor);if(!s.ok)return {ok:false,code:s.code,reason:s.reason,target:n.anchor};let d={paragraphId:s.span.nodeId,offset:s.span.start};return {ok:true,selection:{anchor:d,head:d}}}let{from:r,to:o}=n.range;if(!st(r)||!st(o))return {ok:false,code:"unsupported",reason:"DocLocation endpoints are not supported; address paragraphs by paraId",target:n.range};let a=tn(e,t,r);if(!a.ok)return {ok:false,code:a.code,reason:a.reason,target:r};let i=tn(e,t,o);return i.ok?{ok:true,selection:{anchor:{paragraphId:a.span.nodeId,offset:a.span.start},head:{paragraphId:i.span.nodeId,offset:i.span.end}}}:{ok:false,code:i.code,reason:i.reason,target:o}}var Co=/^[0-9A-Fa-f]{6}$/,xf={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folhlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedhyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"},F0={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"};function Zs(e){return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=1}function Va(e){return Math.max(0,Math.min(1,e))}function If(e){let t=e.replace(/^#/,"").padStart(6,"0").slice(0,6);return {r:parseInt(t.slice(0,2),16)||0,g:parseInt(t.slice(2,4),16)||0,b:parseInt(t.slice(4,6),16)||0}}function Sf(e,t,n){let r=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return `${r(e)}${r(t)}${r(n)}`.toUpperCase()}function kf(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "FFFFFF";let r=Math.max(0,Math.min(255,Math.round((1-Va(t))*255)))/255,o=If(e);return Sf(r*255+(1-r)*o.r,r*255+(1-r)*o.g,r*255+(1-r)*o.b)}function wf(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "000000";let r=Math.max(0,Math.min(255,Math.round(Va(t)*255)))/255,o=If(e);return Sf(r*o.r,r*o.g,r*o.b)}function zs(e){return xf[e]??xf[e.toLowerCase()]??null}function A0(e,t){let n=zs(e);if(!n)return null;let r=t.find(a=>a.slot===n)?.hex;if(r&&Co.test(r))return r.toUpperCase();let o=F0[n];return o&&Co.test(o)?o.toUpperCase():null}function Ua(e,t){let n=A0(e.slot,t);if(!n)return {ok:false,reason:"the theme colour could not be resolved for this document"};if(e.tint!==void 0&&!Zs(e.tint))return {ok:false,reason:"theme tint is out of range"};if(e.shade!==void 0&&!Zs(e.shade))return {ok:false,reason:"theme shade is out of range"};let r=n;return e.tint!==void 0?r=kf(r,Va(e.tint)):e.shade!==void 0&&(r=wf(r,Va(e.shade))),{ok:true,hex:r}}var M0="000000";function $s(e,t){if(e.kind==="hex"){let o=e.value.toUpperCase();return Co.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"border colour requires a six-digit hex value"}}if(e.kind==="auto")return {ok:true,color:{kind:"auto",resolvedHex:M0}};let n=Ua(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:zs(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function js(e,t){if(e.kind==="auto")return {ok:false,reason:"automatic fill cannot be written without a resolved colour"};if(e.kind==="hex"){let o=e.value.toUpperCase();return Co.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"fill colour requires a six-digit hex value"}}let n=Ua(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:zs(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function L0(e,t,n="000000"){if(!e||e.kind==="auto")return `#${n}`;if(e.kind==="hex"){let o=e.value.replace(/^#/,"").toUpperCase();return Co.test(o)?`#${o}`:`#${n}`}let r=Ua(e,t);return `#${r.ok?r.hex:n}`}var _0=new Set(["insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","setCellFill","setTableCellVerticalAlignment","setTableBorders","commitTableColumnDividerResize","commitTableRightEdgeResize","mergeCells","splitCell","toggleHeaderRow","selectTableRegion","setTableProperties"]);function Cr(e){return _0.has(e.type)}function de(e,t){return {ok:false,code:e,reason:t}}function Ks(e,t){switch(e){case "unknown-table":case "unknown-row":case "unknown-grid-column":return de("invalidArgs","the table target is no longer valid");case "table-has-merge":return de("unsupported","this table has merged cells");case "vertical-merge-crossing":return de("unsupported","the row cannot be inserted across a vertical merge");case "block-required":return de("unsupported","the table must keep at least one row or column");case "resource-limit":return de("unsupported","the table has reached the supported size limit");case "invalidArgs":case "invalid-property-value":case "unsupported-property":return de("invalidArgs","the table command arguments are invalid");default:return de("unsupported",`the table operation was refused (${e})`)}}function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pt(e,t){return !rt(e)||Object.keys(e).length!==t.length?false:t.every(r=>Object.prototype.hasOwnProperty.call(e,r))}function Rf(e){if(!rt(e))return false;let t=e.kind;if(t==="hex")return Pt(e,["kind","value"])&&typeof e.value=="string";if(t==="auto")return Pt(e,["kind"]);if(t==="theme"){if(typeof e.slot!="string")return false;let n=["kind","slot"];if(e.tint!==void 0){if(typeof e.tint!="number"||!Number.isFinite(e.tint))return false;n.push("tint");}if(e.shade!==void 0){if(typeof e.shade!="number"||!Number.isFinite(e.shade))return false;n.push("shade");}return Pt(e,n)}return false}function Ef(e){return rt(e)&&Pt(e,["sourceRevision","tableId","rowId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.rowId=="string"&&e.rowId.length>0&&typeof e.isHeaderRepeat=="boolean"}function Of(e){return rt(e)&&Pt(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.gridColumnId=="string"&&e.gridColumnId.length>0&&typeof e.isHeaderRepeat=="boolean"}function B0(e){return rt(e)&&Pt(e,["sourceRevision","tableId","leftGridColumnId","rightGridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.leftGridColumnId=="string"&&typeof e.rightGridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function q0(e){return rt(e)&&Pt(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.gridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function Z0(e){return !rt(e)||!Pt(e,["style","size","color"])?false:typeof e.style=="string"&&typeof e.size=="number"&&Number.isInteger(e.size)&&Rf(e.color)}function Tf(e){return !("target"in e)||e.target===void 0||Ef(e.target)}function Pf(e){return !("target"in e)||e.target===void 0||Of(e.target)}function z0(e){switch(e.type){case "insertRow":return !rt(e)||e.type!=="insertRow"?de("invalidArgs","insertRow command shape is invalid"):e.where!=="above"&&e.where!=="below"?de("invalidArgs","insertRow where must be above or below"):Tf(e)?null:de("invalidArgs","insertRow target shape is invalid");case "deleteRow":return !rt(e)||e.type!=="deleteRow"?de("invalidArgs","deleteRow command shape is invalid"):Tf(e)?null:de("invalidArgs","deleteRow target shape is invalid");case "insertColumn":return !rt(e)||e.type!=="insertColumn"?de("invalidArgs","insertColumn command shape is invalid"):e.where!=="left"&&e.where!=="right"?de("invalidArgs","insertColumn where must be left or right"):Pf(e)?null:de("invalidArgs","insertColumn target shape is invalid");case "deleteColumn":return !rt(e)||e.type!=="deleteColumn"?de("invalidArgs","deleteColumn command shape is invalid"):Pf(e)?null:de("invalidArgs","deleteColumn target shape is invalid");case "deleteTable":return !rt(e)||!Pt(e,["type"])?de("invalidArgs","deleteTable command shape is invalid"):null;case "setCellFill":return !rt(e)||!Pt(e,["type","color"])?de("invalidArgs","setCellFill command shape is invalid"):e.color!==null&&!Rf(e.color)?de("invalidArgs","setCellFill color shape is invalid"):null;case "setTableCellVerticalAlignment":return !rt(e)||!Pt(e,["type","alignment"])||!["top","center","bottom"].includes(e.alignment)?de("invalidArgs","cell vertical alignment command shape is invalid"):null;case "setTableBorders":return !rt(e)||e.type!=="setTableBorders"?de("invalidArgs","setTableBorders command shape is invalid"):e.scope==="none"?typeof e.target!="string"?de("invalidArgs","border none scope requires a target edge"):null:!("spec"in e)||!Z0(e.spec)?de("invalidArgs","concrete border scopes require a complete spec"):null;case "commitTableColumnDividerResize":return !rt(e)||!Pt(e,["type","target","leftWidthTwips","rightWidthTwips"])||!B0(e.target)||typeof e.leftWidthTwips!="number"||typeof e.rightWidthTwips!="number"?de("invalidArgs","column divider resize command shape is invalid"):null;case "commitTableRightEdgeResize":return !rt(e)||!Pt(e,["type","target","columnWidthTwips","tableWidthTwips"])||!q0(e.target)||typeof e.columnWidthTwips!="number"||typeof e.tableWidthTwips!="number"?de("invalidArgs","right-edge resize command shape is invalid"):null;default:return null}}function $0(e){return !("target"in e)||e.target===void 0?null:Ef(e.target)?e.target:null}function j0(e){return !("target"in e)||e.target===void 0?null:Of(e.target)?e.target:null}function K0(e,t){let n=chunk35MI6K7M_cjs.Gf(e.root,t.tableId);if(!n.ok)return {rowIds:[t.rowId],wholeTable:false};let r=new Set(t.cellIds),o=n.topology.rows.filter(a=>a.cells.some(i=>r.has(i.id))).map(a=>a.row.id);return o.length===0?{rowIds:[t.rowId],wholeTable:false}:{rowIds:o,wholeTable:o.length===n.topology.rows.length}}function V0(e,t){let n=chunk35MI6K7M_cjs.Gf(e.root,t.tableId);if(!n.ok||!n.topology.grid)return {gridColumnIds:[],wholeTable:false};let r=new Set(t.cellIds),o=new Set;for(let a of n.topology.rows){let i=0;for(let s of a.cells){let d=Ff(s);if(r.has(s.id))for(let c=0;c<d;c+=1){let p=n.topology.gridColumns[i+c];p&&o.add(p.id);}i+=d;}}return {gridColumnIds:[...o],wholeTable:o.size>0&&o.size===n.topology.gridColumns.length}}function Cf(e,t,n){let r=chunk35MI6K7M_cjs.Gf(e.root,t);return !r.ok||!r.topology.grid?null:r.topology.gridColumns[n]?.id??null}function U0(e){let t=chunk6K6QQVAZ_cjs.pe(e.layout,e.selection.head.paragraphId,e.cellSelection);return t?{tableId:t.tableId,rowId:t.rowId,cellId:t.cellId,cellIds:[...t.cellIds],gridColumnIndex:t.gridColumnIndex,isHeaderRepeat:t.isHeaderRepeat}:null}function Ff(e){let t=chunk35MI6K7M_cjs.Ef(e,"tcPr"),n=t&&chunk35MI6K7M_cjs.Ef(t,"gridSpan"),r=n&&chunk35MI6K7M_cjs.Ff(n,"val");if(!r||!/^\d{1,7}$/.test(r))return 1;let o=Number(r);return Number.isInteger(o)&&o>1?Math.min(o,1024):1}function W0(e,t,n){let r=e.gridColumns.findIndex(o=>o.id===n);if(r===-1)return null;for(let{row:o,cells:a}of e.rows){let i=0;for(let s of a){let d=Ff(s);if(r>=i&&r<i+d)return {tableId:t,rowId:o.id,cellId:s.id,cellIds:[s.id],gridColumnIndex:r,isHeaderRepeat:false};i+=d;}}return null}function G0(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunk35MI6K7M_cjs.Gf(e.part.root,t.tableId);if(!n.ok)return null;let r=n.topology.rows.findIndex(i=>i.row.id===t.rowId);if(r===-1)return null;let a=n.topology.rows[r].cells[0];return a?{tableId:t.tableId,rowId:t.rowId,cellId:a.id,cellIds:[a.id],gridColumnIndex:0,isHeaderRepeat:false}:null}function X0(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunk35MI6K7M_cjs.Gf(e.part.root,t.tableId);return n.ok?W0(n.topology,t.tableId,t.gridColumnId):null}function Y0(e,t){for(let n of t){let r=chunk35MI6K7M_cjs.$f(e,n);if(r)return Ks(r)}return null}function Tt(e,t,n){let r=Y0(e,t);return r||{ok:true,ops:t,selection:n}}function Q0(e,t){if(!chunk35MI6K7M_cjs.Hf.includes(e.style))return {ok:false,reason:"border style is not allowlisted"};if(!Number.isInteger(e.size)||e.size<1)return {ok:false,reason:"border size is out of range"};if(e.size>96)return {ok:false,reason:"border size is out of range"};let n=$s(e.color,t);return n.ok?{ok:true,spec:{style:e.style,size:e.size,color:n.color}}:{ok:false,reason:n.reason}}function Ro(e,t,n){return n!==e.storeRevision?de("invalidArgs","the table target is stale"):chunk35MI6K7M_cjs.Gf(e.part.root,t).ok?null:de("invalidArgs","the table target is no longer valid")}function J0(e){return e?.isHeaderRepeat?de("unsupported","repeated header rows cannot be edited"):null}function eb(e,t,n,r){let o=Ro(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return de("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return de("invalidArgs","column widths must be whole twips");if(n<300||r<300)return de("invalidArgs","column widths are below the minimum");let a=chunk35MI6K7M_cjs.Gf(e.part.root,t.tableId);if(!a.ok){let b=a.reason==="duplicate-node-id"?"unknown-table":a.reason;return Ks(b)}if(a.topology.hasMerge)return de("unsupported","this table has merged cells");let i=a.topology.gridColumns.find(b=>b.id===t.leftGridColumnId),s=a.topology.gridColumns.find(b=>b.id===t.rightGridColumnId);if(!i||!s)return de("invalidArgs","the table target is no longer valid");let d=a.topology.gridColumns.indexOf(i);if(a.topology.gridColumns.indexOf(s)!==d+1)return de("invalidArgs","the column divider target is not adjacent");let p={op:"setTableColumnWidths",tableId:t.tableId,leftGridColumnId:t.leftGridColumnId,rightGridColumnId:t.rightGridColumnId,leftWidthTwips:n,rightWidthTwips:r};return Tt(e.part,[p],{kind:"preserveSelection"})}function tb(e,t,n,r){let o=Ro(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return de("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return de("invalidArgs","column widths must be whole twips");if(n<300)return de("invalidArgs","column widths are below the minimum");let a=chunk35MI6K7M_cjs.Gf(e.part.root,t.tableId);if(!a.ok){let d=a.reason==="duplicate-node-id"?"unknown-table":a.reason;return Ks(d)}if(a.topology.hasMerge)return de("unsupported","this table has merged cells");let i=a.topology.gridColumns[a.topology.gridColumns.length-1];if(!i||i.id!==t.gridColumnId)return de("invalidArgs","the resize target is not the table right edge");let s={op:"setTableRightEdgeWidth",tableId:t.tableId,gridColumnId:t.gridColumnId,columnWidthTwips:n,tableWidthTwips:r};return Tt(e.part,[s],{kind:"preserveSelection"})}function Af(e,t,n){if(e.viewing||!e.editable)return de("locked","the document is open for viewing");let r=Ro(e,t.tableId,t.sourceRevision);if(r)return r;if(t.isHeaderRepeat)return de("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||n<20||n>31680)return de("invalidArgs","row height is outside the supported range");let o={op:"setTableRowHeight",tableId:t.tableId,rowId:t.rowId,heightTwips:n};return Tt(e.part,[o],{kind:"preserveSelection"})}function Sn(e){let{command:t,part:n,viewing:r,editable:o}=e;if(r||!o)return de("locked","the document is open for viewing");switch(t.type){case "mergeCells":return de("unsupported","cell merge is not supported yet");case "splitCell":return de("unsupported","cell split is not supported yet");case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return de("unsupported",`command '${t.type}' is not supported by the tree editor`);}let a=z0(t);if(a)return a;let i=$0(t),s=j0(t),d=J0(i??s);if(d)return d;if(i){let p=Ro(e,i.tableId,i.sourceRevision);if(p)return p}if(s){let p=Ro(e,s.tableId,s.sourceRevision);if(p)return p}let c=i!==null?G0(e,i):s!==null?X0(e,s):U0(e);if(t.type!=="commitTableColumnDividerResize"&&t.type!=="commitTableRightEdgeResize"&&!c)return i||s?de("invalidArgs","the table target is no longer valid"):de("unsupported","the selection is not inside a table");if(c?.isHeaderRepeat)return de("unsupported","repeated header rows cannot be edited");switch(t.type){case "insertRow":{if(!c)return de("unsupported","the selection is not inside a table");let p={op:"insertTableRow",tableId:c.tableId,rowId:c.rowId,where:t.where};return Tt(n,[p],{kind:"adoptCommittedCaret"})}case "deleteRow":{if(!c)return de("unsupported","the selection is not inside a table");let p=K0(n,c),b=p.wholeTable?[{op:"deleteBlock",blockId:c.tableId}]:p.rowIds.map(x=>({op:"deleteTableRow",tableId:c.tableId,rowId:x,...x===c.rowId?{referenceCellId:c.cellId}:{}}));return Tt(n,b,{kind:"adoptCommittedCaret"})}case "insertColumn":{if(!c)return de("unsupported","the selection is not inside a table");let p=s?.tableId??c.tableId,b=s?.gridColumnId??Cf(n,p,c.gridColumnIndex),x=b?{op:"insertTableColumn",tableId:p,where:t.where,gridColumnId:b}:{op:"insertTableColumn",tableId:p,where:t.where,referenceCellId:c.cellId};return Tt(n,[x],{kind:"adoptCommittedCaret"})}case "deleteColumn":{if(!c)return de("unsupported","the selection is not inside a table");let p=s?.tableId??c.tableId,b=s?.gridColumnId??Cf(n,p,c.gridColumnIndex);if(!b)return de("invalidArgs","the table has no grid column to delete");let x=s?.gridColumnId===void 0?V0(n,c):{gridColumnIds:[b],wholeTable:false};if(x.wholeTable)return Tt(n,[{op:"deleteBlock",blockId:p}],{kind:"adoptCommittedCaret"});let F=(x.gridColumnIds.length>0?x.gridColumnIds:[b]).map(T=>({op:"deleteTableColumn",tableId:p,gridColumnId:T}));return Tt(n,F,{kind:"adoptCommittedCaret"})}case "deleteTable":{if(!c)return de("unsupported","the selection is not inside a table");let p={op:"deleteBlock",blockId:c.tableId};return Tt(n,[p],{kind:"adoptCommittedCaret"})}case "setCellFill":{if(!c)return de("unsupported","the selection is not inside a table");let p;if(t.color===null)p=null;else {let x=js(t.color,e.themeColors);if(!x.ok)return de("invalidArgs",x.reason);p=x.color;}let b={op:"setTableCellFill",tableId:c.tableId,cellIds:c.cellIds,color:p};return Tt(n,[b],{kind:"preserveSelection"})}case "setTableCellVerticalAlignment":{if(!c)return de("unsupported","the selection is not inside a table");let p={op:"setTableCellVerticalAlignment",tableId:c.tableId,cellIds:c.cellIds,alignment:t.alignment};return Tt(n,[p],{kind:"preserveSelection"})}case "setTableBorders":{if(!c)return de("unsupported","the selection is not inside a table");if(t.scope==="none"){let x={op:"setTableCellBorders",tableId:c.tableId,cellIds:c.cellIds,scope:"none",target:t.target};return Tt(n,[x],{kind:"preserveSelection"})}let p=Q0(t.spec,e.themeColors);if(!p.ok)return de("invalidArgs",p.reason);let b={op:"setTableCellBorders",tableId:c.tableId,cellIds:c.cellIds,scope:t.scope,spec:p.spec};return Tt(n,[b],{kind:"preserveSelection"})}case "commitTableColumnDividerResize":return eb(e,t.target,t.leftWidthTwips,t.rightWidthTwips);case "commitTableRightEdgeResize":return tb(e,t.target,t.columnWidthTwips,t.tableWidthTwips);default:return de("unsupported",`command '${t.type}' is not a table command`)}}function Mf(e){if(!Cr(e))return {supported:false,reason:`command '${e.type}' is not a table command`};switch(e.type){case "mergeCells":return {supported:false,reason:"cell merge is not supported yet"};case "splitCell":return {supported:false,reason:"cell split is not supported yet"};case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`};default:return {supported:true}}}var nb=["alignment","spaceBeforePt","spaceAfterPt","lineSpacing","tabStops"];function rb(e,t){return e===t?true:!e||!t?false:nb.every(n=>e[n]===t[n])}function Vs(e,t){if(e===t)return true;if(!e||!t||e.bold!==t.bold||e.italic!==t.italic||e.underline!==t.underline||e.strike!==t.strike||e.superscript!==t.superscript||e.subscript!==t.subscript||e.highlight!==t.highlight||e.fontFamily!==t.fontFamily||e.fontSizePt!==t.fontSizePt||e.alignment!==t.alignment||e.styleId!==t.styleId||e.spaceBeforePt!==t.spaceBeforePt||e.spaceAfterPt!==t.spaceAfterPt||e.lineSpacing?.rule!==t.lineSpacing?.rule||e.lineSpacing?.value!==t.lineSpacing?.value||e.indent?.left!==t.indent?.left||e.indent?.right!==t.indent?.right||e.indent?.firstLine!==t.indent?.firstLine||e.indent?.mixed.left!==t.indent?.mixed.left||e.indent?.mixed.right!==t.indent?.mixed.right||e.indent?.mixed.firstLine!==t.indent?.mixed.firstLine||e.paragraphFlags?.contextualSpacing!==t.paragraphFlags?.contextualSpacing||e.paragraphFlags?.keepNext!==t.paragraphFlags?.keepNext||e.paragraphFlags?.keepLines!==t.paragraphFlags?.keepLines||e.paragraphFlags?.widowControl!==t.paragraphFlags?.widowControl||e.paragraphFlags?.pageBreakBefore!==t.paragraphFlags?.pageBreakBefore||!rb(e.disagrees,t.disagrees)||e.tabStops?.length!==t.tabStops?.length||(e.tabStops??[]).some((a,i)=>a.positionTwips!==t.tabStops?.[i]?.positionTwips||a.alignment!==t.tabStops?.[i]?.alignment||(a.leader??"none")!==(t.tabStops?.[i]?.leader??"none")))return false;if(e.color===t.color)return true;if(!e.color||!t.color)return false;let n=e.color,r=t.color,o=new Set([...Object.keys(n),...Object.keys(r)]);for(let a of o)if(n[a]!==r[a])return false;return true}function Us(e,t){return e.current===t.current&&e.total===t.total}function Ws(e,t){return e===t?true:!e||!t?false:e.pageWidthTwips===t.pageWidthTwips&&e.pageHeightTwips===t.pageHeightTwips&&e.orientation===t.orientation&&e.marginsTwips.top===t.marginsTwips.top&&e.marginsTwips.right===t.marginsTwips.right&&e.marginsTwips.bottom===t.marginsTwips.bottom&&e.marginsTwips.left===t.marginsTwips.left&&e.gutterTwips===t.gutterTwips}function Lf(e,t){if(e===t)return true;if(!e||!t)return false;let n=e,r=t;return n.paraId===r.paraId&&n.search===r.search&&n.occurrence===r.occurrence}function Gs(e,t){return e===t?true:!e||!t||!Qn(e)||!Qn(t)?false:Lf(e.from,t.from)&&Lf(e.to,t.to)}function Xs(){let e=null;return t=>(t===null?e=null:e?.id!==t&&(e=Object.freeze({id:t})),e)}var ob={scope:"compared",isLoading:"compared",isOpening:"compared",parseError:"compared",editable:"compared",zoom:"compared",zoomMode:"compared",selection:"compared",selectionCollapsed:"compared",formatting:"compared",table:"compared",tocContext:"compared",image:"compared",page:"compared",canUndo:"compared",canRedo:"compared",pageSetup:"compared",reviewPaneOpen:"compared",hasReviewContent:"compared",editingMode:"compared",lastRejection:"compared",fontSubstitutions:"compared"},ab=Object.keys(ob);function Ys(e,t){return ab.every(n=>e[n]===t[n])}function Wa(e){if(e===null||typeof e!="object"||Object.isFrozen(e))return e;if(Array.isArray(e)){for(let n of e)Wa(n);return Object.freeze(e)}let t=e;for(let n of Object.keys(t))Wa(t[n]);return Object.freeze(e)}var Qs=new Map([["bold",{localName:"b"}],["italic",{localName:"i"}],["underline",{localName:"u",attributes:{val:"single"}}],["strike",{localName:"strike"}],["superscript",{localName:"vertAlign",attributes:{val:"superscript"}}],["subscript",{localName:"vertAlign",attributes:{val:"subscript"}}]]),ib=new Set(["none","black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","yellow","white"]),sb=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,lb=/^[0-9A-Fa-f]{6}$/;function Js(e){let{mark:t,value:n}=e;switch(t){case "fontFamily":return typeof n!="string"||!sb.test(n)?{ok:false,code:"invalidArgs",reason:"fontFamily requires a family name of 1-64 letters, digits, or [ -.+_]"}:{ok:true,localName:"rFonts",attributes:{ascii:n,hAnsi:n}};case "fontSize":return typeof n!="number"||!Number.isInteger(n)||n<2||n>3276?{ok:false,code:"invalidArgs",reason:"fontSize requires an integer half-point value between 2 and 3276"}:{ok:true,localName:"sz",attributes:{val:String(n)}};case "color":return typeof n!="string"||n!=="auto"&&!lb.test(n)?{ok:false,code:"invalidArgs",reason:"color requires a six-digit hex value like FF0000, or 'auto'"}:{ok:true,localName:"color",attributes:{val:n}};case "highlight":return typeof n!="string"||!ib.has(n)?{ok:false,code:"invalidArgs",reason:"highlight requires an ST_HighlightColor name (yellow, cyan, ...)"}:{ok:true,localName:"highlight",attributes:{val:n}};default:return {ok:false,code:"unsupported",reason:`mark '${t}' is not supported by setMarkAttr`}}}function _f(e){return typeof e=="object"&&e!==null&&typeof e.paragraphId=="string"&&typeof e.offset=="number"}function el(e){return typeof e=="object"&&e!==null&&_f(e.anchor)&&_f(e.head)}function Rr(e,t){let n=new Error(t);return n.code=e,n}function tl(e,t){return e===t?true:!e||!t?false:e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function nl(e){return e==="blank"?As():e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null}function rl(e){return typeof e=="string"?`'${e}' is not a document; pass DOCX bytes, or 'blank' for an empty one`:"a DocumentHandle cannot be re-loaded; pass DOCX bytes"}function Eo(e){switch(e.type){case "toggleMark":return Qs.has(e.mark)?{supported:true,mutating:true}:{supported:false,reason:`mark '${e.mark}' is not supported`};case "setMarkAttr":{let t=Js(e);return t.ok?{supported:true,mutating:true}:{supported:false,reason:t.reason,code:t.code}}case "setAlignment":return {supported:true,mutating:true};case "clearFormatting":return {supported:true,mutating:true};case "setLineSpacing":{if(!["multiple","exact","atLeast"].includes(e.rule))return {supported:false,code:"invalidArgs",reason:"setLineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let n=e.rule==="multiple"?e.value*240:e.value*20;return !Number.isFinite(e.value)||e.value<=0||Math.round(n)>31680?{supported:false,code:"invalidArgs",reason:"setLineSpacing requires a positive value no taller than 1584pt"}:{supported:true,mutating:true}}case "setParagraphSpacing":{for(let t of ["beforePt","afterPt"]){let n=e[t];if(n!=null&&(!Number.isFinite(n)||n<0||n>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphSpacing requires ${t} between 0 and 1584 points`}}return {supported:true,mutating:true}}case "setParagraphStyle":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; the style applies at the selection"}:typeof e.styleId!="string"||e.styleId.length===0||e.styleId.length>128||/[\u0000-\u001f\u007f-\u009f]/.test(e.styleId)?{supported:false,code:"invalidArgs",reason:"setParagraphStyle requires a styleId of 1-128 printable characters"}:{supported:true,mutating:true};case "insertHyperlink":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; a link applies at the selection"}:typeof e.href!="string"||e.href.length===0?{supported:false,code:"invalidArgs",reason:"insertHyperlink requires an href"}:{supported:true,mutating:true};case "removeHyperlink":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; unlink acts at the selection"};case "setParagraphFormat":{let t=[e.indentLeftTwips,e.indentRightTwips,e.indentFirstLineTwips];for(let r of t)if(r!=null&&(!Number.isInteger(r)||Math.abs(r)>chunk6K6QQVAZ_cjs.Cb))return {supported:false,code:"invalidArgs",reason:`indent values must be whole twips within \xB1${chunk6K6QQVAZ_cjs.Cb}`};for(let r of ["spaceBeforePt","spaceAfterPt"]){let o=e[r];if(o!=null&&(!Number.isFinite(o)||o<0||o>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphFormat requires ${r} between 0 and 1584 points`}}let n=e.lineSpacing;if(n!=null){if(n.rule!=="multiple"&&n.rule!=="exact"&&n.rule!=="atLeast")return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let r=n.rule==="multiple"?n.value*240:n.value*20;if(!Number.isFinite(n.value)||n.value<=0||Math.round(r)>31680)return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a positive value no taller than 1584pt"}}if(e.alignment!==void 0&&!["left","center","right","justify"].includes(e.alignment))return {supported:false,code:"invalidArgs",reason:"unknown alignment"};if(e.tabStops!==void 0){if(e.tabStops.length>64)return {supported:false,code:"invalidArgs",reason:"setParagraphFormat accepts at most 64 tab stops"};let r=new Set;for(let o of e.tabStops){if(typeof o!="object"||o===null)return {supported:false,code:"invalidArgs",reason:"a tab stop must be an object"};if(!Number.isInteger(o.positionTwips)||o.positionTwips<0||o.positionTwips>31680)return {supported:false,code:"invalidArgs",reason:"tab stop positions must be whole twips between 0 and 31680"};if(!["left","center","right","decimal"].includes(o.alignment))return {supported:false,code:"invalidArgs",reason:"unknown tab alignment"};if(o.leader!==void 0&&!["none","dot","hyphen","underscore","heavy","middleDot"].includes(o.leader))return {supported:false,code:"invalidArgs",reason:"unknown tab leader"};if(r.has(o.positionTwips))return {supported:false,code:"invalidArgs",reason:"two tab stops cannot share a position"};r.add(o.positionTwips);}}return {supported:true,mutating:true}}case "setIndent":{let t=[e.left,e.right,e.firstLine];if(t.every(n=>n===void 0))return {supported:false,reason:"setIndent requires at least one indent field"};for(let n of t)if(n!=null){if(!Number.isInteger(n))return {supported:false,reason:"indent values must be whole twips"};if(Math.abs(n)>chunk6K6QQVAZ_cjs.Cb)return {supported:false,reason:`indent values must be within \xB1${chunk6K6QQVAZ_cjs.Cb} twips`}}return {supported:true,mutating:true}}case "toggleList":return e.kind==="bullet"||e.kind==="ordered"?{supported:true,mutating:true}:{supported:false,reason:`list kind '${e.kind}' is not supported`};case "adjustIndent":return e.direction==="increase"||e.direction==="decrease"?{supported:true,mutating:true}:{supported:false,reason:`indent direction '${e.direction}' is not supported`};case "insertBreak":return e.kind==="line"||e.kind==="page"||e.kind==="section"||e.kind==="sectionContinuous"?{supported:true,mutating:true}:{supported:false,reason:`break kind '${e.kind}' is not supported`};case "insertText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; text inserts at the selection"};case "deleteText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; deletion removes the selection"};case "proposeInsertion":case "proposeReplacement":{let t=e.type==="proposeInsertion"?e.text:e.replaceWith;return typeof t!="string"||t.length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires non-empty text`}:/[\r\n\v\f\u2028\u2029]/.test(t)?{supported:false,code:"invalidArgs",reason:`${e.type} requires text without a paragraph mark`}:e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires a non-empty author`}:{supported:true,mutating:true}}case "proposeDeletion":return e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:"proposeDeletion requires a non-empty author"}:{supported:true,mutating:true};case "setPageSetup":{let t=[e.pageWidth,e.pageHeight],n=[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft];if(t.every(r=>r===void 0)&&n.every(r=>r===void 0)&&e.orientation===void 0)return {supported:false,reason:"setPageSetup requires at least one field"};for(let r of t)if(r!==void 0&&(!Number.isInteger(r)||r<1||r>63360))return {supported:false,code:"invalidArgs",reason:"page dimensions must be integer twips between 1 and 63360"};for(let r of n)if(r!==void 0&&(!Number.isInteger(r)||r<0||r>31680))return {supported:false,code:"invalidArgs",reason:"margins must be integer twips between 0 and 31680"};return e.orientation!==void 0&&e.orientation!=="portrait"&&e.orientation!=="landscape"?{supported:false,code:"invalidArgs",reason:"orientation must be 'portrait' or 'landscape'"}:e.scope!==void 0&&e.scope!=="document"&&e.scope!=="section"?{supported:false,code:"invalidArgs",reason:"scope must be 'document' or 'section'"}:{supported:true,mutating:true}}case "undo":case "redo":return {supported:true,mutating:true};case "insertTable":return Number.isInteger(e.rows)&&Number.isInteger(e.cols)&&e.rows>=1&&e.cols>=1&&e.rows<=32767&&e.cols<=63&&e.rows*e.cols<=2e4?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:`insertTable needs whole rows and cols of at least 1, at most ${32767}\xD7${63}, and at most ${2e4} cells`};case "insertToc":return {supported:true,mutating:true};case "refreshToc":return e.mode!==void 0&&e.mode!=="entire"&&e.mode!=="pageNumbers"?{supported:false,code:"invalidArgs",reason:"refreshToc mode must be 'entire' or 'pageNumbers'"}:e.tocId!==void 0&&(typeof e.tocId!="string"||e.tocId.length===0)?{supported:false,code:"invalidArgs",reason:"refreshToc tocId must be a non-empty string"}:{supported:true,mutating:true};case "editHeaderFooter":return e.position!=="header"&&e.position!=="footer"?{supported:false,reason:"editHeaderFooter requires position 'header' or 'footer'"}:e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"editHeaderFooter variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "exitHeaderFooter":return {supported:true,mutating:false};case "removeHeaderFooter":case "linkHeaderFooterToPrevious":case "unlinkHeaderFooterFromPrevious":return "variant"in e&&e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"furniture variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "setHeaderFooterOptions":return e.titlePage===void 0&&e.evenAndOddHeaders===void 0&&e.headerDistanceTwips===void 0&&e.footerDistanceTwips===void 0?{supported:false,reason:"setHeaderFooterOptions requires at least one option"}:{supported:true,mutating:true};case "insertPageField":return e.field==="PAGE"||e.field==="NUMPAGES"||e.field==="SECTIONPAGES"||e.field==="PAGE_X_OF_Y"?{supported:true,mutating:true}:{supported:false,reason:"insertPageField field must be 'PAGE', 'NUMPAGES', 'SECTIONPAGES', or 'PAGE_X_OF_Y'"};case "insertNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"insertNote noteKind must be 'footnote' or 'endnote'"};case "deleteNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"deleteNote noteKind must be 'footnote' or 'endnote'"};case "convertNote":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertNote fromKind must be 'footnote' or 'endnote'"};case "convertAllNotes":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertAllNotes fromKind must be 'footnote' or 'endnote'"};case "setNoteProperties":return e.endnote?.position==="pageBottom"?{supported:false,reason:"endnote-pageBottom"}:e.footnote!==void 0||e.endnote!==void 0?{supported:true,mutating:true}:{supported:false,reason:"setNoteProperties requires footnote and/or endnote fields"};case "selectAll":case "copy":return {supported:true,mutating:false};case "cut":return {supported:true,mutating:true};case "paste":case "pasteWithoutFormatting":{if(typeof e.text!="string")return {supported:false,code:"invalidArgs",reason:"paste requires text"};let t=e.type==="paste"?e.html:void 0;return t!==void 0&&typeof t!="string"?{supported:false,code:"invalidArgs",reason:"paste html must be a string"}:e.text===""&&(t===void 0||t==="")?{supported:false,code:"invalidArgs",reason:"there is nothing to paste"}:{supported:true,mutating:true}}case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{let t=Mf(e);return t.supported?{supported:true,mutating:true}:{supported:false,reason:t.reason??"unsupported table command"}}case "setSelection":return "range"in e&&(el(e.range)||Qn(e.range))||"anchor"in e&&st(e.anchor)?{supported:true,mutating:false}:{supported:false,reason:"setSelection accepts { anchor: { paraId } }, a { range } whose from/to are paraId anchors, or a { range } carrying a semantic { anchor: { paragraphId, offset }, head } selection"};case "insertImage":return e.data instanceof Uint8Array&&(e.mime==="image/png"||e.mime==="image/jpeg"||e.mime==="image/gif")&&Number.isFinite(e.widthPoints)&&Number.isFinite(e.heightPoints)&&e.widthPoints>0&&e.heightPoints>0?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"insertImage requires png/jpeg/gif bytes and finite dimensions"};case "replaceImage":return e.data instanceof Uint8Array?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};case "deleteImage":return {supported:true,mutating:true};case "setImageWrapType":return ["inline","square","squareLeft","squareRight","tight","through","topAndBottom","behind","inFront"].includes(e.target)?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported wrap target"};case "transformImage":return e.action==="rotateCW"||e.action==="rotateCCW"||e.action==="flipH"||e.action==="flipV"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported transform action"};case "setImagePosition":return {supported:true,mutating:true};case "setImageProperties":return {supported:true,mutating:true};default:return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`}}}function db(e){return [e.left,e.top,e.right,e.bottom]}function ol(e){return Object.freeze({left:e.left*100,top:e.top*100,right:e.right*100,bottom:e.bottom*100})}function cb(e){return Object.freeze({left:e.left/100,top:e.top/100,right:e.right/100,bottom:e.bottom/100})}function Oo(e){return Math.round(e*1e3)}function Fo(e){return e/1e3}function al(e){return Object.freeze({left:Oo(e.left),top:Oo(e.top),right:Oo(e.right),bottom:Oo(e.bottom)})}function ub(e){return Object.freeze({left:Fo(e.left),top:Fo(e.top),right:Fo(e.right),bottom:Fo(e.bottom)})}function il(e){return db(e).some(n=>!Number.isFinite(n)||n<0||n>100)?false:e.left+e.right<100&&e.top+e.bottom<100}var fb=new Set(["insertImage","replaceImage"]),pb=new Set(["insertImage","replaceImage","deleteImage","setImageWrapType","transformImage","setImagePosition","setImageProperties"]);function gb(e,t,n){if(!e)return null;for(let r of e.drawings??[])if(r.paragraphId===t&&(r.start===n||r.start+1===n))return r;return null}function mb(e,t,n){let r=e.layout();for(let o of r.pages){for(let a of o.anchoredDrawings??[])if(a.anchorParagraphId===t&&(a.start===n||a.start+1===n))return a;for(let a of [o.header,o.footer])if(a){for(let i of a.anchoredDrawings??[])if(i.anchorParagraphId===t&&(i.start===n||i.start+1===n))return i}}return null}function sl(e){return e.kind==="pointer"?`pointer:${e.drawingNodeId}`:e.kind}function Xa(e){if(!e)return null;let t=e.drawingSelectionIntent();if(t.kind==="none")return null;let{anchor:n,head:r}=e.state().selection;if(n.paragraphId!==r.paragraphId||n.offset!==r.offset)return null;let o=chunk6K6QQVAZ_cjs.Wd(e.layout(),n.paragraphId,n.offset),a=gb(o,n.paragraphId,n.offset)??mb(e,n.paragraphId,n.offset);return !a||t.kind==="pointer"&&a.drawingNodeId!==t.drawingNodeId?null:a}function Bf(e,t){let n=e.storyScope(),r=e.session.partFor(n)??e.session.part(),o=chunk35MI6K7M_cjs.ya(r,t.drawingNodeId);return !o||o.kind!=="drawing"?null:chunk35MI6K7M_cjs.Ya(o,{ownerPartName:t.ownerPartName,supportedMcRequires:chunk35MI6K7M_cjs.Ta,limits:chunk35MI6K7M_cjs.Sa,resolveRelationship:chunk35MI6K7M_cjs.Va(e.session.currentPackage(),t.ownerPartName)})}function qf(e){if(e.kind!=="anchored"||!e.position)return null;let t=e.position;return e.anchor?.simplePos?Object.freeze({mode:"simple",horizontalEmu:t.simplePosition.xEmu,verticalEmu:t.simplePosition.yEmu}):Object.freeze({mode:"frame",...t.horizontal.offsetEmu!==null?{horizontalEmu:t.horizontal.offsetEmu}:{},...t.vertical.offsetEmu!==null?{verticalEmu:t.vertical.offsetEmu}:{},relativeToH:t.horizontal.relativeFrom,relativeToV:t.vertical.relativeFrom})}function hb(e){let t=e.resource;return t.kind!=="ready"?null:Object.freeze({pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,dpiX:t.dpiX,dpiY:t.dpiY})}function Zf(e){let t=e.locks;return Object.freeze({canResize:!t.resize&&!e.hidden,canMove:!t.move&&!e.hidden,canChangeWrap:!t.move&&e.kind==="anchored"&&!e.hidden,canCrop:!t.resize&&!t.changeAspect&&!e.hidden})}function yb(e){return e.kind==="inlineDrawing"?"inline":e.wrap}function un(e){let t=Xa(e);if(!t||t.placeholderGraphicKind!==null)return null;let n=e?Bf(e,t):null;if(!n||n.hidden||n.locks.select)return null;let r=t.transform;return Object.freeze({id:t.drawingNodeId,kind:n.kind,widthEmu:n.extentEmu.cx,heightEmu:n.extentEmu.cy,crop:ol(t.crop),rotationDegrees:r.rotationDegrees,wrap:yb(t),position:qf(n),name:n.name,title:n.title,description:n.description,hyperlink:n.hyperlinkHref,locks:n.locks,hidden:n.hidden,resourceStatus:t.resource.kind,intrinsic:hb(t),...Zf(n)})}function zf(e,t){return e===t?true:!e||!t?false:e.id===t.id&&e.kind===t.kind&&e.widthEmu===t.widthEmu&&e.heightEmu===t.heightEmu&&e.crop.left===t.crop.left&&e.crop.top===t.crop.top&&e.crop.right===t.crop.right&&e.crop.bottom===t.crop.bottom&&e.rotationDegrees===t.rotationDegrees&&e.wrap===t.wrap&&e.name===t.name&&e.title===t.title&&e.description===t.description&&e.hyperlink===t.hyperlink&&e.hidden===t.hidden&&e.resourceStatus===t.resourceStatus&&e.canResize===t.canResize&&e.canMove===t.canMove&&e.canChangeWrap===t.canChangeWrap&&e.canCrop===t.canCrop&&e.locks.select===t.locks.select&&e.locks.move===t.locks.move&&e.locks.resize===t.locks.resize&&e.locks.changeAspect===t.locks.changeAspect&&(e.position?.mode??"frame")===(t.position?.mode??"frame")&&(e.position?.horizontalEmu??null)===(t.position?.horizontalEmu??null)&&(e.position?.verticalEmu??null)===(t.position?.verticalEmu??null)&&(e.position?.relativeToH??null)===(t.position?.relativeToH??null)&&(e.position?.relativeToV??null)===(t.position?.relativeToV??null)&&(e.intrinsic?.pixelWidth??null)===(t.intrinsic?.pixelWidth??null)&&(e.intrinsic?.pixelHeight??null)===(t.intrinsic?.pixelHeight??null)&&(e.intrinsic?.dpiX??null)===(t.intrinsic?.dpiX??null)&&(e.intrinsic?.dpiY??null)===(t.intrinsic?.dpiY??null)}function ll(e){if("drawingNodeId"in e&&typeof e.drawingNodeId=="string")return e.drawingNodeId}function $f(e){if("expectedPackageRevision"in e&&typeof e.expectedPackageRevision=="number")return e.expectedPackageRevision}function dl(e){return ll(e)!==void 0||$f(e)!==void 0||e.type==="setImageProperties"&&e.selectionParagraphId!==void 0}function cl(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};let o=$f(t);if(o!==void 0&&r.session.packageRevision()!==o)return {ok:false,code:"notFound",reason:"stale package revision"};let a=ll(t),i=un(r);if(a!==void 0&&(!i||i.id!==a))return {ok:false,code:"notFound",reason:"stale drawing selection"};if(t.type==="setImageProperties"&&t.selectionParagraphId!==void 0&&t.selectionOffset!==void 0){let{anchor:s,head:d}=r.state().selection;if(s.paragraphId!==t.selectionParagraphId||s.offset!==t.selectionOffset||d.paragraphId!==t.selectionParagraphId||d.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return Or(e,n,{requireDrawing:a!==void 0||n.drawingNodeId!==null,drawingNodeId:a??n.drawingNodeId??void 0})}function Nn(e,t){let n=un(e),r=ll(t);return r?!n||n.id!==r?{ok:false,code:"notFound",reason:"stale drawing selection"}:{id:r}:n?{id:n.id}:{ok:false,code:"notFound",reason:"no drawing is selected"}}function bb(e){return e.rejected?{ok:false,code:"invalidArgs",reason:e.reason==="drawing-locked"?"the drawing is locked":e.reason==="unknown-drawing"?"stale drawing selection":typeof e.reason=="string"?e.reason:"the image change was refused"}:null}function Ga(e,t){return bb(e.applyDrawingOps(t))}function vb(e){if(!e.intrinsic)return null;let t=Math.round(e.intrinsic.pixelWidth*914400/e.intrinsic.dpiX),n=Math.round(e.intrinsic.pixelHeight*914400/e.intrinsic.dpiY);return !Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0?null:{cx:t,cy:n}}function xb(e){return e.borderWidthEmu!==void 0||e.borderColor!==void 0}function Ib(e){return e.horizontalEmu!==void 0||e.verticalEmu!==void 0||e.relativeToH!==void 0||e.relativeToV!==void 0}function Sb(e){return e.widthEmu!==void 0||e.heightEmu!==void 0||e.alt!==void 0||e.title!==void 0||e.description!==void 0||e.hyperlink!==void 0||e.crop!==void 0||e.wrap!==void 0||e.resetToNaturalSize===true||chunk35MI6K7M_cjs.Rf(e)}function jf(e,t){return t?.position?.mode==="simple"?Object.freeze({mode:"simple",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{}}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}function Ao(e){return pb.has(e.type)}function kb(e){return fb.has(e.type)}function Kf(e){return {ok:false,code:"unsupported",reason:`${e.type} is asynchronous; use executeImageCommand`}}function Vf(e,t){if(!e)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=e.editingMode();return n==="view"?{ok:false,code:"locked",reason:"the document is open for viewing"}:n==="suggest"&&t==="replaceImage"?{ok:false,code:"invalidArgs",reason:"image changes are not supported in suggesting mode"}:null}function Mo(e){let t=e.surface;if(!t)return null;let{anchor:n}=t.state().selection,r=un(t);return Object.freeze({mountGeneration:e.mountGeneration,packageRevision:t.session.packageRevision(),drawingNodeId:r?.id??null,selectionParagraphId:n.paragraphId,selectionOffset:n.offset})}function Or(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};if(e.mountGeneration!==t.mountGeneration)return {ok:false,code:"notFound",reason:"the editor is no longer attached"};let{anchor:o,head:a}=r.state().selection;if(o.paragraphId!==t.selectionParagraphId||o.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(o.paragraphId!==a.paragraphId||o.offset!==a.offset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(n?.requireDrawing){let i=un(r),s=n.drawingNodeId??t.drawingNodeId;if(!i||!s||i.id!==s)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return null}function Lo(e,t){if(!Ao(e))return null;if(!t)return {ok:false,code:"notFound",reason:"no document is loaded"};if(e.type==="insertImage")return !(e.data instanceof Uint8Array)||e.data.byteLength===0?{ok:false,code:"invalidArgs",reason:"insertImage requires image bytes"}:!Number.isFinite(e.widthPoints)||!Number.isFinite(e.heightPoints)?{ok:false,code:"invalidArgs",reason:"insertImage requires finite dimensions"}:e.widthPoints<=0||e.heightPoints<=0?{ok:false,code:"invalidArgs",reason:"insertImage dimensions must be positive"}:null;if(e.type==="replaceImage"){if(!(e.data instanceof Uint8Array)||e.data.byteLength===0)return {ok:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};let o=Nn(t,e);return "ok"in o?o:null}let n=Nn(t,e);if("ok"in n)return n;let r=un(t);if(!r)return {ok:false,code:"notFound",reason:"no drawing is selected"};if(t.editingMode()==="suggest"&&e.type!=="deleteImage")return {ok:false,code:"invalidArgs",reason:"image changes are not supported in suggesting mode"};switch(e.type){case "deleteImage":return r.locks.select?{ok:false,code:"locked",reason:"the drawing cannot be selected"}:null;case "setImageWrapType":return r.canChangeWrap?null:{ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};case "transformImage":return r.locks.changeAspect||r.locks.resize?{ok:false,code:"locked",reason:"the drawing is locked"}:null;case "setImagePosition":if(!r.canMove||r.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};if(!Ib(e))return {ok:false,code:"invalidArgs",reason:"setImagePosition requires at least one field"};let o=r.position?.mode??"frame";return chunk35MI6K7M_cjs.Tf(e,o)?chunk35MI6K7M_cjs.Of(jf(e,r))?null:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"}:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"};case "setImageProperties":{if(xb(e))return {ok:false,code:"unsupported",reason:"image border properties are not supported yet"};if(!Sb(e))return {ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"};if(e.resetToNaturalSize&&!r.intrinsic)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};if(e.widthEmu!==void 0&&(!Number.isFinite(e.widthEmu)||e.widthEmu<=0))return {ok:false,code:"invalidArgs",reason:"widthEmu must be a positive finite number"};if(e.heightEmu!==void 0&&(!Number.isFinite(e.heightEmu)||e.heightEmu<=0))return {ok:false,code:"invalidArgs",reason:"heightEmu must be a positive finite number"};if(e.widthEmu!==void 0&&!r.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.heightEmu!==void 0&&!r.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.crop!==void 0&&!il(e.crop))return {ok:false,code:"invalidArgs",reason:"crop values are out of range"};if(e.crop!==void 0&&!r.canCrop)return {ok:false,code:"locked",reason:"crop cannot be changed on this drawing"};if(e.hyperlink!==void 0&&e.hyperlink!==null&&!chunk35MI6K7M_cjs.L(e.hyperlink).ok)return {ok:false,code:"invalidArgs",reason:"unsafe hyperlink URL"};if(e.wrap!==void 0&&!r.canChangeWrap)return {ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};if(chunk35MI6K7M_cjs.Rf(e)){if(!r.canMove||r.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};let a=r.position?.mode??"frame";if(!chunk35MI6K7M_cjs.Tf(e,a))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"};if(!chunk35MI6K7M_cjs.Of(chunk35MI6K7M_cjs.Sf(e,r)))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"}}return null}default:return null}}function ul(e,t){let n=Vf(t,e.type);if(n)return n;let r=Lo(e,t);return r||{ok:true}}function Uf(e,t){let n=Lo(e,t);return n||Kf(e)}function Wf(e,t,n){if(kb(t))return Kf(t);let r=n&&dl(t)?Mo(n):null;if(r&&n){let o=cl(n,t,r);if(o)return o}switch(t.type){case "deleteImage":{let o=Nn(e,t);if("ok"in o)return o;let a=e.deleteImage(o.id);return a.ok?null:{ok:false,code:"invalidArgs",reason:a.detail??a.reason??"deleteImage was refused"}}case "setImageWrapType":{let o=Nn(e,t);return "ok"in o?o:Ga(e,[{op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.target}])}case "transformImage":{let o=Nn(e,t);return "ok"in o?o:Ga(e,[{op:"transformDrawing",drawingNodeId:o.id,action:t.action}])}case "setImagePosition":{let o=Nn(e,t);if("ok"in o)return o;let a=un(e),i=jf(t,a);return Ga(e,[{op:"positionDrawing",drawingNodeId:o.id,position:i}])}case "setImageProperties":{let o=Nn(e,t);if("ok"in o)return o;let a=un(e);if(!a)return {ok:false,code:"notFound",reason:"no drawing is selected"};let i=[];if(t.resetToNaturalSize){let c=vb(a);if(!c)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};i.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:c});}else (t.widthEmu!==void 0||t.heightEmu!==void 0)&&i.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:{cx:t.widthEmu??a.widthEmu,cy:t.heightEmu??a.heightEmu}});t.crop!==void 0&&i.push({op:"cropDrawing",drawingNodeId:o.id,crop:al(t.crop)});let s=t.title??t.alt,d=t.description??t.alt;if((s!==void 0||d!==void 0)&&i.push({op:"setDrawingMetadata",drawingNodeId:o.id,title:s??a.title,description:d??a.description}),t.wrap!==void 0&&i.push({op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.wrap}),chunk35MI6K7M_cjs.Rf(t)){let c=chunk35MI6K7M_cjs.Sf(t,a);i.push({op:"positionDrawing",drawingNodeId:o.id,position:c});}if(t.hyperlink!==void 0){let c=e.applyImageProperties({drawingNodeId:o.id,ops:i,hyperlink:t.hyperlink});return c.ok?null:{ok:false,code:"invalidArgs",reason:c.detail??c.reason??"setImageProperties was refused"}}return i.length===0?{ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"}:Ga(e,i)}default:return null}}function wb(e,t,n,r,o){let a=chunk6K6QQVAZ_cjs.fd(e.sectionPropertiesAt(t)),i=a.width-a.margin.left-a.margin.right,s=a.height-a.margin.top-a.margin.bottom,d=chunk6K6QQVAZ_cjs.Wd(e.layout(),t,n),c=d&&d.box.width>0?Math.min(d.box.width,i):i,p=Math.min(1,c/r,s/o);return p>=1?{widthPoints:r,heightPoints:o}:{widthPoints:r*p,heightPoints:o*p}}async function fl(e,t){let n=e.surface;if(!n)return {ok:false,code:"notFound",reason:"no document is loaded"};let r=Vf(n,t.type);if(r)return r;let o=Lo(t,n);if(o)return o;let a=Mo(e);if(!a)return {ok:false,code:"notFound",reason:"no document is loaded"};if(t.type==="insertImage"){let{anchor:b}=n.state().selection,x=t.expectedPackageRevision??a.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let w=wb(n,b.paragraphId,b.offset,t.widthPoints,t.heightPoints),F=await n.insertImage({paragraphId:b.paragraphId,offset:b.offset,bytes:t.data,mime:t.mime,widthPoints:w.widthPoints,heightPoints:w.heightPoints,expectedPackageRevision:x,commitGuard:()=>Or(e,a)===null,...t.title!==void 0?{title:t.title}:{},...t.description!==void 0?{description:t.description}:{},...t.hyperlink!==void 0?{hyperlink:t.hyperlink}:{}}),T=Or(e,a);return T||(F.ok?{ok:true,changed:F.change!==null}:{ok:false,code:"invalidArgs",reason:F.detail==="stale-package-epoch"?"stale package revision":F.detail??F.reason??"insertImage was refused"})}let i=Nn(n,t);if("ok"in i)return i;let s=t.expectedPackageRevision??a.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let d=t.mime??"image/png",c=await n.replaceImage(i.id,t.data,d,{expectedPackageRevision:s,commitGuard:()=>Or(e,a,{requireDrawing:true,drawingNodeId:i.id})===null}),p=Or(e,a,{requireDrawing:true,drawingNodeId:i.id});return p||(c.ok?{ok:true,changed:c.change!==null}:{ok:false,code:"invalidArgs",reason:c.detail==="stale-package-epoch"?"stale package revision":c.detail??c.reason??"replaceImage was refused"})}var Tb=1,Pb=10,No=12700;function Cb(e,t){if(!t||t.hidden||t.locks.select)return Object.freeze({canResize:false,canMove:false,aspectLocked:true});let n=Zf(t);return Object.freeze({canResize:n.canResize,canMove:n.canMove,aspectLocked:t.locks.changeAspect})}function Rb(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId!==n.paragraphId||t.offset!==n.offset)return null;let r=Xa(e);if(!r||r.accessibility.hidden)return null;let o=e.layout(),a=chunk6K6QQVAZ_cjs.Jc(o,r.drawingNodeId);if(!a)return null;let i=Bf(e,r);if(!i||i.locks.select)return null;let s=Cb(r,i),c=e.editingMode()==="edit"&&e.session.editable?s:{...s,canResize:false,canMove:false},p=r.kind==="anchoredDrawing"?Object.freeze({x:r.horizontalFrameOrigin,y:r.verticalFrameOrigin}):null;return Object.freeze({id:r.drawingNodeId,pageIndex:a.pageIndex,x:a.x,y:a.y,width:a.width,height:a.height,kind:r.kind==="inlineDrawing"?"inline":"anchored",widthEmu:i.extentEmu.cx,heightEmu:i.extentEmu.cy,position:qf(i),anchorFrameOrigin:p,transform:r.transform,...c})}function lt(e){return Math.round(e*No)}function Er(e){return e/No}function Eb(e,t,n,r,o,a){let i=Er(e),s=Er(t),d=i/s,c=n.includes("e")?r:n.includes("w")?-r:0,p=n.includes("s")?o:n.includes("n")?-o:0;if(i=Math.max(1,i+c),s=Math.max(1,s+p),a)if(n.length===2){let x=Math.max(i/Er(e),s/Er(t));i=Math.max(1,Er(e)*x),s=Math.max(1,i/d);}else n==="e"||n==="w"?s=Math.max(1,i/d):i=Math.max(1,s*d);return Object.freeze({cx:lt(i),cy:lt(s)})}function pl(e,t,n){return e.mode==="simple"?Object.freeze({mode:"simple",horizontalEmu:(e.horizontalEmu??0)+lt(t),verticalEmu:(e.verticalEmu??0)+lt(n)}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu+lt(t)}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu+lt(n)}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}function Ob(e,t){let n=e.surface;return n?n.publishedLayout().revision!==t.layoutRevision?{ok:false,code:"notFound",reason:"stale layout revision"}:n.session.packageRevision()!==t.packageRevision?{ok:false,code:"notFound",reason:"stale package revision"}:Or(e,t.preconditions,{requireDrawing:true,drawingNodeId:t.drawingNodeId}):{ok:false,code:"notFound",reason:"no document is loaded"}}function Gf(e){if(!e)return null;let t=e.formatting();return {bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strikethrough,superscript:t.superscript,subscript:t.subscript,...t.color?{color:{kind:"hex",value:t.color}}:{},...t.highlight?{highlight:t.highlight}:{},...t.fontFamily?{fontFamily:t.fontFamily}:{},...t.fontSizeHalfPoints!==null?{fontSizePt:t.fontSizeHalfPoints/2}:{},...t.alignment?{alignment:t.alignment}:{},...t.styleId?{styleId:t.styleId}:{},...t.lineSpacing?{lineSpacing:t.lineSpacing}:{},...t.spaceBeforePt!==null?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==null?{spaceAfterPt:t.spaceAfterPt}:{},...t.indent!==null?{indent:t.indent}:{},paragraphFlags:t.paragraphFlags,disagrees:t.disagrees,...t.tabStops!==null?{tabStops:t.tabStops}:{}}}function gl(e){if(!e)return null;let t=e.sectionPropertiesAt(e.state().selection.head.paragraphId);return {pageWidthTwips:t.pageSize.widthTwips,pageHeightTwips:t.pageSize.heightTwips,orientation:t.landscape?"landscape":"portrait",marginsTwips:{top:t.margins.topTwips,right:t.margins.rightTwips,bottom:t.margins.bottomTwips,left:t.margins.leftTwips},gutterTwips:t.margins.gutterTwips}}function ml(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId===n.paragraphId){let c=e.session.paraIdOf(t.paragraphId);return c===null?null:{from:{paraId:c},to:{paraId:c}}}let r=e.session.paragraphAnchors(),o=r.paraIdByNode.get(t.paragraphId),a=r.paraIdByNode.get(n.paragraphId);if(o===void 0||a===void 0)return null;let i=r.ordinalByNode.get(t.paragraphId)??0,s=r.ordinalByNode.get(n.paragraphId)??0;return s<i||s===i&&n.offset<t.offset?{from:{paraId:a},to:{paraId:o}}:{from:{paraId:o},to:{paraId:a}}}function Xf(e){if(!e)return null;let t=e.hyperlinks.linkAtCaret();if(!t)return null;let n=e.session.paraIdOf(t.paragraphId);return n===null?null:{href:t.href??"",range:{from:{paraId:n},to:{paraId:n}},...t.tooltip!==void 0?{tooltip:t.tooltip}:{}}}function Yf(e,t){if(!e)return [];if(t!==void 0&&t.part!=="body")return [];let n=e.session.part(),r=e.session.paragraphAnchors();return chunkHBEBUCRM_cjs.d(n).map(o=>{let a=r.paraIdByNode.get(o.id),i=o.kind==="textValue"?void 0:chunkHBEBUCRM_cjs.i(o);return {...a!==void 0?{paraId:a}:{},text:chunk35MI6K7M_cjs._f(n,o.id)??"",...i!==void 0?{styleId:i}:{}}})}function hl(e){return e?e.state().pageCount:0}function yl(e,t="caret"){return e?e.currentPage(t):1}function Fb(e,t){if(!Cr(e))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"not a table command"}};let n=Ya(e,t);return n.can.ok?{ok:true,tablePlan:n.plan}:{ok:false,refusal:{ok:false,code:n.can.code,reason:n.can.reason}}}function Ab(e,t){return {command:e,part:t.session.partFor(t.storyScope())??t.session.part(),layout:t.layout(),storeRevision:t.session.packageRevision(),selection:t.state().selection,cellSelection:t.state().cellSelection,themeColors:t.session.documentThemeColors(),editable:t.session.editable,viewing:t.editingMode()==="view"}}function Ya(e,t){let n=Sn(Ab(e,t));return n.ok?{can:{ok:true},plan:n}:{can:{ok:false,code:n.code,reason:n.reason},plan:n}}function Do(e,t,n,r){if(r?.scope){if(r.scope.kind==="all")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"the all scope is read-only"}};if(r.scope.kind==="note"||r.scope.kind==="frame")return {ok:false,refusal:{ok:false,code:"unsupported",reason:`scope kind '${r.scope.kind}' is not supported`}};if(r.scope.kind==="headerFooter"){let i=t?.activeScope?.()??{kind:"body"};if(i.kind!=="headerFooter"||i.rId!==r.scope.rId)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"open that header or footer before dispatching against its scope"}}}}let o=Eo(e);if(!o.supported)return {ok:false,refusal:{ok:false,code:o.code??"unsupported",reason:o.reason}};if(!t)return {ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}};if(o.mutating&&(n==="view"||!t.session.editable))return {ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}};if(e.type==="adjustIndent"&&!t.canAdjustIndent(e.direction))return {ok:false,refusal:{ok:false,code:"unsupported",reason:e.direction==="decrease"?"the selection is already at the outermost level":"the selection cannot indent any further"}};if(e.type==="copy"||e.type==="cut"||e.type==="deleteText"){let{anchor:i,head:s}=t.state().selection;if(i.paragraphId===s.paragraphId&&i.offset===s.offset)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing is selected"}}}if(e.type==="setParagraphStyle"&&!t.session.documentStyles().some(i=>i.type==="paragraph"))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"this document defines no paragraph styles"}};if(e.type==="undo"&&!t.session.canUndo())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to undo"}};if(e.type==="redo"&&!t.session.canRedo())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to redo"}};if(e.type==="insertTable"&&!t.canInsertTable(e.rows,e.cols))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table can only be inserted at a caret in editable body, cell, or note text"}};if(e.type==="insertToc"&&!t.canInsertToc())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table of contents can only be inserted in the editable document body"}};if(e.type==="refreshToc"&&!t.canRefreshToc(e.tocId))return {ok:false,refusal:{ok:false,code:"notFound",reason:"there is no refreshable table of contents at the selection"}};if(e.type==="insertPageField"&&(t.activeScope?.()??{kind:"body"}).kind!=="headerFooter")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}};if(e.type==="insertNote"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertNote requires body scope"}};if(e.type==="insertBreak"&&(e.kind==="section"||e.kind==="sectionContinuous")){if((t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a section break can only be inserted in the editable document body"}};let s=t.sectionBreakRefusal(e.kind==="section"?"nextPage":"continuous");if(s)return {ok:false,refusal:{ok:false,code:"unsupported",reason:s}}}if(e.type==="insertBreak"&&e.kind==="page"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a page break can only be inserted in the editable document body"}};if(e.type==="linkHeaderFooterToPrevious"){let i=t.headerFooterState?.();if((e.sectionIndex??i?.sectionIndex??0)===0)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}}}if(Cr(e)){let i=Fb(e,t);return i.ok?{ok:true,tablePlan:i.tablePlan}:i}let a=Lo(e,t);return a&&!a.ok?{ok:false,refusal:a}:{ok:true}}function Qf(e,t){let n=e.session.part();if(!t.startsWith(`${n.name}#`)||!chunk35MI6K7M_cjs.ya(n,t))return true;let r=chunk35MI6K7M_cjs.za(n,t),o=0;for(;r;){if(r.kind==="tableCell"||r.kind==="generic"&&r.localName==="tc"||(o+=1)>64)return true;r=chunk35MI6K7M_cjs.za(n,r.id);}return false}function Jf(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!Qf(e,t.selection.head.paragraphId))return null;let r=chunk6K6QQVAZ_cjs.oe(e.layout(),t.selection.head.paragraphId);return r?{blockId:r.tableId,rowCount:r.rows,columnCount:r.columns,cell:{row:n?n.rows.from:r.rowIndex,column:n?n.columns.from:r.columnIndex}}:null}function bl(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!Qf(e,t.selection.head.paragraphId))return null;let r=chunk6K6QQVAZ_cjs.oe(e.layout(),t.selection.head.paragraphId);return r?{rows:r.rows,columns:r.columns,rowIndex:n?n.rows.from:r.rowIndex,columnIndex:n?n.columns.from:r.columnIndex}:null}function ep(e){return e?{...e.bold!==void 0?{bold:e.bold}:{},...e.italic!==void 0?{italic:e.italic}:{},...e.underline!==void 0?{underline:e.underline}:{},...e.fontFamily?{fontFamily:e.fontFamily}:{},...e.fontSizePt!==void 0?{fontSizeHalfPoints:Math.round(e.fontSizePt*2)}:{},...e.styleId?{styleId:e.styleId}:{},...e.alignment?{alignment:e.alignment}:{}}:null}var ue={undo:["M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"],redo:["M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"],print:["M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"],file_download:["M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],file_upload:["M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],format_bold:["M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"],format_italic:["M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"],format_underlined:["M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"],strikethrough_s:["M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"],superscript:["M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"],subscript:["M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"],link:["M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"],format_clear:["m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"],format_align_left:["M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"],format_align_center:["M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"],format_align_right:["M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"],format_align_justify:["M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"],format_line_spacing:["M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"],format_list_bulleted:["M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"],format_list_numbered:["M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"],format_indent_increase:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"],format_indent_decrease:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"],format_color_text:["M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"],ink_highlighter:["M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"],format_color_reset:["M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"],arrow_drop_down:["M480-360 280-560h400L480-360Z"],table:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"],table_chart:["M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"],grid_on:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"],table_rows:["M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"],view_column:["M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"],border_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],select_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],border_outer:["M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"],border_inner:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"],border_clear:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],add:["M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"],remove:["M200-440v-80h560v80H200Z"],delete:["M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"],delete_sweep:["M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"],call_merge:["m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"],call_split:["M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"],drag_indicator:["M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"],image:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"],format_image_left:["M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"],format_image_right:["M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"],horizontal_rule:["M160-440v-80h640v80H160Z"],flip_to_back:["M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],flip_to_front:["M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],open_with:["M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"],tune:["M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"],rotate_right:["M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"],rotate_left:["M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"],swap_horiz:["M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"],swap_vert:["M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"],shapes:["M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"],format_paint:["M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"],expand_more:["M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"],expand_less:["m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"],border_top:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_bottom:["M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_left:["M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_right:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"],border_horizontal:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h720v60H120Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],border_vertical:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-720h60v720h-60Zm165 0v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],padding:["M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"],text_rotation_none:["M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"],wrap_text:["M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"],height:["M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"],fit_width:["M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],settings:["m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"],border_color:["M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"],format_color_fill:["m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"],vertical_align_top:["M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"],vertical_align_center:["M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"],vertical_align_bottom:["M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"],line_weight:["M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"],keyboard_arrow_up:["M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"],keyboard_arrow_down:["M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"],keyboard_arrow_left:["M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"],keyboard_arrow_right:["M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"],more_vert:["M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"],page_break:["M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"],branding_watermark:["M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm0-80h640v-480H160v480Zm320-60q66 0 113-37t47-93q0-29-13-58t-34-55q-21-26-50-49t-50-31q-21 8-50 31t-50 49q-21 26-34 55t-13 58q0 56 47 93t140 37Z"],arrow_back:["M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"],search:["M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"],toc:["M120-240v-80h240v80H120Zm0-200v-80h480v80H120Zm0-200v-80h720v80H120Z"],done_all:["M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"],check_circle:["m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"],chat_bubble_outline:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],chat_bubble_check:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],check:["M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"],close:["m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"],add_comment:["M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],comment:["M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],edit_note:["M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"],rate_review:["M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],visibility:["M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"],format_textdirection_l_to_r:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"],format_textdirection_r_to_l:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"],"agent-sparkle":["m760-600-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110Zm0 560-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110ZM360-160 260-380 40-480l220-100 100-220 100 220 220 100-220 100-100 220Zm0-194 40-86 86-40-86-40-40-86-40 86-86 40 86 40 40 86Zm0-126Z"]};var Fr={activeTarget:"all",spec:{style:"single",size:8,color:{kind:"hex",value:"000000"}}},np=["table.borderTarget","table.borderColor","table.borderStyle","table.borderWidth","table.cellFill"];function vl(e){return i18n.createT(i18n.en)(e)}function Qa(e){return np.includes(e)}function Nb(e){return e!=null}var rp=[{value:"all",icon:"border_all",labelKey:"table.borders.all"},{value:"outside",icon:"border_outer",labelKey:"table.borders.outside"},{value:"inside",icon:"border_inner",labelKey:"table.borders.inside"},{value:"top",icon:"border_top",labelKey:"table.borders.top"},{value:"bottom",icon:"border_bottom",labelKey:"table.borders.bottom"},{value:"left",icon:"border_left",labelKey:"table.borders.left"},{value:"right",icon:"border_right",labelKey:"table.borders.right"},{value:"none",icon:"border_clear",labelKey:"table.borders.none"}],op=[{value:"single",labelKey:"table.borderStyles.single",previewClass:"docx-table-line--single"},{value:"dashed",labelKey:"table.borderStyles.dashed",previewClass:"docx-table-line--dashed"},{value:"dotted",labelKey:"table.borderStyles.dotted",previewClass:"docx-table-line--dotted"},{value:"double",labelKey:"table.borderStyles.double",previewClass:"docx-table-line--double"},{value:"triple",labelKey:"table.borderStyles.triple",previewClass:"docx-table-line--triple"},{value:"thick",labelKey:"table.borderStyles.thick",previewClass:"docx-table-line--thick"}],Db=[{size:4,labelKey:"table.borderWidths.halfPt",previewThickness:.5},{size:8,labelKey:"table.borderWidths.onePt",previewThickness:1},{size:12,labelKey:"table.borderWidths.oneHalfPt",previewThickness:1.5},{size:16,labelKey:"table.borderWidths.twoPt",previewThickness:2},{size:24,labelKey:"table.borderWidths.threePt",previewThickness:3}];function Hb(e){return e==="all"||e==="outside"||e==="inside"||e==="top"||e==="bottom"||e==="left"||e==="right"}function _b(e){return e==="none"||Hb(e)}function tp(e){if(!e||typeof e!="object")return false;let t=e.kind;return t==="hex"||t==="theme"||t==="auto"}function Bb(e){return op.some(t=>t.value===e)}function Jn(e,t,n){switch(t){case "table.borderTarget":return _b(n)?n==="none"?{command:{type:"setTableBorders",scope:"none",target:e.activeTarget},nextDraft:e}:{command:{type:"setTableBorders",scope:n,spec:e.spec},nextDraft:{activeTarget:n,spec:e.spec}}:null;case "table.borderColor":{if(!tp(n))return null;let r={...e.spec,color:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderStyle":{if(!Bb(n))return null;let r={...e.spec,style:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderWidth":{if(typeof n!="number"||!Number.isInteger(n))return null;let r={...e.spec,size:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.cellFill":return n!==null&&!tp(n)?null:{command:{type:"setCellFill",color:n},nextDraft:e};default:return null}}function xl(e,t=Fr){switch(e){case "table.borderTarget":return {type:"setTableBorders",scope:t.activeTarget,spec:t.spec};case "table.borderColor":return Jn(t,e,{kind:"hex",value:"000000"})?.command??null;case "table.borderStyle":return Jn(t,e,"single")?.command??null;case "table.borderWidth":return Jn(t,e,8)?.command??null;case "table.cellFill":return {type:"setCellFill",color:{kind:"hex",value:"FFFF00"}};default:return null}}function qb(e){return rp.find(n=>n.value===e)?.labelKey??"table.borders.all"}function Zb(e){return ue[e]}function Ar(e){return e.surface??null}var zb={"review.comments":{type:"toggleReviewPane"},"history.undo":{type:"undo"},"history.redo":{type:"redo"},"text.bold":{type:"toggleMark",mark:"bold"},"text.italic":{type:"toggleMark",mark:"italic"},"text.underline":{type:"toggleMark",mark:"underline"},"text.strike":{type:"toggleMark",mark:"strike"},"script.super":{type:"toggleMark",mark:"superscript"},"script.sub":{type:"toggleMark",mark:"subscript"},"format.clear":{type:"clearFormatting"},"alignment.left":{type:"setAlignment",align:"left"},"alignment.center":{type:"setAlignment",align:"center"},"alignment.right":{type:"setAlignment",align:"right"},"alignment.justify":{type:"setAlignment",align:"justify"},"list.bullet":{type:"toggleList",kind:"bullet"},"list.numbered":{type:"toggleList",kind:"ordered"},"list.indent":{type:"adjustIndent",direction:"increase"},"list.outdent":{type:"adjustIndent",direction:"decrease"},"insert.footnote":{type:"insertNote",noteKind:"footnote"},"insert.endnote":{type:"insertNote",noteKind:"endnote"},"insert.pageNumber":{type:"insertPageField",field:"PAGE"},"insert.totalPages":{type:"insertPageField",field:"NUMPAGES"},"insert.sectionPages":{type:"insertPageField",field:"SECTIONPAGES"},"insert.pageXofY":{type:"insertPageField",field:"PAGE_X_OF_Y"},"insert.pageBreak":{type:"insertBreak",kind:"page"},"insert.sectionBreakNextPage":{type:"insertBreak",kind:"section"},"insert.sectionBreakContinuous":{type:"insertBreak",kind:"sectionContinuous"},"insert.toc":{type:"insertToc"},"contentControl.remove":{type:"removeContentControl"}};function $b(e){return ip[e]??null}var ap=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e=>e.charCodeAt(0)),ip={"text.link":{type:"insertHyperlink",href:"https://example.com"},"image.insert":{type:"insertImage",data:ap,mime:"image/png",widthPoints:72,heightPoints:72},"image.properties":{type:"setImageProperties",description:"probe"},"table.insert":{type:"insertTable",rows:1,cols:1},"file.pageSetup":{type:"setPageSetup",orientation:"portrait"},"paragraph.dialog":{type:"setParagraphFormat",alignment:"left"}};function Ja(e){return zb[e]??null}var jb={"font.family":{mark:"fontFamily",attr:"family"},"font.size":{mark:"fontSize",attr:"val"},"text.color":{mark:"color",attr:"val"},"text.highlight":{mark:"highlight",attr:"val"}},Kb={"font.family":"Arial","font.size":22,"text.color":"000000","text.highlight":"yellow","styles.style":"Normal","list.lineSpacing":1,"image.wrap":"square","image.altText":"probe alt text"};function sp(e,t,n){return Jn(n,e,t)?.command??null}function ei(e,t){if(e==="review.editingMode")return {type:"setEditingMode",mode:t};if(e==="styles.style")return {type:"setParagraphStyle",styleId:t};if(e==="list.lineSpacing")return {type:"setLineSpacing",rule:"multiple",value:t};if(Qa(e))return sp(e,t,Fr);if(e==="image.wrap")return typeof t!="string"||!chunk35MI6K7M_cjs.Ra.includes(t)?null:{type:"setImageWrapType",target:t};if(e==="image.altText")return typeof t!="string"?null:{type:"setImageProperties",description:t};let n=jb[e];return n?{type:"setMarkAttr",mark:n.mark,attr:n.attr,value:t}:null}function lp(e,t,n=Fr){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let r=xl(t,n);if(!r)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let o=e.can(r);return o.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:o.reason,active:false}}function dp(e,t){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};if(Qa(t))return lp(e,t);if(t==="review.editingMode"){let a=e.getEditingMode?.()??"editing",i=e.can(ei(t,a==="editing"?"suggesting":"editing"));return {id:t,enabled:i.ok,disabledReason:i.ok?null:i.reason,active:false,value:a}}if(t==="contentControl.showAll"||t==="contentControl.formFill"){let a=Ar(e),i=a?.state().contentControls,s=t==="contentControl.showAll"?i?.showAll??false:i?.formFill??false;return {id:t,enabled:a!==null,disabledReason:a?null:"editor is not ready",active:s}}if(t==="contentControl.inspector"){let a=Ar(e);return a?a.state().contentControls.activeControlId?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"no content control at the selection",active:false}:{id:t,enabled:false,disabledReason:"editor is not ready",active:false}}let n=Ja(t);if(!n){let a=Kb[t];if(a!==void 0){let s=ei(t,a);if(!s)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let d=e.can(s),c=e.getSelectedImage?.()??null,p=t==="image.wrap"?c?.wrap:t==="image.altText"?c?.description:void 0;return d.ok?{id:t,enabled:true,disabledReason:null,active:false,...p!==void 0?{value:p}:{}}:{id:t,enabled:false,disabledReason:d.reason,active:false,...p!==void 0?{value:p}:{}}}let i=ip[t];if(i){if(t==="image.insert"&&i.type==="insertImage"){let d=e.canExecuteImageCommand?.({type:"insertImage",data:ap,mime:"image/png",widthPoints:72,heightPoints:72})??e.can(i);return d.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:d.reason,active:false}}if(t==="image.properties"&&i.type==="setImageProperties"){let d=e.can(i);return d.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:d.reason,active:false}}if(t==="table.insert"&&i.type==="insertTable"){let d=e.can(i);return d.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:d.reason,active:false}}if(t==="paragraph.dialog"&&i.type==="setParagraphFormat"){let d=e.can(i);return d.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:d.reason,active:false}}let s=e.can(i);if(!s.ok)return {id:t,enabled:false,disabledReason:s.reason,active:false}}return t==="file.save"?{id:t,enabled:false,disabledReason:"save is not a command; run it with runSave(editor)",active:false}:t==="file.open"?{id:t,enabled:false,disabledReason:"open is not a command; run it with editor.load(bytes)",active:false}:{id:t,enabled:false,disabledReason:"not wired to an editor command",active:false}}let r=e.can(n),o=e.isActive?.(n)??false;return r.ok?{id:t,enabled:true,disabledReason:null,active:o}:{id:t,enabled:false,disabledReason:r.reason,active:o}}function Vb(e,t){return t.map(n=>dp(e,n))}function Ub(e,t,n,r){if(!e)return {result:{ok:false,code:"unsupported",reason:"editor is not ready"},nextDraft:null};let o=Jn(r,t,n);if(!o)return {result:{ok:false,code:"unsupported",reason:"invalid table chrome value"},nextDraft:null};let a=e.can(o.command);if(!a.ok)return {result:{ok:false,code:a.code,reason:a.reason},nextDraft:null};let i=e.exec(o.command);return i.ok?{result:i,nextDraft:o.nextDraft}:{result:i,nextDraft:null}}function Wb(e,t,n){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(t==="contentControl.showAll"){let a=Ar(e);return a?(a.contentControls.setShowAll(!a.contentControls.showAll()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.formFill"){let a=Ar(e);return a?(a.contentControls.setFormFill(!a.contentControls.formFill()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.inspector"){let a=Ar(e);return a?a.state().contentControls.activeControlId?{ok:true,changed:false}:{ok:false,code:"notFound",reason:"no content control at the selection"}:{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.remove"){let a=Ar(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};let i=a.state().contentControls.activeControlId;if(!i)return {ok:false,code:"notFound",reason:"no content control at the selection"};let s=a.contentControls.disabledReason(i,"remove");return s?{ok:false,code:s==="bound"?"bound":"locked",reason:s}:a.contentControls.remove(i)?{ok:true,changed:true}:{ok:false,code:a.state().lastRejection??"unsupported",reason:a.state().lastRejection??"removeContentControl was refused"}}let r=n===void 0?Ja(t):ei(t,n)??Ja(t);if(!r)return n!==void 0?{ok:false,code:"unsupported",reason:"invalid value for toolbar command"}:t==="file.save"?{ok:false,code:"unsupported",reason:"save is not a command; run it with runSave(editor)"}:t==="file.open"?{ok:false,code:"unsupported",reason:"open is not a command; run it with editor.load(bytes)"}:{ok:false,code:"unsupported",reason:"not wired to an editor command"};let o=e.can(r);return o.ok?e.exec(r):{ok:false,code:o.code,reason:o.reason}}function Gb(e){return e?e.save():Promise.reject(new Error("editor is not ready"))}function Xb(e,t){if(!e)return {enabled:false,disabledReason:"editor is not ready"};let n=Ya(t,e);return n.can.ok?{enabled:true,disabledReason:null}:{enabled:false,disabledReason:n.can.reason}}function Yb(e,t){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};let n=e.can(t);return n.ok?e.exec(t):{ok:false,code:n.code,reason:n.reason}}function Il(e){return e instanceof Uint8Array?Array.from(e):Array.isArray(e)?e.map(Il):e===null||typeof e!="object"?e:Object.fromEntries(Object.keys(e).sort().map(t=>[t,Il(e[t])]))}function Qb(e){return JSON.stringify(Il(e))}var Sl=[{id:"history",labelKey:"formattingBar.groups.history",controls:[{id:"undo",labelKey:"formattingBar.undoShortcut",paths:ue.undo,state:{kind:"command"}},{id:"redo",labelKey:"formattingBar.redoShortcut",paths:ue.redo,state:{kind:"command"}}]},{id:"zoom",labelKey:"formattingBar.groups.zoom",controls:[{id:"level",shape:"stepper",valueText:"100%",labelKey:"formattingBar.groups.zoom",paths:null,valueKey:"zoom.zoomLevel",state:{kind:"command"}}]},{id:"styles",labelKey:"formattingBar.groups.styles",controls:[{id:"style",shape:"dropdown",labelKey:"styles.selectAriaLabel",paths:null,valueKey:"styles.normalText",state:{kind:"value"}}]},{id:"font",labelKey:"formattingBar.groups.font",controls:[{id:"family",shape:"dropdown",labelKey:"font.selectAriaLabel",paths:null,valueKey:"font.sansSerif",state:{kind:"value"}},{id:"size",shape:"stepper",valueText:"11",labelKey:"fontSize.listLabel",paths:null,valueKey:"fontSize.label",state:{kind:"value"}}]},{id:"text",labelKey:"formattingBar.groups.textFormatting",controls:[{id:"bold",labelKey:"formattingBar.boldShortcut",paths:ue.format_bold,state:{kind:"command"}},{id:"italic",labelKey:"formattingBar.italicShortcut",paths:ue.format_italic,state:{kind:"command"}},{id:"underline",labelKey:"formattingBar.underlineShortcut",paths:ue.format_underlined,state:{kind:"command"}},{id:"strike",labelKey:"formattingBar.strikethrough",paths:ue.strikethrough_s,state:{kind:"command"}},{id:"color",shape:"colorSplit",swatch:"#ff0000",labelKey:"formattingBar.fontColor",paths:ue.format_color_text,state:{kind:"value"}},{id:"highlight",shape:"colorSplit",swatch:"#ffff00",labelKey:"formattingBar.highlightColor",paths:ue.ink_highlighter,state:{kind:"value"}},{id:"link",labelKey:"formattingBar.insertLinkShortcut",paths:ue.link,state:{kind:"command"}}]},{id:"script",labelKey:"formattingBar.groups.script",controls:[{id:"super",labelKey:"formattingBar.superscript",paths:ue.superscript,state:{kind:"command"}},{id:"sub",labelKey:"formattingBar.subscript",paths:ue.subscript,state:{kind:"command"}}]},{id:"alignment",labelKey:"formattingBar.groups.alignment",controls:[{id:"left",labelKey:"alignment.alignLeft",paths:ue.format_align_left,state:{kind:"command"}},{id:"center",labelKey:"alignment.center",paths:ue.format_align_center,state:{kind:"command"}},{id:"right",labelKey:"alignment.alignRight",paths:ue.format_align_right,state:{kind:"command"}},{id:"justify",labelKey:"alignment.justify",paths:ue.format_align_justify,state:{kind:"command"}}]},{id:"list",labelKey:"formattingBar.groups.listFormatting",controls:[{id:"bullet",labelKey:"lists.bulletList",paths:ue.format_list_bulleted,state:{kind:"command"}},{id:"numbered",labelKey:"lists.numberedList",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"outdent",labelKey:"lists.decreaseIndent",paths:ue.format_indent_decrease,state:{kind:"command"}},{id:"indent",labelKey:"lists.increaseIndent",paths:ue.format_indent_increase,state:{kind:"command"}},{id:"lineSpacing",shape:"dropdown",labelKey:"lineSpacing.label",paths:ue.format_line_spacing,state:{kind:"command"}}]},{id:"format",labelKey:"formattingBar.clearFormatting",controls:[{id:"clear",labelKey:"formattingBar.clearFormatting",paths:ue.format_clear,state:{kind:"command"}}]},{id:"review",labelKey:"formattingBar.commentsAndChanges",controls:[{id:"comments",shape:"icon",labelKey:"formattingBar.commentsAndChanges",paths:ue.comment,state:{kind:"command"}},{id:"editingMode",shape:"dropdown",labelKey:"editingMode.label",valueKey:"editingMode.editing",paths:ue.edit_note,state:{kind:"command"}}]},{id:"contentControl",labelKey:"contentControl.group",contextual:true,controls:[{id:"showAll",labelKey:"contentControl.showAll",paths:ue.visibility,state:{kind:"command"}},{id:"formFill",labelKey:"contentControl.formFill",paths:ue.edit_note,state:{kind:"command"}},{id:"inspector",labelKey:"contentControl.inspector",paths:ue.tune,state:{kind:"command"}},{id:"remove",labelKey:"contentControl.remove",paths:ue.delete,state:{kind:"command"}}]},{id:"image",labelKey:"formattingBar.groups.image",contextual:true,controls:[{id:"insert",labelKey:"toolbar.image",paths:ue.image,state:{kind:"command"}},{id:"properties",labelKey:"formattingBar.imagePropertiesShortcut",paths:ue.tune,state:{kind:"command"}},{id:"wrap",shape:"dropdown",labelKey:"formattingBar.imageWrap",paths:ue.wrap_text,valueKey:"imageWrap.inline",state:{kind:"value"}},{id:"altText",shape:"dropdown",labelKey:"formattingBar.altText",paths:null,valueKey:"imageProperties.altText",state:{kind:"value"}}]},{id:"table",labelKey:"formattingBar.groups.table",contextual:true,controls:[{id:"insert",labelKey:"toolbar.table",paths:ue.table,state:{kind:"command"}},{id:"borderTarget",shape:"dropdown",labelKey:"table.borders.tooltip",paths:ue.border_all,state:{kind:"value"}},{id:"borderColor",shape:"colorSplit",swatch:"#000000",labelKey:"table.borderColor",paths:ue.border_color,state:{kind:"value"}},{id:"borderStyle",shape:"dropdown",labelKey:"table.borders.styleAriaLabel",paths:ue.border_horizontal,state:{kind:"value"}},{id:"borderWidth",shape:"dropdown",labelKey:"table.borderWidth",paths:ue.line_weight,state:{kind:"value"}},{id:"cellFill",shape:"colorSplit",swatch:"#ffffff",labelKey:"table.cellFillColor",paths:ue.format_color_fill,state:{kind:"value"}}]},{id:"paragraph",labelKey:"dialogs.paragraph.title",contextual:true,controls:[{id:"dialog",labelKey:"lineSpacing.options",paths:ue.format_line_spacing,state:{kind:"command"}}]},{id:"file",labelKey:"toolbar.file",contextual:true,controls:[{id:"open",labelKey:"toolbar.open",paths:ue.file_upload,state:{kind:"load"}},{id:"save",labelKey:"toolbar.saveShortcut",paths:ue.file_download,state:{kind:"save"}},{id:"pageSetup",labelKey:"toolbar.pageSetup",paths:ue.settings,state:{kind:"command"}}]},{id:"insert",labelKey:"toolbar.insert",contextual:true,controls:[{id:"footnote",labelKey:"toolbar.insertFootnote",paths:ue.superscript,state:{kind:"command"}},{id:"endnote",labelKey:"toolbar.insertEndnote",paths:ue.edit_note,state:{kind:"command"}},{id:"pageNumber",labelKey:"headerFooter.insertPageNumber",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"totalPages",labelKey:"headerFooter.insertTotalPages",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"sectionPages",labelKey:"headerFooter.insertSectionPages",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"pageXofY",labelKey:"headerFooter.insertPageXofY",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"pageBreak",labelKey:"toolbar.pageBreak",paths:ue.page_break,state:{kind:"command"}},{id:"sectionBreakNextPage",labelKey:"toolbar.sectionBreakNextPage",paths:ue.horizontal_rule,state:{kind:"command"}},{id:"sectionBreakContinuous",labelKey:"toolbar.sectionBreakContinuous",paths:ue.border_horizontal,state:{kind:"command"}},{id:"toc",labelKey:"toolbar.tableOfContents",paths:ue.toc,state:{kind:"command"}}]}],cp=Sl;function Jb(e,t){return `${e.id}.${t.id}`}function up(){return cp.filter(e=>!e.contextual)}function ev(e){let t=up();if(!e)return t;let n=cp.find(r=>r.id==="image");return n?[...t,n]:t}var fp=[{id:"file",labelKey:"toolbar.file",entries:[{kind:"item",slot:"file.open",shortcutKey:"toolbar.openShortcut"},{kind:"item",slot:"file.save",labelKey:"toolbar.save",shortcutKey:"toolbar.saveShortcut"},{kind:"separator"},{kind:"item",slot:"file.pageSetup"}]},{id:"format",labelKey:"toolbar.format",entries:[{kind:"item",slot:"text.bold",labelKey:"formattingBar.bold"},{kind:"item",slot:"text.italic",labelKey:"formattingBar.italic"},{kind:"item",slot:"text.underline",labelKey:"formattingBar.underline"},{kind:"item",slot:"text.strike"},{kind:"separator"},{kind:"item",slot:"alignment.left"},{kind:"item",slot:"alignment.center"},{kind:"item",slot:"alignment.right"},{kind:"item",slot:"alignment.justify"},{kind:"separator"},{kind:"item",slot:"paragraph.dialog"},{kind:"separator"},{kind:"item",slot:"format.clear"}]},{id:"insert",labelKey:"toolbar.insert",entries:[{kind:"item",slot:"image.insert"},{kind:"item",slot:"table.insert",picker:"tableGrid"},{kind:"separator"},{kind:"item",slot:"insert.footnote"},{kind:"item",slot:"insert.endnote"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.break",paths:ue.page_break,items:[{kind:"item",slot:"insert.pageBreak"},{kind:"item",slot:"insert.sectionBreakNextPage"},{kind:"item",slot:"insert.sectionBreakContinuous"}]},{kind:"item",slot:"insert.toc"}]},{id:"help",labelKey:"toolbar.help",entries:[]}];function tv(){let e=[],t=n=>{for(let r of n)r.kind==="item"?e.push(r.slot):r.kind==="submenu"&&t(r.items);};for(let n of fp)t(n.entries);return e}function nv(){return Sl.reduce((e,t)=>e+t.controls.length,0)}var rv="formattingBar.unavailableInPreview";var pp="docx-field-atom--active",ov="docx-field-atom",gp=new WeakMap;function kl(e,t,n){let r=gp.get(e);r||(r={caretKey:null,marked:[]},gp.set(e,r));let o=t?`${t.paragraphId}\0${t.offset}`:null;if(!n?.domReplaced&&o===r.caretKey)return;for(let i of r.marked)i.classList.remove(pp);if(r.marked=[],r.caretKey=o,!t)return;let a=e.querySelectorAll(`.${ov}`);for(let i of a){if(i.dataset.paragraphId!==t.paragraphId)continue;let s=Number(i.dataset.start),d=Number(i.dataset.end);!Number.isFinite(s)||!Number.isFinite(d)||t.offset<s||t.offset>d||(i.classList.add(pp),r.marked.push(i));}}function Mr(e){try{return e.createElement("canvas").getContext("2d")}catch{return null}}function Oe(e){return {anchor:e,head:e}}function er(e){if(e.anchor.paragraphId!==e.head.paragraphId)return null;let t=Math.min(e.anchor.offset,e.head.offset),n=Math.max(e.anchor.offset,e.head.offset);return {paragraphId:e.head.paragraphId,start:t,end:n}}function wl(e,t,n){let{anchor:r,head:o}=t;if(r.paragraphId===o.paragraphId)return r.offset<=o.offset?{from:r,to:o}:{from:o,to:r};let a=n??chunk6K6QQVAZ_cjs.tc(e);return a.indexOf(r.paragraphId)<=a.indexOf(o.paragraphId)?{from:r,to:o}:{from:o,to:r}}function Ho(e,t,n){let r=t[0],o=a=>{let i=t.includes(a.paragraphId),s=i?a.paragraphId:r??a.paragraphId,d=i?a.offset:0,c=chunk6K6QQVAZ_cjs.de(e,s).length;return {paragraphId:s,offset:Math.max(0,Math.min(d,c))}};return {anchor:o(n.anchor),head:o(n.head)}}function Tl(e,t,n,r){if(t.paragraphId===n.paragraphId)return chunk6K6QQVAZ_cjs.de(e,t.paragraphId).slice(t.offset,n.offset);let o=r??chunk6K6QQVAZ_cjs.tc(e),a=o.indexOf(t.paragraphId),i=o.indexOf(n.paragraphId);if(a===-1||i===-1)return "";let s=o.slice(a,i+1),d=chunk6K6QQVAZ_cjs.de(e,t.paragraphId).slice(t.offset);for(let c=1;c<s.length;c+=1){let p=s[c],b=chunk6K6QQVAZ_cjs.de(e,p),x=chunk6K6QQVAZ_cjs.wc(e,p).includes(s[c-1])?"":`
|
|
3
|
-
`;d+=x+(c===s.length-1?b.slice(0,n.offset):b);}return d}function Pl(e){let t=[],n=r=>{if(r.kind!=="textValue"){r.kind==="paragraph"&&t.push(r.id);for(let o of r.children)n(o);}};return n(e),t}function hp(e){return e.kind}function yp(e){return e.kind!=="textValue"&&hp(e)==="contentControl"}function mp(e){return e.kind!=="textValue"&&hp(e)==="contentControlContent"}function av(e,t){let n=new Map,r=o=>{if(o.kind!=="textValue"){if(o.kind==="table"){let a=Pl(o);if(a.length>0&&a.every(i=>t.has(i))){n.set(o.id,a);return}}for(let a of o.children)r(a);}};return r(e.root),n}function iv(e,t,n){let r=new Set,o=(a,i)=>{if(a.kind!=="textValue"){if(a.kind==="table"&&n.has(a.id)){for(let s of a.children)o(s,true);return}if(yp(a)){let s=Pl(a);!i&&s.length>0&&s.every(d=>t.has(d))&&r.add(a.id);for(let d of a.children)o(d,i);return}for(let s of a.children)o(s,i);}};return o(e.root,false),r}function bp(e,t,n,r,o,a){let i=new Set;for(let s=n;s<=r;s+=1){let d=t[s];(s===n?o.offset===0&&(s!==r||a.offset===e(d).length):s!==r||a.offset===e(d).length)&&i.add(d);}return i}function sv(e,t,n){let r=[],o=a=>{if(a.kind!=="textValue"){if(a.kind==="table"||yp(a)){let s=Pl(a).filter(d=>n.has(d));if(s.length>0&&s.every(d=>t.has(d))){r.push(a.id);return}}for(let i of a.children)o(i);}};return o(e.root),r}function vp(e,t,n,r,o){let a=x=>chunk6K6QQVAZ_cjs.de(e,x);if(n.paragraphId===r.paragraphId&&n.offset===r.offset)return null;let i=o??chunk6K6QQVAZ_cjs.tc(e),s=i.indexOf(n.paragraphId),d=i.indexOf(r.paragraphId);if(s===-1||d===-1||s>d)return null;let c=i.slice(s,d+1),p=bp(a,i,s,d,n,r),b=i[d];return {partName:t.name,paragraphIds:c,startOffset:n.offset,endOffset:r.offset,coveredParagraphIds:[...p],fullyCoveredBlockIds:sv(t,p,new Set(i)),lastMarkCovered:r.offset===a(b).length}}function xp(e,t,n,r,o){let a=j=>chunk6K6QQVAZ_cjs.de(e,j);if(n.paragraphId===r.paragraphId)return n.offset===r.offset?{ops:[],collapseTo:n}:{ops:[{op:"deleteText",paragraphId:n.paragraphId,start:n.offset,end:r.offset}],collapseTo:n};let i=o??chunk6K6QQVAZ_cjs.tc(e),s=i.indexOf(n.paragraphId),d=i.indexOf(r.paragraphId);if(s===-1||d===-1)return {ops:[],collapseTo:n};let c=bp(a,i,s,d,n,r),p=av(t,c),b=new Map;for(let[j,M]of p)for(let G of M)b.set(G,j);let x=iv(t,c,p),w=s;if(b.has(n.paragraphId)){w=-1;for(let j=s+1;j<=d;j+=1)if(!b.has(i[j])){w=j;break}if(w===-1){let j=b.get(n.paragraphId);for(let M of p.get(j)??[])b.delete(M);p.delete(j),w=s;}}let F=i[w],T=w===s?n:{paragraphId:F,offset:0},P=[];for(let j=s;j<=d;j+=1){let M=i[j];if(b.has(M))continue;let G=a(M).length,S=j===s?n.offset:0,E=j===d?r.offset:G;S<E&&P.push({op:"deleteText",paragraphId:M,start:S,end:E});}for(let j of p.keys())P.push({op:"deleteBlock",blockId:j});for(let j of x)P.push({op:"removeContentControl",controlId:j});let B=j=>{let M=chunk35MI6K7M_cjs.za(t,j);for(;M&&mp(M);){let G=chunk35MI6K7M_cjs.za(t,M.id);if(!G||!x.has(G.id))break;M=chunk35MI6K7M_cjs.za(t,G.id);}return M},h=j=>{let M=[],G=S=>{for(let E of S)if(E.kind!=="textValue"&&!p.has(E.id)){if(x.has(E.id)){let Z=E.children.find(mp);Z&&Z.kind!=="textValue"&&G(Z.children);continue}if(E.kind==="paragraph"){M.push(E.id);continue}M.push(`\0barrier:${E.id}`);}};return G(j.children),M},N=(j,M)=>{let G=B(j);if(!G||B(M)!==G)return false;let S=h(G),E=S.indexOf(j),Z=S.indexOf(M);return E!==-1&&Z===E+1},A=F,$=F;for(let j=w+1;j<=d;j+=1){let M=i[j];b.has(M)||(N($,M)?P.push({op:"joinParagraphs",firstId:A,secondId:M}):A=M,$=M);}return {ops:P,collapseTo:T}}var Rp="http://schemas.openxmlformats.org/officeDocument/2006/relationships",lv=`${Rp}/styles`,dv=`${Rp}/numbering`,cv=16,uv=2*1024*1024,fv=8*1024*1024,Ip=9525;function Ep(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var Bo=Ep;function pv(e){let t=e.replace(/[^A-Za-z0-9 _.,-]/g,"").trim();return t.length===0?null:/^[A-Za-z][A-Za-z0-9-]*$/.test(t)?t:`'${t}'`}function ri(e){return e===void 0||e.toLowerCase()==="auto"?null:/^[0-9A-Fa-f]{6}$/.test(e)?`#${e.toLowerCase()}`:null}function tr(e){return `${Math.round(e/20*100)/100}pt`}function Ct(e){if(e===void 0||!/^-?\d+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}var ti="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function gv(e){let t=[],n="";for(let r=0;r<e.length;r+=3){let o=e[r],a=r+1<e.length?e[r+1]:0,i=r+2<e.length?e[r+2]:0;n+=ti[o>>2]+ti[(o&3)<<4|a>>4],n+=r+1<e.length?ti[(a&15)<<2|i>>6]:"=",n+=r+2<e.length?ti[i&63]:"=",n.length>=32768&&(t.push(n),n="");}return t.push(n),t.join("")}function We(e){return e.kind!=="textValue"}function ke(e,t){if(!e||e.kind==="textValue")return null;for(let n of e.children)if(We(n)&&n.localName===t&&n.namespaceUri===chunk35MI6K7M_cjs.da)return n;return null}function Ye(e,t="val"){return e?chunk35MI6K7M_cjs.Ud(e,t,chunk35MI6K7M_cjs.da):void 0}function Cl(e,t,n){return e?chunk35MI6K7M_cjs.Ud(e,t,n):void 0}function Op(e){if(e.kind==="textValue")return e.value;let t="";for(let n of e.children)t+=Op(n);return t}function _o(e,t,n){if(e.kind==="textValue")return null;if(e.localName===t&&e.namespaceUri===n)return e;for(let r of e.children){let o=_o(r,t,n);if(o)return o}return null}function Fp(e,t,n){for(let o of chunk35MI6K7M_cjs.wb(e,e.mainDocumentPart)){if(o.type!==t||o.targetMode==="External")continue;let a=chunk35MI6K7M_cjs.w(o.ownerPart,o.rawTarget);if(a.ok){let i=e.parts.get(a.partName);if(i&&We(i.root))return i.root}}let r=e.parts.get(n);return r&&We(r.root)?r.root:null}function mv(e){let t=Fp(e,lv,"/word/styles.xml"),n=new Map,r=null,o=null,a=null;if(!t)return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:a};for(let i of t.children){if(!We(i)||i.namespaceUri!==chunk35MI6K7M_cjs.da)continue;if(i.localName==="docDefaults"){r=ke(ke(i,"rPrDefault"),"rPr"),o=ke(ke(i,"pPrDefault"),"pPr");continue}if(i.localName!=="style")continue;let s=chunk35MI6K7M_cjs.Ud(i,"styleId",chunk35MI6K7M_cjs.da);if(!s)continue;n.set(s,i);let d=chunk35MI6K7M_cjs.Ud(i,"default",chunk35MI6K7M_cjs.da),c=chunk35MI6K7M_cjs.Ud(i,"type",chunk35MI6K7M_cjs.da);(d==="1"||d==="true")&&c==="paragraph"&&(a=s);}return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:a}}function nr(e,t){let n=[],r=new Set,o=t;for(;o&&!r.has(o)&&n.length<cv;){r.add(o);let a=e.byId.get(o);if(!a)break;n.unshift(a),o=Ye(ke(a,"basedOn"));}return n}function Ap(e,t){let n=[];e.docDefaultsPPr&&n.push(e.docDefaultsPPr);for(let r of nr(e,e.defaultParagraphStyleId??void 0)){let o=ke(r,"pPr");o&&n.push(o);}for(let r of nr(e,Ye(ke(t,"pStyle")))){let o=ke(r,"pPr");o&&n.push(o);}return t&&n.push(t),n}function hv(e,t,n){let r=[];e.docDefaultsRPr&&r.push(e.docDefaultsRPr);for(let o of nr(e,e.defaultParagraphStyleId??void 0)){let a=ke(o,"rPr");a&&r.push(a);}for(let o of nr(e,Ye(ke(t,"pStyle")))){let a=ke(o,"rPr");a&&r.push(a);}for(let o of nr(e,Ye(ke(n,"rStyle")))){let a=ke(o,"rPr");a&&r.push(a);}return n&&r.push(n),r}function ni(e,t){let n=null;for(let r of e){let o=ke(r,t);o&&(n=o);}return n}function bt(e,t,n){let r;for(let o of e){let a=ke(o,t);if(!a)continue;let i=chunk35MI6K7M_cjs.Ud(a,n,chunk35MI6K7M_cjs.da);i!==void 0&&(r=i);}return r}function Lr(e,t){let n=false;for(let r of e){let o=ke(r,t);if(!o)continue;let a=Ye(o);n=!(a==="0"||a==="false"||a==="none");}return n}var Sp={yellow:"yellow",green:"green",cyan:"cyan",magenta:"magenta",blue:"blue",red:"red",darkBlue:"darkblue",darkCyan:"darkcyan",darkGreen:"darkgreen",darkMagenta:"darkmagenta",darkRed:"darkred",darkYellow:"#808000",darkGray:"#a9a9a9",lightGray:"#d3d3d3",black:"black",white:"white"},kp={left:"left",start:"left",center:"center",right:"right",end:"right",both:"justify",distribute:"justify"};function yv(e){if(Lr(e,"vanish"))return {css:"",vanish:true,vertAlign:null};let t=[],n=bt(e,"rFonts","ascii");if(n!==void 0){let x=pv(n);x&&t.push(`font-family:${x}`);}let r=Ct(bt(e,"sz","val"));r!==null&&r>0&&t.push(`font-size:${Math.round(r/2*100)/100}pt`),Lr(e,"b")&&t.push("font-weight:bold"),Lr(e,"i")&&t.push("font-style:italic");let o=[],a=ni(e,"u");a&&Ye(a)!=="none"&&o.push("underline"),Lr(e,"strike")&&o.push("line-through"),o.length>0&&t.push(`text-decoration:${o.join(" ")}`);let i=ri(bt(e,"color","val"));i&&t.push(`color:${i}`);let s=Ye(ni(e,"highlight")),d=s!==void 0&&Object.hasOwn(Sp,s)?Sp[s]:void 0,c=ri(bt(e,"shd","fill"));d?t.push(`background-color:${d}`):c&&t.push(`background-color:${c}`),Lr(e,"caps")&&t.push("text-transform:uppercase"),Lr(e,"smallCaps")&&t.push("font-variant:small-caps");let p=Ye(ni(e,"vertAlign")),b=p==="superscript"||p==="subscript"?p:null;return {css:t.join(";"),vanish:false,vertAlign:b}}function bv(e,t){let n=[],r=Ye(ni(e,"jc")),o=r!==void 0&&Object.hasOwn(kp,r)?kp[r]:void 0;o&&n.push(`text-align:${o}`);let a=Ct(bt(e,"spacing","before"));a!==null&&a>=0&&n.push(`margin-top:${tr(a)}`);let i=Ct(bt(e,"spacing","after"));i!==null&&i>=0&&n.push(`margin-bottom:${tr(i)}`);let s=Ct(bt(e,"spacing","line")),d=bt(e,"spacing","lineRule");s!==null&&s>0&&(d===void 0||d==="auto")&&n.push(`line-height:${Math.round(s/240*100)/100}`);let c=Ct(bt(e,"ind","left")??bt(e,"ind","start"));!t&&c!==null&&n.push(`margin-left:${tr(c)}`);let p=Ct(bt(e,"ind","right")??bt(e,"ind","end"));p!==null&&n.push(`margin-right:${tr(p)}`);let b=Ct(bt(e,"ind","hanging")),x=Ct(bt(e,"ind","firstLine"));return b!==null&&b!==0?n.push(`text-indent:${tr(-b)}`):x!==null&&x!==0&&n.push(`text-indent:${tr(x)}`),n.join(";")}function vv(e){let t=new Map,n=new Map,r=Fp(e,dv,"/word/numbering.xml");if(!r)return {numToAbstract:t,levelFormats:n};for(let o of r.children){if(!We(o)||o.namespaceUri!==chunk35MI6K7M_cjs.da)continue;if(o.localName==="num"){let s=chunk35MI6K7M_cjs.Ud(o,"numId",chunk35MI6K7M_cjs.da),d=Ye(ke(o,"abstractNumId"));s&&d&&t.set(s,d);continue}if(o.localName!=="abstractNum")continue;let a=chunk35MI6K7M_cjs.Ud(o,"abstractNumId",chunk35MI6K7M_cjs.da);if(!a)continue;let i=new Map;for(let s of o.children){if(!We(s)||s.localName!=="lvl"||s.namespaceUri!==chunk35MI6K7M_cjs.da)continue;let d=chunk35MI6K7M_cjs.Ud(s,"ilvl",chunk35MI6K7M_cjs.da),c=Ye(ke(s,"numFmt"));d!==void 0&&c!==void 0&&i.set(d,c);}n.set(a,i);}return {numToAbstract:t,levelFormats:n}}var wp={decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman"};function xv(e,t){let n,r;for(let s of t){let d=ke(s,"numPr");if(!d)continue;let c=Ye(ke(d,"numId"));c!==void 0&&(n=c);let p=Ye(ke(d,"ilvl"));p!==void 0&&(r=p);}if(n===void 0||n==="0")return null;let o=e.numbering.numToAbstract.get(n);if(o===void 0)return null;let a=Math.min(Math.max(Ct(r)??0,0),8),i=e.numbering.levelFormats.get(o)?.get(String(a))??"decimal";return {numId:n,level:a,fmt:i}}function Tp(e,t){return e.children.some(n=>n.kind===t)}function Iv(e,t){let n=_o(t,"inline",chunk35MI6K7M_cjs.ha)??_o(t,"anchor",chunk35MI6K7M_cjs.ha);if(!n)return "";let r=_o(n,"blip",chunk35MI6K7M_cjs.ga);if(!r)return "";let o=chunk35MI6K7M_cjs.Ud(r,"embed",chunk35MI6K7M_cjs.ia);if(!o)return "";let a=e.docRels.find(T=>T.id===o&&T.targetMode!=="External");if(!a)return "";let i=chunk35MI6K7M_cjs.w(a.ownerPart,a.rawTarget);if(!i.ok)return "";let s=e.pkg.partBytes.get(i.partName);if(!s)return "";let d=i.partName.lastIndexOf("."),c=d===-1?"":i.partName.slice(d+1).toLowerCase(),p=c==="png"?"image/png":c==="jpg"||c==="jpeg"?"image/jpeg":c==="gif"?"image/gif":null;if(!p||s.byteLength>e.maxImageBytes||e.imageBytesUsed+s.byteLength>e.maxTotalImageBytes)return "";e.imageBytesUsed+=s.byteLength;let b=_o(n,"extent",chunk35MI6K7M_cjs.ha),x=b?Ct(chunk35MI6K7M_cjs.Ud(b,"cx","")):null,w=b?Ct(chunk35MI6K7M_cjs.Ud(b,"cy","")):null,F=x!==null&&w!==null&&x>0&&w>0?` width="${Math.round(x/Ip)}" height="${Math.round(w/Ip)}"`:"";return `<img src="data:${p};base64,${gv(s)}"${F}>`}function Sv(e,t,n,r){if(Tp(t,"fldChar")){for(let d of t.children){if(d.kind!=="fldChar")continue;let c=chunk35MI6K7M_cjs.Ud(d,"fldCharType",chunk35MI6K7M_cjs.da);c==="begin"?r.stack.push("instr"):c==="separate"&&r.stack.length>0?r.stack[r.stack.length-1]="result":c==="end"&&r.stack.pop();}return ""}if(Tp(t,"instrText")||r.stack.some(d=>d==="instr"))return "";let o=t.children.find(d=>d.kind==="runProperties"),a=hv(e.styles,n,o&&We(o)?o:null),i=yv(a);if(i.vanish)return "";let s="";for(let d of t.children)if(We(d))switch(d.kind){case "text":s+=Ep(Op(d));break;case "tab":s+='<span style="white-space:pre"> </span>';break;case "hardBreak":s+="<br>";break;case "drawing":s+=Iv(e,d);break;}return s===""?"":(i.vertAlign==="superscript"?s=`<sup>${s}</sup>`:i.vertAlign==="subscript"&&(s=`<sub>${s}</sub>`),i.css===""?s:`<span style="${Bo(i.css)}">${s}</span>`)}function Nr(e,t,n,r){let o="";for(let a of t)if(We(a))switch(a.kind){case "run":o+=Sv(e,a,n,r);break;case "hyperlink":{let i=Nr(e,a.children,n,r);if(i==="")break;let s=chunk35MI6K7M_cjs.Ud(a,"id",chunk35MI6K7M_cjs.ia),d=s?e.docRels.find(p=>p.id===s&&p.targetMode==="External"):void 0,c=d?chunk35MI6K7M_cjs.L(d.rawTarget):null;o+=c?.ok?`<a href="${Bo(c.href)}">${i}</a>`:i;break}case "fldSimple":o+=Nr(e,a.children,n,r);break;case "contentControl":{let i=a.children.find(s=>s.kind==="contentControlContent");i&&We(i)&&(o+=Nr(e,i.children,n,r));break}case "revisionInsert":case "revisionMoveTo":o+=Nr(e,a.children,n,r);break;case "revisionDelete":case "revisionMoveFrom":break;case "generic":o+=Nr(e,a.children,n,r);break;}return o}function kv(e,t){for(let n of nr(e.styles,Ye(ke(t,"pStyle")))){let r=chunk35MI6K7M_cjs.Ud(n,"styleId",chunk35MI6K7M_cjs.da),o=r?/^Heading([1-6])$/.exec(r):null;if(o)return Number(o[1])}return null}function Pp(e,t,n){let r=t.children.find(x=>x.kind==="paragraphProperties"),o=r&&We(r)?r:null,a=Ap(e.styles,o),i=bv(a,n.asListItem),s={stack:[]},d=Nr(e,t.children,o,s),c=i===""?"":` style="${Bo(i)}"`;if(n.asListItem)return `<li${c}>${d}</li>`;let p=kv(e,o),b=p===null?"p":`h${p}`;return `<${b}${c}>${d}</${b}>`}function wv(e){return e.map(t=>{let n=[],r=0;for(let o of t.children){if(!We(o)||o.kind!=="tableCell")continue;let a=ke(o,"tcPr"),i=Math.max(Ct(Ye(ke(a,"gridSpan")))??1,1),s=ke(a,"vMerge"),d=s===null?null:Ye(s)==="restart"?"restart":"continue";n.push({cell:o,startColumn:r,span:i,vMerge:d}),r+=i;}return n})}function Cp(e){if(!e)return null;let t=Ye(e);return t===void 0||t==="nil"||t==="none"?null:`1pt solid ${ri(chunk35MI6K7M_cjs.Ud(e,"color",chunk35MI6K7M_cjs.da))??"#000000"}`}function Tv(e,t){let n=[],r=ke(e,"tcBorders");for(let c of ["top","left","bottom","right"]){let p=Cp(ke(r,c))??Cp(ke(t,c));p&&n.push(`border-${c}:${p}`);}let o=ri(Cl(ke(e,"shd"),"fill",chunk35MI6K7M_cjs.da));o&&n.push(`background-color:${o}`);let a=Ye(ke(e,"vAlign"));a==="center"?n.push("vertical-align:middle"):a==="bottom"?n.push("vertical-align:bottom"):a==="top"&&n.push("vertical-align:top");let i=ke(e,"tcW"),s=Cl(i,"type",chunk35MI6K7M_cjs.da),d=Ct(Cl(i,"w",chunk35MI6K7M_cjs.da));return d!==null&&d>0&&(s===void 0||s==="dxa")&&n.push(`width:${tr(d)}`),n.join(";")}function Pv(e,t){let n=t.children.find(d=>d.kind==="tableProperties"),r=null;for(let d of nr(e.styles,Ye(ke(n&&We(n)?n:null,"tblStyle")))){let c=ke(ke(d,"tblPr"),"tblBorders");c&&(r=c);}let o=ke(n&&We(n)?n:null,"tblBorders");o&&(r=o);let a=[];for(let d of t.children)We(d)&&d.kind==="tableRow"&&a.push(d);let i=wv(a),s='<table style="border-collapse:collapse">';return i.forEach((d,c)=>{s+="<tr>";for(let p of d){if(p.vMerge==="continue")continue;let b=1;if(p.vMerge==="restart")for(let T=c+1;T<i.length&&i[T].find(B=>B.startColumn===p.startColumn&&B.vMerge==="continue");T+=1)b+=1;let x=ke(p.cell,"tcPr"),w=Tv(x,r),F=(p.span>1?` colspan="${p.span}"`:"")+(b>1?` rowspan="${b}"`:"")+(w===""?"":` style="${Bo(w)}"`);s+=`<td${F}>${Mp(e,p.cell.children)}</td>`;}s+="</tr>";}),`${s}</table>`}function Mp(e,t){let n="",r=[],o=()=>{let d=r.pop();d&&(n+=`</${d.tag}>`);},a=()=>{for(;r.length>0;)o();},i=(d,c)=>{let p=c.level+1;for(;r.length>p;)o();for(r.length===p&&r[p-1].numId!==c.numId&&o();r.length<p;){let b=c.fmt==="bullet"?"ul":"ol",x=b==="ol"?Object.hasOwn(wp,c.fmt)?wp[c.fmt]:"decimal":null;n+=x?`<${b} style="list-style-type:${Bo(x)}">`:`<${b}>`,r.push({tag:b,numId:c.numId});}n+=Pp(e,d,{asListItem:true});},s=d=>{for(let c of d)if(We(c))switch(c.kind){case "paragraph":{let p=c.children.find(w=>w.kind==="paragraphProperties"),b=p&&We(p)?p:null,x=xv(e,Ap(e.styles,b));x?i(c,x):(a(),n+=Pp(e,c,{asListItem:false}));break}case "table":a(),n+=Pv(e,c);break;case "contentControl":{let p=c.children.find(b=>b.kind==="contentControlContent");p&&We(p)&&s(p.children);break}case "generic":s(c.children);break;}};return s(t),a(),n}function Lp(e,t){let n=e.parts.get(e.mainDocumentPart);if(!n||!We(n.root))return "";let r=n.root.children.find(a=>a.kind==="body");if(!r||!We(r))return "";let o={pkg:e,styles:mv(e),numbering:vv(e),docRels:chunk35MI6K7M_cjs.wb(e,e.mainDocumentPart),maxImageBytes:uv,maxTotalImageBytes:fv,imageBytesUsed:0};return Mp(o,r.children)}var Dp="data-docx-fragment",Hp="data-docx-fragment-end",qo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cv=new Map([...qo].map((e,t)=>[e,t]));function Rv(e){let t="";for(let n=0;n<e.length;n+=3){let r=e[n],o=n+1<e.length?e[n+1]:0,a=n+2<e.length?e[n+2]:0;t+=qo[r>>2],t+=qo[(r&3)<<4|o>>4],t+=n+1<e.length?qo[(o&15)<<2|a>>6]:"=",t+=n+2<e.length?qo[a&63]:"=";}return t}function Ev(e,t){let n=e.replace(/=+$/,"");if(n.length*3/4>t)return null;let r=new Uint8Array(Math.floor(n.length*3/4)),o=0,a=0,i=0;for(let s of n){let d=Cv.get(s);if(d===void 0)return null;o=o<<6|d,a+=6,a>=8&&(a-=8,r[i++]=o>>a&255);}return r.subarray(0,i)}function _p(e,t){if(!t)return `<div>${e}</div>`;let n=t.lastMarkCovered?"covered":"open";return `<div ${Dp}="${Rv(t.bytes)}" ${Hp}="${n}">${e}</div>`}function Np(e,t){let n=`${t}="`,r=e.indexOf(n);if(r===-1||r>67108864)return null;let o=r+n.length,a=e.indexOf('"',o);return a===-1?null:e.slice(o,a)}function Bp(e,t=16777216){if(e.length>67108864)return null;let n=Np(e,Dp);if(n===null||n.length===0)return null;let r=Ev(n,t);if(r===null||r.byteLength===0)return null;let o=Np(e,Hp);return {bytes:r,lastMarkCovered:o==="covered"}}var Ov=12*1024*1024;function Fv(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Av(e){return `<div><table>${e.split(`
|
|
4
|
-
`).map(n=>`<tr>${n.split(" ").map(r=>`<td>${Fv(r)}</td>`).join("")}</tr>`).join("")}</table></div>`}function Rl(e){if(e.text.length===0)return {text:"",html:null};if(e.cellRectangle)return {text:e.text,html:Av(e.text)};if(!e.coverage||!e.pkg)return {text:e.text,html:null};let t=chunkC6LK2BYA_cjs.U(e.pkg,e.coverage);if(!t.ok)return {text:e.text,html:null};let n=e.maxFragmentBytes??Ov,r=t.bytes;if(t.bytes.byteLength>n){let s=chunkC6LK2BYA_cjs.U(e.pkg,e.coverage,{omitMedia:true});r=s.ok&&s.bytes.byteLength<=n?s.bytes:null;}let o=chunk35MI6K7M_cjs.sb(t.bytes),a=o.ok?Lp(o.package):"",i=_p(a,r?{bytes:r,lastMarkCovered:t.lastMarkCovered}:null);return {text:e.text,html:i}}var Mv=4*1024*1024,Lv=1e5,Nv=64,Dv=2*1024*1024,Up="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Zo="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Hv="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",_v="http://schemas.openxmlformats.org/drawingml/2006/main",Wp="http://schemas.openxmlformats.org/drawingml/2006/picture",Bv="http://schemas.openxmlformats.org/package/2006/relationships",qv="http://schemas.openxmlformats.org/package/2006/content-types",Zv="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",zv="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",$v="application/vnd.openxmlformats-package.relationships+xml",oi='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',Gp=new Set("script style head template iframe object embed noscript svg math meta link title base select textarea".split(" ")),jv={h1:64,h2:52,h3:44,h4:36,h5:32,h6:28},Kv=new Set("p div h1 h2 h3 h4 h5 h6 li blockquote pre".split(" ")),Vv=new Set("thead tbody tfoot tr section article main header footer aside nav figure form body html".split(" ")),Uv=new Map("black:000000 white:FFFFFF red:FF0000 green:008000 blue:0000FF yellow:FFFF00 gray:808080 grey:808080 silver:C0C0C0 maroon:800000 navy:000080 purple:800080 orange:FFA500".split(" ").map(e=>e.split(":")));function Dr(e){let t=new Map,n=e.getAttribute("style");if(!n||n.length>8192)return t;for(let r of n.split(";")){let o=r.indexOf(":");if(o<=0)continue;let a=r.slice(0,o).trim().toLowerCase(),i=r.slice(o+1).trim();a.length>0&&i.length>0&&!t.has(a)&&t.set(a,i);}return t}function Ol(e){let t=e.trim().toLowerCase(),n=Uv.get(t);if(n)return n;let r=/^#([0-9a-f]{6})$/.exec(t);if(r)return r[1].toUpperCase();let o=/^#([0-9a-f]{3})$/.exec(t);if(o){let[i,s,d]=o[1];return `${i}${i}${s}${s}${d}${d}`.toUpperCase()}let a=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,[^)]*)?\)$/.exec(t);if(a){let i=s=>Math.min(255,Number.parseInt(s,10)).toString(16).padStart(2,"0");return `${i(a[1])}${i(a[2])}${i(a[3])}`.toUpperCase()}return null}function ai(e){let t=/^(-?\d+(?:\.\d+)?)(px|pt)$/.exec(e.trim().toLowerCase());if(!t)return null;let n=Number.parseFloat(t[1]);return Number.isFinite(n)?t[2]==="px"?n*.75:n:null}function Dn(e,t,n){return Math.min(n,Math.max(t,e))}function Xp(e,t){if(t.size===0)return e;let n={...e},r=t.get("font-weight")?.toLowerCase();if(r!==void 0){let b=Number.parseInt(r,10);r==="bold"||b>=600?n.bold=true:(r==="normal"||b<600)&&(n.bold=false);}let o=t.get("font-style");o!==void 0&&(n.italic=o.toLowerCase().includes("italic"));let a=(t.get("text-decoration")??t.get("text-decoration-line"))?.toLowerCase();a!==void 0&&(a.includes("underline")&&(n.underline=true),a.includes("line-through")&&(n.strike=true),a.includes("none")&&(n.underline=n.strike=false));let i=Ol(t.get("color")??"");i&&(n.color=i);let s=t.get("background-color");if(s!==void 0&&s.toLowerCase()!=="transparent"){let b=Ol(s);b&&(n.shdFill=b);}let d=ai(t.get("font-size")??"");d!==null&&d>0&&(n.szHalfPoints=Dn(Math.round(d*2),2,3276));let c=t.get("font-family");if(c!==void 0){let b=c.split(",")[0].trim().replace(/^['"]|['"]$/g,"");b.length>0&&b.length<=64&&(n.font=b);}let p=t.get("vertical-align");return p==="sub"?n.vertAlign="subscript":p==="super"&&(n.vertAlign="superscript"),n}function Wv(e,t){let n=t.get("text-align")?.toLowerCase();n==="left"||n==="start"?e.jc="left":n==="center"?e.jc="center":n==="right"||n==="end"?e.jc="right":n==="justify"&&(e.jc="both");let r=ai(t.get("margin-left")??"");r!==null&&r>0&&(e.indLeftTwips=Dn(Math.round(r*20),0,31680));let o=ai(t.get("text-indent")??"");if(o!==null&&o!==0){let i=Dn(Math.round(o*20),-31680,31680);i!==0&&(e.firstLineTwips=i);}let a=t.get("line-height")?.trim()??"";/^\d+(\.\d+)?$/.test(a)&&Number.parseFloat(a)>0&&(e.lineTwentieths=Dn(Math.round(240*Number.parseFloat(a)),24,9600));}function Yp(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(!(r!==9&&(r<32||r===65534||r===65535))){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}function Fl(e){let t="";if(e.font!==void 0){let n=chunk35MI6K7M_cjs.N(Yp(e.font));t+=`<w:rFonts w:ascii="${n}" w:hAnsi="${n}"/>`;}return e.bold&&(t+="<w:b/>"),e.italic&&(t+="<w:i/>"),e.strike&&(t+="<w:strike/>"),e.color!==void 0&&(t+=`<w:color w:val="${e.color}"/>`),e.szHalfPoints!==void 0&&(t+=`<w:sz w:val="${e.szHalfPoints}"/>`),e.underline&&(t+='<w:u w:val="single"/>'),e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.vertAlign!==void 0&&(t+=`<w:vertAlign w:val="${e.vertAlign}"/>`),t.length>0?`<w:rPr>${t}</w:rPr>`:""}function qp(e,t){return `<w:r>${Fl(t)}<w:t xml:space="preserve">${chunk35MI6K7M_cjs.M(Yp(e))}</w:t></w:r>`}function Gv(e){let t="";e.numPr&&(t+=`<w:numPr><w:ilvl w:val="${e.numPr.ilvl}"/><w:numId w:val="${chunk35MI6K7M_cjs.N(e.numPr.numId)}"/></w:numPr>`),e.lineTwentieths!==void 0&&(t+=`<w:spacing w:line="${e.lineTwentieths}" w:lineRule="auto"/>`);let n=e.firstLineTwips;if(e.indLeftTwips!==void 0||n!==void 0){let r="<w:ind";e.indLeftTwips!==void 0&&(r+=` w:left="${e.indLeftTwips}"`),n!==void 0&&(r+=n>=0?` w:firstLine="${n}"`:` w:hanging="${-n}"`),t+=`${r}/>`;}return e.jc!==void 0&&(t+=`<w:jc w:val="${e.jc}"/>`),t.length>0?`<w:pPr>${t}</w:pPr>`:""}function Zp(e,t){return `<w:p>${Gv(e)}${t.join("")}</w:p>`}var zp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xv=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<zp.length;t+=1)e[zp.charCodeAt(t)]=t;return e})();function Yv(e,t){if(e.length===0||e.length%4!==0)return null;let n=e.endsWith("==")?2:e.endsWith("=")?1:0,r=e.length/4*3-n;if(r<=0||r>t)return null;let o=new Uint8Array(r),a=0;for(let i=0;i<e.length;i+=4){let s=0,d=0;for(let c=0;c<4;c+=1){let p=e.charCodeAt(i+c);if(p===61){if(i+c<e.length-n)return null;continue}let b=p<128?Xv[p]:-1;if(b<0)return null;s=s<<6|b,d+=6;}s<<=24-d,d>=12&&(o[a++]=s>>>16&255),d>=18&&(o[a++]=s>>>8&255),d>=24&&(o[a++]=s&255);}return a===r?o:null}var Qv=/^data:image\/(png|jpeg|jpg|gif);base64,([A-Za-z0-9+/=]+)$/;function $p(e,t,n){let r=ai(t.get(n)??"");if(r!==null&&r>0)return r/.75;let o=e.getAttribute(n)??"";return /^[1-9]\d{0,4}$/.test(o.trim())?Number.parseInt(o,10):null}function Jv(e,t,n){let r=e.getAttribute("src");if(r===null||r.length>n.maxImageBytes*2)return;let o=Qv.exec(r);if(!o)return;let a=o[1]==="png"?"image/png":o[1]==="gif"?"image/gif":"image/jpeg",i=Yv(o[2],n.maxImageBytes);if(i===null||chunk35MI6K7M_cjs.eb(i)!==a)return;let s=chunk35MI6K7M_cjs.jb(i,a),d=Dr(e),c=$p(e,d,"width"),p=$p(e,d,"height");c===null&&p===null&&s?(c=s.pixelWidth,p=s.pixelHeight):c!==null&&p===null?p=s?c*s.pixelHeight/s.pixelWidth:c*2/3:c===null&&p!==null&&(c=s?p*s.pixelWidth/s.pixelHeight:p*3/2);let b=c===null?381e4:Dn(Math.round(c*9525),9525,3e7),x=p===null?254e4:Dn(Math.round(p*9525),9525,3e7),w=a==="image/png"?"png":a==="image/gif"?"gif":"jpeg";n.imageCount+=1,n.media.set(`word/media/image${n.imageCount}.${w}`,i),n.mediaExtensions.has(w)||n.mediaExtensions.set(w,a);let F=Ml(n,`${Zo}/image`,`media/image${n.imageCount}.${w}`,false);n.docPrId+=1,t.push(`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${b}" cy="${x}"/><wp:docPr id="${n.docPrId}" name=""/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${Wp}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="" descr=""/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${F}"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${b}" cy="${x}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`);}function Ml(e,t,n,r){let o=`rId${e.rels.length+1}`;return e.rels.push({id:o,type:t,target:n,external:r}),o}function Qp(e,t,n){let r=e.lists.get(t);if(r)return r.numId;let o=String(1001+e.lists.size);return e.lists.set(t,{numId:o,kind:n}),o}function ii(e){return e.nodeType===1}function fn(e){return e.tagName.toLowerCase()}function Jp(e){let t=e.get("mso-list");return t!==void 0&&t.toLowerCase().includes("ignore")}function ex(e,t){return t==="b"||t==="strong"?{...e,bold:true}:t==="i"||t==="em"?{...e,italic:true}:t==="u"||t==="ins"?{...e,underline:true}:t==="s"||t==="strike"||t==="del"?{...e,strike:true}:t==="sub"?{...e,vertAlign:"subscript"}:t==="sup"?{...e,vertAlign:"superscript"}:t==="code"||t==="tt"||t==="kbd"||t==="samp"?{...e,font:"Courier New"}:e}function Al(e,t,n,r,o){if(o.nodesLeft<=0||t>o.maxDepth)return;if(o.nodesLeft-=1,e.nodeType===3){let d=e.nodeValue??"";if(n.pre){d.replace(/\r\n?/g,`
|
|
5
|
-
`).split(`
|
|
6
|
-
`).forEach((b,x)=>{x>0&&r.push(`<w:r>${Fl(n.run)}<w:br/></w:r>`),b.length>0&&r.push(qp(b,n.run));});return}let c=d.replace(/\s+/g," ");if(c.length===0||c===" "&&r.length===0)return;r.push(qp(c,n.run));return}if(!ii(e))return;let a=fn(e);if(Gp.has(a))return;let i=Dr(e);if(Jp(i))return;if(a==="br"){r.push(`<w:r>${Fl(n.run)}<w:br/></w:r>`);return}if(a==="img"){Jv(e,r,o);return}let s={...n,run:Xp(ex(n.run,a),i),pre:n.pre||a==="pre"};if(a==="a"){let d=e.getAttribute("href"),c=[];for(let b of Array.from(e.childNodes))Al(b,t+1,s,c,o);let p=d===null?null:chunk35MI6K7M_cjs.L(d);if(p!==null&&p.ok&&p.href.length>0){let b=Ml(o,`${Zo}/hyperlink`,p.href,true);r.push(`<w:hyperlink r:id="${b}">${c.join("")}</w:hyperlink>`);}else for(let b of c)r.push(b);return}for(let d of Array.from(e.childNodes))Al(d,t+1,s,r,o);}function tx(e,t,n){let r=t.get("mso-list");if(r===void 0)return;let o=/\bl(\d{1,4})\s+level(\d{1,2})\b/i.exec(r);if(!o)return;let a=Dn(Number.parseInt(o[2],10)-1,0,8),i=nx(e,n),s=/\d|[a-z][.)]/i.test(i)?"ordered":"bullet";return {numId:Qp(n,`mso:l${o[1]}`,s),ilvl:a}}function nx(e,t){let n="",r=(o,a)=>{if(!(n.length>0||a>8||t.nodesLeft<=0)&&ii(o)){if(Jp(Dr(o))){n=(o.textContent??"").slice(0,16);return}for(let i of Array.from(o.childNodes))r(i,a+1);}};for(let o of Array.from(e.childNodes))r(o,0);return n}function eg(e,t,n,r,o){if(r.nodesLeft<=0||t>r.maxDepth)return;let a=fn(e),i=Dr(e),s={};n.para.numPr&&(s.numPr=n.para.numPr),n.para.jc&&(s.jc=n.para.jc);let d={...n.run},c=jv[a];c!==void 0&&(d.bold=true,d.szHalfPoints=c);let p=n.pre||a==="pre";a==="pre"&&(d.font="Courier New");let b=tx(e,i,r);b&&(s.numPr=b),Wv(s,i),d=Xp(d,i);let x={run:d,para:s,pre:p,list:n.list};si(Array.from(e.childNodes),t+1,x,r,o,true);}function tg(e,t,n,r,o){if(r.nodesLeft<=0||t>r.maxDepth)return;r.nodesLeft-=1;let a=fn(e)==="ol"?"ordered":"bullet";n.list||(r.semanticListCount+=1);let i=n.list?{numId:n.list.numId,level:Math.min(n.list.level+1,8)}:{numId:Qp(r,`sem:${r.semanticListCount}`,a),level:0},s={...n,list:i,para:{numPr:{numId:i.numId,ilvl:i.level}}};for(let d of Array.from(e.childNodes)){if(!ii(d))continue;let c=fn(d);c==="li"?eg(d,t+1,s,r,o):(c==="ol"||c==="ul")&&tg(d,t+1,{...n,list:i},r,o);}}function si(e,t,n,r,o,a=false){if(t>r.maxDepth)return;let i=o.length,s=[],d=()=>{s.length>0&&o.push(Zp(n.para,s)),s=[];};for(let c of e){if(r.nodesLeft<=0)break;if(ii(c)){let p=fn(c);if(Gp.has(p)){r.nodesLeft-=1;continue}if(Kv.has(p)){d(),r.nodesLeft-=1,eg(c,t,n,r,o);continue}if(p==="ol"||p==="ul"){d(),tg(c,t,n,r,o);continue}if(p==="table"){d(),ax(c,t,n,r,o);continue}if(Vv.has(p)){d(),r.nodesLeft-=1,si(Array.from(c.childNodes),t+1,n,r,o);continue}}Al(c,t,n,s,r);}d(),a&&o.length===i&&o.push(Zp(n.para,[]));}var jp=9360;function rx(e){return Array.from(e.children).flatMap(t=>{let n=fn(t);return n==="tr"?[t]:n!=="thead"&&n!=="tbody"&&n!=="tfoot"?[]:Array.from(t.children).filter(r=>fn(r)==="tr")})}function El(e,t,n){let r=e.getAttribute(t);return r===null||!/^\d{1,4}$/.test(r.trim())?1:Dn(Number.parseInt(r,10),1,n)}function ox(e,t){let n=e.getAttribute("border");if(n!==null&&n.trim()!=="0"&&n.trim()!=="")return true;let r=t.get("border")??t.get("border-width");if(r===void 0)return false;let o=r.toLowerCase();return !(o.includes("none")||o.includes("hidden")||/^0(px)?$/.test(o))}function ax(e,t,n,r,o){if(r.nodesLeft<=0||t>r.maxDepth)return;r.nodesLeft-=1;let a=rx(e);if(a.length===0)return;let i=1;for(let F of a){let T=0;for(let P of Array.from(F.children))/^t[dh]$/.test(fn(P))&&(T+=El(P,"colspan",63));i=Math.max(i,T);}i=Math.min(i,63);let s=Math.floor(jp/i),d=Dr(e),c=["top","left","bottom","right","insideH","insideV"].map(F=>`<w:${F} w:val="single" w:sz="4" w:space="0" w:color="auto"/>`).join(""),p=ox(e,d)?`<w:tblBorders>${c}</w:tblBorders>`:"",b=Array.from({length:i},()=>`<w:gridCol w:w="${s}"/>`).join(""),x=new Array(i).fill(null),w=[];for(let F of a){if(r.nodesLeft<=0)break;r.nodesLeft-=1;let T=Array.from(F.children).filter(N=>/^t[dh]$/.test(fn(N))),P=0,B=[],h=0;for(;h<i&&(r.nodesLeft-=1,!(r.nodesLeft<=0));){let N=x[h];if(N){let M=N.span,G=M>1?`<w:gridSpan w:val="${M}"/>`:"";B.push(`<w:tc><w:tcPr><w:tcW w:w="${s*M}" w:type="dxa"/>${G}<w:vMerge/></w:tcPr><w:p/></w:tc>`),N.remaining-=1,N.remaining<=0&&(x[h]=null),h+=M;continue}let A=T[P];if(A===void 0){B.push(`<w:tc><w:tcPr><w:tcW w:w="${s}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`),h+=1;continue}P+=1;let $=Math.min(El(A,"colspan",63),i-h),j=El(A,"rowspan",1e3);j>1&&(x[h]={remaining:j-1,span:$}),B.push(ix(A,$,s,j>1,t,n,r)),h+=$;}w.push(`<w:tr>${B.join("")}</w:tr>`);}o.push(`<w:tbl><w:tblPr><w:tblW w:w="${jp}" w:type="dxa"/>${p}</w:tblPr><w:tblGrid>${b}</w:tblGrid>${w.join("")}</w:tbl>`);}function ix(e,t,n,r,o,a,i){let s=fn(e)==="th",d=Dr(e),c=`<w:tcW w:w="${n*t}" w:type="dxa"/>`;t>1&&(c+=`<w:gridSpan w:val="${t}"/>`),r&&(c+='<w:vMerge w:val="restart"/>');let p=d.get("background-color");if(p!==void 0){let F=Ol(p);F&&(c+=`<w:shd w:val="clear" w:color="auto" w:fill="${F}"/>`);}let b=d.get("vertical-align")?.toLowerCase()??e.getAttribute("valign")?.toLowerCase();b==="top"?c+='<w:vAlign w:val="top"/>':b==="middle"||b==="center"?c+='<w:vAlign w:val="center"/>':b==="bottom"&&(c+='<w:vAlign w:val="bottom"/>');let x={run:s?{...a.run,bold:true}:a.run,para:s?{jc:"center"}:{},pre:false,list:null},w=[];return si(Array.from(e.childNodes),o+2,x,i,w,true),(w.length===0||w[w.length-1].endsWith("</w:tbl>"))&&w.push("<w:p/>"),`<w:tc><w:tcPr>${c}</w:tcPr>${w.join("")}</w:tc>`}var Kp=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}];function sx(e,t){let r=`<w:pPr><w:ind w:left="${720*(t+1)}" w:hanging="360"/></w:pPr>`;if(e==="bullet"){let o=Kp[t%Kp.length];return `<w:lvl w:ilvl="${t}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${chunk35MI6K7M_cjs.N(o.text)}"/><w:lvlJc w:val="left"/>${r}<w:rPr><w:rFonts w:ascii="${o.font}" w:hAnsi="${o.font}" w:hint="default"/></w:rPr></w:lvl>`}return `<w:lvl w:ilvl="${t}"><w:start w:val="1"/><w:numFmt w:val="decimal"/><w:lvlText w:val="%${t+1}."/><w:lvlJc w:val="left"/>${r}</w:lvl>`}function lx(e){let t=e.map((r,o)=>{let a=Array.from({length:9},(i,s)=>sx(r.kind,s)).join("");return `<w:abstractNum w:abstractNumId="${o}"><w:multiLevelType w:val="hybridMultilevel"/>${a}</w:abstractNum>`}).join(""),n=e.map((r,o)=>`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${o}"/></w:num>`).join("");return `${oi}<w:numbering xmlns:w="${Up}">${t}${n}</w:numbering>`}function Vp(e){let t=e.map(n=>`<Relationship Id="${chunk35MI6K7M_cjs.N(n.id)}" Type="${chunk35MI6K7M_cjs.N(n.type)}" Target="${chunk35MI6K7M_cjs.N(n.target)}"${n.external?' TargetMode="External"':""}/>`).join("");return `${oi}<Relationships xmlns="${Bv}">${t}</Relationships>`}function dx(e,t){let n=new Map,r=e.lists.size>0;r&&Ml(e,`${Zo}/numbering`,"numbering.xml",false);let o=`${oi}<w:document xmlns:w="${Up}" xmlns:r="${Zo}" xmlns:wp="${Hv}" xmlns:a="${_v}" xmlns:pic="${Wp}"><w:body>${t.join("")}</w:body></w:document>`;n.set("word/document.xml",chunk35MI6K7M_cjs.Fa(o)),n.set("word/_rels/document.xml.rels",chunk35MI6K7M_cjs.Fa(Vp(e.rels)));let a={id:"rId1",type:`${Zo}/officeDocument`,target:"word/document.xml",external:false};n.set("_rels/.rels",chunk35MI6K7M_cjs.Fa(Vp([a]))),r&&n.set("word/numbering.xml",chunk35MI6K7M_cjs.Fa(lx([...e.lists.values()])));for(let[d,c]of e.media)n.set(d,c);let i=`<Default Extension="rels" ContentType="${$v}"/><Default Extension="xml" ContentType="application/xml"/>`;for(let[d,c]of e.mediaExtensions)i+=`<Default Extension="${d}" ContentType="${c}"/>`;let s=`<Override PartName="/word/document.xml" ContentType="${Zv}"/>`+(r?`<Override PartName="/word/numbering.xml" ContentType="${zv}"/>`:"");return n.set("[Content_Types].xml",chunk35MI6K7M_cjs.Fa(`${oi}<Types xmlns="${qv}">${i}${s}</Types>`)),chunk35MI6K7M_cjs.Ia(n)}function ng(e,t={}){let n=t.maxHtmlBytes??Mv;if(e.length>n)return {ok:false,reason:"too-large"};if(e.length*3>n&&new TextEncoder().encode(e).byteLength>n)return {ok:false,reason:"too-large"};if(typeof DOMParser>"u")return {ok:false,reason:"parse-unavailable"};let r;try{r=new DOMParser().parseFromString(e,"text/html");}catch{return {ok:false,reason:"parse-unavailable"}}let o=r.body;if(!o)return {ok:false,reason:"no-content"};let a={nodesLeft:t.maxNodes??Lv,maxDepth:t.maxDepth??Nv,maxImageBytes:t.maxImageBytes??Dv,rels:[],media:new Map,mediaExtensions:new Map,lists:new Map,semanticListCount:0,imageCount:0,docPrId:0},i=[],s={run:{},para:{},pre:false,list:null};return si(Array.from(o.childNodes),0,s,a,i),i.length===0?{ok:false,reason:"no-content"}:{ok:true,fragmentBytes:dx(a,i),lastMarkCovered:false}}function rg(e,t){let n=()=>t.text.length===0?"none":(e.insertPlainText(t.text),"plain");if(t.forcePlain||!e.richLaneOpen)return n();let r=t.html;if(r===null||r.length===0)return n();let o=Bp(r);if(o&&e.pasteFragment(o.bytes,o.lastMarkCovered))return "fragment";let a=ng(r);return a.ok&&e.pasteFragment(a.fragmentBytes,a.lastMarkCovered)?"external-html":n()}var cx={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function ux(e){return e.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(t,n)=>{if(n.startsWith("#")){let r=n.startsWith("#x")?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return !Number.isFinite(r)||r<0||r>1114111||r>=55296&&r<=57343?t:String.fromCodePoint(r)}return cx[n.toLowerCase()]??t})}var fx=new Set(["script","style"]),px=new Set(["p","div","li","tr","h1","h2","h3","h4","h5","h6","blockquote","section","article","pre","table"]),gx=new Set(["td","th"]),og=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),mx=e=>og(e)||e!==void 0&&e>="0"&&e<="9",ag=e=>e===" "||e===" "||e===`
|
|
7
|
-
`||e==="\r"||e==="\f";function hx(e,t){let n=t+1,r=e[n]==="/";if(r&&(n+=1),!og(e[n]))return null;let o=n;for(;n<e.length&&mx(e[n]);)n+=1;let a=e.slice(o,n).toLowerCase(),i="",s=false;for(;n<e.length;){let d=e[n];if(i!=="")d===i&&(i="");else if(d==="=")s=true;else if(s&&(d==='"'||d==="'"))i=d,s=false;else {if(d===">")return {name:a,closing:r,end:n+1};ag(d)||(s=false);}n+=1;}return {name:a,closing:r,end:e.length}}function yx(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===9;)t-=1;return t===e.length?e:e.slice(0,t)}function bx(e,t,n){for(let r=n;r<e.length;){let o=e.indexOf("</",r);if(o===-1)return e.length;let a=o+2;if(e.slice(a,a+t.length).toLowerCase()===t){for(a+=t.length;a<e.length&&ag(e[a]);)a+=1;if(e[a]===">")return a+1}r=o+2;}return e.length}function vx(e){let t=e.length>2e6?e.slice(0,2e6):e,n="",r=0;for(;r<t.length;){let o=t.indexOf("<",r);if(o===-1){n+=t.slice(r);break}if(n+=t.slice(r,o),t.startsWith("<!--",o)){if(t[o+4]===">"){r=o+5;continue}if(t[o+4]==="-"&&t[o+5]===">"){r=o+6;continue}let i=t.indexOf("-->",o+4);r=i===-1?t.length:i+3;continue}if(t[o+1]==="!"||t[o+1]==="?"){let i=t.indexOf(">",o+1);r=i===-1?t.length:i+1;continue}let a=hx(t,o);if(a===null){n+="<",r=o+1;continue}r=a.end,!a.closing&&fx.has(a.name)?r=bx(t,a.name,a.end):!a.closing&&a.name==="br"?n+=`
|
|
8
|
-
`:a.closing&&gx.has(a.name)?n+=" ":a.closing&&px.has(a.name)&&(n+=`
|
|
9
|
-
`);}return ux(n).replace(/\r\n?/g,`
|
|
10
|
-
`).split(`
|
|
11
|
-
`).map(yx).join(`
|
|
12
|
-
`).replace(/\n{3,}/g,`
|
|
13
|
-
|
|
14
|
-
`).trim()}function ig(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r===12){t+=`
|
|
15
|
-
`;continue}if(r===13){t+=`
|
|
16
|
-
`,e.charCodeAt(n+1)===10&&(n+=1);continue}if(r===9||r===10){t+=e[n];continue}if(!(r<32||r===65534||r===65535)){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}function Ll(e){if(!e)return "";let t=e.getData("text/plain");if(t.length>0)return t;let n=e.getData("text/html");return n.length>0?vx(n):""}function xx(e,t){let n=Math.max(0,e.end-e.start);return e.start+Math.max(0,Math.min(t,n))}var cg=/^[^\s]{1,512}$/,Ix=/["\\\u0000-\u001f\u007f]/;function li(e){let t=e.dataset?.paragraphId,n=e.dataset?.start;if(!t||n===void 0||!/^\d{1,9}$/.test(n)||!cg.test(t)||t==="__proto__")return null;let r=Number(n),o=e.dataset?.end,a=o!==void 0&&/^\d{1,9}$/.test(o)&&Number(o)>=r?Number(o):r+(e.textContent?.length??0);return {paragraphId:t,start:r,end:a}}function zo(e,t,n){return Ix.test(t)?e.querySelectorAll(`[data-paragraph-id]${n}`):e.querySelectorAll(`[data-paragraph-id="${t}"]${n}`)}function ug(e){let t=e.nodeType===Node.TEXT_NODE?e.parentNode:e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=li(t);if(n)return {element:t,identity:n};t=t.parentNode;}return null}function fg(e){return e.querySelector("[data-docx-hf-active]")}function rr(e,t){if(!e||t&&!t.contains(e))return;let o=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest("[data-page-index]")?.dataset?.pageIndex;if(!(o===void 0||!/^\d{1,9}$/.test(o)))return Number(o)}function Sx(e,t){return t===void 0||!Number.isInteger(t)||t<0?null:e.querySelector(`[data-page-index="${t}"]`)}function Nl(e,t){let n=fg(e);if(n)return [n,e];let r=Sx(e,t);return r&&r!==e?[r,e]:[e]}function sg(e,t){let n=ug(e);if(n)return n;if(e.nodeType!==Node.ELEMENT_NODE)return null;let r=e.querySelectorAll("[data-paragraph-id][data-start]"),o=t?[...r].reverse():[...r];for(let a of o){let i=li(a);if(i)return {element:a,identity:i}}return null}function kx(e,t){let n=[...e.childNodes];if(n.length===0)return null;for(let r=Math.max(0,t);r<n.length;r+=1){let o=sg(n[r],false);if(o)return {paragraphId:o.identity.paragraphId,offset:o.identity.start}}for(let r=Math.min(t,n.length)-1;r>=0;r-=1){let o=sg(n[r],true);if(o)return {paragraphId:o.identity.paragraphId,offset:o.identity.end}}return null}function lg(e,t,n){if(!n.contains(e))return null;let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(r?.closest("[data-docx-field]"))return null;let o=r?.closest("[data-docx-hf]");if(o&&!o.hasAttribute("data-docx-hf-active")||fg(n)&&r?.closest(".docx-page-content"))return null;let a=r?.closest("[data-docx-marker]");if(a)return a.parentElement?pg(a.parentElement):null;if(r?.closest("[data-docx-tab-leader]"))return null;if(e.nodeType===Node.ELEMENT_NODE){let s=e,d=li(s);if(d)return {paragraphId:d.paragraphId,offset:t>0?d.end:d.start};let c=kx(s,t);return c||Cx(s)}let i=ug(e);return i?{paragraphId:i.identity.paragraphId,offset:xx(i.identity,t)}:null}function Hr(e,t){if(!t||t.rangeCount===0)return null;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:a}=t;if(!n||!o)return null;let i=lg(n,r,e),s=lg(o,a,e);if(!i||!s){let d=i??s;return d?{anchor:d,head:d}:null}return {anchor:i,head:s}}function Dl(e,t){if(!t||t.rangeCount===0)return false;let{anchorNode:n,focusNode:r}=t;return !!n&&e.contains(n)||!!r&&e.contains(r)}function dg(e,t,n){for(let r of Nl(e,n)){let o=wx(r,t);if(o)return o}return null}function wx(e,t){let n=zo(e,t.paragraphId,"[data-start]"),r=null,o=false;for(let i of n){let s=li(i);if(!s||s.paragraphId!==t.paragraphId)continue;let d=Tx(i),c=i.textContent?.length??0,p=s.end;if(d&&!i.closest?.("[data-docx-field]")&&(o=true,t.offset>=s.start&&t.offset<=p)){let b={node:d,offset:Math.min(t.offset-s.start,c)};if(t.offset<p)return b;r=b;}}if(r)return r;if(o)return null;let a=Px(e,t.paragraphId);return a?{node:a,offset:0}:null}function Tx(e){let t=e.firstChild;for(;t&&t.nodeType===Node.ELEMENT_NODE;)t=t.firstChild;return t&&t.nodeType===Node.TEXT_NODE?t:null}function Px(e,t){let n=null;for(let r of zo(e,t,""))if(r.dataset?.paragraphId===t&&r.dataset?.start===void 0){if(r.dataset?.lineId!==void 0)return r;n??=r;}return n}function pg(e){let t=e.closest("[data-paragraph-id]");if(!t||t.dataset.start!==void 0)return null;let n=t.dataset.paragraphId;return !n||!cg.test(n)||n==="__proto__"?null:{paragraphId:n,offset:0}}function Cx(e){let t=pg(e);return !t||e.closest("[data-paragraph-id]").querySelector("[data-paragraph-id][data-start]")?null:t}function gg(e,t,n,r){if(!n)return false;let o=r?.preferredPageIndex??rr(n.anchorNode,e),a=dg(e,t.anchor,o),i=dg(e,t.head,o);if(!a||!i)return false;let s=Hr(e,n);if(s&&Ht(s,t)){let d=rr(n.anchorNode,e);if(o===void 0||d===o)return true}try{return n.setBaseAndExtent(a.node,a.offset,i.node,i.offset),!0}catch{return false}}function Ht(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}var Rx='[data-docx-marker],[data-docx-tab-leader],[aria-hidden="true"],[contenteditable="false"],[data-drawing-node-id]';function mg(e,t,n){let r=e.dataset.end;if(r===void 0||!/^\d{1,9}$/.test(r))return n;let o=Number(r);return o>=t?o:n}function hg(e,t){if(e.dataset.paragraphId!==t)return null;let n=e.dataset.start;return n===void 0||!/^\d{1,9}$/.test(n)?null:Number(n)}function Ex(e){return e?(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".docx-page")??null:null}function Ox(e,t,n){return t&&e.contains(t)?2:n?.contains(e)?1:0}function yg(e,t,n,r){if(e.dataset.docxField!==void 0){let a=mg(e,t,t);return {start:t,end:a,text:n.slice(t,a),seq:r}}let o=e.textContent??"";return {start:t,end:mg(e,t,t+o.length),text:o,seq:r}}function bg(e,t){for(let n of e.childNodes){if(n.nodeType===Node.TEXT_NODE){let s=n.textContent??"";s.length>0&&(t.pieces.push({start:t.end,end:t.end,text:s,seq:t.seq}),t.seq+=1);continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;let r=n,o=hg(r,t.paragraphId);if(o===null){if(r.dataset?.start!==void 0||r.matches?.(Rx))continue;bg(r,t);continue}let a=yg(r,o,t.modelText,t.seq);t.seq+=1,t.end=Math.max(t.end,a.end);let i=`${a.start}:${a.end}`;t.ranges.has(i)||(t.ranges.add(i),t.pieces.push(a));}}function Fx(e,t,n,r){let o=[];for(let i of zo(e,t,"")){let s=i;s.dataset.paragraphId===t&&s.dataset.start===void 0&&(o.some(d=>d.contains(s))||o.push(s));}let a=new Map;for(let i of o){let s=i.dataset.fragmentIndex??"",d=Ox(i,n,r),c=a.get(s);(!c||d>c.affinity)&&a.set(s,{element:i,affinity:d});}return [...a.values()].map(i=>i.element)}function Ax(e,t,n){for(let r of zo(e,n.paragraphId,"[data-start]")){let o=r,a=hg(o,n.paragraphId);if(a===null||t.some(d=>d.contains(o)))continue;let i=yg(o,a,n.modelText,n.seq);n.seq+=1;let s=`${i.start}:${i.end}`;n.ranges.has(s)||(n.ranges.add(s),n.pieces.push(i));}}function Mx(e,t){let n=[...e].sort((a,i)=>a.start-i.start||a.seq-i.seq),r="",o=0;for(let a of n)a.start>o&&(r+=t.slice(o,a.start)),r+=a.text,o=Math.max(o,a.end);return o<t.length&&(r+=t.slice(o)),r}function vg(e,t,n,r){let o=Fx(e,t,r,Ex(r)),a={paragraphId:t,modelText:n,pieces:[],ranges:new Set,end:0,seq:0};for(let i of o)bg(i,a);return Ax(e,o,a),a.pieces.length===0?null:Mx(a.pieces,n)}var Lx={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"lineStart",End:"lineEnd"},xg={l:"left",e:"center",r:"right",j:"both"},Ig={1:"240",5:"360",2:"480"},Sg={b:{localName:"b"},i:{localName:"i"},u:{localName:"u",attributes:{val:"single"}}};function wg(e,t={}){return n=>{if(n.defaultPrevented)return;if(n.key==="Escape"&&e.activeScope().kind==="headerFooter"){e.exitHeaderFooter(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="note"){e.exitNote(),n.preventDefault();return}if((n.ctrlKey||n.metaKey)&&n.altKey&&!n.shiftKey){let a=n.key.toLowerCase();if(a==="f"){n.preventDefault(),e.insertNote("footnote");return}if(a==="d"){n.preventDefault(),e.insertNote("endnote");return}}let r=n.metaKey||n.ctrlKey,o=Lx[n.key];if(o){let a=o;n.key==="Home"||n.key==="End"?r&&(a=n.key==="Home"?"documentStart":"documentEnd"):(n.key==="ArrowLeft"||n.key==="ArrowRight")&&(n.altKey||n.ctrlKey)?a=n.key==="ArrowLeft"?"wordLeft":"wordRight":n.metaKey&&(n.key==="ArrowLeft"||n.key==="ArrowRight")?a=n.key==="ArrowLeft"?"lineStart":"lineEnd":r&&(n.key==="ArrowUp"||n.key==="ArrowDown")&&(a=n.key==="ArrowUp"?"documentStart":"documentEnd"),e.navigate(a,n.shiftKey),n.preventDefault();return}if(n.key==="PageUp"||n.key==="PageDown"){e.navigate(r?n.key==="PageUp"?"documentStart":"documentEnd":n.key==="PageUp"?"pageUp":"pageDown",n.shiftKey),n.preventDefault();return}if(n.key==="Backspace"){r||n.altKey?e.deleteWordBackward():e.deleteBackward(),n.preventDefault();return}if(n.key==="Delete"){r||n.altKey?e.deleteWordForward():e.deleteForward(),n.preventDefault();return}if(n.key==="Tab"){if(e.contentControls.formFill()&&e.contentControls.navigate(n.shiftKey?"previous":"next")){n.preventDefault();return}e.isListParagraph()?e.adjustIndent(n.shiftKey?"decrease":"increase"):n.shiftKey?e.adjustIndent("decrease"):e.insertTab(),n.preventDefault();return}if(n.key==="Enter"){r?e.insertPageBreak():n.shiftKey?e.insertLineBreak():e.exitListOnEmptyItem()||e.splitParagraph(),n.preventDefault();return}if(r&&n.key.toLowerCase()==="a"){e.selectAll(),n.preventDefault();return}if(r&&n.shiftKey&&n.key.toLowerCase()==="v"){e.armForcePlainPaste();return}if(r&&!n.shiftKey&&n.key.toLowerCase()==="k"&&t.onRequestHyperlink){t.onRequestHyperlink(),n.preventDefault();return}if(r&&!n.shiftKey&&Sg[n.key.toLowerCase()]){let a=Sg[n.key.toLowerCase()];e.toggleRunProperty(a.localName,a.attributes),n.preventDefault();return}if(r&&(n.key==="="||n.key==="+"||n.code==="Equal")){e.toggleRunProperty("vertAlign",{val:n.shiftKey?"superscript":"subscript"}),n.preventDefault();return}if(r&&n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("decrease"),n.preventDefault();return}if(r&&!n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("increase"),n.preventDefault();return}if(r&&!n.shiftKey&&xg[n.key.toLowerCase()]){if(n.metaKey&&n.key.toLowerCase()==="r")return;e.setParagraphProperty("jc",{val:xg[n.key.toLowerCase()]}),n.preventDefault();return}if(r&&!n.shiftKey&&Ig[n.key]){e.setParagraphProperty("spacing",{line:Ig[n.key],lineRule:"auto"},{mergeAttributes:true}),n.preventDefault();return}if(r&&n.key.toLowerCase()==="y"){e.redo(),n.preventDefault();return}(n.metaKey||n.ctrlKey)&&n.key.toLowerCase()==="z"&&(n.shiftKey?e.redo():e.undo(),n.preventDefault());}}function Tg(e){let t=a=>{let i=e.copyFlavours();return i.text?(a.clipboardData?.setData("text/plain",i.text),i.html&&a.clipboardData?.setData("text/html",i.html),true):false};return {onCopy:a=>{t(a)&&a.preventDefault();},onCut:a=>{t(a)&&(e.deleteSelection(),a.preventDefault());},onPaste:a=>{let i=Ll(a.clipboardData),s=a.clipboardData?.getData("text/html")??"";a.preventDefault(),!(!i&&!s)&&e.pasteRich(i,s.length>0?s:null);}}}function kg(e){let t=Ll(e.dataTransfer);return t.length>0?t:null}function Pg(e,t){return n=>{if(n.preventDefault(),!t.isComposing()){if(n.inputType==="insertText"&&n.data!=null){e.enqueueType(n.data);return}if(n.inputType!=="insertFromPaste"){if(n.inputType==="insertReplacementText"){let r=n.data??kg(n);if(!r)return;_x(e,Dx(n),r),t.onBrowserSelectionFixup?.();return}if(n.inputType==="deleteContentBackward"){e.deleteBackward();return}if(n.inputType==="deleteWordBackward"){e.deleteWordBackward();return}if(n.inputType==="deleteContentForward"){e.deleteForward();return}if(n.inputType==="deleteWordForward"){e.deleteWordForward();return}if(n.inputType==="insertLineBreak"){e.insertLineBreak();return}if(n.inputType==="insertFromDrop"||n.inputType==="insertFromPasteAsQuotation"){let r=kg(n);r&&t.insertPlainText(r);return}n.inputType==="insertParagraph"&&e.splitParagraph();}}}}function Nx(e){let{startContainer:t,endContainer:n}=e;if(t===n&&t.nodeType===Node.TEXT_NODE)return (t.textContent??"").slice(e.startOffset,e.endOffset);let r=t.ownerDocument;if(!r)return null;try{let o=r.createRange();return o.setStart(t,e.startOffset),o.setEnd(n,e.endOffset),o.toString()}catch{return null}}function Dx(e){if(typeof e.getTargetRanges!="function")return null;let t=e.getTargetRanges();if(t.length!==1)return null;let n=t[0],r=Nx(n);return r?{text:r,paragraphId:Hx(n)}:null}function Hx(e){let t=e.startContainer;return t.isConnected?(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement??null)?.closest("[data-paragraph-id]")?.getAttribute("data-paragraph-id")??null:null}function _x(e,t,n){if(t!==null){e.flushPendingInput();let r=e.state(),o=r.selection.head,a=t.text;if(Ht(r.selection,Oe(o))&&o.offset>=a.length&&(t.paragraphId===null||t.paragraphId===o.paragraphId)&&r.pendingFormat===null){let i=en(e.session,o.paragraphId)??e.session.part(),s=chunk35MI6K7M_cjs._f(i,o.paragraphId);s!==null&&s.slice(o.offset-a.length,o.offset)===a&&e.setSelection({anchor:{paragraphId:o.paragraphId,offset:o.offset-a.length},head:o});}}e.type(n);}function Cg(e,t,n,r=null){for(let o of Nl(e)){let a=vg(o,t,n,r);if(a!==null)return a}return null}function Rg(e,t,n){if(n===t)return null;let r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r+=1;let o=0;for(;o<n.length-r&&o<t.length-r&&n[n.length-1-o]===t[t.length-1-o];)o+=1;let a=n.slice(r,n.length-o),i=[];return t.length-o>r&&i.push({op:"deleteText",paragraphId:e,start:r,end:t.length-o}),a.length>0&&i.push({op:"insertText",paragraphId:e,offset:r,text:a}),i.length===0?null:{ops:i,caret:r+a.length}}function Eg(e){return {atParagraphEnd(t,n){let r=chunk35MI6K7M_cjs._f(e.partOf(t),t);return r!==null&&n===r.length},followerStyleId(t){let n=e.partOf(t),r=e.styleCascade();if(!r)return;let a=chunk35MI6K7M_cjs.Eg(n,t).find(d=>d.localName==="pStyle")?.attributes?.val??r.defaultParagraphStyleId;if(a==null)return;let i=r.styles.get(a)?.next;if(!i||i===a)return;let s=r.styles.get(i);if(!(!s||s.type!=="paragraph"))return i===r.defaultParagraphStyleId?null:i}}}function Hl(e){let{session:t,measurer:n,producer:r,cache:o,styleCascade:a,numberingIndex:i,defaultTabStopPt:s,displayMode:d,inlineDrawingLayoutForPart:c,drawingLayoutTokenForPart:p,drawingTokenForParagraphForPart:b}=e,x=new WeakMap,w=null,F=-1;function T($){let j=t.packageRevision();return (!w||F!==j)&&(w=Zx(t.currentPackage()),F=j),w.get($)}function P($,j,M){let G=p?.($.name)??"",S=M?.height??0,E=M?.margin.top??0,Z=M?.margin.bottom??0,k=M?.margin.left??0,O=M?.margin.right??0,U=i?.(),K=a?.(),X=x.get($);if(X&&X.width===j&&X.pageHeight===S&&X.marginTop===E&&X.marginBottom===Z&&X.marginLeft===k&&X.marginRight===O&&X.producer===r&&X.drawingLayoutToken===G&&X.numberingIndex===U&&X.styleCascade===K)return X.story;let ce=c?.($.name),we=chunk6K6QQVAZ_cjs.Vc($,j,n,r,o,K,void 0,void 0,s,d,ce,b?fe=>b($.name,fe):void 0,void 0,M?{pageNumber:1,pageWidth:M.width,pageHeight:M.height,marginLeft:M.margin.left,marginRight:M.margin.right,marginTop:M.margin.top,marginBottom:M.margin.bottom}:void 0,t.documentProperties(),U?{numberingIndex:U}:void 0),me=T($.name),he=me?Og(we,me):we;return x.set($,{width:j,pageHeight:S,marginTop:E,marginBottom:Z,marginLeft:k,marginRight:O,producer:r,drawingLayoutToken:G,numberingIndex:U,styleCascade:K,story:he}),he}function B($,j,M){let G=new Map;for(let[S,E]of $)G.set(S,P(E,j,M));return G}function h($,j){if(!$||$.headers.size===0&&$.footers.size===0)return;let M=j.width-j.margin.left-j.margin.right;return {titlePage:$.titlePage,evenAndOddHeaders:$.evenAndOddHeaders,headers:B($.headers,M,j),footers:B($.footers,M,j)}}function N(){let $=chunk6K6QQVAZ_cjs.dd(t.part(),d),j=t.headerFooterPartsBySection();return $.map((M,G)=>h(j[G],chunk6K6QQVAZ_cjs.fd(M.properties)))}function A(){let $=N();return $[$.length-1]}return {furniture:A,sectionFurniture:N}}var Bx="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",qx="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";function Zx(e){let t=new Map,n=e.relationships.get(e.mainDocumentPart)??[];for(let r of n){if(r.type!==Bx&&r.type!==qx)continue;let o=chunk35MI6K7M_cjs.E(r);if(o.mode!=="Internal"||!o.target.ok)continue;let a=o.target.partName;t.has(a)||t.set(a,r.id);}return t}function Og(e,t){return e.rId===t?e:{...e,rId:t,withPageContext:n=>Og(e.withPageContext(n),t)}}function Fg(e){let t,n,r,o;return {styleCascade(){let a=e.stylesRoot();return (o===void 0||a!==r)&&(r=a,o=chunk6K6QQVAZ_cjs.Hb(a,e.documentThemeFonts())),o},defaultTabStopPt:chunk6K6QQVAZ_cjs.Sa(e.settingsRoot()),numberingIndex(){let a=e.numberingRoot();return (n===void 0||a!==t)&&(t=a,n=chunk6K6QQVAZ_cjs.hc(a)),n}}}function Rt(e){return e.closest(".docx-editor__scroll-container")}function Ag(e,t,n){let r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return {top:(t.scrollTop!==0&&r.top===0&&o.top===0?t.scrollTop-e.offsetTop:o.top+t.clientTop-r.top)/n,height:t.clientHeight/n}}function Mg(e,t,n){let r=Rt(e);if(!r||r.clientHeight<=0||t.pages.length===0||n<=0)return null;let o=Ag(e,r,n),a=o.top+o.height/2;for(let i of t.pages)if(a<i.box.y+i.box.height)return i.index+1;return t.pages.length}function Lg(e,t,n,r){let o=Rt(e);if(!o||o.clientHeight===0)return;let a=Ag(e,o,r),i=[];for(let s of [n.anchor,n.head]){let d=chunk6K6QQVAZ_cjs.$d(t,s);d&&i.push(d.pageIndex);}return chunk6K6QQVAZ_cjs.Rd({layout:t,viewport:a,overscanPages:1,pinnedPages:i})}function _l(e,t){if(e===t)return true;if(!e||!t||e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function di(e,t){let n=e.pages,r=n[n.length-1],o=r?r.box.y+r.box.height:0,a=t?n.filter(c=>t.has(c.index)):n,i=0;for(let c of a){let p=c.box.x+c.box.width;p>i&&(i=p);}let s=new Set(a.map(c=>c.box.width)),d=new Map;if(a.length>0&&s.size>1)for(let c of n)d.set(c.index,(i-c.box.width)/2-c.box.x);return {width:i,height:o,pageOffsetX:d}}function Ng(e,t){if(e.width!==t.width||e.height!==t.height||e.pageOffsetX.size!==t.pageOffsetX.size)return false;for(let[n,r]of e.pageOffsetX)if(t.pageOffsetX.get(n)!==r)return false;return true}function Dg(e){let t=e.session.currentPackage(),n=chunk35MI6K7M_cjs.ge(t,"footnote"),r=chunk35MI6K7M_cjs.ge(t,"endnote");if(!n&&!r)return;let o=e.session.part();if(chunk35MI6K7M_cjs.he(o).length===0)return;let a=chunk35MI6K7M_cjs.Md(t),i=chunk35MI6K7M_cjs.Nd(a),s=chunk35MI6K7M_cjs.Od(a),d=chunk35MI6K7M_cjs.Pd(void 0,i),c=chunk35MI6K7M_cjs.Qd(void 0,s),p=chunk6K6QQVAZ_cjs.ed(o),b=p.sections,x=zx(o,b,p.truncated),w=b.map((h,N)=>chunk35MI6K7M_cjs.Pd(chunk35MI6K7M_cjs.Kd(x[N]),i)),F=b.map((h,N)=>chunk35MI6K7M_cjs.Qd(chunk35MI6K7M_cjs.Ld(x[N]),s)),T=e.inlineDrawingLayoutForPart,P=e.drawingTokenForParagraphForPart,B=T?h=>{let N=T(h);if(N)return {inlineDrawingLayout:N,...P?{drawingTokenForParagraph:A=>P(h,A)}:{}}}:void 0;return {footnotesPart:n,endnotesPart:r,footnotePropsBySection:w.length>0?w:[d],endnotePropsBySection:F.length>0?F:[c],documentFootnoteProps:d,documentEndnoteProps:c,measurer:e.measurer,producer:e.producer,cache:e.cache,styleCascade:e.styleCascade?.(),numberingIndex:e.numberingIndex?.(),defaultTabStopPt:e.defaultTabStopPt,...B?{drawingsForPart:B}:{},...B&&e.drawingLayoutEpochForPart?{drawingLayoutEpoch:[n,r].map(h=>h?e.drawingLayoutEpochForPart(h.name):"").join("\0")}:{}}}function zx(e,t,n){let r=chunk6K6QQVAZ_cjs.Pb(e);if(!n)return t.map(a=>{if(a.blockStart===a.blockEndExclusive)return;let i=r[a.blockEndExclusive-1];return i?.kind==="paragraph"?chunk6K6QQVAZ_cjs.bd(i):void 0});let o=[];for(let a=0;a<r.length;a+=1){let i=r[a];if(i.kind!=="paragraph")continue;let s=chunk6K6QQVAZ_cjs.bd(i);s&&o.push(s);}for(;o.length<t.length;)o.push(void 0);return o}function _g(e){if(typeof e.defaultView?.createImageBitmap!="function")return null;let t=e.defaultView;return Object.freeze({async decode(n,r,o){let a=new Blob([new Uint8Array(n)],{type:r}),i=await t.createImageBitmap(a);try{let s=i.width,d=i.height;if(s<=0||d<=0)throw new Error("image dimensions invalid");if(s*d>o.maxPixels)throw new Error("image dimensions exceed limits");return Object.freeze({pixelWidth:s,pixelHeight:d,dpiX:96,dpiY:96})}finally{i.close();}},convertPreserved(n,r,o){return r==="image/tiff"?Kx(e,n,o):$x(n,r)}})}async function $x(e,t,n){let{convertEmfToDataUrl:r,convertWmfToDataUrl:o}=await import('emf-converter'),a=new Uint8Array(e),i=a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),s={maxWidth:4096,maxHeight:4096},d=t==="image/x-emf"?await r(i,s):await o(i,s);if(!d)return null;let c="data:image/png;base64,";if(!d.startsWith(c))return null;let p=atob(d.slice(c.length)),b=new Uint8Array(p.length);for(let x=0;x<p.length;x+=1)b[x]=p.charCodeAt(x);return Object.freeze({bytes:b,mime:"image/png"})}function Hg(e,t){let n=e[t];if(!Array.isArray(n)||n.length===0)return null;let r=Number(n[0]);return Number.isSafeInteger(r)&&r>0?r:null}async function jx(e,t){let n=await import('utif2'),r=n.default??n,o=e.slice().buffer,a=r.decode(o)[0];if(!a)return null;let i=Hg(a,"t256"),s=Hg(a,"t257");if(i===null||s===null||i>t.maxDimension||s>t.maxDimension||i>t.maxPixels/s)return null;let d=i*s;if(d*4>t.maxDecodedBytes||(r.decodeImage(o,a),a.width!==i||a.height!==s))return null;let c=r.toRGBA8(a);return c.length!==d*4?null:Object.freeze({rgba:c,pixelWidth:i,pixelHeight:s})}async function Kx(e,t,n){let r=await jx(t,n);if(r===null)return null;let o=await Vx(e,r.rgba,r.pixelWidth,r.pixelHeight);return o===null?null:Object.freeze({bytes:o,mime:"image/png"})}async function Vx(e,t,n,r){let o=e.createElement("canvas");if(o.width=n,o.height=r,o.width!==n||o.height!==r)return null;let a=o.getContext("2d");if(!a)return null;let i=a.createImageData(n,r);i.data.set(t),a.putImageData(i,0,0);let s=await new Promise(d=>{o.toBlob(c=>d(c),"image/png");});return s?new Uint8Array(await s.arrayBuffer()):null}function Bg(){return Object.freeze({async decode(){throw new Error("Image decode unavailable in headless environment")}})}function qg(e){return typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function"?null:Object.freeze({create(t,n){let r=e.mintValidatedBytes(t,t.contentId);if(!r)throw new Error(`PaintImageUrlSource: validated bytes unavailable for ${t.resourceKey}`);let o=new Uint8Array(r);return URL.createObjectURL(new Blob([o],{type:n}))},revoke(t){URL.revokeObjectURL(t);}})}var Ux="docx-editor-one-surface__caret",Bl="docx-editor-one-surface__caret--steady",Wx=530;function Zg(e,t,n){let r=e.ownerDocument,o=r.createElement("div");o.className=Ux,o.dataset.docxCaret="",o.dataset.docxMarker="",o.setAttribute("contenteditable","false"),o.setAttribute("aria-hidden","true"),o.dataset.noColorInvert="",o.style.position="absolute",o.style.pointerEvents="none",o.style.userSelect="none",o.style.setProperty("-webkit-user-select","none");let a=false,i=null,s=null,d=null;function c(){let h=r.activeElement;return h===e||!!h&&e.contains(h)}function p(h){return h.anchor.paragraphId===h.head.paragraphId&&h.anchor.offset===h.head.offset}function b(){s=null,i!==null&&(clearTimeout(i),i=null),o.classList.remove(Bl),o.remove(),e.style.removeProperty("caret-color"),d?.style.removeProperty("caret-color"),d=null;}function x(){o.classList.add(Bl),i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,o.classList.remove(Bl);},Wx);}function w(){if(a||!c()||n().suppress){b();return}let{layout:h,selection:N,scopedHost:A,scopedHostKind:$,preferredPageIndex:j,measurer:M}=n(),G=t();if(!p(N)){b();return}let S=chunk6K6QQVAZ_cjs.$d(h,N.head,{...M?{measurer:M}:{},...j!==void 0?{preferredPageIndex:j}:{}});if(!S||!Number.isInteger(S.pageIndex)){b();return}let E=A??e.querySelector(`[data-page-index="${S.pageIndex}"] > .docx-page-content`);if(!E){b();return}o.style.left=`${S.x*G}px`,o.style.top=`${S.y*G}px`,o.style.height=`${S.height*G}px`,o.parentNode!==E&&E.append(o),e.style.caretColor="transparent",d&&d!==A&&d.style.removeProperty("caret-color"),d=A??null,d?.style.setProperty("caret-color","transparent");let Z=E===A?$??"scoped":"body",k=`${S.pageIndex}:${Z}:${S.x}:${S.y}:${S.height}`;k!==s&&(s=k,x());}let F=()=>{a=true,w();},T=()=>{a=false,w();},P=()=>w(),B=h=>{let N=h.relatedTarget;N&&e.contains(N)||b();};return e.addEventListener("compositionstart",F),e.addEventListener("compositionend",T),e.addEventListener("focusin",P),e.addEventListener("focusout",B),{update:w,destroy(){e.removeEventListener("compositionstart",F),e.removeEventListener("compositionend",T),e.removeEventListener("focusin",P),e.removeEventListener("focusout",B),b();}}}function ql(e){let t=e.indexOf("#");return t===-1?"":e.slice(0,t)}function or(e,t){let n=ql(t);return n.length===0?e.part():e.currentPackage().parts.get(n)??e.part()}function Zl(e,t){return !e||e.kind==="tableBody"?null:ql(e.tableId)===ql(t)?e:null}function $o(e,t,n){let r=i=>{for(let s of i)if(s.kind==="table"){if(s.tableId===t)return s;for(let d of s.rows)for(let c of d.cells){let p=r(c.blocks);if(p)return p}}return null},o=e.pages[n];if(!o)return null;let a=r(o.fragments);if(a)return {table:a,origin:o.contentBox};for(let i of [o.header,o.footer]){if(!i)continue;let s=r(i.fragments);if(s)return {table:s,origin:i.box}}return null}function zl(e,t){for(let n of e)if(n.kind==="table"){t(n);for(let r of n.rows)for(let o of r.cells)zl(o.blocks,t);}}function Gx(e,t){for(let n of e.pages){let r=o=>{for(let a=0;a<o.rows.length;a+=1)t({table:o,row:o.rows[a],rowIndex:a});};zl(n.fragments,r);for(let o of [n.header,n.footer])o&&zl(o.fragments,r);}}function $l(e,t,n,r){let o=null;return Gx(e,a=>{a.table.tableId===t&&a.row.id===n&&a.row.isHeaderRepeat===r&&(o=a);}),o}function jl(e,t){return {sourceRevision:e,tableId:t.table.tableId,rowId:t.row.id,isHeaderRepeat:t.row.isHeaderRepeat}}function zg(e,t,n){let r=n.gridColumnId;return r?{sourceRevision:e,tableId:t.table.tableId,gridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}:null}function $g(e,t,n,r){return {sourceRevision:e,tableId:t.table.tableId,leftGridColumnId:n,rightGridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}}function jg(e,t,n){return {sourceRevision:e,tableId:t.table.tableId,gridColumnId:n,isHeaderRepeat:t.row.isHeaderRepeat}}var Xx=120,Kg=20;function ci(e){let t=chunk35MI6K7M_cjs.Ff(e,"w"),n=t?Number.parseInt(t,10):Number.NaN;return Number.isFinite(n)?n:0}function Yx(e,t,n){let r=e.pagesLayer.getBoundingClientRect(),o=e.scale();return {x:(t-r.left)/o,y:(n-r.top)/o}}function Kl(e){let t=e.editingMode==="view";return {editable:!t,viewing:t}}function Vl(e,t){return t.kind==="insertColumn"?$l(e,t.tableId,t.rowId,t.isHeaderRepeat):"rowId"in t?$l(e,t.tableId,t.rowId,t.isHeaderRepeat):null}function Vg(e){let t=e.furnitureLayer;t.className="docx-table-furniture",t.setAttribute("contenteditable","false"),t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.pointerEvents="none";let n=null,r=null,o=null,a=null,i=null,s=null,d=false,c=0,p=0,b=null,x=null,w=null;function F(v){return v instanceof HTMLButtonElement&&(v.classList.contains("docx-table-insert-row")||v.classList.contains("docx-table-insert-column"))}function T(){let v=document.activeElement;return v!==null&&F(v)&&v.closest(".docx-table-furniture")===t?v:null}function P(v){for(let R of [...t.children])F(R)&&R!==v&&R.remove();}function B(){x=null,w=null;}function h(){n!==null&&(clearTimeout(n),n=null);}function N(){for(let R of [...t.children])F(R)||R.remove();let v=T();if(!v){P(null),B();return}x=v,P(v);}function A(v){let R=x??T(),D=R!==null&&document.activeElement===R;B(),t.replaceChildren(),v&&D&&e.pagesLayer.focus({preventScroll:true});}function $(){for(let v of [...t.children])F(v)||v.remove();}function j(v,R,D,W){let V=e.read().layout.pages[v];if(!V)return {left:0,top:0};let re=W??V.contentBox,ie=e.scale(),pe=e.pageOffsetX(v);return {left:(re.x+R+pe)*ie,top:(re.y+D)*ie}}function M(v,R){let D=e.read(),W=$o(D.layout,R.tableId,R.pageIndex);if(!W)return;let{table:ne,origin:V}=W,re=document.createElement("div");re.className="docx-table-resize-preview",re.style.position="absolute",re.style.pointerEvents="none";let ie=R.kind!=="rowDivider",pe=j(R.pageIndex,ie?ne.box.x+v:ne.box.x,ie?ne.box.y:ne.box.y+v,V);re.style.left=`${pe.left}px`,re.style.top=`${pe.top}px`,re.style.width=ie?"2px":`${ne.box.width*e.scale()}px`,re.style.height=ie?`${ne.box.height*e.scale()}px`:"2px",t.append(re);}function G(){let v=document.createElement("button");return v.type="button",v.textContent="+",v.style.position="absolute",v.style.pointerEvents="auto",v}function S(v){O(v);let R=w;if(!R)return;let D=e.read();R.kind==="insertRow"?K(R,D):R.kind==="insertColumn"&&X(R,D);}function E(){queueMicrotask(()=>{!x||document.activeElement===x||d||r?.kind==="insertRow"||r?.kind==="insertColumn"||(x.remove(),B());});}function Z(){if(x&&t.contains(x))return x;let v=T();if(v)return x=v,v;let R=G();return R.addEventListener("pointerenter",()=>{d=true,h();}),R.addEventListener("pointerleave",()=>{d=false;}),R.addEventListener("pointerdown",O),R.addEventListener("mousedown",O),R.addEventListener("click",S),R.addEventListener("blur",E),x=R,R}function k(v,R){let D=$o(R.layout,v.tableId,v.pageIndex);if(!D)return;let{table:W,origin:ne}=D,V=Z();if(P(V),w=v,V.dataset.tableId=v.tableId,v.kind==="insertRow"){let re=W.rows.find(Me=>Me.id===v.rowId);if(!re)return;V.dataset.rowId=v.rowId,delete V.dataset.gridColumnId,V.className="docx-table-insert-row",V.setAttribute("aria-label",e.label("table.insertRowBelow"));let ie=re.box.y+re.box.height/2,pe=j(v.pageIndex,W.box.x-14,ie,ne);V.style.left=`${pe.left}px`,V.style.top=`${pe.top-8}px`;}else {let re=W.rows[0]?.cells.find(dt=>dt.gridColumnId===v.gridColumnId);if(!re)return;V.dataset.gridColumnId=v.gridColumnId,delete V.dataset.rowId;let ie=W.columnEdges[re.gridColumn]??0,pe=W.columnEdges[re.gridColumn+1]??W.box.width;V.className="docx-table-insert-column",V.setAttribute("aria-label",e.label("table.insertColumnRight"));let Me=j(v.pageIndex,W.box.x+(ie+pe)/2-8,W.box.y-14,ne);V.style.left=`${Me.left}px`,V.style.top=`${Me.top}px`;}t.contains(V)||t.append(V);}function O(v){v.preventDefault(),v.stopPropagation();}function U(v,R){if($(),P(x??T()),!(s||R.editingMode==="view")){if((v.kind==="columnDivider"||v.kind==="rightEdge")&&!v.isHeaderRepeat){let D=$o(R.layout,v.tableId,v.pageIndex);if(!D)return;let{table:W,origin:ne}=D,V=document.createElement("div");V.className=v.kind==="rightEdge"?"docx-table-edge-handle-right layout-table-edge-handle-right":"docx-table-divider-handle layout-table-resize-handle",V.style.position="absolute",V.style.pointerEvents="auto",V.style.cursor="col-resize",V.dataset.active="true";let re=j(v.pageIndex,W.box.x+v.edgeX,W.box.y,ne);V.style.left=`${re.left-3}px`,V.style.top=`${re.top}px`,V.style.width="6px",V.style.height=`${W.box.height*e.scale()}px`,V.addEventListener("pointerdown",ce),t.append(V);}if(v.kind==="rowDivider"&&!v.isHeaderRepeat){let D=$o(R.layout,v.tableId,v.pageIndex);if(!D)return;let{table:W,origin:ne}=D,V=document.createElement("div");V.className="docx-table-row-divider-handle layout-table-row-resize-handle",V.style.position="absolute",V.style.pointerEvents="auto",V.style.cursor="row-resize",V.dataset.active="true";let re=j(v.pageIndex,W.box.x,W.box.y+v.edgeY,ne);V.style.left=`${re.left}px`,V.style.top=`${re.top-3}px`,V.style.width=`${W.box.width*e.scale()}px`,V.style.height="6px",V.addEventListener("pointerdown",ce),t.append(V);}v.kind==="insertRow"&&!v.isHeaderRepeat&&k(v,R),v.kind==="insertColumn"&&!v.isHeaderRepeat&&k(v,R);}}function K(v,R){let D=Vl(R.layout,v);if(!D)return;let W=Kl(R),ne=Sn({command:{type:"insertRow",where:"below",target:jl(v.sourceRevision,D)},part:or(e.session(),v.tableId),layout:R.layout,storeRevision:R.storeRevision,selection:R.selection,cellSelection:R.cellSelection,themeColors:R.themeColors,...W});e.applyTableCommandPlan(ne);}function X(v,R){let D=Vl(R.layout,v);if(!D)return;let W=D.row.cells.find(ie=>ie.gridColumnId===v.gridColumnId);if(!W)return;let ne=zg(v.sourceRevision,D,W);if(!ne)return;let V=Kl(R),re=Sn({command:{type:"insertColumn",where:"right",target:ne},part:or(e.session(),v.tableId),layout:R.layout,storeRevision:R.storeRevision,selection:R.selection,cellSelection:R.cellSelection,themeColors:R.themeColors,...V});e.applyTableCommandPlan(re);}function ce(v){if(v.button!==0)return;let R=e.read();if(R.editingMode==="view"||!r||r.kind!=="columnDivider"&&r.kind!=="rightEdge"&&r.kind!=="rowDivider")return;v.preventDefault(),v.stopPropagation();let D=r,W=Vl(R.layout,D);if(!W)return;let ne=chunk35MI6K7M_cjs.Gf(or(e.session(),D.tableId).root,D.tableId);if(!ne.ok||D.kind!=="rowDivider"&&ne.topology.hasMerge)return;let V=0,re=0,ie=0,pe=ne.topology.gridColumns.reduce((De,Xe)=>De+ci(Xe),0),Me;if(D.kind==="columnDivider"){let De=ne.topology.gridColumns.find(Ce=>Ce.id===D.leftGridColumnId),Xe=ne.topology.gridColumns.find(Ce=>Ce.id===D.rightGridColumnId);if(!De||!Xe)return;V=ci(De),re=ci(Xe),Me=$g(D.sourceRevision,W,D.leftGridColumnId,D.rightGridColumnId);}else if(D.kind==="rightEdge"){let De=ne.topology.gridColumns.find(Xe=>Xe.id===D.gridColumnId);if(!De)return;V=ci(De),re=0,Me=jg(D.sourceRevision,W,D.gridColumnId);}else ie=Math.max(20,Math.round(W.row.box.height*Kg)),Me=jl(D.sourceRevision,W);let dt=v.currentTarget;dt.setPointerCapture(v.pointerId),c=v.clientX,p=v.clientY,s={pointerId:v.pointerId,startClientX:v.clientX,startClientY:v.clientY,startEdgePt:D.kind==="rowDivider"?D.edgeY:D.edgeX,leftTwips:V,rightTwips:re,tableWidthTwips:pe,rowHeightTwips:ie,target:D,ref:W,resizeTarget:Me,captureElement:dt,rightEdge:D.kind==="rightEdge",vertical:D.kind==="rowDivider",cancelled:false};for(let De of [...t.children])De!==dt&&De.remove();M(D.kind==="rowDivider"?D.edgeY:D.edgeX,D);}function we(){if(s){try{s.captureElement.hasPointerCapture(s.pointerId)&&s.captureElement.releasePointerCapture(s.pointerId);}catch{}s.cancelled=true,s=null,N(),r=null;}}function me(){if(!s||s.cancelled){s=null,N();return}let v=s;s=null;try{v.captureElement.hasPointerCapture(v.pointerId)&&v.captureElement.releasePointerCapture(v.pointerId);}catch{}if(v.vertical?p===v.startClientY:c===v.startClientX){N();return}let R=e.read(),D=Kl(R),W=(v.vertical?p-v.startClientY:c-v.startClientX)/e.scale(),ne=Math.round(W*Kg),V;if(v.target.kind==="rowDivider")V=Af({part:or(e.session(),v.target.tableId),layout:R.layout,storeRevision:R.storeRevision,selection:R.selection,cellSelection:R.cellSelection,themeColors:R.themeColors,...D},v.resizeTarget,Math.max(20,v.rowHeightTwips+ne));else if(v.rightEdge&&v.target.kind==="rightEdge"){let re=Math.max(300,v.leftTwips+ne),ie=Math.max(re,v.tableWidthTwips+ne);V=Sn({command:{type:"commitTableRightEdgeResize",target:v.resizeTarget,columnWidthTwips:re,tableWidthTwips:ie},part:or(e.session(),v.target.tableId),layout:R.layout,storeRevision:R.storeRevision,selection:R.selection,cellSelection:R.cellSelection,themeColors:R.themeColors,...D});}else if(v.target.kind==="columnDivider"){let re=v.leftTwips+ne,ie=v.rightTwips-ne;re=Math.max(300,re),ie=Math.max(300,ie);let pe=v.leftTwips+v.rightTwips;re+ie!==pe&&(re>pe-300?(re=pe-300,ie=300):ie=pe-re),V=Sn({command:{type:"commitTableColumnDividerResize",target:v.resizeTarget,leftWidthTwips:re,rightWidthTwips:ie},part:or(e.session(),v.target.tableId),layout:R.layout,storeRevision:R.storeRevision,selection:R.selection,cellSelection:R.cellSelection,themeColors:R.themeColors,...D});}else {N();return}e.applyTableCommandPlan(V),N();}function he(v){if(!o||!b)return null;let R=e.pageOffsetX(b.pageIndex);return chunk6K6QQVAZ_cjs.Oc(o,b.x,b.y,v.layout,R,b.pageIndex)}function fe(v){if(!r||s||v.editingMode==="view")return;h();let R=he(v),D=Zl(R,v.selection.head.paragraphId);if(!D){r=null,N();return}if(chunk6K6QQVAZ_cjs.Mc(D)!==chunk6K6QQVAZ_cjs.Mc(r)){r=null,N();return}r=D,U(D,v);}function Ge(){let v=x??T(),R=v!==null&&document.activeElement===v;B(),v&&t.contains(v)&&v.remove(),R&&e.pagesLayer.focus({preventScroll:true});}function qt(v){if(s||v.editingMode==="view")return;let R=x??T();if(!R||!t.contains(R)){w&&B();return}if(x=R,!w||w.kind!=="insertRow"&&w.kind!=="insertColumn")return;if(!o){Ge();return}let D=chunk6K6QQVAZ_cjs.Mc(w),W=chunk6K6QQVAZ_cjs.Nc(o,w);if(!W||chunk6K6QQVAZ_cjs.Mc(W)!==D){Ge();return}w=W,k(W,v);}function Fe(v){let R=e.read();if(s&&v.pointerId===s.pointerId){c=v.clientX,p=v.clientY;let ie=(s.vertical?v.clientY-s.startClientY:v.clientX-s.startClientX)/e.scale();for(let pe of [...t.children])pe!==s.captureElement&&pe.remove();M(s.startEdgePt+ie,s.target);return}if(R.editingMode==="view"){A(false);return}let D=Yx(e,v.clientX,v.clientY),W=chunk6K6QQVAZ_cjs.Ac(R.layout,D.y);W>=0&&(b={x:D.x,y:D.y,pageIndex:W});let ne=W>=0?e.pageOffsetX(W):0,V=o?chunk6K6QQVAZ_cjs.Oc(o,D.x,D.y,R.layout,ne,W>=0?W:void 0):null,re=Zl(V,R.selection.head.paragraphId);if(!re){if(d)return;!n&&r&&(n=setTimeout(()=>{n=null,r=null,N();},Xx));return}n&&(clearTimeout(n),n=null),!(r&&chunk6K6QQVAZ_cjs.Lc(re)===chunk6K6QQVAZ_cjs.Lc(r))&&(r=re,U(re,R));}function mt(v){if(!(!s||v.pointerId!==s.pointerId)){if(e.read().editingMode==="view"){we();return}me();}}function H(v){!s||v.pointerId!==s.pointerId||we();}function ae(v){v.key!=="Escape"||!s||we();}return e.pagesLayer.addEventListener("pointermove",Fe),document.addEventListener("pointermove",Fe),document.addEventListener("pointerup",mt),document.addEventListener("pointercancel",H),e.pagesLayer.addEventListener("keydown",ae),{update(){let v=e.read(),R=a,D=i;o=chunk6K6QQVAZ_cjs.Kc(v.layout),a=v.layout.revision,i=v.storeRevision,v.editingMode==="view"?(we(),r=null,h(),A(true)):R!==null&&(R!==v.layout.revision||D!==v.storeRevision)&&(r!==null&&fe(v),qt(v)),t.style.width=e.pagesLayer.style.width,t.style.height=e.pagesLayer.style.height;},refreshLabels(){let v=e.read();if(v.editingMode==="view")return;let R=x??T();if(R&&t.contains(R)&&w&&(w.kind==="insertRow"||w.kind==="insertColumn")){k(w,v);return}r&&(r.kind==="insertRow"||r.kind==="insertColumn")&&k(r,v);},destroy(){h(),we(),B(),N(),e.pagesLayer.removeEventListener("pointermove",Fe),document.removeEventListener("pointermove",Fe),document.removeEventListener("pointerup",mt),document.removeEventListener("pointercancel",H),e.pagesLayer.removeEventListener("keydown",ae),t.remove();}}}function Ul(e,t){let n=(r,o)=>{for(let a of r){if(a.kind==="paragraph"){t(a,o);continue}for(let i of a.rows)if(!i.isHeaderRepeat)for(let s of i.cells)n(s.blocks,true);}};n(e.fragments,false),e.header&&n(e.header.fragments,false),e.footer&&n(e.footer.fragments,false);for(let r of [e.footnotes,e.endnotes])if(r)for(let o of r.notes)n(o.fragments,false);}function Wl(e,t,n){e.has(t.paragraphId)||e.set(t.paragraphId,n);for(let r of t.lines)for(let o of chunk6K6QQVAZ_cjs.vc(r))e.has(o.paragraphId)||e.set(o.paragraphId,n);}var Ug=new WeakMap,Wg=new WeakMap;function Qx(e){let t=Wg.get(e);if(t)return t;let n=new Map;return Ul(e,r=>Wl(n,r,r.props)),Wg.set(e,n),n}function Br(e,t){let n=Ug.get(e);if(!n){n=new Map;for(let r of e.pages)for(let[o,a]of Qx(r))n.has(o)||n.set(o,a);Ug.set(e,n);}return n.get(t)??[]}var Gg=new WeakMap;function Jx(e){let t=Gg.get(e);if(t)return t;let n=new Map;return Ul(e,r=>Wl(n,r,r.tabStops)),Gg.set(e,n),n}function jo(e,t){let n=Xg.get(e);if(!n){let r=new Map;for(let o of e.pages)for(let[a,i]of Jx(o))r.has(a)||r.set(a,i);n=r,Xg.set(e,r);}return n.get(t)??null}var Xg=new WeakMap,Yg=new WeakMap,Qg=new WeakMap;function eI(e){let t=Qg.get(e);if(t)return t;let n=new Map;return Ul(e,(r,o)=>Wl(n,r,{indent:r.indent,inTable:o})),Qg.set(e,n),n}function tI(e,t){let n=Yg.get(e);if(!n){let r=new Map;for(let o of e.pages)for(let[a,i]of eI(o))r.has(a)||r.set(a,i);n=r,Yg.set(e,r);}return n.get(t)??null}function Jg(e,t,n,r,o=chunk35MI6K7M_cjs.wg){let a=chunk35MI6K7M_cjs.ya(e,t);if(!a||a.kind!=="paragraph")return false;for(let i of chunk35MI6K7M_cjs.yg(a,chunk35MI6K7M_cjs.Ig(a),n,r,o))if(chunk35MI6K7M_cjs.Dg(chunk35MI6K7M_cjs.Cg(i.run,"runProperties","rPr"),chunk35MI6K7M_cjs.Ag).length>0)return true;return false}function em(e,t,n,r=chunk35MI6K7M_cjs.wg){let o=chunk35MI6K7M_cjs.ya(e,t);if(!o||o.kind!=="paragraph")return [];let a=chunk35MI6K7M_cjs.Ig(o),i=null,s=null;for(let c of chunk35MI6K7M_cjs.xg(o,r)){let p=a.get(c.id);!p||p.end<=p.start||(p.start<n&&n<=p.end&&(i=c),s===null&&p.start<=n&&n<p.end&&(s=c));}let d=i??s;return d?chunk35MI6K7M_cjs.Dg(chunk35MI6K7M_cjs.Cg(d,"runProperties","rPr"),chunk35MI6K7M_cjs.Ag):chunk35MI6K7M_cjs.Fg(e,t)}function _r(e,t,n){let r=e?.find(a=>a.localName===t);if(!r)return null;let o=r.attributes?.val;return t==="vertAlign"?o===n:(t==="u"||o!=="0"&&o!=="false"&&o!=="off")&&o!=="none"}function tm(e,t){if(!t||t.length===0)return e;let n=e;for(let r of t){let o=r.attributes?.val;switch(r.localName){case "b":n={...n,bold:_r(t,"b")===true};break;case "i":n={...n,italic:_r(t,"i")===true};break;case "u":n={...n,underline:_r(t,"u")===true};break;case "strike":n={...n,strikethrough:_r(t,"strike")===true};break;case "vertAlign":n={...n,superscript:o==="superscript",subscript:o==="subscript"};break;case "rFonts":n={...n,fontFamily:r.attributes?.ascii??n.fontFamily};break;case "sz":{let a=Number(o);Number.isFinite(a)&&(n={...n,fontSizeHalfPoints:a});break}case "color":n={...n,color:o==="auto"?null:o??n.color};break;case "highlight":n={...n,highlight:o==="none"?null:o??n.highlight};break;}}return n}function nm(e,t,n,r){return n&&n.length>0?chunk6K6QQVAZ_cjs.le(e,n):chunk6K6QQVAZ_cjs.he(e,t,r??chunk6K6QQVAZ_cjs.uc(e))}function Gl(e,t,n,r,o,a){let i=nm(e,t,r,a);if(i.length===0)return false;let s=d=>{switch(n){case "b":return d.style.bold;case "i":return d.style.italic;case "u":return d.style.underline!==null;case "strike":return d.style.strike;case "vertAlign":return d.style.verticalAlign===o;default:return false}};return i.every(s)}function rm(e,t,n,r,o,a){let i=nm(e,t,r,a),s=i.map(O=>O.style),d=O=>{if(s.length===0)return null;let U=O(s[0]);return s.every(K=>O(K)===U)?U:null},c=(O,U=(K,X)=>K===X)=>O.length>0&&O.every(K=>U(K,O[0]))?O[0]:null,p=(O,U)=>O.props.some(K=>K.localName===U),b=O=>O.style.fontFamily??n?.(O.range.paragraphId,O.props).fontFamily??null,x=O=>p(O,"sz")?Math.round(O.style.fontSizePt*2):n?.(O.range.paragraphId,O.props).fontSizeHalfPoints??Math.round(O.style.fontSizePt*2),w=i.length===0?n?.(t.head.paragraphId,[]):void 0,F=nI(e,t,r,a),T=O=>c(F.map(U=>O(Br(e,U)))),P=(O,U=(K,X)=>K===X)=>{if(F.length<2)return false;let K=O(Br(e,F[0]));return F.some((X,ce)=>ce>0&&!U(O(Br(e,X)),K))},B=T(O=>chunk6K6QQVAZ_cjs.Db(O)),h=T(O=>chunk6K6QQVAZ_cjs.ra(O,"pStyle")?.val??o??void 0)??null,N=O=>chunk6K6QQVAZ_cjs.ra(O,"spacing")??void 0,A=O=>{let U=N(O),K=Number(U?.line);if(!Number.isFinite(K))return "";let X=U?.lineRule??"auto";return X==="auto"?`multiple:${Math.round(K/240*100)/100}`:`${X==="exact"?"exact":"atLeast"}:${Math.round(K/20*100)/100}`},$=T(A),j=(()=>{if(!$)return null;let[O,U]=$.split(":");return {rule:O,value:Number(U)}})(),M=(O,U)=>{let K=Number(N(O)?.[U]);return Number.isFinite(K)?Math.round(K/20*100)/100:null},G=O=>T(U=>M(U,O)),S=(()=>{let O=F.map(fe=>tI(e,fe)),U=O[0];if(!U||O.some(fe=>fe===null||fe.inTable))return null;let K=fe=>Math.round(fe*20),X=fe=>K(fe.hanging>0?-fe.hanging:fe.firstLine),ce=O,we=K(U.indent.left),me=K(U.indent.right),he=X(U.indent);return {left:we,right:me,firstLine:he,mixed:{left:ce.some(fe=>K(fe.indent.left)!==we),right:ce.some(fe=>K(fe.indent.right)!==me),firstLine:ce.some(fe=>X(fe.indent)!==he)}}})(),E=O=>T(U=>O(chunk6K6QQVAZ_cjs.Mb(U))),Z=T(chunk6K6QQVAZ_cjs.ka),k=T(chunk6K6QQVAZ_cjs.va);return {bold:s.length>0&&s.every(O=>O.bold),italic:s.length>0&&s.every(O=>O.italic),underline:s.length>0&&s.every(O=>O.underline!==null),strikethrough:s.length>0&&s.every(O=>O.strike),superscript:s.length>0&&s.every(O=>O.verticalAlign==="superscript"),subscript:s.length>0&&s.every(O=>O.verticalAlign==="subscript"),fontFamily:i.length>0?c(i.map(b)):w?.fontFamily??null,fontSizeHalfPoints:i.length>0?c(i.map(x)):w?.fontSizeHalfPoints??null,color:d(O=>O.color),highlight:d(O=>O.highlight),alignment:B,styleId:h,lineSpacing:j,spaceBeforePt:G("before"),spaceAfterPt:G("after"),disagrees:{alignment:P(O=>chunk6K6QQVAZ_cjs.Db(O)),spaceBeforePt:P(O=>M(O,"before")),spaceAfterPt:P(O=>M(O,"after")),lineSpacing:P(A),tabStops:(()=>{if(F.length<2)return false;let O=JSON.stringify(jo(e,F[0])?.stops??null);return F.some((U,K)=>K>0&&JSON.stringify(jo(e,U)?.stops??null)!==O)})()},indent:S,tabStops:c(F.map(O=>jo(e,O)?.stops??null),(O,U)=>O===null||U===null?O===U:O.length===U.length&&O.every((K,X)=>Math.round(K.positionPt*20)===Math.round(U[X].positionPt*20)&&K.alignment===U[X].alignment&&(K.leader??"none")===(U[X].leader??"none")))?.map(O=>({positionTwips:Math.round(O.positionPt*20),alignment:O.alignment,...O.leader?{leader:O.leader}:{}}))??null,paragraphFlags:{contextualSpacing:k,keepNext:E(O=>O.keepNext),keepLines:E(O=>O.keepLines),widowControl:E(O=>O.widowControl),pageBreakBefore:Z}}}function nI(e,t,n,r){if(n&&n.length>0)return [...chunk6K6QQVAZ_cjs.ke(e,n)];if(t.anchor.paragraphId===t.head.paragraphId)return [t.head.paragraphId];let o=r??chunk6K6QQVAZ_cjs.uc(e),a=o.indexOf(t.anchor.paragraphId),i=o.indexOf(t.head.paragraphId);return a===-1||i===-1?[t.head.paragraphId]:o.slice(Math.min(a,i),Math.max(a,i)+1)}function om(e,t,n,r){return t.paragraphId!==n.paragraphId?[]:t.offset!==0||n.offset!==e.length?[]:e.length===0?[]:[{op:"setParagraphMarkProperties",paragraphId:t.paragraphId,properties:r}]}function am(e){let{session:t,commit:n,orderedRange:r,selectionMark:o,textOf:a}=e,i=()=>e.displayMode(),s=()=>t.partFor(e.storyScope())??t.part(),d=(T,P,B)=>t.applyTreeOps(T,P,B,e.storyScope()),c={get value(){return e.layout()}},p={get value(){return e.selection()}},b=(T,P,B)=>{let h=s();if(T.paragraphId===P.paragraphId){let M=chunk35MI6K7M_cjs.Mg(h,T.paragraphId,T.offset,P.offset,B,i());if(M.length===0)return;let G=chunk35MI6K7M_cjs.Lg(h,T.paragraphId,B);n(()=>d([...M.map(S=>({op:"setRunProperties",paragraphId:T.paragraphId,start:S.start,end:S.end,properties:S.properties,...S.targetRunIds?{targetRunIds:S.targetRunIds}:{}})),...om(a(T.paragraphId),T,P,G)],o()));return}let N=e.paragraphOrder(),A=N.indexOf(T.paragraphId),$=N.indexOf(P.paragraphId);if(A===-1||$===-1)return;let j=[];for(let M=A;M<=$;M+=1){let G=N[M],S=a(G),E=M===A?T.offset:0,Z=M===$?P.offset:S.length,k=E<Z?chunk35MI6K7M_cjs.Mg(h,G,E,Z,B,i()):[];for(let U of k)j.push({op:"setRunProperties",paragraphId:G,start:U.start,end:U.end,properties:U.properties,...U.targetRunIds?{targetRunIds:U.targetRunIds}:{}});(M<$||E===0&&Z===S.length&&S.length>0)&&j.push({op:"setParagraphMarkProperties",paragraphId:G,properties:chunk35MI6K7M_cjs.Lg(h,G,B)});}j.length!==0&&n(()=>d(j,o()));},x=(T,P)=>{let B=s(),h=[];for(let N of chunk6K6QQVAZ_cjs.ke(c.value,T)){let A=a(N);for(let $ of chunk35MI6K7M_cjs.Mg(B,N,0,A.length,P,i()))h.push({op:"setRunProperties",paragraphId:N,start:$.start,end:$.end,properties:$.properties,...$.targetRunIds?{targetRunIds:$.targetRunIds}:{}});h.push({op:"setParagraphMarkProperties",paragraphId:N,properties:chunk35MI6K7M_cjs.Lg(B,N,P)});}return h.length===0?false:(n(()=>d(h,o()),void 0,{keepCellSelection:true}),true)},w=T=>{chunk35MI6K7M_cjs.Bg(T.localName)&&e.setPendingFormats(chunk35MI6K7M_cjs.Gg(e.pendingFormats()??[],T));},F=T=>{if(T.length===0)return;let P=e.selectedCells?.(),B=P&&P.length>0?[...chunk6K6QQVAZ_cjs.ke(c.value,P)]:null,{from:h,to:N}=r(),A=B??e.paragraphOrder(),$=B?0:A.indexOf(h.paragraphId),j=B?A.length-1:A.indexOf(N.paragraphId);if($===-1||j===-1)return;let M=s(),G=A.slice($,j+1).map(S=>{let E=chunk35MI6K7M_cjs.Eg(M,S);for(let Z of T){let k=Z.mergeAttributes?{...E.find(U=>U.localName===Z.localName)?.attributes??{},...Z.attributes}:Z.attributes??{},O=Object.fromEntries(Object.entries(k).filter(([,U])=>U!=null));E=chunk35MI6K7M_cjs.Gg(E,{localName:Z.localName,...Object.keys(O).length>0?{attributes:O}:{}});}return {op:"setParagraphProperties",paragraphId:S,properties:E}});G.length!==0&&n(()=>d(G,o()),void 0,{keepCellSelection:B!==null});};return {setRunProperty(T,P){let B={localName:T,...P?{attributes:P}:{}},h=e.selectedCells?.();if(h&&h.length>0){x(h,B);return}let{from:N,to:A}=r();if(N.paragraphId===A.paragraphId&&N.offset===A.offset){w(B);return}b(N,A,B);},setParagraphProperty(T,P,B){F([{localName:T,...P?{attributes:P}:{},...B??{}}]);},setParagraphProperties:F,formatting:()=>tm(rm(c.value,p.value,(T,P)=>{let B=t.effectiveRunDefaults(T,P);if(B.fontFamily!==null)return B;let h=e.defaultFontFamily?.()??null;return h===null?B:{...B,fontFamily:h}},e.selectedCells?.(),e.defaultParagraphStyleId?.()??null,e.paragraphOrder()),e.pendingFormats()),toggleRunProperty(T,P){let B=e.selectedCells?.(),h=P?.val,N=_r(e.pendingFormats(),T,h)??Gl(c.value,p.value,T,B,h,e.paragraphOrder()),A=N?{localName:T,attributes:{val:rI[T]??"0"}}:{localName:T,...P?{attributes:P}:{}};if(B&&B.length>0){x(B,A);return}let{from:$,to:j}=r();if($.paragraphId===j.paragraphId&&$.offset===j.offset){let M=e.pendingFormats()??[],G=Gl(c.value,p.value,T,void 0,h,e.paragraphOrder());if(!N===G){let S=M.filter(E=>E.localName!==T);e.setPendingFormats(S.length>0?S:null);}else w(A);return}b($,j,A);},clearFormatting(){e.setPendingFormats(null);let T=c.value,P=e.paragraphOrder(),B=e.selectedCells?.(),h=B&&B.length>0?[...chunk6K6QQVAZ_cjs.ke(T,B)]:oI(P,r());if(h.length===0)return;let{from:N,to:A}=r(),$=B!==void 0&&B.length>0,j=s(),M=[];for(let G of h){let S=a(G),E=$||G!==N.paragraphId?0:N.offset,Z=$||G!==A.paragraphId?S.length:A.offset;for(let k of chunk35MI6K7M_cjs.Ng(j,G,E,Z,i()))Jg(j,G,k.start,k.end,i())&&M.push({op:"setRunProperties",paragraphId:G,start:k.start,end:k.end,properties:[]});chunk35MI6K7M_cjs.Fg(j,G).length>0&&M.push({op:"setParagraphMarkProperties",paragraphId:G,properties:[]}),chunk35MI6K7M_cjs.Eg(j,G).length>0&&M.push({op:"setParagraphProperties",paragraphId:G,properties:[]});}M.length!==0&&n(()=>d(M,o()),void 0,{keepCellSelection:$});}}}var rI={u:"none",vertAlign:"baseline"};function oI(e,t){let n=e.indexOf(t.from.paragraphId),r=e.indexOf(t.to.paragraphId);return n===-1||r===-1?[]:e.slice(n,r+1)}var aI=500,im=4,qr=40,ui=12;function iI(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),o=Math.min(e.x+e.width,t.x+t.width),a=Math.min(e.y+e.height,t.y+t.height);return o<=n||a<=r?0:(o-n)*(a-r)}function sm(e,t){return iI(e,t)>0?true:e.width===0?t.x<=e.x&&e.x<=t.x+t.width&&!(e.y+e.height<t.y||t.y+t.height<e.y):false}function _t(e,t,n){let r=chunk6K6QQVAZ_cjs.tc(e),o=r.indexOf(t.paragraphId),a=r.indexOf(n.paragraphId);return o!==a?o-a:t.offset-n.offset}function cm(e,t,n){if(!(t>chunk6K6QQVAZ_cjs.$b))for(let r of e){if(r.kind==="paragraph"){n(r);continue}if(!(t>=chunk6K6QQVAZ_cjs.$b)){for(let o of r.rows)if(!o.isHeaderRepeat)for(let a of o.cells)cm(a.blocks,t+1,n);}}}function Xl(e,t){if(!t.placeholder||t.fragments.length===0)return null;let n=null,r=null,o=(i,s)=>{(!n||_t(e,i,n)<0)&&(n=i),(!r||_t(e,s,r)>0)&&(r=s);},a=t.level!=="inline";for(let i of t.fragments){let s=e.pages[i.pageIndex];s&&cm(s.fragments,0,d=>{if(sm(i.box,d.box)){if(a){let c=chunk6K6QQVAZ_cjs.de(e,d.paragraphId).length;o({paragraphId:d.paragraphId,offset:0},{paragraphId:d.paragraphId,offset:c});return}for(let c of d.lines)for(let p of c.spans)sm(i.box,p.box)&&o({paragraphId:p.range.paragraphId,offset:p.range.start},{paragraphId:p.range.paragraphId,offset:p.range.end});}});}return !n||!r?null:{from:n,to:r}}function sI(e,t){return (e.contentControls??[]).find(n=>n.id===t)??null}function lm(e,t){let n=t.contentControlId;if(!n){let o={x:t.caret.x,y:t.caret.y+t.caret.height/2},a=chunk6K6QQVAZ_cjs.Fc(e,t.pageIndex,o);return a?.placeholder?a:null}let r=sI(e,n);return r?.placeholder?r:null}function dm(e,t){let n=e.contentControls??[];if(n.length===0)return t;let r=_t(e,t.anchor,t.head)<=0?t.anchor:t.head,o=_t(e,t.anchor,t.head)<=0?t.head:t.anchor,a=true;for(;a;){a=false;for(let s of n){if(!s.placeholder)continue;let d=Xl(e,s);!d||!(_t(e,r,o)===0?_t(e,r,d.from)>=0&&_t(e,r,d.to)<0:_t(e,r,d.to)<0&&_t(e,o,d.from)>0)||(_t(e,d.from,r)<0&&(r=d.from,a=true),_t(e,d.to,o)>0&&(o=d.to,a=true));}}return _t(e,t.anchor,t.head)<=0?{anchor:r,head:o}:{anchor:o,head:r}}function um(e,t={}){if(t.mode==="native")return {dragging:()=>false,destroy:()=>{}};let{pagesLayer:n,container:r}=e,o=n.ownerDocument,a=o.defaultView,i=null,s=null,d=0,c=0,p=0,b=0,x=null;function w(H,ae){if(!s){let R=n.getBoundingClientRect();s={left:R.left,top:R.top};}let v=e.scale()||1;return {x:(H-s.left)/v,y:(ae-s.top)/v}}function F(H){return {scope:{kind:"headerFooter",rId:H.rId},pageIndex:H.pageIndex,kind:H.kind,partName:H.partName,variant:H.variant}}function T(H,ae){let v=e.layout(),R=w(H,ae),D=chunk6K6QQVAZ_cjs.Ac(v,R.y),W=v.pages[D];if(!W)return null;let ne=e.measurer();return chunk6K6QQVAZ_cjs.Cc(v,D,{x:R.x-W.contentBox.x-e.pageOffsetX(D),y:R.y-W.contentBox.y},ne?{measurer:ne}:{})}function P(H,ae){let v=e.activeNote?.()??null;if(v){let V=e.layout(),re=_s(V,w(H,ae),e.pageOffsetX);if(!re||re.scopeId!==v.scopeId)return null;let ie=e.measurer();return chunk6K6QQVAZ_cjs.Dc(V,re.pageIndex,re.fragments,re.local,{...ie?{measurer:ie}:{}})}let R=e.activeHeaderFooter?.()??null;if(!R)return T(H,ae);let D=e.layout(),W=w(H,ae),ne=qs(D,W,e.pageOffsetX);if(ne&&Ms(ne.story,F(R))){let V=e.measurer();return Ns(D,ne.pageIndex,ne.story,ne.local,V?{measurer:V}:{})}return null}function B(H,ae){let{story:v,pageIndex:R,kind:D}=H;return {rId:v.rId,pageIndex:R,kind:D,partName:v.partName,variant:v.variant,...ae?{position:ae}:{}}}function h(H){let ae=e.measurer();return Ns(e.layout(),H.pageIndex,H.story,H.local,ae?{measurer:ae}:{})?.position??void 0}let N=new WeakMap;function A(H,ae){let v=e.activeNote?.();if(v){let ne=Pr(H,null,v.scopeId).indexOf(ae);return ne===-1?-1:ne}let R=e.activeHeaderFooter?.();if(R){let ne=Pr(H,F(R)).indexOf(ae);return ne===-1?-1:ne}let D=N.get(H);return D||(D=new Map(chunk6K6QQVAZ_cjs.tc(H).map((W,ne)=>[W,ne])),N.set(H,D)),D.get(ae)??-1}function $(H,ae,v){let R=A(H,ae.paragraphId),D=A(H,v.paragraphId);return R!==D?R<D:ae.offset<v.offset}let j=/[\p{L}\p{N}_'’]/u,M=H=>H!==void 0&&j.test(H);function G(H,ae,v){if(v==="character")return {from:ae,to:ae};let R=chunk6K6QQVAZ_cjs.de(H,ae.paragraphId),D=ae.paragraphId;if(v==="paragraph")return {from:{paragraphId:D,offset:0},to:{paragraphId:D,offset:R.length}};let W=Math.max(0,Math.min(ae.offset,R.length)),ne=-1;if(M(R[W])?ne=W:W>0&&M(R[W-1])&&(ne=W-1),ne===-1){let re=W,ie=W;for(;re>0&&/\s/.test(R[re-1]??"");)re-=1;for(;ie<R.length&&/\s/.test(R[ie]??"");)ie+=1;return re===ie&&ie<R.length&&(ie+=1),{from:{paragraphId:D,offset:re},to:{paragraphId:D,offset:ie}}}let V=chunk6K6QQVAZ_cjs.ee(H,D);return {from:{paragraphId:D,offset:chunk6K6QQVAZ_cjs.Yd(R,ne+1,-1,V)},to:{paragraphId:D,offset:chunk6K6QQVAZ_cjs.Yd(R,ne,1,V)}}}function S(H,ae,v,R,D){let W=D?lm(H,D):null,ne=W?Xl(H,W)??G(H,v,R):G(H,v,R),V=$(H,ne.from,ae.from)?{anchor:ae.to,head:ne.from}:{anchor:ae.from,head:ne.to};return dm(H,V)}let E=r.closest(".docx-editor__scroll-container");function Z(){return r.closest(".docx-editor__scroll-container")}function k(H,ae,v){if(v<H+qr){let R=Math.max(0,H+qr-v);return -Math.min(ui,R/qr*ui)}if(v>ae-qr){let R=Math.max(0,v-(ae-qr));return Math.min(ui,R/qr*ui)}return 0}function O(){x!==null&&(a?.cancelAnimationFrame(x),x=null);}function U(){x=null;let H=i,ae=Z();if(!H||!ae||!a)return;let v=ae.getBoundingClientRect(),R=k(v.top,v.bottom,H.clientY);R!==0&&(ae.scrollTop+=R,s=null,X(H.clientX,H.clientY),x=a.requestAnimationFrame(U));}function K(){if(x!==null||!a||!i)return;let H=Z();if(!H)return;let ae=H.getBoundingClientRect();k(ae.top,ae.bottom,i.clientY)!==0&&(x=a.requestAnimationFrame(U));}function X(H,ae){let v=i;if(!v)return;let R=P(H,ae);R&&(e.isReadOnlyParagraph?.(R.position.paragraphId)||ce(v,R)||e.setSelection(S(e.layout(),v.anchorRange,R.position,v.granularity,R)));}function ce(H,ae){let v=H.anchorCell;if(!v)return false;if(!ae.cell||ae.cell.tableId!==v.tableId)return H.cellDragging;if(!H.cellDragging&&ae.cell.cellId===v.cellId)return false;let R=chunk6K6QQVAZ_cjs.ie(e.layout(),v,ae.cell);return R?(H.cellDragging=true,e.setCellSelection(R),true):H.cellDragging}function we(H){let ae=Date.now(),v=ae-c;return d=Math.abs(H.clientX-p)<=im&&Math.abs(H.clientY-b)<=im&&v>=0&&v<=aI?d+1:1,c=ae,p=H.clientX,b=H.clientY,d}let me=["character","word","paragraph"],he=H=>{if(H.button!==0)return;let ae=H.target?.closest?.("[data-docx-cc-widget]");if(ae){if(H.preventDefault(),H.stopPropagation(),ae.hasAttribute("disabled")||ae.dataset.disabledReason)return;let ye=ae.dataset.docxCcId,Te=ae.dataset.docxCcWidget;ye&&Te&&e.onContentControlWidget?.(ye,Te);return}if(H.pointerType==="touch")return;i&&Fe(),s=null;let v=e.layout(),R=w(H.clientX,H.clientY),D=e.activeHeaderFooter?.()??null,W=e.activeNote?.()??null,ne=qs(v,R,e.pageOffsetX),V=_s(v,R,e.pageOffsetX),re=H.target?.closest("[data-docx-hf]"),ie=!!(re||ne),pe=H.target,Me=pe?.closest("[data-docx-note-ref]"),dt=pe?.closest("[data-docx-note-mark-back]"),De=null,Xe=()=>De??=we(H);if(Me?.dataset.docxNoteScope){H.preventDefault(),e.focus(),e.enterNote?.(Me.dataset.docxNoteScope);return}if(dt){H.preventDefault(),e.focus(),e.exitNote?.(true);return}if(V&&!ie){let ye=e.measurer?.(),Te=chunk6K6QQVAZ_cjs.Dc(v,V.pageIndex,V.fragments,V.local,{...ye?{measurer:ye}:{}});if(!W||W.scopeId!==V.scopeId){H.preventDefault(),e.focus(),e.enterNote?.(V.scopeId,Te?{paragraphId:Te.position.paragraphId,offset:Te.position.offset}:void 0,V.pageIndex);return}if(W.pageIndex!==V.pageIndex){H.preventDefault(),e.focus(),e.enterNote?.(V.scopeId,Te?{paragraphId:Te.position.paragraphId,offset:Te.position.offset}:void 0,V.pageIndex);return}}else if(W){if(!Ls(v,R,e.pageOffsetX))return;e.exitNote?.(false),e.focus();}if(D)if(ne&&Ms(ne.story,F(D)))ne.pageIndex!==D.pageIndex&&e.enterHeaderFooter?.(B(ne,h(ne)));else if(ne&&ne.story.rId){H.preventDefault(),e.focus(),e.enterHeaderFooter?.(B(ne,h(ne)));return}else if(Ls(v,R,e.pageOffsetX)){H.preventDefault(),e.exitHeaderFooter?.(true),e.focus();return}else {let ye=Xe()>=2?Bs(v,R,e.pageOffsetX):null;ye&&(H.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(ye.kind,ye.pageIndex));return}else if(ie&&Xe()>=2){if(ne?.story.rId)H.preventDefault(),e.focus(),e.enterHeaderFooter?.(B(ne,h(ne)));else if(re instanceof HTMLElement){let ye=re.dataset.docxRId,Te=re.dataset.docxHf,$e=re.closest("[data-page-index]")?.getAttribute("data-page-index"),pn=$e!=null?Number($e):NaN;if((Te==="header"||Te==="footer")&&Number.isInteger(pn))if(ye){let kn=v.pages[pn]?.[Te];H.preventDefault(),e.focus(),e.enterHeaderFooter?.({rId:ye,pageIndex:pn,kind:Te,partName:kn?.partName??"",variant:kn?.variant??"default"});}else v.pages[pn]?.[Te]||(H.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Te,pn));}return}else if(Xe()>=2){let ye=Bs(v,R,e.pageOffsetX);if(ye){H.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(ye.kind,ye.pageIndex);return}}let Ce=P(H.clientX,H.clientY);if(!Ce)return;if(e.isReadOnlyParagraph?.(Ce.position.paragraphId)){H.preventDefault();return}H.preventDefault(),e.focus();try{n.setPointerCapture(H.pointerId);}catch{}o.addEventListener("pointermove",Ge),o.addEventListener("pointerup",qt),o.addEventListener("pointercancel",qt);let Zt=Xe(),ct=H.shiftKey?"character":me[(Zt-1)%me.length],rn=lm(v,Ce);if(rn&&!H.shiftKey){if(e.selectContentControl?.(rn.id)){let Te=e.selection(),$e=$(v,Te.anchor,Te.head)||Te.anchor.paragraphId===Te.head.paragraphId&&Te.anchor.offset===Te.head.offset?{from:Te.anchor,to:Te.head}:{from:Te.head,to:Te.anchor};i={pointerId:H.pointerId,granularity:"character",anchorRange:$e,anchorCell:Ce.cell,cellDragging:false,clientX:H.clientX,clientY:H.clientY};return}let ye=Xl(v,rn);if(ye){i={pointerId:H.pointerId,granularity:"character",anchorRange:ye,anchorCell:Ce.cell,cellDragging:false,clientX:H.clientX,clientY:H.clientY},fe(()=>e.setSelection({anchor:ye.from,head:ye.to}));return}}if(H.shiftKey){let ye=e.selection();i={pointerId:H.pointerId,granularity:ct,anchorRange:{from:ye.anchor,to:ye.anchor},anchorCell:Ce.cell,cellDragging:false,clientX:H.clientX,clientY:H.clientY},fe(()=>e.setSelection(S(v,{from:ye.anchor,to:ye.anchor},Ce.position,ct,Ce)));}else {let ye=G(v,Ce.position,ct);i={pointerId:H.pointerId,granularity:ct,anchorRange:ye,anchorCell:Ce.cell,cellDragging:false,clientX:H.clientX,clientY:H.clientY},fe(()=>e.setSelection(dm(v,{anchor:ye.from,head:ye.to})));}};function fe(H){try{H();}catch(ae){throw Fe(),ae}}let Ge=H=>{let ae=i;!ae||H.pointerId!==ae.pointerId||(H.preventDefault(),ae.clientX=H.clientX,ae.clientY=H.clientY,X(H.clientX,H.clientY),K());},qt=H=>{let ae=i;if(!ae||H.pointerId!==ae.pointerId)return;Fe();try{n.releasePointerCapture(ae.pointerId);}catch{}let v=e.cellSelection();v?e.setCellSelection(v):e.setSelection(e.selection());};function Fe(){if(i)try{n.releasePointerCapture(i.pointerId);}catch{}i=null,s=null,O(),o.removeEventListener("pointermove",Ge),o.removeEventListener("pointerup",qt),o.removeEventListener("pointercancel",qt);}let mt=()=>{s=null;};return n.addEventListener("pointerdown",he),E?.addEventListener("scroll",mt,{passive:true}),a?.addEventListener("scroll",mt,{capture:true,passive:true}),a?.addEventListener("resize",mt,{passive:true}),{dragging:()=>i!==null,destroy(){Fe(),n.removeEventListener("pointerdown",he),E?.removeEventListener("scroll",mt),a?.removeEventListener("scroll",mt,{capture:true}),a?.removeEventListener("resize",mt);}}}function fm(e){let{document:t,pagesLayer:n,session:r}=e,o=false,a=null,i;function s(M){let G=rr(M?.anchorNode,n)??rr(M?.focusNode,n);G!==void 0&&(i=G);}function d(M){return i??rr(M?.anchorNode,n)??rr(M?.focusNode,n)}let c=false,p=false,b=false,x=null,w=false;function F(){let M=t.getSelection(),G=Hr(n,M);return !G||(s(M),Ht(G,e.selection()))?false:(e.adoptSelection(G),true)}function T(){let M=t.activeElement;if(M&&n.contains(M))return true;let G=t.getSelection();if(!G||G.rangeCount===0)return true;let S=G.anchorNode;return !S||!S.isConnected?true:n.contains(S)}let P=()=>{let M=t.getSelection(),G=Hr(n,M);if(!G){if(!Dl(n,M))return;c=false;let S=Oe(e.selection().head);if(Ht(S,e.selection()))return;e.setSelection(S);return}c=false,s(M),!Ht(G,e.selection())&&e.setSelection(G);};function B(M){let G=e.textOf(M),S=Cg(n,M,G,t.getSelection()?.anchorNode??null);if(S===null)return;let E=Rg(M,G,S);if(!E)return;let Z=E.ops.find(ce=>ce.op==="deleteText"),k=E.ops.find(ce=>ce.op==="insertText"),O=k&&Z?e.replacementOffset?.(M,Z.start,Z.end):void 0,U=k&&O!==void 0&&O!==k.offset?E.ops.map(ce=>ce===k?{...k,offset:O}:ce):E.ops,K=k?e.pendingFormatOps?.(M,O??k.offset,k.text.length,Z?{start:Z.start,end:Z.end}:void 0)??[]:[],X=e.storyScope();e.commit(()=>{let ce=e.applyOps([...U,...K],e.selectionMark(),X);return K.length===0||!ce.rejected?ce:e.applyOps(U,e.selectionMark(),X)}),e.setSelection(Oe({paragraphId:M,offset:k&&O!==void 0?O+k.text.length:E.caret}));}function h(){o||b||e.isGesturing?.()||e.holdsCellSelection?.()||N()||c&&P();}function N(){if(!p||c)return false;if(!a)return true;let M=Hr(n,t.getSelection());return M!==null&&Ht(M,a)}function A(M){M instanceof PointerEvent&&M.button!==0||(c=true);}let $=false;function j(M=false){if(e.updateCaret(),!M&&!T())return;o=true;let G=e.now(),S=e.domSelection?.()??e.selection();c=false;let E=t.getSelection(),Z=d(E),k=gg(n,S,E,Z!==void 0?{preferredPageIndex:Z}:void 0);k&&s(E),a=k?S:null,k||(p=true),e.recordSelectionMs(e.now()-G),queueMicrotask(()=>{o=false;});}return n.addEventListener("pointerdown",A,true),n.addEventListener("selectstart",A,true),{adoptBeforePaint(){let M=e.holdsCellSelection?.()===true||e.isGesturing?.()===true||e.hasPendingInput?.()===true,G=p||M||!c?false:F();return e.hasPendingInput?.()!==true&&(p=false),G},noteModelMoved(){p=true;},noteSelectionSettled(){p=false;},mirrorToDom:j,adoptBeforeInput:h,isComposing:()=>b,noteBrowserSelectionFixup(){$=true;},onSelectionChange:()=>{if(!o&&!b&&!e.isGesturing?.()&&!e.holdsCellSelection?.()){if($&&Dl(n,t.getSelection())){let M=Hr(n,t.getSelection());if((M===null||!Ht(M,e.selection()))&&($=false,!c)){j();return}}N()||P();}},onCompositionStart:()=>{h(),b=true;let M=e.selection();w=M.anchor.paragraphId!==M.head.paragraphId,x=M.head.paragraphId,r.beginComposition(e.storyScope());},onCompositionEnd:M=>{b=false;let G=x??e.selection().head.paragraphId;x=null;let S=w;w=false;let E=e.storyScope(),Z=r.revisionFor(E);if(S){let k=M?.data??"";k.length>0&&e.replaceSelectionWith?.(k);}else B(G);r.endComposition(),r.revisionFor(E)===Z&&e.discardPaint?.(),e.flushToPaint()||e.render();},selectionPageIndex:()=>i,destroy(){n.removeEventListener("pointerdown",A,true),n.removeEventListener("selectstart",A,true),c=false;}}}var lI=32;function gm(e,t,n,r){if(!(e.kind==="textValue"||r>lI)){if(e.kind==="paragraph"){n.has(e.id)||n.set(e.id,t);return}for(let o of e.children)gm(o,t,n,r+1);}}function uI(e){let t=chunk6K6QQVAZ_cjs.Pb(e),n=chunk6K6QQVAZ_cjs.dd(e),r=new Map;for(let o=0;o<n.length;o+=1){let a=n[o];for(let i=a.blockStart;i<a.blockEndExclusive;i+=1){let s=t[i];s&&gm(s,o,r,0);}}return r}var pm=new WeakMap;function fI(e){return !(!e.story||e.origin===chunk35MI6K7M_cjs.b.mutationUndo||e.origin===chunk35MI6K7M_cjs.b.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.includes(chunk35MI6K7M_cjs.g.section))}function pI(e,t){t.story&&t.story.kind!=="body"||fI(t)||(e.map=null);}function gI(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>pI(t,n)));}function mI(e,t){let n=pm.get(e);return n||(n={map:null,subscribed:false},pm.set(e,n)),gI(e,n),n.map||(n.map=uI(t)),n.map}function mm(e,t,n){return n.startsWith(`${t.name}#`)?mI(e,t).get(n)??null:null}var hm=32;function Ko(e,t,n,r){let o=e.part(),a=chunk6K6QQVAZ_cjs.dd(o);if(a.length<=1)return 0;let i=Yl(e,t);if(i!==null)return i;if(n.kind==="headerFooter"){if(r!==void 0&&a[r]!==void 0)return r;let d=e.headerFooterResolutionBySection().findIndex(c=>[c.headers,c.footers].some(p=>[...p.values()].some(b=>b.rId===n.rId)));return d===-1?0:d}let s=yI(e,t);if(s!==null){let d=Yl(e,s);if(d!==null)return d}return 0}function ym(e,t,n,r){let o=e.part(),a=chunk6K6QQVAZ_cjs.dd(o);if(a.length<=1)return {kind:"whole-document"};if(Yl(e,t)!==null)return {kind:"anchor",paragraphId:t};let s=Ko(e,t,n,r),d=a[s];if(!d)return {kind:"unaddressable"};let c=chunk6K6QQVAZ_cjs.Pb(o);for(let p=d.blockStart;p<d.blockEndExclusive;p+=1){let b=hI(c[p]);if(b!==null)return {kind:"anchor",paragraphId:b}}return {kind:"unaddressable"}}function hI(e){if(!e)return null;let t=(n,r)=>{if(n.kind==="textValue"||r>hm)return null;if(n.kind==="paragraph")return n.id;for(let o of n.children){let a=t(o,r+1);if(a!==null)return a}return null};return t(e,0)}function Yl(e,t){return mm(e,e.part(),t)}function yI(e,t){let n=e.currentPackage();for(let r of ["footnote","endnote"]){let o=chunk35MI6K7M_cjs.ge(n,r);if(!(!o||!t.startsWith(`${o.name}#`)))for(let a of chunk35MI6K7M_cjs.Fd(o.root)){let i=chunk35MI6K7M_cjs.ud(a);if(i===null||!bI(a,t))continue;return chunk35MI6K7M_cjs.he(e.part()).find(d=>d.noteKind===r&&d.noteId===i)?.paragraphId??null}}return null}function bI(e,t){let n=(r,o)=>{if(r.kind==="textValue"||o>hm)return false;if(r.kind==="paragraph"&&r.id===t)return true;for(let a of r.children)if(n(a,o+1))return true;return false};return n(e,0)}function Zr(e,t){if(t===void 0)return {};let n=`${e}Autospacing`,r=`${e}Lines`;return t===null?{[e]:null,[n]:null,[r]:null}:{[e]:String(Math.round(t*20)),[n]:"0",[r]:null}}function fi(e){return e===void 0?{}:e===null?{line:null,lineRule:null}:e.rule==="multiple"?{line:String(Math.round(e.value*240)),lineRule:"auto"}:{line:String(Math.round(e.value*20)),lineRule:e.rule==="exact"?"exact":"atLeast"}}function bm(e){return {val:e?"1":"0"}}var vI="list paragraph",xI="ListParagraph";function vm(e){return e.find(t=>t.localName==="pStyle")?.attributes?.val}function xm(e){let{session:t}=e;function n(){let a=null;for(let i of t.documentStyles())if(i.type==="paragraph"){if(i.name.trim().toLowerCase()===vI)return i.styleId;a===null&&i.styleId===xI&&(a=i.styleId);}return a}let r;function o(){let a=t.stylesRoot();return (r===void 0||r.root!==a)&&(r={root:a,styleId:chunk6K6QQVAZ_cjs.Hb(a,t.documentThemeFonts()).defaultParagraphStyleId}),r.styleId}return {applyOps(a){let i=n();if(i===null)return [];let s=o(),d=e.storyPart(),c=[];for(let p of a){let b=chunk35MI6K7M_cjs.Eg(d,p),x=vm(b);x!==void 0&&x!==s||c.push({op:"setParagraphProperties",paragraphId:p,properties:chunk35MI6K7M_cjs.Gg(b,{localName:"pStyle",attributes:{val:i}})});}return c},clearOp(a){let i=n();if(i===null)return null;let s=chunk35MI6K7M_cjs.Eg(e.storyPart(),a);return vm(s)!==i?null:{op:"setParagraphProperties",paragraphId:a,properties:s.filter(d=>d.localName!=="pStyle")}}}}var Ql="a section break that changes where the next section starts cannot be suggested; turn off suggesting to insert it",gi="a section break cannot be inserted inside a table cell",Im="a section break cannot change a section that a locked or linked content control holds",ed="a section break cannot be inserted in locked or linked content";function II(e){let t=new Set,n=new Set,r=a=>{if(a.kind==="textValue"||!("localName"in a)||a.localName!=="sdt")return false;let i=a.children?.find(s=>s.kind!=="textValue"&&"localName"in s&&s.localName==="sdtPr");return !i||i.kind==="textValue"?false:(i.children??[]).some(s=>{if(s.kind==="textValue"||!("localName"in s)||s.namespaceUri!==chunk35MI6K7M_cjs.da)return false;if(s.localName==="dataBinding")return true;if(s.localName!=="lock")return false;let d=s.attributes?.find(c=>c.localName==="val"&&c.namespaceUri===chunk35MI6K7M_cjs.da)?.value;return d==="contentLocked"||d==="sdtContentLocked"})},o=(a,i,s)=>{if(a.kind==="textValue")return;if(a.kind==="paragraph"){i&&t.add(a.id),s&&n.add(a.id);return}let d=i||a.kind==="table",c=s||r(a);for(let p of a.children??[])o(p,d,c);};return o(e.root,false,false),{inCell:t,held:n}}var SI=32;function kI(e){let t=new Set(chunk35MI6K7M_cjs.Jf(e).map(n=>chunk35MI6K7M_cjs.Mf(n)));return chunk35MI6K7M_cjs.If(e)||t.add("nextPage"),t.size===1?[...t][0]:null}function td(e,t){let n=t.replaceAt??t.collapseTo;return chunk35MI6K7M_cjs.Kf(e,n.paragraphId)?t.collapseTo:n}var Jl=(e,t)=>chunk35MI6K7M_cjs.Wd(e,t)||chunk35MI6K7M_cjs.Vd(e,t).content;function pi(e,t,n,r){if(chunk35MI6K7M_cjs.Kf(e,t))return gi;if(Jl(e,t))return ed;let{section:o,ownerId:a}=chunk35MI6K7M_cjs.Lf(e,t);return chunk35MI6K7M_cjs.Mf(o)===n?null:a!==null&&Jl(e,a)?Im:r?Ql:null}function Sm(e){let{breakType:t,suggesting:n}=e;if(e.cellRectangle)return gi;if(e.caretParagraphId!==null)return pi(e.part(),e.caretParagraphId,t,n);let r=II(e.part());if(!n&&r.inCell.size===0&&r.held.size===0)return null;let{from:o,to:a}=e.orderedRange(),i=e.part(),s=chunk35MI6K7M_cjs.Lf(i,o.paragraphId),d=chunk35MI6K7M_cjs.Lf(i,a.paragraphId),c=s.section===d.section,p=c?chunk35MI6K7M_cjs.Mf(s.section):kI(i),b=e.paragraphOrder(),x=b.indexOf(o.paragraphId),w=b.indexOf(a.paragraphId),F=x===-1||w===-1?null:b.slice(x,w+1),T=F!==null&&!F.some(B=>r.inCell.has(B))&&!F.some(B=>r.held.has(B));if(p!==null&&p!==t){if(T&&c&&s.ownerId!==null&&Jl(i,s.ownerId))return Im;if(n&&T)return Ql}if(T&&p!==null)return null;if(F===null||F.length-1>SI)return n&&p!==null&&p!==t?Ql:null;let P=td(i,e.deleteSelectionPlan());return pi(i,P.paragraphId,t,n)}var wI=[["contextualSpacing","contextualSpacing"],["keepNext","keepNext"],["keepLines","keepLines"],["widowControl","widowControl"],["pageBreakBefore","pageBreakBefore"]];function TI(e,t){let n={...e??{}};return delete n.leftChars,delete n.startChars,e?.start!==void 0&&(n.start=t),(e?.start===void 0||e.left!==void 0)&&(n.left=t),n}function mi(e,t,n,r){let o={...e};if(delete o[`${t}Chars`],delete o[`${n}Chars`],r===null)return delete o[t],delete o[n],o;let a=String(r),i=e[n]!==void 0;return i&&(o[n]=a),(!i||e[t]!==void 0)&&(o[t]=a),o}function km(e,t){let n={...e};return delete n.firstLineChars,delete n.hangingChars,t===null?(delete n.firstLine,delete n.hanging,n):(t>=0?(n.firstLine=String(t),n.hanging="0"):(n.hanging=String(-t),n.firstLine="0"),n)}function wm(e){let{session:t,commit:n,orderedStart:r,orderedRange:o,selectionMark:a,collapsedAt:i}=e,s=e.deleteSelectionPlan,d=()=>t.partFor(e.storyScope())??t.part(),c=(S,E,Z)=>t.applyTreeOps(S,E,Z,e.storyScope()),p=xm({session:t,storyPart:d}),b=()=>e.paragraphOrder(),x={get value(){return e.layout()}};function w(){let S=e.selectedCells?.();return S&&S.length>0?S:null}function F(S){let E=false;return n(()=>{let Z=S();return E=Z.committed,Z},void 0,{keepCellSelection:w()!==null}),E}function T(){if(w()!==null)return [...chunk6K6QQVAZ_cjs.ke(x.value,w())];let{from:S,to:E}=o(),Z=b(),k=Z.indexOf(S.paragraphId),O=Z.indexOf(E.paragraphId);return k===-1||O===-1?null:Z.slice(k,O+1)}let P=720,B=8;function h(S){return N(S)?.level??null}function N(S){return chunk6K6QQVAZ_cjs.yc(x.value,S)?.marker??null}function A(S){let E=N(S);return E?E.numFmt==="bullet"?"bullet":"ordered":null}function $(S,E){let Z=b(),k=Z.indexOf(S[0]??""),O=Z.indexOf(S[S.length-1]??"");if(k===-1||O===-1)return null;for(let U of [k-1,O+1]){let K=Z[U];if(!K)continue;let X=N(K);if(X&&(X.numFmt==="bullet"?"bullet":"ordered")===E)return X.numId}return null}function j(S,E){return E<0||E>B?false:e.numberingLevelExists(S.numId,E)}function M(S,E){return E<0||E>B?false:e.numberingLevelExists(S.numId,E)?true:t.ensureNumberingLevel(S.numId,E,S.numFmt==="bullet"?"bullet":"ordered")&&e.numberingLevelExists(S.numId,E)}function G(S){let E;for(let Z of S){if(Z.localName!=="ind")continue;let k=Z.attributes?.left??Z.attributes?.start;k!==void 0&&(E=k);}return !E||!/^-?\d{1,7}$/.test(E)?0:Number(E)}return {insertTab(){let S=s(),E=S.replaceAt??S.collapseTo;n(()=>c([...S.ops,{op:"insertTab",paragraphId:E.paragraphId,offset:E.offset}],a()),()=>i({...E,offset:E.offset+1}));},insertLineBreak(){let S=s(),E=S.replaceAt??S.collapseTo;n(()=>c([...S.ops,{op:"insertHardBreak",paragraphId:E.paragraphId,offset:E.offset}],a()),()=>i({...E,offset:E.offset+1}));},insertPageBreak(){let S=s(),E=S.replaceAt??S.collapseTo;n(()=>c([...S.ops,{op:"insertPageBreak",paragraphId:E.paragraphId,offset:E.offset}],a()),()=>i({...E,offset:E.offset+1}));},exitListOnEmptyItem(){let{from:S,to:E}=o();if(S.paragraphId!==E.paragraphId||S.offset!==E.offset)return false;let Z=N(S.paragraphId);if(!Z||e.paragraphTextOf(S.paragraphId).length>0)return false;let O=Z.level>0&&j(Z,Z.level-1),U=[];if(O)U.push({op:"setListLevel",paragraphId:S.paragraphId,level:Z.level-1});else {let X=p.clearOp(S.paragraphId);X&&U.push(X),U.push({op:"setListNumbering",paragraphId:S.paragraphId,numId:null});}let K=false;return n(()=>{let X=c(U,a());return K=X.committed,X}),K},isListParagraph(){let{paragraphId:S}=r();return h(S)!==null},isListActive(S){let E=T();if(E===null)return false;let Z=S==="bullet"?"bullet":"ordered";return E.length>0&&E.every(k=>A(k)===Z)},toggleList(S){let E=T();if(E===null||E.length===0)return false;let Z=E.every(U=>A(U)===S),k=Z?null:$(E,S)??t.ensureListDefinition(S);if(!Z&&k===null)return false;let O=Z?[]:p.applyOps(E);for(let U of E){let K=h(U);O.push({op:"setListNumbering",paragraphId:U,numId:k,...K!==null?{level:K}:{}});}return F(()=>c(O,a()))},canAdjustIndent(S){let E=T();if(E===null)return false;let Z=S==="increase"?1:-1;return E.some(k=>{let O=N(k);if(O){let K=O.level+Z;return K>=0&&K<=B}let U=G(Br(x.value,k));return Math.max(0,U+Z*P)!==U})},adjustIndent(S){let E=T();if(E===null)return false;let Z=S==="increase"?1:-1,k=[];for(let O of E){let U=Br(x.value,O),K=N(O),X=K?.level??null;if(K&&X!==null){let fe=X+Z;if(fe<0||fe>B||!M(K,fe))continue;k.push({op:"setListLevel",paragraphId:O,level:fe});continue}let ce=G(U),we=Math.max(0,ce+Z*P);if(we===ce)continue;let me=chunk35MI6K7M_cjs.Eg(d(),O),he=me.find(fe=>fe.localName==="ind");k.push({op:"setParagraphProperties",paragraphId:O,properties:chunk35MI6K7M_cjs.Gg(me,{localName:"ind",attributes:TI(he?.attributes,String(we))})});}return k.length===0?false:F(()=>c(k,a()))},setIndent(S){if(S.left===void 0&&S.right===void 0&&S.firstLine===void 0)return false;let E=T();if(E===null)return false;let Z=[];for(let k of E){let O=chunk35MI6K7M_cjs.Eg(d(),k),K={...O.find(X=>X.localName==="ind")?.attributes??{}};S.left!==void 0&&(K=mi(K,"left","start",S.left)),S.right!==void 0&&(K=mi(K,"right","end",S.right)),S.firstLine!==void 0&&(K=km(K,S.firstLine)),Z.push({op:"setParagraphProperties",paragraphId:k,properties:chunk35MI6K7M_cjs.Gg(O,{localName:"ind",...Object.keys(K).length>0?{attributes:K}:{}})});}return Z.length===0?false:F(()=>c(Z,a()))},setParagraphFormat(S){let E=T();if(E===null||E.length===0)return false;let Z=[];S.alignment!==void 0&&Z.push({localName:"jc",attributes:{val:S.alignment}});let k={...Zr("before",S.spaceBeforePt),...Zr("after",S.spaceAfterPt),...fi(S.lineSpacing)};Object.keys(k).length>0&&Z.push({localName:"spacing",attributes:k,mergeAttributes:true});for(let[X,ce]of wI){let we=S[X];we!==void 0&&Z.push({localName:ce,attributes:bm(we)});}let O=S.tabStops!==void 0,U=S.indentLeftTwips!==void 0||S.indentRightTwips!==void 0||S.indentFirstLineTwips!==void 0;if(Z.length===0&&!U&&!O)return false;let K=[];for(let X of E){let ce=chunk35MI6K7M_cjs.Eg(d(),X),we=ce;if(U){let he={...ce.find(fe=>fe.localName==="ind")?.attributes??{}};S.indentLeftTwips!==void 0&&(he=mi(he,"left","start",S.indentLeftTwips)),S.indentRightTwips!==void 0&&(he=mi(he,"right","end",S.indentRightTwips)),S.indentFirstLineTwips!==void 0&&(he=km(he,S.indentFirstLineTwips)),we=chunk35MI6K7M_cjs.Gg(we,{localName:"ind",...Object.keys(he).length>0?{attributes:he}:{}});}for(let me of Z){let he=me.mergeAttributes?{...we.find(Ge=>Ge.localName===me.localName)?.attributes??{},...me.attributes}:me.attributes??{},fe=Object.fromEntries(Object.entries(he).filter(([,Ge])=>Ge!=null));we=chunk35MI6K7M_cjs.Gg(we,{localName:me.localName,...Object.keys(fe).length>0?{attributes:fe}:{}});}if((Z.length>0||U)&&K.push({op:"setParagraphProperties",paragraphId:X,properties:we}),O){let me=jo(e.layout(),X);K.push({op:"setParagraphTabStops",paragraphId:X,stops:S.tabStops.map(he=>({positionTwips:Math.round(he.positionTwips),alignment:he.alignment,...he.leader&&he.leader!=="none"?{leader:he.leader}:{}})),...me?{inForcePositionsTwips:me.stops.map(he=>Math.round(he.positionPt*20))}:{}});}}return K.length===0?false:F(()=>c(K,a()))},sectionProperties:()=>chunk6K6QQVAZ_cjs.cd(t.part()),sectionPropertiesAt(S){let E=chunk6K6QQVAZ_cjs.dd(t.part()),Z=Ko(t,S,e.storyScope(),e.headerFooterSectionIndex?.());return (E[Z]??E[E.length-1]).properties},sectionAnchorParagraphAt(S){return ym(t,S,e.storyScope(),e.headerFooterSectionIndex?.())},setSectionProperties(S){let E=false;return n(()=>{let Z=e.storyScope().kind==="body",k=t.applyTreeOps([{op:"setSectionProperties",...S}],Z?a():void 0,void 0,{kind:"body"});return E=k.committed,k}),E},sectionBreakRefusal(S="nextPage"){return e.storyScope().kind!=="body"?null:Sm({part:()=>t.part(),breakType:S,suggesting:e.editingMode?.()==="suggest",cellRectangle:(e.selectedCells?.()?.length??0)>0,caretParagraphId:e.caretParagraphId?.()??null,orderedRange:o,paragraphOrder:b,deleteSelectionPlan:s})},insertSectionBreak(S="nextPage"){if(e.storyScope().kind!=="body")return false;let E=s(),Z=td(t.part(),E),k=(chunk35MI6K7M_cjs.Kf(t.part(),Z.paragraphId)?gi:null)??pi(t.part(),Z.paragraphId,S,e.editingMode?.()==="suggest");if(k!==null)return e.publishRefusal?.(k),false;let O=new Set(t.paragraphIds()),U=false,K=false;return n(()=>{let X=t.applyTreeOps([...E.ops,{op:"splitParagraph",paragraphId:Z.paragraphId,offset:Z.offset},{op:"setSectionMark",paragraphId:Z.paragraphId,breakType:S}],a(),void 0,{kind:"body"});return U=X.committed,K=X.reason==="locked"||X.reason==="bound",X},()=>{let X=t.paragraphIds().find(ce=>!O.has(ce));return X?i({paragraphId:X,offset:0}):null}),!U&&K&&e.publishRefusal?.(ed),U}}}var PI=4096;function CI(e){let t=e.tooltip!==null?{tooltip:chunk35MI6K7M_cjs.q(e.tooltip)}:{};if(e.target!==null){let n=chunk35MI6K7M_cjs.L(e.target);if(n.ok&&n.href.length>0&&chunk35MI6K7M_cjs.x(n.href).ok){let o=e.anchor!==null&&!n.href.includes("#")?chunk35MI6K7M_cjs.L(chunk35MI6K7M_cjs.q(e.anchor)):null;return {kind:"external",href:o&&o.ok&&o.href.length>0?`${n.href}#${o.href}`:n.href,authored:e.target,...e.anchor!==null?{anchor:chunk35MI6K7M_cjs.q(e.anchor)}:{},...t}}if(e.anchor===null)return null}if(e.anchor!==null){let n=chunk35MI6K7M_cjs.q(e.anchor),r=chunk35MI6K7M_cjs.L(n);return {kind:"internal",href:r.ok&&r.href.length>0?`#${r.href}`:null,authored:e.anchor,anchor:n,...t}}return null}function Tm(){let e=new Map,t=new Map,n=0;return {project(r){let o=CI(r);if(!o)return null;let a=`${r.target??""}\0${r.anchor??""}\0${r.tooltip??""}`,i=e.get(a);if(i===void 0){if(e.size>=PI)return null;n+=1,i=`field-hyperlink:${n}`,e.set(a,i),t.set(i,Object.freeze({id:i,paragraphId:"",start:0,end:0,text:"",kind:o.kind,href:o.href,authored:o.authored,...o.anchor!==void 0?{anchor:o.anchor}:{},...o.tooltip!==void 0?{tooltip:o.tooltip}:{}}));}return {id:i,kind:o.kind,href:o.href,...o.anchor!==void 0?{anchor:o.anchor}:{},...o.tooltip!==void 0?{tooltip:o.tooltip}:{}}},linkById(r){return t.get(r)??null}}}var Om=32;function Fm(e){return e.kind!=="textValue"&&e.kind==="contentControl"}function RI(e){return e.kind!=="textValue"&&e.kind==="contentControlContent"}function nd(e){return e.kind==="textValue"?[]:e.children}function EI(e){return e.kind==="hyperlink"||Fm(e)||chunk35MI6K7M_cjs.ka(e.kind)}function Am(e,t=0){if(e.kind==="textValue")return e.value;if(t>=Om||e.kind==="deletedText"||OI(e.kind)||chunk35MI6K7M_cjs.hc(e)||e.kind==="runProperties")return "";if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunk35MI6K7M_cjs.$b(e);let n=EI(e)?t+1:t,r="";for(let o of e.children)r+=Am(o,n);return r}function OI(e){return e==="revisionDelete"||e==="revisionMoveFrom"}function rd(e,t,n){if(!(t>=Om))for(let r of e){if(r.kind==="hyperlink"){n(r);continue}if(chunk35MI6K7M_cjs.ka(r.kind)){rd(nd(r),t+1,n);continue}if(Fm(r)){for(let o of nd(r))RI(o)&&rd(nd(o),t+1,n);continue}n(r);}}function Pm(e,t,n){let r=FI(e,t);if(!r||r.kind!=="paragraph")return [];let o=chunk35MI6K7M_cjs.$d(r),a=[],i=0;return rd(r.children,0,s=>{let d=o.spanOf(s);if(d&&(i=Math.max(i,d.end)),s.kind!=="hyperlink")return;let c=d?d.start:i,p=d?d.end:i,b=chunk35MI6K7M_cjs.Oa(s,n);a.push({id:s.id,paragraphId:t,start:c,end:p,text:Am(s),kind:b.kind,href:b.href,authored:b.authored,...b.anchor!==void 0?{anchor:b.anchor}:{},...b.tooltip!==void 0?{tooltip:b.tooltip}:{}});}),a}function FI(e,t){let n=r=>{if(r.kind==="textValue")return r.id===t?r:null;if(r.id===t)return r;for(let o of r.children){let a=n(o);if(a)return a}return null};return n(e.root)}function AI(e,t){for(let n of e)if(n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)return n;return null}function MI(e,t){for(let n of chunk6K6QQVAZ_cjs.ba(e,t.paragraphId))for(let r of n.lines)for(let o of r.spans)if(!(!o.fieldAtom||!o.link)&&t.offset>=o.range.start&&t.offset<=o.range.end)return o.link.id;return null}function Mm(e){let t=()=>e.storyScope(),n=()=>e.session.partFor(t()),r=c=>e.session.relationshipTarget(c,t()),o=(c,p,b)=>e.session.applyTreeOps(c,p,b,t()),a=c=>{let p=n();return p?Pm(p,c,r):[]},i=()=>AI(a(e.selection().head.paragraphId),e.selection().head),s=()=>{let c=e.selection().head,p=MI(e.layout(),c);return p===null?null:e.fieldLinkById(p)},d=c=>{let p=e.selection().head.paragraphId,b=a(p).find(x=>x.id===c);if(b)return b;for(let x of e.session.storyParts()){let w=F=>chunk35MI6K7M_cjs.bd(e.session.currentPackage(),x.name,F);for(let F of chunk35MI6K7M_cjs.Se(x))for(let T of chunk35MI6K7M_cjs.Ve(F.root)){let P=T.id,B=Pm(x,P,w).find(h=>h.id===c);if(B)return B}}return null};return {linksInCaretParagraph:()=>a(e.selection().head.paragraphId),linkAtCaret:i,fieldLinkAtCaret:s,linkById:d,applyHyperlink(c){let p=c.url!==void 0&&c.url.length>0,b=c.anchor!==void 0&&c.anchor.length>0;if(p===b)return false;let x=t();if(!n()||e.refusesWrite())return false;let w;if(p){let S=e.session.ensureHyperlinkRelationship(c.url,x);if(!S)return false;w=S;}let F={...w!==void 0?{relationshipId:w}:{},...b?{anchor:c.anchor}:{},...c.tooltip!==void 0?{tooltip:c.tooltip}:{}},T=i(),P=e.orderedRange(),B=P.from.paragraphId===P.to.paragraphId&&P.from.offset===P.to.offset;if(T&&(B||LI(T,P))){let S=[];if(c.text!==void 0&&c.text!==T.text){if(c.text.length===0)return false;let Z=e.suggestReplacementOffset?.(T.paragraphId,T.start,T.end),k=e.textOf(T.paragraphId).slice(T.start,T.start+2),O=T.start+(k.length===2&&k.charCodeAt(0)>=55296&&k.charCodeAt(0)<=56319&&k.charCodeAt(1)>=56320&&k.charCodeAt(1)<=57343?2:1);if(Z!=null&&Z>T.start&&O<T.end)S.push({op:"setHyperlinkTarget",linkId:T.id,...F},{op:"deleteText",paragraphId:T.paragraphId,start:T.start,end:T.end},{op:"insertText",paragraphId:T.paragraphId,offset:O,text:c.text});else if(Z!=null){let U=Cm(e.session);S.push({op:"setHyperlinkTarget",linkId:T.id,...F},...Rm(T,Z,c.text),{op:"insertHyperlink",paragraphId:T.paragraphId,start:Z,end:Z+c.text.length,...F,...U?{styleId:U}:{}});}else {let U=Em(T.paragraphId,T.start,T.end,c.text);if(!U)return false;S.push({op:"setHyperlinkTarget",linkId:T.id,...F},...U);}}else S.push({op:"setHyperlinkTarget",linkId:T.id,...F});let E=false;return e.commit(()=>{let Z=o(S,e.selectionMark());return E=Z.committed,Z},()=>null),E}let h=P.from.paragraphId;if(P.to.paragraphId!==h)return false;let N=[],A=P.from.offset,$=P.to.offset;if(B){let S=c.text??c.url??c.anchor??"";if(S.length===0)return false;A=e.insertionLanding?.(h,A)??A,N.push({op:"insertText",paragraphId:h,offset:A,text:S}),$=A+S.length;}else {let S=e.suggestReplacementOffset?.(h,A,$);if(S!=null){let E=c.text??e.textOf(h).slice(A,$);if(E.length===0)return false;N.push(...Rm({paragraphId:h,start:A,end:$},S,E)),A=S,$=S+E.length;}else if(c.text!==void 0&&c.text!==e.textOf(h).slice(A,$)){let E=Em(h,A,$,c.text);if(!E)return false;N.push(...E),$=A+c.text.length;}}if($<=A)return false;let j=Cm(e.session);N.push({op:"insertHyperlink",paragraphId:h,start:A,end:$,...F,...j?{styleId:j}:{}});let M=false,G={paragraphId:h,offset:$};return e.commit(()=>{let S=o(N,e.selectionMark(),{paragraphId:h,start:$,end:$});return M=S.committed,S},()=>({anchor:G,head:G})),M},removeHyperlink(c){if(!n())return false;let p=c?d(c):i();if(!p)return false;let b=false,x={paragraphId:p.paragraphId,offset:p.end};return e.commit(()=>{let w=o([{op:"removeHyperlink",linkId:p.id}],e.selectionMark());return b=w.committed,w},()=>({anchor:x,head:x})),b}}}function Cm(e){for(let t of e.documentStyles())if(t.type==="character"&&t.styleId.toLowerCase()==="hyperlink")return t.styleId;return null}function LI(e,t){return t.from.paragraphId===e.paragraphId&&t.to.paragraphId===e.paragraphId&&t.from.offset>=e.start&&t.to.offset<=e.end}function Rm(e,t,n){return [{op:"deleteText",paragraphId:e.paragraphId,start:e.start,end:e.end},{op:"insertText",paragraphId:e.paragraphId,offset:t,text:n}]}function Em(e,t,n,r){if(r.length===0)return null;let o=[{op:"insertText",paragraphId:e,offset:t,text:r,bias:"right"}];return n>t&&o.push({op:"deleteText",paragraphId:e,start:t+r.length,end:n+r.length}),o}var NI="equation replacement and removal are not supported in suggesting mode",Lm=new WeakMap;function Nm(e,t){let n=chunk35MI6K7M_cjs.ya(e,t);if(!n||n.kind!=="paragraph")return [];let r=Lm.get(n);if(r)return r;let o=[];for(let i of chunk35MI6K7M_cjs._d(n)){let s=i.node;if(s.kind==="textValue"||s.kind!=="generic"||s.namespaceUri!==chunk35MI6K7M_cjs.Eb||s.localName!=="oMath")continue;let d=chunk35MI6K7M_cjs.Gb(s);d&&o.push(Object.freeze({id:s.id,paragraphId:t,start:i.start,end:i.end,linear:chunk35MI6K7M_cjs.Ib(d.expression),fallbackText:d.fallbackText,supported:Bt(d.expression)}));}let a=Object.freeze(o);return Lm.set(n,a),a}function Bt(e){switch(e.kind){case "fallback":return false;case "text":return true;case "row":return e.items.every(Bt);case "fraction":return Bt(e.numerator)&&Bt(e.denominator);case "radical":return Bt(e.radicand)&&(e.degree===void 0||Bt(e.degree));case "script":return Bt(e.base)&&(e.subscript===void 0||Bt(e.subscript))&&(e.superscript===void 0||Bt(e.superscript));case "nary":return Bt(e.body)&&(e.lowerLimit===void 0||Bt(e.lowerLimit))&&(e.upperLimit===void 0||Bt(e.upperLimit))}}function Dm(e,t){return e.find(n=>n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)??null}function Hm(e){let t=null,n=i=>{let s=e.pagesLayer.ownerDocument.defaultView;if(!s||!(i instanceof s.Element))return null;let d=i.closest("[data-docx-equation]");return d&&e.pagesLayer.contains(d)?d:null},r=(i,s)=>{let d=e.equationById(i);d&&(e.setSelection({anchor:{paragraphId:d.paragraphId,offset:d.start},head:{paragraphId:d.paragraphId,offset:d.end}}),e.onPopover?.({equation:d,rect:s}));},o=i=>{t=null;let s=n(i.target),d=s?.dataset.docxEquation;if(!s||!d)return;let c=s.getBoundingClientRect();t={equationId:d,rect:{left:c.left,top:c.top,right:c.right,bottom:c.bottom}};},a=i=>{let s=n(i.target),d=s?.dataset.docxEquation,c=t;if(t=null,!s||!d){if(!c)return;i.preventDefault(),r(c.equationId,c.rect);return}let p=s.getBoundingClientRect();i.preventDefault(),r(d,{left:p.left,top:p.top,right:p.right,bottom:p.bottom});};return e.pagesLayer.addEventListener("pointerdown",o,true),e.pagesLayer.addEventListener("click",a),{destroy:()=>{e.pagesLayer.removeEventListener("pointerdown",o,true),e.pagesLayer.removeEventListener("click",a);}}}function _m(e){let t=()=>e.session.partFor(e.storyScope()),n=d=>{let c=t();return c?Nm(c,d):[]},r=()=>{let d=e.selection().head;return Dm(n(d.paragraphId),d)},o=d=>{let c=n(e.selection().head.paragraphId).find(p=>p.id===d);if(c)return c;for(let p of e.session.storyParts()){let b=chunk35MI6K7M_cjs.ya(p,d);if(!b||b.kind!=="generic"||b.namespaceUri!==chunk35MI6K7M_cjs.Eb||b.localName!=="oMath")continue;let x=b;for(;x&&x.kind!=="paragraph";)x=chunk35MI6K7M_cjs.za(p,x.id);return !x||x.kind!=="paragraph"?null:Nm(p,x.id).find(w=>w.id===d)??null}return null},a=(d,c)=>{let p=false,b={paragraphId:d.paragraphId,offset:d.start};return e.commit(()=>{let x=e.session.applyTreeOps([c],e.selectionMark(),{paragraphId:b.paragraphId,start:b.offset,end:b.offset},e.storyScope());return p=x.committed,x},()=>({anchor:b,head:b})),p},i=(d,c)=>{let p=o(d);if(!p)return {ok:false,code:"notFound",reason:"no equation with that id"};if(e.editingMode()==="suggest")return {ok:false,code:"unsupported",reason:NI};let b=c==="replace"?{op:"setMathEquation",equationId:d,linear:p.linear}:{op:"removeMathEquation",equationId:d},x=e.writeRefusal(b);return x===null?{ok:true}:{ok:false,code:"locked",reason:x}},s=d=>(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:d.reason})),false);return {equationsInCaretParagraph:()=>[...n(e.selection().head.paragraphId)],equationAtCaret:r,equationById:o,can:i,applyEquation(d,c){let p=o(d);if(!p)return false;let b=i(d,"replace");return b.ok?p.supported&&p.linear===c?true:a(p,{op:"setMathEquation",equationId:d,linear:c}):s(b)},removeEquation(d){let c=o(d);if(!c)return false;let p=i(d,"remove");return p.ok?a(c,{op:"removeMathEquation",equationId:d}):s(p)}}}var DI=24;function Bm(e){let{pagesLayer:t}=e,n=t.ownerDocument.defaultView;function r(){return e.container.closest(".docx-editor__scroll-container")}let o=x=>{if(!x||x.length===0||x.startsWith("#"))return false;let w=chunk35MI6K7M_cjs.L(x);return !w.ok||!w.href||!n?false:(n.open(w.href,"_blank","noopener,noreferrer"),true)},a=x=>{if(e.enterStoryFor&&!e.enterStoryFor(x.paragraphId))return false;let w=e.layout(),F=chunk6K6QQVAZ_cjs.$d(w,x);if(!F)return false;let T=w.pages[F.pageIndex];if(!T)return false;let P=T.box.y+(T.contentBox.y-T.box.y)+F.y,B=r();return B&&(B.scrollTop=Math.max(0,P*e.scale()-DI),e.onScrolled?.()),e.setSelection(x),true},i=x=>{let w=e.bookmarks().get(x);return w?a(w):false},s=null;function d(x){if(!x||x.closest("[data-docx-hf]"))return null;let w=x.closest("a.docx-hyperlink");if(w){let T=w.dataset.docxLink;return T?{linkId:T,drawing:false}:null}let F=x.closest("[data-docx-drawing-link]");if(F){let T=F.dataset.docxDrawingLink;return T?{linkId:T,drawing:true}:null}return null}let c=x=>{s=null;let w=x.target,F=d(w);if(!F)return;let P=w.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();s={linkId:F.linkId,drawing:F.drawing,rect:{left:P.left,top:P.top,bottom:P.bottom,right:P.right}};},p=x=>{let w=x.target,F=d(w);if(!F){let B=s;if(s=null,!B)return;x.preventDefault(),b(B.linkId,B.rect,x,B.drawing);return}s=null,x.preventDefault();let P=w.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();b(F.linkId,{left:P.left,top:P.top,bottom:P.bottom,right:P.right},x,F.drawing);};function b(x,w,F,T){let P=T?e.drawingLinkById?.(x)??null:e.linkById(x);if(!P)return;if(F.metaKey||F.ctrlKey){P.kind==="external"?o(P.href):P.anchor&&i(P.anchor);return}if(e.isCollapsedSelection()){if(P.kind==="internal"){P.anchor&&i(P.anchor);return}e.onPopover?.({link:P,rect:w});}}return t.addEventListener("pointerdown",c,true),t.addEventListener("click",p),{goToPosition:a,goToBookmark:i,openExternal:o,destroy(){t.removeEventListener("pointerdown",c,true),t.removeEventListener("click",p);}}}function HI(e){let t=e.hyperlinkHref;if(!t)return null;let n=e.kind==="anchoredDrawing"?e.anchorParagraphId:e.paragraphId,r=e.kind==="inlineDrawing"?e.start:0,o=t.startsWith("#")?"internal":"external";return Object.freeze({id:e.drawingNodeId,paragraphId:n,start:r,end:r+1,text:"",kind:o,href:t,authored:t,...o==="internal"?{anchor:t.slice(1)}:{}})}function od(e,t){return e.drawingNodeId!==t?null:HI(e)}function qm(e,t){if(!e)return null;for(let n of e.anchoredDrawings??[]){let r=od(n,t);if(r)return r}return null}function _I(e,t){for(let r of e.anchoredDrawings??[]){let o=od(r,t);if(o)return o}for(let r of e.fragments){if(r.kind==="table"){for(let a of r.rows)for(let i of a.cells)for(let s of i.blocks){let d=zm(s,t);if(d)return d}continue}let o=Zm(r,t);if(o)return o}let n=qm(e.header,t);return n||qm(e.footer,t)}function Zm(e,t){for(let n of e.lines)for(let r of n.drawings??[]){let o=od(r,t);if(o)return o}return null}function zm(e,t){if(e.kind==="table"){for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks){let a=zm(o,t);if(a)return a}return null}return Zm(e,t)}function $m(e,t){for(let n of e.pages){let r=_I(n,t);if(r)return r}return null}function jm(e){return {applyHeaderFooterLifecycle(t){let n=null;return e.commit(()=>{let r=e.applyOps([t]);return r.rejected&&(n=String(r.reason??"rejected")),r}),n?{ok:false,reason:n}:{ok:true}},insertPageField(t){if(!e.isHeaderFooterOpen())return false;let n=e.deleteSelectionPlan(),r=n.replaceAt??n.collapseTo;return e.commit(()=>e.applyOps([...n.ops,{op:"insertPageField",paragraphId:r.paragraphId,offset:r.offset,field:t}],e.selectionMark()),()=>e.collapsedAt({paragraphId:r.paragraphId,offset:r.offset+(t==="PAGE_X_OF_Y"?6:1)})),e.lastRejection()===null}}}var Vo="the document is open for viewing",ad="image changes are not supported in suggesting mode",Km="tracked changes need a non-empty author";function Vm(e){function t(){return {committed:false,rejected:true,opCount:0,reason:Vo}}function n(){return {committed:false,rejected:true,opCount:0,reason:ad}}return {applyDrawingOps(r){if(e.editingMode()==="view")return t();if(e.editingMode()==="suggest")return n();let o=e.selectionMark(),a={committed:false,rejected:true,opCount:0};return e.commit(()=>(a=e.applyOps(r,o,o),a)),a},applyImageProperties(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:Vo};if(e.editingMode()==="suggest")return {ok:false,reason:"invalidArgs",detail:ad};let o={ok:false,reason:"invalidArgs"};return e.commit(()=>(o=e.session.applyImageProperties(e.storyScope(),r),{committed:o.ok,rejected:!o.ok,opCount:o.ok?1:0,...o.ok?{}:{reason:o.detail??o.reason}})),o},deleteImage(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:Vo};let o=e.editingMode()==="suggest",a=e.author();if(o&&(a===void 0||a===""))return {ok:false,reason:"invalidArgs",detail:Km};let i={ok:false,reason:"invalidArgs"};return e.commit(()=>(i=o?e.session.deleteImageTracked(e.storyScope(),r,{author:a,date:e.trackedDate()}):e.session.deleteImage(e.storyScope(),r),{committed:i.ok,rejected:!i.ok,opCount:i.ok?1:0,...i.ok?{}:{reason:i.detail??i.reason}})),i},insertImage(r){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Vo});let o=e.editingMode()==="suggest",a=e.author();return o&&(a===void 0||a==="")?Promise.resolve({ok:false,reason:"invalidArgs",detail:Km}):e.session.insertImage(e.storyScope(),{...r,decodePort:e.decodePort(),...o?{revision:{author:a,date:e.trackedDate()}}:{}})},replaceImage(r,o,a,i){return e.editingMode()==="view"?Promise.resolve({ok:false,reason:"invalidArgs",detail:Vo}):e.editingMode()==="suggest"?Promise.resolve({ok:false,reason:"invalidArgs",detail:ad}):e.session.replaceImage(e.storyScope(),r,o,a,e.decodePort(),i)}}}function Um(e){let t=null,n=null,r="",o=()=>{if(!t)return;let s=uf(e.layout(),t,e.materializedPages?.());s!==t.pageIndex&&(t={...t,pageIndex:s,sectionIndex:e.sectionAtPage(s).sectionIndex});},a=s=>{if(e.entryRefused?.()===true&&t?.scope.rId!==s.rId||!s.rId||e.session.partFor({kind:"headerFooter",rId:s.rId})===null)return false;t?.scope.rId!==s.rId&&e.leaveOtherStories?.();let d=e.layout(),c=lf(d,s.rId),p=t,b=p?.scope.rId===s.rId,x=c?null:BI(e.session,s.rId);if(!c&&!x)return false;let w=s.pageIndex??(b&&p?p.pageIndex:c?.pageIndex??0),F=s.kind??(b&&p?p.kind:c?.kind??x.kind),T=s.variant??(b&&p?p.variant:c?.story.variant??x.variant),P=b&&p?p.partName:c?.story.partName??x.partName,B=d.pages[w]??d.pages[c?.pageIndex??0],h=(B?Tr(B,{scope:{kind:"headerFooter",rId:s.rId},kind:F,partName:P}):null)??c?.story??{scope:{rId:s.rId},variant:T,partName:P},N=e.selection(),A=p?p.savedBodySelection:{anchor:{...N.anchor},head:{...N.head}},$=b&&p?.sectionIndex!==void 0&&w===p.pageIndex,j=s.sectionIndex??($?p.sectionIndex:c?e.sectionAtPage(w).sectionIndex:x?.sectionIndex);t={scope:{kind:"headerFooter",rId:s.rId},pageIndex:w,...j!==void 0?{sectionIndex:j}:{},kind:F,variant:h.variant,partName:h.partName,savedBodySelection:A};let G=e.session.paragraphIdsIn($a(t))[0];if(!G)return t=null,false;let S=s.position?ja(d,{anchor:s.position,head:s.position},t):b?ja(d,N,t):{anchor:{paragraphId:G,offset:0},head:{paragraphId:G,offset:0}};return e.setScopeSelection(S),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify(),true},i=()=>{if(!t)return;let s=t.savedBodySelection;t=null,e.setScopeSelection(ja(e.layout(),s,null)),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify();};return {getActive:()=>t,activeScope:()=>sf(t),setActiveScope(s){return s.kind==="body"?(i(),true):s.kind==="headerFooter"?a({rId:s.rId}):false},enterHeaderFooter:a,exitHeaderFooter:i,reconcileOccurrence:o,headerFooterState(){if(!t)return null;let s=e.session.headerFooterResolutionBySection(),d=t.sectionIndex??0,c,p,b,x=B=>{let h=s[B];if(!h)return false;let A=(t.kind==="header"?h.headers:h.footers).get(t.variant);return !A||A.rId!==t.scope.rId?false:(d=B,c=A.inherited,p=h.titlePage,b=h.evenAndOddHeaders,true)};if(!(t.sectionIndex!==void 0&&x(t.sectionIndex))){let B;s.forEach((h,N)=>{let $=(t.kind==="header"?h.headers:h.footers).get(t.variant);!$||$.rId!==t.scope.rId||!(B===void 0||B&&!$.inherited||B===$.inherited&&N<d)||(d=N,c=$.inherited,p=h.titlePage,b=h.evenAndOddHeaders,B=$.inherited);});}let w=chunk6K6QQVAZ_cjs.dd(e.session.part()),F=w[d]?.properties??w.at(-1)?.properties,T=F?.margins.headerTwips,P=F?.margins.footerTwips;return {editing:t.kind,sectionIndex:d,variant:t.variant,rId:t.scope.rId,partName:t.partName,...c!==void 0?{inherited:c}:{},...p!==void 0?{titlePage:p}:{},...b!==void 0?{evenAndOddHeaders:b}:{},...T!==void 0?{headerDistanceTwips:T}:{},...P!==void 0?{footerDistanceTwips:P}:{}}},headerFooterStateStable(s){if(!t)return n=null,r="",null;let d=this.headerFooterState();if(!d)return null;let c=[s,d.editing,d.sectionIndex,d.variant??"",d.rId??"",d.partName??"",String(d.inherited),String(d.titlePage),String(d.evenAndOddHeaders),String(d.headerDistanceTwips??""),String(d.footerDistanceTwips??"")].join("|");return n&&r===c||(n=Object.freeze({...d}),r=c),n}}}function BI(e,t){let n=e.headerFooterResolutionBySection();for(let r=0;r<n.length;r+=1){let o=n[r];for(let a of ["header","footer"]){let i=a==="header"?o.headers:o.footers;for(let[s,d]of i)if(d.rId===t)return {sectionIndex:r,kind:a,variant:s,partName:d.partName}}}return null}function Gm(e){let t=null,n=null,r=null,o=(i,s)=>(e.setLastRejection(null),e.commit(()=>{let d=e.applyOps(Array.isArray(i)?i:[i],e.selectionMark());return d.rejected&&e.setLastRejection(String(d.reason??"rejected")),d},s),e.lastRejection()===null),a=(i,s,d)=>{let c=chunk35MI6K7M_cjs.ld(i);if(!c)return e.setLastRejection("invalid note scope id"),false;let p=e.session.currentPackage(),b=chunk35MI6K7M_cjs.ge(p,c.noteKind),x=b?chunk35MI6K7M_cjs.Gd(b.root,c.noteId):null;if(!b||!x)return e.setLastRejection("note not found"),false;if(e.exitHeaderFooter?.(),e.activeScope().kind==="body"){let w=e.selection();r={anchor:{paragraphId:w.anchor.paragraphId,offset:w.anchor.offset},head:{paragraphId:w.head.paragraphId,offset:w.head.offset}};}if(t={kind:"note",id:chunk35MI6K7M_cjs.kd(c.noteKind,c.noteId)},n=Number.isInteger(d)?d:null,s)e.setSelection({anchor:s,head:s});else {let w=qI(x),F=new Set(e.session.paragraphIdsIn({kind:"notesPart",noteKind:c.noteKind})),T=w.find(P=>F.has(P.id));if(T){let P=ZI(T);e.setSelection({anchor:{paragraphId:T.id,offset:P},head:{paragraphId:T.id,offset:P}});}}return e.noteModelMoved(),e.render(),n??=e.revealNote(t.id),e.notify(),true};return {insertNote(i){if(e.activeScope().kind!=="body")return e.setLastRejection("insertNote requires body scope"),false;let s=e.deleteSelectionPlan(),d=s.collapseTo;if(!(s.ops.length===0||o(s.ops,()=>({anchor:{...d},head:{...d}}))))return false;let p=Wm(e.session.currentPackage(),i);if(!o({op:"insertNote",noteKind:i,paragraphId:d.paragraphId,offset:d.offset},()=>{let F={paragraphId:d.paragraphId,offset:d.offset+1};return {anchor:F,head:F}}))return s.ops.length>0&&e.undo(),false;let w=[...Wm(e.session.currentPackage(),i)].find(F=>!p.has(F));return w===void 0?true:a(chunk35MI6K7M_cjs.kd(i,w))},deleteNote(i,s){return o({op:"deleteNote",noteKind:i,noteId:s})},convertNote(i,s){return o({op:"convertNote",fromKind:i,noteId:s})},convertAllNotes(i){return o({op:"convertAllNotes",fromKind:i})},setNoteProperties(i){return o({op:"setNoteProperties",scope:i.scope,sectionIndex:i.sectionIndex,footnote:i.footnote,endnote:i.endnote})},enterNote:a,exitNote(i=true){if(!t)return;let s=r;t=null,n=null,r=null,e.setActiveScopeBodyOrHf({kind:"body"}),i&&s&&e.setSelection(s),e.noteModelMoved(),e.render(),e.notify();},activeNoteScope(){return t},activeNotePageIndex(){return n},setActiveNotePageIndex(i){!t||!Number.isInteger(i)||n!==i&&(n=i);}}}function qI(e){let t=[],n=(r,o)=>{if(!(o>32)){if(r.kind==="paragraph"){t.push(r);return}if("children"in r)for(let a of r.children)n(a,o+1);}};return n(e,0),t}function ZI(e){let t=chunk35MI6K7M_cjs._d(e)[0];return t&&chunk35MI6K7M_cjs.qd(t.node)?t.end:0}function Wm(e,t){let n=chunk35MI6K7M_cjs.ge(e,t),r=new Set;if(!n)return r;for(let o of chunk35MI6K7M_cjs.Fd(n.root)){if(!chunk35MI6K7M_cjs.wd(o))continue;let a=chunk35MI6K7M_cjs.ud(o);a!==null&&r.add(a);}return r}var zI=500;function $I(e,t){let n=e.part(),r=chunk6K6QQVAZ_cjs.Pb(n),o=[];for(let a=0;a<r.length;a+=1){let i=r[a];if(i.kind!=="paragraph")continue;let s=chunk6K6QQVAZ_cjs.bd(i);s&&o.push(s);}if(o.length<t.length){let a=chunk6K6QQVAZ_cjs.ad(e.part());o.push(a&&a.kind!=="textValue"?a:void 0);}for(;o.length<t.length;)o.push(void 0);return o}function Xm(e){if(!e)return null;let t=e.session,n=e.state().selection.head.paragraphId,r=Ko(t,n,e.activeScope().kind==="headerFooter"?{kind:"headerFooter",rId:e.headerFooterState()?.rId??""}:gt(t,n,{kind:"body"}),e.headerFooterState()?.sectionIndex),o=t.currentPackage(),a=chunk35MI6K7M_cjs.Md(o),i=chunk35MI6K7M_cjs.Nd(a),s=chunk35MI6K7M_cjs.Od(a),d=chunk6K6QQVAZ_cjs.dd(t.part()),c=$I(t,d),p=chunk35MI6K7M_cjs.Kd(c[r]),b=chunk35MI6K7M_cjs.Ld(c[r]),x=chunk35MI6K7M_cjs.Pd(p,i),w=chunk35MI6K7M_cjs.Qd(b,s);return {sectionIndex:r,footnote:{resolved:x,...i?{documentAuthored:i}:{},...p?{sectionAuthored:p}:{}},endnote:{resolved:w,...s?{documentAuthored:s}:{},...b?{sectionAuthored:b}:{}}}}function Ym(e,t){let n=chunk35MI6K7M_cjs.ld(t);if(!n)return null;let r=chunk35MI6K7M_cjs.ge(e.currentPackage(),n.noteKind);if(!r)return null;let o=r,a=chunk35MI6K7M_cjs.Gd(o.root,n.noteId);if(!a)return null;let i=[],s=zI,d=(p,b)=>{if(!(b>32||s<=0)){if(p.kind==="paragraph"&&typeof p.id=="string"){let x=(chunk35MI6K7M_cjs._f(o,p.id)??"").replace(/\uFFFC/g,"").trim();if(x){let w=x.slice(0,s);i.push(w),s-=w.length;}return}if(p.kind!=="textValue")for(let x of p.children)d(x,b+1);}};d(a,0);let c=i.filter(Boolean).join(" ").trim();return c.length>0?c:null}function Qm(e){return [()=>{chunk35MI6K7M_cjs.Xc(e().root);},()=>{chunk35MI6K7M_cjs.ch(e());},()=>{chunk35MI6K7M_cjs.Bf(e());}]}var jI=50,KI=16;function Jm(e){let t=e.schedule??((s,d)=>{let c=setTimeout(s,d);return ()=>clearTimeout(c)}),n=false,r=null,o=0,a=0,i=s=>{r=t(()=>{if(r=null,!(n||a>=e.steps.length||!e.shouldRun())){if(e.hasPendingInput()){if(o+=1,o>jI)return;i(KI);return}try{e.steps[a]();}catch{return}a+=1,a<e.steps.length&&i(0);}},s);};return i(0),()=>{n=true,r&&r(),r=null;}}function eh(e,t){let n=e.setScale;return typeof n!="function"?false:n.call(e,t)}function id(e,t,n={}){let r=n,o=chunkHBEBUCRM_cjs.j(t,n.reviewModel?{reviewModel:n.reviewModel}:{});if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let a=o.session,i=n.scale??96/72,s={resolve:n.tableInteractionLabel??(l=>vl(l))},d="the document is open for viewing",c="the document is read-only",p="the table of contents is generated and read-only",b="\0range\0",x=()=>`${new Date().toISOString().slice(0,19)}Z`,w=n.measurer?null:chunk6K6QQVAZ_cjs.Ld(i,{context:Mr(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),F=n.measurer??w.measurer,T=chunk6K6QQVAZ_cjs.zb(),P=chunk6K6QQVAZ_cjs.Ed();function B(){return n.measurer?n.producer??"host-measurer":`${n.producer??w?.producer??"fixed-measurer"}@scale:${i}`}let h=B(),N=e.ownerDocument,A=N.createElement("div");A.className="docx-pages",A.style.position="relative",A.contentEditable="true",A.spellcheck=false,A.setAttribute("role","textbox"),A.setAttribute("aria-multiline","true"),A.style.outline="none";let $=N.createElement("div");$.className="docx-selection-overlay",$.contentEditable="false",$.setAttribute("aria-hidden","true"),$.style.position="absolute",$.style.left="0",$.style.top="0",$.style.pointerEvents="none";let j=N.createElement("div");j.className="docx-comment-overlay",j.contentEditable="false",j.setAttribute("aria-hidden","true"),j.style.position="absolute",j.style.left="0",j.style.top="0",j.style.pointerEvents="none";let M=N.createElement("div");M.className="docx-table-furniture",M.contentEditable="false",M.style.position="absolute",M.style.left="0",M.style.top="0",M.style.pointerEvents="none",e.style.position="relative",e.replaceChildren(A,M,j,$);let G=Zg(A,()=>i,()=>{let l=D?.getActive()??null,u=W?.activeNoteScope()??null,f=W?.activeNotePageIndex()??null,g=l?df(A,l.pageIndex):u?cf(A,u.id,f):null;return {layout:Y,selection:k,measurer:F,...l?{preferredPageIndex:l.pageIndex}:f!==null?{preferredPageIndex:f}:Le.selectionPageIndex()!==void 0?{preferredPageIndex:Le.selectionPageIndex()}:{},scopedHost:g,...l?{scopedHostKind:"headerFooter"}:u?{scopedHostKind:"note"}:{}}}),S=new Set(chunk35MI6K7M_cjs.Bc(a.part()).flatMap(l=>[l.beginParagraphId,...l.resultParagraphIds,l.endParagraphId])),E=a.paragraphIds(),Z=E.find(l=>!S.has(l))??E[0]??"",k={anchor:{paragraphId:Z,offset:0},head:{paragraphId:Z,offset:0}},O=r.initialDrawingSelectionIntent??{kind:"none"};function U(l,u){l.kind===O.kind&&(l.kind!=="pointer"||O.kind==="pointer"&&l.drawingNodeId===O.drawingNodeId)||(O=l,u&&n.onChange?.(qe()));}let K=null,X=null,ce=false,we=false,me=null,he=new Map;function fe(){me=null;for(let l of he.values())me=l;}function Ge(l,u){if(l.paragraphId===u.paragraphId)return l.offset-u.offset;let f=pe();return f.indexOf(l.paragraphId)-f.indexOf(u.paragraphId)}function qt(l){if(!me)return;let{from:u,to:f}=wl(Y,me),g=l.head;Ge(g,u)>=0&&Ge(g,f)<=0||(he.clear(),me=null);}let Fe=null;function mt(){return H()?.properties??null}function H(){if(!Fe)return null;let l=Fe.position,u=f=>f.paragraphId===l.paragraphId&&f.offset===l.offset;return u(k.anchor)&&u(k.head)?Fe:null}function ae(l){if(!Fe)return;let u=Fe.position;l.anchor.paragraphId===u.paragraphId&&l.anchor.offset===u.offset&&l.head.paragraphId===u.paragraphId&&l.head.offset===u.offset||(Fe=null);}function v(l,u,f,g){let y=He([...l],f,g);return l.length===u.length||!y.rejected?y:He([...u],f,g)}function R(l,u,f,g){let y=H();if(!y||f===0)return [];let I=Fe.position,L=g&&I.paragraphId===l&&I.offset>=g.start&&I.offset<=g.end?{paragraphId:l,offset:pr({paragraphId:l,offset:g.start},{paragraphId:l,offset:g.end})}:chunk6K6QQVAZ_cjs.Xd(Y,I);return L.paragraphId!==l||L.offset!==u?[]:[{op:"setRunProperties",paragraphId:l,start:u,end:u+f,properties:y.properties.reduce((_,q)=>chunk35MI6K7M_cjs.Gg(_,chunk35MI6K7M_cjs.Kg(_,q)),[...y.base])}]}let D=null,W=null,ne=null,V=()=>$a(D?.getActive()??null,W?.activeNoteScope()??null),re=()=>W?.activeNoteScope()?.id??null,ie=l=>{let u=P.multi?.spans,f=0,g=0;if(u&&u.length>0)for(let y=0;y<u.length;y+=1){let I=u[y];if(f=y,g=I.startIndex,l<I.startIndex+I.pageCount)break}return {sectionIndex:f,sectionStart:g}},pe=()=>Pr(Y,D?.getActive()??null,re()),Me=()=>globalThis.performance?.now()??Date.now(),dt=0,De=0,Xe=0,{styleCascade:Ce,numberingIndex:Zt,defaultTabStopPt:ct}=Fg(a),rn=Eg({styleCascade:Ce,partOf:l=>en(a,l)??a.part()}),ye=null,Te=n.imageDecodePort??_g(N)??Bg(),$e=chunk6K6QQVAZ_cjs.Rc({session:a,decodePort:Te,onResourcesChanged:()=>ye?.()}),pn=n.drawingStrings??chunk4XL7SOWQ_cjs.f,on=()=>k.anchor.paragraphId!==k.head.paragraphId||k.anchor.offset!==k.head.offset?null:{paragraphId:k.head.paragraphId,offset:k.head.offset},kn=-1,jr=true,Yo=()=>{let l=a.packageRevision();return kn!==l&&(kn=l,jr=!chunkC6LK2BYA_cjs.Q(a.settingsRoot()).doNotShadeFormData),jr},Kr=qg({mintValidatedBytes:(l,u)=>$e.mintValidatedBytes(l,u)}),wn=()=>n.revisionDisplayMode??chunk6K6QQVAZ_cjs.mb,Tn=Hl({session:a,measurer:F,producer:h,cache:T,styleCascade:Ce,numberingIndex:Zt,defaultTabStopPt:ct,displayMode:wn(),inlineDrawingLayoutForPart:l=>$e.contextForPart(l),drawingLayoutTokenForPart:l=>$e.cacheTokenForPart(l),drawingTokenForParagraphForPart:(l,u)=>$e.drawingTokenForParagraph(u,l)}),Ci=l=>{let u=chunk35MI6K7M_cjs.Oa(l,f=>a.relationshipTarget(f));return l.kind==="textValue"?null:{id:l.id,kind:u.kind,href:u.href,...u.anchor!==void 0?{anchor:u.anchor}:{},...u.tooltip!==void 0?{tooltip:u.tooltip}:{}}},zt=Tm(),_n={...a,applyTreeOps:(l,u,f,g)=>He(l,u,f,g),applyPmDoc:l=>Ae==="view"?{committed:false,rejected:true,opCount:0,reason:d}:qi()?{committed:false,rejected:true,opCount:0,reason:p}:a.applyPmDoc(l)},Y=Ei(),$t=n.revisionStyles,Ri=r.reviewAuthorSlots??chunk4XL7SOWQ_cjs.d(),jt=null,Qo=am({session:_n,storyScope:V,paragraphOrder:pe,layout:()=>Y,selection:()=>k,displayMode:()=>wn(),commit:(l,u,f)=>Ee(l,u,f),orderedRange:()=>Ut(),selectionMark:()=>Ne(),textOf:l=>Je(l),selectedCells:()=>K?.cellIds,defaultParagraphStyleId:()=>Ce()?.defaultParagraphStyleId??null,defaultFontFamily:()=>n.defaultFontFamily??null,pendingFormats:()=>mt(),setPendingFormats:l=>{if(l===null||l.length===0){if(!Fe)return;Fe=null;}else {let{anchor:u,head:f}=k;if(u.paragraphId!==f.paragraphId||u.offset!==f.offset)return;let g=H()?.base??em(a.partFor(V())??a.part(),f.paragraphId,f.offset,wn());Fe={position:f,properties:l,base:g};}n.onChange?.(qe());}}),Vr=wm({session:_n,storyScope:V,headerFooterSectionIndex:()=>D?.getActive()?.sectionIndex,paragraphOrder:pe,selectedCells:()=>K?.cellIds,editingMode:()=>Ae,publishRefusal:l=>{X=l,n.onChange?.(qe());},caretParagraphId:()=>k.anchor.paragraphId===k.head.paragraphId&&k.anchor.offset===k.head.offset?k.head.paragraphId:null,layout:()=>Y,commit:(l,u,f)=>Ee(l,u,{rearmPending:H()??void 0,...f?.keepCellSelection?{keepCellSelection:true}:{}}),orderedStart:()=>sa(),orderedRange:()=>Ut(),selectionMark:()=>Ne(),collapsedAt:l=>Oe(l),deleteSelectionPlan:()=>Wt(),paragraphTextOf:l=>Je(l),numberingLevelExists:(l,u)=>chunk6K6QQVAZ_cjs.ic(chunk6K6QQVAZ_cjs.nc(Zt(),Ce()),l,u)!==null}),ir=Mm({session:_n,layout:()=>Y,fieldLinkById:l=>zt.linkById(l),refusesWrite:()=>ur(true)!==null,storyScope:V,suggestReplacementOffset:(l,u,f)=>Ae==="suggest"?pr({paragraphId:l,offset:u},{paragraphId:l,offset:f}):null,insertionLanding:(l,u)=>chunk6K6QQVAZ_cjs.Xd(Y,{paragraphId:l,offset:u}).offset,selection:()=>k,orderedRange:()=>Ut(),selectionMark:()=>Ne(),textOf:l=>Je(l),commit:(l,u)=>Ee(l,u)}),Ur=_m({session:_n,storyScope:V,editingMode:()=>Ae,writeRefusal:l=>ur(true,[l]),selection:()=>k,selectionMark:()=>Ne(),commit:(l,u)=>Ee(l,u)}),Jo=l=>{let u=gt(a,l,{kind:"body"});if(u.kind==="body")return W?.exitNote(),D?.exitHeaderFooter(),true;if(u.kind==="headerFooter"){let g=D?.activeScope();return g?.kind==="headerFooter"&&g.rId===u.rId?true:(W?.exitNote(),D?.enterHeaderFooter({rId:u.rId})??false)}let f=ea(l);return f?W?.activeNoteScope()?.id===f?true:(D?.exitHeaderFooter(),W?.enterNote(f)??false):false},ea=l=>{for(let u of Y.pages)for(let f of [u.footnotes,u.endnotes])if(f){for(let g of f.notes)for(let y of chunk6K6QQVAZ_cjs.Z(g.fragments))if(y.paragraphId===l)return g.scopeId}return null},Wr=Bm({pagesLayer:A,container:e,scale:()=>i,layout:()=>Y,bookmarks:()=>a.bookmarks(),linkById:l=>zt.linkById(l)??ir.linkById(l),drawingLinkById:l=>$m(Y,l),setSelection:l=>ft(Oe(l)),enterStoryFor:l=>Jo(l),isCollapsedSelection:()=>k.anchor.paragraphId===k.head.paragraphId&&k.anchor.offset===k.head.offset,onScrolled:()=>oa(),...n.onHyperlinkPopover?{onPopover:n.onHyperlinkPopover}:{}}),ta=Hm({pagesLayer:A,equationById:l=>Ur.equationById(l),setSelection:ft,...n.onEquationPopover?{onPopover:n.onEquationPopover}:{}});A.addEventListener("contextmenu",kd),A.addEventListener("click",wd),A.addEventListener("pointermove",Zn),A.addEventListener("pointerleave",je);let Kt=null;function na(l,u){u&&chunk6K6QQVAZ_cjs.lc(P,u),$e.sync(a);let f=Dg({session:a,measurer:F,producer:h,cache:T,styleCascade:Ce,numberingIndex:Zt,defaultTabStopPt:ct,inlineDrawingLayoutForPart:g=>$e.contextForPart(g),drawingTokenForParagraphForPart:(g,y)=>$e.drawingTokenForParagraph(y,g),drawingLayoutEpochForPart:g=>$e.cacheTokenForPart(g)});return chunk6K6QQVAZ_cjs.Gd(a.part(),l,{measurer:F,cache:T,session:P,producer:h,styleCascade:Ce(),defaultTabStopPt:ct,numberingIndex:Zt(),sectionFurniture:Tn.sectionFurniture(),furniture:Tn.furniture(),projectLink:Ci,projectFieldLink:g=>zt.project(g),documentProperties:a.documentProperties(),inlineDrawingLayout:$e.bodyContext,drawingTokenForParagraph:g=>$e.drawingTokenForParagraph(g,a.part().name),drawingLayoutEpoch:$e.cacheTokenForPart(a.part().name),...f?{notes:f}:{},...n.revisionDisplayMode?{displayMode:n.revisionDisplayMode}:{}})}function Ei(){let l=Me(),u=na(a.packageRevision());return dt=Me()-l,u}let Et=null,Bn=null,sr=false;function an(){if(sr)return;sr=true;let l=a.packageRevision();Bn=Jm({steps:Qm(()=>a.part()),shouldRun:()=>Ae!=="view"&&a.editable&&a.packageRevision()===l,hasPendingInput:lr});}function lr(l=true){return e.ownerDocument.defaultView?.navigator?.scheduling?.isInputPending?.({includeContinuous:l})??false}function Oi(){if(!lr()){ht(),an();return}Et===null&&(Et=setTimeout(()=>{Et=null,C.pending()===null&&(ht(),an());},0));}let Vt="",gn=null,Gr=false;function ut(){if(Gr||(gn!==null&&(clearTimeout(gn),gn=null),Vt.length===0))return;let l=Vt;Vt="",Gr=true;try{_e.type(l);}catch(u){throw Vt=l+Vt,u}finally{Gr=false;}}function Pn(l){Vt+=l,gn===null&&(gn=setTimeout(()=>{gn=null,ut();},0));}function m(l,u,f){ut();let g=f?.trim()||n.author?.trim();if(!g)return X="tracked changes need a non-empty author",n.onChange?.(qe()),false;if(l!=="deletion"&&u.length===0)return X=`${l} requires non-empty text`,n.onChange?.(qe()),false;if(l!=="deletion"&&/[\r\n\v\f\u2028\u2029]/.test(u))return X=`${l} requires text without a paragraph mark`,n.onChange?.(qe()),false;let y={author:g,date:x()},I=Ut(),L=I.from.paragraphId===I.to.paragraphId&&I.from.offset===I.to.offset;if(l!=="insertion"&&L&&!(l==="replacement"&&K))return X=`${l} needs a non-collapsed selection`,n.onChange?.(qe()),false;let _=l==="insertion"?{ops:[],collapseTo:chunk6K6QQVAZ_cjs.Xd(Y,I.from)}:Wt(g),q=Od(_.ops,y,Rd()),se=_.collapseTo;if(l==="insertion"||l==="replacement"){let ee=l==="replacement"?_.replaceAt??_.collapseTo:_.collapseTo;q.push({op:"insertText",paragraphId:ee.paragraphId,offset:ee.offset,text:u,revision:y}),se={paragraphId:ee.paragraphId,offset:ee.offset+u.length};}let J=false;return Ee(()=>{let ee=He(q,Ne(),On(se));return J=ee.committed,ee},()=>Oe(se)),J}let C=chunk6K6QQVAZ_cjs.Sd({run:l=>{let u=Me(),f=na(l.revision,l);return dt=Me()-u,f},currentRevision:()=>a.packageRevision(),schedule:l=>{let u=setTimeout(l,0);return ()=>clearTimeout(u)},publish:l=>{jt!==null&&(jt={...jt,layout:null,items:null}),Y=l,Oi();}}),z=false;ye=()=>{C.invalidateAll(a.packageRevision(),"drawing-resources"),!z&&(z=true,setTimeout(()=>{z=false,oe();},0));};let le=a.subscribe(l=>{Ay(l),Fe=null,C.notify(l);});function te(){let l=Lg(e,Y,k,i),u=D?.getActive()?.pageIndex??Le.selectionPageIndex();return u===void 0||l===void 0||l.has(u)?l:new Set([...l,u])}function oe(){return C.pending()?C.flush():false}let Pe=8;function Re(l){!l&&C.pending()!==null&&dt>Pe&&lr(false)||oe()||ht();}function Q(){ut(),oe();}function ve(){ut();let l=oe();return Et!==null?(ht(),an(),true):l}let ge=null;function Qe(l){return l.contentControlId??`toc:${l.id}`}function Cn(l){return chunk35MI6K7M_cjs.Bc(a.part()).find(u=>u.beginParagraphId===l||u.endParagraphId===l||u.resultParagraphIds.includes(l))}function dr(){for(let l of A.querySelectorAll(".docx-content-control-chrome[data-docx-toc]")){if(l.getAttribute("data-docx-content-control")===ge){l.dataset.hover="",l.dataset.boundaryVisible="";continue}delete l.dataset.hover,ce||delete l.dataset.boundaryVisible;}}function qn(l){ge!==l&&(ge=l,dr());}function Zn(l){let f=l.target?.closest("[data-paragraph-id]")?.dataset.paragraphId,g=f?Cn(f):null;qn(g?Qe(g):null);}function xe(l){let u=l.target,f=u?.isConnected?u.closest("[data-paragraph-id]"):void 0;if(f)return f.dataset.paragraphId;let g=A.ownerDocument;return typeof g.elementFromPoint!="function"?void 0:g.elementFromPoint(l.clientX,l.clientY)?.closest("[data-paragraph-id]")?.dataset.paragraphId}function je(){qn(null);}function Rn(){let l=sn(),u=chunk6K6QQVAZ_cjs.Tc(a.part()),g=chunk35MI6K7M_cjs.Bc(a.part()).map(ee=>{let Ie=En(ee);return Ie?{...Ie,empty:u.has(ee.beginParagraphId)}:null}).filter(ee=>ee!==null),y=new Set(g.map(ee=>ee.boundary.id)),I=new Set(g.filter(ee=>ee.empty).map(ee=>ee.boundary.id)),L=l&&!y.has(l.id)?new Set([l.id]):void 0,_=ge?new Set([ge]):void 0,q=new Set(chunk6K6QQVAZ_cjs.ce(Y).filter(ee=>ee.controlType==="checkbox"&&Sd(ee.id)).map(ee=>ee.id)),se=g.filter(ee=>ee.additional&&!ee.empty).map(ee=>ee.boundary),J=Cd()!==null;if(!(!ce&&!L&&!_&&!J&&q.size===0&&se.length===0&&y.size===0))return {...J?{readOnly:true}:{},...ce?{showAll:true}:{},...L?{activeIds:L}:{},..._?{hoverIds:_}:{},...q.size>0?{checkedIds:q}:{},...se.length>0?{additionalBoundaries:se}:{},...y.size>0?{tocControlIds:y}:{},...I.size>0?{suppressedIds:I}:{}}}function En(l){let u=l.contentControlId?chunk6K6QQVAZ_cjs.ce(Y).find(y=>y.id===l.contentControlId):void 0;if(u)return {tocId:l.id,boundary:u,additional:false};let f=new Set([l.beginParagraphId,...l.resultParagraphIds,l.endParagraphId]),g=Y.pages.flatMap(y=>{let I=chunk6K6QQVAZ_cjs.Y(y).filter(J=>f.has(J.paragraphId)).map(J=>J.box);if(I.length===0)return [];let L=Math.min(...I.map(J=>J.x)),_=Math.min(...I.map(J=>J.y)),q=Math.max(...I.map(J=>J.x+J.width)),se=Math.max(...I.map(J=>J.y+J.height));return [{pageIndex:y.index,box:{x:L,y:_,width:q-L,height:se-_}}]});return g.length===0?null:{tocId:l.id,additional:true,boundary:{id:`toc:${l.id}`,controlType:"richText",lock:"unlocked",effectiveLock:"unlocked",placeholder:false,bound:false,nestingDepth:0,level:"block",fragments:g}}}let mn=null;function sn(){let l=V();if(l.kind!=="body")return cy(l);if(mn&&mn.layout===Y&&mn.selection===k)return mn.result;let u=ly();return mn={layout:Y,selection:k,result:u},u}function ly(){let l=chunk6K6QQVAZ_cjs.$d(Y,k.head,F);if(!l)return null;let u=chunk6K6QQVAZ_cjs.be(Y,{x:l.x,y:l.y+l.height/2,pageIndex:l.pageIndex});return u&&dy(u.id)===a.part().name?u:null}function dy(l){let u=l.indexOf("#");return u===-1?"":l.slice(0,u)}function cy(l){let u=a.partFor(l);return u?chunk6K6QQVAZ_cjs.Xc(u,k.head.paragraphId):null}function xd(l){return l.bound?"bound":l.effectiveLock==="contentLocked"||l.effectiveLock==="sdtContentLocked"?"locked":null}function uy(l){return l.effectiveLock==="sdtLocked"||l.effectiveLock==="sdtContentLocked"?"locked":null}function fy(l){return chunk35MI6K7M_cjs.Lb(l)}function cr(l){let u=en(a,l),f=chunk35MI6K7M_cjs.ya(u??a.part(),l);return !f||!fy(f)?null:f}function Id(l){let u=cr(l);if(!u)return null;for(let f of u.children)if(f.kind!=="textValue"&&(f.kind==="contentControlProperties"||f.localName==="sdtPr"))for(let g of f.children){if(g.kind==="textValue"||g.localName!=="tabIndex")continue;let y=g.attributes.find(L=>L.localName==="val")?.value;if(y===void 0)return null;let I=Number(y);return Number.isFinite(I)?I:null}return null}function py(){let l=V(),u=l.kind==="body"?null:a.partFor(l),f=l.kind==="notesPart"?new Set(pe()):void 0;return (u?[...chunk6K6QQVAZ_cjs.Wc(u,f)]:[...chunk6K6QQVAZ_cjs.ce(Y)]).filter(y=>xd(y)===null).sort((y,I)=>{let L=Id(y.id),_=Id(I.id);return L!==null&&_!==null&&L!==_?L-_:L!==null&&_===null?-1:L===null&&_!==null?1:0})}function zn(l){if(l.kind==="textValue")return l.value.length;if(l.kind==="tab"||l.kind==="hardBreak")return 1;if(l.kind==="runProperties"||l.kind==="generic")return 0;if(l.kind==="contentControl"){let g=0;for(let y of l.children)if(y.kind!=="textValue"&&(y.kind==="contentControlContent"||y.localName==="sdtContent"))for(let I of y.children)g+=zn(I);return g}let f=0;for(let g of l.children)f+=zn(g);return f}function Fi(l){for(let u of l.children)if(u.kind!=="textValue"&&(u.kind==="contentControlContent"||u.localName==="sdtContent"))return u.children;return []}function gy(l){let u=cr(l);if(!u)return false;let f=Fi(u),g=[],y=se=>{for(let J of se){if(J.kind==="paragraph"){g.push({id:J.id,length:zn(J)});continue}if(J.kind==="textValue")continue;if(J.kind==="contentControl"){y(Fi(J));continue}y(J.children);}};if(y(f),g.length>0){let se=g[0],J=g[g.length-1];return ft({anchor:{paragraphId:se.id,offset:0},head:{paragraphId:J.id,offset:J.length}}),true}let I=null,L=0,_=0,q=(se,J,ee)=>{let Ie=J;for(let be of se){if(be.id===l)return I=ee,L=Ie,_=Ie+zn(be),true;if(be.kind==="textValue"){Ie+=be.value.length;continue}if(be.kind==="contentControl"){let vt=zn(be);if(q(Fi(be),Ie,ee))return true;Ie+=vt;continue}if(be.kind==="run"||be.kind==="hyperlink"){if(q(be.children,Ie,ee))return true;Ie+=zn(be);continue}if(be.kind==="paragraph"){if(q(be.children,0,be.id))return true;continue}if(be.kind==="tab"||be.kind==="hardBreak"){Ie+=1;continue}if(q(be.children,Ie,ee))return true;Ie+=zn(be);}return false};return q((a.partFor(gt(a,l,V()))??a.part()).root.children,0,""),I?(ft({anchor:{paragraphId:I,offset:L},head:{paragraphId:I,offset:_}}),true):false}function my(l){let u=cr(l);if(!u)return [];for(let f of u.children)if(f.kind!=="textValue"&&!(f.kind!=="contentControlProperties"&&f.localName!=="sdtPr"))for(let g of f.children){if(g.kind==="textValue"||g.localName!=="dropDownList"&&g.localName!=="comboBox")continue;let y=[];for(let I of g.children){if(I.kind==="textValue"||I.localName!=="listItem")continue;let L=I.attributes.find(q=>q.localName==="value")?.value??"",_=I.attributes.find(q=>q.localName==="displayText")?.value??L;y.push({displayText:_,value:L});}return y}return []}function Sd(l){let u=cr(l);if(!u)return false;for(let f of u.children)if(f.kind!=="textValue"&&!(f.kind!=="contentControlProperties"&&f.localName!=="sdtPr")){for(let g of f.children)if(g.kind==="contentControlCheckbox")for(let y of g.children){if(y.kind!=="contentControlChecked")continue;let I=y.attributes.find(L=>L.localName==="val")?.value;return !(I==="0"||I==="false"||I==="off")}}return false}function hy(l){let u=cr(l);if(u){for(let f of u.children)if(f.kind==="contentControlProperties"){for(let g of f.children)if(g.kind==="contentControlDate")return g.attributes.find(y=>y.localName==="fullDate")?.value}}}function Ai(l,u){for(let f of A.querySelectorAll("[data-docx-content-control]"))f.getAttribute("data-docx-content-control")===l&&(u?f.dataset.open="":delete f.dataset.open);}function hn(l){let u=l.dataset.docxCcId;l.remove(),u&&Ai(u,false);}function Mi(){let l=A.querySelector(".docx-content-control-menu");l&&hn(l);}function kd(l){let u=xe(l),f=u?Cn(u):void 0;yy(f&&$i(f.id)?f.id:null);}let Xr=null;function yy(l){Xr!==l&&(Xr=l,n.onChange?.(qe()));}function wd(l){if(l.button!==0||l.target?.closest("a.docx-hyperlink")||k.anchor.paragraphId!==k.head.paragraphId||k.anchor.offset!==k.head.offset)return;let u=xe(l);if(!u)return;let f=chunk35MI6K7M_cjs.Bc(a.part()).find(I=>I.resultParagraphIds.includes(u));if(!f)return;let y=chunkC6LK2BYA_cjs.H(a.part(),f,a.documentOutline(),Zi(f))[f.resultParagraphIds.indexOf(u)];y&&(l.preventDefault(),Wr.goToPosition({paragraphId:y,offset:0}));}function by(l,u){let f=yn.disabledReason(l,"edit");if(f){X=f,n.onChange?.(qe());return}if(u==="checkbox"){yn.setValue(l,Sd(l)?"false":"true");return}if(u==="dropdown"||u==="comboBox"){let g=my(l);if(g.length===0&&u==="dropdown")return;Mi();let y=N.createElement("div");y.className="docx-content-control-menu",y.dataset.docxMarker="",y.dataset.docxCcId=l,y.setAttribute("contenteditable","false"),y.setAttribute("role","listbox"),y.style.position="absolute",y.style.zIndex="20",y.style.pointerEvents="auto",y.addEventListener("pointerdown",q=>q.stopPropagation());let L=chunk6K6QQVAZ_cjs.ce(Y).find(q=>q.id===l)?.fragments[0];if(L){let q=Y.pages[L.pageIndex],se=Ue?.pageOffsetX.get(L.pageIndex)??0;if(q){let J=q.contentBox.x-q.box.x,ee=q.contentBox.y-q.box.y;y.style.left=`${(q.box.x+se+J+L.box.x+L.box.width)*i}px`,y.style.top=`${(q.box.y+ee+L.box.y+L.box.height)*i}px`,y.style.transform="translateX(-100%)";}}for(let q of g){let se=N.createElement("button");se.type="button",se.className="docx-content-control-menu-item",se.dataset.docxMarker="",se.setAttribute("contenteditable","false"),se.setAttribute("role","option"),se.textContent=q.displayText,se.addEventListener("mousedown",J=>{J.preventDefault(),J.stopPropagation(),hn(y),yn.setValue(l,q.value);}),y.append(se);}if(u==="comboBox"){let q=N.createElement("input");q.type="text",q.className="docx-content-control-menu-input",q.dataset.docxMarker="",q.setAttribute("contenteditable","false"),q.addEventListener("mousedown",se=>se.stopPropagation()),q.addEventListener("keydown",se=>{se.key==="Enter"&&(se.preventDefault(),hn(y),yn.setValue(l,q.value));}),y.append(q);}A.append(y),Ai(l,true);let _=q=>{y.contains(q.target)||(hn(y),N.removeEventListener("mousedown",_,true));};N.addEventListener("mousedown",_,true);return}if(u==="date"){Mi();let g=N.createElement("div");g.className="docx-content-control-menu",g.dataset.docxMarker="",g.dataset.docxCcId=l,g.setAttribute("contenteditable","false"),g.style.position="absolute",g.style.zIndex="20",g.style.pointerEvents="auto",g.addEventListener("pointerdown",Se=>Se.stopPropagation());let y=chunk6K6QQVAZ_cjs.ce(Y).find(Se=>Se.id===l),I=y?.fragments[0];if(I){let Se=Y.pages[I.pageIndex],dn=Ue?.pageOffsetX.get(I.pageIndex)??0;if(Se){let Kn=Se.contentBox.x-Se.box.x,Ot=Se.contentBox.y-Se.box.y;g.style.left=`${(Se.box.x+dn+Kn+I.box.x+I.box.width)*i}px`,g.style.top=`${(Se.box.y+Ot+I.box.y+I.box.height)*i}px`,g.style.transform="translateX(-100%)";}}g.classList.add("docx-content-control-calendar");let L=hy(l),_=L?new Date(L):new Date,q=Number.isNaN(_.getTime())?null:_,se=q??new Date,J=se.getFullYear(),ee=se.getMonth(),Ie=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),be=new Intl.DateTimeFormat(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),et=new Intl.DateTimeFormat(void 0,{weekday:"narrow"}),vt=Se=>`${Se.getFullYear().toString().padStart(4,"0")}-${(Se.getMonth()+1).toString().padStart(2,"0")}-${Se.getDate().toString().padStart(2,"0")}`,Be=(Se,dn)=>Se.getFullYear()===dn.getFullYear()&&Se.getMonth()===dn.getMonth()&&Se.getDate()===dn.getDate(),ot=null,pt=()=>{let Se=N.createElement("input");Se.type="date",Se.className="docx-content-control-calendar-input",Se.value=q?vt(q):"";let dn=Se.value;y?.alias&&Se.setAttribute("aria-label",y.alias);let Kn=()=>{if(!Se.value||Se.value===dn)return false;let at=Se.value;return hn(g),yn.setValue(l,at),true};ot=Kn,Se.addEventListener("keydown",at=>{at.key==="Enter"&&(at.preventDefault(),Kn()||hn(g));}),Se.addEventListener("blur",()=>{queueMicrotask(()=>{!g.isConnected||g.contains(N.activeElement)||Kn()||hn(g);});});let Ot=N.createElement("div");Ot.className="docx-content-control-calendar-header";let Ze=N.createElement("button");Ze.type="button",Ze.className="docx-content-control-calendar-nav",Ze.textContent="\u2039";let tt=new Date(J,ee-1,1);Ze.setAttribute("aria-label",Ie.format(tt));let Vn=N.createElement("div");Vn.className="docx-content-control-calendar-title",Vn.textContent=Ie.format(new Date(J,ee,1));let Gt=N.createElement("button");Gt.type="button",Gt.className="docx-content-control-calendar-nav",Gt.textContent="\u203A";let Un=new Date(J,ee+1,1);Gt.setAttribute("aria-label",Ie.format(Un)),Ze.addEventListener("mousedown",at=>at.stopPropagation()),Gt.addEventListener("mousedown",at=>at.stopPropagation()),Ze.addEventListener("click",()=>{ee-=1,ee<0&&(ee=11,J-=1),pt();}),Gt.addEventListener("click",()=>{ee+=1,ee>11&&(ee=0,J+=1),pt();}),Ot.append(Ze,Vn,Gt);let gr=N.createElement("div");gr.className="docx-content-control-calendar-weekdays";for(let at=0;at<7;at+=1){let vn=N.createElement("span");vn.textContent=et.format(new Date(2024,0,1+at)),gr.append(vn);}let ca=N.createElement("div");ca.className="docx-content-control-calendar-grid",ca.setAttribute("role","grid");let Xy=(new Date(J,ee,1).getDay()+6)%7,Yy=new Date;for(let at=0;at<42;at+=1){let vn=new Date(J,ee,at-Xy+1),Ft=N.createElement("button");Ft.type="button",Ft.className="docx-content-control-calendar-day",Ft.textContent=String(vn.getDate()),Ft.setAttribute("role","gridcell"),Ft.setAttribute("aria-label",be.format(vn)),vn.getMonth()!==ee&&(Ft.dataset.otherMonth=""),q&&Be(vn,q)&&(Ft.dataset.selected="",Ft.setAttribute("aria-selected","true")),Be(vn,Yy)&&(Ft.dataset.today=""),Ft.addEventListener("mousedown",Qy=>Qy.stopPropagation()),Ft.addEventListener("click",()=>{hn(g),yn.setValue(l,vt(vn));}),ca.append(Ft);}g.replaceChildren(Se,Ot,gr,ca);};pt(),A.append(g),Ai(l,true);let Fn=Se=>{g.contains(Se.target)||(ot?.()||hn(g),N.removeEventListener("mousedown",Fn,true));};N.addEventListener("mousedown",Fn,true),g.querySelector("[data-selected], [data-today], .docx-content-control-calendar-day")?.focus({preventScroll:true});}}let yn={setShowAll(l){ce!==l&&(ce=l,ht());},setFormFill(l){we!==l&&(we=l,n.onChange?.(qe()));},showAll:()=>ce,formFill:()=>we,atCaret:()=>sn(),navigate(l){let u=py();if(u.length===0)return false;let f=sn(),g=f?u.findIndex(I=>I.id===f.id):-1;l==="next"?g=g<0?0:(g+1)%u.length:g=g<0?u.length-1:(g-1+u.length)%u.length;let y=u[g];return gy(y.id)},setValue(l,u){let f=yn.disabledReason(l,"edit");if(f)return X=f,n.onChange?.(qe()),false;let g=false;return Ee(()=>{let y=He([{op:"setContentControlValue",controlId:l,value:u}],Ne(),void 0,gt(a,l,V()),false);return g=y.committed,y}),g},remove(l){let u=l??sn()?.id;if(!u)return X="notFound",n.onChange?.(qe()),false;let f=yn.disabledReason(u,"remove");if(f)return X=f,n.onChange?.(qe()),false;let g=false;return Ee(()=>{let y=He([{op:"removeContentControl",controlId:u}],Ne(),void 0,gt(a,u,V()),false);return g=y.committed,y}),g},disabledReason(l,u){let f=Cd();if(f!==null)return f;let g=chunk6K6QQVAZ_cjs.ce(Y).find(I=>I.id===l);if(g)return u==="remove"?uy(g):xd(g);let y=cr(l);if(!y)return "notFound";for(let I of y.children)if(I.kind!=="textValue"&&!(I.kind!=="contentControlProperties"&&I.localName!=="sdtPr")){if(I.children.some(L=>L.kind!=="textValue"&&L.localName==="dataBinding")&&u==="edit")return "bound";for(let L of I.children){if(L.kind==="textValue"||L.localName!=="lock")continue;let _=L.attributes.find(q=>q.localName==="val")?.value;if(u==="remove"){if(_==="sdtLocked"||_==="sdtContentLocked")return "locked"}else if(_==="contentLocked"||_==="sdtContentLocked")return "locked"}}return null}};function Li(){let l=Pd&&Ae!=="view";A.contentEditable=l?"true":"false",A.setAttribute("aria-readonly",l?"false":"true");}function qe(){return {revision:a.packageRevision(),pageCount:Y.pages.length,selection:k,cellSelection:K,canUndo:a.canUndo(),canRedo:a.canRedo(),lastRejection:X,pendingFormat:mt(),contentControls:{showAll:ce,formFill:we,activeControlId:sn()?.id??null},contextTocId:Xr,perf:{layoutMs:dt,paintMs:De,selectionMs:Xe,placed:P.stats.placed,total:P.stats.total,reusedPages:P.stats.reusedPages,fullPasses:P.stats.fullPasses,staleDiscards:C.staleDiscards,cancelledRuns:C.cancelledRuns}}}let ln,Ue,Ni=null,ra=false,Yr=null,Di=null;function vy(l){for(let u of Y.pages){let f=A.children.item(u.index);if(f?.dataset.pageIndex!==String(u.index))continue;let g=l.pageOffsetX.get(u.index)??0;f.style.left=`${(u.box.x+g)*i}px`;}}function ht(l=true){Et!==null&&(clearTimeout(Et),Et=null,l=true);let u=Le.adoptBeforePaint(),f=Me();ln=te(),D?.reconcileOccurrence();let g=D?.getActive()??null,y=Rn(),I=chunk6K6QQVAZ_cjs.Tc(a.part());chunk4XL7SOWQ_cjs.k(A,Y,{scale:i,readOnlyParagraphIds:ia(),...I.size>0?{emptyTocPlaceholderIds:I}:{},...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},materialize:ln,ariaHidden:false,drawingStrings:pn,...n.fieldShading?{fieldShading:n.fieldShading}:{},...$t!==void 0?{revisionStyles:$t}:{},shadeFormFields:Yo(),...Kr?{imageUrlPort:Kr}:{},...g?{activeHeaderFooterRId:g.scope.rId,activeHeaderFooterPageIndex:g.pageIndex}:{},...y?{contentControlChrome:y}:{}},Bi().value),kl(A,on(),{domReplaced:true}),pf(e,A,g!=null),Ds(e,Ae),Ue=di(Y,ln),vy(Ue),A.style.width=`${Ue.width*i}px`,A.style.height=`${Ue.height*i}px`,e.style.width=`${Ue.width*i}px`,e.style.height=`${Ue.height*i}px`,$.style.width=`${Ue.width*i}px`,$.style.height=`${Ue.height*i}px`,j.style.width=$.style.width,j.style.height=$.style.height,M.style.width=$.style.width,M.style.height=$.style.height,oo.update(),De=Me()-f,to(),fr(true),ac(),Le.mirrorToDom(),Td(ra),ra=false,(l||u)&&n.onChange?.(qe());}function oa(){Q();let l=te(),u=di(Y,l);Ue&&_l(l,ln)&&Ng(u,Ue)||ht(false);}function Td(l=false){if(D?.getActive()||W?.activeNoteScope()||k.anchor.paragraphId!==k.head.paragraphId||k.anchor.offset!==k.head.offset)return;let u=N.activeElement;if(u!==A&&(!u||!A.contains(u)))return;let f=chunk6K6QQVAZ_cjs.$d(Y,k.head,{measurer:F,...Le.selectionPageIndex()!==void 0?{preferredPageIndex:Le.selectionPageIndex()}:{}});if(!f)return;let g=Ni!==null&&Ni!==f.pageIndex;if(Ni=f.pageIndex,!l&&!g)return;let y=Y.pages[f.pageIndex],I=Rt(e);if(!y||!I||I.clientHeight<=0)return;let L=24,_=y.contentBox.y-y.box.y,q=(y.box.y+_+f.y)*i+e.offsetTop,se=q+f.height*i,J=I.scrollTop,ee=J+I.clientHeight,Ie=J;if(q<J+L)Ie=q-L;else if(se>ee-L)Ie=se+L-I.clientHeight;else return;let be=Math.max(0,I.scrollHeight-I.clientHeight),et=Math.max(0,Math.min(Ie,be));Math.abs(et-I.scrollTop)<.5||(I.scrollTop=et,Ui());}let Ae=n.editingMode??"edit",Pd=true,xy=Object.freeze({kind:"body"});function He(l,u,f,g=V(),y=true){ut();let I=ur(l.some(Iy),l,y);if(I!==null)return {committed:false,rejected:true,opCount:0,reason:I};let L=Ty(l),_=a.applyTreeOps(L,u,f,g);return _.committed&&L.some(wy)&&r.onTrackedChange?.(),_}function ur(l,u=[],f=true){return Ae==="view"?d:l&&(f&&qi()||u.some(g=>Ny(g)))?p:Ae==="suggest"&&!n.author?.trim()&&l?"suggesting needs an author before it can propose a change":Ae==="suggest"&&u.some(g=>g.op==="deleteNote")?"suggesting cannot delete a note outright; strike its reference to propose the deletion":null}function Cd(){let l=ur(true,[],false);return l!==null?l:a.editable?null:c}function Iy(l){return l.op!=="acceptRevision"&&l.op!=="rejectRevision"&&l.op!=="acceptAllRevisions"&&l.op!=="rejectAllRevisions"}let Sy=new Set(["insertText","deleteText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertNote","insertTableRow","deleteTableRow","setRunProperties","setParagraphProperties","setParagraphMarkProperties"]),ky=l=>chunk35MI6K7M_cjs.Af.has(l),Rd=()=>!a.trackingSettings().doNotTrackFormatting;function Ed(l){return Sy.has(l.op)}function wy(l){if(Ed(l))return l.revision!==void 0;switch(l.op){case "setParagraphMarkRevision":case "proposeParagraphMerge":return true;case "splitParagraphMany":return l.revision!==void 0;default:return false}}function Od(l,u,f){return l.flatMap(g=>Ed(g)?!f&&ky(g.op)?[g]:[g.revision!==void 0?g:{...g,revision:u}]:g.op==="splitParagraphMany"?[{...g,revision:u}]:g.op==="splitParagraph"?[g,{op:"setParagraphMarkRevision",paragraphId:g.paragraphId,kind:"ins",revision:u}]:g.op==="joinParagraphs"?[{op:"proposeParagraphMerge",paragraphId:g.secondId,revision:u}]:[g])}function Fd(){let l=n.author?.trim();return Ae==="suggest"&&l?l:void 0}function Ty(l){let u=Fd();return u===void 0?[...l]:Od(l,{author:u,date:x()},Rd())}function Py(l,u,f){let g=Je(u);if(g===f)return l;let y=0;for(;y<f.length&&y<g.length&&f[y]===g[y];)y+=1;let I=0;for(;I<f.length-y&&I<g.length-y&&f[f.length-1-I]===g[g.length-1-I];)I+=1;let L=g.length-f.length,_=q=>q.paragraphId!==u||q.offset<=y?q:q.offset>=f.length-I?{...q,offset:q.offset+L}:{...q,offset:y};return {anchor:_(l.anchor),head:_(l.head)}}function Cy(l,u){let f=a.partFor(V())??a.part(),g=chunk35MI6K7M_cjs.za(f,l),y=chunk35MI6K7M_cjs.za(f,u);return g!==null&&y!==null&&g.id===y.id}function On(l){return {paragraphId:l.paragraphId,start:l.offset,end:l.offset}}function Ee(l,u,f={}){ut(),f?.keepCellSelection||(K=null),Fe=null,Le.noteModelMoved();let g=l(),y=typeof g=="boolean"||!g.rejected?null:g;if(y)X=String(y.reason??"rejected");else {X=null;let I=u?.();I&&(eo(),k=I,U({kind:"none"},false),Kt=null,ra=true);let L=f?.rearmPending;if(L&&L.properties.length>0){let{anchor:_,head:q}=k;_.paragraphId===q.paragraphId&&_.offset===q.offset&&(Fe={properties:L.properties,base:L.base,position:q});}}Re(y!==null);}function Ry(){if(!ln)return true;for(let l of [k.anchor,k.head]){let u=chunk6K6QQVAZ_cjs.$d(Y,l);if(u&&!ln.has(u.pageIndex))return false}return true}function ft(l,u=false){let f=!Ht(l,k);Vt.length>0&&f&&ut(),ae(l),qt(l);let g=sn()?.id??null,y=no(k.head.paragraphId);eo(),k=l,K=null,u||(Kt=null),Ry()||(Le.noteModelMoved(),ht(false)),Le.noteSelectionSettled(),Le.mirrorToDom(true),Td(true),to(),jn.clear(),fr();let I=sn()?.id??null,L=no(k.head.paragraphId);(g!==I||y!==L)&&ht(false),n.onChange?.(qe());}let Le=fm({session:a,storyScope:V,document:N,pagesLayer:A,selection:()=>k,setSelection:l=>ft(l),adoptSelection:l=>{ae(l),qt(l),eo(),k=l,Kt=null,ra=true;},commit:l=>Ee(l),applyOps:(l,u,f)=>He(l,u,void 0,f),hasPendingInput:()=>Vt.length>0,replacementOffset:(l,u,f)=>pr({paragraphId:l,offset:u},{paragraphId:l,offset:f}),render:()=>ht(),flushLayout:()=>oe(),flushToPaint:()=>ve(),updateCaret:()=>{G.update(),kl(A,on());},textOf:l=>Je(l),pendingFormatOps:(l,u,f,g)=>R(l,u,f,g),selectionMark:()=>Ne(),now:Me,recordSelectionMs:l=>{Xe=l;},isGesturing:()=>ji?.dragging()??false,domSelection:()=>K?Oe(K.text.anchor):k,holdsCellSelection:()=>K!==null,replaceSelectionWith:l=>_e.type(l),discardPaint:()=>chunk4XL7SOWQ_cjs.i(A)});D=Um({session:a,layout:()=>Y,sectionAtPage:ie,selection:()=>k,setScopeSelection:l=>{ut(),eo(),ae(l),jn.clear(),k=l,K=null,Kt=null;},noteModelMoved:()=>Le.noteModelMoved(),render:()=>ht(),mirrorToDom:()=>Le.mirrorToDom(),notify:()=>n.onChange?.(qe()),materializedPages:()=>ln,entryRefused:()=>Ae==="view",leaveOtherStories:()=>W?.exitNote()}),W=Gm({session:a,exitHeaderFooter:()=>D?.exitHeaderFooter(),applyOps:He,commit:Ee,selection:()=>k,selectionMark:()=>Ne(),orderedStart:()=>sa(),deleteSelectionPlan:()=>Wt(),undo:()=>_e.undo(),activeScope:()=>{let l=W?.activeNoteScope();return l||(D?.activeScope()??{kind:"body"})},setActiveScopeBodyOrHf:l=>D.setActiveScope(l),setSelection:l=>ft(l),noteModelMoved:()=>Le.noteModelMoved(),render:()=>{oe()||ht();},revealNote:l=>{oe();for(let u of Y.pages){let f=[...u.footnotes?.notes??[],...u.endnotes?.notes??[]].find(g=>g.scopeId===l);if(f)return ro(f.box.y,f.box.height,{block:"nearest",offsetPx:48}),u.index}return null},notify:()=>n.onChange?.(qe()),lastRejection:()=>X,setLastRejection:l=>{X=l;}});function Ad(l){l&&ut(),K=l,l&&(ae(l.text),eo(),k=l.text),Kt=null,Le.noteSelectionSettled(),Le.mirrorToDom(),to(),jn.clear(),fr(),n.onChange?.(qe());}let $n=null;function Ey(){let u=chunk6K6QQVAZ_cjs.$d(Y,k.head)?.pageIndex??0,f=new Set;for(let g=u-1;g<=u+1;g+=1)g>=0&&g<Y.pages.length&&f.add(g);return f}let Md=new WeakMap;function Oy(l){let u=Md.get(l);if(u)return u;let f=new Map;for(let g of l.pages)for(let y of chunk6K6QQVAZ_cjs.Y(g))f.has(y.paragraphId)||f.set(y.paragraphId,g.index);return Md.set(l,f),f}function Fy(){let l=a.revision(),u=ln??Ey();if($n?.layout===Y&&$n.revision===l&&_l($n.pages,u))return $n.rects;let f=Oy(Y),g=(_,q)=>{if(!u)return true;let se=f.get(_),J=f.get(q);if(se===void 0||J===void 0)return true;for(let ee=Math.min(se,J);ee<=Math.max(se,J);ee+=1)if(u.has(ee))return true;return false},y=[];for(let _ of a.reviewItems()){if(_.kind==="comment"){if(_.range===null||!g(_.range.start.paragraphId,_.range.end.paragraphId))continue;y.push({key:chunk35MI6K7M_cjs.Qg(_),from:{paragraphId:_.range.start.paragraphId,offset:_.range.start.offset},to:{paragraphId:_.range.end.paragraphId,offset:_.range.end.offset}});continue}let q=chunk35MI6K7M_cjs.Qg(_),se=_.kind==="revision"?_.ranges:_.range?[_.range]:[];for(let[J,ee]of se.entries())g(ee.start.paragraphId,ee.end.paragraphId)&&y.push({key:se.length===1?q:`${q}${b}${J}`,from:{paragraphId:ee.start.paragraphId,offset:ee.start.offset},to:{paragraphId:ee.end.paragraphId,offset:ee.end.offset}});}let I=chunk6K6QQVAZ_cjs.Vd(Y,y,u),L=[];for(let[_,q]of I)for(let se of q)L.push({...se,key:_});return $n={layout:Y,revision:l,pages:u,rects:L},L}let bn=null;function Ay(l){bn&&(l.impact==="text-local"&&l.created.length===0&&l.deleted.length===0&&l.splitJoin.length===0?bn={packageRevision:a.packageRevision(),bodyRoot:a.part().root,index:bn.index}:bn=null);}function My(){let l=a.packageRevision(),u=a.part().root;if(bn&&bn.packageRevision===l&&bn.bodyRoot===u)return bn.index;let f=new Map,g=I=>{let L=f.size;for(let[_,q]of I)f.has(_)||f.set(_,L+q);};g(chunk35MI6K7M_cjs.ch(a.part()));let y=new Set([a.part()]);for(let I of a.headerFooterPartsBySection())for(let L of [I.headers,I.footers])for(let _ of L.values())y.has(_)||(y.add(_),g(chunk35MI6K7M_cjs.ch(_)));for(let I of ["footnote","endnote"]){let L=a.partFor({kind:"notesPart",noteKind:I});!L||y.has(L)||(y.add(L),g(chunk35MI6K7M_cjs.ch(L)));}return bn={packageRevision:l,bodyRoot:u,index:f},f}let jn=new Set,Qr=null,Jr=null,Hi=false;function eo(){Hi||(Jr=null);}function Ld(){let l=Jr;if(!l||!k)return null;let u=(g,y)=>g.paragraphId===y.paragraphId&&g.offset===y.offset;if(!u(k.anchor,l.anchor)||!u(k.head,l.head))return null;let f=a.reviewItems().find(g=>chunk35MI6K7M_cjs.Qg(g)===l.key);return !f||f.kind==="revision"&&Qr!==null&&Qr.has(f.revisionKind)?null:f}function _i(){let l=Ld();if(l)return Nd(l);let u=k?.head;if(!u)return null;let g=chunk35MI6K7M_cjs.Ug(a.reviewItems(),u,My()).filter(y=>!(y.kind==="comment"&&y.resolved)&&!jn.has(chunk35MI6K7M_cjs.Qg(y))&&!(y.kind==="revision"&&Qr!==null&&Qr.has(y.revisionKind)))[0];return g?Nd(g):null}function Nd(l){if(l.kind!=="comment")return l;let u=chunk35MI6K7M_cjs.Wg(a.reviewItems(),l);return jn.has(chunk35MI6K7M_cjs.Qg(u))?null:u}function Dd(l){return l.kind==="comment"?l.comment.author:l.kind==="revision"?l.author:""}function Bi(){let l=a.reviewItems(),u=jt;if(u!==null&&u.layout===Y&&u.items===l&&u.styles===$t)return u;let f=Ri.resolve(chunk4XL7SOWQ_cjs.c(Y),(function*(){for(let q of l)yield Dd(q);})()),g=u?.value,y=g!==void 0&&g.size===f.size&&[...f].every(([_,q])=>g.get(_)===q),I=y?g:f,L=u!==null&&y&&u.styles===$t?u.resolved:new Map(chunk4XL7SOWQ_cjs.b(I,$t).map(_=>[_.author,_]));return jt={layout:Y,items:l,styles:$t,value:I,resolved:L},jt}function Ly(l,u,f){let g=l.split(b),y=g[0],I=u!==null&&y===chunk35MI6K7M_cjs.Qg(u);if(l.startsWith("comment-")){let J=f.get(y),ee=J?.kind==="comment"&&J.resolved;return ee&&!I?null:I?`docx-comment-band docx-comment-band--active${ee?" docx-comment-band--resolved-active":""}`:"docx-comment-band"}if(l.startsWith("custom-"))return I?"docx-comment-band docx-comment-band--active":null;let L=f.get(y);if(!L||L.kind!=="revision")return null;let _=g.length>1?Number(g[1]):0;return `docx-revision-band docx-revision-band--${(J=>J==="delete"||J==="moveFrom"?"delete":J==="insert"||J==="moveTo"?"insert":J==="replace"&&L.replacedRangeCount!==void 0?_<L.replacedRangeCount?"delete":"insert":"other")(L.revisionKind)}${I?" docx-revision-band--active":""}`}let Hd=null,_d,Bd=null;function fr(l=false){let u=_i(),f=u?chunk35MI6K7M_cjs.Qg(u):null,g=Bi();if(!l&&Hd===Y&&_d===f&&Bd===g.resolved)return;let y=new Map;for(let L of a.reviewItems())y.set(chunk35MI6K7M_cjs.Qg(L),L);let I=[];for(let L of Fy()){let _=Ly(L.key,u,y);if(!_)continue;let q=y.get(L.key.split(b)[0]),se=q?Dd(q):"",J=se===""?void 0:g.resolved.get(se);I.push({...L,className:_,...J?{reviewAuthor:J}:{}});}chunk4XL7SOWQ_cjs.l(j,Y,I,{scale:i,...Ue?{pageOffsetX:Ue.pageOffsetX}:{}}),Hd=Y,_d=f,Bd=g.resolved;}function to(){let l=K?chunk6K6QQVAZ_cjs.me(Y,K.cellIds):me?chunk6K6QQVAZ_cjs.Td(Y,me,pe()):chunk6K6QQVAZ_cjs.Ud(Y,k,pe());chunk4XL7SOWQ_cjs.l($,Y,l,{scale:i,pageOffsetX:Ue?.pageOffsetX,...K?{}:{className:me?"docx-retained-selection-rect":"docx-selection-mark-rect"}});}function aa(l){let u=chunk35MI6K7M_cjs.Bc(a.part());if(l)return u.find(y=>y.id===l)??null;let f=Xr?u.find(y=>y.id===Xr):void 0;if(f)return f;let g=k.head.paragraphId;return u.find(y=>y.beginParagraphId===g||y.endParagraphId===g||y.resultParagraphIds.includes(g))??(u.length===1?u[0]:null)}function no(l){return chunk35MI6K7M_cjs.Bc(a.part()).find(f=>f.beginParagraphId===l||f.endParagraphId===l||f.resultParagraphIds.includes(l))?.id??null}function qi(){return no(k.anchor.paragraphId)!==null||no(k.head.paragraphId)!==null}function Ny(l){let u=ia(),f=(g,y="")=>typeof g=="string"?/(?:Id|Ids)$/.test(y)&&u.has(g):Array.isArray(g)?g.some(I=>f(I,y)):!g||typeof g!="object"?false:Object.entries(g).some(([I,L])=>f(L,I));return f(l)}function ia(){return new Set(chunk35MI6K7M_cjs.Bc(a.part()).flatMap(l=>[l.beginParagraphId,...l.resultParagraphIds,l.endParagraphId]))}function Zi(l){return new Set([l.beginParagraphId,l.endParagraphId,...l.resultParagraphIds])}function Dy(l){let u=0;for(let f of Y.pages)for(let g of chunk6K6QQVAZ_cjs.Y(f))l.has(g.paragraphId)&&(u+=g.lines.length);return u}function zi(l,u){let f=new Set(u),g=new Map;for(let y of l.pages)for(let I of chunk6K6QQVAZ_cjs.Y(y)){if(!f.has(I.paragraphId)||g.has(I.paragraphId))continue;let L=y.pageFieldSource;g.set(I.paragraphId,chunk6K6QQVAZ_cjs.fb(L?.pageNumber??y.index+1,L?.format));}return g}function $i(l){if(Ae==="view"||!a.editable)return false;let u=aa(l);return u?chunk35MI6K7M_cjs.$f(a.part(),{op:"rewriteTocPageNumbers",tocId:u.id,updates:[]})===null:false}function qd(l,u){if(!Number.isInteger(l)||!Number.isInteger(u)||l<1||u<1)return null;let f=Vr.sectionPropertiesAt(k.head.paragraphId),g=f.pageSize.widthTwips-f.margins.leftTwips-f.margins.rightTwips-f.margins.gutterTwips,y=Math.max(300,Math.floor(g/u));return {op:"insertTable",beforeParagraphId:k.head.paragraphId,rows:l,cols:u,columnWidthTwips:y}}function Zd(l,u){if(Ae==="view"||!a.editable)return false;let f=qd(l,u),g=a.partFor(V())??a.part();return f!==null&&chunk35MI6K7M_cjs.$f(g,f)===null}function Hy(l,u){if(!Zd(l,u))return false;let f=qd(l,u);if(!f)return false;let g=null,y=a.subscribe(L=>{L.caret&&(g=L.caret);}),I=false;try{Ee(()=>{let L=He([f],Ne());return L.committed||(X=L.reason??"the table could not be inserted here"),I=L.committed,L},()=>{let L=g;return L?Oe({paragraphId:L.paragraphId,offset:L.start}):null});}finally{y();}return I}let zd='TOC \\o "1-3" \\h';function $d(){let l=chunk35MI6K7M_cjs.Ac(zd);if(!l)return null;let u=a.documentOutline(),f=chunk35MI6K7M_cjs.Oc(a.part(),u,l,zi(_e.layout(),u.map(g=>g.blockId)),ia());return {op:"insertToc",beforeParagraphId:k.head.paragraphId,instruction:zd,alias:n.tocLabels?.title??"TOC",entries:f.entries,bookmarksToCreate:f.bookmarksToCreate}}function jd(){if(Ae==="view"||!a.editable||qi())return false;let l=$d();return l!==null&&chunk35MI6K7M_cjs.$f(a.part(),l)===null}function _y(){if(!jd())return false;let l=$d();if(!l)return false;let u=new Set(chunk35MI6K7M_cjs.Bc(a.part()).map(y=>y.id)),f=a.applyTreeOps([l]);if(!f.committed)return X=f.reason??"the table of contents could not be inserted",false;let g=chunk35MI6K7M_cjs.Bc(a.part()).find(y=>!u.has(y.id));return g?Kd(g.id,"pageNumbers"):true}function Kd(l,u="entire"){let f=aa(l);if(!f||!$i(f.id))return false;let g=_e.layout(),y=a.documentOutline(),I=y.map(_=>_.blockId);if(u==="entire"){let _=chunk35MI6K7M_cjs.Oc(a.part(),y,f.instruction,zi(g,I),Zi(f)),q=a.applyTreeOps([{op:"replaceTocResult",tocId:f.id,entries:_.entries,bookmarksToCreate:_.bookmarksToCreate}]);if(!q.committed)return X=q.reason??"the table of contents could not be refreshed",false;if(g=_e.layout(),f=aa(f.id),!f)return true}let L="";for(let _=0;_<3;_+=1){let q=zi(g,I),se=chunkC6LK2BYA_cjs.H(a.part(),f,y,Zi(f)),J=f.resultParagraphIds.flatMap((be,et)=>{let vt=se[et],Be=vt?q.get(vt):void 0;return Be===void 0?[]:[{paragraphId:be,pageNumberText:Be}]});if(J.length===0)break;let ee=J.map(be=>`${be.paragraphId}\0${be.pageNumberText}`).join("");if(ee===L)break;L=ee;let Ie=a.applyTreeOps([{op:"rewriteTocPageNumbers",tocId:f.id,updates:J}]);if(!Ie.committed){if(Ie.rejected)return X=Ie.reason??"the table of contents page numbers were refused",false;break}g=_e.layout(),f=aa(f.id)??f;}return true}let _e={session:a,storyScope:V,imageDecodePort:()=>Te,layout:()=>(Q(),Y),state:qe,currentPage:(l="caret")=>{if(Q(),l==="viewport"){let f=Mg(e,Y,i);if(f!==null)return f}let u=chunk6K6QQVAZ_cjs.$d(Y,k.head);return u?u.pageIndex+1:1},setScale(l){if(!(l>0)||!Number.isFinite(l))return false;if(l===i)return true;let u={scale:i,defaults:w,measurer:F,producer:h,furnitureSource:Tn};try{let f=Rt(e),g=f?{x:(f.scrollLeft-e.offsetLeft+f.clientWidth/2)/i,y:(f.scrollTop-e.offsetTop+f.clientHeight/2)/i}:null;if(i=l,n.measurer||(w=chunk6K6QQVAZ_cjs.Ld(i,{context:Mr(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),F=w.measurer),h=B(),Tn=Hl({session:a,measurer:F,producer:h,cache:T,styleCascade:Ce,numberingIndex:Zt,defaultTabStopPt:ct,displayMode:wn(),inlineDrawingLayoutForPart:y=>$e.contextForPart(y),drawingLayoutTokenForPart:y=>$e.cacheTokenForPart(y),drawingTokenForParagraphForPart:(y,I)=>$e.drawingTokenForParagraph(I,y)}),ln=void 0,Ue=void 0,$n=null,C.invalidateAll(a.packageRevision(),"zoom"),C.flush(),f&&g){let y=Math.max(0,g.x*i+e.offsetLeft-f.clientWidth/2),I=Math.max(0,g.y*i+e.offsetTop-f.clientHeight/2),L=Number.isFinite(f.scrollWidth)?Math.max(0,f.scrollWidth-f.clientWidth):null,_=Number.isFinite(f.scrollHeight)?Math.max(0,f.scrollHeight-f.clientHeight):null;f.scrollLeft=L===null?y:Math.min(y,L),f.scrollTop=_===null?I:Math.min(I,_),oa();}return !0}catch{(({scale:i,defaults:w,measurer:F,producer:h,furnitureSource:Tn}=u)),ln=void 0,Ue=void 0,$n=null;try{C.invalidateAll(a.packageRevision(),"zoom-rollback"),C.flush();}catch{}return false}},enqueueType:Pn,flushPendingInput:Q,type(l){let u=Wt(),f=u.replaceAt??u.collapseTo,g=R(f.paragraphId,f.offset,l.length),y=[...u.ops,{op:"insertText",paragraphId:f.paragraphId,offset:f.offset,text:l}],I={paragraphId:f.paragraphId,start:f.offset+l.length,end:f.offset+l.length};Ee(()=>v([...y,...g],y,Ne(),I),()=>Oe({paragraphId:f.paragraphId,offset:f.offset+l.length}));},proposeTextChange:(l,u,f)=>m(l,u,f),insertPlainText:l=>Ki(l),deleteBackward(){let l=Wt();if(l.ops.length>0){Ee(()=>He(l.ops,Ne(),On(l.collapseTo)),()=>Oe(l.collapseTo));return}let u=H()??void 0,f=k.head;if(f.offset===0){for(let q of chunk6K6QQVAZ_cjs.wc(Y,f.paragraphId)){let se=Je(q);if(se.length!==0){Ee(()=>He([{op:"deleteText",paragraphId:q,start:se.length-1,end:se.length}],Ne(),On({paragraphId:q,offset:se.length-1})),()=>Oe({paragraphId:q,offset:se.length-1}),{rearmPending:u});return}}let y=pe(),I=y.indexOf(f.paragraphId),L=y[I-1];if(!L)return;if(!Cy(L,f.paragraphId)){ft(Oe({paragraphId:L,offset:Je(L).length}));return}let _=Je(L).length;Ee(()=>He([{op:"joinParagraphs",firstId:L,secondId:f.paragraphId}],Ne(),On({paragraphId:L,offset:_})),()=>Oe({paragraphId:L,offset:_}),{rearmPending:u});return}let g=Ud(f,"before");if(g){Ee(()=>He([{op:"removeContentControl",controlId:g.controlId,keepContent:false}],Ne(),On({paragraphId:f.paragraphId,offset:g.start})),()=>Oe({paragraphId:f.paragraphId,offset:g.start}),{rearmPending:u});return}Ee(()=>He([{op:"deleteText",paragraphId:f.paragraphId,start:f.offset-1,end:f.offset}],Ne(),On({...f,offset:f.offset-1})),()=>Oe({...f,offset:f.offset-1}),{rearmPending:u});},splitParagraph(){let l=Wt(),u=l.replaceAt??l.collapseTo,f=new Set(a.paragraphIdsIn(V())),g=H()??void 0,y=By(u)?rn.followerStyleId(u.paragraphId):void 0;Ee(()=>He([...l.ops,{op:"splitParagraph",paragraphId:u.paragraphId,offset:u.offset,tailStyleId:y}],Ne()),()=>{let I=a.paragraphIdsIn(V()).find(L=>!f.has(L));return I?Oe({paragraphId:I,offset:0}):null},{rearmPending:g});},navigate(l,u=false){if(Q(),!u&&(l==="left"||l==="right")&&(k.anchor.paragraphId!==k.head.paragraphId||k.anchor.offset!==k.head.offset)){let y=Ut();Kt=null,ft(Oe(l==="left"?y.from:y.to),true);return}let f=Hs(Y,k.head,l,Kt,D?.getActive()??null,re(),F);if(!f)return;let g=ia();if(g.has(f.position.paragraphId)){if(u)return;let I=new Set(["left","wordLeft","lineStart","up","pageUp"]).has(l)?"up":"down",L=Dy(g)+4;for(let _=0;_<L;_+=1){let q=Hs(Y,f.position,I,f.desiredX,D?.getActive()??null,re(),F);if(!q||q.position.paragraphId===f.position.paragraphId&&q.position.offset===f.position.offset)return;if(f=q,!g.has(f.position.paragraphId))break}if(g.has(f.position.paragraphId))return}Kt=f.desiredX,W?.activeNoteScope()&&f.pageIndex!==void 0&&Number.isInteger(f.pageIndex)&&W.setActiveNotePageIndex(f.pageIndex),ft({anchor:u?k.anchor:f.position,head:f.position},true);},deleteWordBackward(){if(_e.deleteSelection())return;let l=k.head,u=chunk6K6QQVAZ_cjs.Yd(Je(l.paragraphId),l.offset,-1,chunk6K6QQVAZ_cjs.ee(Y,l.paragraphId));if(u===l.offset){_e.deleteBackward();return}Ee(()=>He([{op:"deleteText",paragraphId:l.paragraphId,start:u,end:l.offset}],Ne()),()=>Oe({...l,offset:u}),{rearmPending:H()??void 0});},deleteWordForward(){if(_e.deleteSelection())return;let l=k.head,u=chunk6K6QQVAZ_cjs.Yd(Je(l.paragraphId),l.offset,1,chunk6K6QQVAZ_cjs.ee(Y,l.paragraphId));if(u===l.offset){_e.deleteForward();return}Ee(()=>He([{op:"deleteText",paragraphId:l.paragraphId,start:l.offset,end:u}],Ne()),void 0,{rearmPending:H()??void 0});},deleteForward(){if(_e.deleteSelection())return;let l=H()??void 0,u=k.head,f=Je(u.paragraphId);if(u.offset<f.length){let I=Ud(u,"after");if(I){Ee(()=>He([{op:"removeContentControl",controlId:I.controlId,keepContent:false}],Ne()),()=>Oe(u),{rearmPending:l});return}Ee(()=>He([{op:"deleteText",paragraphId:u.paragraphId,start:u.offset,end:u.offset+1}],Ne()),void 0,{rearmPending:l});return}let g=pe(),y=g[g.indexOf(u.paragraphId)+1];if(y){if(chunk6K6QQVAZ_cjs.wc(Y,y).includes(u.paragraphId)){if(Je(y).length===0)return;Ee(()=>He([{op:"deleteText",paragraphId:y,start:0,end:1}],Ne()),()=>Oe(u),{rearmPending:l});return}Ee(()=>He([{op:"joinParagraphs",firstId:u.paragraphId,secondId:y}],Ne()),()=>Oe(u),{rearmPending:l});}},...Vr,...Qo,setSelection:l=>{Ht(l,k)||U({kind:"programmatic"},false),ft(l);},revealPage(l,u){oe();let f=Y.pages.find(g=>g.index===l);return f?ro(f.box.y,f.box.height,u):false},revealParagraph(l,u){oe();let f=chunk6K6QQVAZ_cjs.$d(Y,{paragraphId:l,offset:0});if(!f)return false;let g=Y.pages.find(y=>y.index===f.pageIndex);return g?ro(g.contentBox.y+f.y,f.height,u):false},revealPosition(l,u){oe();let f=chunk6K6QQVAZ_cjs.$d(Y,l);if(!f)return false;let g=Y.pages.find(y=>y.index===f.pageIndex);return g?ro(g.contentBox.y+f.y,f.height,{block:"nearest",...u}):false},setEditable(l){Pd=l,Li();},selectAll(){let l=pe(),u=l[0],f=l[l.length-1];!u||!f||ft({anchor:{paragraphId:u,offset:0},head:{paragraphId:f,offset:Je(f).length}});},hyperlinks:ir,equations:Ur,contentControls:yn,canInsertTable:Zd,insertTable:Hy,canInsertToc:jd,insertToc:_y,canRefreshToc:$i,refreshToc:Kd,isInsideToc:l=>chunk35MI6K7M_cjs.Bc(a.part()).some(u=>u.beginParagraphId===l||u.endParagraphId===l||u.resultParagraphIds.includes(l)),retainSelection:()=>{let l=Symbol("selection-pin");return he.set(l,k),me=k,to(),l},releaseSelection:l=>{he.delete(l)&&(fe(),to());},retainedSelection:()=>me,publishedLayout:()=>Y,drawingSelectionIntent:()=>O,overlayCoordinates:()=>Object.freeze({paintScale:i,pageOffsetX:Ue?.pageOffsetX??new Map}),commitReviewOps:l=>{Q();let u=k.head.paragraphId,f=Je(u);return Ee(()=>{if(Ae==="view")return {committed:false,rejected:true,opCount:0,reason:d};let g=l();return {committed:g.committed,rejected:!g.committed,opCount:0,...typeof g.reason=="string"?{reason:g.reason}:{}}},()=>{oe(),Le.noteModelMoved();let g=pe();if(g.length===0)return null;let y=Py(k,u,f);return Ho(Y,g,y)})},revisionDisplayMode:wn,applyAutomationOps:(l,u)=>{let f={committed:false,rejected:false,opCount:0},g=u??xy;return Ee(()=>{let y=ur(false);if(y!==null)return f={committed:false,rejected:true,opCount:0,reason:y};let I=null,L=l(_=>{let q=ur(true,[],false);return q===null?a.ensureHyperlinkRelationship(_,g):(I=q,null)});return L===null?f={committed:false,rejected:true,opCount:0,reason:I??"this engine will not author that hyperlink target"}:f=He(L,void 0,void 0,g,false)},()=>{oe(),Le.noteModelMoved();let y=pe();return y.length===0?null:Ho(Y,y,k)}),f},editingMode:()=>Ae,setEditingMode:l=>{Q();let u=Ae!==l;Ae=l,u&&l==="view"&&D?.exitHeaderFooter(),Mi(),Li(),Ds(e,Ae),u&&ht(false),X=null,n.onChange?.(qe());},revisionAuthors:()=>Bi().value,setRevisionStyles:l=>{l!==$t&&($t=l,Q(),ht(false));},setReviewActivationExclusions(l){Qr=l===null?null:new Set(l),fr(),n.onChange?.(qe());},activeReviewKey:()=>{let l=_i();return l?chunk35MI6K7M_cjs.Qg(l):null},activateReview:(l,u)=>{if(jn.clear(),Jr=u?{key:l,anchor:u.anchor,head:u.head}:{key:l,anchor:k.anchor,head:k.head},u){Hi=true;try{ft(u);}finally{Hi=false;}return}fr(),n.onChange?.(qe());},activatedReviewKey:()=>Ld()===null?null:Jr?.key??null,dismissActiveReview:()=>{let l=_i();l&&(jn.add(chunk35MI6K7M_cjs.Qg(l)),Jr=null,fr(),n.onChange?.(qe()));},navigation:Wr,bookmarks:()=>a.bookmarks(),selectedText(){if(K)return chunk6K6QQVAZ_cjs.ne(Y,K);let{from:l,to:u}=Ut();return Tl(Y,l,u,pe())},copyFlavours:()=>Vy(),pasteRich:(l,u)=>Wy(l,u),armForcePlainPaste:()=>{la=Me();},deleteSelection(){let l=Wt();return l.ops.length===0?false:(Ee(()=>He(l.ops,Ne(),On(l.collapseTo)),()=>Oe(l.collapseTo)),true)},setCellSelection:Ad,layoutSession:()=>P,undo:()=>{if(Ae==="view"){X=d,n.onChange?.(qe());return}ut(),Vd(a.undo());},redo:()=>{if(Ae==="view"){X=d,n.onChange?.(qe());return}ut(),Vd(a.redo());},sectionAtPage:ie,activeScope:()=>{let l=W?.activeNoteScope();return l||D.activeScope()},setActiveScope:l=>(Q(),l.kind==="note"?W.enterNote(l.id):l.kind!=="body"&&l.kind!=="headerFooter"?false:(W?.exitNote(),D.setActiveScope(l))),insertNote:l=>(Q(),W.insertNote(l)),deleteNote:(l,u)=>W.deleteNote(l,u),convertNote:(l,u)=>W.convertNote(l,u),convertAllNotes:l=>W.convertAllNotes(l),setNoteProperties:l=>W.setNoteProperties(l),enterNote:(l,u)=>(Q(),W.enterNote(l,u)),exitNote:()=>(Q(),W.exitNote()),notePropertiesState:()=>{let l=_e.state().selection.head.paragraphId,u=a.packageRevision(),f=a.currentPackage(),g=a.part(),y=chunk35MI6K7M_cjs.Md(f),I=chunk35MI6K7M_cjs.ge(f,"footnote"),L=chunk35MI6K7M_cjs.ge(f,"endnote"),_=_e.activeScope().kind==="headerFooter",q=_e.headerFooterState(),se=q?.rId??null,J=q?.sectionIndex??null,ee=ne;if(ee&&ee.packageRevision===u&&ee.paragraphId===l&&ee.bodyPart===g&&ee.settingsPart===y&&ee.footnotesPart===I&&ee.endnotesPart===L&&ee.headerFooterOpen===_&&ee.headerFooterRId===se&&ee.headerFooterSectionIndex===J)return ee.result;let Ie=Xm(_e);return ne={packageRevision:u,paragraphId:l,bodyPart:g,settingsPart:y,footnotesPart:I,endnotesPart:L,headerFooterOpen:_,headerFooterRId:se,headerFooterSectionIndex:J,result:Ie},Ie},notePreviewText:l=>Ym(a,l),applyTableCommandPlan(l){if(!l.ok)return {ok:false,code:l.code,reason:l.reason};let u=null,f=a.subscribe(g=>{g.caret&&(u=g.caret);});try{let g=Ne(),y=l.selection.kind==="adoptCommittedCaret";Ee(()=>He(l.ops,g),y?()=>{let I=u;return I?Oe({paragraphId:I.paragraphId,offset:I.start}):null}:void 0,l.selection.kind==="preserveSelection"?{keepCellSelection:!0}:void 0);}finally{f();}return X?{ok:false,code:"invalidArgs",reason:X}:{ok:true,changed:true}},enterHeaderFooter:l=>{Q();let u=D.enterHeaderFooter(l);if(!u)return u;let f=D.getActive(),g=f?Y.pages[f.pageIndex]:void 0;if(f&&g){let y=f.kind==="header"?g.header:g.footer,I=y?.box.y??(f.kind==="header"?g.box.y:g.box.y+g.box.height-1),L=y?.box.height??1;ro(I,L,{block:"nearest"});}return u},exitHeaderFooter:()=>(Q(),D.exitHeaderFooter()),headerFooterState:()=>D.headerFooterStateStable(a.packageRevision()),...jm({applyOps:He,commit:Ee,deleteSelectionOps:Zy,deleteSelectionPlan:()=>Wt(),orderedStart:sa,selectionMark:Ne,collapsedAt:Oe,isHeaderFooterOpen:()=>D?.getActive()!==null,lastRejection:()=>X}),...Vm({session:a,applyOps:He,commit:Ee,storyScope:V,selectionMark:Ne,editingMode:()=>Ae,author:()=>n.author,trackedDate:x,decodePort:()=>Te}),focus:()=>A.focus({preventScroll:true}),setTableInteractionLabel(l){s.resolve=l;},refreshTableInteractionLabels(){oo.refreshLabels();},destroy(){ve(),N.removeEventListener("selectionchange",Gd),A.removeEventListener("pointerdown",rc,{capture:true}),A.removeEventListener("keydown",da,{capture:true}),A.removeEventListener("beforeinput",da,{capture:true}),A.removeEventListener("keydown",Qd),A.removeEventListener("beforeinput",nc),A.removeEventListener("copy",Jd),A.removeEventListener("cut",ec),A.removeEventListener("paste",tc),A.removeEventListener("compositionstart",Yd),A.removeEventListener("compositionend",Xd),N.removeEventListener("scroll",oc,{capture:true}),e.ownerDocument.defaultView?.removeEventListener("resize",Wi),Yr?.disconnect(),Di=null,ji?.destroy(),oo.destroy(),Wr.destroy(),ta.destroy(),Le.destroy(),A.removeEventListener("contextmenu",kd),A.removeEventListener("click",wd),A.removeEventListener("pointermove",Zn),A.removeEventListener("pointerleave",je),C.cancel(),Et!==null&&clearTimeout(Et),Et=null,Bn&&Bn(),Bn=null,$e.dispose(),chunk4XL7SOWQ_cjs.e(A),G.destroy(),le(),e.replaceChildren();}};function Vd(l){if(Fe=null,Le.noteModelMoved(),oe(),!l){ft(Ho(Y,pe(),k));return}let u={anchor:{paragraphId:l.paragraphId,offset:l.start},head:{paragraphId:l.paragraphId,offset:l.end}};ft(pe().includes(l.paragraphId)?u:Ho(Y,pe(),u));}function ro(l,u,f){let g=Rt(e);if(!g||g.clientHeight===0)return false;let y=l*i+e.offsetTop,I=u*i,L=f?.offsetPx??24,_=f?.block??"start",q=g.clientHeight;if(_==="nearest"||_==="centerIfNeeded"){let ee=y<g.scrollTop,Ie=y+I>g.scrollTop+q;if(!ee&&!Ie)return true}let se=_==="center"||_==="centerIfNeeded"?y-Math.max(0,(q-I)/2):_==="nearest"&&y>g.scrollTop?y+I+L-q:y-L,J=Math.max(0,g.scrollHeight-q);return g.scrollTo({top:Math.max(0,Math.min(se,J)),behavior:f?.behavior??"auto"}),oa(),true}function Ne(){return er(k)}function Ut(){return Q(),wl(Y,k,pe())}function sa(){return Ut().from}function Je(l){return chunk6K6QQVAZ_cjs.de(Y,l)}function Ud(l,u){let f=a.partFor(V())??a.part(),g=chunk35MI6K7M_cjs.ya(f,l.paragraphId);return !g||g.kind!=="paragraph"?null:u==="before"?chunk35MI6K7M_cjs.be(g,l.offset):chunk35MI6K7M_cjs.ce(g,l.offset)}function By(l){if(Fd()!==void 0||K)return false;let u=Ut();return u.from.paragraphId===u.to.paragraphId&&u.from.offset===u.to.offset?rn.atParagraphEnd(l.paragraphId,l.offset):rn.atParagraphEnd(u.to.paragraphId,u.to.offset)}function Wt(l){let u=l?.trim()||void 0,f=qy(),g=K,y=null;return {...f,get replaceAt(){return y??=zy(f,u,g),y}}}function qy(){if(Q(),K){let f=[];for(let g of chunk6K6QQVAZ_cjs.ke(Y,K.cellIds)){let y=chunk6K6QQVAZ_cjs.de(Y,g).length;y>0&&f.push({op:"deleteText",paragraphId:g,start:0,end:y});}return {ops:f,collapseTo:sa()}}if(k.anchor.paragraphId===k.head.paragraphId&&k.anchor.offset===k.head.offset)return {ops:[],collapseTo:chunk6K6QQVAZ_cjs.Xd(Y,k.head)};let{from:l,to:u}=Ut();return xp(Y,a.partFor(V())??a.part(),l,u,pe())}function Zy(){return Wt().ops}function pr(l,u,f){if(!(f!==void 0||Ae==="suggest")||l.paragraphId!==u.paragraphId)return l.offset;let y=chunk6K6QQVAZ_cjs.Xd(Y,u);return y.offset-Wd(l,y,f??n.author)}function zy(l,u,f){let g=l.collapseTo;if(u===void 0&&Ae!=="suggest")return g;if(f){for(let Be of f.cellIds){let ot=chunk6K6QQVAZ_cjs.je(Y,[Be]),pt=ot.length>0?ot:chunk6K6QQVAZ_cjs.ke(Y,[Be]);if(pt.length===0)continue;let Fn=new Map,Se=Ze=>{let tt=Fn.get(Ze);return tt===void 0&&(tt=pr({paragraphId:Ze,offset:0},{paragraphId:Ze,offset:Je(Ze).length},u),Fn.set(Ze,tt)),tt},dn=(u??n.author)?.trim(),Kn=Ze=>{let tt=Je(Ze);if(!dn)return /\S/.test(tt);let Vn=chunk35MI6K7M_cjs.ya(en(a,Ze)??a.part(),Ze);if(!Vn||Vn.kind!=="paragraph")return /\S/.test(tt);let Gt="",Un=0;for(let gr of chunk35MI6K7M_cjs.ne(Vn,0,tt.length,dn))Gt+=tt.slice(Un,Math.max(Un,gr.start)),Un=Math.max(Un,gr.end);return Gt+=tt.slice(Un),/\S/.test(Gt)},Ot=null;for(let Ze=pt.length-1;Ze>=0;Ze-=1){let tt=pt[Ze];if(Kn(tt)){Ot=tt;break}}if(Ot===null)for(let Ze=pt.length-1;Ze>=0;Ze-=1){let tt=pt[Ze];if(Se(tt)!==0){Ot=tt;break}}return Ot??=pt[pt.length-1],{paragraphId:Ot,offset:Se(Ot)}}return g}let{from:y,to:I}=Ut();if(y.paragraphId===I.paragraphId&&y.offset===I.offset)return g;if(y.paragraphId===I.paragraphId)return {paragraphId:I.paragraphId,offset:pr(y,I,u)};let L=new Set(l.ops.flatMap(Be=>Be.op==="deleteBlock"?[Be.blockId]:[])),_=en(a,I.paragraphId)??a.part();if(L.size>0)for(let Be=chunk35MI6K7M_cjs.za(_,I.paragraphId);Be;Be=chunk35MI6K7M_cjs.za(_,Be.id)){if(!L.has(Be.id))continue;let ot={paragraphId:g.paragraphId,offset:Je(g.paragraphId).length};return {paragraphId:g.paragraphId,offset:pr(g,ot,u)}}let q=(u??n.author)?.trim();if(!q)return g;let se=new Set(l.ops.flatMap(Be=>Be.op==="joinParagraphs"?[Be.secondId]:[])),J=pe(),ee=J.indexOf(y.paragraphId),Ie=J.indexOf(I.paragraphId);if(ee===-1||Ie===-1)return g;let be=Be=>{let ot=chunk35MI6K7M_cjs.ya(_,Be);return ot?.kind==="paragraph"&&chunk35MI6K7M_cjs.Yf(ot,q)},et=Ie;for(;et>ee&&se.has(J[et])&&be(J[et-1]);)et-=1;let vt=0;for(let Be=et;Be<=Ie;Be+=1){let ot=J[Be],pt={paragraphId:ot,offset:ot===y.paragraphId?y.offset:0},Fn=ot===I.paragraphId?chunk6K6QQVAZ_cjs.Xd(Y,I):{paragraphId:ot,offset:Je(ot).length};Be===et&&(vt+=pt.offset),vt+=Fn.offset-pt.offset-Wd(pt,Fn,q);}return {paragraphId:J[et],offset:vt}}function Wd(l,u,f){let g=f?.trim();if(!g||l.paragraphId!==u.paragraphId)return 0;let y=a.partFor(V())??a.part(),I=chunk35MI6K7M_cjs.ya(y,u.paragraphId);return !I||I.kind!=="paragraph"?0:chunk35MI6K7M_cjs.me(I,l.offset,u.offset,g)}let{onSelectionChange:Gd,onCompositionEnd:Xd}=Le,Yd=(...l)=>{Le.adoptBeforeInput(),ve(),Le.onCompositionStart(...l);},ji=null,$y=wg(_e,n.onRequestHyperlink?{onRequestHyperlink:n.onRequestHyperlink}:{}),Qd=l=>{l.defaultPrevented||Le.adoptBeforeInput(),$y(l);},{onCopy:Jd,onCut:ec,onPaste:tc}=Tg(_e),jy=Pg(_e,{isComposing:()=>Le.isComposing(),insertPlainText:Ki,onBrowserSelectionFixup:()=>{Le.mirrorToDom(),Le.noteBrowserSelectionFixup();}}),nc=l=>{Le.adoptBeforeInput(),jy(l);};function Ki(l){let u=ig(l).split(`
|
|
17
|
-
`),f=Wt(),g=f.replaceAt??f.collapseTo,y=u.join(""),I=[...f.ops],L=R(g.paragraphId,g.offset,y.length);y.length>0&&(I.push({op:"insertText",paragraphId:g.paragraphId,offset:g.offset,text:y}),I.push(...L));let _=[],q=0;for(let be=0;be<u.length-1;be+=1)q+=u[be].length,_.push(g.offset+q);if(_.length>0&&I.push({op:"splitParagraphMany",paragraphId:g.paragraphId,offsets:_}),I.length===0)return;let se=new Set(a.paragraphIdsIn(V())),J=u[u.length-1],ee=_.length===0?On({paragraphId:g.paragraphId,offset:g.offset+J.length}):void 0,Ie=I.filter(be=>!L.includes(be));Ee(()=>v(I,Ie,Ne(),ee),()=>{if(_.length===0)return Oe({paragraphId:g.paragraphId,offset:g.offset+J.length});let be=a.paragraphIdsIn(V()).filter(vt=>!se.has(vt)),et=be[be.length-1];return et?Oe({paragraphId:et,offset:J.length}):null});}let la=null,Ky=2e3;function Vy(){if(Q(),K)return Rl({text:chunk6K6QQVAZ_cjs.ne(Y,K),cellRectangle:true,coverage:null,pkg:null});let{from:l,to:u}=Ut(),f=Tl(Y,l,u,pe()),g=V();if(f.length===0||g.kind!=="body")return {text:f,html:null};let y=a.part(),I=vp(Y,y,l,u,pe());return Rl({text:f,cellRectangle:false,coverage:I,pkg:a.currentPackage()})}function Uy(l,u){if(Ae!=="edit"||V().kind!=="body"||K)return false;Q();let f=Wt(),g=f.replaceAt??f.collapseTo,y=false;return Ee(()=>{let I=a.applyFragmentPaste({kind:"body"},{paragraphId:g.paragraphId,offset:g.offset,fragmentBytes:l,lastMarkCovered:u,priorOps:f.ops});return y=I.ok,{committed:I.ok,rejected:!I.ok,opCount:I.ok?1:0,...I.ok?{}:{reason:I.detail??I.reason}}},()=>Oe(g)),y}function Wy(l,u){let f=la!==null&&Me()-la<Ky;return la=null,rg({richLaneOpen:Ae==="edit"&&V().kind==="body"&&K===null,pasteFragment:(y,I)=>Uy(y,I),insertPlainText:Ki},{html:u,text:l,forcePlain:f})!=="none"}N.addEventListener("selectionchange",Gd);let Gy=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock","ContextMenu"]),rc=l=>{if(l instanceof PointerEvent&&l.button!==0)return;let f=(l.target instanceof Element?l.target:null)?.closest("[data-drawing-node-id]")?.getAttribute("data-drawing-node-id");U(f?{kind:"pointer",drawingNodeId:f}:{kind:"none"},true);},da=l=>{if(l instanceof KeyboardEvent&&Gy.has(l.key))return;if((l instanceof KeyboardEvent&&(l.key==="Delete"||l.key==="Backspace")&&!l.altKey&&!l.ctrlKey&&!l.metaKey||l instanceof InputEvent&&(l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward"))&&O.kind==="pointer"){let f=Xa(_e);if(f!==null){l.preventDefault(),l.stopImmediatePropagation(),U({kind:"none"},true),_e.deleteImage(f.drawingNodeId);return}}U({kind:"none"},true);};A.addEventListener("pointerdown",rc,{capture:true}),A.addEventListener("keydown",da,{capture:true}),A.addEventListener("beforeinput",da,{capture:true}),A.addEventListener("keydown",Qd),A.addEventListener("beforeinput",nc),A.addEventListener("copy",Jd),A.addEventListener("cut",ec),A.addEventListener("paste",tc),A.addEventListener("compositionstart",Yd),A.addEventListener("compositionend",Xd);let Vi=false;function Ui(){if(Vi)return;Vi=true;let l=e.ownerDocument.defaultView?.requestAnimationFrame,u=()=>{Vi=false,oa();};l?l(u):queueMicrotask(u);}let oc=l=>{let u=Rt(e);!u||l.target!==u||Ui();};N.addEventListener("scroll",oc,{capture:true,passive:true});let Wi=()=>{Ui();},Gi=e.ownerDocument.defaultView;Gi?.addEventListener("resize",Wi,{passive:true}),Yr=typeof Gi?.ResizeObserver=="function"?new Gi.ResizeObserver(Wi):null;function ac(){if(!Yr)return;let l=Rt(e);l!==Di&&(Yr.disconnect(),Di=l,l&&Yr.observe(l));}ac(),ji=um({pagesLayer:A,container:e,scale:()=>i,pageOffsetX:l=>Ue?.pageOffsetX.get(l)??0,layout:()=>(oe(),Y),measurer:()=>F,selection:()=>k,setSelection:l=>ft(l),cellSelection:()=>K,setCellSelection:l=>Ad(l),focus:()=>A.focus({preventScroll:true}),activeHeaderFooter:()=>ff(D?.getActive()??null),activeNote:()=>{let l=W?.activeNoteScope();return l?{scopeId:l.id,pageIndex:W?.activeNotePageIndex()??null}:null},enterHeaderFooter:l=>{Q(),D?.enterHeaderFooter({rId:l.rId,pageIndex:l.pageIndex,sectionIndex:ie(l.pageIndex).sectionIndex,kind:l.kind,...l.position?{position:l.position}:{}});},enterNote:(l,u,f)=>{Q(),W?.enterNote(l,u,f);},exitNote:l=>{Q(),W?.exitNote(l);},exitHeaderFooter:()=>(Q(),D?.exitHeaderFooter()),enterEmptyHeaderFooter:(l,u)=>{if(Ae==="view")return;Q();let{sectionIndex:f,sectionStart:g}=ie(u),y=a.headerFooterResolutionBySection(),I=y[Math.min(f,Math.max(0,y.length-1))],L=Y.pages[u]?.pageFieldSource?.pageNumber??u+1,_=I?.evenAndOddHeaders&&L%2===0?"even":I?.titlePage&&u===g?"first":"default",q=J=>{let ee=J[Math.min(f,Math.max(0,J.length-1))];return l==="header"?ee?.headers:ee?.footers},se=q(y)?.get(_)?.rId;if(!se){if(!_e.applyHeaderFooterLifecycle?.({op:"createHeaderFooter",sectionIndex:f,kind:l,variant:_,..._==="first"?{titlePage:true}:{},..._==="even"?{evenAndOddHeaders:true}:{}})?.ok)return;se=q(a.headerFooterResolutionBySection())?.get(_)?.rId,oe();}se&&D?.enterHeaderFooter({rId:se,pageIndex:u,sectionIndex:f,kind:l,variant:_});},onContentControlWidget:(l,u)=>by(l,u),isReadOnlyParagraph:l=>no(l)!==null},n.pointer?{mode:n.pointer}:{});let oo=Vg({pagesLayer:A,furnitureLayer:M,scale:()=>i,pageOffsetX:l=>Ue?.pageOffsetX.get(l)??0,read:()=>({layout:Y,storeRevision:a.packageRevision(),selection:k,cellSelection:K,editingMode:Ae,themeColors:a.documentThemeColors()}),session:()=>a,applyTableCommandPlan:l=>_e.applyTableCommandPlan(l),label:l=>s.resolve(l)});return ht(),Li(),_e.setTableInteractionLabel=l=>{s.resolve=l,oo.refreshLabels();},_e.refreshTableInteractionLabels=()=>{oo.refreshLabels();},{ok:true,surface:_e}}var VI=e=>chunk6K6QQVAZ_cjs.Y(e);function nh(){let e=new WeakMap;return t=>{let n=e.get(t);if(n)return n;let r=chunk6K6QQVAZ_cjs.Od(t,VI);for(let o of t.pages){for(let a of [o.header,o.footer])a&&th(r,a.fragments,o.index,a.box.y);for(let a of [o.footnotes,o.endnotes])if(a)for(let i of a.notes)th(r,i.fragments,o.index,i.box.y);}return e.set(t,r),r}}function th(e,t,n,r){for(let o of chunk6K6QQVAZ_cjs.Z(t))for(let a of chunk6K6QQVAZ_cjs.xc(o))e.has(a)||e.set(a,{pageIndex:n,contentY:r,fragmentY:o.box.y,...o.lines?{lines:o.lines}:{}});}function rh(e){if(e==="")return;let t=globalThis.navigator?.clipboard;if(t?.writeText)try{t.writeText(e).catch(()=>{});}catch{}}function sd(e,t){if(e===""&&(t===null||t===""))return;let n=globalThis.navigator?.clipboard;if(!n)return;let r=globalThis.ClipboardItem;if(t&&n.write&&r&&typeof Blob<"u")try{let o=new r({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})});n.write([o]).catch(()=>{rh(e);});return}catch{}rh(e);}function UI(e){return typeof e=="object"&&e!==null&&"container"in e&&Array.isArray(e.path)}function WI(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function oh(e){return ah(e.children)}function ah(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||chunk35MI6K7M_cjs.xe(n))&&t.push(n);return t}function GI(e){if(chunk35MI6K7M_cjs.xe(e))return ah(chunk35MI6K7M_cjs.Ae(e));if(e.kind!=="table")return [];let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...oh(r));return t}function XI(e,t,n){let r=t.container,o=r.part==="body"?{kind:"body"}:r.part==="header"||r.part==="footer"?{kind:"headerFooter",rId:r.rId}:{kind:"notesPart",noteKind:r.part==="footnote"?"footnote":"endnote"},a=e.session.partFor(o);if(!a)return {ok:false,code:"notFound",reason:"the target story was not found"};let i="noteId"in r?r.noteId:null,s=r.part==="body"?chunk35MI6K7M_cjs.Ue(a):chunk35MI6K7M_cjs.Se(a).find(w=>r.part==="header"||r.part==="footer"?w.kind===r.part:w.kind==="note"&&chunk35MI6K7M_cjs.ud(w.root)===i)?.root;if(!s||s.kind==="textValue")return {ok:false,code:"notFound",reason:"the target story was not found"};if(t.path.length===0)return {ok:false,code:"invalidArgs",reason:"DocLocation path must not be empty"};let d=oh(s),c;for(let w=0;w<t.path.length;w+=1){let F=t.path[w];if(!Number.isInteger(F)||F<0)return {ok:false,code:"invalidArgs",reason:"DocLocation indices must be non-negative"};if(c=d[F],!c)return {ok:false,code:"notFound",reason:`block index ${F} is out of range`};w<t.path.length-1&&(d=GI(c));}if(!c||c.kind!=="paragraph"||!chunk35MI6K7M_cjs.ya(a,c.id))return {ok:false,code:"invalidArgs",reason:"DocLocation must resolve to a paragraph"};let p=(chunk35MI6K7M_cjs._f(a,c.id)??"").length,b=t.offset??(n==="start"?0:p);if(!Number.isInteger(b)||b<0||b>p)return {ok:false,code:"invalidArgs",reason:"DocLocation offset is outside the paragraph"};let x={paragraphId:c.id,offset:b};return {ok:true,selection:{anchor:x,head:x}}}function hi(e,t,n){if(UI(t))return XI(e,t,n);if(!st(t))return {ok:false,code:"invalidArgs",reason:"unrecognized DocTarget endpoint"};let r=e.session.paragraphAnchors(),o=r.nodeByParaId.get(t.paraId.toUpperCase());if(!o)return {ok:false,code:"notFound",reason:"the paragraph was not found"};let a=gt(e.session,o,{kind:"body"}),i=e.session.partFor(a);if(!i)return {ok:false,code:"notFound",reason:"the target story was not found"};let s=tn(i,r,t);if(!s.ok)return s;let d=n==="start"?s.span.start:s.span.end,c={paragraphId:s.span.nodeId,offset:d};return {ok:true,selection:{anchor:c,head:c}}}function yi(e,t){if(!WI(t)){let o=hi(e,t,"start");if(!o.ok)return o;let a=hi(e,t,"end");return a.ok?{ok:true,selection:{anchor:o.selection.anchor,head:a.selection.head}}:a}let n=hi(e,t.from,"start");if(!n.ok)return n;let r=hi(e,t.to,"end");return r.ok?{ok:true,selection:{anchor:n.selection.anchor,head:r.selection.head}}:r}function YI(e){return e.evenPage?"even":e.firstPage?"first":"default"}function ih(e){return e.variant!==void 0?e.variant==="default"||e.variant==="first"||e.variant==="even"?e.variant:{ok:false,reason:"variant must be 'default', 'first', or 'even'"}:YI(e)}function ld(e,t){let n=e.headerFooterState(),r=t.position??n?.editing??null;if(r!=="header"&&r!=="footer")return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"header/footer position is required when no furniture scope is open"}};let a=t.variant!==void 0||t.firstPage!==void 0||t.evenPage!==void 0?ih(t):n?.variant??"default";if(typeof a=="object"&&a.ok===false)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:a.reason}};let i=a,s=t.sectionIndex??n?.sectionIndex??0;return !Number.isInteger(s)||s<0?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"}}:{ok:true,sectionIndex:s,kind:r,variant:i}}function QI(e){let t=e??"rejected";return t==="first-section"||t.includes("first-section")?{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}:{ok:false,code:"invalidArgs",reason:`header/footer lifecycle refused: ${t}`}}function Uo(e,t){if(typeof e.applyHeaderFooterLifecycle!="function")return {ok:false,code:"unsupported",reason:"header/footer lifecycle is not available"};let n=e.applyHeaderFooterLifecycle(t);return n.ok?{ok:true,changed:true}:QI(n.reason)}function bi(e,t,n,r){let a=e.session.headerFooterResolutionBySection()[t];if(!a)return null;let s=(n==="header"?a.headers:a.footers).get(r);return s?{rId:s.rId,partName:s.partName,inherited:s.inherited,titlePage:a.titlePage,evenAndOddHeaders:a.evenAndOddHeaders}:null}function sh(e,t){if(typeof e.enterHeaderFooter!="function")return {ok:false,code:"unsupported",reason:"header/footer editing is not available"};let n=t.sectionIndex??0;if(!Number.isInteger(n)||n<0)return {ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"};let r=t.position,o=ih(t);if(typeof o=="object"&&o.ok===false)return {ok:false,code:"invalidArgs",reason:o.reason};let a=o,s=bi(e,n,r,a)?.rId,d=false;if(!s){let p=Uo(e,{op:"createHeaderFooter",sectionIndex:n,kind:r,variant:a,...a==="first"?{titlePage:true}:{},...a==="even"?{evenAndOddHeaders:true}:{}});if(!p.ok)return p;d=true,s=bi(e,n,r,a)?.rId;}return s?e.enterHeaderFooter({rId:s,kind:r,sectionIndex:n,variant:a})?{ok:true,changed:d}:{ok:false,code:"invalidArgs",reason:"the header/footer relationship could not be opened"}:{ok:false,code:"notFound",reason:`no ${r} story is available to edit`}}function lh(e,t){let n=ld(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=r?.rId,a=Uo(e,{op:"deleteHeaderFooter",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});return a.ok&&o&&r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant&&e.exitHeaderFooter(),a}function dh(e,t){let n=ld(e,t);if(!n.ok)return n.refusal;if(n.sectionIndex===0)return {ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"};let r=e.headerFooterState(),o=r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,a=Uo(e,{op:"linkToPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!a.ok)return a;if(o){let i=bi(e,n.sectionIndex,n.kind,n.variant);i?e.enterHeaderFooter({rId:i.rId,kind:n.kind,sectionIndex:n.sectionIndex}):e.exitHeaderFooter();}return a}function ch(e,t){let n=ld(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=!!r&&r.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,a=r?.rId,i=Uo(e,{op:"unlinkFromPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!i.ok)return i;let s=bi(e,n.sectionIndex,n.kind,n.variant);return o&&s&&s.rId!==a&&e.enterHeaderFooter({rId:s.rId,kind:n.kind,sectionIndex:n.sectionIndex}),i}function uh(e,t){let n=e.headerFooterState(),r=t.sectionIndex??n?.sectionIndex;return Uo(e,{op:"setSectionFurnitureOptions",...r!==void 0?{sectionIndex:r}:{},...t.titlePage!==void 0?{titlePage:t.titlePage}:{},...t.evenAndOddHeaders!==void 0?{evenAndOddHeaders:t.evenAndOddHeaders}:{},...t.headerDistanceTwips!==void 0?{headerDistanceTwips:t.headerDistanceTwips}:{},...t.footerDistanceTwips!==void 0?{footerDistanceTwips:t.footerDistanceTwips}:{}})}function fh(e,t){return e.activeScope().kind!=="headerFooter"?{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}:typeof e.insertPageField!="function"?{ok:false,code:"unsupported",reason:"page field insertion is not available"}:e.insertPageField(t.field)?{ok:true,changed:true}:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"page field insertion was refused"}}function ph(e,t){let n=e.activeScope();return n.kind==="headerFooter"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside a header or footer"}:n.kind==="note"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside another note"}:typeof e.insertNote!="function"?{ok:false,code:"unsupported",reason:"insertNote is not available"}:e.insertNote(t.noteKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"insertNote was refused"}}function gh(e,t){return typeof e.deleteNote!="function"?{ok:false,code:"unsupported",reason:"deleteNote is not available"}:e.deleteNote(t.noteKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"deleteNote was refused"}}function mh(e,t){return typeof e.convertNote!="function"?{ok:false,code:"unsupported",reason:"convertNote is not available"}:e.convertNote(t.fromKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertNote was refused"}}function hh(e,t){return typeof e.convertAllNotes!="function"?{ok:false,code:"unsupported",reason:"convertAllNotes is not available"}:e.convertAllNotes(t.fromKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertAllNotes was refused"}}function yh(e,t){if(typeof e.setNoteProperties!="function")return {ok:false,code:"unsupported",reason:"setNoteProperties is not available"};let n=t.scope??"document";return e.setNoteProperties({scope:n,sectionIndex:t.sectionIndex,footnote:t.footnote,endnote:t.endnote})?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"setNoteProperties was refused"}}function vh(e,t,n){switch(t.type){case "toggleMark":{let r=Qs.get(t.mark);e.toggleRunProperty(r.localName,r.attributes);break}case "setMarkAttr":{let r=Js(t);if(!r.ok)return {ok:false,code:r.code,reason:r.reason};e.setRunProperty(r.localName,r.attributes);break}case "clearFormatting":e.clearFormatting();break;case "setLineSpacing":e.setParagraphProperty("spacing",fi({rule:t.rule,value:t.value}),{mergeAttributes:true});break;case "setParagraphSpacing":e.setParagraphProperty("spacing",{...Zr("before",t.beforePt),...Zr("after",t.afterPt)},{mergeAttributes:true});break;case "setAlignment":e.setParagraphProperty("jc",{val:t.align==="justify"?"both":t.align});break;case "setParagraphStyle":{if(!e.session.documentStyles().some(o=>o.type==="paragraph"&&o.styleId===t.styleId))return {ok:false,code:"invalidArgs",reason:`style '${t.styleId}' is not a paragraph style of this document`};e.setParagraphProperty("pStyle",{val:t.styleId});break}case "setIndent":{e.setIndent({...t.left!==void 0?{left:t.left}:{},...t.right!==void 0?{right:t.right}:{},...t.firstLine!==void 0?{firstLine:t.firstLine}:{}});break}case "setParagraphFormat":{if(!e.setParagraphFormat({...t.alignment!==void 0?{alignment:t.alignment==="justify"?"both":t.alignment}:{},...t.spaceBeforePt!==void 0?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==void 0?{spaceAfterPt:t.spaceAfterPt}:{},...t.lineSpacing!==void 0?{lineSpacing:t.lineSpacing}:{},...t.indentLeftTwips!==void 0?{indentLeftTwips:t.indentLeftTwips}:{},...t.indentRightTwips!==void 0?{indentRightTwips:t.indentRightTwips}:{},...t.indentFirstLineTwips!==void 0?{indentFirstLineTwips:t.indentFirstLineTwips}:{},...t.contextualSpacing!==void 0?{contextualSpacing:t.contextualSpacing}:{},...t.keepNext!==void 0?{keepNext:t.keepNext}:{},...t.keepLines!==void 0?{keepLines:t.keepLines}:{},...t.widowControl!==void 0?{widowControl:t.widowControl}:{},...t.pageBreakBefore!==void 0?{pageBreakBefore:t.pageBreakBefore}:{},...t.tabStops!==void 0?{tabStops:t.tabStops}:{}}))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the paragraph format could not be written here"};break}case "setPageSetup":{let r;if(t.scope==="section"){let s=e.sectionAnchorParagraphAt(e.state().selection.head.paragraphId);if(s.kind==="unaddressable")return {ok:false,code:"unsupported",reason:"this section holds no paragraph to address it by"};r=s.kind==="anchor"?s.paragraphId:void 0;}let o=t.pageWidth,a=t.pageHeight;if(t.orientation!==void 0&&(o!==void 0||a!==void 0)){let s=r?e.sectionPropertiesAt(r):e.sectionProperties(),d=o??s.pageSize.widthTwips,c=a??s.pageSize.heightTwips;o=t.orientation==="landscape"?Math.max(d,c):Math.min(d,c),a=t.orientation==="landscape"?Math.min(d,c):Math.max(d,c);}if(!e.setSectionProperties({...o!==void 0?{pageWidthTwips:o}:{},...a!==void 0?{pageHeightTwips:a}:{},...t.orientation!==void 0?{orientation:t.orientation}:{},...t.marginTop!==void 0?{marginTopTwips:t.marginTop}:{},...t.marginRight!==void 0?{marginRightTwips:t.marginRight}:{},...t.marginBottom!==void 0?{marginBottomTwips:t.marginBottom}:{},...t.marginLeft!==void 0?{marginLeftTwips:t.marginLeft}:{},...r!==void 0?{anchorParagraphId:r}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the page setup change was refused"};break}case "toggleList":if(!e.toggleList(t.kind))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the list change was refused"};break;case "adjustIndent":if(!e.adjustIndent(t.direction))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the selection is already at that indent level"};break;case "insertBreak":if(t.kind==="section"||t.kind==="sectionContinuous"){let r=t.kind==="section"?"nextPage":"continuous";if(!e.insertSectionBreak(r))return {ok:false,code:"invalidArgs",reason:e.sectionBreakRefusal(r)??e.state().lastRejection??"the section break was refused"};break}if(t.kind==="page"){e.insertPageBreak();break}e.insertLineBreak();break;case "insertHyperlink":{let r=t.href.startsWith("#");if(!e.hyperlinks.applyHyperlink({...r?{anchor:t.href.slice(1)}:{url:t.href},...t.text!==void 0?{text:t.text}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the link was refused: the target is not an allowed scheme, or there is no text to link"};break}case "removeHyperlink":if(!e.hyperlinks.removeHyperlink())return {ok:false,code:"notFound",reason:"there is no hyperlink at the selection"};break;case "insertText":e.type(t.text);break;case "deleteText":e.deleteSelection();break;case "proposeInsertion":case "proposeDeletion":case "proposeReplacement":{if(t.target!==void 0){let a=yi(e,t.target);if(!a.ok)return {ok:false,code:a.code,reason:a.reason};e.setSelection(a.selection);}let r=t.type==="proposeInsertion"?"insertion":t.type==="proposeDeletion"?"deletion":"replacement",o=t.type==="proposeInsertion"?t.text:t.type==="proposeReplacement"?t.replaceWith:"";if(!e.proposeTextChange(r,o,t.author))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??`${t.type} was refused`};break}case "undo":e.undo();break;case "redo":e.redo();break;case "insertTable":if(!e.insertTable(t.rows,t.cols))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table could not be inserted here"};break;case "insertToc":if(!e.insertToc())return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be inserted"};break;case "refreshToc":if(!e.refreshToc(t.tocId,t.mode))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be refreshed"};break;case "editHeaderFooter":return sh(e,t);case "exitHeaderFooter":return typeof e.exitHeaderFooter=="function"&&e.exitHeaderFooter(),{ok:true,changed:false};case "removeHeaderFooter":return lh(e,t);case "linkHeaderFooterToPrevious":return dh(e,t);case "unlinkHeaderFooterFromPrevious":return ch(e,t);case "setHeaderFooterOptions":return uh(e,t);case "insertPageField":return fh(e,t);case "insertNote":return ph(e,t);case "deleteNote":return gh(e,t);case "convertNote":return mh(e,t);case "convertAllNotes":return hh(e,t);case "setNoteProperties":return yh(e,t);case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{if(!Cr(t))return {ok:false,code:"unsupported",reason:"unsupported command"};let r=n?.admittedTablePlan??Sn({command:t,part:e.session.part(),layout:e.layout(),storeRevision:e.session.packageRevision(),selection:e.state().selection,cellSelection:e.state().cellSelection,themeColors:e.session.documentThemeColors(),editable:e.session.editable,viewing:e.editingMode()==="view"});return e.applyTableCommandPlan(r)}case "selectAll":return e.selectAll(),{ok:true,changed:false};case "copy":{let r=e.copyFlavours();return sd(r.text,r.html),{ok:true,changed:false}}case "cut":{let r=e.copyFlavours();sd(r.text,r.html),e.deleteSelection();break}case "paste":if(!e.pasteRich(t.text,t.html??null))return {ok:true,changed:false};break;case "pasteWithoutFormatting":e.insertPlainText(t.text);break;case "setSelection":{if("range"in t&&el(t.range))return e.setSelection(t.range),e.revealPosition(t.range.head,{block:"centerIfNeeded"}),{ok:true,changed:false};let r="anchor"in t&&st(t.anchor)?{anchor:t.anchor}:"range"in t&&Qn(t.range)?{range:t.range}:null;if(r===null)return {ok:false,code:"unsupported",reason:"unsupported selection form"};let o=vf(e.session.part(),e.session.paragraphAnchors(),r);if(!o.ok)return o;let a=tS(e,o.selection);return a.ok?(e.setSelection(o.selection),e.revealPosition(o.selection.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):a}default:return Ao(t)?Wf(e,t,n?.editor):{ok:false,code:"unsupported",reason:"unsupported command"}}return null}function bh(e,t){for(let n of e.layout().pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let a of chunk6K6QQVAZ_cjs.Z(o.fragments))if(a.paragraphId===t)return o.scopeId}return null}function JI(e,t){let n=e.layout().pages;for(let r=0;r<n.length;r+=1){let o=n[r];for(let a of [o.header,o.footer])if(a){for(let i of chunk6K6QQVAZ_cjs.Z(a.fragments))if(i.paragraphId===t)return {pageIndex:r,sectionIndex:e.sectionAtPage(r).sectionIndex}}}return null}function eS(e,t){return e.kind!==t.kind?false:e.kind==="headerFooter"&&t.kind==="headerFooter"?e.rId===t.rId:e.kind==="notesPart"&&t.kind==="notesPart"?e.noteKind===t.noteKind:true}function tS(e,t){let n=gt(e.session,t.head.paragraphId,{kind:"body"}),r=gt(e.session,t.anchor.paragraphId,{kind:"body"});if(!eS(n,r))return {ok:false,code:"unsupported",reason:"a selection cannot span two stories"};let o=e.activeScope();if(n.kind==="body")return o.kind!=="body"&&(e.exitNote?.(),e.exitHeaderFooter?.()),{ok:true,changed:false};if(n.kind==="headerFooter"){if(o.kind==="headerFooter"&&o.rId===n.rId)return {ok:true,changed:false};e.exitNote?.();let d=JI(e,t.head.paragraphId);return e.enterHeaderFooter?.({rId:n.rId,...d?{pageIndex:d.pageIndex,sectionIndex:d.sectionIndex}:{}})?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that header or footer could not be opened"}}let a=bh(e,t.head.paragraphId);return a?(t.anchor.paragraphId===t.head.paragraphId?a:bh(e,t.anchor.paragraphId))!==a?{ok:false,code:"unsupported",reason:"a selection cannot span two stories"}:o.kind==="note"&&o.id===a?{ok:true,changed:false}:(e.exitHeaderFooter?.(),e.enterNote?.(a)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that note could not be opened"}):{ok:false,code:"notFound",reason:"that note is not laid out"}}function nS(e,t){let n=e.byteLength;if(n<22)return false;let r=new DataView(e.buffer,e.byteOffset,n),o=Math.max(0,n-(64*1024+22)),a=-1;for(let c=n-22;c>=o;c-=1)if(r.getUint32(c,true)===101010256){a=c;break}if(a<0)return false;let i=r.getUint16(a+10,true),s=r.getUint32(a+16,true),d=0;for(let c=0;c<i;c+=1){if(s+46>n||r.getUint32(s,true)!==33639248)return false;if(d+=r.getUint32(s+24,true),d>=t)return true;s+=46+r.getUint16(s+28,true)+r.getUint16(s+30,true)+r.getUint16(s+32,true);}return false}function xh(e){let t=null,n=()=>{if(!t)return null;let{bytes:r}=t;return t.cancel(),t=null,r};return {shouldYield:r=>typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"&&(r.byteLength>=524288||nS(r,524288)),schedule(r){let o=null,a=null,i=()=>{t=null,e.mount(r);},s=requestAnimationFrame(()=>{a!==null&&clearTimeout(a),a=null,o=setTimeout(i,0);});a=setTimeout(()=>{cancelAnimationFrame(s),i();},250),t={bytes:r,cancel:()=>{cancelAnimationFrame(s),o!==null&&clearTimeout(o),a!==null&&clearTimeout(a);}},e.scheduled();},cancel:n,flush(){let r=n();r&&e.mount(r);},isScheduled:()=>t!==null}}function Ih(e){return t=>{for(let n of e.customNodeDiagnostics)try{n(t);}catch{}}}function Sh(e,t){t.customNodePayloadNamespaces.length!==0&&e.session.sweepCustomNodePayloads(t.customNodePayloadNamespaces);}function kh(e){return e.kind==="comment"}function rS(e){let t=new Map;for(let n of e){let r=n.item;if(!kh(r))continue;let o=t.get(r.id);if(o===void 0){t.set(r.id,r);continue}if(o.comment!==r.comment)return "ambiguous"}return t}function oS(e,t){let n=e.filter(a=>a.key===t);if(n.length===0)return {ok:false,code:"notFound",reason:"no review item with that key"};let r=n.map(a=>a.item).filter(kh);if(r.length===0)return {ok:false,code:"kindMismatch",reason:"the review item is not a comment"};let o=r[0];for(let a of r)if(a.comment!==o.comment)return {ok:false,code:"ambiguous",reason:"duplicate comment records share that key"};return o}function wh(e,t,n){if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:e.proReviewReason};if(e.editingMode==="viewing")return {ok:false,code:"locked",reason:"the document is open for viewing"};let r=e.placements(),o=oS(r,t);if(!("kind"in o))return o;if(!e.surface)return {ok:false,code:"notFound",reason:"no review item with that key"};let a=rS(r);if(a==="ambiguous")return {ok:false,code:"ambiguous",reason:"duplicate comment records share an id"};let i=o,s=new Set;for(;i.parentId!==void 0&&!s.has(i.id);){s.add(i.id);let p=a.get(i.parentId);if(!p)break;i=p;}let d=false,c=false;return e.surface.commitReviewOps(()=>{let p=e.surface.session.packageRevision();return d=e.surface.session.setCommentResolved(i.id,n),c=d&&e.surface.session.packageRevision()!==p,{committed:c}}),d?(c&&e.bump(),{ok:true,changed:c}):{ok:false,code:"notFound",reason:"the comment could not be resolved"}}function Th(e,t,n){return e.kind==="comment"&&e.resolved?{ok:false,code:"unsupported",reason:"a resolved comment takes no replies"}:n.length===0||t.trim().length===0?{ok:false,code:"invalidArgs",reason:"a reply needs both an author and text"}:e.kind==="custom"?{ok:false,code:"unsupported",reason:"a custom node card takes no replies"}:null}var Ph=new WeakMap;function lS(e){return !(!e.story||e.origin===chunk35MI6K7M_cjs.b.mutationUndo||e.origin===chunk35MI6K7M_cjs.b.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.some(t=>t!==chunk35MI6K7M_cjs.g.story))}function dS(e,t){lS(t)||(e.summaries=null);}function cS(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>dS(t,n)));}function Rh(e){}function Eh(e,t){let n=Ph.get(e);return n||(n={summaries:null,subscribed:false},Ph.set(e,n)),cS(e,n),n.summaries||(n.summaries=t()),n.summaries}var uS=new Map([["richText","richText"],["plainText","plainText"],["dropdown","dropDownList"],["dropDownList","dropDownList"],["comboBox","comboBox"],["date","date"]]);function fS(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function pS(e,t){let n=e.session.part(),r=e.session.paragraphAnchors();if(st(t)){let o=tn(n,r,t);return o.ok?{ok:true,span:{paragraphId:o.span.nodeId,start:o.span.start,end:o.span.end}}:{ok:false,code:o.code,reason:o.reason,target:t}}if(fS(t)){if(!st(t.from)||!st(t.to))return {ok:false,code:"unsupported",reason:"address the span with paraId anchors; DocLocation endpoints are not supported",target:t};let o=tn(n,r,t.from);if(!o.ok)return {ok:false,code:o.code,reason:o.reason,target:t};let a=tn(n,r,t.to);if(!a.ok)return {ok:false,code:a.code,reason:a.reason,target:t};if(o.span.nodeId!==a.span.nodeId)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported",target:t};let i=Math.min(o.span.start,a.span.start),s=Math.max(o.span.end,a.span.end);return {ok:true,span:{paragraphId:o.span.nodeId,start:i,end:s}}}return {ok:false,code:"unsupported",reason:"address the span with a paraId anchor; DocLocation targeting is not supported",target:t}}function dd(e,t){let n=uS.get(t.subtype);if(!n)return {ok:false,code:"invalidArgs",reason:`that control type cannot be inserted (${String(t.subtype)})`,...t.target===void 0?{}:{target:t.target}};let r;if(t.target===void 0){let o=er(e.state().selection);if(!o)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported"};r=o;}else {let o=pS(e,t.target);if(!o.ok)return o;r=o.span;}return {ok:true,span:r,op:{op:"insertContentControl",paragraphId:r.paragraphId,start:r.start,end:r.end,type:n,...t.tag===void 0?{}:{tag:t.tag},...t.title===void 0?{}:{alias:t.title}}}}var gS="http://schemas.microsoft.com/office/word/2010/wordml",mS="http://schemas.microsoft.com/office/word/2012/wordml",hS=32;function Hn(e){return chunk35MI6K7M_cjs.Lb(e)}function yS(e){return e.kind==="textValue"?[]:e.children}function vi(e){if(e.kind==="textValue")return e.value.length;if(e.kind==="tab"||e.kind==="hardBreak")return 1;if(e.kind==="runProperties"||e.kind==="generic")return 0;if(Hn(e)){let n=0;for(let r of chunk35MI6K7M_cjs.Ae(e))n+=vi(r);return n}let t=0;for(let n of yS(e))t+=vi(n);return t}function Wo(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlProperties"||t.localName==="sdtPr"))return t}function bS(e){if(e.kind!=="textValue"){for(let t of e.attributes)if(t.localName==="val"&&t.namespaceUri===chunk35MI6K7M_cjs.da)return t.value}}function cd(e,t){if(e){for(let n of e.children)if(n.kind!=="textValue"&&n.localName===t)return bS(n)}}function vS(e){if(!e)return "richText";for(let t of e.children){if(t.kind==="textValue")continue;let n=xS(t);if(n!==void 0)return n}return "richText"}function xS(e){if(e.kind==="textValue")return;let t=e.kind,n=e.localName,r=e.namespaceUri;if(t==="contentControlDropDownList"||n==="dropDownList")return "dropdown";if(t==="contentControlComboBox"||n==="comboBox")return "comboBox";if(t==="contentControlDate"||n==="date")return "date";if(n==="picture")return "picture";if(t==="contentControlText"||n==="text")return "plainText";if(n==="richText")return "richText";if(n==="checkbox"&&(r===gS||t==="contentControlCheckbox"))return "checkbox";if(n==="repeatingSection"&&r===mS)return "repeatingSection"}function xi(e){let t=cd(e,"lock");return t==="contentLocked"||t==="sdtContentLocked"}function IS(e,t){if(xi(Wo(t)))return true;let n=chunk35MI6K7M_cjs.za(e,t.id);for(;n;){if(Hn(n)&&xi(Wo(n)))return true;n=chunk35MI6K7M_cjs.za(e,n.id);}return false}function fd(e,t){let n=Wo(e),r=cd(n,"tag"),o=cd(n,"alias"),a=t?IS(t,e):xi(n);return {id:e.id,controlType:vS(n),...r!==void 0?{tag:r}:{},...o!==void 0?{alias:o}:{},...a?{locked:true}:{}}}var Oh=new WeakMap;function SS(e,t){let n=[],r=chunk35MI6K7M_cjs.za(e,t.id);for(;r;)Hn(r)&&n.push(`${r.id}:${xi(Wo(r))?1:0}`),r=chunk35MI6K7M_cjs.za(e,r.id);return n.join("|")}function Ah(e){return Object.freeze({...e,...e.tag!==void 0?{tag:e.tag}:{},...e.alias!==void 0?{alias:e.alias}:{},...e.locked?{locked:true}:{}})}function kS(e){return Object.freeze(e.map(t=>Ah(t)))}function wS(e,t){let n=e.node,r=Wo(n),o=SS(t,n),a=Oh.get(n);if(a&&a.properties===r&&a.lockAncestors===o)return a.summary;let i=Ah(fd(n,t));return Oh.set(n,{properties:r,lockAncestors:o,summary:i}),i}function TS(e){let t=chunk35MI6K7M_cjs.Ie(e.root);return Rh(t.length),t.map(n=>wS(n,e))}function PS(e){return kS(e.storyParts().flatMap(t=>TS(t)))}function CS(e){return Eh(e,()=>PS(e))}function ud(e,t){return t?!(t.tag!==void 0&&e.tag!==t.tag||t.alias!==void 0&&e.alias!==t.alias||t.controlType!==void 0&&e.controlType!==t.controlType):true}function RS(e){let t=[],n=(r,o,a,i)=>{let s=o;for(let d of r)if(d.kind!=="paragraphProperties"){if(d.kind==="run"){s+=vi(d);continue}if(d.kind==="hyperlink"){s=n(d.children,s,a,i);continue}if(Hn(d)&&i<hS){let c=s,p=a+1;s=n(chunk35MI6K7M_cjs.Ae(d),s,p,i+1),t.push({control:d,start:c,end:s,depth:p});continue}s+=vi(d);}return s};return n(e.children,0,-1,0),t}function pd(e,t,n){return RS(e).filter(r=>t>=r.start&&t<r.end).sort((r,o)=>o.depth-r.depth).map(r=>fd(r.control,n))}function gd(e,t){let n=[],r=chunk35MI6K7M_cjs.za(e,t);for(;r;)Hn(r)&&n.push(fd(r,e)),r=chunk35MI6K7M_cjs.za(e,r.id);return n.reverse()}function Mh(e,t){if(!e)return [];let n=CS(e.session);return t?n.filter(r=>ud(r,t)):n}function md(e,t){if(!e)return null;let{paragraphId:n,offset:r}=e.state().selection.head,o=en(e.session,n)??e.session.part(),a=chunk35MI6K7M_cjs.ya(o,n);if(a&&a.kind==="paragraph"){for(let s of pd(a,r,o))if(ud(s,t))return s}let i=gd(o,n);for(let s=i.length-1;s>=0;s-=1){let d=i[s];if(ud(d,t))return d}return null}function hd(e){return e.type==="insertContentControl"||e.type==="setContentControlValue"||e.type==="removeContentControl"}function ES(e){return typeof e=="object"&&e!==null&&"container"in e&&"path"in e}function OS(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function FS(e){let t=n=>{if(n.kind==="textValue")return null;if(n.kind==="body")return n;for(let r of n.children){let o=t(r);if(o)return o}return null};return t(e.root)}function Ii(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||Hn(n))&&t.push(n);return t}function AS(e){let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...Ii(r.children));return t}function MS(e){return e.kind==="table"?AS(e):Hn(e)?Ii(chunk35MI6K7M_cjs.Ae(e)):e.kind==="body"?Ii(e.children):[]}function LS(e,t,n){if(Hn(t))return {ok:true,controlId:t.id};if(t.kind==="paragraph"){let r=n??0;for(let i of pd(t,r,e))return {ok:true,controlId:i.id};let a=gd(e,t.id).at(-1);if(a)return {ok:true,controlId:a.id}}return {ok:false,code:"notFound",reason:"no content control at the addressed block"}}function NS(e,t){if(t.container.part!=="body")return {ok:false,code:"unsupported",reason:"only the body container is supported",target:t};let n=FS(e);if(!n)return {ok:false,code:"notFound",reason:"the document body was not found",target:t};if(t.path.length===0)return {ok:false,code:"notFound",reason:"DocLocation path is empty",target:t};let r=Ii(n.children),o=null;for(let i=0;i<t.path.length;i+=1){if(o=r[t.path[i]]??null,!o)return {ok:false,code:"notFound",reason:`block index ${t.path[i]} is out of range`,target:t};i<t.path.length-1&&(r=MS(o));}if(!o)return {ok:false,code:"notFound",reason:"the addressed block was not found",target:t};let a=LS(e,o,t.offset);return a.ok?a:{...a,target:t}}function DS(e,t,n){let r=tn(e,t,n);if(!r.ok)return {ok:false,code:r.code,reason:r.reason,target:n};let o=t.partByNode.get(r.span.nodeId)??e,a=chunk35MI6K7M_cjs.ya(o,r.span.nodeId);if(!a||a.kind!=="paragraph")return {ok:false,code:"notFound",reason:`paragraph '${n.paraId}' was not found`,target:n};let i=r.span.start;for(let c of pd(a,i,o))return {ok:true,controlId:c.id};let d=gd(o,a.id).at(-1);return d?{ok:true,controlId:d.id}:{ok:false,code:"notFound",reason:`no content control encloses paragraph '${n.paraId}'`,target:n}}function Lh(e,t){if(t===void 0){let r=md(e);return r?{ok:true,controlId:r.id}:{ok:false,code:"notFound",reason:"no content control at the current selection"}}if(OS(t))return {ok:false,code:"unsupported",reason:"DocRange targeting is not supported for content controls",target:t};let n=e.session.part();return ES(t)?NS(n,t):st(t)?DS(n,e.session.paragraphAnchors(),t):{ok:false,code:"invalidArgs",reason:"unrecognized target shape",target:t}}function Nh(e){switch(e){case "locked":case "bound":case "typeMismatch":case "invalidArgs":case "unsupported":return e;case "unknown-control":return "notFound";case "indivisible-content":return "unsupported";default:return "unsupported"}}function Dh(e){switch(e){case "locked":return "the content control is locked";case "bound":return "the content control is bound to external data";case "typeMismatch":return "the value does not match the control type";case "invalidArgs":return "the value is not valid for this control";case "unsupported":return "this control type is not supported";case "unknown-control":return "the content control was not found";case "indivisible-content":return "a content control cannot start or end inside a hyperlink, a field, or another inline control";default:return `the edit was refused (${e})`}}function Hh(e,t){return {ok:false,code:Nh(e),reason:Dh(e),...t!==void 0?{target:t}:{}}}function HS(e,t,n,r){return r?.scope&&r.scope.kind!=="body"&&e.target!==void 0?{ok:false,refusal:{ok:false,code:"unsupported",reason:"a location or anchor target resolves in the body only; omit it to use the caret"}}:t?n==="view"||!t.session.editable?{ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}}:e.type==="setContentControlValue"&&typeof e.value!="string"?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"setContentControlValue requires a string value"}}:{ok:true}:{ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}}}function yd(e){return e==="viewing"?"view":e==="suggesting"?"suggesting":"edit"}function bd(e,t,n,r){let o=HS(e,t,n,r);if(!o.ok)return o.refusal;if(e.type==="insertContentControl"){let s=dd(t,e);return s.ok?Fh(t,s.op,s.span.paragraphId):{ok:false,code:s.code,reason:s.reason}}let a=Lh(t,e.target);if(!a.ok)return {ok:false,code:a.code,reason:a.reason};let i=e.type==="setContentControlValue"?{op:"setContentControlValue",controlId:a.controlId,value:e.value}:{op:"removeContentControl",controlId:a.controlId};return Fh(t,i,a.controlId)}function Fh(e,t,n){let r=chunk35MI6K7M_cjs.$f(en(e.session,n)??e.session.part(),t);return r?{ok:false,code:Nh(r),reason:Dh(r)}:{ok:true}}function _h(e,t,n,r){t?.flushPendingInput();let o=bd(e,t,n,r);return o.ok?_S(t,e):o}function _S(e,t){if(t.type==="insertContentControl")return BS(e,t);let n=Lh(e,t.target);if(!n.ok){let i=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...i!==void 0?{target:i}:{}}}e.flushPendingInput();let r=er(e.state().selection),o=t.type==="setContentControlValue"?{op:"setContentControlValue",controlId:n.controlId,value:t.value}:{op:"removeContentControl",controlId:n.controlId},a=e.session.applyTreeOps([o],r,r,gt(e.session,n.controlId,{kind:"body"}));return a.rejected?Hh(a.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:a.committed})}function BS(e,t){e.flushPendingInput();let n=dd(e,t);if(!n.ok){let c=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...c!==void 0?{target:c}:{}}}let{paragraphId:r,start:o,end:a}=n.span,i=er(e.state().selection),s={paragraphId:r,start:o,end:a},d=e.session.applyTreeOps([n.op],i,s,gt(e.session,r,{kind:"body"}));return d.rejected?Hh(d.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:d.committed})}var Bh=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Si(e){let t=e?.defaultFont?.family;return t!==void 0&&Bh.test(t)?t:Za.family}function qh(e,t){let n=new Map,r=s=>{if(s===void 0||!Bh.test(s))return;let d=s.toLowerCase();n.has(d)||n.set(d,s);};r(Si(e));let o=e?.substitutions??[],a=new Set(o.map(s=>s.to.family.toLowerCase()));for(let s of o)r(s.from.family);for(let s of e?.sources??[])a.has(s.request.family.toLowerCase())||r(s.request.family);for(let s of t)r(s);let i=[...n.values()];return i.sort((s,d)=>s<d?-1:s>d?1:0),i}var qS={regular:{weight:400,style:"normal"},bold:{weight:700,style:"normal"},italic:{weight:400,style:"italic"},boldItalic:{weight:700,style:"italic"}};function Zh(e,t){let n=[],r=[],o=t.aggregateBudget,a=new Set;for(let i of e){let s=qS[i.style],d=Object.freeze({family:i.family,weight:s.weight,style:s.style});if(i.family.trim().length===0){r.push({request:d,partName:i.partName,reason:"malformed"});continue}let c=chunk6K6QQVAZ_cjs.e(d);if(!(t.shadowedRequests?.has(c)||a.has(c))){if(a.add(c),i.bytes.byteLength>t.maxFontBytes||i.bytes.byteLength>o){r.push({request:d,partName:i.partName,reason:"overLimit"});continue}o-=i.bytes.byteLength,n.push({request:d,id:`embedded:${i.partName}#${i.style}`,bytes:i.bytes,hash:chunk35MI6K7M_cjs.a(i.bytes),faceIndex:0});}}return {sources:n,dropped:r}}var ZS="The quick brown fox 0123 \u2014 {}#@",zS=["monospace","serif"],$S=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function zh(e){if(!e)return ()=>true;let t=new Map,n=r=>(e.font=r,e.measureText(ZS).width);return r=>{let o=t.get(r);if(o!==void 0)return o;if(!$S.test(r))return t.set(r,true),true;let a=false;for(let i of zS){let s=n(`32px ${i}`);if(n(`32px "${r}", ${i}`)!==s){a=true;break}}return t.set(r,a),a}}function $h(e,t,n){let r=[];for(let o of e){if(t(o)||n(o))continue;let a=chunk6K6QQVAZ_cjs.Id.get(o.toLowerCase());a!==void 0&&n(a)||r.push(o);}return r}var jh=Object.freeze({installed:0,alias:()=>{},dispose(){}});function jS(e){let t=0;for(let n of e)for(let r=0;r<n.length;r+=1)t=t*31+n.charCodeAt(r)>>>0;return `docx-embedded-${t.toString(36)}`}function KS(){let t=(typeof document<"u"?document:void 0)?.fonts;return !t||typeof FontFace>"u"?{}:{fontSet:t,createFontFace:(n,r,o)=>new FontFace(n,r.slice().buffer,o)}}async function Kh(e,t=KS(),n=[]){let{fontSet:r,createFontFace:o}=t;if(!r||!o||e.length===0)return jh;let a=new Map;for(let c of e){let p=c.request.family,b=a.get(p);b?b.push(c):a.set(p,[c]);}let i=new Map,s=[];if(await Promise.all([...a].map(async([c,p])=>{let b=jS(p.map(w=>w.hash)),x=false;await Promise.all(p.map(async w=>{try{let F=o(b,w.bytes,{weight:String(w.request.weight),style:w.request.style});await F.load(),r.add(F),s.push(F),x=!0;}catch{}})),x&&i.set(c,b);})),s.length===0)return jh;for(let c of n){if(i.has(c.from.family))continue;let p=i.get(c.to.family);p!==void 0&&i.set(c.from.family,p);}let d=false;return {installed:s.length,alias:c=>d?void 0:i.get(c),dispose(){if(!d){d=true;for(let c of s)try{r.delete(c);}catch{}}}}}var Go=.1,Xo=5;var zr={type:"fit",fit:"pageWidth",minZoom:.5,maxZoom:1},VS={type:"fit",fit:"pageWidth"},ki={type:"fixed"};function wi(e){return e==="auto"?zr:!e||typeof e!="object"?null:e.type==="fixed"?ki:e.type==="fit"&&e.fit==="pageWidth"?Ti(e,zr)?zr:e:null}function Ti(e,t){return e===t?true:e.type!==t.type?false:e.type!=="fit"||t.type!=="fit"?true:e.fit===t.fit&&Object.is(e.minZoom,t.minZoom)&&Object.is(e.maxZoom,t.maxZoom)}function $r(e){return e.type==="fit"}function Uh({availableWidthPx:e,pageWidthPx:t,gutterPx:n=24,minZoom:r=.1,maxZoom:o=5}){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0)return null;let a=Number.isFinite(n)&&n>0?n:0,i=Math.max(e-2*a,e*.5),s=Number.isFinite(r)?Vh(r):.1,d=Number.isFinite(o)?Vh(o):5,c=Math.floor(i/t*100)/100;return Math.min(Math.max(c,s),Math.max(d,s))}function Vh(e){return Math.min(Math.max(e,.1),5)}function US(e){let t=Rt(e);if(!t)return null;let n=t.clientWidth;if(!Number.isFinite(n)||n<=0)return null;let r=t.ownerDocument.defaultView?.getComputedStyle(t);if(!r)return n;let o=Number.parseFloat(r.paddingLeft)||0,a=Number.parseFloat(r.paddingRight)||0;return Math.max(n-o-a,0)}function Wh(e){let t=null,n=null,r=null,o=null;function a(){if(r===null)return;n?.ownerDocument.defaultView?.cancelAnimationFrame(r),r=null;}function i(){let d=e.mode();if(!$r(d))return;let c=e.container();if(!c)return;let p=US(c);if(p===null)return;let b=e.pageWidthPx();if(b===null)return;o=e.pageWidthTwips();let x=Uh({availableWidthPx:p,pageWidthPx:b,...d.minZoom!==void 0?{minZoom:d.minZoom}:{},...d.maxZoom!==void 0?{maxZoom:d.maxZoom}:{}});x===null||x===e.zoom()||e.applyZoom(x);}function s(){let d=n?.ownerDocument.defaultView;if(!d?.requestAnimationFrame){i();return}r===null&&(r=d.requestAnimationFrame(()=>{r=null,i();}));}return {refitIfPageResized(){let d=e.pageWidthTwips();d===null||d===o||i();},attach(){this.detach();let d=e.container();if(!d)return;let c=Rt(d);c&&(n=c,typeof ResizeObserver<"u"&&(t=new ResizeObserver(s),t.observe(c)),i());},refit:i,detach(){a(),t?.disconnect(),t=null,n=null,o=null;}}}function Xh(e,t){let n=e.zoom!==void 0&&Number.isFinite(e.zoom)&&e.zoom>=.1&&e.zoom<=5?e.zoom:null,r=n??1,o=wi(e.zoomMode??(n!==null?ki:"auto"))??zr;function a(d,c){if(d===r)return c?.(),true;let p=t.surface();return p&&!eh(p,d*(96/72))?false:(r=d,c?.(),t.bump(),t.emitSelectionChange(),true)}function i(){o=ki,s.detach();}let s=Wh({container:t.container,mode:()=>o,pageWidthPx:()=>{let d=t.surface()?.layout().pages[0]?.box;return d?d.width*(96/72):null},pageWidthTwips:()=>t.surface()?.sectionProperties().pageSize.widthTwips??null,zoom:()=>r,applyZoom:d=>{a(d);}});return {zoom:()=>r,mode:()=>o,scale:()=>r*(96/72),attach:()=>{$r(o)&&s.attach();},detach:()=>s.detach(),refit:()=>s.refit(),refitIfPageResized:()=>s.refitIfPageResized(),setZoom(d){if(!Number.isFinite(d)||d<.1||d>5)return {ok:false,code:"invalidArgs",reason:`zoom must be between ${.1} and ${5}, got ${d}`};let c=$r(o);return d===r?c?(i(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:true,changed:false}:a(d,c?i:void 0)?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:`the mounted surface could not apply zoom ${d}`}},setZoomMode(d){let c=wi(d);return c?Ti(c,o)?{ok:true,changed:false}:(o=c,$r(c)?s.attach():s.detach(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:false,code:"invalidArgs",reason:`unknown zoom mode ${JSON.stringify(d)}`}}}}function Gh(e){let t=1.3333333333333333;return {x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t}}function Yh(e,t){return {getZoom:()=>e.zoom(),setZoom:n=>e.setZoom(n),getZoomMode:()=>e.mode(),setZoomMode:n=>e.setZoomMode(n),getRenderScale:()=>e.scale(),getPageGeometry:()=>{let n=t();return n?n.layout().pages.map(r=>({index:r.index,box:Gh(r.box),contentBox:Gh(r.contentBox)})):[]}}}var nn="comments and tracked changes require the pro review module (@docx-editor.dev/pro)",Pi={mode:null,rejection:null};function Qh(e,t){return e===void 0||e==="view"?Pi:e==="edit"?{mode:"editing",rejection:null}:t.reviewEnabled?t.hasAuthor?{mode:"suggesting",rejection:null}:{mode:null,rejection:"suggesting mode was requested, but no author is configured"}:{mode:null,rejection:nn}}function Jh(e){return e.viewOnly||e.currentMode!=="editing"||e.readerChoseMode||!(e.trackRevisions&&!e.hostChoseMode)&&!e.restrictedToTrackedChanges||!e.reviewEnabled?Pi:e.hasAuthor?{mode:"suggesting",rejection:null}:{mode:null,rejection:"this document asks for tracked changes, but no author is configured"}}var ey=new Map;function ty(e){let t=e,n=null,r=null;return {current:()=>t,set:o=>{t=o;},authorsFor:o=>{if(n&&n.slots===o&&n.colors===t)return n.value;let a=chunk4XL7SOWQ_cjs.b(o,t);return n={slots:o,colors:t,value:a},a},styleFor:o=>((!r||r.colors!==t)&&(r={colors:t,value:chunk4XL7SOWQ_cjs.a(t)}),r.value.get(o))}}function vd(e){let t=[];return {current:()=>t[t.length-1]??e,push:n=>(t.push(n),()=>{let r=t.lastIndexOf(n);r>=0&&t.splice(r,1);})}}var YS=Object.freeze({kind:"body"}),ry=Object.freeze([]);function QS(e){let t=e.locale&&e.locale in i18n.locales?e.locale:"en",r={title:i18n.createT(i18n.deepMerge(i18n.en,t==="en"?void 0:i18n.locales[t]),t)("toolbar.tableOfContents")},o=e.container??null,a=chunk7VQ7YLW3_cjs.a(e.modules),i=Ih(a),s=a.review!==null,d=null,c=xh({mount:m=>ct(m),scheduled:()=>{ie(),De();}}),p=e.mode==="view"?"viewing":"editing",b=null,x=ty(e.revisionStyles),w=chunk4XL7SOWQ_cjs.d(),F=false,T=null,P=e.mode??"edit",B=Qh(e.mode,{reviewEnabled:s,hasAuthor:!!e.author});B.mode!==null&&(p=B.mode),B.rejection!==null&&(T=B.rejection);let h=null,N=null,A=null,$=null,j="none",M={kind:"none"},G=null,S=null,E=vd({}),Z=vd({}),k=false,O,U,K=null;function X(){K?.dispose(),K=null;}let ce=0,we,me=()=>typeof e.fonts=="function"?we:e.fonts,he=-1,fe=false,Ge=null,qt=m=>(Ge||(Ge=zh(o?Mr(o.ownerDocument):null)),Ge(m)),Fe=null,mt=()=>{let m=me();return (Fe===null||Fe.configuration!==m)&&(Fe={configuration:m,families:new Set([...(m?.sources??[]).map(C=>C.request.family),...(m?.substitutions??[]).map(C=>C.from.family)].filter(C=>typeof C=="string"&&C.trim().length>0).map(C=>C.toLowerCase()))}),Fe.families},H=m=>mt().has(m.toLowerCase())||K?.alias(m)!==void 0,ae=()=>!h||fe||!h.session.rendersText()?ry:$h(h.session.documentFonts(),H,qt),v=0,R=null,D=null,W=-1,ne=0,V=-1,re=false;function ie(){v+=1;}let pe={change:new Set,selectionChange:new Set,error:new Set};function Me(m){for(let C of [...pe.error])C(m);}function dt(m){for(let C of [...pe.change])C(m);}function De(){if(pe.selectionChange.size===0)return;let m=on();for(let C of [...pe.selectionChange])C(m);}function Xe(){A?.(),A=null,h?.destroy(),h=null,$=null,j="none",G=null,S=null,ne+=1;}let Ce=Xh(e,{container:()=>o,surface:()=>h,bump:ie,emitSelectionChange:De}),Zt=()=>Ce.scale();function ct(m){if(!o){d=m,N=null,ie();return}Xe();let C=id(o,m,{scale:Zt(),defaultFontFamily:Si(me()),...e.translate?{drawingStrings:chunk4XL7SOWQ_cjs.g(e.translate)}:{},...e.author?{author:e.author}:{},...x.current()!==void 0?{revisionStyles:x.current()}:{},reviewAuthorSlots:w,initialDrawingSelectionIntent:M,editingMode:p==="suggesting"?"suggest":p==="viewing"?"view":"edit",...s?{}:{revisionDisplayMode:"proposed"},...a.review?{reviewModel:{...a.review,collectReviewItems:z=>a.review.collectReviewItems(a.customNodes.length>0?{...z,customNodes:a.customNodes,...a.customNodeDiagnostics.length>0?{reportCustomNodeDiagnostic:i}:{}}:z)}}:{},...O?{measurer:O,...U?{producer:U}:{}}:{},...K?{fontAlias:K.alias}:{},...e.tableInteractionLabel?{tableInteractionLabel:e.tableInteractionLabel}:{},...e.imageDecodePort?{imageDecodePort:e.imageDecodePort}:{},onHyperlinkPopover:z=>E.current().onPopover?.(z),onRequestHyperlink:()=>E.current().onRequest?.(),onEquationPopover:z=>Z.current().onPopover?.(z),onTrackedChange:()=>{re||(re=true,ie(),De());},tocLabels:r,onChange:z=>{if(!h)return;ie();let le=z.pendingFormat!==G;G=z.pendingFormat;let te=h.headerFooterState?.(),oe=te?.editing&&te.rId?`${te.editing}:${te.rId}`:null,Pe=oe!==S;S=oe;let Re=sl(h.drawingSelectionIntent()),Q=Re!==j;j=Re,!(tl(z.selection,$)&&!le&&!Pe&&!Q)&&($=z.selection,De());}});if(!C.ok){N=C.detail?`${C.reason}: ${C.detail}`:C.reason,ie(),Me(Rr(C.reason,`failed to open document: ${N}`));return}N=null,h=C.surface,re=s&&h.session.reviewItems().length>0,Oi(),Sh(h,a),ne+=1,h.setEditable(p!=="viewing"),b!==null&&h.setReviewActivationExclusions(b),$=h.state().selection,j=sl(h.drawingSelectionIntent()),A=C.surface.session.subscribe(z=>{let le={revision:C.surface.session.packageRevision(),created:z.created,deleted:z.deleted,dirty:z.dirty};Ce.refitIfPageResized(),ie(),dt(le);}),Ce.attach(),ie(),dt({revision:h.session.packageRevision()}),De(),he!==ce&&(he=ce,Te(ce,h));}function rn(m){if(c.cancel(),re=false,ce+=1,w=chunk4XL7SOWQ_cjs.d(),O=void 0,U=void 0,we=void 0,X(),fe=false,o){let C=Rt(o);C&&(C.scrollTop=0,C.scrollLeft=0);}o&&c.shouldYield(m)?c.schedule(m):ct(m);}function ye(m){(m.code==="wasmUnavailable"||m.cause instanceof chunk6K6QQVAZ_cjs.r&&m.cause.code==="unsupportedRuntime")&&!e.onFontError&&pe.error.size===0&&nf(m);try{e.onFontError?.(m);}catch{}Me(m);}async function Te(m,C){let z=e.fonts,le=C.session.embeddedFonts();if(!(!z&&le.length===0)){fe=true,ie();try{let te=typeof z=="function"?await z({families:C.session.documentFonts().slice(0,Fs),defaultFamily:Si(me())}):z;if(k||m!==ce){m===ce&&(fe=!1);return}if(we=te,!te&&le.length===0){fe=!1,ie();return}let oe=(te&&"maxFontBytes"in te?te.maxFontBytes:void 0)??chunk6K6QQVAZ_cjs.a,Pe=(te?.sources??[]).reduce((xe,je)=>xe+je.bytes.byteLength,0),Re=new Set((te?.sources??[]).filter(xe=>xe.request.family.trim().length>0).map(xe=>chunk6K6QQVAZ_cjs.e(xe.request))),Q=Zh(le,{maxFontBytes:oe,aggregateBudget:Math.max(0,chunk6K6QQVAZ_cjs.c-Pe),shadowedRequests:Re});for(let xe of Q.dropped)ye(new chunkYMYCPY5Y_cjs.a(xe.reason,xe.reason==="overLimit"?`embedded font ${xe.request.family} (${xe.partName}) exceeds the font byte budget`:`embedded font part ${xe.partName} declares an invalid family name`,{request:xe.request}));let ve=za({epoch:m,...te},Q);if(ve.sources.length===0){fe=!1,ie(),te&&ye(new chunkYMYCPY5Y_cjs.a("missing","the supplied font configuration contains no usable sources; the fixed measurer stays in effect"));return}let ge=await qa(ve);if(k||m!==ce){wr(ge),m===ce&&(fe=!1);return}let Qe=new Set;for(let xe of Q.sources){let je=ge.fonts.resolve(xe.request);je instanceof chunk6K6QQVAZ_cjs.d&&(ye(kr(je)),Qe.add(xe.id));}if(Qe.size>0&&Qe.size<Q.sources.length){let xe=Q.sources.filter(Rn=>!Qe.has(Rn.id)),je=ge;if(ge=await qa(za({epoch:m,...te},{sources:xe})),wr(je),k||m!==ce){wr(ge),m===ce&&(fe=!1);return}}else if(Qe.size===Q.sources.length&&!te){fe=!1,ie();return}let Cn=[...te?.sources??[],...Q.sources].filter(xe=>!Qe.has(xe.id)).map(xe=>{let je=ge.fonts.resolve(xe.request);return je instanceof chunk6K6QQVAZ_cjs.d||je.id!==xe.id?null:{request:xe.request,id:je.id,bytes:je.bytes,hash:je.hash,faceIndex:je.faceIndex}}).filter(xe=>xe!==null),dr=await Kh(Cn,void 0,ve.substitutions??[]);if(k||m!==ce){dr.dispose(),wr(ge),m===ce&&(fe=!1);return}X(),K=dr;let qn=chunk6K6QQVAZ_cjs.Ld(Zt(),{context:o?Mr(o.ownerDocument):null,...K?{fontAlias:K.alias}:{}}),Zn=new Map;if(O=chunk6K6QQVAZ_cjs.Qd({shaper:ge.shaper,resolveFont:xe=>{let je=xe.fontFamily??ve.defaultFont.family;if(je.trim().length===0)return null;let Rn={family:je,weight:xe.bold?700:400,style:xe.italic?"italic":"normal"},En=chunk6K6QQVAZ_cjs.e(Rn);if(Zn.has(En))return Zn.get(En)??null;let mn;try{mn=ge.fonts.resolve(Rn);}catch{return Zn.set(En,null),null}let sn=mn instanceof chunk6K6QQVAZ_cjs.d?null:mn;return Zn.set(En,sn),sn},fallback:qn.measurer,shapingLibrary:chunk6K6QQVAZ_cjs.o,unicodeDataVersion:"16.0.0",...ve.language?{language:ve.language}:{}}),U=`shaped:${ge.operation.extensionFingerprint}+fallback:${qn.producer}@scale:${Zt()}`,fe=!1,h){h.flushPendingInput();let xe=h.session.save(),je=h.state().selection;M=h.drawingSelectionIntent();let Rn=typeof document<"u"&&document.activeElement!==null&&o!==null&&o.contains(document.activeElement);try{ct(xe);}catch(En){O=void 0,U=void 0,h||(d=xe,ct(xe)),ye(kr(En));}Rn&&h?.focus(),h?.setSelection(je),M={kind:"none"};}else ie();}catch(te){if(k||m!==ce)return;fe=false,ie(),ye(kr(te));}}}let $e=Xs();function pn(){let m=h?.state()??null;return {scope:h?.activeScope?.()??YS,isLoading:N===null&&h===null&&d===null&&!c.isScheduled(),isOpening:c.isScheduled(),parseError:N,editable:h!==null&&h.session.editable&&P!=="view"&&p!=="viewing",zoom:Ce.zoom(),zoomMode:Ce.mode(),selection:ml(h),selectionCollapsed:m===null||m.selection.anchor.paragraphId===m.selection.head.paragraphId&&m.selection.anchor.offset===m.selection.head.offset,formatting:Gf(h),table:bl(h),tocContext:$e(m?.contextTocId??null),image:un(h),page:{current:yl(h),total:hl(h)},canUndo:m?.canUndo??false,canRedo:m?.canRedo??false,pageSetup:gl(h),reviewPaneOpen:re,hasReviewContent:h?.session.hasReviewContent()??false,editingMode:p,lastRejection:m?.lastRejection??T,fontSubstitutions:ae()}}function on(){if(R&&V===v)return R;let m=R,C=h?.state().selection??null,z=tl(C,D);D=C;let le=h?.session.packageRevision()??-1,te=le===W;W=le;let oe=pn(),Pe=oe;if(m){let Re=Vs(oe.formatting,m.formatting)?m.formatting:oe.formatting,Q=Us(oe.page,m.page)?m.page:oe.page,ve=Ws(oe.pageSetup??null,m.pageSetup??null)?m.pageSetup:oe.pageSetup,ge=Gs(oe.selection,m.selection)?m.selection:oe.selection,Qe=zf(oe.image,m.image)?m.image:oe.image,Cn=m.fontSubstitutions!==void 0&&oe.fontSubstitutions!==void 0&&m.fontSubstitutions.length===oe.fontSubstitutions.length&&oe.fontSubstitutions.every((dr,qn)=>m.fontSubstitutions[qn]===dr)?m.fontSubstitutions:oe.fontSubstitutions;Pe={...oe,formatting:Re,page:Q,pageSetup:ve,selection:ge,image:Qe,fontSubstitutions:Cn},Ys(Pe,m)&&z&&te&&(Pe=m);}return R=Wa(Pe),V=v,R}if(e.document){let m=nl(e.document);m?rn(m):(N=rl(e.document),Me(Rr("unsupported",N)));}let kn=0,jr=null,Yo="",Kr=null,wn=true,Tn=null;function Ci(){let m=`${h?.session.packageRevision()??-1}:${h?.session.revision()??-1}`,C=sr(),z=Bn()?.anchorY??null;return (h!==jr||m!==Yo||C!==Kr||re!==wn||z!==Tn)&&(jr=h,Yo=m,Kr=C,wn=re,Tn=z,kn+=1),kn}function zt(m){return m.kind==="revision"?m.ranges[0]??null:m.range}function _n(m){return zt(m)===null?false:!(m.kind==="revision"&&b!==null&&b.includes(m.revisionKind))}let Y=nh(),$t=new WeakMap;function Ri(m){let C=$t.get(m);if(C)return C;let z=new Map;for(let le of m.pages)for(let te of [le.footnotes,le.endnotes])if(te)for(let oe of te.notes)for(let Pe of chunk6K6QQVAZ_cjs.Z(oe.fragments))for(let Re of chunk6K6QQVAZ_cjs.xc(Pe))z.has(Re)||z.set(Re,oe.scopeId);return $t.set(m,z),z}function jt(m){let C=zt(m)?.partName;if(!C||!h||C===h.session.part().name)return null;for(let z of h.session.headerFooterResolutionBySection())for(let le of ["header","footer"]){let te=le==="header"?z.headers:z.footers;for(let oe of te.values())if(oe.partName===C)return {kind:le,rId:oe.rId}}return null}function Qo(m){let C=zt(m),z=h?.publishedLayout();return !C||!z?null:Ri(z).get(C.start.paragraphId)??null}function Vr(m){let C=zt(m)?.partName;if(!C||!h)return null;for(let z of ["footnote","endnote"])if(chunk35MI6K7M_cjs.ge(h.session.currentPackage(),z)?.name===C)return {kind:"notesPart",noteKind:z};return null}function ir(m){let C=jt(m);return C!==null?{kind:"headerFooter",rId:C.rId}:Vr(m)??{kind:"body"}}function Ur(m){!h||h.activeScope().kind==="body"||h.session.paragraphIds().includes(m)&&(h.exitNote?.(),h.exitHeaderFooter?.());}let Jo=()=>`${new Date().toISOString().slice(0,19)}Z`,ea=new WeakMap;function Wr(m){let C=ea.get(m);if(C)return C;let z=new Map;for(let[le,te]of chunk6K6QQVAZ_cjs.tc(m).entries())z.set(te,le);return ea.set(m,z),z}function ta(){h?.flushPendingInput();let m=h?.retainedSelection()??h?.state().selection??null;if(!m)return null;let{anchor:C,head:z}=m;if(C.paragraphId===z.paragraphId&&C.offset===z.offset)return null;let le=h?.publishedLayout();if(!le)return null;let te=Wr(le),oe=te.get(C.paragraphId)??-1,Pe=te.get(z.paragraphId)??-1;if(oe===-1||Pe===-1){let Q=Ei();oe=Q.get(C.paragraphId)??-1,Pe=Q.get(z.paragraphId)??-1;}return oe===-1||Pe===-1?null:oe<Pe||oe===Pe&&C.offset<=z.offset?{from:C,to:z}:{from:z,to:C}}function Kt(){let m=h?.activeScope();if(m?.kind==="headerFooter")return {kind:"headerFooter",rId:m.rId};if(m?.kind==="note"){let C=chunk35MI6K7M_cjs.ld(m.id);if(C)return {kind:"notesPart",noteKind:C.noteKind}}return {kind:"body"}}function na(m){if(!h)return {kind:"body"};let C=m.slice(0,m.indexOf("#"));if(C.length===0||C===h.session.part().name)return {kind:"body"};for(let z of h.session.headerFooterResolutionBySection())for(let le of [z.headers,z.footers])for(let te of le.values())if(te.partName===C)return {kind:"headerFooter",rId:te.rId};for(let z of ["footnote","endnote"])if(chunk35MI6K7M_cjs.ge(h.session.currentPackage(),z)?.name===C)return {kind:"notesPart",noteKind:z};return Kt()}function Ei(){if(!h)return new Map;let m=Kt();if(m.kind==="body")return new Map;let C=new Map;for(let[z,le]of h.session.paragraphIdsIn(m).entries())C.set(le,z);return C}function Et(m){if(m.kind==="revision"){let z=m.ranges;if(z.length===0)return null;let te=m.revisionKind==="replace"||m.revisionKind==="insert"||m.revisionKind==="delete"?z[z.length-1]:z[0];return {start:z[0].start,end:te.end}}let C=zt(m);return C?{start:C.start,end:C.end}:null}function Bn(){if(h&&h.activatedReviewKey()!==null)return null;let m=ta(),C=h?.publishedLayout();if(!m||!C)return null;let z=Y(C).get(m.from.paragraphId);return z?{pageIndex:z.pageIndex,anchorY:z.contentY+chunk6K6QQVAZ_cjs.Nd(z,m.from.paragraphId,m.from.offset)}:null}function sr(){return h?.activeReviewKey()??null}function an(m){if(!s)return [];let C=h?.session.reviewItems()??[],z=m?.excludeRevisionKinds;if(z&&z.length>0){let Q=new Set(z);C=C.filter(ge=>ge.kind!=="revision"||!Q.has(ge.revisionKind));let ve=new Set(C.filter(ge=>ge.kind==="revision").map(ge=>ge.id));C=C.map(ge=>{if(ge.kind!=="comment"||ge.parentRevisionId===void 0||ve.has(ge.parentRevisionId))return ge;let{parentRevisionId:Qe,...Cn}=ge;return Cn});}let le=m?.placement!==false,te=null;if(le&&C.length>0){let Q=h?.publishedLayout()??null;Q&&(te=Y(Q));}let oe=sr(),Pe=Q=>{let ve=jt(Q);return ve===null?1:ve.kind==="header"?0:2},Re=C.map((Q,ve)=>({item:Q,position:ve,pageIndex:te?chunk6K6QQVAZ_cjs.Pd(Q,te)?.pageIndex??null:null,group:Pe(Q)}));return Re.sort((Q,ve)=>{let ge=Q.pageIndex??Number.MAX_SAFE_INTEGER,Qe=ve.pageIndex??Number.MAX_SAFE_INTEGER;return ge!==Qe?ge-Qe:Q.group!==ve.group?Q.group-ve.group:Q.position-ve.position}),Re.map(({item:Q})=>{let ve=chunk35MI6K7M_cjs.Qg(Q),ge=te?chunk6K6QQVAZ_cjs.Pd(Q,te):null,Qe={key:ve,id:Q.id,...gn(Q)!==void 0?{date:gn(Q)}:{},activatable:_n(Q),anchorY:ge?.y??null,pageIndex:ge?.pageIndex??null,isActive:ve===oe};return Q.kind==="comment"?{...Qe,kind:"comment",author:Q.comment.author,initials:chunk35MI6K7M_cjs.Yg(Q.comment),text:chunk35MI6K7M_cjs.Xg(Q.comment),resolved:Q.resolved,...Q.parentId!==void 0?{parentId:Q.parentId}:{},...Q.parentRevisionId!==void 0?{parentRevisionId:Q.parentRevisionId}:{},replyIds:Q.replyIds,readOnly:false,item:Q}:Q.kind==="revision"?{...Qe,kind:"revision",revisionKind:Q.revisionKind,author:Q.author,initials:Gr(Q.author),text:Q.text,...Q.replacedText?{replacedText:Q.replacedText}:{},replyIds:Q.replyIds,readOnly:Q.readOnly,item:Q}:{...Qe,kind:"custom",author:"",initials:"",text:Q.detail??Q.text,replyIds:[],readOnly:true,item:Q}})}function lr(){return h?.session.trackingSettings()??chunkC6LK2BYA_cjs.N}function Oi(){let m=lr(),C=Jh({viewOnly:P==="view",reviewEnabled:s,hasAuthor:!!e.author,hostChoseMode:e.mode!==void 0,readerChoseMode:F,currentMode:p,trackRevisions:m.trackRevisions,restrictedToTrackedChanges:m.restrictedToTrackedChanges});C.rejection!==null&&(T=C.rejection),C.mode==="suggesting"&&(p="suggesting",h?.setEditingMode("suggest"));}function Vt(m){return m!=="editing"||!lr().restrictedToTrackedChanges?null:{ok:false,code:"locked",reason:"this document permits editing only as tracked changes"}}function gn(m){return m.kind==="comment"?m.comment.date:m.kind==="revision"?m.date:void 0}function Gr(m){let C=m.trim().split(/\s+/).filter(Boolean);return C.length===0?"?":C.slice(0,2).map(z=>z[0].toUpperCase()).join("")}function ut(m,C){if(!s)return {ok:false,code:"unsupported",reason:nn};let le=an().find(oe=>oe.key===m)?.item;if(!le||le.kind!=="revision")return {ok:false,code:"notFound",reason:"no revision with that key"};if(le.readOnly)return {ok:false,code:"unsupported",reason:"this revision kind has no structural accept/reject yet"};let te;return h?.commitReviewOps(()=>(te=h.session.applyTreeOps(le.addresses.map(oe=>C==="accept"?{op:"acceptRevision",revision:oe}:{op:"rejectRevision",revision:oe}),void 0,void 0,ir(le)),te)),te?.committed?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:typeof te?.reason=="string"?te.reason:"the revision was refused"}}let Pn={get mountGeneration(){return ne},get surface(){return h},setHyperlinkChrome:E.push,setEquationChrome:Z.push,stateVersion:()=>v,fontMeasurement:()=>({measurer:O?"shaped":"fixed",resolving:fe,...O&&U?{producer:U}:{}}),attach(m){if(k){Me(Rr("destroyed","this editor was destroyed; create a new instance to remount"));return}if(h&&o===m)return;h&&(h.flushPendingInput(),d=h.session.save(),Xe());let C=c.cancel();C&&(d=C),Ce.detach(),o=m,Ge=null;let z=d;d=null,z&&c.shouldYield(z)?c.schedule(z):z?ct(z):ie();},detach(){if(k)return;Ce.detach();let m=c.cancel();h&&(h.flushPendingInput(),d=h.session.save(),Xe()),m&&(d=m),o=null,Ge=null,ie();},load(m){let C=nl(m);if(!C){Me(Rr("unsupported",rl(m)));return}rn(C);},save(){if(c.flush(),!h)return Promise.reject(Rr("notFound","no document is loaded"));h.flushPendingInput();let C=h.session.save().slice();return Promise.resolve(C.buffer)},getDocumentHandle(){return Object.freeze({revision:h?.session.packageRevision()??0})},exec(m,C){if(c.flush(),k&&(m.type==="toggleReviewPane"||m.type==="setEditingMode"))return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(m.type==="setEditingMode"){if(P==="view"&&m.mode!=="viewing")return {ok:false,code:"locked",reason:"this document was opened for viewing"};if(m.mode==="suggesting"&&!s)return {ok:false,code:"unsupported",reason:nn};let Re=Vt(m.mode);return Re||(F=true,T=null,p=m.mode,h?.setEditingMode(m.mode==="suggesting"?"suggest":m.mode==="viewing"?"view":"edit"),h?.setEditable(m.mode!=="viewing"),ie(),De(),{ok:true,changed:false})}if(m.type==="toggleReviewPane")return s?(re=!re,ie(),De(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:nn};if(hd(m))return _h(m,h,yd(p),C);let z=Eo(m);if(p==="viewing"&&z.supported&&z.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let le=Do(m,h,P,C);if(!le.ok)return le.refusal;let te=h,oe=te.session.packageRevision(),Pe=vh(te,m,{...le.tablePlan?{admittedTablePlan:le.tablePlan}:{},editor:Pn});return Pe||{ok:true,changed:te.session.packageRevision()!==oe}},can(m,C){if(m.type==="insertImage"||m.type==="replaceImage"){if(k)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(C?.scope){let te=Do(m,h,P,C);if(!te.ok)return te.refusal}return Uf(m,h)}if(m.type==="toggleReviewPane"||m.type==="setEditingMode"){if(k)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(m.type==="toggleReviewPane"&&!s)return {ok:false,code:"unsupported",reason:nn};if(m.type==="setEditingMode"&&P==="view"&&m.mode!=="viewing")return {ok:false,code:"locked",reason:"this document was opened for viewing"};if(m.type==="setEditingMode"){if(m.mode==="suggesting"&&!s)return {ok:false,code:"unsupported",reason:nn};let te=Vt(m.mode);if(te)return te}return {ok:true}}if(hd(m))return bd(m,h,yd(p),C);let z=Eo(m);if(p==="viewing"&&z.supported&&z.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let le=Do(m,h,P,C);if(!le.ok)return le.refusal;if(m.type==="proposeInsertion"||m.type==="proposeDeletion"||m.type==="proposeReplacement"){if(!(m.author??e.author??"").trim())return {ok:false,code:"invalidArgs",reason:`${m.type} requires a non-empty author`};let oe=m.target===void 0?{ok:true,selection:h.state().selection}:yi(h,m.target);if(!oe.ok)return oe;let{anchor:Pe,head:Re}=oe.selection,Q=Pe.paragraphId===Re.paragraphId&&Pe.offset===Re.offset,ve=m.type==="proposeReplacement"&&m.target===void 0&&h.state().cellSelection!==null;if(m.type!=="proposeInsertion"&&Q&&!ve)return {ok:false,code:"invalidArgs",reason:`${m.type} needs a non-collapsed selection`}}if(Ao(m)&&dl(m)){let te=Mo(Pn);if(te){let oe=cl(Pn,m,te);if(oe)return oe}}return {ok:true}},isActive(m){if(m.type==="toggleReviewPane")return re;if(m.type==="setEditingMode")return p===m.mode;let C=h?on().formatting:null;if(!C)return false;switch(m.type){case "toggleMark":switch(m.mark){case "bold":return C.bold===true;case "italic":return C.italic===true;case "underline":return C.underline===true;case "strike":return C.strike===true;case "superscript":return C.superscript===true;case "subscript":return C.subscript===true;default:return false}case "setAlignment":return C.alignment===(m.align==="justify"?"both":m.align);case "toggleList":return h?.isListActive(m.kind)??false;default:return false}},getDocumentStyles:()=>h?.session.documentStyles()??[],getDocumentFonts:()=>h?.session.documentFonts()??[],getAvailableFonts:()=>qh(me(),h?.session.documentFonts()??[]),getDocumentThemeColors:()=>h?.session.documentThemeColors()??[],getOutline:()=>h?.session.documentOutline()??[],getComments:()=>[],getSelectionFormatting:()=>ep(h?on().formatting:null),findMatches:(m,C)=>h?.session.findText(m,{...C?.matchCase!==void 0?{matchCase:C.matchCase}:{},...C?.wholeWord!==void 0?{wholeWord:C.wholeWord}:{}}).matches??[],selectMatch(m){return c.flush(),h?typeof m?.blockId!="string"||m.blockId.length===0||!Number.isInteger(m.start)||m.start<0||!Number.isInteger(m.length)||m.length<0?{ok:false,code:"invalidArgs",reason:"match must carry a blockId and offsets"}:(Ur(m.blockId),h.setSelection({anchor:{paragraphId:m.blockId,offset:m.start},head:{paragraphId:m.blockId,offset:m.start+m.length}}),h.revealParagraph(m.blockId),{ok:true,changed:false}):{ok:false,code:"notFound",reason:"no document is loaded"}},getSelectedImage:()=>on().image,getSelectedTable:()=>Jf(h),getTableCellSelection:()=>{let m=h?.state().cellSelection;return m?{tableId:m.tableId,rows:m.rows,columns:m.columns,cellIds:m.cellIds}:null},setTableInteractionLabel(m){h?.setTableInteractionLabel(m);},canExecuteImageCommand(m,C){if(k)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(C?.scope){let z=Do(m,h,P,C);if(!z.ok)return z.refusal}return ul(m,h)},executeImageCommand(m){return k?Promise.resolve({ok:false,code:"notFound",reason:"the editor was destroyed"}):fl(Pn,m)},getPageSetup:()=>gl(h),getWatermark:()=>null,getTrackedChanges:()=>(h?.session.reviewItems()??[]).filter(m=>m.kind==="revision").map(m=>{let C=jt(m);return {id:m.id,kind:m.kind==="revision"?m.revisionKind:"revision",...m.kind==="revision"&&m.author?{author:m.author}:{},story:C!==null?C.kind:Vr(m)?.noteKind??"body"}}),getReviewItems:m=>an(m),getCustomNodeDefinitions:()=>a.customNodes,reportCustomNodeDiagnostic:i,addComment(m,C){if(!s)return {ok:false,code:"unsupported",reason:nn};let z=ta();if(!z||!h)return {ok:false,code:"invalidArgs",reason:"a comment needs a selected range"};let le=(C??e.author??"").trim();if(le.length===0||m.trim().length===0)return {ok:false,code:"invalidArgs",reason:"a comment needs both an author and text"};let te=null;return h.commitReviewOps(()=>(te=h.session.replyToComment(null,{paragraphId:z.from.paragraphId,start:z.from.offset,end:z.to.offset,...z.to.paragraphId===z.from.paragraphId?{}:{endParagraphId:z.to.paragraphId}},m,le,Jo(),na(z.from.paragraphId)),{committed:te!==null})),te===null?{ok:false,code:"unsupported",reason:"the comment could not be committed"}:{ok:true,changed:true}},getSelectionPlacement:()=>Bn(),isReviewPaneOpen:()=>re,getEditingMode:()=>p,getReviewAuthors:()=>x.authorsFor(h?.revisionAuthors()??ey),getConfiguredAuthor:()=>e.author?.trim()||null,getReviewAuthorStyle:m=>x.styleFor(m),setRevisionStyles(m){x.set(m),h?.setRevisionStyles(m),ie(),De();},setEditingMode:m=>Pn.exec({type:"setEditingMode",mode:m}),getReviewRevision:()=>Ci(),setActiveReviewItem(m,C){if(m===null)return h?.dismissActiveReview(),ie(),De(),{ok:true,changed:false};if(!h)return {ok:false,code:"notFound",reason:"no document is open"};h.flushPendingInput();let le=an().find(Re=>Re.key===m)?.item;if(!le)return {ok:false,code:"notFound",reason:"no review item with that key"};let te=zt(le);if(!te)return {ok:false,code:"unsupported",reason:"this review item has no resolvable range"};if(!_n(le))return {ok:false,code:"unsupported",reason:`review items of kind '${le.revisionKind}' are excluded from activation`};let oe=le?jt(le):null,Pe=oe===null&&le?Qo(le):null;if(oe!==null){if(!h.enterHeaderFooter?.({rId:oe.rId,kind:oe.kind,position:{paragraphId:te.start.paragraphId,offset:te.start.offset}}))return {ok:false,code:"unsupported",reason:"the header or footer this change lives in could not be opened"}}else if(Pe!==null){if(!h.enterNote?.(Pe,{paragraphId:te.start.paragraphId,offset:te.start.offset}))return {ok:false,code:"unsupported",reason:"the note this change lives in could not be opened"}}else {h.exitNote?.(),h.exitHeaderFooter?.();let Re=Et(le)??te,Q={paragraphId:Re.start.paragraphId,offset:Re.start.offset};h.activateReview(m,{anchor:Q,head:Q});let ve=C?.reveal??"centerIfNeeded";ve!==false&&h.revealPosition?.(Re.start,{block:ve});}return (oe!==null||Pe!==null)&&h.activateReview(m),ie(),De(),{ok:true,changed:false}},setReviewActivationExclusions(m){b=m===null?null:[...m],h?.setReviewActivationExclusions(b);},acceptReviewItem:m=>ut(m,"accept"),rejectReviewItem:m=>ut(m,"reject"),setCommentResolved(m,C){return wh({reviewEnabled:s,editingMode:p,placements:an,surface:h,proReviewReason:nn,bump:ie},m,C)},deleteReviewItem(m){if(!s)return {ok:false,code:"unsupported",reason:nn};let z=an().find(te=>te.key===m)?.item;if(!z||!h)return {ok:false,code:"notFound",reason:"no review item with that key"};if(z.kind==="revision")return ut(m,"reject");if(z.kind!=="comment")return {ok:false,code:"unsupported",reason:"a custom node card cannot be deleted"};sr()===m&&h.dismissActiveReview();let le=false;return h.commitReviewOps(()=>{let te=Qo(z),oe=te===null?null:chunk35MI6K7M_cjs.ld(te);return le=h.session.deleteComment(z.id,ir(z),oe?.noteId),{committed:le}}),le?(ie(),{ok:true,changed:true}):{ok:false,code:"unsupported",reason:"the comment could not be deleted"}},replyToReviewItem(m,C,z){if(!s)return {ok:false,code:"unsupported",reason:nn};h?.flushPendingInput();let te=an().find(ge=>ge.key===m)?.item;if(!te||!h)return {ok:false,code:"notFound",reason:"no review item with that key"};let oe=zt(te);if(!oe)return {ok:false,code:"invalidArgs",reason:"the item has no anchorable range"};let Pe=(z??e.author??"").trim(),Re=Th(te,C,Pe);if(Re)return Re;let Q=te.kind==="comment"?te.id:null,ve=null;return h.commitReviewOps(()=>(ve=h.session.replyToComment(Q,{paragraphId:oe.start.paragraphId,start:oe.start.offset,end:oe.end.offset},C,Pe,Jo(),ir(te)),{committed:ve!==null})),ve===null?{ok:false,code:"unsupported",reason:"the reply could not be committed"}:{ok:true,changed:true}},getHeaderFooterState:()=>h?.headerFooterState()??null,getNotePropertiesState:()=>h?.notePropertiesState?.()??null,getNotePreviewText:m=>h?.notePreviewText?.(m)??null,setActiveScope(m){h?.setActiveScope(m)&&ie();},getActiveScope:()=>h?.activeScope()??{kind:"body"},query(m){switch(m.type){case "selectedText":return h?.selectedText()??"";case "selectionFormatting":return h?on().formatting:null;case "selection":return ml(h);case "paragraphs":return Yf(h,m.container);case "isInsideToc":return h?h.isInsideToc(h.state().selection.head.paragraphId):false;case "hyperlinkAt":return Xf(h);case "contentControls":return Mh(h,m.filter);case "trackedChanges":case "revisions":case "findText":case "comments":return [];case "styles":return {paragraph:new Map,character:new Map,table:new Map};case "variables":return {};case "contentControlAt":return md(h,m.filter);case "tableContext":return bl(h);default:return null}},snapshot:()=>on(),getTotalPages:()=>hl(h),getCurrentPage:m=>yl(h,m),scrollToPage:m=>!Number.isInteger(m)||m<1?false:(c.flush(),h?.revealPage(m-1)??false),scrollToBlock:m=>typeof m!="string"||m.length===0?false:(c.flush(),Ur(m),h?.revealParagraph(m)??false),...Yh(Ce,()=>h),relayout(m){m?.sync,h?.layout();},retainSelection:()=>h?.retainSelection()??null,releaseSelection:m=>h?.releaseSelection(m),focus(m){return c.flush(),h?m&&m.kind==="all"?{ok:false,code:"invalidTarget",reason:"the all scope cannot take focus"}:m&&!h.setActiveScope(m)?{ok:false,code:"invalidTarget",reason:"that scope cannot be opened"}:(h.focus(),{ok:true,value:void 0}):{ok:false,code:"invalidTarget",reason:"no document is loaded"}},destroy(){k=true,c.cancel(),Ce.detach(),X(),Xe(),o=null,d=null,ne+=1,ie();for(let m of Object.values(pe))m.clear();},on(m,C){return pe[m].add(C),()=>{pe[m].delete(C);}}};return Pn}var oy=Object.freeze({document:true,save:true,events:true,selection:true,scrolling:true,layout:true});function JS(e){return chunk7ZJL5AEY_cjs.g({port:ek(e),capabilities:oy})}function ek(e){let t=0,n=0,r=null,o=false,a=false,i=()=>{if(a)return null;let s=e.surface?.session??null;return s!==r&&(o&&(t+=n+1),o=true,r=s,n=0),s&&(n=s.packageRevision()),s};return {revision(){return i(),t+n},currentPackage:()=>i()?.currentPackage()??null,revisionDisplayMode:()=>e.surface?.revisionDisplayMode()??chunk35MI6K7M_cjs.wg,apply(s,d){i();let c=e.surface;if(!c)return {ok:false,reason:"no-document"};let p=c.applyAutomationOps(s,d);return p.rejected?{ok:false,reason:String(p.reason??"refused")}:{ok:true,changed:p.committed}},applyLifecycle(s){i();let d=e.surface;if(!d)return {ok:false,reason:"no-document"};let c=d.applyAutomationOps(()=>[s]);return c.rejected?{ok:false,reason:String(c.reason??"refused")}:{ok:true,changed:c.committed}},applyCommentWrites(s,d){let c=e.surface,p=i();if(!c||!p)return {ok:false,reason:"no-document"};if(s.length===0)return {ok:true,changed:false};if(d.kind!=="body")return {ok:false,reason:"unsupported-story"};let b=e.can({type:"toggleReviewPane"});if(!b.ok)return {ok:false,reason:b.reason??"review-module-required"};let x={ok:false,reason:"refused"};return c.commitReviewOps(()=>{if(s.every(T=>T.kind==="delete")){let T=s.find(B=>B.kind==="delete"),P=p.deleteComments(s.map(B=>{if(B.kind!=="delete")throw new Error("unreachable mixed comment write");return {commentId:B.commentId,...B.parentCommentId===void 0?{}:{parentCommentId:B.parentCommentId}}}),d,T?.kind==="delete"?T.noteId:void 0);return x=P?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:P}}if(s.length!==1)return x={ok:false,reason:"mixed-comment-writes"},{committed:false};let w=s[0];if(w.kind==="resolve"){let T=p.setCommentResolved(w.commentId,w.resolved);return x=T?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:T}}if(w.kind!=="create"&&w.kind!=="reply")return x={ok:false,reason:"unsupported-comment-write"},{committed:false};let F=p.replyToComment(w.kind==="reply"?w.parentCommentId:null,w.anchor,w.text,w.author,w.date);return x=F===null?{ok:false,reason:"refused"}:{ok:true,changed:true,commentId:F},{committed:F!==null}}),x},applyCustomNodeWrite(s,d){let c=e.surface,p=i();if(!c||!p)return {ok:false,reason:"no-document"};if(d.kind!=="body")return {ok:false,reason:"unsupported-story"};let b={ok:false,reason:"refused"};return c.commitReviewOps(()=>{let x=p.insertCustomNode(s);return b=x.ok?{ok:true,changed:x.change!==null}:{ok:false,reason:x.detail?`${x.reason}: ${x.detail}`:x.reason},{committed:x.ok}}),b},save:()=>i()?.save()??null,select(s,d){if(!e.surface)return;let p=d==="end"?s.end:s.start,b=d==="start"?s.start:s.end;e.exec({type:"setSelection",range:{anchor:{paragraphId:p.paragraphId,offset:p.offset},head:{paragraphId:b.paragraphId,offset:b.offset}}});},subscribe:s=>e.on("change",()=>s()),dispose(){a=true,r=null;}}}function tk(e){return e*(96/72)}function nk(e,t){return e*t}function rk(e,t){return e/t}function ok(e,t,n){let r=e.pages[t.pageIndex];if(!r)return {left:0,top:0,width:0,height:0};let o=n.pageOffsetX.get(r.index)??0,a=n.paintScale;return Object.freeze({left:(r.contentBox.x+t.x+o)*a,top:(r.contentBox.y+t.y)*a,width:t.width*a,height:t.height*a})}function ak(e){return Object.freeze(e?{left:e.offsetLeft,top:e.offsetTop}:{left:0,top:0})}function iy(e,t,n){return t?true:e.length===1?false:!n}var ay=["e","se","s","sw","w","nw","n","ne"];function ik(e,t){let n=ay.indexOf(e);t.flipHorizontal&&(n=(4-n+8)%8),t.flipVertical&&(n=(8-n)%8);let r=Math.round(t.rotationDegrees/45)%8;return ay[(n-r+8)%8]}function sk(e,t,n){let r=e,o=t,a=-n.rotationDegrees*Math.PI/180,i=Math.cos(a),s=Math.sin(a),d=r*i-o*s,c=r*s+o*i;return r=d,o=c,n.flipHorizontal&&(r=-r),n.flipVertical&&(o=-o),Object.freeze({x:r,y:o})}function ar(e){return e/No}function sy(e){let t=sk(e.deltaXPt,e.deltaYPt,e.transform),n=ar(e.startWidthEmu),r=ar(e.startHeightEmu),o=n/r,a=ik(e.handle,e.transform),i=a.includes("e")?t.x:a.includes("w")?-t.x:0,s=a.includes("s")?t.y:a.includes("n")?-t.y:0;if(n=Math.max(1,n+i),r=Math.max(1,r+s),e.preserveAspect)if(a.length===2){let N=Math.max(n/ar(e.startWidthEmu),r/ar(e.startHeightEmu));n=Math.max(1,ar(e.startWidthEmu)*N),r=Math.max(1,n/o);}else a==="e"||a==="w"?r=Math.max(1,n/o):n=Math.max(1,r*o);let d=ar(e.startWidthEmu),c=ar(e.startHeightEmu),p=n/d,b=r/c,x=Math.max(1,e.startBounds.width*p),w=Math.max(1,e.startBounds.height*b),F=e.startBounds.x,T=e.startBounds.y,P=e.handle;P.includes("w")&&(F=e.startBounds.x+e.startBounds.width-x),P.includes("n")&&(T=e.startBounds.y+e.startBounds.height-w);let B=null;if(e.kind==="anchored"&&e.startPosition&&(P.includes("w")||P.includes("n")))if(e.startPosition.mode==="simple"){let h=P.includes("w")?lt(F-e.startBounds.x):0,N=P.includes("n")?lt(T-e.startBounds.y):0;B=Object.freeze({mode:"simple",horizontalEmu:(e.startPosition.horizontalEmu??0)+h,verticalEmu:(e.startPosition.verticalEmu??0)+N});}else if(e.anchorFrameOrigin)B=Object.freeze({mode:"frame",...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{},...P.includes("w")?{horizontalEmu:lt(F-e.anchorFrameOrigin.x)}:e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu}:{},...P.includes("n")?{verticalEmu:lt(T-e.anchorFrameOrigin.y)}:e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu}:{}});else {let h=P.includes("w")?lt(F-e.startBounds.x):0,N=P.includes("n")?lt(T-e.startBounds.y):0;B=Object.freeze({mode:"frame",...e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu+h}:{},...e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu+N}:{},...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{}});}return Object.freeze({widthEmu:lt(n),heightEmu:lt(r),previewBounds:Object.freeze({x:F,y:T,width:x,height:w}),position:B})}function lk(e,t){return Object.freeze({scrollBy(n){if(!Number.isFinite(n)||n===0)return 0;let r=e.scrollTop;return e.scrollTop+=n*t,(e.scrollTop-r)/t}})}function dk(e){if(e.session.mode==="move"){let t=e.session.startBounds.x+e.deltaXPt,n=e.session.startBounds.y+e.deltaYPt+e.accumulatedScrollPt,r=e.session.startPosition&&pl(e.session.startPosition,e.deltaXPt,e.deltaYPt+e.accumulatedScrollPt);return Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:Object.freeze({x:t,y:n,width:e.session.startBounds.width,height:e.session.startBounds.height}),position:r??null})}return e.session.handle?sy({handle:e.session.handle,startWidthEmu:e.session.startWidthEmu,startHeightEmu:e.session.startHeightEmu,startBounds:e.session.startBounds,startPosition:e.session.startPosition,anchorFrameOrigin:e.anchorFrameOrigin,deltaXPt:e.deltaXPt,deltaYPt:e.deltaYPt,transform:e.session.transform,preserveAspect:iy(e.session.handle,e.aspectLocked,e.shiftKey),kind:e.session.kind}):Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:e.session.startBounds,position:null})}
|
|
18
|
-
exports.$=Qa;exports.A=$s;exports.Aa=tv;exports.B=js;exports.Ba=nv;exports.C=L0;exports.Ca=rv;exports.D=ol;exports.Da=di;exports.E=cb;exports.Ea=Dm;exports.F=Oo;exports.Fa=id;exports.G=Fo;exports.Ga=Go;exports.H=al;exports.Ha=Xo;exports.I=ub;exports.Ia=zr;exports.J=il;exports.Ja=VS;exports.K=un;exports.Ka=wi;exports.L=Mo;exports.La=Ti;exports.M=ul;exports.Ma=QS;exports.N=fl;exports.Na=oy;exports.O=Tb;exports.Oa=JS;exports.P=Pb;exports.Pa=tk;exports.Q=No;exports.Qa=nk;exports.R=Rb;exports.Ra=rk;exports.S=lt;exports.Sa=ok;exports.T=Er;exports.Ta=ak;exports.U=Eb;exports.Ua=iy;exports.V=pl;exports.Va=sy;exports.W=Ob;exports.Wa=lk;exports.X=Ya;exports.Xa=dk;exports.Y=Fr;exports.Z=np;exports._=vl;exports.a=kr;exports.aa=Nb;exports.b=qa;exports.ba=rp;exports.c=wr;exports.ca=op;exports.d=e0;exports.da=Db;exports.e=Fs;exports.ea=Jn;exports.f=Za;exports.fa=xl;exports.g=za;exports.ga=qb;exports.h=As;exports.ha=Zb;exports.i=en;exports.ia=$b;exports.j=x0;exports.ja=Ja;exports.k=I0;exports.ka=sp;exports.l=S0;exports.la=ei;exports.m=hf;exports.ma=lp;exports.n=k0;exports.na=dp;exports.o=w0;exports.oa=Vb;exports.p=T0;exports.pa=Ub;exports.q=P0;exports.qa=Wb;exports.r=C0;exports.ra=Gb;exports.s=R0;exports.sa=Xb;exports.t=E0;exports.ta=Yb;exports.u=yf;exports.ua=Qb;exports.v=O0;exports.va=Sl;exports.w=Zs;exports.wa=Jb;exports.x=kf;exports.xa=up;exports.y=wf;exports.ya=ev;exports.z=Ua;exports.za=fp;
|