@docx-editor.dev/core 2.21.0 → 2.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +31 -31
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +10 -10
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +8 -8
  7. package/dist/binding.js +1 -1
  8. package/dist/chunk-25OQBAKA.js +2 -0
  9. package/dist/chunk-3B3DQMSL.js +11 -0
  10. package/dist/chunk-3P3DNJYM.js +5 -0
  11. package/dist/chunk-3PA64KPK.js +5 -0
  12. package/dist/{chunk-4EHMMSFR.cjs → chunk-4TYA4RLP.cjs} +1 -1
  13. package/dist/chunk-7N77EN2Z.cjs +2 -0
  14. package/dist/{chunk-TE43S3LX.cjs → chunk-AGWWNVIJ.cjs} +1 -1
  15. package/dist/{chunk-Q2B6HX3R.js → chunk-BF2TOG2V.js} +1 -1
  16. package/dist/chunk-DFTVN25X.cjs +5 -0
  17. package/dist/{chunk-BQXF2PFF.js → chunk-DGONGMAV.js} +1 -1
  18. package/dist/{chunk-BDAY2ETZ.js → chunk-DZYKU2HG.js} +1 -1
  19. package/dist/chunk-E5OUYRNM.cjs +5 -0
  20. package/dist/{chunk-S35UK656.cjs → chunk-F4H3LC6M.cjs} +1 -1
  21. package/dist/{chunk-X5QNSISI.js → chunk-FPDIJ4RF.js} +1 -1
  22. package/dist/chunk-IUTTOBQW.cjs +20 -0
  23. package/dist/{chunk-WQFNWLNY.cjs → chunk-IYCXQAFT.cjs} +2 -2
  24. package/dist/chunk-JL3SI5SZ.js +18 -0
  25. package/dist/chunk-OFWUHH52.js +20 -0
  26. package/dist/chunk-OKY6JRJL.js +4 -0
  27. package/dist/{chunk-XZY4Q6PJ.cjs → chunk-P24FHMQW.cjs} +1 -1
  28. package/dist/chunk-QBKAOSVF.cjs +18 -0
  29. package/dist/{chunk-PYXMAUNR.cjs → chunk-RA2TDTEQ.cjs} +1 -1
  30. package/dist/{chunk-Z2ETEZRU.cjs → chunk-T5B4NMKF.cjs} +1 -1
  31. package/dist/{chunk-VUNFWXHF.js → chunk-U5GUJKTS.js} +1 -1
  32. package/dist/chunk-XRYSPKKC.js +1 -0
  33. package/dist/chunk-ZZRCVDQU.cjs +11 -0
  34. package/dist/collaboration/replication.cjs +1 -1
  35. package/dist/collaboration/replication.d.ts +4 -4
  36. package/dist/collaboration/replication.js +1 -1
  37. package/dist/collaboration.d.ts +3 -3
  38. package/dist/contracts/document.d.ts +2 -2
  39. package/dist/contracts/editor.d.ts +8 -8
  40. package/dist/contracts/modules.d.ts +6 -6
  41. package/dist/contracts/types.d.ts +1 -1
  42. package/dist/{custom-node-writes-05qS32px.d.ts → custom-node-writes-CncR6KfC.d.ts} +2 -2
  43. package/dist/{document-protection-Cr59VKLO.d.ts → document-protection-DM6mA8Rf.d.ts} +1 -1
  44. package/dist/{editor-BsLSz_7y.d.ts → editor-BRh7GuZF.d.ts} +10 -6
  45. package/dist/editor.cjs +1 -1
  46. package/dist/editor.css +1 -1
  47. package/dist/editor.d.ts +25 -25
  48. package/dist/editor.js +1 -1
  49. package/dist/export.cjs +2 -2
  50. package/dist/export.d.ts +12 -12
  51. package/dist/export.js +1 -1
  52. package/dist/{font-resolver-CzwdBJDE.d.ts → font-resolver-DwuQYj3P.d.ts} +1 -1
  53. package/dist/{headless-document-view-B7nAiR7P.d.ts → headless-document-view-C3fc_jV0.d.ts} +2 -2
  54. package/dist/{image-resources-C4ilLzog.d.ts → image-resources-DxF-SN_8.d.ts} +1 -1
  55. package/dist/{index-zkvqBQ9o.d.ts → index-3pNnG4z4.d.ts} +19 -18
  56. package/dist/index.cjs +1 -1
  57. package/dist/index.d.ts +17 -17
  58. package/dist/index.js +1 -1
  59. package/dist/{layout-shaping-BJKVTI6i.d.ts → layout-shaping-_GGjhhVc.d.ts} +1 -1
  60. package/dist/layout.cjs +1 -1
  61. package/dist/layout.d.ts +19 -17
  62. package/dist/layout.js +1 -1
  63. package/dist/{note-properties-MNztEj5s.d.ts → note-properties-CjT31AuP.d.ts} +1 -1
  64. package/dist/{omml-equation-CbnW9yXd.d.ts → omml-equation-Bk3OP1fv.d.ts} +1 -1
  65. package/dist/output.cjs +1 -1
  66. package/dist/output.d.ts +7 -7
  67. package/dist/output.js +1 -1
  68. package/dist/{protocol-Co_r0SZQ.d.ts → protocol-CrbTIW2Z.d.ts} +2 -2
  69. package/dist/{review-paragraph-order-EFaU7TqH.d.ts → review-paragraph-order-D3KZohIL.d.ts} +1 -1
  70. package/dist/{revision-projection-DEIvpxiq.d.ts → revision-projection-kVd7p6Wd.d.ts} +1 -1
  71. package/dist/{semantic-cell-selection-DXmfnDCw.d.ts → semantic-cell-selection-CkSsZHDL.d.ts} +6 -4
  72. package/dist/{semantic-interaction-BLu3M6Nn.d.ts → semantic-interaction-Z2Xa68U5.d.ts} +1 -1
  73. package/dist/{semantic-paint-CPsihA6k.d.ts → semantic-paint-BHKprI9P.d.ts} +2 -2
  74. package/dist/{semantic-records-CqD0b5Ex.d.ts → semantic-records-StH-AnHK.d.ts} +11 -8
  75. package/dist/store.cjs +1 -1
  76. package/dist/store.d.ts +19 -25
  77. package/dist/store.js +1 -1
  78. package/dist/{tree-package-fragment-CwJDixNs.d.ts → tree-package-fragment-CpEV1gl3.d.ts} +2 -2
  79. package/dist/{tree-session-contract-D9RRWE0C.d.ts → tree-session-contract-CTT9nM7Z.d.ts} +10 -5
  80. package/dist/{types-barrel-DLB11iSY.d.ts → types-barrel-PwcfEkaX.d.ts} +8 -4
  81. package/package.json +2 -2
  82. package/dist/chunk-44LQJIKH.cjs +0 -20
  83. package/dist/chunk-AFG7Q622.cjs +0 -2
  84. package/dist/chunk-AYMSP25Q.js +0 -4
  85. package/dist/chunk-B4KZSKF7.cjs +0 -5
  86. package/dist/chunk-BNZF6DYC.cjs +0 -18
  87. package/dist/chunk-GIHKVXEO.js +0 -2
  88. package/dist/chunk-ITNK6C5M.cjs +0 -3
  89. package/dist/chunk-MP3K4LC5.js +0 -1
  90. package/dist/chunk-MXOO7KRI.cjs +0 -11
  91. package/dist/chunk-NG6IQ4SI.js +0 -11
  92. package/dist/chunk-Q5JPPUNR.js +0 -5
  93. package/dist/chunk-VH2DLEZK.js +0 -20
  94. package/dist/chunk-WZX4UGRQ.js +0 -3
  95. package/dist/chunk-XS4FOHH6.js +0 -18
@@ -0,0 +1,20 @@
1
+ import {a as a$3}from'./chunk-AJCCS53D.js';import {k,h,e,n,o,f,g,l,i as i$2,b as b$1,c,a as a$7,d as d$2}from'./chunk-DGONGMAV.js';import {p,q,i as i$1,f as f$1,a as a$8,k as k$2,b as b$3,e as e$2,r,v,t as t$1,m as m$2,n as n$1,c as c$1}from'./chunk-U5GUJKTS.js';import {d,y,t,F,a as a$1,i,da,qa as qa$1,va,wa,ta as ta$1,ea,fa,ga,xa as xa$2,ka as ka$1,ia,ya,pa as pa$1,za as za$2,ra as ra$1,ua,sa as sa$1,ja as ja$2,aa,H,g as g$2,oa as oa$1}from'./chunk-OKY6JRJL.js';import {k as k$1,e as e$1,b,a as a$4}from'./chunk-25OQBAKA.js';import {a as a$5}from'./chunk-XRYSPKKC.js';import {ed,La,Yd,Ac as Ac$1,sd,td,X,Jb as Jb$1,Cd,qe,wd,fe,ne,S,be,se,$d,fc as fc$1,zc as zc$1,Y,Z,$,_,fd,pd,cc as cc$1,bc as bc$1,Bd,ee,ge,ke,W,je,B,lc as lc$1,re,V,ce,_d,te,U,Kb as Kb$1,Fb as Fb$1,ae,Ab as Ab$1,Nc as Nc$1,h as h$1,Vc as Vc$1,m,_c as _c$2,Xc as Xc$1,jd,gd,hd,id,dc as dc$1,Ha as Ha$2,pe as pe$1,Ad,R,$b as $b$1,ac as ac$1,me as me$1,C,T,ad,ve,cb as cb$1,nb as nb$1,jb as jb$1,Na,ud,K,Pc as Pc$1,Zc as Zc$1,Eb as Eb$2,wc as wc$1,Db as Db$1,Cb as Cb$1,xc as xc$1,Lb as Lb$1,Q as Q$1,Ea,Ga as Ga$1}from'./chunk-JL3SI5SZ.js';import {j,d as d$1,i as i$3}from'./chunk-3PA64KPK.js';import {ja as ja$1,Da,ta,xa,Sa,Aa,sa,ra,Ha as Ha$1,va as va$1,ka,qa as qa$2,pa,na,Ka as Ka$1,La as La$2,la,za as za$1,ya as ya$1,oa,Ja as Ja$1,Ca,I,_a}from'./chunk-3P3DNJYM.js';import {a as a$6}from'./chunk-6JIJOZDW.js';import {a as a$2,Lf as Lf$1,qi,db as db$1,hh,ih,jh as jh$1,Be,lf as lf$1,De,Vi,jf as jf$1,Wf as Wf$1,Nb as Nb$1,$c as $c$1,Ha,mb as mb$1,eb as eb$1,fb as fb$1,hb as hb$1,L,zi,Bi,wi,Ai,oh,mh,lh,ai as ai$1,xf as xf$1,Df as Df$1,_c as _c$1,ze,b as b$2,vd,Mf as Mf$1,Nf as Nf$1,Jf,Kf as Kf$1,Of as Of$1,Pf as Pf$1,zh as zh$1,cg,nf as nf$1,xa as xa$1,Fa,La as La$1,da as da$1,gc as gc$1,pc as pc$1,nc,oc,Ia,ui as ui$1,Pi,Xi,li as li$1,Dh as Dh$1,vi,Ae,Ue,fi as fi$1,qh as qh$1,wh,hi as hi$1,bi as bi$1,ci as ci$1,yd,Bd as Bd$1,rc,Ed,Ig,Fb as Fb$2,Eb as Eb$1,td as td$1,kd,id as id$1,hg,eg,Ye,Ze,Ke as Ke$1,Jc as Jc$1,m as m$1,Fd,Id,Fg,Ah,Bh as Bh$1,Me,Je as Je$1,$h as $h$1,_h as _h$1,Xf,Se,tc,vc as vc$1,ed as ed$1,ji,ki,ub as ub$1,oi as oi$1,Lh,Cf as Cf$1,Hh as Hh$1,Th,Ad as Ad$1,kh,la as la$1,ma,na as na$1,fg,Yh as Yh$1,ic as ic$1,nh,Ve as Ve$1,Dc as Dc$1,Ac as Ac$2,N,w,Ie,M,zb as zb$1,fe as fe$1,g as g$1,Sa as Sa$1,Ra,Gd,ja as ja$3,Q,ia as ia$1,ha,B as B$1,ab as ab$1,de,Xd,Af as Af$1,Ib as Ib$1,re as re$1,Lc as Lc$1}from'./chunk-3B3DQMSL.js';import {a}from'./chunk-S6J4O5XP.js';import {zipSync,strToU8}from'fflate';import {createT,en as en$1,locales,deepMerge}from'@docx-editor.dev/i18n';function Uk(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var Dh=false;function Hh(e){if(Dh)return;Dh=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 wo(e){if(e instanceof a)return e;if(e instanceof d)return new a(e.code,e.message,{request:Uk(e.request),diagnostic:e.diagnostic});if(e instanceof y)return new a("overLimit",e.message,{diagnostic:e.message});if(e instanceof t){let t=e.code==="wasmUnavailable"||e.code==="shapingLibraryMismatch"?"wasmUnavailable":"initializationFailed";return new a(t,e.message,{diagnostic:e.diagnostic??e.message,cause:e})}return new a("initializationFailed",e instanceof Error?e.message:"Font initialization failed",{diagnostic:e instanceof Error?e.message:String(e)})}async function Ba(e,t){try{return await F(e,t)}catch(n){throw wo(n)}}var Gk=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,collaborationStatus:"inactive"});var _h="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Yk="http://schemas.openxmlformats.org/package/2006/content-types",Bh="http://schemas.openxmlformats.org/package/2006/relationships",Qk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Jk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",eT=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${Yk}"><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>`,tT=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Bh}"><Relationship Id="rId1" Type="${Qk}" Target="word/document.xml"/></Relationships>`,nT=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Bh}"><Relationship Id="rId1" Type="${Jk}" Target="styles.xml"/></Relationships>`,rT=[{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}],oT=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>",aT=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="${_h}"><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>`+rT.map(oT).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="Caption"><w:name w:val="caption"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="35"/><w:semiHidden/><w:unhideWhenUsed/><w:pPr><w:spacing w:after="0"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/><w:sz w:val="18"/><w:szCs w:val="18"/></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>',iT=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="${_h}"><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 ac(){return zipSync({"[Content_Types].xml":strToU8(eT),"_rels/.rels":strToU8(tT),"word/_rels/document.xml.rels":strToU8(nT),"word/document.xml":strToU8(iT),"word/styles.xml":strToU8(aT)})}var Io="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sT=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<Io.length;t+=1)e[Io.charCodeAt(t)]=t;return e})();function ys(e,t){if(e.length===0)return null;let n=e.length%4;if(n===1)return null;let r=n===0?e:e+"=".repeat(4-n),o=r.endsWith("==")?2:r.endsWith("=")?1:0,a=r.length/4*3-o;if(a<=0||a>t)return null;let i=new Uint8Array(a),s=0;for(let l=0;l<r.length;l+=4){let d=0,u=0;for(let f=0;f<4;f+=1){let p=r.charCodeAt(l+f);if(p===61){if(l+f<r.length-o)return null;continue}let m=p<128?sT[p]:-1;if(m<0)return null;d=d<<6|m,u+=6;}d<<=24-u,u>=12&&(i[s++]=d>>>16&255),u>=18&&(i[s++]=d>>>8&255),u>=24&&(i[s++]=d&255);}return s===a?i:null}function bs(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+=Io[o>>2]+Io[(o&3)<<4|a>>4],n+=r+1<e.length?Io[(a&15)<<2|i>>6]:"=",n+=r+2<e.length?Io[i&63]:"=",n.length>=32768&&(t.push(n),n="");}return t.push(n),t.join("")}var lT=16*1024*1024,qh=64*1024*1024,Zh="data-docx-fragment",Kh="data-docx-fragment-end",dT=bs;function Vh(e,t){if(!t)return `<div>${e}</div>`;let n=t.lastMarkCovered?"covered":"open";return `<div ${Zh}="${dT(t.bytes)}" ${Kh}="${n}">${e}</div>`}function $h(e,t){let n=`${t}="`,r=e.indexOf(n);if(r===-1||r>qh)return null;let o=r+n.length,a=e.indexOf('"',o);return a===-1?null:e.slice(o,a)}function vs(e,t=lT){if(e.length>qh)return null;let n=$h(e,Zh);if(n===null||n.length===0)return null;let r=ys(n,t);if(r===null||r.byteLength===0)return null;let o=$h(e,Kh);return {bytes:r,lastMarkCovered:o==="covered"}}function qr(e){if(e==null)return null;let t=e.trim();return /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,3}$/.test(t)?t:null}var sc=["single","words","double","thick","dotted","dottedHeavy","dash","dashedHeavy","dashLong","dashLongHeavy","dotDash","dashDotHeavy","dotDotDash","dashDotDotHeavy","wave","wavyHeavy","wavyDouble"],ic={Normal:"MsoNormal",ListParagraph:"MsoListParagraph",Title:"MsoTitle",Subtitle:"MsoSubtitle",Caption:"MsoCaption",Quote:"MsoQuote",IntenseQuote:"MsoIntenseQuote",BodyText:"MsoBodyText",FootnoteText:"MsoFootnoteText"},lc=new Map([...Object.entries(ic).filter(([e])=>e!=="Normal").map(([e,t])=>[t,e]),["MsoListParagraphCxSpFirst","ListParagraph"],["MsoListParagraphCxSpMiddle","ListParagraph"],["MsoListParagraphCxSpLast","ListParagraph"]]);function zh(e){return e===void 0?null:/^Heading[7-9]$/.test(e)?`Mso${e}`:Object.hasOwn(ic,e)?ic[e]:null}var dc=Object.fromEntries(k),cc={left:"left",start:"left",center:"center",right:"right",end:"right",both:"justify",distribute:"justify"};function jh(e){let t=e.trim();if(t.length===0||t.length>255)return null;let n=t.replace(/[^\p{L}\p{N} _.,-]/gu,"");return n.length===0?null:`"${Q(n)}"`}var cT=new Map([["single","solid"],["thick","solid"],["double","double"],["triple","double"],["dotted","dotted"],["dashed","dashed"],["dashSmallGap","dashed"],["dotDash","dashed"],["dotDotDash","dashed"],["wave","solid"],["hairline","solid"],["inset","solid"],["outset","solid"]]);function Zr(e){if(e===null)return null;let t=Ie(e,"val",da$1);if(t===void 0||t==="nil"||t==="none")return null;let n=cT.get(t)??"solid",r=Ie(e,"sz",da$1),o=r!==void 0&&/^\d{1,4}$/.test(r)?Number.parseInt(r,10):0,a=o>0?o/8:.5,i=`${Math.round(a*100)/100}pt`,s=Ie(e,"color",da$1),l=s!==void 0&&/^[0-9A-Fa-f]{6}$/.test(s)?`#${s}`:"#000000";return `${i} ${n} ${l.toLowerCase()}`}function Wh(e,t){return e===null||e<=0?[]:t==="exact"||t==="atLeast"?[`line-height:${`${Math.round(e/20*100)/100}pt`}`,`mso-line-height-rule:${t==="exact"?"exactly":"at-least"}`]:[`line-height:${Math.round(e/240*100)/100}`]}var uT=new Map([["double","double"],["wavyDouble","double"],["dotted","dotted"],["dottedHeavy","dotted"],["dash","dashed"],["dashedHeavy","dashed"],["dashLong","dashed"],["dashLongHeavy","dashed"],["dotDash","dashed"],["dashDotHeavy","dashed"],["dotDotDash","dashed"],["dashDotDotHeavy","dashed"],["wave","wavy"],["wavyHeavy","wavy"]]),fT=new Set(sc);function Uh(e){if(e===null)return [];let t=Ie(e,"val",da$1),n=[],r=t===void 0?void 0:uT.get(t);r!==void 0&&n.push(`text-decoration-style:${r}`),t!==void 0&&t!=="single"&&fT.has(t)&&n.push(`text-underline:${t}`);let o=Ie(e,"color",da$1);return o!==void 0&&/^[0-9A-Fa-f]{6}$/.test(o)&&n.push(`text-decoration-color:#${o.toLowerCase()}`),t==="thick"&&n.push("text-decoration-thickness:2px"),n}function Gh(e,t){return e===null||e<=0?"":`height:${Math.round(e/20*100)/100}pt;mso-height-rule:${t==="exact"?"exactly":"at-least"}`}function Xh(e,t,n,r){if(e.namespaceUri!==da$1)return "";let o=e.localName==="footnoteRef"?"footnote":e.localName==="endnoteRef"?"endnote":null,a=e.localName==="footnoteReference"?"footnote":e.localName==="endnoteReference"?"endnote":null,i=o??a;if(i===null)return "";let s=Ie(e,"id",da$1),l=o===null?s!==void 0&&/^\d{1,10}$/.test(s)?Number.parseInt(s,10):void 0:t?.id;if(l===void 0||!Number.isInteger(l)||l<1||o!==null&&t?.kind!==o||l>2147483647||o===null&&!r(i,l))return "";let d=i==="footnote",u=o!==null,f=d?"MsoFootnoteReference":"MsoEndnoteReference",p=d?"ftn":"edn",m=u?`#_${p}ref${l}`:`#_${p}${l}`,h=u?`_${p}${l}`:`_${p}ref${l}`;return `<a style="mso-${d?"footnote":"endnote"}-id:${p}${l}" href="${m}" name="${h}"><span class="${f}"><span style="mso-special-character:footnote">[${n(i,l)}]</span></span></a>`}function Yh(e){if(e.namespaceUri!==da$1||e.localName!=="ptab")return "";let t=Ie(e,"alignment",da$1),n=Ie(e,"relativeTo",da$1),r=Ie(e,"leader",da$1)??"none";if(t!=="left"&&t!=="center"&&t!=="right")return "";let o=n==="margin"||n==="leftMargin"?"margin":n==="indent"?"indent":null;return o===null||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middleDot"&&r!=="heavy"?"":`<w:PTab Alignment="${t.toUpperCase()}" RelativeTo="${o.toUpperCase()}" Leader="${r.toUpperCase()}"></w:PTab>`}function it(e){let t=e.trim().toLowerCase();if(/^-?0+(\.0+)?$/.test(t))return 0;let n=/^(-?(?:\d+(?:\.\d+)?|\.\d+))(px|pt|in|cm|mm|pc)$/.exec(t);if(!n)return null;let r=Number.parseFloat(n[1]);if(!Number.isFinite(r))return null;switch(n[2]){case "px":return r*.75;case "in":return r*72;case "cm":return r*72/2.54;case "mm":return r*72/25.4;case "pc":return r*12;default:return r}}function ey(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("<o:p")||e.includes("class=Mso")||e.includes('class="Mso')||e.includes("class='Mso")}function ty(e,t){for(let r of e.classList){let o=/^MsoHeading([1-9])$/.exec(r);if(o)return `Heading${o[1]}`;let a=/^Heading([1-9])$/.exec(r);if(a)return `Heading${a[1]}`;let i=lc.get(r);if(i!==void 0)return i}if(e.classList.contains("docx-outline"))return;let n=t?/^h([1-6])$/.exec(tt(e)):null;return n?`Heading${n[1]}`:void 0}var ny=262144,pT=4096,mT=256,gT=2048,hT=8,yT=new Set(["MsoNormal",...lc.keys(),...Array.from({length:9},(e,t)=>`MsoHeading${t+1}`),...Array.from({length:9},(e,t)=>`Heading${t+1}`)]),bT=new Map([["left","left"],["start","left"],["center","center"],["right","right"],["end","right"],["justify","both"]]),vT=/^\s*(p|li|div)\.([A-Za-z][A-Za-z0-9]{0,31})\s*$/i;function xT(e){let t="";for(let n=0;n<e.length;n+=1){if(e.startsWith("<!--",n)){n+=3;continue}if(e.startsWith("-->",n)){n+=2;continue}t+=e[n];}return t}function ST(e,t){let n=0;for(let r=t;r<e.length;r+=1){let o=e[r];if(o==="{"){if(n+=1,n>4)return null}else if(o==="}"&&(n-=1,n===0))return r+1}return null}function wT(e,t){for(let n=t+1;n<e.length;n+=1){let r=e[n];if(r===";")return n+1;if(r==="{")return ST(e,n)}return null}function IT(e){let t=e.split(",");if(t.length===0||t.length>hT)return null;let n=[];for(let r of t){let o=vT.exec(r);if(!o)return null;let a=o[2];if(!yT.has(a))return null;n.includes(a)||n.push(a);}return n}function kT(e){let t;for(let n of e.split(";")){let r=n.indexOf(":");if(r<=0||n.slice(0,r).trim().toLowerCase()!=="text-align")continue;let a=n.slice(r+1).trim().toLowerCase();if(a.length===0||a.length>32||a.includes("("))continue;let i=0;for(;i<a.length&&a.charCodeAt(i)>32;)i+=1;let s=bT.get(a.slice(0,i));s!==void 0&&(t=s);}return t}function TT(e){let t=new Map,n=()=>({ok:false,alignments:new Map});if(e.length===0)return {ok:true,alignments:t};if(e.length>ny)return n();let r=xT(e),o=0,a=0;for(;o<r.length&&a<pT;){for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;if(o>=r.length)break;if(r[o]==="@"){let p=wT(r,o);if(p===null)return n();o=p;continue}let i=r.indexOf("{",o);if(i<0)return n();let s=r.slice(o,i),l=r.indexOf("}",i+1);if(l<0)return n();let d=r.slice(i+1,l);if(a+=1,o=l+1,s.length>mT||d.length>gT||d.includes("{"))return n();let u=IT(s),f=kT(d);if(!(!u||f===void 0))for(let p of u)t.set(p,f);}for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;return o<r.length?n():{ok:true,alignments:t}}function ry(e){let t=new Map,n=e.getElementsByTagName("style");if(n.length>16)return new Map;for(let r=0;r<n.length;r+=1){let o=n[r]?.textContent??"";if(o.length>ny)return new Map;let a=TT(o);if(!a.ok)return new Map;for(let[i,s]of a.alignments)t.set(i,s);}return t}var PT=262144;function oy(e,t=PT){let n=e.getElementsByTagName("style"),r="";for(let o=0;o<n.length&&o<16;o+=1){let a=n[o]?.textContent??"";a.length>t||r.length+a.length>t||(r+=`
3
+ ${a}`);}return r}function ay(e,t,n){for(let o of t.classList){let a=n.get(o);if(a!==void 0){e.jc=a;break}}let r=t.getAttribute("align")?.trim().toLowerCase();r==="left"||r==="center"||r==="right"?e.jc=r:r==="justify"&&(e.jc="both");}function uc(e,t,n,r){let o=it(t.get(n)??"");if(o!==null&&o>0)return o/.75;let a=e.getAttribute(n)?.trim()??"";if(!/^[1-9]\d{0,4}$/.test(a))return null;let i=Number.parseInt(a,10);return r?i/.75:i}function ko(e){return e.nodeType===1}function tt(e){return e.tagName.toLowerCase()}var CT=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 aqua:00FFFF cyan:00FFFF fuchsia:FF00FF magenta:FF00FF lime:00FF00 olive:808000 windowtext:000000".split(" ").map(e=>e.split(":"))),RT=new Map([["yellow","yellow"],["aqua","cyan"],["cyan","cyan"],["fuchsia","magenta"],["magenta","magenta"],["lime","green"],["green","green"],["olive","darkYellow"],["red","red"],["blue","blue"],["black","black"],["white","white"],["darkblue","darkBlue"],["darkcyan","darkCyan"],["darkgray","darkGray"],["darkgrey","darkGray"],["darkgreen","darkGreen"],["darkmagenta","darkMagenta"],["darkred","darkRed"],["darkyellow","darkYellow"],["lightgray","lightGray"],["lightgrey","lightGray"]]),ET=/url\s*\(|image\s*\(|image-set\s*\(|element\s*\(|cross-fade\s*\(/i,OT=new Map(sc.map(e=>[e.toLowerCase(),e])),Qh=new WeakMap;function Je(e){let t=Qh.get(e);if(t!==void 0)return t;let n=new Map;Qh.set(e,n);let r=e.getAttribute("style");if(!r||r.length>8192)return n;for(let o of r.split(";")){let a=o.indexOf(":");if(a<=0)continue;let i=o.slice(0,a).trim().toLowerCase(),s=o.slice(a+1).trim();i.length>0&&s.length>0&&(n.delete(i),n.set(i,s));}return n}function fr(e){let t=e.trim().toLowerCase(),n=CT.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,l]=o[1];return `${i}${i}${s}${s}${l}${l}`.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 MT(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!(t.length===0||t.length>32||/[^a-z]/.test(t)))return RT.get(t)}function Jh(e){if(e===void 0)return null;let t=e.trim();if(t.length===0||t.length>128||ET.test(t))return null;let n=t.toLowerCase();return n==="transparent"||n==="none"?null:fr(t)}function Xt(e,t,n){return Math.min(n,Math.max(t,e))}function Ss(e){let t=null;for(let[n,r]of e)if(n==="background")t=Jh(r);else if(n==="background-color"){let o=r.trim().toLowerCase();if(o==="transparent"||o==="none"||o==="initial"){t=null;continue}let a=Jh(r);a!==null&&(t=a);}return t}var FT=new Set(["left","center","right","decimal","bar"]),AT=new Map([["dotted","dot"],["dot","dot"],["dashed","hyphen"],["hyphen","hyphen"],["lined","underscore"],["underscore","underscore"],["middledot","middleDot"],["heavy","heavy"]]);function LT(e){if(e===void 0||e.length===0||e.length>512)return;let t="left",n,r=[];for(let o of e.trim().toLowerCase().split(/\s+/)){if(FT.has(o)){t=o;continue}if(o==="list"){t="left";continue}let a=AT.get(o);if(a!==void 0){n=a;continue}let i=it(o);if(!(i===null||i<0)){if(r.push({val:t,posTwips:Xt(Math.round(i*20),0,31680),...n===void 0?{}:{leader:n}}),r.length>=32)break;t="left",n=void 0;}}return r.length>0?r:void 0}var NT=new Map([["solid","single"],["single","single"],["double","double"],["dotted","dotted"],["dashed","dashed"]]);function fc(e){return e.trim().replace(/\([^)]*\)/g,t=>t.replace(/\s+/g,"")).split(/\s+/)}var DT=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function xs(e){if(e===void 0||e.length===0||e.length>128)return;let t,n=false,r,o;for(let a of fc(e)){let i=a.toLowerCase();if(i==="none"||i==="hidden"){n=true;continue}let s=NT.get(i);if(s!==void 0){t=s;continue}let l=DT.get(a.toLowerCase())??it(a);if(l!==null){r=l;continue}let d=fr(a);if(d!==null){o=d;continue}return}if(n)return "suppressed";if(t!==void 0)return r===void 0?{val:t,szEighthPoints:4,color:o??"000000"}:r<=0?"suppressed":{val:t,szEighthPoints:Xt(Math.round(r*8),2,96),color:o??"000000"}}function ws(e){let t=e.getAttribute("style");return t?/mso-list\s*:[^;]{0,128}ignore/i.test(t.slice(0,8192)):false}function pc(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 mc(e,t){if(t.size===0)return e;let n={...e},r=t.get("font-weight")?.toLowerCase();if(r!==void 0){let k=Number.parseInt(r,10);r==="bold"||k>=600?n.bold=true:(r==="normal"||k<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=t.get("font-variant")?.toLowerCase();i!==void 0&&(i.includes("small-caps")?n.smallCaps=true:(i.includes("normal")||i.includes("none"))&&(n.smallCaps=false));let s=t.get("text-transform")?.trim().toLowerCase();s==="uppercase"?n.caps=true:s==="none"&&(n.caps=false);let l=t.get("text-underline");if(l!==void 0&&l.length<=128)for(let k of l.trim().split(/\s+/)){let C=k.toLowerCase(),T=OT.get(C);if(T!==void 0)n.underline=true,n.underlineVal=T;else {let A=fr(k);A!==null&&(n.underlineColor=A);}}let d=t.get("text-decoration-style")?.trim().toLowerCase();if(d==="double"&&n.strike&&!n.underline&&(n.doubleStrike=true),n.underline){d==="double"?n.underlineVal="double":d==="dotted"?n.underlineVal="dotted":d==="dashed"?n.underlineVal="dash":d==="wavy"&&(n.underlineVal="wave");let k=fr(t.get("text-decoration-color")??"");k!==null&&(n.underlineColor=k);}let u=fr(t.get("color")??"");u&&(n.color=u);let f=MT(t.get("mso-highlight"));if(f)n.highlight=f,delete n.shdFill;else {let k=Ss(t);k&&(n.shdFill=k);}let p=it(t.get("font-size")??"");p!==null&&p>0&&(n.szHalfPoints=Xt(Math.round(p*2),2,3276));let m=t.get("font-family");if(m!==void 0){let k=m.split(",")[0].trim().replace(/^['"]|['"]$/g,"");k.length>0&&k.length<=64&&(n.font=k);}let h=it(t.get("letter-spacing")??"");h!==null&&(n.charSpacingTwentieths=Xt(Math.round(h*20),-31680,31680));let x=t.get("vertical-align")?.trim().toLowerCase();x==="sub"?n.vertAlign="subscript":x==="super"&&(n.vertAlign="superscript");let v=qr(t.get("mso-ansi-language")),b=qr(t.get("mso-fareast-language")),I=qr(t.get("mso-bidi-language"));return v!==null&&(n.langVal=v),b!==null&&(n.langEastAsia=b),I!==null&&(n.langBidi=I),t.get("direction")?.trim().toLowerCase()==="rtl"&&(n.rtl=true),n}function qa(e,t){let n=mc(e,Je(t)),r=qr(t.getAttribute("lang"));return r!==null&&(n={...n,lang:r}),t.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(n={...n,rtl:true}),n}function iy(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"),t.get("direction")?.trim().toLowerCase()==="rtl"&&(e.bidi=true);let r={top:null,right:null,bottom:null,left:null},o=t.get("margin");if(o!==void 0&&o.length<=128){let b=o.trim().split(/\s+/).map(I=>it(I));if(b.length>=1&&b.length<=4&&!b.some(I=>I===null)){let[I,k=I,C=I,T=k]=b.length===2?[b[0],b[1],b[0],b[1]]:b.length===3?[b[0],b[1],b[2],b[1]]:b;r.top=I??null,r.right=k??null,r.bottom=C??null,r.left=T??null;}}let a=it(t.get("margin-left")??"")??r.left;a!==null&&(a>0||a===0&&!e.numPr)&&(e.indLeftTwips=Xt(Math.round(a*20),0,31680));let i=it(t.get("margin-right")??"")??r.right;i!==null&&i>=0&&(e.indRightTwips=Xt(Math.round(i*20),0,31680));let s=it(t.get("text-indent")??"");if(s!==null&&s!==0){let b=Xt(Math.round(s*20),-31680,31680);b!==0&&(e.firstLineTwips=b);}let l=it(t.get("margin-top")??"")??r.top;l!==null&&l>=0&&(e.spacingBeforeTwips=Xt(Math.round(l*20),0,31680));let d=it(t.get("margin-bottom")??"")??r.bottom;d!==null&&d>=0&&(e.spacingAfterTwips=Xt(Math.round(d*20),0,31680));let u=t.get("line-height")?.trim()??"",f=t.get("mso-line-height-rule")?.trim().toLowerCase(),p=it(u);if(p!==null&&p>0)e.lineTwentieths=Xt(Math.round(p*20),24,31680),e.lineRule=f==="exactly"?"exact":"atLeast";else if(/^\d+(\.\d+)?$/.test(u)&&Number.parseFloat(u)>0)e.lineTwentieths=Xt(Math.round(240*Number.parseFloat(u)),24,9600),e.lineRule="auto";else if(/^\d+(\.\d+)?%$/.test(u)){let b=Number.parseFloat(u);b>0&&(e.lineTwentieths=Xt(Math.round(2.4*b),24,9600),e.lineRule="auto");}(t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page")&&(e.pageBreakBefore=true),t.get("page-break-after")?.trim().toLowerCase()==="avoid"&&(e.keepNext=true),t.get("page-break-inside")?.trim().toLowerCase()==="avoid"&&(e.keepLines=true),(/^[2-9]\d?$/.test(t.get("widows")?.trim()??"")||/^[2-9]\d?$/.test(t.get("orphans")?.trim()??""))&&(e.widowControl=true);let m=Ss(t);m&&(e.shdFill=m);let h=LT(t.get("tab-stops"));h!==void 0&&(e.tabs=h);let x=xs(t.get("mso-border-alt"))??xs(t.get("border")),v={};for(let b of ["top","left","bottom","right"]){let I=xs(t.get(`mso-border-${b}-alt`))??xs(t.get(`border-${b}`))??x;I!==void 0&&I!=="suppressed"&&(v[b]=I);}Object.keys(v).length>0&&(e.borders=v);}var HT="http://schemas.openxmlformats.org/drawingml/2006/picture",_T=/^data:image\/(?:png|jpeg|jpg|gif|bmp|webp|svg\+xml|tiff|tif|x-emf|emf|x-wmf|wmf);base64,([A-Za-z0-9+/=]+)$/i,BT=new Map([["image/png","png"],["image/jpeg","jpeg"],["image/gif","gif"],["image/bmp","bmp"],["image/webp","webp"],["image/svg+xml","svg"],["image/tiff","tiff"],["image/x-emf","emf"],["image/x-wmf","wmf"]]);function sy(e,t,n){return Math.min(n,Math.max(t,e))}function ly(e,t,n,r){let o=e.getAttribute("src");if(o===null||o.length>n.maxImageBytes*2)return;let a=_T.exec(o);if(!a)return;let i=n.mediaBySrc.get(o),s=i===void 0?void 0:n.media.get(i),l=s??ys(a[1],n.maxImageBytes);if(l==null)return;let d=ub$1(l),u=BT.get(d);if(u===void 0)return;let f=d==="image/png"||d==="image/jpeg"||d==="image/gif"||d==="image/bmp"||d==="image/webp"?zb$1(l,d):null,p=Je(e),m=uc(e,p,"width",n.wordHtml),h=uc(e,p,"height",n.wordHtml);f!==null?m===null&&h===null?(m=f.pixelWidth*96/(f.dpiX??96),h=f.pixelHeight*96/(f.dpiY??96)):m!==null&&h===null?h=m*f.pixelHeight/f.pixelWidth:m===null&&h!==null&&(m=h*f.pixelWidth/f.pixelHeight):m!==null&&h===null?h=m*2/3:m===null&&h!==null&&(m=h*3/2);let x=m===null?381e4:sy(Math.round(m*9525),9525,3e7),v=h===null?254e4:sy(Math.round(h*9525),9525,3e7),b=s===void 0?void 0:i;b===void 0&&(n.imageCount+=1,b=`word/media/image${n.imageCount}.${u}`,n.media.set(b,l),n.mediaBySrc.set(o,b),n.mediaExtensions.has(u)||n.mediaExtensions.set(u,d));let I=r(b.replace("word/",""));n.docPrId+=1,t.push(`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${x}" cy="${v}"/><wp:docPr id="${n.docPrId}" name=""/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${HT}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="" descr=""/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${I}"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${x}" cy="${v}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`);}var $T="http://schemas.openxmlformats.org/wordprocessingml/2006/main",qT='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',dy=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}];function cy(e,t,n){let r=720*(n+1);if(e==="bullet"){let a=dy[n%dy.length];return `<w:lvl w:ilvl="${n}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${N(a.text)}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${r}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${a.font}" w:hAnsi="${a.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=e==="lowerRoman"||e==="upperRoman";return `<w:lvl w:ilvl="${n}"><w:start w:val="${t}"/><w:numFmt w:val="${e}"/><w:lvlText w:val="%${n+1}."/><w:lvlJc w:val="${o?"right":"left"}"/><w:pPr><w:ind w:left="${r}" w:hanging="${o?180:360}"/></w:pPr></w:lvl>`}var ZT=new Map([["i",1],["v",5],["x",10],["l",50],["c",100],["d",500],["m",1e3]]),KT=new Map([["alpha-lower","lowerLetter"],["alpha-upper","upperLetter"],["roman-lower","lowerRoman"],["roman-upper","upperRoman"],["bullet","bullet"],["image","bullet"],["decimal","decimal"],["arabic","decimal"]]),uy=/@list\s+l(\d{1,4}):level([1-9])(?:[\s:]+lfo(\d{1,4}))?\s*\{([^{}]{0,2048})\}/g;function fy(e){let t=new Map;if(e.length===0||e.length>262200)return t;uy.lastIndex=0;let n,r=0;for(;(n=uy.exec(e))!==null&&r<512;){r+=1;let o="decimal",a=null;for(let s of n[4].split(";")){let l=s.indexOf(":");if(l<=0)continue;let d=s.slice(0,l).trim().toLowerCase(),u=s.slice(l+1).trim().toLowerCase();d==="mso-level-number-format"?o=KT.get(u)??null:d==="mso-level-start-at"&&/^\d{1,5}$/.test(u)&&(a=Math.min(32767,Number.parseInt(u,10)));}if(o===null)continue;let i=n[3]===void 0?`l${n[1]}:level${n[2]}`:`l${n[1]}:level${n[2]}:lfo${n[3]}`;t.has(i)||t.set(i,{kind:o,start:a});}return t}function py(e,t){let n=e.trim().replace(/^\(/,"");if(t==="decimal"){let r=/^(\d{1,5}(?:\.\d{1,5})*)/.exec(n);if(!r)return null;let o=r[1].split(".");return Math.min(32767,Number.parseInt(o[o.length-1],10))}if(t==="lowerRoman"||t==="upperRoman"){let r=/^([A-Za-z]{1,8})/.exec(n);return r?my(r[1]):null}if(t==="lowerLetter"||t==="upperLetter"){let r=/^(([A-Za-z])\2{0,4})(?![A-Za-z])/.exec(n);if(!r)return null;let o=r[2].toLowerCase().charCodeAt(0);return Math.min(32767,(r[1].length-1)*26+(o-96))}return null}var VT=/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/;function my(e){let t=e.toLowerCase();if(!VT.test(t))return null;let n=0,r=0;for(let o of t){let a=ZT.get(o);if(a===void 0)return null;n+=a,r>0&&r<a&&(n-=2*r),r=a;}return n>0&&n<=32767?n:null}function gy(e){let t=e.trim().replace(/^\(/,""),n=/^(\d{1,5}(?:\.\d{1,5})*)[.)]/.exec(t);if(n){let i=n[1].split(".");return {kind:"decimal",start:Math.min(32767,Number.parseInt(i[i.length-1],10))}}let r=/^([A-Za-z])[.)]/.exec(t);if(r){let i=r[1].toLowerCase();if(i==="i"||i==="v"||i==="x"){let l=i==="i"?1:i==="v"?5:10;return {kind:r[1]===i?"lowerRoman":"upperRoman",start:l}}let s=r[1].charCodeAt(0);return s>=97?{kind:"lowerLetter",start:s-96}:{kind:"upperLetter",start:s-64}}let o=/^([A-Za-z]{2,8})[.)]/.exec(t);if(o){let i=o[1],s=i===i.toLowerCase(),l=/^([A-Za-z])\1+$/.test(i);if(!l||/^[iI]+$/.test(i)){let d=my(i);if(d!==null)return {kind:s?"lowerRoman":"upperRoman",start:d}}if(l){let d=i.toLowerCase().charCodeAt(0),u=Math.min(32767,(i.length-1)*26+(d-96));return {kind:s?"lowerLetter":"upperLetter",start:u}}}let a=/\d{1,5}/.exec(t);return a?{kind:"decimal",start:Math.min(32767,Number.parseInt(a[0],10))}:{kind:"bullet",start:1}}var zT=new Map([["none","none"],["decimal","decimal"],["upper-alpha","upperLetter"],["upper-latin","upperLetter"],["lower-alpha","lowerLetter"],["lower-latin","lowerLetter"],["upper-roman","upperRoman"],["lower-roman","lowerRoman"]]);function hy(e){if(e.localName.toLowerCase()!=="ol")return "bullet";let t=Je(e).get("list-style-type")?.trim().toLowerCase(),n=t===void 0?void 0:zT.get(t);if(n!==void 0)return n;let r=e.getAttribute("type");return r==="A"?"upperLetter":r==="a"?"lowerLetter":r==="I"?"upperRoman":r==="i"?"lowerRoman":"decimal"}function gc(e){let t=e.getAttribute("start")?.trim();return t!==void 0&&/^\d{1,5}$/.test(t)?Math.min(32767,Number.parseInt(t,10)):1}function yy(e){let t=e.map((r,o)=>{let a=r.levels.get(0)??r.levels.values().next().value??{kind:"decimal"},i=Array.from({length:9},(s,l)=>{let d=r.levels.get(l);return d?cy(d.kind,d.start,l):cy(a.kind==="bullet"?"bullet":"decimal",1,l)}).join("");return `<w:abstractNum w:abstractNumId="${o}"><w:multiLevelType w:val="hybridMultilevel"/>${i}</w:abstractNum>`}).join(""),n=e.map((r,o)=>`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${o}"/></w:num>`).join("");return `${qT}<w:numbering xmlns:w="${$T}">${t}${n}</w:numbering>`}function fn(e){if(e==null)return null;let t=e.trim();if(t.length===0||t.length>256)return null;if(/^[A-Za-z_][A-Za-z0-9_]{0,39}$/.test(t))return t;let n=t.replace(/[^A-Za-z0-9_]/g,"_");if(n.replace(/_/g,"").length===0)return null;let r=5381;for(let i=0;i<t.length;i+=1)r=(Math.imul(r,33)^t.charCodeAt(i))>>>0;let o=`_${r.toString(36)}`,a=n.slice(0,40-o.length);return /^[A-Za-z_]/.test(a)||(a=`_${a.slice(0,39-o.length)}`),`${a}${o}`}function by(e){if(e===null)return false;if(e.startsWith("#"))return fn(e.slice(1))!==null;let t=L(e);return t?.ok===true&&t.href.length>0}function vy(e,t){if(e!==void 0&&e.startsWith("#")){let o=fn(e.slice(1)),a=fn(t)??o;return a===null?null:`#${a}`}let n=e===void 0?null:L(e),r=fn(t);return n?.ok===true&&n.href.length>0?r===null?n.href:`${n.href.split("#")[0]}#${r}`:r===null?null:`#${r}`}function xy(){let e=null;return (t,n,r)=>{if(e!==null&&e.html===t&&e.key===n){let i=e.value;return e=null,i}let o=r(),a={html:t,key:n,value:o};return e=a,setTimeout(()=>{e===a&&(e=null);},0),o}}var jT=/^(ftn|edn)([1-9]\d{0,9})$/i,WT={footnote:"ftn",endnote:"edn"};function Sy(e,t){let n=e===null?null:jT.exec(e);if(!n||n[1].toLowerCase()!==WT[t])return null;let r=Number.parseInt(n[2],10);return r<=2147483647?r:null}function hc(e){for(let t of ["footnote","endnote"]){let n=e.get(`mso-${t}-id`),r=Sy(n??null,t);if(r!==null)return {kind:t,id:r}}return null}function UT(e,t){let n=t.get("mso-element")?.trim().toLowerCase();if(n!=="footnote"&&n!=="endnote")return null;let r=Sy(e.getAttribute("id"),n);return r===null?null:{kind:n,id:r}}function wy(e){let t=[],n=e.getElementsByTagName("div");for(let r=0;r<n.length&&t.length<2048;r+=1){let o=n[r],a=UT(o,Je(o));a!==null&&t.push({...a,element:o});}return t}function Iy(e,t,n){let r=new Map(t.map(i=>[i.element,i])),o=i=>{let s=i.parentElement;for(let l=0;s!==null&&l<128;l+=1){let d=r.get(s);if(d!==void 0)return d;s=s.parentElement;}return null},a=e.getElementsByTagName("a");for(let i=0;i<a.length&&i<2e4;i+=1){let s=a[i],l=hc(Je(s));if(l===null)continue;let d=o(s);d!==null&&d.kind===l.kind&&d.id===l.id||n[l.kind].add(l.id);}}function ky(e){let t=e.get("mso-element")?.trim().toLowerCase();return t==="footnote-list"||t==="endnote-list"}var GT=/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(footnote|endnote)Reference w:id="(\d{1,10})"\/><\/w:r>/g;function To(e,t,n){return e.replace(GT,(r,o,a)=>{let i=`${o}:${a}`;return t.has(i)?n?.get(i)??"":r})}function yc(e,t){let n="";for(let[r,o]of t)n+=`<w:${e} w:id="${r}">${o.join("")}</w:${e}>`;return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${e}s xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">${n}</w:${e}s>`}function Ty(e,t,n,r){let o=new Set,a={footnote:new Set,endnote:new Set},i=()=>{a.footnote.clear(),a.endnote.clear();let s=[],l=(d,u)=>{o.has(`${d}:${u}`)||!e.notes[d].has(u)||a[d].has(u)||(a[d].add(u),s.push({kind:d,id:u}));};for(let d of ["footnote","endnote"])for(let u of e.bodyNoteRefs[d])l(d,u);for(let d of o)for(let u of e.noteNoteRefs.get(d)??[])l(u.kind,u.id);for(;s.length>0;){let d=s.pop();for(let u of e.noteNoteRefs.get(`${d.kind}:${d.id}`)??[])l(u.kind,u.id);}};for(;;){i();let s=false;for(let l of ["footnote","endnote"]){for(let d of e.notes[l].keys()){let u=`${l}:${d}`;if(!(a[l].has(d)||o.has(u))){o.add(u),s=true;break}}if(s)break}if(!s)break}if(o.size>0)for(let s of ["footnote","endnote"])for(let[l,d]of e.notes[s])o.has(`${s}:${l}`)||e.notes[s].set(l,d.map(u=>To(u,o,e.noteMarkFallbacks)));for(let s of ["footnote","endnote"])for(let[l,d]of [...e.notes[s]]){if(!o.has(`${s}:${l}`))continue;e.notes[s].delete(l),t[s].delete(l);let u=new Map;for(let f of d){let p=To(f.replace(/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(?:footnote|endnote)Ref\/><\/w:r>/g,""),o,e.noteMarkFallbacks).replace(/ r:(id|embed)="([^"]{1,32})"/g,(m,h,x)=>{let v=u.get(x);if(v===void 0){let b=e.noteRels[s].find(I=>I.id===x);if(b===void 0)return m;v=r(e,b.type,b.target,b.external),u.set(x,v);}return ` r:${h}="${v}"`});n.push(p),e.lastMarkCovered=false;}}}function bc(e,t,n,r=1,o=0){let a=e.lists.get(t);if(a)return a.levels.has(o)||a.levels.set(o,{kind:n,start:r}),a.numId;let i=String(1001+e.lists.size),s={numId:i,levels:new Map([[o,{kind:n,start:r}]])};return e.lists.set(t,s),e.listsByNumId.set(i,s),i}function Py(e,t,n,r){let o=t.get("mso-list");if(o===void 0)return;let a=/\bl(\d{1,4})\s+level(\d{1,2})\b/i.exec(o);if(!a)return;let i=Math.min(Math.max(Number.parseInt(a[2],10)-1,0),8),s=XT(e,n),l=/\blfo(\d{1,4})\b/i.exec(o),d=(l!==null?n.listDefinitions.get(`l${a[1]}:level${a[2]}:lfo${l[1]}`):void 0)??n.listDefinitions.get(`l${a[1]}:level${a[2]}`),u,f;d!==void 0?(u=d.kind,f=py(s,u)??d.start??1):{kind:u,start:f}=gy(s);let m=`mso:${r===void 0?"":`${r.kind}${r.id}:`}l${a[1]}${l?`:lfo${l[1]}`:""}`;return {numId:bc(n,m,u,f,i),ilvl:i}}function XT(e,t){let n="",r=(o,a)=>{if(!(n.length>0||a>8||t.nodesLeft<=0)&&ko(o)){if(ws(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}var YT="http://schemas.openxmlformats.org/package/2006/relationships",QT="http://schemas.openxmlformats.org/package/2006/content-types",JT="application/vnd.openxmlformats-package.relationships+xml",Sc='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',eP="http://schemas.openxmlformats.org/wordprocessingml/2006/main",xc="http://schemas.openxmlformats.org/officeDocument/2006/relationships",tP="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",nP="http://schemas.openxmlformats.org/drawingml/2006/main",rP="http://schemas.openxmlformats.org/drawingml/2006/picture",Cy={document:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",numbering:"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",footnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",endnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"};function vc(e){let t=e.map(n=>`<Relationship Id="${N(n.id)}" Type="${N(n.type)}" Target="${N(n.target)}"${n.external?' TargetMode="External"':""}/>`).join("");return `${Sc}<Relationships xmlns="${YT}">${t}</Relationships>`}function oP(e){let t=new Map;t.set("word/document.xml",Sa$1(e.documentXml)),t.set("word/_rels/document.xml.rels",Sa$1(vc(e.rels))),t.set("_rels/.rels",Sa$1(vc([{id:"rId1",type:`${xc}/officeDocument`,target:"word/document.xml",external:false}])));let n=[["numbering",e.numberingXml],["footnotes",e.footnotesXml],["endnotes",e.endnotesXml]],r=`<Override PartName="/word/document.xml" ContentType="${Cy.document}"/>`;for(let[a,i]of n)i!==void 0&&(t.set(`word/${a}.xml`,Sa$1(i)),r+=`<Override PartName="/word/${a}.xml" ContentType="${Cy[a]}"/>`);for(let[a,i]of [["footnotes",e.footnotesRels],["endnotes",e.endnotesRels]])i!==void 0&&i.length>0&&t.set(`word/_rels/${a}.xml.rels`,Sa$1(vc(i)));for(let[a,i]of e.media)t.set(a,i);let o=`<Default Extension="rels" ContentType="${JT}"/><Default Extension="xml" ContentType="application/xml"/>`;for(let[a,i]of e.mediaExtensions)o+=`<Default Extension="${N(a)}" ContentType="${N(i)}"/>`;return t.set("[Content_Types].xml",Sa$1(`${Sc}<Types xmlns="${QT}">${o}${r}</Types>`)),Ra(t)}function Ry(e){let t=[...e.rels],n=o=>{t.push({id:`rId${t.length+1}`,type:`${xc}/${o}`,target:`${o}.xml`,external:false});};e.lists.length>0&&n("numbering");for(let o of ["footnote","endnote"])e.notes[o].size>0&&n(`${o}s`);let r=`${Sc}<w:document xmlns:w="${eP}" xmlns:r="${xc}" xmlns:wp="${tP}" xmlns:a="${nP}" xmlns:pic="${rP}"><w:body>${e.blocks.join("")}</w:body></w:document>`;return oP({documentXml:r,rels:t,...e.lists.length>0?{numberingXml:yy(e.lists)}:{},...e.notes.footnote.size>0?{footnotesXml:yc("footnote",e.notes.footnote),footnotesRels:e.noteRels.footnote}:{},...e.notes.endnote.size>0?{endnotesXml:yc("endnote",e.notes.endnote),endnotesRels:e.noteRels.endnote}:{},media:e.media,mediaExtensions:e.mediaExtensions})}function wc(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 pr(e){let t="";if(e.rStyle!==void 0&&(t+=`<w:rStyle w:val="${N(e.rStyle)}"/>`),e.font!==void 0){let i=N(wc(e.font));t+=e.rtl?`<w:rFonts w:cs="${i}"/>`:`<w:rFonts w:ascii="${i}" w:hAnsi="${i}"/>`;}e.bold?t+="<w:b/>":e.bold===false&&(t+='<w:b w:val="0"/>'),e.italic?t+="<w:i/>":e.italic===false&&(t+='<w:i w:val="0"/>'),e.caps?t+="<w:caps/>":e.caps===false&&(t+='<w:caps w:val="0"/>'),e.smallCaps?t+="<w:smallCaps/>":e.smallCaps===false&&(t+='<w:smallCaps w:val="0"/>'),e.doubleStrike?t+="<w:dstrike/>":e.strike?t+="<w:strike/>":e.strike===false&&(t+='<w:strike w:val="0"/>'),e.color!==void 0&&(t+=`<w:color w:val="${e.color}"/>`),e.charSpacingTwentieths!==void 0&&(t+=`<w:spacing w:val="${e.charSpacingTwentieths}"/>`),e.szHalfPoints!==void 0&&(t+=`<w:sz w:val="${e.szHalfPoints}"/>`),e.highlight!==void 0&&(t+=`<w:highlight w:val="${N(e.highlight)}"/>`),e.underline?t+=`<w:u w:val="${e.underlineVal??"single"}"${e.underlineColor===void 0?"":` w:color="${e.underlineColor}"`}/>`:e.underline===false&&(t+='<w:u w:val="none"/>'),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}"/>`),e.rtl&&(t+="<w:rtl/>");let n=e.langVal,r=e.langEastAsia,o=e.langBidi;e.lang!==void 0&&(e.rtl?o??=e.lang:/^(?:zh|ja|ko)(?:-|$)/i.test(e.lang)?r??=e.lang:n??=e.lang);let a=`${n===void 0?"":` w:val="${N(n)}"`}${r===void 0?"":` w:eastAsia="${N(r)}"`}${o===void 0?"":` w:bidi="${N(o)}"`}`;return a.length>0&&(t+=`<w:lang${a}/>`),t.length>0?`<w:rPr>${t}</w:rPr>`:""}function Is(e,t){return `<w:r>${pr(t)}<w:t xml:space="preserve">${M(wc(e))}</w:t></w:r>`}function aP(e){let t="";if(e.styleId!==void 0&&(t+=`<w:pStyle w:val="${N(e.styleId)}"/>`),e.keepNext&&(t+="<w:keepNext/>"),e.keepLines&&(t+="<w:keepLines/>"),e.pageBreakBefore&&(t+="<w:pageBreakBefore/>"),e.widowControl&&(t+="<w:widowControl/>"),e.numPr&&(t+=`<w:numPr><w:ilvl w:val="${e.numPr.ilvl}"/><w:numId w:val="${N(e.numPr.numId)}"/></w:numPr>`),e.borders!==void 0){let r="";for(let o of ["top","left","bottom","right"]){let a=e.borders[o];a!==void 0&&(r+=`<w:${o} w:val="${a.val}" w:sz="${a.szEighthPoints}" w:space="0" w:color="${a.color}"/>`);}r.length>0&&(t+=`<w:pBdr>${r}</w:pBdr>`);}if(e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.tabs!==void 0&&e.tabs.length>0&&(t+=`<w:tabs>${e.tabs.map(r=>`<w:tab w:val="${r.val}" w:pos="${r.posTwips}"`+(r.leader===void 0?"/>":` w:leader="${r.leader}"/>`)).join("")}</w:tabs>`),e.bidi&&(t+="<w:bidi/>"),e.spacingBeforeTwips!==void 0||e.spacingAfterTwips!==void 0||e.lineTwentieths!==void 0){let r="<w:spacing";e.spacingBeforeTwips!==void 0&&(r+=` w:before="${e.spacingBeforeTwips}"`),e.spacingAfterTwips!==void 0&&(r+=` w:after="${e.spacingAfterTwips}"`),e.lineTwentieths!==void 0&&(r+=` w:line="${e.lineTwentieths}" w:lineRule="${e.lineRule??"auto"}"`),t+=`${r}/>`;}let n=e.firstLineTwips;if(e.indLeftTwips!==void 0||e.indRightTwips!==void 0||n!==void 0){let r="<w:ind";e.indLeftTwips!==void 0&&(r+=` w:left="${e.indLeftTwips}"`),e.indRightTwips!==void 0&&(r+=` w:right="${e.indRightTwips}"`),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 Kr(e,t){return `<w:p>${aP(e)}${t.join("")}</w:p>`}var Oy={h1:64,h2:52,h3:44,h4:36,h5:32,h6:28};function ks(e){let t=e[e.length-1];if(t?.endsWith("</w:p>")){e[e.length-1]=`${t.slice(0,-6)}<w:r><w:br w:type="page"/></w:r></w:p>`;return}e.push('<w:p><w:r><w:br w:type="page"/></w:r></w:p>');}var iP=/^(?:<w:bookmark(?:Start|End)\b[^>]*\/>)+$/,Ey=new WeakMap;function Ic(e){let t=Ey.get(e);for(t||(t={checked:0,furniture:true},Ey.set(e,t));t.furniture&&t.checked<e.length;)t.furniture=iP.test(e[t.checked]),t.checked+=1;return t.furniture}function pn(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var mr=31680;function Vn(e,t,n){return Math.min(n,Math.max(t,e))}function My(e){let t=it(Je(e).get("width")??"");if(t!==null&&t>0)return t;let n=e.getAttribute("width")?.trim();if(n===void 0||!/^\d{1,6}(\.\d+)?$/.test(n))return null;let r=Number.parseFloat(n);return Number.isFinite(r)&&r>0?r*.75:null}function sP(e){return Vr(e,"colspan",63)}function Fy(e){return Array.from(e.children).flatMap(t=>{let n=tt(t);return n==="tr"?[t]:n!=="thead"&&n!=="tbody"&&n!=="tfoot"?[]:Array.from(t.children).filter(r=>tt(r)==="tr")})}function Vr(e,t,n){let r=e.getAttribute(t);return r===null||!/^\d{1,4}$/.test(r.trim())?1:Vn(Number.parseInt(r,10),1,n)}function Ay(e,t){let n=(Je(e).get("width")??e.getAttribute("width")??"").trim(),r=/^(\d{1,3}(?:\.\d+)?)%$/.exec(n);if(r)return {xml:`<w:tblW w:w="${Vn(Math.round(Number.parseFloat(r[1])*50),50,5e3)}" w:type="pct"/>`,twips:t};let o=My(e);if(o===null)return {xml:'<w:tblW w:w="0" w:type="auto"/>',twips:t};let a=Vn(Math.round(o*20),1,mr);return {xml:`<w:tblW w:w="${a}" w:type="dxa"/>`,twips:a}}function Ly(e){let n=Je(e).get("mso-table-left")?.trim().toLowerCase(),r=(n==="left"||n==="center"||n==="right"?n:void 0)??e.getAttribute("align")?.trim().toLowerCase();return r==="left"||r==="center"||r==="right"?r:void 0}function Ny(e){let t=Je(e),n=t.get("mso-table-anchor-horizontal")?.trim().toLowerCase(),r=t.get("mso-table-anchor-vertical")?.trim().toLowerCase();if(n===void 0&&r===void 0)return "";let o=l=>l==="margin"||l==="page"?l:"text",a=` w:horzAnchor="${o(n)}" w:vertAnchor="${o(r)}"`,i=t.get("mso-table-left")?.trim().toLowerCase();if(i==="left"||i==="center"||i==="right")a+=` w:tblpXSpec="${i}"`;else {let l=it(i??"");l!==null&&(a+=` w:tblpX="${Vn(Math.round(l*20),-mr,mr)}"`);}let s=it(t.get("mso-table-top")??"");return s!==null&&(a+=` w:tblpY="${Vn(Math.round(s*20),-mr,mr)}"`),`<w:tblpPr${a}/>`}function Dy(e,t,n){let r=Math.max(1,Math.floor(n/t)),o=-1,a=Array.from({length:t},()=>r),i=new Array(t).fill(null);for(let u of e){let f=Array.from({length:t},()=>r),p=0,m=0,h=i.map(b=>b?b.span:null);for(let b=0;b<t;b+=1){let I=i[b];I&&(I.remaining-=1,I.remaining<=0&&(i[b]=null));}let x=Array.from(u.children).filter(b=>/^t[dh]$/.test(tt(b))),v=0;for(;m<t;){let b=h[m];if(b!==null){m+=b;continue}let I=x[v];if(I===void 0)break;v+=1;let k=Math.min(sP(I),t-m);for(let A=m+1;A<m+k;A+=1)if(h[A]!==null){k=A-m;break}let C=Vr(I,"rowspan",1e3);C>1&&(i[m]={remaining:C-1,span:k});let T=My(I);if(T!==null){let A=Vn(Math.round(T*20/k),1,mr);for(let O=0;O<k;O+=1)f[m+O]=A;p+=k;}m+=k;}p>o&&(o=p,a=f);}let s=a.reduce((u,f)=>u+f,0);if(s<=0)return a;let l=a.map(u=>Math.max(1,Math.round(u*n/s))),d=n-l.reduce((u,f)=>u+f,0);return l[l.length-1]=Math.max(1,l[l.length-1]+d),l}function kc(e,t,n){let r=0;for(let o=0;o<n;o+=1)r+=e[t+o]??0;return Math.max(1,r)}var Hy=new Map([["solid","single"],["double","double"],["dotted","dotted"],["dashed","dashed"],["none","nil"],["hidden","nil"]]),_y=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function By(e){return Vn(Math.round(e*8),2,96)}function Tn(e){if(e===void 0||e.length===0||e.length>128)return;let t,n,r;for(let o of fc(e)){let a=Hy.get(o.toLowerCase());if(a!==void 0){t=a;continue}let i=_y.get(o.toLowerCase())??it(o);if(i!==null){n=i;continue}let s=fr(o);if(s!==null){r=s;continue}return}if(t!==void 0){if(t==="nil")return {val:t,size:0,color:r??"auto"};if(n===void 0)return {val:t,size:4,color:r??"000000"};if(!(n<=0))return {val:t,size:By(n),color:r??"000000"}}}function Ts(e,t){let n=e.get(`${t}-style`)?.trim();if(n===void 0||n.length===0||n.length>64)return;let r=Hy.get(n.split(/\s+/)[0].toLowerCase());if(r===void 0)return;if(r==="nil")return {val:r,size:0,color:"auto"};let o=e.get(`${t}-width`)?.trim().split(/\s+/)[0],a=o===void 0||o.length>64?null:_y.get(o.toLowerCase())??it(o);if(a!==null&&a<=0)return;let i=e.get(`${t}-color`)?.trim().split(/\s+/)[0],s=i===void 0||i.length>64?null:fr(i);return {val:r,size:a===null?4:By(a),color:s??"000000"}}function $y(e,t){return `<w:${e} w:val="${t.val}" w:sz="${t.size}" w:space="0" w:color="${t.color}"/>`}function qy(e,t=false){let n=Je(e),o=Tn(n.get("mso-border-alt"))??Tn(n.get("border"))??Ts(n,"border")??(e.getAttribute("border")?.trim()&&e.getAttribute("border")?.trim()!=="0"?{val:"single",size:4,color:"auto"}:void 0),a=[["top","top"],["left","left"],["bottom","bottom"],["right","right"],["insideH","insideh"],["insideV","insidev"]],i="";for(let[s,l]of a){let d=pn(l,t),u=Tn(n.get(`mso-border-${d}-alt`))??Tn(n.get(`mso-border-${d}`))??Tn(n.get(`border-${d}`))??Ts(n,`border-${d}`)??o;u!==void 0&&(i+=$y(s,u));}return i.length>0?`<w:tblBorders>${i}</w:tblBorders>`:""}function Zy(e){let t=Je(e),n=it(t.get("height")??"");if(n===null||n<=0)return "";let r=Vn(Math.round(n*20),1,mr),a=t.get("mso-height-rule")?.trim().toLowerCase()==="exactly"?"exact":"atLeast";return `<w:trPr><w:trHeight w:val="${r}" w:hRule="${a}"/></w:trPr>`}function lP(e,t){let n={top:null,right:null,bottom:null,left:null},r=e.get("padding");if(r!==void 0&&r.length<=128){let a=r.trim().split(/\s+/).map(i=>it(i));if(a.length>=1&&a.length<=4&&!a.some(i=>i===null||i<0)){let[i,s=i,l=i,d=s]=a.length===2?[a[0],a[1],a[0],a[1]]:a.length===3?[a[0],a[1],a[2],a[1]]:a;n.top=i??null,n.right=s??null,n.bottom=l??null,n.left=d??null;}}for(let a of ["top","right","bottom","left"]){let i=it(e.get(`padding-${a}`)??"");i!==null&&i>=0&&(n[a]=i);}let o="";for(let a of ["top","left","bottom","right"]){let i=pn(a,t),s=n[i];s!==null&&(o+=`<w:${a} w:w="${Vn(Math.round(s*20),0,mr)}" w:type="dxa"/>`);}return o.length>0?`<w:tcMar>${o}</w:tcMar>`:""}function Ky(e,t=false){let n=Je(e),r=Tn(n.get("mso-border-alt"))??Tn(n.get("border"))??Ts(n,"border"),o="";for(let l of ["top","left","bottom","right"]){let d=pn(l,t),u=Tn(n.get(`mso-border-${d}-alt`))??Tn(n.get(`mso-border-${d}`))??Tn(n.get(`border-${d}`))??Ts(n,`border-${d}`)??r;u!==void 0&&(o+=$y(l,u));}let a=o.length>0?`<w:tcBorders>${o}</w:tcBorders>`:"",i=Ss(n);i&&(a+=`<w:shd w:val="clear" w:color="auto" w:fill="${i}"/>`),a+=lP(n,t);let s=n.get("vertical-align")?.toLowerCase()??e.getAttribute("valign")?.toLowerCase();return s==="top"?a+='<w:vAlign w:val="top"/>':s==="middle"||s==="center"?a+='<w:vAlign w:val="center"/>':s==="bottom"&&(a+='<w:vAlign w:val="bottom"/>'),a}var dP=9360;function Vy(e,t,n,r,o,a){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;for(let O of Array.from(e.children))tt(O)==="caption"&&a(Array.from(O.childNodes),t+1,n,r,o,true);let i=Fy(e);if(i.length===0)return;let s=1,l=r.nodesLeft,d=[];for(let O of i){if(l<=0||s>=63)break;let $=d.map(_=>_?_.span:null);for(let _=0;_<d.length;_+=1){let j=d[_];j&&(j.remaining-=1,j.remaining<=0&&(d[_]=null));}let y=Array.from(O.children).filter(_=>/^t[dh]$/.test(tt(_))),R=0,L=0;for(;L<63&&(l-=1,!(l<=0));){let _=L<$.length?$[L]:null;if(_!=null){L+=_;continue}let j=y[R];if(j===void 0)break;R+=1;let F=Math.min(Vr(j,"colspan",63),63-L);for(let V=L+1;V<L+F;V+=1)if(V<$.length&&$[V]!=null){F=V-L;break}let H=Vr(j,"rowspan",1e3);if(H>1){for(;d.length<=L;)d.push(null);d[L]={remaining:H-1,span:F};}L+=F;}for(let _=L;_<$.length&&_<63;_+=1){let j=$[_];j!=null&&(L=Math.max(L,_+j));}s=Math.max(s,L);}s=Math.min(Math.max(s,1),63);let u=Ay(e,dP),f=u.twips,p=i.length>r.nodesLeft?i.slice(0,Math.max(1,r.nodesLeft)):i,m=Dy(p,s,f),x=(Je(e).get("direction")??e.getAttribute("dir"))?.trim().toLowerCase()==="rtl",v=qy(e,x),b=Ny(e),I=Ly(e)??(x?"left":void 0),k=I===void 0?"":`<w:jc w:val="${pn(I,x)}"/>`,C=m.map(O=>`<w:gridCol w:w="${O}"/>`).join(""),T=new Array(s).fill(null),A=[];for(let O of i){if(r.nodesLeft<=0){r.truncated=true;break}r.nodesLeft-=1;let $=T.map(F=>F?F.span:null);for(let F=0;F<s;F+=1){let H=T[F];H&&(H.remaining-=1,H.remaining<=0&&(T[F]=null));}let y=Array.from(O.children).filter(F=>/^t[dh]$/.test(tt(F))),R=0,L=[],_=0,j=true;for(;_<s;){if(r.nodesLeft-=1,r.nodesLeft<=0){r.truncated=true,j=false;break}let F=$[_];if(F!==null){let X=F>1?`<w:gridSpan w:val="${F}"/>`:"";L.push(`<w:tc><w:tcPr><w:tcW w:w="${kc(m,_,F)}" w:type="dxa"/>${X}<w:vMerge/></w:tcPr><w:p/></w:tc>`),_+=F;continue}let H=y[R];if(H===void 0){L.push(`<w:tc><w:tcPr><w:tcW w:w="${m[_]}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`),_+=1;continue}R+=1;let V=Math.min(Vr(H,"colspan",63),s-_);for(let X=_+1;X<_+V;X+=1)if($[X]!==null){V=X-_;break}let B=Vr(H,"rowspan",1e3);B>1&&(T[_]={remaining:B-1,span:V}),L.push(cP(H,V,kc(m,_,V),B>1,t,n,r,a,x)),_+=V;}if(!j)break;A.push(`<w:tr>${Zy(O)}${L.join("")}</w:tr>`);}A.length!==0&&(o.push(`<w:tbl><w:tblPr>${x?"<w:bidiVisual/>":""}${b}${u.xml}${k}${v}</w:tblPr><w:tblGrid>${C}</w:tblGrid>${A.join("")}</w:tbl>`),r.lastMarkCovered=false);}function cP(e,t,n,r,o,a,i,s,l){let d=tt(e)==="th",u=`<w:tcW w:w="${n}" w:type="dxa"/>`;t>1&&(u+=`<w:gridSpan w:val="${t}"/>`),r&&(u+='<w:vMerge w:val="restart"/>'),u+=Ky(e,l);let f={run:d?{...a.run,bold:true}:a.run,para:d?{jc:"center"}:{},paragraphMarkCovered:false,pre:false,list:null,...a.noteBody?{noteBody:a.noteBody}:{},...a.rels?{rels:a.rels}:{}},p=[];return s(Array.from(e.childNodes),o+2,f,i,p,true),(p.length===0||p[p.length-1].endsWith("</w:tbl>"))&&p.push("<w:p/>"),`<w:tc><w:tcPr>${u}</w:tcPr>${p.join("")}</w:tc>`}function zy(e){if(e===void 0)return "";let t=e.trim();return /^\d{1,4}$/.test(t)?"<w:tab/>".repeat(Math.min(Number.parseInt(t,10),64)):""}function jy(e){let t=e.getAttribute("alignment")?.trim().toLowerCase(),n=e.getAttribute("relativeto")?.trim().toLowerCase(),r=e.getAttribute("leader")?.trim().toLowerCase();return t!=="left"&&t!=="center"&&t!=="right"||n!=="margin"&&n!=="indent"||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middledot"?"":`<w:ptab w:alignment="${t}" w:relativeTo="${n}" w:leader="${r==="middledot"?"middleDot":r}"/>`}function Wy(e){if(tt(e)!=="br")return false;let t=Je(e);return t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page"}function Uy(e){if(Wy(e))return true;if(tt(e)!=="span"||e.childNodes.length>8)return false;let t=false;for(let n=0;n<e.childNodes.length;n+=1){let r=e.childNodes[n];if(!(r.nodeType===3&&(r.nodeValue??"").trim().length===0)){if(r.nodeType!==1||t||!Wy(r))return false;t=true;}}return t}function Gy(e){if(tt(e)!=="p")return false;let t=null;for(let o=0;o<e.childNodes.length;o+=1){let a=e.childNodes[o];if(a.nodeType===3){if((a.nodeValue??"").replace(/[\s\u00a0]/g,"").length===0)continue;return false}if(a.nodeType!==1||t!==null)return false;t=a;}if(t===null)return false;let n=Je(e);for(let o of n.keys())if(o==="background"||o==="background-color"||o.startsWith("border"))return false;if(tt(t)!=="o:p"||t.childNodes.length>3)return false;let r="";for(let o=0;o<t.childNodes.length;o+=1){let a=t.childNodes[o];if(a.nodeType!==3)return false;r+=a.nodeValue??"";}return r.includes("\xA0")&&r.replace(/[\s\u00a0]/g,"").length===0}function Tc(e){let t=0,n=e.parentElement;for(;n!==null&&t<256;)t+=1,n=n.parentElement;return t}var Pc=new Set("script style head template iframe object embed noscript svg math meta link title base select textarea hr w:sdtpr".split(" ")),Cc=new Set("p div h1 h2 h3 h4 h5 h6 li blockquote pre".split(" ")),Rc=new Set("thead tbody tfoot tr section article main header footer aside nav figure form body html".split(" ")),uP=new Set([...Cc,...Rc,"table","ol","ul","w:sdt"]);function Ec(e){for(let t=0;t<e.children.length;t+=1)if(uP.has(tt(e.children[t])))return true;return false}var fP=new Set(["p","div","table","ol","ul","section","article","main","h1","h2","h3","h4","h5","h6"]);function Xy(e){if(tt(e)!=="w:sdt")return null;let t=[e],n=0;for(let r=0;r<t.length&&n<64;r+=1){let o=t[r];for(let a=0;a<o.children.length&&n<64;a+=1){let i=o.children[a];n+=1;let s=tt(i);if(fP.has(s))return Array.from(e.childNodes);s!=="w:sdtpr"&&t.push(i);}}return null}var pP=4*1024*1024,mP=1e5,gP=64,hP=2*1024*1024,Yy="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function Oc(e,t,n,r,o=e.rels){let a=`rId${o.length+1}`;return o.push({id:a,type:t,target:n,external:r}),a}function Ps(e,t,n,r,o){if(o.nodesLeft<=0){o.truncated=true;return}if(t>o.maxDepth)return;if(o.nodesLeft-=1,e.nodeType===3){let h=e.nodeValue??"";if(n.pre){let v=h.replace(/\r\n?/g,`
4
+ `).split(`
5
+ `);for(let b=0;b<v.length;b+=1){if(b>0){if(o.nodesLeft-=1,o.nodesLeft<=0){o.truncated=true;return}r.push(`<w:r>${pr(n.run)}<w:br/></w:r>`);}let I=v[b];I.length>0&&r.push(Is(I,n.run));}return}let x=h.replace(/[ \t\r\n\f\v]+/g," ");if(x.length===0||x===" "&&Ic(r))return;r.push(Is(x,n.run));return}if(!ko(e))return;let a=tt(e);if(Pc.has(a))return;let i=Je(e);if(ws(e)&&n.para.numPr!==void 0||i.get("mso-element")?.trim().toLowerCase()==="comment-reference"||i.get("mso-special-character")?.trim().toLowerCase()==="comment"||e.classList.contains("msocomanchor")||o.definedNoteElements.has(e))return;if(a==="w:ptab"){let h=jy(e);h.length>0&&r.push(`<w:r>${pr(n.run)}${h}</w:r>`);return}let l=zy(i.get("mso-tab-count"));if(l.length>0){if(o.nodesLeft-=l.split("<w:tab/>").length-2,o.nodesLeft<=0){o.truncated=true;return}let h=mc(pc(n.run,a),i);if(r.push(`<w:r>${pr(h)}${l}</w:r>`),(e.textContent??"").trim().length===0&&e.children.length===0)return}if(a==="br"){let h=i.get("page-break-before")?.trim().toLowerCase()==="always"||i.get("break-before")?.trim().toLowerCase()==="page";r.push(`<w:r>${pr(n.run)}${h?'<w:br w:type="page"/>':"<w:br/>"}</w:r>`);return}if(a==="img"){ly(e,r,o,h=>Oc(o,`${Yy}/image`,h,false,n.rels??o.rels));return}let d=pc(n.run,a),u=a==="a"?e.getAttribute("href"):null,f=a==="a"?hc(i):null;f===null&&by(u)&&(d={...d,rStyle:"Hyperlink"});let p=qa(d,e),m={...n,run:p,pre:n.pre||a==="pre"};if(f!==null){let h={...m.run,vertAlign:"superscript"};if(n.noteBody!==void 0&&n.noteBody.kind===f.kind&&n.noteBody.id===f.id){let x=f.kind==="footnote"?"footnoteRef":"endnoteRef";r.push(`<w:r>${pr(h)}<w:${x}/></w:r>`);return}if(o.definedNotes[f.kind].has(f.id)){let x=f.kind==="footnote"?"footnoteReference":"endnoteReference";r.push(`<w:r>${pr(h)}<w:${x} w:id="${f.id}"/></w:r>`);let v=(e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim(),b=`${f.kind}:${f.id}`;if(v.length>0&&!o.noteMarkFallbacks.has(b)&&o.noteMarkFallbacks.set(b,Is(v,h)),n.noteBody===void 0)o.bodyNoteRefs[f.kind].add(f.id);else {let I=`${n.noteBody.kind}:${n.noteBody.id}`,k=o.noteNoteRefs.get(I)??[];k.push({kind:f.kind,id:f.id}),o.noteNoteRefs.set(I,k);}return}for(let x of Array.from(e.childNodes))Ps(x,t+1,m,r,o);return}if(a==="a"){let h=e.getAttribute("href"),x=fn(e.getAttribute("name")||e.getAttribute("id")),v=[];for(let k of Array.from(e.childNodes))Ps(k,t+1,m,v,o);let b=h?.startsWith("#")?fn(h.slice(1)):null,I=v.join("");if(b!==null)I=`<w:hyperlink w:anchor="${N(b)}">${I}</w:hyperlink>`;else if(h!==null&&!h.startsWith("#")){let k=L(h);k.ok&&k.href.length>0&&(I=`<w:hyperlink r:id="${Oc(o,`${Yy}/hyperlink`,k.href,true,n.rels??o.rels)}">${I}</w:hyperlink>`);}if(x!==null){let k=String(o.nextBookmarkId++);I=`<w:bookmarkStart w:id="${k}" w:name="${N(x)}"/>${I}<w:bookmarkEnd w:id="${k}"/>`;}I.length>0&&r.push(I);return}for(let h of Array.from(e.childNodes))Ps(h,t+1,m,r,o);}function Qy(e,t,n,r){let o=tt(e),a=Je(e),i={};r&&(i.pageBreakBefore=true);let s=ty(e,n.wordHtml);s!==void 0&&(i.styleId=s),t.para.numPr&&(i.numPr=t.para.numPr),t.para.jc&&(i.jc=t.para.jc),t.para.bidi&&(i.bidi=true);let l={...t.run},d=Oy[o];d!==void 0&&s===void 0&&!e.classList.contains("docx-outline")&&(l.bold=true,l.szHalfPoints=d);let u=t.pre||o==="pre";o==="pre"&&(l.font="Courier New");let f=Py(e,a,n,t.noteBody);return f&&(i.numPr=f),ay(i,e,n.classAlignments),iy(i,a),l=qa(l,e),e.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(i.bidi=true),{run:l,para:i,paragraphMarkCovered:i.styleId!==void 0||i.numPr!==void 0,pre:u,list:t.list,...t.noteBody?{noteBody:t.noteBody}:{},...t.rels?{rels:t.rels}:{}}}function Jy(e,t,n,r,o,a=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;let i=Qy(e,n,r,a);gr(Array.from(e.childNodes),t+1,i,r,o,true,void 0,false);}function eb(e,t,n,r,o,a=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;let i=hy(e);n.list||(r.semanticListCount+=1);let s=n.list?{numId:n.list.numId,level:Math.min(n.list.level+1,8)}:{numId:bc(r,`sem:${r.semanticListCount}`,i,gc(e)),level:0};if(n.list){let u=r.listsByNumId.get(s.numId);u!==void 0&&!u.levels.has(s.level)&&u.levels.set(s.level,{kind:i,start:gc(e)});}let l={...n,list:s,para:{numPr:{numId:s.numId,ilvl:s.level}}},d=a;for(let u of Array.from(e.childNodes)){if(r.nodesLeft<=0){r.truncated=true;break}if(!ko(u))continue;let f=tt(u);if(f==="li")r.nodesLeft-=1,Jy(u,t+1,l,r,o,d),d=false;else if(f==="ol"||f==="ul"){let p=o.length;eb(u,t+1,{...n,list:s},r,o,d),o.length>p&&(d=false);}}}function gr(e,t,n,r,o,a=false,i,s=true){if(t>r.maxDepth)return;let l=o.length,d=i===void 0,u=[],f=[],p=n.para,m=i??{pending:false,skipSpacer:false},h=()=>({...p,pageBreakBefore:void 0,numPr:void 0}),x=()=>{if(u.length===0)return;if(!u.some(b=>b.includes("<w:r"))){if(o.length===l){f=f.concat(u),u=[];return}let b=o[o.length-1];b?.endsWith("</w:p>")?(o[o.length-1]=`${b.slice(0,-6)}${u.join("")}</w:p>`,u=[]):b!==void 0&&u.length>0&&(o.push(Kr(h(),u)),u=[],r.lastMarkCovered=false);return}let v=m.pending?{...p,pageBreakBefore:true}:p;o.push(Kr(v,u)),p.pageBreakBefore&&(p={...p,pageBreakBefore:void 0}),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=n.paragraphMarkCovered,u=[];};for(let v of e){if(r.nodesLeft<=0){r.truncated=true;break}if(ko(v)){let b=tt(v),I=b==="w:sdt"?Xy(v):null;if(s&&Uy(v)){x(),r.nodesLeft-=1,m.pending&&ks(o),m.pending=true,m.skipSpacer=true;continue}if(Pc.has(b)){r.nodesLeft-=1;continue}let k=Je(v);if(k.get("mso-element")?.trim().toLowerCase()==="comment-list"){r.nodesLeft-=1;continue}if(ky(k)){x(),r.nodesLeft-=1,gr(Array.from(v.childNodes),t+1,n,r,o,false,m,s);continue}if(r.definedNoteElements.has(v)){r.nodesLeft-=1;continue}if(Cc.has(b)){if(x(),r.nodesLeft-=1,m.pending&&m.skipSpacer&&Gy(v)){m.skipSpacer=false;continue}if(b==="div"&&Ec(v)){let T=Qy(v,n,r,false);T.para.pageBreakBefore&&(m.pending=true),gr(Array.from(v.childNodes),t+1,T,r,o,false,m,s);continue}let C=o.length;Jy(v,t,n,r,o,m.pending),o.length>C&&(m.pending=false,m.skipSpacer=false);continue}if(b==="ol"||b==="ul"){x();let C=o.length;eb(v,t,n,r,o,m.pending),o.length>C&&(m.pending=false,m.skipSpacer=false);continue}if(b==="table"){x(),m.pending&&ks(o),yP(v,t,n,r,o),m.pending=false,m.skipSpacer=false;continue}if(Rc.has(b)||I!==null||b==="span"&&Ec(v)){x(),r.nodesLeft-=1,gr(I??Array.from(v.childNodes),t+1,n,r,o,false,m,s);continue}}if(v.nodeType===3&&/^[\s\u00a0]+$/.test(v.nodeValue??"")&&Ic(u)){r.nodesLeft-=1;continue}Ps(v,t,n,u,r);}if(a&&o.length===l&&u.length>0&&!u.some(v=>v.includes("<w:r"))&&(o.push(Kr(p,u)),u=[],r.lastMarkCovered=n.paragraphMarkCovered),x(),f.length>0){let v=o[l];v!==void 0&&v.startsWith("<w:p>")?o[l]=v.replace(/^(<w:p>(?:<w:pPr>(?:(?!<\/w:pPr>)[\s\S])*?<\/w:pPr>)?)/,`$1${f.join("")}`):v!==void 0?o.splice(l,0,Kr(h(),f)):u=f.concat(u),f=[];}u.length>0&&(o.push(Kr(h(),u)),u=[],r.lastMarkCovered=false),d&&m.pending&&(ks(o),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=false),a&&o.length===l&&(o.push(Kr(p,u)),u=[],r.lastMarkCovered=n.paragraphMarkCovered);}function yP(e,t,n,r,o){Vy(e,t,n,r,o,gr);}function bP(e,t){return Ry({blocks:t,rels:e.rels,lists:[...e.lists.values()],notes:e.notes,noteRels:e.noteRels,media:e.media,mediaExtensions:e.mediaExtensions})}function vP(e,t){let n=t.maxHtmlBytes??pP;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=wy(r),i={footnote:new Set,endnote:new Set},s=new Set,l={footnote:new Set,endnote:new Set};Iy(r,a,l);let d={nodesLeft:t.maxNodes??mP,maxDepth:t.maxDepth??gP,maxImageBytes:t.maxImageBytes??hP,wordHtml:ey(e),truncated:false,lastMarkCovered:false,rels:[],media:new Map,mediaExtensions:new Map,mediaBySrc:new Map,lists:new Map,listsByNumId:new Map,semanticListCount:0,imageCount:0,docPrId:0,nextBookmarkId:1,classAlignments:ry(r),listDefinitions:fy(oy(r)),notes:{footnote:new Map,endnote:new Map},noteRels:{footnote:[],endnote:[]},definedNotes:i,bodyNoteRefs:{footnote:new Set,endnote:new Set},noteNoteRefs:new Map,noteMarkFallbacks:new Map,definedNoteElements:s},u={};u=qa(u,r.documentElement),u=qa(u,o);let f={run:u,para:u.rtl?{bidi:true}:{},paragraphMarkCovered:false,pre:false,list:null},p=[];for(let b of a)l[b.kind].has(b.id)&&(i[b.kind].has(b.id)||(i[b.kind].add(b.id),s.add(b.element),p.push(b)));p.sort((b,I)=>Tc(I.element)-Tc(b.element)),d.lastMarkCovered=false;let m=[];gr(Array.from(o.childNodes),0,f,d,m);let h=d.lastMarkCovered,x=d.truncated,v=false;for(let b=0;b<p.length;b+=1){let I=p[b];d.truncated=false;let k=d.nodesLeft,C=[];if(gr(Array.from(I.element.childNodes),0,{...f,noteBody:{kind:I.kind,id:I.id},rels:d.noteRels[I.kind]},d,C,true),d.truncated||C.length===0){v=true;let T=new Set;for(let A=b;A<p.length;A+=1){let O=p[A];i[O.kind].delete(O.id),s.delete(O.element),d.notes[O.kind].delete(O.id),d.bodyNoteRefs[O.kind].delete(O.id),T.add(`${O.kind}:${O.id}`);}if(T.size>0){for(let A=0;A<m.length;A+=1)m[A]=To(m[A],T,d.noteMarkFallbacks);for(let A of ["footnote","endnote"])for(let[O,$]of d.notes[A])d.notes[A].set(O,$.map(y=>To(y,T,d.noteMarkFallbacks)));}d.nodesLeft=k;for(let A=b;A<p.length&&d.nodesLeft>0;A+=1)gr(Array.from(p[A].element.childNodes),0,f,d,m);break}d.notes[I.kind].set(I.id,C);}return d.truncated=x||v,d.lastMarkCovered=h,Ty(d,i,m,Oc),m.length===0?{ok:false,reason:"no-content"}:{ok:true,projection:d,blocks:m}}var xP=xy();function tb(e,t){let n=`${t.maxHtmlBytes??""}:${t.maxNodes??""}:${t.maxDepth??""}:${t.maxImageBytes??""}`;return xP(e,n,()=>vP(e,t))}function nb(e,t={}){let n=tb(e,t);return n.ok?{ok:true,fragmentBytes:bP(n.projection,n.blocks),lastMarkCovered:n.projection.lastMarkCovered,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:n}function rb(e,t={}){let n=tb(e,t);return n.ok?{lands:true,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:{lands:false,imageCount:0,truncated:false}}var SP={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function ob(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 SP[n.toLowerCase()]??t})}var wP=new Set(["script","style","title","template"]),IP=new Set(["p","div","li","tr","h1","h2","h3","h4","h5","h6","blockquote","section","article","pre","table"]),kP=new Set(["td","th"]),ab=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),TP=e=>ab(e)||e!==void 0&&e>="0"&&e<="9",ib=e=>e===" "||e===" "||e===`
6
+ `||e==="\r"||e==="\f";function PP(e,t){let n=t+1,r=e[n]==="/";if(r&&(n+=1),!ab(e[n]))return null;let o=n;for(;n<e.length&&TP(e[n]);)n+=1;let a=e.slice(o,n).toLowerCase(),i="",s=false;for(;n<e.length;){let l=e[n];if(i!=="")l===i&&(i="");else if(l==="=")s=true;else if(s&&(l==='"'||l==="'"))i=l,s=false;else {if(l===">")return {name:a,closing:r,end:n+1};ib(l)||(s=false);}n+=1;}return {name:a,closing:r,end:e.length}}function CP(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 RP(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&&ib(e[a]);)a+=1;if(e[a]===">")return a+1}r=o+2;}return e.length}function*sb(e){let t=0;for(;t<e.length;){let n=e.indexOf("<",t);if(n===-1){yield e.slice(t);break}if(n>t&&(yield e.slice(t,n)),e.startsWith("<!--",n)){if(e[n+4]===">"){t=n+5;continue}if(e[n+4]==="-"&&e[n+5]===">"){t=n+6;continue}let o=e.indexOf("-->",n+4);t=o===-1?e.length:o+3;continue}if(e[n+1]==="!"||e[n+1]==="?"){let o=e.indexOf(">",n+1);t=o===-1?e.length:o+1;continue}let r=PP(e,n);if(r===null){yield "<",t=n+1;continue}t=r.end,!r.closing&&wP.has(r.name)?t=RP(e,r.name,r.end):!r.closing&&r.name==="br"?yield `
7
+ `:r.closing&&kP.has(r.name)?yield " ":r.closing&&IP.has(r.name)&&(yield `
8
+ `);}}function EP(e){let t=e.length>2e6?e.slice(0,2e6):e,n="";for(let r of sb(t))n+=r;return ob(n).replace(/\r\n?/g,`
9
+ `).split(`
10
+ `).map(CP).join(`
11
+ `).replace(/\n{3,}/g,`
12
+
13
+ `).trim()}function lb(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r===12){t+=`
14
+ `;continue}if(r===13){t+=`
15
+ `,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}var db=/[^\s\u200B-\u200F\u2060\u2066-\u2069\u061C\uFEFF\u00AD]/;function cb(e){return db.test(e)}function Mc(e){let t=e.length>2e6?e.slice(0,2e6):e;for(let n of sb(t)){let r=n.includes("&")?ob(n):n;if(db.test(r))return true}return false}function Fc(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?EP(n):""}function Ac(e,t){if(typeof e.getData!="function")return "";try{return e.getData(t)??""}catch{return ""}}function OP(e){if(!e)return false;if(cb(Ac(e,"text/plain")))return true;let t=Ac(e,"text/html");if(t.length===0)return false;if(Mc(t))return true;let n=vs(t);return n!==null&&n.bytes[0]===80&&n.bytes[1]===75?true:rb(t).imageCount>0}function MP(e){return e?Mc(Ac(e,"text/html")):false}var FP=Object.freeze({kind:"body"});function Ve(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 ft(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 Cs(e,t){if(e)return {kind:"headerFooter",rId:e.scope.rId};if(t){let n=$c$1(t.id);if(n)return {kind:"notesPart",noteKind:n.noteKind}}return {kind:"body"}}function fb(e,t){return e?e.scope:t||FP}function AP(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(...ub(i.fragments));return o}if(!t)return B(e);let r=Po(e,t);return r?ub(r.fragments):[]}function Po(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 pb(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 Lc(e,t){return !!(e.rId&&e.rId===t.scope.rId||!e.rId&&e.partName===t.partName&&e.kind===t.kind)}function Nc(e,t,n){let r=Xc$1(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 Dc(e,t,n,r,o={}){return _c$2(e,t,n.fragments,r,o)}function LP(e,t,n){let r=e.pages[t.pageIndex]??e.pages[0];if(!r)return null;let o=Po(r,t);return o?me$1(e,t.pageIndex,o.fragments,n):null}function NP(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(...me$1(e,o.index,i.fragments,n));}return r.length>0?r:null}function mb(e,t){return e.querySelector(`[data-page-index="${t}"] > [data-docx-hf-active]`)??e.querySelector("[data-docx-hf-active]")}function gb(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 hb(e,t,n){if((a=>{let i=e.pages[a];return !!i&&!!Po(i,t)})(t.pageIndex)&&(n===void 0||n.has(t.pageIndex)))return t.pageIndex;let o=null;for(let a of e.pages)if(Po(a,t)&&(o===null&&(o=a.index),n===void 0||n.has(a.index)))return a.index;return o??t.pageIndex}function yb(e){return e?{rId:e.scope.rId,pageIndex:e.pageIndex,kind:e.kind,partName:e.partName,variant:e.variant}:null}function bb(e,t,n){e.classList.toggle("docx-paginated-surface--hf-editing",n),t.classList.toggle("docx-pages--hf-editing",n);}function Hc(e,t){e.classList.toggle("docx-paginated-surface--viewing",t==="view");}function _c(e,t,n,r,o,a,i){let s=o?LP(e,o,i):a?NP(e,a,i):null,l=te(e,t,n,r,{...i?{measurer:i}:{},...s?{stops:s}:{}});if(!l)return null;if(!s)return l;let d=s.find(u=>u.position.paragraphId===l.position.paragraphId&&u.position.offset===l.position.offset);return d?{...l,pageIndex:d.pageIndex}:l}function Bc(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,l=s.x+o,d=s.y;if(t.x>=l&&t.x<l+s.width&&t.y>=d&&t.y<d+s.height)return {pageIndex:r.index,scopeId:i.scopeId,noteKind:i.noteKind,noteId:i.noteId,local:{x:t.x-l,y:t.y-d},fragments:i.fragments}}}return null}function vb(e,t){let n=e[t],r=e.contentBox,o=e.box;if(t==="header"){let d=o.y,u=r.y,f=n?Math.max(u,n.box.y+n.box.height):u,p=n?Math.min(d,n.box.y):d;return f<=p?null:{x:r.x,y:p,width:r.width,height:f-p}}let a=r.y+r.height,i=o.y+o.height,s=n?Math.min(a,n.box.y):a,l=n?Math.max(i,n.box.y+n.box.height):i;return l<=s?null:{x:r.x,y:s,width:r.width,height:l-s}}function $c(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=vb(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 qc(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,l=vb(r,a)??s,d=l.x+o,u=l.y;if(t.x>=d&&t.x<d+l.width&&t.y>=u&&t.y<u+l.height)return {pageIndex:r.index,kind:a,story:i,local:{x:t.x-(s.x+o),y:t.y-s.y}}}}return null}function Co(e,t,n){if(!t&&!n)return V(e);let r=new Set,o=[];for(let a of e.pages)for(let i of AP(a,t,n)){for(let s of i.lines)for(let l of R(s))r.has(l.paragraphId)||(r.add(l.paragraphId),o.push(l.paragraphId));i.lines.length===0&&!r.has(i.paragraphId)&&(r.add(i.paragraphId),o.push(i.paragraphId));}return o}function Rs(e,t,n,r){let o=Co(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 ub(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 xb(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 DP(e){try{return typeof caches>"u"?Promise.resolve(null):caches.open(e).catch(()=>null)}catch{return Promise.resolve(null)}}async function HP(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 _P(e,t,n){if(e)try{await e.put(t,new Response(n.slice(),{headers:{"Content-Length":String(n.byteLength)}}));}catch{}}async function BP(e,t){if(e)try{await e.delete(t);}catch{}}async function Zc(e){let t=()=>{if(e.signal?.aborted)throw e.signal.reason};t();let n=e.fetcher??fetch,r=e.maxFontBytes??a$1,o=await DP(e.cacheName??"docx-editor-fonts");t();async function a(d){t();let u=Object.freeze({family:d.family,weight:d.weight,style:d.style}),f=xb(u);if(f)return {failure:{url:d.url,request:u,reason:"invalidRequest",diagnostic:f}};let p=(b,I)=>{if(b.byteLength===0)return {url:d.url,request:u,reason:"emptyResponse"};if(b.byteLength>r)return {url:d.url,request:u,reason:"overLimit"};let k=i(b,d.faceIndex??0);if(!k.valid)return {url:d.url,request:u,reason:"malformed",diagnostic:k.diagnostic};let C=a$2(b);return d.hash!==void 0&&d.hash!==C?{url:d.url,request:u,reason:"hashMismatch",expectedHash:d.hash,actualHash:C,...I?{diagnostic:"cached bytes failed revalidation"}:{}}:{request:u,id:`url:${d.url}`,bytes:b,hash:C,faceIndex:d.faceIndex??0}},m=await HP(o,d.url);if(t(),m){let b=p(m,true);if(!("reason"in b))return {source:b};await BP(o,d.url),t();}let h;try{h=e.signal?await n(d.url,{signal:e.signal}):await n(d.url),t();}catch(b){return t(),{failure:{url:d.url,request:u,reason:"networkError",diagnostic:b instanceof Error?b.message:String(b)}}}if(!h.ok)return {failure:{url:d.url,request:u,reason:"httpError",status:h.status}};let x;try{x=new Uint8Array(await h.arrayBuffer()),t();}catch(b){return t(),{failure:{url:d.url,request:u,reason:"networkError",diagnostic:b instanceof Error?b.message:String(b)}}}let v=p(x,false);return "reason"in v?{failure:v}:(await _P(o,d.url,x),t(),{source:v})}let i$1=await Promise.all(e.sources.map(d=>a(d)));t();let s=[],l=[];for(let d of i$1)"source"in d?s.push(d.source):l.push(d.failure);return {sources:s,failures:l}}function $P(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=xb(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??a$1))return {failure:{url:o,request:r,reason:"overLimit"}};let i$1=t.faceIndex??0,s=i(e,i$1);return s.valid?{source:{request:r,id:o,bytes:e,hash:a$2(e),faceIndex:i$1}}:{failure:{url:o,request:r,reason:"malformed",diagnostic:s.diagnostic}}}var qP=e=>e.trim().toLowerCase(),Sb=e=>JSON.stringify([qP(e.family),e.weight,e.style]);function ZP(e){return i$1(async t=>{if(t.signal?.aborted)throw t.signal.reason;let n=new Set((t.resolvedFaces??[]).map(Sb)),r=e.sources.filter(s=>!n.has(Sb(s)));if(r.length===0)return {sources:[],failures:[]};let{onFailure:o,...a}=e,i=await Zc({...a,sources:r,signal:t.signal});if(t.signal?.aborted)throw t.signal.reason;for(let s of i.failures)o?o(s):console.warn(`[fonts] ${s.request.family} (${s.url}): ${s.reason}`);return i})}var KP=96,wb=37.79527559055118;function VP(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 l=s*12;if(s%8===0){let d=s/8;n.push({position:l,height:10,...d>0?{label:String(d)}:{}});}else s%4===0?n.push({position:l,height:6}):s%2===0?n.push({position:l,height:4}):n.push({position:l,height:2});}return n}let r=wb/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 zP(e){let t=[...e].sort((n,r)=>n.index-r.index)[0];return t?t.box:null}var jP=1440,WP=567,UP=180,GP=56.7,Es=(e,t,n)=>n<t||e<t?t:e>n?n:e;function XP(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 Ib(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 YP(e,t,n,r,o={}){let a=Ib(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 l=Es(a,0,i);return {...n,firstLine:l-r.leftMargin-n.left}}case "left":{let l=-r.leftMargin-Math.min(0,n.firstLine),d=i-r.leftMargin-Math.max(0,n.firstLine);return {...n,left:Es(a-r.leftMargin,l,d)}}case "hanging":{let l=Es(a-r.leftMargin,-r.leftMargin,i-r.leftMargin);return {...n,left:l,firstLine:n.firstLine+(n.left-l)}}case "right":{let l=Es(a,s,r.pageWidth);return {...n,right:r.pageWidth-r.rightMargin-l}}}}function kb(e,t){let n=e.snapshot().formatting;if(n)switch(t){case "text.color":return n.color?.kind==="hex"?n.color.value.replace(/^#/,""):void 0;case "text.highlight":return n.highlight;case "styles.style":return n.styleId;case "font.family":return n.fontFamily;case "font.size":return n.fontSizePt===void 0?void 0:String(n.fontSizePt*2);case "list.lineSpacing":return n.lineSpacing?.rule==="multiple"?String(n.lineSpacing.value):void 0;default:return}}function QP(e){if(!(!e||typeof e!="object"||"preventDefault"in e))return e}var Tb="no formatting has been copied",Os="there is nothing at the selection to copy",Kc="the selection has nothing to paint",Ms=Object.freeze({mode:"off",level:"none"});var Vc=new WeakMap;function zn(e){let t=Vc.get(e);if(t)return t;let n=Be(e);if(n.length===0)return Vc.set(e,[]),[];let r=[];for(let o of n){let a=Ae(o);for(let i of new Set([o.beginParagraphId,...o.resultParagraphIds,o.endParagraphId])){let s=Ha(e,i);if(s?.kind!=="paragraph")continue;let l=Ue(s),d=i===o.beginParagraphId,u=i===o.endParagraphId;r.push({toc:o,paragraphId:i,length:l.length,startsHere:d,endsHere:u,start:d?l.spanOf(o.beginNodeId)?.start??0:0,end:u&&a?l.spanOf(a.endNodeId)?.end??l.length:l.length});}}return Vc.set(e,r),r}function Fs(e){return new Set(zn(e).filter(t=>t.start===0&&t.end===t.length&&!(t.endsHere&&!t.startsHere&&t.end===0)).map(t=>t.paragraphId))}function zc(e,t){return e.endsHere&&!e.startsHere&&e.end===0||e.startsHere&&e.start>0&&t<=e.start||e.endsHere&&e.end<e.length&&t>=e.end?false:t>=e.start&&t<=e.end}function Yt(e,t){return zn(e).find(n=>n.paragraphId===t.paragraphId&&zc(n,t.offset))?.toc}function Pb(e,t){let{anchor:n,head:r}=t;if(n.paragraphId===r.paragraphId){let o=Math.min(n.offset,r.offset),a=Math.max(n.offset,r.offset);return zn(e).some(i=>i.paragraphId===n.paragraphId&&(o===a?zc(i,o):o<i.end&&a>i.start))}return Yt(e,n)!==void 0||Yt(e,r)!==void 0}function Cb(e,t){let n=zn(e);if(n.length===0)return false;let r=oi$1(t);if(r.kind==="nodes")return r.targets.some(i=>n.some(s=>{if(i.nodeId!==s.paragraphId)return false;if(i.range){let{start:l,end:d}=i.range;return l===d?zc(s,l):l<s.end&&d>s.start}return t.op==="joinParagraphs"&&t.firstId===s.paragraphId&&s.endsHere&&s.end===0?false:i.removes||i.structural?true:s.end>s.start||s.length===0&&!s.endsHere}));let o=new Set(n.map(i=>i.paragraphId)),a=(i,s="")=>typeof i=="string"?/(?:Id|Ids)$/.test(s)&&o.has(i):Array.isArray(i)?i.some(l=>a(l,s)):!!i&&typeof i=="object"&&Object.entries(i).some(([l,d])=>a(d,l));return a(t)}function Rb(e,t,n){let r=Yt(e,t);if(!r)return null;let o=zn(e).find(a=>a.toc.id===r.id&&(n?a.startsHere&&a.start>0:a.endsHere&&a.end<a.length));return o?{paragraphId:o.paragraphId,offset:n?o.start:o.end}:null}function Eb(e,t){return !zn(t).some(r=>r.toc.id===e.id&&(r.start>0||r.end<r.length))&&e.contentControlId?e.contentControlId:`toc:${e.id}`}function Ob(e,t,n){if(!t)return;let r=n?.closest("[data-start]");return zn(e).find(o=>o.paragraphId===t&&(r?Number(r.dataset.start)<o.end&&Number(r.dataset.end)>o.start:Fs(e).has(t)))?.toc}var Za=/^[0-9A-Fa-f]{6}$/,Mb={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"},JP={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 jc(e){return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=1}function As(e){return Math.max(0,Math.min(1,e))}function Fb(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 Ab(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 Lb(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "FFFFFF";let r=Math.max(0,Math.min(255,Math.round((1-As(t))*255)))/255,o=Fb(e);return Ab(r*255+(1-r)*o.r,r*255+(1-r)*o.g,r*255+(1-r)*o.b)}function Nb(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "000000";let r=Math.max(0,Math.min(255,Math.round(As(t)*255)))/255,o=Fb(e);return Ab(r*o.r,r*o.g,r*o.b)}function Wc(e){return Mb[e]??Mb[e.toLowerCase()]??null}function eC(e,t){let n=Wc(e);if(!n)return null;let r=t.find(a=>a.slot===n)?.hex;if(r&&Za.test(r))return r.toUpperCase();let o=JP[n];return o&&Za.test(o)?o.toUpperCase():null}function Ls(e,t){let n=eC(e.slot,t);if(!n)return {ok:false,reason:"the theme colour could not be resolved for this document"};if(e.tint!==void 0&&!jc(e.tint))return {ok:false,reason:"theme tint is out of range"};if(e.shade!==void 0&&!jc(e.shade))return {ok:false,reason:"theme shade is out of range"};let r=n;return e.tint!==void 0?r=Lb(r,As(e.tint)):e.shade!==void 0&&(r=Nb(r,As(e.shade))),{ok:true,hex:r}}var tC="000000";function Uc(e,t){if(e.kind==="hex"){let o=e.value.toUpperCase();return Za.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:tC}};let n=Ls(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Wc(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function Gc(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 Za.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"fill colour requires a six-digit hex value"}}let n=Ls(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Wc(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function nC(e,t,n="000000"){if(!e||e.kind==="auto")return `#${n}`;if(e.kind==="hex"){let o=e.value.replace(/^#/,"").toUpperCase();return Za.test(o)?`#${o}`:`#${n}`}let r=Ls(e,t);return `#${r.ok?r.hex:n}`}function Xc(e,t){return fd(e).occurrences.some(n=>n.table.tableId===t&&n.row.cells.some(r=>r.logicalGridColumn!==void 0))}function Db(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var iC=new Set(["insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","setCellFill","setTableCellVerticalAlignment","setTableBorders","commitTableColumnDividerResize","commitTableRightEdgeResize","mergeCells","splitCell","toggleHeaderRow","selectTableRegion","setTableProperties"]);function hr(e){return iC.has(e.type)}function he(e,t){return {ok:false,code:e,reason:t}}function Yc(e,t){switch(e){case "unknown-table":case "unknown-row":case "unknown-grid-column":return he("invalidArgs","the table target is no longer valid");case "table-has-merge":return he("unsupported","this table has merged cells");case "row-hides-cell":return he("unsupported","this table has a cell the editor cannot place in the grid");case "block-required":return he("unsupported","the table must keep at least one row or column");case "resource-limit":return he("unsupported","the table has reached the supported size limit");case "invalidArgs":case "invalid-property-value":case "unsupported-property":return he("invalidArgs","the table command arguments are invalid");default:return he("unsupported",`the table operation was refused (${e})`)}}function It(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Kt(e,t){return !It(e)||Object.keys(e).length!==t.length?false:t.every(r=>Object.prototype.hasOwnProperty.call(e,r))}function $b(e){if(!It(e))return false;let t=e.kind;if(t==="hex")return Kt(e,["kind","value"])&&typeof e.value=="string";if(t==="auto")return Kt(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 Kt(e,n)}return false}function qb(e){return It(e)&&Kt(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 Zb(e){return It(e)&&Kt(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 sC(e){return It(e)&&Kt(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 lC(e){return It(e)&&Kt(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 dC(e){return !It(e)||!Kt(e,["style","size","color"])?false:typeof e.style=="string"&&typeof e.size=="number"&&Number.isInteger(e.size)&&$b(e.color)}function Hb(e){return !("target"in e)||e.target===void 0||qb(e.target)}function _b(e){return !("target"in e)||e.target===void 0||Zb(e.target)}function cC(e){switch(e.type){case "insertRow":return !It(e)||e.type!=="insertRow"?he("invalidArgs","insertRow command shape is invalid"):e.where!=="above"&&e.where!=="below"?he("invalidArgs","insertRow where must be above or below"):Hb(e)?null:he("invalidArgs","insertRow target shape is invalid");case "deleteRow":return !It(e)||e.type!=="deleteRow"?he("invalidArgs","deleteRow command shape is invalid"):Hb(e)?null:he("invalidArgs","deleteRow target shape is invalid");case "insertColumn":return !It(e)||e.type!=="insertColumn"?he("invalidArgs","insertColumn command shape is invalid"):e.where!=="left"&&e.where!=="right"?he("invalidArgs","insertColumn where must be left or right"):_b(e)?null:he("invalidArgs","insertColumn target shape is invalid");case "deleteColumn":return !It(e)||e.type!=="deleteColumn"?he("invalidArgs","deleteColumn command shape is invalid"):_b(e)?null:he("invalidArgs","deleteColumn target shape is invalid");case "deleteTable":return !It(e)||!Kt(e,["type"])?he("invalidArgs","deleteTable command shape is invalid"):null;case "setCellFill":return !It(e)||!Kt(e,["type","color"])?he("invalidArgs","setCellFill command shape is invalid"):e.color!==null&&!$b(e.color)?he("invalidArgs","setCellFill color shape is invalid"):null;case "setTableCellVerticalAlignment":return !It(e)||!Kt(e,["type","alignment"])||!["top","center","bottom"].includes(e.alignment)?he("invalidArgs","cell vertical alignment command shape is invalid"):null;case "setTableBorders":return !It(e)||e.type!=="setTableBorders"?he("invalidArgs","setTableBorders command shape is invalid"):e.scope==="none"?typeof e.target!="string"?he("invalidArgs","border none scope requires a target edge"):null:!("spec"in e)||!dC(e.spec)?he("invalidArgs","concrete border scopes require a complete spec"):null;case "commitTableColumnDividerResize":return !It(e)||!Kt(e,["type","target","leftWidthTwips","rightWidthTwips"])||!sC(e.target)||typeof e.leftWidthTwips!="number"||typeof e.rightWidthTwips!="number"?he("invalidArgs","column divider resize command shape is invalid"):null;case "commitTableRightEdgeResize":return !It(e)||!Kt(e,["type","target","columnWidthTwips","tableWidthTwips"])||!lC(e.target)||typeof e.columnWidthTwips!="number"||typeof e.tableWidthTwips!="number"?he("invalidArgs","right-edge resize command shape is invalid"):null;default:return null}}function uC(e){return !("target"in e)||e.target===void 0?null:qb(e.target)?e.target:null}function fC(e){return !("target"in e)||e.target===void 0?null:Zb(e.target)?e.target:null}function pC(e,t){let n=Dh$1(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 mC(e,t){let n=Dh$1(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 l=Kb(s);if(r.has(s.id))for(let d=0;d<l;d+=1){let u=n.topology.gridColumns[i+d];u&&o.add(u.id);}i+=l;}}return {gridColumnIds:[...o],wholeTable:o.size>0&&o.size===n.topology.gridColumns.length}}function Bb(e,t,n){let r=Dh$1(e.root,t);return !r.ok||!r.topology.grid?null:r.topology.gridColumns[n]?.id??null}function gC(e){let t=ya(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 Kb(e){let t=Ah(e,"tcPr"),n=t&&Ah(t,"gridSpan"),r=n&&Bh$1(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 hC(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 l=Kb(s);if(r>=i&&r<i+l)return {tableId:t,rowId:o.id,cellId:s.id,cellIds:[s.id],gridColumnIndex:r,isHeaderRepeat:false};i+=l;}}return null}function yC(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=Dh$1(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 bC(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=Dh$1(e.part.root,t.tableId);return n.ok?hC(n.topology,t.tableId,t.gridColumnId):null}function vC(e,t){for(let n of t){let r=Vi(e,n);if(r)return Yc(r)}return null}function Zt(e,t,n){let r=vC(e,t);return r||{ok:true,ops:t,selection:n}}function xC(e,t){if(!vi.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=Uc(e.color,t);return n.ok?{ok:true,spec:{style:e.style,size:e.size,color:n.color}}:{ok:false,reason:n.reason}}function Ka(e,t,n){return n!==e.storeRevision?he("invalidArgs","the table target is stale"):Dh$1(e.part.root,t).ok?null:he("invalidArgs","the table target is no longer valid")}function SC(e){return e?.isHeaderRepeat?he("unsupported","repeated header rows cannot be edited"):null}function wC(e,t,n,r){let o=Ka(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return he("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return he("invalidArgs","column widths must be whole twips");if(n<300||r<300)return he("invalidArgs","column widths are below the minimum");let a=Dh$1(e.part.root,t.tableId);if(!a.ok){let f=a.reason==="duplicate-node-id"?"unknown-table":a.reason;return Yc(f)}if(a.topology.hasMerge)return he("unsupported","this table has merged cells");let i=a.topology.gridColumns.find(f=>f.id===t.leftGridColumnId),s=a.topology.gridColumns.find(f=>f.id===t.rightGridColumnId);if(!i||!s)return he("invalidArgs","the table target is no longer valid");let l=a.topology.gridColumns.indexOf(i),d=a.topology.gridColumns.indexOf(s);if(Math.abs(d-l)!==1)return he("invalidArgs","the column divider target is not adjacent");let u={op:"setTableColumnWidths",tableId:t.tableId,leftGridColumnId:l<d?t.leftGridColumnId:t.rightGridColumnId,rightGridColumnId:l<d?t.rightGridColumnId:t.leftGridColumnId,leftWidthTwips:l<d?n:r,rightWidthTwips:l<d?r:n};return Zt(e.part,[u],{kind:"preserveSelection"})}function IC(e,t,n,r){let o=Ka(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return he("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return he("invalidArgs","column widths must be whole twips");if(n<300)return he("invalidArgs","column widths are below the minimum");let a=Dh$1(e.part.root,t.tableId);if(!a.ok){let l=a.reason==="duplicate-node-id"?"unknown-table":a.reason;return Yc(l)}if(a.topology.hasMerge)return he("unsupported","this table has merged cells");let i=a.topology.gridColumns[a.topology.gridColumns.length-1];if(!i||i.id!==t.gridColumnId)return he("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 Zt(e.part,[s],{kind:"preserveSelection"})}function Vb(e,t,n){if(e.viewing||!e.editable)return he("locked","the document is open for viewing");let r=Ka(e,t.tableId,t.sourceRevision);if(r)return r;if(t.isHeaderRepeat)return he("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||n<20||n>31680)return he("invalidArgs","row height is outside the supported range");let o={op:"setTableRowHeight",tableId:t.tableId,rowId:t.rowId,heightTwips:n};return Zt(e.part,[o],{kind:"preserveSelection"})}function jn(e){let{command:t,part:n,viewing:r,editable:o}=e;if(r||!o)return he("locked","the document is open for viewing");switch(t.type){case "mergeCells":return he("unsupported","cell merge is not supported yet");case "splitCell":return he("unsupported","cell split is not supported yet");case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return he("unsupported",`command '${t.type}' is not supported by the tree editor`);}let a=cC(t);if(a)return a;let i=uC(t),s=fC(t),l=SC(i??s);if(l)return l;if(i){let u=Ka(e,i.tableId,i.sourceRevision);if(u)return u}if(s){let u=Ka(e,s.tableId,s.sourceRevision);if(u)return u}let d=i!==null?yC(e,i):s!==null?bC(e,s):gC(e);if(t.type!=="commitTableColumnDividerResize"&&t.type!=="commitTableRightEdgeResize"&&!d)return i||s?he("invalidArgs","the table target is no longer valid"):he("unsupported","the selection is not inside a table");if(d?.isHeaderRepeat)return he("unsupported","repeated header rows cannot be edited");switch(t.type){case "insertRow":{if(!d)return he("unsupported","the selection is not inside a table");let u={op:"insertTableRow",tableId:d.tableId,rowId:d.rowId,where:t.where};return Zt(n,[u],{kind:"adoptCommittedCaret"})}case "deleteRow":{if(!d)return he("unsupported","the selection is not inside a table");let u=pC(n,d),f=u.wholeTable?[{op:"deleteBlock",blockId:d.tableId}]:u.rowIds.map(p=>({op:"deleteTableRow",tableId:d.tableId,rowId:p,...p===d.rowId?{referenceCellId:d.cellId}:{}}));return Zt(n,f,{kind:"adoptCommittedCaret"})}case "insertColumn":{if(!d)return he("unsupported","the selection is not inside a table");let u=s?.tableId??d.tableId,f=s?.gridColumnId??Bb(n,u,d.gridColumnIndex),p=Xc(e.layout,u)?t.where==="left"?"right":"left":t.where,m=f?{op:"insertTableColumn",tableId:u,where:p,gridColumnId:f}:{op:"insertTableColumn",tableId:u,where:p,referenceCellId:d.cellId};return Zt(n,[m],{kind:"adoptCommittedCaret"})}case "deleteColumn":{if(!d)return he("unsupported","the selection is not inside a table");let u=s?.tableId??d.tableId,f=s?.gridColumnId??Bb(n,u,d.gridColumnIndex);if(!f)return he("invalidArgs","the table has no grid column to delete");let p=s?.gridColumnId===void 0?mC(n,d):{gridColumnIds:[f],wholeTable:false};if(p.wholeTable)return Zt(n,[{op:"deleteBlock",blockId:u}],{kind:"adoptCommittedCaret"});let h=(p.gridColumnIds.length>0?p.gridColumnIds:[f]).map(x=>({op:"deleteTableColumn",tableId:u,gridColumnId:x}));return Zt(n,h,{kind:"adoptCommittedCaret"})}case "deleteTable":{if(!d)return he("unsupported","the selection is not inside a table");let u={op:"deleteBlock",blockId:d.tableId};return Zt(n,[u],{kind:"adoptCommittedCaret"})}case "setCellFill":{if(!d)return he("unsupported","the selection is not inside a table");let u;if(t.color===null)u=null;else {let p=Gc(t.color,e.themeColors);if(!p.ok)return he("invalidArgs",p.reason);u=p.color;}let f={op:"setTableCellFill",tableId:d.tableId,cellIds:d.cellIds,color:u};return Zt(n,[f],{kind:"preserveSelection"})}case "setTableCellVerticalAlignment":{if(!d)return he("unsupported","the selection is not inside a table");let u={op:"setTableCellVerticalAlignment",tableId:d.tableId,cellIds:d.cellIds,alignment:t.alignment};return Zt(n,[u],{kind:"preserveSelection"})}case "setTableBorders":{if(!d)return he("unsupported","the selection is not inside a table");if(t.scope==="none"){let p={op:"setTableCellBorders",tableId:d.tableId,cellIds:d.cellIds,scope:"none",target:Db(t.target,Xc(e.layout,d.tableId))};return Zt(n,[p],{kind:"preserveSelection"})}let u=xC(t.spec,e.themeColors);if(!u.ok)return he("invalidArgs",u.reason);let f={op:"setTableCellBorders",tableId:d.tableId,cellIds:d.cellIds,scope:Db(t.scope,Xc(e.layout,d.tableId)),spec:u.spec};return Zt(n,[f],{kind:"preserveSelection"})}case "commitTableColumnDividerResize":return wC(e,t.target,t.leftWidthTwips,t.rightWidthTwips);case "commitTableRightEdgeResize":return IC(e,t.target,t.columnWidthTwips,t.tableWidthTwips);default:return he("unsupported",`command '${t.type}' is not a table command`)}}function zb(e){if(!hr(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}}}function Ct(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 zr(e){if(typeof e!="object"||e===null)return false;let t=e;return Ct(t.from)&&Ct(t.to)}function jb(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 mn(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=Pi(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=jb(a,n.search,n.occurrence),l=s[n.occurrence-1];return l===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:l,end:l+n.search.length}}}let i=jb(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 Wb(e,t,n){if("anchor"in n){let s=mn(e,t,n.anchor);if(!s.ok)return {ok:false,code:s.code,reason:s.reason,target:n.anchor};let l={paragraphId:s.span.nodeId,offset:s.span.start};return {ok:true,selection:{anchor:l,head:l}}}let{from:r,to:o}=n.range;if(!Ct(r)||!Ct(o))return {ok:false,code:"unsupported",reason:"DocLocation endpoints are not supported; address paragraphs by paraId",target:n.range};let a=mn(e,t,r);if(!a.ok)return {ok:false,code:a.code,reason:a.reason,target:r};let i=mn(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 kC=["alignment","spaceBeforePt","spaceAfterPt","lineSpacing","tabStops"];function TC(e,t){return e===t?true:!e||!t?false:kC.every(n=>e[n]===t[n])}function Qc(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||!TC(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 Jc(e,t){return e.current===t.current&&e.total===t.total}function eu(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 Ub(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 tu(e,t){return e===t?true:!e||!t||!zr(e)||!zr(t)?false:Ub(e.from,t.from)&&Ub(e.to,t.to)}function nu(){let e=null;return t=>(t===null?e=null:e?.id!==t&&(e=Object.freeze({id:t})),e)}var PC={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",showParagraphMarks:"compared",documentProtection:"compared",reviewDisplayMode:"compared",hasReviewContent:"compared",hiddenReviewAuthors:"compared",collaborationStatus:"compared",editingMode:"compared",lastRejection:"compared",fontSubstitutions:"compared",formatPainter:"compared"},CC=Object.keys(PC);function ru(e,t){return CC.every(n=>e[n]===t[n])}function Ns(e){if(e===null||typeof e!="object"||Object.isFrozen(e))return e;if(Array.isArray(e)){for(let n of e)Ns(n);return Object.freeze(e)}let t=e;for(let n of Object.keys(t))Ns(t[n]);return Object.freeze(e)}var ou=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"}}]]),RC=new Set(["none","black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","yellow","white"]),EC=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,OC=/^[0-9A-Fa-f]{6}$/;function au(e){let{mark:t,value:n}=e;switch(t){case "fontFamily":return typeof n!="string"||!EC.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"&&!OC.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"||!RC.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 Qb(e){return typeof e=="object"&&e!==null&&typeof e.paragraphId=="string"&&typeof e.offset=="number"}function iu(e){return typeof e=="object"&&e!==null&&Qb(e.anchor)&&Qb(e.head)}function Vt(e,t){let n=new Error(t);return n.code=e,n}function Ds(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 su(e){return e==="blank"?ac():e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null}function lu(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 Va(e){switch(e.type){case "toggleMark":return ou.has(e.mark)?{supported:true,mutating:true}:{supported:false,reason:`mark '${e.mark}' is not supported`};case "setMarkAttr":{let t=au(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 "copyFormatting":return {supported:true,mutating:false};case "pasteFormatting":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)>Ab$1))return {supported:false,code:"invalidArgs",reason:`indent values must be whole twips within \xB1${Ab$1}`};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)>Ab$1)return {supported:false,reason:`indent values must be within \xB1${Ab$1} 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 "editTextFormField":return {supported:true,mutating:false};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=zb(e);return t.supported?{supported:true,mutating:true}:{supported:false,reason:t.reason??"unsupported table command"}}case "setSelection":return "range"in e&&(iu(e.range)||zr(e.range))||"anchor"in e&&Ct(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`}}}var gn="comments and tracked changes require the pro review module (@docx-editor.dev/pro)";var yr="suggesting mode needs an author; configure author before enabling it",MC="this document asks for tracked changes, but no author is configured",Jb="this document is protected for filling in forms, which does not track changes",za="this document is protected against editing; open it in Word to change that",ja="this document is protected for comments only",du={mode:null,rejection:null};function cu(e,t){if(e===void 0||e==="view")return du;if(e==="edit")return {mode:"editing",rejection:null};let n=uu(t);return n!==null?{mode:null,rejection:n.reason}:{mode:"suggesting",rejection:null}}function uu(e){return e.reviewEnabled?e.hasAuthor?null:{ok:false,code:"invalidArgs",reason:yr}:{ok:false,code:"unsupported",reason:gn}}function e0(e){let t=false,n=null,r=e.log??(o=>console.error(o));return {report(o){o!==yr||t||n!==null||(n=setTimeout(()=>{if(n=null,!e.stillMissing())return;t=true;let a=`${yr}. Edits are not tracked until an author is set (the author option at construction, setAuthor(), or the adapter author prop).`;e.emit(Vt("suggestingNeedsAuthor",a)),r(`[@docx-editor.dev/core] ${a}`);},0));},dispose(){n!==null&&clearTimeout(n),n=null;}}}function fu(e){if(e.restrictedToReadOnly)return e.currentMode==="viewing"?du:{mode:"viewing",rejection:za};let t=e.currentMode,n=null;e.engineAdoptedViewing&&t==="viewing"&&!e.viewOnly&&(n="editing",t="editing");let r=n===null?du:{mode:n,rejection:null};return e.restrictedToComments?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:ja}:r:e.restrictedToForms?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:Jb}:r:e.viewOnly||t!=="editing"||e.readerChoseMode||!(e.trackRevisions&&!e.hostChoseMode)&&!e.restrictedToTrackedChanges||!e.reviewEnabled?r:e.hasAuthor?{mode:"suggesting",rejection:null}:{mode:n,rejection:MC}}function t0(e){return e===null?{enter:true,rejection:null}:{enter:false,rejection:e.reason}}function pu(e,t){return t!=="viewing"&&e.restrictedToReadOnly?{ok:false,code:"locked",reason:za}:t==="suggesting"&&e.restrictedToComments?{ok:false,code:"locked",reason:ja}:t==="suggesting"&&e.restrictedToForms?{ok:false,code:"locked",reason:Jb}:t!=="editing"||!e.restrictedToTrackedChanges?null:{ok:false,code:"locked",reason:"this document permits editing only as tracked changes"}}function n0(e,t,n,r,o,a=false){let i=cu(e,t),s=e==="view"?"viewing":i.mode??o,l=fu({...t,...n,viewOnly:e==="view",hostChoseMode:e!==void 0,readerChoseMode:false,currentMode:s,engineAdoptedViewing:a});l.mode!==null&&(s=l.mode);let d=pu(n,s),u=n.restrictedToReadOnly?"viewing":r;return {mode:d===null?s:u,rejection:l.rejection??d?.reason??null,configurationRejection:i.rejection}}var r0=new WeakMap;function o0(e,t){r0.set(e,t);}var Wa="this document is protected; only form fields can be filled";function Pn(e,t){if(e.type==="undo"||e.type==="redo"||e.type==="toggleDocumentProtection")return null;let n=Lf$1(t.session.currentPackage()),r=Df$1(n?.root);if(!r.enforced)return null;if(r.edit==="readOnly"||r.edit==="comments")return {ok:false,code:"locked",reason:r.edit==="comments"?ja:za};if(r.edit!=="forms"||hr(e))return null;let o="structure",a,i=false;switch(e.type){case "insertText":o="text",a=e.text;break;case "paste":case "pasteWithoutFormatting":o="text",a=e.text,i=true;break;case "deleteText":case "cut":o="text";break;case "toggleMark":case "setMarkAttr":case "pasteFormatting":o="runFormat";break;case "clearFormatting":case "setAlignment":case "setLineSpacing":case "setParagraphSpacing":case "setIndent":case "adjustIndent":case "toggleList":case "setParagraphStyle":case "setParagraphFormat":case "removeTabMark":o="paragraph";break;case "setPageSetup":case "setHeaderFooterOptions":case "convertAllNotes":case "insertToc":case "refreshToc":case "replaceAllMatches":case "resolveAllReviewChanges":case "acceptRevision":case "rejectRevision":case "acceptAllRevisions":case "rejectAllRevisions":o="document";break}let s=t.state().selection,l=t.session.storyParts().find(p=>s.head.paragraphId.startsWith(`${p.name}#`));if(!l)return {ok:false,code:"locked",reason:Wa};let d=t.state().cellSelection;return (d&&(o==="runFormat"||o==="paragraph")?[...ta$1(t.layout(),d.cellIds)].map(p=>({anchor:{paragraphId:p,offset:0},head:{paragraphId:p,offset:(Pi(l,p)??"").length}})):[s]).some(p=>li$1(l,n,{selection:p,intent:o,text:a,paste:i,fieldId:r0.get(t)?.()??void 0}))?{ok:false,code:"locked",reason:Wa}:null}function a0(e,t){if(e!=="locked")return e;let n=Df$1(t);return n.enforced?n.edit==="comments"?ja:n.edit==="forms"?Wa:za:"this content is locked"}function i0(e){return e!==null&&Pn({type:"resolveAllReviewChanges"},e)!==null}function s0(e,t){return ()=>e()??(t()?null:"the document is read-only")}function FC(e){return [e.left,e.top,e.right,e.bottom]}function mu(e){return Object.freeze({left:e.left*100,top:e.top*100,right:e.right*100,bottom:e.bottom*100})}function AC(e){return Object.freeze({left:e.left/100,top:e.top/100,right:e.right/100,bottom:e.bottom/100})}function Ua(e){return Math.round(e*1e3)}function Ga(e){return e/1e3}function gu(e){return Object.freeze({left:Ua(e.left),top:Ua(e.top),right:Ua(e.right),bottom:Ua(e.bottom)})}function LC(e){return Object.freeze({left:Ga(e.left),top:Ga(e.top),right:Ga(e.right),bottom:Ga(e.bottom)})}function hu(e){return FC(e).some(n=>!Number.isFinite(n)||n<0||n>100)?false:e.left+e.right<100&&e.top+e.bottom<100}var NC=new Set(["insertImage","replaceImage"]),DC=new Set(["insertImage","replaceImage","deleteImage","setImageWrapType","transformImage","setImagePosition","setImageProperties"]);function yu(e,t,n){return n!==null&&e.drawingNodeId!==n?false:e.start===t||e.start+1===t}function HC(e,t,n,r){if(!e)return null;for(let o of e.drawings??[])if(o.paragraphId===t&&yu(o,n,r))return o;return null}function _C(e,t,n,r){let o=e.layout();for(let a of o.pages){for(let i of a.anchoredDrawings??[])if(i.anchorParagraphId===t&&yu(i,n,r))return i;for(let i of [a.header,a.footer])if(i){for(let s of i.anchoredDrawings??[])if(s.anchorParagraphId===t&&yu(s,n,r))return s}}return null}function l0(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=$d(e.layout(),n.paragraphId,n.offset),a=t.kind==="pointer"?t.drawingNodeId:null;return HC(o,n.paragraphId,n.offset,a)??_C(e,n.paragraphId,n.offset,a)}function d0(e,t){let n=e.storyScope(),r=e.session.partFor(n)??e.session.part(),o=Ha(r,t.drawingNodeId);return !o||o.kind!=="drawing"?null:mb$1(o,{ownerPartName:t.ownerPartName,supportedMcRequires:fb$1,limits:eb$1,resolveRelationship:hb$1(e.session.currentPackage(),t.ownerPartName)})}function c0(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 BC(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 u0(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 $C(e){return e.kind==="inlineDrawing"?"inline":e.wrap}function Cn(e){let t=Xa(e);if(!t||t.placeholderGraphicKind!==null)return null;let n=e?d0(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:mu(t.crop),rotationDegrees:r.rotationDegrees,wrap:$C(t),position:c0(n),name:n.name,title:n.title,description:n.description,hyperlink:n.hyperlinkHref,locks:n.locks,hidden:n.hidden,resourceStatus:t.resource.kind,intrinsic:BC(t),...u0(n)})}function f0(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 bu(e){if("drawingNodeId"in e&&typeof e.drawingNodeId=="string")return e.drawingNodeId}function p0(e){if("expectedPackageRevision"in e&&typeof e.expectedPackageRevision=="number")return e.expectedPackageRevision}function vu(e){return bu(e)!==void 0||p0(e)!==void 0||e.type==="setImageProperties"&&e.selectionParagraphId!==void 0}function xu(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};let o=p0(t);if(o!==void 0&&r.session.packageRevision()!==o)return {ok:false,code:"notFound",reason:"stale package revision"};let a=bu(t),i=Cn(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:l}=r.state().selection;if(s.paragraphId!==t.selectionParagraphId||s.offset!==t.selectionOffset||l.paragraphId!==t.selectionParagraphId||l.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return Eo(e,n,{requireDrawing:a!==void 0||n.drawingNodeId!==null,drawingNodeId:a??n.drawingNodeId??void 0})}function br(e,t){let n=Cn(e),r=bu(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 qC(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 Hs(e,t){return qC(e.applyDrawingOps(t))}function ZC(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 KC(e){return e.borderWidthEmu!==void 0||e.borderColor!==void 0}function VC(e){return e.horizontalEmu!==void 0||e.verticalEmu!==void 0||e.relativeToH!==void 0||e.relativeToV!==void 0}function zC(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||zi(e)}function m0(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 Ya(e){return DC.has(e.type)}function jC(e){return NC.has(e.type)}function g0(e){return {ok:false,code:"unsupported",reason:`${e.type} is asynchronous; use executeImageCommand`}}function h0(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 Qa(e){let t=e.surface;if(!t)return null;let{anchor:n}=t.state().selection,r=Cn(t);return Object.freeze({mountGeneration:e.mountGeneration,packageRevision:t.session.packageRevision(),drawingNodeId:r?.id??null,selectionParagraphId:n.paragraphId,selectionOffset:n.offset})}function Eo(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=Cn(r),s=n.drawingNodeId??t.drawingNodeId;if(!i||!s||i.id!==s)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return null}function Ja(e,t){if(!Ya(e))return null;if(!t)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=Pn(e,t);if(n)return n;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 a=br(t,e);return "ok"in a?a:null}let r=br(t,e);if("ok"in r)return r;let o=Cn(t);if(!o)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 o.locks.select?{ok:false,code:"locked",reason:"the drawing cannot be selected"}:null;case "setImageWrapType":return o.canChangeWrap?null:{ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};case "transformImage":return o.locks.changeAspect||o.locks.resize?{ok:false,code:"locked",reason:"the drawing is locked"}:null;case "setImagePosition":if(!o.canMove||o.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};if(!VC(e))return {ok:false,code:"invalidArgs",reason:"setImagePosition requires at least one field"};let a=o.position?.mode??"frame";return Bi(e,a)?wi(m0(e,o))?null:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"}:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"};case "setImageProperties":{if(KC(e))return {ok:false,code:"unsupported",reason:"image border properties are not supported yet"};if(!zC(e))return {ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"};if(e.resetToNaturalSize&&!o.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&&!o.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.heightEmu!==void 0&&!o.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.crop!==void 0&&!hu(e.crop))return {ok:false,code:"invalidArgs",reason:"crop values are out of range"};if(e.crop!==void 0&&!o.canCrop)return {ok:false,code:"locked",reason:"crop cannot be changed on this drawing"};if(e.hyperlink!==void 0&&e.hyperlink!==null&&!L(e.hyperlink).ok)return {ok:false,code:"invalidArgs",reason:"unsafe hyperlink URL"};if(e.wrap!==void 0&&!o.canChangeWrap)return {ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};if(zi(e)){if(!o.canMove||o.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};let i=o.position?.mode??"frame";if(!Bi(e,i))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"};if(!wi(Ai(e,o)))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"}}return null}default:return null}}function Su(e,t){let n=h0(t,e.type);if(n)return n;let r=Ja(e,t);return r||{ok:true}}function y0(e,t){let n=Ja(e,t);return n||g0(e)}function b0(e,t,n){if(jC(t))return g0(t);let r=n&&vu(t)?Qa(n):null;if(r&&n){let o=xu(n,t,r);if(o)return o}switch(t.type){case "deleteImage":{let o=br(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=br(e,t);return "ok"in o?o:Hs(e,[{op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.target}])}case "transformImage":{let o=br(e,t);return "ok"in o?o:Hs(e,[{op:"transformDrawing",drawingNodeId:o.id,action:t.action}])}case "setImagePosition":{let o=br(e,t);if("ok"in o)return o;let a=Cn(e),i=m0(t,a);return Hs(e,[{op:"positionDrawing",drawingNodeId:o.id,position:i}])}case "setImageProperties":{let o=br(e,t);if("ok"in o)return o;let a=Cn(e);if(!a)return {ok:false,code:"notFound",reason:"no drawing is selected"};let i=[];if(t.resetToNaturalSize){let d=ZC(a);if(!d)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};i.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:d});}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:gu(t.crop)});let s=t.title??t.alt,l=t.description??t.alt;if((s!==void 0||l!==void 0)&&i.push({op:"setDrawingMetadata",drawingNodeId:o.id,title:s??a.title,description:l??a.description}),t.wrap!==void 0&&i.push({op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.wrap}),zi(t)){let d=Ai(t,a);i.push({op:"positionDrawing",drawingNodeId:o.id,position:d});}if(t.hyperlink!==void 0){let d=e.applyImageProperties({drawingNodeId:o.id,ops:i,hyperlink:t.hyperlink});return d.ok?null:{ok:false,code:"invalidArgs",reason:d.detail??d.reason??"setImageProperties was refused"}}return i.length===0?{ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"}:Hs(e,i)}default:return null}}function WC(e,t,n,r,o){let a=fc$1(e.sectionPropertiesAt(t)),i=a.width-a.margin.left-a.margin.right,s=a.height-a.margin.top-a.margin.bottom,l=$d(e.layout(),t,n),d=l&&l.box.width>0?Math.min(l.box.width,i):i,u=Math.min(1,d/r,s/o);return u>=1?{widthPoints:r,heightPoints:o}:{widthPoints:r*u,heightPoints:o*u}}async function wu(e,t){let n=e.surface;if(!n)return {ok:false,code:"notFound",reason:"no document is loaded"};let r=h0(n,t.type);if(r)return r;let o=Ja(t,n);if(o)return o;let a=Qa(e);if(!a)return {ok:false,code:"notFound",reason:"no document is loaded"};if(t.type==="insertImage"){let{anchor:f}=n.state().selection,p=t.expectedPackageRevision??a.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let m=WC(n,f.paragraphId,f.offset,t.widthPoints,t.heightPoints),h=await n.insertImage({paragraphId:f.paragraphId,offset:f.offset,bytes:t.data,mime:t.mime,widthPoints:m.widthPoints,heightPoints:m.heightPoints,expectedPackageRevision:p,commitGuard:()=>Eo(e,a)===null,...t.title!==void 0?{title:t.title}:{},...t.description!==void 0?{description:t.description}:{},...t.hyperlink!==void 0?{hyperlink:t.hyperlink}:{}}),x=Eo(e,a);return x||(h.ok?{ok:true,changed:h.change!==null}:{ok:false,code:"invalidArgs",reason:h.detail==="stale-package-epoch"?"stale package revision":h.detail??h.reason??"insertImage was refused"})}let i=br(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 l=t.mime??"image/png",d=await n.replaceImage(i.id,t.data,l,{expectedPackageRevision:s,commitGuard:()=>Eo(e,a,{requireDrawing:true,drawingNodeId:i.id})===null}),u=Eo(e,a,{requireDrawing:true,drawingNodeId:i.id});return u||(d.ok?{ok:true,changed:d.change!==null}:{ok:false,code:"invalidArgs",reason:d.detail==="stale-package-epoch"?"stale package revision":d.detail??d.reason??"replaceImage was refused"})}var UC=1,GC=10,ei=12700;function XC(e,t){if(!t||t.hidden||t.locks.select)return Object.freeze({canResize:false,canMove:false,aspectLocked:true});let n=u0(t);return Object.freeze({canResize:n.canResize,canMove:n.canMove,aspectLocked:t.locks.changeAspect})}function YC(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=ed(o,r.drawingNodeId);if(!a)return null;let i=d0(e,r);if(!i||i.locks.select)return null;let s=XC(r,i),d=e.editingMode()==="edit"&&e.session.editable?s:{...s,canResize:false,canMove:false},u=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:c0(i),anchorFrameOrigin:u,transform:r.transform,...d})}function Rt(e){return Math.round(e*ei)}function Ro(e){return e/ei}function QC(e,t,n,r,o,a){let i=Ro(e),s=Ro(t),l=i/s,d=n.includes("e")?r:n.includes("w")?-r:0,u=n.includes("s")?o:n.includes("n")?-o:0;if(i=Math.max(1,i+d),s=Math.max(1,s+u),a)if(n.length===2){let p=Math.max(i/Ro(e),s/Ro(t));i=Math.max(1,Ro(e)*p),s=Math.max(1,i/l);}else n==="e"||n==="w"?s=Math.max(1,i/l):i=Math.max(1,s*l);return Object.freeze({cx:Rt(i),cy:Rt(s)})}function Iu(e,t,n){return e.mode==="simple"?Object.freeze({mode:"simple",horizontalEmu:(e.horizontalEmu??0)+Rt(t),verticalEmu:(e.verticalEmu??0)+Rt(n)}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu+Rt(t)}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu+Rt(n)}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}function JC(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"}:Eo(e,t.preconditions,{requireDrawing:true,drawingNodeId:t.drawingNodeId}):{ok:false,code:"notFound",reason:"no document is loaded"}}function v0(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 ku(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 Tu(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId===n.paragraphId){let d=e.session.paraIdOf(t.paragraphId);return d===null?null:{from:{paraId:d},to:{paraId:d}}}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 x0(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 S0(e,t){if(!e)return [];if(t!==void 0&&t.part!=="body")return [];let n=e.session.part(),r=e.session.paragraphAnchors();return d$1(n).map(o=>{let a=r.paraIdByNode.get(o.id),i=o.kind==="textValue"?void 0:i$3(o);return {...a!==void 0?{paraId:a}:{},text:Pi(n,o.id)??"",...i!==void 0?{styleId:i}:{}}})}function Pu(e){return e?e.state().pageCount:0}function Cu(e,t="caret"){return e?e.currentPage(t):1}function eR(e,t){if(!hr(e))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"not a table command"}};let n=_s(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 tR(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 _s(e,t){let n=tR(e,t),r=jn(n),o=Lf$1(t.session.currentPackage());return r.ok&&r.ops.some(a=>qi(n.part,o,a))&&(r={ok:false,code:"locked",reason:Wa}),r.ok?{can:{ok:true},plan:r}:{can:{ok:false,code:r.code,reason:r.reason},plan:r}}function ti(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 s=t?.activeScope?.()??{kind:"body"};if(s.kind!=="headerFooter"||s.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=Va(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"}};let a=o.mutating?Pn(e,t):null;if(a)return {ok:false,refusal:a};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:s,head:l}=t.state().selection;if(s.paragraphId===l.paragraphId&&s.offset===l.offset)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing is selected"}}}if(e.type==="setParagraphStyle"&&!t.session.documentStyles().some(s=>s.type==="paragraph"))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"this document defines no paragraph styles"}};if(e.type==="pasteFormatting"&&t.formatPainter.state().level==="none")return {ok:false,refusal:{ok:false,code:"notFound",reason:Tb}};if(e.type==="undo"&&!t.state().canUndo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to undo"}};if(e.type==="redo"&&!t.state().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==="editTextFormField"&&!t.canEditTextFormField())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"field options are unavailable"}};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 l=t.sectionBreakRefusal(e.kind==="section"?"nextPage":"continuous");if(l)return {ok:false,refusal:{ok:false,code:"unsupported",reason:l}}}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 s=t.headerFooterState?.();if((e.sectionIndex??s?.sectionIndex??0)===0)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}}}if(hr(e)){let s=eR(e,t);return s.ok?{ok:true,tablePlan:s.tablePlan}:s}let i=Ja(e,t);return i&&!i.ok?{ok:false,refusal:i}:{ok:true}}function w0(e,t){let n=e.session.part();if(!t.startsWith(`${n.name}#`)||!Ha(n,t))return true;let r=Ia(n,t),o=0;for(;r;){if(r.kind==="tableCell"||r.kind==="generic"&&r.localName==="tc"||(o+=1)>64)return true;r=Ia(n,r.id);}return false}function I0(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!w0(e,t.selection.head.paragraphId))return null;let r=xa$2(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 Ru(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!w0(e,t.selection.head.paragraphId))return null;let r=xa$2(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 k0(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}function T0(e){return !!e&&Yt(e.session.part(),e.state().selection.head)!==void 0}var pe={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_paragraph:["M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z"],lock:["M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80Zm-120 480v-400 400Z"],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 Oo={activeTarget:"all",spec:{style:"single",size:8,color:{kind:"hex",value:"000000"}}},C0=["table.borderTarget","table.borderColor","table.borderStyle","table.borderWidth","table.cellFill"];function Eu(e){return createT(en$1)(e)}function ni(e){return C0.includes(e)}function oR(e){return e!=null}var R0=[{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"}],E0=[{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"}],aR=[{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 iR(e){return e==="all"||e==="outside"||e==="inside"||e==="top"||e==="bottom"||e==="left"||e==="right"}function sR(e){return e==="none"||iR(e)}function P0(e){if(!e||typeof e!="object")return false;let t=e.kind;return t==="hex"||t==="theme"||t==="auto"}function lR(e){return E0.some(t=>t.value===e)}function jr(e,t,n){switch(t){case "table.borderTarget":return sR(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(!P0(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(!lR(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&&!P0(n)?null:{command:{type:"setCellFill",color:n},nextDraft:e};default:return null}}function Ou(e,t=Oo){switch(e){case "table.borderTarget":return {type:"setTableBorders",scope:t.activeTarget,spec:t.spec};case "table.borderColor":return jr(t,e,{kind:"hex",value:"000000"})?.command??null;case "table.borderStyle":return jr(t,e,"single")?.command??null;case "table.borderWidth":return jr(t,e,8)?.command??null;case "table.cellFill":return {type:"setCellFill",color:{kind:"hex",value:"FFFF00"}};default:return null}}function dR(e){return R0.find(n=>n.value===e)?.labelKey??"table.borders.all"}function cR(e){return pe[e]}function vr(e){return e.surface??null}var uR={"review.comments":{type:"toggleReviewPane"},"review.paragraphMarks":{type:"toggleParagraphMarks"},"review.protectDocument":{type:"toggleDocumentProtection"},"review.simpleMarkup":{type:"setReviewDisplayMode",mode:"simple-markup"},"review.allMarkup":{type:"setReviewDisplayMode",mode:"all-markup"},"review.noMarkup":{type:"setReviewDisplayMode",mode:"proposed"},"review.original":{type:"setReviewDisplayMode",mode:"original"},"review.previousChange":{type:"navigateReviewChange",direction:"previous"},"review.nextChange":{type:"navigateReviewChange",direction:"next"},"review.acceptAllChanges":{type:"resolveAllReviewChanges",action:"accept"},"review.rejectAllChanges":{type:"resolveAllReviewChanges",action:"reject"},"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 fR(e){return M0[e]??null}var O0=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e=>e.charCodeAt(0)),M0={"text.link":{type:"insertHyperlink",href:"https://example.com"},"image.insert":{type:"insertImage",data:O0,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 $s(e){return uR[e]??null}var pR={"font.family":{mark:"fontFamily",attr:"family"},"font.size":{mark:"fontSize",attr:"val"},"text.color":{mark:"color",attr:"val"},"text.highlight":{mark:"highlight",attr:"val"}},F0={"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 A0(e,t,n){return jr(n,e,t)?.command??null}function Bs(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(ni(e))return A0(e,t,Oo);if(e==="image.wrap")return typeof t!="string"||!db$1.includes(t)?null:{type:"setImageWrapType",target:t};if(e==="image.altText")return typeof t!="string"?null:{type:"setImageProperties",description:t};let n=pR[e];return n?{type:"setMarkAttr",mark:n.mark,attr:n.attr,value:t}:null}function L0(e,t,n=Oo){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let r=Ou(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}}var mR=["editing","suggesting","viewing"];function N0(e,t){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};if(ni(t))return L0(e,t);if(t==="review.editingMode"){let a=e.getEditingMode?.()??"editing",i=mR.filter(d=>d!==a).map(d=>e.can(Bs(t,d))),s=i.some(d=>d.ok),l=i.find(d=>!d.ok);return {id:t,enabled:s,disabledReason:!s&&l&&!l.ok?l.reason:null,active:false,value:a}}if(t==="format.painter"){let a=vr(e);if(!a)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let i=a.formatPainter.state();if(i.mode!=="off")return {id:t,enabled:true,disabledReason:null,active:true,value:i.mode};let s=e.can({type:"clearFormatting"});return s.ok?{id:t,enabled:true,disabledReason:null,active:false,value:i.mode}:{id:t,enabled:false,disabledReason:s.reason,active:false,value:i.mode}}if(t==="contentControl.showAll"||t==="contentControl.formFill"){let a=vr(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=vr(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}}if(t==="review.authors"){let a=e.can({type:"toggleReviewPane"});return a.ok?(e.getReviewAuthors?.().length??0)>0?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"the document has no review authors",active:false}:{id:t,enabled:false,disabledReason:a.reason,active:false}}let n=$s(t);if(!n){let a=F0[t];if(a!==void 0){let s=Bs(t,a);if(!s)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let l=e.can(s),d=e.getSelectedImage?.()??null,u=t==="image.wrap"?d?.wrap:t==="image.altText"?d?.description:kb(e,t);return l.ok?{id:t,enabled:true,disabledReason:null,active:false,...u!==void 0?{value:u}:{}}:{id:t,enabled:false,disabledReason:l.reason,active:false,...u!==void 0?{value:u}:{}}}let i=M0[t];if(i){if(t==="image.insert"&&i.type==="insertImage"){let l=e.canExecuteImageCommand?.({type:"insertImage",data:O0,mime:"image/png",widthPoints:72,heightPoints:72})??e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="image.properties"&&i.type==="setImageProperties"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="table.insert"&&i.type==="insertTable"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="paragraph.dialog"&&i.type==="setParagraphFormat"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.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 gR(e){if(e==="format.painter")return true;let t=$s(e);return t?.type==="toggleMark"||t?.type==="toggleParagraphMarks"||t?.type==="toggleDocumentProtection"||t?.type==="setReviewDisplayMode"||t?.type==="setAlignment"}function hR(e,t){return t.map(n=>N0(e,n))}function yR(e,t,n,r){if(!e)return {result:{ok:false,code:"unsupported",reason:"editor is not ready"},nextDraft:null};let o=jr(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}}var bR=new Set(["format.painter","contentControl.showAll","contentControl.formFill","contentControl.inspector","contentControl.remove"]);function vR(e,t,n,r){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(n&&typeof n=="object"&&("historyGroup"in n||"scope"in n||Object.keys(n).length===0)){if(r||F0[t]!==void 0||ni(t))return {ok:false,code:"invalidArgs",reason:"pass a toolbar value before command options"};r=n,n=void 0;}if(r?.historyGroup!==void 0&&bR.has(t))return {ok:false,code:"unsupported",reason:`${t} does not take a history group`};if(t==="format.painter"){let i=vr(e);if(!i)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(i.formatPainter.state().mode==="off"){let s=e.can({type:"clearFormatting"});if(!s.ok)return {ok:false,code:s.code,reason:s.reason}}return i.formatPainter.press()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:Os}}if(t==="contentControl.showAll"){let i=vr(e);return i?(i.contentControls.setShowAll(!i.contentControls.showAll()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.formFill"){let i=vr(e);return i?(i.contentControls.setFormFill(!i.contentControls.formFill()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.inspector"){let i=vr(e);return i?i.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 i=vr(e);if(!i)return {ok:false,code:"unsupported",reason:"editor is not ready"};let s=i.state().contentControls.activeControlId;if(!s)return {ok:false,code:"notFound",reason:"no content control at the selection"};let l=i.contentControls.disabledReason(s,"remove");return l?{ok:false,code:l==="bound"?"bound":"locked",reason:l}:i.contentControls.remove(s)?{ok:true,changed:true}:{ok:false,code:i.state().lastRejection??"unsupported",reason:i.state().lastRejection??"removeContentControl was refused"}}let o=n===void 0?$s(t):Bs(t,n);if(!o)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 a=e.can(o,r);return a.ok?e.exec(o,r):{ok:false,code:a.code,reason:a.reason}}function xR(e){return e?e.save():Promise.reject(new Error("editor is not ready"))}function SR(e,t){if(!e)return {enabled:false,disabledReason:"editor is not ready"};let n=_s(t,e);return n.can.ok?{enabled:true,disabledReason:null}:{enabled:false,disabledReason:n.can.reason}}function wR(e,t,n){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};let r=e.can(t,n);return r.ok?e.exec(t,n):{ok:false,code:r.code,reason:r.reason}}function Mu(e){return e instanceof Uint8Array?Array.from(e):Array.isArray(e)?e.map(Mu):e===null||typeof e!="object"?e:Object.fromEntries(Object.keys(e).sort().map(t=>[t,Mu(e[t])]))}function IR(e){return JSON.stringify(Mu(e))}var D0={id:"review",labelKey:"formattingBar.commentsAndChanges",controls:[{id:"simpleMarkup",shape:"icon",labelKey:"review.simpleMarkup",defaultToolbar:false,paths:pe.visibility,state:{kind:"command"}},{id:"allMarkup",shape:"icon",labelKey:"review.allMarkup",defaultToolbar:false,paths:pe.visibility,state:{kind:"command"}},{id:"noMarkup",shape:"icon",labelKey:"review.noMarkup",defaultToolbar:false,paths:pe.visibility,state:{kind:"command"}},{id:"original",shape:"icon",labelKey:"review.original",defaultToolbar:false,paths:pe.visibility,state:{kind:"command"}},{id:"previousChange",shape:"icon",labelKey:"review.previousChange",defaultToolbar:false,paths:pe.keyboard_arrow_up,state:{kind:"command"}},{id:"nextChange",shape:"icon",labelKey:"review.nextChange",defaultToolbar:false,paths:pe.keyboard_arrow_down,state:{kind:"command"}},{id:"acceptAllChanges",shape:"icon",labelKey:"review.acceptAllChanges",defaultToolbar:false,paths:pe.check,state:{kind:"command"}},{id:"rejectAllChanges",shape:"icon",labelKey:"review.rejectAllChanges",defaultToolbar:false,paths:pe.close,state:{kind:"command"}},{id:"paragraphMarks",shape:"icon",labelKey:"formattingBar.paragraphMarks",defaultToolbar:false,paths:pe.format_paragraph,state:{kind:"command"}},{id:"protectDocument",shape:"icon",labelKey:"review.protectDocument",defaultToolbar:false,paths:pe.lock,state:{kind:"command"}},{id:"comments",shape:"icon",labelKey:"formattingBar.commentsAndChanges",paths:pe.comment,state:{kind:"command"}},{id:"authors",shape:"dropdown",labelKey:"reviewers.label",paths:pe.visibility,defaultToolbar:false,state:{kind:"command"}},{id:"editingMode",shape:"dropdown",labelKey:"editingMode.label",valueKey:"editingMode.editing",paths:pe.edit_note,state:{kind:"command"}}]};var Fu=[{id:"history",labelKey:"formattingBar.groups.history",controls:[{id:"undo",labelKey:"formattingBar.undoShortcut",paths:pe.undo,state:{kind:"command"}},{id:"redo",labelKey:"formattingBar.redoShortcut",paths:pe.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:pe.format_bold,state:{kind:"command"}},{id:"italic",labelKey:"formattingBar.italicShortcut",paths:pe.format_italic,state:{kind:"command"}},{id:"underline",labelKey:"formattingBar.underlineShortcut",paths:pe.format_underlined,state:{kind:"command"}},{id:"strike",labelKey:"formattingBar.strikethrough",paths:pe.strikethrough_s,state:{kind:"command"}},{id:"color",shape:"colorSplit",swatch:"#ff0000",labelKey:"formattingBar.fontColor",paths:pe.format_color_text,state:{kind:"value"}},{id:"highlight",shape:"colorSplit",swatch:"#ffff00",labelKey:"formattingBar.highlightColor",paths:pe.ink_highlighter,state:{kind:"value"}},{id:"link",labelKey:"formattingBar.insertLinkShortcut",paths:pe.link,state:{kind:"command"}}]},{id:"script",labelKey:"formattingBar.groups.script",controls:[{id:"super",labelKey:"formattingBar.superscript",paths:pe.superscript,state:{kind:"command"}},{id:"sub",labelKey:"formattingBar.subscript",paths:pe.subscript,state:{kind:"command"}}]},{id:"alignment",labelKey:"formattingBar.groups.alignment",controls:[{id:"left",labelKey:"alignment.alignLeft",paths:pe.format_align_left,state:{kind:"command"}},{id:"center",labelKey:"alignment.center",paths:pe.format_align_center,state:{kind:"command"}},{id:"right",labelKey:"alignment.alignRight",paths:pe.format_align_right,state:{kind:"command"}},{id:"justify",labelKey:"alignment.justify",paths:pe.format_align_justify,state:{kind:"command"}}]},{id:"list",labelKey:"formattingBar.groups.listFormatting",controls:[{id:"bullet",labelKey:"lists.bulletList",paths:pe.format_list_bulleted,state:{kind:"command"}},{id:"numbered",labelKey:"lists.numberedList",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"outdent",labelKey:"lists.decreaseIndent",paths:pe.format_indent_decrease,state:{kind:"command"}},{id:"indent",labelKey:"lists.increaseIndent",paths:pe.format_indent_increase,state:{kind:"command"}},{id:"lineSpacing",shape:"dropdown",labelKey:"lineSpacing.label",paths:pe.format_line_spacing,state:{kind:"command"}}]},{id:"format",labelKey:"formattingBar.groups.format",controls:[{id:"painter",labelKey:"formattingBar.formatPainterShortcut",paths:pe.format_paint,state:{kind:"command"}},{id:"clear",labelKey:"formattingBar.clearFormatting",paths:pe.format_clear,state:{kind:"command"}}]},D0,{id:"contentControl",labelKey:"contentControl.group",contextual:true,controls:[{id:"showAll",labelKey:"contentControl.showAll",paths:pe.visibility,state:{kind:"command"}},{id:"formFill",labelKey:"contentControl.formFill",paths:pe.edit_note,state:{kind:"command"}},{id:"inspector",labelKey:"contentControl.inspector",paths:pe.tune,state:{kind:"command"}},{id:"remove",labelKey:"contentControl.remove",paths:pe.delete,state:{kind:"command"}}]},{id:"image",labelKey:"formattingBar.groups.image",contextual:true,controls:[{id:"insert",labelKey:"toolbar.image",paths:pe.image,state:{kind:"command"}},{id:"properties",labelKey:"formattingBar.imagePropertiesShortcut",paths:pe.tune,state:{kind:"command"}},{id:"wrap",shape:"dropdown",labelKey:"formattingBar.imageWrap",paths:pe.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:pe.table,state:{kind:"command"}},{id:"borderTarget",shape:"dropdown",labelKey:"table.borders.tooltip",paths:pe.border_all,state:{kind:"value"}},{id:"borderColor",shape:"colorSplit",swatch:"#000000",labelKey:"table.borderColor",paths:pe.border_color,state:{kind:"value"}},{id:"borderStyle",shape:"dropdown",labelKey:"table.borders.styleAriaLabel",paths:pe.border_horizontal,state:{kind:"value"}},{id:"borderWidth",shape:"dropdown",labelKey:"table.borderWidth",paths:pe.line_weight,state:{kind:"value"}},{id:"cellFill",shape:"colorSplit",swatch:"#ffffff",labelKey:"table.cellFillColor",paths:pe.format_color_fill,state:{kind:"value"}}]},{id:"paragraph",labelKey:"dialogs.paragraph.title",contextual:true,controls:[{id:"dialog",labelKey:"lineSpacing.options",paths:pe.format_line_spacing,state:{kind:"command"}}]},{id:"file",labelKey:"toolbar.file",contextual:true,controls:[{id:"open",labelKey:"toolbar.open",paths:pe.file_upload,state:{kind:"load"}},{id:"save",labelKey:"toolbar.saveShortcut",paths:pe.file_download,state:{kind:"save"}},{id:"pageSetup",labelKey:"toolbar.pageSetup",paths:pe.settings,state:{kind:"command"}}]},{id:"insert",labelKey:"toolbar.insert",contextual:true,controls:[{id:"footnote",labelKey:"toolbar.insertFootnote",paths:pe.superscript,state:{kind:"command"}},{id:"endnote",labelKey:"toolbar.insertEndnote",paths:pe.edit_note,state:{kind:"command"}},{id:"pageNumber",labelKey:"headerFooter.insertPageNumber",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"totalPages",labelKey:"headerFooter.insertTotalPages",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"sectionPages",labelKey:"headerFooter.insertSectionPages",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"pageXofY",labelKey:"headerFooter.insertPageXofY",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"pageBreak",labelKey:"toolbar.pageBreak",paths:pe.page_break,state:{kind:"command"}},{id:"sectionBreakNextPage",labelKey:"toolbar.sectionBreakNextPage",paths:pe.horizontal_rule,state:{kind:"command"}},{id:"sectionBreakContinuous",labelKey:"toolbar.sectionBreakContinuous",paths:pe.border_horizontal,state:{kind:"command"}},{id:"toc",labelKey:"toolbar.tableOfContents",paths:pe.toc,state:{kind:"command"}}]}],H0=Fu;function kR(e,t){return `${e.id}.${t.id}`}function _0(){return H0.filter(e=>!e.contextual).map(e=>({...e,controls:e.controls.filter(t=>t.defaultToolbar!==false)}))}function TR(e){let t=_0();if(!e)return t;let n=H0.find(r=>r.id==="image");return n?[...t,n]:t}var B0=[{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.painter",labelKey:"formattingBar.formatPainter"},{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:pe.page_break,items:[{kind:"item",slot:"insert.pageBreak"},{kind:"item",slot:"insert.sectionBreakNextPage"},{kind:"item",slot:"insert.sectionBreakContinuous"}]},{kind:"item",slot:"insert.toc"}]},{id:"review",labelKey:"toolbar.review",entries:[{kind:"submenu",labelKey:"review.displayForReview",paths:pe.visibility,items:[{kind:"item",slot:"review.simpleMarkup"},{kind:"item",slot:"review.allMarkup"},{kind:"item",slot:"review.noMarkup"},{kind:"item",slot:"review.original"}]},{kind:"separator"},{kind:"item",slot:"review.previousChange"},{kind:"item",slot:"review.nextChange"},{kind:"separator"},{kind:"item",slot:"review.acceptAllChanges"},{kind:"item",slot:"review.rejectAllChanges"},{kind:"separator"},{kind:"item",slot:"review.paragraphMarks"},{kind:"separator"},{kind:"item",slot:"review.protectDocument"}]},{id:"help",labelKey:"toolbar.help",entries:[]}];function PR(){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 B0)t(n.entries);return e}function CR(){return Fu.reduce((e,t)=>e+t.controls.length,0)}var RR="formattingBar.unavailableInPreview";function $0(e){let t="select[data-docx-form-dropdown]",n=d=>d instanceof Element?d.closest(t):null,r=d=>{let u=d.closest("[data-start][data-paragraph-id]"),f=u?.dataset.paragraphId;if(!u||!f)return null;let p=e.part(f),m=Ha(p,f);if(m?.kind!=="paragraph")return null;let h=Number(u.dataset.start),x=wh(m).find(b=>b.start<=h&&h<b.end);if(!x)return null;let v={op:"setLegacyDropdown",paragraphId:f,fieldNodeId:x.fieldNodeId,selectedIndex:d.selectedIndex};return {field:x,paragraphId:f,op:v,enabled:e.editable()&&e.canApply(v)&&hi$1(e.settings(),v)===null&&Vi(p,v)===null}},o=()=>{for(let d of e.pagesLayer.querySelectorAll(t))d.disabled=!r(d)?.enabled;},a=d=>{let u=n(d.target);u&&(d.stopPropagation(),r(u)?.enabled||d.preventDefault());},i=d=>{let u=n(d.target);u&&(u.disabled=!r(u)?.enabled);},s=d=>{let u=n(d.target);if(!u)return;d.stopPropagation();let f=r(u);if(!f)return;if(!f.enabled||!e.apply(f.op)){u.selectedIndex=f.field.selectedIndex;return}e.select({anchor:{paragraphId:f.paragraphId,offset:f.field.start},head:{paragraphId:f.paragraphId,offset:f.field.end}}),[...e.pagesLayer.querySelectorAll(t)].find(m=>{let h=m.closest("[data-start][data-paragraph-id]");return h?.dataset.paragraphId===f.paragraphId&&Number(h.dataset.start)===f.field.start})?.focus({preventScroll:true});},l=new MutationObserver(d=>{for(let u of d)for(let f of u.addedNodes){if(!(f instanceof Element))continue;let p=f.matches(t)?[f]:f.querySelectorAll(t);for(let m of p)m.disabled=!r(m)?.enabled;}});return l.observe(e.pagesLayer,{childList:true,subtree:true}),e.pagesLayer.addEventListener("pointerdown",a,true),e.pagesLayer.addEventListener("focusin",i),e.pagesLayer.addEventListener("change",s),o(),{sync:o,keydown(d){let u=n(d.target);if(!u)return false;d.stopPropagation();let f=d.key.toLowerCase();return (d.ctrlKey||d.metaKey)&&!d.altKey&&(f==="z"||f==="y")?(d.preventDefault(),e.pagesLayer.focus({preventScroll:true}),e.history(f==="y"||d.shiftKey?"redo":"undo"),true):(!r(u)?.enabled&&d.key!=="Tab"&&d.preventDefault(),true)},destroy(){l.disconnect(),e.pagesLayer.removeEventListener("pointerdown",a,true),e.pagesLayer.removeEventListener("focusin",i),e.pagesLayer.removeEventListener("change",s);}}}function q0(e,t){let n=Ia(e,t.id);for(let a=0;n&&a<64&&(n.namespaceUri===da$1&&n.localName==="customXml"||Ed(n)||Fd(n));a+=1)n=Ia(e,n.id);if(!n)return [];let r=Id(n.children),o=r.findIndex(a=>a.id===t.id);return o>=2?r.slice(o-2,o):[]}function Z0(e){let t=n=>n.kind==="textValue"?/^[ \t\u00a0]*$/.test(n.value):n.namespaceUri!==da$1?false:n.localName==="pPr"?!n.children.some(r=>r.kind!=="textValue"&&r.localName==="sectPr"):n.localName==="rPr"||n.localName==="tab"||["bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","proofErr"].includes(n.localName)?true:["p","r","t","hyperlink"].includes(n.localName)?n.children.every(t):false;return t(e)}function K0(e,t,n,r,o,a,i,s){let l=Ha(e,n.paragraphId);if(l?.kind!=="paragraph")return null;let[d,u]=q0(e,l);if(u?.kind!=="paragraph"||d?.kind!=="paragraph"||!Z0(u))return null;let f=U(t,l.id)?.marker,p=U(t,d.id)?.marker;if(!f||f.numId!==p?.numId||f.level!==p.level||U(t,u.id)?.marker)return null;let m=(A,O,$,y)=>({id:A,kind:O,localName:$,namespaceUri:da$1,prefix:"w",namespaceBindings:[],attributes:[],children:y}),h=l.children.find(A=>A.kind==="paragraphProperties"),x=h&&{...h,children:h.children.filter(A=>A.localName!=="sectPr")},v=zh$1({localName:"pStyle",attributes:{val:o}},"separator-style"),b=r.map((A,O)=>zh$1(A,`separator-format-${O}`));i&&b.push(zh$1({localName:"ins",attributes:{id:cg(e,s)(),author:i.author,...i.date?{date:i.date}:{}}},"separator-insertion"));let I=m("separator-mark","runProperties","rPr",b),k=m("separator-properties","paragraphProperties","pPr",[...v?[v]:[],...b.length?[I]:[]]),C=[...k.children],T=a?.styles.has(o)?k:m("separator-defaults","paragraphProperties","pPr",[]);return a&&Kb$1(Fb$1(a,T).paragraphPropertyNodes)&&C.splice(v?1:0,0,m("separator-numbering","generic","numPr",[zh$1({localName:"numId",attributes:{val:"0"}},"separator-number-id")])),{op:"insertFragment",paragraphId:l.id,offset:n.offset,blocks:[m("separator-head","paragraph","p",x?[x]:[]),m("separator-blank","paragraph","p",[m("separator-properties-final","paragraphProperties","pPr",C)])],lastMarkCovered:true}}function qs(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 Zs(e,t,n){e.has(t.paragraphId)||e.set(t.paragraphId,n);for(let r of t.lines)for(let o of Q$1(r))e.has(o.paragraphId)||e.set(o.paragraphId,n);}var V0=new WeakMap,z0=new WeakMap;function ER(e,t){let n=z0.get(e);if(!n){let r=new Map;for(let o of e.pages)qs(o,a=>{a.emptyParagraphStyle&&Zs(r,a,a.emptyParagraphStyle);});n=r,z0.set(e,n);}return n.get(t)}var j0=new WeakMap;function OR(e){let t=j0.get(e);if(t)return t;let n=new Map;return qs(e,r=>Zs(n,r,r.props)),j0.set(e,n),n}function Fo(e,t){let n=V0.get(e);if(!n){n=new Map;for(let r of e.pages)for(let[o,a]of OR(r))n.has(o)||n.set(o,a);V0.set(e,n);}return n.get(t)??[]}var W0=new WeakMap;function MR(e){let t=W0.get(e);if(t)return t;let n=new Map;return qs(e,r=>Zs(n,r,r.tabStops)),W0.set(e,n),n}function ri(e,t){let n=U0.get(e);if(!n){let r=new Map;for(let o of e.pages)for(let[a,i]of MR(o))r.has(a)||r.set(a,i);n=r,U0.set(e,r);}return n.get(t)??null}var U0=new WeakMap,G0=new WeakMap,X0=new WeakMap;function FR(e){let t=X0.get(e);if(t)return t;let n=new Map;return qs(e,(r,o)=>Zs(n,r,{indent:r.indent,inTable:o})),X0.set(e,n),n}function AR(e,t){let n=G0.get(e);if(!n){let r=new Map;for(let o of e.pages)for(let[a,i]of FR(o))r.has(a)||r.set(a,i);n=r,G0.set(e,r);}return n.get(t)??null}function Q0(e,t,n,r,o=ja$1,a){let i=Ha(e,t);if(!i||i.kind!=="paragraph")return false;for(let s of la(i,va$1(i),n,r,o,a))if(qa$2(pa(s.run,"runProperties","rPr"),na).length>0)return true;return false}function Ks(e,t,n,r=ja$1,o){let a=Ha(e,t);if(!a||a.kind!=="paragraph")return [];let i=va$1(a),s=null,l=null;for(let u of ka(a,r,o)){let f=i.get(u.id);!f||f.end<=f.start||(f.start<n&&n<=f.end&&(s=u),l===null&&f.start<=n&&n<f.end&&(l=u));}let d=s??l;return d?qa$2(pa(d,"runProperties","rPr"),na):sa(e,t)}function Mo(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 J0(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:Mo(t,"b")===true};break;case "i":n={...n,italic:Mo(t,"i")===true};break;case "u":n={...n,underline:Mo(t,"u")===true};break;case "strike":n={...n,strikethrough:Mo(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 Au(e,t,n,r){return n&&n.length>0?ua(e,n):ve(e,t,r??W(e))}function Vs(e,t){let n=e.indexOf(t.from.paragraphId),r=e.indexOf(t.to.paragraphId);if(n===-1||r===-1)return [];let o=r>n&&t.to.offset===0?r-1:r;return e.slice(n,o+1)}function zs(e,t,n,r){return Au(e,t,n,r)[0]?.style??null}function Lu(e,t,n,r,o,a){let i=Au(e,t,r,a);if(i.length===0)return false;let s=l=>{switch(n){case "b":return l.style.bold;case "i":return l.style.italic;case "u":return l.style.underline!==null;case "strike":return l.style.strike;case "vertAlign":return l.style.verticalAlign===o;default:return false}};return i.every(s)}function ev(e,t,n,r,o,a,i){let s=Au(e,t,r,a),l=s.length===0?Y0(e,t,r,a).map(H=>ER(e,H)).filter(H=>H!==void 0):[],d=l.length>0?l:s.map(H=>H.style),u=H=>{if(d.length===0)return null;let V=H(d[0]);return d.every(B=>H(B)===V)?V:null},f=(H,V=(B,X)=>B===X)=>H.length>0&&H.every(B=>V(B,H[0]))?H[0]:null,p=(H,V)=>H.props.some(B=>B.localName===V),m=H=>H.style.fontFamily??n?.(H.range.paragraphId,H.props).fontFamily??null,h=H=>p(H,"sz")?Math.round(H.style.fontSizePt*2):n?.(H.range.paragraphId,H.props).fontSizeHalfPoints??Math.round(H.style.fontSizePt*2),x=l.length>0?{fontFamily:u(H=>H.fontFamily??i??null),fontSizeHalfPoints:u(H=>Math.round(H.fontSizePt*2))}:s.length===0?n?.(t.head.paragraphId,[]):void 0,v=Y0(e,t,r,a),b=H=>f(v.map(V=>H(Fo(e,V)))),I=(H,V=(B,X)=>B===X)=>{if(v.length<2)return false;let B=H(Fo(e,v[0]));return v.some((X,ae)=>ae>0&&!V(H(Fo(e,X)),B))},k=b(H=>Na(H)),C=b(H=>jb$1(H,"pStyle")?.val??o??void 0)??null,T=H=>jb$1(H,"spacing")??void 0,A=H=>{let V=T(H),B=Number(V?.line);if(!Number.isFinite(B))return "";let X=V?.lineRule??"auto";return X==="auto"?`multiple:${Math.round(B/240*100)/100}`:`${X==="exact"?"exact":"atLeast"}:${Math.round(B/20*100)/100}`},O=b(A),$=(()=>{if(!O)return null;let[H,V]=O.split(":");return {rule:H,value:Number(V)}})(),y=(H,V)=>{let B=Number(T(H)?.[V]);return Number.isFinite(B)?Math.round(B/20*100)/100:null},R=H=>b(V=>y(V,H)),L=(()=>{let H=v.map(D=>AR(e,D)),V=H[0];if(!V||H.some(D=>D===null||D.inTable))return null;let B=D=>Math.round(D*20),X=D=>B(D.hanging>0?-D.hanging:D.firstLine),ae=H,ce=B(V.indent.left),xe=B(V.indent.right),fe=X(V.indent);return {left:ce,right:xe,firstLine:fe,mixed:{left:ae.some(D=>B(D.indent.left)!==ce),right:ae.some(D=>B(D.indent.right)!==xe),firstLine:ae.some(D=>X(D.indent)!==fe)}}})(),_=H=>b(V=>H(ud(V))),j=b(cb$1),F=b(nb$1);return {bold:d.length>0&&d.every(H=>H.bold),italic:d.length>0&&d.every(H=>H.italic),underline:d.length>0&&d.every(H=>H.underline!==null),strikethrough:d.length>0&&d.every(H=>H.strike),superscript:d.length>0&&d.every(H=>H.verticalAlign==="superscript"),subscript:d.length>0&&d.every(H=>H.verticalAlign==="subscript"),fontFamily:s.length>0?f(s.map(m)):x?.fontFamily??null,fontSizeHalfPoints:s.length>0?f(s.map(h)):x?.fontSizeHalfPoints??null,color:u(H=>H.color),highlight:u(H=>H.highlight),alignment:k,styleId:C,lineSpacing:$,spaceBeforePt:R("before"),spaceAfterPt:R("after"),disagrees:{alignment:I(H=>Na(H)),spaceBeforePt:I(H=>y(H,"before")),spaceAfterPt:I(H=>y(H,"after")),lineSpacing:I(A),tabStops:(()=>{if(v.length<2)return false;let H=JSON.stringify(ri(e,v[0])?.stops??null);return v.some((V,B)=>B>0&&JSON.stringify(ri(e,V)?.stops??null)!==H)})()},indent:L,tabStops:f(v.map(H=>ri(e,H)?.stops??null),(H,V)=>H===null||V===null?H===V:H.length===V.length&&H.every((B,X)=>Math.round(B.positionPt*20)===Math.round(V[X].positionPt*20)&&B.alignment===V[X].alignment&&(B.leader??"none")===(V[X].leader??"none")))?.map(H=>({positionTwips:Math.round(H.positionPt*20),alignment:H.alignment,...H.leader?{leader:H.leader}:{}}))??null,paragraphFlags:{contextualSpacing:F,keepNext:_(H=>H.keepNext),keepLines:_(H=>H.keepLines),widowControl:_(H=>H.widowControl),pageBreakBefore:j}}}function Y0(e,t,n,r){if(n&&n.length>0)return [...ta$1(e,n)];if(t.anchor.paragraphId===t.head.paragraphId)return [t.head.paragraphId];let o=r??W(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 tv(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}]}var LR="list paragraph",NR="ListParagraph";function nv(e){return e.find(t=>t.localName==="pStyle")?.attributes?.val}function js(e){let t=null;for(let n of e)if(n.type==="paragraph"){if(n.name.trim().toLowerCase()===LR)return n.styleId;t===null&&n.styleId===NR&&(t=n.styleId);}return t}function rv(e){let{session:t}=e,n;function r(){let o=t.stylesRoot();return (n===void 0||n.root!==o)&&(n={root:o,styleId:Eb$2(o,t.documentThemeFonts()).defaultParagraphStyleId}),n.styleId}return {applyOps(o){let a=js(t.documentStyles());if(a===null)return [];let i=r(),s=e.storyPart(),l=[];for(let d of o){let u=ra(s,d),f=nv(u);f!==void 0&&f!==i||l.push({op:"setParagraphProperties",paragraphId:d,properties:ta(u,{localName:"pStyle",attributes:{val:a}})});}return l},clearOp(o){let a=js(t.documentStyles());if(a===null)return null;let i=ra(e.storyPart(),o);return nv(i)!==a?null:{op:"setParagraphProperties",paragraphId:o,properties:i.filter(s=>s.localName!=="pStyle")}}}}function ov(e,t){return n=>{let r=nf$1(n),o=r?.name??"/word/styles.xml",a="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",i=r?null:xa$1('<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"/>',{name:o,contentType:a}),s=r??(i?.ok?i.part:null);if(!s)throw new Error("Cannot create list paragraph style");if(s.root.children.some(h=>h.kind!=="textValue"&&h.attributes.some(x=>x.localName==="styleId"&&x.value===t)))return n;let l=Fa(s),d=(h,x={},v=[])=>({...zh$1({localName:h,attributes:x},l()),children:v,...h==="pPr"?{kind:"paragraphProperties"}:{}}),f={...d("style",{type:"paragraph",styleId:t},[d("name",{val:"List Paragraph"}),...e?[d("basedOn",{val:e})]:[],d("uiPriority",{val:"34"}),d("qFormat"),d("pPr",{},[d("ind",{left:"720"}),d("contextualSpacing")])]),namespaceBindings:[{prefix:"w",namespaceUri:da$1}]};if(r){let h=La$1(s,s.root.id,s.root.children.length,[f]);if(!h.ok)throw new Error("Cannot insert list paragraph style");return gc$1(n,h.part)}let p=pc$1(n,o,{...s.root,children:[f]},a);p=nc(p,n.mainDocumentPart);let m=oc(p,n.mainDocumentPart,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",o);if(!m.ok)throw new Error("Cannot link list paragraph style");return m.pkg}}function Ws(e,t){let n=e.ownerDocument,r=e.dataset.docxCcId,o=()=>{n.removeEventListener("pointerdown",a,true),n.removeEventListener("keydown",i,true);},a=s=>{if(e.parentNode===null){o();return}let l=s.target,d=l instanceof Element?l.closest("[data-docx-cc-widget]"):null;l&&(e.contains(l)||d?.getAttribute("data-docx-cc-id")===r)||(o(),t());},i=s=>{s.key!=="Escape"||s.isComposing||(s.preventDefault(),o(),e.parentNode!==null&&(s.stopPropagation(),t()));};return n.addEventListener("pointerdown",a,true),n.addEventListener("keydown",i,true),o}function av(e,t,n,r,o){let i=qe(e).find(f=>f.id===n)?.fragments[0],s=i?e.pages[i.pageIndex]:void 0;if(!i||!s)return null;let l=o?.get(i.pageIndex)??0,d=s.contentBox.x-s.box.x,u=s.contentBox.y-s.box.y;return {left:(s.box.x+l+d+i.box.x)*t,top:(s.box.y+u+i.box.y+i.box.height)*t,element:[...r.querySelectorAll("[data-docx-content-control]")].find(f=>f.dataset.docxContentControl===n)?.querySelector(".docx-content-control-boundary")??void 0,sheetLeft:(s.box.x+l)*t,sheetRight:(s.box.x+l+s.box.width)*t}}function iv(e){return e.kind==="textValue"?e.value:e.localName==="sdtPr"?"":e.children.map(iv).join("")}function Nu(e,t){let n=e?iv(e):"";return t.find(r=>r.displayText===n)?.value??n}function sv(e){let t=e?.children.find(n=>n.kind!=="textValue"&&n.localName==="sdtPr");if(!(!t||t.kind==="textValue")){for(let n of t.children)if(n.kind!=="textValue"){if(n.localName==="dropDownList")return "dropdown";if(n.localName==="comboBox"||n.localName==="date")return n.localName;if(n.localName==="checkbox")return "checkbox";if(n.localName==="picture")return "picture";if(n.localName==="docPartList")return "buildingBlockGallery"}}}var DR=["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"];function lv(e){let t=null,n=false,r=()=>{let o=t;t=null,o&&(e.setOpen(o.id,false),o.controller.abort());};return {cancel:r,destroy(){n=true,r();},open(o,a){if(r(),n||!e.request||!DR.includes(a))return false;let i=new AbortController;t={controller:i,id:o};let s=()=>!n&&t?.controller===i&&!i.signal.aborted,l=()=>s()&&sv(e.find(o))===a&&e.allowed(o),d=e.find(o),u=e.items(o).map(x=>({...x})),f=Nu(d,u),p=a==="picture"?e.picture(o):void 0;if(a==="picture"&&!p)return r(),false;let m=false,h={controlId:o,kind:a,items:u,value:a==="date"?e.date(o)??"":a==="checkbox"?String(e.checked(o)):a==="picture"?p:a==="buildingBlockGallery"?"":f,locale:e.locale(),anchor:[...e.layer.querySelectorAll("[data-docx-content-control]")].find(x=>x.getAttribute("data-docx-content-control")===o)?.querySelector(".docx-content-control-boundary")??null,signal:i.signal,canApply:l,apply(x){return a==="picture"||!l()||!e.apply(o,x)?false:(s()&&r(),true)},cancel(){s()&&r();},...a==="picture"?{async replaceImage(x){if(m||!l())return false;m=true;try{return await e.replaceImage(o,x,()=>l()&&e.picture(o)===p)?(s()&&r(),!0):!1}finally{m=false;}}}:{}};return e.setOpen(o,true),e.request(h)?true:(h.cancel(),false)}}}function dv(e,t){if(!e)return [];if(t&&uv(e))return xf$1(t(),e).map(n=>({displayText:n.name,value:n.name}));for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr"))for(let r of n.children){if(r.kind==="textValue"||r.localName!=="dropDownList"&&r.localName!=="comboBox")continue;let o=[];for(let a of r.children){if(a.kind==="textValue"||a.localName!=="listItem")continue;let i=a.attributes.find(l=>l.localName==="value")?.value??"",s=a.attributes.find(l=>l.localName==="displayText")?.value??i;o.push({displayText:s,value:i});}return o}return []}function cv(e){if(e){for(let t of e.children)if(t.kind==="contentControlProperties"){for(let n of t.children)if(n.kind==="contentControlDate")return n.attributes.find(r=>r.localName==="fullDate")?.value}}}function uv(e){return sv(e&&e.kind!=="textValue"?e:null)==="buildingBlockGallery"}function fv(e,t,n,r){if(!e||!uv(e))return [{op:"setContentControlValue",controlId:n,value:r}];let o=xf$1(t(),e).filter(i=>i.name===r),a=o.length===1?o[0]:void 0;return a?[{op:"insertBuildingBlock",controlId:n,name:a.name,blocks:a.blocks}]:null}function pv(e){let t=-1,n=true;return ()=>{let r=e.packageRevision();return t!==r&&(t=r,n=!Ig(e.settingsRoot()).doNotShadeFormData),n}}var Us="switch to field results before editing a form value";function mv(e,t){let{anchor:n,head:r}=t,o=n.paragraphId===r.paragraphId;for(let a of [n,r]){let i=e(a.paragraphId),s=i&&Ha(i,a.paragraphId);if(s?.kind!=="paragraph")continue;let l=o?Math.min(n.offset,r.offset):a.offset,d=o?Math.max(n.offset,r.offset):a.offset,u=Ue(s);if(re$1(s).filter(p=>p.addressing==="editable-result").map(p=>{let m=u.spanOf(p.node)?.start??0,h=m;for(let x of p.removeNodeIds)h=Math.max(h,u.spanOf(x)?.end??h);return {start:m,end:h}}).some(p=>l===d?l>=p.start&&(l<p.end||p.start===p.end):l<p.end&&d>p.start))return true}return false}function gv(e,t,n,r){let o=e.contentControlId?qe(t).find(u=>u.id===e.contentControlId):void 0,a=zn(n).filter(u=>u.toc.id===e.id),i=a.some(u=>u.start>0||u.end<u.length);if(o&&!i)return {tocId:e.id,boundary:o,additional:false};let s=new Map(a.map(u=>[u.paragraphId,u])),l=a.filter(u=>u.start>0||u.end<u.length).flatMap(u=>ee(t,{anchor:{paragraphId:u.paragraphId,offset:u.start},head:{paragraphId:u.paragraphId,offset:u.end}},[u.paragraphId],r)),d=t.pages.flatMap(u=>{let f=B(u).filter(v=>{let b=s.get(v.paragraphId);return b&&b.start===0&&b.end===b.length}).map(Ad);if(f.push(...l.filter(v=>v.pageIndex===u.index)),f.length===0)return [];let p=Math.min(...f.map(v=>v.x)),m=Math.min(...f.map(v=>v.y)),h=Math.max(...f.map(v=>v.x+v.width)),x=Math.max(...f.map(v=>v.y+v.height));return [{pageIndex:u.index,box:{x:p,y:m,width:h-p,height:x-m}}]});return d.length===0?null:{tocId:e.id,additional:true,boundary:{id:`toc:${e.id}`,controlType:"richText",lock:"unlocked",effectiveLock:"unlocked",placeholder:false,bound:false,nestingDepth:0,level:"block",fragments:d}}}var hv=new WeakMap;function yv(e,t,n,r){hv.set(e,o=>{let a=t();e.flushPendingInput();try{n(o),r();}catch(i){throw n(a),r(),i}});}function bv(e,t){let n=hv.get(e);if(!n)throw new Error("Surface does not support measurement updates");n(t);}var BR=createT(en$1);function Jt(e){return t=>{try{let n=e?.(t);if(typeof n=="string"&&n&&n!==t)return n}catch{}return BR(t)}}var vv=new WeakMap;function Gs(e,t){let n=new Map;return vv.set(e,n),(r,o,a="textContent")=>{let i=n.get(r);i||n.set(r,i=new Map),i.set(a,o),a==="textContent"?r.textContent=t(o):r.setAttribute(a,t(o));}}function xv(e,t){let n=vv.get(e);if(n)for(let[r,o]of n){if(r!==e&&!e.contains(r)){n.delete(r);continue}for(let[a,i]of o)a==="textContent"?r.textContent=t(i):r.setAttribute(a,t(i));}}function Sv(e,t){let n=e.ownerDocument.defaultView;if(!n)return;let r=e.offsetParent;if(!r)return;let o=t.getBoundingClientRect(),a=t.closest(".docx-page")?.getBoundingClientRect(),i=t.closest(".docx-editor__scroll-container")?.getBoundingClientRect(),s=Math.max(0,a?.left??0,i?.left??0),l=Math.min(n.innerWidth,a?.right??n.innerWidth,i?.right??n.innerWidth),d=Math.max(0,i?.top??0),u=Math.min(n.innerHeight,i?.bottom??n.innerHeight);e.style.maxWidth=`${Math.max(0,l-s)}px`,e.style.maxHeight=`${Math.max(0,u-d)}px`;let f=e.getBoundingClientRect(),p=u-o.bottom,m=o.top-d,h=f.height>p&&m>p,x=Math.max(0,h?m:p);e.style.maxHeight=`${Math.max(0,Math.min(u-d,x))}px`;let v=Math.min(f.height,x),b=Math.max(s,Math.min(o.left,l-f.width)),I=Math.max(d,h?o.top-v:o.bottom),k=r.getBoundingClientRect(),C=r.offsetWidth?k.width/r.offsetWidth:1,T=r.offsetHeight?k.height/r.offsetHeight:1;e.style.left=`${(b-k.left)/C-r.clientLeft+r.scrollLeft}px`,e.style.top=`${(I-k.top)/T-r.clientTop+r.scrollTop}px`,e.dataset.placement=h?"top":"bottom";}function oi(e,t){let n=e.ownerDocument.defaultView,r=t.closest(".docx-pages")??e.closest(".docx-editor")?.querySelector(".docx-pages"),o=t.closest("[data-docx-content-control]")?.dataset.docxContentControl,a=t,i=()=>{if(!a.isConnected&&r&&o){let d=[...r.querySelectorAll("[data-docx-content-control]")].find(u=>u.dataset.docxContentControl===o)?.querySelector(".docx-content-control-boundary");d&&(s?.unobserve(a),a=d,s?.observe(a));}a.isConnected&&Sv(e,a);},s=typeof ResizeObserver>"u"?null:new ResizeObserver(i);s?.observe(e),s?.observe(a);let l=typeof MutationObserver>"u"?null:new MutationObserver(i);return r&&l?.observe(r,{childList:true,subtree:true}),i(),n?.addEventListener("resize",i),e.ownerDocument.addEventListener("scroll",i,true),()=>{s?.disconnect(),l?.disconnect(),n?.removeEventListener("resize",i),e.ownerDocument.removeEventListener("scroll",i,true);}}function ai(e,t,n){if(t.stopPropagation(),t.isComposing||(t.key==="Escape"&&(t.preventDefault(),n()),t.key!=="Tab"))return;let r=[...e.querySelectorAll("button,input,select,textarea,[href],[tabindex]")].filter(i=>i.tabIndex>=0&&!i.hasAttribute("disabled")&&!i.closest("[hidden]")&&e.ownerDocument.defaultView?.getComputedStyle(i).display!=="none");if(!r.length){t.preventDefault(),e.focus();return}let o=e.ownerDocument.activeElement,a=t.shiftKey&&(o===r[0]||o===e)?r.at(-1):!t.shiftKey&&(o===r.at(-1)||o===e)?r[0]:null;a&&(t.preventDefault(),a.focus());}function $R(e){let t=e?.ownerDocument??(typeof document>"u"?null:document),n=t?.activeElement;return n&&n!==t?.body?n:e?.closest(".docx-pages")??null}var Du="image/png,image/jpeg,image/gif,image/bmp,image/webp",qR=new Set(Du.split(",")),ZR=8;function KR(e){if(!e||e.kind==="textValue")return;let t=(n,r)=>{if(!(n.kind==="textValue"||r>ZR)){if(n.kind==="drawing")return n.id;if(n.localName!=="sdtPr")for(let o of n.children){let a=t(o,r+1);if(a)return a}}};return t(e,0)}function wv(e){let t=null,n=null,r=null,o,a,i=0,s=false,l=()=>{i++,o?.(),a?.(),r?.remove(),r=null;let f=n;t?.remove(),t=null,n=null,f&&(e.setOpen(f,false),s||e.layer.focus({preventScroll:true}));},d=f=>KR(e.find(f)),u=async(f,p,m=()=>true)=>{if(s||!m()||!e.allowed(f))return false;if(p.byteLength>m$1.maxEncodedBytes)return e.reject("image-resource-limit"),false;let h=d(f);if(!h)return e.reject("no-picture"),false;let x=ub$1(p);if(!qR.has(x))return e.reject("unsupported-image"),false;let v=await e.replaceImage(h,p,x,()=>!s&&m()&&e.allowed(f)&&d(f)===h);return v.ok?true:(e.reject(v.detail??v.reason),false)};return {drawingOf:d,replace:u,cancel:l,select(f){let p=d(f),m=p?ed(e.layout(),p):null;return m?e.selectDrawing(p,m.record.paragraphId):false},pick(f){if(l(),s||!e.allowed(f))return;let p=i,m=()=>!s&&i===p;if(!d(f)){e.reject("no-picture");return}let h=e.document.createElement("input");h.type="file",h.accept=Du,h.className="docx-content-control-picture-picker",h.dataset.docxMarker="",h.dataset.docxCcId=f,h.setAttribute("contenteditable","false"),h.setAttribute("aria-hidden","true"),h.tabIndex=-1;let x=Jt(e.translate),v=e.document.createElement("div");v.className="docx-content-control-menu",v.style.position="absolute",v.style.zIndex="20",v.style.pointerEvents="auto",v.dataset.docxCcId=f,v.dataset.docxMarker="",v.setAttribute("role","dialog"),v.setAttribute("aria-label",x("contentControl.types.picture")),v.setAttribute("contenteditable","false"),v.hidden=true;let b=e.document.createElement("div");b.className="docx-content-control-widget-error",b.setAttribute("role","alert"),b.textContent=x("disabledReason.invalidValue");let I=e.document.createElement("button");I.type="button",I.textContent=x("common.cancel"),I.addEventListener("click",l),v.addEventListener("pointerdown",k=>k.stopPropagation()),v.addEventListener("keydown",k=>{ai(v,k,l),k.stopPropagation();}),v.append(b,I),h.addEventListener("change",()=>{let k=h.files?.[0];!k||!m()||(h.value="",h.disabled=true,(async()=>{let C=false;try{k.size>m$1.maxEncodedBytes?e.reject("image-resource-limit"):C=await u(f,new Uint8Array(await k.arrayBuffer()),m);}catch{m()&&e.reject("image-read-failed");}if(!m())return;if(C){l();return}h.disabled=false,h.className="docx-content-control-picture-input",h.removeAttribute("aria-hidden"),h.tabIndex=0,h.setAttribute("aria-label",x("contentControl.types.picture")),h.setAttribute("aria-invalid","true"),v.prepend(h),v.hidden=false;let T=[...e.layer.querySelectorAll("[data-docx-content-control]")].find(A=>A.getAttribute("data-docx-content-control")===f)?.querySelector(".docx-content-control-boundary");a?.(),o?.(),T&&(a=oi(v,T)),o=Ws(v,l),h.focus();})());}),h.addEventListener("cancel",l),e.layer.append(h),(e.layer.closest(".docx-editor__scroll-container")??e.layer).append(v),r=v,t=h,n=f,e.setOpen(f,true),h.click();},destroy(){s=true,l();}}}function Iv(e,t,n,r){return (ui$1(e,t,n)?.offset??n)+r}function kv(e){if(e&&!(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")&&!(e.controlType==="checkbox"||e.controlType==="picture"))return e.id}function Tv(e,t,n){return {op:"insertText",paragraphId:e.paragraphId,offset:e.offset,text:t,...n===void 0?{}:{inside:n}}}function VR(e,t,n){let r=e.ownerDocument;if(typeof r.elementFromPoint!="function")return null;let o=r.elementFromPoint(t,n)?.closest(".docx-page");if(!o)return null;for(let a of o.querySelectorAll("[data-docx-content-control]:not([data-docx-toc])"))for(let i of a.querySelectorAll(".docx-content-control-boundary")){let s=i.getBoundingClientRect();if(t>=s.left-3&&t<=s.right+22&&n>=s.top-3&&n<=s.bottom+3)return a}return null}function Pv(e){let t=null,n=0,r=null,o=l=>{l!==t&&(t?.isConnected&&delete t.dataset.hover,t=l,l&&(l.dataset.hover=""));},a=()=>{n=0,r&&o(VR(e,r.x,r.y));},i=l=>{r={x:l.clientX,y:l.clientY},n===0&&(n=e.ownerDocument.defaultView?.requestAnimationFrame(a)??0),n===0&&a();},s=()=>{r=null,o(null);};return e.addEventListener("pointermove",i),e.addEventListener("pointerleave",s),{destroy(){e.removeEventListener("pointermove",i),e.removeEventListener("pointerleave",s),n&&e.ownerDocument.defaultView?.cancelAnimationFrame(n),o(null);}}}var ii=.25;function Cv(e,t,n){let r=(s,l)=>{let d=ne(e,s,n);return d?pe$1(e,{x:d.x+l,y:d.y+d.height/2,pageIndex:d.pageIndex}):null},o=r(t.head,0);if(o)return o;if(t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset)return r(t.head,-ii);let i=t.head.paragraphId===t.anchor.paragraphId&&t.head.offset<t.anchor.offset;return r(t.head,i?ii:-ii)??r(t.anchor,i?-ii:ii)}function Rv(e,t,n,r,o){let a=r==="left"?-1:1,i=ne(e,t.from,o),s=ne(e,t.to,o),l=i?ce(e,i)??1:1,d=a*l===-1?t.from:t.to;if(!i||!s||i.lineId!==s.lineId||i.pageIndex!==s.pageIndex)return d;let u=_d(e).get(t.from.paragraphId)?.find(({line:h})=>h.id===i.lineId)?.line;if(!u?.spans.some(h=>h.style.shaping))return d;let f=n.indexOf(t.from.paragraphId),p=n.indexOf(t.to.paragraphId),m;for(let h of u.spans){let x=h.range.paragraphId,v=n.indexOf(x);if(v<f||v>p)continue;let b=Math.max(h.range.start,x===t.from.paragraphId?t.from.offset:0),I=Math.min(h.range.end,x===t.to.paragraphId?t.to.offset:1/0);if(!(b>=I))for(let k of [b,I]){let C={paragraphId:x,offset:k},T=ne(e,C,o);if(!T||T.lineId!==i.lineId||T.pageIndex!==i.pageIndex)continue;let A=T.x;(!m||(A-m.x)*a>0)&&(m={position:C,x:A});}}return m?.position??d}function Ev(e,t,n){let r=e;return {get:()=>r,set(o){o!==r&&(t(),r=o,n());}}}function Ov(e,t,n,r){let o=Jt(r),a=e.ownerDocument,i=a.createElement("dialog"),s=Gs(i,o);i.className="docx-text-form-dialog",i.setAttribute("role","alertdialog"),s(i,"textFormField.invalidTitle","aria-label"),s(i,`textFormField.invalid${t==="number"?"Number":"Date"}`,"aria-description");let l=a.createElement("h2");l.className="docx-text-form-dialog__header",s(l,"textFormField.invalidTitle");let d=a.createElement("div");d.className="docx-text-form-dialog__body",s(d,`textFormField.invalid${t==="number"?"Number":"Date"}`);let u=a.createElement("div");u.className="docx-text-form-dialog__footer";let f=a.createElement("button");f.type="button",f.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",s(f,"textFormField.apply");let p=false,m=()=>{p||(p=true,n());};return f.addEventListener("click",m),i.addEventListener("keydown",h=>{h.key!=="Enter"||h.isComposing||(h.preventDefault(),h.stopPropagation(),m());}),i.addEventListener("cancel",h=>{h.preventDefault(),m();}),u.append(f),i.append(l,d,u),e.append(i),i.showModal(),f.focus(),i}function Mv(e,t,n,r,o){let a=Jt(o),i=e.ownerDocument,s=i.createElement("dialog"),l=Gs(s,a);s.className="docx-text-form-dialog",l(s,"textFormField.title","aria-label");let d=i.createElement("h2");d.className="docx-text-form-dialog__header",l(d,"textFormField.title");let u=i.createElement("div");u.className="docx-text-form-dialog__body";let f=i.createElement("div");f.className="docx-text-form-dialog__footer",s.append(d,u,f);let p=(R,L)=>{let _=i.createElement("label");_.className="docx-text-form-dialog__row";let j=i.createElement("span");j.className="docx-text-form-dialog__label",l(j,R),L.className="docx-text-form-dialog__input",_.append(j,L),u.append(_);},m=i.createElement("input");m.type="text",m.value=t.defaultText,p("textFormField.defaultText",m);let h=i.createElement("select"),x=["regular","number","date"];for(let R of x){let L=i.createElement("option");L.value=R,l(L,`textFormField.${R}`),h.append(L);}if(!x.includes(t.type)){let R=i.createElement("option");R.value=t.type,l(R,"textFormField.preservedType"),R.disabled=true,h.append(R);}h.value=t.type,p("textFormField.type",h);let v=i.createElement("input");v.type="number",v.min="0",v.max="32767",v.step="1",v.value=String(t.maxLength),p("textFormField.maxLength",v);let b=i.createElement("select"),I=R=>{b.replaceChildren();let L=kh[h.value]??[];for(let _ of L){let j=i.createElement("option");j.value=_;let H={Uppercase:"textFormField.uppercase",Lowercase:"textFormField.lowercase","First capital":"textFormField.firstCapital","Title case":"textFormField.titleCase"}[_];H||!_?l(j,H??"textFormField.noFormat"):j.textContent=_,b.append(j);}if(!L.includes(R)){let _=i.createElement("option");_.value=R,R?_.textContent=R:l(_,"textFormField.noFormat"),_.disabled=true,b.append(_);}b.value=R;};I(t.format),h.addEventListener("change",()=>I("")),p("textFormField.format",b);let k=i.createElement("input");k.type="checkbox",k.checked=t.enabled;let C=i.createElement("label");C.className="docx-text-form-dialog__checkbox-row";let T=i.createElement("span");l(T,"textFormField.enabled"),C.append(k,T),u.append(C);let A=i.createElement("p");A.className="docx-text-form-dialog__error",A.setAttribute("role","alert"),u.append(A);let O=i.createElement("button");O.type="button",O.className="docx-text-form-dialog__button",l(O,"textFormField.cancel"),O.addEventListener("click",r);let $=i.createElement("button");$.type="button",$.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",l($,"textFormField.apply");let y=()=>{if(!v.value||!v.checkValidity()||!n(m.value,{type:h.value,maxLength:Number(v.value),format:b.value,enabled:k.checked})){l(A,"textFormField.invalidOptions");return}r();};return $.addEventListener("click",y),s.addEventListener("keydown",R=>{R.key==="Enter"&&!R.isComposing&&R.target instanceof HTMLInputElement&&(R.preventDefault(),y());}),s.addEventListener("cancel",R=>{R.preventDefault(),r();}),f.append(O,$),e.append(s),s.showModal(),m.focus(),m.select(),s}function Fv(e,t,n){let r=[],o=[];for(let i of e)for(let s of fi$1(i).keys()){let l=Ha(i,s);if(l?.kind==="paragraph")for(let d of oh(l)){let u=t.get(d.fieldNodeId);if(!u)continue;let f=(Pi(i,s)??"").slice(d.start,d.end),p=lh(f,d,"fill",u.locale);if(p===null)return {reason:"invalidArgs"};if(p===f)continue;let m={op:"commitTextFormField",paragraphId:s,fieldNodeId:d.fieldNodeId,locale:u.locale},h=Vi(i,m);if(h)return {reason:h};r.push(m),o.push({paragraphId:s,start:d.start,end:d.end,length:p.length});}}let a=i=>{let s=i.offset;for(let l of o)l.paragraphId!==i.paragraphId||i.offset<=l.start||(s+=i.offset>=l.end?l.length-(l.end-l.start):Math.min(i.offset-l.start,l.length)-(i.offset-l.start));return s===i.offset?i:{...i,offset:s}};return {ops:r,selection:{anchor:a(n.anchor),head:a(n.head)}}}var Xs=new WeakMap,Ys=new WeakMap;function Lv(e){return Ys.get(e)?.()??null}function Av(e){return [...fi$1(e).keys()].flatMap(t=>{let n=Ha(e,t);return n?.kind==="paragraph"?oh(n):[]})}function Hu(e){return Xs.get(e)?.()}function Nv(e,t){let n=Jt(e.translate),r=e.container.ownerDocument,o,a=false,i=new Map,s=()=>e.parts?.()??[e.part()];if(t?.length)for(let D of s()){let M=t.filter(Z=>Z.partName===D.name);if(!M.length)continue;let q=Av(D);for(let Z of M){let Y=q[Z.fieldIndex];Y&&i.set(Y.fieldNodeId,{text:Z.text,locale:Z.locale});}}let l=new WeakMap,d=new WeakMap,u=(D=e.part())=>{l.set(D,new Map([...i].filter(([M])=>M.startsWith(`${D.name}#`))));},f=()=>(i=new Map(s().flatMap(D=>[...l.get(D)??[]])),d.get(e.part())??null),p=D=>{i.delete(D),u();};s().forEach(u);let m=()=>{if(!i.size)return null;if(a)return "invalidState";let D=Fv(s(),i,e.selection());if("reason"in D)return D.reason;if(D.ops.length&&!e.editable())return "locked";let M=s();s().forEach(u);let q=i;D.ops.length&&d.set(e.part(),e.selection()),i=new Map,a=true;try{let Z=D.ops.length?e.save?e.save(D.ops,D.selection):"unsupported":null;return Z?i=q:(delete fe.dataset.fieldError,D.ops.length&&d.set(e.part(),D.selection)),s().forEach(u),Z}catch(Z){throw s().every(Y=>M.includes(Y))&&(i=q),s().forEach(u),Z}finally{a=false;}};Ys.set(e.container,m);let h=()=>i.size?s().flatMap(D=>Av(D).flatMap((M,q)=>{let Z=i.get(M.fieldNodeId);return Z?[{partName:D.name,fieldIndex:q,...Z}]:[]})):[];Xs.set(e.container,h);let x,v=(D,M)=>(Pi(e.part(),D)??"").slice(M.start,M.end),b=null,I=null,k=null,C=false,T=false,A=()=>{let D=k;k=null,T=false,b?.remove(),b=null,D?.abort();},O=()=>{if(!b&&!k)return;let D=e.selection();A(),!C&&(e.pagesLayer.focus({preventScroll:true}),e.select(D));};function $(D,M,q="plain"){x={paragraphId:D,fieldNodeId:M.fieldNodeId},e.select({anchor:{paragraphId:D,offset:M.start},head:{paragraphId:D,offset:M.end}},q==="press"?"pressed":void 0);let Z=e.selection().head.paragraphId===D&&e.selection().head.offset>=M.start&&e.selection().head.offset<=M.end;Z&&(I=x??I),x=void 0,Z&&q==="travel"&&e.reveal?.({paragraphId:D,offset:M.start});}function y(D,M){if(C)return;O();let q=e.locale?.()??"en-US",Z=new AbortController;k=Z;let Y=()=>{if(C||Z.signal.aborted||k!==Z)return false;let K=Ha(e.part(D),D);return K?.kind==="paragraph"&&oh(K).some(W=>W.fieldNodeId===M.fieldNodeId)&&e.editable()&&!e.protected(D)},E={field:{...M},signal:Z.signal,canApply:Y,apply(K,W){if(!Y()||!e.apply({op:"setTextFormFieldDefault",locale:q,paragraphId:D,fieldNodeId:M.fieldNodeId,text:K,options:W}))return false;if(C||k!==Z||Z.signal.aborted)return true;let ee=Ha(e.part(D),D),re=ee?.kind==="paragraph"?oh(ee).find(te=>te.fieldNodeId===M.fieldNodeId):null;return re&&$(D,re),O(),true},cancel(){k===Z&&!Z.signal.aborted&&O();}};e.onRequest?.(E)||Z.signal.aborted||(b=Mv(e.container,M,E.apply,E.cancel,n));}let R=D=>{let q=D.target?.closest('[data-field-atom="form"][data-start]'),Z=q?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!q||!Z||!e.editable())return null;let Y=Ha(e.part(),Z);if(Y?.kind!=="paragraph")return null;let E=Number(q.dataset.start),K=oh(Y).find(W=>W.start<=E&&E<W.end);return K?{paragraphId:Z,field:K}:null},L=null,_=D=>D.shiftKey||D.altKey||D.ctrlKey||D.metaKey,j=D=>{if(o=void 0,L=null,D.button!==0)return;let M=R(D);M&&!_(D)&&!e.protected(M.paragraphId)&&(L={x:D.clientX,y:D.clientY,paragraphId:M.paragraphId,fieldNodeId:M.field.fieldNodeId,moved:false}),x=M?{paragraphId:M.paragraphId,fieldNodeId:M.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("pointerdown",j,{capture:true});let F=D=>{L&&Math.hypot(D.clientX-L.x,D.clientY-L.y)>4&&(L.moved=true);},H=()=>{L=null;},V=(D,M=false)=>{let q=L;if(L=null,!q||q.moved||b||D.button!==0||D.detail>1||Math.hypot(D.clientX-q.x,D.clientY-q.y)>4||!e.editable()||_(D)||e.protected(q.paragraphId))return;let Z=Ha(e.part(),q.paragraphId),Y=Z?.kind==="paragraph"?oh(Z).find(K=>K.fieldNodeId===q.fieldNodeId):null;if(!Y)return;let E=e.selection();M&&(E.anchor.paragraphId!==E.head.paragraphId||E.anchor.offset!==E.head.offset)&&!(E.anchor.paragraphId===q.paragraphId&&E.head.paragraphId===q.paragraphId&&Math.min(E.anchor.offset,E.head.offset)===Y.start&&Math.max(E.anchor.offset,E.head.offset)===Y.end)||$(q.paragraphId,Y,"press");};r.addEventListener("pointermove",F),r.addEventListener("pointercancel",H),e.pagesLayer.addEventListener("click",V);let B=D=>{if(D.shiftKey||D.altKey||D.ctrlKey||D.metaKey)return false;let M=R(D);if(!M)return false;let{paragraphId:q,field:Z}=M;return D.preventDefault(),$(q,Z,"press"),e.protected(q)||y(q,Z),true};e.pagesLayer.addEventListener("dblclick",B);function X(){let D=e.selection();if(D.anchor.paragraphId!==D.head.paragraphId)return null;let M=D.head.paragraphId,q=Ha(e.part(),M);if(q?.kind!=="paragraph")return null;let Z=Math.min(D.anchor.offset,D.head.offset),Y=Math.max(D.anchor.offset,D.head.offset),E=oh(q).filter(W=>W.start<=Z&&W.end>=Y&&(W.start===W.end||Z!==Y||Z<W.end||e.protected(M))),K=E.find(W=>I?.paragraphId===M&&W.fieldNodeId===I.fieldNodeId)??E.find(W=>W.start===Z&&W.end===Y)??E[0];return K?{paragraphId:M,field:K}:null}function ae(){if(o===void 0)return X();if(!o)return null;let D=Ha(e.part(),o.paragraphId),M=D?.kind==="paragraph"?oh(D).find(q=>q.fieldNodeId===o.fieldNodeId):null;return M?{paragraphId:o.paragraphId,field:M}:null}let ce=D=>{let M=D.button===-1||D.clientX===0&&D.clientY===0?X():R(D);o=M?{paragraphId:M.paragraphId,fieldNodeId:M.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("contextmenu",ce);let xe=()=>{let D=ae();return !!D&&e.editable()&&!e.protected(D.paragraphId)&&!Vi(e.part(),{op:"setTextFormFieldDefault",paragraphId:D.paragraphId,fieldNodeId:D.field.fieldNodeId,text:"",options:{type:"regular",maxLength:0,format:"",enabled:true}})},fe=r.createElement("span");return fe.className="docx-text-form-status",e.container.append(fe),{doubleClick:B,pointerUp:D=>V(D,true),canEdit:xe,edit(){if(!xe())return false;let D=ae();return $(D.paragraphId,D.field,"travel"),y(D.paragraphId,D.field),true},selectForDeletion(D){let M=e.selection(),{paragraphId:q,offset:Z}=M.head;if(!e.editable()||e.protected(q)||M.anchor.paragraphId!==q||M.anchor.offset!==Z)return false;let Y=Ha(e.part(),q);if(Y?.kind!=="paragraph")return false;let E=oh(Y).find(K=>K.start<K.end&&(D==="backward"?K.end===Z:K.start===Z));return E?($(q,E),true):false},wordDeletionBoundary(D,M,q,Z){let Y=be(D,M,q,Z),E=e.selection().head.paragraphId;if(e.protected(E))return Y;let K=Ha(e.part(E),E);if(K?.kind!=="paragraph")return Y;let W=oh(K),ee=W.find(te=>te.start<te.end&&(q===-1?te.end===M:te.start===M));if(ee)return q===-1?ee.start:ee.end;let re=Y;for(let te of W)for(let le of [te.start,te.end])q===-1&&le<M&&le>re&&(re=le),q===1&&le>M&&le<re&&(re=le);return re},beforeSelect(D){let M=De=>{if(x!==void 0)I=x;else if(D.anchor.paragraphId!==D.head.paragraphId||I?.paragraphId!==D.head.paragraphId)I=null;else {let Ce=Ha(e.part(),D.head.paragraphId),ze=Ce?.kind==="paragraph"?oh(Ce).find(Oe=>Oe.fieldNodeId===I?.fieldNodeId):null;(!ze||Math.min(D.anchor.offset,D.head.offset)<ze.start||Math.max(D.anchor.offset,D.head.offset)>ze.end)&&(I=null);}return x=void 0,delete fe.dataset.fieldError,De};if(a||T)return null;if(!e.editable())return D;let q=X();if(!q||!e.protected(q.paragraphId)||!q.field.enabled||!mh(q.field))return M(D);let{field:Z,paragraphId:Y}=q;if((!x||x.fieldNodeId===Z.fieldNodeId)&&D.anchor.paragraphId===Y&&D.head.paragraphId===Y&&Math.min(D.anchor.offset,D.head.offset)>=Z.start&&Math.max(D.anchor.offset,D.head.offset)<=Z.end)return M(D);let E=i.get(Z.fieldNodeId),K=E?.text,W=E?.locale??e.locale?.()??"en-US",ee=v(Y,Z);if(Z.type==="date"&&K===void 0)return p(Z.fieldNodeId),M(D);let re=lh(ee,Z,"fill",W);if(re===ee||re===null&&(K===void 0||K===ee))return p(Z.fieldNodeId),M(D);a=true;let te=e.part();u(te);let le=i;i=new Map(le),i.delete(Z.fieldNodeId);let ue;try{ue=e.apply({op:"commitTextFormField",locale:W,paragraphId:Y,fieldNodeId:Z.fieldNodeId}),ue||(i=le);}catch(De){throw e.part()===te&&(i=le),De}finally{u(),a=false;}if(!ue){if(x=void 0,fe.setAttribute("role","alert"),fe.dataset.fieldError="true",fe.textContent=n("textFormField.invalidValue"),re===null&&(Z.type==="number"||Z.type==="date")){A();let De=new AbortController;k=De,T=true;let Ce=()=>{if(C||De.signal.aborted||k!==De||(A(),C))return;let Oe=e.selection(),Be=()=>{e.pagesLayer.focus({preventScroll:true}),e.select(Oe);},Se=Ha(e.part(),Y),Ae=Se?.kind==="paragraph"?oh(Se).find(St=>St.fieldNodeId===Z.fieldNodeId):null;if(!Ae||!e.editable()||!e.protected(Y)||v(Y,Ae)!==ee||!Ae.enabled||!mh(Ae)||Ae.type!==Z.type||Ae.format!==Z.format||lh(ee,Ae,"fill",W)!==null){Be();return}a=true;try{if(e.apply({op:"deleteText",paragraphId:Y,start:Ae.start,end:Ae.end,textFormFieldId:Ae.fieldNodeId})){p(Ae.fieldNodeId),delete fe.dataset.fieldError,e.pagesLayer.focus({preventScroll:!0});let St={paragraphId:Y,offset:Ae.start};a=!1,e.select({anchor:St,head:St}),I={paragraphId:Y,fieldNodeId:Ae.fieldNodeId};}else a=!1,Be();}finally{a=false;}},ze={type:Z.type,signal:De.signal,acknowledge:Ce,cancel(){k===De&&!De.signal.aborted&&O();}};!e.onInvalidRequest?.(ze)&&!De.signal.aborted&&(b=Ov(e.container,Z.type,Ce,n));}return null}p(Z.fieldNodeId);let ve=Ha(e.part(),Y),rt=ve?.kind==="paragraph"?oh(ve).find(De=>De.fieldNodeId===Z.fieldNodeId):null,Ee=rt?rt.end-Z.end:0,_e=De=>De.paragraphId===Y&&De.offset>=Z.end?{...De,offset:De.offset+Ee}:De;return M({anchor:_e(D.anchor),head:_e(D.head)})},update(){b&&xv(b,n);let D=X(),M=e.selection(),q=!!D&&M.anchor.offset!==M.head.offset&&Math.min(M.anchor.offset,M.head.offset)===D.field.start&&Math.max(M.anchor.offset,M.head.offset)===D.field.end;for(let Z of e.pagesLayer.querySelectorAll('[data-field-atom="form"][data-start]')){let Y=Z.closest("[data-paragraph-id]")?.dataset.paragraphId,E=Number(Z.dataset.start);!!D&&Y===D.paragraphId&&E>=D.field.start&&E<D.field.end?Z.dataset.textFormSelection=q?"whole":"caret":delete Z.dataset.textFormSelection;}if(fe.dataset.fieldError){fe.textContent=n("textFormField.invalidValue");return}D?fe.setAttribute("role","status"):fe.removeAttribute("role"),fe.textContent=D?n(q?"textFormField.selected":"textFormField.editing"):"";},fieldId:()=>X()?.field.fieldNodeId??null,afterApply(D){D?u():f();},restoreAfterHistory:f,annotate(D){(!a||D.some(q=>q.op!=="commitTextFormField"))&&u(),D.some(q=>q.op==="insertText"||q.op==="deleteText")&&delete fe.dataset.fieldError;let M=X();return I=M?{paragraphId:M.paragraphId,fieldNodeId:M.field.fieldNodeId}:null,D.map(q=>{if(!I||q.op!=="insertText"&&q.op!=="deleteText"||q.revision||q.paragraphId!==I.paragraphId||!e.protected(q.paragraphId))return q;let Z=Ha(e.part(),q.paragraphId),Y=Z?.kind==="paragraph"?oh(Z).find(W=>W.fieldNodeId===I.fieldNodeId):null,E=q.op==="insertText"?q.offset:q.start,K=q.op==="insertText"?q.offset:q.end;return !Y||E<Y.start||K>Y.end?q:(i.has(Y.fieldNodeId)||i.set(Y.fieldNodeId,{text:v(q.paragraphId,Y),locale:e.locale?.()??"en-US"}),{...q,textFormFieldId:Y.fieldNodeId})})},keydown(D){if(D.key==="F10"&&D.shiftKey&&!D.altKey&&!D.ctrlKey&&!D.metaKey)return o=void 0,D.preventDefault(),e.pagesLayer.dispatchEvent(new MouseEvent("contextmenu",{bubbles:true,cancelable:true,button:-1})),true;if(D.key!=="Tab"||D.altKey||D.ctrlKey||D.metaKey||!e.editable()||!e.protected(e.selection().head.paragraphId))return false;let M=[],q=[e.part().root];for(;q.length;){let re=q.pop();if(re.kind==="paragraph")for(let te of oh(re))e.protected(re.id)&&te.enabled&&mh(te)&&!Vi(e.part(),{op:"insertText",paragraphId:re.id,offset:te.start,text:"x"})&&M.push({paragraphId:re.id,field:te});else for(let te=re.children.length-1;te>=0;te--){let le=re.children[te];le.kind!=="textValue"&&q.push(le);}}if(!M.length)return false;let Z=e.selection(),Y=Z.head,E=I?M.findIndex(re=>re.paragraphId===I.paragraphId&&re.field.fieldNodeId===I.fieldNodeId&&re.field.start<=Math.min(Z.anchor.offset,Y.offset)&&re.field.end>=Math.max(Z.anchor.offset,Y.offset)):-1,K=E>=0?E:M.findIndex(re=>re.paragraphId===Y.paragraphId&&re.field.start<=Math.min(Z.anchor.offset,Y.offset)&&re.field.end>=Math.max(Z.anchor.offset,Y.offset)),W=K<0?D.shiftKey?M.length-1:0:(K+(D.shiftKey?-1:1)+M.length)%M.length,ee=M[W];return D.preventDefault(),$(ee.paragraphId,ee.field,"travel"),true},destroy(){C=true,A(),Ys.get(e.container)===m&&Ys.delete(e.container),Xs.get(e.container)===h&&Xs.delete(e.container),r.removeEventListener("pointermove",F),r.removeEventListener("pointercancel",H),e.pagesLayer.removeEventListener("click",V),e.pagesLayer.removeEventListener("contextmenu",ce),fe.remove(),e.pagesLayer.removeEventListener("dblclick",B),e.pagesLayer.removeEventListener("pointerdown",j,{capture:true}),b?.remove(),b=null;}}}var Qs=new WeakMap;function _u(e){let t=Qs.get(e);if(t)return t.settled??=new Promise(n=>{t.resolve=n;}),t.settled}function Dv(e){let t=Qs.get(e)??{depth:0};return t.depth++,Qs.set(e,t),()=>{--t.depth===0&&(Qs.delete(e),t.resolve?.());}}async function Hv(e,t,n){if(!e)throw Vt("notFound","no document is loaded");let r=t?_u(t):void 0;if(r&&(await r,n()!==e))throw Vt("invalidState","The document changed before the pending save could finish.");return e.save().slice().buffer}function _v(e,t,n){let r=()=>{if(n())throw Vt("destroyed","Cannot save a destroyed surface.")};if(r(),_u(t))throw Vt("invalidState","Cannot save during an active edit. Retry after the edit finishes.");e.flushPendingInput(),r();let o=Lv(t);if(o)throw Vt(o,"Cannot save pending text form input. Enter a valid value in each field.");return r(),e.refreshRefFieldResults(),r(),e.session.save()}function Js(e,t,n){let r=false;return t(()=>{let o=n([e]);return r=!o.rejected,o}),r}function Bv(e,t,n){let r=n.refusal();if(r)return r;let o=new Map;for(let i of e){if(i.op!=="commitTextFormField")return "invalidArgs";let s=ft(n.session,i.paragraphId,{kind:"body"}),l=JSON.stringify(s),d=o.get(l)??{scope:s,ops:[]};d.ops.push(i),o.set(l,d);}for(let i of o.values()){let s=n.gate(i.ops,i.scope);if(s)return s}if(n.collaborationActive)return "unsupported";let a;return n.commit(()=>a=n.session.applyTreeOpsAtomic([...o.values()]),()=>t),a?.rejected?a.reason??"invalidArgs":null}function $v(e,t){let n=hh(e);return {get:()=>n,set(r){let o=hh(r);n!==o&&(t(),n=o);}}}var zR=42,jR=/^(\d{4})-(\d{2})-(\d{2})/,WR=new Set(["AG","AS","BD","BR","BS","BT","BW","BZ","CA","CO","DM","DO","ET","GT","GU","HK","HN","ID","IL","IN","JM","JP","KE","KH","KR","LA","MH","MM","MO","MT","MX","MZ","NI","NP","PA","PE","PH","PK","PR","PT","PY","SA","SG","SV","TH","TT","TW","UM","US","VE","VI","WS","YE","ZA","ZW"]),UR=new Set(["AE","AF","BH","DJ","DZ","EG","IQ","IR","JO","KW","LY","OM","QA","SD","SY"]);function Wr(e){return `${String(e.getFullYear()).padStart(4,"0")}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Wn(e){let t=jR.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);if(r<1||r>12||o<1||o>31)return null;let a=new Date(n,r-1,o);return a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==o?null:a}function el(e){let t=hh(e);try{let n=new Intl.Locale(t),r=n,o=r.getWeekInfo?.().firstDay??r.weekInfo?.firstDay;if(typeof o=="number"&&o>=1&&o<=7)return o%7;let a=n.maximize().region;if(a&&WR.has(a))return 0;if(a&&UR.has(a))return 6}catch{}return 1}function qv(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Zv(e,t,n){return new Intl.DateTimeFormat(hh(n),{calendar:"gregory",month:"long",year:"numeric"}).format(new Date(e,t,1))}function Kv(e){let t=hh(e),n=new Intl.DateTimeFormat(t,{calendar:"gregory",weekday:"narrow"}),r=el(t);return Array.from({length:7},(o,a)=>n.format(new Date(2024,0,7+(r+a)%7)))}function Bu(e,t,n={}){let r=hh(n.locale),o=n.selected?Wn(n.selected):null,a=n.today??new Date,i=new Intl.DateTimeFormat(r,{calendar:"gregory",weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=el(r),l=(new Date(e,t,1).getDay()-s+7)%7,d=[];for(let u=0;u<zR;u+=1){let f=new Date(e,t,u-l+1);d.push({iso:Wr(f),day:f.getDate(),label:i.format(f),otherMonth:f.getMonth()!==t,selected:o!==null&&qv(f,o),today:qv(f,a)});}return {year:e,month:t,title:Zv(e,t,r),weekdays:Kv(r),days:d}}function tl(e,t,n){let r=new Date(e,t+n,1);return {year:r.getFullYear(),month:r.getMonth()}}function $u(e,t,n,r=false){let o=Wn(e);if(!o)return null;let a={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7},i=(o.getDay()-el(n)+7)%7;if(t==="PageUp"||t==="PageDown"){let s=o.getDate();o.setDate(1),o.setMonth(o.getMonth()+(t==="PageUp"?-1:1)*(r?12:1));let l=new Date(o.getFullYear(),o.getMonth()+1,0).getDate();o.setDate(Math.min(s,l));}else {let s=t==="Home"?-i:t==="End"?6-i:a[t];if(s===void 0)return null;o.setDate(o.getDate()+s);}return o.getFullYear()>=100&&o.getFullYear()<=9999?Wr(o):null}function nl(e,t){let n=Wn(e);if(!n)return "";let r=hh(t),o=new Intl.NumberFormat(r,{useGrouping:false}).format(0);return new Intl.DateTimeFormat(r,{calendar:"gregory",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(n).map(a=>a.type==="year"?a.value.padStart(4,o):a.value).join("")}function qu(e,t){if(e.length>100)return null;let n=e.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(n)){let s=Wn(n);return s?Wr(s):null}let r=ih(hh(t)),o=r.pattern.exec(jh$1(n,r));if(!o)return null;let a={year:"",month:"",day:""};if(r.order.forEach((s,l)=>{a[s]=o[l+1];}),a.year.length!==4)return null;let i=`${a.year}-${a.month.padStart(2,"0")}-${a.day.padStart(2,"0")}`;return Wn(i)?i:null}function Zu(e){let t=new Intl.DateTimeFormat(hh(e),{calendar:"gregory",month:"long"});return Array.from({length:12},(n,r)=>t.format(new Date(2e3,r,1)))}function Ku(e){let t="",n=0,r=new Intl.Collator(hh(e),{usage:"search",sensitivity:"base"});return {reset(){t="",n=0;},keyDown(o,a){if(o.defaultPrevented||o.isComposing||o.altKey||o.ctrlKey||o.metaKey)return;let i=o.target.tagName==="INPUT",s=[...a.querySelectorAll('[role="option"]')].filter(u=>!u.hasAttribute("disabled"));if(!s.length)return;let l=s.indexOf(a.ownerDocument.activeElement),d;if(o.key==="ArrowDown")d=Math.min(s.length-1,l+1);else if(o.key==="ArrowUp")d=l<0?s.length-1:Math.max(0,l-1);else if(!i&&o.key==="Home")d=0;else if(!i&&o.key==="End")d=s.length-1;else if(!i&&o.key.length===1&&o.key!==" "){let u=Date.now();t=u-n>700?o.key:(t+o.key).slice(-100),n=u;let f=[...t].every(p=>r.compare(p,o.key)===0)?o.key:t;for(let p=1;p<=s.length;p++){let m=(Math.max(-1,l)+p)%s.length;if(r.compare((s[m].textContent??"").slice(0,f.length),f)===0){d=m;break}}}d!==void 0&&(o.preventDefault(),s.forEach((u,f)=>{u.tabIndex=f===d?0:-1;}),s[d]?.focus({preventScroll:true}),s[d]?.scrollIntoView?.({block:"nearest"}));}}}var GR=0;function Vv(e,t){let n=e.document.createElement("div");n.className="docx-content-control-menu",n.dataset.docxMarker="",n.dataset.docxPart="popup",n.addEventListener("keydown",r=>ai(n,r,()=>e.close(n))),n.dataset.docxCcId=t,n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.zIndex="20",n.style.pointerEvents="auto",n.addEventListener("pointerdown",r=>r.stopPropagation());for(let r of ["keydown","beforeinput","input","compositionstart","compositionupdate","compositionend","copy","cut","paste"])n.addEventListener(r,o=>o.stopPropagation());return n}function zv(e,t,n){if(!n){t.append(e);return}e.style.left=`${n.left}px`,e.style.top=`${n.top}px`;let r=n.element?t.closest(".docx-editor__scroll-container")??t.parentElement??t:t;if(r.append(e),n.element){let i=oi(e,n.element),s=new MutationObserver(()=>{e.isConnected||(i(),s.disconnect());});s.observe(r,{childList:true});return}let o=e.offsetWidth;if(o<=0)return;let a=n.left+o-n.sheetRight;a>0&&(e.style.left=`${Math.max(n.sheetLeft,n.left-a)}px`);}function rl(e,t,n,r){if(e.setValue(n,r))return e.close(t),true;let o=t.querySelector("[data-docx-part=error]");return o||(o=e.document.createElement("div"),o.dataset.docxPart="error",o.className="docx-content-control-widget-error",o.setAttribute("role","alert"),t.append(o)),o.hidden=false,o.textContent=Jt(e.translate)("disabledReason.invalidValue"),false}function jv(e,t,n,r,o,a){let i=Vv(e,t),s=Jt(e.translate);i.setAttribute("role","dialog"),i.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let l=e.document.createElement("div");l.className="docx-content-control-menu-list",l.dataset.docxPart="list",l.id=`docx-engine-cc-list-${++GR}`,l.setAttribute("role","listbox"),l.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let d=Ku(e.locale());i.addEventListener("keydown",f=>d.keyDown(f,i));let u=r.findIndex(f=>f.value===a);for(let[f,p]of r.entries()){let m=e.document.createElement("button");m.type="button",m.className="docx-content-control-menu-item",m.dataset.docxPart="item",m.dataset.value=p.value,m.setAttribute("role","option"),m.setAttribute("aria-selected",String(p.value===a)),m.tabIndex=f===Math.max(0,u)?0:-1,m.textContent=p.displayText,m.addEventListener("click",()=>{rl(e,i,t,p.value);}),l.append(m);}if(n==="buildingBlockGallery"&&r.length===0){let f=e.document.createElement("div");f.className="docx-content-control-menu-empty",f.dataset.docxPart="empty",f.setAttribute("role","note"),f.tabIndex=0,f.textContent=s("contentControl.gallery.empty"),l.append(f);}if(n==="comboBox"){let f=e.document.createElement("input");f.type="text",f.className="docx-content-control-menu-input",f.dataset.docxPart="input",f.value=a??"",f.setAttribute("aria-label",o||s("contentControl.types.comboBox")),f.setAttribute("aria-autocomplete","list"),f.setAttribute("role","combobox"),f.setAttribute("aria-expanded","true"),f.setAttribute("aria-controls",l.id),f.addEventListener("keydown",m=>{m.key!=="Enter"||m.isComposing||(m.preventDefault(),rl(e,i,t,f.value));}),i.append(f);let p=e.document.createElement("div");p.className="docx-dialog__footer",p.dataset.docxPart="footer";for(let m of ["cancel","apply"]){let h=e.document.createElement("button");h.type="button",h.className=`docx-dialog__button${m==="apply"?" docx-dialog__button--primary":""}`,h.dataset.docxPart=m,h.textContent=s(`common.${m}`),h.addEventListener("click",()=>{m==="apply"?rl(e,i,t,f.value):e.close(i);}),p.append(h);}i.append(l,p);}else i.append(l);return i}function ol(e,t){let n=(t?e.querySelector(`[data-iso="${t}"]`):null)??e.querySelector("[data-selected]")??e.querySelector("[data-today]:not([data-other-month])")??e.querySelector(".docx-content-control-calendar-day:not([data-other-month])");for(let r of e.querySelectorAll("[data-iso]"))r.tabIndex=r===n?0:-1;n?.focus({preventScroll:true});}function Wv(e,t,n,r){let o=Jt(e.translate),a=Vv(e,t);a.classList.add("docx-content-control-calendar"),a.setAttribute("role","dialog"),a.setAttribute("aria-label",r||o("contentControl.types.date"));let i=n?Wn(n):null,s=i?Wr(i):null,l=new Date,d={year:(i??l).getFullYear(),month:(i??l).getMonth()},u=null,f=nl(s??"",e.locale()),p=b=>{rl(e,a,t,b);},m=b=>{b.addEventListener("mousedown",I=>I.stopPropagation());},h=e.document.createElement("div");h.className="docx-content-control-calendar-title docx-content-control-calendar-announcement",h.dataset.docxPart="title",h.setAttribute("aria-live","polite");let x=()=>{let b=e.document.activeElement?.dataset.docxCalendarNav,I=Bu(d.year,d.month,{locale:e.locale(),selected:s,today:l}),k=e.document.createElement("div");k.className="docx-content-control-calendar-header",k.dataset.docxPart="header";let C=e.document.createElement("button");C.type="button",C.className="docx-content-control-calendar-nav",C.dataset.docxPart="previousMonth",C.dataset.docxCalendarNav="previous",C.textContent="\u2039",C.setAttribute("aria-label",o("contentControl.calendar.previousMonth")),h.textContent=I.title;let T=e.document.createElement("button");T.type="button",T.className="docx-content-control-calendar-nav",T.dataset.docxPart="nextMonth",T.dataset.docxCalendarNav="next",T.textContent="\u203A",T.setAttribute("aria-label",o("contentControl.calendar.nextMonth")),m(C),m(T),C.addEventListener("click",()=>{d=tl(d.year,d.month,-1),u=null,x();}),T.addEventListener("click",()=>{d=tl(d.year,d.month,1),u=null,x();});let A=e.document.createElement("div");A.className="docx-content-control-calendar-navigation",A.dataset.docxPart="navigation";let O=e.document.createElement("select");O.className="docx-content-control-calendar-month",O.dataset.docxPart="month",O.dataset.docxCalendarNav="month",O.setAttribute("aria-label",o("contentControl.calendar.month"));for(let[B,X]of Zu(e.locale()).entries()){let ae=e.document.createElement("option");ae.value=String(B),ae.textContent=X,O.append(ae);}O.value=String(d.month);let $=e.document.createElement("input");$.type="number",$.min="100",$.max="9999",$.value=String(d.year),$.className="docx-content-control-calendar-year",$.dataset.docxPart="year",$.dataset.docxCalendarNav="year",$.addEventListener("keydown",B=>{B.key==="Enter"&&!B.isComposing&&(B.preventDefault(),$.blur());}),$.setAttribute("aria-label",o("contentControl.calendar.year")),O.addEventListener("change",()=>{d.month=Number(O.value),u=null,x();}),$.addEventListener("change",()=>{let B=Number($.value);if(!Number.isInteger(B)||B<100||B>9999){$.value=String(d.year);return}d.year=B,u=null,x();}),A.append(O,$);let y=e.document.createElement("div");y.className="docx-content-control-calendar-weekdays",y.dataset.docxPart="weekdays";for(let B of I.weekdays){let X=e.document.createElement("span");X.textContent=B,y.append(X);}let R=e.document.createElement("div");R.className="docx-content-control-calendar-grid",R.dataset.docxPart="grid",R.setAttribute("role","grid"),R.setAttribute("aria-label",I.title);for(let B=0;B<I.days.length;B+=7){let X=e.document.createElement("div");X.className="docx-content-control-calendar-week",X.setAttribute("role","row");for(let ae of I.days.slice(B,B+7))X.append(v(ae));R.append(X);}let L=e.document.createElement("div");L.className="docx-content-control-calendar-entry",L.dataset.docxPart="dateEntry";let _=e.document.createElement("button");_.type="button",_.className="docx-content-control-calendar-today",_.dataset.docxPart="today",_.textContent=o("contentControl.calendar.today"),m(_),_.addEventListener("click",()=>p(Wr(l)));let j=e.document.createElement("input");j.type="text",j.className="docx-content-control-menu-input",j.dataset.docxPart="input",j.setAttribute("aria-label",o("contentControl.types.date")),j.placeholder=nl("2006-11-22",e.locale()),j.value=f,j.addEventListener("input",()=>{f=j.value,j.removeAttribute("aria-invalid"),F.hidden=true;});let F=e.document.createElement("div");F.className="docx-content-control-widget-error",F.dataset.docxPart="error",F.setAttribute("role","alert"),F.hidden=true,F.textContent=o("disabledReason.invalidValue");let H=()=>{let B=qu(f,e.locale());B?p(B):(F.hidden=false,j.setAttribute("aria-invalid","true"),j.focus());};j.addEventListener("keydown",B=>{B.key==="Enter"&&!B.isComposing&&(B.preventDefault(),H());});let V=e.document.createElement("div");V.className="docx-dialog__footer",V.dataset.docxPart="footer";for(let B of ["cancel","apply"]){let X=e.document.createElement("button");X.type="button",X.dataset.docxPart=B,X.className=`docx-dialog__button${B==="apply"?" docx-dialog__button--primary":""}`,X.textContent=o(`common.${B}`),X.addEventListener("click",B==="apply"?H:()=>e.close(a)),V.append(X);}k.append(C,A,T,h),L.append(_,j),a.replaceChildren(k,y,R,L,F,V),ol(a,u),b==="previous"&&C.focus({preventScroll:true}),b==="next"&&T.focus({preventScroll:true}),b==="month"&&O.focus({preventScroll:true}),b==="year"&&$.focus({preventScroll:true});},v=b=>{let I=e.document.createElement("button");return I.type="button",I.className="docx-content-control-calendar-day",I.dataset.docxPart="day",I.textContent=String(b.day),I.dataset.iso=b.iso,I.setAttribute("role","gridcell"),I.setAttribute("aria-label",b.label),b.otherMonth&&(I.dataset.otherMonth=""),b.selected&&(I.dataset.selected="",I.setAttribute("aria-selected","true")),I.setAttribute("aria-selected",String(b.selected)),b.today&&(I.dataset.today="",I.setAttribute("aria-current","date")),m(I),I.addEventListener("click",()=>p(b.iso)),I.addEventListener("keydown",k=>{if(k.isComposing||k.altKey||k.ctrlKey||k.metaKey)return;let C=$u(b.iso,k.key,e.locale(),k.shiftKey);if(!C)return;k.preventDefault();let T=Wn(C);if(u=C,T.getFullYear()!==d.year||T.getMonth()!==d.month){d={year:T.getFullYear(),month:T.getMonth()},x();return}ol(a,u);}),I};return x(),a}function Vu(e,t){let r=(t instanceof Element?t:null)?.closest("[data-docx-form-checkbox][data-start]"),o=r?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!r||!o)return null;let a=Ha(e.part(o),o);if(a?.kind!=="paragraph")return null;let i=Number(r.dataset.start),s=qh$1(a).find(l=>l.start<=i&&i<l.end);return s?{paragraphId:o,field:s}:null}function Uv(e){return e.shiftKey||e.altKey||e.ctrlKey||e.metaKey}function Gv(e){let t=(a,i)=>{if(!e.editable()||!i.enabled)return false;let s=e.apply({op:"setLegacyCheckbox",paragraphId:a,fieldNodeId:i.fieldNodeId,checked:!i.checked});return s&&(e.pagesLayer.focus({preventScroll:true}),e.select({anchor:{paragraphId:a,offset:i.start},head:{paragraphId:a,offset:i.end}})),s},n=a=>{if(a.button!==0||Uv(a))return;let i=Vu(e,a.target);!i||!e.editable()||!i.field.enabled||(a.preventDefault(),a.stopPropagation(),t(i.paragraphId,i.field));};e.pagesLayer.addEventListener("pointerdown",n,{capture:true});let r=a=>{let i=Vu(e,a.target);i&&a.target instanceof HTMLElement&&a.target.setAttribute("aria-disabled",String(!e.editable()||!i.field.enabled));};e.pagesLayer.addEventListener("focusin",r);let o=()=>{let a=e.selection();if(a.anchor.paragraphId!==a.head.paragraphId)return null;let i=a.head.paragraphId,s=Ha(e.part(i),i);if(s?.kind!=="paragraph")return null;let l=Math.min(a.anchor.offset,a.head.offset),d=Math.max(a.anchor.offset,a.head.offset),u=qh$1(s).find(f=>f.start===l&&f.end===d||l===d&&l===f.start&&e.protected(i));return u?{paragraphId:i,field:u}:null};return {keydown(a){let i=Vu(e,a.target);if(i&&a.key==="Tab")return true;if(i&&a.key.length===1&&a.key!==" "&&!a.ctrlKey&&!a.metaKey&&!a.altKey)return a.preventDefault(),true;if(a.key!==" "||Uv(a)||a.isComposing)return false;let s=i??o();if(!s)return false;if(!e.editable()||!s.field.enabled)return i?(a.preventDefault(),true):false;a.preventDefault();let l=t(s.paragraphId,s.field);return i&&l&&[...e.pagesLayer.querySelectorAll("[data-docx-form-checkbox][data-start]")].find(d=>d.dataset.paragraphId===s.paragraphId&&Number(d.dataset.start)===s.field.start)?.focus({preventScroll:true}),true},destroy(){e.pagesLayer.removeEventListener("pointerdown",n,{capture:true}),e.pagesLayer.removeEventListener("focusin",r);}}}var XR=new Set(["insertText","deleteText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertNote","insertTableRow","deleteTableRow","setRunProperties","setParagraphProperties","setParagraphMarkProperties"]);function zu(e){return XR.has(e.op)}function ju(e){if(zu(e))return e.revision!==void 0;switch(e.op){case "setParagraphMarkRevision":case "proposeParagraphMerge":return true;case "splitParagraphMany":return e.revision!==void 0;default:return false}}function Wu(e){return e?.trim()||void 0}function Xv(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function Yv(e){return e==="suggesting needs an author before it can propose a change"||e==="tracked changes need a non-empty author"}function al(e,t,n){if(!e)return null;let r=ed(e,t);return !r||r.record.paragraphId!==n?null:{paragraphId:n,offset:r.record.start}}var Qv="docx-field-atom--active",YR="docx-field-atom",Jv=new WeakMap;function Uu(e,t,n){let r=Jv.get(e);r||(r={caretKey:null,marked:[]},Jv.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(Qv);if(r.marked=[],r.caretKey=o,!t)return;let a=e.querySelectorAll(`.${YR}`);for(let i of a){if(i.dataset.paragraphId!==t.paragraphId)continue;let s=Number(i.dataset.start),l=Number(i.dataset.end);!Number.isFinite(s)||!Number.isFinite(l)||t.offset<s||t.offset>l||(i.classList.add(Qv),r.marked.push(i));}}var QR={kind:"body"};function ex(e){let{session:t}=e;if(e.editingMode==="view"||!t.editable)return true;if(e.collaborationActive)return false;let n,r=e.reviewerFilterActive?l=>(n??=ea(e.canonicalUnfilteredLayout()),n(l)):ea(e.layout),o={package:t.currentPackage(),styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,displayMode:e.displayMode,pageRefPageNumberOf:r},a=fa(t.part(),o),i=ga(t.part(),o);if(!a&&i.length===0)return true;let s=[];a&&s.push({scope:QR,ops:[a]});for(let l of i)s.push({scope:{kind:"notesPart",noteKind:l.noteKind},ops:[l.op]});return t.applyTreeOpsAtomic(s).committed}function nx(e){let t=0,n=null,r="",o=null,a=true,i=null,s="";return ()=>{let l=e.surface(),d=`${l?.session.packageRevision()??-1}:${l?.session.revision()??-1}`,u=e.activeKey(),f=e.paneOpen(),p=e.selectionAnchor(),m=e.authorFilterKey();return (l!==n||d!==r||u!==o||f!==a||p!==i||m!==s)&&(n=l,r=d,o=u,a=f,i=p,s=m,t+=1),t}}function il(e=[]){let t=new Set(e),n=Object.freeze([...t]),r=$(t),o=null,a="accept",i=null,s="accept",l=new WeakMap,d=null,u=false,f=0,p=null,m=[],h=null,x=[],v=r,b=t,I=new Set,k="accept",C=new WeakSet,T=new WeakMap,A=new Map,O=()=>{f+=1,p=null,m=[],h=null;},$$1=L=>JSON.stringify([L.id,Ca(L)]),y=(L,_$1,j)=>{let F=JR(j),H=t,V=r?.hiddenAuthors??_,B=a,X;H===b&&eE(F,I)&&(F.size===0||B===k)?X=v:F.size===0&&H.size===0?X=void 0:X=Object.freeze({hiddenAuthors:V,includes:ce=>!H.has(ce.author)&&!F.has(ce.nodeId),includesNode:(ce,xe)=>!H.has(xe)&&!F.has(ce),excludedNodeMode:(ce,xe)=>H.has(xe)?"proposed":F.has(ce)&&B==="reject"?"original":"proposed",cacheKey:tE(H,F,B)});let ae=[];for(let ce of L){let xe=tx(ce);xe!==null&&H.has(xe)||ce.kind==="revision"&&_$1.has(ce)||ae.push(ce);}x=ae.length===L.length?L:Sa(ae),h=L,C=_$1,v=X,b=H,I=F,k=B,u=false,i=null,s="accept",l=new WeakMap,d=null;},R=L=>{if(L===h)return;let _=new WeakSet,j=[],F=[];try{for(let V of L){if(V.kind!=="revision")continue;let B=!t.has(V.author),X=T.get(V);X===void 0&&(X=o?.(V)??!0,F.push([V,X])),!(B&&X)&&(_.add(V),X||j.push(V));}}catch(V){if(u)o=i,a=s,T=l,h=d,i=null,s="accept",l=new WeakMap,d=null,f+=1;else {let B=new WeakSet,X=[];for(let ae of L){if(ae.kind!=="revision")continue;let ce=A.get($$1(ae))??true;(t.has(ae.author)||!ce)&&B.add(ae),ce||X.push(ae);}y(L,B,X);}throw u=false,V}for(let[V,B]of F)T.set(V,B);let H=new Map;for(let V of L)V.kind==="revision"&&H.set($$1(V),T.get(V)??true);A=H,y(L,_,j);};return {get hiddenAuthors(){return r?.hiddenAuthors??_},get hiddenAuthorList(){return n},get stateKey(){return String(f)},get hasFilter(){return t.size>0||o!==null},filterFor(L){return o?(R(L),v):r},filterForSession(L){return o?(R(L.reviewItems()),v):r},filterItems(L){if(!o){if(t.size===0)return L;if(L===p)return m;let _=L.filter(j=>{let F=tx(j);return F===null||!t.has(F)});return p=L,m=_.length===L.length?L:Sa(_),m}return R(L),x},includesRevisionItem(L){return !C.has(L)},setPredicate(L,_="accept"){return o===null&&L===null?false:L===null?(o=null,a="accept",i=null,s="accept",u=false,T=new WeakMap,l=new WeakMap,A=new Map,d=null,x=[],C=new WeakSet,v=r,b=t,I=new Set,k="accept",O(),true):(i=o,s=a,l=T,d=h,u=true,o=L,a=_,T=new WeakMap,O(),true)},isVisible:L=>!t.has(L),setVisible(L,_){if(_===!t.has(L))return false;let j=new Set(t);return _?j.delete(L):j.add(L),t=j,n=Object.freeze([...j]),r=$(j),O(),true},setAllVisible(L,_){let j=_?new Set:new Set(L);return j.size===t.size&&[...j].every(F=>t.has(F))?false:(t=j,n=Object.freeze([...j]),r=$(j),O(),true)},showAll(){return t.size===0?false:(t=new Set,n=Object.freeze([]),r=void 0,O(),true)}}}function Gu(e,t){return t.filterItems(e)}function JR(e){let t=new Set;for(let n of e)for(let r of Ca(n))t.add(r);return t}function eE(e,t){if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function tE(e,t,n){return JSON.stringify({hiddenAuthors:[...e].sort(),excludedNodeIds:[...t].sort(),mode:t.size===0?"accept":n})}function tx(e){return e.kind==="comment"?e.comment?.author??"":e.author??null}function rx(e,t){let n=r=>{if(!t.enabled)return;let o=t.surface();if(o)return o.setAllRevisionAuthorsVisible(r);!r||!e.showAll()||t.notify();};return {isReviewAuthorVisible:e.isVisible,setReviewAuthorVisible(r,o){if(!t.enabled)return;let a=t.surface();if(a)return a.setRevisionAuthorVisible(r,o);e.setVisible(r,o)&&t.notify();},setAllReviewAuthorsVisible:n,showAllReviewAuthors:()=>n(true)}}function Xu(e){return e.kind==="comment"?e.comment.author:e.kind==="revision"?e.author:null}function ox(e){let t=null;return {get(){let n=e.layout(),r=e.items(),o=e.styles(),a=t;if(a?.layout===n&&a.items===r&&a.styles===o)return a;let i=e.slots.resolve(d$2(n),(function*(){for(let p of r){let m=Xu(p);m!==null&&(yield m);}})()),s=a?.value,l=s!==void 0&&s.size===i.size&&[...i].every(([f,p])=>s.get(f)===p),d=l?s:i,u=a!==null&&l&&a.styles===o?a.resolved:new Map(c(d,o).map(f=>[f.author,f]));return t={layout:n,items:r,styles:o,value:d,resolved:u},t},releaseLayout(){t!==null&&(t={...t,layout:null,items:null});}}}function ax(e){let t=null;return {forAuthor(n){let r=e.roster(),o=r.resolved.get(n);if(o)return a$6(o.color)??a$7(o.slot);let a=e.slots.resolve(r.value,[n]).get(n);return a===void 0?void 0:a$7(a)},declaredFor(n){let r=e.styles();return (t===null||t.styles!==r)&&(t={styles:r,resolved:b$1(r)}),a$6(t.resolved.get(n)?.color)}}}function Ao(e){try{return e.createElement("canvas").getContext("2d")}catch{return null}}function sx(e,t,n){let r=t(e.anchor.paragraphId),o=t(e.head.paragraphId);return !r||!o?null:{anchor:{paragraphId:r.paragraphId,offset:Math.max(0,e.anchor.offset)},head:{paragraphId:o.paragraphId,offset:Math.max(0,e.head.offset)},...n?{kind:n}:{}}}function lx(e,t){let n=Ha(e,t);if(!n||n.kind==="textValue")return null;let r=Fb$2(n);return !r||!Eb$1(r)?null:{paragraphId:r.toUpperCase(),nodeId:t,text:""}}var Yu=new WeakMap;function nE(e,t,n){return e.map(r=>a$6(n?.(r.name))??a$6(r.color)??a$6(t?.(r.name)))}function rE(e,t){let n="";for(let[r,o]of e.entries())n+=`${o.actorId} ${o.name} ${t[r]??""} ${o.kind??""} `,n+=`${o.anchor.nodeId}:${o.anchor.offset} `,n+=`${o.head.nodeId}:${o.head.offset}
16
+ `;return n}function oE(e){if(!e)return "*";let t=[];for(let n of e)t.push(n);return t.sort((n,r)=>n-r),t.join(",")}function aE(e){if(!e||e.size===0)return "";let t=[];for(let[n,r]of e)t.push(`${n}:${r}`);return t.sort(),t.join(",")}function iE(e,t,n){return e.layout===n.layout&&e.fingerprint===n.fingerprint&&e.pagesKey===n.pagesKey&&e.scale===n.scale&&e.offsetKey===n.offsetKey&&e.labelHost===n.labelHost&&e.childCount===t.childElementCount}function ix(e){return e.anchor.nodeId===e.head.nodeId&&e.anchor.offset===e.head.offset}function sE(e,t){let n=za$2(e,t.anchor.nodeId),r=za$2(e,t.head.nodeId);if(!n||!r)return [];let o=ra$1(e,n,r);return o?va(e,o.cellIds).map(a=>({...a,className:"docx-remote-selection-rect"})):[]}function dx(e,t,n,r){let{scale:o$1,pageOffsetX:a,pages:i,colorForAuthor:s,declaredColorFor:l}=r,d=r.labelHost??null,u=nE(n,s,l),f={layout:t,fingerprint:rE(n,u),pagesKey:oE(i),scale:o$1,offsetKey:aE(a),labelHost:d},p=Yu.get(e);if(p&&iE(p,e,f))return;Yu.delete(e);let m=[],h=[],x=[],v=[];for(let[C,T]of n.entries())T.kind==="cells"||ix(T)||v.push({key:String(C),from:{paragraphId:T.anchor.nodeId,offset:T.anchor.offset},to:{paragraphId:T.head.nodeId,offset:T.head.offset}});let b=v.length>0?ke(t,v,W(t),i,r.measurer):null;for(let[C,T]of n.entries()){let A=u[C],O=ne(t,{paragraphId:T.head.nodeId,offset:T.head.offset},r.measurer);if(O){let y=je(t,T.head.nodeId,O.pageIndex);x.push({selection:T,...A?{color:A}:{},pageIndex:O.pageIndex,x:O.x+y.x,y:O.y+y.y});}if(T.kind==="cells"){let y=sE(t,T);if(y.length>0){for(let R of y)m.push(R),h.push(A);continue}}if(ix(T)){let y=ne(t,{paragraphId:T.anchor.nodeId,offset:T.anchor.offset},r.measurer);if(!y)continue;let R=je(t,T.anchor.nodeId,y.pageIndex);m.push({pageIndex:y.pageIndex,x:y.x+R.x,y:y.y+R.y,width:Math.max(1/o$1,1),height:y.height,className:"docx-remote-caret"}),h.push(A);continue}let $=b?.get(String(C));if($)for(let y of $)m.push({...y,className:"docx-remote-selection-rect"}),h.push(A);}o(e,t,m,{scale:o$1,pageOffsetX:a}),[...e.children].forEach((C,T)=>{let A=a$6(h[T]);!A||!(C instanceof HTMLElement)||C.style.setProperty("--doc-remote-color",A);});let I=e.ownerDocument,k=[];for(let C of x){let T=t.pages[C.pageIndex];if(!T)continue;let A=I.createElement("div");A.className="docx-remote-caret-label",d?(A.setAttribute("data-docx-remote-actor",C.selection.actorId),k.push({element:A,selection:C.selection})):A.textContent=C.selection.name,A.style.left=`${(T.contentBox.x+C.x+(a?.get(C.pageIndex)??0))*o$1}px`,A.style.top=`${(T.contentBox.y+C.y)*o$1}px`;let O=a$6(C.color);O&&A.style.setProperty("--doc-remote-color",O),e.append(A);}Yu.set(e,{...f,childCount:e.childElementCount}),d&&d.publish(k);}var lE=/[\p{L}\p{N}_'’]/u,cx=e=>e!==void 0&&lE.test(e);function sl(e,t,n){let r=re(e,t.paragraphId),o=t.paragraphId,a=Math.max(0,Math.min(t.offset,r.length)),i=-1;if(cx(r[a])?i=a:a>0&&cx(r[a-1])&&(i=a-1),i===-1){let s=a,l=a;for(;s>0&&/\s/.test(r[s-1]??"");)s-=1;for(;l<r.length&&/\s/.test(r[l]??"");)l+=1;return s===l&&l<r.length&&(l+=1),{from:{paragraphId:o,offset:s},to:{paragraphId:o,offset:l}}}return {from:{paragraphId:o,offset:be(r,i+1,-1,n)},to:{paragraphId:o,offset:be(r,i,1,n)}}}function Ke(e){return {anchor:e,head:e}}function Ur(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 ll(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??V(e);return a.indexOf(r.paragraphId)<=a.indexOf(o.paragraphId)?{from:r,to:o}:{from:o,to:r}}function si(e,t,n){let r=t[0],o=a=>{let i=t.includes(a.paragraphId),s=i?a.paragraphId:r??a.paragraphId,l=i?a.offset:0,d=re(e,s).length;return {paragraphId:s,offset:Math.max(0,Math.min(l,d))}};return {anchor:o(n.anchor),head:o(n.head)}}function dl(e,t,n,r){if(t.paragraphId===n.paragraphId)return re(e,t.paragraphId).slice(t.offset,n.offset);let o=r??V(e),a=o.indexOf(t.paragraphId),i=o.indexOf(n.paragraphId);if(a===-1||i===-1)return "";let s=o.slice(a,i+1),l=re(e,t.paragraphId).slice(t.offset);for(let d=1;d<s.length;d+=1){let u=s[d],f=re(e,u),p=S(e,u).includes(s[d-1])?"":`
17
+ `;l+=p+(d===s.length-1?f.slice(0,n.offset):f);}return l}function Qu(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 fx(e){return e.kind}function px(e){return e.kind!=="textValue"&&fx(e)==="contentControl"}function ux(e){return e.kind!=="textValue"&&fx(e)==="contentControlContent"}function dE(e,t){let n=new Map,r=o=>{if(o.kind!=="textValue"){if(o.kind==="table"){let a=Qu(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 cE(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(px(a)){let s=Qu(a);!i&&s.length>0&&s.every(l=>t.has(l))&&r.add(a.id);for(let l of a.children)o(l,i);return}for(let s of a.children)o(s,i);}};return o(e.root,false),r}function mx(e,t,n,r,o,a){let i=new Set;for(let s=n;s<=r;s+=1){let l=t[s];(s===n?o.offset===0&&(s!==r||a.offset===e(l).length):s!==r||a.offset===e(l).length)&&i.add(l);}return i}function uE(e,t,n){let r=[],o=a=>{if(a.kind!=="textValue"){if(a.kind==="table"||px(a)){let s=Qu(a).filter(l=>n.has(l));if(s.length>0&&s.every(l=>t.has(l))){r.push(a.id);return}}for(let i of a.children)o(i);}};return o(e.root),r}function gx(e,t,n,r,o){let a=p=>re(e,p);if(n.paragraphId===r.paragraphId&&n.offset===r.offset)return null;let i=o??V(e),s=i.indexOf(n.paragraphId),l=i.indexOf(r.paragraphId);if(s===-1||l===-1||s>l)return null;let d=i.slice(s,l+1),u=mx(a,i,s,l,n,r),f=i[l];return {partName:t.name,paragraphIds:d,startOffset:n.offset,endOffset:r.offset,coveredParagraphIds:[...u],fullyCoveredBlockIds:uE(t,u,new Set(i)),lastMarkCovered:r.offset===a(f).length}}function hx(e,t,n,r,o){let a=A=>re(e,A);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??V(e),s=i.indexOf(n.paragraphId),l=i.indexOf(r.paragraphId);if(s===-1||l===-1)return {ops:[],collapseTo:n};let d=mx(a,i,s,l,n,r),u=dE(t,d),f=new Map;for(let[A,O]of u)for(let $ of O)f.set($,A);let p=cE(t,d,u),m=s;if(f.has(n.paragraphId)){m=-1;for(let A=s+1;A<=l;A+=1)if(!f.has(i[A])){m=A;break}if(m===-1){let A=f.get(n.paragraphId);for(let O of u.get(A)??[])f.delete(O);u.delete(A),m=s;}}let h=i[m],x=m===s?n:{paragraphId:h,offset:0},v=[];for(let A=s;A<=l;A+=1){let O=i[A];if(f.has(O))continue;let $=a(O).length,y=A===s?n.offset:0,R=A===l?r.offset:$;y<R&&v.push({op:"deleteText",paragraphId:O,start:y,end:R});}for(let A of u.keys())v.push({op:"deleteBlock",blockId:A});for(let A of p)v.push({op:"removeContentControl",controlId:A});let b=A=>{let O=Ia(t,A);for(;O&&ux(O);){let $=Ia(t,O.id);if(!$||!p.has($.id))break;O=Ia(t,$.id);}return O},I=A=>{let O=[],$=y=>{for(let R of y)if(R.kind!=="textValue"&&!u.has(R.id)){if(p.has(R.id)){let L=R.children.find(ux);L&&L.kind!=="textValue"&&$(L.children);continue}if(R.kind==="paragraph"){O.push(R.id);continue}O.push(`\0barrier:${R.id}`);}};return $(A.children),O},k=(A,O)=>{let $=b(A);if(!$||b(O)!==$)return false;let y=I($),R=y.indexOf(A),L=y.indexOf(O);return R!==-1&&L===R+1},C=h,T=h;for(let A=m+1;A<=l;A+=1){let O=i[A];f.has(O)||(k(T,O)?v.push({op:"joinParagraphs",firstId:C,secondId:O}):C=O,T=O);}return {ops:v,collapseTo:x}}function fE(e,t){let n=Math.max(0,e.end-e.start);return e.start+Math.max(0,Math.min(t,n))}var xx=/^[^\s]{1,512}$/,pE=/["\\\u0000-\u001f\u007f]/;function cl(e){let t=e.dataset?.paragraphId,n=e.dataset?.start;if(!t||n===void 0||!/^\d{1,9}$/.test(n)||!xx.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 li(e,t,n){return pE.test(t)?e.querySelectorAll(`[data-paragraph-id]${n}`):e.querySelectorAll(`[data-paragraph-id="${t}"]${n}`)}function Sx(e){let t=e.nodeType===Node.TEXT_NODE?e.parentNode:e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=cl(t);if(n)return {element:t,identity:n};t=t.parentNode;}return null}function wx(e){return e.querySelector("[data-docx-hf-active]")}function Gr(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 mE(e,t){return t===void 0||!Number.isInteger(t)||t<0?null:e.querySelector(`[data-page-index="${t}"]`)}function Ju(e,t){let n=wx(e);if(n)return [n,e];let r=mE(e,t);return r&&r!==e?[r,e]:[e]}function yx(e,t){let n=Sx(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=cl(a);if(i)return {element:a,identity:i}}return null}function gE(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=yx(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=yx(n[r],true);if(o)return {paragraphId:o.identity.paragraphId,offset:o.identity.end}}return null}function bx(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")||wx(n)&&r?.closest(".docx-page-content"))return null;let a=r?.closest("[data-docx-marker]");if(a)return a.parentElement?Ix(a.parentElement):null;if(r?.closest("[data-docx-tab-leader]"))return null;if(e.nodeType===Node.ELEMENT_NODE){let s=e,l=cl(s);if(l)return {paragraphId:l.paragraphId,offset:t>0?l.end:l.start};let d=gE(s,t);return d||vE(s)}let i=Sx(e);return i?{paragraphId:i.identity.paragraphId,offset:fE(i.identity,t)}:null}function Lo(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=bx(n,r,e),s=bx(o,a,e);if(!i||!s){let l=i??s;return l?{anchor:l,head:l}:null}return {anchor:i,head:s}}function ef(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 vx(e,t,n){for(let r of Ju(e,n)){let o=hE(r,t);if(o)return o}return null}function hE(e,t){let n=li(e,t.paragraphId,"[data-start]"),r=null,o=false;for(let i of n){let s=cl(i);if(!s||s.paragraphId!==t.paragraphId)continue;let l=yE(i),d=i.textContent?.length??0,u=s.end;if(l&&!i.closest?.("[data-docx-field]")&&(o=true,t.offset>=s.start&&t.offset<=u)){let f={node:l,offset:Math.min(t.offset-s.start,d)};if(t.offset<u)return f;r=f;}}if(r)return r;if(o)return null;let a=bE(e,t.paragraphId);return a?{node:a,offset:0}:null}function yE(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 bE(e,t){let n=null;for(let r of li(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 Ix(e){let t=e.closest("[data-paragraph-id]");if(!t||t.dataset.start!==void 0)return null;let n=t.dataset.paragraphId;return !n||!xx.test(n)||n==="__proto__"?null:{paragraphId:n,offset:0}}function vE(e){let t=Ix(e);return !t||e.closest("[data-paragraph-id]").querySelector("[data-paragraph-id][data-start]")?null:t}function kx(e,t,n,r){if(!n)return false;let o=r?.preferredPageIndex??Gr(n.anchorNode,e),a=vx(e,t.anchor,o),i=vx(e,t.head,o);if(!a||!i)return false;let s=Lo(e,n);if(s&&Et(s,t)){let l=Gr(n.anchorNode,e);if(o===void 0||l===o)return true}try{return n.setBaseAndExtent(a.node,a.offset,i.node,i.offset),!0}catch{return false}}function Et(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 xE='[data-docx-marker],[data-docx-tab-leader],[aria-hidden="true"],[contenteditable="false"],[data-drawing-node-id]';function Tx(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 Px(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 SE(e){return e?(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".docx-page")??null:null}function wE(e,t,n){return t&&e.contains(t)?2:n?.contains(e)?1:0}function Cx(e,t,n,r){if(e.dataset.docxField!==void 0){let a=Tx(e,t,t);return {start:t,end:a,text:n.slice(t,a),seq:r}}let o=e.textContent??"";return {start:t,end:Tx(e,t,t+o.length),text:o,seq:r}}function Rx(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=Px(r,t.paragraphId);if(o===null){if(r.dataset?.start!==void 0||r.matches?.(xE))continue;Rx(r,t);continue}let a=Cx(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 IE(e,t,n,r){let o=[];for(let i of li(e,t,"")){let s=i;s.dataset.paragraphId===t&&s.dataset.start===void 0&&(o.some(l=>l.contains(s))||o.push(s));}let a=new Map;for(let i of o){let s=i.dataset.fragmentIndex??"",l=wE(i,n,r),d=a.get(s);(!d||l>d.affinity)&&a.set(s,{element:i,affinity:l});}return [...a.values()].map(i=>i.element)}function kE(e,t,n){for(let r of li(e,n.paragraphId,"[data-start]")){let o=r,a=Px(o,n.paragraphId);if(a===null||t.some(l=>l.contains(o)))continue;let i=Cx(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 TE(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 Ex(e,t,n,r){let o=IE(e,t,r,SE(r)),a={paragraphId:t,modelText:n,pieces:[],ranges:new Set,end:0,seq:0};for(let i of o)Rx(i,a);return kE(e,o,a),a.pieces.length===0?null:TE(a.pieces,n)}var PE={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"lineStart",End:"lineEnd"},Ox={l:"left",e:"center",r:"right",j:"both"},Mx={1:"240",5:"360",2:"480"},Fx={b:{localName:"b"},i:{localName:"i"},u:{localName:"u",attributes:{val:"single"}}};function CE(e,t){return e.altKey?e.metaKey?true:e.ctrlKey?e.getModifierState?.("AltGraph")??false?e.key.toLowerCase()===t:true:false:false}var RE=/^[a-z]$/;function EE(e){let t=e.key.toLowerCase();if(RE.test(t))return t;let n=e.code??"";return n.length===4&&n.startsWith("Key")?n[3].toLowerCase():""}function Lx(e,t={}){return n=>{if(n.defaultPrevented)return;if(n.key==="F9"&&n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.isComposing&&t.onToggleFieldCodes){n.preventDefault(),t.onToggleFieldCodes();return}if(!n.altKey&&!n.isComposing&&(n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.key==="8"||n.ctrlKey&&!n.metaKey&&n.shiftKey&&(n.code==="Digit8"||n.key==="*"))&&t.onToggleParagraphMarks){n.preventDefault(),t.onToggleParagraphMarks();return}if(n.key==="Escape"&&e.formatPainter.state().mode!=="off"){e.formatPainter.disarm(),n.preventDefault();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}let r=EE(n);if(CE(n,r)&&!n.shiftKey){let i=r;if(i==="f"){n.preventDefault(),e.insertNote("footnote");return}if(i==="d"){n.preventDefault(),e.insertNote("endnote");return}if(i==="c"){n.preventDefault(),e.formatPainter.capture();return}if(i==="v"){n.preventDefault(),e.formatPainter.apply();return}}let o=n.metaKey||n.ctrlKey,a=PE[n.key];if(a){let i=a;n.key==="Home"||n.key==="End"?o&&(i=n.key==="Home"?"documentStart":"documentEnd"):(n.key==="ArrowLeft"||n.key==="ArrowRight")&&(n.altKey||n.ctrlKey)?i=n.key==="ArrowLeft"?"wordLeft":"wordRight":n.metaKey&&(n.key==="ArrowLeft"||n.key==="ArrowRight")?i=n.key==="ArrowLeft"?"lineStart":"lineEnd":o&&(n.key==="ArrowUp"||n.key==="ArrowDown")&&(i=n.key==="ArrowUp"?"documentStart":"documentEnd"),e.navigate(i,n.shiftKey),n.preventDefault();return}if(n.key==="PageUp"||n.key==="PageDown"){e.navigate(o?n.key==="PageUp"?"documentStart":"documentEnd":n.key==="PageUp"?"pageUp":"pageDown",n.shiftKey),n.preventDefault();return}if(n.key==="Backspace"){o||n.altKey?e.deleteWordBackward():e.deleteBackward(),n.preventDefault();return}if(n.key==="Delete"){o||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"){o?e.insertPageBreak():n.shiftKey?e.insertLineBreak():e.exitListOnEmptyItem()||e.splitParagraph(),n.preventDefault();return}if(o&&n.key.toLowerCase()==="a"){e.selectAll(),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="v"){e.armForcePlainPaste();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="k"&&t.onRequestHyperlink){t.onRequestHyperlink(),n.preventDefault();return}if(o&&!n.shiftKey&&Fx[n.key.toLowerCase()]){let i=Fx[n.key.toLowerCase()];e.toggleRunProperty(i.localName,i.attributes),n.preventDefault();return}if(o&&(n.key==="="||n.key==="+"||n.code==="Equal")){e.toggleRunProperty("vertAlign",{val:n.shiftKey?"superscript":"subscript"}),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("decrease"),n.preventDefault();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("increase"),n.preventDefault();return}if(o&&!n.shiftKey&&Ox[n.key.toLowerCase()]){if(n.metaKey&&n.key.toLowerCase()==="r")return;e.setParagraphProperty("jc",{val:Ox[n.key.toLowerCase()]}),n.preventDefault();return}if(o&&!n.shiftKey&&Mx[n.key]){e.setParagraphProperty("spacing",{line:Mx[n.key],lineRule:"auto"},{mergeAttributes:true}),n.preventDefault();return}if(o&&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 Nx(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=Fc(a.clipboardData),s=a.clipboardData?.getData("text/html")??"";a.preventDefault(),!(!i&&!s)&&e.pasteRich(i,s.length>0?s:null);}}}function Ax(e){let t=Fc(e.dataTransfer);return t.length>0?t:null}function Dx(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??Ax(n);if(!r)return;AE(e,ME(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=Ax(n);r&&t.insertPlainText(r);return}n.inputType==="insertParagraph"&&e.splitParagraph();}}}}function OE(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 ME(e){if(typeof e.getTargetRanges!="function")return null;let t=e.getTargetRanges();if(t.length!==1)return null;let n=t[0],r=OE(n);return r?{text:r,paragraphId:FE(n)}:null}function FE(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 AE(e,t,n){if(t!==null){e.flushPendingInput();let r=e.state(),o=r.selection.head,a=t.text;if(Et(r.selection,Ke(o))&&o.offset>=a.length&&(t.paragraphId===null||t.paragraphId===o.paragraphId)&&r.pendingFormat===null){let i=Ve(e.session,o.paragraphId)??e.session.part(),s=Pi(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 Hx(e,t,n,r=null){for(let o of Ju(e)){let a=Ex(o,t,n,r);if(a!==null)return a}return null}function _x(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 $e(e){return e.kind!=="textValue"}function me(e,t){if(!e||e.kind==="textValue")return null;for(let n of e.children)if($e(n)&&n.localName===t&&n.namespaceUri===da$1)return n;return null}function Xe(e,t="val"){return e?Ie(e,t,da$1):void 0}function en(e,t,n){return e?Ie(e,t,n):void 0}function tf(e){if(e.kind==="textValue")return e.value;let t="";for(let n of e.children)t+=tf(n);return t}function No(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=No(r,t,n);if(o)return o}return null}function ht(e){if(e===void 0||!/^-?\d+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function nf(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var Rn=nf;function ul(e){return e===void 0||e.toLowerCase()==="auto"?null:/^[0-9A-Fa-f]{6}$/.test(e)?`#${e.toLowerCase()}`:null}function En(e){return `${Math.round(e/20*100)/100}pt`}var LE="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",NE=Cb$1;function di(e,t,n){for(let o of ic$1(e,e.mainDocumentPart)){if(o.type!==t||o.targetMode==="External")continue;let a=w(o.ownerPart,o.rawTarget);if(a.ok){let i=e.parts.get(a.partName);if(i&&$e(i.root))return i.root}}let r=e.parts.get(n);return r&&$e(r.root)?r.root:null}function Bx(e){let t=di(e,LE,"/word/styles.xml"),n=new Map,r=null,o=null,a=null,i=null,s=null;if(!t)return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:a,defaultCharacterStyleId:i,defaultTableStyleId:s};let l=0;for(let d of t.children){if(!$e(d)||d.namespaceUri!==da$1)continue;if(d.localName==="docDefaults"){r=me(me(d,"rPrDefault"),"rPr"),o=me(me(d,"pPrDefault"),"pPr");continue}if(d.localName!=="style")continue;if(l>=Db$1)break;l+=1;let u=Ie(d,"styleId",da$1);if(!u)continue;n.set(u,d);let f=Ie(d,"default",da$1),p=Ie(d,"type",da$1);f==="1"||f==="true"||f==="on"?p==="paragraph"?a=u:p==="character"?i=u:p==="table"&&(s=u):(a===u&&(a=null),i===u&&(i=null),s===u&&(s=null));}return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:a,defaultCharacterStyleId:i,defaultTableStyleId:s}}function Un(e,t,n){let r=[],o=new Set,a=t;for(;a&&!o.has(a)&&r.length<NE;){o.add(a);let i=e.byId.get(a);if(!i)break;if(r.length===0&&n!==void 0){let s=Ie(i,"type",da$1);if(s!==void 0&&s!==n)return []}r.unshift(i),a=Xe(me(i,"basedOn"));}return r}function rf(e,t,n){let r=[];if(e.docDefaultsPPr&&r.push(e.docDefaultsPPr),n)for(let a of n)r.push(a);let o=Xe(me(t,"pStyle"));for(let a of Un(e,o??e.defaultParagraphStyleId??void 0,"paragraph")){let i=me(a,"pPr");i&&r.push(i);}return t&&r.push(t),r}function fl(e,t,n,r){let o=[];e.docDefaultsRPr&&o.push(e.docDefaultsRPr);let a=[];if(r)for(let f of r)a.push(f);let i=[],s=Xe(me(t,"pStyle"));for(let f of Un(e,s??e.defaultParagraphStyleId??void 0,"paragraph")){let p=me(f,"rPr");p&&i.push(p);}let l=[],d=Xe(me(n,"rStyle"))??e.defaultCharacterStyleId??void 0;for(let f of Un(e,d,"character")){let p=me(f,"rPr");p&&l.push(p);}let u=[...o,...a,...i,...l];return n&&u.push(n),{all:u,defaults:o,tableLevel:a,paragraphLevel:i,characterLevel:l,direct:n}}function tn(e,t){let n=null;for(let r of e){let o=me(r,t);o&&(n=o);}return n}function st(e,t,n){let r;for(let o of e){let a=me(o,t);if(!a)continue;let i=Ie(a,n,da$1);i!==void 0&&(r=i);}return r}function pl(e){return !(e==="0"||e==="false"||e==="off")}function Gn(e,t){let n=false;for(let r of e){let o=me(r,t);o&&(n=pl(Xe(o)));}return n}function xr(e,t){let n;for(let r of e){let o=me(r,t);o&&(n=pl(Xe(o)));}return n}function hn(e,t){let n=e.direct?me(e.direct,t):null;if(n)return pl(Xe(n));let r=xr(e.tableLevel,t),o=xr(e.paragraphLevel,t),a=xr(e.characterLevel,t);return a===false||a===void 0&&o===false||a===void 0&&o===void 0&&r===false?false:xr(e.defaults,t)===true?true:r===true!=(o===true)!=(a===true)}function of(e,t){let n=e.direct?me(e.direct,t):null;if(n)return pl(Xe(n));let r=xr(e.characterLevel,t);if(r!==void 0)return r;let o=xr(e.paragraphLevel,t);if(o!==void 0)return o;let a=xr(e.tableLevel,t);return a!==void 0?a:xr(e.defaults,t)===true}function $x(e){return e.isLgl?"decimal":e.numFmt}function qx(e){let t=wc$1(e),n=new Map,r=new Map,o=new Map,a=new Map,i=new Map,s=new Map;for(let[l,d]of t.abstractNums){d.numStyleLink!==void 0&&s.set(l,d.numStyleLink);let u=new Map,f=new Map;for(let[p,m]of d.levels)u.set(String(p),$x(m)),f.set(String(p),m.start);r.set(l,u),o.set(l,f);}for(let[l,d]of t.nums){n.set(l,d.abstractNumId);for(let[u,f]of d.overrides){let p=`${l}:${u}`,m=f.startOverride??f.level?.start;m!==void 0&&a.set(p,m),f.level!==void 0&&i.set(p,$x(f.level));}}return {numToAbstract:n,levelFormats:r,levelStarts:o,startOverrides:a,formatOverrides:i,styleLinks:s}}function Zx(e,t){if(e===null)return null;let n=Ie(e,t,da$1);if(n===void 0||!/^-?\d{1,9}$/.test(n))return null;let r=Number.parseInt(n,10);return Number.isSafeInteger(r)?r:null}function Vx(e,t){if(e===null)return null;let n=Ie(e,t,da$1);return n!==void 0&&/^[0-9A-Fa-f]{6}$/.test(n)?`#${n.toLowerCase()}`:null}function Kx(e){return `${Math.round(e/20*100)/100}pt`}var DE=["wholeTable","firstRow","lastRow","firstCol","lastCol","band1Horz","band2Horz","band1Vert","band2Vert","nwCell","neCell","swCell","seCell"];function Do(e,t,n){if(e===null)return null;let r=Ie(e,t,da$1);if(r!==void 0)return !(r==="0"||r==="false"||r==="off");let o=Ie(e,"val",da$1);return o===void 0||!/^[0-9A-Fa-f]{1,4}$/.test(o)?null:(Number.parseInt(o,16)&n)!==0}function af(e,t){let n=new Map,r=new Set(DE);for(let o of e)for(let a of o.children){if(a.kind==="textValue"||a.localName!=="tblStylePr"||a.namespaceUri!==da$1)continue;let i=Ie(a,"type",da$1);i===void 0||!r.has(i)||n.set(i,{fill:Vx(me(me(a,"tcPr"),"shd"),"fill"),rPr:me(a,"rPr"),pPr:me(a,"pPr")});}return {byType:n,firstRowEnabled:Do(t,"firstRow",32)??false,lastRowEnabled:Do(t,"lastRow",64)??false,firstColumnEnabled:Do(t,"firstColumn",128)??false,lastColumnEnabled:Do(t,"lastColumn",256)??false,hBandingEnabled:!(Do(t,"noHBand",512)??false),vBandingEnabled:!(Do(t,"noVBand",1024)??false)}}function sf(e,t,n,r,o,a){let i=e.firstRowEnabled&&t===0,s=e.lastRowEnabled&&t===n-1,l=e.firstColumnEnabled&&r,d=e.lastColumnEnabled&&o,u=f=>e.byType.get(f)??null;if(s&&l&&u("swCell"))return u("swCell");if(s&&d&&u("seCell"))return u("seCell");if(i&&l&&u("nwCell"))return u("nwCell");if(i&&d&&u("neCell"))return u("neCell");if(s&&u("lastRow"))return u("lastRow");if(i&&u("firstRow"))return u("firstRow");if(d&&u("lastCol"))return u("lastCol");if(l&&u("firstCol"))return u("firstCol");if(e.hBandingEnabled){let f=t-(e.firstRowEnabled?1:0);if(f>=0){let p=u(f%2===0?"band1Horz":"band2Horz");if(p)return p}}if(e.vBandingEnabled){let f=a-(e.firstColumnEnabled?1:0);if(f>=0){let p=u(f%2===0?"band1Vert":"band2Vert");if(p)return p}}return null}function zx(e,t,n,r,o,a,i,s,l=false,d=[]){let u=[],f=me(e,"tcBorders"),p={top:n===0?"top":"insideH",bottom:n+o>=r?"bottom":"insideH",left:a?"left":"insideV",right:i?"right":"insideV"};for(let C of ["top","left","bottom","right"]){let T=C==="left"?"start":C==="right"?"end":C,A=me(f,C)??me(f,T),O=p[C],$=O==="left"?"start":O==="right"?"end":O,y=A!==null?Zr(A):Zr(me(t,O)??me(t,$));y&&u.push(`border-${pn(C,l)}:${y}`);}let m=Vx(me(e,"shd"),"fill")??s;m&&u.push(`background-color:${m}`);let h=me(e,"vAlign"),x=h===null?void 0:Ie(h,"val",da$1);x==="center"?u.push("vertical-align:middle"):(x==="bottom"||x==="top")&&u.push(`vertical-align:${x}`);let v=me(e,"tcW"),b=Zx(v,"w"),I=v===null?void 0:Ie(v,"type",da$1);b!==null&&b>0&&(I===void 0||I==="dxa")&&u.push(`width:${Kx(b)}`);let k=me(e,"tcMar");for(let C of ["top","right","bottom","left"]){let T=C==="left"?"start":C==="right"?"end":C,A=me(k,C)??me(k,T)??d.map(y=>me(y,C)??me(y,T)).find(y=>y!==null)??null,O=Zx(A,"w"),$=A===null?void 0:Ie(A,"type",da$1);O!==null&&O>=0&&($===void 0||$==="dxa")&&u.push(`padding-${pn(C,l)}:${Kx(O)}`);}return u.join(";")}function HE(e){return e.kind==="tableCell"?true:e.localName==="tc"&&e.namespaceUri===da$1}function jx(e){return e.localName==="customXml"&&e.namespaceUri===da$1}function Wx(e){let t=[],n=[],r=o=>{for(let a of o)if($e(a)){if(a.kind==="tableRow"||a.localName==="tr"&&a.namespaceUri===da$1){n.push({row:t.length}),t.push(a);continue}if(a.kind==="contentControl"){let i=a.children.find(s=>s.kind==="contentControlContent");i&&$e(i)&&r(i.children);continue}if(jx(a)){r(a.children);continue}n.push({skip:a});}};return r(e.children),{rows:t,tableItems:n}}function Ux(e){let t=[],n=[];for(let r of e){let o=[],a=[],i=0,s=l=>{for(let d of l)if($e(d)){if(HE(d)){let u=me(d,"tcPr"),f=Math.min(Math.max(ht(Xe(me(u,"gridSpan")))??1,1),63),p=me(u,"vMerge"),m=p===null?null:Xe(p)==="restart"?"restart":"continue",h={cell:d,startColumn:i,span:f,vMerge:m};o.push(h),a.push({placement:h}),i+=f;continue}if(d.kind==="contentControl"){let u=d.children.find(f=>f.kind==="contentControlContent");u&&$e(u)&&s(u.children);continue}if(jx(d)){s(d.children);continue}a.push({skip:d});}};s(r.children),t.push(o),n.push(a);}return {placements:t,items:n}}function Gx(e){let t=1;for(let n of e)for(let r of n)t=Math.max(t,r.startColumn+r.span);return t}function Xx(e,t,n,r){let o=new Map,a=t.byType.get("wholeTable")??null;for(let i=0;i<n.length;i+=1)for(let s of n[i]??[]){if(s.vMerge==="continue")continue;let l=sf(t,i,n.length,s.startColumn===0,s.startColumn+s.span>=r,s.startColumn),d=[],u=[];a?.rPr&&d.push(a.rPr),a?.pPr&&u.push(a.pPr),l?.rPr&&d.push(l.rPr),l?.pPr&&u.push(l.pPr),o.set(s.cell,d.length>0||u.length>0?{...e,tableRPr:d,tablePPr:u}:e);}return o}function Yx(e,t){let n=Un(e.styles,Xe(me(t,"tblStyle")),"table");return n.length>0?n:Un(e.styles,e.styles.defaultTableStyleId??void 0,"table")}function Qx(e,t){let n=t.children.find(l=>l.kind==="tableProperties"),r=n&&$e(n)?n:null,o=Yx(e,r),a=af(o,me(r,"tblLook")),{rows:i}=Wx(t),{placements:s}=Ux(i);return Xx(e,a,s,Gx(s))}function Jx(e,t,n,r){let o=t.children.find(y=>y.kind==="tableProperties"),a=o&&$e(o)?o:null,i=null,s=Yx(e,a);for(let y of s){let R=me(me(y,"tblPr"),"tblBorders");R&&(i=R);}let l=s.map(y=>me(y,"tblPr")).filter(y=>y!==null);a&&l.push(a);let d=Gn(l,"bidiVisual"),u=[],f;for(let y of l){let R=me(y,"tblCellMar");R&&u.unshift(R),f=Xe(me(y,"jc"))??f;}let p=me(a,"tblBorders");p&&(i=p);let m=af(s,me(a,"tblLook")),{rows:h,tableItems:x}=Wx(t),{placements:v,items:b}=Ux(h),I=Gx(v),k=Xx(e,m,v,I),C=["border-collapse:collapse"],T=me(a,"tblW"),A=ht(en(T,"w",da$1));A!==null&&A>0&&en(T,"type",da$1)==="dxa"&&C.push(`width:${En(A)}`);let O=pn(f==="right"||f==="end"?"right":f==="center"?"center":"left",d);O==="center"?C.push("margin-left:auto","margin-right:auto"):O==="right"?C.push("margin-left:auto","margin-right:0"):C.push("margin-left:0","margin-right:auto");for(let[y,R]of [["insideH","insideh"],["insideV","insidev"]]){let L=Zr(me(i,y));L&&C.push(`mso-border-${R}-alt:${L}`);}let $=`<table dir="${d?"rtl":"ltr"}" align="${O}" style="${C.join(";")}">`;for(let y of x){if("skip"in y){r.advanceFieldState(y.skip,n);continue}let R=y.row,L=me(me(h[R]??null,"trPr"),"trHeight"),_=ht(en(L,"val",da$1)),j=Gh(_,en(L,"hRule",da$1)),F=j===""?"":` style="${j}"`;$+=`<tr${F}>`;for(let H of b[R]??[]){if("skip"in H){r.advanceFieldState(H.skip,n);continue}let V=H.placement;if(V.vMerge==="continue"){r.advanceFieldState(V.cell,n);continue}let B=1;if(V.vMerge==="restart")for(let q=R+1;q<v.length&&v[q].find(Y=>Y.startColumn===V.startColumn&&Y.vMerge==="continue");q+=1)B+=1;let X=me(V.cell,"tcPr"),ae=V.startColumn+V.span>=I,ce=sf(m,R,v.length,V.startColumn===0,ae,V.startColumn),xe=m.byType.get("wholeTable")??null,fe=zx(X,i,R,v.length,B,V.startColumn===0,ae,ce?.fill??xe?.fill??null,d,u),D=(V.span>1?` colspan="${V.span}"`:"")+(B>1?` rowspan="${B}"`:"")+(fe===""?"":` style="${Rn(fe)}"`),M=k.get(V.cell)??e;$+=`<td dir="ltr"${D}>${r.renderBlocks(M,V.cell.children,n)}</td>`;}$+="</tr>";}return `${$}</table>`}function ml(e){if(e===void 0||!/^\d{1,10}$/.test(e))return null;let t=Number.parseInt(e,10);return t>=1&&t<=2147483647?t:null}function lf(e){let t=Ie(e,"type",da$1);return t==="separator"||t==="continuationSeparator"}function df(e,t){let n=new Set;if(e===null)return n;for(let r of e.children){if(!$e(r)||r.namespaceUri!==da$1||r.localName!==t||lf(r))continue;let o=ml(Ie(r,"id",da$1));o!==null&&n.add(o);}return n}function ci(e,t,n,r,o,a,i){for(let s of t.children)if($e(s)&&s.kind!=="drawing"){if(s.kind==="revisionDelete"||s.kind==="revisionMoveFrom"){r.inert||o(s,r);continue}if(s.kind==="table"){ci(e,s,n,r,o,a,Qx(e,s));continue}if(s.kind==="tableCell"||s.namespaceUri===da$1&&s.localName==="tc"){let l=i?.get(s);if(l===void 0){r.inert||o(s,r);continue}ci(l,s,n,r,o,a,i);continue}if(s.kind==="paragraph"){let l=s.children.find(d=>d.kind==="paragraphProperties");ci(e,s,n,r,o,l&&$e(l)?l:null,i);continue}if(s.kind==="run"){if(s.children.some(u=>u.kind==="fldChar")){r.inert||o(s,r);continue}if(s.children.some(u=>u.kind==="instrText")||!r.inert&&r.stack.some(u=>u==="instr"))continue;let l=s.children.find(u=>u.kind==="runProperties"),d=fl(e.styles,a,l&&$e(l)?l:null,e.tableRPr);if(hn(d,"vanish"))continue}if(s.namespaceUri===da$1&&(s.localName==="footnoteReference"||s.localName==="endnoteReference")){let l=ml(Ie(s,"id",da$1));l!==null&&n.push({kind:s.localName==="footnoteReference"?"footnote":"endnote",id:l});continue}ci(e,s,n,r,o,a,i);}}function _E(e,t,n){if(e===null)return null;for(let r of e.children)if(!(!$e(r)||r.namespaceUri!==da$1)&&!(r.localName!==t||lf(r))&&ml(Ie(r,"id",da$1))===n)return r;return null}function eS(e,t,n){let r={footnote:new Set(e.noteOrdinals.footnote.keys()),endnote:new Set(e.noteOrdinals.endnote.keys())},o=[];for(let a of ["footnote","endnote"])for(let i of r[a])o.push({kind:a,id:i});for(;o.length>0;){let a=o.pop(),i=_E(t[a.kind],a.kind,a.id);if(i===null)continue;let s={stack:[],inert:false};n(i,s);let l={stack:[],inert:s.stack.length>0},d=[];ci(e,i,d,l,n,null);for(let u of d)e.availableNotes[u.kind].has(u.id)&&(r[u.kind].has(u.id)||(r[u.kind].add(u.id),o.push(u)));}return r}function cf(e,t,n,r,o){if(n===null)return "";let a=`/word/${t}s.xml`;for(let[l,d]of e.pkg.parts)d.root===n&&(a=l);let i=ic$1(e.pkg,a),s="";for(let l of n.children){if(!$e(l)||l.namespaceUri!==da$1||l.localName!==t||lf(l))continue;let d=Ie(l,"id",da$1),u=ml(d);if(d===void 0||u===null||!r.has(u))continue;let f=o({...e,noteBody:{kind:t,id:u},docRels:i},l.children);s+=`<div style="mso-element:${t}" id="${t==="footnote"?"ftn":"edn"}${u}">${f===""?"<p></p>":f}</div>`;}return s===""?"":`<div style="mso-element:${t}-list">${s}</div>`}var uf="http://schemas.openxmlformats.org/officeDocument/2006/relationships",BE=`${uf}/numbering`,$E=`${uf}/footnotes`,qE=`${uf}/endnotes`,ZE=2*1024*1024,KE=8*1024*1024,tS=9525,VE=new Map([["image/png","image/png"],["image/jpeg","image/jpeg"],["image/jpg","image/jpeg"],["image/gif","image/gif"],["image/bmp","image/bmp"],["image/x-ms-bmp","image/bmp"],["image/x-bmp","image/bmp"],["image/webp","image/webp"],["image/svg+xml","image/svg+xml"],["image/tiff","image/tiff"],["image/x-emf","image/x-emf"],["image/x-wmf","image/x-wmf"]]);function gl(e,t,n,r){let o=e.direct!==null&&me(e.direct,r)!==null||tn(e.defaults,r)!==null||tn(e.tableLevel,r)!==null||tn(e.paragraphLevel,r)!==null||tn(e.characterLevel,r)!==null;return hn(e,t&&o?r:n)}function zE(e){let t=e.all;if(hn(e,"vanish"))return {css:"",vanish:true,vertAlign:null,lang:null,rtl:false};let n=[],r=Gn(t,"rtl"),o=(r?st(t,"rFonts","cs"):void 0)??st(t,"rFonts","ascii")??st(t,"rFonts","hAnsi")??st(t,"rFonts","eastAsia")??(r?void 0:st(t,"rFonts","cs"));if(o!==void 0){let C=jh(o);C&&n.push(`font-family:${C}`);}let a=ht((r?st(t,"szCs","val"):void 0)??st(t,"sz","val")??(r?void 0:st(t,"szCs","val")));a!==null&&a>0&&n.push(`font-size:${Math.round(a/2*100)/100}pt`);let i={...e,direct:null},s=e.direct?t.slice(0,-1):t;gl(e,r,"b","bCs")?n.push("font-weight:bold"):gl(i,r,"b","bCs")&&n.push("font-weight:normal"),gl(e,r,"i","iCs")?n.push("font-style:italic"):gl(i,r,"i","iCs")&&n.push("font-style:normal");let l=[],d=tn(t,"u"),u=d!==null&&Xe(d)!=="none";u&&l.push("underline");let f=of(e,"dstrike");if((hn(e,"strike")||f)&&l.push("line-through"),l.length>0)n.push(`text-decoration:${l.join(" ")}`);else {let C=tn(s,"u");(C!==null&&Xe(C)!=="none"||hn(i,"strike")||of(i,"dstrike"))&&n.push("text-decoration:none");}u&&n.push(...Uh(d)),f&&!u&&n.push("text-decoration-style:double");let p=ul(st(t,"color","val"));p&&n.push(`color:${p}`);let m=ht(st(t,"spacing","val"));m!==null&&n.push(`letter-spacing:${Math.round(m/20*100)/100}pt`);let h=Xe(tn(t,"highlight")),x=h!==void 0&&Object.hasOwn(dc,h)?dc[h]:void 0,v=ul(st(t,"shd","fill"));x?n.push(`background-color:${x}`,`mso-highlight:${h}`):v&&n.push(`background-color:${v}`),hn(e,"caps")?n.push("text-transform:uppercase"):hn(i,"caps")&&n.push("text-transform:none"),hn(e,"smallCaps")?n.push("font-variant:small-caps"):hn(i,"smallCaps")&&n.push("font-variant:normal");let b=Xe(tn(t,"vertAlign")),I=b==="superscript"||b==="subscript"?b:null,k=qr((r?st(t,"lang","bidi"):void 0)??st(t,"lang","val")??st(t,"lang","bidi")??st(t,"lang","eastAsia"));return {css:n.join(";"),vanish:false,vertAlign:I,lang:k,rtl:r}}function jE(e,t){let n=[],r=Xe(tn(e,"jc")),o=r!==void 0&&Object.hasOwn(cc,r)?cc[r]:void 0;o&&n.push(`text-align:${o}`);let a=ht(st(e,"spacing","before"));a!==null&&a>=0&&n.push(`margin-top:${En(a)}`);let i=ht(st(e,"spacing","after"));i!==null&&i>=0&&n.push(`margin-bottom:${En(i)}`);let s=ht(st(e,"spacing","line")),l=st(e,"spacing","lineRule");n.push(...Wh(s,l));let d=null,u=null,f=null,p=null;for(let v of e){let b=me(v,"ind");if(!b)continue;let I=ht(en(b,"left",da$1)??en(b,"start",da$1));I!==null&&(d=I);let k=ht(en(b,"right",da$1)??en(b,"end",da$1));k!==null&&(u=k);let C=ht(en(b,"hanging",da$1)),T=ht(en(b,"firstLine",da$1));C!==null?(f=C,p=null):T!==null&&(p=T,f=null);}!t&&d!==null&&n.push(`margin-left:${En(d)}`),u!==null&&n.push(`margin-right:${En(u)}`),f!==null&&f!==0?n.push(`text-indent:${En(-f)}`):p!==null&&p!==0&&n.push(`text-indent:${En(p)}`);let m=tn(e,"tabs");if(m){let v=[];for(let b of m.children){if(!$e(b)||b.localName!=="tab")continue;let I=Xe(b),k=ht(Ie(b,"pos",da$1));if(k===null||k<0||I!=="left"&&I!=="center"&&I!=="right"&&I!=="decimal"&&I!=="bar")continue;let C=Xe(b,"leader"),T=C==="dot"?"dotted":C==="hyphen"?"dashed":C==="underscore"?"lined":C==="middleDot"?"middledot":C==="heavy"?"heavy":"";v.push(`${I}${T?` ${T}`:""} ${En(k)}`);}v.length>0&&n.push(`tab-stops:${v.join(" ")}`);}Gn(e,"pageBreakBefore")&&n.push("page-break-before:always"),Gn(e,"keepNext")&&n.push("page-break-after:avoid"),Gn(e,"keepLines")&&n.push("page-break-inside:avoid"),Gn(e,"widowControl")&&n.push("widows:2","orphans:2");let h=ul(st(e,"shd","fill"));h&&n.push(`background-color:${h}`);let x=tn(e,"pBdr");if(x)for(let v of ["top","left","bottom","right"]){let b=Zr(me(x,v));b&&n.push(`border-${v}:${b}`,`mso-border-${v}-alt:${b}`);}return n.join(";")}function WE(e,t,n){let r=e.noteOrdinals[t],o=r.get(n);if(o!==void 0)return o;let a=r.size+1;return r.set(n,a),a}var nS={decimal:"decimal",decimalZero:"decimal-leading-zero",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",none:"none"};function oS(e,t,n,r){let o=e.numbering.formatOverrides.get(`${t}:${r}`)??e.numbering.levelFormats.get(n)?.get(String(r))??"decimal",a=e.numbering.startOverrides.get(`${t}:${r}`)??e.numbering.levelStarts.get(n)?.get(String(r))??1;return {fmt:o,start:a}}function UE(e,t){let n,r;for(let s of t){let l=me(s,"numPr");if(!l)continue;let d=Xe(me(l,"numId"));d!==void 0&&(n=d);let u=Xe(me(l,"ilvl"));u!==void 0&&(r=u);}if(n===void 0||n==="0")return null;let o=e.numbering.numToAbstract.get(n);if(o===void 0)return null;for(let s=0;s<8&&!((e.numbering.levelFormats.get(o)?.size??0)>0);s+=1){let l=e.numbering.styleLinks.get(o),d=l===void 0?void 0:e.styles.byId.get(l),u=Xe(me(me(me(d??null,"pPr"),"numPr"),"numId")),f=u===void 0?void 0:e.numbering.numToAbstract.get(u);if(f===void 0||f===o)break;o=f;}let a=Math.min(Math.max(ht(r)??0,0),8),i=oS(e,n,o,a);return {numId:n,abstractId:o,level:a,fmt:i.fmt,start:i.start}}function GE(e,t){let n=B$1(e.pkg.contentTypes,t);if(n.ok){let a=VE.get(n.contentType.toLowerCase());if(a!==void 0)return a}let r=t.lastIndexOf("."),o=r===-1?"":t.slice(r+1).toLowerCase();return o==="png"?"image/png":o==="jpg"||o==="jpeg"?"image/jpeg":o==="gif"?"image/gif":o==="bmp"?"image/bmp":o==="webp"?"image/webp":o==="svg"?"image/svg+xml":o==="tif"||o==="tiff"?"image/tiff":o==="emf"?"image/x-emf":o==="wmf"?"image/x-wmf":null}function XE(e,t){let n=No(t,"inline",ia$1)??No(t,"anchor",ia$1);if(!n)return "";let r=No(n,"blip",ha);if(!r)return "";let o=Ie(r,"embed",ja$3);if(!o)return "";let a=e.docRels.find(x=>x.id===o&&x.targetMode!=="External");if(!a)return "";let i=w(a.ownerPart,a.rawTarget);if(!i.ok)return "";let s=e.pkg.partBytes.get(i.partName.replace(/^\//,""))??e.pkg.partBytes.get(i.partName);if(!s)return "";let l=GE(e,i.partName);if(!l||s.byteLength>e.maxImageBytes||e.imageBudget.used+s.byteLength>e.maxTotalImageBytes)return "";e.imageBudget.used+=s.byteLength;let d=e.imageDataUris.get(i.partName);d==null&&(d=`data:${l};base64,${bs(s)}`,e.imageDataUris.set(i.partName,d));let u=No(n,"extent",ia$1),f=u?ht(Ie(u,"cx","")):null,p=u?ht(Ie(u,"cy","")):null,m=x=>Math.round(x/12700*100)/100,h=f!==null&&p!==null&&f>0&&p>0?` width="${Math.round(f/tS)}" height="${Math.round(p/tS)}" style="width:${m(f)}pt;height:${m(p)}pt"`:"";return `<img src="${d}"${h}>`}function Yr(e,t,n=0){if(n>=la$1)return;let r=fe$1(e)?n+1:ma(e,n);for(let o of e.children)if($e(o)&&o.kind!=="drawing"){if(o.kind==="contentControl"){let a=o.children.find(i=>i.kind==="contentControlContent");a&&$e(a)&&Yr(a,t,r+1);continue}if(o.kind==="fldChar"){aS(o,t);continue}Yr(o,t,r);}}function aS(e,t){let n=Ie(e,"fldCharType",da$1);n==="begin"?t.stack.push("instr"):n==="separate"&&t.stack.length>0?t.stack[t.stack.length-1]="result":n==="end"&&t.stack.pop();}function YE(e,t,n,r){let o=t.children.find(d=>d.kind==="runProperties"),a=fl(e.styles,n,o&&$e(o)?o:null,e.tableRPr),i=zE(a),s="";for(let d of t.children){if(!$e(d))continue;if(d.kind==="fldChar"){r.inert||aS(d,r);continue}if(d.kind==="instrText"||!r.inert&&r.stack.some(p=>p==="instr")||i.vanish)continue;let u=Yh(d);if(u!==""){s+=u;continue}let f=Xh(d,e.noteBody,(p,m)=>WE(e,p,m),(p,m)=>e.availableNotes[p].has(m));if(f!==""){s+=f;continue}switch(d.kind){case "text":s+=nf(tf(d));break;case "tab":s+='<span style="white-space:pre;mso-tab-count:1"> </span>';break;case "hardBreak":{let p=Ie(d,"type",da$1);s+=p==="page"?'<br style="page-break-before:always">':"<br>";break}case "bookmarkStart":{let p=fn(Ie(d,"name",da$1));p!==null&&(s+=`<a id="${Rn(p)}"></a>`);break}case "drawing":s+=XE(e,d);break;}}if(s==="")return "";i.vertAlign==="superscript"?s=`<sup>${s}</sup>`:i.vertAlign==="subscript"&&(s=`<sub>${s}</sub>`);let l=`${i.lang===null?"":` lang="${i.lang}"`}${i.rtl?' dir="rtl"':""}${i.css===""?"":` style="${Rn(i.css)}"`}`;return l===""?s:`<span${l}>${s}</span>`}function Xr(e,t,n,r,o=0){if(o>=la$1)return "";let a="";for(let i of t)if($e(i))switch(fe$1(i)?"fldSimple":i.kind){case "run":a+=YE(e,i,n,r);break;case "hyperlink":{let s=Xr(e,i.children,n,r,o+1);if(s==="")break;let l=Ie(i,"id",ja$3),d=l?e.docRels.find(p=>p.id===l):void 0,u=d===void 0?void 0:d.targetMode==="External"||d.rawTarget.startsWith("#")?d.rawTarget:void 0,f=vy(u,Ie(i,"anchor",da$1));a+=f!==null?`<a href="${Rn(f)}">${s}</a>`:s;break}case "bookmarkStart":{let s=fn(Ie(i,"name",da$1));s!==null&&(a+=`<a id="${Rn(s)}"></a>`);break}case "fldSimple":a+=Xr(e,i.children,n,r,o+1);break;case "contentControl":{let s=i.children.find(l=>l.kind==="contentControlContent");s&&$e(s)&&(a+=Xr(e,s.children,n,r,o+1));break}case "revisionInsert":case "revisionMoveTo":a+=Xr(e,i.children,n,r,o+1);break;case "revisionDelete":case "revisionMoveFrom":Yr(i,r,o);break;case "generic":if(na$1(i))a+=Xr(e,i.children,n,r,o+1);else {let s=Gd(i);s&&(a+=Xr(e,s,n,r,o+1));}break}return a}function QE(e,t){let n=Xe(me(t,"pStyle")),r=Un(e.styles,n,"paragraph");for(let o=r.length-1;o>=0;o-=1){let a=Ie(r[o],"styleId",da$1),i=a?/^Heading([1-6])$/.exec(a):null;if(i)return {level:Number(i[1]),fromStyle:true}}if(n===void 0){let o=ht(Xe(me(t,"outlineLvl")));if(o!==null&&o>=0&&o<=5)return {level:o+1,fromStyle:false}}return null}function JE(e,t){let n=Un(e.styles,Xe(me(t,"pStyle")),"paragraph");for(let r=n.length-1;r>=0;r-=1){let o=zh(Ie(n[r],"styleId",da$1));if(o!==null)return o}return null}function rS(e,t,n,r){let o=t.children.find(v=>v.kind==="paragraphProperties"),a=o&&$e(o)?o:null,i=rf(e.styles,a,e.tablePPr),s=jE(i,n.asListItem),l=Xr(e,t.children,a,r),d=s===""?"":` style="${Rn(s)}"`,u=Gn(i,"bidi")?' dir="rtl"':"",f=JE(e,a),p=f===null?"":` class="${f}"`,m=QE(e,a);if(n.asListItem)return `<li${m?.fromStyle===true?` class="Heading${m.level}"`:p}${u}${d}>${l}</li>`;let h=m===null?"p":`h${m.level}`,x=m===null?p:m.fromStyle?` class="Heading${m.level}"`:' class="docx-outline"';return `<${h}${x}${u}${d}>${l}</${h}>`}var eO={renderBlocks:(e,t,n)=>hl(e,t,n),advanceFieldState:Yr};function hl(e,t,n){let r="",o=[],a=null,i=new Map,s=n;if(s===void 0){let p={stack:[]};for(let m of t)$e(m)&&Yr(m,p);s={stack:[],inert:p.stack.length>0};}let l=()=>{let p=o.pop();p&&(r+=`</${p.tag}>`);},d=()=>{for(;o.length>0;)l();a=null;},u=(p,m)=>{for(a!==null&&m.level<a&&d();o.length>0&&o[o.length-1].abstractId!==m.abstractId;)l();o.length===0&&(a=m.level);let h=a??m.level,x=m.level-h+1;for(;o.length>x;)l();for(o.length===x&&o[x-1].numId!==m.numId&&l();o.length<x;){let I=h+o.length,k=oS(e,m.numId,m.abstractId,I),C=i.get(`${m.abstractId}:${m.numId}:${I}`)??0,T=k.start+C,A=k.fmt==="bullet"?"ul":"ol",O=A==="ol"?Object.hasOwn(nS,k.fmt)?nS[k.fmt]:"decimal":null,$=A==="ol"&&T!==1?` start="${T}"`:"";r+=O?`<${A}${$} style="list-style-type:${Rn(O)}">`:`<${A}>`,o.push({tag:A,numId:m.numId,abstractId:m.abstractId});}let v=`${m.abstractId}:${m.numId}:${m.level}`;i.set(v,(i.get(v)??0)+1);let b=`${m.abstractId}:`;for(let I of i.keys()){if(!I.startsWith(b))continue;let k=I.slice(I.lastIndexOf(":")+1);/^\d+$/.test(k)&&Number(k)>m.level&&i.delete(I);}r+=rS(e,p,{asListItem:true},s);},f=p=>{for(let m of p)if($e(m))switch(m.kind){case "paragraph":{let h=m.children.find(b=>b.kind==="paragraphProperties"),x=h&&$e(h)?h:null,v=UE(e,rf(e.styles,x));v?u(m,v):(d(),r+=rS(e,m,{asListItem:false},s));break}case "table":d(),r+=Jx(e,m,s,eO);break;case "contentControl":{let h=m.children.find(x=>x.kind==="contentControlContent");h&&$e(h)&&f(h.children);break}case "generic":f(m.children);break;case "bookmarkStart":{let h=fn(Ie(m,"name",da$1));h!==null&&(r+=`<a id="${Rn(h)}"></a>`);break}default:s.inert||Yr(m,s);break}};return f(t),d(),r}function iS(e,t){let n=e.parts.get(e.mainDocumentPart);if(!n||!$e(n.root))return "";let r=n.root.children.find(d=>d.kind==="body");if(!r||!$e(r))return "";let o=di(e,$E,"/word/footnotes.xml"),a=di(e,qE,"/word/endnotes.xml"),i={pkg:e,styles:Bx(e),numbering:qx(di(e,BE,"/word/numbering.xml")),docRels:ic$1(e,e.mainDocumentPart),maxImageBytes:ZE,maxTotalImageBytes:KE,imageBudget:{used:0},imageDataUris:new Map,noteOrdinals:{footnote:new Map,endnote:new Map},availableNotes:{footnote:df(o,"footnote"),endnote:df(a,"endnote")},noteBody:null},s=hl(i,r.children),l=eS(i,{footnote:o,endnote:a},Yr);return s+cf(i,"footnote",o,l.footnote,hl)+cf(i,"endnote",a,l.endnote,hl)}var tO=12*1024*1024;function nO(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function rO(e){return `<div><table>${e.split(`
18
+ `).map(n=>`<tr>${n.split(" ").map(r=>`<td>${nO(r)}</td>`).join("")}</tr>`).join("")}</table></div>`}function ff(e){if(e.cellRectangle)return {text:e.text,html:rO(e.text)};if(!e.coverage||!e.pkg)return {text:e.text,html:null};let t=I(e.pkg,e.coverage);if(!t.ok)return {text:e.text,html:null};let n=e.maxFragmentBytes??tO,r=t.bytes;if(t.bytes.byteLength>n){let i=I(e.pkg,e.coverage,{omitMedia:true});r=i.ok&&i.bytes.byteLength<=n?i.bytes:null;}let o;try{o=iS(t.package);}catch(i){console.error("docx-editor: copy HTML flavour failed to render",i),o="";}let a=Vh(o,r?{bytes:r,lastMarkCovered:t.lastMarkCovered}:null);return {text:e.text,html:a}}function sS(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=vs(r);if(o&&e.pasteFragment(o.bytes,o.lastMarkCovered))return "fragment";let a=nb(r);return a.ok&&a.truncated&&t.text.length>0?n():a.ok&&e.pasteFragment(a.fragmentBytes,a.lastMarkCovered)?"external-html":n()}function lS(e,t,n,r,o){if(!o||t.paragraphId!==n.paragraphId||/[\r\n\t]/.test(r)||!ji(e.settingsRoot()))return r;let a=Ve(e,t.paragraphId)??e.part();if(!ki(a,t.paragraphId))return r;let i=Ha(a,t.paragraphId);if(i?.kind!=="paragraph")return r;let s=oh(i).find(v=>v.fieldNodeId===o&&v.start<=t.offset&&v.end>=n.offset);if(!s?.enabled||!mh(s)||s.maxLength<=0)return r;let l=(Pi(a,t.paragraphId)??"").slice(s.start,s.end),d=l.slice(0,t.offset-s.start),u=l.slice(n.offset-s.start),f=d+u,p=v=>nh(d+v+u,s,f)<=s.maxLength;if(p(r))return r;let m=[...r],h=s.maxLength-[...f].length;if(s.type==="number"&&s.format)for(let v of f)(v===","&&s.format.includes(",")||v==="%"&&s.format.endsWith("%"))&&h++;let x=new Set;if(s.type==="date"){let v=0;for(let b=0;b<m.length;b++)if(/\S/.test(m[b])){if(++v>18)break;x.add(b+1);}else (b+1===m.length||/\S/.test(m[b+1]))&&x.add(b+1);}else if(s.type==="number"&&s.format)for(let v=1;v<=3;v++)x.add(h+v);for(let v of [...x].sort((b,I)=>I-b)){if(v<=Math.max(0,h)||v>m.length)continue;let b=m.slice(0,v).join("");if(p(b))return b}return m.slice(0,Math.max(0,h)).join("")}var oO=2e3;function dS(e){let{session:t}=e,n=null;function r(s){let l=lb(s),d=e.orderedRange(),u=lS(t,d.from,d.to,l,e.textFormFieldId?.()??null).split(`
19
+ `),f=e.deleteSelectionPlan(),p=f.replaceAt??f.collapseTo,m=u.join(""),h=[...f.ops],x=e.consumePendingFormatOps(p.paragraphId,p.offset,m.length);m.length>0&&(h.push({op:"insertText",paragraphId:p.paragraphId,offset:p.offset,text:m}),h.push(...x));let v=[],b=0;for(let A=0;A<u.length-1;A+=1)b+=u[A].length,v.push(p.offset+b);if(v.length>0&&h.push({op:"splitParagraphMany",paragraphId:p.paragraphId,offsets:v}),h.length===0)return;let I=new Set(t.paragraphIdsIn(e.storyScope())),k=u[u.length-1],C=v.length===0?e.caretMark({paragraphId:p.paragraphId,offset:p.offset+k.length}):void 0,T=h.filter(A=>!x.includes(A));e.commit(()=>e.withoutPendingOnRejection(h,T,e.selectionMark(),C),()=>{if(v.length===0)return Ke({paragraphId:p.paragraphId,offset:p.offset+k.length});let A=t.paragraphIdsIn(e.storyScope()).filter($=>!I.has($)),O=A[A.length-1];return O?Ke({paragraphId:O,offset:k.length}):null});}function o(){e.flushPendingInputAndLayout();let s=e.cellSelection();if(s)return ff({text:wa(e.layout(),s),cellRectangle:true,coverage:null,pkg:null});let{from:l,to:d}=e.orderedRange(),u=dl(e.layout(),l,d,e.paragraphOrder()),f=e.storyScope();if(l.paragraphId===d.paragraphId&&l.offset===d.offset||f.kind!=="body")return {text:u,html:null};let m=t.part(),h=gx(e.layout(),m,l,d,e.paragraphOrder());return ff({text:u,cellRectangle:false,coverage:h,pkg:t.currentPackage()})}function a(s,l){if(e.editingMode()!=="edit"||e.storyScope().kind!=="body"||e.cellSelection())return false;e.flushPendingInputAndLayout();let d=e.deleteSelectionPlan(),u=d.replaceAt??d.collapseTo,f=false;return e.commit(()=>{let p=e.collaborationGate(d.ops,{kind:"body"});if(p)return {committed:false,rejected:true,opCount:0,reason:p};let m=e.actorId(),h=t.applyFragmentPaste({kind:"body"},{paragraphId:u.paragraphId,offset:u.offset,fragmentBytes:s,lastMarkCovered:l,priorOps:d.ops,...m!==void 0?{actorId:m}:{}});return f=h.ok,{committed:h.ok,rejected:!h.ok,opCount:h.ok?1:0,...h.ok?{}:{reason:h.detail??h.reason}}},()=>Ke(u)),f}function i(s,l){let d=n!==null&&e.now()-n<oO;return n=null,sS({richLaneOpen:e.editingMode()==="edit"&&e.storyScope().kind==="body"&&e.cellSelection()===null,pasteFragment:(f,p)=>a(f,p),insertPlainText:r},{html:l,text:s,forcePlain:d})!=="none"}return {insertPlainText:r,copyFlavoursNow:o,pasteRichNow:i,armForcePlainPaste:()=>{n=e.now();}}}function cS(e){let{session:t}=e;function n(){return Ur(e.selection())}function r(){return e.flushPendingInputAndLayout(),ll(e.layout(),e.selection(),e.paragraphOrder())}function o(){return r().from}function a(h){return re(e.layout(),h)}function i(h,x){let v=t.partFor(e.storyScope())??t.part(),b=Ha(v,h.paragraphId);if(!b||b.kind!=="paragraph")return null;let I=x==="before"?Ye(b,h.offset):Ze(b,h.offset);if(!I)return null;let k=Ke$1(v,I.controlId),C=k?Jc$1(k):null;return C&&(C.lock==="contentLocked"||C.lock==="sdtContentLocked"||C.type==="checkbox"||C.type==="picture")?I:null}function s(h){if(e.trackedAuthorOrNone()!==void 0||e.cellSelection())return false;let x=r();return x.from.paragraphId===x.to.paragraphId&&x.from.offset===x.to.offset?e.atParagraphEnd(h.paragraphId,h.offset):e.atParagraphEnd(x.to.paragraphId,x.to.offset)}function l(h){let x=h?.trim()||void 0,v=d(),b=e.cellSelection(),I=null;return {...v,get replaceAt(){return I??=p(v,x,b),I}}}function d(){e.flushPendingInputAndLayout();let h=e.cellSelection();if(h){let I=[];for(let k of ta$1(e.layout(),h.cellIds)){let C=re(e.layout(),k).length;C>0&&I.push({op:"deleteText",paragraphId:k,start:0,end:C});}return {ops:I,collapseTo:o()}}let x=e.selection();if(x.anchor.paragraphId===x.head.paragraphId&&x.anchor.offset===x.head.offset)return {ops:[],collapseTo:ae(e.layout(),x.head)};let{from:v,to:b}=r();return hx(e.layout(),t.partFor(e.storyScope())??t.part(),v,b,e.paragraphOrder())}function u(){return l().ops}function f(h,x,v){if(!(v!==void 0||e.editingMode()==="suggest")||h.paragraphId!==x.paragraphId||x.offset<=h.offset)return h.offset;let I=(v??e.author())?.trim();if(!I)return ae(e.layout(),x).offset;let k=Ve(t,x.paragraphId)??t.part(),C=Ha(k,x.paragraphId);if(!C||C.kind!=="paragraph")return ae(e.layout(),x).offset;let T={start:h.offset,end:x.offset},{past:A,landing:O}=hg(C,T,x.offset,I,e.trackedDate()),$=eg(C,h.offset,A,I);return (A-h.offset>$?O:A)-$}function p(h,x,v){let b=h.collapseTo;if(x===void 0&&e.editingMode()!=="suggest")return b;if(v){for(let F of v.cellIds){let H=sa$1(e.layout(),[F]),V=H.length>0?H:ta$1(e.layout(),[F]);if(V.length===0)continue;let B=new Map,X=fe=>{let D=B.get(fe);return D===void 0&&(D=f({paragraphId:fe,offset:0},{paragraphId:fe,offset:a(fe).length},x),B.set(fe,D)),D},ae=(x??e.author())?.trim(),ce=fe=>{let D=a(fe);if(!ae)return /\S/.test(D);let M=Ha(Ve(t,fe)??t.part(),fe);if(!M||M.kind!=="paragraph")return /\S/.test(D);let q="",Z=0;for(let Y of fg(M,0,D.length,ae))q+=D.slice(Z,Math.max(Z,Y.start)),Z=Math.max(Z,Y.end);return q+=D.slice(Z),/\S/.test(q)},xe=null;for(let fe=V.length-1;fe>=0;fe-=1){let D=V[fe];if(ce(D)){xe=D;break}}if(xe===null)for(let fe=V.length-1;fe>=0;fe-=1){let D=V[fe];if(X(D)!==0){xe=D;break}}return xe??=V[V.length-1],{paragraphId:xe,offset:X(xe)}}return b}let{from:I,to:k}=r();if(I.paragraphId===k.paragraphId&&I.offset===k.offset)return b;if(I.paragraphId===k.paragraphId)return {paragraphId:k.paragraphId,offset:f(I,k,x)};let C=new Set(h.ops.flatMap(F=>F.op==="deleteBlock"?[F.blockId]:[])),T=Ve(t,k.paragraphId)??t.part();if(C.size>0)for(let F=Ia(T,k.paragraphId);F;F=Ia(T,F.id)){if(!C.has(F.id))continue;let H={paragraphId:b.paragraphId,offset:a(b.paragraphId).length};return {paragraphId:b.paragraphId,offset:f(b,H,x)}}let A=(x??e.author())?.trim();if(!A)return b;let O=new Set(h.ops.flatMap(F=>F.op==="joinParagraphs"?[F.secondId]:[])),$=e.paragraphOrder(),y=$.indexOf(I.paragraphId),R=$.indexOf(k.paragraphId);if(y===-1||R===-1)return b;let L=F=>{let H=Ha(T,F);return H?.kind==="paragraph"&&Yh$1(H,A)},_=R;for(;_>y&&O.has($[_])&&L($[_-1]);)_-=1;let j=0;for(let F=_;F<=R;F+=1){let H=$[F],V={paragraphId:H,offset:H===I.paragraphId?I.offset:0},B=H===k.paragraphId?ae(e.layout(),k):{paragraphId:H,offset:a(H).length};F===_&&(j+=V.offset),j+=B.offset-V.offset-m(V,B,A);}return {paragraphId:$[_],offset:j}}function m(h,x,v){let b=v?.trim();if(!b||h.paragraphId!==x.paragraphId)return 0;let I=Ve(t,x.paragraphId)??t.partFor(e.storyScope())??t.part(),k=Ha(I,x.paragraphId);return !k||k.kind!=="paragraph"?0:eg(k,h.offset,x.offset,b)}return {selectionMark:n,orderedRange:r,orderedStart:o,textOf:a,inlineControlBeside:i,splitEndsTheParagraph:s,deleteSelectionPlan:l,deleteSelectionOps:u,replacementOffset:f}}function uS(e){return {atParagraphEnd(t,n){let r=Pi(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=ra(n,t).find(l=>l.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}}}var fS=zc$1;function pS(e){let{session:t,...n}=e;return pd({view:t,...n})}function zt(e){return e.closest(".docx-editor__scroll-container")}function mS(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 gS(e,t,n){let r=zt(e);if(!r||r.clientHeight<=0||t.pages.length===0||n<=0)return null;let o=mS(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 hS(e,t,n,r){let o=zt(e);if(!o||o.clientHeight===0)return;let a=mS(e,o,r),i=[];for(let s of [n.anchor,n.head]){let l=ne(t,s);l&&i.push(l.pageIndex);}return pa$1({layout:t,viewport:a,overscanPages:1,pinnedPages:i})}function pf(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 yl(e,t){let n=e.pages[e.pages.length-1],r=n?n.box.y+n.box.height:0,o=t?e.pages.filter(s=>t.has(s.index)):e.pages,a=0;for(let s of o)a=Math.max(a,s.box.x+s.box.width);let i=new Map;if(new Set(o.map(s=>s.box.width)).size>1)for(let s of e.pages)i.set(s.index,(a-s.box.width)/2-s.box.x);return {width:a,height:r,pageOffsetX:i}}function yS(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 vS(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;try{i=await t.createImageBitmap(a,{imageOrientation:"from-image"});}catch(s){if(s?.name!=="TypeError")throw s;i=await t.createImageBitmap(a);}try{let s=i.width,l=i.height;if(s<=0||l<=0)throw new Error("image dimensions invalid");if(s*l>o.maxPixels)throw new Error("image dimensions exceed limits");return Object.freeze({pixelWidth:s,pixelHeight:l,dpiX:96,dpiY:96})}finally{i.close();}},convertPreserved(n,r,o){return r==="image/tiff"?sO(e,n,o):aO(n,r)}})}async function aO(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},l=t==="image/x-emf"?await r(i,s):await o(i,s);if(!l)return null;let d="data:image/png;base64,";if(!l.startsWith(d))return null;let u=atob(l.slice(d.length)),f=new Uint8Array(u.length);for(let p=0;p<u.length;p+=1)f[p]=u.charCodeAt(p);return Object.freeze({bytes:f,mime:"image/png"})}function bS(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 iO(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=bS(a,"t256"),s=bS(a,"t257");if(i===null||s===null||i>t.maxDimension||s>t.maxDimension||i>t.maxPixels/s)return null;let l=i*s;if(l*4>t.maxDecodedBytes||(r.decodeImage(o,a),a.width!==i||a.height!==s))return null;let d=r.toRGBA8(a);return d.length!==l*4?null:Object.freeze({rgba:d,pixelWidth:i,pixelHeight:s})}async function sO(e,t,n){let r=await iO(t,n);if(r===null)return null;let o=await lO(e,r.rgba,r.pixelWidth,r.pixelHeight);return o===null?null:Object.freeze({bytes:o,mime:"image/png"})}async function lO(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(l=>{o.toBlob(d=>l(d),"image/png");});return s?new Uint8Array(await s.arrayBuffer()):null}function xS(){return Object.freeze({async decode(){throw new Error("Image decode unavailable in headless environment")}})}function SS(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 dO="docx-editor-one-surface__caret",mf="docx-editor-one-surface__caret--steady",cO=530;function wS(e,t,n){let r=e.ownerDocument,o=r.createElement("div");o.className=dO,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,l=null;function d(){let I=r.activeElement;return I===e||!!I&&e.contains(I)}function u(I){return I.anchor.paragraphId===I.head.paragraphId&&I.anchor.offset===I.head.offset}function f(){s=null,i!==null&&(clearTimeout(i),i=null),o.classList.remove(mf),o.remove(),e.style.removeProperty("caret-color"),l?.style.removeProperty("caret-color"),l=null;}function p(){o.classList.add(mf),i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,o.classList.remove(mf);},cO);}function m$1(){if(a||!d()||n().suppress){f();return}let{layout:I,selection:k,scopedHost:C,scopedHostKind:T,preferredPageIndex:A,measurer:O,typingStyle:$}=n(),y=t();if(!u(k)){f();return}let R=ne(I,k.head,{...O?{measurer:O}:{},...A!==void 0?{preferredPageIndex:A}:{}});if(!R||!Number.isInteger(R.pageIndex)){f();return}if($&&O){let{pageIndex:H,lineId:V}=R,B=_d(I).get(k.head.paragraphId)?.find(ae=>ae.pageIndex===H&&ae.line.id===V),X=B?.line;if(X&&!X.drawings?.length&&!Nc$1(R)){let ae=$();if(ae){let ce={...zs(I,k)??h$1,...ae},xe=O.lineMetrics(ce);if(xe.height>0){let fe=Vc$1({...R,width:0,y:X.spans.length>0?X.box.y+X.baseline-xe.baseline-m(ce):R.y,height:xe.height},B?.clipBox);if(!fe){f();return}R=fe;}}}}let L=C??e.querySelector(`[data-page-index="${R.pageIndex}"] > .docx-page-content`);if(!L){f();return}if(!(R.height>0)){f();return}o.style.left=`${R.x*y}px`,o.style.top=`${R.y*y}px`,o.style.height=`${R.height*y}px`;let _=Nc$1(R);o.style.transformOrigin=_?"0 0":"",o.style.transform=_?"rotate(-90deg)":"",o.parentNode!==L&&L.append(o),e.style.caretColor="transparent",l&&l!==C&&l.style.removeProperty("caret-color"),l=C??null,l?.style.setProperty("caret-color","transparent");let j=L===C?T??"scoped":"body",F=`${R.pageIndex}:${j}:${R.x}:${R.y}:${R.height}`;F!==s&&(s=F,p());}let h=()=>{a=true,m$1();},x=()=>{a=false,m$1();},v=()=>m$1(),b=I=>{let k=I.relatedTarget;k&&e.contains(k)||f();};return e.addEventListener("compositionstart",h),e.addEventListener("compositionend",x),e.addEventListener("focusin",v),e.addEventListener("focusout",b),{update:m$1,destroy(){e.removeEventListener("compositionstart",h),e.removeEventListener("compositionend",x),e.removeEventListener("focusin",v),e.removeEventListener("focusout",b),f();}}}function gf(e){let t=e.indexOf("#");return t===-1?"":e.slice(0,t)}function Qr(e,t){let n=gf(t);return n.length===0?e.part():e.currentPackage().parts.get(n)??e.part()}function hf(e,t){return !e||e.kind==="tableBody"?null:gf(e.tableId)===gf(t)?e:null}function ui(e,t,n){let r=i=>{for(let s of i)if(s.kind==="table"){if(s.tableId===t)return s;for(let l of s.rows)for(let d of l.cells){let u=r(d.blocks);if(u)return u}}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 yf(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)yf(o.blocks,t);}}function uO(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});};yf(n.fragments,r);for(let o of [n.header,n.footer])o&&yf(o.fragments,r);}}function bf(e,t,n,r){let o=null;return uO(e,a=>{a.table.tableId===t&&a.row.id===n&&a.row.isHeaderRepeat===r&&(o=a);}),o}function vf(e,t){return {sourceRevision:e,tableId:t.table.tableId,rowId:t.row.id,isHeaderRepeat:t.row.isHeaderRepeat}}function IS(e,t,n){let r=n.gridColumnId;return r?{sourceRevision:e,tableId:t.table.tableId,gridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}:null}function kS(e,t,n,r){return {sourceRevision:e,tableId:t.table.tableId,leftGridColumnId:n,rightGridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}}function TS(e,t,n){return {sourceRevision:e,tableId:t.table.tableId,gridColumnId:n,isHeaderRepeat:t.row.isHeaderRepeat}}var fO=120,PS=20;function bl(e){let t=Bh$1(e,"w"),n=t?Number.parseInt(t,10):Number.NaN;return Number.isFinite(n)?n:0}function pO(e,t,n){let r=e.pagesLayer.getBoundingClientRect(),o=e.scale();return {x:(t-r.left)/o,y:(n-r.top)/o}}function xf(e){let t=e.editingMode==="view";return {editable:!t,viewing:t}}function Sf(e,t){return t.kind==="insertColumn"?bf(e,t.tableId,t.rowId,t.isHeaderRepeat):"rowId"in t?bf(e,t.tableId,t.rowId,t.isHeaderRepeat):null}function CS(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,l=false,d=0,u=0,f=null,p=null,m=null;function h(E){return E instanceof HTMLButtonElement&&(E.classList.contains("docx-table-insert-row")||E.classList.contains("docx-table-insert-column"))}function x(){let E=document.activeElement;return E!==null&&h(E)&&E.closest(".docx-table-furniture")===t?E:null}function v(E){for(let K of [...t.children])h(K)&&K!==E&&K.remove();}function b(){p=null,m=null;}function I(){n!==null&&(clearTimeout(n),n=null);}function k(){for(let K of [...t.children])h(K)||K.remove();let E=x();if(!E){v(null),b();return}p=E,v(E);}function C(E){let K=p??x(),W=K!==null&&document.activeElement===K;b(),t.replaceChildren(),E&&W&&e.pagesLayer.focus({preventScroll:true});}function T(){for(let E of [...t.children])h(E)||E.remove();}function A(E,K,W,ee){let te=e.read().layout.pages[E];if(!te)return {left:0,top:0};let le=ee??te.contentBox,ue=e.scale(),ve=e.pageOffsetX(E);return {left:(le.x+K+ve)*ue,top:(le.y+W)*ue}}function O(E,K){let W=e.read(),ee=ui(W.layout,K.tableId,K.pageIndex);if(!ee)return;let{table:re,origin:te}=ee,le=document.createElement("div");le.className="docx-table-resize-preview",le.style.position="absolute",le.style.pointerEvents="none";let ue=K.kind!=="rowDivider",ve=A(K.pageIndex,ue?re.box.x+E:re.box.x,ue?re.box.y:re.box.y+E,te);le.style.left=`${ve.left}px`,le.style.top=`${ve.top}px`,le.style.width=ue?"2px":`${re.box.width*e.scale()}px`,le.style.height=ue?`${re.box.height*e.scale()}px`:"2px",t.append(le);}function $(){let E=document.createElement("button");return E.type="button",E.textContent="+",E.style.position="absolute",E.style.pointerEvents="auto",E}function y(E){j(E);let K=m;if(!K)return;let W=e.read();K.kind==="insertRow"?H(K,W):K.kind==="insertColumn"&&V(K,W);}function R(){queueMicrotask(()=>{!p||document.activeElement===p||l||r?.kind==="insertRow"||r?.kind==="insertColumn"||(p.remove(),b());});}function L(){if(p&&t.contains(p))return p;let E=x();if(E)return p=E,E;let K=$();return K.addEventListener("pointerenter",()=>{l=true,I();}),K.addEventListener("pointerleave",()=>{l=false;}),K.addEventListener("pointerdown",j),K.addEventListener("mousedown",j),K.addEventListener("click",y),K.addEventListener("blur",R),p=K,K}function _(E,K){let W=ui(K.layout,E.tableId,E.pageIndex);if(!W)return;let{table:ee,origin:re}=W,te=L();if(v(te),m=E,te.dataset.tableId=E.tableId,E.kind==="insertRow"){let le=ee.rows.find(rt=>rt.id===E.rowId);if(!le)return;te.dataset.rowId=E.rowId,delete te.dataset.gridColumnId,te.className="docx-table-insert-row",te.setAttribute("aria-label",e.label("table.insertRowBelow"));let ue=le.box.y+le.box.height/2,ve=A(E.pageIndex,ee.box.x-14,ue,re);te.style.left=`${ve.left}px`,te.style.top=`${ve.top-8}px`;}else {let le=ee.rows[0]?.cells.find(Ee=>Ee.gridColumnId===E.gridColumnId);if(!le)return;te.dataset.gridColumnId=E.gridColumnId,delete te.dataset.rowId;let ue=ee.columnEdges[le.gridColumn]??0,ve=ee.columnEdges[le.gridColumn+1]??ee.box.width;te.className="docx-table-insert-column",te.setAttribute("aria-label",e.label("table.insertColumnRight"));let rt=A(E.pageIndex,ee.box.x+(ue+ve)/2-8,ee.box.y-14,re);te.style.left=`${rt.left}px`,te.style.top=`${rt.top}px`;}t.contains(te)||t.append(te);}function j(E){E.preventDefault(),E.stopPropagation();}function F(E,K){if(T(),v(p??x()),!(s||K.editingMode==="view")){if((E.kind==="columnDivider"||E.kind==="rightEdge")&&!E.isHeaderRepeat){let W=ui(K.layout,E.tableId,E.pageIndex);if(!W)return;let{table:ee,origin:re}=W,te=document.createElement("div");te.className=E.kind==="rightEdge"?"docx-table-edge-handle-right layout-table-edge-handle-right":"docx-table-divider-handle layout-table-resize-handle",te.style.position="absolute",te.style.pointerEvents="auto",te.style.cursor="col-resize",te.dataset.active="true";let le=A(E.pageIndex,ee.box.x+E.edgeX,ee.box.y,re);te.style.left=`${le.left-3}px`,te.style.top=`${le.top}px`,te.style.width="6px",te.style.height=`${ee.box.height*e.scale()}px`,te.addEventListener("pointerdown",B),t.append(te);}if(E.kind==="rowDivider"&&!E.isHeaderRepeat){let W=ui(K.layout,E.tableId,E.pageIndex);if(!W)return;let{table:ee,origin:re}=W,te=document.createElement("div");te.className="docx-table-row-divider-handle layout-table-row-resize-handle",te.style.position="absolute",te.style.pointerEvents="auto",te.style.cursor="row-resize",te.dataset.active="true";let le=A(E.pageIndex,ee.box.x,ee.box.y+E.edgeY,re);te.style.left=`${le.left}px`,te.style.top=`${le.top-3}px`,te.style.width=`${ee.box.width*e.scale()}px`,te.style.height="6px",te.addEventListener("pointerdown",B),t.append(te);}E.kind==="insertRow"&&!E.isHeaderRepeat&&_(E,K),E.kind==="insertColumn"&&!E.isHeaderRepeat&&_(E,K);}}function H(E,K){let W=Sf(K.layout,E);if(!W)return;let ee=xf(K),re=jn({command:{type:"insertRow",where:"below",target:vf(E.sourceRevision,W)},part:Qr(e.session(),E.tableId),layout:K.layout,storeRevision:K.storeRevision,selection:K.selection,cellSelection:K.cellSelection,themeColors:K.themeColors,...ee});e.applyTableCommandPlan(re);}function V(E,K){let W=Sf(K.layout,E);if(!W)return;let ee=W.row.cells.find(ue=>ue.gridColumnId===E.gridColumnId);if(!ee)return;let re=IS(E.sourceRevision,W,ee);if(!re)return;let te=xf(K),le=jn({command:{type:"insertColumn",where:"right",target:re},part:Qr(e.session(),E.tableId),layout:K.layout,storeRevision:K.storeRevision,selection:K.selection,cellSelection:K.cellSelection,themeColors:K.themeColors,...te});e.applyTableCommandPlan(le);}function B(E){if(E.button!==0)return;let K=e.read();if(K.editingMode==="view"||!r||r.kind!=="columnDivider"&&r.kind!=="rightEdge"&&r.kind!=="rowDivider")return;E.preventDefault(),E.stopPropagation();let W=r,ee=Sf(K.layout,W);if(!ee)return;let re=Dh$1(Qr(e.session(),W.tableId).root,W.tableId);if(!re.ok||W.kind!=="rowDivider"&&re.topology.hasMerge)return;let te=0,le=0,ue=0,ve=re.topology.gridColumns.reduce((_e,De)=>_e+bl(De),0),rt;if(W.kind==="columnDivider"){let _e=re.topology.gridColumns.find(Ce=>Ce.id===W.leftGridColumnId),De=re.topology.gridColumns.find(Ce=>Ce.id===W.rightGridColumnId);if(!_e||!De)return;te=bl(_e),le=bl(De),rt=kS(W.sourceRevision,ee,W.leftGridColumnId,W.rightGridColumnId);}else if(W.kind==="rightEdge"){let _e=re.topology.gridColumns.find(De=>De.id===W.gridColumnId);if(!_e)return;te=bl(_e),le=0,rt=TS(W.sourceRevision,ee,W.gridColumnId);}else ue=Math.max(20,Math.round(ee.row.box.height*PS)),rt=vf(W.sourceRevision,ee);let Ee=E.currentTarget;Ee.setPointerCapture(E.pointerId),d=E.clientX,u=E.clientY,s={pointerId:E.pointerId,startClientX:E.clientX,startClientY:E.clientY,startEdgePt:W.kind==="rowDivider"?W.edgeY:W.edgeX,leftTwips:te,rightTwips:le,tableWidthTwips:ve,rowHeightTwips:ue,target:W,ref:ee,resizeTarget:rt,captureElement:Ee,rightEdge:W.kind==="rightEdge",vertical:W.kind==="rowDivider",cancelled:false};for(let _e of [...t.children])_e!==Ee&&_e.remove();O(W.kind==="rowDivider"?W.edgeY:W.edgeX,W);}function X(){if(s){try{s.captureElement.hasPointerCapture(s.pointerId)&&s.captureElement.releasePointerCapture(s.pointerId);}catch{}s.cancelled=true,s=null,k(),r=null;}}function ae(){if(!s||s.cancelled){s=null,k();return}let E=s;s=null;try{E.captureElement.hasPointerCapture(E.pointerId)&&E.captureElement.releasePointerCapture(E.pointerId);}catch{}if(E.vertical?u===E.startClientY:d===E.startClientX){k();return}let K=e.read(),W=xf(K),ee=(E.vertical?u-E.startClientY:d-E.startClientX)/e.scale(),re=Math.round(ee*PS),te;if(E.target.kind==="rowDivider")te=Vb({part:Qr(e.session(),E.target.tableId),layout:K.layout,storeRevision:K.storeRevision,selection:K.selection,cellSelection:K.cellSelection,themeColors:K.themeColors,...W},E.resizeTarget,Math.max(20,E.rowHeightTwips+re));else if(E.rightEdge&&E.target.kind==="rightEdge"){let le=Math.max(300,E.leftTwips+re),ue=Math.max(le,E.tableWidthTwips+re);te=jn({command:{type:"commitTableRightEdgeResize",target:E.resizeTarget,columnWidthTwips:le,tableWidthTwips:ue},part:Qr(e.session(),E.target.tableId),layout:K.layout,storeRevision:K.storeRevision,selection:K.selection,cellSelection:K.cellSelection,themeColors:K.themeColors,...W});}else if(E.target.kind==="columnDivider"){let le=E.leftTwips+re,ue=E.rightTwips-re;le=Math.max(300,le),ue=Math.max(300,ue);let ve=E.leftTwips+E.rightTwips;le+ue!==ve&&(le>ve-300?(le=ve-300,ue=300):ue=ve-le),te=jn({command:{type:"commitTableColumnDividerResize",target:E.resizeTarget,leftWidthTwips:le,rightWidthTwips:ue},part:Qr(e.session(),E.target.tableId),layout:K.layout,storeRevision:K.storeRevision,selection:K.selection,cellSelection:K.cellSelection,themeColors:K.themeColors,...W});}else {k();return}e.applyTableCommandPlan(te),k();}function ce(E){if(!o||!f)return null;let K=e.pageOffsetX(f.pageIndex);return jd(o,f.x,f.y,E.layout,K,f.pageIndex)}function xe(E){if(!r||s||E.editingMode==="view")return;I();let K=ce(E),W=hf(K,E.selection.head.paragraphId);if(!W){r=null,k();return}if(hd(W)!==hd(r)){r=null,k();return}r=W,F(W,E);}function fe(){let E=p??x(),K=E!==null&&document.activeElement===E;b(),E&&t.contains(E)&&E.remove(),K&&e.pagesLayer.focus({preventScroll:true});}function D(E){if(s||E.editingMode==="view")return;let K=p??x();if(!K||!t.contains(K)){m&&b();return}if(p=K,!m||m.kind!=="insertRow"&&m.kind!=="insertColumn")return;if(!o){fe();return}let W=hd(m),ee=id(o,m);if(!ee||hd(ee)!==W){fe();return}m=ee,_(ee,E);}function M(E){let K=e.read();if(s&&E.pointerId===s.pointerId){d=E.clientX,u=E.clientY;let ue=(s.vertical?E.clientY-s.startClientY:E.clientX-s.startClientX)/e.scale();for(let ve of [...t.children])ve!==s.captureElement&&ve.remove();O(s.startEdgePt+ue,s.target);return}if(K.editingMode==="view"){C(false);return}if(E.target instanceof Node&&p?.contains(E.target)){I();return}let W=pO(e,E.clientX,E.clientY),ee=Xc$1(K.layout,W.y);ee>=0&&(f={x:W.x,y:W.y,pageIndex:ee});let re=ee>=0?e.pageOffsetX(ee):0,te=o?jd(o,W.x,W.y,K.layout,re,ee>=0?ee:void 0):null,le=hf(te,K.selection.head.paragraphId);if(!le){if(l)return;!n&&r&&(n=setTimeout(()=>{n=null,r=null,k();},fO));return}n&&(clearTimeout(n),n=null),!(r&&gd(le)===gd(r))&&(r=le,F(le,K));}function q(E){if(!(!s||E.pointerId!==s.pointerId)){if(e.read().editingMode==="view"){X();return}ae();}}function Z(E){!s||E.pointerId!==s.pointerId||X();}function Y(E){E.key!=="Escape"||!s||X();}return e.pagesLayer.addEventListener("pointermove",M),document.addEventListener("pointermove",M),document.addEventListener("pointerup",q),document.addEventListener("pointercancel",Z),e.pagesLayer.addEventListener("keydown",Y),{update(){let E=e.read(),K=a,W=i;o=fd(E.layout),a=E.layout.revision,i=E.storeRevision,E.editingMode==="view"?(X(),r=null,I(),C(true)):K!==null&&(K!==E.layout.revision||W!==E.storeRevision)&&(r!==null&&xe(E),D(E)),t.style.width=e.pagesLayer.style.width,t.style.height=e.pagesLayer.style.height;},refreshLabels(){let E=e.read();if(E.editingMode==="view")return;let K=p??x();if(K&&t.contains(K)&&m&&(m.kind==="insertRow"||m.kind==="insertColumn")){_(m,E);return}r&&(r.kind==="insertRow"||r.kind==="insertColumn")&&_(r,E);},destroy(){I(),X(),b(),k(),e.pagesLayer.removeEventListener("pointermove",M),document.removeEventListener("pointermove",M),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",Z),e.pagesLayer.removeEventListener("keydown",Y),t.remove();}}}function RS(e){let{session:t,commit:n,orderedRange:r,selectionMark:o,textOf:a}=e,i=()=>e.displayMode(),s=()=>e.authorFilter(),l=()=>t.partFor(e.storyScope())??t.part(),d=(b,I,k)=>t.applyTreeOps(b,I,k,e.storyScope()),u=()=>{let b=e.runFormatRefusal?.();return b?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:b})),true):false},f={get value(){return e.layout()}},p={get value(){return e.selection()}},m=(b,I,k)=>{let C=l();if(b.paragraphId===I.paragraphId){let y=za$1(C,b.paragraphId,b.offset,I.offset,k,i(),s());if(y.length===0)return;let R=ya$1(C,b.paragraphId,k);n(()=>d([...y.map(L=>({op:"setRunProperties",paragraphId:b.paragraphId,start:L.start,end:L.end,properties:L.properties,...L.targetRunIds?{targetRunIds:L.targetRunIds}:{}})),...e.paragraphMarkVisible(b.paragraphId)?tv(a(b.paragraphId),b,I,R):[]],o()));return}let T=e.paragraphOrder(),A=T.indexOf(b.paragraphId),O=T.indexOf(I.paragraphId);if(A===-1||O===-1)return;let $=[];for(let y=A;y<=O;y+=1){let R=T[y],L=a(R),_=y===A?b.offset:0,j=y===O?I.offset:L.length,F=_<j?za$1(C,R,_,j,k,i(),s()):[];for(let V of F)$.push({op:"setRunProperties",paragraphId:R,start:V.start,end:V.end,properties:V.properties,...V.targetRunIds?{targetRunIds:V.targetRunIds}:{}});(y<O||_===0&&j===L.length&&L.length>0)&&e.paragraphMarkVisible(R)&&$.push({op:"setParagraphMarkProperties",paragraphId:R,properties:ya$1(C,R,k)});}$.length!==0&&n(()=>d($,o()));},h=(b,I)=>{let k=l(),C=[];for(let T of ta$1(f.value,b)){let A=a(T);for(let O of za$1(k,T,0,A.length,I,i(),s()))C.push({op:"setRunProperties",paragraphId:T,start:O.start,end:O.end,properties:O.properties,...O.targetRunIds?{targetRunIds:O.targetRunIds}:{}});e.paragraphMarkVisible(T)&&C.push({op:"setParagraphMarkProperties",paragraphId:T,properties:ya$1(k,T,I)});}return C.length===0?false:(n(()=>d(C,o()),void 0,{keepCellSelection:true}),true)},x=b=>{oa(b.localName)&&e.setPendingFormats(ta(e.pendingFormats()??[],b));},v=b=>{if(b.length===0)return;let I=e.selectedCells?.(),k=I&&I.length>0?[...ta$1(f.value,I)]:null,{from:C,to:T}=r(),A=k??e.paragraphOrder(),O=k?0:A.indexOf(C.paragraphId),$=k?A.length-1:A.indexOf(T.paragraphId);if(O===-1||$===-1)return;let y=l(),R=A.slice(O,$+1).filter(L=>e.paragraphMarkVisible(L)).map(L=>{let _=ra(y,L);for(let j of b){let F=j.mergeAttributes?{..._.find(V=>V.localName===j.localName)?.attributes??{},...j.attributes}:j.attributes??{},H=Object.fromEntries(Object.entries(F).filter(([,V])=>V!=null));_=ta(_,{localName:j.localName,...Object.keys(H).length>0?{attributes:H}:{}});}return {op:"setParagraphProperties",paragraphId:L,properties:_}});R.length!==0&&n(()=>d(R,o()),void 0,{keepCellSelection:k!==null});};return {setRunProperty(b,I){if(u())return;let k={localName:b,...I?{attributes:I}:{}},C=e.selectedCells?.();if(C&&C.length>0){h(C,k);return}let{from:T,to:A}=r();if(T.paragraphId===A.paragraphId&&T.offset===A.offset){x(k);return}m(T,A,k);},setParagraphProperty(b,I,k){v([{localName:b,...I?{attributes:I}:{},...k??{}}]);},setParagraphProperties:v,formatting:()=>J0(ev(f.value,p.value,(b,I)=>{let k=t.effectiveRunDefaults(b,I);if(k.fontFamily!==null)return k;let C=e.defaultFontFamily?.()??null;return C===null?k:{...k,fontFamily:C}},e.selectedCells?.(),e.defaultParagraphStyleId?.()??null,e.paragraphOrder(),e.defaultFontFamily?.()??null),e.pendingFormats()),toggleRunProperty(b,I){if(u())return;let k=e.selectedCells?.(),C=I?.val,T=Mo(e.pendingFormats(),b,C)??Lu(f.value,p.value,b,k,C,e.paragraphOrder()),A=T?{localName:b,attributes:{val:mO[b]??"0"}}:{localName:b,...I?{attributes:I}:{}};if(k&&k.length>0){h(k,A);return}let{from:O,to:$}=r();if(O.paragraphId===$.paragraphId&&O.offset===$.offset){let y=e.pendingFormats()??[],R=Lu(f.value,p.value,b,void 0,C,e.paragraphOrder());if(!T===R){let L=y.filter(_=>_.localName!==b);e.setPendingFormats(L.length>0?L:null);}else x(A);return}m(O,$,A);},clearFormatting(){if(u())return;e.setPendingFormats(null);let b=f.value,I=e.paragraphOrder(),k=e.selectedCells?.(),C=k&&k.length>0?[...ta$1(b,k)]:Vs(I,r());if(C.length===0)return;let{from:T,to:A}=r(),O=k!==void 0&&k.length>0,$=l(),y=[];for(let R of C){let L=a(R),_=O||R!==T.paragraphId?0:T.offset,j=O||R!==A.paragraphId?L.length:A.offset;for(let F of Aa($,R,_,j,i(),s()))Q0($,R,F.start,F.end,i(),s())&&y.push({op:"setRunProperties",paragraphId:R,start:F.start,end:F.end,properties:[]});e.paragraphMarkVisible(R)&&sa($,R).length>0&&y.push({op:"setParagraphMarkProperties",paragraphId:R,properties:[]}),e.paragraphMarkVisible(R)&&ra($,R).length>0&&y.push({op:"setParagraphProperties",paragraphId:R,properties:[]});}y.length!==0&&n(()=>d(y,o()),void 0,{keepCellSelection:O});}}}var mO={u:"none",vertAlign:"baseline"};var gO=new Set,ES=500;function hO(e){let t=o=>({val:o?"1":"0"}),n=String(Math.max(2,Math.min(3276,Math.round(e.fontSizePt*2)))),r=[{localName:"b",attributes:t(e.bold)},{localName:"i",attributes:t(e.italic)},{localName:"bCs",attributes:t(e.bold)},{localName:"iCs",attributes:t(e.italic)},{localName:"u",attributes:{val:e.underline?e.underline.variant:"none",color:e.underline?.color??"auto",themeColor:"none"}},{localName:"strike",attributes:t(e.strike)},{localName:"dstrike",attributes:t(e.doubleStrike)},{localName:"caps",attributes:t(e.caps)},{localName:"smallCaps",attributes:t(e.smallCaps)},{localName:"vertAlign",attributes:{val:e.verticalAlign}},{localName:"color",attributes:{val:e.color??"auto"}},{localName:"highlight",attributes:{val:e.highlight??"none"}},{localName:"sz",attributes:{val:n}},{localName:"szCs",attributes:{val:n}},{localName:"spacing",attributes:{val:String(Math.round(e.characterSpacingPt*20))}},{localName:"position",attributes:{val:String(Math.round(e.baselineShiftPt*2))}},{localName:"w",attributes:{val:String(Math.round(e.horizontalScalePercent))}},{localName:"kern",attributes:{val:String(Math.round(e.kerningMinPt*2))}}];return (e.fontFamily||e.fontFamilyEastAsia)&&r.push({localName:"rFonts",attributes:{...e.fontFamily?{ascii:e.fontFamily,hAnsi:e.fontFamily}:{},...e.fontFamilyEastAsia?{eastAsia:e.fontFamilyEastAsia}:{}}}),r}function OS(e){let t=e.session,n=()=>t.partFor(e.storyScope())??t.part(),r="off",o=null,a=null,i=null,s=Ms,l=()=>{let v=o===null?"none":o.paragraphProperties?"paragraph":"run";return (s.mode!==r||s.level!==v)&&(s={mode:r,level:v}),s},d=(v,b,I)=>{if(I||v.paragraphId!==b.paragraphId||v.offset===b.offset)return true;let k=e.textOf(v.paragraphId);return v.offset===0&&b.offset===k.length&&k.length>0},u=()=>{let v=e.selectedCells?.(),b=v!==void 0&&v.length>0,{from:I,to:k}=e.orderedRange();if(!e.paragraphOrder().includes(I.paragraphId))return false;let C=zs(e.layout(),e.selection(),v,e.paragraphOrder()),T=d(I,k,b)?ra(n(),I.paragraphId):null;return !C&&T===null?false:(o={runProperties:C?hO(C):[],paragraphProperties:T},true)},f=()=>u()?(e.publish(),true):false,p=()=>{let v=o;if(!v)return {wrote:false,armed:false,built:false};let b=e.selectedCells?.(),I=b!==void 0&&b.length>0,{from:k,to:C}=e.orderedRange(),T=!I&&k.paragraphId===C.paragraphId&&k.offset===C.offset,A=T?sl(e.layout(),k,gO):null,O=A?.from??k,$=A?.to??C,y=T&&O.offset===$.offset,R=I?[...ta$1(e.layout(),b)]:Vs(e.paragraphOrder(),{from:O,to:$});if(R.length===0)return {wrote:false,armed:false,built:false};let L=n(),_=e.displayMode(),j=[];for(let B of R){let X=e.textOf(B),ae=I||B!==O.paragraphId?0:O.offset,ce=I||B!==$.paragraphId?X.length:$.offset;if(ae<ce&&v.runProperties.length>0)for(let D of za$1(L,B,ae,ce,v.runProperties,_,e.authorFilter()))j.push({op:"setRunProperties",paragraphId:B,start:D.start,end:D.end,properties:D.properties,...D.targetRunIds?{targetRunIds:D.targetRunIds}:{}});let xe=v.paragraphProperties!==null||I||B!==$.paragraphId||ae===0&&ce===X.length&&X.length>0,fe=e.paragraphMarkVisible(B);xe&&fe&&v.runProperties.length>0&&j.push({op:"setParagraphMarkProperties",paragraphId:B,properties:ya$1(L,B,v.runProperties)}),v.paragraphProperties&&fe&&j.push({op:"setParagraphProperties",paragraphId:B,properties:[...v.paragraphProperties]});}let F=t.packageRevision();j.length>0&&e.commit(()=>t.applyTreeOps(j,e.selectionMark(),void 0,e.storyScope()),void 0,{keepCellSelection:I});let H=t.packageRevision()!==F,V=y&&v.runProperties.length>0&&(H||j.length===0);return V&&e.armPendingFormats(v.runProperties),{wrote:H,armed:V,built:j.length>0}},m=()=>{let v=p();return v.wrote&&r==="once"&&x(),v.wrote?"painted":v.armed?"armed":v.built?"refused":"nothingToPaint"},h=()=>{r!=="off"&&(r="off",e.publish());},x=()=>{a=null,i=null,h();};return {state:l,capture:f,apply:m,disarm:x,press(){let v=e.now(),b=a!==null&&v-a<ES,I=r;a=v;let k=()=>(a=null,false);return I==="once"&&b?u()?(r="locked",e.publish(),true):(h(),k()):I!=="off"?(h(),i=I==="locked"?v:null,true):i!==null&&v-i<ES?(i=null,true):u()?(r="once",i=null,e.publish(),true):k()},applyIfArmed(){r==="off"||o===null||p().wrote&&r==="once"&&x();}}}var yO=500,MS=4,Ho=40,vl=12;function bO(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 FS(e,t){return bO(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 nn(e,t,n){let r=V(e),o=r.indexOf(t.paragraphId),a=r.indexOf(n.paragraphId);return o!==a?o-a:t.offset-n.offset}function LS(e,t,n){if(!(t>Pc$1))for(let r of e){if(r.kind==="paragraph"){n(r);continue}if(!(t>=Pc$1)){for(let o of r.rows)if(!o.isHeaderRepeat)for(let a of o.cells)LS(a.blocks,t+1,n);}}}function wf(e,t){if(!t.placeholder||t.fragments.length===0)return null;let n=null,r=null,o=(i,s)=>{(!n||nn(e,i,n)<0)&&(n=i),(!r||nn(e,s,r)>0)&&(r=s);},a=t.level!=="inline";for(let i of t.fragments){let s=e.pages[i.pageIndex];s&&LS(s.fragments,0,l=>{if(FS(i.box,l.box)){if(a){let d=re(e,l.paragraphId).length;o({paragraphId:l.paragraphId,offset:0},{paragraphId:l.paragraphId,offset:d});return}for(let d of l.lines)for(let u of d.spans)FS(i.box,u.box)&&o({paragraphId:u.range.paragraphId,offset:u.range.start},{paragraphId:u.range.paragraphId,offset:u.range.end});}});}return !n||!r?null:{from:n,to:r}}function vO(e,t){return (e.contentControls??[]).find(n=>n.id===t)??null}function AS(e,t){let n=t.contentControlId;if(!n){let o={x:t.caret.x,y:t.caret.y+t.caret.height/2},a=ad(e,t.pageIndex,o);return a?.placeholder?a:null}let r=vO(e,n);return r?.placeholder?r:null}function xl(e,t){let n=e.contentControls??[];if(n.length===0)return t;let r=nn(e,t.anchor,t.head)<=0?t.anchor:t.head,o=nn(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 l=wf(e,s);!l||!(nn(e,r,o)===0?nn(e,r,l.from)>=0&&nn(e,r,l.to)<0:nn(e,r,l.to)<0&&nn(e,o,l.from)>0)||(nn(e,l.from,r)<0&&(r=l.from,a=true),nn(e,l.to,o)>0&&(o=l.to,a=true));}}return nn(e,t.anchor,t.head)<=0?{anchor:r,head:o}:{anchor:o,head:r}}var xO=new Set(["dropdown","comboBox","date","buildingBlockGallery"]);function NS(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,l=0,d=0,u=0,f=0,p=null;function m(M,q){if(!s){let Y=n.getBoundingClientRect();s={left:Y.left,top:Y.top};}let Z=e.scale()||1;return {x:(M-s.left)/Z,y:(q-s.top)/Z}}function h(M){return {scope:{kind:"headerFooter",rId:M.rId},pageIndex:M.pageIndex,kind:M.kind,partName:M.partName,variant:M.variant}}function x(M,q){let Z=e.layout(),Y=m(M,q),E=Xc$1(Z,Y.y),K=Z.pages[E];if(!K)return null;let W=e.measurer();return Zc$1(Z,E,{x:Y.x-K.contentBox.x-e.pageOffsetX(E),y:Y.y-K.contentBox.y},W?{measurer:W}:{})}function v(M,q){let Z=e.activeNote?.()??null;if(Z){let ee=e.layout(),re=Bc(ee,m(M,q),e.pageOffsetX);if(!re||re.scopeId!==Z.scopeId)return null;let te=e.measurer();return _c$2(ee,re.pageIndex,re.fragments,re.local,{...te?{measurer:te}:{}})}let Y=e.activeHeaderFooter?.()??null;if(!Y)return x(M,q);let E=e.layout(),K=m(M,q),W=qc(E,K,e.pageOffsetX);if(W&&Lc(W.story,h(Y))){let ee=e.measurer();return Dc(E,W.pageIndex,W.story,W.local,ee?{measurer:ee}:{})}return null}function b(M,q){let{story:Z,pageIndex:Y,kind:E}=M;return {rId:Z.rId,pageIndex:Y,kind:E,partName:Z.partName,variant:Z.variant,...q?{position:q}:{}}}function I(M){let q=e.measurer();return Dc(e.layout(),M.pageIndex,M.story,M.local,q?{measurer:q}:{})?.position??void 0}let k=new WeakMap;function C(M,q){let Z=e.activeNote?.();if(Z){let W=Co(M,null,Z.scopeId).indexOf(q);return W===-1?-1:W}let Y=e.activeHeaderFooter?.();if(Y){let W=Co(M,h(Y)).indexOf(q);return W===-1?-1:W}let E=k.get(M);return E||(E=new Map(V(M).map((K,W)=>[K,W])),k.set(M,E)),E.get(q)??-1}function T(M,q,Z){let Y=C(M,q.paragraphId),E=C(M,Z.paragraphId);return Y!==E?Y<E:q.offset<Z.offset}function A(M,q,Z){if(Z==="character")return {from:q,to:q};let Y=q.paragraphId;if(Z==="paragraph"){let E=re(M,Y);return {from:{paragraphId:Y,offset:0},to:{paragraphId:Y,offset:E.length}}}return sl(M,q,se(M,Y))}function O(M,q,Z,Y,E){let K=E?AS(M,E):null,W=K?wf(M,K)??A(M,Z,Y):A(M,Z,Y),ee=T(M,W.from,q.from)?{anchor:q.to,head:W.from}:{anchor:q.from,head:W.to};return xl(M,ee)}let $=r.closest(".docx-editor__scroll-container");function y(){return r.closest(".docx-editor__scroll-container")}function R(M,q,Z){if(Z<M+Ho){let Y=Math.max(0,M+Ho-Z);return -Math.min(vl,Y/Ho*vl)}if(Z>q-Ho){let Y=Math.max(0,Z-(q-Ho));return Math.min(vl,Y/Ho*vl)}return 0}function L(){p!==null&&(a?.cancelAnimationFrame(p),p=null);}function _(){p=null;let M=i,q=y();if(!M||!q||!a)return;let Z=q.getBoundingClientRect(),Y=R(Z.top,Z.bottom,M.clientY);Y!==0&&(q.scrollTop+=Y,s=null,F(M.clientX,M.clientY),p=a.requestAnimationFrame(_));}function j(){if(p!==null||!a||!i)return;let M=y();if(!M)return;let q=M.getBoundingClientRect();R(q.top,q.bottom,i.clientY)!==0&&(p=a.requestAnimationFrame(_));}function F(M,q){let Z=i;if(!Z)return;let Y=v(M,q);Y&&((e.isReadOnlyPosition?.(Y.position)??e.isReadOnlyParagraph?.(Y.position.paragraphId))||H(Z,Y)||e.setSelection(O(e.layout(),Z.anchorRange,Y.position,Z.granularity,Y)));}function H(M,q){let Z=M.anchorCell;if(!Z)return false;if(!q.cell||q.cell.tableId!==Z.tableId)return M.cellDragging;if(!M.cellDragging&&q.cell.cellId===Z.cellId)return false;let Y=ra$1(e.layout(),Z,q.cell);return Y?(M.cellDragging=true,e.setCellSelection(Y),true):M.cellDragging}function V$1(M){let q=Date.now(),Z=q-d;return l=Math.abs(M.clientX-u)<=MS&&Math.abs(M.clientY-f)<=MS&&Z>=0&&Z<=yO?l+1:1,d=q,u=M.clientX,f=M.clientY,l}let B=["character","word","paragraph"],X=M=>{if(M.button!==0)return;if(e.onChangeBarToggle&&M.target?.closest?.("[data-docx-change-bar-toggle]")){M.preventDefault(),M.stopPropagation(),e.onChangeBarToggle();return}let q=M.target?.closest?.("[data-docx-cc-widget]");if(q){if(M.preventDefault(),M.stopPropagation(),q.hasAttribute("disabled")||q.dataset.disabledReason)return;let Oe=q.dataset.docxCcId,Be=q.dataset.docxCcWidget;Oe&&Be&&e.onContentControlWidget?.(Oe,Be);return}if(M.pointerType==="touch")return;i&&fe(),s=null;let Z=e.layout(),Y=m(M.clientX,M.clientY),E=e.activeHeaderFooter?.()??null,K=e.activeNote?.()??null,W=qc(Z,Y,e.pageOffsetX),ee=Bc(Z,Y,e.pageOffsetX),re=M.target?.closest("[data-docx-hf]"),te=!!(re||W),le=M.target,ue=le?.closest("[data-docx-note-ref]"),ve=le?.closest("[data-docx-note-mark-back]"),rt=null,Ee=()=>rt??=V$1(M);if(ue?.dataset.docxNoteScope){M.preventDefault(),e.focus(),e.enterNote?.(ue.dataset.docxNoteScope);return}if(ve){M.preventDefault(),e.focus(),e.exitNote?.(true);return}if(ee&&!te){let Oe=e.measurer?.(),Be=_c$2(Z,ee.pageIndex,ee.fragments,ee.local,{...Oe?{measurer:Oe}:{}});if(!K||K.scopeId!==ee.scopeId){M.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,Be?{paragraphId:Be.position.paragraphId,offset:Be.position.offset}:void 0,ee.pageIndex);return}if(K.pageIndex!==ee.pageIndex){M.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,Be?{paragraphId:Be.position.paragraphId,offset:Be.position.offset}:void 0,ee.pageIndex);return}}else if(K){if(!Nc(Z,Y,e.pageOffsetX))return;e.exitNote?.(false),e.focus();}if(E)if(W&&Lc(W.story,h(E)))W.pageIndex!==E.pageIndex&&e.enterHeaderFooter?.(b(W,I(W)));else if(W&&W.story.rId){M.preventDefault(),e.focus(),e.enterHeaderFooter?.(b(W,I(W)));return}else if(Nc(Z,Y,e.pageOffsetX)){M.preventDefault(),e.exitHeaderFooter?.(true),e.focus();return}else {let Oe=Ee()>=2?$c(Z,Y,e.pageOffsetX):null;Oe&&(M.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Oe.kind,Oe.pageIndex));return}else if(te&&Ee()>=2){if(W?.story.rId)M.preventDefault(),e.focus(),e.enterHeaderFooter?.(b(W,I(W)));else if(re instanceof HTMLElement){let Oe=re.dataset.docxRId,Be=re.dataset.docxHf,Se=re.closest("[data-page-index]")?.getAttribute("data-page-index"),Ae=Se!=null?Number(Se):NaN;if((Be==="header"||Be==="footer")&&Number.isInteger(Ae))if(Oe){let Yn=Z.pages[Ae]?.[Be];M.preventDefault(),e.focus(),e.enterHeaderFooter?.({rId:Oe,pageIndex:Ae,kind:Be,partName:Yn?.partName??"",variant:Yn?.variant??"default"});}else Z.pages[Ae]?.[Be]||(M.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Be,Ae));}return}else if(Ee()>=2){let Oe=$c(Z,Y,e.pageOffsetX);if(Oe){M.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Oe.kind,Oe.pageIndex);return}}let _e=v(M.clientX,M.clientY);if(!_e)return;if(e.isReadOnlyPosition?.(_e.position)??e.isReadOnlyParagraph?.(_e.position.paragraphId)){M.preventDefault();return}if(Ee()===2&&e.onTextFormDoubleClick?.(M))return;M.preventDefault(),e.focus();try{n.setPointerCapture(M.pointerId);}catch{}o.addEventListener("pointermove",ce),o.addEventListener("pointerup",xe),o.addEventListener("pointercancel",xe);let De=Ee(),Ce=M.shiftKey?"character":B[(De-1)%B.length],ze=AS(Z,_e);if(ze&&!M.shiftKey){let Oe=()=>{De===1&&xO.has(ze.controlType)&&e.onContentControlWidget?.(ze.id,ze.controlType);};if(e.selectContentControl?.(ze.id)){let Se=e.selection(),Ae=T(Z,Se.anchor,Se.head)||Se.anchor.paragraphId===Se.head.paragraphId&&Se.anchor.offset===Se.head.offset?{from:Se.anchor,to:Se.head}:{from:Se.head,to:Se.anchor};i={pointerId:M.pointerId,granularity:"character",anchorRange:Ae,anchorCell:_e.cell,cellDragging:false,clientX:M.clientX,clientY:M.clientY},Oe();return}let Be=wf(Z,ze);if(Be){i={pointerId:M.pointerId,granularity:"character",anchorRange:Be,anchorCell:_e.cell,cellDragging:false,clientX:M.clientX,clientY:M.clientY},ae(()=>e.setSelection({anchor:Be.from,head:Be.to})),Oe();return}}if(M.shiftKey){let Oe=e.selection();i={pointerId:M.pointerId,granularity:Ce,anchorRange:{from:Oe.anchor,to:Oe.anchor},anchorCell:_e.cell,cellDragging:false,clientX:M.clientX,clientY:M.clientY},ae(()=>e.setSelection(O(Z,{from:Oe.anchor,to:Oe.anchor},_e.position,Ce,_e)));}else {let Oe=A(Z,_e.position,Ce);i={pointerId:M.pointerId,granularity:Ce,anchorRange:Oe,anchorCell:_e.cell,cellDragging:false,clientX:M.clientX,clientY:M.clientY},ae(()=>e.setSelection(xl(Z,{anchor:Oe.from,head:Oe.to})));}};function ae(M){try{M();}catch(q){throw fe(),q}}let ce=M=>{let q=i;!q||M.pointerId!==q.pointerId||(M.preventDefault(),q.clientX=M.clientX,q.clientY=M.clientY,F(M.clientX,M.clientY),j());},xe=M=>{let q=i;if(!q||M.pointerId!==q.pointerId)return;fe();try{n.releasePointerCapture(q.pointerId);}catch{}let Z=e.cellSelection();Z?e.setCellSelection(Z):e.setSelection(e.selection()),M.type==="pointerup"&&(e.onTextFormPointerUp?.(M),e.onSelectionSettled?.());};function fe(){if(i)try{n.releasePointerCapture(i.pointerId);}catch{}i=null,s=null,L(),o.removeEventListener("pointermove",ce),o.removeEventListener("pointerup",xe),o.removeEventListener("pointercancel",xe);}let D=()=>{s=null;};return n.addEventListener("pointerdown",X),$?.addEventListener("scroll",D,{passive:true}),a?.addEventListener("scroll",D,{capture:true,passive:true}),a?.addEventListener("resize",D,{passive:true}),{dragging:()=>i!==null,destroy(){fe(),n.removeEventListener("pointerdown",X),$?.removeEventListener("scroll",D),a?.removeEventListener("scroll",D,{capture:true}),a?.removeEventListener("resize",D);}}}function DS(e,t,n){let r=e??Y;return {view:()=>r,projection:()=>X(r),changeBars:()=>t?r==="all-markup"||r==="simple-markup"?r:"none":"all-markup",set:o=>{r=o;},filter:o=>t&&X(r)!=="all-markup"?Z(o):o,toggleByChangeBar:()=>{t&&n(r==="simple-markup"?"all-markup":"simple-markup");}}}function HS(e){let{document:t,pagesLayer:n,session:r}=e,o=false,a=null,i;function s(O){let $=Gr(O?.anchorNode,n)??Gr(O?.focusNode,n);$!==void 0&&(i=$);}function l(O){return i??Gr(O?.anchorNode,n)??Gr(O?.focusNode,n)}let d=false,u=false,f=false,p=null,m=false;function h(){let O=t.getSelection(),$=Lo(n,O);return !$||(s(O),Et($,e.selection()))?false:(e.adoptSelection($),true)}function x(){let O=t.activeElement;if(O&&n.contains(O))return true;if(O&&O!==t.body&&O!==t.documentElement)return false;let $=t.getSelection();if(!$||$.rangeCount===0)return true;let y=$.anchorNode;return !y||!y.isConnected?true:n.contains(y)}let v=()=>{let O=t.getSelection(),$=Lo(n,O);if(!$){if(!ef(n,O))return;d=false;let y=Ke(e.selection().head);if(Et(y,e.selection()))return;e.setSelection(y);return}d=false,s(O),!Et($,e.selection())&&e.setSelection($);};function b(O){let $=e.textOf(O),y=Hx(n,O,$,t.getSelection()?.anchorNode??null);if(y===null)return;let R=_x(O,$,y);if(!R)return;let L=R.ops.find(B=>B.op==="deleteText"),_=R.ops.find(B=>B.op==="insertText"),j=_&&L?e.replacementOffset?.(O,L.start,L.end):void 0,F=_&&j!==void 0&&j!==_.offset?R.ops.map(B=>B===_?{..._,offset:j}:B):R.ops,H=_?e.pendingFormatOps?.(O,j??_.offset,_.text.length,L?{start:L.start,end:L.end}:void 0)??[]:[],V=e.storyScope();e.commit(()=>{let B=e.applyOps([...F,...H],e.selectionMark(),V);return H.length===0||!B.rejected?B:e.applyOps(F,e.selectionMark(),V)}),e.setSelection(Ke({paragraphId:O,offset:_&&j!==void 0?j+_.text.length:R.caret}));}function I(){o||f||e.isGesturing?.()||e.holdsCellSelection?.()||k()||d&&v();}function k(){if(!u||d)return false;if(!a)return true;let O=Lo(n,t.getSelection());return O!==null&&Et(O,a)}function C(O){O instanceof PointerEvent&&O.button!==0||(d=true);}let T=false;function A(O=false){if(e.updateCaret(),!O&&!x())return;o=true;let $=e.now(),y=e.domSelection?.()??e.selection();d=false;let R=t.getSelection(),L=l(R),_=kx(n,y,R,L!==void 0?{preferredPageIndex:L}:void 0);_&&s(R),a=_?y:null,_||(u=true),e.recordSelectionMs(e.now()-$),queueMicrotask(()=>{o=false;});}return n.addEventListener("pointerdown",C,true),n.addEventListener("selectstart",C,true),{adoptBeforePaint(){let O=e.holdsCellSelection?.()===true||e.isGesturing?.()===true||e.hasPendingInput?.()===true,$=u||O||!d?false:h();return e.hasPendingInput?.()!==true&&(u=false),$},noteModelMoved(){u=true;},noteSelectionSettled(){u=false;},mirrorToDom:A,adoptBeforeInput:I,isComposing:()=>f,noteBrowserSelectionFixup(){T=true;},onSelectionChange:()=>{if(!o&&!f&&!e.isGesturing?.()&&!e.holdsCellSelection?.()){if(T&&ef(n,t.getSelection())){let O=Lo(n,t.getSelection());if((O===null||!Et(O,e.selection()))&&(T=false,!d)){A();return}}k()||v();}},onCompositionStart:()=>{I(),f=true;let O=e.selection();m=O.anchor.paragraphId!==O.head.paragraphId,p=O.head.paragraphId,r.beginComposition(e.storyScope());},onCompositionEnd:O=>{f=false;let $=p??e.selection().head.paragraphId;p=null;let y=m;m=false;let R=e.storyScope(),L=r.revisionFor(R);if(y){let _=O?.data??"";_.length>0&&e.replaceSelectionWith?.(_);}else b($);r.endComposition(),r.revisionFor(R)===L&&e.discardPaint?.(),e.flushToPaint()||e.render();},selectionPageIndex:()=>i,destroy(){n.removeEventListener("pointerdown",C,true),n.removeEventListener("selectstart",C,true),d=false;}}}var SO=32;function BS(e,t,n,r){if(!(e.kind==="textValue"||r>SO)){if(e.kind==="paragraph"){n.has(e.id)||n.set(e.id,t);return}for(let o of e.children)BS(o,t,n,r+1);}}function kO(e){let t=Ha$2(e),n=cc$1(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&&BS(s,o,r,0);}}return r}var _S=new WeakMap;function TO(e){return !(!e.story||e.origin===b$2.mutationUndo||e.origin===b$2.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.includes(g$1.section))}function PO(e,t){t.story&&t.story.kind!=="body"||TO(t)||(e.map=null);}function CO(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>PO(t,n)));}function RO(e,t){let n=_S.get(e);return n||(n={map:null,subscribed:false},_S.set(e,n)),CO(e,n),n.map||(n.map=kO(t)),n.map}function $S(e,t,n){return n.startsWith(`${t.name}#`)?RO(e,t).get(n)??null:null}var qS=32;function fi(e,t,n,r,o="all-markup",a){let i=e.part(),s=cc$1(i,o,a);if(s.length<=1)return 0;let l=dc$1(i,o,a),d=p=>{let m=l.indexOf(p);if(m!==-1)return m;let h=l.findIndex(x=>x>p);return h===-1?Math.max(0,l.length-1):h},u=If(e,t);if(u!==null)return d(u);if(n.kind==="headerFooter"){if(r!==void 0&&s[r]!==void 0)return r;let p=e.headerFooterResolutionBySection().findIndex(m=>[m.headers,m.footers].some(h=>[...h.values()].some(x=>x.rId===n.rId)));return p===-1?0:d(p)}let f=OO(e,t);if(f!==null){let p=If(e,f);if(p!==null)return d(p)}return 0}function ZS(e,t,n,r,o="all-markup",a){let i=e.part(),s=cc$1(i);if(s.length<=1)return {kind:"whole-document"};let l=dc$1(i,o,a),d=If(e,t),u=fi(e,t,n,r,o,a),f=l[u]??u;if(d!==null&&d===f)return {kind:"anchor",paragraphId:t};let p=s[f];if(!p)return {kind:"unaddressable"};let m=Ha$2(i);for(let h=p.blockStart;h<p.blockEndExclusive;h+=1){let x=EO(m[h]);if(x!==null)return {kind:"anchor",paragraphId:x}}return {kind:"unaddressable"}}function EO(e){if(!e)return null;let t=(n,r)=>{if(n.kind==="textValue"||r>qS)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 If(e,t){return $S(e,e.part(),t)}function OO(e,t){let n=e.currentPackage();for(let r of ["footnote","endnote"]){let o=Wf$1(n,r);if(!(!o||!t.startsWith(`${o.name}#`)))for(let a of td$1(o.root)){let i=id$1(a);if(i===null||!MO(a,t))continue;return Xf(e.part()).find(l=>l.noteKind===r&&l.noteId===i)?.paragraphId??null}}return null}function MO(e,t){let n=(r,o)=>{if(r.kind==="textValue"||o>qS)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 _o(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 Sl(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 KS(e){return {val:e?"1":"0"}}var kf="a section break that changes where the next section starts cannot be suggested; turn off suggesting to insert it",Il="a section break cannot be inserted inside a table cell",VS="a section break cannot change a section that a locked or linked content control holds",Pf="a section break cannot be inserted in locked or linked content";function FO(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!==da$1)return false;if(s.localName==="dataBinding")return true;if(s.localName!=="lock")return false;let l=s.attributes?.find(d=>d.localName==="val"&&d.namespaceUri===da$1)?.value;return l==="contentLocked"||l==="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 l=i||a.kind==="table",d=s||r(a);for(let u of a.children??[])o(u,l,d);};return o(e.root,false,false),{inCell:t,held:n}}var AO=32;function LO(e){let t=new Set($h$1(e).map(n=>ci$1(n)));return _h$1(e)||t.add("nextPage"),t.size===1?[...t][0]:null}function Cf(e,t){let n=t.replaceAt??t.collapseTo;return ai$1(e,n.paragraphId)?t.collapseTo:n}var Tf=(e,t)=>Me(e,t)||Je$1(e,t).content;function wl(e,t,n,r){if(ai$1(e,t))return Il;if(Tf(e,t))return Pf;let{section:o,ownerId:a}=bi$1(e,t);return ci$1(o)===n?null:a!==null&&Tf(e,a)?VS:r?kf:null}function zS(e){let{breakType:t,suggesting:n}=e;if(e.cellRectangle)return Il;if(e.caretParagraphId!==null)return wl(e.part(),e.caretParagraphId,t,n);let r=FO(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=bi$1(i,o.paragraphId),l=bi$1(i,a.paragraphId),d=s.section===l.section,u=d?ci$1(s.section):LO(i),f=e.paragraphOrder(),p=f.indexOf(o.paragraphId),m=f.indexOf(a.paragraphId),h=p===-1||m===-1?null:f.slice(p,m+1),x=h!==null&&!h.some(b=>r.inCell.has(b))&&!h.some(b=>r.held.has(b));if(u!==null&&u!==t){if(x&&d&&s.ownerId!==null&&Tf(i,s.ownerId))return VS;if(n&&x)return kf}if(x&&u!==null)return null;if(h===null||h.length-1>AO)return n&&u!==null&&u!==t?kf:null;let v=Cf(i,e.deleteSelectionPlan());return wl(i,v.paragraphId,t,n)}var NO=[["contextualSpacing","contextualSpacing"],["keepNext","keepNext"],["keepLines","keepLines"],["widowControl","widowControl"],["pageBreakBefore","pageBreakBefore"]];function DO(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 kl(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 jS(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 WS(e){let{session:t,commit:n,orderedStart:r,orderedRange:o,selectionMark:a,collapsedAt:i}=e,s=e.deleteSelectionPlan,l=()=>t.partFor(e.storyScope())??t.part(),d=(y,R,L)=>t.applyTreeOps(y,R,L,e.storyScope()),u=rv({session:t,storyPart:l}),f=()=>e.paragraphOrder(),p={get value(){return e.layout()}};function m(){let y=e.selectedCells?.();return y&&y.length>0?y:null}function h(y){let R=false;return n(()=>{let L=y();return R=L.committed,L},void 0,{keepCellSelection:m()!==null}),R}function x(){if(m()!==null)return [...ta$1(p.value,m())];let{from:y,to:R}=o(),L=f(),_=L.indexOf(y.paragraphId),j=L.indexOf(R.paragraphId);return _===-1||j===-1?null:L.slice(_,j+1)}let v=720,b=8;function I(y){return k(y)?.level??null}function k(y){return U(p.value,y)?.marker??null}function C(y){let R=k(y);return R?R.numFmt==="bullet"?"bullet":"ordered":null}function T(y,R){let L=f(),_=L.indexOf(y[0]??""),j=L.indexOf(y[y.length-1]??"");if(_===-1||j===-1)return null;for(let F of [_-1,j+1]){let H=L[F];if(!H)continue;let V=k(H);if(V&&(V.numFmt==="bullet"?"bullet":"ordered")===R)return V.numId}return null}function A(y,R){return R<0||R>b?false:e.numberingLevelExists(y.numId,R)}function O(y,R){return R<0||R>b?false:e.numberingLevelExists(y.numId,R)?true:t.ensureNumberingLevel(y.numId,R,y.numFmt==="bullet"?"bullet":"ordered")&&e.numberingLevelExists(y.numId,R)}function $(y){let R;for(let L of y){if(L.localName!=="ind")continue;let _=L.attributes?.left??L.attributes?.start;_!==void 0&&(R=_);}return !R||!/^-?\d{1,7}$/.test(R)?0:Number(R)}return {insertTab(){let y=s(),R=y.replaceAt??y.collapseTo;n(()=>d([...y.ops,{op:"insertTab",paragraphId:R.paragraphId,offset:R.offset}],a()),()=>i({...R,offset:R.offset+1}));},insertLineBreak(){let y=s(),R=y.replaceAt??y.collapseTo;n(()=>d([...y.ops,{op:"insertHardBreak",paragraphId:R.paragraphId,offset:R.offset}],a()),()=>i({...R,offset:R.offset+1}));},insertPageBreak(){let y=s(),R=y.replaceAt??y.collapseTo;n(()=>d([...y.ops,{op:"insertPageBreak",paragraphId:R.paragraphId,offset:R.offset}],a()),()=>i({...R,offset:R.offset+1}));},exitListOnEmptyItem(){let{from:y,to:R}=o();if(y.paragraphId!==R.paragraphId||y.offset!==R.offset)return false;let L=k(y.paragraphId);if(!L||e.paragraphTextOf(y.paragraphId).length>0)return false;let j=L.level>0&&A(L,L.level-1),F=[];if(j)F.push({op:"setListLevel",paragraphId:y.paragraphId,level:L.level-1});else {let V=u.clearOp(y.paragraphId);V&&F.push(V),F.push({op:"setListNumbering",paragraphId:y.paragraphId,numId:null});}let H=false;return n(()=>{let V=d(F,a());return H=V.committed,V}),H},isListParagraph(){let{paragraphId:y}=r();return I(y)!==null},isListActive(y){let R=x();if(R===null)return false;let L=y==="bullet"?"bullet":"ordered";return R.length>0&&R.every(_=>C(_)===L)},toggleList(y){let R=x();if(R===null||R.length===0)return false;let L=R.every(F=>C(F)===y),_=L?null:T(R,y)??t.ensureListDefinition(y);if(!L&&_===null)return false;let j=L?[]:u.applyOps(R);for(let F of R){let H=I(F);j.push({op:"setListNumbering",paragraphId:F,numId:_,...H!==null?{level:H}:{}});}return h(()=>d(j,a()))},canAdjustIndent(y){let R=x();if(R===null)return false;let L=y==="increase"?1:-1;return R.some(_=>{let j=k(_);if(j){let H=j.level+L;return H>=0&&H<=b}let F=$(Fo(p.value,_));return Math.max(0,F+L*v)!==F})},adjustIndent(y){let R=x();if(R===null)return false;let L=y==="increase"?1:-1,_=[];for(let j of R){let F=Fo(p.value,j),H=k(j),V=H?.level??null;if(H&&V!==null){let xe=V+L;if(xe<0||xe>b||!O(H,xe))continue;_.push({op:"setListLevel",paragraphId:j,level:xe});continue}let B=$(F),X=Math.max(0,B+L*v);if(X===B)continue;let ae=ra(l(),j),ce=ae.find(xe=>xe.localName==="ind");_.push({op:"setParagraphProperties",paragraphId:j,properties:ta(ae,{localName:"ind",attributes:DO(ce?.attributes,String(X))})});}return _.length===0?false:h(()=>d(_,a()))},setIndent(y){if(y.left===void 0&&y.right===void 0&&y.firstLine===void 0)return false;let R=x();if(R===null)return false;let L=[];for(let _ of R){let j=ra(l(),_),H={...j.find(V=>V.localName==="ind")?.attributes??{}};y.left!==void 0&&(H=kl(H,"left","start",y.left)),y.right!==void 0&&(H=kl(H,"right","end",y.right)),y.firstLine!==void 0&&(H=jS(H,y.firstLine)),L.push({op:"setParagraphProperties",paragraphId:_,properties:ta(j,{localName:"ind",...Object.keys(H).length>0?{attributes:H}:{}})});}return L.length===0?false:h(()=>d(L,a()))},setParagraphFormat(y){let R=x();if(R===null||R.length===0)return false;let L=[];y.alignment!==void 0&&L.push({localName:"jc",attributes:{val:y.alignment}});let _={..._o("before",y.spaceBeforePt),..._o("after",y.spaceAfterPt),...Sl(y.lineSpacing)};Object.keys(_).length>0&&L.push({localName:"spacing",attributes:_,mergeAttributes:true});for(let[V,B]of NO){let X=y[V];X!==void 0&&L.push({localName:B,attributes:KS(X)});}let j=y.tabStops!==void 0,F=y.indentLeftTwips!==void 0||y.indentRightTwips!==void 0||y.indentFirstLineTwips!==void 0;if(L.length===0&&!F&&!j)return false;let H=[];for(let V of R){let B=ra(l(),V),X=B;if(F){let ce={...B.find(xe=>xe.localName==="ind")?.attributes??{}};y.indentLeftTwips!==void 0&&(ce=kl(ce,"left","start",y.indentLeftTwips)),y.indentRightTwips!==void 0&&(ce=kl(ce,"right","end",y.indentRightTwips)),y.indentFirstLineTwips!==void 0&&(ce=jS(ce,y.indentFirstLineTwips)),X=ta(X,{localName:"ind",...Object.keys(ce).length>0?{attributes:ce}:{}});}for(let ae of L){let ce=ae.mergeAttributes?{...X.find(fe=>fe.localName===ae.localName)?.attributes??{},...ae.attributes}:ae.attributes??{},xe=Object.fromEntries(Object.entries(ce).filter(([,fe])=>fe!=null));X=ta(X,{localName:ae.localName,...Object.keys(xe).length>0?{attributes:xe}:{}});}if((L.length>0||F)&&H.push({op:"setParagraphProperties",paragraphId:V,properties:X}),j){let ae=ri(e.layout(),V);H.push({op:"setParagraphTabStops",paragraphId:V,stops:y.tabStops.map(ce=>({positionTwips:Math.round(ce.positionTwips),alignment:ce.alignment,...ce.leader&&ce.leader!=="none"?{leader:ce.leader}:{}})),...ae?{inForcePositionsTwips:ae.stops.map(ce=>Math.round(ce.positionPt*20))}:{}});}}return H.length===0?false:h(()=>d(H,a()))},sectionProperties:()=>bc$1(t.part()),sectionPropertiesAt(y){let R=cc$1(t.part(),e.revisionDisplayMode(),e.revisionAuthorFilter()),L=fi(t,y,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter());return (R[L]??R[R.length-1]).properties},sectionAnchorParagraphAt(y){return ZS(t,y,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter())},setSectionProperties(y){let R=false;return n(()=>{let L=e.storyScope().kind==="body",_=t.applyTreeOps([{op:"setSectionProperties",...y}],L?a():void 0,void 0,{kind:"body"});return R=_.committed,_}),R},sectionBreakRefusal(y="nextPage"){return e.storyScope().kind!=="body"?null:zS({part:()=>t.part(),breakType:y,suggesting:e.editingMode?.()==="suggest",cellRectangle:(e.selectedCells?.()?.length??0)>0,caretParagraphId:e.caretParagraphId?.()??null,orderedRange:o,paragraphOrder:f,deleteSelectionPlan:s})},insertSectionBreak(y="nextPage"){if(e.storyScope().kind!=="body")return false;let R=s(),L=Cf(t.part(),R),_=(ai$1(t.part(),L.paragraphId)?Il:null)??wl(t.part(),L.paragraphId,y,e.editingMode?.()==="suggest");if(_!==null)return e.publishRefusal?.(_),false;let j=new Set(t.paragraphIds()),F=false,H=false;return n(()=>{let V=t.applyTreeOps([...R.ops,{op:"splitParagraph",paragraphId:L.paragraphId,offset:L.offset},{op:"setSectionMark",paragraphId:L.paragraphId,breakType:y}],a(),void 0,{kind:"body"});return F=V.committed,H=V.reason==="locked"||V.reason==="bound",V},()=>{let V=t.paragraphIds().find(B=>!j.has(B));return V?i({paragraphId:V,offset:0}):null}),!F&&H&&e.publishRefusal?.(Pf),F}}}var QS="http://schemas.openxmlformats.org/wordprocessingml/2006/main";function JS(e){return e.kind==="textValue"?false:e.kind==="contentControl"?true:e.kind==="generic"&&e.localName==="sdt"&&e.namespaceUri===QS}function HO(e){return e.kind==="textValue"?false:e.kind==="contentControlContent"?true:e.kind==="generic"&&e.localName==="sdtContent"&&e.namespaceUri===QS}function Rf(e){return e.kind==="textValue"?[]:e.children}function ew(e,t=0){if(e.kind==="textValue")return e.value;if(t>=la$1||e.kind==="deletedText"||_O(e.kind)||de(e)||e.kind==="runProperties"||e.kind==="generic"&&!na$1(e)&&!JS(e))return "";if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return Xd(e);let n=ma(e,t),r="";for(let o of e.children)r+=ew(o,n);return r}function _O(e){return e==="revisionDelete"||e==="revisionMoveFrom"}function Ef(e,t,n){if(!(t>=la$1))for(let r of e){if(r.kind==="hyperlink"){ma(r,t)<la$1&&n(r,t);continue}if(na$1(r)){Ef(Rf(r),ma(r,t),n);continue}if(JS(r)){for(let o of Rf(r))HO(o)&&Ef(Rf(o),ma(r,t),n);continue}n(r,t);}}function US(e,t,n){let r=BO(e,t);if(!r||r.kind!=="paragraph")return [];let o=Ue(r),a=[],i=0;return Ef(r.children,0,(s,l)=>{let d=o.spanOf(s);if(d&&(i=Math.max(i,d.end)),s.kind!=="hyperlink")return;let u=d?d.start:i,f=d?d.end:i,p=ab$1(s,n);a.push({id:s.id,paragraphId:t,start:u,end:f,text:ew(s,l),kind:p.kind,href:p.href,authored:p.authored,...p.anchor!==void 0?{anchor:p.anchor}:{},...p.tooltip!==void 0?{tooltip:p.tooltip}:{}});}),a}function BO(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 $O(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 qO(e,t){for(let n of K(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 tw(e){let t=()=>e.storyScope(),n=()=>e.session.partFor(t()),r=d=>e.session.relationshipTarget(d,t()),o=(d,u,f)=>e.session.applyTreeOps(d,u,f,t()),a=d=>{let u=n();return u?US(u,d,r):[]},i=()=>$O(a(e.selection().head.paragraphId),e.selection().head),s=()=>{let d=e.selection().head,u=qO(e.layout(),d);return u===null?null:e.fieldLinkById(u)},l=d=>{let u=e.selection().head.paragraphId,f=a(u).find(p=>p.id===d);if(f)return f;for(let p of e.session.storyParts()){let m=h=>Af$1(e.session.currentPackage(),p.name,h);for(let h of yd(p))for(let x of Bd$1(h.root)){let v=x.id,b=US(p,v,m).find(I=>I.id===d);if(b)return b}}return null};return {linksInCaretParagraph:()=>a(e.selection().head.paragraphId),linkAtCaret:i,fieldLinkAtCaret:s,linkById:l,applyHyperlink(d){let u=d.url!==void 0&&d.url.length>0,f=d.anchor!==void 0&&d.anchor.length>0;if(u===f)return false;let p=t();if(!n()||e.refusesWrite())return false;let m;if(u){let y=()=>e.session.ensureHyperlinkRelationship(d.url,p),R=e.withMintActor?e.withMintActor(y):y();if(!R)return false;m=R;}let h={...m!==void 0?{relationshipId:m}:{},...f?{anchor:d.anchor}:{},...d.tooltip!==void 0?{tooltip:d.tooltip}:{}},x=i(),v=e.orderedRange(),b=v.from.paragraphId===v.to.paragraphId&&v.from.offset===v.to.offset;if(x&&(b||ZO(x,v))){let y=[];if(d.text!==void 0&&d.text!==x.text){if(d.text.length===0)return false;let L=e.replacementLanding?.(x.paragraphId,x.start,x.end),_=e.textOf(x.paragraphId).slice(x.start,x.start+2),j=x.start+(_.length===2&&_.charCodeAt(0)>=55296&&_.charCodeAt(0)<=56319&&_.charCodeAt(1)>=56320&&_.charCodeAt(1)<=57343?2:1);if(L!=null&&L>x.start&&j<x.end)y.push({op:"setHyperlinkTarget",linkId:x.id,...h},{op:"deleteText",paragraphId:x.paragraphId,start:x.start,end:x.end},{op:"insertText",paragraphId:x.paragraphId,offset:j,text:d.text});else if(L!=null){let F=GS(e.session);y.push({op:"setHyperlinkTarget",linkId:x.id,...h},...XS(x,L,d.text),{op:"insertHyperlink",paragraphId:x.paragraphId,start:L,end:L+d.text.length,...h,...F?{styleId:F}:{}});}else {let F=YS(x.paragraphId,x.start,x.end,d.text);if(!F)return false;y.push({op:"setHyperlinkTarget",linkId:x.id,...h},...F);}}else y.push({op:"setHyperlinkTarget",linkId:x.id,...h});let R=false;return e.commit(()=>{let L=o(y,e.selectionMark());return R=L.committed,L},()=>null),R}let I=v.from.paragraphId;if(v.to.paragraphId!==I)return false;let k=[],C=v.from.offset,T=v.to.offset;if(b){let y=d.text??d.url??d.anchor??"";if(y.length===0)return false;C=e.insertionLanding?.(I,C)??C,k.push({op:"insertText",paragraphId:I,offset:C,text:y}),T=C+y.length;}else {let y=e.replacementLanding?.(I,C,T);if(y!=null){let R=d.text??e.textOf(I).slice(C,T);if(R.length===0)return false;k.push(...XS({paragraphId:I,start:C,end:T},y,R)),C=y,T=y+R.length;}else if(d.text!==void 0&&d.text!==e.textOf(I).slice(C,T)){let R=YS(I,C,T,d.text);if(!R)return false;k.push(...R),T=C+d.text.length;}}if(T<=C)return false;let A=GS(e.session);k.push({op:"insertHyperlink",paragraphId:I,start:C,end:T,...h,...A?{styleId:A}:{}});let O=false,$={paragraphId:I,offset:T};return e.commit(()=>{let y=o(k,e.selectionMark(),{paragraphId:I,start:T,end:T});return O=y.committed,y},()=>({anchor:$,head:$})),O},removeHyperlink(d){if(!n())return false;let u=d?l(d):i();if(!u)return false;let f=false,p={paragraphId:u.paragraphId,offset:u.end};return e.commit(()=>{let m=o([{op:"removeHyperlink",linkId:u.id}],e.selectionMark());return f=m.committed,m},()=>({anchor:p,head:p})),f}}}function GS(e){for(let t of e.documentStyles())if(t.type==="character"&&t.styleId.toLowerCase()==="hyperlink")return t.styleId;return null}function ZO(e,t){return t.from.paragraphId===e.paragraphId&&t.to.paragraphId===e.paragraphId&&t.from.offset>=e.start&&t.to.offset<=e.end}function XS(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 YS(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 KO="equation replacement and removal are not supported in suggesting mode",nw=new WeakMap;function rw(e,t){let n=Ha(e,t);if(!n||n.kind!=="paragraph")return [];let r=nw.get(n);if(r)return r;let o=[];for(let i of Se(n)){let s=i.node;if(s.kind==="textValue"||s.kind!=="generic"||s.namespaceUri!==rc||s.localName!=="oMath")continue;let l=tc(s);l&&o.push(Object.freeze({id:s.id,paragraphId:t,start:i.start,end:i.end,linear:vc$1(l.expression),fallbackText:l.fallbackText,supported:rn(l.expression)}));}let a=Object.freeze(o);return nw.set(n,a),a}function rn(e){switch(e.kind){case "fallback":return false;case "text":return true;case "row":return e.items.every(rn);case "fraction":return rn(e.numerator)&&rn(e.denominator);case "radical":return rn(e.radicand)&&(e.degree===void 0||rn(e.degree));case "script":return rn(e.base)&&(e.subscript===void 0||rn(e.subscript))&&(e.superscript===void 0||rn(e.superscript));case "nary":return rn(e.body)&&(e.lowerLimit===void 0||rn(e.lowerLimit))&&(e.upperLimit===void 0||rn(e.upperLimit))}}function ow(e,t){return e.find(n=>n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)??null}function aw(e){let t=null,n=i=>{let s=e.pagesLayer.ownerDocument.defaultView;if(!s||!(i instanceof s.Element))return null;let l=i.closest("[data-docx-equation]");return l&&e.pagesLayer.contains(l)?l:null},r=(i,s)=>{let l=e.equationById(i);l&&(e.setSelection({anchor:{paragraphId:l.paragraphId,offset:l.start},head:{paragraphId:l.paragraphId,offset:l.end}}),e.onPopover?.({equation:l,rect:s}));},o=i=>{t=null;let s=n(i.target),l=s?.dataset.docxEquation;if(!s||!l)return;let d=s.getBoundingClientRect();t={equationId:l,rect:{left:d.left,top:d.top,right:d.right,bottom:d.bottom}};},a=i=>{let s=n(i.target),l=s?.dataset.docxEquation,d=t;if(t=null,!s||!l){if(!d)return;i.preventDefault(),r(d.equationId,d.rect);return}let u=s.getBoundingClientRect();i.preventDefault(),r(l,{left:u.left,top:u.top,right:u.right,bottom:u.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 iw(e){let t=()=>e.session.partFor(e.storyScope()),n=l=>{let d=t();return d?rw(d,l):[]},r=()=>{let l=e.selection().head;return ow(n(l.paragraphId),l)},o=l=>{let d=n(e.selection().head.paragraphId).find(u=>u.id===l);if(d)return d;for(let u of e.session.storyParts()){let f=Ha(u,l);if(!f||f.kind!=="generic"||f.namespaceUri!==rc||f.localName!=="oMath")continue;let p=f;for(;p&&p.kind!=="paragraph";)p=Ia(u,p.id);return !p||p.kind!=="paragraph"?null:rw(u,p.id).find(m=>m.id===l)??null}return null},a=(l,d)=>{let u=false,f={paragraphId:l.paragraphId,offset:l.start};return e.commit(()=>{let p=e.session.applyTreeOps([d],e.selectionMark(),{paragraphId:f.paragraphId,start:f.offset,end:f.offset},e.storyScope());return u=p.committed,p},()=>({anchor:f,head:f})),u},i=(l,d)=>{let u=o(l);if(!u)return {ok:false,code:"notFound",reason:"no equation with that id"};if(e.editingMode()==="suggest")return {ok:false,code:"unsupported",reason:KO};let f=d==="replace"?{op:"setMathEquation",equationId:l,linear:u.linear}:{op:"removeMathEquation",equationId:l},p=e.writeRefusal(f);return p===null?{ok:true}:{ok:false,code:"locked",reason:p}},s=l=>(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:l.reason})),false);return {equationsInCaretParagraph:()=>[...n(e.selection().head.paragraphId)],equationAtCaret:r,equationById:o,can:i,applyEquation(l,d){let u=o(l);if(!u)return false;let f=i(l,"replace");return f.ok?u.supported&&u.linear===d?true:a(u,{op:"setMathEquation",equationId:l,linear:d}):s(f)},removeEquation(l){let d=o(l);if(!d)return false;let u=i(l,"remove");return u.ok?a(d,{op:"removeMathEquation",equationId:l}):s(u)}}}var VO=24;function sw(e){let{pagesLayer:t}=e,n=t.ownerDocument.defaultView;function r(){return e.container.closest(".docx-editor__scroll-container")}let o=p=>{if(!p||p.length===0||p.startsWith("#"))return false;let m=L(p);return !m.ok||!m.href||!n?false:(n.open(m.href,"_blank","noopener,noreferrer"),true)},a=p=>{if(e.enterStoryFor&&!e.enterStoryFor(p.paragraphId))return false;let m=e.layout(),h=ne(m,p);if(!h)return false;let x=m.pages[h.pageIndex];if(!x)return false;let v=x.box.y+(x.contentBox.y-x.box.y)+h.y,b=r();return b&&(b.scrollTop=Math.max(0,v*e.scale()-VO),e.onScrolled?.()),e.setSelection(p),true},i=p=>{let m=e.bookmarks().get(p);return m?a(m):false},s=null;function l(p){if(!p||p.closest("[data-docx-hf]"))return null;let m=p.closest("a.docx-hyperlink");if(m){let x=m.dataset.docxLink;return x?{linkId:x,drawing:false}:null}let h=p.closest("[data-docx-drawing-link]");if(h){let x=h.dataset.docxDrawingLink;return x?{linkId:x,drawing:true}:null}return null}let d=p=>{s=null;let m=p.target,h=l(m);if(!h)return;let v=m.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();s={linkId:h.linkId,drawing:h.drawing,rect:{left:v.left,top:v.top,bottom:v.bottom,right:v.right}};},u=p=>{let m=p.target,h=l(m);if(!h){let b=s;if(s=null,!b)return;p.preventDefault(),f(b.linkId,b.rect,p,b.drawing);return}s=null,p.preventDefault();let v=m.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();f(h.linkId,{left:v.left,top:v.top,bottom:v.bottom,right:v.right},p,h.drawing);};function f(p,m,h,x){let v=x?e.drawingLinkById?.(p)??null:e.linkById(p);if(!v)return;if(h.metaKey||h.ctrlKey){v.kind==="external"?o(v.href):v.anchor&&i(v.anchor);return}if(e.isCollapsedSelection()){if(v.kind==="internal"){v.anchor&&i(v.anchor);return}e.onPopover?.({link:v,rect:m});}}return t.addEventListener("pointerdown",d,true),t.addEventListener("click",u),{goToPosition:a,goToBookmark:i,openExternal:o,destroy(){t.removeEventListener("pointerdown",d,true),t.removeEventListener("click",u);}}}function zO(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 Of(e,t){return e.drawingNodeId!==t?null:zO(e)}function lw(e,t){if(!e)return null;for(let n of e.anchoredDrawings??[]){let r=Of(n,t);if(r)return r}return null}function jO(e,t){for(let r of e.anchoredDrawings??[]){let o=Of(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 l=cw(s,t);if(l)return l}continue}let o=dw(r,t);if(o)return o}let n=lw(e.header,t);return n||lw(e.footer,t)}function dw(e,t){for(let n of e.lines)for(let r of n.drawings??[]){let o=Of(r,t);if(o)return o}return null}function cw(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=cw(o,t);if(a)return a}return null}return dw(e,t)}function uw(e,t){for(let n of e.pages){let r=jO(n,t);if(r)return r}return null}var Tl=24;function fw(e){let t=null,n=false;return {without(r){let o=n;n=true;try{return r()}finally{n=o;}},follow(r,o){let a=n?"none":o;if(e.storyScopeOpen())return;let i=e.selection();if(!(i.anchor.paragraphId===i.head.paragraphId&&i.anchor.offset===i.head.offset)&&a!=="head")return;let l=e.pagesLayer.ownerDocument.activeElement;if(l!==e.pagesLayer&&(!l||!e.pagesLayer.contains(l)))return;let d=e.preferredPageIndex(),u=e.layout(),f=ne(u,i.head,{measurer:e.measurer(),...d!==void 0?{preferredPageIndex:d}:{}});if(!f)return;let p=t!==null&&t!==f.pageIndex;if(t=f.pageIndex,a==="none"||!r&&!p)return;let m=u.pages[f.pageIndex],h=e.scroller();if(!m||!h||h.clientHeight<=0)return;let x=e.scale(),v=m.contentBox.y-m.box.y,b=(m.box.y+v+f.y)*x+e.container.offsetTop,I=b+f.height*x,k=h.scrollTop,C=k+h.clientHeight,T=k;if(b<k+Tl)T=b-Tl;else if(I>C-Tl)T=I+Tl-h.clientHeight;else return;let A=Math.max(0,h.scrollHeight-h.clientHeight),O=Math.max(0,Math.min(T,A));Math.abs(O-h.scrollTop)<.5||(h.scrollTop=O,e.scheduleRematerialize());}}}function pw(e,t){let n=[],r=i=>{for(let s of i){if(s.kind==="paragraph"){n.push({id:s.id,length:Ue(s).length});continue}if(s.kind==="textValue")continue;if(s.kind==="contentControl"){r(t.contentChildrenOf(s));continue}r(s.children);}};if(r(t.contentChildrenOf(e)),n.length>0){let i=n[0],s=n[n.length-1];return {anchor:{paragraphId:i.id,offset:0},head:{paragraphId:s.id,offset:s.length}}}let o=null,a=i=>{for(let s of i){if(s.kind==="paragraph"){let l=Ue(s).spanOf(e);if(!l)continue;return o={anchor:{paragraphId:s.id,offset:l.start},head:{paragraphId:s.id,offset:l.end}},true}if(s.kind!=="textValue"&&a(s.children))return true}return false};return a(t.searchRoots()),o}function mw(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 pi="the document is open for viewing",Mf="image changes are not supported in suggesting mode",gw="tracked changes need a non-empty author";function hw(e){function t(){return {committed:false,rejected:true,opCount:0,reason:pi}}function n(){return {committed:false,rejected:true,opCount:0,reason:Mf}}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:pi};if(e.editingMode()==="suggest")return {ok:false,reason:"invalidArgs",detail:Mf};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:pi};let o=e.editingMode()==="suggest",a=e.author();if(o&&(a===void 0||a===""))return {ok:false,reason:"invalidArgs",detail:gw};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:pi});let o=e.editingMode()==="suggest",a=e.author();if(o&&(a===void 0||a===""))return Promise.resolve({ok:false,reason:"invalidArgs",detail:gw});let i=e.actorId();return e.session.insertImage(e.storyScope(),{...r,decodePort:e.decodePort(),...o?{revision:{author:a,date:e.trackedDate()}}:{},...i?{actorId:i}:{}})},replaceImage(r,o,a,i){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:pi});if(e.editingMode()==="suggest")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Mf});let s=e.actorId();return e.session.replaceImage(e.storyScope(),r,o,a,e.decodePort(),{...i,commitGuard:()=>e.editingMode()==="edit"&&i.commitGuard?.()!==false,...s?{actorId:s}:{}})}}}function yw(e){let t=null,n=null,r="",o=()=>{let d=e.session.part(),u=e.revisionDisplayMode(),f=e.revisionAuthorFilter();return {sections:cc$1(d,u,f),sourceIndexes:dc$1(d,u,f)}},a=d=>{let{sourceIndexes:u}=o(),f=u.indexOf(d);if(f!==-1)return f;let p=u.findIndex(m=>m>d);return p===-1?Math.max(0,u.length-1):p},i=()=>{if(!t)return;let d=hb(e.layout(),t,e.materializedPages?.());d!==t.pageIndex&&(t={...t,pageIndex:d,sectionIndex:e.sectionAtPage(d).sectionIndex});},s=d=>{if(e.entryRefused?.()===true&&t?.scope.rId!==d.rId||!d.rId||e.session.partFor({kind:"headerFooter",rId:d.rId})===null)return false;t?.scope.rId!==d.rId&&e.leaveOtherStories?.();let u=e.layout(),f=pb(u,d.rId),p=t,m=p?.scope.rId===d.rId,h=f?null:WO(e.session,d.rId);if(!f&&!h)return false;let x=d.pageIndex??(m&&p?p.pageIndex:f?.pageIndex??0),v=d.kind??(m&&p?p.kind:f?.kind??h.kind),b=d.variant??(m&&p?p.variant:f?.story.variant??h.variant),I=m&&p?p.partName:f?.story.partName??h.partName,k=u.pages[x]??u.pages[f?.pageIndex??0],C=(k?Po(k,{scope:{kind:"headerFooter",rId:d.rId},kind:v,partName:I}):null)??f?.story??{scope:{rId:d.rId},variant:b,partName:I},T=e.selection(),A=p?p.savedBodySelection:{anchor:{...T.anchor},head:{...T.head}},O=m&&p?.sectionIndex!==void 0&&x===p.pageIndex,$=d.sectionIndex??(O?p.sectionIndex:f?e.sectionAtPage(x).sectionIndex:h?a(h.sectionIndex):void 0);t={scope:{kind:"headerFooter",rId:d.rId},pageIndex:x,...$!==void 0?{sectionIndex:$}:{},kind:v,variant:C.variant,partName:C.partName,savedBodySelection:A};let R=e.session.paragraphIdsIn(Cs(t))[0];if(!R)return t=null,false;let L=d.position?Rs(u,{anchor:d.position,head:d.position},t):m?Rs(u,T,t):{anchor:{paragraphId:R,offset:0},head:{paragraphId:R,offset:0}};return e.setScopeSelection(L),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify(),true},l=()=>{if(!t)return;let d=t.savedBodySelection;t=null,e.setScopeSelection(Rs(e.layout(),d,null)),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify();};return {getActive:()=>t,activeScope:()=>fb(t),setActiveScope(d){return d.kind==="body"?(l(),true):d.kind==="headerFooter"?s({rId:d.rId}):false},enterHeaderFooter:s,exitHeaderFooter:l,reconcileOccurrence:i,headerFooterState(){if(!t)return null;let d=e.session.headerFooterResolutionBySection(),u=t.sectionIndex??0,f=o(),p,m,h,x=k=>{let C=f.sourceIndexes[k]??k,T=d[C];if(!T)return false;let O=(t.kind==="header"?T.headers:T.footers).get(t.variant);return !O||O.rId!==t.scope.rId?false:(u=k,p=O.inherited,m=T.titlePage,h=T.evenAndOddHeaders,true)};if(!(t.sectionIndex!==void 0&&x(t.sectionIndex))){let k;d.forEach((C,T)=>{let O=(t.kind==="header"?C.headers:C.footers).get(t.variant);!O||O.rId!==t.scope.rId||!(k===void 0||k&&!O.inherited||k===O.inherited&&a(T)<u)||(u=a(T),p=O.inherited,m=C.titlePage,h=C.evenAndOddHeaders,k=O.inherited);});}let v=f.sections[u]?.properties??f.sections.at(-1)?.properties,b=v?.margins.headerTwips,I=v?.margins.footerTwips;return {editing:t.kind,sectionIndex:u,variant:t.variant,rId:t.scope.rId,partName:t.partName,...p!==void 0?{inherited:p}:{},...m!==void 0?{titlePage:m}:{},...h!==void 0?{evenAndOddHeaders:h}:{},...b!==void 0?{headerDistanceTwips:b}:{},...I!==void 0?{footerDistanceTwips:I}:{}}},headerFooterStateStable(d){if(!t)return n=null,r="",null;let u=this.headerFooterState();if(!u)return null;let f=[d,u.editing,u.sectionIndex,u.variant??"",u.rId??"",u.partName??"",String(u.inherited),String(u.titlePage),String(u.evenAndOddHeaders),String(u.headerDistanceTwips??""),String(u.footerDistanceTwips??"")].join("|");return n&&r===f||(n=Object.freeze({...u}),r=f),n}}}function bw(e){return e.length>0&&e.every(t=>t.op==="setDocumentProtection")}function WO(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,l]of i)if(l.rId===t)return {sectionIndex:r,kind:a,variant:s,partName:l.partName}}}return null}function xw(e){let t=null,n=null,r=null,o=(i,s)=>(e.setLastRejection(null),e.commit(()=>{let l=e.applyOps(Array.isArray(i)?i:[i],e.selectionMark());return l.rejected&&e.setLastRejection(String(l.reason??"rejected")),l},s),e.lastRejection()===null),a=(i,s,l)=>{let d=$c$1(i);if(!d)return e.setLastRejection("invalid note scope id"),false;let u=e.session.currentPackage(),f=Wf$1(u,d.noteKind),p=f?vd(f.root,d.noteId):null;if(!f||!p)return e.setLastRejection("note not found"),false;if(e.exitHeaderFooter?.(),e.activeScope().kind==="body"){let m=e.selection();r={anchor:{paragraphId:m.anchor.paragraphId,offset:m.anchor.offset},head:{paragraphId:m.head.paragraphId,offset:m.head.offset}};}if(t={kind:"note",id:_c$1(d.noteKind,d.noteId)},n=Number.isInteger(l)?l:null,s)e.setSelection({anchor:s,head:s});else {let m=UO(p),h=new Set(e.session.paragraphIdsIn({kind:"notesPart",noteKind:d.noteKind})),x=m.find(v=>h.has(v.id));if(x){let v=GO(x);e.setSelection({anchor:{paragraphId:x.id,offset:v},head:{paragraphId:x.id,offset:v}});}}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(),l=s.collapseTo;if(!(s.ops.length===0||o(s.ops,()=>({anchor:{...l},head:{...l}}))))return false;let u=vw(e.session.currentPackage(),i);if(!o({op:"insertNote",noteKind:i,paragraphId:l.paragraphId,offset:l.offset},()=>{let h={paragraphId:l.paragraphId,offset:l.offset+1};return {anchor:h,head:h}}))return s.ops.length>0&&e.undo(),false;let m=[...vw(e.session.currentPackage(),i)].find(h=>!u.has(h));return m===void 0?true:a(_c$1(i,m))},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 UO(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 GO(e){let t=Se(e)[0];return t&&ed$1(t.node)?t.end:0}function vw(e,t){let n=Wf$1(e,t),r=new Set;if(!n)return r;for(let o of td$1(n.root)){if(!kd(o))continue;let a=id$1(o);a!==null&&r.add(a);}return r}var XO=500;function YO(e,t,n,r){let o=e.part(),a=Ha$2(o,n,r),i=$b$1(o);return t.map((s,l)=>{let d=s.blockStart<s.blockEndExclusive?a[s.blockEndExclusive-1]:void 0,u=d?.kind==="paragraph"?ac$1(d):void 0;return u||(l===t.length-1&&i?.kind!=="textValue"?i:void 0)})}function Sw(e,t){if(!e)return null;let n=e.session,r=X(e.revisionDisplayMode()),o=e.state().selection.head.paragraphId,a=fi(n,o,e.activeScope().kind==="headerFooter"?{kind:"headerFooter",rId:e.headerFooterState()?.rId??""}:ft(n,o,{kind:"body"}),e.headerFooterState()?.sectionIndex,r,t),i=n.currentPackage(),s=Lf$1(i),l=Mf$1(s),d=Nf$1(s),u=cc$1(n.part(),r,t),f=YO(n,u,r,t),p=Jf(f[a]),m=Kf$1(f[a]),h=Of$1(p,l),x=Pf$1(m,d);return {sectionIndex:a,footnote:{resolved:h,...l?{documentAuthored:l}:{},...p?{sectionAuthored:p}:{}},endnote:{resolved:x,...d?{documentAuthored:d}:{},...m?{sectionAuthored:m}:{}}}}function ww(e,t){let n=$c$1(t);if(!n)return null;let r=Wf$1(e.currentPackage(),n.noteKind);if(!r)return null;let o=r,a=vd(o.root,n.noteId);if(!a)return null;let i=[],s=XO,l=(u,f)=>{if(!(f>32||s<=0)){if(u.kind==="paragraph"&&typeof u.id=="string"){let p=(Pi(o,u.id)??"").replace(/\uFFFC/g,"").trim();if(p){let m=p.slice(0,s);i.push(m),s-=m.length;}return}if(u.kind!=="textValue")for(let p of u.children)l(p,f+1);}};l(a,0);let d=i.filter(Boolean).join(" ").trim();return d.length>0?d:null}function Iw(e){return [()=>{Ib$1(e().root);},()=>{fi$1(e());},()=>{Th(e());}]}var QO=50,JO=16;function kw(e){let t=e.schedule??((s,l)=>{let d=setTimeout(s,l);return ()=>clearTimeout(d)}),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>QO)return;i(JO);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;}}var Xn=null;function mi(e,t,n){let r=Xn;Xn=t===void 0?null:{owner:e,group:t};try{return n()}finally{Xn=r;}}function e1(e){if(Xn===null||Xn.owner!==e)return;let{group:t}=Xn;return Xn=null,t}function t1(e,t){Xn===null&&(Xn={owner:e,group:t});}var Pl=class{current;get value(){return this.current}around(t,n,r){let o=this.current,a=e1(t);this.current=a;let i;try{i=n();}finally{this.current=o;}return a!==void 0&&!r(i)&&t1(t,a),i}};var n1=new Set(["comment-add","comment-delete","comment-reply","comment-resolve","package-scoped","revision-resolve"]);function Tw(e,t){let n=e.setScale;return typeof n!="function"?false:n.call(e,t)}function Ff(e$1,t,n$1={}){let r=n$1,o$1=j(t,n$1.reviewModel?{reviewModel:n$1.reviewModel}:{});if(!o$1.ok)return {ok:false,reason:o$1.reason,...o$1.detail?{detail:o$1.detail}:{}};let a=o$1.session,i=n$1.collaborationModel?.session,s=n$1.author,l$1=n$1.scale??96/72,d={resolve:n$1.tableInteractionLabel??(c=>Eu(c))},u="the document is open for viewing",f$1="the table of contents is generated and read-only",p="\0range\0",m=()=>`${new Date().toISOString().slice(0,19)}Z`,h$1=n$1.measurer?null:da(l$1,{context:Ao(e$1.ownerDocument),...n$1.fontAlias?{fontAlias:n$1.fontAlias}:{}}),x=n$1.measurer??h$1.measurer,v=La(),b=Yd();function I(){return n$1.measurer?n$1.producer??"host-measurer":`${n$1.producer??h$1?.producer??"fixed-measurer"}@scale:${l$1}`}let k=I(),C$1=e$1.ownerDocument,T=C$1.createElement("div");T.className="docx-pages",T.style.position="relative",T.contentEditable="true",T.spellcheck=false,T.setAttribute("role","textbox"),T.setAttribute("aria-multiline","true"),T.style.outline="none";let A=C$1.createElement("div");A.className="docx-selection-overlay",A.contentEditable="false",A.setAttribute("aria-hidden","true"),A.style.position="absolute",A.style.left="0",A.style.top="0",A.style.pointerEvents="none";let O=C$1.createElement("div");O.className="docx-comment-overlay",O.contentEditable="false",O.setAttribute("aria-hidden","true"),O.style.position="absolute",O.style.left="0",O.style.top="0",O.style.pointerEvents="none";let $=C$1.createElement("div");$.className="docx-remote-selection-overlay",$.contentEditable="false",$.setAttribute("aria-hidden","true"),$.style.position="absolute",$.style.left="0",$.style.top="0",$.style.pointerEvents="none";let y=C$1.createElement("div");y.className="docx-table-furniture",y.contentEditable="false",y.style.position="absolute",y.style.left="0",y.style.top="0",y.style.pointerEvents="none",e$1.style.position="relative",e$1.replaceChildren(T,y,O,$,A);let R=wS(T,()=>l$1,()=>{let c=ue?.getActive()??null,g=ve?.activeNoteScope()??null,S=ve?.activeNotePageIndex()??null,P=c?mb(T,c.pageIndex):g?gb(T,g.id,S):null;return {layout:ne$1,selection:F,measurer:x,...ee$1()?{typingStyle:()=>{let N=ki$1.formatting();return N.fontSizeHalfPoints?{fontSizePt:N.fontSizeHalfPoints/2,fontFamily:N.fontFamily,bold:N.bold,italic:N.italic,verticalAlign:N.superscript?"superscript":N.subscript?"subscript":"baseline"}:null}}:{},...c?{preferredPageIndex:c.pageIndex}:S!==null?{preferredPageIndex:S}:Ge.selectionPageIndex()!==void 0?{preferredPageIndex:Ge.selectionPageIndex()}:{},scopedHost:P,...c?{scopedHostKind:"headerFooter"}:g?{scopedHostKind:"note"}:{}}}),L=Fs(a.part()),_=a.paragraphIds(),j$1=_.find(c=>!L.has(c))??_[0]??"",F=r.initialSelection??{anchor:{paragraphId:j$1,offset:0},head:{paragraphId:j$1,offset:0}},H=r.initialDrawingSelectionIntent??{kind:"none"};function V(c,g){c.kind===H.kind&&(c.kind!=="pointer"||H.kind==="pointer"&&c.drawingNodeId===H.drawingNodeId)||(H=c,g&&n$1.onChange?.(nt()));}let B$1=null,X=null;function ae$1(c){return X=c,n$1.onChange?.(nt()),false}let ce=new Pl,xe="suggesting needs an author before it can propose a change",fe$1=false,D=false,M=null,q=new Map;function Z(){M=null;for(let c of q.values())M=c;}function Y(c,g){if(c.paragraphId===g.paragraphId)return c.offset-g.offset;let S=Ce();return S.indexOf(c.paragraphId)-S.indexOf(g.paragraphId)}function E(c){if(!M)return;let{from:g,to:S}=ll(ne$1,M),P=c.head;Y(P,g)>=0&&Y(P,S)<=0||(q.clear(),M=null);}let K=null;function W(){return ee$1()?.properties??null}function ee$1(){if(!K)return null;let c=K.position,g=S=>S.paragraphId===c.paragraphId&&S.offset===c.offset;return g(F.anchor)&&g(F.head)?K:null}function re(c){if(!K)return;let g=K.position;c.anchor.paragraphId===g.paragraphId&&c.anchor.offset===g.offset&&c.head.paragraphId===g.paragraphId&&c.head.offset===g.offset||(K=null);}function te(c,g,S,P,N){let z=Ue([...c],S,P,Ee(),true,N);return c.length===g.length||!z.rejected?z:Ue([...g],S,P,Ee(),true,N)}function le(c,g,S,P){let N=ee$1()??(Pt(F.head.paragraphId).length===0?{base:[],properties:Ks(Ve(a,F.head.paragraphId)??a.part(),F.head.paragraphId,F.head.offset,pt(),mt())}:null);if(!N||S===0||N.properties.length===0&&N.base.length===0)return [];let z=K?.position??F.head,G=P&&z.paragraphId===c&&z.offset>=P.start&&z.offset<=P.end?{paragraphId:c,offset:id({paragraphId:c,offset:P.start},{paragraphId:c,offset:P.end})}:ae(ne$1,z);return G.paragraphId!==c||G.offset!==g?[]:[{op:"setRunProperties",paragraphId:c,start:g,end:g+S,properties:N.properties.reduce((Q,de)=>ta(Q,xa(Q,de)),[...N.base])}]}let ue=null,ve=null,rt=null,Ee=()=>Cs(ue?.getActive()??null,ve?.activeNoteScope()??null),_e=()=>ve?.activeNoteScope()?.id??null,De$1=c=>{let g=b.multi?.spans,S=0,P=0;if(g&&g.length>0)for(let N=0;N<g.length;N+=1){let z=g[N];if(S=N,P=z.startIndex,c<z.startIndex+z.pageCount)break}return {sectionIndex:S,sectionStart:P}},Ce=()=>Co(ne$1,ue?.getActive()??null,_e()),ze$1=()=>globalThis.performance?.now()??Date.now(),Oe=0,Be$1=0,Se=0,{styleCascade:Ae,numberingIndex:St,defaultTabStopPt:Yn,compatibilityMode:Ye}=fS(a),Sr=uS({styleCascade:Ae,partOf:c=>Ve(a,c)??a.part()}),jt=null,wr=n$1.imageDecodePort??vS(C$1)??xS(),kt=Ac$1({session:a,decodePort:wr,onResourcesChanged:()=>jt?.()}),Ir=n$1.drawingStrings??h,On=n$1.tocLabels,vi=()=>F.anchor.paragraphId!==F.head.paragraphId||F.anchor.offset!==F.head.offset?null:{paragraphId:F.head.paragraphId,offset:F.head.offset},Bl=pv(a),xi=SS({mintValidatedBytes:(c,g)=>kt.mintValidatedBytes(c,g)}),on=false,Ot=DS(n$1.revisionDisplayMode,!!n$1.reviewModel,c=>Le.setRevisionDisplayMode(c)),$l=Ot.view,pt=Ot.projection,Si=Ot.changeBars,yn=r.revisionAuthorVisibility??il(n$1.hiddenRevisionAuthors),mt=()=>Ot.filter(yn.filterForSession(a)),wi=c=>{let g=Ve(a,c)??a.part(),S=Ha(g,c);if(S?.kind!=="paragraph")return false;let P=pt(),N=mt();if(!Ea(S,P,N))return true;let z=Ia(g,c);return z?Ga$1(z.children,P,N).some(G=>G.kind==="paragraph"&&G.id===c):false},Ht,qo=sd(a),kr=td(),bn=(c,g=on)=>pS({session:a,measurer:x,producer:k,cache:v,styleCascade:Ae,numberingIndex:St,defaultTabStopPt:Yn,compatibilityMode:Ye,displayMode:pt(),showFieldCodes:g,revisionAuthorFilter:c,inlineDrawingLayoutForPart:S=>kt.contextForPart(S),drawingLayoutTokenForPart:S=>kt.cacheTokenForPart(S),drawingTokenForParagraphForPart:(S,P)=>kt.drawingTokenForParagraph(P,S),linkProjectors:qo,projectFieldLink:S=>kr.project(S)});Ht=bn(mt());let Qn={...a,applyTreeOps:(c,g,S,P)=>Ue(c,g,S,P),ensureListDefinition:c=>Nb$1(i?.identity.actorId,()=>a.ensureListDefinition(c)),applyPmDoc:c=>qe$1==="view"?{committed:false,rejected:true,opCount:0,reason:u}:i?{committed:false,rejected:true,opCount:0,reason:"collaboration-pm-doc-unproven"}:td$1()?{committed:false,rejected:true,opCount:0,reason:f$1}:a.applyPmDoc(c)},ne$1=Fn(),Jn=n$1.revisionStyles,Zo=Ev(n$1.showParagraphMarks??false,Ze,()=>wt(false)),Ko=r.reviewAuthorSlots??e(),er=ox({layout:()=>ne$1,items:()=>a.reviewItems(),styles:()=>Jn,slots:Ko});function Ii(c){if(c===null||c.length===0){if(!K)return;K=null;}else {let{anchor:g,head:S}=F;if(g.paragraphId!==S.paragraphId||g.offset!==S.offset)return;let P=ee$1()?.base??Ks(a.partFor(Ee())??a.part(),S.paragraphId,S.offset,pt(),mt());K={position:S,properties:c,base:P};}R.update(),n$1.onChange?.(nt());}let ki$1=RS({runFormatRefusal:()=>Pn({type:"toggleMark"},Le)?.reason??null,session:Qn,storyScope:Ee,paragraphOrder:Ce,layout:()=>ne$1,selection:()=>F,displayMode:()=>pt(),authorFilter:mt,paragraphMarkVisible:wi,commit:(c,g,S)=>He(c,g,S),orderedRange:()=>ir(),selectionMark:()=>je(),textOf:c=>Pt(c),selectedCells:()=>B$1?.cellIds,defaultParagraphStyleId:()=>Ae()?.defaultParagraphStyleId??null,defaultFontFamily:()=>n$1.defaultFontFamily??null,pendingFormats:()=>W(),setPendingFormats:Ii}),tr=OS({session:Qn,storyScope:Ee,layout:()=>ne$1,selection:()=>F,displayMode:()=>pt(),authorFilter:mt,paragraphMarkVisible:wi,commit:(c,g,S)=>He(c,g,S),orderedRange:()=>ir(),selectionMark:()=>je(),textOf:c=>Pt(c),paragraphOrder:Ce,selectedCells:()=>B$1?.cellIds,armPendingFormats:c=>Ii(c),now:ze$1,publish:()=>{tr.state().mode!=="off"?T.dataset.formatPainter="":delete T.dataset.formatPainter,n$1.onChange?.(nt());}}),to=WS({session:Qn,storyScope:Ee,headerFooterSectionIndex:()=>ue?.getActive()?.sectionIndex,revisionDisplayMode:pt,revisionAuthorFilter:mt,paragraphOrder:Ce,selectedCells:()=>B$1?.cellIds,editingMode:()=>qe$1,publishRefusal:ae$1,caretParagraphId:()=>F.anchor.paragraphId===F.head.paragraphId&&F.anchor.offset===F.head.offset?F.head.paragraphId:null,layout:()=>ne$1,commit:(c,g,S)=>He(c,g,{rearmPending:ee$1()??void 0,...S?.keepCellSelection?{keepCellSelection:true}:{}}),orderedStart:()=>ad(),orderedRange:()=>ir(),selectionMark:()=>je(),collapsedAt:c=>Ke(c),deleteSelectionPlan:()=>Dn(),paragraphTextOf:c=>Pt(c),numberingLevelExists:(c,g)=>xc$1(Lb$1(St(),Ae()),c,g)!==null});function Mn(c,g,S){return qe$1!=="suggest"?null:id({paragraphId:c,offset:g},{paragraphId:c,offset:S})}let Tr=tw({session:Qn,layout:()=>ne$1,fieldLinkById:c=>kr.linkById(c),refusesWrite:()=>rr(true)!==null,withMintActor:c=>Nb$1(i?.identity.actorId,c),storyScope:Ee,replacementLanding:Mn,insertionLanding:(c,g)=>ae(ne$1,{paragraphId:c,offset:g}).offset,selection:()=>F,orderedRange:()=>ir(),selectionMark:()=>je(),textOf:c=>Pt(c),commit:(c,g)=>He(c,g)}),Vo=iw({session:Qn,storyScope:Ee,editingMode:()=>qe$1,writeRefusal:c=>rr(true,[c]),selection:()=>F,selectionMark:()=>je(),commit:(c,g)=>He(c,g)}),Pr=c=>{let g=ft(a,c,{kind:"body"});if(g.kind==="body")return ve?.exitNote(),ue?.exitHeaderFooter(),true;if(g.kind==="headerFooter"){let P=ue?.activeScope();return P?.kind==="headerFooter"&&P.rId===g.rId?true:(ve?.exitNote(),ue?.enterHeaderFooter({rId:g.rId})??false)}let S=Cr(c);return S?ve?.activeNoteScope()?.id===S?true:(ue?.exitHeaderFooter(),ve?.enterNote(S)??false):false},Cr=c=>{for(let g of ne$1.pages)for(let S of [g.footnotes,g.endnotes])if(S){for(let P of S.notes)for(let N of C(P.fragments))if(N.paragraphId===c)return P.scopeId}return null},zo=sw({pagesLayer:T,container:e$1,scale:()=>l$1,layout:()=>ne$1,bookmarks:()=>a.bookmarks(),linkById:c=>kr.linkById(c)??Tr.linkById(c),drawingLinkById:c=>uw(ne$1,c),setSelection:c=>vt(Ke(c)),enterStoryFor:c=>Pr(c),isCollapsedSelection:()=>F.anchor.paragraphId===F.head.paragraphId&&F.anchor.offset===F.head.offset,onScrolled:()=>Ei(),...n$1.onHyperlinkPopover?{onPopover:n$1.onHyperlinkPopover}:{}}),jo=aw({pagesLayer:T,equationById:c=>Vo.equationById(c),setSelection:c=>vt(c,false,"none"),...n$1.onEquationPopover?{onPopover:n$1.onEquationPopover}:{}});T.addEventListener("contextmenu",op),T.addEventListener("click",ap),T.addEventListener("pointermove",Yf),T.addEventListener("pointerleave",Jf);let no=Pv(T),Wt=null;function Rr(c,g,S){let P=S?S.authorFilter:mt(),N=S?.layoutSession??b,z=S?.furnitureSource??Ht;return g&&Jb$1(N,g),kt.sync(a),a$5({view:a,revision:c,measurer:x,cache:v,session:N,producer:k,styleCascade:Ae,defaultTabStopPt:Yn,numberingIndex:St,furniture:z,compatibilityMode:Ye,linkProjectors:qo,projectFieldLink:G=>kr.project(G),inlineDrawingLayout:kt.bodyContext,inlineDrawingLayoutForPart:G=>kt.contextForPart(G),drawingTokenForParagraph:G=>kt.drawingTokenForParagraph(G,a.part().name),drawingTokenForParagraphForPart:(G,Q)=>kt.drawingTokenForParagraph(Q,G),drawingLayoutEpoch:kt.cacheTokenForPart(a.part().name),drawingLayoutEpochForPart:G=>kt.cacheTokenForPart(G),displayMode:pt(),showFieldCodes:S?false:on,revisionAuthorFilter:P})}function Er(){return Rr(a.packageRevision(),void 0,{layoutSession:Yd(),furnitureSource:bn(void 0,false)})}function Fn(){let c=ze$1(),g=Rr(a.packageRevision());return Oe=ze$1()-c,g}let w=null,U=null,J=false;function ye(){if(J)return;J=true;let c=a.packageRevision();U=kw({steps:Iw(()=>a.part()),shouldRun:()=>qe$1!=="view"&&a.editable&&a.packageRevision()===c,hasPendingInput:ge$1});}function ge$1(c=true){return e$1.ownerDocument.defaultView?.navigator?.scheduling?.isInputPending?.({includeContinuous:c})??false}function Pe(){if(!ge$1()){wt(),ye();return}w===null&&(w=setTimeout(()=>{w=null,We.pending()===null&&(wt(),ye());},0));}let Ne="",be$1=null,ie=false;function ke(){if(ie||(be$1!==null&&(clearTimeout(be$1),be$1=null),Ne.length===0))return;let c=Ne;Ne="",ie=true;try{mi(Le,void 0,()=>Le.type(c));}catch(g){throw Ne=c+Ne,g}finally{ie=false;}}function Fe(c){Ne+=c,be$1===null&&(be$1=setTimeout(()=>{be$1=null,ke();},0));}function lt(c,g,S){ke();let P=S?.trim()||s?.trim();if(!P)return ae$1("tracked changes need a non-empty author");if(c!=="deletion"&&g.length===0)return ae$1(`${c} requires non-empty text`);if(c!=="deletion"&&/[\r\n\v\f\u2028\u2029]/.test(g))return ae$1(`${c} requires text without a paragraph mark`);let N={author:P,date:m()},z=ir(),G=z.from.paragraphId===z.to.paragraphId&&z.from.offset===z.to.offset;if(c!=="insertion"&&G&&!(c==="replacement"&&B$1))return ae$1(`${c} needs a non-collapsed selection`);let Q=c==="insertion"?{ops:[],collapseTo:ae(ne$1,z.from)}:Dn(P),de=fp(Q.ops,N,up()),Ie=Q.collapseTo;if(c==="insertion"||c==="replacement"){let se=c==="replacement"?Q.replaceAt??Q.collapseTo:Q.collapseTo;de.push({op:"insertText",paragraphId:se.paragraphId,offset:se.offset,text:g,revision:N}),Ie={paragraphId:se.paragraphId,offset:se.offset+g.length};}let Me=false;return He(()=>{let se=Ue(de,je(),or(Ie));return Me=se.committed,se},()=>Ke(Ie)),Me}let We=qa$1({run:c=>{let g=ze$1(),S=Rr(c.revision,c);return Oe=ze$1()-g,S},currentRevision:()=>a.packageRevision(),schedule:c=>{let g=setTimeout(c,0);return ()=>clearTimeout(g)},publish:c=>{er.releaseLayout(),ne$1=c,Pe();}}),an=false;jt=()=>{We.invalidateAll(a.packageRevision(),"drawing-resources"),!an&&(an=true,setTimeout(()=>{an=false,Re();},0));};let yt=a.subscribe(c=>{Ok(c),K=null,We.notify(c);}),bt=i?a.collaborationPort(i.documentId):null,An=()=>{},Wo=()=>{},ro=false,Or=null,Uo=null,oo=i?i.subscribeRemoteSelections(()=>{ro&&Ai();}):()=>{};function ao(){let c=hS(e$1,ne$1,F,l$1),g=ue?.getActive()?.pageIndex??Ge.selectionPageIndex();return g===void 0||c===void 0||c.has(g)?c:new Set([...c,g])}function Re(){return We.pending()?We.flush():false}let Tt=8;function io(c){!c&&We.pending()!==null&&Oe>Tt&&ge$1(false)||Re()||wt();}function Ze(){ke(),Re();}function vn(){ke();let c=Re();return w!==null?(wt(),ye(),true):c}let sn=null;function Ti(c){return Eb(c,a.part())}function Pi(){for(let c of T.querySelectorAll(".docx-content-control-chrome[data-docx-toc]")){if(c.getAttribute("data-docx-content-control")===sn){c.dataset.hover="",c.dataset.boundaryVisible="";continue}delete c.dataset.hover,fe$1||delete c.dataset.boundaryVisible;}}function so(c){sn!==c&&(sn=c,Pi());}function ql(c){return Ob(a.part(),Qf(c),c.target)}function Yf(c){let g=ql(c);so(g?Ti(g):null);}function Qf(c){let g=c.target,S=g?.isConnected?g.closest("[data-paragraph-id]"):void 0;if(S)return S.dataset.paragraphId;let P=T.ownerDocument;return typeof P.elementFromPoint!="function"?void 0:P.elementFromPoint(c.clientX,c.clientY)?.closest("[data-paragraph-id]")?.dataset.paragraphId}function Jf(){so(null);}function lk(){let c=nr(),g=wd(a.part()),S=Be(a.part()),P=S.map(se=>{let dt=gv(se,ne$1,a.part(),x);return dt?{...dt,empty:g.has(se.beginParagraphId)}:null}).filter(se=>se!==null),N=new Set(P.map(se=>se.boundary.id)),z=new Set(P.filter(se=>se.empty).map(se=>se.boundary.id));for(let se of S)se.contentControlId&&Ti(se)!==se.contentControlId&&z.add(se.contentControlId);let G=c&&!N.has(c.id)?new Set([c.id]):void 0,Q=sn?new Set([sn]):void 0,de=new Set(qe(ne$1).filter(se=>se.controlType==="checkbox"&&Kl(se.id)).map(se=>se.id)),Ie=P.filter(se=>se.additional&&!se.empty).map(se=>se.boundary),Me=cp()!==null;if(!(!fe$1&&!G&&!Q&&!Me&&de.size===0&&Ie.length===0&&N.size===0))return {...Me?{readOnly:true}:{},...fe$1?{showAll:true}:{},...G?{activeIds:G}:{},...Q?{hoverIds:Q}:{},...de.size>0?{checkedIds:de}:{},...Ie.length>0?{additionalBoundaries:Ie}:{},...N.size>0?{tocControlIds:N}:{},...z.size>0?{suppressedIds:z}:{}}}let Go=null;function nr(){let c=Ee();if(c.kind!=="body")return uk(c);if(Go&&Go.layout===ne$1&&Go.selection===F)return Go.result;let g=dk();return Go={layout:ne$1,selection:F,result:g},g}function dk(){let c=Cv(ne$1,F,x);return c&&ck(c.id)===a.part().name?c:null}function ck(c){let g=c.indexOf("#");return g===-1?"":c.slice(0,g)}function uk(c){let g=a.partFor(c);return g?Cd(g,F.head.paragraphId):null}function ep(c){return c.bound?"bound":c.effectiveLock==="contentLocked"||c.effectiveLock==="sdtContentLocked"?"locked":null}function fk(c){return c.effectiveLock==="sdtLocked"||c.effectiveLock==="sdtContentLocked"?"locked":null}function pk(c){return Ed(c)}function xn(c){let g=Ve(a,c),S=Ha(g??a.part(),c);return !S||!pk(S)?null:S}function tp(c){let g=xn(c);if(!g)return null;for(let S of g.children)if(S.kind!=="textValue"&&(S.kind==="contentControlProperties"||S.localName==="sdtPr"))for(let P of S.children){if(P.kind==="textValue"||P.localName!=="tabIndex")continue;let N=P.attributes.find(G=>G.localName==="val")?.value;if(N===void 0)return null;let z=Number(N);return Number.isFinite(z)?z:null}return null}function mk(){let c=Ee(),g=c.kind==="body"?null:a.partFor(c),S=c.kind==="notesPart"?new Set(Ce()):void 0;return (g?[...Bd(g,S)]:[...qe(ne$1)]).filter(N=>ep(N)===null).sort((N,z)=>{let G=tp(N.id),Q=tp(z.id);return G!==null&&Q!==null&&G!==Q?G-Q:G!==null&&Q===null?-1:G===null&&Q!==null?1:0})}function gk(c){for(let g of c.children)if(g.kind!=="textValue"&&(g.kind==="contentControlContent"||g.localName==="sdtContent"))return g.children;return []}function Zl(c){ue?.getActive()||ve?.activeNoteScope()||ft(a,c.paragraphId,{kind:"body"}).kind==="body"&&Le.revealPosition(c);}function hk(c){let g=xn(c);if(!g)return false;let S=pw(g,{contentChildrenOf:gk,searchRoots:()=>(a.partFor(ft(a,c,Ee()))??a.part()).root.children});if(!S)return false;let P=F;return vt(S,false,"none"),(F!==P||Et(F,S))&&Zl(F.anchor),true}let np=c=>dv(xn(c),()=>a.currentPackage());function Kl(c){let g=xn(c);if(!g)return false;for(let S of g.children)if(S.kind!=="textValue"&&!(S.kind!=="contentControlProperties"&&S.localName!=="sdtPr")){for(let P of S.children)if(P.kind==="contentControlCheckbox")for(let N of P.children){if(N.kind!=="contentControlChecked")continue;let z=N.attributes.find(G=>G.localName==="val")?.value;return !(z==="0"||z==="false"||z==="off")}}return false}let rp=c=>cv(xn(c));function Ci(c,g){for(let S of T.querySelectorAll("[data-docx-content-control]"))S.getAttribute("data-docx-content-control")===c&&(g?S.dataset.open="":delete S.dataset.open);}let lo=wv({document:C$1,layer:T,find:xn,layout:()=>ne$1,selectDrawing:(c,g)=>Le.selectDrawing(c,g),allowed:c=>!Ln.disabledReason(c,"edit"),translate:c=>Jo?.(c)??c,replaceImage:(c,g,S,P)=>Le.replaceImage(c,g,S,{expectedPackageRevision:a.packageRevision(),commitGuard:P}),setOpen:Ci,reject:ae$1}),Vl=lv({find:xn,allowed:c=>!Ln.disabledReason(c,"edit"),apply:(c,g)=>Ln.setValue(c,g),items:np,date:rp,checked:Kl,picture:lo.drawingOf,replaceImage:lo.replace,locale:()=>Mi.get(),layer:T,setOpen:Ci,request:n$1.onRequestContentControlWidget}),Ri=null,zl;function jl(c){Ri===c&&(Ri=null,zl?.(),zl=void 0);let g=c.dataset.docxCcId,S=c.contains(C$1.activeElement);c.remove(),g&&Ci(g,false),S&&T.focus({preventScroll:true});}function Wl(){Vl.cancel();let c=Ri;return c&&jl(c),c}function op(c){let g=ql(c);yk(g&&od(g.id)?g.id:null);}let Xo=null;function yk(c){Xo!==c&&(Xo=c,n$1.onChange?.(nt()));}function ap(c){if(c.button!==0||c.target?.closest("a.docx-hyperlink")||F.anchor.paragraphId!==F.head.paragraphId||F.anchor.offset!==F.head.offset)return;let g=Qf(c);if(!g)return;let S=Be(a.part()).find(z=>z.resultParagraphIds.includes(g));if(!S||ql(c)?.id!==S.id)return;let N=lf$1(a.part(),S,a.documentOutline(),nd(S))[S.resultParagraphIds.indexOf(g)];N&&(c.preventDefault(),zo.goToPosition({paragraphId:N,offset:0}));}let ip={document:C$1,locale:()=>Mi.get(),translate:c=>Jo?.(c)??c,setValue:(c,g)=>Ln.setValue(c,g),close:c=>jl(c)};function bk(c,g){let S=Ln.disabledReason(c,"edit");if(S){X=S,n$1.onChange?.(nt());return}if(lo.cancel(),Wl()?.dataset.docxCcId===c||(g==="picture"&&lo.select(c),Vl.open(c,g)))return;if(g==="picture")return lo.pick(c);if(g==="checkbox"){Ln.setValue(c,Kl(c)?"false":"true");return}let P=qe(ne$1).find(z=>z.id===c)?.alias,N;if(g==="dropdown"||g==="comboBox"||g==="buildingBlockGallery"){let z=np(c);if(z.length===0&&g==="dropdown")return;N=jv(ip,c,g,z,P,Nu(xn(c),z));}else if(g==="date")N=Wv(ip,c,rp(c),P);else return;Ri=N,zv(N,T,av(ne$1,l$1,c,T,ot?.pageOffsetX)),Ci(c,true),zl=Ws(N,()=>jl(N)),g==="date"?ol(N):(N.querySelector("input")??N.querySelector('[role=option][tabindex="0"]')??N.querySelector("button,[data-docx-part=empty]"))?.focus({preventScroll:true});}let Ln={setShowAll(c){fe$1!==c&&(fe$1=c,wt());},setFormFill(c){D!==c&&(D=c,n$1.onChange?.(nt()));},showAll:()=>fe$1,formFill:()=>D,atCaret:()=>nr(),navigate(c){let g=mk();if(g.length===0)return false;let S=nr(),P=S?g.findIndex(z=>z.id===S.id):-1;c==="next"?P=P<0?0:(P+1)%g.length:P=P<0?g.length-1:(P-1+g.length)%g.length;let N=g[P];return hk(N.id)},setValue(c,g){let S=Ln.disabledReason(c,"edit");if(S)return ae$1(S);let P=fv(xn(c),()=>a.currentPackage(),c,g);if(!P)return ae$1("unknown-building-block");let N=false;return He(()=>{let z=Ue(P,je(),void 0,ft(a,c,Ee()),false);return N=z.committed,z}),N},remove(c){let g=c??nr()?.id;if(!g)return ae$1("notFound");let S=Ln.disabledReason(g,"remove");if(S)return ae$1(S);let P=false;return He(()=>{let N=Ue([{op:"removeContentControl",controlId:g}],je(),void 0,ft(a,g,Ee()),false);return P=N.committed,N}),P},disabledReason(c,g){let S=cp();if(S!==null)return S;let P=qe(ne$1).find(z=>z.id===c);if(P)return g==="remove"?fk(P):ep(P);let N=xn(c);if(!N)return "notFound";for(let z of N.children)if(z.kind!=="textValue"&&!(z.kind!=="contentControlProperties"&&z.localName!=="sdtPr")){if(z.children.some(G=>G.kind!=="textValue"&&G.localName==="dataBinding")&&g==="edit")return "bound";for(let G of z.children){if(G.kind==="textValue"||G.localName!=="lock")continue;let Q=G.attributes.find(de=>de.localName==="val")?.value;if(g==="remove"){if(Q==="sdtLocked"||Q==="sdtContentLocked")return "locked"}else if(Q==="contentLocked"||Q==="sdtContentLocked")return "locked"}}return null}};function Ul(){let c=lp&&qe$1!=="view";T.contentEditable=c?"true":"false",T.setAttribute("aria-readonly",c?"false":"true");}function nt(){return {revision:a.packageRevision(),pageCount:ne$1.pages.length,selection:F,cellSelection:B$1,canUndo:i?.canUndo()??a.canUndo(),canRedo:i?.canRedo()??a.canRedo(),collaborationStatus:i?.status()??"inactive",lastRejection:X,pendingFormat:W(),contentControls:{showAll:fe$1,formFill:D,activeControlId:nr()?.id??null},contextTocId:Xo,formatPainter:tr.state(),perf:{layoutMs:Oe,paintMs:Be$1,selectionMs:Se,placed:b.stats.placed,total:b.stats.total,reusedPages:b.stats.reusedPages,fullPasses:b.stats.fullPasses,staleDiscards:We.staleDiscards,cancelledRuns:We.cancelledRuns}}}let _t,ot,Yo=false,Qo=null,Gl=null;function vk(c){for(let g of ne$1.pages){let S=T.children.item(g.index);if(S?.dataset.pageIndex!==String(g.index))continue;let P=c.pageOffsetX.get(g.index)??0;S.style.left=`${(g.box.x+P)*l$1}px`;}}function wt(c=true){w!==null&&(clearTimeout(w),w=null,c=true);let g=Ge.adoptBeforePaint(),S=ze$1();_t=ao(),ue?.reconcileOccurrence();let P=ue?.getActive()??null,N=lk(),z=wd(a.part());n(T,ne$1,{scale:l$1,readOnlyParagraphIds:Fs(a.part()),...z.size>0?{emptyTocPlaceholderIds:z}:{},...n$1.fontAlias?{fontAlias:n$1.fontAlias}:{},...n$1.defaultFontFamily?{defaultFontFamily:n$1.defaultFontFamily}:{},materialize:_t,ariaHidden:false,drawingStrings:Ir,...n$1.fieldShading?{fieldShading:n$1.fieldShading}:{},...Jn!==void 0?{revisionStyles:Jn}:{},shadeFormFields:Bl(),showParagraphMarks:Zo.get(),changeBars:Si(),changeBarsToggle:!!n$1.reviewModel,...xi?{imageUrlPort:xi}:{},...P?{activeHeaderFooterRId:P.scope.rId,activeHeaderFooterPageIndex:P.pageIndex}:{},...N?{contentControlChrome:N}:{}},er.get().value),Uu(T,vi(),{domReplaced:true}),bb(e$1,T,P!=null),Hc(e$1,qe$1),ot=yl(ne$1,_t),vk(ot),T.style.width=`${ot.width*l$1}px`,T.style.height=`${ot.height*l$1}px`,e$1.style.width=`${ot.width*l$1}px`,e$1.style.height=`${ot.height*l$1}px`,A.style.width=`${ot.width*l$1}px`,A.style.height=`${ot.height*l$1}px`,O.style.width=A.style.width,O.style.height=A.style.height,$.style.width=A.style.width,$.style.height=A.style.height,y.style.width=A.style.width,y.style.height=A.style.height,ca.update(),Be$1=ze$1()-S,ia(),Ai(),uo(true),Zp(),Ge.mirrorToDom(),sp(Yo),Yo=false,(c||g)&&n$1.onChange?.(nt());}function Ei(){Ze();let c=ao(),g=yl(ne$1,c);ot&&pf(c,_t)&&yS(g,ot)||wt(false);}let Xl=fw({storyScopeOpen:()=>!!(ue?.getActive()||ve?.activeNoteScope()),selection:()=>F,layout:()=>ne$1,measurer:()=>x,preferredPageIndex:()=>Ge.selectionPageIndex(),pagesLayer:T,container:e$1,scroller:()=>zt(e$1),scale:()=>l$1,scheduleRematerialize:()=>dd()});function sp(c=false,g="caret"){Xl.follow(c,g);}let qe$1=n$1.editingMode??"edit",lp=true,Oi=Object.freeze({kind:"body"}),dp=0,Mi=$v(n$1.locale,ke),Jo=n$1.translate,at=null,Fi=null,Yl=null;function Ue(c,g,S,P=Ee(),N=true,z){ke();let G=rr(c.some(xk)||!!z?.length,c,N);if(G!==null)return {committed:false,rejected:true,opCount:0,reason:G};let Q=wk(N&&at?at.annotate(c):c),de=ea(Q,g,S,P,z);return N&&at?.afterApply(de.committed),de.committed&&Q.some(ju)&&r.onTrackedChange?.(),de}function ea(c,g,S,P=Ee(),N){let z=i?.gateOperations(c,P);if(z)return {committed:false,rejected:true,opCount:0,reason:z};dp+=1;let G=ce.value;return a.applyTreeOps(c,g,S,P,i?{packageEdits:N,origin:b$2.mutationHuman,actorId:i.identity.actorId,operationId:`${i.identity.actorId}:${i.sessionId}:browser:${dp}`,recordsHistory:false,historyGroup:G}:{packageEdits:N,historyGroup:G})}function rr(c,g=[],S=true){let P=bw(g);return qe$1==="view"&&!P?u:on&&c&&S&&!P&&mv(N=>Ve(a,N),F)?Us:c&&!P&&(S&&td$1()||g.some(N=>Lk(N)))?f$1:qe$1==="suggest"&&!s?.trim()&&c?xe:qe$1==="suggest"&&g.some(N=>N.op==="deleteNote")?"suggesting cannot delete a note outright; strike its reference to propose the deletion":null}let cp=s0(()=>rr(true,[],false),()=>a.editable);function xk(c){return c.op!=="acceptRevision"&&c.op!=="rejectRevision"&&c.op!=="acceptAllRevisions"&&c.op!=="rejectAllRevisions"}let Sk=c=>Lh.has(c),up=()=>!a.trackingSettings().doNotTrackFormatting;function fp(c,g,S){return c.flatMap(P=>zu(P)?!S&&Sk(P.op)?[P]:[P.revision!==void 0?P:{...P,revision:g}]:P.op==="splitParagraphMany"?[{...P,revision:g}]:P.op==="splitParagraph"?[P,{op:"setParagraphMarkRevision",paragraphId:P.paragraphId,kind:"ins",revision:g}]:P.op==="joinParagraphs"?[{op:"proposeParagraphMerge",paragraphId:P.secondId,revision:g}]:[P])}function Ql(){let c=s?.trim();return qe$1==="suggest"&&c?c:void 0}function wk(c){let g=Ql();return g===void 0?[...c]:fp(c,{author:g,date:m()},up())}function Ik(c,g,S){let P=Pt(g);if(P===S)return c;let N=0;for(;N<S.length&&N<P.length&&S[N]===P[N];)N+=1;let z=0;for(;z<S.length-N&&z<P.length-N&&S[S.length-1-z]===P[P.length-1-z];)z+=1;let G=P.length-S.length,Q=de=>de.paragraphId!==g||de.offset<=N?de:de.offset>=S.length-z?{...de,offset:de.offset+G}:{...de,offset:N};return {anchor:Q(c.anchor),head:Q(c.head)}}function kk(c,g){let S=a.partFor(Ee())??a.part(),P=Ia(S,c),N=Ia(S,g);return P!==null&&N!==null&&P.id===N.id}function or(c){return {paragraphId:c.paragraphId,start:c.offset,end:c.offset}}function He(...c){let g=Dv(e$1);try{Tk(...c);}finally{g();}}function Tk(c,g,S={}){ke(),S?.keepCellSelection||(B$1=null),K=null,Ge.noteModelMoved();let P=ce.around(Le,c,z=>typeof z=="boolean"?z:z.committed),N=typeof P=="boolean"||!P.rejected?null:P;if(N)X=a0(String(N.reason??"rejected"),a.settingsRoot());else {X=null;let z=g?.();z&&(oa(),F=z,V({kind:"none"},false),Wt=null,Yo=true);let G=S?.rearmPending;if(G&&G.properties.length>0){let{anchor:Q,head:de}=F;Q.paragraphId===de.paragraphId&&Q.offset===de.offset&&(K={properties:G.properties,base:G.base,position:de});}}co(),io(N!==null);}function Pk(){if(!_t)return true;for(let c of [F.anchor,F.head]){let g=ne(ne$1,c);if(g&&!_t.has(g.pageIndex))return false}return true}function co(){let c=i;if(!c)return;let g=bt?sx(B$1?.text??F,P=>{let N=Ve(a,P)??a.part();return lx(N,P)},B$1?"cells":void 0):null,S=g?`${g.anchor.paragraphId}:${g.anchor.offset}|${g.head.paragraphId}:${g.head.offset}|${g.kind??""}`:"";S!==Uo&&(Uo=S,c.setLocalSelection(g));}function vt(c,g=false,S="caret"){let P=!Et(c,F);Ne.length>0&&P&&ke();let N=at?.beforeSelect(c);if(N===null)return;c=N??c,re(c),E(c);let z=nr()?.id??null,G=Yt(a.part(),F.head)?.id;oa(),F=c,B$1=null,g||(Wt=null),Pk()||(Ge.noteModelMoved(),S==="none"?Xl.without(()=>wt(false)):wt(false)),Ge.noteSelectionSettled(),Ge.mirrorToDom(true),sp(true,S),ia(),Mr.clear(),uo();let Q=nr()?.id??null,de=Yt(a.part(),F.head)?.id;(z!==Q||G!==de)&&wt(false),co(),n$1.onChange?.(nt());}let Ge=HS({session:a,storyScope:Ee,document:C$1,pagesLayer:T,selection:()=>F,setSelection:c=>vt(c),adoptSelection:c=>{let g=at?.beforeSelect(c);g!==null&&(c=g??c,re(c),E(c),oa(),F=c,Wt=null,Yo=true,co());},commit:c=>He(c),applyOps:(c,g,S)=>Ue(c,g,void 0,S),hasPendingInput:()=>Ne.length>0,replacementOffset:(c,g,S)=>id({paragraphId:c,offset:g},{paragraphId:c,offset:S}),render:()=>wt(),flushLayout:()=>Re(),flushToPaint:()=>vn(),updateCaret:()=>{R.update(),Uu(T,vi());},textOf:c=>Pt(c),pendingFormatOps:(c,g,S,P)=>le(c,g,S,P),selectionMark:()=>je(),now:ze$1,recordSelectionMs:c=>{Se=c;},isGesturing:()=>sd$1?.dragging()??false,domSelection:()=>B$1?Ke(B$1.text.anchor):F,holdsCellSelection:()=>B$1!==null,replaceSelectionWith:c=>Le.type(c),discardPaint:()=>l(T)});ue=yw({session:a,layout:()=>ne$1,sectionAtPage:De$1,revisionDisplayMode:pt,revisionAuthorFilter:mt,selection:()=>F,setScopeSelection:c=>{ke(),oa(),re(c),Mr.clear(),F=c,B$1=null,Wt=null,co();},noteModelMoved:()=>Ge.noteModelMoved(),render:()=>wt(),mirrorToDom:()=>Ge.mirrorToDom(),notify:()=>n$1.onChange?.(nt()),materializedPages:()=>_t,entryRefused:()=>qe$1==="view",leaveOtherStories:()=>ve?.exitNote()}),ve=xw({session:a,exitHeaderFooter:()=>ue?.exitHeaderFooter(),applyOps:Ue,commit:He,selection:()=>F,selectionMark:()=>je(),orderedStart:()=>ad(),deleteSelectionPlan:()=>Dn(),undo:()=>Le.undo(),activeScope:()=>{let c=ve?.activeNoteScope();return c||(ue?.activeScope()??{kind:"body"})},setActiveScopeBodyOrHf:c=>ue.setActiveScope(c),setSelection:c=>vt(c),noteModelMoved:()=>Ge.noteModelMoved(),render:()=>{Re()||wt();},revealNote:c=>{Re();for(let g of ne$1.pages){let S=[...g.footnotes?.notes??[],...g.endnotes?.notes??[]].find(P=>P.scopeId===c);if(S)return da$1(S.box.y,S.box.height,{block:"nearest",offsetPx:48}),g.index}return null},notify:()=>n$1.onChange?.(nt()),lastRejection:()=>X,setLastRejection:c=>{X=c;}});function pp(c){c&&ke(),B$1=c,c&&(re(c.text),oa(),F=c.text),Wt=null,Ge.noteSelectionSettled(),Ge.mirrorToDom(),ia(),Mr.clear(),uo(),co(),n$1.onChange?.(nt());}let ar=null;function Ck(){let g=ne(ne$1,F.head)?.pageIndex??0,S=new Set;for(let P=g-1;P<=g+1;P+=1)P>=0&&P<ne$1.pages.length&&S.add(P);return S}let mp=new WeakMap;function Rk(c){let g=mp.get(c);if(g)return g;let S=new Map;for(let P of c.pages)for(let N of B(P))S.has(N.paragraphId)||S.set(N.paragraphId,P.index);return mp.set(c,S),S}function Ek(){let c=a.revision(),g=_t??Ck();if(ar?.layout===ne$1&&ar.revision===c&&pf(ar.pages,g))return ar.rects;let S=Rk(ne$1),P=(Q,de)=>{if(!g)return true;let Ie=S.get(Q),Me=S.get(de);if(Ie===void 0||Me===void 0)return true;for(let se=Math.min(Ie,Me);se<=Math.max(Ie,Me);se+=1)if(g.has(se))return true;return false},N=[];for(let Q of aa()){if(Q.kind==="comment"){if(Q.range===null||!P(Q.range.start.paragraphId,Q.range.end.paragraphId))continue;N.push({key:Da(Q),from:{paragraphId:Q.range.start.paragraphId,offset:Q.range.start.offset},to:{paragraphId:Q.range.end.paragraphId,offset:Q.range.end.offset}});continue}let de=Da(Q),Ie=Q.kind==="revision"?Q.ranges:Q.range?[Q.range]:[];for(let[Me,se]of Ie.entries())P(se.start.paragraphId,se.end.paragraphId)&&N.push({key:Ie.length===1?de:`${de}${p}${Me}`,from:{paragraphId:se.start.paragraphId,offset:se.start.offset},to:{paragraphId:se.end.paragraphId,offset:se.end.offset}});}let z=ge(ne$1,N,g,x),G=[];for(let[Q,de]of z)for(let Ie of de)G.push({...Ie,key:Q});return ar={layout:ne$1,revision:c,pages:g,rects:G},G}let Nn=null;function Ok(c){Nn&&(c.impact==="text-local"&&c.created.length===0&&c.deleted.length===0&&c.splitJoin.length===0?Nn={packageRevision:a.packageRevision(),bodyRoot:a.part().root,index:Nn.index}:Nn=null);}function Mk(){let c=a.packageRevision(),g=a.part().root;if(Nn&&Nn.packageRevision===c&&Nn.bodyRoot===g)return Nn.index;let S=new Map,P=z=>{let G=S.size;for(let[Q,de]of z)S.has(Q)||S.set(Q,G+de);};P(fi$1(a.part()));let N=new Set([a.part()]);for(let z of a.headerFooterPartsBySection())for(let G of [z.headers,z.footers])for(let Q of G.values())N.has(Q)||(N.add(Q),P(fi$1(Q)));for(let z of ["footnote","endnote"]){let G=a.partFor({kind:"notesPart",noteKind:z});!G||N.has(G)||(N.add(G),P(fi$1(G)));}return Nn={packageRevision:c,bodyRoot:g,index:S},S}let Mr=new Set,ta$1=null,na,ra=null,Jl=false,gp=false;function oa(){Jl||(ra=null);}function hp(){let c=ra;if(!c||!F)return null;let g=(P,N)=>P.paragraphId===N.paragraphId&&P.offset===N.offset;if(!g(F.anchor,c.anchor)||!g(F.head,c.head))return null;let S=aa().find(P=>Da(P)===c.key);return !S||S.kind==="revision"&&ta$1!==null&&ta$1.has(S.revisionKind)&&(S.revisionKind!=="format"||na===void 0||na.has(S.formattingKind??""))&&!gp?null:S}function ed(){let c=hp();if(c)return yp(c);let g=F?.head;if(!g)return null;let P=Ha$1(aa(),g,Mk()).filter(N=>!(N.kind==="comment"&&N.resolved)&&!Mr.has(Da(N))&&!(N.kind==="revision"&&ta$1!==null&&ta$1.has(N.revisionKind)&&(N.revisionKind!=="format"||na===void 0||na.has(N.formattingKind??""))))[0];return P?yp(P):null}function yp(c){if(c.kind!=="comment")return c;let g=Ja$1(aa(),c);return Mr.has(Da(g))?null:g}function aa(){return yn.filterItems(a.reviewItems())}let bp=ax({roster:er.get,styles:()=>Jn,slots:Ko}),vp=bp.forAuthor,Fk=bp.declaredFor;function Ak(c,g,S){let P=c.split(p),N=P[0],z=g!==null&&N===Da(g);if(c.startsWith("comment-")){let Me=S.get(N),se=Me?.kind==="comment"&&Me.resolved;return se&&!z?null:z?`docx-comment-band docx-comment-band--active${se?" docx-comment-band--resolved-active":""}`:"docx-comment-band"}if(c.startsWith("custom-"))return z?"docx-comment-band docx-comment-band--active":null;let G=S.get(N);if(!G||G.kind!=="revision")return null;let Q=P.length>1?Number(P[1]):0;return `docx-revision-band docx-revision-band--${(Me=>Me==="delete"||Me==="moveFrom"?"delete":Me==="insert"||Me==="moveTo"?"insert":Me==="replace"&&G.replacedRangeCount!==void 0?Q<G.replacedRangeCount?"delete":"insert":"other")(G.revisionKind)}${z?" docx-revision-band--active":""}`}let xp=null,Sp,wp=null;function uo(c=false){let g=ed(),S=g?Da(g):null,P=er.get();if(!c&&xp===ne$1&&Sp===S&&wp===P.resolved)return;let N=new Map;for(let G of aa())N.set(Da(G),G);let z=[];for(let G of Ek()){let Q=Ak(G.key,g,N);if(!Q)continue;let de=G.key.split(p)[0],Ie=N.get(de),Me=Ie?Xu(Ie):null,se=Me===null||Me===""?void 0:P.resolved.get(Me),dt=Ie?.kind==="revision"&&g!==null&&de===Da(g)?se?.style?.activeBackground:void 0;z.push({...G,className:Q,...se?{reviewAuthor:se}:{},...dt!==void 0?{activeBackground:dt}:{}});}o(O,ne$1,z,{scale:l$1,...ot?{pageOffsetX:ot.pageOffsetX}:{}}),xp=ne$1,Sp=S,wp=P.resolved;}function ia(){at?.update();let c=B$1?va(ne$1,B$1.cellIds):M?ee(ne$1,M,Ce(),x):fe(ne$1,F,Ce(),x);o(A,ne$1,c,{scale:l$1,pageOffsetX:ot?.pageOffsetX,...B$1?{}:{className:M?"docx-retained-selection-rect":"docx-selection-mark-rect"}});}function Ai(){if(!ro){$.replaceChildren();return}let c=i;if(!c){$.replaceChildren();return}dx($,ne$1,c.remoteSelections(),{scale:l$1,pageOffsetX:ot?.pageOffsetX,..._t?{pages:_t}:{},colorForAuthor:vp,declaredColorFor:Fk,labelHost:Or,measurer:x});}function Li(c){let g=Be(a.part());if(c)return g.find(N=>N.id===c)??null;let S=Xo?g.find(N=>N.id===Xo):void 0;if(S)return S;let P=F.head.paragraphId;return g.find(N=>N.beginParagraphId===P||N.endParagraphId===P||N.resultParagraphIds.includes(P))??(g.length===1?g[0]:null)}function td$1(){return Pb(a.part(),F)}function Lk(c){return Cb(a.part(),c)}function Ip(){return new Set(Be(a.part()).flatMap(c=>[c.beginParagraphId,...c.resultParagraphIds,c.endParagraphId]))}function nd(c){return new Set([c.beginParagraphId,c.endParagraphId,...c.resultParagraphIds])}function Nk(c){let g=0;for(let S of ne$1.pages)for(let P of B(S))c.has(P.paragraphId)&&(g+=P.lines.length);return g}function rd(c,g){let S=new Set(g),P=new Map;for(let N of c.pages)for(let z of B(N)){if(!S.has(z.paragraphId)||P.has(z.paragraphId))continue;let G=N.pageFieldSource;P.set(z.paragraphId,lc$1(G?.pageNumber??N.index+1,G?.format));}return P}function od(c){if(qe$1==="view"||!a.editable)return false;let g=Li(c);return !g||!De(a.part(),a.documentOutline(),g.instruction)?false:Vi(a.part(),{op:"rewriteTocPageNumbers",tocId:g.id,updates:[]})===null}function kp(c,g){if(!Number.isInteger(c)||!Number.isInteger(g)||c<1||g<1)return null;let S=to.sectionPropertiesAt(F.head.paragraphId),P=S.pageSize.widthTwips-S.margins.leftTwips-S.margins.rightTwips-S.margins.gutterTwips,N=Math.max(300,Math.floor(P/g));return {op:"insertTable",beforeParagraphId:F.head.paragraphId,rows:c,cols:g,columnWidthTwips:N}}function Tp(c,g){if(qe$1==="view"||!a.editable)return false;let S=kp(c,g),P=a.partFor(Ee())??a.part();return S!==null&&Vi(P,S)===null}function Dk(c,g){if(!Tp(c,g))return false;let S=kp(c,g);if(!S)return false;let P=null,N=a.subscribe(G=>{G.caret&&(P=G.caret);}),z=false;try{He(()=>{let G=Ue([S],je());return G.committed||(X=G.reason??"the table could not be inserted here"),z=G.committed,G},()=>{let G=P;return G?Ke({paragraphId:G.paragraphId,offset:G.start}):null});}finally{N();}return z}let Pp='TOC \\o "1-3" \\h';function Cp(){let c=ze(Pp);if(!c)return null;let g=a.documentOutline(),S=jf$1(a.part(),g,c,rd(Le.layout(),g.map(P=>P.blockId)),Ip(),i?.identity.actorId);return {op:"insertToc",beforeParagraphId:F.head.paragraphId,instruction:Pp,alias:On?.title??"TOC",entries:S.entries,bookmarksToCreate:S.bookmarksToCreate}}function Rp(){if(qe$1==="view"||!a.editable||td$1())return false;let c=Cp();return c!==null&&Vi(a.part(),c)===null}function Hk(){if(!Rp())return false;let c=Cp();if(!c)return false;let g=new Set(Be(a.part()).map(N=>N.id)),S=ea([c],void 0,void 0,Oi);if(!S.committed)return X=S.reason??"the table of contents could not be inserted",false;let P=Be(a.part()).find(N=>!g.has(N.id));return P?Ep(P.id,"pageNumbers"):true}function Ep(c,g="entire"){let S=Li(c);if(!S||!od(S.id))return false;let P=Le.layout(),N=a.documentOutline(),z=De(a.part(),N,S.instruction);if(!z)return false;let G=z.map(de=>de.blockId);if(g==="entire"){let de=jf$1(a.part(),N,S.instruction,rd(P,G),nd(S),i?.identity.actorId),Ie=ea([{op:"replaceTocResult",tocId:S.id,entries:de.entries,bookmarksToCreate:de.bookmarksToCreate}],void 0,void 0,Oi);if(!Ie.committed)return X=Ie.reason??"the table of contents could not be refreshed",false;if(P=Le.layout(),S=Li(S.id),!S)return true}let Q="";for(let de=0;de<3;de+=1){let Ie=rd(P,G),Me=lf$1(a.part(),S,N,nd(S)),se=S.resultParagraphIds.flatMap((fo,sr)=>{let ua=Me[sr],Hi=ua?Ie.get(ua):void 0;return Hi===void 0?[]:[{paragraphId:fo,pageNumberText:Hi}]});if(se.length===0)break;let dt=se.map(fo=>`${fo.paragraphId}\0${fo.pageNumberText}`).join("");if(dt===Q)break;Q=dt;let Bt=ea([{op:"rewriteTocPageNumbers",tocId:S.id,updates:se}],void 0,void 0,Oi);if(!Bt.committed){if(Bt.rejected)return X=Bt.reason??"the table of contents page numbers were refused",false;break}P=Le.layout(),S=Li(S.id)??S;}return true}function _k(){return ex({session:a,editingMode:qe$1,collaborationActive:i!==void 0,reviewerFilterActive:mt()!==void 0,layout:Le.layout(),canonicalUnfilteredLayout:Er,styleCascade:Ae(),numberingIndex:St(),displayMode:pt()})}let{selectionMark:je,orderedRange:ir,orderedStart:ad,textOf:Pt,inlineControlBeside:Op,splitEndsTheParagraph:Bk,deleteSelectionPlan:Dn,deleteSelectionOps:$k,replacementOffset:id}=cS({session:a,layout:()=>ne$1,selection:()=>F,cellSelection:()=>B$1,editingMode:()=>qe$1,author:()=>s,trackedDate:m,storyScope:Ee,paragraphOrder:Ce,flushPendingInputAndLayout:Ze,trackedAuthorOrNone:Ql,atParagraphEnd:(c,g)=>Sr.atParagraphEnd(c,g)}),{insertPlainText:Mp,copyFlavoursNow:qk,pasteRichNow:Zk,armForcePlainPaste:Kk}=dS({session:a,textFormFieldId:()=>at?.fieldId()??null,layout:()=>ne$1,cellSelection:()=>B$1,editingMode:()=>qe$1,storyScope:Ee,paragraphOrder:Ce,actorId:()=>i?.identity.actorId,collaborationGate:(c,g)=>i?.gateOperations(c,g)??null,now:ze$1,flushPendingInputAndLayout:Ze,orderedRange:ir,selectionMark:je,deleteSelectionPlan:Dn,consumePendingFormatOps:le,withoutPendingOnRejection:te,caretMark:or,commit:He});function sa(c){c&&(rt=null,Ze(),Ht=bn(mt()),We.invalidateAll(a.packageRevision(),"tracked-change-filter"),We.flush(),n$1.onChange?.(nt()));}let la=false,Le={session:a,applyGatedTreeOps:(c,g,S,P)=>ea(c,g,S,P??Ee()),storyScope:Ee,imageDecodePort:()=>wr,layout:()=>(Ze(),ne$1),state:nt,currentPage:(c="caret")=>{if(Ze(),c==="viewport"){let S=gS(e$1,ne$1,l$1);if(S!==null)return S}let g=ne(ne$1,F.head);return g?g.pageIndex+1:1},setScale(c){if(!(c>0)||!Number.isFinite(c))return false;if(c===l$1)return true;let g={scale:l$1,defaults:h$1,measurer:x,producer:k,furnitureSource:Ht};try{let S=zt(e$1),P=S?{x:(S.scrollLeft-e$1.offsetLeft+S.clientWidth/2)/l$1,y:(S.scrollTop-e$1.offsetTop+S.clientHeight/2)/l$1}:null;if(l$1=c,n$1.measurer||(h$1=da(l$1,{context:Ao(e$1.ownerDocument),...n$1.fontAlias?{fontAlias:n$1.fontAlias}:{}}),x=h$1.measurer),k=I(),Ht=bn(mt()),_t=void 0,ot=void 0,ar=null,We.invalidateAll(a.packageRevision(),"zoom"),We.flush(),S&&P){let N=Math.max(0,P.x*l$1+e$1.offsetLeft-S.clientWidth/2),z=Math.max(0,P.y*l$1+e$1.offsetTop-S.clientHeight/2),G=Number.isFinite(S.scrollWidth)?Math.max(0,S.scrollWidth-S.clientWidth):null,Q=Number.isFinite(S.scrollHeight)?Math.max(0,S.scrollHeight-S.clientHeight):null;S.scrollLeft=G===null?N:Math.min(N,G),S.scrollTop=Q===null?z:Math.min(z,Q),Ei();}return !0}catch{(({scale:l$1,defaults:h$1,measurer:x,producer:k,furnitureSource:Ht}=g)),_t=void 0,ot=void 0,ar=null;try{We.invalidateAll(a.packageRevision(),"zoom-rollback"),We.flush();}catch{}return false}},enqueueType:Fe,flushPendingInput:Ze,type(c){let g=Dn(),S=g.replaceAt??g.collapseTo,P=le(S.paragraphId,S.offset,c.length),N=g.ops.length===0?kv(nr()):void 0,z=[...g.ops,Tv(S,c,N)],G=Iv(Ve(a,S.paragraphId)??a.part(),S.paragraphId,S.offset,c.length),Q={paragraphId:S.paragraphId,start:G,end:G};He(()=>te([...z,...P],z,je(),Q),()=>Ke({paragraphId:S.paragraphId,offset:G}));},proposeTextChange:(c,g,S)=>lt(c,g,S),insertPlainText:c=>Mp(c),deleteBackward(){if(at?.selectForDeletion("backward"))return;let c=Dn();if(c.ops.length>0){He(()=>Ue(c.ops,je(),or(c.collapseTo)),()=>Ke(c.collapseTo));return}let g=ee$1()??void 0,S$1=F.head;if(S$1.offset===0){for(let de of S(ne$1,S$1.paragraphId)){let Ie=Pt(de);if(Ie.length!==0){He(()=>Ue([{op:"deleteText",paragraphId:de,start:Ie.length-1,end:Ie.length}],je(),or({paragraphId:de,offset:Ie.length-1})),()=>Ke({paragraphId:de,offset:Ie.length-1}),{rearmPending:g});return}}let N=Ce(),z=N.indexOf(S$1.paragraphId),G=N[z-1];if(!G)return;if(!kk(G,S$1.paragraphId)){vt(Ke({paragraphId:G,offset:Pt(G).length}));return}let Q=Pt(G).length;He(()=>Ue([{op:"joinParagraphs",firstId:G,secondId:S$1.paragraphId}],je(),or({paragraphId:G,offset:Q})),()=>Ke({paragraphId:G,offset:Q}),{rearmPending:g});return}let P=Op(S$1,"before");if(P){He(()=>Ue([{op:"removeContentControl",controlId:P.controlId,keepContent:false}],je(),or({paragraphId:S$1.paragraphId,offset:P.start})),()=>Ke({paragraphId:S$1.paragraphId,offset:P.start}),{rearmPending:g});return}He(()=>Ue([{op:"deleteText",paragraphId:S$1.paragraphId,start:S$1.offset-1,end:S$1.offset}],je(),or({...S$1,offset:S$1.offset-1})),()=>Ke({...S$1,offset:S$1.offset-1}),{rearmPending:g});},splitParagraph(){let c=Dn(),g=c.replaceAt??c.collapseTo,S=new Set(a.paragraphIdsIn(Ee())),P=ee$1()??{properties:Ks(Ve(a,g.paragraphId)??a.part(),g.paragraphId,g.offset,pt(),mt()),base:[]},N=Bk(g),z=N?Sr.followerStyleId(g.paragraphId):void 0,G=P.properties.reduce(($t,_i)=>ta($t,xa($t,_i)),[...P.base]),Q=N&&qe$1==="edit"&&G.length>0?[{op:"setParagraphMarkProperties",paragraphId:g.paragraphId,properties:G}]:[],de={op:"splitParagraph",paragraphId:g.paragraphId,offset:g.offset,tailStyleId:z},Ie=Ql(),Me=Ie?{author:Ie,date:m()}:void 0,se=a.documentStyles(),dt=js(se),Bt=dt??"ListParagraph",fo=new Set(se.map($t=>$t.styleId));for(let $t=1;!dt&&fo.has(Bt);$t++)Bt=`ListParagraph${$t}`;let sr=qe$1!=="view"&&c.ops.every($t=>$t.op==="deleteText"&&$t.paragraphId===g.paragraphId)&&z===void 0?K0(Ve(a,g.paragraphId)??a.part(),ne$1,g,G,Bt,Ae(),Me,i?.identity.actorId):null,ua=Me?[{op:"setParagraphMarkRevision",paragraphId:g.paragraphId,kind:"ins",revision:Me}]:[],Hi=sr?[sr,...Q,...ua]:[de];He(()=>te([...c.ops,...Q,...Hi],[...c.ops,...sr?[sr,...ua]:[de]],je(),void 0,sr&&!dt?[ov(Ae()?.defaultParagraphStyleId??null,Bt)]:void 0),()=>{let $t=a.paragraphIdsIn(Ee()).filter(Wk=>!S.has(Wk)),_i=sr?$t.at(-1):$t[0];return _i?Ke({paragraphId:_i,offset:0}):null},{rearmPending:P});},navigate(c,g=false){if(Ze(),!g&&(c==="left"||c==="right")&&(F.anchor.paragraphId!==F.head.paragraphId||F.anchor.offset!==F.head.offset)){let Ie=ir();Wt=null;let Me=Rv(ne$1,Ie,Ce(),c,x);vt(Ke(Me),true);return}let S=_c(ne$1,F.head,c,Wt,ue?.getActive()??null,_e(),x);if(!S)return;let P=Ip(),N=Rb(a.part(),S.position,["left","wordLeft","lineStart","up","pageUp"].includes(c));if(N&&(S={...S,position:N}),Yt(a.part(),S.position)){if(g)return;let Me=new Set(["left","wordLeft","lineStart","up","pageUp"]).has(c)?"up":"down",se=Nk(P)+4;for(let dt=0;dt<se;dt+=1){let Bt=_c(ne$1,S.position,Me,S.desiredX,ue?.getActive()??null,_e(),x);if(!Bt||Bt.position.paragraphId===S.position.paragraphId&&Bt.position.offset===S.position.offset)return;if(S=Bt,!Yt(a.part(),S.position))break}if(Yt(a.part(),S.position))return}Wt=S.desiredX,ve?.activeNoteScope()&&S.pageIndex!==void 0&&Number.isInteger(S.pageIndex)&&ve.setActiveNotePageIndex(S.pageIndex);let z={anchor:g?F.anchor:S.position,head:S.position},G=g?z:xl(ne$1,z),Q=!g&&!Et(G,z),de=F;vt(G,true,Q?"none":"head"),Q&&(F!==de||Et(F,G))&&Zl(F.anchor);},deleteWordBackward(){if(Le.deleteSelection())return;let c=F.head,g=(at?.wordDeletionBoundary??be)(Pt(c.paragraphId),c.offset,-1,se(ne$1,c.paragraphId));if(g===c.offset){Le.deleteBackward();return}He(()=>Ue([{op:"deleteText",paragraphId:c.paragraphId,start:g,end:c.offset}],je()),()=>Ke({...c,offset:g}),{rearmPending:ee$1()??void 0});},deleteWordForward(){if(Le.deleteSelection())return;let c=F.head,g=(at?.wordDeletionBoundary??be)(Pt(c.paragraphId),c.offset,1,se(ne$1,c.paragraphId));if(g===c.offset){Le.deleteForward();return}He(()=>Ue([{op:"deleteText",paragraphId:c.paragraphId,start:c.offset,end:g}],je()),void 0,{rearmPending:ee$1()??void 0});},deleteForward(){if(at?.selectForDeletion("forward")||Le.deleteSelection())return;let c=ee$1()??void 0,g=F.head,S$1=Pt(g.paragraphId);if(g.offset<S$1.length){let z=Op(g,"after");if(z){He(()=>Ue([{op:"removeContentControl",controlId:z.controlId,keepContent:false}],je()),()=>Ke(g),{rearmPending:c});return}He(()=>Ue([{op:"deleteText",paragraphId:g.paragraphId,start:g.offset,end:g.offset+1}],je()),void 0,{rearmPending:c});return}let P=Ce(),N=P[P.indexOf(g.paragraphId)+1];if(N){if(S(ne$1,N).includes(g.paragraphId)){if(Pt(N).length===0)return;He(()=>Ue([{op:"deleteText",paragraphId:N,start:0,end:1}],je()),()=>Ke(g),{rearmPending:c});return}He(()=>Ue([{op:"joinParagraphs",firstId:g.paragraphId,secondId:N}],je()),()=>Ke(g),{rearmPending:c});}},...to,...ki$1,setSelection:c=>{Et(c,F)||V({kind:"programmatic"},false),vt(c);},selectDrawing(c,g){Re();let S=al(ne$1,c,g);if(!S)return false;let P=Ke(S);return V({kind:"pointer",drawingNodeId:c},Et(P,F)),vt(P),Xa(Le)?.drawingNodeId===c},revealPage(c,g){Re();let S=ne$1.pages.find(P=>P.index===c);return S?da$1(S.box.y,S.box.height,g):false},revealParagraph(c,g){Re();let S=ne(ne$1,{paragraphId:c,offset:0});if(!S)return false;let P=ne$1.pages.find(N=>N.index===S.pageIndex);return P?da$1(P.contentBox.y+S.y,S.height,g):false},revealPosition(c,g){Re();let S=ne(ne$1,c);if(!S)return false;let P=ne$1.pages.find(N=>N.index===S.pageIndex);return P?da$1(P.contentBox.y+S.y,S.height,{block:"nearest",...g}):false},setEditable(c){lp=c,Ul();},selectAll(){let c=Ce(),g=c[0],S=c[c.length-1];!g||!S||vt({anchor:{paragraphId:g,offset:0},head:{paragraphId:S,offset:Pt(S).length}});},hyperlinks:Tr,equations:Vo,contentControls:Ln,formatPainter:tr,canInsertTable:Tp,insertTable:Dk,canInsertToc:Rp,insertToc:Hk,canRefreshToc:od,canEditTextFormField:()=>at?.canEdit()??false,editTextFormField:()=>at?.edit()??false,refreshToc:Ep,refreshRefFieldResults:_k,save:()=>_v(Le,e$1,()=>la),isInsideToc:c=>Be(a.part()).some(g=>g.beginParagraphId===c||g.endParagraphId===c||g.resultParagraphIds.includes(c)),retainSelection:()=>{let c=Symbol("selection-pin");return q.set(c,F),M=F,ia(),c},releaseSelection:c=>{q.delete(c)&&(Z(),ia());},retainedSelection:()=>M,publishedLayout:()=>ne$1,drawingSelectionIntent:()=>H,overlayCoordinates:()=>Object.freeze({paintScale:l$1,pageOffsetX:ot?.pageOffsetX??new Map}),commitReviewOps:(c,g)=>{Ze();let S=F.head.paragraphId,P=Pt(S);return He(()=>{if(qe$1==="view")return {committed:false,rejected:true,opCount:0,reason:u};if(i&&(g===void 0||!n1.has(g)))return {committed:false,rejected:true,opCount:0,reason:"experimental-collaboration-body-text-only"};if(i){let z=i.gateOperations([],Ee());if(z)return {committed:false,rejected:true,opCount:0,reason:z}}let N=Nb$1(i?.identity.actorId,c);return {committed:N.committed,rejected:!N.committed,opCount:0,...typeof N.reason=="string"?{reason:N.reason}:{}}},()=>{Re(),Ge.noteModelMoved();let N=Ce();if(N.length===0)return null;let z=Ik(F,S,P);return si(ne$1,N,z)})},revisionDisplayMode:$l,replacementLanding:Mn,applyAutomationOps:(c,g,S)=>{let P={committed:false,rejected:false,opCount:0},N=g??Oi;return He(()=>{let z=rr(false);if(z!==null)return P={committed:false,rejected:true,opCount:0,reason:z};let G=null,Q=c(de=>{let Ie=rr(true,[],false);return Ie===null?Nb$1(i?.identity.actorId,()=>a.ensureHyperlinkRelationship(de,N)):(G=Ie,null)});return Q===null?P={committed:false,rejected:true,opCount:0,reason:G??"this engine will not author that hyperlink target"}:!n$1.reviewModel&&Q.some(ju)?P={committed:false,rejected:true,opCount:0,reason:"review-module-required"}:P=Ue(Q,void 0,void 0,N,false,S)},()=>{Re(),Ge.noteModelMoved();let z=Ce();return z.length===0?null:si(ne$1,z,F)}),P},editingMode:()=>qe$1,setAuthor:c=>{s!==c&&(ke(),s=c,c?.trim()&&Yv(X)&&(X=null,n$1.onChange?.(nt())));},setDrawingStrings:c=>{Ir!==c&&g(Ir)!==g(c)&&(Ir=c,Ze(),wt(false));},setLocale:Mi.set,setTranslate:c=>{Jo!==c&&(Jo=c,at?.update());},setTocLabels:c=>{On=c;},setEditingMode:c=>{Ze();let g=qe$1!==c;qe$1=c,g&&c==="view"&&ue?.exitHeaderFooter(),g&&c==="view"&&tr.disarm(),Wl(),Ul(),Hc(e$1,qe$1),g&&wt(false),X=null,n$1.onChange?.(nt());},revisionAuthors:()=>er.get().value,setRevisionDisplayMode(c){la||c===Ot.view()||(Ze(),Ot.set(c),sa(true));},hiddenRevisionAuthors:()=>yn.hiddenAuthors,setRevisionAuthorVisible(c,g){sa(yn.setVisible(c,g));},setAllRevisionAuthorsVisible(c){sa(yn.setAllVisible(er.get().value.keys(),c));},showAllRevisionAuthors(){sa(yn.showAll());},setTrackedChangesFilter(c,g){sa(yn.setPredicate(c,g));},collaborationSession:()=>i??null,remotePresenceColor:vp,setShowParagraphMarks:Zo.set,setRevisionStyles:c=>{c!==Jn&&(Jn=c,Ze(),wt(false));},setRemoteCaretLabelHost:c=>{c!==Or&&(Or=c,Ai());},setReviewActivationExclusions(c,g){na=g?.formattingKinds?new Set(g.formattingKinds):void 0,ta$1=c===null?null:new Set(c),uo(),n$1.onChange?.(nt());},activeReviewKey:()=>{let c=ed();return c?Da(c):null},activateReview:(c,g,S)=>{if(Mr.clear(),gp=S?.allowExcluded??false,ra=g?{key:c,anchor:g.anchor,head:g.head}:{key:c,anchor:F.anchor,head:F.head},g){Jl=true;try{vt(g);}finally{Jl=false;}return}uo(),n$1.onChange?.(nt());},activatedReviewKey:()=>hp()===null?null:ra?.key??null,dismissActiveReview:()=>{let c=ed();c&&(Mr.add(Da(c)),ra=null,uo(),n$1.onChange?.(nt()));},navigation:zo,bookmarks:()=>a.bookmarks(),selectedText(){if(B$1)return wa(ne$1,B$1);let{from:c,to:g}=ir();return dl(ne$1,c,g,Ce())},copyFlavours:()=>qk(),pasteRich:(c,g)=>Zk(c,g),armForcePlainPaste:Kk,deleteSelection(){let c=Dn();return c.ops.length===0?false:(He(()=>Ue(c.ops,je(),or(c.collapseTo)),()=>Ke(c.collapseTo)),true)},setCellSelection:pp,layoutSession:()=>b,undo:()=>{if(qe$1==="view"){X=u,n$1.onChange?.(nt());return}if(ke(),i){i.undo()&&Ni(null);return}let c=a.packageRevision(),g=a.undo();a.packageRevision()!==c&&Ni(g);},redo:()=>{if(qe$1==="view"){X=u,n$1.onChange?.(nt());return}if(ke(),i){i.redo()&&Ni(null);return}let c=a.packageRevision(),g=a.redo();a.packageRevision()!==c&&Ni(g);},sectionAtPage:De$1,activeScope:()=>{let c=ve?.activeNoteScope();return c||ue.activeScope()},setActiveScope:c=>(Ze(),c.kind==="note"?ve.enterNote(c.id):c.kind!=="body"&&c.kind!=="headerFooter"?false:(ve?.exitNote(),ue.setActiveScope(c))),insertNote:c=>(Ze(),ve.insertNote(c)),deleteNote:(c,g)=>ve.deleteNote(c,g),convertNote:(c,g)=>ve.convertNote(c,g),convertAllNotes:c=>ve.convertAllNotes(c),setNoteProperties:c=>ve.setNoteProperties(c),enterNote:(c,g)=>(Ze(),ve.enterNote(c,g)),exitNote:()=>(Ze(),ve.exitNote()),notePropertiesState:()=>{let c=Le.state().selection.head.paragraphId,g=a.packageRevision(),S=a.currentPackage(),P=a.part(),N=Lf$1(S),z=Wf$1(S,"footnote"),G=Wf$1(S,"endnote"),Q=Le.activeScope().kind==="headerFooter",de=Le.headerFooterState(),Ie=de?.rId??null,Me=de?.sectionIndex??null,se=rt;if(se&&se.packageRevision===g&&se.paragraphId===c&&se.bodyPart===P&&se.settingsPart===N&&se.footnotesPart===z&&se.endnotesPart===G&&se.headerFooterOpen===Q&&se.headerFooterRId===Ie&&se.headerFooterSectionIndex===Me)return se.result;let dt=Sw(Le,mt());return rt={packageRevision:g,paragraphId:c,bodyPart:P,settingsPart:N,footnotesPart:z,endnotesPart:G,headerFooterOpen:Q,headerFooterRId:Ie,headerFooterSectionIndex:Me,result:dt},dt},notePreviewText:c=>ww(a,c),applyTableCommandPlan(c){if(!c.ok)return {ok:false,code:c.code,reason:c.reason};let g=null,S=a.subscribe(P=>{P.caret&&(g=P.caret);});try{let P=je(),N=c.selection.kind==="adoptCommittedCaret";He(()=>Ue(c.ops,P),N?()=>{let z=g;return z?Ke({paragraphId:z.paragraphId,offset:z.start}):null}:void 0,c.selection.kind==="preserveSelection"?{keepCellSelection:!0}:void 0);}finally{S();}return X?{ok:false,code:"invalidArgs",reason:X}:{ok:true,changed:true}},enterHeaderFooter:c=>{Ze();let g=ue.enterHeaderFooter(c);if(!g)return g;let S=ue.getActive(),P=S?ne$1.pages[S.pageIndex]:void 0;if(S&&P){let N=S.kind==="header"?P.header:P.footer,z=N?.box.y??(S.kind==="header"?P.box.y:P.box.y+P.box.height-1),G=N?.box.height??1;da$1(z,G,{block:"nearest"});}return g},exitHeaderFooter:()=>(Ze(),ue.exitHeaderFooter()),headerFooterState:()=>ue.headerFooterStateStable(a.packageRevision()),...mw({applyOps:Ue,commit:He,deleteSelectionOps:$k,deleteSelectionPlan:()=>Dn(),orderedStart:ad,selectionMark:je,collapsedAt:Ke,isHeaderFooterOpen:()=>ue?.getActive()!==null,lastRejection:()=>X}),...hw({session:a,applyOps:Ue,commit:He,storyScope:Ee,selectionMark:je,editingMode:()=>qe$1,author:()=>s,trackedDate:m,decodePort:()=>wr,actorId:()=>i?.identity.actorId}),focus:()=>{C$1.activeElement!==T&&(T.focus({preventScroll:true}),Ge.mirrorToDom(true));},setTableInteractionLabel(c){d.resolve=c;},refreshTableInteractionLabels(){ca.refreshLabels();},destroy(){if(!la){la=true;try{vn();}finally{C$1.removeEventListener("selectionchange",Fp),T.removeEventListener("pointerdown",$p,{capture:true}),T.removeEventListener("keydown",Di,{capture:true}),T.removeEventListener("beforeinput",Di,{capture:true}),T.removeEventListener("keydown",Np),T.removeEventListener("beforeinput",Bp),T.removeEventListener("copy",Dp),T.removeEventListener("cut",Hp),T.removeEventListener("paste",_p),T.removeEventListener("compositionstart",Lp),T.removeEventListener("compositionend",Ap),C$1.removeEventListener("scroll",qp,{capture:true}),e$1.ownerDocument.defaultView?.removeEventListener("resize",cd),Qo?.disconnect(),Gl=null,Wl(),Vl.destroy(),lo.destroy(),at?.destroy(),Fi?.destroy(),Yl?.destroy(),sd$1?.destroy(),ca.destroy(),zo.destroy(),jo.destroy(),Ge.destroy(),T.removeEventListener("contextmenu",op),T.removeEventListener("click",ap),T.removeEventListener("pointermove",Yf),T.removeEventListener("pointerleave",Jf),no.destroy(),We.cancel(),w!==null&&clearTimeout(w),w=null,U&&U(),U=null,kt.dispose(),f(T),R.destroy(),oo(),Wo(),An(),yt(),e$1.replaceChildren();}}}};function Ni(c){K=null;let g=at?.restoreAfterHistory();if(!c&&g&&(F=g),Ge.noteModelMoved(),Re(),!c){vt(si(ne$1,Ce(),F));return}let S={anchor:{paragraphId:c.paragraphId,offset:c.start},head:{paragraphId:c.paragraphId,offset:c.end}};vt(Ce().includes(c.paragraphId)?S:si(ne$1,Ce(),S));}function da$1(c,g,S){let P=zt(e$1);if(!P||P.clientHeight===0)return false;let N=c*l$1+e$1.offsetTop,z=g*l$1,G=S?.offsetPx??24,Q=S?.block??"start",de=P.clientHeight;if(Q==="nearest"||Q==="centerIfNeeded"){let se=N<P.scrollTop,dt=N+z>P.scrollTop+de;if(!se&&!dt)return true}let Ie=Q==="center"||Q==="centerIfNeeded"?N-Math.max(0,(de-z)/2):Q==="nearest"&&N>P.scrollTop?N+z+G-de:N-G,Me=Math.max(0,P.scrollHeight-de);return P.scrollTo({top:Math.max(0,Math.min(Ie,Me)),behavior:S?.behavior??"auto"}),Ei(),true}let{onSelectionChange:Fp,onCompositionEnd:Ap}=Ge,Lp=(...c)=>{Ge.adoptBeforeInput(),vn(),Ge.onCompositionStart(...c);},sd$1=null;at=Nv({onRequest:n$1.onRequestTextFormField,onInvalidRequest:n$1.onRequestInvalidTextFormField,locale:Mi.get,translate:(c,g)=>Jo?.(c,g)??c,pagesLayer:T,container:e$1,part:c=>Ve(a,c??F.head.paragraphId)??a.part(),parts:()=>a.storyParts(),protected:(c=F.head.paragraphId)=>ji(a.settingsRoot())&&ki(Ve(a,c)??a.part(),c),selection:()=>F,select:(c,g)=>vt(c,false,g?"none":"caret"),reveal:Zl,editable:()=>qe$1==="edit"&&!on,apply:c=>Js(c,He,Ue),save:(c,g)=>Bv(c,g,{session:a,commit:He,refusal:()=>rr(true,c,false),gate:(S,P)=>i?.gateOperations(S,P)??null,collaborationActive:i!==void 0})},r.initialTextFormInput),o0(Le,at.fieldId),Yl=Gv({pagesLayer:T,part:c=>Ve(a,c??F.head.paragraphId)??a.part(),editable:()=>qe$1==="edit"&&!on,protected:c=>ji(a.settingsRoot())&&ki(Ve(a,c)??a.part(),c),selection:()=>F,select:c=>vt(c,false,"none"),apply:c=>Js(c,He,Ue)}),Fi=$0({pagesLayer:T,settings:()=>Lf$1(a.currentPackage()),part:c=>Ve(a,c??F.head.paragraphId)??a.part(),editable:()=>qe$1==="edit"&&!on,select:c=>vt(c,false,"none"),canApply:c=>a.editable&&rr(true,[c],false)===null,history:c=>Le[c](),apply:c=>Js(c,He,Ue)});let Vk=Lx(Le,{...n$1,onToggleFieldCodes:()=>{Ze(),on=!on,Ht=bn(mt()),We.invalidateAll(a.packageRevision(),"field-code-view"),We.flush();}}),Np=c=>{Fi?.keydown(c)||(c.defaultPrevented||Ge.adoptBeforeInput(),!(Yl?.keydown(c)||at?.keydown(c))&&Vk(c));},{onCopy:Dp,onCut:Hp,onPaste:_p}=Nx(Le),zk=Dx(Le,{isComposing:()=>Ge.isComposing(),insertPlainText:Mp,onBrowserSelectionFixup:()=>{Ge.mirrorToDom(),Ge.noteBrowserSelectionFixup();}}),Bp=c=>{Ge.adoptBeforeInput(),zk(c);};C$1.addEventListener("selectionchange",Fp);let jk=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock","ContextMenu"]),$p=c=>{if(c instanceof PointerEvent&&c.button!==0)return;let S=(c.target instanceof Element?c.target:null)?.closest("[data-drawing-node-id]")?.getAttribute("data-drawing-node-id");V(S?{kind:"pointer",drawingNodeId:S}:{kind:"none"},true);},Di=c=>{if(c instanceof KeyboardEvent&&jk.has(c.key))return;if((c instanceof KeyboardEvent&&(c.key==="Delete"||c.key==="Backspace")&&!c.altKey&&!c.ctrlKey&&!c.metaKey||c instanceof InputEvent&&(c.inputType==="deleteContentBackward"||c.inputType==="deleteContentForward"))&&H.kind==="pointer"){let S=Xa(Le);if(S!==null){c.preventDefault(),c.stopImmediatePropagation(),V({kind:"none"},true),Le.deleteImage(S.drawingNodeId);return}}V({kind:"none"},true);};T.addEventListener("pointerdown",$p,{capture:true}),T.addEventListener("keydown",Di,{capture:true}),T.addEventListener("beforeinput",Di,{capture:true}),T.addEventListener("keydown",Np),T.addEventListener("beforeinput",Bp),T.addEventListener("copy",Dp),T.addEventListener("cut",Hp),T.addEventListener("paste",_p),T.addEventListener("compositionstart",Lp),T.addEventListener("compositionend",Ap);let ld=false;function dd(){if(ld)return;ld=true;let c=e$1.ownerDocument.defaultView?.requestAnimationFrame,g=()=>{ld=false,Ei();};c?c(g):queueMicrotask(g);}let qp=c=>{let g=zt(e$1);!g||c.target!==g||dd();};C$1.addEventListener("scroll",qp,{capture:true,passive:true});let cd=()=>{dd();},ud=e$1.ownerDocument.defaultView;ud?.addEventListener("resize",cd,{passive:true}),Qo=typeof ud?.ResizeObserver=="function"?new ud.ResizeObserver(cd):null;function Zp(){if(!Qo)return;let c=zt(e$1);c!==Gl&&(Qo.disconnect(),Gl=c,c&&Qo.observe(c));}Zp(),sd$1=NS({onTextFormDoubleClick:c=>at?.doubleClick(c)??false,onTextFormPointerUp:c=>at?.pointerUp(c),pagesLayer:T,container:e$1,scale:()=>l$1,pageOffsetX:c=>ot?.pageOffsetX.get(c)??0,layout:()=>(Yo=false,Xl.without(Re),ne$1),measurer:()=>x,selection:()=>F,setSelection:c=>vt(c,false,"none"),cellSelection:()=>B$1,setCellSelection:c=>pp(c),focus:()=>T.focus({preventScroll:true}),onSelectionSettled:()=>tr.applyIfArmed(),activeHeaderFooter:()=>yb(ue?.getActive()??null),activeNote:()=>{let c=ve?.activeNoteScope();return c?{scopeId:c.id,pageIndex:ve?.activeNotePageIndex()??null}:null},enterHeaderFooter:c=>{Ze(),ue?.enterHeaderFooter({rId:c.rId,pageIndex:c.pageIndex,sectionIndex:De$1(c.pageIndex).sectionIndex,kind:c.kind,...c.position?{position:c.position}:{}});},enterNote:(c,g,S)=>{Ze(),ve?.enterNote(c,g,S);},exitNote:c=>{Ze(),ve?.exitNote(c);},exitHeaderFooter:()=>(Ze(),ue?.exitHeaderFooter()),enterEmptyHeaderFooter:(c,g)=>{if(qe$1==="view")return;Ze();let{sectionIndex:S,sectionStart:P}=De$1(g),N=a.headerFooterResolutionBySection(),z=N[Math.min(S,Math.max(0,N.length-1))],G=ne$1.pages[g]?.pageFieldSource?.pageNumber??g+1,Q=z?.evenAndOddHeaders&&G%2===0?"even":z?.titlePage&&g===P?"first":"default",de=Me=>{let se=Me[Math.min(S,Math.max(0,Me.length-1))];return c==="header"?se?.headers:se?.footers},Ie=de(N)?.get(Q)?.rId;if(!Ie){if(!Le.applyHeaderFooterLifecycle?.({op:"createHeaderFooter",sectionIndex:S,kind:c,variant:Q,...Q==="first"?{titlePage:true}:{},...Q==="even"?{evenAndOddHeaders:true}:{}})?.ok)return;Ie=de(a.headerFooterResolutionBySection())?.get(Q)?.rId,Re();}Ie&&ue?.enterHeaderFooter({rId:Ie,pageIndex:g,sectionIndex:S,kind:c,variant:Q});},onContentControlWidget:(c,g)=>bk(c,g),...n$1.reviewModel?{onChangeBarToggle:Ot.toggleByChangeBar}:{},isReadOnlyPosition:c=>Yt(a.part(),c)!==void 0},n$1.pointer?{mode:n$1.pointer}:{});let ca=CS({pagesLayer:T,furnitureLayer:y,scale:()=>l$1,pageOffsetX:c=>ot?.pageOffsetX.get(c)??0,read:()=>({layout:ne$1,storeRevision:a.packageRevision(),selection:F,cellSelection:B$1,editingMode:qe$1,themeColors:a.documentThemeColors()}),session:()=>a,applyTableCommandPlan:c=>Le.applyTableCommandPlan(c),label:c=>d.resolve(c)});if(wt(),Fi?.sync(),ro=true,Ai(),i&&(Wo=i.subscribeStatus(()=>{n$1.onChange?.(nt());})),i&&bt)try{An=i.attach(bt);}catch{try{i.destroy();}catch{}}return co(),Ul(),Le.setTableInteractionLabel=c=>{d.resolve=c,ca.refreshLabels();},Le.refreshTableInteractionLabels=()=>{ca.refreshLabels();},yv(Le,()=>({measurer:n$1.measurer,producer:n$1.producer,fontAlias:n$1.fontAlias,defaultFontFamily:n$1.defaultFontFamily}),c=>{n$1={...n$1,...c},x=n$1.measurer??h$1.measurer,k=I();},()=>{la||(Ht=bn(mt()),_t=void 0,ot=void 0,ar=null,We.invalidateAll(a.packageRevision(),"fonts"),We.flush());}),{ok:true,surface:Le}}function Pw(e,t,n,r,o){let a=new Map,i=oa$1(e,{resolveFont:l=>{let d$1=l.fontFamily??t.defaultFont.family;if(d$1.trim().length===0)return null;let u={family:d$1,weight:l.bold?700:400,style:l.italic?"italic":"normal"},f=g$2(u);if(a.has(f))return a.get(f)??null;let p;try{p=e.fonts.resolve(u);}catch{return a.set(f,null),null}let m=p instanceof d?null:p;return a.set(f,m),m},fallback:n.measurer}),s=`shaped:${e.operation.extensionFingerprint}+algorithm:${e.operation.shapingHash}+producer:${e.operation.producerVersion}+fallback:${n.producer}@scale:${r}+fonts:${o}`;return {measurer:i,producer:s}}function Cw(e,t){let n,r=false,o=()=>{r=false;let i=e();if(!i)return;let s=n?.generation!==i.generation;s&&(n={generation:i.generation,requested:new Set,running:false});let l=n;if(l.running||!s&&!i.dynamic)return;let d=i.dynamic?i.families().filter(u=>!l.requested.has(u.toLowerCase())):[];if(!(!s&&d.length===0)){for(let u of d)l.requested.add(u.toLowerCase());l.running=true,t(d).finally(()=>{l.running=false,n===l&&a();});}},a=(i=false)=>{if(i){o();return}r||(r=true,queueMicrotask(o));};return {schedule:a}}function Af(e){let t=[],n=(r,o)=>{let a=o.kind,i=r.handlers.kinds??e;return typeof a!="string"||!i||i.includes(a)};return {request(r){let o=t.filter(l=>n(l,r)),a=[...o].reverse().find(l=>!l.fallback)??o.at(-1);if(!a?.handlers.onRequest)return false;let{sessions:i,handlers:s}=a;return i.add(r),r.signal.addEventListener("abort",()=>i.delete(r),{once:true}),s.onRequest(r),true},register(r,o){let a={handlers:r,fallback:o?.fallback===true,sessions:new Set};return t.push(a),()=>{let i=t.indexOf(a);if(!(i<0)){t.splice(i,1);for(let s of a.sessions)s.cancel();}}}}}var r1=()=>Af();function Rw(){let e=r1(),t=Af(["dropdown","comboBox","date","buildingBlockGallery"]),n=Af();return {surfaceOptions:{onRequestTextFormField:e.request,onRequestContentControlWidget:t.request,onRequestInvalidTextFormField:n.request},setters:{setTextFormFieldChrome:e.register,setContentControlWidgetChrome:t.register,setInvalidTextFormFieldChrome:n.register}}}function Ow(e,t){let n=e.review;return n?{reviewModel:{...n,collectReviewItems:r=>n.collectReviewItems(e.customNodes.length>0?{...r,customNodes:e.customNodes,...e.customNodeDiagnostics.length>0?{reportCustomNodeDiagnostic:t}:{}}:r)}}:{}}var o1=["all-markup","simple-markup","proposed","original"];function Mw(e){let t=()=>e.placements().filter(l=>l.kind==="revision"&&(l.activatable||l.revisionKind==="format")),n=()=>e.surface()?.session.reviewItems().filter(l=>l.kind==="revision")??[],r=l=>{let d=nf$1(e.surface().session.currentPackage()),u=n(),f=new Set(l.keys??(l.scope==="document"?u:e.visible()).filter(k=>k.kind==="revision").map(Da)),p=new Map,m=l.scope==="document"&&l.keys===void 0;if(m){let k=e.surface().session;for(let C of k.storyParts())p.set(C.name,{scope:ft(k,C.root.id,{kind:"body"}),part:C,keys:[]});}for(let k of u){let C=e.scope(k),T=Ve(e.surface().session,Ca(k)[0]);if(!T)continue;let A=p.get(T.name);A||(A={scope:C,part:T,keys:[]},p.set(T.name,A));let O=Da(k);f.delete(O)&&A.keys.push(O);}let h=[],x=[...f].map(k=>({key:k,reason:"unknown-revision"})),v=[],b=[],I=0;for(let{scope:k,part:C,keys:T}of p.values()){let A=_a(C,l.action,m?void 0:T);h.push(...A.result.resolved),x.push(...A.result.skipped),I+=A.result.remaining,A.ops.length&&(C.name===d?.name?b.push({partName:C.name,ops:A.ops}):v.push({scope:k,ops:A.ops}));}return {groups:v,partOps:b,result:{resolved:h,skipped:x,remaining:I}}},o=()=>e.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.enabled()?e.surface()?{ok:true}:{ok:false,code:"notFound",reason:"no document is open"}:{ok:false,code:"unsupported",reason:gn},a=l=>{if(l.type!=="navigateReviewChange"&&l.type!=="resolveAllReviewChanges"&&l.type!=="setReviewDisplayMode")return null;let d=o();if(!d.ok)return d;if(l.type==="setReviewDisplayMode")return o1.includes(l.mode)?{ok:true}:{ok:false,code:"invalidArgs",reason:"unknown review display mode"};if(l.type==="navigateReviewChange"&&!["next","previous"].includes(l.direction))return {ok:false,code:"invalidArgs",reason:"unknown review navigation direction"};if(l.type==="resolveAllReviewChanges"&&!["accept","reject"].includes(l.action))return {ok:false,code:"invalidArgs",reason:"unknown review resolution action"};if(l.type==="navigateReviewChange")return t().length?{ok:true}:{ok:false,code:"notFound",reason:"no visible changes to review"};if(e.viewing())return {ok:false,code:"locked",reason:"the document is open for viewing"};let u=Pn(l,e.surface());if(u)return u;if(l.scope!==void 0&&!["visible","document"].includes(l.scope)||l.unsupported!==void 0&&!["skip","fail"].includes(l.unsupported)||l.keys!==void 0&&(!Array.isArray(l.keys)||l.keys.some(h=>typeof h!="string")))return {ok:false,code:"invalidArgs",reason:"invalid bulk revision selection"};let{result:f,groups:p,partOps:m}=r(l);return l.unsupported==="fail"&&f.skipped.length?{ok:false,code:"unsupported",reason:"some selected changes cannot be resolved"}:!f.resolved.length&&!p.length&&!m.length?{ok:false,code:f.skipped.length?"unsupported":"notFound",reason:"no eligible selected changes to review"}:{ok:true}};return {can:a,exec:l=>{if(!["navigateReviewChange","resolveAllReviewChanges","setReviewDisplayMode"].includes(l.type))return null;e.surface()?.flushPendingInput();let d=a(l);if(!d)return null;if(!d.ok){if(l.type==="resolveAllReviewChanges"&&(d.code==="notFound"||d.code==="unsupported")&&o().ok&&!e.viewing()){let{result:x}=r(l);return {...d,revisions:{...x,resolved:[],remaining:x.remaining+x.resolved.length}}}return d}let u=e.surface();if(l.type==="setReviewDisplayMode")return e.setDisplayMode(l.mode),{ok:true,changed:false};if(l.type==="navigateReviewChange"){let x=t(),v=x.findIndex(C=>C.isActive),b=l.direction==="next"?1:-1,I=v<0?a1(x,u,b):(v+b+x.length)%x.length,k=x[I];return e.activate(k.key,!k.activatable&&k.revisionKind==="format")}if(l.type!=="resolveAllReviewChanges")return null;let{groups:f,partOps:p,result:m}=r(l),h;return u.commitReviewOps(()=>(h=u.session.applyTreeOpsAtomic(f,{partOps:p}),h),"revision-resolve"),h?.committed?(e.activate(null),{ok:true,changed:true,revisions:{...m,remaining:n().length}}):{ok:false,code:"unsupported",reason:typeof h?.reason=="string"?h.reason:"the revisions were refused"}},resolveReviewItem:(l,d)=>{let u=o();if(!u.ok)return u;if(e.viewing())return e.surface().commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"revision-resolve"),{ok:false,code:"locked",reason:"the document is open for viewing"};let f=Pn({type:"resolveAllReviewChanges"},e.surface());if(f)return f;e.surface().flushPendingInput();let p=e.placements().find(h=>h.key===l)?.item;if(!p||p.kind!=="revision")return {ok:false,code:"notFound",reason:"no revision with that key"};if(p.readOnly)return {ok:false,code:"unsupported",reason:"this revision kind has no structural accept/reject yet"};let m;return e.surface().commitReviewOps(()=>{let h=e.surface().session,x=Ve(h,Ca(p)[0]);return x&&x.name===nf$1(h.currentPackage())?.name?(m=h.applyTreeOpsAtomic([],{partOps:[{partName:x.name,ops:Ew(p,d,x)}]}),m):(m=e.surface().session.applyTreeOps(Ew(p,d,e.surface().session.partFor(e.scope(p))),void 0,void 0,e.scope(p)),m)},"revision-resolve"),m?.committed?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:typeof m?.reason=="string"?m.reason:"the revision was refused"}}}}function a1(e,t,n){let r=t.state().selection.head,o=t.session.storyParts().find(s=>r.paragraphId.startsWith(`${s.name}#`)),a=o?fi$1(o):new Map,i=a.get(r.paragraphId);if(i!==void 0)for(let s=n>0?0:e.length-1;s>=0&&s<e.length;s+=n){let l=e[s],d=l.kind==="revision"?l.item.ranges[0]?.start:void 0,u=d?a.get(d.paragraphId):void 0;if(d&&u!==void 0&&(n>0?u>i||u===i&&d.offset>=r.offset:u<i||u===i&&d.offset<=r.offset))return s}return n>0?0:e.length-1}function Ew(e,t,n){let r=t==="accept"?"acceptRevision":"rejectRevision";if(!n)return [];if(e.revisionKind==="structural"||Hh$1(n.root).length>0||e.revisionKind==="format"&&Ca(e).length>1)return [..._a(n,t,[Da(e)]).ops];let o=new Set(Ca(e)),a=new Map;for(let i of Th(n)){if(!o.has(i.node.id))continue;let s=p=>i.node.attributes.find(m=>m.namespaceUri===da$1&&m.localName===p)?.value,l=e.addresses.find(p=>p.id===s("id")&&p.author===(s("author")??"")&&(p.date??"")===(s("date")??""));if(!l)continue;let d=i.node.localName,u=JSON.stringify([l,d]),f=a.get(u);f?f.siteNodeIds.push(i.node.id):a.set(u,{revision:l,localName:d,siteNodeIds:[i.node.id]});}return [...a.values()].map(({revision:i,localName:s,siteNodeIds:l})=>({op:r,revision:i,...s===void 0?{}:{localName:s},siteNodeIds:l}))}function Lf(e){return e.kind==="comment"?e.comment.date:e.kind==="revision"?e.date:void 0}function Nf(e,t,n,r){return e.type!=="toggleReviewPane"&&e.type!=="toggleParagraphMarks"&&e.type!=="setEditingMode"?null:t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.type==="toggleReviewPane"&&!n?{ok:false,code:"unsupported",reason:gn}:e.type==="setEditingMode"?r(e.mode)??{ok:true}:{ok:true}}function Fw(e){let t=false;return {get:()=>t,toggle:()=>{t=!t,e(t);}}}function Aw(e,t,n){if(!t)return false;switch(e.type){case "toggleMark":switch(e.mark){case "bold":return t.bold===true;case "italic":return t.italic===true;case "underline":return t.underline===true;case "strike":return t.strike===true;case "superscript":return t.superscript===true;case "subscript":return t.subscript===true;default:return false}case "setAlignment":return t.alignment===(e.align==="justify"?"both":e.align);case "toggleList":return n(e.kind);default:return false}}function i1(e){return e==="password"?{ok:false,code:"locked",reason:Lw}:e==="other-restriction"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:e==="no-change"?{ok:false,code:"invalidArgs",reason:"the document protection is already set"}:{ok:false,code:"unsupported",reason:"document protection could not be written"}}var Lw="this document is protected with a password; open it in Word to change that";function Nw(e){let t=null,n=null,r=()=>{let l=e.tracking();return [l.restrictedToReadOnly,l.restrictedToComments,l.restrictedToForms,l.restrictedToTrackedChanges].join("|")},o,a=null,i=()=>{let l=e.surface();if(!l)return null;let d=l.session.settingsRoot();return (d!==o||a===null)&&(o=d,a=d?Df$1(d):Cf$1),a},s=()=>{if(e.destroyed())return {ok:false,code:"notFound",reason:"the editor was destroyed"};let l=i();return l===null?{ok:false,code:"notFound",reason:"no document is loaded"}:e.hostViewOnly()?{ok:false,code:"locked",reason:"this document was opened for viewing"}:l.enforced&&l.password?{ok:false,code:"locked",reason:Lw}:!l.enforced&&l.edit!=="none"&&l.edit!=="forms"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:null};return {sync(){let l=e.surface()?.session.settingsRoot()??null;if(l===n&&t!==null)return;n=l;let d=r();d!==t&&(t=d,e.adopt(e.decision()));},prime:()=>{n=e.surface()?.session.settingsRoot()??null,t=r();},state:i,isActive:()=>i()?.enforced===true,can(l){return l.type!=="toggleDocumentProtection"?null:s()??{ok:true}},exec(l){if(l.type!=="toggleDocumentProtection")return null;let d=s();if(d&&!d.ok)return d;let u=e.surface(),f=!i().enforced,p=u.applyHeaderFooterLifecycle?.({op:"setDocumentProtection",enforce:f});return p?p.ok?(e.publish(),{ok:true,changed:true}):i1(p.reason):{ok:false,code:"unsupported",reason:"document protection is not available"}}}}var s1=e=>B(e);function Hw(){let e=new WeakMap;return t=>{let n=e.get(t);if(n)return n;let r=ja$2(t,s1);for(let o of t.pages){for(let a of [o.header,o.footer])a&&Dw(r,a.fragments,o.index,a.box.y);for(let a of [o.footnotes,o.endnotes])if(a)for(let i of a.notes)Dw(r,i.fragments,o.index,i.box.y);}return e.set(t,r),r}}function Dw(e,t,n,r){for(let o of C(t))for(let a of T(o))e.has(a)||e.set(a,{pageIndex:n,contentY:r,fragmentY:o.box.y,...o.lines?{lines:o.lines}:{}});}function Cl(e,t,n){return t.kind==="note"?e.enterNote?.(t.id,n)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the note could not be opened"}:(t.furnitureKind?e.enterHeaderFooter?.({rId:t.rId,kind:t.furnitureKind,position:n}):e.enterHeaderFooter?.({rId:t.rId,position:n}))?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the header or footer could not be opened"}}function l1(e){return e?.kind==="headerFooter"||e?.kind==="note"}function _w(e,t){return t!=="viewing"&&typeof e.enterHeaderFooter=="function"&&typeof e.enterNote=="function"?"all":"body"}function Rl(e,t){e.activeScope().kind!=="body"&&e.session.paragraphIds().includes(t)&&(e.exitNote?.(),e.exitHeaderFooter?.());}function Bw(e,t){if(typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0)return {ok:false,code:"invalidArgs",reason:"match must carry a blockId and offsets"};if(t.scope?.kind==="frame"){let{drawingNodeId:r,hostParagraphId:o}=t.scope;if(typeof r!="string"||r.length===0||typeof o!="string"||o.length===0)return {ok:false,code:"invalidArgs",reason:"a frame match must carry drawing and host paragraph ids"};let a={ok:false,code:"unsupported",reason:"the text box drawing could not be selected"};if(!al(e.layout(),r,o))return a;let i=t.scope.owner;if(i){let s=Cl(e,i,{paragraphId:o,offset:0});if(!s.ok)return s}else Rl(e,o);return e.revealParagraph(o),e.selectDrawing(r,o)?{ok:true,changed:false}:a}let n={paragraphId:t.blockId,offset:t.start};if(l1(t.scope)){let r=Cl(e,t.scope,n);if(!r.ok)return r}else {if(t.scope&&t.scope.kind!=="body")return {ok:false,code:"unsupported",reason:"the match scope cannot be opened"};Rl(e,t.blockId);}return e.setSelection({anchor:n,head:{paragraphId:t.blockId,offset:t.start+t.length}}),e.revealParagraph(t.blockId),{ok:true,changed:false}}function $w(e){if(e==="")return;let t=globalThis.navigator?.clipboard;if(t?.writeText)try{t.writeText(e).catch(()=>{});}catch{}}function Df(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(()=>{$w(e);});return}catch{}$w(e);}function d1(e){return typeof e=="object"&&e!==null&&"container"in e&&Array.isArray(e.path)}function c1(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function qw(e){return Zw(e.children)}function Zw(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||Ac$2(n))&&t.push(n);return t}function u1(e){if(Ac$2(e))return Zw(Dc$1(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(...qw(r));return t}function f1(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"?Ad$1(a):yd(a).find(m=>r.part==="header"||r.part==="footer"?m.kind===r.part:m.kind==="note"&&id$1(m.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 l=qw(s),d;for(let m=0;m<t.path.length;m+=1){let h=t.path[m];if(!Number.isInteger(h)||h<0)return {ok:false,code:"invalidArgs",reason:"DocLocation indices must be non-negative"};if(d=l[h],!d)return {ok:false,code:"notFound",reason:`block index ${h} is out of range`};m<t.path.length-1&&(l=u1(d));}if(!d||d.kind!=="paragraph"||!Ha(a,d.id))return {ok:false,code:"invalidArgs",reason:"DocLocation must resolve to a paragraph"};let u=(Pi(a,d.id)??"").length,f=t.offset??(n==="start"?0:u);if(!Number.isInteger(f)||f<0||f>u)return {ok:false,code:"invalidArgs",reason:"DocLocation offset is outside the paragraph"};let p={paragraphId:d.id,offset:f};return {ok:true,selection:{anchor:p,head:p}}}function El(e,t,n){if(d1(t))return f1(e,t,n);if(!Ct(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=ft(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=mn(i,r,t);if(!s.ok)return s;let l=n==="start"?s.span.start:s.span.end,d={paragraphId:s.span.nodeId,offset:l};return {ok:true,selection:{anchor:d,head:d}}}function Ol(e,t){if(!c1(t)){let o=El(e,t,"start");if(!o.ok)return o;let a=El(e,t,"end");return a.ok?{ok:true,selection:{anchor:o.selection.anchor,head:a.selection.head}}:a}let n=El(e,t.from,"start");if(!n.ok)return n;let r=El(e,t.to,"end");return r.ok?{ok:true,selection:{anchor:n.selection.anchor,head:r.selection.head}}:r}function p1(e){return e.evenPage?"even":e.firstPage?"first":"default"}function Kw(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'"}:p1(e)}function Hf(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?Kw(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 m1(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 gi(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}:m1(n.reason)}function Ml(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 Vw(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=Kw(t);if(typeof o=="object"&&o.ok===false)return {ok:false,code:"invalidArgs",reason:o.reason};let a=o,s=Ml(e,n,r,a)?.rId,l=false;if(!s){let u=gi(e,{op:"createHeaderFooter",sectionIndex:n,kind:r,variant:a,...a==="first"?{titlePage:true}:{},...a==="even"?{evenAndOddHeaders:true}:{}});if(!u.ok)return u;l=true,s=Ml(e,n,r,a)?.rId;}return s?e.enterHeaderFooter({rId:s,kind:r,sectionIndex:n,variant:a})?{ok:true,changed:l}:{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 zw(e,t){let n=Hf(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=r?.rId,a=gi(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 jw(e,t){let n=Hf(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=gi(e,{op:"linkToPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!a.ok)return a;if(o){let i=Ml(e,n.sectionIndex,n.kind,n.variant);i?e.enterHeaderFooter({rId:i.rId,kind:n.kind,sectionIndex:n.sectionIndex}):e.exitHeaderFooter();}return a}function Ww(e,t){let n=Hf(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=gi(e,{op:"unlinkFromPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!i.ok)return i;let s=Ml(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 Uw(e,t){let n=e.headerFooterState(),r=t.sectionIndex??n?.sectionIndex;return gi(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 Gw(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 Xw(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 Yw(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 Qw(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 Jw(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 eI(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 nI(e,t,n){switch(t.type){case "toggleMark":{let r=ou.get(t.mark);e.toggleRunProperty(r.localName,r.attributes);break}case "setMarkAttr":{let r=au(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 "copyFormatting":return e.formatPainter.capture()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:Os};case "pasteFormatting":{let r=e.formatPainter.apply();if(r==="nothingToPaint")return {ok:false,code:"notFound",reason:Kc};if(r==="refused")return {ok:false,code:"locked",reason:e.state().lastRejection??Kc};break}case "setLineSpacing":e.setParagraphProperty("spacing",Sl({rule:t.rule,value:t.value}),{mergeAttributes:true});break;case "setParagraphSpacing":e.setParagraphProperty("spacing",{..._o("before",t.beforePt),..._o("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(),l=o??s.pageSize.widthTwips,d=a??s.pageSize.heightTwips;o=t.orientation==="landscape"?Math.max(l,d):Math.min(l,d),a=t.orientation==="landscape"?Math.min(l,d):Math.max(l,d);}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":if(e.type(t.text),e.state().lastRejection==="the table of contents is generated and read-only"||e.state().lastRejection===Us)return {ok:false,code:"invalidArgs",reason:e.state().lastRejection};break;case "deleteText":e.deleteSelection();break;case "proposeInsertion":case "proposeDeletion":case "proposeReplacement":{if(t.target!==void 0){let a=Ol(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 "editTextFormField":return e.editTextFormField()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"field options are unavailable"};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 Vw(e,t);case "exitHeaderFooter":return typeof e.exitHeaderFooter=="function"&&e.exitHeaderFooter(),{ok:true,changed:false};case "removeHeaderFooter":return zw(e,t);case "linkHeaderFooterToPrevious":return jw(e,t);case "unlinkHeaderFooterFromPrevious":return Ww(e,t);case "setHeaderFooterOptions":return Uw(e,t);case "insertPageField":return Gw(e,t);case "insertNote":return Xw(e,t);case "deleteNote":return Yw(e,t);case "convertNote":return Qw(e,t);case "convertAllNotes":return Jw(e,t);case "setNoteProperties":return eI(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(!hr(t))return {ok:false,code:"unsupported",reason:"unsupported command"};let r=n?.admittedTablePlan??jn({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 Df(r.text,r.html),{ok:true,changed:false}}case "cut":{let r=e.copyFlavours();Df(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&&iu(t.range))return e.setSelection(t.range),e.revealPosition(t.range.head,{block:"centerIfNeeded"}),{ok:true,changed:false};let r="anchor"in t&&Ct(t.anchor)?{anchor:t.anchor}:"range"in t&&zr(t.range)?{range:t.range}:null;if(r===null)return {ok:false,code:"unsupported",reason:"unsupported selection form"};let o=Wb(e.session.part(),e.session.paragraphAnchors(),r);if(!o.ok)return o;let a=y1(e,o.selection);return a.ok?(e.setSelection(o.selection),e.revealPosition(o.selection.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):a}default:return Ya(t)?b0(e,t,n?.editor):{ok:false,code:"unsupported",reason:"unsupported command"}}return null}function tI(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 C(o.fragments))if(a.paragraphId===t)return o.scopeId}return null}function g1(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 C(a.fragments))if(i.paragraphId===t)return {pageIndex:r,sectionIndex:e.sectionAtPage(r).sectionIndex}}}return null}function h1(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 y1(e,t){let n=ft(e.session,t.head.paragraphId,{kind:"body"}),r=ft(e.session,t.anchor.paragraphId,{kind:"body"});if(!h1(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 l=g1(e,t.head.paragraphId);return e.enterHeaderFooter?.({rId:n.rId,...l?{pageIndex:l.pageIndex,sectionIndex:l.sectionIndex}:{}})?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that header or footer could not be opened"}}let a=tI(e,t.head.paragraphId);return a?(t.anchor.paragraphId===t.head.paragraphId?a:tI(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"}}var b1=new Set(["toggleMark","setMarkAttr","setAlignment","clearFormatting","setLineSpacing","setParagraphSpacing","setParagraphStyle","setParagraphFormat"]),Fl=class{constructor(t,n,r){this.owner=t;this.diagnose=n;this.target=r;}owner;diagnose;target;records=new WeakMap;undoEpoch=0;burst;diagnoseWrites(t,n,r=false){if(t.type!=="setMarkAttr"||!n.ok||!n.changed)return;let o=`${r}:${t.mark}:${t.attr}:${this.target()}`,a=Date.now(),i=this.burst,s=i?.key===o&&a-i.time<=250?i.count+1:1;this.burst={key:o,time:a,count:s},s===3&&this.diagnose({kind:r?"possible-fragmented-gesture":"possible-ungrouped-gesture",reason:"Three rapid formatting writes started separate groups at the same selection. For a continuous control, retain one handle with bindHistoryGroup; separate clicks may be intentional."});}begin(){let t=this.owner(),n={token:Symbol("gesture"),owner:t?new WeakRef(t):void 0,closed:false,committed:false,undoEpoch:this.undoEpoch},r=v1(n,new WeakRef(this));return this.records.set(r,n),r}owns(t){return t!==void 0&&t===this.owner()}gate(t,n){let r=n?.historyGroup;return r===void 0?null:!this.records.get(r)||r.state!=="open"?{ok:false,code:"unsupported",reason:"historyGroup must be an open handle from this editor and document"}:b1.has(t.type)?null:{ok:false,code:"unsupported",reason:`${t.type} does not support history grouping`}}note(t){(t.type==="undo"||t.type==="redo")&&this.undoEpoch++;}run(t,n,r,o){let a=r?.historyGroup,i=a&&this.records.get(a);if(!i){let m=mi(t,void 0,o);return this.diagnoseWrites(n,m),m}let s=i.committed,l,d,u=Xi(i.token,(m,h)=>{l=m,d=h;},()=>mi(t,i.token,o));if(!u.ok)return u;let p=l===void 0?{kind:"none",reason:"no-history"}:l==="split"||l==="started"&&s?{kind:"split",reason:d??(i.undoEpoch!==this.undoEpoch?"undo-redo":"history-boundary")}:{kind:l};return l&&(i.committed=true,i.undoEpoch=this.undoEpoch),p.kind==="started"?this.diagnoseWrites(n,u,true):this.burst=void 0,p.kind==="split"&&this.diagnose({kind:"split",reason:p.reason??"history-boundary"}),{...u,history:p}}};function v1(e,t){return Object.freeze({get state(){return !e.closed&&t.deref()?.owns(e.owner?.deref())?"open":"closed"},end(){e.closed=true,e.owner=void 0;}})}var rI={selection:null,pendingFormat:null,headerFooter:null,drawingIntent:"none",formatPainter:"off/none"};function oI(e,t){let n=t.headerFooterState?.();return {selection:e.selection,pendingFormat:e.pendingFormat,headerFooter:n?.editing&&n.rId?`${n.editing}:${n.rId}`:null,drawingIntent:l0(t.drawingSelectionIntent()),formatPainter:`${e.formatPainter.mode}/${e.formatPainter.level}`}}function aI(){let e={...rI};return {moved(t,n){let r=oI(t,n),o=Ds(r.selection,e.selection)&&r.pendingFormat===e.pendingFormat&&r.headerFooter===e.headerFooter&&r.drawingIntent===e.drawingIntent&&r.formatPainter===e.formatPainter;return e=r,!o},adopt(t){e=oI(t.state(),t);},reset(){e={...rI};}}}function x1(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 d=n-22;d>=o;d-=1)if(r.getUint32(d,true)===101010256){a=d;break}if(a<0)return false;let i=r.getUint16(a+10,true),s=r.getUint32(a+16,true),l=0;for(let d=0;d<i;d+=1){if(s+46>n||r.getUint32(s,true)!==33639248)return false;if(l+=r.getUint32(s+24,true),l>=t)return true;s+=46+r.getUint16(s+28,true)+r.getUint16(s+30,true)+r.getUint16(s+32,true);}return false}function iI(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||x1(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 sI(e){return t=>{for(let n of e.customNodeDiagnostics)try{n(t);}catch{}}}function lI(e,t){t.customNodePayloadNamespaces.length!==0&&e.session.sweepCustomNodePayloads(t.customNodePayloadNamespaces);}function dI(e){return e.kind==="comment"}function cI(e){let{surface:t}=e,n=t?.retainedSelection()??t?.state().selection??null;if(!n)return null;let{anchor:r,head:o}=n;if(r.paragraphId===o.paragraphId&&r.offset===o.offset||!t?.publishedLayout())return null;let a=e.bodyOrder(),i=a.get(r.paragraphId)??-1,s=a.get(o.paragraphId)??-1;if(i===-1||s===-1){let d=e.openStoryOrder();i=d.get(r.paragraphId)??-1,s=d.get(o.paragraphId)??-1;}return i===-1||s===-1?null:i<s||i===s&&r.offset<=o.offset?{from:r,to:o}:{from:o,to:r}}function S1(e){let t=new Map;for(let n of e){let r=n.item;if(!dI(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 w1(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(dI);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 uI(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=w1(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=S1(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 u=a.get(i.parentId);if(!u)break;i=u;}let l=false,d=false;return e.surface.commitReviewOps(()=>{let u=e.surface.session.packageRevision();return l=e.surface.session.setCommentResolved(i.id,n),d=l&&e.surface.session.packageRevision()!==u,{committed:d}},"comment-resolve"),l?(d&&e.bump(),{ok:true,changed:d}):{ok:false,code:"notFound",reason:"the comment could not be resolved"}}function fI(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 pI=new WeakMap;function P1(e){return !(!e.story||e.origin===b$2.mutationUndo||e.origin===b$2.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.some(t=>t!==g$1.story))}function C1(e,t){P1(t)||(e.summaries=null);}function R1(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>C1(t,n)));}function gI(e){}function hI(e,t){let n=pI.get(e);return n||(n={summaries:null,subscribed:false},pI.set(e,n)),R1(e,n),n.summaries||(n.summaries=t()),n.summaries}var E1=new Map([["richText","richText"],["plainText","plainText"],["dropdown","dropDownList"],["dropDownList","dropDownList"],["comboBox","comboBox"],["date","date"]]);function O1(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function M1(e,t){let n=e.session.part(),r=e.session.paragraphAnchors();if(Ct(t)){let o=mn(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(O1(t)){if(!Ct(t.from)||!Ct(t.to))return {ok:false,code:"unsupported",reason:"address the span with paraId anchors; DocLocation endpoints are not supported",target:t};let o=mn(n,r,t.from);if(!o.ok)return {ok:false,code:o.code,reason:o.reason,target:t};let a=mn(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 _f(e,t){let n=E1.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=Ur(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=M1(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 F1="http://schemas.microsoft.com/office/word/2010/wordml",A1="http://schemas.microsoft.com/office/word/2012/wordml";function Jr(e){return Ed(e)}function hi(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlProperties"||t.localName==="sdtPr"))return t}function L1(e){if(e.kind!=="textValue"){for(let t of e.attributes)if(t.localName==="val"&&t.namespaceUri===da$1)return t.value}}function Bf(e,t){if(e){for(let n of e.children)if(n.kind!=="textValue"&&n.localName===t)return L1(n)}}function N1(e){if(!e)return "richText";for(let t of e.children){if(t.kind==="textValue")continue;let n=D1(t);if(n!==void 0)return n}return "richText"}function D1(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(n==="docPartList")return "buildingBlockGallery";if(t==="contentControlText"||n==="text")return "plainText";if(n==="richText")return "richText";if(n==="checkbox"&&(r===F1||t==="contentControlCheckbox"))return "checkbox";if(n==="repeatingSection"&&r===A1)return "repeatingSection"}function Al(e){let t=Bf(e,"lock");return t==="contentLocked"||t==="sdtContentLocked"}function H1(e,t){if(Al(hi(t)))return true;let n=Ia(e,t.id);for(;n;){if(Jr(n)&&Al(hi(n)))return true;n=Ia(e,n.id);}return false}function qf(e,t){let n=hi(e),r=Bf(n,"tag"),o=Bf(n,"alias"),a=t?H1(t,e):Al(n);return {id:e.id,controlType:N1(n),...r!==void 0?{tag:r}:{},...o!==void 0?{alias:o}:{},...a?{locked:true}:{}}}var yI=new WeakMap;function _1(e,t){let n=[],r=Ia(e,t.id);for(;r;)Jr(r)&&n.push(`${r.id}:${Al(hi(r))?1:0}`),r=Ia(e,r.id);return n.join("|")}function vI(e){return Object.freeze({...e,...e.tag!==void 0?{tag:e.tag}:{},...e.alias!==void 0?{alias:e.alias}:{},...e.locked?{locked:true}:{}})}function B1(e){return Object.freeze(e.map(t=>vI(t)))}function $1(e,t){let n=e.node,r=hi(n),o=_1(t,n),a=yI.get(n);if(a&&a.properties===r&&a.lockAncestors===o)return a.summary;let i=vI(qf(n,t));return yI.set(n,{properties:r,lockAncestors:o,summary:i}),i}function q1(e){let t=Lc$1(e.root);return gI(t.length),t.map(n=>$1(n,e))}function Z1(e){return B1(e.storyParts().flatMap(t=>q1(t)))}function K1(e){return hI(e,()=>Z1(e))}function $f(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 V1(e){let t=[];if(e.kind!=="paragraph")return t;let n=(r,o,a,i)=>{if(i>=la$1)return o;let s=o;for(let l of r)if(l.kind!=="paragraphProperties"){if(l.kind==="run"){s+=Ve$1(e,l);continue}if(na$1(l)){s=n(l.children,s,a,i+1);continue}if(Jr(l)){let d=s,u=a+1;s=n(Dc$1(l),s,u,i+1),t.push({control:l,start:d,end:s,depth:u});continue}s+=Ve$1(e,l);}return s};return n(e.children,0,-1,0),t}function Zf(e,t,n){return V1(e).filter(r=>t>=r.start&&t<r.end).sort((r,o)=>o.depth-r.depth).map(r=>qf(r.control,n))}function Kf(e,t){let n=[],r=Ia(e,t);for(;r;)Jr(r)&&n.push(qf(r,e)),r=Ia(e,r.id);return n.reverse()}function xI(e,t){if(!e)return [];let n=K1(e.session);return t?n.filter(r=>$f(r,t)):n}function Vf(e,t){if(!e)return null;let{paragraphId:n,offset:r}=e.state().selection.head,o=Ve(e.session,n)??e.session.part(),a=Ha(o,n);if(a&&a.kind==="paragraph"){for(let s of Zf(a,r,o))if($f(s,t))return s}let i=Kf(o,n);for(let s=i.length-1;s>=0;s-=1){let l=i[s];if($f(l,t))return l}return null}function zf(e){return e.type==="insertContentControl"||e.type==="setContentControlValue"||e.type==="removeContentControl"}function z1(e){return typeof e=="object"&&e!==null&&"container"in e&&"path"in e}function j1(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function W1(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 Ll(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||Jr(n))&&t.push(n);return t}function U1(e){let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...Ll(r.children));return t}function G1(e){return e.kind==="table"?U1(e):Jr(e)?Ll(Dc$1(e)):e.kind==="body"?Ll(e.children):[]}function X1(e,t,n){if(Jr(t))return {ok:true,controlId:t.id};if(t.kind==="paragraph"){let r=n??0;for(let i of Zf(t,r,e))return {ok:true,controlId:i.id};let a=Kf(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 Y1(e,t){if(t.container.part!=="body")return {ok:false,code:"unsupported",reason:"only the body container is supported",target:t};let n=W1(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=Ll(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=G1(o));}if(!o)return {ok:false,code:"notFound",reason:"the addressed block was not found",target:t};let a=X1(e,o,t.offset);return a.ok?a:{...a,target:t}}function Q1(e,t,n){let r=mn(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=Ha(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 d of Zf(a,i,o))return {ok:true,controlId:d.id};let l=Kf(o,a.id).at(-1);return l?{ok:true,controlId:l.id}:{ok:false,code:"notFound",reason:`no content control encloses paragraph '${n.paraId}'`,target:n}}function SI(e,t){if(t===void 0){let r=Vf(e);return r?{ok:true,controlId:r.id}:{ok:false,code:"notFound",reason:"no content control at the current selection"}}if(j1(t))return {ok:false,code:"unsupported",reason:"DocRange targeting is not supported for content controls",target:t};let n=e.session.part();return z1(t)?Y1(n,t):Ct(t)?Q1(n,e.session.paragraphAnchors(),t):{ok:false,code:"invalidArgs",reason:"unrecognized target shape",target:t}}function wI(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 II(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 kI(e,t){return {ok:false,code:wI(e),reason:II(e),...t!==void 0?{target:t}:{}}}function J1(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 jf(e){return e==="viewing"?"view":e==="suggesting"?"suggesting":"edit"}function Wf(e,t,n,r){let o=J1(e,t,n,r);if(!o.ok)return o.refusal;if(e.type==="insertContentControl"){let s=_f(t,e);return s.ok?bI(t,s.op,s.span.paragraphId):{ok:false,code:s.code,reason:s.reason}}let a=SI(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 bI(t,i,a.controlId)}function bI(e,t,n){let r=Ve(e.session,n)??e.session.part(),o=Lf$1(e.session.currentPackage()),a=hi$1(o,t)??qi(r,o,t)??Vi(r,t);return a?{ok:false,code:wI(a),reason:II(a)}:{ok:true}}function TI(e,t,n,r){t?.flushPendingInput();let o=Wf(e,t,n,r);return o.ok?eM(t,e):o}function PI(e,t,n,r,o){let a=e.applyGatedTreeOps;return typeof a=="function"?a.call(e,t,n,r,o):e.session.applyTreeOps(t,n,r,o)}function eM(e,t){if(t.type==="insertContentControl")return tM(e,t);let n=SI(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=Ur(e.state().selection),o=t.type==="setContentControlValue"?{op:"setContentControlValue",controlId:n.controlId,value:t.value}:{op:"removeContentControl",controlId:n.controlId},a=PI(e,[o],r,r,ft(e.session,n.controlId,{kind:"body"}));return a.rejected?kI(a.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:a.committed})}function tM(e,t){e.flushPendingInput();let n=_f(e,t);if(!n.ok){let d=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...d!==void 0?{target:d}:{}}}let{paragraphId:r,start:o,end:a}=n.span,i=Ur(e.state().selection),s={paragraphId:r,start:o,end:a},l=PI(e,[n.op],i,s,ft(e.session,r,{kind:"body"}));return l.rejected?kI(l.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:l.committed})}var nM=Object.freeze(["Arial","Calibri","Cambria","Consolas","Courier New","Garamond","Georgia","Helvetica","Open Sans","Roboto","Times New Roman","Verdana"]),rM=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function CI(e,t){let n=new Map,r=s=>{if(s===void 0||!rM.test(s))return;let l=s.toLowerCase();n.has(l)||n.set(l,s);};r(f$1(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 a$8([e?.supportedFamilies]))r(s);for(let s of nM)r(s);for(let s of t)r(s);let i=[...n.values()];return i.sort((s,l)=>s<l?-1:s>l?1:0),i}var RI=e=>new a("overLimit",`font source ${e.id} exceeds the font byte budget`,{request:e.request}),EI=e=>new a(e.reason,e.reason==="overLimit"?`embedded font ${e.request.family} (${e.partName}) exceeds the font byte budget`:`embedded font part ${e.partName} declares an invalid family name`,{request:e.request});function OI(e,t){return m$2(e,t)}function Uf(e,t,n){return n$1(e,t,n)}var oM="The quick brown fox 0123 \u2014 {}#@",aM=["monospace","serif"],iM=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function FI(e){if(!e)return ()=>true;let t=new Map,n=r=>(e.font=r,e.measureText(oM).width);return r=>{let o=t.get(r);if(o!==void 0)return o;if(!iM.test(r))return t.set(r,true),true;let a=false;for(let i of aM){let s=n(`32px ${i}`);if(n(`32px "${r}", ${i}`)!==s){a=true;break}}return t.set(r,a),a}}var MI=4;function AI(e,t,n){let r=new Set,o=[];for(let u of t){let f=u.toLowerCase();r.has(f)||(r.add(f),o.push(u));}let a=u=>new Set(e.slice(0,Math.max(u,0)).map(f=>f.toLowerCase())),i=0;for(let u=0;u<=MI;u+=1){let f=a(n-i),p=o.filter(h=>!f.has(h.toLowerCase())).length,m=Math.min(p,MI,Math.floor(n/2));if(m===i)break;i=m;}let s=e.slice(0,Math.max(n-i,0)),l=a(n-i),d=o.filter(u=>!l.has(u.toLowerCase()));return [...s,...d].slice(0,n)}function LI(e,t,n){let r=[];for(let o of e){if(t(o)||n(o))continue;let a=aa.get(o.toLowerCase());a!==void 0&&n(a)||r.push(o);}return r}function NI(e,t){let n=new Set(e.map(r=>r.request.family.toLowerCase()));for(let r=0;r<t.length;r+=1){let o=false;for(let a of t){let i=a.from.family.toLowerCase();n.has(i)||!n.has(a.to.family.toLowerCase())||(n.add(i),o=true);}if(!o)break}return n}var DI=new WeakMap,sM=0,lM=p((e,t)=>{if(e.kind==="paragraphProperties"){let n=DI.get(e);return n||(n=String(++sM),DI.set(e,n)),{families:[n],children:[]}}return {families:e.kind==="paragraph"&&!e.children.some(n=>n.kind==="paragraphProperties")?["default-paragraph"]:[],children:q(e,t)}});function HI(e){return lM(e,{key:""})}var _I=new WeakMap;function BI(e){let t=e.packageRevision(),n=_I.get(e);if(n?.revision===t)return n.families;let r$1=n?.eastAsianFonts??r(),o=e.storyParts().map(p=>p.root),a=e.stylesRoot(),i=e.numberingRoot(),s=e.documentThemeFonts(),l=HI(o),u=n&&n.stylesRoot===a&&n.numberingRoot===i&&n.theme===s&&n.numberingInputs.length===l.length&&n.numberingInputs.every((p,m)=>p===l[m])?n.numberingFamilies:v(o,i,a,s),f=[...e.symbolFontFamilies(),...r$1(o,a,s),...t$1(o),...u];return _I.set(e,{eastAsianFonts:r$1,revision:t,families:f,numberingInputs:l,numberingFamilies:u,numberingRoot:i,stylesRoot:a,theme:s}),f}var $I=Object.freeze({installed:0,alias:()=>{},dispose(){}});function dM(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)}`}var Nl=e=>e.trim().toLowerCase();function cM(){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 qI(e,t=cM(),n=[]){let{fontSet:r,createFontFace:o}=t;if(!r||!o||e.length===0)return $I;let a=new Map;for(let d of e){let u=Nl(d.request.family),f=a.get(u);f?f.push(d):a.set(u,[d]);}let i=new Map,s=[];if(await Promise.all([...a].map(async([d,u])=>{let f=dM(u.map(m=>m.hash)),p=false;await Promise.all(u.map(async m=>{try{let h=o(f,m.bytes,{weight:String(m.request.weight),style:m.request.style});await h.load(),r.add(h),s.push(h),p=!0;}catch{}})),p&&i.set(d,f);})),s.length===0)return $I;for(let d of n){let u=Nl(d.from.family);if(i.has(u))continue;let f=i.get(Nl(d.to.family));f!==void 0&&i.set(u,f);}let l=false;return {installed:s.length,alias:d=>l?void 0:i.get(Nl(d)),dispose(){if(!l){l=true;for(let d of s)try{r.delete(d);}catch{}}}}}var yi=.1,bi=5;var Bo={type:"fit",fit:"pageWidth",minZoom:.5,maxZoom:1},uM={type:"fit",fit:"pageWidth"},Dl={type:"fixed"};function Hl(e){return e==="auto"?Bo:!e||typeof e!="object"?null:e.type==="fixed"?Dl:e.type==="fit"&&e.fit==="pageWidth"?_l(e,Bo)?Bo:e:null}function _l(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 $o(e){return e.type==="fit"}function KI({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)?ZI(r):.1,l=Number.isFinite(o)?ZI(o):5,d=Math.floor(i/t*100)/100;return Math.min(Math.max(d,s),Math.max(l,s))}function ZI(e){return Math.min(Math.max(e,.1),5)}function fM(e){let t=zt(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 VI(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 l=e.mode();if(!$o(l))return;let d=e.container();if(!d)return;let u=fM(d);if(u===null)return;let f=e.pageWidthPx();if(f===null)return;o=e.pageWidthTwips();let p=KI({availableWidthPx:u,pageWidthPx:f,...l.minZoom!==void 0?{minZoom:l.minZoom}:{},...l.maxZoom!==void 0?{maxZoom:l.maxZoom}:{}});p===null||p===e.zoom()||e.applyZoom(p);}function s(){let l=n?.ownerDocument.defaultView;if(!l?.requestAnimationFrame){i();return}r===null&&(r=l.requestAnimationFrame(()=>{r=null,i();}));}return {refitIfPageResized(){let l=e.pageWidthTwips();l===null||l===o||i();},attach(){this.detach();let l=e.container();if(!l)return;let d=zt(l);d&&(n=d,typeof ResizeObserver<"u"&&(t=new ResizeObserver(s),t.observe(d)),i());},refit:i,detach(){a(),t?.disconnect(),t=null,n=null,o=null;}}}function jI(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=Hl(e.zoomMode??(n!==null?Dl:"auto"))??Bo;function a(l,d){if(l===r)return d?.(),true;let u=t.surface();return u&&!Tw(u,l*(96/72))?false:(r=l,d?.(),t.bump(),t.emitSelectionChange(),true)}function i(){o=Dl,s.detach();}let s=VI({container:t.container,mode:()=>o,pageWidthPx:()=>{let l=t.surface()?.layout().pages[0]?.box;return l?l.width*(96/72):null},pageWidthTwips:()=>t.surface()?.sectionProperties().pageSize.widthTwips??null,zoom:()=>r,applyZoom:l=>{a(l);}});return {zoom:()=>r,mode:()=>o,scale:()=>r*(96/72),attach:()=>{$o(o)&&s.attach();},detach:()=>s.detach(),refit:()=>s.refit(),refitIfPageResized:()=>s.refitIfPageResized(),setZoom(l){if(!Number.isFinite(l)||l<.1||l>5)return {ok:false,code:"invalidArgs",reason:`zoom must be between ${.1} and ${5}, got ${l}`};let d=$o(o);return l===r?d?(i(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:true,changed:false}:a(l,d?i:void 0)?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:`the mounted surface could not apply zoom ${l}`}},setZoomMode(l){let d=Hl(l);return d?_l(d,o)?{ok:true,changed:false}:(o=d,$o(d)?s.attach():s.detach(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:false,code:"invalidArgs",reason:`unknown zoom mode ${JSON.stringify(l)}`}}}}function zI(e){let t=1.3333333333333333;return {x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t}}function WI(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:zI(r.box),contentBox:zI(r.contentBox)})):[]}}}var UI=new Map;function GI(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=c(o,t);return n={slots:o,colors:t,value:a},a},styleFor:o=>((!r||r.colors!==t)&&(r={colors:t,value:b$1(t)}),r.value.get(o))}}function Gf(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);})}}function XI(e){let t=hh(e),n=new Intl.Locale(t).baseName;for(;n&&!Object.hasOwn(locales,n);){let s=n.lastIndexOf("-");n=s<0?"":n.slice(0,s);}let r=new Intl.Locale(t).maximize(),o=n?void 0:Object.keys(locales).find(s=>{let l=new Intl.Locale(s).maximize();return l.language===r.language&&l.script===r.script}),a=n||o||"en",i=createT(deepMerge(en$1,a==="en"?void 0:locales[a]),a);return {locale:t,labels:{title:i("toolbar.tableOfContents")}}}function YI(e){let t=e.mode,n=e.translate,r=n?i$2(n):h,o=XI(e.locale);return {mode:()=>t,modeForGate:()=>t??"edit",openingModeDecision:a=>cu(t,a),setMode(a){return t===a?false:(t=a,true)},translate:()=>n,drawingStrings:()=>r,setTranslate(a){if(n===a)return null;n=a;let i=a?i$2(a):h;return g(r)===g(i)?(r=i,null):(r=i,r)},locale:()=>o.locale,tocLabels:()=>o.labels,setLocale(a){let i=XI(a);return o.locale===i.locale?null:(o=i,o.labels)}}}function QI(e,t){return {setTranslate(n){let r=e.setTranslate(n);t.surface()?.setTranslate(e.translate()),r!==null&&(t.surface()?.setDrawingStrings(r),t.bump(),t.emitSelectionChange());},setLocale(n){let r=e.setLocale(n);r!==null&&(t.surface()?.setLocale(e.locale()),t.surface()?.setTocLabels(r),t.bump(),t.emitSelectionChange());}}}var hM=Object.freeze({kind:"body"}),yM=Object.freeze([]);function bM(e$1){let t$1=YI(e$1),n=Wu(e$1.author),r=e$1.container??null,o=a$3(e$1.modules),a$2=sI(o),i=o.review!==null,s=null,l=new WeakMap,d$1=iI({mount:w=>kt(w),scheduled:()=>{Se(),Ye();}}),u=t$1.mode()==="view"?"viewing":"editing",f=null,p,m=false,h=il(),x=GI(e$1.revisionStyles),v=e(),b=false,I=false,k=null,C$1=()=>({reviewEnabled:i,hasAuthor:!!n}),T$1=false,A=null,O=e0({stillMissing:()=>!B&&n===void 0&&Cr(null)===yr,emit:w=>St(w)}),$=t$1.openingModeDecision(C$1());$.mode!==null&&(u=$.mode),$.rejection!==null&&(k=$.rejection),O.report($.rejection);let y=null,R=null,L=null,_=null,j=aI(),F=Rw(),H$1=Gf({}),V$1=Gf({}),B=false,X,ae,ce=null,xe=()=>{},fe=0;function D(){ce?.dispose(),ce=null;}let M=0,q,Z=()=>typeof e$1.fonts=="function"?q:e$1.fonts,Y=Cw(()=>{if(B||!y)return null;let{session:w}=y,[U]=a$8([[Ot().formatting?.fontFamily]]);return {generation:M,dynamic:typeof e$1.fonts=="function",families:()=>AI([...new Set([...U&&U!==f$1(Z())?[U]:[],...w.documentFonts()])],BI(w),c$1)}},async w=>{y&&await vi(M,y,w);}),E=false,K=null,W=w=>(K||(K=FI(r?Ao(r.ownerDocument):null)),K(w)),ee=new Set,re=w=>ee.has(w.toLowerCase())||ce?.alias(w)!==void 0,te=()=>!y||E?yM:LI(y.session.renderedFontFamilies(),re,W),le=0,ue=null,ve,rt=null,Ee=-1,_e=0,De=-1,Ce=false,ze="all-markup",Oe=Fw(w=>{y?.setShowParagraphMarks(w),Se(),Ye();}),Be=Nw({surface:()=>y,destroyed:()=>B,editingMode:()=>u,hostViewOnly:()=>t$1.mode()==="view",publish:()=>{Se(),Ye();},decision:()=>Vo(),tracking:Tr,adopt:w=>{k=w.rejection??Cr(null),w.mode!==null&&(I=w.mode==="viewing",Pr(w.mode)),Se(),Ye();}});function Se(){le+=1;}let Ae={change:new Set,selectionChange:new Set,error:new Set,historyDiagnostic:new Set};function St(w){for(let U of [...Ae.error])U(w);}function Yn(w){for(let U of [...Ae.change])U(w);}function Ye(){if(Ae.selectionChange.size===0)return;let w=Ot();for(let U of [...Ae.selectionChange])U(w);}function Sr(){_?.(),_=null,y?.destroy(),y=null,j.reset(),_e+=1;}let jt=jI(e$1,{container:()=>r,surface:()=>y,bump:Se,emitSelectionChange:Ye}),wr=()=>jt.scale();function kt(w,U,J){if(J??=l.get(w),l.delete(w),!r){s=w,J&&l.set(w,J),L=null,Se();return}Sr();let ye=h.stateKey,ge=Ff(r,w,{scale:wr(),showParagraphMarks:Oe.get(),onToggleParagraphMarks:Oe.toggle,defaultFontFamily:f$1(Z()),translate:t$1.translate(),drawingStrings:t$1.drawingStrings(),locale:t$1.locale(),...n?{author:n}:{},...x.current()!==void 0?{revisionStyles:x.current()}:{},reviewAuthorSlots:v,revisionAuthorVisibility:h,initialSelection:U,initialTextFormInput:J,editingMode:u==="suggesting"?"suggest":u==="viewing"?"view":"edit",revisionDisplayMode:i?ze:"proposed",...Ow(o,a$2),...X?{measurer:X,...ae?{producer:ae}:{}}:{},...ce?{fontAlias:ce.alias}:{},...e$1.tableInteractionLabel?{tableInteractionLabel:e$1.tableInteractionLabel}:{},...e$1.imageDecodePort?{imageDecodePort:e$1.imageDecodePort}:{},...o.collaboration?{collaborationModel:o.collaboration}:{},onHyperlinkPopover:Pe=>H$1.current().onPopover?.(Pe),...F.surfaceOptions,onRequestHyperlink:()=>H$1.current().onRequest?.(),onEquationPopover:Pe=>V$1.current().onPopover?.(Pe),onTrackedChange:()=>{Ce||(Ce=true,Se(),Ye());},tocLabels:t$1.tocLabels(),onChange:Pe=>{if(!y)return;Se(),Be.sync(),Y.schedule();let Ne=i&&ze!==y.revisionDisplayMode();Ne&&(ze=y.revisionDisplayMode());let be=ye!==h.stateKey||Ne;ye=h.stateKey,!(!be&&!j.moved(Pe,y))&&Ye();}});if(!ge.ok){L=ge.detail?`${ge.reason}: ${ge.detail}`:ge.reason,Se(),St(Vt(ge.reason,`failed to open document: ${L}`));return}L=null,y=ge.surface,Be.prime(),Ce=i&&y.session.reviewItems().length>0,j.adopt(y),A!==null?jo(A,false):zo(),lI(y,o),_e+=1,y.setEditable(u!=="viewing"),R!==null&&y.setRemoteCaretLabelHost(R),f!==null&&y.setReviewActivationExclusions(f,{formattingKinds:p}),_=ge.surface.session.subscribe(Pe=>{let Ne={revision:ge.surface.session.packageRevision(),created:Pe.created,deleted:Pe.deleted,dirty:Pe.dirty};jt.refitIfPageResized(),Se(),Yn(Ne);}),jt.attach(),Se(),Yn({revision:y.session.packageRevision()}),Ye(),Y.schedule(true);}function Ir(w){if(d$1.cancel(),l=new WeakMap,Ce=false,M+=1,v=e(),h.showAll(),X=void 0,ae=void 0,q=void 0,ee=new Set,D(),xe(),xe=()=>{},E=false,r){let U=zt(r);U&&(U.scrollTop=0,U.scrollLeft=0);}r&&d$1.shouldYield(w)?d$1.schedule(w):kt(w);}function On(w){(w.code==="wasmUnavailable"||w.cause instanceof t&&w.cause.code==="unsupportedRuntime")&&!e$1.onFontError&&Ae.error.size===0&&Hh(w);try{e$1.onFontError?.(w);}catch{}St(w);}async function vi(w,U,J){let ye=e$1.fonts,ge=U.session.embeddedFonts();if(!(!ye&&ge.length===0)){E=true,Se();try{let Pe={families:J,defaultFamily:f$1(Z())},Ne=typeof ye!="function"?ye:q?await k$2([q,i$1(Re=>ye(Re))],Pe,{onOriginFailure:({cause:Re})=>On(wo(Re))}):await ye(Pe),be=typeof ye=="function"?b$3(Ne):Ne;if(B||w!==M){w===M&&(E=!1);return}if(q=Ne,ge.length===0&&(!be||Ne?.supportedFamilies?.length&&!b$3(Ne))){E=!1,Se(),Ye();return}let ie=(be&&"maxFontBytes"in be?be.maxFontBytes:void 0)??a$1,ke=OI(be?.sources??[],ie),Fe=ke.sources;for(let Re of ke.dropped)On(RI(Re));let lt=Uf(ge,Fe,ie),We=!1,an=()=>{if(!We){We=!0;for(let Re of lt.dropped)On(EI(Re));}},yt=e$2({epoch:w,...be,sources:Fe},lt);if(yt.sources.length===0){an(),E=!1,Se(),be&&On(new a("missing","the supplied font configuration contains no usable sources; the fixed measurer stays in effect"));return}let bt=await Ba(yt),An=()=>!B&&w===M?!1:(H(bt),w===M&&(E=!1),!0);if(An())return;let Wo=Re=>{an(),Re&&H(Re),E=!1,Se();},ro=(Re,Tt)=>{let io=new Set;for(let Ze of Tt.sources??[]){let vn=Re.fonts.resolve(Ze.request);vn instanceof d&&(On(wo(vn)),io.add(g$2(Ze.request)));}return io},Or=ro(bt,yt);try{if(Or.size>0){let Re=Fe.filter(sn=>!Or.has(g$2(sn.request))),Tt=Re.length!==Fe.length;Tt&&(lt=Uf(ge,Re,ie));let io=lt.sources.filter(sn=>Tt||!Or.has(g$2(sn.request))),Ze=bt;if(yt=e$2({epoch:w,...be,sources:Re},{sources:io}),yt.sources.length===0)return Wo(Ze);if(bt=await Ba(yt),H(Ze),An())return;let vn=ro(bt,yt);if(vn.size>0){let sn=Re.filter(so=>!vn.has(g$2(so.request))),Ti=lt.sources.filter(so=>!vn.has(g$2(so.request))),Pi=bt;if(yt=e$2({epoch:w,...be,sources:sn},{sources:Ti}),yt.sources.length===0)return Wo(Pi);if(bt=await Ba(yt),H(Pi),An())return}}}finally{an();}let Uo=yt.sources.map(Re=>{let Tt=bt.fonts.resolve(Re.request);return Tt instanceof d||Tt.id!==Re.id?null:{request:Re.request,id:Tt.id,bytes:Tt.bytes,hash:Tt.hash,faceIndex:Tt.faceIndex}}).filter(Re=>Re!==null),oo=await qI(Uo,void 0,yt.substitutions??[]);if(B||w!==M){oo.dispose(),An();return}let ao={embeddedFaces:ce,coveredFontFamilies:ee,shapedMeasurer:X,shapedProducer:ae,disposeShapedFonts:xe};try{ce=oo,ee=NI(Uo,yt.substitutions??[]);let Re=da(wr(),{context:r?Ao(r.ownerDocument):null,...ce?{fontAlias:ce.alias}:{}}),Tt=Pw(bt,yt,Re,wr(),++fe);if(X=Tt.measurer,ae=Tt.producer,E=!1,y&&bv(y,{measurer:X,producer:ae,fontAlias:ce?.alias,defaultFontFamily:f$1(Z())}),B||w!==M){oo.dispose(),H(bt);return}}catch(Re){throw !B&&w===M&&({embeddedFaces:ce,coveredFontFamilies:ee,shapedMeasurer:X,shapedProducer:ae,disposeShapedFonts:xe}=ao),oo.dispose(),H(bt),Re}xe=()=>H(bt),ao.disposeShapedFonts(),ao.embeddedFaces?.dispose(),Se(),Ye();}catch(Pe){if(B||w!==M)return;E=false,Se(),On(wo(Pe));}}}let Bl=nu();function xi(){let w=y?.state()??null;return {scope:y?.activeScope?.()??hM,isLoading:L===null&&y===null&&s===null&&!d$1.isScheduled(),isOpening:d$1.isScheduled(),parseError:L,editable:y!==null&&y.session.editable&&t$1.mode()!=="view"&&u!=="viewing",zoom:jt.zoom(),zoomMode:jt.mode(),selection:Tu(y),selectionCollapsed:w===null||w.selection.anchor.paragraphId===w.selection.head.paragraphId&&w.selection.anchor.offset===w.selection.head.offset,formatting:v0(y),table:Ru(y),tocContext:Bl(w?.contextTocId??null),image:Cn(y),page:{current:Cu(y),total:Pu(y)},canUndo:w?.canUndo??false,canRedo:w?.canRedo??false,pageSetup:ku(y),reviewPaneOpen:Ce,showParagraphMarks:Oe.get(),documentProtection:Be.state(),reviewDisplayMode:y&&i?y.revisionDisplayMode():ze,hasReviewContent:y?.session.hasReviewContent()??false,hiddenReviewAuthors:h.hiddenAuthorList,collaborationStatus:w?.collaborationStatus??"inactive",editingMode:u,lastRejection:k??w?.lastRejection??null,fontSubstitutions:te(),formatPainter:w?.formatPainter??Ms}}let on;function Ot(){if(ue&&De===le)return ue;let w=ue,U=Z()===on;on=Z();let J=n===ve;ve=n;let ye=y?.state().selection??null,ge=Ds(ye,rt);rt=ye;let Pe=y?.session.packageRevision()??-1,Ne=Pe===Ee;Ee=Pe;let be=xi(),ie=be;if(w){let ke=Qc(be.formatting,w.formatting)?w.formatting:be.formatting,Fe=Jc(be.page,w.page)?w.page:be.page,lt=eu(be.pageSetup??null,w.pageSetup??null)?w.pageSetup:be.pageSetup,We=tu(be.selection,w.selection)?w.selection:be.selection,an=f0(be.image,w.image)?w.image:be.image,yt=w.fontSubstitutions!==void 0&&be.fontSubstitutions!==void 0&&w.fontSubstitutions.length===be.fontSubstitutions.length&&be.fontSubstitutions.every((bt,An)=>w.fontSubstitutions[An]===bt)?w.fontSubstitutions:be.fontSubstitutions;ie={...be,formatting:ke,page:Fe,pageSetup:lt,selection:We,image:an,fontSubstitutions:yt},ru(ie,w)&&ge&&Ne&&J&&U&&(ie=w);}return ue=Ns(ie),De=le,ue}if(e$1.document){let w=su(e$1.document);w?Ir(w):(L=lu(e$1.document),St(Vt("unsupported",L)));}let $l=nx({surface:()=>y,activeKey:to,paneOpen:()=>Ce,selectionAnchor:()=>tr()?.anchorY??null,authorFilterKey:()=>h.stateKey});function pt(w){return w.kind==="revision"?w.ranges[0]??null:w.range}function Si(w){return pt(w)===null?false:!(w.kind==="revision"&&f!==null&&f.includes(w.revisionKind)&&(w.revisionKind!=="format"||p===void 0||p.includes(w.formattingKind??"")))}let yn=Hw(),mt=new WeakMap;function wi(w){let U=mt.get(w);if(U)return U;let J=new Map;for(let ye of w.pages)for(let ge of [ye.footnotes,ye.endnotes])if(ge)for(let Pe of ge.notes)for(let Ne of C(Pe.fragments))for(let be of T(Ne))J.has(be)||J.set(be,Pe.scopeId);return mt.set(w,J),J}function Ht(w){let U=pt(w)?.partName;if(!U||!y||U===y.session.part().name)return null;for(let J of y.session.headerFooterResolutionBySection())for(let ye of ["header","footer"]){let ge=ye==="header"?J.headers:J.footers;for(let Pe of ge.values())if(Pe.partName===U)return {kind:ye,rId:Pe.rId}}return null}function qo(w){let U=pt(w),J=y?.publishedLayout();return !U||!J?null:wi(J).get(U.start.paragraphId)??null}function kr(w){let U=pt(w)?.partName;if(!U||!y)return null;for(let J of ["footnote","endnote"])if(Wf$1(y.session.currentPackage(),J)?.name===U)return {kind:"notesPart",noteKind:J};return null}function bn(w){let U=Ht(w);return U!==null?{kind:"headerFooter",rId:U.rId}:kr(w)??{kind:"body"}}let Qn=()=>`${new Date().toISOString().slice(0,19)}Z`,ne=new WeakMap;function Jn(w){let U=ne.get(w);if(U)return U;let J=new Map;for(let[ye,ge]of V(w).entries())J.set(ge,ye);return ne.set(w,J),J}function Zo(){return cI({surface:y,bodyOrder:()=>{let w=y?.publishedLayout();return w?Jn(w):new Map},openStoryOrder:Ii})}function Ko(){let w=y?.activeScope();if(w?.kind==="headerFooter")return {kind:"headerFooter",rId:w.rId};if(w?.kind==="note"){let U=$c$1(w.id);if(U)return {kind:"notesPart",noteKind:U.noteKind}}return {kind:"body"}}function er(w){if(!y)return {kind:"body"};let U=w.slice(0,w.indexOf("#"));if(U.length===0||U===y.session.part().name)return {kind:"body"};for(let J of y.session.headerFooterResolutionBySection())for(let ye of [J.headers,J.footers])for(let ge of ye.values())if(ge.partName===U)return {kind:"headerFooter",rId:ge.rId};for(let J of ["footnote","endnote"])if(Wf$1(y.session.currentPackage(),J)?.name===U)return {kind:"notesPart",noteKind:J};return Ko()}function Ii(){if(!y)return new Map;let w=Ko();if(w.kind==="body")return new Map;let U=new Map;for(let[J,ye]of y.session.paragraphIdsIn(w).entries())U.set(ye,J);return U}function ki(w){if(w.kind==="revision"){let J=w.ranges;if(J.length===0)return null;let ge=w.revisionKind==="replace"||w.revisionKind==="insert"||w.revisionKind==="delete"?J[J.length-1]:J[0];return {start:J[0].start,end:ge.end}}let U=pt(w);return U?{start:U.start,end:U.end}:null}function tr(){if(y&&y.activatedReviewKey()!==null)return null;let w=Zo(),U=y?.publishedLayout();if(!w||!U)return null;let J=yn(U).get(w.from.paragraphId);return J?{pageIndex:J.pageIndex,anchorY:J.contentY+ia(J,w.from.paragraphId,w.from.offset)}:null}function to(){return y?.activeReviewKey()??null}function Mn(w){if(!i)return [];let U=Gu(y?.session.reviewItems()??[],h),J=w?.excludeRevisionKinds;if(J&&J.length>0){let ie=new Set(J);U=U.filter(Fe=>Fe.kind!=="revision"||!ie.has(Fe.revisionKind));let ke=new Set(U.filter(Fe=>Fe.kind==="revision").map(Fe=>Fe.id));U=U.map(Fe=>{if(Fe.kind!=="comment"||Fe.parentRevisionId===void 0||ke.has(Fe.parentRevisionId))return Fe;let{parentRevisionId:lt,...We}=Fe;return We});}let ye=w?.placement!==false,ge=null;if(ye&&U.length>0){let ie=y?.publishedLayout()??null;ie&&(ge=yn(ie));}let Pe=to(),Ne=ie=>{let ke=Ht(ie);return ke===null?1:ke.kind==="header"?0:2},be=U.map((ie,ke)=>({item:ie,position:ke,pageIndex:ge?ka$1(ie,ge)?.pageIndex??null:null,group:Ne(ie)}));return be.sort((ie,ke)=>{let Fe=ie.pageIndex??Number.MAX_SAFE_INTEGER,lt=ke.pageIndex??Number.MAX_SAFE_INTEGER;return Fe!==lt?Fe-lt:ie.group!==ke.group?ie.group-ke.group:ie.position-ke.position}),be.map(({item:ie})=>{let ke=Da(ie),Fe=ge?ka$1(ie,ge):null,lt={key:ke,id:ie.id,...Lf(ie)!==void 0?{date:Lf(ie)}:{},activatable:Si(ie),anchorY:Fe?.y??null,pageIndex:Fe?.pageIndex??null,isActive:ke===Pe};return ie.kind==="comment"?{...lt,kind:"comment",author:ie.comment.author,initials:La$2(ie.comment),text:Ka$1(ie.comment),resolved:ie.resolved,...ie.parentId!==void 0?{parentId:ie.parentId}:{},...ie.parentRevisionId!==void 0?{parentRevisionId:ie.parentRevisionId}:{},replyIds:ie.replyIds,readOnly:false,item:ie}:ie.kind==="revision"?{...lt,kind:"revision",revisionKind:ie.revisionKind,author:ie.author,initials:Xv(ie.author),text:ie.text,...ie.replacedText?{replacedText:ie.replacedText}:{},replyIds:ie.replyIds,readOnly:ie.readOnly||i0(y),item:ie}:{...lt,kind:"custom",author:"",initials:"",text:ie.detail??ie.text,replyIds:[],readOnly:true,item:ie}})}function Tr(){return y?.session.trackingSettings()??Fg}function Vo(w=u,U=b){let J=Tr();return fu({...C$1(),viewOnly:t$1.mode()==="view",hostChoseMode:t$1.mode()!==void 0,readerChoseMode:U,currentMode:w,trackRevisions:J.trackRevisions,restrictedToTrackedChanges:J.restrictedToTrackedChanges,restrictedToForms:J.restrictedToForms,restrictedToReadOnly:J.restrictedToReadOnly,restrictedToComments:J.restrictedToComments,engineAdoptedViewing:I})}function Pr(w){A=null,u=w,y?.setEditingMode(w==="suggesting"?"suggest":w==="viewing"?"view":"edit"),y?.setEditable(w!=="viewing");}function Cr(w){return w!==null?w:u==="suggesting"&&n===void 0?yr:T$1?yr:b?null:t$1.openingModeDecision(C$1()).rejection}function zo(){let w=Vo();k=Cr(w.rejection),w.mode!==null&&(I=w.mode==="viewing",Pr(w.mode));}function jo(w="editing",U=true){if(d$1.isScheduled()){A=w;return}A=null;let J=n0(t$1.mode(),C$1(),Tr(),u,w,I);I=J.mode==="viewing"&&t$1.mode()!=="view",J.mode!==u&&Pr(J.mode),k=Cr(J.rejection),O.report(J.configurationRejection),U&&(Se(),Ye());}function no(w){return t$1.mode()==="view"&&w!=="viewing"?{ok:false,code:"locked",reason:"this document was opened for viewing"}:(w==="suggesting"?uu(C$1()):null)??pu(Tr(),w)}let Wt=Mw({surface:()=>y,enabled:()=>i,destroyed:()=>B,viewing:()=>u==="viewing",placements:()=>Mn(),visible:()=>Gu(y?.session.reviewItems()??[],h),scope:bn,activate:(w,U)=>{m=U??false;try{return Fn.setActiveReviewItem(w)}finally{m=false;}},setDisplayMode:w=>{ze=w,y?.setRevisionDisplayMode(w),Se(),Ye();}}),{resolveReviewItem:Rr}=Wt,Er=new Fl(()=>y,w=>{for(let U of [...Ae.historyDiagnostic])U(w);},()=>JSON.stringify(y?.state().selection)),Fn={beginHistoryGroup(){return d$1.flush(),Er.begin()},get mountGeneration(){return _e},get surface(){return y},...F.setters,setHyperlinkChrome:H$1.push,setEquationChrome:V$1.push,stateVersion:()=>le,fontMeasurement:()=>({measurer:X?"shaped":"fixed",resolving:E,...X&&ae?{producer:ae}:{}}),attach(w){if(B){St(Vt("destroyed","this editor was destroyed; create a new instance to remount"));return}if(y&&r===w)return;if(y){y.flushPendingInput(),s=y.session.save();let ye=r?Hu(r):void 0;ye&&l.set(s,ye),Sr();}let U=d$1.cancel();U&&(s=U),jt.detach(),r=w,K=null;let J=s;s=null,J&&d$1.shouldYield(J)?d$1.schedule(J):J?kt(J):Se();},detach(){if(B)return;jt.detach();let w=d$1.cancel();if(y){y.flushPendingInput(),s=y.session.save();let U=r?Hu(r):void 0;U&&l.set(s,U),Sr();}w&&(s=w),r=null,K=null,Se();},load(w){let U=su(w);if(!U){St(Vt("unsupported",lu(w)));return}Ir(U);},save(){return d$1.flush(),Hv(y,r,()=>y)},getDocumentHandle(){return Object.freeze({revision:y?.session.packageRevision()??0})},exec(w,U){d$1.flush();let J=Er.gate(w,U);if(J)return J;Er.note(w);let ye=Nf(w,B,i,no);if(B&&ye&&!ye.ok)return ye;if(w.type==="setEditingMode"){let Fe=no(w.mode);return Fe!==null?(Fe.reason===yr&&(T$1=true,k=Fe.reason,O.report(Fe.reason),Se(),Ye()),Fe):(b=true,T$1=false,k=null,Pr(w.mode),Se(),Ye(),{ok:true,changed:false})}if(w.type==="toggleParagraphMarks")return Oe.toggle(),{ok:true,changed:false};if(w.type==="toggleReviewPane")return i?(Ce=!Ce,Se(),Ye(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:gn};let ge=Be.exec(w);if(ge)return ge;let Pe=Wt.exec(w);if(Pe)return Pe;if(zf(w))return TI(w,y,jf(u),U);let Ne=Va(w);if(u==="viewing"&&Ne.supported&&Ne.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let be=ti(w,y,t$1.modeForGate(),U);if(!be.ok)return be.refusal;let ie=y,ke=ie.session.packageRevision();return Er.run(ie,w,U,()=>{let Fe=nI(ie,w,{...be.tablePlan?{admittedTablePlan:be.tablePlan}:{},editor:Fn});return Fe||{ok:true,changed:ie.session.packageRevision()!==ke}})},can(w,U){let J=Er.gate(w,U);if(J)return J;if(w.type==="insertImage"||w.type==="replaceImage"){if(B)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(U?.scope){let ie=ti(w,y,t$1.modeForGate(),U);if(!ie.ok)return ie.refusal}return y0(w,y)}let ye=Nf(w,B,i,no);if(ye)return ye;let ge=Be.can(w);if(ge)return ge;let Pe=Wt.can(w);if(Pe)return Pe;if(zf(w))return Wf(w,y,jf(u),U);let Ne=Va(w);if(u==="viewing"&&Ne.supported&&Ne.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let be=ti(w,y,t$1.modeForGate(),U);if(!be.ok)return be.refusal;if(w.type==="proposeInsertion"||w.type==="proposeDeletion"||w.type==="proposeReplacement"){if(!(w.author??n??"").trim())return {ok:false,code:"invalidArgs",reason:`${w.type} requires a non-empty author`};let ke=w.target===void 0?{ok:true,selection:y.state().selection}:Ol(y,w.target);if(!ke.ok)return ke;let{anchor:Fe,head:lt}=ke.selection,We=Fe.paragraphId===lt.paragraphId&&Fe.offset===lt.offset,an=w.type==="proposeReplacement"&&w.target===void 0&&y.state().cellSelection!==null;if(w.type!=="proposeInsertion"&&We&&!an)return {ok:false,code:"invalidArgs",reason:`${w.type} needs a non-collapsed selection`}}if(Ya(w)&&vu(w)){let ie=Qa(Fn);if(ie){let ke=xu(Fn,w,ie);if(ke)return ke}}return {ok:true}},isActive(w){return w.type==="toggleParagraphMarks"?Oe.get():w.type==="toggleDocumentProtection"?Be.isActive():w.type==="setReviewDisplayMode"?ze===w.mode:w.type==="toggleReviewPane"?Ce:w.type==="setEditingMode"?u===w.mode:Aw(w,y?Ot().formatting:null,U=>y?.isListActive(U)??false)},getDocumentStyles:()=>y?.session.documentStyles()??[],getDocumentFonts:()=>y?.session.documentFonts()??[],getAvailableFonts:()=>CI(Z(),y?.session.documentFonts()??[]),getDocumentThemeColors:()=>y?.session.documentThemeColors()??[],getOutline:()=>y?.session.documentOutline()??[],getComments:()=>[],getSelectionFormatting:()=>k0(y?Ot().formatting:null),findMatches:(w,U)=>y?.session.findText(w,{...U?.matchCase!==void 0?{matchCase:U.matchCase}:{},...U?.wholeWord!==void 0?{wholeWord:U.wholeWord}:{},stories:_w(y,u)}).matches??[],selectMatch(w){return d$1.flush(),y?Bw(y,w):{ok:false,code:"notFound",reason:"no document is loaded"}},getSelectedImage:()=>Ot().image,getSelectedTable:()=>I0(y),getTableCellSelection:()=>{let w=y?.state().cellSelection;return w?{tableId:w.tableId,rows:w.rows,columns:w.columns,cellIds:w.cellIds}:null},setTableInteractionLabel(w){y?.setTableInteractionLabel(w);},canExecuteImageCommand(w,U){if(B)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(U?.scope){let J=ti(w,y,t$1.modeForGate(),U);if(!J.ok)return J.refusal}return Su(w,y)},executeImageCommand(w){return B?Promise.resolve({ok:false,code:"notFound",reason:"the editor was destroyed"}):wu(Fn,w)},getPageSetup:()=>ku(y),getWatermark:()=>null,getTrackedChanges:()=>(y?.session.reviewItems()??[]).filter(w=>w.kind==="revision").map(w=>{let U=Ht(w);return {id:w.id,kind:w.kind==="revision"?w.revisionKind:"revision",...w.kind==="revision"&&w.author?{author:w.author}:{},story:U!==null?U.kind:kr(w)?.noteKind??"body"}}),getReviewItems:w=>Mn(w),getCustomNodeDefinitions:()=>o.customNodes,reportCustomNodeDiagnostic:a$2,addComment(w,U){if(!i)return {ok:false,code:"unsupported",reason:gn};y?.flushPendingInput();let J=Zo();if(!J||!y)return {ok:false,code:"invalidArgs",reason:"a comment needs a selected range"};let ye=(U??n??"").trim();if(ye.length===0||w.trim().length===0)return {ok:false,code:"invalidArgs",reason:"a comment needs both an author and text"};let ge=null;return y.commitReviewOps(()=>(ge=y.session.replyToComment(null,{paragraphId:J.from.paragraphId,start:J.from.offset,end:J.to.offset,...J.to.paragraphId===J.from.paragraphId?{}:{endParagraphId:J.to.paragraphId}},w,ye,Qn(),er(J.from.paragraphId)),{committed:ge!==null}),"comment-add"),ge===null?{ok:false,code:"unsupported",reason:"the comment could not be committed"}:{ok:true,changed:true}},getSelectionPlacement:()=>tr(),isReviewPaneOpen:()=>Ce,getEditingMode:()=>u,getReviewAuthors:()=>x.authorsFor(y?.revisionAuthors()??UI),...rx(h,{enabled:i,surface:()=>y,notify:()=>{Se(),Ye();}}),setTrackedChangesFilter(w,U){if(y)return y.setTrackedChangesFilter(w,U);h.setPredicate(w,U)&&(Se(),Ye());},getConfiguredAuthor:()=>n??null,setAuthor(w){let U=Wu(w);if(n!==U){if(n=U,y?.setAuthor(n),n!==void 0&&T$1){T$1=false;let J=t0(no("suggesting"));if(J.enter)b=true,Pr("suggesting");else {k=J.rejection,Se(),Ye();return}}else if(!b){let J=A??u;jo(t$1.mode()===void 0?J:"editing");return}k=Cr(null),O.report(k),Se(),Ye();}},setMode(w){t$1.setMode(w)&&(b=false,T$1=false,jo());},...QI(t$1,{surface:()=>y,bump:Se,emitSelectionChange:Ye}),presenceColorFor:w=>y?.remotePresenceColor(w)??"var(--doc-accent)",collaborationSession:()=>y?.collaborationSession()??null,getReviewAuthorStyle:w=>x.styleFor(w),setRemoteCaretLabelHost(w){R=w,y?.setRemoteCaretLabelHost(w);},setRevisionStyles(w){x.set(w),y?.setRevisionStyles(w),Se(),Ye();},setEditingMode:w=>Fn.exec({type:"setEditingMode",mode:w}),getReviewRevision:()=>$l(),setActiveReviewItem(w,U){if(w===null)return y?.dismissActiveReview(),Se(),Ye(),{ok:true,changed:false};if(!y)return {ok:false,code:"notFound",reason:"no document is open"};y.flushPendingInput();let ye=Mn().find(be=>be.key===w)?.item;if(!ye)return {ok:false,code:"notFound",reason:"no review item with that key"};let ge=pt(ye);if(!ge)return {ok:false,code:"unsupported",reason:"this review item has no resolvable range"};if(!Si(ye)&&!(m&&ye.kind==="revision"&&ye.revisionKind==="format"))return {ok:false,code:"unsupported",reason:`review items of kind '${ye.revisionKind}' are excluded from activation`};let Pe=ye?Ht(ye):null,Ne=Pe===null&&ye?qo(ye):null;if(Pe!==null||Ne!==null){let be=Pe!==null?{kind:"headerFooter",rId:Pe.rId,furnitureKind:Pe.kind}:{kind:"note",id:Ne},ie=Cl(y,be,ge.start);if(!ie.ok)return ie}else {y.exitNote?.(),y.exitHeaderFooter?.();let be=ki(ye)??ge,ie={paragraphId:be.start.paragraphId,offset:be.start.offset};y.activateReview(w,{anchor:ie,head:ie},{allowExcluded:m});let ke=U?.reveal??"centerIfNeeded";ke!==false&&y.revealPosition?.(be.start,{block:ke});}return (Pe!==null||Ne!==null)&&y.activateReview(w,void 0,{allowExcluded:m}),Se(),Ye(),{ok:true,changed:false}},setReviewActivationExclusions(w,U){f=w===null?null:[...w],p=U?.formattingKinds?[...U.formattingKinds]:void 0,y?.setReviewActivationExclusions(f,{formattingKinds:p});},acceptReviewItem:w=>Rr(w,"accept"),rejectReviewItem:w=>Rr(w,"reject"),setCommentResolved(w,U){return uI({reviewEnabled:i,editingMode:u,placements:Mn,surface:y,proReviewReason:gn,bump:Se},w,U)},deleteReviewItem(w){if(!i)return {ok:false,code:"unsupported",reason:gn};let J=Mn().find(ge=>ge.key===w)?.item;if(!J||!y)return {ok:false,code:"notFound",reason:"no review item with that key"};if(J.kind==="revision")return Rr(w,"reject");if(J.kind!=="comment")return {ok:false,code:"unsupported",reason:"a custom node card cannot be deleted"};to()===w&&y.dismissActiveReview();let ye=false;return y.commitReviewOps(()=>{let ge=qo(J),Pe=ge===null?null:$c$1(ge);return ye=y.session.deleteComment(J.id,bn(J),Pe?.noteId),{committed:ye}},"comment-delete"),ye?(Se(),{ok:true,changed:true}):{ok:false,code:"unsupported",reason:"the comment could not be deleted"}},replyToReviewItem(w,U,J){if(!i)return {ok:false,code:"unsupported",reason:gn};y?.flushPendingInput();let ge=Mn().find(Fe=>Fe.key===w)?.item;if(!ge||!y)return {ok:false,code:"notFound",reason:"no review item with that key"};let Pe=pt(ge);if(!Pe)return {ok:false,code:"invalidArgs",reason:"the item has no anchorable range"};let Ne=(J??n??"").trim(),be=fI(ge,U,Ne);if(be)return be;let ie=ge.kind==="comment"?ge.id:null,ke=null;return y.commitReviewOps(()=>(ke=y.session.replyToComment(ie,{paragraphId:Pe.start.paragraphId,start:Pe.start.offset,end:Pe.end.offset},U,Ne,Qn(),bn(ge)),{committed:ke!==null}),"comment-reply"),ke===null?{ok:false,code:"unsupported",reason:"the reply could not be committed"}:{ok:true,changed:true}},getHeaderFooterState:()=>y?.headerFooterState()??null,getNotePropertiesState:()=>y?.notePropertiesState?.()??null,getNotePreviewText:w=>y?.notePreviewText?.(w)??null,setActiveScope(w){y?.setActiveScope(w)&&Se();},getActiveScope:()=>y?.activeScope()??{kind:"body"},query(w){switch(w.type){case "selectedText":return y?.selectedText()??"";case "selectionFormatting":return y?Ot().formatting:null;case "selection":return Tu(y);case "paragraphs":return S0(y,w.container);case "isInsideToc":return T0(y);case "hyperlinkAt":return x0(y);case "contentControls":return xI(y,w.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 Vf(y,w.filter);case "tableContext":return Ru(y);default:return null}},snapshot:()=>Ot(),getTotalPages:()=>Pu(y),getCurrentPage:w=>Cu(y,w),scrollToPage:w=>!Number.isInteger(w)||w<1?false:(d$1.flush(),y?.revealPage(w-1)??false),scrollToBlock:w=>typeof w!="string"||w.length===0?false:(d$1.flush(),y&&Rl(y,w),y?.revealParagraph(w)??false),...WI(jt,()=>y),relayout(w){w?.sync,y?.layout();},retainSelection:()=>y?.retainSelection()??null,releaseSelection:w=>y?.releaseSelection(w),focus(w){return d$1.flush(),y?w&&w.kind==="all"?{ok:false,code:"invalidTarget",reason:"the all scope cannot take focus"}:w&&!y.setActiveScope(w)?{ok:false,code:"invalidTarget",reason:"that scope cannot be opened"}:(y.focus(),{ok:true,value:void 0}):{ok:false,code:"invalidTarget",reason:"no document is loaded"}},destroy(){B=true,O.dispose(),d$1.cancel(),jt.detach(),D(),xe(),xe=()=>{},Sr(),r=null,s=null,l=new WeakMap,_e+=1,Se();for(let w of Object.values(Ae))w.clear();},on(w,U){return Ae[w].add(U),()=>{Ae[w].delete(U);}}};return Fn}var JI=Object.freeze({document:true,save:true,events:true,selection:true,scrolling:true,layout:true});function vM(e){if(e.length===0)return;if(e.every(n=>n.kind==="delete"))return "comment-delete";if(e.length!==1)return;let t=e[0];if(t.kind==="resolve")return "comment-resolve";if(t.kind==="create")return "comment-add";if(t.kind==="reply")return "comment-reply"}function xM(e){let t=k$1({port:SM(e),capabilities:JI}),n=false;return {...t,save:()=>{try{return t.save()}catch(r){return {ok:false,error:{code:"transaction-refused",message:r instanceof Error?r.message:"Cannot save the document."}}}},dispose:()=>{n=true,t.dispose();},execute:r=>(n||e.surface?.flushPendingInput(),t.execute(r))}}function SM(e){let t=0,n=0,r=null,o=false,a=false,i=()=>{if(a)return null;let d=e.surface?.session??null;return d!==r&&(o&&(t+=n+1),o=true,r=d,n=0),d&&(n=d.packageRevision()),d},s,l=null;return {localChangeTracking:true,suggesting:()=>e.surface?.editingMode()==="suggest",async prepare(d){if(!d.operations.some(p=>p.op==="updateFieldResult"))return;s=void 0,l=null;let u=e.surface;if(!u)return;let f=u.layout();s=a$4(f),l=i()?.currentPackage()??null;},fieldPageContext(d,u,f){let p=i()?.currentPackage()??null;if(!p||p!==l)return null;let m=e$1(p).story(d);return m?b(s,m.part,u,f):null},revision(){return i(),t+n},currentPackage:()=>i()?.currentPackage()??null,revisionDisplayMode:()=>e.surface?X(e.surface.revisionDisplayMode()):ja$1,replacementLanding:(d,u,f)=>e.surface?.replacementLanding(d,u,f)??null,apply(d,u,f=[]){i();let p=e.surface;if(!p)return {ok:false,reason:"no-document"};let m=p.applyAutomationOps(d,u,f);return m.rejected?{ok:false,reason:String(m.reason??"refused")}:{ok:true,changed:m.committed}},applyLifecycle(d){i();let u=e.surface;if(!u)return {ok:false,reason:"no-document"};let f=u.applyAutomationOps(()=>[d]);return f.rejected?{ok:false,reason:String(f.reason??"refused")}:{ok:true,changed:f.committed}},applyCommentWrites(d,u){let f=e.surface,p=i();if(!f||!p)return {ok:false,reason:"no-document"};if(d.length===0)return {ok:true,changed:false};if(u.kind!=="body")return {ok:false,reason:"unsupported-story"};let m=e.can({type:"toggleReviewPane"});if(!m.ok)return {ok:false,reason:m.reason??"review-module-required"};let h={ok:false,reason:"refused"};return f.commitReviewOps(()=>{if(d.every(b=>b.kind==="delete")){let b=d.find(k=>k.kind==="delete"),I=p.deleteComments(d.map(k=>{if(k.kind!=="delete")throw new Error("unreachable mixed comment write");return {commentId:k.commentId,...k.parentCommentId===void 0?{}:{parentCommentId:k.parentCommentId}}}),u,b?.kind==="delete"?b.noteId:void 0);return h=I?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:I}}if(d.length!==1)return h={ok:false,reason:"mixed-comment-writes"},{committed:false};let x=d[0];if(x.kind==="resolve"){let b=p.setCommentResolved(x.commentId,x.resolved);return h=b?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:b}}if(x.kind!=="create"&&x.kind!=="reply")return h={ok:false,reason:"unsupported-comment-write"},{committed:false};let v=p.replyToComment(x.kind==="reply"?x.parentCommentId:null,x.anchor,x.text,x.author,x.date);return h=v===null?{ok:false,reason:"refused"}:{ok:true,changed:true,commentId:v},{committed:v!==null}},vM(d)),h},applyCustomNodeWrite(d,u){let f=e.surface,p=i();if(!f||!p)return {ok:false,reason:"no-document"};if(u.kind!=="body")return {ok:false,reason:"unsupported-story"};let m={ok:false,reason:"refused"};return f.commitReviewOps(()=>{let h=p.insertCustomNode(d);return m=h.ok?{ok:true,changed:h.change!==null}:{ok:false,reason:h.detail?`${h.reason}: ${h.detail}`:h.reason},{committed:h.ok}},"package-scoped"),m},save:()=>i()?e.surface?.save()??null:null,select(d,u){if(!e.surface)return;let p=u==="end"?d.end:d.start,m=u==="start"?d.start:d.end;e.exec({type:"setSelection",range:{anchor:{paragraphId:p.paragraphId,offset:p.offset},head:{paragraphId:m.paragraphId,offset:m.offset}}});},subscribe:d=>e.on("change",()=>d()),dispose(){a=true,r=null;}}}function wM(e){return e*(96/72)}function IM(e,t){return e*t}function kM(e,t){return e/t}function TM(e,t,n){let r=e.pages.find(i=>i.index===t.pageIndex)??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 PM(e){return Object.freeze(e?{left:e.offsetLeft,top:e.offsetTop}:{left:0,top:0})}function tk(e,t,n){return t?true:e.length===1?false:!n}var ek=["e","se","s","sw","w","nw","n","ne"];function CM(e,t){let n=ek.indexOf(e);t.flipHorizontal&&(n=(4-n+8)%8),t.flipVertical&&(n=(8-n)%8);let r=Math.round(t.rotationDegrees/45)%8;return ek[(n-r+8)%8]}function RM(e,t,n){let r=e,o=t,a=-n.rotationDegrees*Math.PI/180,i=Math.cos(a),s=Math.sin(a),l=r*i-o*s,d=r*s+o*i;return r=l,o=d,n.flipHorizontal&&(r=-r),n.flipVertical&&(o=-o),Object.freeze({x:r,y:o})}function eo(e){return e/ei}function nk(e){let t=RM(e.deltaXPt,e.deltaYPt,e.transform),n=eo(e.startWidthEmu),r=eo(e.startHeightEmu),o=n/r,a=CM(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 k=Math.max(n/eo(e.startWidthEmu),r/eo(e.startHeightEmu));n=Math.max(1,eo(e.startWidthEmu)*k),r=Math.max(1,n/o);}else a==="e"||a==="w"?r=Math.max(1,n/o):n=Math.max(1,r*o);let l=eo(e.startWidthEmu),d=eo(e.startHeightEmu),u=n/l,f=r/d,p=Math.max(1,e.startBounds.width*u),m=Math.max(1,e.startBounds.height*f),h=e.startBounds.x,x=e.startBounds.y,v=e.handle;v.includes("w")&&(h=e.startBounds.x+e.startBounds.width-p),v.includes("n")&&(x=e.startBounds.y+e.startBounds.height-m);let b=null;if(e.kind==="anchored"&&e.startPosition&&(v.includes("w")||v.includes("n")))if(e.startPosition.mode==="simple"){let I=v.includes("w")?Rt(h-e.startBounds.x):0,k=v.includes("n")?Rt(x-e.startBounds.y):0;b=Object.freeze({mode:"simple",horizontalEmu:(e.startPosition.horizontalEmu??0)+I,verticalEmu:(e.startPosition.verticalEmu??0)+k});}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}:{},...v.includes("w")?{horizontalEmu:Rt(h-e.anchorFrameOrigin.x)}:e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu}:{},...v.includes("n")?{verticalEmu:Rt(x-e.anchorFrameOrigin.y)}:e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu}:{}});else {let I=v.includes("w")?Rt(h-e.startBounds.x):0,k=v.includes("n")?Rt(x-e.startBounds.y):0;b=Object.freeze({mode:"frame",...e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu+I}:{},...e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu+k}:{},...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{}});}return Object.freeze({widthEmu:Rt(n),heightEmu:Rt(r),previewBounds:Object.freeze({x:h,y:x,width:p,height:m}),position:b})}function EM(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 OM(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&&Iu(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?nk({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:tk(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})}var rk=e=>Math.round(e/1440*100)/100,MM=e=>rk(e).toLocaleString(void 0,{maximumFractionDigits:2}),FM=e=>Math.round(e*1440),AM={left:"dialogs.paragraph.tabAlignLeft",center:"dialogs.paragraph.tabAlignCenter",right:"dialogs.paragraph.tabAlignRight",decimal:"dialogs.paragraph.tabAlignDecimal",bar:"dialogs.paragraph.tabAlignBar"},ok=e=>e===null||e===0?"none":e<0?"hanging":"firstLine",ak=(e,t)=>e==="none"?0:e==="hanging"?-Math.abs(t):Math.abs(t);function LM(e){let t=e.indentFirstLineTwips;return {alignment:e.alignment??"left",indentLeft:e.indentLeftTwips??0,indentRight:e.indentRightTwips??0,special:ok(t),specialBy:Math.abs(t??0),spaceBefore:e.spaceBeforePt??0,spaceAfter:e.spaceAfterPt??0,lineRule:e.lineSpacing?.rule??"multiple",lineValue:e.lineSpacing?.value??1.08,contextualSpacing:e.contextualSpacing===true,keepNext:e.keepNext===true,keepLines:e.keepLines===true,widowControl:e.widowControl!==false,pageBreakBefore:e.pageBreakBefore===true,tabStops:e.tabStops??[],clearedAllTabStops:false}}var ik={contextualSpacing:false,keepNext:false,keepLines:false,widowControl:false,pageBreakBefore:false,tabStops:false,alignment:false,indentLeft:false,indentRight:false,special:false,spaceBefore:false,spaceAfter:false,lineSpacing:false};function NM(e){return {contextualSpacing:e.contextualSpacing===null,keepNext:e.keepNext===null,keepLines:e.keepLines===null,widowControl:e.widowControl===null,pageBreakBefore:e.pageBreakBefore===null,tabStops:e.disagrees.tabStops,alignment:e.disagrees.alignment,indentLeft:e.disagrees.indentLeft||e.indentUnknown,indentRight:e.disagrees.indentRight||e.indentUnknown,special:e.disagrees.indentFirstLine||e.indentUnknown,spaceBefore:e.disagrees.spaceBeforePt,spaceAfter:e.disagrees.spaceAfterPt,lineSpacing:e.disagrees.lineSpacing}}function sk(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let o=t[r];return o!==void 0&&n.positionTwips===o.positionTwips&&n.alignment===o.alignment&&(n.leader??"none")===(o.leader??"none")})}function DM(e,t,n=ik,r=n){let o={},a=false,i=(l,d)=>{o[l]=d,a=true;},s=l=>n[l]&&!r[l];return (e.alignment!==t.alignment||s("alignment"))&&i("alignment",t.alignment),(e.indentLeft!==t.indentLeft||s("indentLeft"))&&i("indentLeftTwips",t.indentLeft),(e.indentRight!==t.indentRight||s("indentRight"))&&i("indentRightTwips",t.indentRight),(e.special!==t.special||e.specialBy!==t.specialBy||s("special"))&&i("indentFirstLineTwips",ak(t.special,t.specialBy)),(e.spaceBefore!==t.spaceBefore||s("spaceBefore"))&&i("spaceBeforePt",t.spaceBefore),(e.spaceAfter!==t.spaceAfter||s("spaceAfter"))&&i("spaceAfterPt",t.spaceAfter),!r.lineSpacing&&(e.lineRule!==t.lineRule||e.lineValue!==t.lineValue||s("lineSpacing"))&&i("lineSpacing",{rule:t.lineRule,value:t.lineValue}),(e.contextualSpacing!==t.contextualSpacing||s("contextualSpacing"))&&i("contextualSpacing",t.contextualSpacing),(e.keepNext!==t.keepNext||s("keepNext"))&&i("keepNext",t.keepNext),(e.keepLines!==t.keepLines||s("keepLines"))&&i("keepLines",t.keepLines),(e.widowControl!==t.widowControl||s("widowControl"))&&i("widowControl",t.widowControl),(e.pageBreakBefore!==t.pageBreakBefore||s("pageBreakBefore"))&&i("pageBreakBefore",t.pageBreakBefore),(!sk(e.tabStops,t.tabStops)||s("tabStops")&&t.clearedAllTabStops)&&i("tabStops",t.tabStops),a?o:null}function HM(e,t){return [...e.filter(r=>r.positionTwips!==t.positionTwips),t].sort((r,o)=>r.positionTwips-o.positionTwips)}function _M(e,t){if(t.key!=="Tab")return false;let n=[...e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(i=>!i.hasAttribute("disabled")&&i.tabIndex!==-1);if(n.length===0)return false;let r=n[0],o=n[n.length-1],a=e.ownerDocument.activeElement;return t.shiftKey&&(a===r||a===e)?(o.focus(),true):!t.shiftKey&&a===o?(r.focus(),true):false}function BM(e,t,n){let r,o=false,a,i,s=new Set,l=[],d=()=>{clearTimeout(i),i=void 0,r?.end(),r=void 0,a=void 0,s.clear();},u=()=>{if(o)throw new Error("history group binding was disposed");return (!r||r.state==="closed")&&(r=e.beginHistoryGroup()),r},f=()=>{d(),u();},p=()=>{let x=r;a=void 0,s.clear(),clearTimeout(i),i=setTimeout(()=>{r===x&&d();},0);},m=(x,v,b,I=false)=>{x.addEventListener(v,b,I),l.push(()=>x.removeEventListener(v,b,I));},h=x=>n.kind==="native-color"?x==="Enter"||x===" ":["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"," ","Enter"].includes(x);if(m(t,"pointerdown",x=>{let v=x;if(!(v.button!==0||n.kind==="keyboard")&&(f(),a=v.pointerId,n.kind!=="native-color"))try{t.setPointerCapture?.(v.pointerId);}catch{}},true),m(t,"keydown",x=>{let v=x;if(v.key==="Escape"){p();return}!h(v.key)||v.altKey||v.ctrlKey||v.metaKey||(!v.repeat&&s.size===0&&f(),s.add(v.key),u());},true),m(t.ownerDocument,"keyup",x=>{let v=x.key;s.delete(v)&&n.kind!=="native-color"&&s.size===0&&p();},true),n.kind!=="native-color")for(let x of ["pointerup","pointercancel","lostpointercapture"])m(x==="lostpointercapture"?t:t.ownerDocument,x,v=>{a!==void 0&&v.pointerId===a&&p();},true);return m(t,"input",()=>{i!==void 0?f():u();},true),m(t,"change",()=>{(n.kind==="native-color"||a===void 0&&s.size===0)&&p();}),m(t,"blur",p,true),t.ownerDocument.defaultView&&m(t.ownerDocument.defaultView,"blur",p),{options:()=>({historyGroup:u()}),dispose(){if(!o){o=true,d();for(let x of l)x();}}}}
20
+ export{ni as $,uM as $a,Uc as A,B0 as Aa,_M as Ab,Gc as B,PR as Ba,BM as Bb,nC as C,CR as Ca,mu as D,RR as Da,AC as E,Sv as Ea,Ua as F,oi as Fa,Ga as G,ai as Ga,gu as H,$R as Ha,LC as I,Du as Ia,hu as J,Wr as Ja,Cn as K,Wn as Ka,Qa as L,el as La,Su as M,Zv as Ma,wu as N,Kv as Na,UC as O,Bu as Oa,GC as P,tl as Pa,ei as Q,$u as Qa,YC as R,nl as Ra,Rt as S,qu as Sa,Ro as T,Zu as Ta,QC as U,Ku as Ua,Iu as V,yl as Va,JC as W,ow as Wa,_s as X,Ff as Xa,Oo as Y,yi as Ya,C0 as Z,bi as Za,Eu as _,Bo as _a,wo as a,oR as aa,Hl as ab,Ba as b,R0 as ba,_l as bb,Gk as c,E0 as ca,bM as cb,ac as d,aR as da,JI as db,OP as e,jr as ea,xM as eb,MP as f,Ou as fa,wM as fb,Ve as g,dR as ga,IM as gb,Zc as h,cR as ha,kM as hb,$P as i,fR as ia,TM as ib,ZP as j,$s as ja,PM as jb,KP as k,A0 as ka,tk as kb,wb as l,Bs as la,nk as lb,VP as m,L0 as ma,EM as mb,zP as n,N0 as na,OM as nb,jP as o,gR as oa,rk as ob,WP as p,hR as pa,MM as pb,UP as q,yR as qa,FM as qb,GP as r,vR as ra,AM as rb,XP as s,xR as sa,ok as sb,Ib as t,SR as ta,ak as tb,YP as u,wR as ua,LM as ub,QP as v,IR as va,ik as vb,jc as w,Fu as wa,NM as wb,Lb as x,kR as xa,sk as xb,Nb as y,_0 as ya,DM as yb,Ls as z,TR as za,HM as zb};