@docx-editor.dev/core 2.10.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.cts +14 -5
  3. package/dist/automation.d.ts +14 -5
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.cts +12 -11
  7. package/dist/binding.d.ts +12 -11
  8. package/dist/binding.js +1 -1
  9. package/dist/chunk-3JON7JMD.cjs +1 -0
  10. package/dist/chunk-5V6FNKBE.cjs +2 -0
  11. package/dist/chunk-6JIJOZDW.js +1 -0
  12. package/dist/chunk-BTQKU64Q.cjs +1 -0
  13. package/dist/chunk-BXRVGHTY.cjs +18 -0
  14. package/dist/chunk-BXTTPJSH.js +5 -0
  15. package/dist/chunk-D5EHDHYV.js +1 -0
  16. package/dist/{chunk-PSZH2VXP.js → chunk-GOEBQ26R.js} +1 -1
  17. package/dist/chunk-ILTZTY3K.cjs +10 -0
  18. package/dist/chunk-IUM7FZPA.js +2 -0
  19. package/dist/chunk-JWZG4QJ5.cjs +2 -0
  20. package/dist/chunk-JXZYDBKU.cjs +19 -0
  21. package/dist/chunk-KBOOIC2Q.js +19 -0
  22. package/dist/chunk-L6XZTLPS.js +10 -0
  23. package/dist/chunk-L7OR5TJK.cjs +5 -0
  24. package/dist/chunk-MHQNR2OU.js +2 -0
  25. package/dist/chunk-MLGPISGH.js +1 -0
  26. package/dist/chunk-NJXQABQU.js +18 -0
  27. package/dist/{chunk-YMYCPY5Y.cjs → chunk-OHJQ7GPZ.cjs} +1 -1
  28. package/dist/chunk-TKEGK4GQ.cjs +2 -0
  29. package/dist/chunk-VGFMPWND.js +2 -0
  30. package/dist/chunk-W77HJGYX.js +1 -0
  31. package/dist/chunk-XCFM3G5L.cjs +1 -0
  32. package/dist/chunk-ZKWRCLT2.cjs +1 -0
  33. package/dist/collaboration/replication.cjs +1 -0
  34. package/dist/collaboration/replication.d.cts +216 -0
  35. package/dist/collaboration/replication.d.ts +216 -0
  36. package/dist/collaboration/replication.js +1 -0
  37. package/dist/collaboration.cjs +1 -0
  38. package/dist/collaboration.d.cts +176 -0
  39. package/dist/collaboration.d.ts +176 -0
  40. package/dist/collaboration.js +1 -0
  41. package/dist/contracts/editor.cjs +1 -1
  42. package/dist/contracts/editor.d.cts +8 -9
  43. package/dist/contracts/editor.d.ts +8 -9
  44. package/dist/contracts/editor.js +1 -1
  45. package/dist/contracts/interaction.d.cts +8 -9
  46. package/dist/contracts/interaction.d.ts +8 -9
  47. package/dist/contracts/modules.cjs +1 -1
  48. package/dist/contracts/modules.d.cts +21 -8
  49. package/dist/contracts/modules.d.ts +21 -8
  50. package/dist/contracts/modules.js +1 -1
  51. package/dist/custom-node-writes-CcNeHH5C.d.ts +310 -0
  52. package/dist/custom-node-writes-D4rMJIES.d.cts +310 -0
  53. package/dist/document-properties-D6Ahr8D6.d.cts +28 -0
  54. package/dist/document-properties-D6Ahr8D6.d.ts +28 -0
  55. package/dist/{editor-CwzY2Hcg.d.cts → editor-B76SEMZw.d.cts} +145 -49
  56. package/dist/{editor-C0my6Uta.d.ts → editor-BcdsPdbY.d.ts} +145 -49
  57. package/dist/editor.cjs +1 -1
  58. package/dist/editor.css +1 -7299
  59. package/dist/editor.d.cts +60 -26
  60. package/dist/editor.d.ts +60 -26
  61. package/dist/editor.js +1 -1
  62. package/dist/failure-BnGjoXf0.d.cts +64 -0
  63. package/dist/failure-BnGjoXf0.d.ts +64 -0
  64. package/dist/{index-kID8Ymkp.d.ts → index-BYTvklN5.d.ts} +262 -81
  65. package/dist/{index-nLFwo_17.d.cts → index-CDGhPib1.d.cts} +262 -81
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.d.cts +19 -18
  68. package/dist/index.d.ts +19 -18
  69. package/dist/index.js +1 -1
  70. package/dist/layout.cjs +1 -1
  71. package/dist/layout.d.cts +82 -53
  72. package/dist/layout.d.ts +82 -53
  73. package/dist/layout.js +1 -1
  74. package/dist/{note-properties-jvnw_DGG.d.ts → note-properties-Bx7rXruA.d.ts} +1 -1
  75. package/dist/{note-properties-CQlxjic_.d.cts → note-properties-zQ8w04en.d.cts} +1 -1
  76. package/dist/{omml-equation-Dd3mBep-.d.ts → omml-equation-69O1Pd8G.d.ts} +1 -1
  77. package/dist/{omml-equation-BD-LsmWE.d.cts → omml-equation-BmV51rim.d.cts} +1 -1
  78. package/dist/output.cjs +1 -1
  79. package/dist/output.d.cts +6 -8
  80. package/dist/output.d.ts +6 -8
  81. package/dist/output.js +1 -1
  82. package/dist/{protocol-C7ahrdUx.d.ts → protocol-DC7ueVuo.d.ts} +2 -2
  83. package/dist/{protocol-UuZOcOp7.d.cts → protocol-FTXtrAIT.d.cts} +2 -2
  84. package/dist/{review-items-Dw-8a6Ie.d.ts → review-items-B78OsJU2.d.ts} +1 -2
  85. package/dist/{review-items-CwixiHNe.d.cts → review-items-C-2WQdEb.d.cts} +1 -2
  86. package/dist/{review-reads-BqkiJTeR.d.cts → review-reads-CbBQlb-n.d.cts} +2 -2
  87. package/dist/{review-reads-C0u-IKEA.d.ts → review-reads-UexYBp-m.d.ts} +2 -2
  88. package/dist/{revision-projection-Cc4wz30g.d.cts → revision-projection-6u8lae9J.d.cts} +1 -1
  89. package/dist/{revision-projection-CILpvv4M.d.ts → revision-projection-B2v9U3qx.d.ts} +1 -1
  90. package/dist/{semantic-cell-selection-Utrf0lz7.d.ts → semantic-cell-selection-DsYz2Vg3.d.ts} +4 -4
  91. package/dist/{semantic-cell-selection-DT9x9WLf.d.cts → semantic-cell-selection-nEE7E3Z8.d.cts} +4 -4
  92. package/dist/{semantic-interaction-B6hFRQLy.d.ts → semantic-interaction-C00BpIyC.d.ts} +1 -1
  93. package/dist/{semantic-interaction-Z0xKQcB4.d.cts → semantic-interaction-DiOX0FIH.d.cts} +1 -1
  94. package/dist/{semantic-paint-CQEOC0Od.d.cts → semantic-paint-Cc11nrDL.d.cts} +2 -2
  95. package/dist/{semantic-paint-quke354p.d.ts → semantic-paint-ofuoBsYo.d.ts} +2 -2
  96. package/dist/{semantic-records-Do3-i5oB.d.ts → semantic-records-CRG1r6-a.d.cts} +5 -4
  97. package/dist/{semantic-records-CMakzQ1X.d.cts → semantic-records-CzI0ZEuR.d.ts} +5 -4
  98. package/dist/{shaped-measurer-BxwTUluj.d.ts → shaped-measurer-CkOGZQn9.d.ts} +1 -1
  99. package/dist/{shaped-measurer-DzRwWrL5.d.cts → shaped-measurer-CneACGcP.d.cts} +1 -1
  100. package/dist/store.cjs +1 -1
  101. package/dist/store.d.cts +81 -17
  102. package/dist/store.d.ts +81 -17
  103. package/dist/store.js +1 -1
  104. package/dist/{tree-op-types-DSJYmf5b.d.cts → tree-op-types-CA7qgAUF.d.cts} +1288 -18
  105. package/dist/{tree-op-types-BuOfCrkp.d.ts → tree-op-types-HKfUzt_-.d.ts} +1288 -18
  106. package/dist/{custom-node-writes-BvpWCnW8.d.ts → tree-package-fragment-Cz-v-0B3.d.cts} +107 -322
  107. package/dist/{custom-node-writes-Db8H6Z3n.d.cts → tree-package-fragment-oJZX_5iN.d.ts} +107 -322
  108. package/dist/{tree-session-contract-ByWx8eew.d.cts → tree-session-contract-BPDLrEPX.d.ts} +16 -10
  109. package/dist/{tree-session-contract-C1dfE9hy.d.ts → tree-session-contract-Cbl87xa8.d.cts} +16 -10
  110. package/dist/{tree-store-ASBtz7UB.d.ts → tree-store-B7hd6cEa.d.ts} +130 -25
  111. package/dist/{tree-store-CWOUMGN8.d.cts → tree-store-BenW0Mg_.d.cts} +130 -25
  112. package/package.json +14 -3
  113. package/dist/chunk-27APDXY2.js +0 -2
  114. package/dist/chunk-35MI6K7M.cjs +0 -10
  115. package/dist/chunk-4XL7SOWQ.cjs +0 -2
  116. package/dist/chunk-6K6QQVAZ.cjs +0 -18
  117. package/dist/chunk-7VQ7YLW3.cjs +0 -1
  118. package/dist/chunk-7ZJL5AEY.cjs +0 -1
  119. package/dist/chunk-C6LK2BYA.cjs +0 -2
  120. package/dist/chunk-GQQOL4PV.js +0 -1
  121. package/dist/chunk-HBEBUCRM.cjs +0 -5
  122. package/dist/chunk-LG5K46OM.js +0 -2
  123. package/dist/chunk-LWADHMVV.js +0 -5
  124. package/dist/chunk-N725IUO7.js +0 -18
  125. package/dist/chunk-N7DBENH4.js +0 -10
  126. package/dist/chunk-NVGFWMCO.js +0 -1
  127. package/dist/chunk-SYTWKJPJ.cjs +0 -18
  128. package/dist/chunk-YI6JXF7U.js +0 -18
  129. package/dist/hf-references-Dvk6De4Q.d.cts +0 -70
  130. package/dist/hf-references-z5Y4N1ab.d.ts +0 -70
  131. package/dist/note-nodes-BNCANoGN.d.ts +0 -108
  132. package/dist/note-nodes-DL-Au22P.d.cts +0 -108
  133. package/dist/ooxml-package-CdEy9ufK.d.cts +0 -1222
  134. package/dist/ooxml-package-CdEy9ufK.d.ts +0 -1222
  135. package/dist/tree-op-revision-attribution-CN06Xshv.d.cts +0 -24
  136. package/dist/tree-op-revision-attribution-CN06Xshv.d.ts +0 -24
@@ -1 +1 @@
1
- 'use strict';var t=class extends Error{name="EditorFontError";code;request;diagnostic;constructor(r,n,e={}){super(n,{cause:e.cause}),this.code=r,this.request=e.request,this.diagnostic=e.diagnostic;}};exports.a=t;
1
+ 'use strict';var t=class extends Error{name="EditorFontError";code;request;diagnostic;constructor(r,o,e={}){super(o,{cause:e.cause}),this.code=r,this.request=e.request,this.diagnostic=e.diagnostic;}};exports.a=t;
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkBXRVGHTY_cjs=require('./chunk-BXRVGHTY.cjs');var $=8,xe={color:"painted",background:"painted",spanClassName:"painted",avatarUrl:"card-only"},be=Object.keys(xe),lt=be.filter(t=>xe[t]==="painted"),dt=new Set(["http","https","data","blob"]),ct=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function ut(t){let e=t.replace(/[\u0000-\u0020\u007f]/g,"");if(e.length===0)return;let n=ct.exec(e);if(n)return !dt.has(n[1].toLowerCase())||/^data:/i.test(e)&&!/^data:image\/(?!svg)/i.test(e)?void 0:e;let o=a=>e[a]==="/"||e[a]==="\\";return o(0)&&o(1)?void 0:e}function yt(t){if(typeof t=="string")return t.length>0?{color:t}:null;if(t===null||typeof t!="object")return null;let e={},n=Object.prototype.hasOwnProperty;for(let o of be){if(!n.call(t,o))continue;let a=t[o];if(!(typeof a!="string"||a.length===0)){if(o==="avatarUrl"){let r=ut(a);r!==void 0&&(e.avatarUrl=r);continue}e[o]=a;}}return Object.keys(e).length>0?e:null}function _(t){return `var(--doc-review-author-${t%$})`}function me(t){let e=new Map;if(t===void 0||t==="kind"||t==="author")return e;for(let[n,o]of Object.entries(t.authors)){let a=yt(o);a&&e.set(n,a);}return e}function $n(t,e){let n=me(e);return [...t].map(([o,a])=>{let r=n.get(o);return {author:o,slot:a,color:r?.color??_(a),...r?{style:r}:{}}})}var ht=128;function K(t,e,n=ht){let o=e.length<n?e.length:n,a=t;for(let r=0;r<o;r+=1)a=Math.imul(a^e.charCodeAt(r),16777619);return Math.imul(a^e.length,16777619)}function pt(t,e,n){let o=K(2166136261,n);for(let a of t.keys())o=K(o,a);for(let[a,r]of e){o=K(o,a);for(let i of lt)o=K(o,r[i]??"",1/0);}return `${t.size}.${e.size}.${(o>>>0).toString(36)}`}function ve(t){return t===null?"kind":t.key}var Y=new WeakMap;function Re(t,e,n){if(t==="kind")return null;let o=Y.get(e);if(o&&o.option===t&&o.authorSlots===n)return o.context;let a=me(t),r=t===void 0||t==="author"?"author":t.others??"author";if(a.size===0&&r==="kind")return Y.set(e,{option:t,authorSlots:n,context:null}),null;let i=n??gt(e),s=new Map;for(let[d,c]of a){if(!c.spanClassName)continue;let u=c.spanClassName.split(/\s+/).filter(y=>y.length>0);u.length>0&&s.set(d,u);}let l={authorSlots:i,styles:a,classTokens:s,others:r,key:pt(i,a,r)};return Y.set(e,{option:t,authorSlots:n,context:l}),l}var fe=new WeakMap;function ft(t){let e=fe.get(t);if(e)return e;let n=[],o=new Set,a=r=>{r===""||o.has(r)||(o.add(r),n.push(r));};for(let r of chunkBXRVGHTY_cjs.Z(t)){for(let s of r.lines)for(let l of s.spans){let d=l.revisions;if(d!==void 0)for(let c=0;c<d.length;c+=1)a(d[c].author);for(let c of l.props){if(c.localName!=="rPrChange"&&c.localName!=="pPrChange")continue;let u=c.attributes?.author;a(u??"");break}}for(let s of r.lines){let l=s.drawings;if(l!==void 0)for(let d=0;d<l.length;d+=1){let c=l[d].revisions;if(c!==void 0)for(let u=0;u<c.length;u+=1)a(c[u].author);}}let i=r.markRevisions;if(i)for(let s=0;s<i.length;s+=1)a(i[s].author);}return fe.set(t,n),n}var ge=new WeakMap;function gt(t){let e=ge.get(t);if(e)return e;let n=new Map,o=a=>{for(let r of ft(a))n.has(r)||n.set(r,n.size);};for(let a of t.pages){o(a.fragments),a.header&&o(a.header.fragments),a.footer&&o(a.footer.fragments);for(let r of [a.footnotes,a.endnotes])if(r){r.separator&&o(r.separator.fragments);for(let i of r.notes)o(i.fragments);}for(let r of [a.anchoredDrawings,a.header?.anchoredDrawings,a.footer?.anchoredDrawings])if(r)for(let i of r){let s=i.revisions;if(s!==void 0)for(let l=0;l<s.length;l+=1){let d=s[l].author;d!==""&&!n.has(d)&&n.set(d,n.size);}i.textboxStory&&o(i.textboxStory.fragments);}}return ge.set(t,n),n}function xt(t,e){let n=null;for(let o of e)o===""||t.has(o)||(n===null&&(n=new Map(t)),n.has(o)||n.set(o,n.size));return n??t}function Tn(){let t=new Map,e=0;return {resolve(n,o){let a=xt(n,o);for(let r of a.keys())t.has(r)||(t.set(r,e),e+=1);return new Map([...a.keys()].map(r=>[r,t.get(r)]).sort((r,i)=>r[1]-i[1]))}}}function j(t,e,n){if(t===void 0||t.length===0)return null;let o=t[t.length-1],a=t.some(s=>s.kind==="delete"||s.kind==="moveFrom"),r=o.kind,i=r==="delete"||r==="moveFrom"?"line-through":r==="insert"||r==="moveTo"?"underline":null;return {attribution:o,line:a&&i==="underline"?"line-through":i,decorationStyle:r==="moveFrom"||r==="moveTo"?"double":r==="insert"?"dashed":"solid",color:a?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",authorColor:n?.get(o.author)?.color??_(e?.get(o.author)??0),deleted:a}}function Se(t,e,n,o,a,r){for(let i of [n.footnotes,n.endnotes])i&&e.append(bt(t,n,i,o,a,r));}function bt(t,e,n,o,a,r){let i=t.createElement("div");if(i.className="docx-notes",i.dataset.docxNotes=n.kind,i.dataset.docxNotesPlacement=n.placement,i.style.position="absolute",i.style.left=`${(n.box.x-e.box.x)*o.scale}px`,i.style.top=`${(n.box.y-e.box.y)*o.scale}px`,i.style.width=`${n.box.width*o.scale}px`,i.style.height=`${n.box.height*o.scale}px`,n.separator){let s=t.createElement("div");s.className="docx-note-separator",s.dataset.docxNoteSeparator=n.separator.kind,s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(n.separator.box.x-n.box.x)*o.scale}px`,s.style.top=`${(n.separator.box.y-n.box.y)*o.scale}px`,s.style.width=`${n.separator.box.width*o.scale}px`,s.style.height=`${Math.max(n.separator.box.height,.75)*o.scale}px`;let l=n.separator.ruleStyle;if(l||n.separator.synthetic||n.separator.fragments.length===0)mt(s,t,l??"single",o.scale);else for(let d of n.separator.fragments)s.append(d.kind==="table"?r(t,d,o):a(t,d,o));i.append(s);}for(let s of n.notes){let l=t.createElement("div");l.className="docx-note",l.dataset.docxNote=s.noteKind,l.dataset.docxNoteId=String(s.noteId),l.dataset.docxNoteScope=s.scopeId,s.mark!==null&&(l.dataset.docxNoteMark=s.mark),s.continuation&&(l.dataset.docxNoteContinuation=""),l.setAttribute("role","doc-footnote"),l.style.position="absolute",l.style.left=`${(s.box.x-n.box.x)*o.scale}px`,l.style.top=`${(s.box.y-n.box.y)*o.scale}px`,l.style.width=`${s.box.width*o.scale}px`,l.style.height=`${s.box.height*o.scale}px`;for(let d of s.fragments)l.append(d.kind==="table"?r(t,d,o):a(t,d,o));i.append(l);}return i}function mt(t,e,n,o){t.dataset.docxNoteRule=n;let a=Math.max(1,o*.75);if(n==="single"){t.style.borderTop=`${a}px solid currentColor`,t.style.opacity="0.85";return}t.style.opacity="0.85";let r=Math.max(1,o*1.25);for(let i of [0,a+r]){let s=e.createElement("div");s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top=`${i}px`,s.style.height="0",s.style.borderTop=`${a}px solid currentColor`,t.append(s);}}function G(t,e,n){return !!n.activeHeaderFooterRId&&!!t.rId&&n.activeHeaderFooterRId===t.rId&&(n.activeHeaderFooterPageIndex===void 0||n.activeHeaderFooterPageIndex===e)}function Z(t,e,n){return n?t.kind==="footer"?Math.max(t.box.height,e.box.y+e.box.height-t.box.y):Math.max(t.box.height,e.contentBox.y-t.box.y):t.box.height}function we(t,e){for(let{record:n,element:o,materialized:a}of t){if(!a)continue;let r=o.querySelector(":scope > .docx-page-content");r&&(e.activeHeaderFooterRId?r.setAttribute("contenteditable","false"):r.removeAttribute("contenteditable"));for(let i of o.querySelectorAll(":scope > .docx-hf:not(.docx-hf--placeholder)")){let s=vt(n,i);if(!s)continue;let l=G(s,n.index,e);Rt(i,n,s,l,e.scale);}for(let i of o.querySelectorAll(":scope > [data-docx-hf-front]")){let s=ke(n,i.dataset.docxHfFront);Ae(i,!!s&&G(s,n.index,e));}}}function vt(t,e){return ke(t,e.dataset.docxHf)}function ke(t,e){if(e==="header")return t.header;if(e==="footer")return t.footer}function Rt(t,e,n,o,a){o?(t.dataset.docxHfActive="",t.setAttribute("contenteditable","true")):(delete t.dataset.docxHfActive,t.setAttribute("contenteditable","false")),t.style.height=`${Z(n,e,o)*a}px`,Ae(t,o);}function Ae(t,e){let n=t.querySelectorAll(t instanceof Element&&t.classList.contains("docx-drawing-layer")?":scope > *":":scope > .docx-drawing-layer > *");for(let o of n){o.style.pointerEvents=e?"auto":"none";for(let a of o.querySelectorAll(".docx-drawing"))a.style.pointerEvents=e?"auto":"none";}}var St=new Map([["image/svg+xml","SVG"],["image/tiff","TIFF"],["image/x-emf","EMF"],["image/x-wmf","WMF"]]),wt="Unknown",W=new WeakMap,J=new WeakMap,kt=256;function Le(t,e){let n=W.get(t);if(n)return n;let o=new Map,a=new Map;return n=Object.freeze({urlForReady(r,i){let s=o.get(r.resourceKey);if(s)return s;let l;try{l=e.create(r,i);}catch(d){if(d instanceof Error&&d.message.startsWith("PaintImageUrlSource:"))return null;throw d}return o.set(r.resourceKey,l),l},imageFor(r,i,s){let l=a.get(r);if(l&&l.resourceKey===i)return l.element;let d=s.createElement("img");return a.size<kt&&a.set(r,{element:d,resourceKey:i,...l?.readyElement?{readyElement:l.readyElement}:{}}),d},imageForPending(r){return a.get(r)?.element??null},readyElementFor(r){return a.get(r)?.readyElement??null},rememberReadyElement(r,i){let s=a.get(r);s&&a.set(r,{...s,readyElement:i});},reconcile(r,i){for(let[s,l]of o)r.has(s)||(e.revoke(l),o.delete(s));for(let[s,l]of a)i.has(s)||(l.element.removeAttribute("src"),a.delete(s));},revokeAll(){for(let r of o.values())e.revoke(r);o.clear();for(let r of a.values())r.element.removeAttribute("src");a.clear();}}),W.set(t,n),n}function Q(t,e){return `${e.paintInstance??""}|${t.drawingNodeId}`}function Nn(t){W.get(t)?.revokeAll(),W.delete(t);}function k(t){return Number.isFinite(t)?String(t):"0"}function $e(t,e){if(t.length<3||e.width<=0||e.height<=0)return null;let n=[];for(let o of t){if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return null;let a=(o.x-e.x)/e.width*100,r=(o.y-e.y)/e.height*100;n.push(`${k(a)}% ${k(r)}%`);}return `polygon(${n.join(", ")})`}function Te(t){let e=t.geometry.contentBounds;return chunkBXRVGHTY_cjs.Ab({transform:t.transform,contentWidth:e.width,contentHeight:e.height})}function Me(t){let{effects:e}=t,n=[];if(e.grayscale&&n.push("grayscale(1)"),e.brightness!==0&&Number.isFinite(e.brightness)){let o=1+e.brightness/100;Number.isFinite(o)&&n.push(`brightness(${k(Math.max(0,o))})`);}if(e.contrast!==0&&Number.isFinite(e.contrast)){let o=1+e.contrast/100;Number.isFinite(o)&&n.push(`contrast(${k(Math.max(0,o))})`);}return n.length>0?n.join(" "):void 0}function De(t,e){let{crop:n}=t,o=Math.max(0,Math.min(1,n.left)),a=Math.max(0,Math.min(1,n.top)),r=Math.max(0,Math.min(1,n.right)),i=Math.max(0,Math.min(1,n.bottom)),s=Math.max(1e-4,1-o-r),l=Math.max(1e-4,1-a-i);return Object.freeze({width:`${k(1/s*100)}%`,height:`${k(1/l*100)}%`,left:`${k(-o/s*100)}%`,top:`${k(-a/l*100)}%`})}function At(t,e){let{resource:n}=t;switch(n.kind){case "external":return e.externalResource;case "missing":return e.missingResource;case "pending":return e.pendingResource;case "unrenderable":switch(n.reason){case "unsupported-format":return e.unsupportedFormat(St.get(n.mime)??wt);case "non-picture-graphic":return e.nonPictureGraphic(t.placeholderGraphicKind??"graphic");case "signature-mismatch":return e.contentMismatch;case "decode-failed":return e.decodeFailed;case "resource-limit":return e.resourceLimit;default:return e.invalidResource}default:return e.invalidResource}}function D(t,e,n){let{accessibility:o}=e;o.hidden||(t.setAttribute("role",n?"link":"img"),o.label?t.setAttribute("aria-label",o.label):n||t.setAttribute("aria-hidden","true"));}function O(t,e,n,o){let a=o?.x??0,r=o?.y??0;t.style.position="absolute",t.style.left=`${(e.x-a)*n}px`,t.style.top=`${(e.y-r)*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`,t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.pointerEvents="auto";}function Et(t,e,n,o,a){let r=t.paintBounds,i=t.geometry.contentBounds,s=De(t);return [o,n.scale,a?.x??0,a?.y??0,r.x,r.y,r.width,r.height,i.x,i.y,i.width,i.height,$e(t.geometry.clipPolygon??[],r)??"",Me(t)??"",Te(t)??"",s.width,s.height,s.left,s.top,n.inertLinks?"":t.hyperlinkHref??"",t.accessibility.label??""].join("|")}function N(t,e,n,o){let a=t.createElement("div");a.className="docx-drawing docx-drawing-placeholder",a.dataset.drawingNodeId=e.drawingNodeId,O(a,e.paintBounds,n.scale,o);let r=t.createElement("div");r.className="docx-drawing-placeholder-card";let i=t.createElement("span");return i.className="docx-drawing-placeholder-label",i.textContent=At(e,n.strings),r.append(i),a.append(r),e.hyperlinkHref&&!n.inertLinks?(a.dataset.docxDrawingLink=e.drawingNodeId,a.dataset.docxDrawingLinkKind="external",a.dataset.docxDrawingLinkHref=e.hyperlinkHref,a.setAttribute("tabindex","-1"),D(a,e,true)):D(a,e,false),a}function Pt(t,e,n,o,a,r){let i=e.resource;if(i.kind!=="ready")return N(t,e,n,r);let s=Q(e,n),l=a?.readyElementFor?.(s)??t.createElement("div"),d=Et(e,i,n,o,r);if(J.get(l)===d)return l;l.className="docx-drawing docx-drawing-ready",l.style.cssText="",l.dataset.drawingNodeId=e.drawingNodeId,delete l.dataset.docxDrawingLink,delete l.dataset.docxDrawingLinkKind,delete l.dataset.docxDrawingLinkHref,l.removeAttribute("aria-hidden"),l.removeAttribute("aria-label"),l.removeAttribute("role"),l.removeAttribute("tabindex"),O(l,e.paintBounds,n.scale,r);let c=$e(e.geometry.clipPolygon??[],e.paintBounds);c&&(l.style.clipPath=c);let u=t.createElement("div");u.className="docx-drawing-image-frame",u.style.position="absolute";let y=e.geometry.contentBounds,p=e.paintBounds;u.style.left=`${(y.x-p.x)*n.scale}px`,u.style.top=`${(y.y-p.y)*n.scale}px`,u.style.width=`${y.width*n.scale}px`,u.style.height=`${y.height*n.scale}px`;let h=Me(e);h&&(u.style.filter=h);let g=t.createElement("div");g.className="docx-drawing-transform-stage",g.style.position="relative",g.style.width="100%",g.style.height="100%";let w=Te(e);w&&(g.style.transform=w,g.style.transformOrigin="0 0");let S=t.createElement("div");S.className="docx-drawing-crop-viewport",S.style.position="relative",S.style.width="100%",S.style.height="100%",S.style.overflow="hidden";let R=a?.imageFor?.(s,i.resourceKey,t)??t.createElement("img");R.className="docx-drawing-image",R.setAttribute("draggable","false"),R.getAttribute("src")!==o&&R.setAttribute("src",o),R.setAttribute("alt","");let P=De(e);return R.style.position="absolute",R.style.width=P.width,R.style.height=P.height,R.style.left=P.left,R.style.top=P.top,R.style.maxWidth="none",R.style.maxHeight="none",S.append(R),g.append(S),u.append(g),l.replaceChildren(u),e.hyperlinkHref&&!n.inertLinks?(l.dataset.docxDrawingLink=e.drawingNodeId,l.dataset.docxDrawingLinkKind="external",l.dataset.docxDrawingLinkHref=e.hyperlinkHref,l.setAttribute("tabindex","-1"),D(l,e,true)):D(l,e,false),a?.rememberReadyElement?.(s,l),J.set(l,d),l}var Ee="http://www.w3.org/2000/svg";function Lt(t,e,n,o){let a=e.vectorShape,r=t.createElement("div");r.className="docx-drawing docx-drawing-shape",r.dataset.drawingNodeId=e.drawingNodeId,O(r,e.paintBounds,n.scale,o);let i=e.geometry.contentBounds,s=e.paintBounds,l=t.createElement("div");l.className="docx-drawing-image-frame",l.style.position="absolute",l.style.left=`${(i.x-s.x)*n.scale}px`,l.style.top=`${(i.y-s.y)*n.scale}px`,l.style.width=`${i.width*n.scale}px`,l.style.height=`${i.height*n.scale}px`;let d=t.createElementNS(Ee,"svg");d.setAttribute("viewBox",`0 0 ${k(Math.max(1,a.extentEmu.cx))} ${k(Math.max(1,a.extentEmu.cy))}`),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.style.display="block";for(let c of a.components){let u=t.createElementNS(Ee,"path"),y=c.subpathsEmu.map(p=>`M${p.map(h=>`${k(h.x)} ${k(h.y)}`).join("L")}Z`).join("");u.setAttribute("d",y),u.setAttribute("fill",c.fillHex!==null?`#${c.fillHex}`:"none"),u.setAttribute("fill-rule","evenodd"),c.fillAlpha<1&&u.setAttribute("fill-opacity",k(Math.max(0,c.fillAlpha))),c.strokeHex!==null&&(u.setAttribute("stroke",`#${c.strokeHex}`),u.setAttribute("stroke-width",k(Math.max(1,c.strokeWidthEmu))),c.strokeAlpha<1&&u.setAttribute("stroke-opacity",k(Math.max(0,c.strokeAlpha)))),d.append(u);}return l.append(d),r.append(l),e.hyperlinkHref&&!n.inertLinks?(r.dataset.docxDrawingLink=e.drawingNodeId,r.dataset.docxDrawingLinkKind="external",r.dataset.docxDrawingLinkHref=e.hyperlinkHref,r.setAttribute("tabindex","-1"),D(r,e,true)):D(r,e,false),r}function $t(t,e,n,o,a){let r=o.scale,i=t.createElement("div");i.className="docx-drawing docx-drawing-textbox",i.dataset.drawingNodeId=e.drawingNodeId,i.setAttribute("contenteditable","false"),O(i,e.paintBounds,o.scale,a),i.style.overflow="hidden";let s=(e.x-e.paintBounds.x)*r,l=(e.y-e.paintBounds.y)*r;if(n.fillHex!==null||n.strokeHex!==null){let c=t.createElement("div");c.className="docx-drawing-textbox-box",c.style.position="absolute",c.style.left=`${s}px`,c.style.top=`${l}px`,c.style.width=`${e.width*r}px`,c.style.height=`${e.height*r}px`,c.style.boxSizing="border-box",n.fillHex!==null&&(c.style.backgroundColor=`#${n.fillHex}`),n.strokeHex!==null&&(c.style.border=`${Math.max(n.strokeWidthPt*r,.5)}px solid #${n.strokeHex}`),i.append(c);}let d=t.createElement("div");d.className="docx-drawing-textbox-content",d.style.position="absolute",d.style.left=`${s+n.contentOffset.x*r}px`,d.style.top=`${l+n.contentOffset.y*r}px`,d.style.width=`${n.contentWidth*r}px`,d.style.height=`${Math.max(0,n.contentHeight)*r}px`,d.style.overflow="hidden";for(let c of n.fragments)d.append(o.paintStoryFragment(t,c));for(let c of d.querySelectorAll("[data-paragraph-id]"))delete c.dataset.paragraphId;return i.append(d),D(i,e,false),i}function Tt(t,e,n){let o=n.revisionStyles,a=j(e.revisions,o?.authorSlots,o?.styles);if(!a){if(t.dataset.revisionKind===void 0)return;t.classList.remove("docx-drawing--revision","docx-drawing--revision-insertion","docx-drawing--revision-deletion"),delete t.dataset.revisionKind,delete t.dataset.revisionId,delete t.dataset.reviewAuthor,delete t.dataset.revisionDate,delete t.dataset.reviewAuthorSlot,t.style.outlineColor="";return}let{attribution:r}=a;t.classList.add("docx-drawing--revision",a.deleted?"docx-drawing--revision-deletion":"docx-drawing--revision-insertion"),t.classList.remove(a.deleted?"docx-drawing--revision-insertion":"docx-drawing--revision-deletion"),t.dataset.revisionKind=r.kind,t.dataset.revisionId=r.id,r.author!==""?t.dataset.reviewAuthor=r.author:delete t.dataset.reviewAuthor,r.date!==void 0?t.dataset.revisionDate=r.date:delete t.dataset.revisionDate;let i=o?.styles.get(r.author),s=o!==void 0&&(i?.color!==void 0||o.others==="author");o?t.dataset.reviewAuthorSlot=String((o.authorSlots.get(r.author)??0)%$):delete t.dataset.reviewAuthorSlot,t.style.outlineColor=s?a.authorColor:"";}function He(t,e,n,o,a){let r=Mt(t,e,n,o,a);return r&&Tt(r,e,n),r}function Mt(t,e,n,o,a){if(e.accessibility.hidden||e.paintBounds.width<=0||e.paintBounds.height<=0)return null;if(e.kind==="anchoredDrawing"&&e.textboxStory!==void 0&&n.paintStoryFragment!==void 0)return $t(t,e,e.textboxStory,n,a);if(e.vectorShape&&e.vectorShape.subpathsEmu.length>0)return Lt(t,e,n,a);let{resource:r}=e;if(r.kind==="ready"){if(!n.imageUrlPort||!o)return N(t,e,n,a);let i=o.urlForReady(r.validatedHandle,r.mime);return i?Pt(t,e,n,i,o,a):N(t,e,n,a)}if(r.kind==="pending"){let i=o?.readyElementFor?.(Q(e,n))??o?.imageForPending?.(Q(e,n))?.closest(".docx-drawing-ready");return i?(J.delete(i),i.dataset.drawingNodeId=e.drawingNodeId,O(i,e.paintBounds,n.scale,a),i):N(t,e,n,a)}return N(t,e,n,a)}function Ie(t,e,n,o,a){let r=[];for(let i of e.drawings??[]){let s=He(t,i,n,o,a);s&&r.push(s);}return Object.freeze(r)}function Ce(t,e,n,o,a,r){let i=[];for(let s of e){if(chunkBXRVGHTY_cjs.Bb(s)!==n)continue;let l=He(t,s,o,a,r);l&&(l.dataset.drawingLayer=n,i.push(l));}return Object.freeze(i)}function Dt(t,e){chunkBXRVGHTY_cjs.aa({fragments:t.fragments,...t.anchoredDrawings?{anchoredDrawings:t.anchoredDrawings}:{}},e);for(let n of [t.header,t.footer])n&&chunkBXRVGHTY_cjs.aa(n,e);for(let n of [t.footnotes,t.endnotes])if(n){n.separator&&chunkBXRVGHTY_cjs.aa(n.separator,e);for(let o of n.notes)chunkBXRVGHTY_cjs.aa(o,e);}}var Pe=new WeakMap;function Fe(t){let e=Pe.get(t);if(e)return e;let n=[],o=[];Dt(t,r=>{r.resource.kind==="ready"&&n.push(r.resource.resourceKey),o.push(`p${t.index}|${r.drawingNodeId}`);});let a=Object.freeze({resourceKeys:Object.freeze(n),elementKeys:Object.freeze(o)});return Pe.set(t,a),a}function Be(t){let e=new Set;for(let n of t.pages)for(let o of Fe(n).resourceKeys)e.add(o);return e}function Ne(t){let e=new Set;for(let n of t.pages)for(let o of Fe(n).elementKeys)e.add(o);return e}function Oe(t){return [t.missingResource,t.externalResource,t.invalidResource,t.contentMismatch,t.decodeFailed,t.resourceLimit,t.pendingResource,t.unsupportedFormat("probe"),t.nonPictureGraphic("probe")].join("\0")}var ee=Object.freeze({unsupportedFormat:t=>`Unsupported image format (${t})`,nonPictureGraphic:t=>`Unsupported graphic (${t})`,missingResource:"Image missing",externalResource:"External image not loaded",invalidResource:"Invalid image",contentMismatch:"Image content does not match its type",decodeFailed:"Image could not be decoded",resourceLimit:"Image exceeds size limits",pendingResource:"Loading image"});function On(t){return Object.freeze({unsupportedFormat:e=>t("image.unsupportedFormat",{format:e}),nonPictureGraphic:e=>t("image.nonPictureGraphic",{kind:e}),missingResource:t("image.missingResource"),externalResource:t("image.externalResource"),invalidResource:t("image.invalidResource"),contentMismatch:t("image.contentMismatch"),decodeFailed:t("image.decodeFailed"),resourceLimit:t("image.resourceLimit"),pendingResource:t("image.pendingResource")})}function Ht(t,e,n){t.style.position="absolute",t.style.left=`${e.x*n}px`,t.style.top=`${e.y*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`;}function ze(t,e,n,o){let a=t.createElement("span");return a.className=e,a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.display="block",a.style.left=`${n.x*o}px`,a.style.top=`${n.y*o}px`,a.style.width=`${n.width*o}px`,a.style.height=`${n.height*o}px`,a.style.backgroundColor="currentColor",a.style.pointerEvents="none",a}function E(t,e,n,o,a=0,r=0,i=[]){let s=a+n.box.x,l=r+n.box.y,d=[...i,n.kind];switch(n.kind){case "text":case "fallback":{let c=t.createElement("span");c.className=["docx-equation-node",...d.map(u=>`docx-equation-${u}`)].join(" "),Ht(c,{x:s,y:l,width:n.box.width,height:n.box.height},o),c.textContent=n.text,c.style.display="block",c.style.fontSize=`${n.fontSizePt*o}px`,c.style.lineHeight=`${n.box.height*o}px`,c.style.whiteSpace="pre",e.append(c);break}case "row":for(let c of n.items)E(t,e,c,o,s,l,d);break;case "fraction":E(t,e,n.numerator,o,s,l,d),e.append(ze(t,"docx-equation-fraction-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},o)),E(t,e,n.denominator,o,s,l,d);break;case "radical":E(t,e,n.sign,o,s,l,d),n.degree&&E(t,e,n.degree,o,s,l,d),e.append(ze(t,"docx-equation-radical-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},o)),E(t,e,n.radicand,o,s,l,d);break;case "script":E(t,e,n.base,o,s,l,d),n.subscript&&E(t,e,n.subscript,o,s,l,d),n.superscript&&E(t,e,n.superscript,o,s,l,d);break;case "nary":E(t,e,n.operator,o,s,l,d),n.lowerLimit&&E(t,e,n.lowerLimit,o,s,l,d),n.upperLimit&&E(t,e,n.upperLimit,o,s,l,d),E(t,e,n.body,o,s,l,d);break}}function Ue(t,e,n,o){let a=n.geometry;e.className="layout-run docx-equation",e.dataset.docxEquation=n.sourceNodeId,e.setAttribute("contenteditable","false"),e.setAttribute("role","math"),n.fallbackText&&e.setAttribute("aria-label",n.fallbackText),e.style.position="relative",e.style.display="inline-block",e.style.width=`${a.box.width*o}px`,e.style.height=`${a.box.height*o}px`,e.style.lineHeight="0",e.style.pointerEvents="auto",e.style.userSelect="none",e.style.verticalAlign=`${-(a.box.height-a.baseline)*o}px`;let r=t.createDocumentFragment();E(t,r,a,o),e.append(r);}var It=/^[0-9A-Fa-f]{6}$/;function Ct(t){switch(t){case "dashed":return "dashed";case "dotted":return "dotted";case "double":case "triple":return "solid";default:return "solid"}}function Ke(t){return t&&It.test(t)?t:"000000"}function te(t,e){let n=t.createElement("div");return n.className=e,n.setAttribute("aria-hidden","true"),n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.right="0",n.style.bottom="0",n.style.overflow="visible",n.style.pointerEvents="none",n.style.boxSizing="border-box",n}function q(t,e,n,o){if(!n)return;let a=`#${Ke(n.color)}`,r=`${Math.max(0,n.widthPt*o)}px`;if(t.style[`border${e}Width`]=r,t.style[`border${e}Color`]=a,n.style==="double"||n.style==="triple"){t.style[`border${e}Style`]="none";return}t.style[`border${e}Style`]=Ct(n.style);}function ne(t,e,n,o,a){let r=t.createElement("div");r.className=a,r.dataset.edge=n.side,r.dataset.stroke=n.role,r.style.position="absolute",r.style.left=`${n.x*o}px`,r.style.top=`${n.y*o}px`,r.style.width=`${n.width*o}px`,r.style.height=`${n.height*o}px`,r.style.pointerEvents="none",r.style.backgroundColor=`#${Ke(n.color)}`,n.cssStyle!=="solid"&&(r.dataset.cssStyle=n.cssStyle),e.append(r);}function Ft(t){let e=new Set;for(let n of t)e.add(`${n.side}\0${n.role}`);return e}function Bt(t,e,n,o){let a=Ft(n),r=y=>a.has(`${y}\0middle`),i=te(t,"docx-table-border-double"),s=te(t,"docx-table-border-triple"),l=te(t,"docx-table-border-edge"),d=false,c=false,u=false;for(let y of n){if(y.role==="edge"){u=true,ne(t,l,y,o,"docx-table-border-edge-stroke");continue}if(r(y.side)){c=true,ne(t,s,y,o,"docx-table-border-triple-stroke");continue}(y.role==="outer"||y.role==="inner")&&(d=true,ne(t,i,y,o,"docx-table-border-double-stroke"));}d&&e.append(i),c&&e.append(s),u&&e.append(l);}function _e(t,e,n,o){q(e,"Top",n?.top,o),q(e,"Right",n?.right,o),q(e,"Bottom",n?.bottom,o),q(e,"Left",n?.left,o),n?.strokes&&n.strokes.length>0&&Bt(t,e,n.strokes,o);}var oe="when-selected",je=new WeakMap,Ge=0;function Nt(t){let e=je.get(t);return e||(Ge+=1,e=`alias${Ge}`,je.set(t,e)),e}function et(t){return {...t,drawingStrings:t.drawingStrings??ee,urlRegistry:t.urlRegistry??null}}function Ot(t){let e={...t,inertLinks:true};return Object.freeze({scale:t.scale,strings:t.drawingStrings,...t.imageUrlPort?{imageUrlPort:t.imageUrlPort}:{},...t.inertLinks?{inertLinks:true}:{},...t.paintInstance?{paintInstance:t.paintInstance}:{},...t.revisionStyles?{revisionStyles:t.revisionStyles}:{},paintStoryFragment:(n,o)=>o.kind==="table"?C(n,o,e):I(n,o,e)})}function tt(t){return Object.freeze({ctx:Ot(t),urlRegistry:t.urlRegistry})}function We(t,e,n,o,a,r){X(t,e,chunkBXRVGHTY_cjs.$(n),o,a,r);}function X(t,e,n,o,a,r,i=true,s){if(n.length===0)return;let l=tt(o),d=t.createElement("div");d.className=r==="behind"?"docx-drawing-layer docx-drawing-layer-behind":"docx-drawing-layer docx-drawing-layer-front",d.style.position="absolute",d.style.inset="0",d.style.pointerEvents="none",s&&(d.dataset.docxHfFront=s);for(let c of Ce(t,n,r,l.ctx,l.urlRegistry,a)){if(c.style.pointerEvents=i?"auto":"none",!i)for(let u of c.querySelectorAll(".docx-drawing"))u.style.pointerEvents="none";d.append(c);}d.childElementCount>0&&e.append(d);}function nt(t){return t.horizontalFrame==="page"||t.verticalFrame==="page"}function ot(t,e,n){let o=e.paintBounds,a=e.horizontalFrame==="page"?n.x+(o.x-e.horizontalFrameOrigin):t.box.x+o.x,r=e.verticalFrame==="page"?n.y+(o.y-e.verticalFrameOrigin):t.box.y+o.y,i=a-o.x,s=r-o.y,l=d=>Object.freeze({x:d.x+i,y:d.y+s,width:d.width,height:d.height});return Object.freeze({...e,x:e.x+i,y:e.y+s,paintBounds:l(o),hitBounds:l(e.hitBounds),geometry:Object.freeze({...e.geometry,contentBounds:l(e.geometry.contentBounds),paintBounds:l(e.geometry.paintBounds),...e.geometry.clipPolygon?{clipPolygon:Object.freeze(e.geometry.clipPolygon.map(d=>Object.freeze({x:d.x+i,y:d.y+s})))}:{}})})}function zt(t,e,n,o,a,r){let i=o.map(l=>ot(n,l,r)),s=t.createElement("div");s.className="docx-hf-behind-layer",s.dataset.docxHfBehind=n.kind,s.setAttribute("contenteditable","false"),s.style.position="absolute",s.style.inset="0",s.style.overflow="hidden",s.style.pointerEvents="none",X(t,s,i,a,r,"behind",false),s.childElementCount>0&&e.append(s);}function Ut(t,e,n,o,a,r,i,s=false){let l=o.filter(nt).map(d=>ot(n,d,r));X(t,e,l,a,r,i,s,n.kind);}var F=/^[0-9A-Fa-f]{6}$/,qe=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Kt=new Map(Object.entries({single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"})),_t=new Map(Object.entries({black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"}));function jt(t){return t.doubleStrike?"double":t.strike?"single":"none"}function Gt(t){return t==="thick"||t.endsWith("Heavy")}function rt(t){if(!t.underline)return null;let e=t.underline.color&&F.test(t.underline.color)?t.underline.color:null;return {cssStyle:Kt.get(t.underline.variant)??"solid",color:e,heavy:Gt(t.underline.variant)}}function at(t,e,n,o){t.textDecorationLine=e,t.textDecorationStyle=n,o.color&&(t.textDecorationColor=`#${o.color}`),o.heavy&&(t.textDecorationThickness=`max(${2*o.scale}px, 0.12em)`);}function Ve(t,e,n){e!=="none"&&at(t,"line-through",e==="double"?"double":"solid",{scale:n});}function Xe(t,e,n){at(t,"underline",e.cssStyle,{color:e.color,heavy:e.heavy,scale:n});}function Wt(t,e,n){let o=e.color?`#${e.color}`:"currentColor";t.borderBottomWidth=`${(e.heavy?2:1)*n}px`,t.borderBottomStyle=e.cssStyle==="wavy"?"solid":e.cssStyle,t.borderBottomColor=o;}function V(t,e,n){let o=t.style,a=n.scale,r=e.verticalAlign==="baseline"?1:.75;o.fontSize=`${e.fontSizePt*r*a}px`,e.bold&&(o.fontWeight="bold"),e.italic&&(o.fontStyle="italic");let i=e.fontFamily&&qe.test(e.fontFamily)?e.fontFamily:n.defaultFontFamily&&qe.test(n.defaultFontFamily)?n.defaultFontFamily:null;if(i){let d=n.fontAlias?.(i);o.fontFamily=d?`"${d}", "${i}", ${chunkBXRVGHTY_cjs.Hd}`:`"${i}", ${chunkBXRVGHTY_cjs.Hd}`;}e.color&&F.test(e.color)&&(o.color=`#${e.color}`);let s=e.highlight?_t.get(e.highlight):void 0;s?(o.backgroundColor=s,t.dataset.highlight=e.highlight??""):e.shading&&F.test(e.shading)&&(o.backgroundColor=`#${e.shading}`),e.caps&&(o.textTransform="uppercase"),e.smallCaps&&(o.fontVariant="small-caps");let l=chunkBXRVGHTY_cjs.lb(e);l!==0&&(o.position="relative",o.top=`${-l*a}px`),e.characterSpacingPt!==0&&(o.letterSpacing=`${e.characterSpacingPt*a}px`),e.horizontalScalePercent!==100&&(o.transformOrigin="left",o.transform=`scaleX(${e.horizontalScalePercent/100})`);}function it(t,e,n,o,a){let r=n===" "?null:rt(o),i=jt(o),s=e;if(r&&i!=="none"){let l=t.createElement("span");l.dataset.docxDeco="underline",Xe(l.style,r,a);let d=t.createElement("span");d.dataset.docxDeco="strike",Ve(d.style,i,a),l.append(d),e.append(l),s=d;}else r?Xe(e.style,r,a):i!=="none"&&Ve(e.style,i,a);s.textContent=n;}function T(t,e,n,o){let a=t.createElement(e);return a.style.position="absolute",a.style.left=`${n.x*o}px`,a.style.top=`${n.y*o}px`,a.style.width=`${n.width*o}px`,a.style.height=`${n.height*o}px`,a}function qt(t,e,n){let o=e.fieldAtom;!o||(t.dataset.fieldAtom=o.formField?"form":"field",!(o.formField?n.shadeFormFields!==false:(n.fieldShading??oe)!=="never"))||(t.classList.add("docx-field-atom"),(o.formField||(n.fieldShading??oe)==="always")&&t.classList.add("docx-field-atom--shaded"));}function Ye(t,e,n){let o=chunkBXRVGHTY_cjs.tb(e.props),a=n.revisionStyles,r=j(e.revisions,a?.authorSlots,a?.styles);if(!(!r&&!o)){if(r){let{attribution:i}=r;t.classList.add("docx-revision",`docx-revision-${i.kind}`),t.dataset.revisionKind=i.kind,t.dataset.revisionId=i.id,i.author!==""&&(t.dataset.reviewAuthor=i.author),i.date!==void 0&&(t.dataset.revisionDate=i.date);let s=a?.styles.get(i.author);if(a){t.dataset.reviewAuthorSlot=String((a.authorSlots.get(i.author)??0)%$);let c=a.classTokens.get(i.author);if(c)for(let u=0;u<c.length;u+=1)t.classList.add(c[u]);}let d=a!==void 0&&(s?.color!==void 0||a.others==="author")?r.authorColor:r.color;t.style.color=d,t.style.backgroundColor=s?.background??(r.deleted?"var(--doc-revision-deletion-wash)":"var(--doc-revision-insertion-wash)"),r.line&&(t.style.textDecorationLine=r.line,t.style.textDecorationStyle=r.decorationStyle,t.style.textDecorationColor=d);return}if(t.classList.add("docx-revision","docx-revision-format"),t.dataset.revisionKind="format",t.dataset.revisionId=o.id,o.author!==""&&(t.dataset.reviewAuthor=o.author),o.date!==void 0&&(t.dataset.revisionDate=o.date),a){let i=a.styles.get(o.author);t.dataset.reviewAuthorSlot=String((a.authorSlots.get(o.author)??0)%$);let s=a.classTokens.get(o.author);if(s)for(let l=0;l<s.length;l+=1)t.classList.add(s[l]);i?.color!==void 0&&(t.style.color=i.color),i?.background!==void 0&&(t.style.backgroundColor=i.background);}}}function Vt(t,e,n,o){let a=chunkBXRVGHTY_cjs.qb(e),r=t.createElement("span");r.className=`docx-revision-pmark docx-revision-pmark-${a.kind}`,r.setAttribute("aria-hidden","true"),r.contentEditable="false",r.dataset.revisionKind=a.kind,r.dataset.revisionId=a.id,a.author!==""&&(r.dataset.reviewAuthor=a.author),r.dataset.revisionIds=e.map(d=>d.id).join(" "),r.dataset.revisionKinds=e.map(d=>d.kind).join(" "),r.textContent="\xB6",r.style.position="absolute",r.style.pointerEvents="none",r.style.marginLeft=`${2*n}px`;let i=chunkBXRVGHTY_cjs.rb(a),s=o?.styles.get(a.author),l=o?(o.authorSlots.get(a.author)??0)%$:0;if(o){r.dataset.reviewAuthorSlot=String(l);let d=o.classTokens.get(a.author);if(d)for(let c=0;c<d.length;c+=1)r.classList.add(d[c]);}return r.style.color=s?.color??(o?.others==="author"?_(l):i?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)"),i&&(r.style.textDecorationLine="line-through"),r}function Xt(t,e,n){let o=[],a=e.lines[e.lines.length-1];for(let i of e.lines){let s=[...i.spans.flatMap(y=>y.revisions??[]),...(i.drawings??[]).flatMap(y=>y.revisions??[]),...i.anchorRevisions??[],...i===a?e.markRevisions??[]:[]];if(s.length===0)continue;let l=s.some(y=>y.kind==="delete"||y.kind==="moveFrom"),d=i.box.y-e.box.y,c=d+i.box.height,u=o[o.length-1];if(u&&u.deleted===l&&d<=u.bottom+.5){u.bottom=Math.max(u.bottom,c);continue}o.push({top:d,bottom:c,deleted:l});}if(o.length===0)return null;let r=t.createElement("div");r.className="docx-change-bars",r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.inset="0",r.style.pointerEvents="none";for(let i of o){let s=t.createElement("div");s.className=`docx-change-bar docx-change-bar-${i.deleted?"deletion":"insertion"}`,s.style.position="absolute",s.style.top=`${i.top*n}px`,s.style.height=`${(i.bottom-i.top)*n}px`,s.style.left=`${(-e.box.x-Yt)*n}px`,s.style.width=`${Zt*n}px`,s.style.pointerEvents="none",s.style.backgroundColor=i.deleted?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",r.append(s);}return r}var Yt=7.5,Zt=1.5;function Jt(t,e,n,o,a){let r=t.createElement("span");if(e.equation)return r.dataset.paragraphId=e.range.paragraphId,r.dataset.start=String(e.range.start),r.dataset.end=String(e.range.end),V(r,e.style,n),Ue(t,r,e.equation,n.scale),Ye(r,e,n),r;if(r.className="layout-run layout-run-text",r.style.display="inline-block",r.style.verticalAlign="baseline",r.style.boxSizing="border-box",r.style.height=`${o*n.scale}px`,r.style.paddingTop=`${a*n.scale}px`,r.style.lineHeight=`${(o-a)*n.scale}px`,e.range.end>e.range.start?(r.dataset.paragraphId=e.range.paragraphId,r.dataset.start=String(e.range.start),r.dataset.end=String(e.range.end)):(r.setAttribute("aria-hidden","true"),r.contentEditable="false"),V(r,e.style,n),qt(r,e,n),Ye(r,e,n),(e.style.horizontalScalePercent!==100||e.text===" ")&&(r.style.width=`${e.box.width*n.scale}px`),e.text===" "){r.style.overflow="hidden",r.style.verticalAlign="top";let i=rt(e.style);i&&(r.dataset.docxTabUnderline="",Wt(r.style,i,n.scale));}return it(t,r,e.text,e.style,n.scale),e.projected&&(r.dataset.docxField="",r.setAttribute("contenteditable","false"),e.noteNav?(r.style.userSelect="none",e.noteNav.direction==="to-note"?(r.dataset.docxNoteRef="",r.dataset.docxNoteScope=e.noteNav.scopeId,e.text.length>0&&r.setAttribute("aria-description",e.text)):(r.dataset.docxNoteMarkBack="",r.dataset.docxNoteScope=e.noteNav.scopeId)):(r.style.pointerEvents="none",r.style.userSelect="none")),r}function Ze(t,e,n){let o=t.createElement("a");return o.className="docx-hyperlink",o.dataset.docxLink=e.id,o.dataset.docxLinkKind=e.kind,o.setAttribute("tabindex","-1"),!n.inertLinks&&e.href&&(o.setAttribute("href",e.href),e.kind==="external"&&o.setAttribute("rel","noopener noreferrer")),e.tooltip&&o.setAttribute("title",e.tooltip),o.style.display="inline-block",o.style.verticalAlign="baseline",o.style.textDecoration="none",o.style.color="inherit",o}function Qt(t,e,n){let o=n.scale,a=t.createElement("div");a.className="docx-line layout-line",a.dataset.lineId=e.id,a.dataset.paragraphId=e.range.paragraphId,a.style.position="absolute",a.style.top=`${e.box.y*o}px`,a.style.left=`${e.contentX*o}px`,a.style.height=`${e.box.height*o}px`,a.style.fontSize="0",a.style.whiteSpace="pre",a.style.overflow="visible";let r=e.leading??0,i=Math.min(Math.max(r,...e.spans.map(v=>v.box.height+r),e.spans.length===0?e.box.height-(e.trailingSpacing??0):0),e.box.height),s=Math.max(0,e.box.height-i);a.style.boxSizing="border-box",a.style.paddingBottom=`${s*o}px`,a.style.lineHeight=`${(e.box.height-s)*o}px`;let l=null,d=null,c=null,u=new Map;for(let[v,b]of chunkBXRVGHTY_cjs.vc(e).entries())u.set(b.paragraphId,v);let y=v=>u.get(v)??0,p=[...e.drawings??[]].sort((v,b)=>y(v.paragraphId)-y(b.paragraphId)||v.start-b.start),h=0,g=(v,b)=>{for(;h<p.length&&(y(p[h].paragraphId)<y(v)||y(p[h].paragraphId)===y(v)&&p[h].start<b);){let x=p[h],f=Math.max(0,x.advanceEnd-x.advanceStart),m=t.createElement("span");m.className="docx-inline-drawing-advance",m.dataset.docxMarker="",m.setAttribute("contenteditable","false"),m.setAttribute("aria-hidden","true"),m.style.display="inline-block",m.style.width=`${f*o}px`,m.style.height=`${x.baselineOffset*o}px`,m.style.lineHeight="0",m.style.pointerEvents="none",m.style.verticalAlign="baseline",a.append(m),h+=1,l=null,d=null;}},w=v=>{let b=v.wrapAdvanceBefore??0;if(b<=.001)return;let x=t.createElement("span");x.className="docx-wrap-advance",x.dataset.docxMarker="",x.setAttribute("contenteditable","false"),x.setAttribute("aria-hidden","true"),x.style.display="inline-block",x.style.width=`${b*o}px`,x.style.height="0",x.style.lineHeight="0",x.style.pointerEvents="none",x.style.verticalAlign="baseline",a.append(x),l=null,d=null;},S=0,R=false;for(let[v,b]of e.spans.entries()){g(b.range.paragraphId,b.range.start),w(b);let x=Math.min(b.box.height+r,e.box.height),f=Jt(t,b,n,x,r);S>0&&!R&&(f.style.marginLeft=`${S*o}px`);let m=e.spans[v+1],M=en(e,v+1,y);R=M>0&&m!==void 0&&nn(b,m),R&&(f.style.wordSpacing=`${M*o}px`),S=M;let A=b.link;if(!A){l=null,d=null,c=null,a.append(f);continue}if(b.fieldAtom){l!==null&&d===A.id&&c===b.range.start||(l=Ze(t,A,n),d=A.id,c=b.range.start,a.append(l)),l.append(f);continue}(!l||d!==A.id||c!==null)&&(l=Ze(t,A,n),d=A.id,c=null,a.append(l)),l.append(f);}if(g(chunkBXRVGHTY_cjs.vc(e)[chunkBXRVGHTY_cjs.vc(e).length-1]?.paragraphId??e.range.paragraphId,Number.POSITIVE_INFINITY),e.spans.length===0){let v=t.createElement("br");v.style.lineHeight=`${e.box.height*o}px`,a.append(v);}let P=Object.freeze({x:e.contentX,y:e.box.y,width:e.box.width,height:e.box.height}),L=tt(et(n));if(e.drawings&&e.drawings.length>0)for(let v of Ie(t,e,L.ctx,L.urlRegistry,P))a.append(v);return a}function en(t,e,n){if(e<=0||e>=t.spans.length)return 0;let o=t.spans[e-1],a=t.spans[e],r=n(o.range.paragraphId),i=n(a.range.paragraphId);if(t.drawings?.some(d=>{let c=n(d.paragraphId),u=c>r||c===r&&d.start>=o.range.start,y=c<i||c===i&&d.start<a.range.start;return u&&y}))return 0;let l=a.box.x-(o.box.x+o.box.width)-(a.wrapAdvanceBefore??0);return l>.25?l:0}var tn=/[\t\n\r \u00A0\u1361\u{10100}-\u{10102}\u{1039F}\u{1091F}]/u;function nn(t,e){return !t.text.endsWith(" ")||t.style.horizontalScalePercent!==100||!on(t,e)||(e.wrapAdvanceBefore??0)>.001?false:!tn.test(t.text.slice(0,-1))}function on(t,e){return !t.link&&!e.link?true:!t.link||!e.link||t.link.id!==e.link.id||!!t.fieldAtom!=!!e.fieldAtom?false:!t.fieldAtom||t.range.start===e.range.start}function I(t,e,n){let o=n.scale,a=T(t,"div",e.box,o);a.className="docx-paragraph-fragment layout-paragraph",a.dataset.paragraphId=e.paragraphId,a.dataset.fragmentIndex=String(e.fragmentIndex),n.readOnlyParagraphIds?.has(e.paragraphId)&&(a.classList.add("docx-generated-region"),a.dataset.docxReadOnly="",a.setAttribute("contenteditable","false"),a.setAttribute("aria-readonly","true")),n.emptyTocPlaceholderIds?.has(e.paragraphId)&&(a.classList.add("docx-toc-empty-placeholder"),a.dataset.docxTocEmpty=""),e.shading&&F.test(e.shading)&&e.shadingBox&&a.append(ln(t,e,o)),e.marker&&a.append(rn(t,e,n));for(let i of e.lines)for(let s of i.spans){if(!s.tabLeader)continue;let l=sn(t,e,i,s,n);l&&a.append(l);}let r=Xt(t,e,o);if(r&&a.append(r),e.markRevisions&&e.markRevisions.length>0){let i=Vt(t,e.markRevisions,o,n.revisionStyles),s=e.lines[e.lines.length-1];if(s){let l=s.spans[s.spans.length-1];i.style.top=`${(s.box.y-e.box.y)*o}px`,i.style.left=`${((l?l.box.x+l.box.width:s.contentX)-e.box.x)*o}px`,a.append(i);}}for(let i of e.lines){let s=Qt(t,i,n);s.style.top=`${(i.box.y-e.box.y)*o}px`,s.style.left=`${(i.contentX-e.box.x)*o}px`,a.append(s);}if(e.borders)for(let i of e.borders)a.append(Je(t,e,i,o));else e.bottomBorder&&a.append(Je(t,e,{side:"bottom",edge:e.bottomBorder.edge,box:e.bottomBorder.box},o));return a}function rn(t,e,n){let o=e.marker,a=n.scale,r=e.lines[0]?.leading??0,i=T(t,"span",o.box,a);i.className="docx-list-marker",i.dataset.docxMarker="",i.setAttribute("contenteditable","false"),i.setAttribute("aria-hidden","true"),i.style.left=`${(o.box.x-e.box.x)*a}px`,i.style.top=`${(o.box.y-e.box.y)*a}px`,i.style.display="block",i.style.overflow="visible",i.style.whiteSpace="pre";let s=e.lines[0],l=s?Math.max(r,...s.spans.map(y=>y.box.height+r),s.spans.length===0?s.box.height-(s.trailingSpacing??0):0):o.box.height,d=Math.min(l,o.box.height),c=Math.max(0,o.box.height-d);i.style.fontSize="0",i.style.boxSizing="border-box",i.style.paddingBottom=`${c*a}px`,i.style.lineHeight=`${d*a}px`;let u=t.createElement("span");return u.style.display="inline-block",u.style.verticalAlign="baseline",u.style.boxSizing="border-box",u.style.height=`${d*a}px`,u.style.paddingTop=`${r*a}px`,u.style.lineHeight=`${(d-r)*a}px`,V(u,o.style,n),it(t,u,o.text,o.style,a),i.append(u),i}var an=512;function sn(t,e,n,o,a){let r=o.tabLeader?chunkBXRVGHTY_cjs.Na.get(o.tabLeader):void 0;if(!r||o.box.width<=0)return null;let i=a.scale,s=t.createElement("div");s.className="docx-tab-leader",s.dataset.docxTabLeader="",s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(o.box.x-e.box.x)*i}px`,s.style.top=`${(n.box.y-e.box.y)*i}px`,s.style.width=`${o.box.width*i}px`,s.style.height=`${n.box.height*i}px`,s.style.overflow="hidden",s.style.whiteSpace="pre",s.style.pointerEvents="none",s.style.userSelect="none";let l=n.leading??0,d=Math.min(o.box.height+l,n.box.height),c=Math.max(0,n.box.height-d);s.style.fontSize="0",s.style.boxSizing="border-box",s.style.paddingBottom=`${c*i}px`,s.style.lineHeight=`${(n.box.height-c)*i}px`;let u=t.createElement("span");u.style.display="inline-block",u.style.verticalAlign="baseline",V(u,o.style,a),u.style.boxSizing="border-box",u.style.height=`${d*i}px`,u.style.paddingTop=`${l*i}px`,u.style.lineHeight=`${(d-l)*i}px`,o.tabLeader==="heavy"&&(u.style.fontWeight="bold");let y=o.tabLeaderAdvancePt&&o.tabLeaderAdvancePt>0?o.tabLeaderAdvancePt:Math.max(.5,o.style.fontSizePt*.2),p=Math.min(an,Math.max(1,Math.floor(o.box.width/y)+2));return u.textContent=r.repeat(p),u.style.letterSpacing="0",s.append(u),s}function ln(t,e,n){let o=e.shadingBox,a=T(t,"div",o,n);return a.className="docx-paragraph-shading",a.setAttribute("aria-hidden","true"),a.style.left=`${(o.x-e.box.x)*n}px`,a.style.top=`${(o.y-e.box.y)*n}px`,a.style.backgroundColor=`#${e.shading}`,a}function Je(t,e,n,o){let a=T(t,"div",n.box,o);a.className=`docx-paragraph-border docx-paragraph-border-${n.side}`,a.setAttribute("aria-hidden","true");let r=(n.box.x-e.box.x)*o,i=(n.box.y-e.box.y)*o,s=n.side==="left"||n.side==="right"||n.side==="bar",l=(s?n.box.width:n.box.height)*o,c=dn(n.edge.val)?l:Math.max(1,l);a.style.left=`${n.side==="right"?r-(c-l):r}px`,a.style.top=`${n.side==="bottom"?i-(c-l):i}px`,s?a.style.width=`${c}px`:a.style.height=`${c}px`;let u=n.edge.color&&F.test(n.edge.color)?n.edge.color:"000000";return a.style.backgroundColor=`#${u}`,cn(a,n.edge.val,u,s,c,o),a}function dn(t){return t==="double"||t==="triple"||t==="doubleWave"||t.startsWith("thinThick")||t.startsWith("thickThin")}function cn(t,e,n,o,a,r){switch(e){case "dashed":case "dashSmallGap":case "dotDash":case "dotDotDash":case "dashDotStroked":{let i=Math.max(4,4*r);t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 60%, transparent 60%)`,t.style.backgroundSize=o?`100% ${i}px`:`${i}px 100%`;return}case "dotted":{let i=Math.max(3,3*r);t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 35%, transparent 35%)`,t.style.backgroundSize=o?`100% ${i}px`:`${i}px 100%`;return}case "double":case "doubleWave":case "triple":case "thinThickSmallGap":case "thickThinSmallGap":case "thinThickThinSmallGap":case "thinThickMediumGap":case "thickThinMediumGap":case "thinThickThinMediumGap":case "thinThickLargeGap":case "thickThinLargeGap":case "thinThickThinLargeGap":{let i=Math.max(1,a/3);t.style.backgroundColor="transparent",o?(t.style.borderLeft=`${i}px solid #${n}`,t.style.borderRight=`${i}px solid #${n}`):(t.style.borderTop=`${i}px solid #${n}`,t.style.borderBottom=`${i}px solid #${n}`),t.style.boxSizing="border-box";return}case "threeDEmboss":case "ridge":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px ridge #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "threeDEngrave":case "groove":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px groove #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "inset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px inset #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "outset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px outset #${n}`,o?t.style.width="0px":t.style.height="0px";return}default:return}}function un(t,e,n,o){let a=o.scale,r=T(t,"div",e.box,a);if(r.className="docx-table-cell",r.style.left=`${(e.box.x-n.x)*a}px`,r.style.top=`${(e.box.y-n.y)*a}px`,r.style.boxSizing="border-box",r.style.overflow="visible",r.dataset.cellId=e.id,r.dataset.gridColumn=String(e.gridColumn),r.dataset.gridSpan=String(e.gridSpan),e.rowSpan&&e.rowSpan>1&&(r.dataset.rowSpan=String(e.rowSpan)),e.paintInert||e.vMergeContinue)return r.dataset.vMergeContinue="true",r.style.border="none",r.style.backgroundColor="transparent",r;r.style.border="none",_e(t,r,e.borders,a),e.shading&&F.test(e.shading)&&(r.style.backgroundColor=`#${e.shading}`);for(let i of e.blocks){let s=i.kind==="table"?C(t,i,o):I(t,i,o);s.style.left=`${(i.box.x-e.box.x)*a}px`,s.style.top=`${(i.box.y-e.box.y)*a}px`,r.append(s);}return r}function C(t,e,n){let o=n.scale,a=T(t,"div",e.box,o);a.className="docx-table-fragment layout-table",a.dataset.tableId=e.tableId,a.dataset.fragmentIndex=String(e.fragmentIndex),a.style.overflow="visible";for(let r of e.rows){let i=T(t,"div",r.box,o);i.className="docx-table-row",r.revisionKind&&(i.classList.add("docx-table-row--revision",r.revisionKind==="insert"?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionKind=r.revisionKind,r.revisionId!==void 0&&(i.dataset.revisionId=r.revisionId),r.revisionAuthor!==void 0&&(i.dataset.reviewAuthor=r.revisionAuthor),r.revisionDate!==void 0&&(i.dataset.revisionDate=r.revisionDate)),i.dataset.rowId=r.id,r.isHeaderRepeat&&(i.dataset.headerRepeat="true"),i.style.left=`${(r.box.x-e.box.x)*o}px`,i.style.top=`${(r.box.y-e.box.y)*o}px`,i.style.overflow="visible";for(let s of r.cells)i.append(un(t,s,r.box,n));a.append(i);}return a}function yn(t,e,n,o,a){let r={...n,paintInstance:`p${e.index}`},i=T(t,"div",e.box,r.scale);if(i.className="docx-page",i.style.fontFamily=chunkBXRVGHTY_cjs.Hd,i.dataset.pageIndex=String(e.index),r.ariaHidden&&(i.setAttribute("aria-hidden","true"),i.setAttribute("role","presentation")),i.dataset.materialized=String(o),!o)return i;let s=Object.freeze({x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height}),l=Object.freeze({x:-(e.contentBox.x-e.box.x),y:-(e.contentBox.y-e.box.y),width:e.box.width,height:e.box.height});We(t,i,e,r,l,"behind");for(let u of [e.header,e.footer])u?.anchoredDrawings?.length&&zt(t,i,u,u.anchoredDrawings,r,{x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height});let d=t.createElement("div");d.className="docx-page-content",d.style.position="absolute",d.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,d.style.top=`${(e.contentBox.y-e.box.y)*r.scale}px`,d.style.width=`${e.contentBox.width*r.scale}px`,d.style.height=`${e.contentBox.height*r.scale}px`,r.activeHeaderFooterRId&&d.setAttribute("contenteditable","false");for(let u of e.columnSeparators??[]){let y=t.createElement("div");y.className="docx-column-separator",y.setAttribute("contenteditable","false"),y.style.position="absolute",y.style.left=`${u.x*r.scale}px`,y.style.top=`${u.y*r.scale}px`,y.style.width=`${u.width*r.scale}px`,y.style.height=`${u.height*r.scale}px`,y.style.backgroundColor="currentColor",y.style.pointerEvents="none",d.append(y);}let c=a?new Map:null;for(let u of e.fragments){let y=u.kind==="table"?C(t,u,r):I(t,u,r);c?.set(u,y),d.append(y);}a&&c&&(a.content=d,a.blocks=c),i.append(d),We(t,i,e,r,l,"inFront"),Se(t,i,e,r,I,C);for(let u of ["header","footer"]){if(e[u])continue;let y=t.createElement("div");y.className="docx-hf docx-hf--placeholder",y.dataset.docxHf=u,y.setAttribute("contenteditable","false");let p=u==="header"?e.contentBox.y-e.box.y:e.box.y+e.box.height-(e.contentBox.y+e.contentBox.height),h=Math.min(p,hn);if(h<=0)continue;let g=Math.max(0,Math.min(pn,p-h)),w=u==="header"?g:e.box.height-g-h;y.style.position="absolute",y.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,y.style.top=`${w*r.scale}px`,y.style.width=`${e.contentBox.width*r.scale}px`,y.style.height=`${h*r.scale}px`,i.append(y);}for(let u of [e.header,e.footer]){if(!u)continue;let y=u.anchoredDrawings??[],p=G(u,e.index,r),h=t.createElement("div");h.className="docx-hf",h.dataset.docxHf=u.kind,u.rId&&(h.dataset.docxRId=u.rId),p?(h.dataset.docxHfActive="",h.setAttribute("contenteditable","true")):h.setAttribute("contenteditable","false"),h.style.position="absolute",h.style.left=`${(u.box.x-e.box.x)*r.scale}px`,h.style.top=`${(u.box.y-e.box.y)*r.scale}px`,h.style.width=`${u.box.width*r.scale}px`;let g=Z(u,e,p);h.style.height=`${g*r.scale}px`,h.style.overflow="visible";let w=(e.box.x-u.box.x)*r.scale,S=(e.box.y-u.box.y)*r.scale,R=w+e.box.width*r.scale,P=S+e.box.height*r.scale;h.style.clipPath=`polygon(${w}px ${S}px, ${R}px ${S}px, ${R}px ${P}px, ${w}px ${P}px)`;let L=Object.freeze({x:0,y:0,width:u.box.width,height:u.box.height}),v=y.filter(f=>!nt(f)),b={...r,inertLinks:true};for(let f of u.fragments)h.append(f.kind==="table"?C(t,f,b):I(t,f,b));X(t,h,v,et(r),L,"inFront",p),i.append(h);let x=t.createElement("div");x.className="docx-hf-edit-hint",x.dataset.docxHfHint=u.kind,x.setAttribute("contenteditable","false"),x.style.position="absolute",x.style.left=h.style.left,x.style.width=h.style.width,x.style.top=u.kind==="header"?`${(u.box.y+u.box.height-e.box.y)*r.scale}px`:`${(u.box.y-e.box.y)*r.scale}px`,u.kind==="footer"&&(x.style.transform="translateY(-100%)"),i.append(x),Ut(t,i,u,y,r,s,"inFront",p);}return xn(t,i,e,r),i}var hn=30,pn=36,fn=16,gn=new Set(["dropdown","comboBox","date","checkbox"]);function xn(t,e,n,o){let a=o.contentControlChrome,r=a?.suppressedIds,i=(n.contentControls??[]).filter(y=>r?.has(y.id)!==true),s=[...i,...(a?.additionalBoundaries??[]).filter(y=>r?.has(y.id)!==true&&!i.some(p=>p.id===y.id))];if(s.length===0)return;let l=a?.showAll===true,d=a?.activeIds,c=a?.hoverIds,u=a?.tocControlIds;for(let y of s){let p=u?.has(y.id)===true,h=!p&&d?.has(y.id)===true,g=c?.has(y.id)===true;e.append(bn(t,n,y,o.scale,h,g,l||h||p&&g,a?.checkedIds?.has(y.id),p,a?.readOnly===true));}}function bn(t,e,n,o,a,r,i,s,l,d){let c=t.createElement("div");c.className="docx-content-control-chrome",c.dataset.docxContentControl=n.id,c.dataset.docxMarker="",c.dataset.controlType=n.controlType,c.dataset.lock=n.effectiveLock,n.bound&&(c.dataset.bound=""),n.placeholder&&(c.dataset.placeholder=""),l&&(c.dataset.docxToc=""),d&&(c.dataset.readOnly=""),a&&(c.dataset.active=""),r&&(c.dataset.hover=""),i&&(c.dataset.boundaryVisible=""),c.setAttribute("contenteditable","false"),c.setAttribute("role","group"),n.alias&&(c.dataset.alias=n.alias),n.tag&&(c.dataset.tag=n.tag),n.alias&&c.setAttribute("aria-label",n.alias),c.style.position="absolute",c.style.inset="0",c.style.pointerEvents="none",c.style.zIndex="2";let u=e.contentBox.x-e.box.x,y=e.contentBox.y-e.box.y;for(let h of n.fragments){if(h.pageIndex!==e.index)continue;let g=t.createElement("div");g.className="docx-content-control-boundary",g.dataset.docxMarker="",g.setAttribute("contenteditable","false"),g.setAttribute("aria-hidden","true"),g.style.position="absolute",g.style.left=`${(u+h.box.x)*o}px`,g.style.top=`${(y+h.box.y)*o}px`,g.style.width=`${Math.max(h.box.width,1)*o}px`,g.style.height=`${Math.max(h.box.height,1)*o}px`,g.style.pointerEvents="none",c.append(g);}let p=n.fragments.find(h=>h.pageIndex===e.index);if(p&&n.alias){let h=t.createElement("div");h.className="docx-content-control-label",h.dataset.docxMarker="",h.setAttribute("contenteditable","false"),h.setAttribute("aria-hidden","true"),h.textContent=n.alias,h.style.position="absolute",h.style.left=`${(u+p.box.x)*o}px`,h.style.top=`${Math.max(0,(y+p.box.y)*o-fn)}px`,h.style.pointerEvents="none",c.append(h);}if(p&&gn.has(n.controlType)){let h=t.createElement("button");h.type="button",h.className="docx-content-control-widget",h.dataset.docxMarker="",h.dataset.docxCcWidget=n.controlType,h.dataset.docxCcId=n.id,h.setAttribute("contenteditable","false"),h.setAttribute("tabindex","-1"),n.controlType==="checkbox"?h.setAttribute("role","checkbox"):n.controlType==="dropdown"||n.controlType==="comboBox"?h.setAttribute("role","listbox"):n.controlType==="date"&&h.setAttribute("role","button"),n.alias&&(h.dataset.name=n.alias),n.alias&&h.setAttribute("aria-label",n.alias),n.controlType==="checkbox"&&(h.setAttribute("data-checked",s?"true":"false"),h.setAttribute("aria-checked",s?"true":"false"));let g=n.effectiveLock==="contentLocked"||n.effectiveLock==="sdtContentLocked";(d||g||n.bound)&&(h.disabled=true,h.dataset.disabledReason=d?"readOnly":n.bound?"bound":"locked",h.setAttribute("aria-disabled","true")),h.style.position="absolute",h.style.left=`${(u+p.box.x+p.box.width)*o-18}px`,h.style.top=`${(y+p.box.y)*o}px`,h.style.width="16px",h.style.height="16px",h.style.pointerEvents="auto",h.style.padding="0",h.style.margin="0",h.style.cursor=h.disabled?"not-allowed":"pointer",c.append(h);}return c}var re=new WeakMap;function eo(t){re.delete(t);}function mn(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function vn(t,e){let n=Object.keys(t);if(n.length!==Object.keys(e).length)return false;for(let o of n){let a=t[o],r=e[o];if(a!==r)return false}return true}function Rn(t,e){if(t.length!==e.length)return false;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return false;return true}function Sn(t,e){if(t===e)return false;let n=new Set([...Object.keys(t),...Object.keys(e)]);for(let o of n){if(o==="fragments")continue;let a=t[o],r=e[o];if(a!==r&&!(Array.isArray(a)&&Array.isArray(r)&&Rn(a,r))&&!(typeof a=="object"&&typeof r=="object"&&a!==null&&r!==null&&!Array.isArray(a)&&!Array.isArray(r)&&vn(a,r)))return false}return true}var Qe="docx-column-separator";function wn(t,e,n,o){let a=e.content,r=e.blocks;if(!a||!r||a.parentElement!==e.element)return null;let i={...o,paintInstance:`p${n.index}`},s=new Map,l=[];for(let y of n.fragments){let p=r.get(y)??(y.kind==="table"?C(t,y,i):I(t,y,i));s.set(y,p),l.push(p);}let d=new Set(l),c=a.firstChild;for(;c;){let y=c.nextSibling,p=c;!d.has(p)&&p.classList?.contains(Qe)!==true&&c.remove(),c=y;}let u=a.firstChild;for(;u&&u.classList?.contains(Qe);)u=u.nextSibling;for(let y of l){if(y===u){u=u.nextSibling;continue}a.insertBefore(y,u);}return {record:n,materialized:true,element:e.element,content:a,blocks:s}}function kn(t,e,n,o){let a=t.element;return !t.materialized&&mn(t.record.box,e.box)&&a.style.left===`${e.box.x*n}px`&&a.style.top===`${e.box.y*n}px`&&a.style.width===`${e.box.width*n}px`&&a.style.height===`${e.box.height*n}px`&&a.getAttribute("aria-hidden")===(o?"true":null)}function An(t,e,n={}){En(t,e,n);}function En(t,e,n,o){let a=n.contentControlChrome,r=a?`${a.showAll===true?"1":"0"}:${a.activeIds?[...a.activeIds].sort().join(","):""}:${a.checkedIds?[...a.checkedIds].sort().join(","):""}:${a.tocControlIds?[...a.tocControlIds].sort().join(","):""}:${a.suppressedIds?[...a.suppressedIds].sort().join(","):""}:${a.readOnly===true?"ro":""}`:"",i=n.drawingStrings??ee,s=n.imageUrlPort!==void 0?Le(t,n.imageUrlPort):null,l=a?.additionalBoundaries?a.additionalBoundaries.flatMap(f=>f.fragments.map(m=>`${f.id}:${m.pageIndex}:${m.box.x}:${m.box.y}:${m.box.width}:${m.box.height}`)).sort().join(","):"",d=n.readOnlyParagraphIds?[...n.readOnlyParagraphIds].sort().join(","):"",c=n.emptyTocPlaceholderIds?[...n.emptyTocPlaceholderIds].sort().join(","):"",u=a?.tocControlIds?[...a.tocControlIds].sort().join(","):"",y=Re(n.revisionStyles,e,o),p={scale:n.scale??96/72,ariaHidden:n.ariaHidden??true,drawingStrings:i,urlRegistry:s,...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.readOnlyParagraphIds?{readOnlyParagraphIds:n.readOnlyParagraphIds}:{},...n.emptyTocPlaceholderIds?{emptyTocPlaceholderIds:n.emptyTocPlaceholderIds}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},...n.fieldShading?{fieldShading:n.fieldShading}:{},...n.shadeFormFields!==void 0?{shadeFormFields:n.shadeFormFields}:{},...y?{revisionStyles:y}:{},...n.imageUrlPort?{imageUrlPort:n.imageUrlPort}:{},...n.activeHeaderFooterRId?{activeHeaderFooterRId:n.activeHeaderFooterRId}:{},...n.activeHeaderFooterPageIndex!==void 0?{activeHeaderFooterPageIndex:n.activeHeaderFooterPageIndex}:{},...a?{contentControlChrome:a}:{}},h=t.ownerDocument,g=`${p.scale}|${p.ariaHidden}|${p.fontAlias?Nt(p.fontAlias):""}|${p.defaultFontFamily??""}|cc:${r}:${l}|toc:${u}|ro:${d}|tocEmpty:${c}|${n.imageUrlPort?"url":""}|${Oe(i)}|rev:${ve(y)}`,w=re.get(t),S=w?.parameters===g,R=S?new Map(w.pages.map(f=>[f.record,f])):null,P=w?new Map(w.pages.map(f=>[f.record.index,f])):null,L=e.pages.map(f=>{let m=n.materialize?.has(f.index)??true,M=R?.get(f);if(M&&M.materialized===m)return M;let A=P?.get(f.index);if(!m&&A&&kn(A,f,p.scale,p.ariaHidden))return {record:f,materialized:false,element:A.element};if(S&&m&&A?.materialized&&Sn(A.record,f)){let ae=wn(h,A,f,p);if(ae)return ae}let H={},st=yn(h,f,p,m,H);return {record:f,materialized:m,element:st,...H.content?{content:H.content}:{},...H.blocks?{blocks:H.blocks}:{}}});re.set(t,{parameters:g,pages:L}),t.dataset.revision=String(e.revision),s&&s.reconcile(Be(e),Ne(e));let v=new Set(L.map(f=>f.element)),b=t.firstChild;for(;b;){let f=b.nextSibling;v.has(b)||b.remove(),b=f;}let x=t.firstChild;for(let f of L){if(f.element===x){x=x.nextSibling;continue}t.insertBefore(f.element,x);}we(L,p);}function Pn(t,e,n,o){let a=t.ownerDocument,r=o.scale,i=[];for(let s of n){let l=e.pages[s.pageIndex];if(!l)continue;let d=a.createElement("div");d.className=s.className??o.className??"docx-cell-selection-rect",d.style.position="absolute";let c=o.pageOffsetX?.get(s.pageIndex)??0;d.style.left=`${(l.contentBox.x+s.x+c)*r}px`,d.style.top=`${(l.contentBox.y+s.y)*r}px`,d.style.width=`${s.width*r}px`,d.style.height=`${s.height*r}px`,s.reviewAuthor&&(d.dataset.reviewAuthor=s.reviewAuthor.author,d.dataset.reviewAuthorSlot=String(s.reviewAuthor.slot%$),d.style.setProperty("--doc-review-author-current",s.reviewAuthor.color)),i.push(d);}t.replaceChildren(...i);}
2
+ exports.a=_;exports.b=me;exports.c=$n;exports.d=gt;exports.e=Tn;exports.f=Nn;exports.g=ee;exports.h=On;exports.i=oe;exports.j=eo;exports.k=An;exports.l=En;exports.m=Pn;
@@ -0,0 +1,2 @@
1
+ import {c,d,p,f,k,j,i,Je,Zg,Pe as Pe$1,Zb,Ka,_b,N,Na,ze as ze$1,w as w$1,ma,ca}from'./chunk-L6XZTLPS.js';var Gt=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],Kt=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,qt=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function ut(e){return Kt.test(e)||qt.test(e)}function oe(e,t){if(!ut(e))throw new Error(`invalid ${t??"registry"} id ${JSON.stringify(e)}: must be reverse-domain (dev.docx-editor.core.x) or package-owned (@scope/pkg#kind/name)`)}var Yt=/^(\d+)\.(\d+)\.(\d+)$/;function M(e){let t=Yt.exec(e);if(!t)throw new Error(`invalid semantic version: ${JSON.stringify(e)}`);return {major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3])}}function re(e,t){return e.major!==t.major?e.major<t.major?-1:1:e.minor!==t.minor?e.minor<t.minor?-1:1:e.patch!==t.patch?e.patch<t.patch?-1:1:0}function ie(e,t){let n=M(e),o=t.trim();if(o==="*")return true;if(o.startsWith("^")){let r=M(o.slice(1));return re(n,r)<0?false:r.major>0?n.major===r.major:r.minor>0?n.major===0&&n.minor===r.minor:n.major===0&&n.minor===0}if(o.includes(" ")){let r=o.split(/\s+/);if(r.length!==2)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let s=true;for(let i of r){let a=i.startsWith(">=")?">=":i.startsWith("<")?"<":null;if(!a)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let l=M(i.slice(a.length)),c=re(n,l);a===">="?s=s&&c>=0:s=s&&c<0;}return s}return re(n,M(o))===0}var b=class extends Error{constructor(n,o,r=[]){super(o);this.code=n;this.responsible=r;this.name="RegistryError";}code;responsible},we=(e,t)=>`${e}:${t}`;function Xt(e,t={}){let n=new Map;for(let c of e){if(oe(c.id,"extension"),ft(c.version,c.id),n.has(c.id))throw new b("duplicate-extension",`duplicate extension id ${c.id}`,[c.id]);n.set(c.id,c);for(let p of c.contributions)oe(p.id,p.kind),ft(p.version,`${c.id} \u2192 ${p.id}`),p.replaces&&Zt(p.replaces.targetRange,`${c.id} \u2192 replaces ${p.replaces.targetId}`);}for(let c of e){for(let p of c.dependencies??[])if(!n.has(p))throw new b("missing-dependency",`${c.id} requires missing extension ${p}`,[c.id,p]);for(let p of c.conflicts??[])if(n.has(p)){let h=[c.id,p].sort();throw new b("conflict",`extensions ${h[0]} and ${h[1]} conflict`,h)}}Qt(n);let o=new Set(t.availablePorts??[]);for(let c of e)for(let p of c.contributions)p.kind==="runtimePort"&&o.add(p.id);for(let c of e)for(let p of c.requiredPorts??[])if(!o.has(p))throw new b("missing-port",`${c.id} requires unavailable port ${p}`,[c.id,p]);let r=new Map,s=new Map,i=new Map;for(let c of e)for(let p of c.contributions){let h=we(p.kind,p.id);if(p.replaces){let x=we(p.kind,p.replaces.targetId),R=i.get(x)??[];R.push({ext:c.id,c:p}),i.set(x,R);continue}if(s.has(h)){let x=[r.get(h),c.id].sort();throw new b("id-collision",`${p.kind} id ${p.id} registered by both ${x[0]} and ${x[1]}`,x)}s.set(h,p),r.set(h,c.id);}let a=new Map(s);for(let[c,p]of i){let h=s.get(c);if(!h){let v=p[0];throw new b("replacement-target-missing",`${v.ext} replaces missing target ${v.c.replaces.targetId}`,[v.ext,v.c.replaces.targetId])}let x=h.replaceable??{kind:"none"};for(let{ext:v,c:k}of p){if(!ie(h.version,k.replaces.targetRange))throw new b("replacement-version-mismatch",`${v} replaces ${k.replaces.targetId}@${h.version} outside range ${k.replaces.targetRange}`,[v,k.replaces.targetId]);if(x.kind==="none")throw new b("unauthorized-replacement",`${k.replaces.targetId} does not authorize replacement (attempted by ${v})`,[v,k.replaces.targetId])}let R=Jt(h,p);a.set(c,R);}return {extensions:n,contributions:a,get:(c,p)=>a.get(we(c,p))}}function Jt(e,t){let n=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(n.kind==="priority"){let r=[...t].sort((a,l)=>(l.c.replaces.priority??0)-(a.c.replaces.priority??0)),s=r[0].c.replaces.priority??0,i=r.filter(a=>(a.c.replaces.priority??0)===s);if(i.length>1){let a=i.map(l=>l.ext).sort();throw new b("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${s}: ${a.join(", ")}`,a)}return r[0].c}let o=t.map(r=>r.ext).sort();throw new b("ambiguous-replacement",`multiple replacers of ${e.id}: ${o.join(", ")}`,o)}function Qt(e){let r=new Map,s=[],i=a=>{r.set(a,1),s.push(a);let l=[...e.get(a)?.dependencies??[]].sort();for(let c of l){let p=r.get(c)??0;if(p===1){let h=s.indexOf(c),x=[...s.slice(h),c];throw new b("dependency-cycle",`dependency cycle: ${x.join(" -> ")}`,x)}p===0&&i(c);}s.pop(),r.set(a,2);};for(let a of [...e.keys()].sort())(r.get(a)??0)===0&&i(a);}function ft(e,t){try{M(e);}catch{throw new b("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function Zt(e,t){try{ie("0.0.0",e);}catch{throw new b("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var L=class extends Error{constructor(t){super(t),this.name="BudgetError";}},K=class e{constructor(t,n){this.label=t;this.capacity=n;this.used=new p(`${t}.budget`,n);}label;capacity;used;children=new Set;activeReservations=0;cleanups=[];disposed=false;carveAmount=0;parent;get inUse(){return this.used.current}get available(){return this.used.remaining}get isDisposed(){return this.disposed}reserve(t){this.assertLive(),this.used.add(t),this.activeReservations+=1;let n=false,o=this;return {amount:t,get released(){return n},release(){n||(n=true,o.used.release(t),o.activeReservations-=1);}}}child(t,n){this.assertLive(),this.used.add(n);let o=new e(t,n);return o.parent=this,o.carveAmount=n,this.children.add(o),o}onRelease(t){this.assertLive(),this.cleanups.push(t);}dispose(){if(this.disposed)return;if(this.children.size>0)throw new L(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new L(`${this.label}: cannot release with ${this.activeReservations} reservation(s) outstanding`);let t=[];for(let n=this.cleanups.length-1;n>=0;n--)try{this.cleanups[n]();}catch(o){t.push(o);}if(this.disposed=true,this.parent&&(this.parent.children.delete(this),this.parent.used.release(this.carveAmount),this.parent=void 0),t.length>0)throw new L(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new L(`${this.label}: budget already released`)}};var ae=class extends Error{constructor(n,o){super(o?`cancelled: ${o}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},q=class{_cancelled=false;_phase="pre-publication";_reason;cancel(t){this._cancelled=true,t!==void 0&&(this._reason=t);}markPublished(){this._phase="post-publication";}get isCancelled(){return this._cancelled}get phase(){return this._phase}get isPublished(){return this._phase==="post-publication"}get derivedOnly(){return this._cancelled&&this._phase==="post-publication"}get token(){let t=this;return {get isCancelled(){return t._cancelled},get phase(){return t._phase},get derivedOnly(){return t.derivedOnly},checkpoint(){if(t._cancelled)throw new ae(t.derivedOnly,t._reason)}}}};var se=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},ke=class{ports=new Map;provide(t,n){return this.ports.set(t,n),this}has(t){return this.ports.has(t)}resolve(t){if(!this.ports.has(t))throw new se(t);return this.ports.get(t)}missing(t){return t.filter(n=>!this.ports.has(n))}availablePorts(){return [...this.ports.keys()]}clock(){return this.resolve(f.clock)}identity(){return this.resolve(f.identity)}},Ne=class{constructor(t=0,n=1){this.step=n;this.t=t;}step;t;now(){let t=this.t;return this.t+=this.step,t}},Te=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function en(e){let t=k(e.limits),n=Object.freeze({...e.config??{}}),o=e.capacity??t.maxDecompressedBytes,r=e.id??"op",s={id:r,limits:t,config:n,ports:e.ports,budget:new K(`op:${r}`,o),cancellation:new q};return Object.freeze(s)}function tn(e){e.budget.dispose();}var _e=Object.freeze({maxRecursionDepth:{unit:"depth",phase:"xml-parse"},maxElementCount:{unit:"count",phase:"xml-parse"},maxPartCount:{unit:"count",phase:"package-read"},maxDecompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressionRatio:{unit:"ratio",phase:"package-read"},maxChunkBytes:{unit:"bytes",phase:"package-read"},maxPaginationPasses:{unit:"passes",phase:"layout"},maxQueueDepth:{unit:"count",phase:"output"}}),yt=Object.keys(_e);function nn(e,t){return new p(`${_e[t].phase}:${t}`,e[t])}var Pe=class{counter;current=0;peak=0;constructor(t){this.counter=new p("memory",t);}allocate(t){this.counter.add(t),this.current+=t,this.current>this.peak&&(this.peak=this.current);}free(t){this.counter.release(t),this.current=Math.max(0,this.current-t);}get currentBytes(){return this.current}get peakBytes(){return this.peak}reset(){this.counter.release(this.current),this.current=0;}};function on(){for(let e of yt){let t=j[e],n=i[e];if(!Number.isFinite(t)||t<=0)throw new Error(`default ${e} must be finite > 0`);if(!Number.isFinite(n)||n<=0)throw new Error(`ceiling ${e} must be finite > 0`);if(t>n)throw new Error(`default ${e} exceeds ceiling`)}}function Y(e,t=new Set){let n=new WeakSet,o=r=>{if(r===null)return "null";let s=typeof r;if(s==="boolean")return r?"true":"false";if(s==="number"){let i=r;if(!Number.isFinite(i))throw new Error(`non-finite number is not comparable: ${i}`);return Object.is(i,-0)?"0":String(i)}if(s==="string")return JSON.stringify(r);if(s==="bigint")return `${r.toString()}n`;if(Array.isArray(r))return `[${r.map(o).join(",")}]`;if(s==="object"){let i=r;if(n.has(i))throw new Error("cannot canonicalize a cyclic structure");n.add(i);let l=Object.keys(i).filter(c=>!t.has(c)).sort().map(c=>`${JSON.stringify(c)}:${o(i[c])}`).join(",");return n.delete(i),`{${l}}`}throw new Error(`unsupported value type in comparator input: ${s}`)};return o(e)}function Ae(e,t){let n=Y(e,t),o=0xcbf29ce484222325n,r=0x100000001b3n,s=0xffffffffffffffffn;for(let i=0;i<n.length;i++)o^=BigInt(n.charCodeAt(i)),o=o*r&s;return o.toString(16).padStart(16,"0")}var w="dev.docx-editor.core.comparator",$e={authoredState:{id:`${w}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${w}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${w}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${w}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${w}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${w}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${w}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${w}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${w}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${w}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function Me(e,t,n,o={}){let r=$e[e];switch(r.mode){case "sync-optimization-only":throw new Error(`${r.id} is not an equivalence basis (${r.note})`);case "tolerance":{if(o.epsilon===void 0)throw new Error(`${r.id} requires an explicit epsilon`);return {equal:ht(t,n,o.epsilon)}}case "exact":case "canonical-exact":{let s=r.mode==="canonical-exact"?new Set(r.ephemera):new Set,i=Y(t,s),a=Y(n,s);return i===a?{equal:true}:{equal:false,left:i,right:a}}}}function Le(e,t){let n=$e[e];if(n.mode==="tolerance"||n.mode==="sync-optimization-only")throw new Error(`${n.id} has no canonical fingerprint (${n.mode})`);let o=n.mode==="canonical-exact"?new Set(n.ephemera):void 0;return Ae(t,o)}function ht(e,t,n){return typeof e=="number"&&typeof t=="number"?Number.isFinite(e)&&Number.isFinite(t)&&Math.abs(e-t)<=n:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((o,r)=>ht(o,t[r],n)):false}var xt=new Set([...c,...d]),gt=/^[0-9a-f]{16}$/,rn=/^[0-9a-f]*$/;function Fe(e){let t=[],n=r=>t.push(r);e.formatVersion!==1&&n(`unsupported formatVersion ${e.formatVersion}`),e.documentId||n("documentId is required"),e.source.kind==="docx"&&!/^[0-9a-f]{64}$/.test(e.source.sha256)&&n("docx source requires a 64-hex sha256");let o=-1;e.steps.forEach((r,s)=>{let i=`step[${s}]`;xt.has(r.origin)||n(`${i}: unknown origin ${r.origin}`),(!Number.isInteger(r.baseRevision)||r.baseRevision<0)&&n(`${i}: baseRevision must be a non-negative integer`),r.baseRevision<o&&n(`${i}: baseRevision regressed below ${o}`);let a=r.expect;a.outcome==="applied"?(a.committedRevision===void 0?n(`${i}: applied step needs committedRevision`):a.committedRevision<=r.baseRevision?n(`${i}: committedRevision ${a.committedRevision} must exceed baseRevision ${r.baseRevision}`):o=a.committedRevision,a.modelChange&&an(a.modelChange,i,n)):(a.committedRevision!==void 0&&n(`${i}: ${a.outcome} step must not commit a revision`),a.authoredStateHash!==void 0&&n(`${i}: ${a.outcome} step must not change authored state`)),a.authoredStateHash!==void 0&&!gt.test(a.authoredStateHash)&&n(`${i}: authoredStateHash must be 16-hex`),a.outputHash!==void 0&&!gt.test(a.outputHash)&&n(`${i}: outputHash must be 16-hex`);});for(let r of [...e.snapshots??[],...e.updates??[]])r.documentId!==e.documentId&&n(`envelope documentId ${r.documentId} != ${e.documentId}`),rn.test(r.bytesHex)||n("envelope bytesHex must be hex"),r.bytesHex.length!==r.byteLength*2&&n(`envelope byteLength ${r.byteLength} disagrees with ${r.bytesHex.length/2} decoded bytes`);return {valid:t.length===0,errors:t}}function an(e,t,n){xt.has(e.origin)||n(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&n(`${t}: modelChange revision must advance`);}function sn(e,t){let n=Fe(e);if(!n.valid)return {ok:false,mismatches:n.errors};let o=[];return t.init(e),e.steps.forEach((r,s)=>{let i=`step[${s}]`,a=t.applyStep(r),l=r.expect;if(a.outcome!==l.outcome){o.push(`${i}: outcome ${a.outcome} != expected ${l.outcome}`);return}if(l.outcome==="applied"&&(a.committedRevision!==l.committedRevision&&o.push(`${i}: revision ${a.committedRevision} != expected ${l.committedRevision}`),l.authoredStateHash!==void 0))if(a.authoredState===void 0)o.push(`${i}: store returned no authored state to hash`);else {Me("authoredState",a.authoredState,a.authoredState).equal||o.push(`${i}: authored state is not self-consistent`);let p=Rt(a.authoredState);p!==l.authoredStateHash&&o.push(`${i}: authoredStateHash ${p} != expected ${l.authoredStateHash}`);}}),{ok:o.length===0,mismatches:o}}function Rt(e){return Le("authoredState",e)}var F="http://schemas.openxmlformats.org/officeDocument/2006/relationships",ln="http://schemas.openxmlformats.org/package/2006/relationships",cn="http://schemas.openxmlformats.org/drawingml/2006/main",Et="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",vt="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",St="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",It="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",Ct="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",wt="application/vnd.openxmlformats-package.relationships+xml",De=`${F}/styles`,Be=`${F}/numbering`,kt=`${F}/footnotes`,Nt=`${F}/endnotes`,Tt=`${F}/officeDocument`,dn=`${F}/theme`;function I(e){return e.kind!=="textValue"}function Ot(e,t){return {...e,children:t}}function P(e,t){if(t(e),e.kind!=="textValue")for(let n of e.children)P(n,t);}var pn=new Set(["pStyle","rStyle","tblStyle"]);function Ue(e,t){for(let n of e)P(n,o=>{if(o.kind!=="textValue"&&pn.has(o.localName)&&o.namespaceUri===ca){let r=ze$1(o,"val");r&&t.add(r);}});}function Ve(e,t){for(let n of e)P(n,o=>{if(o.kind!=="textValue"&&o.localName==="numId"&&o.namespaceUri===ca){let r=ze$1(o,"val");r&&t.add(r);}});}function ce(e,t){for(let n of e)P(n,o=>{if(o.kind!=="textValue")for(let r of o.attributes)r.namespaceUri===F&&r.value.length>0&&t.add(r.value);});}function je(e,t){let n=new Set;for(let o of e)P(o,r=>{if(r.kind!=="textValue"&&r.kind==="noteReference"&&r.localName===t){let s=ze$1(r,"id");s!==void 0&&n.add(s);}});return n}function mn(e,t){for(let n of Zb(e,t)){if(n.type!==De||n.targetMode==="External")continue;let o=w$1(n.ownerPart,n.rawTarget);if(o.ok)return e.parts.get(o.partName)??null}return e.parts.get("/word/styles.xml")??null}function Pt(e,t,n){for(let o of Zb(e,t)){if(o.type!==n||o.targetMode==="External")continue;let r=w$1(o.ownerPart,o.rawTarget);if(r.ok)return e.parts.get(r.partName)??null}return null}function _t(e,t){let n=mn(e,t),o=new Map,r=[],s=null;if(n&&I(n.root))for(let i of n.root.children){if(!I(i))continue;if(i.localName==="docDefaults"&&i.namespaceUri===ca){s=i;continue}if(i.localName!=="style"||i.namespaceUri!==ca)continue;let a=ze$1(i,"styleId");a&&o.set(a,i),(ze$1(i,"default")==="1"||ze$1(i,"default")==="true")&&r.push(i);}return {part:n,byId:o,defaults:r,docDefaults:s}}var un=new Set(["basedOn","link","next"]);function ze(e,t){let n=new Set,o=[...t];for(let i of e.defaults){let a=ze$1(i,"styleId");a&&o.push(a);}let r=[];for(;o.length>0;){let i=o.pop();if(n.has(i))continue;n.add(i);let a=e.byId.get(i);if(a){r.push(a);for(let l of a.children)if(I(l)&&un.has(l.localName)&&l.namespaceUri===ca){let c=ze$1(l,"val");c&&o.push(c);}}}if(!e.part||!I(e.part.root))return r;let s=new Map;return e.part.root.children.forEach((i,a)=>s.set(i,a)),r.sort((i,a)=>(s.get(i)??0)-(s.get(a)??0))}function At(e,t,n){let o=Pt(e,t,Be)??e.parts.get("/word/numbering.xml")??null;if(!o||!I(o.root)||n.size===0)return {part:o,nums:[],abstracts:[]};let r=[],s=new Set;for(let a of o.root.children){if(!I(a)||a.localName!=="num"||a.namespaceUri!==ca)continue;let l=ze$1(a,"numId");if(!(!l||!n.has(l))){r.push(a);for(let c of a.children)if(I(c)&&c.localName==="abstractNumId"){let p=ze$1(c,"val");p&&s.add(p);}}}let i=[];for(let a of o.root.children){if(!I(a)||a.localName!=="abstractNum"||a.namespaceUri!==ca)continue;let l=ze$1(a,"abstractNumId");l&&s.has(l)&&i.push(a);}return {part:o,nums:r,abstracts:i}}var le={latin:null,eastAsia:null,cs:null};function $t(e,t){let n=Pt(e,t,dn);if(!n)return {major:le,minor:le};let o={major:{...le},minor:{...le}};return P(n.root,r=>{if(r.kind==="textValue"||r.namespaceUri!==cn||r.localName!=="majorFont"&&r.localName!=="minorFont")return;let s=r.localName==="majorFont"?o.major:o.minor;for(let i of r.children){if(!I(i))continue;let a=ze$1(i,"typeface");a&&(i.localName==="latin"?s.latin=a:i.localName==="ea"?s.eastAsia=a:i.localName==="cs"&&(s.cs=a));}}),{major:o.major,minor:o.minor}}function fn(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 yn=[["asciiTheme","ascii"],["hAnsiTheme","hAnsi"],["eastAsiaTheme","eastAsia"],["cstheme","cs"]],bt=new Set(["themeColor","themeTint","themeShade","themeFill","themeFillTint","themeFillShade"]);function _(e,t){if(e.kind==="textValue")return e;let n=e.attributes;if(e.localName==="rFonts"&&e.namespaceUri===ca){let s=[],i=new Map;for(let a of e.attributes){let l=yn.find(([c])=>c===a.localName);if(l&&a.namespaceUri===ca){let c=fn(t,a.value);c&&i.set(l[1],c);continue}s.push(a);}for(let[a,l]of i)s.some(c=>c.localName===a)||s.push({kind:"genericExtension",namespaceUri:ca,localName:a,prefix:"w",value:l});n=s;}else e.attributes.some(s=>bt.has(s.localName)&&s.namespaceUri===ca&&e.attributes.some(i=>i.localName==="val"))&&(n=e.attributes.filter(s=>!(bt.has(s.localName)&&s.namespaceUri===ca)));let o=e.children.map(s=>_(s,t)),r=o.some((s,i)=>s!==e.children[i]);return n===e.attributes&&!r?e:{...e,attributes:n,children:o}}function Mt(e,t,n){return {id:e,name:e,contentType:t,root:n}}function Lt(e,t){if(e.root.kind==="document"){let o=e.root.children.find(s=>s.kind==="body"),r=o&&I(o)?Ot(o,t):{id:"fragment#body",kind:"body",namespaceUri:ca,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return Ot(e.root,[r])}let n={id:"fragment#body",kind:"body",namespaceUri:ca,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return {id:"fragment#document",kind:"document",namespaceUri:ca,localName:"document",prefix:"w",namespaceBindings:I(e.root)?e.root.namespaceBindings:[],attributes:[],children:[n]}}function X(e){let t=e.map(n=>{let o=n.targetMode==="External"?' TargetMode="External"':"";return `<Relationship Id="${N(n.id)}" Type="${N(n.type)}" Target="${N(n.rawTarget)}"${o}/>`}).join("");return `<Relationships xmlns="${ln}">${t}</Relationships>`}function Ft(e,t){let n=t;for(;e.has(`rId${n}`);)n+=1;return `rId${n}`}function Dt(e){let t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}var hn="http://schemas.openxmlformats.org/package/2006/content-types",gn=5e4;function A(e){return e.kind!=="textValue"}function z(e,t=[]){if(e.kind==="textValue")return t;e.kind==="paragraph"&&t.push(e.id);for(let n of e.children)z(n,t);return t}function de(e,t){if(e.kind==="textValue")return null;if(e.kind==="paragraph"&&e.id===t)return e;for(let n of e.children){let o=de(n,t);if(o)return o}return null}function S(e,t){return {...e,children:t}}function H(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===ca}function xn(e){if(e.root.kind==="document"){let t=e.root.children.find(n=>n.kind==="body");return t&&A(t)?t:null}return A(e.root)?e.root:null}function Rn(e,t){return z(e).some(n=>t.has(n))}function On(e){let t=o=>{if(o.kind==="textValue")return o;if(H(o,"vMerge")){if(ze$1(o,"val")==="restart")return o;let r=[...o.attributes.filter(s=>!(s.localName==="val"&&s.namespaceUri===ca)),{kind:"wmlVal",namespaceUri:ca,localName:"val",prefix:"w",value:"restart"}];return {...o,attributes:r}}if(H(o,"tc")||H(o,"tcPr")){let r=o.children.map(t);return S(o,r)}return o},n=e.children.map(t);return S(e,n)}function bn(e,t,n){let o=e.children.filter(l=>l.kind!=="textValue"&&H(l,"tr")),r=new Set(z(e).filter(l=>t.inRange.has(l)));if(r.size===0)return;let s=o.filter(l=>{let c=z(l);return c.length>0&&c.every(p=>t.covered.has(p))}),i=new Set(s.flatMap(l=>z(l)));if(s.length>0&&r.size===i.size&&[...r].every(l=>i.has(l))){let l=true,c=[];for(let p of e.children){if(!H(p,"tr")){c.push(p);continue}s.includes(p)&&(c.push(l?On(p):p),l=false);}n.push(S(e,c));return}for(let l of z(e)){if(!t.inRange.has(l))continue;let c=de(e,l);c&&n.push(c);}}function He(e,t,n){for(let o of e)if(A(o)){if(o.kind==="paragraph"){t.inRange.has(o.id)&&n.push(o);continue}if(t.fullBlocks.has(o.id)){n.push(o);continue}if(o.kind==="table"){bn(o,t,n);continue}if(o.kind==="contentControl"){let r=o.children.find(s=>s.kind==="contentControlContent");r&&A(r)&&He(r.children,t,n);continue}Rn(o,t.inRange)&&He(o.children,t,n);}}var En=new Set(["commentRangeStart","commentRangeEnd"]);function vn(e){return e.kind==="run"&&e.children.some(t=>t.kind==="commentReference")}function We(e){if(e.kind==="textValue")return e;if(En.has(e.localName)&&e.namespaceUri===ca||vn(e)||H(e,"sectPr"))return null;let t=false,n=[];for(let o of e.children){let r=We(o);if(r===null){t=true;continue}r!==o&&(t=true),n.push(r);}return t?S(e,n):e}function Sn(e){if(e.kind!=="run")return null;for(let t of e.children)if(t.kind==="fldChar"){let n=ze$1(t,"fldCharType");return n==="begin"||n==="separate"||n==="end"?n:"begin"}return null}function In(e){return e.kind==="run"&&e.children.some(t=>t.kind==="instrText")}function Cn(e){let t=[],n=l=>{if(l.kind!=="textValue"){if(l.kind==="run"){let c=Sn(l);c?t.push({nodeId:l.id,type:c}):In(l)&&t.push({nodeId:l.id,type:"instr"});return}for(let c of l.children)n(c);}};for(let l of e)n(l);if(t.length===0)return e;let o=new Set,r=[],s=null,i=[];for(let l of t){if(l.type==="begin"){r.push({beginId:l.nodeId,separateId:null,instrIds:[]});continue}if(l.type==="separate"){let p=r[r.length-1];p?p.separateId=l.nodeId:s=l.nodeId;continue}if(l.type==="instr"){let p=r[r.length-1];p?p.instrIds.push(l.nodeId):s===null&&i.push(l.nodeId);continue}if(!r.pop()){o.add(l.nodeId),s!==null&&o.add(s);for(let p of i)o.add(p);s=null,i=[];}}for(let l of r){o.add(l.beginId),l.separateId!==null&&o.add(l.separateId);for(let c of l.instrIds)o.add(c);}s!==null&&o.add(s);for(let l of i)o.add(l);if(o.size===0)return e;let a=l=>{if(l.kind==="textValue")return l;if(o.has(l.id))return null;let c=[],p=false;for(let h of l.children){let x=a(h);if(x===null){p=true;continue}x!==h&&(p=true),c.push(x);}return p?S(l,c):l};return e.map(l=>a(l)).filter(l=>l!==null)}function Ge(e){if(e.kind==="textValue")return e.value.length;let t=0;for(let n of e.children)t+=Ge(n);return t}function wn(e,t){let n=[];for(let o of e.children){if(o.kind!=="contentControl"){n.push(o);continue}let r=t.get(o.id),s=Ge(o);if(r===void 0||s>=r){n.push(o);continue}if(s===0)continue;let i=o.children.find(a=>a.kind==="contentControlContent");i&&A(i)?n.push(...i.children):n.push(o);}return S(e,n)}function kn(e){let t=new Set,n=new Set,o=i=>{if(i.kind!=="textValue"){if(i.kind==="bookmarkStart"){let a=ze$1(i,"id");a!==void 0&&t.add(a);}if(i.kind==="bookmarkEnd"){let a=ze$1(i,"id");a!==void 0&&n.add(a);}for(let a of i.children)o(a);}};for(let i of e)o(i);let r=new Set([...t].filter(i=>n.has(i)));if(r.size===t.size&&r.size===n.size)return e;let s=i=>{if(i.kind==="textValue")return i;if(i.kind==="bookmarkStart"||i.kind==="bookmarkEnd"){let c=ze$1(i,"id");return c!==void 0&&r.has(c)?i:null}let a=[],l=false;for(let c of i.children){let p=s(c);if(p===null){l=true;continue}p!==c&&(l=true),a.push(p);}return l?S(i,a):i};return e.map(i=>s(i)??i)}function Nn(e,t,n){let o=e.parts.get(t.partName);if(!o)return {ok:false,reason:"unknown-part"};if(t.paragraphIds.length===0)return {ok:false,reason:"empty-range"};let r=t.paragraphIds[0],s=t.paragraphIds[t.paragraphIds.length-1],i=new Map;for(let d of [r,s]){let m=de(o.root,d);if(!m)return {ok:false,reason:"empty-range"};for(let u of m.children)u.kind==="contentControl"&&i.set(u.id,Ge(u));}let a=o,l=de(a.root,s);if(!l)return {ok:false,reason:"empty-range"};let c=Je(l);if(t.endOffset<c){let d=Zg(a,{op:"deleteText",paragraphId:s,start:t.endOffset,end:c},{deferValidation:true});if(!d.ok)return {ok:false,reason:"trim-refused"};a=d.part;}if(t.startOffset>0){let d=Zg(a,{op:"deleteText",paragraphId:r,start:0,end:t.startOffset},{deferValidation:true});if(!d.ok)return {ok:false,reason:"trim-refused"};a=d.part;}let p=xn(a);if(!p)return {ok:false,reason:"unknown-part"};let h={inRange:new Set(t.paragraphIds),covered:new Set(t.coveredParagraphIds),fullBlocks:new Set(t.fullyCoveredBlockIds)},x=[];if(He(p.children,h,x),x.length===0)return {ok:false,reason:"empty-range"};if(x.length>gn)return {ok:false,reason:"resource-limit"};let R=x.map(d=>We(d)).filter(d=>d!==null).map(d=>d.kind!=="paragraph"||d.id!==r&&d.id!==s?d:wn(d,i));R=[...Cn(R)],R=[...kn(R)];let v=je(R,"footnoteReference"),k=je(R,"endnoteReference"),J=v.size>0?Pe$1(e,"footnote"):null,Q=k.size>0?Pe$1(e,"endnote"):null,Ke=(d,m)=>{if(!d||!A(d.root))return [];let u=[];for(let O of d.root.children){if(!A(O)||O.kind!=="note")continue;let E=ze$1(O,"id"),g=ze$1(O,"type");if(g==="separator"||g==="continuationSeparator"){u.push(O);continue}if(E!==void 0&&m.has(E)){let U=We(O);U&&A(U)&&u.push(U);}}return u},qe=Ke(J,v),Ye=Ke(Q,k),Bt=[...qe,...Ye],Xe=[...R,...Bt],Je$1=new Set;Ue(Xe,Je$1);let D=_t(e,e.mainDocumentPart),pe=ze(D,Je$1),me=new Set;Ve(Xe,me),Ve(pe,me);let C=At(e,e.mainDocumentPart,me),ue=new Set;Ue([...C.nums,...C.abstracts],ue);for(let d of [...C.nums,...C.abstracts])P(d,m=>{if(m.kind!=="textValue"&&(m.localName==="styleLink"||m.localName==="numStyleLink")&&m.namespaceUri===ca){let u=ze$1(m,"val");u&&ue.add(u);}});let Ut=ze(D,ue).filter(d=>!pe.includes(d)),Vt=[...pe,...Ut],B=$t(e,e.mainDocumentPart),Qe=Vt.map(d=>_(d,B)),fe=D.docDefaults?_(D.docDefaults,B):null;R=R.map(d=>_(d,B));let ye=qe.map(d=>_(d,B)),he=Ye.map(d=>_(d,B)),Ze=new Set;ce(R,Ze);let et=Zb(e,o.name).filter(d=>Ze.has(d.id)),tt=new Map,nt=0,ot=d=>{let m=new Set;for(let u of d){if(u.targetMode==="External")continue;let O=w$1(u.ownerPart,u.rawTarget);if(!O.ok){m.add(u.id);continue}if((_b(e,O.partName)??"").toLowerCase().startsWith("image/")&&n?.omitMedia!==true){let g=e.partBytes.get(O.partName)??e.partBytes.get(O.partName.replace(/^\//,""));g?(tt.set(O.partName,g),nt+=g.byteLength):m.add(u.id);continue}m.add(u.id);}return m},ge=ot(et),xe=(d,m)=>{if(d.kind==="textValue")return d;if(d.kind==="drawing"){let E=new Set;ce([d],E);for(let g of E)if(m.has(g))return null;return d}let u=[],O=false;for(let E of d.children){let g=xe(E,m);if(g===null){O=true;continue}g!==E&&(O=true),u.push(g);}return O?S(d,u):d};ge.size>0&&(R=R.map(d=>xe(d,ge)).filter(d=>d!==null));let jt=et.filter(d=>!ge.has(d.id)),rt=(d,m)=>{if(!d)return [];let u=new Set;ce(m,u);let O=Zb(e,d.name).filter(g=>u.has(g.id)),E=ot(O);if(E.size>0)for(let g=0;g<m.length;g+=1){let U=xe(m[g],E);U!==null&&(m[g]=U);}return O.filter(g=>!E.has(g.id))},it=rt(J,ye),at=rt(Q,he),T=new Map,st=[],W=(d,m,u)=>{T.set(d.slice(1),Ka(ma(Mt(d,m,u)))),st.push([d,m]);},Z=[...jt],lt=new Set(Z.map(d=>d.id)),ct=9001,ee=(d,m)=>{let u=Ft(lt,ct);ct+=1,lt.add(u),Z.push({ownerPart:"/word/document.xml",id:u,type:d,rawTarget:m,targetMode:"Internal",order:Z.length});},zt=Lt(a,R);if(W("/word/document.xml",Et,zt),D.part&&(Qe.length>0||fe)){let d=S(D.part.root,[...fe?[fe]:[],...Qe]);W("/word/styles.xml",vt,d),ee(De,"styles.xml");}if(C.part&&(C.nums.length>0||C.abstracts.length>0)){let d=S(C.part.root,[...C.abstracts.map(m=>_(m,B)),...C.nums]);W("/word/numbering.xml",St,d),ee(Be,"numbering.xml");}J&&ye.length>0&&(W("/word/footnotes.xml",It,S(J.root,ye)),ee(kt,"footnotes.xml"),it.length>0&&T.set("word/_rels/footnotes.xml.rels",Ka(X(it)))),Q&&he.length>0&&(W("/word/endnotes.xml",Ct,S(Q.root,he)),ee(Nt,"endnotes.xml"),at.length>0&&T.set("word/_rels/endnotes.xml.rels",Ka(X(at))));let Re=new Map;for(let[d,m]of tt){T.set(d.slice(1),m);let u=Dt(d);u&&!Re.has(u)&&Re.set(u,_b(e,d)??"application/octet-stream");}T.set("word/_rels/document.xml.rels",Ka(X(Z))),T.set("_rels/.rels",Ka(X([{ownerPart:"/",id:"rId1",type:Tt,rawTarget:"word/document.xml",targetMode:"Internal",order:0}])));let Ht=[`<Default Extension="rels" ContentType="${wt}"/>`,'<Default Extension="xml" ContentType="application/xml"/>',...[...Re].map(([d,m])=>`<Default Extension="${N(d)}" ContentType="${N(m)}"/>`)].join(""),Wt=st.map(([d,m])=>`<Override PartName="${N(d)}" ContentType="${N(m)}"/>`).join("");return T.set("[Content_Types].xml",Ka(`<Types xmlns="${hn}">${Ht}${Wt}</Types>`)),{ok:true,bytes:Na(T),lastMarkCovered:t.lastMarkCovered,blockCount:R.length,mediaBytes:nt}}
2
+ export{Me as A,Le as B,Fe as C,sn as D,Rt as E,Nn as F,Gt as a,ut as b,oe as c,M as d,re as e,ie as f,b as g,Xt as h,L as i,K as j,ae as k,q as l,se as m,ke as n,Ne as o,Te as p,en as q,tn as r,_e as s,yt as t,nn as u,Pe as v,on as w,Y as x,Ae as y,$e as z};
@@ -0,0 +1 @@
1
+ import {Mf,Ca,Ha,Xb,Wb,va,ua,_g,ca,wa,Bb,vb,ub,da}from'./chunk-L6XZTLPS.js';var W=new Set(["document","hdr","ftr","footnotes","endnotes"]),$=24,U=512,E=Mf($);function z(o){let a=o.root;return a.namespaceUri===ca&&W.has(a.localName)}function Y(o){let a=[],r=e=>{if(e.kind!=="textValue"){e.namespaceUri===ca&&e.localName==="p"&&a.push(e);for(let i of e.children)r(i);}};return r(o.root),a}function V(o){let a=Bb(o);let r=[],e=new Set;for(let i of Y(a)){let n=vb(i);if(!n||!ub(n))continue;let t=n.toUpperCase();if(e.has(t))continue;e.add(t);let s=_g(a,i.id);s!==null&&r.push(Object.freeze({paragraphId:t,nodeId:i.id,text:s}));}return Object.freeze(r)}function G(o){let a=E.get(o.root);if(a)return a;let r=Bb(o);let e=new Map,i=new Set,n=t=>{if(t.kind!=="textValue"){if(t.namespaceUri===ca&&t.localName==="p"){let s=vb(t);if(s&&ub(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),t.kind==="paragraph"&&e.set(p,t.id));}}for(let s of t.children)n(s);}};return n(r.root),E.set(o.root,e),e}function w(o,a){if(o.length!==a.length)return false;for(let r=0;r<o.length;r+=1)if(o[r].root!==a[r])return false;return true}function B(o){let a=new Map,r=null,e=(n,t,s)=>{for(a.delete(n),a.set(n,{partName:t.name,root:t.root,nodeId:s});a.size>U;){let p=a.keys().next();if(p.done)break;a.delete(p.value);}},i=(n,t)=>{let s=a.get(n);if(!s)return null;let p=t.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=Ca(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=vb(l);return !d||d.toUpperCase()!==n?null:(e(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let t=o(),s=i(n,t);if(s)return s;if(r&&r.ids.has(n)&&w(t,r.roots))return null;for(let p of t){let l=G(p).get(n);if(l!==void 0)return e(n,p,l),{part:p,nodeId:l}}return (!r||!w(t,r.roots))&&(r={roots:t.map(p=>p.root),ids:new Set}),r.ids.size<U&&r.ids.add(n),null}}function H(o,a){return wa(o,a)}var Z=Object.freeze({kind:"body"}),q=1e6;function b(o,a){if(a<=0||a>=o.length)return false;let r=o.charCodeAt(a-1),e=o.charCodeAt(a);return r>=55296&&r<=56319&&e>=56320&&e<=57343}function F(o,a,r){if(a===r)return [];let e=0,i=Math.min(a.length,r.length);for(;e<i&&a.charCodeAt(e)===r.charCodeAt(e);)e+=1;for(;e>0&&(b(a,e)||b(r,e));)e-=1;let n=0;for(;n<a.length-e&&n<r.length-e&&a.charCodeAt(a.length-n-1)===r.charCodeAt(r.length-n-1);)n+=1;for(;n>0&&(b(a,a.length-n)||b(r,r.length-n));)n-=1;let t=a.length-e-n,s=r.slice(e,r.length-n),p=[];return t>0&&p.push({op:"deleteText",paragraphId:o,start:e,end:e+t}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:e,text:s}),Object.freeze(p)}function Q(o){let a=e=>!!e&&e.kind!=="textValue"&&e.namespaceUri===ca&&e.localName==="t"&&e.attributes.every(i=>i.namespaceUri===da&&i.localName==="space")&&e.children.every(i=>i.kind==="textValue"),r=[];for(let e of o){let i=r.at(-1);if(!a(i)||!a(e)){r.push(e);continue}let n=i.children.map(t=>t.kind==="textValue"?t.value:"").join("")+e.children.map(t=>t.kind==="textValue"?t.value:"").join("");r[r.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:da,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return r}function L(o){if(o.kind==="textValue")return o;let a=false,r=o.children.map(e=>{let i=L(e);return i!==e&&(a=true),i});if(o.namespaceUri===ca&&o.localName==="r"){let e=Q(r);(e.length!==r.length||e.some((i,n)=>i!==r[n]))&&(r=[...e],a=true);}return a?{...o,children:r}:o}function K(o,a,r){let e=o.parts.get(a);if(!e)return o;let i=false,n=new Set;for(let t of r)(t.op==="insertText"||t.op==="deleteText")&&!t.revision&&n.add(t.paragraphId);for(let t of n){let s=Ca(e,t);if(!s||s.kind==="textValue")continue;let p=L(s);if(p===s)continue;let l=Ha(e,t,p,{deferValidation:true});l.ok&&(e=l.part,i=true);}return i?Xb(o,e):o}function ee(o,a){let r=a.documentId.trim();if(r.length===0||r.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let e=()=>V(o.bodyStore().part),i,t=B(()=>{let l=o.bodyStore().part,d=o.currentPackage();if(i?.pkg===d&&i.body===l)return i.parts;let c=[l];for(let g of d.parts.values())g===l||!z(g)||c.push(g);return i={pkg:d,body:l,parts:Object.freeze(c)},i.parts}),s=(l,d)=>{if(l.length===0)return {ok:true,changed:false};let c=e(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>q)return {ok:false,reason:"collaboration-text-limit"};if(typeof u.paragraphId!="string"||u.paragraphId.length===0||u.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let m=u.paragraphId.toUpperCase();if(g.has(m))return {ok:false,reason:"duplicate-paragraph-id"};g.add(m);let N=c.filter(X=>X.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...F(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(Z,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>K(m,m.mainDocumentPart,h));},{origin:d.origin,actorId:d.actorId,operationId:d.operationId,recordsHistory:false});return y.ok?{ok:true,changed:y.change!==null}:{ok:false,reason:y.detail??y.reason}};return Object.freeze({documentId:r,paragraphs:e,paragraphByNodeId(l){return e().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=t(d);if(!c)return null;let g=_g(c.part,c.nodeId);return g===null?null:Object.freeze({paragraphId:d,nodeId:c.nodeId,text:g})},applyParagraphText(l,d,c){return s([{paragraphId:l,text:d}],c)},applyParagraphTexts:s,applyRemotePackage(l,d){let c=o.publishRemotePackage(l,d);return c.ok?{ok:true,changed:c.change!==null}:{ok:false,reason:c.detail??c.reason}},revision:()=>o.packageRevision,subscribe:l=>o.subscribe(l),observePrimitiveJournal:l=>H(o,l),hasPendingJournals:()=>ua(o),flushPendingJournals:()=>{va(o);},save:()=>Wb(o.currentPackage()),binaryPart(l){let d=o.currentPackage();return d.partBytes.get(l)??d.partBytes.get(l.startsWith("/")?l.slice(1):`/${l}`)??null}})}export{K as a,ee as b};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkILTZTY3K_cjs=require('./chunk-ILTZTY3K.cjs');var W=new Set(["document","hdr","ftr","footnotes","endnotes"]),$=24,U=512,E=chunkILTZTY3K_cjs.Mf($);function z(o){let a=o.root;return a.namespaceUri===chunkILTZTY3K_cjs.ca&&W.has(a.localName)}function Y(o){let a=[],r=e=>{if(e.kind!=="textValue"){e.namespaceUri===chunkILTZTY3K_cjs.ca&&e.localName==="p"&&a.push(e);for(let i of e.children)r(i);}};return r(o.root),a}function V(o){let a=chunkILTZTY3K_cjs.Bb(o);let r=[],e=new Set;for(let i of Y(a)){let n=chunkILTZTY3K_cjs.vb(i);if(!n||!chunkILTZTY3K_cjs.ub(n))continue;let t=n.toUpperCase();if(e.has(t))continue;e.add(t);let s=chunkILTZTY3K_cjs._g(a,i.id);s!==null&&r.push(Object.freeze({paragraphId:t,nodeId:i.id,text:s}));}return Object.freeze(r)}function G(o){let a=E.get(o.root);if(a)return a;let r=chunkILTZTY3K_cjs.Bb(o);let e=new Map,i=new Set,n=t=>{if(t.kind!=="textValue"){if(t.namespaceUri===chunkILTZTY3K_cjs.ca&&t.localName==="p"){let s=chunkILTZTY3K_cjs.vb(t);if(s&&chunkILTZTY3K_cjs.ub(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),t.kind==="paragraph"&&e.set(p,t.id));}}for(let s of t.children)n(s);}};return n(r.root),E.set(o.root,e),e}function w(o,a){if(o.length!==a.length)return false;for(let r=0;r<o.length;r+=1)if(o[r].root!==a[r])return false;return true}function B(o){let a=new Map,r=null,e=(n,t,s)=>{for(a.delete(n),a.set(n,{partName:t.name,root:t.root,nodeId:s});a.size>U;){let p=a.keys().next();if(p.done)break;a.delete(p.value);}},i=(n,t)=>{let s=a.get(n);if(!s)return null;let p=t.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=chunkILTZTY3K_cjs.Ca(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=chunkILTZTY3K_cjs.vb(l);return !d||d.toUpperCase()!==n?null:(e(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let t=o(),s=i(n,t);if(s)return s;if(r&&r.ids.has(n)&&w(t,r.roots))return null;for(let p of t){let l=G(p).get(n);if(l!==void 0)return e(n,p,l),{part:p,nodeId:l}}return (!r||!w(t,r.roots))&&(r={roots:t.map(p=>p.root),ids:new Set}),r.ids.size<U&&r.ids.add(n),null}}function H(o,a){return chunkILTZTY3K_cjs.wa(o,a)}var Z=Object.freeze({kind:"body"}),q=1e6;function b(o,a){if(a<=0||a>=o.length)return false;let r=o.charCodeAt(a-1),e=o.charCodeAt(a);return r>=55296&&r<=56319&&e>=56320&&e<=57343}function F(o,a,r){if(a===r)return [];let e=0,i=Math.min(a.length,r.length);for(;e<i&&a.charCodeAt(e)===r.charCodeAt(e);)e+=1;for(;e>0&&(b(a,e)||b(r,e));)e-=1;let n=0;for(;n<a.length-e&&n<r.length-e&&a.charCodeAt(a.length-n-1)===r.charCodeAt(r.length-n-1);)n+=1;for(;n>0&&(b(a,a.length-n)||b(r,r.length-n));)n-=1;let t=a.length-e-n,s=r.slice(e,r.length-n),p=[];return t>0&&p.push({op:"deleteText",paragraphId:o,start:e,end:e+t}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:e,text:s}),Object.freeze(p)}function Q(o){let a=e=>!!e&&e.kind!=="textValue"&&e.namespaceUri===chunkILTZTY3K_cjs.ca&&e.localName==="t"&&e.attributes.every(i=>i.namespaceUri===chunkILTZTY3K_cjs.da&&i.localName==="space")&&e.children.every(i=>i.kind==="textValue"),r=[];for(let e of o){let i=r.at(-1);if(!a(i)||!a(e)){r.push(e);continue}let n=i.children.map(t=>t.kind==="textValue"?t.value:"").join("")+e.children.map(t=>t.kind==="textValue"?t.value:"").join("");r[r.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:chunkILTZTY3K_cjs.da,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return r}function L(o){if(o.kind==="textValue")return o;let a=false,r=o.children.map(e=>{let i=L(e);return i!==e&&(a=true),i});if(o.namespaceUri===chunkILTZTY3K_cjs.ca&&o.localName==="r"){let e=Q(r);(e.length!==r.length||e.some((i,n)=>i!==r[n]))&&(r=[...e],a=true);}return a?{...o,children:r}:o}function K(o,a,r){let e=o.parts.get(a);if(!e)return o;let i=false,n=new Set;for(let t of r)(t.op==="insertText"||t.op==="deleteText")&&!t.revision&&n.add(t.paragraphId);for(let t of n){let s=chunkILTZTY3K_cjs.Ca(e,t);if(!s||s.kind==="textValue")continue;let p=L(s);if(p===s)continue;let l=chunkILTZTY3K_cjs.Ha(e,t,p,{deferValidation:true});l.ok&&(e=l.part,i=true);}return i?chunkILTZTY3K_cjs.Xb(o,e):o}function ee(o,a){let r=a.documentId.trim();if(r.length===0||r.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let e=()=>V(o.bodyStore().part),i,t=B(()=>{let l=o.bodyStore().part,d=o.currentPackage();if(i?.pkg===d&&i.body===l)return i.parts;let c=[l];for(let g of d.parts.values())g===l||!z(g)||c.push(g);return i={pkg:d,body:l,parts:Object.freeze(c)},i.parts}),s=(l,d)=>{if(l.length===0)return {ok:true,changed:false};let c=e(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>q)return {ok:false,reason:"collaboration-text-limit"};if(typeof u.paragraphId!="string"||u.paragraphId.length===0||u.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let m=u.paragraphId.toUpperCase();if(g.has(m))return {ok:false,reason:"duplicate-paragraph-id"};g.add(m);let N=c.filter(X=>X.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...F(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(Z,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>K(m,m.mainDocumentPart,h));},{origin:d.origin,actorId:d.actorId,operationId:d.operationId,recordsHistory:false});return y.ok?{ok:true,changed:y.change!==null}:{ok:false,reason:y.detail??y.reason}};return Object.freeze({documentId:r,paragraphs:e,paragraphByNodeId(l){return e().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=t(d);if(!c)return null;let g=chunkILTZTY3K_cjs._g(c.part,c.nodeId);return g===null?null:Object.freeze({paragraphId:d,nodeId:c.nodeId,text:g})},applyParagraphText(l,d,c){return s([{paragraphId:l,text:d}],c)},applyParagraphTexts:s,applyRemotePackage(l,d){let c=o.publishRemotePackage(l,d);return c.ok?{ok:true,changed:c.change!==null}:{ok:false,reason:c.detail??c.reason}},revision:()=>o.packageRevision,subscribe:l=>o.subscribe(l),observePrimitiveJournal:l=>H(o,l),hasPendingJournals:()=>chunkILTZTY3K_cjs.ua(o),flushPendingJournals:()=>{chunkILTZTY3K_cjs.va(o);},save:()=>chunkILTZTY3K_cjs.Wb(o.currentPackage()),binaryPart(l){let d=o.currentPackage();return d.partBytes.get(l)??d.partBytes.get(l.startsWith("/")?l.slice(1):`/${l}`)??null}})}exports.a=K;exports.b=ee;
@@ -0,0 +1 @@
1
+ 'use strict';var a=Object.freeze({review:null,collaboration:null,customNodes:Object.freeze([]),customNodePayloadNamespaces:Object.freeze([]),customNodeDiagnostics:Object.freeze([])});function d(e){if(!e||e.length===0)return a;let t=null,n=null,i=[],r=new Set,s=[];for(let o of e){o.review&&t===null&&(t=o.review),o.collaboration&&n===null&&(n=o.collaboration),o.customNodes&&i.push(...o.customNodes);for(let l of o.customNodePayloadNamespaces??[])r.add(l);o.onCustomNodeDiagnostic&&s.push(o.onCustomNodeDiagnostic);}return {review:t,collaboration:n,customNodes:i,customNodePayloadNamespaces:[...r],customNodeDiagnostics:s}}exports.a=d;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkXCFM3G5L_cjs=require('../chunk-XCFM3G5L.cjs');require('../chunk-ILTZTY3K.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunkXCFM3G5L_cjs.b}});
@@ -0,0 +1,216 @@
1
+ import { T as TreeModelChange } from '../tree-store-BenW0Mg_.cjs';
2
+ import { g as OoxmlElement, b as OoxmlPackage } from '../tree-op-types-CA7qgAUF.cjs';
3
+ import { T as TreePackageStore } from '../tree-package-fragment-Cz-v-0B3.cjs';
4
+ import '../contracts/types.cjs';
5
+
6
+ /** Attribute name as the journal addresses it. Prefix is authored fidelity, not identity. @public */
7
+ interface CanonicalAttributeName {
8
+ readonly namespaceUri: string;
9
+ readonly localName: string;
10
+ readonly prefix?: string;
11
+ }
12
+ /** Content-addressed binary part reference. Bytes stay out of the journal. @public */
13
+ interface CanonicalBinaryDescriptor {
14
+ readonly storageKey: string;
15
+ readonly digest: string;
16
+ readonly size: number;
17
+ readonly mediaType: string;
18
+ }
19
+ /** Text node shell. Value arrives later through `spliceText`. @public */
20
+ interface CanonicalTextNodeDescriptor {
21
+ readonly logicalId: string;
22
+ readonly kind: 'textValue';
23
+ }
24
+ /** OOXML element shell. Attributes, bindings, and children arrive as later effects. @public */
25
+ interface CanonicalElementNodeDescriptor {
26
+ readonly logicalId: string;
27
+ readonly kind: OoxmlElement['kind'];
28
+ readonly qname: CanonicalAttributeName;
29
+ }
30
+ /** Immutable node record required to create a registry entry. @public */
31
+ type CanonicalNodeDescriptor = CanonicalTextNodeDescriptor | CanonicalElementNodeDescriptor;
32
+ /** One relationship as the journal records it. @public */
33
+ interface CanonicalRelationshipRecord {
34
+ readonly ownerPart: string;
35
+ readonly id: string;
36
+ readonly type: string;
37
+ readonly rawTarget: string;
38
+ readonly targetMode: 'Internal' | 'External';
39
+ readonly order: number;
40
+ }
41
+ /** One compositional tree or package effect captured from a canonical write. @public */
42
+ type CanonicalPrimitiveEffect = {
43
+ readonly kind: 'putNode';
44
+ readonly descriptor: CanonicalNodeDescriptor;
45
+ } | {
46
+ readonly kind: 'spliceText';
47
+ readonly logicalId: string;
48
+ readonly utf16Start: number;
49
+ readonly deleteCount: number;
50
+ readonly insert: string;
51
+ } | {
52
+ readonly kind: 'setAttribute';
53
+ readonly logicalId: string;
54
+ readonly qname: CanonicalAttributeName;
55
+ readonly value: string | null;
56
+ } | {
57
+ readonly kind: 'setNamespaceBinding';
58
+ readonly logicalId: string;
59
+ readonly prefix: string;
60
+ readonly uri: string | null;
61
+ } | {
62
+ readonly kind: 'spliceChildren';
63
+ readonly parentLogicalId: string;
64
+ readonly start: number;
65
+ readonly deleteCount: number;
66
+ readonly childLogicalIds: readonly string[];
67
+ } | {
68
+ readonly kind: 'moveNode';
69
+ readonly logicalId: string;
70
+ readonly destinationParentLogicalId: string;
71
+ readonly destinationIndex: number;
72
+ } | {
73
+ readonly kind: 'putXmlPart';
74
+ readonly name: string;
75
+ readonly rootLogicalId: string;
76
+ } | {
77
+ readonly kind: 'deleteXmlPart';
78
+ readonly name: string;
79
+ } | {
80
+ readonly kind: 'putRelationship';
81
+ readonly owner: string;
82
+ readonly record: CanonicalRelationshipRecord;
83
+ } | {
84
+ readonly kind: 'deleteRelationship';
85
+ readonly owner: string;
86
+ readonly relationshipId: string;
87
+ } | {
88
+ readonly kind: 'putContentTypeOverride';
89
+ readonly partName: string;
90
+ readonly mediaType: string;
91
+ } | {
92
+ readonly kind: 'deleteContentTypeOverride';
93
+ readonly partName: string;
94
+ } | {
95
+ readonly kind: 'putBinary';
96
+ readonly descriptor: CanonicalBinaryDescriptor;
97
+ } | {
98
+ readonly kind: 'deleteBinary';
99
+ readonly storageKey: string;
100
+ };
101
+ /**
102
+ * One immutable journal for one `TreePackageStore` transaction.
103
+ *
104
+ * Empty only when a committed write used a path the journal does not yet intercept.
105
+ *
106
+ * @public
107
+ */
108
+ interface CanonicalPrimitiveJournal {
109
+ readonly effects: readonly CanonicalPrimitiveEffect[];
110
+ }
111
+
112
+ /** Options for a canonical collaboration document port. @public */
113
+ interface CreateCollaborationDocumentPortOptions {
114
+ readonly documentId: string;
115
+ }
116
+ /** Create the narrow collaboration view over one canonical package store. @public */
117
+ declare function createCollaborationDocumentPort(store: TreePackageStore, options: CreateCollaborationDocumentPortOptions): CollaborationDocumentPort;
118
+
119
+ /**
120
+ * `@docx-editor.dev/core/collaboration/replication` — the seam a replication implementation
121
+ * binds to, not the surface a host consumes.
122
+ *
123
+ * Everything here exists for the layer BETWEEN a CRDT and the canonical tree: the document
124
+ * port an adapter writes through, the primitive journal it reads, and the descriptors that
125
+ * journal is made of. A host that renders presence and reads a status needs none of it, which
126
+ * is why it lives behind its own subpath — autocomplete on
127
+ * `@docx-editor.dev/core/collaboration` should not offer `putXmlPart` and `spliceChildren` to
128
+ * somebody wiring up an avatar stack.
129
+ *
130
+ * Reach for this when you are writing a provider. `@docx-editor.dev/pro` is one.
131
+ *
132
+ * @packageDocumentation
133
+ * @public
134
+ */
135
+
136
+ /** One existing body paragraph exposed to the replication adapter. @public */
137
+ interface CollaborationParagraph {
138
+ /** Uppercase `w14:paraId`, stable across save and reopen. */
139
+ readonly paragraphId: string;
140
+ /** Replica-local canonical node identity. Never sent as wire identity. */
141
+ readonly nodeId: string;
142
+ /** Current canonical UTF-16 text. */
143
+ readonly text: string;
144
+ }
145
+ /** Attribution for one collaboration-derived canonical publication. @public */
146
+ interface CollaborationMutation {
147
+ readonly origin: string;
148
+ readonly actorId: string;
149
+ readonly operationId: string;
150
+ }
151
+ /** One paragraph text value in an atomic collaboration publication. @public */
152
+ interface CollaborationParagraphTextUpdate {
153
+ readonly paragraphId: string;
154
+ readonly text: string;
155
+ }
156
+ /** Result of replacing one supported paragraph's canonical text. @public */
157
+ type CollaborationApplyResult = {
158
+ readonly ok: true;
159
+ readonly changed: boolean;
160
+ } | {
161
+ readonly ok: false;
162
+ readonly reason: string;
163
+ };
164
+ /**
165
+ * Narrow canonical document capability handed to a collaboration implementation.
166
+ *
167
+ * It deliberately exposes no mutable package or tree store. Every write returns through the
168
+ * same validated transaction path as browser and automation edits.
169
+ *
170
+ * @public
171
+ */
172
+ interface CollaborationDocumentPort {
173
+ readonly documentId: string;
174
+ paragraphs(): readonly CollaborationParagraph[];
175
+ paragraphByNodeId(nodeId: string): CollaborationParagraph | null;
176
+ /**
177
+ * Resolve a stable `w14:paraId` in any story this replica holds.
178
+ *
179
+ * `paragraphs()` stays body-only because text publication transacts against the body
180
+ * store. Presence may name a header, a footer, a note, or a cell, so this lookup covers
181
+ * those parts too. It resolves through an index, not a scan, because a remote caret
182
+ * resolves two addresses per selection on every caret move.
183
+ */
184
+ paragraphByStableId(paragraphId: string): CollaborationParagraph | null;
185
+ applyParagraphText(paragraphId: string, text: string, mutation: CollaborationMutation): CollaborationApplyResult;
186
+ applyParagraphTexts(updates: readonly CollaborationParagraphTextUpdate[], mutation: CollaborationMutation): CollaborationApplyResult;
187
+ /**
188
+ * Publish one remotely materialized canonical package as one revision.
189
+ *
190
+ * The package is frozen canonical state. This port exposes no mutable store or CRDT.
191
+ */
192
+ applyRemotePackage(pkg: OoxmlPackage, mutation: CollaborationMutation): CollaborationApplyResult;
193
+ revision(): number;
194
+ subscribe(listener: (change: TreeModelChange) => void): () => void;
195
+ /**
196
+ * Observe one settled primitive journal per committed canonical transaction.
197
+ *
198
+ * Disabled observation allocates no journal. This is the collaboration write seam;
199
+ * adapters never write a CRDT through this port.
200
+ */
201
+ observePrimitiveJournal(listener: (journal: CanonicalPrimitiveJournal) => void): () => void;
202
+ /** True when a committed journal has not yet been frozen or delivered to observers. */
203
+ hasPendingJournals(): boolean;
204
+ /**
205
+ * Freeze and deliver queued journals in production order.
206
+ *
207
+ * Local edit, layout, and paint do not wait for this. Tests and teardown call it
208
+ * instead of sleeping on the publication timer.
209
+ */
210
+ flushPendingJournals(): void;
211
+ save(): Uint8Array;
212
+ /** Bytes of one binary package part, or null when the part is absent. */
213
+ binaryPart(storageKey: string): Uint8Array | null;
214
+ }
215
+
216
+ export { type CanonicalAttributeName, type CanonicalBinaryDescriptor, type CanonicalElementNodeDescriptor, type CanonicalNodeDescriptor, type CanonicalPrimitiveEffect, type CanonicalPrimitiveJournal, type CanonicalRelationshipRecord, type CanonicalTextNodeDescriptor, type CollaborationApplyResult, type CollaborationDocumentPort, type CollaborationMutation, type CollaborationParagraph, type CollaborationParagraphTextUpdate, type CreateCollaborationDocumentPortOptions, createCollaborationDocumentPort };