@docx-editor.dev/core 2.15.0 → 2.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +9 -15
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +11 -9
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +12 -16
  7. package/dist/binding.js +1 -1
  8. package/dist/{chunk-Q4AB7E4O.cjs → chunk-4MIFIUEV.cjs} +1 -1
  9. package/dist/chunk-66DTF4TD.cjs +2 -0
  10. package/dist/chunk-67U2OZS7.cjs +2 -0
  11. package/dist/chunk-6EGMDUL7.js +21 -0
  12. package/dist/chunk-ABXCIZVW.js +2 -0
  13. package/dist/chunk-AEIAYDCG.js +1 -0
  14. package/dist/{chunk-YL4Q5LZP.cjs → chunk-BPSGGVP5.cjs} +1 -1
  15. package/dist/chunk-CMV2MTDE.js +5 -0
  16. package/dist/chunk-DYPT6YDY.js +1 -0
  17. package/dist/chunk-EWV5JMJY.cjs +21 -0
  18. package/dist/chunk-FAD7DH6Q.cjs +1 -0
  19. package/dist/chunk-GHNTGVKG.cjs +11 -0
  20. package/dist/chunk-GQVKCK33.js +2 -0
  21. package/dist/chunk-I4ENGOOZ.js +1 -0
  22. package/dist/chunk-IZHDCQUC.js +20 -0
  23. package/dist/chunk-KEXMDQ2Z.js +1 -0
  24. package/dist/chunk-KQEUFAAG.cjs +20 -0
  25. package/dist/chunk-QVJO5FUR.js +11 -0
  26. package/dist/chunk-SIUUTE5M.js +2 -0
  27. package/dist/chunk-TDHR2QLH.cjs +1 -0
  28. package/dist/{chunk-PXKZUTHX.cjs → chunk-WGHVIB6B.cjs} +2 -2
  29. package/dist/chunk-XKQTITOJ.cjs +5 -0
  30. package/dist/{chunk-KXPVOPR5.js → chunk-YKDRBDI2.js} +1 -1
  31. package/dist/chunk-YRTRPSSA.cjs +1 -0
  32. package/dist/collaboration/replication.cjs +1 -1
  33. package/dist/collaboration/replication.d.ts +4 -4
  34. package/dist/collaboration/replication.js +1 -1
  35. package/dist/collaboration.d.ts +4 -4
  36. package/dist/contracts/editor.d.ts +9 -7
  37. package/dist/contracts/interaction.d.ts +73 -10
  38. package/dist/contracts/modules.d.ts +8 -8
  39. package/dist/{custom-node-writes-C9ArIlJh.d.ts → custom-node-writes-4WOL8JB_.d.ts} +2 -2
  40. package/dist/{editor-sRxrFJd8.d.ts → editor-PDx0fqSo.d.ts} +26 -125
  41. package/dist/editor-scope-DZJT4ukT.d.ts +53 -0
  42. package/dist/editor.cjs +1 -1
  43. package/dist/editor.css +1 -1
  44. package/dist/editor.d.ts +32 -26
  45. package/dist/editor.js +1 -1
  46. package/dist/export.cjs +2 -2
  47. package/dist/export.d.ts +24 -12
  48. package/dist/export.js +2 -2
  49. package/dist/{font-resolver-BYEHQGTw.d.ts → font-resolver-CdqOugwZ.d.ts} +2 -2
  50. package/dist/{headless-document-view-DELC4E5v.d.ts → headless-document-view-C9ONlGtf.d.ts} +2 -2
  51. package/dist/{hf-references-DTrHkktY.d.ts → hf-references-BZVHctVD.d.ts} +1 -1
  52. package/dist/{index-C3Gvq4jN.d.ts → index-BVb4a6O3.d.ts} +74 -28
  53. package/dist/index.cjs +1 -1
  54. package/dist/index.d.ts +20 -18
  55. package/dist/index.js +1 -1
  56. package/dist/{layout-shaping-DoGR5cf8.d.ts → layout-shaping-D_U5z-Qh.d.ts} +1 -1
  57. package/dist/layout.cjs +1 -1
  58. package/dist/layout.d.ts +270 -459
  59. package/dist/layout.js +1 -1
  60. package/dist/{note-properties-DSe8igrz.d.ts → note-properties-BosjbkGC.d.ts} +1 -1
  61. package/dist/{omml-equation-BpRmfDAf.d.ts → omml-equation-oLlbPpVy.d.ts} +1 -1
  62. package/dist/output.cjs +1 -1
  63. package/dist/output.d.ts +6 -6
  64. package/dist/output.js +1 -1
  65. package/dist/{protocol-DZzKxH5r.d.ts → protocol-CUsqt13U.d.ts} +28 -6
  66. package/dist/{review-items-DYRx187i.d.ts → review-items-kC-YI70C.d.ts} +1 -1
  67. package/dist/{review-reads-LbGUdNzn.d.ts → review-reads-DdvADsmp.d.ts} +8 -7
  68. package/dist/{revision-projection-DHRJH48u.d.ts → revision-projection-CN_DiOl_.d.ts} +1 -1
  69. package/dist/{semantic-cell-selection-BXVWCBYm.d.ts → semantic-cell-selection-BMrXDniV.d.ts} +4 -4
  70. package/dist/{semantic-interaction-DZsDmPg5.d.ts → semantic-interaction-NGeYzYCN.d.ts} +1 -1
  71. package/dist/{semantic-paint-f7SqN4oW.d.ts → semantic-paint-CM8F-8pH.d.ts} +2 -2
  72. package/dist/{semantic-records-EIdwId-a.d.ts → semantic-records-BreR44Ki.d.ts} +1231 -947
  73. package/dist/store.cjs +1 -1
  74. package/dist/store.d.ts +80 -20
  75. package/dist/store.js +1 -1
  76. package/dist/{tree-op-types-egdarvH_.d.ts → tree-op-types-C5rZzoAz.d.ts} +131 -53
  77. package/dist/{tree-package-fragment-DjkH4ESI.d.ts → tree-package-fragment-DDQHk8sv.d.ts} +3 -3
  78. package/dist/{tree-session-contract-CGOOgPjW.d.ts → tree-session-contract-dKgbKH9A.d.ts} +18 -8
  79. package/dist/{tree-store-DKJB0IcA.d.ts → tree-store-DU192chS.d.ts} +1 -1
  80. package/package.json +2 -2
  81. package/dist/chunk-24APKZAN.cjs +0 -11
  82. package/dist/chunk-2YH4MSHX.cjs +0 -2
  83. package/dist/chunk-5Y7AADI6.js +0 -1
  84. package/dist/chunk-AREFLNUP.js +0 -11
  85. package/dist/chunk-AS7YZNQE.cjs +0 -2
  86. package/dist/chunk-AVGCKH6A.cjs +0 -20
  87. package/dist/chunk-CDYVDQRI.cjs +0 -5
  88. package/dist/chunk-HOEWFH5U.cjs +0 -1
  89. package/dist/chunk-KFELX7CN.js +0 -2
  90. package/dist/chunk-LGFKIF4M.cjs +0 -1
  91. package/dist/chunk-M52QXFKI.js +0 -1
  92. package/dist/chunk-MNUKSXRO.js +0 -1
  93. package/dist/chunk-PBOIGBDO.js +0 -2
  94. package/dist/chunk-PMHGONET.cjs +0 -1
  95. package/dist/chunk-QJYH6AYD.js +0 -1
  96. package/dist/chunk-QRC37MWG.cjs +0 -20
  97. package/dist/chunk-RJSB6RJ7.js +0 -20
  98. package/dist/chunk-SB54HLFJ.js +0 -20
  99. package/dist/chunk-XCESLTJL.js +0 -2
  100. package/dist/chunk-Z4527AXR.js +0 -5
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkGHNTGVKG_cjs=require('./chunk-GHNTGVKG.cjs'),fflate=require('fflate');function Y(e){return e.kind!=="textValue"}function L(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunkGHNTGVKG_cjs.da}function ae(e,t){for(let n of e)t(n),n.kind!=="textValue"&&ae(n.children,t);}function ke(e){if(e.kind==="textValue")return `T(${e.value})`;if(e.namespaceUri===chunkGHNTGVKG_cjs.da&&e.localName.startsWith("rsid"))return "";let t=e.attributes.filter(r=>!r.localName.startsWith("rsid")&&!(r.namespaceUri===chunkGHNTGVKG_cjs.ga&&(r.localName==="paraId"||r.localName==="textId"))).map(r=>`${r.namespaceUri}|${r.localName}=${r.value}`).sort().join(","),n=e.children.map(ke).join("");return `E(${e.namespaceUri}:${e.localName}[${t}]{${n}})`}function ut(e){return `S[${e.attributes.filter(n=>n.localName!=="styleId").map(n=>`${n.localName}=${n.value}`).sort().join(",")}]${e.children.map(ke).join("")}`}function Ft(e){let t=[],n=new Map,r=new Set,o=null;if(e&&Y(e.root))for(let i of e.root.children){if(!Y(i))continue;if(L(i,"docDefaults")){o=i;continue}if(!L(i,"style"))continue;t.push(i);let a=chunkGHNTGVKG_cjs.Ce(i,"styleId");a&&n.set(a,i);let s=i.children.find(d=>L(d,"name")),l=s?chunkGHNTGVKG_cjs.Ce(s,"val"):void 0;l&&r.add(l);}return {part:e,styles:t,docDefaults:o,byId:n,names:r}}function At(e,t,n){let r=new Map;if(!e)return r;let o=e.children.find(a=>L(a,t));if(!o||!Y(o))return r;let i=o.children.find(a=>L(a,n));if(!i||!Y(i))return r;for(let a of i.children)a.kind!=="textValue"&&r.set(a.localName,a);return r}function yn(e,t,n,r){let o=t;for(let i=0;i<16&&o;i+=1){let a=e.byId.get(o);if(!a)return false;let s=a.children.find(d=>L(d,n));if(s&&Y(s)&&s.children.some(d=>d.kind!=="textValue"&&d.localName===r))return true;let l=a.children.find(d=>L(d,"basedOn"));o=l?chunkGHNTGVKG_cjs.Ce(l,"val"):void 0;}return false}function Di(e,t){for(let n of e.styles){if(chunkGHNTGVKG_cjs.Ce(n,"type")!==t)continue;let r=chunkGHNTGVKG_cjs.Ce(n,"default");if(r==="1"||r==="true")return chunkGHNTGVKG_cjs.Ce(n,"styleId")}}function _t(e,t){let n=e.children.find(r=>L(r,t));return n&&Y(n)?n:null}var Ai=new Map(["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"].map((e,t)=>[e,t])),_i=new Map(["rStyle","rFonts","b","bCs","i","iCs","caps","smallCaps","strike","dstrike","outline","shadow","emboss","imprint","noProof","snapToGrid","vanish","webHidden","color","spacing","w","kern","position","sz","szCs","highlight","u","effect","bdr","shd","fitText","vertAlign","rtl","cs","em","lang","eastAsianLayout","specVanish","oMath","rPrChange"].map((e,t)=>[e,t]));function xn(e,t,n){let r=At(t.docDefaults,"rPrDefault","rPr"),o=At(n.docDefaults,"rPrDefault","rPr"),i=At(t.docDefaults,"pPrDefault","pPr"),a=At(n.docDefaults,"pPrDefault","pPr"),s=(f,x,p)=>{let k=Di(f,"paragraph"),w=k?f.byId.get(k):void 0;if(!w)return k;for(let[T,R]of [["rPr",x],["pPr",p]]){let S=_t(w,T);if(S)for(let A of S.children)A.kind!=="textValue"&&R.set(A.localName,A);}return k};s(t,r,i),s(n,o,a);let l=new Map;for(let[f,x]of r){let p=o.get(f);(!p||ke(p)!==ke(x))&&l.set(f,x);}let d=new Map;for(let[f,x]of i){if(f==="sectPr")continue;let p=a.get(f);(!p||ke(p)!==ke(x))&&d.set(f,x);}if(l.size===0&&d.size===0)return e;let c=0,u=()=>`fragment#materialized-${c++}`,m=f=>{let x=p=>p.kind==="textValue"?{id:u(),kind:"textValue",value:p.value}:{...p,id:u(),children:p.children.map(x)};return x(f)},g=(f,x,p)=>{if(p.length===0)return f;let k=_t(f,x);if(k){let T=x==="rPr"?_i:Ai,R=[...k.children];for(let A of p){let G=A.kind==="textValue"?Number.MAX_SAFE_INTEGER:T.get(A.localName)??Number.MAX_SAFE_INTEGER,H=R.length;for(let Q=0;Q<R.length;Q+=1){let me=R[Q];if(me.kind==="textValue")continue;let te=T.get(me.localName);if(te!==void 0&&te>G){H=Q;break}}R.splice(H,0,A);}let S={...k,children:R};return {...f,children:f.children.map(A=>A===k?S:A)}}let w={id:u(),kind:x==="rPr"?"runProperties":"paragraphProperties",namespaceUri:chunkGHNTGVKG_cjs.da,localName:x,prefix:"w",namespaceBindings:[],attributes:[],children:p};return {...f,children:[w,...f.children]}},y=f=>{let x=_t(f,"pPr"),p=x?.children.find(S=>L(S,"pStyle")),k=p?chunkGHNTGVKG_cjs.Ce(p,"val"):void 0,w=[];for(let[S,A]of d)x?.children.some(H=>H.kind!=="textValue"&&H.localName===S)||k&&yn(t,k,"pPr",S)||w.push(m(A));let T=S=>{if(S.kind==="textValue")return S;if(S.kind==="run"){let G=_t(S,"rPr"),H=G?.children.find(te=>L(te,"rStyle")),Q=H?chunkGHNTGVKG_cjs.Ce(H,"val"):void 0,me=[];for(let[te,Se]of l)G?.children.some(E=>E.kind!=="textValue"&&E.localName===te)||Q&&yn(t,Q,"rPr",te)||k&&yn(t,k,"rPr",te)||me.push(m(Se));return g(S,"rPr",me)}if(S.kind==="paragraphProperties"||S.kind==="runProperties")return S;let A=S.children.map(T);return A.some((G,H)=>G!==S.children[H])?{...S,children:A}:S};return T(g(f,"pPr",w))},P=f=>{if(f.kind==="textValue")return f;if(f.kind==="paragraph")return y(f);let x=f.children.map(P);return x.some((p,k)=>p!==f.children[k])?{...f,children:x}:f};return e.map(P)}function Fi(e,t){return {...e,children:t}}function Ui(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunkGHNTGVKG_cjs.da}var Li=new Set(["commentRangeStart","commentRangeEnd"]),$i=new Set(["altChunk","subDoc"]);function Bi(e){return e.kind==="run"&&e.children.some(t=>t.kind==="commentReference")}var Hi=new Set(["DDE","DDEAUTO","INCLUDE","INCLUDEPICTURE","INCLUDETEXT","IMPORT","LINK","DATABASE","AUTOTEXT","AUTOTEXTLIST","GOTOBUTTON","MACROBUTTON","PRINT","ADDIN"]);function bo(e){if(e===void 0)return false;let t=e.trim().replace(/^"+/,"").split(/\s+/,1)[0]??"";return Hi.has(t.toUpperCase())}function ji(e){if(e.kind!=="run")return null;for(let t of e.children)if(t.kind==="fldChar"){let n=chunkGHNTGVKG_cjs.Ce(t,"fldCharType");return n==="separate"||n==="end"?n:"begin"}return null}function Wi(e){if(e.kind!=="run")return null;let t="",n=false;for(let r of e.children)if(r.kind==="instrText"){n=true;for(let o of r.children)o.kind==="textValue"&&(t+=o.value);}return n?t:null}function Vi(e){let t=[],n=new Set,r=i=>{if(i.dangerous){for(let a of i.machinery)n.add(a);for(let a of i.instr)n.add(a);for(let a of i.preResult)n.add(a);}},o=i=>{if(i.kind!=="textValue"){if(i.kind==="run"){let a=ji(i);if(a==="begin"){t.push({dangerous:false,afterSeparate:false,machinery:[i.id],instr:[],preResult:[]});return}let s=t[t.length-1];if(s){if(a==="separate"){s.afterSeparate=true,s.machinery.push(i.id);return}if(a==="end"){s.machinery.push(i.id),t.pop(),r(s);return}let l=Wi(i);if(l!==null){s.instr.push(i.id),bo(l)&&(s.dangerous=true);return}s.afterSeparate||s.preResult.push(i.id);return}return}for(let a of i.children)o(a);}};for(let i of e)o(i);for(;t.length>0;){let i=t.pop();i.dangerous=true,r(i);}return n}function Ki(e,t){if(e.kind==="textValue")return e;if(e.namespaceUri===chunkGHNTGVKG_cjs.da&&(Li.has(e.localName)||e.localName==="sectPr"||$i.has(e.localName))||Bi(e)||t.has(e.id))return "drop";if(Ui(e,"fldSimple")&&bo(chunkGHNTGVKG_cjs.Ce(e,"instr")))return kn(e.children,t);let n=kn(e.children,t);return n.length===e.children.length&&n.every((r,o)=>r===e.children[o])?e:Fi(e,n)}function kn(e,t){let n=[];for(let r of e){let o=Ki(r,t);o!=="drop"&&(Array.isArray(o)?n.push(...o):n.push(o));}return n}function Pn(e){let t=Vi(e);return kn(e,t)}var _e="http://schemas.openxmlformats.org/officeDocument/2006/relationships",zi="http://schemas.openxmlformats.org/package/2006/relationships",Gi="http://schemas.openxmlformats.org/drawingml/2006/main",xd="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",kd="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",Pd="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Od="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",Id="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",Rd="application/vnd.openxmlformats-package.relationships+xml",Xi=`${_e}/styles`,Yi=`${_e}/numbering`,vd=`${_e}/footnotes`,bd=`${_e}/endnotes`,Nd=`${_e}/officeDocument`,qi=`${_e}/theme`;function ce(e){return e.kind!=="textValue"}function No(e,t){return {...e,children:t}}function ze(e,t){if(t(e),e.kind!=="textValue")for(let n of e.children)ze(n,t);}var Ji=new Set(["pStyle","rStyle","tblStyle"]);function Sd(e,t){for(let n of e)ze(n,r=>{if(r.kind!=="textValue"&&Ji.has(r.localName)&&r.namespaceUri===chunkGHNTGVKG_cjs.da){let o=chunkGHNTGVKG_cjs.Ce(r,"val");o&&t.add(o);}});}function Td(e,t){for(let n of e)ze(n,r=>{if(r.kind!=="textValue"&&r.localName==="numId"&&r.namespaceUri===chunkGHNTGVKG_cjs.da){let o=chunkGHNTGVKG_cjs.Ce(r,"val");o&&t.add(o);}});}function wd(e,t){for(let n of e)ze(n,r=>{if(r.kind!=="textValue")for(let o of r.attributes)o.namespaceUri===_e&&o.value.length>0&&t.add(o.value);});}function Pe(e){return /^\d+$/.test(e)?e.replace(/^0+(?=\d)/,""):e}function To(e,t){let n={footnote:new Set,endnote:new Set},r=[],o=i=>{for(let a of i)ze(a,s=>{if(s.kind!=="noteReference")return;let l=s.localName==="footnoteReference"?"footnote":"endnote",d=chunkGHNTGVKG_cjs.Ce(s,"id");if(d===void 0)return;let c=Pe(d);n[l].has(c)||(n[l].add(c),r.push({kind:l,id:c}));});};for(o(e);r.length>0;){let i=r.pop(),a=t(i.kind,i.id);a!==null&&o([a]);}return n}function On(e,t,n){if(e.kind==="textValue")return e;let r=[],o=false;for(let i of e.children){if(i.kind!=="textValue"&&i.namespaceUri===chunkGHNTGVKG_cjs.da&&(i.localName==="footnoteReference"||i.localName==="endnoteReference")){let l=i.localName==="footnoteReference"?t:n,d=chunkGHNTGVKG_cjs.Ce(i,"id");if(i.kind!=="noteReference"||d===void 0||!l.has(Pe(d))){o=true;continue}}let s=On(i,t,n);s!==i&&(o=true),r.push(s);}return o?{...e,children:r}:e}function Qi(e,t){for(let n of chunkGHNTGVKG_cjs.gc(e,t)){if(n.type!==Xi||n.targetMode==="External")continue;let r=chunkGHNTGVKG_cjs.w(n.ownerPart,n.rawTarget);if(r.ok)return e.parts.get(r.partName)??null}return e.parts.get("/word/styles.xml")??null}function wo(e,t,n){for(let r of chunkGHNTGVKG_cjs.gc(e,t)){if(r.type!==n||r.targetMode==="External")continue;let o=chunkGHNTGVKG_cjs.w(r.ownerPart,r.rawTarget);if(o.ok)return e.parts.get(o.partName)??null}return null}function Ed(e,t){let n=Qi(e,t),r=new Map,o=[],i=null;if(n&&ce(n.root))for(let a of n.root.children){if(!ce(a))continue;if(a.localName==="docDefaults"&&a.namespaceUri===chunkGHNTGVKG_cjs.da){i=a;continue}if(a.localName!=="style"||a.namespaceUri!==chunkGHNTGVKG_cjs.da)continue;let s=chunkGHNTGVKG_cjs.Ce(a,"styleId");s&&r.set(s,a),(chunkGHNTGVKG_cjs.Ce(a,"default")==="1"||chunkGHNTGVKG_cjs.Ce(a,"default")==="true")&&o.push(a);}return {part:n,byId:r,defaults:o,docDefaults:i}}var Zi=new Set(["basedOn","link","next"]);function Cd(e,t){let n=new Set,r=[...t];for(let a of e.defaults){let s=chunkGHNTGVKG_cjs.Ce(a,"styleId");s&&r.push(s);}let o=[];for(;r.length>0;){let a=r.pop();if(n.has(a))continue;n.add(a);let s=e.byId.get(a);if(s){o.push(s);for(let l of s.children)if(ce(l)&&Zi.has(l.localName)&&l.namespaceUri===chunkGHNTGVKG_cjs.da){let d=chunkGHNTGVKG_cjs.Ce(l,"val");d&&r.push(d);}}}if(!e.part||!ce(e.part.root))return o;let i=new Map;return e.part.root.children.forEach((a,s)=>i.set(a,s)),o.sort((a,s)=>(i.get(a)??0)-(i.get(s)??0))}function Md(e,t,n){let r=wo(e,t,Yi)??e.parts.get("/word/numbering.xml")??null;if(!r||!ce(r.root)||n.size===0)return {part:r,nums:[],abstracts:[]};let o=[],i=new Set;for(let s of r.root.children){if(!ce(s)||s.localName!=="num"||s.namespaceUri!==chunkGHNTGVKG_cjs.da)continue;let l=chunkGHNTGVKG_cjs.Ce(s,"numId");if(!(!l||!n.has(l))){o.push(s);for(let d of s.children)if(ce(d)&&d.localName==="abstractNumId"){let c=chunkGHNTGVKG_cjs.Ce(d,"val");c&&i.add(c);}}}let a=[];for(let s of r.root.children){if(!ce(s)||s.localName!=="abstractNum"||s.namespaceUri!==chunkGHNTGVKG_cjs.da)continue;let l=chunkGHNTGVKG_cjs.Ce(s,"abstractNumId");l&&i.has(l)&&a.push(s);}return {part:r,nums:o,abstracts:a}}var Ut={latin:null,eastAsia:null,cs:null};function Dd(e,t){let n=wo(e,t,qi);if(!n)return {major:Ut,minor:Ut};let r={major:{...Ut},minor:{...Ut}};return ze(n.root,o=>{if(o.kind==="textValue"||o.namespaceUri!==Gi||o.localName!=="majorFont"&&o.localName!=="minorFont")return;let i=o.localName==="majorFont"?r.major:r.minor;for(let a of o.children){if(!ce(a))continue;let s=chunkGHNTGVKG_cjs.Ce(a,"typeface");s&&(a.localName==="latin"?i.latin=s:a.localName==="ea"?i.eastAsia=s:a.localName==="cs"&&(i.cs=s));}}),{major:r.major,minor:r.minor}}function es(e,t){let n=t.startsWith("major")?e.major:e.minor;return t.endsWith("EastAsia")?n.eastAsia??n.latin:t.endsWith("Bidi")?n.cs??n.latin:n.latin}var ts=[["asciiTheme","ascii"],["hAnsiTheme","hAnsi"],["eastAsiaTheme","eastAsia"],["cstheme","cs"]],So=new Set(["themeColor","themeTint","themeShade","themeFill","themeFillTint","themeFillShade"]);function ns(e,t){if(e.kind==="textValue")return e;let n=e.attributes;if(e.localName==="rFonts"&&e.namespaceUri===chunkGHNTGVKG_cjs.da){let i=[],a=new Map;for(let s of e.attributes){let l=ts.find(([d])=>d===s.localName);if(l&&s.namespaceUri===chunkGHNTGVKG_cjs.da){let d=es(t,s.value);d&&a.set(l[1],d);continue}i.push(s);}for(let[s,l]of a)i.some(d=>d.localName===s)||i.push({kind:"genericExtension",namespaceUri:chunkGHNTGVKG_cjs.da,localName:s,prefix:"w",value:l});n=i;}else e.attributes.some(i=>So.has(i.localName)&&i.namespaceUri===chunkGHNTGVKG_cjs.da&&e.attributes.some(a=>a.localName==="val"))&&(n=e.attributes.filter(i=>!(So.has(i.localName)&&i.namespaceUri===chunkGHNTGVKG_cjs.da)));let r=e.children.map(i=>ns(i,t)),o=r.some((i,a)=>i!==e.children[a]);return n===e.attributes&&!o?e:{...e,attributes:n,children:r}}function Ad(e,t,n){return {id:e,name:e,contentType:t,root:n}}function _d(e,t){if(e.root.kind==="document"){let r=e.root.children.find(i=>i.kind==="body"),o=r&&ce(r)?No(r,t):{id:"fragment#body",kind:"body",namespaceUri:chunkGHNTGVKG_cjs.da,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return No(e.root,[o])}let n={id:"fragment#body",kind:"body",namespaceUri:chunkGHNTGVKG_cjs.da,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return {id:"fragment#document",kind:"document",namespaceUri:chunkGHNTGVKG_cjs.da,localName:"document",prefix:"w",namespaceBindings:ce(e.root)?e.root.namespaceBindings:[],attributes:[],children:[n]}}function Fd(e){let t=e.map(n=>{let r=n.targetMode==="External"?' TargetMode="External"':"";return `<Relationship Id="${chunkGHNTGVKG_cjs.N(n.id)}" Type="${chunkGHNTGVKG_cjs.N(n.type)}" Target="${chunkGHNTGVKG_cjs.N(n.rawTarget)}"${r}/>`}).join("");return `<Relationships xmlns="${zi}">${t}</Relationships>`}function Ud(e,t){let n=t;for(;e.has(`rId${n}`);)n+=1;return `rId${n}`}function Ld(e){let t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}var Eo="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function J(e,t,n,r){return {...e,attributes:e.attributes.map(o=>o.localName===n&&o.namespaceUri===t?{...o,value:r}:o)}}var rs=new Set(["pStyle","rStyle","tblStyle","basedOn","link","next","styleLink","numStyleLink"]),In=chunkGHNTGVKG_cjs.Rf,Oe=new Map;function Ge(e,t){let n=t.styleIds??Oe,r=t.numIds??Oe,o=t.relIds??Oe,i=t.footnoteIds??Oe,a=t.endnoteIds??Oe,s=t.bookmarkIds??Oe,l=t.sdtIds??Oe,d=t.revisionIds??Oe,c=t.docPrIds??Oe,u=(m,g)=>{if(m.kind==="textValue")return m;let y=m;if(m.namespaceUri===chunkGHNTGVKG_cjs.da&&rs.has(m.localName)){let p=chunkGHNTGVKG_cjs.Ce(m,"val"),k=p!==void 0?n.get(p):void 0;k!==void 0&&(y=J(y,chunkGHNTGVKG_cjs.da,"val",k));}if(L(m,"numId")){let p=chunkGHNTGVKG_cjs.Ce(m,"val"),k=p!==void 0?r.get(p):void 0;k!==void 0&&(y=J(y,chunkGHNTGVKG_cjs.da,"val",k));}if(m.kind==="noteReference"){let p=m.localName==="footnoteReference"?i:a,k=chunkGHNTGVKG_cjs.Ce(m,"id"),w=k!==void 0?p.get(Pe(k)):void 0;w!==void 0&&(y=J(y,chunkGHNTGVKG_cjs.da,"id",w));}if(m.kind==="bookmarkStart"||m.kind==="bookmarkEnd"){let p=chunkGHNTGVKG_cjs.Ce(m,"id"),k=p!==void 0?s.get(p):void 0;k!==void 0&&(y=J(y,chunkGHNTGVKG_cjs.da,"id",k));}if(L(m,"id")&&g==="sdtPr"){let p=chunkGHNTGVKG_cjs.Ce(m,"val"),k=p!==void 0?l.get(p):void 0;k!==void 0&&(y=J(y,chunkGHNTGVKG_cjs.da,"val",k));}if(In(m)){let p=chunkGHNTGVKG_cjs.Ce(m,"id"),k=p!==void 0?d.get(p):void 0;k!==void 0&&(y=J(y,chunkGHNTGVKG_cjs.da,"id",k));}if(m.kind==="drawingDocPr"){let p=m.attributes.find(w=>w.localName==="id"&&w.namespaceUri==="")?.value,k=p!==void 0?c.get(p):void 0;k!==void 0&&(y=J(y,"","id",k));}for(let p of y.attributes){if(p.namespaceUri!==Eo)continue;let k=o.get(p.value);k!==void 0&&k!==p.value&&(y=J(y,Eo,p.localName,k));}let P=m.localName,f=y.children.map(p=>u(p,P));return y!==m||f.some((p,k)=>p!==y.children[k])?{...y,children:f}:m};return u(e,"")}function Co(e,t,n){let r=e,o=n.get(e)??2;for(;t.has(r);)r=`${e}${o}`,o+=1;return n.set(e,o),r}function Mo(e,t,n){let r=`${e} (pasted)`,o=n.get(e)??2;for(;t.has(r);)r=`${e} (pasted ${o})`,o+=1;return n.set(e,o),r}var os=1e5;function Do(e){let t=chunkGHNTGVKG_cjs.Nb(),n=as(e,t),r=is(e,t),o=ss(e,t);return !n||!r||!o?null:{bookmarkIds:n,revisionIds:r,docPrIds:o}}function Rn(e,t,n,r){if(e)return chunkGHNTGVKG_cjs.Pb(t,e,r);let o=n;return ()=>String(o++)}function Ao(e,t){if(e.add(t),!/^\d{1,10}$/.test(t))return;let n=Number(t);n<=chunkGHNTGVKG_cjs.Lb&&e.add(String(n));}function _o(e,t){if(t===void 0)return e;let n=Number(t);return Number.isInteger(n)&&n>e?n:e}function as(e,t){let n=new Map;if(e.fragmentBookmarkIds.length===0)return n;let r=0,o=new Set;for(let a of [e.ownerPart,...e.notesParts])ae([a.root],s=>{if(s.kind!=="bookmarkStart"&&s.kind!=="bookmarkEnd")return;let l=chunkGHNTGVKG_cjs.Ce(s,"id");l!==void 0&&(Ao(o,l),s.kind==="bookmarkStart"&&(r=_o(r,l)));});let i=Rn(t,o,r+1,chunkGHNTGVKG_cjs.Lb);for(let a of e.fragmentBookmarkIds){if(n.has(a))continue;let s=i();if(s===null)return null;n.set(a,s);}return n}function is(e,t){let n=new Map;if(!e.hasRevision)return n;let r=0,o=new Set;for(let s of [e.ownerPart,...e.notesParts]){let l=s===e.ownerPart;ae([s.root],d=>{if(!chunkGHNTGVKG_cjs.Rf(d))return;let c=chunkGHNTGVKG_cjs.Ce(d,"id");c!==void 0&&Ao(o,c),l&&(r=_o(r,c));});}let i=Rn(t,o,r+1,chunkGHNTGVKG_cjs.Lb),a=false;return ae(e.travelling,s=>{if(a||!chunkGHNTGVKG_cjs.Rf(s))return;let l=chunkGHNTGVKG_cjs.Ce(s,"id");if(l===void 0||n.has(l))return;let d=i();d===null?a=true:n.set(l,d);}),a?null:n}function ss(e,t){let n=new Map;if(!e.hasDocPr)return n;let{used:r}=chunkGHNTGVKG_cjs.Rb(e.pkg),o=os;if(!t){let s=chunkGHNTGVKG_cjs.Sb(e.pkg);s.ok&&(o=s.id);}let i=Rn(t,r,o,chunkGHNTGVKG_cjs.Qb),a=false;return ae(e.travelling,s=>{if(a||s.kind==="textValue"||s.kind!=="drawingDocPr")return;let l=s.attributes.find(c=>c.localName==="id"&&c.namespaceUri==="")?.value;if(l===void 0||n.has(l))return;let d=i();d===null?a=true:n.set(l,d);}),a?null:n}var Fe="http://schemas.openxmlformats.org/officeDocument/2006/relationships",ls=`${Fe}/hyperlink`,Fo=`${Fe}/image`,Lt=`${Fe}/numbering`,vn=`${Fe}/styles`,Uo="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Lo="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function pt(e,t,n,r){for(let o of chunkGHNTGVKG_cjs.gc(e,t)){if(o.type!==n||o.targetMode==="External")continue;let i=chunkGHNTGVKG_cjs.w(o.ownerPart,o.rawTarget);if(i.ok){let a=e.parts.get(i.partName);if(a)return a}}return e.parts.get(r)??null}function bn(e,t){let n=0;return ae([e],r=>{let o=t(r);if(o===void 0)return;let i=Number(o);Number.isInteger(i)&&i>n&&(n=i);}),n}function $t(e,t,n,r){if(n.length===0)return e;let o=chunkGHNTGVKG_cjs.Ea(t,"paste"),i=n.map(d=>chunkGHNTGVKG_cjs.Ge(d,o)),a=chunkGHNTGVKG_cjs.Rh(t,i),s=r??a.root.children.length,l=chunkGHNTGVKG_cjs.Ka(a,a.root.id,s,i,{deferValidation:true});return l.ok?chunkGHNTGVKG_cjs.ec(e,l.part):null}function $o(e){let t=new Set;return ae(e,n=>{if(n.kind!=="textValue")for(let r of n.attributes)r.namespaceUri===Fe&&r.value.length>0&&t.add(r.value);}),t}function Bo(e,t){if(t.size===0)return [...e];let n=o=>{if(o.kind==="textValue")return o;if(o.kind==="drawing"||L(o,"pict")){let a=false;return ae([o],s=>{if(s.kind!=="textValue")for(let l of s.attributes)l.namespaceUri===Fe&&t.has(l.value)&&(a=true);}),a?null:o}if(o.kind==="hyperlink"){let a=o.attributes.find(s=>s.namespaceUri===Fe)?.value;if(a!==void 0&&t.has(a))return r(o.children)}let i=r(o.children);return i.length===o.children.length&&i.every((a,s)=>a===o.children[s])?o:{...o,children:i}};function r(o){let i=[];for(let a of o){let s=n(a);s!==null&&(Array.isArray(s)?i.push(...s):i.push(s));}return i}return r(e)}var ds=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),Ho={"image/jpg":"image/jpeg","image/x-ms-bmp":"image/bmp","image/x-bmp":"image/bmp"};function cs(e,t){let n=chunkGHNTGVKG_cjs.tb(e);return n==="unknown"||(Object.hasOwn(Ho,t)?Ho[t]:t)!==n||ds.has(n)&&!chunkGHNTGVKG_cjs.Tb(e,n)?null:n}function jo(e,t,n){let r=t.parts.get(t.mainDocumentPart);if(!r)return {ok:false,reason:"no-fragment-document"};if(!e.parts.has(n))return {ok:false,reason:"no-target-part"};let o=r.root.kind==="document"?r.root.children.find(h=>h.kind==="body"):null;if(!o||!Y(o))return {ok:false,reason:"no-fragment-document"};let i=Pn(o.children.filter(h=>h.kind==="paragraph"||h.kind==="table"||h.kind==="contentControl"));if(i.length===0)return {ok:false,reason:"no-fragment-document"};let a=e,s=pt(t,t.mainDocumentPart,Lt,"/word/numbering.xml"),l=new Map,d=[],c=[];if(s&&Y(s.root)){let h=new Map,I=[];for(let C of s.root.children)if(Y(C))if(L(C,"abstractNum")){let j=chunkGHNTGVKG_cjs.Ce(C,"abstractNumId");j&&h.set(j,C);}else L(C,"num")&&I.push(C);let O=pt(a,a.mainDocumentPart,Lt,"/word/numbering.xml"),N=new Map,M=new Map;if(O&&Y(O.root)){for(let C of O.root.children)if(Y(C)&&L(C,"abstractNum")){let j=chunkGHNTGVKG_cjs.Ce(C,"abstractNumId");j&&M.set(j,C);}for(let C of O.root.children){if(!Y(C)||!L(C,"num"))continue;let j=chunkGHNTGVKG_cjs.Ce(C,"numId");if(!j)continue;let ie=C.children.find(B=>L(B,"abstractNumId")),X=ie?chunkGHNTGVKG_cjs.Ce(ie,"val"):void 0,he=X?M.get(X):void 0;N.set(`${he?ut(he):"none"}::${C.children.filter(B=>L(B,"lvlOverride")).map(ke).join("")}`,j);}}let F=(O?bn(O.root,C=>C.kind!=="textValue"&&L(C,"abstractNum")?chunkGHNTGVKG_cjs.Ce(C,"abstractNumId"):void 0):0)+1,W=(O?bn(O.root,C=>C.kind!=="textValue"&&L(C,"num")?chunkGHNTGVKG_cjs.Ce(C,"numId"):void 0):0)+1,re=new Map;for(let C of I){let j=chunkGHNTGVKG_cjs.Ce(C,"numId");if(!j)continue;let ie=C.children.find(ve=>L(ve,"abstractNumId")),X=ie?chunkGHNTGVKG_cjs.Ce(ie,"val"):void 0,he=X?h.get(X):void 0,B=`${he?ut(he):"none"}::${C.children.filter(ve=>L(ve,"lvlOverride")).map(ke).join("")}`,z=N.get(B);if(z!==void 0){l.set(j,z);continue}let Z=X?re.get(X):void 0;Z===void 0&&he&&X&&(Z=String(F++),re.set(X,Z),c.push(J(he,chunkGHNTGVKG_cjs.da,"abstractNumId",Z)));let $e=String(W++);l.set(j,$e);let we=J(C,chunkGHNTGVKG_cjs.da,"numId",$e);if(Z!==void 0){let ve=we.children.map(Be=>L(Be,"abstractNumId")?J(Be,chunkGHNTGVKG_cjs.da,"val",Z):Be);we={...we,children:ve};}d.push(we),N.set(B,$e);}}let u=Ft(pt(t,t.mainDocumentPart,vn,"/word/styles.xml")),m=pt(a,a.mainDocumentPart,vn,"/word/styles.xml"),g=Ft(m),y=new Map,P=[],f=new Set(g.byId.keys()),x=new Set(g.names),p=new Map,k=new Map,w=new Map,T=(h,I)=>{let O=w.get(h);return O===void 0&&(O=ut(I),w.set(h,O)),O},R=h=>({...h,attributes:h.attributes.filter(I=>!(I.localName==="default"&&I.namespaceUri===chunkGHNTGVKG_cjs.da))});for(let h of u.styles){let I=chunkGHNTGVKG_cjs.Ce(h,"styleId");if(!I)continue;let O=g.byId.get(I),N=ut(Ge(h,{styleIds:y,numIds:l}));if(O&&T(I,O)===N){y.set(I,I);continue}if(!O){y.set(I,I),f.add(I),P.push(R(h));continue}let M=Co(`${I}Pasted`,f,p);f.add(M),y.set(I,M),P.push(R(J(h,chunkGHNTGVKG_cjs.da,"styleId",M)));}let S=P.map(h=>{let I=h.children.find(F=>L(F,"name")),O=I?chunkGHNTGVKG_cjs.Ce(I,"val"):void 0;if(!O||!x.has(O))return O&&x.add(O),h;let N=Mo(O,x,k);x.add(N);let M=h.children.map(F=>L(F,"name")?J(F,chunkGHNTGVKG_cjs.da,"val",N):F);return {...h,children:M}}),A=null,G=1,H=()=>{if(A)return A;let h=new Map;for(let[I,O]of a.partBytes){let N=I.startsWith("/")?I:`/${I}`;if(!N.startsWith("/word/media/"))continue;h.set(chunkGHNTGVKG_cjs.a(O),N);let M=/\/image(\d+)\./.exec(N);M&&(G=Math.max(G,Number(M[1])+1));}return A=h,h},Q=new Map,me=h=>{let I=Q.get(h);if(!I){I=new Map;for(let O of chunkGHNTGVKG_cjs.gc(a,h)){if(O.targetMode==="External"||O.type!==Fo)continue;let N=chunkGHNTGVKG_cjs.w(O.ownerPart,O.rawTarget);N.ok&&I.set(N.partName,O.id);}Q.set(h,I);}return I},te=(h,I)=>{let O=h.lastIndexOf("."),N=O===-1?"":h.slice(O+1);return /^[A-Za-z0-9]{1,8}$/.test(N)?N.toLowerCase():I==="image/jpeg"?"jpeg":I==="image/gif"?"gif":"png"},Se=(h,I,O)=>{let N=new Map,M=new Set,F=me(I),W=[],re=new Set,C=[],j=[],ie=new Map,X=[],he=t.relationships.get(h)??[];for(let B of he){if(!O.has(B.id))continue;if(B.targetMode==="External"){if(B.type===ls){let He=chunkGHNTGVKG_cjs.nf(a,B.rawTarget,I);He?(a=He.pkg,N.set(B.id,He.relationshipId)):M.add(B.id);}else M.add(B.id);continue}let z=chunkGHNTGVKG_cjs.w(B.ownerPart,B.rawTarget);if(!z.ok){M.add(B.id);continue}let Z=t.partBytes.get(z.partName)??t.partBytes.get(z.partName.replace(/^\//,"")),$e=(chunkGHNTGVKG_cjs.hc(t,z.partName)??"").toLowerCase();if(!Z||!$e.startsWith("image/")){M.add(B.id);continue}let we=cs(Z,$e);if(we===null){M.add(B.id);continue}let ve=we,Be=H(),rr=chunkGHNTGVKG_cjs.a(Z),oe=Be.get(rr);if(!oe){let He=te(z.partName,ve),Mi=Rt=>a.partBytes.has(Rt)||a.partBytes.has(Rt.slice(1))||a.parts.has(Rt)||re.has(Rt),qt=`/word/media/image${G}.${He}`;for(;Mi(qt);)G+=1,qt=`/word/media/image${G}.${He}`;G+=1,oe=qt,W.push({partName:oe,bytes:Z,contentType:ve}),re.add(oe),Be.set(rr,oe);}let Ci=oe.startsWith("/word/")?oe.slice(6):oe,or=F.get(oe);if(or!==void 0){N.set(B.id,or);continue}let It=ie.get(oe);It===void 0&&(It=C.length,ie.set(oe,It),C.push(Ci),j.push(oe)),X.push({recordId:B.id,index:It});}if(W.length>0&&(a=chunkGHNTGVKG_cjs.Xb(a,W)),C.length>0){let B=chunkGHNTGVKG_cjs.kc(chunkGHNTGVKG_cjs.lc(a,I),I,C.map(z=>[Fo,z]));if(B.ok){a=B.pkg,B.ids.forEach((z,Z)=>{F.set(j[Z],z);});for(let z of X)N.set(z.recordId,B.ids[z.index]);}else for(let z of X)M.add(z.recordId);}return {relIdMap:N,dropRelIds:M}},Pt=Se(t.mainDocumentPart,n,$o(i));i=Bo(i,Pt.dropRelIds);let E=new Map,D=new Map,_=[],V=(h,I)=>Y(h)&&h.namespaceUri===chunkGHNTGVKG_cjs.da&&h.localName===I,ue={},Le=To(i,(h,I)=>{let O=ue[h];if(O===void 0){O=new Map,ue[h]=O;let N=chunkGHNTGVKG_cjs.If(t,h);if(N&&Y(N.root))for(let M of N.root.children){if(!V(M,h))continue;let F=chunkGHNTGVKG_cjs.Ce(M,"id");if(F===void 0)continue;let W=Pe(F);O.has(W)||O.set(W,M);}}return O.get(I)??null});for(let h of ["footnote","endnote"]){let I=h==="footnote"?E:D,O=Le[h];if(O.size===0)continue;let N=chunkGHNTGVKG_cjs.If(t,h);if(!N||!Y(N.root))continue;let M=chunkGHNTGVKG_cjs.$f(a,h);if(!M.ok||!M.package)return {ok:false,reason:"merge-refused"};a=M.package;let F=chunkGHNTGVKG_cjs.If(a,h);if(!F)return {ok:false,reason:"merge-refused"};let W=bn(F.root,C=>V(C,h)?chunkGHNTGVKG_cjs.Ce(C,"id"):void 0)+1,re=[];for(let C of N.root.children){if(!V(C,h))continue;let j=chunkGHNTGVKG_cjs.Ce(C,"id"),ie=chunkGHNTGVKG_cjs.Ce(C,"type");if(ie==="separator"||ie==="continuationSeparator"||j===void 0||!O.has(Pe(j))||I.has(Pe(j)))continue;let X=String(W++);I.set(Pe(j),X),re.push(J(C,chunkGHNTGVKG_cjs.da,"id",X));}re.length>0&&_.push({kind:h,fragmentPartName:N.name,bodies:Pn(re)});}let Re=a.parts.get(n),Te=[...i,..._.flatMap(h=>h.bodies)],nt=[],U=new Set,Yt=false,ne=false,rt=new Map;ae(Te,h=>{if(h.kind!=="textValue"){if(h.kind==="bookmarkStart"||h.kind==="bookmarkEnd"){let I=chunkGHNTGVKG_cjs.Ce(h,"id");if(I!==void 0&&nt.push(I),h.kind==="bookmarkStart"){let O=chunkGHNTGVKG_cjs.Ce(h,"name");O&&U.add(O);}return}if(In(h)){Yt=true;return}if(h.kind==="drawingDocPr"){ne=true;return}if(h.kind==="contentControlProperties")for(let I of h.children){if(!L(I,"id"))continue;let O=chunkGHNTGVKG_cjs.Ce(I,"val");if(O!==void 0&&!rt.has(O)){let N=0,M=`${O}:${rt.size}`;for(let F=0;F<M.length;F+=1)N=N*31+M.charCodeAt(F)>>>0;rt.set(O,String(N%2147483647||1));}}}});let Ot=Do({pkg:a,ownerPart:Re,notesParts:_.map(h=>chunkGHNTGVKG_cjs.If(a,h.kind)).filter(h=>h!==null),travelling:Te,fragmentBookmarkIds:nt,hasRevision:Yt,hasDocPr:ne});if(!Ot)return {ok:false,reason:"merge-refused"};let Zn=Ot.bookmarkIds,er=Ot.revisionIds,tr=Ot.docPrIds;if(U.size>0){let h=new Set;if(ae([Re.root],I=>{if(I.kind!=="textValue"&&I.kind==="bookmarkStart"){let O=chunkGHNTGVKG_cjs.Ce(I,"name"),N=chunkGHNTGVKG_cjs.Ce(I,"id");O&&N!==void 0&&U.has(O)&&h.add(N);}}),h.size>0){let I=N=>{if(N.kind==="textValue")return N;let M=[],F=false;for(let W of N.children){if((W.kind==="bookmarkStart"||W.kind==="bookmarkEnd")&&h.has(chunkGHNTGVKG_cjs.Ce(W,"id")??"")){F=true;continue}let re=I(W);re!==W&&(F=true),M.push(re);}return F?{...N,children:M}:N},O=I(Re.root);O!==Re.root&&(chunkGHNTGVKG_cjs.Ia(Re.root,O),a=chunkGHNTGVKG_cjs.ec(a,{...Re,root:O}));}}let nr=h=>On(h,E,D);for(let h of _){h.bodies=h.bodies.map(nr);let I=chunkGHNTGVKG_cjs.If(a,h.kind);if(!I)return {ok:false,reason:"merge-refused"};let O=Se(h.fragmentPartName,I.name,$o(h.bodies)),N=Bo(h.bodies,O.dropRelIds);N=[...xn(N,u,g)],N=N.map(F=>Ge(F,{styleIds:y,numIds:l,relIds:O.relIdMap,footnoteIds:E,endnoteIds:D,bookmarkIds:Zn,sdtIds:rt,revisionIds:er,docPrIds:tr}));let M=$t(a,a.parts.get(I.name),N);if(!M)return {ok:false,reason:"merge-refused"};a=M;}if(S.length>0){let h=S.map(O=>Ge(O,{styleIds:y,numIds:l}));if(!m){let O=chunkGHNTGVKG_cjs.xa(`<w:styles xmlns:w="${chunkGHNTGVKG_cjs.da}"></w:styles>`,{name:"/word/styles.xml",contentType:Lo});if(!O.ok)return {ok:false,reason:"merge-refused"};a=chunkGHNTGVKG_cjs.nc(a,"/word/styles.xml",O.part.root,Lo);let N=chunkGHNTGVKG_cjs.mc(chunkGHNTGVKG_cjs.lc(a,a.mainDocumentPart),a.mainDocumentPart,vn,"styles.xml");if(!N.ok)return {ok:false,reason:"merge-refused"};a=N.pkg,m=a.parts.get("/word/styles.xml")??null;}if(!m)return {ok:false,reason:"merge-refused"};let I=$t(a,a.parts.get(m.name),h);if(!I)return {ok:false,reason:"merge-refused"};a=I,g=Ft(a.parts.get(m.name)??null);}if(c.length>0||d.length>0){let h=pt(a,a.mainDocumentPart,Lt,"/word/numbering.xml");if(!h){let F=chunkGHNTGVKG_cjs.xa(`<w:numbering xmlns:w="${chunkGHNTGVKG_cjs.da}"></w:numbering>`,{name:"/word/numbering.xml",contentType:Uo});if(!F.ok)return {ok:false,reason:"merge-refused"};a=chunkGHNTGVKG_cjs.nc(a,"/word/numbering.xml",F.part.root,Uo);let W=chunkGHNTGVKG_cjs.mc(chunkGHNTGVKG_cjs.lc(a,a.mainDocumentPart),a.mainDocumentPart,Lt,"numbering.xml");if(!W.ok)return {ok:false,reason:"merge-refused"};a=W.pkg,h=a.parts.get("/word/numbering.xml")??null;}if(!h)return {ok:false,reason:"merge-refused"};let I=a.parts.get(h.name),O=I.root.children.findIndex(F=>L(F,"num")),N=c.map(F=>Ge(F,{styleIds:y,numIds:l})),M=$t(a,I,N,O===-1?void 0:O);if(!M)return {ok:false,reason:"merge-refused"};if(a=M,M=$t(a,a.parts.get(h.name),d),!M)return {ok:false,reason:"merge-refused"};a=M;}let Ei=[...xn(i,u,g)].map(nr).map(h=>Ge(h,{styleIds:y,numIds:l,relIds:Pt.relIdMap,footnoteIds:E,endnoteIds:D,bookmarkIds:Zn,sdtIds:rt,revisionIds:er,docPrIds:tr}));return {ok:true,pkg:a,blocks:Ei}}var ms=16*1024*1024;function us(e){let t=e.parts.get(e.mainDocumentPart);if(!t||t.root.kind!=="document")return false;let n=t.root.children.find(i=>i.kind==="body");if(!n||n.kind!=="body"||n.children.length>chunkGHNTGVKG_cjs.Oh)return false;let r=0,o=(i,a,s)=>{if(a>s||(r+=1,r>chunkGHNTGVKG_cjs.Qh))return false;if(i.kind==="textValue")return true;for(let l of i.children)if(!o(l,a+1,s))return false;return true};for(let i of n.children)if(!o(i,1,chunkGHNTGVKG_cjs.Ph))return false;for(let[i,a]of e.parts)if(i!==e.mainDocumentPart&&/\/(styles|numbering|footnotes|endnotes)\.xml$/.test(i)&&!o(a.root,1,chunkGHNTGVKG_cjs.Ph*4))return false;return true}function Wo(e,t,n){if(n.fragmentBytes.byteLength>ms)return {ok:false,reason:"invalidArgs",detail:"fragment-too-large"};let r=chunkGHNTGVKG_cjs.cc(n.fragmentBytes);if(!r.ok)return {ok:false,reason:"invalidArgs",detail:`fragment-read:${r.reason}`};let o=r.package;if(!us(o))return {ok:false,reason:"invalidArgs",detail:"fragment-over-budget"};let i=e.resolveStory(t);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let{store:a,story:s}=i;if(a.compositionActive||e.compositionSessionOpen())return {ok:false,reason:"invalidArgs",detail:"ime-composition-active"};let l=e.currentPackage(),d=a.checkpoint(),c=a.historyDepth,u=0,m="";return chunkGHNTGVKG_cjs.Ba(e,()=>{let g=a.transact(P=>{for(let k of n.priorOps??[])if(!P.apply(k))return;let f=null,x=P.applyPackage(k=>(f=jo(k,o,s.partName),f.ok?f.pkg:k)),p=f;if(!p||!p.ok){m=`fragment-merge:${p?p.reason:"no-merge"}`,P.apply({op:"insertText",paragraphId:"\0fragment-abort",offset:0,text:"x"});return}x&&(u=p.blocks.length,P.apply({op:"insertFragment",paragraphId:n.paragraphId,offset:n.offset,blocks:p.blocks,lastMarkCovered:n.lastMarkCovered}));},{story:s,...n.actorId?{actorId:n.actorId}:{}});return m.length>0?{ok:false,reason:"invalidArgs",detail:m}:g.ok?g.change?{ok:true,change:e.promoteStoryTransactionToPackageUnit(l,a,d,c),blockCount:u}:{ok:true,change:null,blockCount:u}:{ok:false,reason:g.reason,...g.detail?{detail:g.detail}:{}}},g=>chunkGHNTGVKG_cjs.Ca(g))}var ps=new Set(["insertText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertDrawing","deleteText"]),Vo=new Set(["insertDrawing"]);function fs(e){if(!(e===null||e.start!==e.end))return e}var Xe={"text-local":0,"paragraph-local":1,"flow-structural":2,global:3};function gs(e){return Object.freeze({parts:new Map([[e.name,e]]),partBytes:new Map,relationships:new Map,externalTargets:[],contentTypes:{defaults:new Map,overrides:new Map([[e.name.toLowerCase(),e.contentType]])},mainDocumentPart:e.name})}var Ye=class{current;storyPartName;rev=0;commitCounter=0;undoStack=[];redoStack=[];subscribers=new Set;historyLimit;settingsPartOverride;storyRef=null;composition=null;constructor(t,n,r={}){let o="root"in t,i=typeof n=="string"?n:void 0,a=typeof n=="object"&&n!==null?n:r;this.current=o?gs(t):t,this.storyPartName=i??(o?t.name:t.mainDocumentPart),this.historyLimit=a.historyLimit??200,this.settingsPartOverride=a.settingsPart;}setStoryRef(t){this.storyRef=t;}get part(){let t=this.current.parts.get(this.storyPartName);if(!t)throw new Error(`story part missing: ${this.storyPartName}`);return t}get package(){return this.current}get revision(){return this.rev}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get historyDepth(){return this.undoStack.length}get compositionActive(){return this.composition!==null}graftPackage(t){this.current=t(this.current);}replacePart(t){let n=this.current.parts.get(t.name);t!==n&&(this.current=chunkGHNTGVKG_cjs.ec(this.current,t),this.rev+=1);}checkpoint(){return {pkg:this.current,revision:this.rev,undoStack:this.undoStack.slice(),redoStack:this.redoStack.slice(),composition:this.composition?{entry:{...this.composition.entry},committed:this.composition.committed}:null}}restoreCheckpoint(t){this.current=t.pkg,this.rev=t.revision,this.undoStack.length=0,this.undoStack.push(...t.undoStack),this.redoStack.length=0,this.redoStack.push(...t.redoStack),this.composition=t.composition?{entry:{...t.composition.entry},committed:t.composition.committed}:null;}restoreHistoryStacks(t){this.undoStack.length=0,this.undoStack.push(...t.undoStack),this.redoStack.length=0,this.redoStack.push(...t.redoStack);}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}transact(t,n={}){return chunkGHNTGVKG_cjs.Mb(n.actorId,()=>this.commitTransaction(t,n))}commitTransaction(t,n){let r=n.origin??chunkGHNTGVKG_cjs.b.mutationHuman,o=this.current,i=this.rev,a=this.current,s=null,l=0,d=new Set,c=new Set,u=new Set,m=new Set,g=new Set,y=[],P=n.minimumImpact??"text-local",f=null,x=false,p=null,k=null,w=new Map,T=new Map,R=E=>{let D=T.get(E.name);D||(D={mint:null,written:new Set},T.set(E.name,D));let _=D;return {mint:()=>(_.mint??=chunkGHNTGVKG_cjs.Qf(E))(),wrote:V=>{_.written.add(V);},wroteUnder:V=>_.written.has(V)}},S=()=>{for(let E of T.values())E.mint=null;},A=(E,D)=>{let _=chunkGHNTGVKG_cjs.hh.get(E.op);if(_===void 0)return w.clear(),null;let V=`${D.name}\0${_}`,ue=w.get(V);ue||(ue={id:null},w.set(V,ue));let Le=ue;return ()=>Le.id??=R(D).mint()},G=(E,D)=>{let _=ps.has(E.op);return !_&&chunkGHNTGVKG_cjs.hh.get(E.op)!==void 0?null:((!_||Vo.has(E.op))&&S(),_?R(D):null)},H=null,Q=(E,D)=>{if(s)return false;let _=a.parts.get(E);if(!_)return s={reason:"unknown-part",detail:E},false;let V=chunkGHNTGVKG_cjs.mh(_,this.settingsPartOverride?.()??chunkGHNTGVKG_cjs.xf(a),D,H?.partName===E&&"paragraphId"in D&&H.paragraphId===D.paragraphId?H.fieldNodeId:void 0);if(V)return s={reason:V},false;let ue=A(D,_),Le=G(D,_),Re=this.settingsPartOverride?.()??chunkGHNTGVKG_cjs.xf(a),Te=chunkGHNTGVKG_cjs.eh(Re)&&"paragraphId"in D&&chunkGHNTGVKG_cjs.gh(_,D.paragraphId)?chunkGHNTGVKG_cjs._g(_,D,H?.partName===E&&H.paragraphId===D.paragraphId?H.fieldNodeId:void 0):null;H=Te&&"paragraphId"in D?{partName:E,paragraphId:D.paragraphId,fieldNodeId:Te.fieldNodeId}:null;let nt={deferValidation:true,...ue?{revisionIds:ue}:{},...Le?{trackedRevisionIds:Le}:{}},U=Te?chunkGHNTGVKG_cjs.dh(_,D,Te,nt):chunkGHNTGVKG_cjs.Mh(_,D,nt);if(!U.ok)return s={reason:U.reason,...U.detail?{detail:U.detail}:{}},false;if(Vo.has(D.op)&&S(),a=chunkGHNTGVKG_cjs.ec(a,U.part),U.part===_&&U.effect.dirty.length===0&&U.effect.created.length===0&&U.effect.deleted.length===0&&U.effect.split===void 0&&(U.effect.splits===void 0||U.effect.splits.length===0)&&U.effect.join===void 0&&U.effect.caret===void 0)return true;d.add(E),l+=1;for(let ne of U.effect.dirty)c.add(ne);for(let ne of U.effect.created)u.add(ne);for(let ne of U.effect.deleted)m.add(ne);for(let ne of U.effect.dependencyKeys)g.add(ne);U.effect.split&&y.push({split:U.effect.split});for(let ne of U.effect.splits??[])y.push({split:ne});return U.effect.join&&y.push({join:U.effect.join}),Xe[U.effect.impact]>Xe[P]&&(P=U.effect.impact),U.effect.caret&&(k={paragraphId:U.effect.caret.paragraphId,start:0,end:0}),true};if(t({apply:E=>Q(this.storyPartName,E),applyTo:(E,D)=>Q(E,D),applyPackage:E=>{if(s)return false;w.clear(),S();let D=E(a);if(D===a)return true;for(let[_,V]of D.parts)a.parts.get(_)!==V&&d.add(_);return a=D,l+=1,Xe["flow-structural"]>Xe[P]&&(P="flow-structural"),true},selectionBefore:E=>{f=E;},selectionAfter:E=>{x=true,p=E;}}),s){let E=s;return {ok:false,reason:E.reason,...E.detail?{detail:E.detail}:{}}}if(l===0)return {ok:true,change:null};let me=x?p:k,te=x?fs(p):k??void 0;for(let E of d){let D=o.parts.get(E),_=a.parts.get(E);if(_===void 0)continue;let V=D?chunkGHNTGVKG_cjs.va(D,_):chunkGHNTGVKG_cjs.va(_,_);if(!V.ok)return {ok:false,reason:"tree-invariant",detail:JSON.stringify(V.issues)}}let Se=chunkGHNTGVKG_cjs.oc(a);return Se.ok?((n.recordsHistory??(r!==chunkGHNTGVKG_cjs.b.projection&&r!==chunkGHNTGVKG_cjs.b.awareness))&&(this.composition?(this.composition.committed=true,this.composition={...this.composition,entry:{...this.composition.entry,selectionAfter:me}}):(this.pushUndo({pkg:o,revision:i,selectionBefore:f,selectionAfter:me}),this.redoStack.length=0)),this.current=a,this.rev+=1,n.story&&(this.storyRef=n.story),n.minimumImpact&&Xe[n.minimumImpact]>Xe[P]&&(P=n.minimumImpact),{ok:true,change:this.publish(r,i,{dirty:c,created:u,deleted:m,dependencyKeys:g,splitJoin:y,impact:P,caret:te},n.story??this.storyRef??void 0,n.actorId,n.operationId)}):{ok:false,reason:"package-invariant",detail:JSON.stringify(Se.issues)}}beginComposition(t=null){this.composition||(this.composition={entry:{pkg:this.current,revision:this.rev,selectionBefore:t,selectionAfter:null},committed:false});}endComposition(){let t=this.composition;this.composition=null,!(!t||!t.committed)&&(this.pushUndo(t.entry),this.redoStack.length=0);}cancelComposition(){this.composition=null;}undo(){let t=this.undoStack.pop();if(!t)return null;let n=this.rev;return this.redoStack.push({pkg:this.current,revision:this.rev,selectionBefore:t.selectionBefore,selectionAfter:t.selectionAfter}),this.current=t.pkg,this.rev+=1,this.publish(chunkGHNTGVKG_cjs.b.mutationUndo,n,null,this.storyRef??void 0)}redo(){let t=this.redoStack.pop();if(!t)return null;let n=this.rev;return this.undoStack.push({pkg:this.current,revision:this.rev,selectionBefore:t.selectionBefore,selectionAfter:t.selectionAfter}),this.current=t.pkg,this.rev+=1,this.publish(chunkGHNTGVKG_cjs.b.mutationRedo,n,null,this.storyRef??void 0)}selectionForUndo(){return this.undoStack[this.undoStack.length-1]?.selectionBefore??null}selectionForRedo(){return this.redoStack[this.redoStack.length-1]?.selectionAfter??null}pushUndo(t){this.undoStack.push(t),this.undoStack.length>this.historyLimit&&this.undoStack.shift();}publish(t,n,r,o,i,a){this.commitCounter+=1;let s={change:"model-change",fromRevision:n,toRevision:this.rev,commitId:`commit-${this.commitCounter}`,origin:t,...i?{actorId:i}:{},...a?{operationId:a}:{},dirty:r?[...r.dirty]:[],created:r?[...r.created]:[],deleted:r?[...r.deleted]:[],splitJoin:r?r.splitJoin:[],dependencyKeys:r?[...r.dependencyKeys]:[],impact:r?r.impact:o?.kind==="headerFooter"?"global":"flow-structural",...r?.caret?{caret:r.caret}:{},...o?{story:o}:{}};for(let l of this.subscribers)l(s);return s}};function Nn(e,t){return [...e.values()].map(n=>n.part).filter(n=>t.parts.has(n.name))}function Ko(e,t){return Nn(e,t).map(n=>n.name).sort().join(",")}function zo(e,t,n){if(e.relationships!==t.relationships||e.contentTypes!==t.contentTypes||e.partBytes!==t.partBytes||e.externalTargets!==t.externalTargets||e.mainDocumentPart!==t.mainDocumentPart)return true;if(e.parts===t.parts)return false;if(e.parts.size!==t.parts.size)return true;for(let[r,o]of t.parts)if(r!==n&&e.parts.get(r)!==o)return true;return false}var Ht="http://schemas.openxmlformats.org/wordprocessingml/2006/main",hs="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function qe(e,t){for(let n of e.children)if(n.kind!=="textValue"&&n.namespaceUri===Ht&&n.localName===t)return n;return null}function Bt(e,t){return e.attributes.find(n=>n.namespaceUri===Ht&&n.localName===t)?.value}function ys(e){let t=Bt(e,"val");return t===void 0||t==="1"||t==="true"||t==="on"}function Xo(e,t){return e.kind==="textValue"?Object.freeze({...e,id:t()}):Object.freeze({...e,id:t(),children:e.children.map(n=>Xo(n,t))})}function xs(e){let t=chunkGHNTGVKG_cjs.xa(`<w:styles xmlns:w="${Ht}"><w:style w:type="paragraph" w:styleId="ListParagraph"><w:pPr><w:contextualSpacing/></w:pPr></w:style></w:styles>`,{name:e.name,contentType:hs});if(!t.ok)return null;let n=qe(t.part.root,"style"),r=n?qe(n,"pPr"):null;return r?Xo(r,chunkGHNTGVKG_cjs.Ea(e)):null}var Go=["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"];function ks(e,t){let n=Go.indexOf(t),r=0;return e.forEach((o,i)=>{if(o.kind==="textValue")return;let a=Go.indexOf(o.localName);a!==-1&&a<=n&&(r=i+1);}),r}function Yo(e,t){let n=chunkGHNTGVKG_cjs.ff(e);if(!n)return null;let r=null;for(let d of n.root.children)if(d.kind!=="textValue"&&d.namespaceUri===Ht&&d.localName==="style"&&Bt(d,"type")==="paragraph"&&Bt(d,"styleId")===t){r=d;break}if(!r)return null;let o=qe(r,"name");if(o&&Bt(o,"val")?.trim().toLowerCase()!=="list paragraph"&&t!=="ListParagraph")return null;let i=xs(n);if(!i)return null;let a=qe(i,"contextualSpacing");if(!a)return null;let s=qe(r,"pPr"),l;if(s){let d=qe(s,"contextualSpacing");if(d&&ys(d))return e;l=d?chunkGHNTGVKG_cjs.La(n,d.id,a):chunkGHNTGVKG_cjs.Ka(n,s.id,ks(s.children,"contextualSpacing"),[a]);}else {let d=r.children.findIndex(c=>c.kind!=="textValue"&&["rPr","tblPr","tcPr","tblStylePr"].includes(c.localName));l=chunkGHNTGVKG_cjs.Ka(n,r.id,d===-1?r.children.length:d,[i]);}return l.ok?Object.freeze({...e,parts:new Map([...e.parts,[n.name,l.part]])}):null}var Zo="http://schemas.openxmlformats.org/package/2006/relationships",ea="application/vnd.openxmlformats-package.relationships+xml",Is="http://schemas.openxmlformats.org/package/2006/content-types",qo="/[Content_Types].xml",Je="/word/numbering.xml",Jo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",ft="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Rs=`<Override PartName="${Je}" ContentType="${ft}"/>`;function jt(e){return `${e.ownerPart}\0${e.id}`}function ta(e,t,n){let r=new Set(t.externalTargets.filter(s=>s.type===chunkGHNTGVKG_cjs.Xa).map(jt)),o=n.externalTargets.filter(s=>s.type===chunkGHNTGVKG_cjs.Xa&&!r.has(jt(s)));if(o.length===0)return e;let i=new Set(e.map(jt)),a=o.filter(s=>!i.has(jt(s)));return a.length===0?e:Object.freeze([...e,...a])}function na(e,t,n){let r=e.filter(o=>o.ownerPart===n||t.has(o.ownerPart));return r.length===e.length?e:Object.freeze(r)}function ra(e,t,n=[]){if(e===t)return e;let r=vs(e,t);return r=bs(r,t,n),r}function oa(e,t){let n=new Set;for(let o of e.externalTargets)o.type===chunkGHNTGVKG_cjs.Xa&&o.ownerPart!==e.mainDocumentPart&&(e.parts.has(o.ownerPart)||t.has(o.ownerPart)||n.add(o.ownerPart));for(let o of e.parts.keys()){let i=ws(o);!i||i===e.mainDocumentPart||e.parts.has(i)||t.has(i)||e.externalTargets.some(a=>a.ownerPart===i)||n.add(i);}if(n.size===0)return e;let r=e;for(let o of n)r=Es(r,o);return r}function vs(e,t){let n=t.parts.get(Je);if(!n)return e;let r=chunkGHNTGVKG_cjs.ec(e,n),o=(t.relationships.get(t.mainDocumentPart)??[]).find(a=>a.type===Jo),i=r.relationships.get(r.mainDocumentPart)??[];if(o&&!i.some(a=>a.type===Jo)&&!i.some(a=>a.id===o.id)){let a=Ss(r,{...o,ownerPart:r.mainDocumentPart});a&&(r=a);}if(r.contentTypes.overrides.get(chunkGHNTGVKG_cjs.u(Je))!==ft){let a=Cs(r);a&&(r=a);}return r}function bs(e,t,n){let r=n.filter(i=>i.type===chunkGHNTGVKG_cjs.Xa);if(r.length===0)return e;let o=e;for(let i of r){let a=Ns(e,t,i.ownerPart);if(!a||o.externalTargets.some(d=>d.ownerPart===a&&d.id===i.id)||new Set((o.relationships.get(a)??[]).map(d=>d.id)).has(i.id))continue;let l=Ts(o,{ownerPart:a,id:i.id,type:chunkGHNTGVKG_cjs.Xa,rawTarget:i.rawTarget,sinkSafe:i.sinkSafe},a);l&&(o=l);}return o}function Ns(e,t,n){return n===t.mainDocumentPart?e.mainDocumentPart:typeof n!="string"||n.length===0?null:n}function Ss(e,t){let n=e.mainDocumentPart,r=Sn(n),o=e.parts.get(r),i=chunkGHNTGVKG_cjs.xa(`<Relationships xmlns="${Zo}"><Relationship Id="${chunkGHNTGVKG_cjs.P(t.id,"relationship id")}" Type="${chunkGHNTGVKG_cjs.P(t.type,"relationship type")}" Target="${chunkGHNTGVKG_cjs.P(t.rawTarget,"relationship target")}"/></Relationships>`,{name:r,contentType:ea});if(!i.ok)return null;let a=e.relationships.get(n)??[];if(a.some(d=>d.id===t.id))return null;let s={...t,ownerPart:n,order:a.reduce((d,c)=>Math.max(d,c.order),-1)+1},l=new Map([...e.relationships,[n,[...a,s]]]);return o?aa(e,o,i.part.root.children[0],l):Object.freeze({...e,parts:new Map([...e.parts,[r,i.part]]),relationships:l})}function Ts(e,t,n=e.mainDocumentPart){let r=n;if(typeof r!="string"||r.length===0)return null;let o=Sn(r),i=e.parts.get(o),a=chunkGHNTGVKG_cjs.xa(`<Relationships xmlns="${Zo}"><Relationship Id="${chunkGHNTGVKG_cjs.P(t.id,"relationship id")}" Type="${chunkGHNTGVKG_cjs.Xa}" Target="${chunkGHNTGVKG_cjs.P(t.rawTarget,"relationship target")}" TargetMode="External"/></Relationships>`,{name:o,contentType:ea});if(!a.ok)return null;let s=[...e.externalTargets,t];if(!i)return Object.freeze({...e,parts:new Map([...e.parts,[o,a.part]]),externalTargets:s});let l=aa(e,i,a.part.root.children[0],e.relationships);return l?Object.freeze({...l,externalTargets:s}):null}function aa(e,t,n,r){if(!n)return null;let o=chunkGHNTGVKG_cjs.Ea(t),i=chunkGHNTGVKG_cjs.Ka(t,t.root.id,t.root.children.length,[ia(n,o)]);return i.ok?Object.freeze({...e,parts:new Map([...e.parts,[t.name,i.part]]),relationships:r}):null}function ia(e,t){return e.kind==="textValue"?{...e,id:t()}:{...e,id:t(),children:e.children.map(n=>ia(n,t))}}function Sn(e){let t=e.lastIndexOf("/");return `${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function ws(e){let t=/^(.*)\/_rels\/([^/]+)\.rels$/.exec(e);if(!t)return null;let n=t[1],r=t[2];return n===""||r===""?null:`${n}/${r}`}function Es(e,t){let n=Sn(t),r=new Map(e.parts);r.delete(n);let o=new Map(e.partBytes);o.delete(n);let i=new Map(e.relationships);i.delete(t);let a=Object.freeze(e.externalTargets.filter(s=>s.ownerPart!==t));return Object.freeze({...e,parts:r,partBytes:o,relationships:i,externalTargets:a})}function Cs(e){let t=e.contentTypes.overrides.get(chunkGHNTGVKG_cjs.u(Je));if(t===ft)return e;if(t!==void 0)return null;let n=e.partBytes.get(qo);if(!n)return null;let r=fflate.strFromU8(n),o=Qo(r);if(!o)return null;let i=r.lastIndexOf(`</${o.rootName}>`);if(i===-1)return null;let a=r.slice(0,i)+Rs+r.slice(i),s=Qo(a);if(!s||s.rootName!==o.rootName)return null;let l=[...o.children,sa("Override",{PartName:Je,ContentType:ft})];return s.children.length!==l.length||s.children.some((d,c)=>d!==l[c])?null:Object.freeze({...e,partBytes:new Map([...e.partBytes,[qo,fflate.strToU8(a)]]),contentTypes:Object.freeze({defaults:e.contentTypes.defaults,overrides:new Map([...e.contentTypes.overrides,[chunkGHNTGVKG_cjs.u(Je),ft]])})})}function Qo(e){let t=chunkGHNTGVKG_cjs.X(e);if(!t.ok)return null;let n=t.nodes.filter(s=>s.type==="element");if(n.length!==1)return null;let r=n[0],o=r.name.indexOf(":"),i=o===-1?"":r.name.slice(0,o);if(r.name.slice(o+1)!=="Types"||r.attributes[i?`xmlns:${i}`:"xmlns"]!==Is)return null;let a=[];for(let s of r.children)s.type==="element"&&a.push(sa(s.name,s.attributes));return {rootName:r.name,children:a}}function sa(e,t){let n=Object.entries(t).map(([r,o])=>`${r}=${o}`).sort();return [e,...n].join("")}var la=4e3,da=64;function ca(e){return chunkGHNTGVKG_cjs.If(e,"footnote")!==null||chunkGHNTGVKG_cjs.If(e,"endnote")!==null}function ma(e,t,n,r){if(!ca(e))return false;if(r.has(n.paragraphId))return true;r.add(n.paragraphId);let o=chunkGHNTGVKG_cjs.Ga(t,n.paragraphId);return !o||o.kind!=="paragraph"?true:chunkGHNTGVKG_cjs.Ke(o).some(i=>i.node.kind==="noteReference"&&i.start<n.end&&i.end>n.start)}function ua(e,t,n,r){if(!ca(e))return false;if(r.has(n.blockId))return true;r.add(n.blockId);let o=chunkGHNTGVKG_cjs.Ga(t,n.blockId);if(!o||o.kind==="textValue")return true;let i=0,a=(s,l)=>{if(i>=la||l>da)return true;if(i+=1,s.kind==="textValue")return false;if(s.kind==="paragraph")return chunkGHNTGVKG_cjs.Ke(s).some(d=>d.node.kind==="noteReference");for(let d of s.children)if(a(d,l+1))return true;return false};return a(o,0)}function pa(e,t,n){if(n.count>=la||t>da)return true;if(n.count+=1,e.kind==="textValue")return false;if(e.kind==="commentRangeStart"||e.kind==="commentRangeEnd"||e.kind==="commentReference")return true;for(let r of e.children)if(pa(r,t+1,n))return true;return false}function fa(e,t,n,r){if(!chunkGHNTGVKG_cjs.lg(e))return false;let o=n.op==="deleteText"?n.paragraphId:n.blockId;if(r.has(o))return true;r.add(o);let i=chunkGHNTGVKG_cjs.Ga(t,o);return !i||i.kind==="textValue"?true:pa(i,0,{count:0})}var Tn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",wn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";function ga(e,t){let r=(e.relationships.get(e.mainDocumentPart)??[]).find(o=>o.id===t);return r?r.type!==Tn&&r.type!==wn?{ok:false,reason:"wrong-relationship-type",detail:r.type}:Ms(e,r):{ok:false,reason:"dangling-relationship",detail:t}}function Ms(e,t){let n=chunkGHNTGVKG_cjs.E(t);if(n.mode==="External")return {ok:false,reason:"external-relationship",detail:t.id};if(!n.target.ok)return {ok:false,reason:"bad-relationship-target",detail:n.target.reason};let r=e.parts.get(n.target.partName);if(!r)return {ok:false,reason:"missing-part",detail:n.target.partName};let o=r.root.localName;return o!=="hdr"&&o!=="ftr"?{ok:false,reason:"not-a-story-part",detail:o||r.name}:{ok:true,partName:r.name,part:r}}function Ue(e,t){return t.compositionActive||e.compositionSessionOpen()?{ok:false,reason:"invalidArgs",detail:"ime-composition-active"}:null}function ha(e,t){let n=chunkGHNTGVKG_cjs.Ga(e,t);return !n||n.kind!=="drawing"?null:n.children.find(o=>o.kind==="inlineDrawing"||o.kind==="anchoredDrawing")??null}function ya(e,t,n){let r=e.parts.get(t);if(!r)return null;let o=chunkGHNTGVKG_cjs.Ga(r,n);return !o||o.kind!=="drawing"?null:chunkGHNTGVKG_cjs.lb(o,{ownerPartName:t,supportedMcRequires:chunkGHNTGVKG_cjs.eb,limits:chunkGHNTGVKG_cjs.db,resolveRelationship:chunkGHNTGVKG_cjs.gb(e,t)})}function xa(e,t,n){let r=chunkGHNTGVKG_cjs.F(e.relationships.get(t)??[],t,n);return r.mode==="internal"?r.partName:null}function Qe(e,t,n,r){let o=e.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let i=Ue(e,o.store);if(i)return i;let{store:a,story:s}=o;return chunkGHNTGVKG_cjs.Ba(e,()=>Ds(e,a,s,n,r),l=>chunkGHNTGVKG_cjs.Ca(l))}function Ds(e,t,n,r,o){let i=n.partName,a=e.currentPackage(),s=t.checkpoint(),l=t.historyDepth,d=null,c=false,u=false,m=t.transact(P=>{if(o?.commitGuard?.()===false){u=true;return}if(o?.expectedPackageRevision!==void 0&&e.packageRevision!==o.expectedPackageRevision){c=true;return}let f=r(P,i);if(f===null){P.apply({op:"insertText",paragraphId:"\0task12-abort",offset:0,text:"x"});return}d=f;},{story:n,...o?.actorId?{actorId:o.actorId}:{},...n.kind==="headerFooter"||n.kind==="notesPart"?{minimumImpact:"global"}:{}});if(u)return {ok:false,reason:"invalidArgs",detail:"stale drawing selection"};if(c)return {ok:false,reason:"invalidArgs",detail:"stale-package-epoch"};if(!m.ok)return {ok:false,reason:m.reason,...m.detail?{detail:m.detail}:{}};if(!m.change)return {ok:true,change:null};let g=m.change.created.find(P=>{let f=t.part;return chunkGHNTGVKG_cjs.Ga(f,P)?.kind==="drawing"});return g&&(d=g),{ok:true,change:e.promoteStoryTransactionToPackageUnit(a,t,s,l),...d?{drawingNodeId:d}:{}}}function ka(e,t,n){let r=e.parts.get(t);if(!r)return null;let o=ha(r,n);return o?chunkGHNTGVKG_cjs.Gh(o):null}function En(e,t,n,r){let o=false;return e.applyPackage(i=>{let a=i.parts.get(t);if(!a)return i;let s=chunkGHNTGVKG_cjs.Ga(a,n);if(!s||s.kind!=="drawing")return i;let l=ha(a,n);if(!l)return i;let d=chunkGHNTGVKG_cjs.Hh(l,r),c=As(s,d),u=chunkGHNTGVKG_cjs.La(a,s.id,c,{deferValidation:true});return u.ok?(o=true,chunkGHNTGVKG_cjs.ec(i,u.part)):i}),o}function As(e,t){return {...e,children:e.children.map(n=>n.id===t.id?t:n)}}async function Pa(e,t,n){let r=chunkGHNTGVKG_cjs.Yb(n.widthPoints),o=chunkGHNTGVKG_cjs.Yb(n.heightPoints);if(r===null||o===null)return {ok:false,reason:"invalidArgs",detail:"invalid-dimensions"};let i=e.resolveStory(t);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let a=Ue(e,i.store);if(a)return a;let s=i.story.partName,l=await chunkGHNTGVKG_cjs.Ub(n.decodePort,n.bytes,n.mime);if(!l.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let d=l.bytes,c=chunkGHNTGVKG_cjs.Wb(e.currentPackage(),s,{bytes:d,mime:n.mime});if(!c.ok)return {ok:false,reason:"invalidArgs",detail:c.reason==="invalid-image"?"invalid-image":c.reason};let u=c.partName,m=Qe(e,t,(g,y)=>{let P=e.currentPackage(),f=chunkGHNTGVKG_cjs.Wb(P,y,{bytes:d,mime:n.mime});if(!f.ok)return null;P=f.pkg,u=f.partName;let x;if(n.hyperlink){let k=chunkGHNTGVKG_cjs.nf(P,n.hyperlink,y);if(!k)return null;P=k.pkg,x=k.relationshipId;}if(!g.applyPackage(()=>P))return null;let p=chunkGHNTGVKG_cjs.Zb({docPrId:f.docPrId,relationshipId:f.relationshipId,extentEmu:{cx:r,cy:o},...n.title!==void 0?{title:n.title}:{},...n.description!==void 0?{description:n.description}:{},...x?{hyperlinkRelationshipId:x}:{}});return g.apply({op:"insertDrawing",paragraphId:n.paragraphId,offset:n.offset,drawing:p,...n.revision?{revision:n.revision}:{}})?p.id:null},{expectedPackageRevision:n.expectedPackageRevision,...n.commitGuard?{commitGuard:n.commitGuard}:{},...n.actorId?{actorId:n.actorId}:{}});return m.ok?m.change?{...m,mediaPartName:u}:{ok:true,change:null,mediaPartName:u}:m}async function Cn(e,t,n,r,o,i,a){let s=e.resolveStory(t);if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};let l=Ue(e,s.store);if(l)return l;let d=s.story.partName,c=await chunkGHNTGVKG_cjs.Ub(i,r,o);if(!c.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let u=c.bytes,m=chunkGHNTGVKG_cjs.Wb(e.currentPackage(),d,{bytes:u,mime:o});return m.ok?Qe(e,t,(g,y)=>{let P=e.currentPackage(),f=ya(P,d,n),x=f?.picture?.embeddedRelationshipId??null,p=f?.picture?.linkedRelationshipId??null,k=x??p;if(!k)return null;let w=x!==null?xa(P,d,x):null,T=P,R=chunkGHNTGVKG_cjs.Wb(T,y,{bytes:u,mime:o});return !R.ok||(T=R.pkg,!g.applyPackage(()=>T))||!g.apply({op:"replaceDrawingResource",drawingNodeId:n,relationshipId:R.relationshipId})?null:(g.applyPackage(S=>chunkGHNTGVKG_cjs.$b(S,y,w,k)),n)},{expectedPackageRevision:a.expectedPackageRevision,...a.commitGuard?{commitGuard:a.commitGuard}:{},...a.actorId?{actorId:a.actorId}:{}}):{ok:false,reason:"invalidArgs",detail:m.reason==="invalid-image"?"invalid-image":m.reason}}function Oa(e,t,n){let r=e.resolveStory(t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let o=Ue(e,r.store);if(o)return o;let i=r.story.partName,a=e.currentPackage(),s=ya(a,i,n);if(!s)return {ok:false,reason:"unknown-drawing"};let l=s.picture?.embeddedRelationshipId??null,d=s.picture?.linkedRelationshipId??null,c=l??d,u=l!==null?xa(a,i,l):null;return Qe(e,t,(m,g)=>m.apply({op:"deleteDrawing",drawingNodeId:n})?(m.applyPackage(y=>chunkGHNTGVKG_cjs.$b(y,g,u,c)),n):null)}function _s(e,t){let n=null,r=i=>{let a=false,s=false,l=(d,c)=>{if(a||d.kind==="textValue")return;if(d.id===t){a=true,s=c;return}let u=c||d.kind==="revisionDelete"||d.kind==="revisionMoveFrom";for(let m of d.children)l(m,u);};return l(i,false),s},o=i=>{if(!(n!==null||i.kind==="textValue")){if(i.kind==="paragraph"){let a=chunkGHNTGVKG_cjs.Me(i).spanOf(t);if(a!==null&&a.end>a.start){let s=chunkGHNTGVKG_cjs.Ga(e,t);if(!s||s.kind!=="drawing"&&!chunkGHNTGVKG_cjs.hb(s))return;n={paragraphId:i.id,start:a.start,end:a.end,alreadyDeleted:r(i)};}return}for(let a of i.children)o(a);}};return o(e.root),n}function Ia(e,t,n,r){let o=e.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let i=Ue(e,o.store);if(i)return i;let a=e.currentPackage().parts.get(o.story.partName);if(!a)return {ok:false,reason:"unknown-drawing"};let s=_s(a,n);return s?s.alreadyDeleted?{ok:true,change:null}:Qe(e,t,l=>l.apply({op:"deleteText",paragraphId:s.paragraphId,start:s.start,end:s.end,revision:r})?n:null):{ok:false,reason:"unknown-drawing"}}async function Ra(e,t,n,r,o,i,a,s){let l=await chunkGHNTGVKG_cjs.ac(o,r,i,void 0,a);return l.ok?Cn(e,t,n,l.bytes,l.mime,a,{expectedPackageRevision:e.packageRevision,...s?{actorId:s}:{}}):{ok:false,reason:"invalidArgs",detail:`${l.reason}${l.detail?`:${l.detail}`:""}`}}function va(e,t,n,r,o,i){let a=e.resolveStory(t);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let s=Ue(e,a.store);return s||Qe(e,t,(l,d)=>{let c=ka(e.currentPackage(),d,n),u=null;if(i!==null){let g=chunkGHNTGVKG_cjs.nf(e.currentPackage(),i,d);if(!g||!l.applyPackage(()=>g.pkg))return null;u=g.relationshipId;}if(!l.apply({op:"setDrawingMetadata",drawingNodeId:n,title:r,description:o,...i===null?{hyperlink:null}:{}}))return null;if(i!==null&&u!==null){if(!En(l,d,n,u))return null}else if(i===null&&!En(l,d,n,null))return null;let m=false;return l.applyPackage(g=>{let y=chunkGHNTGVKG_cjs.pf(g,d,c);return y===null?(m=true,g):y}),m?null:n})}function ba(e,t,n){let r=e.resolveStory(t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let o=Ue(e,r.store);return o||Qe(e,t,(i,a)=>{let s=ka(e.currentPackage(),a,n.drawingNodeId),l=null;if(n.hyperlink!==null){let c=chunkGHNTGVKG_cjs.nf(e.currentPackage(),n.hyperlink,a);if(!c||!i.applyPackage(()=>c.pkg))return null;l=c.relationshipId;}for(let c of n.ops)if(!i.apply(c))return null;if(!En(i,a,n.drawingNodeId,n.hyperlink===null?null:l))return null;let d=false;return i.applyPackage(c=>{let u=chunkGHNTGVKG_cjs.pf(c,a,s);return u===null?(d=true,c):u}),d?null:n.drawingNodeId})}function Fs(e,t){if(e===t)return true;if(e.byteLength!==t.byteLength)return false;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return false;return true}function Na(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e)if(t.get(n)!==r)return false;return true}function Us(e,t){return e===t||e.ownerPart===t.ownerPart&&e.id===t.id&&e.type===t.type&&e.rawTarget===t.rawTarget&&e.targetMode===t.targetMode&&e.order===t.order}function Ls(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e){let o=t.get(n);if(!o||o.length!==r.length||o!==r&&r.some((i,a)=>!Us(i,o[a])))return false}return true}function $s(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let o=t[r];return n===o||n.ownerPart===o.ownerPart&&n.id===o.id&&n.type===o.type&&n.rawTarget===o.rawTarget&&n.sinkSafe===o.sinkSafe})}function Bs(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e){let o=t.get(n);if(!o||!Fs(r,o))return false}return true}function Hs(e,t){return e.contentTypes===t.contentTypes||Na(e.contentTypes.defaults,t.contentTypes.defaults)&&Na(e.contentTypes.overrides,t.contentTypes.overrides)}var Wt=Object.freeze({equal:true,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"}),Vt=Object.freeze({equal:false,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"});function Sa(e){for(let[t,n]of e)if(!chunkGHNTGVKG_cjs.sa(t,n))return Vt;return Wt}function js(e,t){if(e===t)return Wt;if(e.mainDocumentPart!==t.mainDocumentPart||e.parts.size!==t.parts.size||!Bs(e.partBytes,t.partBytes)||!Ls(e.relationships,t.relationships)||!$s(e.externalTargets,t.externalTargets)||!Hs(e,t))return Vt;let n=[];for(let[a,s]of e.parts){let l=t.parts.get(a);if(!l)return Vt;s!==l&&n.push([s,l]);}if(n.length===0)return Wt;let[r,o]=n[0];if(n.length>1||r.name!==e.mainDocumentPart)return Sa(n);let i=chunkGHNTGVKG_cjs.ta(o.root,r.root);return i.undecided?Sa(n):i.equal?Wt:!i.idsPreserved||i.reach==="outside-paragraph"||i.paragraphIds.length===0?Vt:{equal:false,dirty:i.paragraphIds,dependencyKeys:[chunkGHNTGVKG_cjs.g.story],impact:i.reach==="paragraph-text"?"text-local":"flow-structural"}}function Mn(e){return {ok:false,reason:"package-invariant",detail:e}}function Ws(e,t){if(!e.parts.get(e.mainDocumentPart))return Mn("no-main-document");for(let[r,o]of e.parts){let i=t?.parts.get(r);if(i===o)continue;let a=i?chunkGHNTGVKG_cjs.va(i,o):chunkGHNTGVKG_cjs.ua(o);if(!a.ok)return Mn(`invalid-part:${r}:${a.issues[0]?.code??"invalid"}`)}let n=chunkGHNTGVKG_cjs.oc(e);return n.ok?null:Mn(n.issues[0]?.code??"package-invariant")}function Ta(e,t,n){let r=e.currentPackage(),o=js(t,r);if(o.equal)return {ok:true,change:null};let i=Ws(t,r);if(i)return i;let a=e.bodyStore().part.name,s=o.impact!=="global"&&t.mainDocumentPart===a;return chunkGHNTGVKG_cjs.Ba(e,()=>{let l=e.packageRevision;return e.installAuthoritativePackageSnapshot(t),{ok:true,change:e.publishStoryWrite({change:"model-change",fromRevision:l,toRevision:l+1,commitId:`pkg-remote-${l+1}`,origin:n.origin,...n.actorId?{actorId:n.actorId}:{},...n.operationId?{operationId:n.operationId}:{},dirty:s?o.dirty:[],created:[],deleted:[],splitJoin:[],dependencyKeys:s?o.dependencyKeys:[],impact:s?o.impact:"global",story:{kind:"body",partName:a}})}},()=>false)}function Ca(e,t,n,r){let o=[...t],i=new Set;for(let a of o)e.parts.has(a)&&i.add(a);for(let a of n)wa(a,o,i);for(let a of r)wa(a,o,i);return i}function Ma(e,t,n,r,o){let i=new Set(e);i.add(t),i.add(n);for(let a of r)Ea(a,i);for(let a of o)Ea(a,i);return i}function wa(e,t,n){if(e.kind==="story"){n.add(e.partName);return}for(let r of t)(e.before.parts.has(r)||e.after.parts.has(r))&&n.add(r);}function Ea(e,t){if(e.kind==="story"){t.add(e.partName);return}for(let n of e.before.parts.keys())t.add(n);for(let n of e.after.parts.keys())t.add(n);}var Da=new Set(["acceptRevision","rejectRevision","acceptAllRevisions","rejectAllRevisions"]),Vs=new Set(["deleteTableRow","deleteTableColumn","removeContentControl","removeRepeatingSectionItem"]),Ks=64,Aa=class{pkg;packageRev=0;body;stories=new Map;rIdToPartName=new Map;undoOrder=[];redoOrder=[];subscribers=new Set;historyLimit;maxEditableStoryParts;cascadeNoteReferences;lastChange=null;shellHyperlinks=Object.freeze([]);compositionSession=null;commitCounter=0;currentPackageMemo=null;constructor(t,n,r={}){this.pkg=chunkGHNTGVKG_cjs.ec(t,n),this.historyLimit=r.historyLimit??200,this.maxEditableStoryParts=r.maxEditableStoryParts??Ks,this.cascadeNoteReferences=r.cascadeDeletedNoteReferences??chunkGHNTGVKG_cjs._f,this.body=new Ye(this.pkg,n.name,{historyLimit:this.historyLimit,settingsPart:()=>chunkGHNTGVKG_cjs.xf(this.pkg)}),this.body.setStoryRef({kind:"body",partName:n.name});}get packageRevision(){return this.packageRev}get canUndo(){return this.undoOrder.length>0}get canRedo(){return this.redoOrder.length>0}get lastModelChange(){return this.lastChange}bodyStore(){return this.body}currentPackage(){let t=this.currentPackageMemo;if(t&&t.pkg===this.pkg&&t.bodyPart===this.body.part){let o=0,i=true;for(let a of this.stories.values()){if(t.storyParts[o]!==a.part){i=false;break}o+=1;}if(i&&o===t.storyParts.length)return t.result}let n=chunkGHNTGVKG_cjs.ec(this.pkg,this.body.part),r=[];for(let o of this.stories.values())r.push(o.part),this.pkg.parts.has(o.part.name)&&(n=chunkGHNTGVKG_cjs.ec(n,o.part));return this.currentPackageMemo={pkg:this.pkg,bodyPart:this.body.part,storyParts:r,result:n},n}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}resolveStory(t){return t.kind==="body"?{ok:true,story:{kind:"body",partName:this.body.part.name},store:this.body}:t.kind==="notesPart"?t.noteKind!=="footnote"&&t.noteKind!=="endnote"?{ok:false,reason:"unknown-scope",detail:String(t.noteKind)}:this.openNotesPartStore(t.noteKind):t.kind!=="headerFooter"||typeof t.rId!="string"||t.rId.length===0?{ok:false,reason:"unknown-scope",detail:String(t.kind)}:this.openHeaderFooterStore(t.rId)}partFor(t){let n=this.resolveStory(t);return n.ok?n.store.part:null}revisionFor(t){let n=this.resolveStory(t);return n.ok?n.store.revision:null}transact(t,n,r={}){return chunkGHNTGVKG_cjs.Ba(this,()=>this.commitStoryTransaction(t,n,r),chunkGHNTGVKG_cjs.Ca)}commitStoryTransaction(t,n,r={}){let o=this.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let{store:i,story:a}=o,s=this.currentPackage(),l=i.historyDepth,d=i.compositionActive,c=i.checkpoint(),u=false,m=new Set,g=false,y=new Set,P=false,f,x=false;i.graftPackage(()=>this.currentPackage());let p=i.transact(T=>{n({...T,applyTo:(R,S)=>{let A=T.applyTo(R,S);return A&&R!==a.partName&&(x=true),A},applyPackage:R=>T.applyPackage(S=>{let A=R(S);return A!==S&&!x&&(x=zo(S,A,a.partName)),A}),apply:R=>(R.op==="setListNumbering"&&R.numId!==null&&(P=true),R.op==="setParagraphProperties"&&(f??=R.properties.find(S=>S.localName==="pStyle")?.attributes?.val),u||(R.op==="deleteText"&&ma(this.pkg,i.part,R,m)||R.op==="deleteBlock"&&ua(this.pkg,i.part,R,m)||Da.has(R.op))&&(u=true),g||(R.op==="deleteText"||R.op==="deleteBlock"?g=fa(this.pkg,i.part,R,y):(Da.has(R.op)||Vs.has(R.op))&&(g=true)),T.apply(R)),selectionBefore:R=>T.selectionBefore(R),selectionAfter:R=>T.selectionAfter(R)});},{...r,story:a,...a.kind==="headerFooter"||a.kind==="notesPart"?{minimumImpact:"global"}:{}});if(!p.ok)return {ok:false,reason:p.reason,...p.detail?{detail:p.detail}:{}};this.syncPackageFromStore(i);let k=false;if(p.change&&x&&(this.installPackageSnapshotInternal(i.package),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),k=true),P&&f){let T=Yo(this.pkg,f);T&&this.replacePackageShell(T);}let w=false;if(p.change&&u){let T=this.currentPackage(),R=this.cascadeNoteReferences(s,T);if(R===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"note-cascade-failed"};R!==T&&(this.installPackageSnapshotInternal(R),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),w=true);}if(p.change&&g){let T=this.currentPackage(),R=chunkGHNTGVKG_cjs.pg(s,T,{storyPartName:a.partName});if(R===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"comment-cascade-failed"};R!==T&&(this.installPackageSnapshotInternal(R),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),w=true);}if(p.change){this.packageRev+=1;let T=w||k;!d&&r.recordsHistory!==false&&(i.historyDepth>l||T)&&(T?this.pushUndoPointer({kind:"package",before:s,after:this.currentPackage()}):this.pushUndoPointer({kind:"story",partName:a.partName,story:a}));let R=T?this.publishSynthetic(p.change.origin,"global",a,p.change.created):p.change;return T||this.publish(R),{ok:true,change:R}}return {ok:true,change:p.change}}compositionSessionOpen(){return this.compositionSession!==null}beginComposition(t,n=null){let r=this.resolveStory(t);return !r.ok||this.compositionSession&&this.compositionSession.partName!==r.story.partName&&(this.endComposition(),r=this.resolveStory(t),!r.ok)?false:(this.compositionSession||(this.compositionSession={partName:r.story.partName,beforePackage:this.currentPackage(),storyCheckpoint:r.store.checkpoint(),packageWideEffects:false}),r.store.beginComposition(n),true)}endComposition(){let t=this.compositionSession;if(this.compositionSession=null,!t){this.body.endComposition();return}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return;let r=n.historyDepth;if(n.endComposition(),t.packageWideEffects){n.restoreHistoryStacks(t.storyCheckpoint),this.syncPackageFromStore(n),this.pushUndoPointer({kind:"package",before:t.beforePackage,after:this.currentPackage()});return}if(n.historyDepth>r){let o=t.partName===this.body.part.name?{kind:"body",partName:t.partName}:this.storyRefForPart(t.partName);o&&this.pushUndoPointer({kind:"story",partName:t.partName,story:o});}this.syncPackageFromStore(n);}cancelComposition(){let t=this.compositionSession;if(this.compositionSession=null,!t){this.body.cancelComposition();return}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(t.packageWideEffects){n&&n.restoreCheckpoint(t.storyCheckpoint),this.installPackageSnapshotInternal(t.beforePackage),this.packageRev+=1;let r=t.partName===this.body.part.name?{kind:"body",partName:t.partName}:this.storyRefForPart(t.partName);this.publishSynthetic(chunkGHNTGVKG_cjs.b.mutationHuman,"global",r??{kind:"body",partName:this.body.part.name},[]);return}n?.cancelComposition();}applyLifecycleOp(t){return chunkGHNTGVKG_cjs.Ba(this,()=>this.commitLifecycleOp(t),chunkGHNTGVKG_cjs.Ca)}commitLifecycleOp(t){let n=this.currentPackage();if(chunkGHNTGVKG_cjs.Yf(t)){let a=chunkGHNTGVKG_cjs.Zf(n,t);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};if(a.package===n)return {ok:true,change:null};this.installPackageSnapshotInternal(a.package),this.pushUndoPointer({kind:"package",before:n,after:a.package}),this.packageRev+=1;let s={kind:"body",partName:this.body.part.name},l=this.publishSynthetic(chunkGHNTGVKG_cjs.b.mutationHuman,a.impact,s,a.createdPartName?[a.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:l}}if(!chunkGHNTGVKG_cjs.qf(t))return {ok:false,reason:"invalidArgs",detail:"not-lifecycle-op"};let r=chunkGHNTGVKG_cjs.rf(n,t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};this.installPackageSnapshotInternal(r.package),this.pushUndoPointer({kind:"package",before:n,after:r.package}),this.packageRev+=1;let o={kind:"body",partName:this.body.part.name},i=this.publishSynthetic(chunkGHNTGVKG_cjs.b.mutationHuman,r.impact,o,r.createdPartName?[r.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:i}}undo(){let t=this.undoOrder.pop();if(!t)return null;if(t.kind==="package"){this.installPackageSnapshotInternal(t.before),this.redoOrder.push(t),this.packageRev+=1;let o=this.publishSynthetic(chunkGHNTGVKG_cjs.b.mutationUndo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),o}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return null;let r=n.undo();return r?(this.redoOrder.push(t),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}redo(){let t=this.redoOrder.pop();if(!t)return null;if(t.kind==="package"){this.installPackageSnapshotInternal(t.after),this.undoOrder.push(t),this.packageRev+=1;let o=this.publishSynthetic(chunkGHNTGVKG_cjs.b.mutationRedo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),o}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return null;let r=n.redo();return r?(this.undoOrder.push(t),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}selectionForUndo(){let t=this.undoOrder[this.undoOrder.length-1];return !t||t.kind==="package"?null:(t.partName===this.body.part.name?this.body:this.stories.get(t.partName))?.selectionForUndo()??null}selectionForRedo(){let t=this.redoOrder[this.redoOrder.length-1];return !t||t.kind==="package"?null:(t.partName===this.body.part.name?this.body:this.stories.get(t.partName))?.selectionForRedo()??null}openStoryParts(){return Nn(this.stories,this.pkg)}openedStoryCount(){return 1+this.stories.size}openStoryToken(){return Ko(this.stories,this.pkg)}insertImage(t,n){return Pa(this,t,n)}applyFragmentPaste(t,n){return Wo(this,t,n)}replaceImage(t,n,r,o,i,a){return Cn(this,t,n,r,o,i,a)}deleteImage(t,n){return Oa(this,t,n)}deleteImageTracked(t,n,r){return Ia(this,t,n,r)}embedExternalImage(t,n,r,o,i,a,s){return Ra(this,t,n,r,o,i,a,s)}setDrawingMetadataWithHyperlink(t,n,r,o,i){return va(this,t,n,r,o,i)}applyImageProperties(t,n){return ba(this,t,n)}promoteStoryTransactionToPackageUnit(t,n,r,o){this.installPackageSnapshotInternal(n.package),n.historyDepth>o&&n.restoreHistoryStacks(r),this.pushUndoPointer({kind:"package",before:t,after:this.currentPackage()}),this.packageRev+=1;let i=n.part.name===this.body.part.name?{kind:"body",partName:n.part.name}:this.storyRefForPart(n.part.name);return this.publishSynthetic(chunkGHNTGVKG_cjs.b.mutationHuman,i?.kind==="headerFooter"?"global":"flow-structural",i??{kind:"body",partName:this.body.part.name},[])}publishStoryWrite(t){return t?(this.packageRev+=1,this.publish(t),t):null}adoptPackageUnit(t){let n=this.currentPackage();t!==n&&this.pushUndoPointer({kind:"package",before:t,after:n});}installPackageSnapshot(t){this.installPackageSnapshotInternal(t);}installAuthoritativePackageSnapshot(t){this.installPackageSnapshotInternal(t,false);}publishRemotePackage(t,n){return Ta(this,t,n)}replacePackageShell(t){this.shellHyperlinks=ta(this.shellHyperlinks,this.pkg,t);let n=t;n=chunkGHNTGVKG_cjs.ec(n,this.body.part);for(let r of this.stories.values())t.parts.has(r.part.name)&&(n=chunkGHNTGVKG_cjs.ec(n,r.part));this.pkg=n;}installPackageSnapshotInternal(t,n=true){let r=n?ra(t,this.pkg,this.shellHyperlinks):t,o=r.parts.get(r.mainDocumentPart);if(!o)return;this.body.replacePart(o);for(let[a,s]of this.stories){let l=r.parts.get(a);l&&s.replacePart(l);}this.rIdToPartName.clear();let i=r.relationships.get(r.mainDocumentPart)??[];for(let a of i){if(a.type!==Tn&&a.type!==wn)continue;let s=chunkGHNTGVKG_cjs.E(a);s.mode!=="Internal"||!s.target.ok||this.stories.has(s.target.partName)&&r.parts.has(s.target.partName)&&this.rIdToPartName.set(a.id,s.target.partName);}this.pkg=r,this.pkg=chunkGHNTGVKG_cjs.ec(this.pkg,this.body.part);for(let a of this.stories.values())this.pkg.parts.has(a.part.name)&&(this.pkg=chunkGHNTGVKG_cjs.ec(this.pkg,a.part));}openNotesPartStore(t){let n=chunkGHNTGVKG_cjs.If(this.currentPackage(),t);if(!n)return {ok:false,reason:"missing-part",detail:t};let r=this.stories.get(n.name);if(r)return {ok:true,story:{kind:"notesPart",partName:n.name,noteKind:t},store:r};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let o=chunkGHNTGVKG_cjs.Kb(n),i=new Ye(o,{historyLimit:this.historyLimit,settingsPart:()=>chunkGHNTGVKG_cjs.xf(this.pkg)}),a={kind:"notesPart",partName:o.name,noteKind:t};return i.setStoryRef(a),this.stories.set(o.name,i),o!==n&&(this.pkg=chunkGHNTGVKG_cjs.ec(this.pkg,o)),{ok:true,story:a,store:i}}openHeaderFooterStore(t){let n=this.rIdToPartName.get(t);if(n){let l=this.stories.get(n);if(l)return {ok:true,story:{kind:"headerFooter",partName:n,rId:t},store:l}}let r=ga(this.currentPackage(),t);if(!r.ok)return r;let o=this.stories.get(r.partName);if(o)return this.rIdToPartName.set(t,r.partName),{ok:true,story:{kind:"headerFooter",partName:r.partName,rId:t},store:o};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let i=chunkGHNTGVKG_cjs.Kb(r.part),a=new Ye(i,{historyLimit:this.historyLimit,settingsPart:()=>chunkGHNTGVKG_cjs.xf(this.pkg)}),s={kind:"headerFooter",partName:i.name,rId:t};return a.setStoryRef(s),this.stories.set(i.name,a),this.rIdToPartName.set(t,i.name),i!==r.part&&(this.pkg=chunkGHNTGVKG_cjs.ec(this.pkg,i)),{ok:true,story:s,store:a}}storyRefForPart(t){if(t===this.body.part.name)return {kind:"body",partName:t};for(let[r,o]of this.rIdToPartName)if(o===t)return {kind:"headerFooter",partName:t,rId:r};let n=this.currentPackage().parts.get(t);return n?.root.localName==="footnotes"?{kind:"notesPart",partName:t,noteKind:"footnote"}:n?.root.localName==="endnotes"?{kind:"notesPart",partName:t,noteKind:"endnote"}:null}syncPackageFromStore(t){this.pkg=chunkGHNTGVKG_cjs.ec(this.pkg,t.part);}pushUndoPointer(t){this.undoOrder.push(t),this.redoOrder.length=0,this.undoOrder.length>this.historyLimit&&this.undoOrder.shift(),this.evictUnreachableStories();}evictUnreachableStories(){let t=Ca(this.pkg,this.stories.keys(),this.undoOrder,this.redoOrder);for(let[o]of [...this.stories])if(!t.has(o)){this.stories.delete(o);for(let[i,a]of [...this.rIdToPartName])a===o&&this.rIdToPartName.delete(i);}let n=Ma(t,this.pkg.mainDocumentPart,this.body.part.name,this.undoOrder,this.redoOrder),r=oa(this.pkg,n);r!==this.pkg&&(this.pkg=r),this.shellHyperlinks=na(this.shellHyperlinks,n,this.pkg.mainDocumentPart);}publish(t){this.lastChange=t;for(let n of this.subscribers)n(t);}publishSynthetic(t,n,r,o){this.commitCounter+=1;let i=this.packageRev-1,a={change:"model-change",fromRevision:i<0?0:i,toRevision:this.packageRev,commitId:`pkg-commit-${this.commitCounter}`,origin:t,dirty:[],created:[...o],deleted:[],splitJoin:[],dependencyKeys:[],impact:n,story:r};return this.publish(a),a}};function zs(e,t,n){for(let r of e.attributes)if(r.localName===n&&r.namespaceUri===t)return r.value}function _a(e,t){if(!e){let a=chunkGHNTGVKG_cjs.Nb(t);return a?chunkGHNTGVKG_cjs.Ob(new Set,a,chunkGHNTGVKG_cjs.Lb):"0"}let n=-1,r=new Set,o=a=>{if(a.kind!=="textValue"){if(a.kind==="comment"){let s=zs(a,chunkGHNTGVKG_cjs.da,"id");if(s!==void 0&&/^\d{1,10}$/.test(s)){let l=Number(s);Number.isSafeInteger(l)&&l<=chunkGHNTGVKG_cjs.Lb&&(r.add(String(l)),l>n&&(n=l));}}for(let s of a.children)o(s);}};o(e.root);let i=chunkGHNTGVKG_cjs.Nb(t);return i?chunkGHNTGVKG_cjs.Ob(r,i,chunkGHNTGVKG_cjs.Lb):String(n+1)}var Gs=256,Xs=65535,Fa=64;function Kt(e,t){return e.length>t}function Ua(e){return typeof e!="string"||e.trim().length===0?"invalid-author":Kt(e,Gs)?"resource-limit":chunkGHNTGVKG_cjs.O(e)?null:"invalid-author"}function La(e){return typeof e!="string"||e.length===0?"invalid-text":Kt(e,Xs)?"resource-limit":chunkGHNTGVKG_cjs.O(e)?null:"invalid-text"}function Dn(e){if(typeof e!="string")return {ok:false,rejection:"invalid-date"};let t=e.trim();if(Kt(t,Fa))return {ok:false,rejection:"resource-limit"};if(!chunkGHNTGVKG_cjs.O(t))return {ok:false,rejection:"invalid-date"};let n=chunkGHNTGVKG_cjs.Ee(t);return n===null?{ok:false,rejection:"invalid-date"}:Kt(n,Fa)?{ok:false,rejection:"resource-limit"}:{ok:true,value:n}}function zm(e){if(e===void 0)return null;let t=Dn(e);return t.ok?null:t.rejection}function An(e){switch(e){case "invalid-author":return "invalid-author";case "invalid-text":return "invalid-text";case "invalid-date":return "invalid-property-value";case "resource-limit":return "resource-limit"}}function $a(e,t){if(e.kind==="textValue")return e;let n=t.get(e.id);if(n!==void 0)return n;let r=false,o=[];for(let i of e.children){let a=$a(i,t);a!==i&&(r=true),o.push(a);}return r?{...e,children:o}:e}function Js(e,t,n){let r=$a(e.root,t);if(r.kind==="textValue")return {ok:false,issues:[{code:"known-node-invariant",path:e.root.id,nodeId:e.root.id}]};let o=n===null?r:{...r,namespaceBindings:[...r.namespaceBindings,{prefix:n,namespaceUri:chunkGHNTGVKG_cjs.ga}]};return chunkGHNTGVKG_cjs.La(e,e.root.id,o,{deferValidation:true})}function Ba(e,t,n){let r=new Map;for(let i of t){if(i.stampParagraph===null)continue;let a=r.get(i.commentsPartName);a||(a=new Map,r.set(i.commentsPartName,a)),a.set(i.stampParagraph.id,{paragraph:i.stampParagraph,paraId:i.paraId});}let o=e;for(let[i,a]of r){let s=o.parts.get(i);if(!s)return null;let l=chunkGHNTGVKG_cjs.Ib(s.root),d=l??"w14",c=new Map;for(let m of a.values())c.set(m.paragraph.id,n(m.paragraph,m.paraId,d));let u=Js(s,c,l===null?d:null);if(!u.ok)return null;o=chunkGHNTGVKG_cjs.ec(o,u.part);}return o}function Ha(e,t,n){let r=e.root.children.map(o=>o.kind==="textValue"?o:t.get(o.id)??o);return chunkGHNTGVKG_cjs.Ja(e,e.root.id,[...r,...n],{deferValidation:true})}var Va="/word/comments.xml",Ka="/word/commentsExtended.xml",$n="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",Bn="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Qs=[Bn,"application/vnd.ms-word.commentsExtended+xml"],za="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Hn="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",Ne="http://schemas.microsoft.com/office/word/2012/wordml";function ht(e,t,n){for(let r of e.attributes)if(r.localName===n&&r.namespaceUri===t)return r.value}function Ze(e,t){return {kind:"genericExtension",namespaceUri:chunkGHNTGVKG_cjs.da,localName:e,prefix:"w",value:t}}function Ie(e,t,n,r,o,i,a,s=[]){return {id:e,kind:t,namespaceUri:n,localName:o,prefix:r,namespaceBindings:s,attributes:i,children:a}}function Ga(e,t,n,r,o){let i=t===e.mainDocumentPart?[t]:[t,e.mainDocumentPart];for(let a of i)for(let s of chunkGHNTGVKG_cjs.gc(e,a)){if(s.type!==n)continue;let l=chunkGHNTGVKG_cjs.w(a,s.rawTarget);if(!l.ok)continue;if(!e.parts.has(l.partName))return l.partName;let d=chunkGHNTGVKG_cjs.hc(e,l.partName);if(d!==null&&(typeof r=="string"?d===r:r.includes(d)))return l.partName}return o}function _n(e,t,n){let r=e.mainDocumentPart;for(let i of chunkGHNTGVKG_cjs.gc(e,r)){if(i.type!==t)continue;let a=chunkGHNTGVKG_cjs.w(r,i.rawTarget);if(a.ok&&a.partName===n)return e}let o=chunkGHNTGVKG_cjs.lc(e,r);return chunkGHNTGVKG_cjs.mc(o,r,t,chunkGHNTGVKG_cjs.Cg(r,n)).pkg}function jn(e,t){return Ga(e,t,za,$n,Va)}function Xa(e,t){let n=chunkGHNTGVKG_cjs.bg(e,t),r=chunkGHNTGVKG_cjs.cg(e,t,n).extended;return r!==null?r:Ga(e,t,Hn,Qs,Ka)}function ja(e){let t=new Set;for(let n of e.parts.values())for(let r of chunkGHNTGVKG_cjs.Hb(n.root))t.add(r);return t}function Zs(e,t){if(!e)return null;let n=null,r=o=>{if(!(n!==null||o.kind==="textValue")){if(o.kind==="comment"&&ht(o,chunkGHNTGVKG_cjs.da,"id")===t){for(let i=o.children.length-1;i>=0;i-=1){let a=o.children[i];if(a.kind!=="paragraph")continue;let s=ht(a,chunkGHNTGVKG_cjs.ga,"paraId");s!==void 0&&chunkGHNTGVKG_cjs.Db(s)&&(n=s.toUpperCase());return}return}for(let i of o.children)r(i);}};return r(e.root),n}function el(e,t){if(!e)return null;let n=null,r=o=>{if(!(n!==null||o.kind==="textValue")){if(o.kind==="comment"&&ht(o,chunkGHNTGVKG_cjs.da,"id")===t){for(let i=o.children.length-1;i>=0;i-=1){let a=o.children[i];if(a.kind==="paragraph"){n=a;return}}return}for(let i of o.children)r(i);}};return r(e.root),n}function Ya(e){let t=chunkGHNTGVKG_cjs.Ib(e.root);if(t!==null)return {part:e,prefix:t};let n={...e.root,namespaceBindings:[...e.root.namespaceBindings,{prefix:"w14",namespaceUri:chunkGHNTGVKG_cjs.ga}]},r=chunkGHNTGVKG_cjs.La(e,e.root.id,n,{deferValidation:true});return r.ok?{part:r.part,prefix:"w14"}:(chunkGHNTGVKG_cjs.Ia(e.root,n),{part:{...e,root:n},prefix:"w14"})}function qa(e,t,n){return Ie(e.id,"paragraph",e.namespaceUri,e.prefix??"w",e.localName,[...e.attributes.filter(r=>!(r.namespaceUri===chunkGHNTGVKG_cjs.ga&&r.localName==="paraId")),{kind:"genericExtension",namespaceUri:chunkGHNTGVKG_cjs.ga,localName:"paraId",prefix:n,value:t}],e.children,e.namespaceBindings)}function tl(e,t,n,r){let o=e.parts.get(t);if(!o)return e;let i=Ya(o),a=chunkGHNTGVKG_cjs.Ga(i.part,n);if(!a||a.kind!=="paragraph")return chunkGHNTGVKG_cjs.ec(e,i.part);let s=chunkGHNTGVKG_cjs.La(i.part,a.id,qa(a,r,i.prefix),{deferValidation:true});return chunkGHNTGVKG_cjs.ec(e,s.ok?s.part:i.part)}function nl(e,t,n,r){let o=`${Va}#comment-${e}`,i=n.text!==n.text.trim(),a=Ie(`${o}.t`,"text",chunkGHNTGVKG_cjs.da,"w","t",i?[{kind:"xmlSpace",namespaceUri:chunkGHNTGVKG_cjs.ea,localName:"space",prefix:"xml",value:"preserve"}]:[],[{id:`${o}.tv`,kind:"textValue",value:n.text}]),s=Ie(`${o}.rPr`,"runProperties",chunkGHNTGVKG_cjs.da,"w","rPr",[],[Ie(`${o}.rStyle`,"generic",chunkGHNTGVKG_cjs.da,"w","rStyle",[Ze("val","CommentReference")],[])]),l=Ie(`${o}.r`,"run",chunkGHNTGVKG_cjs.da,"w","r",[],[s,a]),d=Ie(`${o}.pPr`,"paragraphProperties",chunkGHNTGVKG_cjs.da,"w","pPr",[],[Ie(`${o}.pStyle`,"generic",chunkGHNTGVKG_cjs.da,"w","pStyle",[Ze("val","CommentText")],[])]),c=Ie(`${o}.p`,"paragraph",chunkGHNTGVKG_cjs.da,"w","p",[{kind:"genericExtension",namespaceUri:chunkGHNTGVKG_cjs.ga,localName:"paraId",prefix:r,value:t}],[d,l]);return Ie(o,"comment",chunkGHNTGVKG_cjs.da,"w","comment",[Ze("id",e),Ze("author",n.author),...n.initials===void 0?[]:[Ze("initials",n.initials)],...n.date===void 0?[]:[Ze("date",n.date)]],[c])}function Fn(e,t){let n=chunkGHNTGVKG_cjs.xa(t,{name:e,contentType:"application/xml"});return n.ok?n.part.root:null}function Ja(e,t){for(let x of [Ua(t.author),La(t.text)])if(x)return {ok:false,reason:An(x)};let n;if(t.date!==void 0){let x=Dn(t.date);if(!x.ok)return {ok:false,reason:An(x.rejection)};n=x.value;}let r={...t,...n===void 0?{}:{date:n}},o=e.package,i=e.part.name,a=jn(o,i),s=Xa(o,i),l=o.parts.get(a),d=_a(l,r.actorId),c=chunkGHNTGVKG_cjs.Gb(`${a}#${d}`,ja(o)),u=t.replyToCommentId===void 0?null:Zs(l,t.replyToCommentId),m=t.replyToCommentId!==void 0&&u===null?el(l,t.replyToCommentId):null;if(t.replyToCommentId!==void 0&&u===null&&!m)return {ok:false,reason:"unknown-revision"};let g=m?chunkGHNTGVKG_cjs.Gb(`${a}#parent-${t.replyToCommentId}`,new Set([...ja(o),c])):null,y=u??g,P=t.anchor.endParagraphId??t.anchor.paragraphId,f=e.transact(x=>{x.applyPackage(p=>{let k=p.parts.has(a)?p:(()=>{let w=Fn(a,`<w:comments xmlns:w="${chunkGHNTGVKG_cjs.da}"/>`);return w?chunkGHNTGVKG_cjs.nc(p,a,w,$n):null})();return k===null?p:_n(k,za,a)}),m&&g&&x.applyPackage(p=>tl(p,a,m.id,g)),x.applyPackage(p=>{let k=p.parts.get(a);if(!k)return p;let w=Ya(k),T=chunkGHNTGVKG_cjs.Ka(w.part,w.part.root.id,w.part.root.children.length,[nl(d,c,r,w.prefix)],{deferValidation:true});return T.ok?chunkGHNTGVKG_cjs.ec(p,T.part):p}),y!==null&&(x.applyPackage(p=>{let k=p.parts.has(s)?p:(()=>{let w=Fn(s,`<w15:commentsEx xmlns:w15="${Ne}"/>`);return w?chunkGHNTGVKG_cjs.nc(p,s,w,Bn):null})();return k===null?p:_n(k,Hn,s)}),x.applyPackage(p=>{let k=p.parts.get(s);if(!k)return p;let T=[...rl(k).has(y.toUpperCase())?[]:[Ln(`${s}#ex-${y}`,y,void 0,false)],Ln(`${s}#ex-${c}`,c,y,false)],R=chunkGHNTGVKG_cjs.Ka(k,k.root.id,k.root.children.length,T,{deferValidation:true});return R.ok?chunkGHNTGVKG_cjs.ec(p,R.part):p})),x.applyTo(i,{op:"insertCommentMarker",paragraphId:P,offset:t.anchor.end,commentId:d,marker:"reference"}),x.applyTo(i,{op:"insertCommentMarker",paragraphId:P,offset:t.anchor.end,commentId:d,marker:"end"}),x.applyTo(i,{op:"insertCommentMarker",paragraphId:t.anchor.paragraphId,offset:t.anchor.start,commentId:d,marker:"start"});},r.actorId===void 0?{}:{actorId:r.actorId});return f.ok?{ok:true,commentId:d,change:f.change}:{ok:false,reason:f.reason}}function Un(e){for(let t=e.children.length-1;t>=0;t-=1){let n=e.children[t];if(n.kind==="paragraph")return n}return null}function Wa(e){let t=Un(e);if(!t)return null;let n=ht(t,chunkGHNTGVKG_cjs.ga,"paraId");return n!==void 0&&chunkGHNTGVKG_cjs.Db(n)?n.toUpperCase():null}function rl(e){let t=new Map;if(!e)return t;let n=r=>{if(r.kind!=="textValue"){if(r.namespaceUri===Ne&&r.localName==="commentEx"){let o=ht(r,Ne,"paraId");o!==void 0&&chunkGHNTGVKG_cjs.Db(o)&&t.set(o.toUpperCase(),r);}for(let o of r.children)n(o);}};return n(e.root),t}function gt(e,t){return {kind:"genericExtension",namespaceUri:Ne,localName:e,prefix:"w15",value:t}}function ol(e,t){return {id:e.id,kind:"generic",namespaceUri:e.namespaceUri,localName:e.localName,...e.prefix===void 0?{}:{prefix:e.prefix},namespaceBindings:e.namespaceBindings,attributes:t,children:e.children}}function al(e,t,n){let r=[],o=false,i=false;for(let a of e.attributes){if(a.namespaceUri===Ne&&a.localName==="done"){o=true,r.push({kind:"genericExtension",namespaceUri:a.namespaceUri,localName:a.localName,...a.prefix===void 0?{}:{prefix:a.prefix},value:n?"1":"0"});continue}a.namespaceUri===Ne&&a.localName==="paraIdParent"&&(i=true),r.push(a);}return !i&&t!==void 0&&r.push(gt("paraIdParent",t)),o||r.push(gt("done",n?"1":"0")),ol(e,r)}function Ln(e,t,n,r){return {id:e,kind:"generic",namespaceUri:Ne,localName:"commentEx",prefix:"w15",namespaceBindings:[],attributes:[gt("paraId",t),...n===void 0?[]:[gt("paraIdParent",n)],gt("done",r?"1":"0")],children:[]}}function Qa(e,t,n){return il(e,t,n,chunkGHNTGVKG_cjs.ag())}function il(e,t,n,r){let o=e.package,i=e.part.name;if(chunkGHNTGVKG_cjs.bg(o,i)===null)return {ok:false,reason:"unknown-comment"};let s=chunkGHNTGVKG_cjs.eg(o,t,{storyPartName:i},r);if(!s.ok)return {ok:false,reason:"unknown-comment"};let l=chunkGHNTGVKG_cjs.dg(o,r);if(l.truncated||r.truncated)return {ok:false,reason:"unknown-comment"};let d=l.used,c=new Map,u=[];for(let P of s.ids){let f=s.records.get(P);if(!f)return {ok:false,reason:"unknown-comment"};if(!Un(f.node))return {ok:false,reason:"unknown-comment"};let p=Wa(f.node),k=p??chunkGHNTGVKG_cjs.Gb(`${f.partName}#done-${P}`,d);p===null&&d.add(k),c.set(P,k);}for(let P of s.ids){let f=s.records.get(P),x=Un(f.node),p=c.get(P),k=Wa(f.node),w=s.parentCommentIdByChildId.get(P),T=s.parentParaIdByCommentId.get(P)??(w===void 0?void 0:c.get(w)),R=s.commentExByParaId.get(p);u.push({paraId:p,stampParagraph:k===null?x:null,commentsPartName:f.partName,parentParaId:T,existing:R?.node,existingParentParaId:R?.parentParaId,existingDone:R?.done??false});}if(u.length===0)return {ok:false,reason:"unknown-comment"};if(u.every(P=>P.existingDone===n))return {ok:true,changed:false,change:null};let m=s.extendedPartName??Ka,g=s.extendedPartName===null,y=e.transact(P=>{P.applyPackage(f=>{let x=Ba(f,u,qa);if(x===null)return f;let p=x;if(!p.parts.has(m)){let S=Fn(m,`<w15:commentsEx xmlns:w15="${Ne}"/>`);if(!S)return f;let A=chunkGHNTGVKG_cjs.nc(p,m,S,Bn);p=g?_n(A,Hn,m):A;}let k=p.parts.get(m);if(!k)return f;let w=new Map,T=[];for(let S of u){let A=S.existingParentParaId??S.parentParaId;S.existing?w.set(S.existing.id,al(S.existing,A,n)):T.push(Ln(`${m}#done-${S.paraId}`,S.paraId,A,n));}let R=Ha(k,w,T);return R.ok?chunkGHNTGVKG_cjs.ec(p,R.part):f});});return y.ok?{ok:true,changed:true,change:y.change}:{ok:false,reason:y.reason}}function fu(e,t){let n=jn(e,t);return e.parts.has(n)&&chunkGHNTGVKG_cjs.hc(e,n)===$n}function gu(e,t){return jn(e,t)}function hu(e,t){return Xa(e,t)}var Za={kind:"body"};function Iu(e,t,n=Za){let r=n.kind==="body"?null:e.resolveStory(n),o=r?.ok?r.store:e.bodyStore(),i=e.currentPackage(),a=o.checkpoint();return o.graftPackage(()=>e.currentPackage()),chunkGHNTGVKG_cjs.Ba(e,()=>{let s=Ja(o,t);return s.ok&&(o.restoreHistoryStacks(a),e.replacePackageShell(o.package),e.adoptPackageUnit(i),e.publishStoryWrite(s.change)),s},s=>chunkGHNTGVKG_cjs.Ca(s))}function Ru(e,t,n){let r=e.bodyStore(),o=e.currentPackage(),i=r.checkpoint();return r.graftPackage(()=>e.currentPackage()),chunkGHNTGVKG_cjs.Ba(e,()=>{let a=Qa(r,t,n);return !a.ok||!a.changed||(r.restoreHistoryStacks(i),e.replacePackageShell(r.package),e.adoptPackageUnit(o),e.publishStoryWrite(a.change)),a},a=>a.ok&&a.changed)}function vu(e,t,n=Za,r){if(t.length===0)return false;let o=n.kind==="body"?e.bodyStore().part:e.partFor(n);if(!o)return false;let i={storyPartName:o.name,...r===void 0?{}:{noteId:r}},a=e.bodyStore(),s=e.currentPackage(),l=a.checkpoint();return a.graftPackage(()=>e.currentPackage()),chunkGHNTGVKG_cjs.Ba(e,()=>{let d=false,c=false,u=a.transact(m=>{m.applyPackage(g=>{let y=g;for(let P of t){let f=P.parentCommentId===void 0?chunkGHNTGVKG_cjs.ng(y,P.commentId,i):chunkGHNTGVKG_cjs.og(y,P.commentId,P.parentCommentId,i);if(f===null)return d=true,g;c||=f!==y,y=f;}return y});});return d||!u.ok||!c?false:(a.restoreHistoryStacks(l),e.installPackageSnapshot(a.package),e.adoptPackageUnit(s),e.publishStoryWrite(u.change),true)},d=>d)}var sl=256*1024,ll=4096;function ti(e,t,n){let r=t.payload,o=e.part.name,i=n??o;if(r){if(r.data.length>sl)return {ok:false,reason:"payload-too-large",detail:"data"};if(r.label.length>ll)return {ok:false,reason:"payload-too-large",detail:"label"}}let a=new Set(chunkGHNTGVKG_cjs.Jc(e.part.root).map(m=>m.node.id)),s=t.replaceControlId===void 0?[]:ni(e,o,t.replaceControlId),l=null,d,c=e.transact(m=>{if(t.replaceControlId!==void 0){m.apply({op:"removeContentControl",controlId:t.replaceControlId,keepContent:false});for(let P of s)m.applyPackage(f=>chunkGHNTGVKG_cjs.Kg(f,P.partName,P.nodeId));}let g=t.replaceUntil;if(g!==void 0&&g<=t.offset){l="invalid-range",d="replaceUntil must be past offset";return}if(g!==void 0&&m.apply({op:"deleteText",paragraphId:t.paragraphId,start:t.offset,end:g}),!r){m.apply({op:"insertInlineContentControl",paragraphId:t.paragraphId,offset:t.offset,tag:t.tag,text:t.text,...t.alias===void 0?{}:{alias:t.alias},...t.lock===void 0?{}:{lock:t.lock}});return}let y=null;m.applyPackage(P=>{let f=chunkGHNTGVKG_cjs.Fg(P,i,r.namespaceUri,r.rootLocalName);if(!f.part)return l="store-not-authored",d=`no customXml store could be created for ${r.namespaceUri}. The namespace must be free of control characters and quotes, the root name must be an XML name, and a store this document already carries for that namespace must use the same root name (${r.rootLocalName})`,P;if(y=chunkGHNTGVKG_cjs.Pg(f.part,r.rootLocalName,r.nodeId),!y)return l="unaddressable-payload",d=`the node id ${JSON.stringify(r.nodeId)} or the namespace ${JSON.stringify(r.namespaceUri)} cannot be written into an XPath. Ids and root names must match [A-Za-z_][\\w.-]{0,127}; a namespace may not contain a quote, an angle bracket or an ampersand`,P;let x=chunkGHNTGVKG_cjs.Jg(f.pkg,f.part.partName,{id:r.nodeId,label:r.label,data:r.data});return chunkGHNTGVKG_cjs.Ig(x,f.part.partName,r.nodeId)?x:(l="store-not-authored",d="the payload node could not be written into the store",P)}),!(l!==null||!y)&&m.apply({op:"insertInlineContentControl",paragraphId:t.paragraphId,offset:t.offset,tag:t.tag,text:t.text,...t.alias===void 0?{}:{alias:t.alias},...t.lock===void 0?{}:{lock:t.lock},dataBinding:y});});if(l!==null)return {ok:false,reason:l,...d===void 0?{}:{detail:d}};if(!c.ok)return {ok:false,reason:c.reason,...c.detail===void 0?{}:{detail:c.detail}};let u=dl(e,a);return {ok:true,change:c.change,...u===void 0?{}:{nodeId:u}}}function dl(e,t){for(let n of chunkGHNTGVKG_cjs.Jc(e.part.root))if(!t.has(n.node.id))return n.node.id}function ni(e,t,n){let r=chunkGHNTGVKG_cjs.Jc(e.part.root).find(i=>i.node.id===n);if(!r)return [];let o=[];for(let i of chunkGHNTGVKG_cjs.Dg(e.package,t)){let a=chunkGHNTGVKG_cjs.Sg(r.node,i.itemId);a!==null&&o.push({partName:i.partName,nodeId:a});}return o}function ri(e,t){let n=e.part.name,r=ni(e,n,t),o=e.transact(i=>{i.apply({op:"removeContentControl",controlId:t,keepContent:false});for(let a of r)i.applyPackage(s=>chunkGHNTGVKG_cjs.Kg(s,a.partName,a.nodeId));});return o.ok?{ok:true,change:o.change}:{ok:false,reason:o.reason,...o.detail===void 0?{}:{detail:o.detail}}}function Eu(e,t,n){if(!e.parts.has(t)||n.length===0)return {ok:true,pkg:e,removed:[]};let r=e,o=[];for(let i of n){let a=chunkGHNTGVKG_cjs.Eg(r,t,i);if(!a)continue;let s=chunkGHNTGVKG_cjs.Rg(r,a.itemId),l=chunkGHNTGVKG_cjs.Lg(r,a.partName,s);if(l.pkg===r&&chunkGHNTGVKG_cjs.Hg(r,a.partName).some(d=>!s.has(d.id)))return {ok:false,reason:`the payload store for ${i} refused the sweep`};r=l.pkg,o.push(...l.removed);}return {ok:true,pkg:r,removed:o}}var ei=new WeakMap;function cl(e,t){let n=ei.get(e);n||(n=new Map,ei.set(e,n));let r=n.get(t);if(r)return r;let o=chunkGHNTGVKG_cjs.Dg(e,t).map(i=>({itemId:i.itemId,nodes:new Map(chunkGHNTGVKG_cjs.Hg(e,i.partName).map(a=>[a.id,a]))}));return n.set(t,o),o}function Cu(e,t,n=t){let r=new Map,o=e.parts.get(t);if(!o)return r;let i=cl(e,n);if(i.length===0)return r;for(let a of chunkGHNTGVKG_cjs.Jc(o.root))for(let s of i){let l=chunkGHNTGVKG_cjs.Sg(a.node,s.itemId);if(l===null)continue;let d=s.nodes.get(l);if(d){r.set(a.node.id,{nodeId:l,label:d.label,data:d.data});break}}return r}function Mu(e,t,n){let r=new Map,o=chunkGHNTGVKG_cjs.Eg(e,t,n);if(!o)return r;for(let i of chunkGHNTGVKG_cjs.Hg(e,o.partName))r.set(i.id,{label:i.label,data:i.data});return r}var oi={kind:"body"};function ai(e,t,n){let r=t.kind==="body"?null:e.resolveStory(t),o=r?.ok?r.store:e.bodyStore(),i=e.currentPackage(),a=o.checkpoint();return o.graftPackage(()=>e.currentPackage()),chunkGHNTGVKG_cjs.Ba(e,()=>{let s=n(o);return s.ok&&(o.restoreHistoryStacks(a),e.replacePackageShell(o.package),e.adoptPackageUnit(i),e.publishStoryWrite(s.change)),s},s=>chunkGHNTGVKG_cjs.Ca(s))}function Fu(e,t,n=oi){return ai(e,n,r=>ti(r,t,e.bodyStore().part.name))}function Uu(e,t,n=oi){return ai(e,n,r=>ri(r,t))}var et="proposed";function ml(e,t){switch(e){case "revisionInsert":case "revisionMoveTo":return t!=="original";case "revisionDelete":case "revisionMoveFrom":return t!=="proposed";default:return false}}function Wn(e,t=et,n){let r=[];return yt(e.children,t,n,0,r),r}function Vn(e,t,n,r,o=et,i){let a=[];for(let s of Wn(e,o,i)){let l=t.get(s.id);if(!l||l.end<=l.start)continue;let d=Math.max(l.start,n),c=Math.min(l.end,r);d>=c||a.push({run:s,start:d,end:c});}return a}function yt(e,t,n,r,o){if(!(r>=chunkGHNTGVKG_cjs.la)){for(let i of e)if(!(i.kind==="textValue"||i.kind==="paragraphProperties")){if(i.kind==="run"){o.push(i);continue}if(chunkGHNTGVKG_cjs.na(i)&&!chunkGHNTGVKG_cjs.ka(i.kind)){yt(i.children,t,n,r+1,o);continue}if(chunkGHNTGVKG_cjs.ka(i.kind)){let a=chunkGHNTGVKG_cjs.Ce(i,"author")??"",s=n?.includesNode?.(i.id,a)??!n?.hiddenAuthors.has(a),l=n&&!s?n.excludedNodeMode?.(i.id,a)??"proposed":t;if(!ml(i.kind,l))continue;yt(i.children,t,n,r+1,o);continue}if(chunkGHNTGVKG_cjs.de(i)){yt(i.children,t,n,r+1,o);continue}if(chunkGHNTGVKG_cjs.Ae(i)){let a=chunkGHNTGVKG_cjs.Be(i);a&&yt(a.children,t,n,r+1,o);continue}}}}var ul=new Set(chunkGHNTGVKG_cjs.Wf),zn=new Set(chunkGHNTGVKG_cjs.Vf);function Yu(e){return zn.has(e)}function zt(e,t,n){return !e||e.kind==="textValue"?void 0:e.children.find(o=>o.kind===t||o.kind==="generic"&&o.localName===n&&o.namespaceUri===chunkGHNTGVKG_cjs.da)}function Gn(e,t){if(!e||e.kind==="textValue")return [];let n=[];for(let r of e.children){if(r.kind==="textValue"||!t.has(r.localName))continue;let o=chunkGHNTGVKG_cjs.J();for(let i of r.attributes)o[i.localName]=i.value;n.push(Object.keys(o).length>0?{localName:r.localName,attributes:o}:{localName:r.localName});}return n}function qu(e,t){let n=chunkGHNTGVKG_cjs.Ga(e,t);return Gn(zt(n,"paragraphProperties","pPr"),ul)}function pl(e,t){let n=chunkGHNTGVKG_cjs.Ga(e,t),r=zt(n,"paragraphProperties","pPr");return Gn(zt(r,"runProperties","rPr"),zn)}function ii(e,t){let n=Array.isArray(t)?t:[t],r=new Set(n.map(i=>i.localName));return [...e.filter(i=>!r.has(i.localName)),...n]}var fl=new Map([["ascii","asciiTheme"],["hAnsi","hAnsiTheme"],["eastAsia","eastAsiaTheme"],["cs","cstheme"]]);function gl(e,t){let n=e.find(o=>o.localName==="rFonts")?.attributes;if(!n)return t;let r={...n,...t.attributes??{}};for(let o of Object.keys(t.attributes??{})){let i=fl.get(o);i&&delete r[i];}return {localName:"rFonts",attributes:r}}function Xn(e){let t=new Map;for(let n of chunkGHNTGVKG_cjs.Ke(e)){let r=n.formatRunIds&&n.formatRunIds.length>0?n.formatRunIds:n.runId?[n.runId]:[];for(let o of r){let i=t.get(o);i?(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end)):t.set(o,{start:n.start,end:n.end});}}return t}function hl(e){let t=new Set;for(let n of chunkGHNTGVKG_cjs.Ke(e))if(n.formatRunIds)for(let r of n.formatRunIds)t.add(r);return t}function Kn(e,t){if(t.localName==="rFonts")return gl(e,t);if(t.localName!=="u")return t;let n=e.find(r=>r.localName==="u")?.attributes;return n?{localName:"u",attributes:{...n,...t.attributes??{}}}:t}function Ju(e,t,n){let r=pl(e,t),o=Array.isArray(n)?n:[n];return ii(r,o.map(i=>Kn(r,i)))}function yl(e,t){return Array.isArray(t)?t.map(n=>Kn(e,n)):Kn(e,t)}function Qu(e,t,n,r,o,i=et,a){let s=chunkGHNTGVKG_cjs.Ga(e,t);if(!s||s.kind!=="paragraph")return [];let l=[],d=hl(s);for(let c of Vn(s,Xn(s),n,r,i,a)){let u=Gn(zt(c.run,"runProperties","rPr"),zn);l.push({start:c.start,end:c.end,properties:ii(u,yl(u,o)),...d.has(c.run.id)?{targetRunIds:[c.run.id]}:{}});}return l}function Zu(e,t,n,r,o=et,i){let a=chunkGHNTGVKG_cjs.Ga(e,t);if(!a||a.kind!=="paragraph"||r<=n)return [];let s=[];for(let l of Vn(a,Xn(a),n,r,o,i)){let d=s[s.length-1];d&&l.start<=d.end?d.end=Math.max(d.end,l.end):s.push({start:l.start,end:l.end});}return s}function ep(e,t,n,r,o=et,i){let a=chunkGHNTGVKG_cjs.Ga(e,t);if(!a||a.kind!=="paragraph")return [];let s=Xn(a),l=[];for(let d of Wn(a,o,i)){let c=s.get(d.id);if(!c||c.end<=c.start)continue;(r>n?Math.max(c.start,n)<Math.min(c.end,r):c.start<=n&&n<c.end)&&l.push(d);}return l}function Yn(e){return ci(e,true)}function op(e){return ci(e,false)}function ci(e,t){let n=t?li.get(e.root):void 0;if(n)return n;let r=new Map,o=s=>{let l=t?si.get(s):void 0;if(l){for(let[c,u]of l)r.set(c,u);return}let d=new Map;kl(s,d,t),t&&si.set(s,d);for(let[c,u]of d)r.set(c,u);},i=(s,l)=>{if(!(s.kind==="textValue"||l>64)){if(s.kind==="paragraph"){o(s);return}for(let d of s.children)i(d,l+1);}};i(e.root,0);let a=(s,l)=>{if(!(s.kind==="textValue"||l>64)){if(s.kind==="paragraph"){let d=t?di.get(s):void 0;if(!d){let c=[];mi(s,0,c,t),d=c,t&&di.set(s,d);}for(let[c,u]of d)r.set(c,u);return}if(s.kind==="tableRow"){let d=t?Gt.get(s):void 0;d||(d=ui(s),t&&Gt.set(s,d));for(let[c,u]of d)r.set(c,u);}for(let d of s.children)a(d,l+1);}};return a(e.root,0),t&&li.set(e.root,r),r}function mi(e,t,n,r){if(!(e.kind==="textValue"||t>64)){if(e.kind==="tableRow"){let o=r?Gt.get(e):void 0;o||(o=ui(e),r&&Gt.set(e,o));for(let i of o)n.push(i);}for(let o of e.children)mi(o,t+1,n,r);}}function ui(e){let t=null,n=(a,s)=>{if(!(t||a.kind==="textValue"||s>64)){if(a.kind==="paragraph"){t=a;return}for(let l of a.children)n(l,s+1);}};if(n(e,0),!t)return xl;let r={paragraphId:t.id,start:0,end:0},o=[],i=(a,s,l)=>{if(a.kind==="textValue"||l>64||a.kind==="paragraph")return;let d=s==="trPr"&&(a.localName==="ins"||a.localName==="del"),c=s==="tcPr"&&(a.localName==="cellIns"||a.localName==="cellDel");(d||c)&&o.push([a.id,r]);for(let u of a.children)i(u,a.localName,l+1);};return i(e,void 0,0),o}var xl=[],si=new WeakMap,li=chunkGHNTGVKG_cjs.fg(8),Gt=new WeakMap,di=new WeakMap;function kl(e,t,n){let r=n?chunkGHNTGVKG_cjs.Me(e):chunkGHNTGVKG_cjs.Oe(e),o=(s,l,d,c)=>{if(!(s.kind==="textValue"||c>64)){t.set(s.id,{paragraphId:e.id,start:l,end:d});for(let u of s.children)o(u,l,d,c+1);}},i=(s,l)=>{if(s.kind==="textValue"||l>64)return;let d=r.spanOf(s);if(s.kind==="run"){if(!d)return;t.set(s.id,{paragraphId:e.id,start:d.start,end:d.end});for(let c of s.children)c.kind==="runProperties"&&o(c,d.start,d.end,l+1);return}d&&t.set(s.id,{paragraphId:e.id,start:d.start,end:d.end});for(let c of s.children)i(c,l+1);};for(let s of e.children)s.kind!=="paragraphProperties"&&i(s,0);let a=e.children.find(s=>s.kind==="paragraphProperties");a&&o(a,r.length,r.length,0);}function Pl(e){let t=pi.get(e.root);if(t)return t;let n=new Map,r=(o,i)=>{if(!(o.kind==="textValue"||i>64)){if(o.kind==="paragraph"){n.has(o.id)||n.set(o.id,n.size);return}if(o.kind==="table"){let a=yi.get(o);if(!a){let s=[],l=(d,c)=>{if(!(d.kind==="textValue"||c>64)){if(d.kind==="paragraph"){s.push(d.id);return}for(let u of d.children)l(u,c+1);}};for(let d of o.children)l(d,0);a=s,yi.set(o,a);}for(let s of a)n.has(s)||n.set(s,n.size);return}for(let a of o.children)r(a,i+1);}};return r(e.root,0),pi.set(e.root,n),n}var pi=chunkGHNTGVKG_cjs.fg(8);function qn(e){let t=hi.get(e.root);if(t)return t;let n=new Map;for(let r of xi(e.root,0))n.has(r)||n.set(r,n.size);return hi.set(e.root,n),n}var fi=Object.freeze([]),gi=new WeakMap;function xi(e,t){if(e.kind==="textValue"||t>64)return fi;let n=gi.get(e);if(n&&n.depth===t)return n.ids;let r=null;e.kind==="paragraph"&&(r??=[]).push(e.id);for(let i of e.children){let a=xi(i,t+1);if(a.length!==0){r??=[];for(let s of a)r.push(s);}}let o=r??fi;return gi.set(e,{depth:t,ids:o}),o}var hi=chunkGHNTGVKG_cjs.fg(8),yi=new WeakMap;var Pi=new WeakMap;function xt(e,t){return Pi.set(e,t),e}function tt(e){return Pi.get(e)??[]}function lp(e){return `${e.kind}-${e.id}`}function Oi(e){return e.kind==="revision"?e.ranges:e.range?[e.range]:[]}function Ol(e){return Oi(e)[0]??null}function Jn(e,t){let n=Ol(e);if(!n)return Number.MAX_SAFE_INTEGER;let r=t.get(n.start.paragraphId);return r===void 0?Number.MAX_SAFE_INTEGER:r*1e6+Math.min(n.start.offset,999999)}function Il(e,t){let n=t.get(e.start.paragraphId),r=t.get(e.end.paragraphId);return n===void 0||r===void 0?Number.MAX_SAFE_INTEGER:(r-n)*1e6+(e.end.offset-e.start.offset)}var Rl=0,vl=1,bl=2;function Nl(e,t,n){let r=n.get(t.paragraphId),o=n.get(e.start.paragraphId),i=n.get(e.end.paragraphId);return r===void 0||o===void 0||i===void 0||r<o||r>i||r===o&&t.offset<e.start.offset||r===i&&t.offset>e.end.offset?null:o===i&&e.start.offset===e.end.offset?Rl:r===i&&t.offset===e.end.offset?bl:vl}function Sl(e,t,n){let r=null;for(let o of Oi(e)){let i=Nl(o,t,n);if(i===null)continue;let a=Il(o,n);(r===null||i<r.grip||i===r.grip&&a<r.width)&&(r={grip:i,width:a});}return r}var ki={comment:0,custom:1,revision:2};function Tl(e,t,n){let r=[];for(let o of e){let i=Sl(o,t,n);i!==null&&r.push({item:o,grip:i.grip,width:i.width});}return r.sort((o,i)=>o.grip!==i.grip?o.grip-i.grip:o.width!==i.width?o.width-i.width:o.item.kind!==i.item.kind?ki[o.item.kind]-ki[i.item.kind]:o.item.kind==="revision"&&i.item.kind==="revision"?i.item.nesting-o.item.nesting:0).map(o=>o.item)}function dp(e,t,n){let o=Tl(e,t,n).filter(i=>!(i.kind==="comment"&&i.resolved))[0];return o?o.kind==="comment"?Ii(e,o):o:null}function cp(e,t){return Ii(e,t)}function Ii(e,t){let n=new Map,r=new Map;for(let a of e)a.kind==="comment"?n.set(a.id,a):a.kind==="revision"&&r.set(a.id,a);let o=new Set([t.id]),i=t;for(;i.parentId!==void 0;){let a=n.get(i.parentId);if(!a||o.has(a.id))break;o.add(a.id),i=a;}if(i.parentRevisionId!==void 0){let a=r.get(i.parentRevisionId);if(a)return a}return i}var wl={ins:"insert",del:"delete",moveFrom:"moveFrom",moveTo:"moveTo"};function Op(e){let t=[],n=r=>{if(r.kind==="textValue"){t.push(r.value);return}for(let o of r.children)n(o);};for(let r of e.blocks)n(r);return t.join("")}function Ip(e){if(e.initials&&e.initials.trim().length>0)return e.initials.trim();let t=e.author.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function Xt(e,t){for(let n of e.attributes)if(n.localName===t&&n.namespaceUri===chunkGHNTGVKG_cjs.da)return n.value}function kt(e){if(e.kind==="textValue")return e.value;if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkGHNTGVKG_cjs.Vd(e);if(chunkGHNTGVKG_cjs.be(e))return "";let t="";for(let n of e.children)t+=kt(n);return t}function Qn(e){return `${e.id}\0${e.author}\0${e.date??""}`}var El={revisionInsert:"insert",revisionDelete:"delete",revisionMoveFrom:"moveFrom",revisionMoveTo:"moveTo"},bi={retainRevisionItems:true,revisionSites:chunkGHNTGVKG_cjs.jh,locations:Yn,commentAnchors:chunkGHNTGVKG_cjs.hg,deepOrder:qn};function Rp(e){return Ni(e,bi)}function Ni(e,t){let n=e.root.kind!=="paragraph";if(n&&t.retainRevisionItems){let o=Ri.get(e.root);if(o&&o.name===e.name)return o.items}let r=Cl(e,t);return n&&t.retainRevisionItems&&Ri.set(e.root,{name:e.name,items:r}),r}var Ri=chunkGHNTGVKG_cjs.fg(8);function Cl(e,t){let n=t.revisionSites(e);if(n.length===0)return [];let r=t.locations(e),o=new Map;for(let a of n){let s=Xt(a.node,"id");if(s===void 0)continue;let l=Xt(a.node,"author")??"",d=Xt(a.node,"author")===void 0,c=Xt(a.node,"date"),u=c===void 0?{id:s,author:l}:{id:s,author:l,date:c},m=a.propertyChange?"format":a.paragraphMark?"paragraphMark":El[a.node.kind]??"structural",g=a.paragraphMark?wl[a.node.localName]:void 0,y=r.get(a.node.id),P=y?{partName:e.name,start:{paragraphId:y.paragraphId,offset:y.start},end:{paragraphId:y.paragraphId,offset:y.end}}:null,f=m==="structural"?`structural\0${Qn(u)}`:`${a.node.localName}\0${Qn(u)}`,x=o.get(f);if(x){x.siteNodeIds.push(a.node.id),P&&!x.ranges.some(p=>p.partName===P.partName&&p.start.paragraphId===P.start.paragraphId&&p.start.offset===P.start.offset&&p.end.paragraphId===P.end.paragraphId&&p.end.offset===P.end.offset)&&x.ranges.push(P),m!=="structural"&&x.revisionKind==="structural"&&(x.revisionKind=m),(m==="insert"&&x.revisionKind==="delete"||m==="delete"&&x.revisionKind==="insert"||x.revisionKind==="replace")&&(x.revisionKind="replace"),x.readOnly||=a.refused||d,a.nesting>x.nesting&&(x.nesting=a.nesting),m==="delete"||m==="moveFrom"?x.deletedText+=kt(a.node):m!=="format"&&m!=="paragraphMark"&&(x.text+=kt(a.node));continue}o.set(f,{address:u,revisionKind:m,...g?{markDirection:g}:{},author:l,...c===void 0?{}:{date:c},text:m==="format"||m==="paragraphMark"||m==="delete"||m==="moveFrom"?"":kt(a.node),deletedText:m==="delete"||m==="moveFrom"?kt(a.node):"",ranges:P?[P]:[],siteNodeIds:[a.node.id],nesting:a.nesting,readOnly:a.refused||d});}let i=[...o.values()].map(a=>xt({kind:"revision",id:`${a.revisionKind}-${e.name}\0${Qn(a.address)}`,address:a.address,addresses:[a.address],revisionKind:a.revisionKind,...a.markDirection?{markDirection:a.markDirection}:{},author:a.author,...a.date===void 0?{}:{date:a.date},text:a.revisionKind==="replace"?a.text:a.text||a.deletedText,replacedText:a.revisionKind==="replace"?a.deletedText:"",ranges:a.ranges,nesting:a.nesting,readOnly:a.readOnly,replyIds:[]},a.siteNodeIds));return Ml(i,t.deepOrder(e))}function Ml(e,t){let n=Dl(e,t),r=n.filter(l=>(l.revisionKind==="insert"||l.revisionKind==="delete")&&!l.readOnly&&l.ranges.length>0),o=new Set,i=new Map,a=new Map;for(let l of r){if(l.revisionKind!=="insert")continue;let d=l.ranges[0].start,c=`${d.paragraphId}\0${d.offset}`,u=a.get(c);u?u.push(l):a.set(c,[l]);}for(let l of r){if(l.revisionKind!=="delete"||o.has(l.id))continue;let d=l.ranges[l.ranges.length-1].end,c=a.get(`${d.paragraphId}\0${d.offset}`)??[],u=c.length>1?[...c].sort((m,g)=>(m.text.length>0?0:1)-(g.text.length>0?0:1)):c;for(let m of u){if(o.has(m.id)||m.author!==l.author)continue;o.add(l.id),o.add(m.id);let g=$l(l.ranges[0],m.ranges[0],t)?l:m,y=Ll(l.date,m.date);i.set(l.id,xt({...g,id:`replace-${l.id}-${m.id}`,revisionKind:"replace",...y===void 0?{}:{date:y},addresses:Ul([...l.addresses,...m.addresses]),text:m.text,replacedText:l.text,ranges:[...l.ranges,...m.ranges],replacedRangeCount:l.ranges.length,readOnly:l.readOnly||m.readOnly},[...tt(l),...tt(m)]));break}}let s=[];for(let l of n){let d=i.get(l.id);if(d){s.push(d);continue}o.has(l.id)||s.push(l);}return s}function Dl(e,t){let n=e.filter(d=>(d.revisionKind==="insert"||d.revisionKind==="delete")&&!d.readOnly&&d.ranges.length>0);if(n.length<2)return e;let r=d=>`${d.paragraphId}\0${d.offset}`,o=new Map;for(let d of n){let c=`${d.revisionKind}\0${d.author}`,u=o.get(c);u?u.push(d):o.set(c,[d]);}let i=(d,c)=>{let u=d.ranges[0].start,m=c.ranges[0].start,g=(t.get(u.paragraphId)??0)-(t.get(m.paragraphId)??0);return g!==0?g:u.offset-m.offset};for(let d of o.values()){let c=true;for(let u=1;u<d.length&&c;u+=1)c=i(d[u-1],d[u])<=0;c||d.sort(i);}let a=new Set,s=new Map;for(let d of o.values()){let c=[],u="",m=()=>{if(c.length>1){s.set(c[0].id,_l(c));for(let g=1;g<c.length;g+=1)a.add(c[g].id);}c=[];};for(let g of d){let y=r(g.ranges[0].start);c.length>0&&y!==u&&m();let P=c.length===0;c.push(g),(P||Al(g))&&(u=r(g.ranges[g.ranges.length-1].end));}m();}if(s.size===0)return e;let l=[];for(let d of e)a.has(d.id)||l.push(s.get(d.id)??d);return l}function Al(e){return e.ranges.some(t=>t.start.paragraphId!==t.end.paragraphId||t.start.offset!==t.end.offset)}function _l(e){let t=e[0],n=[...t.addresses],r=[...t.ranges],o=[...tt(t)],i=t.text,a=t.date;for(let s of e.slice(1)){for(let l of s.addresses)n.some(d=>Si(d,l))||n.push(l);for(let l of s.ranges)r.push(l);for(let l of tt(s))o.push(l);i+=s.text,a=Fl(a,s.date);}return xt({...t,id:e.map(s=>s.id).join("+"),addresses:n,ranges:r,text:i,...a===void 0?{}:{date:a}},o)}function Fl(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?e:r>n?t:e}function Ul(e){let t=[];for(let n of e)t.some(r=>Si(r,n))||t.push(n);return t}function Si(e,t){return e.id===t.id&&e.author===t.author&&(e.date??"")===(t.date??"")}function Ll(e,t){if(t===void 0)return e;if(e===void 0)return t;let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?t:n>r?e:t}function $l(e,t,n){let r=n.get(e.start.paragraphId)??0,o=n.get(t.start.paragraphId)??0;return r!==o?r<o:e.start.offset<=t.start.offset}function Bl(e,t,n){let r=new Map(t.map(c=>[c.commentId,c])),o=new Map,i=new Map;for(let c of e)c.paraId&&o.set(c.paraId.toUpperCase(),c),i.set(c.id,c);let a=new Map,s=new Map;for(let c of e){let u=r.get(c.id);if(!u||u.orphaned||u.start.paragraphId===u.end.paragraphId&&u.start.offset===u.end.offset)continue;let m=`${u.start.paragraphId}:${u.start.offset}|${u.end.paragraphId}:${u.end.offset}`;a.has(m)?s.set(c.id,a.get(m)):a.set(m,c.id);}let l=new Map;for(let c of e){let u=c.paraId?n.get(c.paraId.toUpperCase()):void 0,m=u?.parentParaId?o.get(u.parentParaId):void 0,g=c.parentCommentId?i.get(c.parentCommentId):void 0,y=u===void 0?s.get(c.id):void 0,P=y?i.get(y):void 0,f=m??g??P;f&&f.id!==c.id&&l.set(c.id,f.id);}for(let c of [...l.keys()]){let u=new Set([c]),m=l.get(c);for(;m!==void 0;){if(u.has(m)){l.delete(c);break}u.add(m),m=l.get(m);}}let d=new Map;for(let[c,u]of l){let m=d.get(u);m?m.push(c):d.set(u,[c]);}return e.map(c=>{let u=r.get(c.id),m=c.paraId?n.get(c.paraId.toUpperCase()):void 0,g=l.get(c.id);return {kind:"comment",id:c.id,comment:c,range:u?{partName:u.partName,start:u.start,end:u.end}:null,resolved:m?.done??false,...g===void 0?{}:{parentId:g},replyIds:d.get(c.id)??[],orphaned:u===void 0||u.orphaned}})}function vp(e){return Hl(e,bi)}function Hl(e,t){let n=[e.storyPart],r=new Set([e.storyPart.name]);for(let c of e.furnitureParts??[])r.has(c.name)||(r.add(c.name),n.push(c));let o=e.commentsPart?chunkGHNTGVKG_cjs.jg(e.commentsPart):[],i=e.commentsExtendedPart?chunkGHNTGVKG_cjs.kg(e.commentsExtendedPart):new Map,a=[],s=[],l=n.length===1?t.deepOrder(n[0]):new Map;for(let c of n){for(let g of Ni(c,t))a.push(g);for(let g of t.commentAnchors(c))s.push(g);if(n.length===1)continue;let u=l,m=u.size;for(let[g,y]of t.deepOrder(c))u.has(g)||u.set(g,m+y);}return Wl([...a,...Bl(o,s,i)]).sort((c,u)=>Jn(c,l)-Jn(u,l))}function jl(e,t){if(e.kind!=="comment")return e;let n=e.replyIds??[],r=n.filter(i=>t.has(i)),o=e.parentId!==void 0&&!t.has(e.parentId);if(!o&&r.length===n.length)return e;if(o){let{parentId:i,parentRevisionId:a,...s}=e;return r.length===n.length?s:{...s,replyIds:r}}return {...e,replyIds:r}}function vi(e){return `${e.partName}\0${e.start.paragraphId}:${e.start.offset}|${e.end.paragraphId}:${e.end.offset}`}function Wl(e){let t=new Set;for(let l of e)l.kind==="comment"&&t.add(l.id);let n=e.map(l=>jl(l,t)),r=new Map;for(let l of n)if(l.kind==="revision")for(let d of l.ranges??[]){if(d.start.paragraphId===d.end.paragraphId&&d.start.offset===d.end.offset)continue;let c=vi(d),u=l.nesting??0,m=r.get(c);(m===void 0||u>m.nesting)&&r.set(c,{id:l.id,nesting:u});}let o=new Map;for(let l of n)l.kind==="comment"&&l.replyIds&&l.replyIds.length>0&&o.set(l.id,l.replyIds);let i=l=>{let d=[],c=new Set([l]),u=[...o.get(l)??[]];for(;u.length>0;){let m=u.shift();c.has(m)||(c.add(m),d.push(m),u.push(...o.get(m)??[]));}return d},a=new Map,s=new Map;for(let l of n){if(l.kind!=="comment"||l.parentId!==void 0||l.orphaned||!l.range)continue;let d=r.get(vi(l.range))?.id;if(d===void 0)continue;let c=[l.id,...i(l.id)];for(let m of c)s.set(m,d);let u=a.get(d);u?u.push(...c):a.set(d,c);}return n.map(l=>{if(l.kind==="revision"){let d=a.get(l.id)??[];return d.length===0&&(l.replyIds??[]).length===0?l:xt({...l,replyIds:d},tt(l))}if(l.kind==="comment"){let d=s.get(l.id);if(d===void 0){if(l.parentRevisionId===void 0)return l;let{parentRevisionId:c,...u}=l;return u}return l.parentRevisionId===d?l:{...l,parentRevisionId:d}}return l})}var Tp=256,wp=2e3,Ti=/[\p{L}\p{N}_]/u;function wi(e){let t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(let r=0;r<e.length;r+=1){let o=e[r],i=o.toLowerCase();n+=i.length===1?i:o;}return n}function Vl(e,t,n){let r=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return !(r!==void 0&&Ti.test(r)||o!==void 0&&Ti.test(o))}function Kl(e){return typeof e=="string"&&e.length>0&&e.length<=256}function Ep(e,t,n,r={}){let o={matches:[],truncated:false};if(!Kl(t)||e.length===0||n<=0)return o;let i=r.matchCase===true,a=r.wholeWord===true,s=i?t:wi(t),l=i?e:wi(e),d=Math.max(0,r.from??0),c=Math.min(e.length,r.to??e.length),u=[],m=l.indexOf(s,d);for(;m>=0;){let g=m+s.length;if(g>c)return {matches:u,truncated:false};if(!a||Vl(e,m,g)){if(u.length>=n)return {matches:u,truncated:true};u.push({start:m,length:s.length});}m=l.indexOf(s,g);}return {matches:u,truncated:false}}
2
+ exports.$=Fu;exports.A=Ld;exports.Aa=Oi;exports.B=jo;exports.Ba=Ol;exports.C=ms;exports.Ca=Jn;exports.D=Wo;exports.Da=Tl;exports.E=Ye;exports.Ea=dp;exports.F=Ks;exports.Fa=cp;exports.G=Aa;exports.Ga=Op;exports.H=Ua;exports.Ha=Ip;exports.I=La;exports.Ia=Rp;exports.J=Dn;exports.Ja=Bl;exports.K=zm;exports.Ka=vp;exports.L=_a;exports.La=Hl;exports.M=Ja;exports.Ma=Wl;exports.N=Qa;exports.Na=Tp;exports.O=fu;exports.Oa=wp;exports.P=gu;exports.Pa=wi;exports.Q=hu;exports.Qa=Vl;exports.R=Iu;exports.Ra=Kl;exports.S=Ru;exports.Sa=Ep;exports.T=vu;exports.U=sl;exports.V=ll;exports.W=ti;exports.X=ri;exports.Y=Eu;exports.Z=Cu;exports._=Mu;exports.a=xd;exports.aa=Uu;exports.b=kd;exports.ba=et;exports.c=Pd;exports.ca=Wn;exports.d=Od;exports.da=Vn;exports.e=Id;exports.ea=ul;exports.f=Rd;exports.fa=zn;exports.g=Xi;exports.ga=Yu;exports.h=Yi;exports.ha=zt;exports.i=vd;exports.ia=Gn;exports.j=bd;exports.ja=qu;exports.k=Nd;exports.ka=pl;exports.l=ze;exports.la=ii;exports.m=Sd;exports.ma=gl;exports.n=Td;exports.na=Xn;exports.o=wd;exports.oa=hl;exports.p=Pe;exports.pa=Kn;exports.q=To;exports.qa=Ju;exports.r=Ed;exports.ra=Qu;exports.s=Cd;exports.sa=Zu;exports.t=Md;exports.ta=ep;exports.u=Dd;exports.ua=Yn;exports.v=ns;exports.va=op;exports.w=Ad;exports.wa=Pl;exports.x=_d;exports.xa=qn;exports.y=Fd;exports.ya=tt;exports.z=Ud;exports.za=lp;