@docx-editor.dev/core 2.22.0 → 2.23.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 (107) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.ts +13 -12
  3. package/dist/automation.js +1 -1
  4. package/dist/binding.cjs +1 -1
  5. package/dist/binding.d.ts +11 -10
  6. package/dist/binding.js +1 -1
  7. package/dist/chunk-4OAXZNBU.js +5 -0
  8. package/dist/chunk-6745I4XF.cjs +20 -0
  9. package/dist/chunk-6KA3L3FR.cjs +11 -0
  10. package/dist/chunk-6QS5WL63.js +1 -0
  11. package/dist/{chunk-X2LJDR53.cjs → chunk-BUDXZ7T2.cjs} +5 -5
  12. package/dist/chunk-DYRXA5UJ.cjs +2 -0
  13. package/dist/chunk-DZOGUV7O.js +1 -0
  14. package/dist/chunk-EHT4LKKZ.cjs +1 -0
  15. package/dist/chunk-F5LAOPAD.js +20 -0
  16. package/dist/chunk-FWX535CS.cjs +1 -0
  17. package/dist/chunk-GRVRQBKU.js +1 -0
  18. package/dist/chunk-JN62FLHE.cjs +4 -0
  19. package/dist/{chunk-5RKCJ5DF.js → chunk-KRBBWATQ.js} +1 -1
  20. package/dist/chunk-KV5HFE23.cjs +2 -0
  21. package/dist/{chunk-RLKX7BIP.cjs → chunk-PCPBDYEL.cjs} +1 -1
  22. package/dist/chunk-Q4RDWB3U.cjs +18 -0
  23. package/dist/{chunk-P5PWSRNW.cjs → chunk-QK23BSRK.cjs} +1 -1
  24. package/dist/chunk-QTFAXWVI.cjs +1 -0
  25. package/dist/chunk-RLO64PHP.cjs +1 -0
  26. package/dist/chunk-T7RGKBCE.cjs +5 -0
  27. package/dist/{chunk-IWAUA732.js → chunk-UMBHUW6R.js} +1 -1
  28. package/dist/chunk-VE6H5EJA.js +5 -0
  29. package/dist/chunk-WHG23WNI.js +1 -0
  30. package/dist/chunk-XBYZTDF7.js +4 -0
  31. package/dist/chunk-XRBPZCNK.js +11 -0
  32. package/dist/chunk-Y5JCIWTF.js +2 -0
  33. package/dist/chunk-ZA6HEWUM.js +2 -0
  34. package/dist/chunk-ZCRSPN4Q.js +18 -0
  35. package/dist/collaboration/replication.cjs +1 -1
  36. package/dist/collaboration/replication.d.ts +6 -5
  37. package/dist/collaboration/replication.js +1 -1
  38. package/dist/collaboration.d.ts +7 -6
  39. package/dist/contracts/document.d.ts +4 -3
  40. package/dist/contracts/editor.d.ts +9 -9
  41. package/dist/contracts/interaction.d.ts +2 -1
  42. package/dist/contracts/modules.d.ts +9 -8
  43. package/dist/contracts/types.d.ts +1 -1
  44. package/dist/{custom-node-writes-Ck6eOiJ3.d.ts → custom-node-writes-77rvPW2-.d.ts} +4 -3
  45. package/dist/{document-protection-CMPEonQc.d.ts → document-protection-CYIjO-li.d.ts} +3 -2
  46. package/dist/{editor-BKDVqXyk.d.ts → editor-DhUQsWWH.d.ts} +132 -26
  47. package/dist/editor.cjs +1 -1
  48. package/dist/editor.css +1 -1
  49. package/dist/editor.d.ts +57 -66
  50. package/dist/editor.js +1 -1
  51. package/dist/export.cjs +2 -2
  52. package/dist/export.d.ts +17 -16
  53. package/dist/export.js +2 -2
  54. package/dist/{failure-DNNmwsgD.d.ts → failure-BIPVQbRm.d.ts} +2 -1
  55. package/dist/{font-resolver-PBc8Vuxs.d.ts → font-resolver-BwoHFBlr.d.ts} +3 -2
  56. package/dist/{headless-document-view-9wjJT20Y.d.ts → headless-document-view-Cc3fFWhv.d.ts} +4 -3
  57. package/dist/{image-resources-B0v-XaTM.d.ts → image-resources-DkuzBnTM.d.ts} +3 -2
  58. package/dist/{index-DQA53aR1.d.ts → index-BYaCkGKO.d.ts} +61 -26
  59. package/dist/index.cjs +1 -1
  60. package/dist/index.d.ts +18 -18
  61. package/dist/index.js +1 -1
  62. package/dist/{layout-shaping-Dyr0ZSOI.d.ts → layout-shaping-DpWQG26a.d.ts} +3 -2
  63. package/dist/layout.cjs +1 -1
  64. package/dist/layout.d.ts +116 -50
  65. package/dist/layout.js +1 -1
  66. package/dist/{note-properties-D_lmG9xx.d.ts → note-properties-DMfKK3QU.d.ts} +3 -2
  67. package/dist/{omml-equation-CfTm3jOK.d.ts → omml-equation-BY7OdfGY.d.ts} +3 -2
  68. package/dist/output.cjs +1 -1
  69. package/dist/output.d.ts +9 -8
  70. package/dist/output.js +1 -1
  71. package/dist/{protocol-CkVDxyQ3.d.ts → protocol-CPAakntQ.d.ts} +4 -3
  72. package/dist/{review-paragraph-order-BjUs-tDd.d.ts → review-paragraph-order-B0BP_wJP.d.ts} +1 -1
  73. package/dist/{revision-projection-DDVBYTIG.d.ts → revision-projection-CVJeA2jp.d.ts} +3 -2
  74. package/dist/{semantic-cell-selection-DW6qsmoC.d.ts → semantic-cell-selection-B8GF_H2e.d.ts} +10 -6
  75. package/dist/{semantic-interaction-BNiYSBcB.d.ts → semantic-interaction-DQjtIruQ.d.ts} +3 -2
  76. package/dist/{semantic-paint-DE236npp.d.ts → semantic-paint-DoPl85nR.d.ts} +4 -3
  77. package/dist/{semantic-records-C5OeXnaL.d.ts → semantic-records-DB0VgWsr.d.ts} +888 -778
  78. package/dist/store.cjs +1 -1
  79. package/dist/store.d.ts +17 -16
  80. package/dist/store.js +1 -1
  81. package/dist/{tree-package-fragment-DBb97w3F.d.ts → tree-package-fragment-BIyGh6L8.d.ts} +4 -3
  82. package/dist/{tree-session-contract-BYat3RKx.d.ts → tree-session-contract-CHcCnz3W.d.ts} +7 -6
  83. package/dist/{types-barrel-ChGvWjkO.d.ts → types-barrel-DN_-gaRX.d.ts} +70 -5
  84. package/package.json +3 -3
  85. package/dist/chunk-65GJRSZ5.cjs +0 -18
  86. package/dist/chunk-6TBRG6SA.cjs +0 -20
  87. package/dist/chunk-A72MJGY7.cjs +0 -4
  88. package/dist/chunk-AZ7QSAXH.js +0 -4
  89. package/dist/chunk-BL57VQ7E.js +0 -1
  90. package/dist/chunk-CB6RQ3GD.cjs +0 -11
  91. package/dist/chunk-FGBADUSK.cjs +0 -1
  92. package/dist/chunk-GG4IAKFI.js +0 -5
  93. package/dist/chunk-HJYLFMLX.js +0 -2
  94. package/dist/chunk-HL6NO7IH.cjs +0 -2
  95. package/dist/chunk-HZQFGB2X.cjs +0 -5
  96. package/dist/chunk-OZXBAEWW.js +0 -2
  97. package/dist/chunk-PD5XKBJA.js +0 -1
  98. package/dist/chunk-REMFTPDL.cjs +0 -2
  99. package/dist/chunk-UGLO2GA5.cjs +0 -1
  100. package/dist/chunk-UOQONZVQ.js +0 -11
  101. package/dist/chunk-VD2MWTR6.js +0 -20
  102. package/dist/chunk-VIXH2OVP.js +0 -1
  103. package/dist/chunk-VP7SDFCM.js +0 -1
  104. package/dist/chunk-W2JIZ5JH.js +0 -18
  105. package/dist/chunk-W5H62AWM.cjs +0 -1
  106. package/dist/chunk-YQXY6TQ3.js +0 -5
  107. package/dist/chunk-YYFBYVW4.cjs +0 -1
@@ -1 +1 @@
1
- 'use strict';var chunkCB6RQ3GD_cjs=require('./chunk-CB6RQ3GD.cjs');var X=new Set(["document","hdr","ftr","footnotes","endnotes"]),W=24,U=512,E=chunkCB6RQ3GD_cjs.zg(W);function z(o){let t=o.root;return t.namespaceUri===chunkCB6RQ3GD_cjs.da&&X.has(t.localName)}function $(o){let t=[],e=r=>{if(r.kind!=="textValue"){r.namespaceUri===chunkCB6RQ3GD_cjs.da&&r.localName==="p"&&t.push(r);for(let i of r.children)e(i);}};return e(o.root),t}function V(o){let t=chunkCB6RQ3GD_cjs.Qb(o);let e=[],r=new Set;for(let i of $(t)){let n=chunkCB6RQ3GD_cjs.Kb(i);if(!n||!chunkCB6RQ3GD_cjs.Jb(n))continue;let a=n.toUpperCase();if(r.has(a))continue;r.add(a);let s=chunkCB6RQ3GD_cjs.Ui(t,i.id);s!==null&&e.push(Object.freeze({paragraphId:a,nodeId:i.id,text:s}));}return Object.freeze(e)}function Y(o){let t=E.get(o.root);if(t)return t;let e=chunkCB6RQ3GD_cjs.Qb(o);let r=new Map,i=new Set,n=a=>{if(a.kind!=="textValue"){if(a.namespaceUri===chunkCB6RQ3GD_cjs.da&&a.localName==="p"){let s=chunkCB6RQ3GD_cjs.Kb(a);if(s&&chunkCB6RQ3GD_cjs.Jb(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),a.kind==="paragraph"&&r.set(p,a.id));}}for(let s of a.children)n(s);}};return n(e.root),E.set(o.root,r),r}function w(o,t){if(o.length!==t.length)return false;for(let e=0;e<o.length;e+=1)if(o[e].root!==t[e])return false;return true}function B(o){let t=new Map,e=null,r=(n,a,s)=>{for(t.delete(n),t.set(n,{partName:a.name,root:a.root,nodeId:s});t.size>U;){let p=t.keys().next();if(p.done)break;t.delete(p.value);}},i=(n,a)=>{let s=t.get(n);if(!s)return null;let p=a.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=chunkCB6RQ3GD_cjs.Ha(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=chunkCB6RQ3GD_cjs.Kb(l);return !d||d.toUpperCase()!==n?null:(r(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let a=o(),s=i(n,a);if(s)return s;if(e&&e.ids.has(n)&&w(a,e.roots))return null;for(let p of a){let l=Y(p).get(n);if(l!==void 0)return r(n,p,l),{part:p,nodeId:l}}return (!e||!w(a,e.roots))&&(e={roots:a.map(p=>p.root),ids:new Set}),e.ids.size<U&&e.ids.add(n),null}}function H(o,t){return chunkCB6RQ3GD_cjs.Ba(o,t)}var q=Object.freeze({kind:"body"}),F=1e6;function b(o,t){if(t<=0||t>=o.length)return false;let e=o.charCodeAt(t-1),r=o.charCodeAt(t);return e>=55296&&e<=56319&&r>=56320&&r<=57343}function Q(o,t,e){if(t===e)return [];let r=0,i=Math.min(t.length,e.length);for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r+=1;for(;r>0&&(b(t,r)||b(e,r));)r-=1;let n=0;for(;n<t.length-r&&n<e.length-r&&t.charCodeAt(t.length-n-1)===e.charCodeAt(e.length-n-1);)n+=1;for(;n>0&&(b(t,t.length-n)||b(e,e.length-n));)n-=1;let a=t.length-r-n,s=e.slice(r,e.length-n),p=[];return a>0&&p.push({op:"deleteText",paragraphId:o,start:r,end:r+a}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:r,text:s}),Object.freeze(p)}function K(o){let t=r=>!!r&&r.kind!=="textValue"&&r.namespaceUri===chunkCB6RQ3GD_cjs.da&&r.localName==="t"&&r.attributes.every(i=>i.namespaceUri===chunkCB6RQ3GD_cjs.ea&&i.localName==="space")&&r.children.every(i=>i.kind==="textValue"),e=[];for(let r of o){let i=e.at(-1);if(!t(i)||!t(r)){e.push(r);continue}let n=i.children.map(a=>a.kind==="textValue"?a.value:"").join("")+r.children.map(a=>a.kind==="textValue"?a.value:"").join("");e[e.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:chunkCB6RQ3GD_cjs.ea,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return e}function G(o){if(o.kind==="textValue")return o;let t=false,e=o.children.map(r=>{let i=G(r);return i!==r&&(t=true),i});if(o.namespaceUri===chunkCB6RQ3GD_cjs.da&&o.localName==="r"){let r=K(e);(r.length!==e.length||r.some((i,n)=>i!==e[n]))&&(e=[...r],t=true);}return t?{...o,children:e}:o}function rr(o,t,e){let r=o.parts.get(t);if(!r)return o;let i=false,n=new Set;for(let a of e)(a.op==="insertText"||a.op==="deleteText")&&!a.revision&&n.add(a.paragraphId);for(let a of n){let s=chunkCB6RQ3GD_cjs.Ha(r,a);if(!s||s.kind==="textValue")continue;let p=G(s);if(p===s)continue;let l=chunkCB6RQ3GD_cjs.Ma(r,a,p,{deferValidation:true});l.ok&&(r=l.part,i=true);}return i?chunkCB6RQ3GD_cjs.lc(o,r):o}function er(o,t){let e=t.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let r=()=>V(o.bodyStore().part),i,a=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=r(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>F)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(L=>L.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...Q(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(q,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>rr(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:e,paragraphs:r,paragraphByNodeId(l){return r().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=a(d);if(!c)return null;let g=chunkCB6RQ3GD_cjs.Ui(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:()=>chunkCB6RQ3GD_cjs.za(o),flushPendingJournals:()=>{chunkCB6RQ3GD_cjs.Aa(o);},save:()=>chunkCB6RQ3GD_cjs.kc(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=rr;exports.b=er;
1
+ 'use strict';var chunk6KA3L3FR_cjs=require('./chunk-6KA3L3FR.cjs');var X=new Set(["document","hdr","ftr","footnotes","endnotes"]),W=24,U=512,E=chunk6KA3L3FR_cjs.Yg(W);function z(o){let t=o.root;return t.namespaceUri===chunk6KA3L3FR_cjs.da&&X.has(t.localName)}function $(o){let t=[],e=r=>{if(r.kind!=="textValue"){r.namespaceUri===chunk6KA3L3FR_cjs.da&&r.localName==="p"&&t.push(r);for(let i of r.children)e(i);}};return e(o.root),t}function V(o){let t=chunk6KA3L3FR_cjs.eb(o);let e=[],r=new Set;for(let i of $(t)){let n=chunk6KA3L3FR_cjs._a(i);if(!n||!chunk6KA3L3FR_cjs.Za(n))continue;let a=n.toUpperCase();if(r.has(a))continue;r.add(a);let s=chunk6KA3L3FR_cjs.rj(t,i.id);s!==null&&e.push(Object.freeze({paragraphId:a,nodeId:i.id,text:s}));}return Object.freeze(e)}function Y(o){let t=E.get(o.root);if(t)return t;let e=chunk6KA3L3FR_cjs.eb(o);let r=new Map,i=new Set,n=a=>{if(a.kind!=="textValue"){if(a.namespaceUri===chunk6KA3L3FR_cjs.da&&a.localName==="p"){let s=chunk6KA3L3FR_cjs._a(a);if(s&&chunk6KA3L3FR_cjs.Za(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),a.kind==="paragraph"&&r.set(p,a.id));}}for(let s of a.children)n(s);}};return n(e.root),E.set(o.root,r),r}function w(o,t){if(o.length!==t.length)return false;for(let e=0;e<o.length;e+=1)if(o[e].root!==t[e])return false;return true}function B(o){let t=new Map,e=null,r=(n,a,s)=>{for(t.delete(n),t.set(n,{partName:a.name,root:a.root,nodeId:s});t.size>U;){let p=t.keys().next();if(p.done)break;t.delete(p.value);}},i=(n,a)=>{let s=t.get(n);if(!s)return null;let p=a.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=chunk6KA3L3FR_cjs.Ha(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=chunk6KA3L3FR_cjs._a(l);return !d||d.toUpperCase()!==n?null:(r(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let a=o(),s=i(n,a);if(s)return s;if(e&&e.ids.has(n)&&w(a,e.roots))return null;for(let p of a){let l=Y(p).get(n);if(l!==void 0)return r(n,p,l),{part:p,nodeId:l}}return (!e||!w(a,e.roots))&&(e={roots:a.map(p=>p.root),ids:new Set}),e.ids.size<U&&e.ids.add(n),null}}function H(o,t){return chunk6KA3L3FR_cjs.Ba(o,t)}var q=Object.freeze({kind:"body"}),F=1e6;function b(o,t){if(t<=0||t>=o.length)return false;let e=o.charCodeAt(t-1),r=o.charCodeAt(t);return e>=55296&&e<=56319&&r>=56320&&r<=57343}function Q(o,t,e){if(t===e)return [];let r=0,i=Math.min(t.length,e.length);for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r+=1;for(;r>0&&(b(t,r)||b(e,r));)r-=1;let n=0;for(;n<t.length-r&&n<e.length-r&&t.charCodeAt(t.length-n-1)===e.charCodeAt(e.length-n-1);)n+=1;for(;n>0&&(b(t,t.length-n)||b(e,e.length-n));)n-=1;let a=t.length-r-n,s=e.slice(r,e.length-n),p=[];return a>0&&p.push({op:"deleteText",paragraphId:o,start:r,end:r+a}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:r,text:s}),Object.freeze(p)}function K(o){let t=r=>!!r&&r.kind!=="textValue"&&r.namespaceUri===chunk6KA3L3FR_cjs.da&&r.localName==="t"&&r.attributes.every(i=>i.namespaceUri===chunk6KA3L3FR_cjs.ea&&i.localName==="space")&&r.children.every(i=>i.kind==="textValue"),e=[];for(let r of o){let i=e.at(-1);if(!t(i)||!t(r)){e.push(r);continue}let n=i.children.map(a=>a.kind==="textValue"?a.value:"").join("")+r.children.map(a=>a.kind==="textValue"?a.value:"").join("");e[e.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:chunk6KA3L3FR_cjs.ea,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return e}function G(o){if(o.kind==="textValue")return o;let t=false,e=o.children.map(r=>{let i=G(r);return i!==r&&(t=true),i});if(o.namespaceUri===chunk6KA3L3FR_cjs.da&&o.localName==="r"){let r=K(e);(r.length!==e.length||r.some((i,n)=>i!==e[n]))&&(e=[...r],t=true);}return t?{...o,children:e}:o}function rr(o,t,e){let r=o.parts.get(t);if(!r)return o;let i=false,n=new Set;for(let a of e)(a.op==="insertText"||a.op==="deleteText")&&!a.revision&&n.add(a.paragraphId);for(let a of n){let s=chunk6KA3L3FR_cjs.Ha(r,a);if(!s||s.kind==="textValue")continue;let p=G(s);if(p===s)continue;let l=chunk6KA3L3FR_cjs.Ma(r,a,p,{deferValidation:true});l.ok&&(r=l.part,i=true);}return i?chunk6KA3L3FR_cjs.Kd(o,r):o}function er(o,t){let e=t.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let r=()=>V(o.bodyStore().part),i,a=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=r(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>F)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(L=>L.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...Q(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(q,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>rr(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:e,paragraphs:r,paragraphByNodeId(l){return r().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=a(d);if(!c)return null;let g=chunk6KA3L3FR_cjs.rj(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:()=>chunk6KA3L3FR_cjs.za(o),flushPendingJournals:()=>{chunk6KA3L3FR_cjs.Aa(o);},save:()=>chunk6KA3L3FR_cjs.Jd(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=rr;exports.b=er;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkEHT4LKKZ_cjs=require('./chunk-EHT4LKKZ.cjs'),chunkT7RGKBCE_cjs=require('./chunk-T7RGKBCE.cjs'),chunk6KA3L3FR_cjs=require('./chunk-6KA3L3FR.cjs');function F(t){let r=[],s=0;for(let e of t){let o=s+e.text.length;e.resultRuns?r.push({text:e.text,rawStart:e.rawStart,rawEnd:e.rawEnd,resultRuns:e.resultRuns,projectedStart:s,projectedEnd:o,expansion:e.text.length!==e.rawEnd-e.rawStart}):r.push({text:e.text,rawStart:e.rawStart,rawEnd:e.rawEnd,projectedStart:s,projectedEnd:o,expansion:e.text.length!==e.rawEnd-e.rawStart}),s=o;}return r}function T(t,r){return r<=t.rawStart?t.projectedStart:r>=t.rawEnd?t.projectedEnd:t.expansion?t.projectedStart:t.projectedStart+r-t.rawStart}function M(t,r){return t.expansion?t.rawStart:t.rawStart+r-t.projectedStart}function V(t,r){return t.expansion?t.rawEnd:t.rawStart+r-t.projectedStart}function g(t){let r=F(t),s="";for(let e of t)s+=e.text;return {text:s,projectedOffset(e){let o=0;for(let a of r){if(e<=a.rawEnd)return T(a,e);o=a.projectedEnd;}return o},rawRange(e,o){if(e<0||e>=o||o>s.length)return null;let a=r.find(d=>e>=d.projectedStart&&e<d.projectedEnd),n=r.find(d=>o>d.projectedStart&&o<=d.projectedEnd);return !a||!n?null:{start:M(a,e),end:V(n,o)}},sliceRaw(e,o){if(e>=o)return "";let a="";for(let n of r){if(n.expansion){e<=n.rawStart&&o>=n.rawEnd&&(a+=n.text);continue}let d=Math.max(e,n.rawStart),u=Math.min(o,n.rawEnd);d<u&&(a+=n.text.slice(d-n.rawStart,u-n.rawStart));}return a},resultRunAddressAt(e){let o=r.find(n=>n.resultRuns!==void 0&&e>=n.projectedStart&&e<n.projectedEnd);if(!o?.resultRuns)return null;let a=e-o.projectedStart;for(let n of o.resultRuns)if(a>=n.start&&a<n.end)return {runId:n.runId,offset:a-n.start};return null},findOccurrences(e,o,a={}){let n=[];if(o<=0||!chunkT7RGKBCE_cjs.Ga(e)||s.length===0)return {matches:n,truncated:false};let d=a.matchCase===true,u=a.wholeWord===true,i=d?e:chunkT7RGKBCE_cjs.Ea(e),l=d?s:chunkT7RGKBCE_cjs.Ea(s),f=Math.min(s.length,a.to??s.length),j=new Set,c=l.indexOf(i,Math.max(0,a.from??0));for(;c>=0;){let p=c+i.length;if(p>f)return {matches:n,truncated:false};if(!u||chunkT7RGKBCE_cjs.Fa(s,c,p)){let m=r.find(x=>c>=x.projectedStart&&c<x.projectedEnd),P=r.find(x=>p>x.projectedStart&&p<=x.projectedEnd);if(!m||!P)return {matches:n,truncated:false};let h=m===P&&m.expansion?m:null;if(!h||!j.has(h)){if(n.length>=o)return {matches:n,truncated:true};n.push({start:c,length:i.length,rawStart:M(m,c),rawEnd:V(P,p)}),h&&j.add(h);}}c=l.indexOf(i,p);}return {matches:n,truncated:false}}}}function A(t){return t.length===0?g([]):g([{text:t,rawStart:0,rawEnd:t.length}])}function B(t,r,s="allMarkup"){if(!r.includes(chunk6KA3L3FR_cjs.he))return r.length===0?[]:[{text:r,rawStart:0,rawEnd:r.length}];let e=chunk6KA3L3FR_cjs.Ce(t),o=chunk6KA3L3FR_cjs.bf(t,e),a=chunkEHT4LKKZ_cjs.c(t,e,s),n=new Map;for(let i of e)n.set(i.node.id,i);let d=[],u=0;for(let i of o){let l=n.get(i.node.id);if(!l)continue;u<i.start&&d.push({text:r.slice(u,i.start),rawStart:u,rawEnd:i.start});let f=a.get(l.node.id);l.kind==="simple"&&f?d.push({text:f.text,rawStart:i.start,rawEnd:i.end,resultRuns:f.runs}):d.push({text:f?.text??chunk6KA3L3FR_cjs.he,rawStart:i.start,rawEnd:i.end}),u=i.end;}return u<r.length&&d.push({text:r.slice(u),rawStart:u,rawEnd:r.length}),d}function N(t,r,s="allMarkup"){return r.includes(chunk6KA3L3FR_cjs.he)?g(B(t,r,s)):A(r)}exports.a=g;exports.b=A;exports.c=B;exports.d=N;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkQ4RDWB3U_cjs=require('./chunk-Q4RDWB3U.cjs'),chunkT7RGKBCE_cjs=require('./chunk-T7RGKBCE.cjs'),chunk6KA3L3FR_cjs=require('./chunk-6KA3L3FR.cjs');var Dt=Object.freeze({}),Mt=Object.freeze([]);function Et(e){let t=Object.keys(e);if(t.length===0)return Dt;let r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=o);}return Object.freeze(r)}function Lt(e){let t=new Map(chunk6KA3L3FR_cjs.if(e.part())),r=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!r.has(i)){r.add(i);for(let[s,d]of chunk6KA3L3FR_cjs.if(i))t.has(s)||t.set(s,d);}let n=e.currentPackage();for(let o of ["footnote","endnote"]){let a=chunk6KA3L3FR_cjs.bg(n,o);if(!(!a||r.has(a))){r.add(a);for(let[i,s]of chunk6KA3L3FR_cjs.if(a))t.has(i)||t.set(i,s);}}return t}function At(e,t){let r=chunkQ4RDWB3U_cjs.Xe(e,t);if(!r)return null;let n=e.pages[r.pageIndex];if(!n)return null;let o=chunkQ4RDWB3U_cjs.Re(n),a=chunkQ4RDWB3U_cjs.Te(e,t.paragraphId,r.pageIndex),i=Object.freeze({x:r.x+a.x,y:r.y+a.y,height:r.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:r.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function Ft(e,t){let r=[];for(let n of t.values()){let o=At(e,n);o&&r.push(o);}return r.length===0?Mt:Object.freeze(r)}function tt(e,t){return {documentMetadata:Et(e.documentProperties()),destinations:Ft(t,Lt(e))}}function yr(e,t){let r=e.destinations;if(r){for(let n of r)if(n.anchor.name===t)return n}}function rt(e={}){return Object.freeze({async decode(t,r,n){let o=chunk6KA3L3FR_cjs.od(t,r);if(!o)throw new Error(`Unsupported or malformed ${r} image`);if(o.pixelWidth>n.maxDimension||o.pixelHeight>n.maxDimension||o.pixelWidth>n.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var nt=new WeakMap;function ot(e,t){let r=nt.get(e);r||(r=chunkQ4RDWB3U_cjs.id(e),nt.set(e,r));let n=r.styleCascade(),o=new Set;if(t===e.part())for(let d of chunkQ4RDWB3U_cjs.xc(t,void 0,void 0,n,r.numberingIndex()))for(let h of chunkQ4RDWB3U_cjs.Eb(d)?.slice(0,-1)??[])o.add(h.paragraph.id);let a=d=>{if(d.kind==="textValue")return false;let h=d.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===chunk6KA3L3FR_cjs.da&&c.localName==="pPr"),f=h?.kind!=="textValue"?h?.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===chunk6KA3L3FR_cjs.da&&c.localName==="rPr"):void 0;return f!==void 0&&chunk6KA3L3FR_cjs.pa(f,"vanish")},i=0,s=(d,h)=>{if(++i>chunk6KA3L3FR_cjs.Xc||h>chunk6KA3L3FR_cjs.W||d.kind==="textValue")return false;if(d.kind==="paragraph"&&!o.has(d.id)&&(chunkQ4RDWB3U_cjs.vc(d,n,false)||a(d))&&chunk6KA3L3FR_cjs.cf(d).length>0)return true;for(let f of d.children){if(i>=chunk6KA3L3FR_cjs.Xc)break;if(s(f,h+1))return true}return false};return s(t.root,0)}var at=new WeakMap,Tt=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function Ct(e,t){let r=at.get(e.root);if(r&&r.stylesPart===t)return r.codes;let n=chunk6KA3L3FR_cjs.Ta(t),o=new Set,a=[{node:e.root,scope:chunk6KA3L3FR_cjs.Kc(),depth:0,mcSelected:false,framed:false}],i=0;for(;a.length;){let{node:d,scope:h,depth:f,mcSelected:c,framed:p}=a.pop();if(++i>chunk6KA3L3FR_cjs.Xc||f>chunk6KA3L3FR_cjs.W){o.add("scan-limit");break}if(d.kind==="textValue")continue;if(i+a.length+d.children.length>chunk6KA3L3FR_cjs.Xc){o.add("scan-limit");break}let g=chunk6KA3L3FR_cjs.Jc(h,d),x=p||n(d),u=chunk6KA3L3FR_cjs.Ic(d)?d:void 0;if(u){if(chunk6KA3L3FR_cjs.$c(u,g).drawing)continue;let m=chunk6KA3L3FR_cjs._c(u,g);m.refused&&o.add("scan-limit"),m.branch&&a.push({node:m.branch,scope:g,depth:f+1,mcSelected:true,framed:x});continue}if(!(!c&&chunk6KA3L3FR_cjs.Hc(d)&&!(x&&d.localName==="object"))){if(d.namespaceUri==="urn:schemas-microsoft-com:vml"&&d.localName==="textbox"){o.add("legacy-textbox");continue}d.namespaceUri==="urn:schemas-microsoft-com:vml"&&Tt.has(d.localName)&&!d.children.some(m=>m.kind!=="textValue"&&m.namespaceUri==="urn:schemas-microsoft-com:vml"&&m.localName==="textbox")&&o.add("legacy-drawing");for(let m of d.children)a.push({node:m,scope:g,depth:f+1,mcSelected:c,framed:x});}}let s=Object.freeze([...o]);return at.set(e.root,{stylesPart:t,codes:s}),s}function it(e){let t=new Set([e.part()]);for(let r of e.headerFooterPartsBySection())for(let n of [r.headers,r.footers])for(let o of n.values())t.add(o);for(let r of ["footnote","endnote"]){let n=chunk6KA3L3FR_cjs.bg(e.currentPackage(),r);n&&t.add(n);}return Object.freeze([...t].flatMap(r=>[...Ct(r,chunk6KA3L3FR_cjs.Ac(e.currentPackage())),...ot(e,r)?["unsupported-style-separator"]:[]].map(n=>Object.freeze({code:n,partName:r.name}))))}function st(e){let t=e.defaultTabStopPt?.(),r=e.view.part().name,n={view:e.view,measurer:e.measurer,producer:e.producer,cache:e.cache,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,compatibilityMode:e.compatibilityMode?.(),inlineDrawingLayoutForPart:e.inlineDrawingLayoutForPart,drawingTokenForParagraphForPart:e.drawingTokenForParagraphForPart,drawingLayoutEpochForPart:e.drawingLayoutEpochForPart,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},o=chunkQ4RDWB3U_cjs.ce(n),a={view:e.view,revision:e.revision,measurer:e.measurer,cache:e.cache,session:e.session,producer:e.producer,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,furniture:e.furniture,compatibilityMode:e.compatibilityMode,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,inlineDrawingLayout:e.inlineDrawingLayout,drawingTokenForParagraph:e.drawingTokenForParagraph,drawingLayoutEpoch:e.drawingLayoutEpoch,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},i={measurer:a.measurer,cache:a.cache,session:a.session,producer:a.producer,styleCascade:a.styleCascade?.(),defaultTabStopPt:a.defaultTabStopPt,compatibilityMode:a.compatibilityMode?.(),numberingIndex:a.numberingIndex?.(),sectionFurniture:a.furniture.sectionFurniture(),furniture:a.furniture.furniture(),evenAndOddHeaders:a.view.headerFooterPartsBySection()[0]?.evenAndOddHeaders===true,projectLink:a.linkProjectors.projectLink,projectFieldLink:a.projectFieldLink,showFieldCodes:a.showFieldCodes,documentProperties:a.view.documentProperties(),inlineDrawingLayout:a.inlineDrawingLayout,drawingTokenForParagraph:a.drawingTokenForParagraph,drawingLayoutEpoch:a.drawingLayoutEpoch,projectionTokenForParagraph:s=>a.linkProjectors.tokenForParagraphForPart(r,s),projectionTokenForTable:s=>a.linkProjectors.tokenForTableForPart(r,s),projectionEpoch:a.linkProjectors.epochForPart(r),notes:o,displayMode:a.displayMode,revisionAuthorFilter:a.revisionAuthorFilter};return chunkQ4RDWB3U_cjs.He(a.view.part(),a.revision,i)}var Nt=65536;function ut(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function jt(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function _t(e,t,r){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===r:true}function Bt(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let r=null;return chunkQ4RDWB3U_cjs.ya(e,n=>{if(r||!_t(t,n.story,n.noteScopeId))return;let o=n.story==="header"||n.story==="footer"?a=>chunkQ4RDWB3U_cjs.ta(a,n.origin,{x:e.box.x,y:e.box.y}):void 0;chunkQ4RDWB3U_cjs.Ca(n.host,(a,i)=>{if(r||i.textboxDepth===0)return;let s=i.textboxPath.map(d=>d.drawingNodeId);jt(s,t.textboxPath)&&(r=ut(e,i.storyOrigin));},n.origin,o);}),r}function Vt(e,t){if(t.story==="textbox")return Bt(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?chunkQ4RDWB3U_cjs.Se(e,e.header.box):{x:0,y:0};case "footer":return e.footer?chunkQ4RDWB3U_cjs.Se(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let n=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return n?chunkQ4RDWB3U_cjs.Se(e,n.box):{x:0,y:0}}case "note-separator":{let r=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes,n=r?.separator?.box;return r?.continuationNotice&&chunkQ4RDWB3U_cjs.Ca(r.continuationNotice,o=>{o.paragraphId===t.source.start.paragraphId&&(n=r.continuationNotice.box);}),n?chunkQ4RDWB3U_cjs.Se(e,n):{x:0,y:0}}default:return {x:0,y:0}}}function lt(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function pt(e,t){let r=chunkQ4RDWB3U_cjs.Re(e);return Object.freeze({x:r.x+t.x,y:r.y+t.y,width:t.width,height:t.height})}function Kt(e,t){let r=chunkQ4RDWB3U_cjs.Xe(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!r||r.pageIndex!==t.pageIndex)return;let n=e.pages[r.pageIndex];if(!n)return;let o=Vt(n,t),a=Object.freeze([lt({x:r.x+o.x,y:r.y+o.y,width:0,height:r.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>pt(n,i)))})}function zt(e,t,r){let n=r.filter(i=>i.pageIndex===t.pageIndex);if(n.length===0)return mt(t)?Kt(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(n.map(i=>lt(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>pt(o,i)))})}function mt(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function dt(e,t){return `${e}\0${t}`}function Ht(e,t,r){let n=Math.max(e.start,t.offset),o=Math.min(e.end,r.offset);return o>n?{start:n,end:o}:null}function Wt(e,t){let r=new Map,n=new Map,o=new Set,a=0;let i=(s,d)=>{if(a>=Nt)return false;a+=1;let h=dt(s.pageIndex,d),f=n.get(h);return f?f.push(s):n.set(h,[s]),true};for(let[s,d]of t.entries())for(let[h,f]of d.occurrences.entries()){if(mt(f)||f.source.start.paragraphId!==f.source.end.paragraphId)continue;o.add(f.pageIndex);let c=`${s}\0${h}`,p={paragraphId:f.source.start.paragraphId,offset:f.source.start.offset},g={paragraphId:f.source.end.paragraphId,offset:f.source.end.offset},x=p.offset<=g.offset?{from:p,to:g}:{from:g,to:p};i({key:c,from:x.from,to:x.to,pageIndex:f.pageIndex},x.from.paragraphId);}if(n.size===0)return r;for(let s of e.pages)o.has(s.index)&&chunkQ4RDWB3U_cjs.ya(s,d=>{let h=d.story==="header"||d.story==="footer"?f=>chunkQ4RDWB3U_cjs.ta(f,d.origin,{x:s.box.x,y:s.box.y}):void 0;chunkQ4RDWB3U_cjs.Ca(d.host,(f,c)=>{let p=ut(s,c.storyOrigin);for(let g of f.lines)for(let x of chunkQ4RDWB3U_cjs.Ja(g)){let u=n.get(dt(s.index,x.paragraphId));if(u)for(let m of u){let w=Ht(x,m.from,m.to);if(!w)continue;let b=chunkQ4RDWB3U_cjs.Ne(g,w.start,void 0,x),S=chunkQ4RDWB3U_cjs.Ne(g,w.end,void 0,x),R=r.get(m.key)??[];R.push({pageIndex:s.index,x:Math.min(b,S)+p.x,y:g.box.y+p.y,width:Math.abs(S-b),height:g.box.height}),r.set(m.key,R);}}},d.origin,h);});return r}function ft(e,t){let r=false;for(let o of t)if(o.occurrences.length!==0){r=true;break}if(!r)return t;let n=Wt(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,d)=>{let h=`${a}\0${d}`,f=zt(e,s,n.get(h)??[]);return f?{...s,geometry:f}:s});return {...o,occurrences:Object.freeze(i)}})}function $t(e){let t=new Map,r=[{node:e.root,depth:0}];for(;r.length>0;){let{node:n,depth:o}=r.pop();if(!(n.kind==="textValue"||o>64)){n.kind==="paragraph"&&!t.has(n.id)&&t.set(n.id,t.size);for(let a=n.children.length-1;a>=0;a-=1)r.push({node:n.children[a],depth:o+1});}}return t}function yt(){let e=new Map,t=n=>{let o=e.get(n.root);if(o)return o;let a=$t(n);return e.set(n.root,a),a},r={retainRevisionItems:false,revisionSites:chunk6KA3L3FR_cjs.wi,locations:chunkT7RGKBCE_cjs.wa,commentAnchors:chunk6KA3L3FR_cjs.$g,deepOrder:t};return Object.freeze({collectReviewItems:n=>chunkT7RGKBCE_cjs.Aa(n,r),deepParagraphOrderOfPart:t})}function Ut(e,t){if(t)return true;let r=e.map(n=>n.root);for(;r.length>0;){let n=r.pop();if(chunk6KA3L3FR_cjs.ui(n))return true;if(n.kind!=="textValue")for(let o of n.children)r.push(o);}return false}function Gt(e,t){let r=[],n=new Set([t.name]),o=a=>{!a||n.has(a.name)||(n.add(a.name),r.push(a));};for(let a of chunk6KA3L3FR_cjs.de(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(chunk6KA3L3FR_cjs.bg(e,"footnote")),o(chunk6KA3L3FR_cjs.bg(e,"endnote")),r}function Yt(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return chunk6KA3L3FR_cjs.bg(e,"footnote")?.name??null;case "endnote":return chunk6KA3L3FR_cjs.bg(e,"endnote")?.name??null;case "note-separator":return chunk6KA3L3FR_cjs.bg(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function Xt(e,t){let r=new Map;for(let n of e){let o=t.get(n.partName),a=o?.get(n.start.paragraphId),i=o?.get(n.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),d=Math.max(a,i),h=r.get(n.partName);r.set(n.partName,{lower:Math.min(h?.lower??s,s),upper:Math.max(h?.upper??d,d)});}return r}function qt(e,t,r,n,o){let a=new Map(r.map(c=>[c.name,o(c)])),i=Xt(n,a),s=new Map,d=new Map,h=(c,p,g,x,u,m,w)=>{let b=a.get(c)?.get(u),S=i.get(c);if(b===void 0||!S||b<S.lower||b>S.upper)return;let R=s.get(c)??new Map;s.set(c,R);let V=d.get(c)??new Map;d.set(c,V);let j=JSON.stringify([p.story,p.noteScopeId,p.noteAreaKind]),X=g==="textbox"?JSON.stringify([j,"textbox",x]):j,H=R.get(u)??[],W=`${u}\0${p.page.index}\0${X}`,T=V.get(W);T||(T={pageIndex:p.page.index,story:g,rootStory:p.story,textboxPath:x,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,laneKey:X,intervals:[],intervalKeys:new Set},V.set(W,T),H.push(T),R.set(u,H));let y=`${m}\0${w}`;T.intervalKeys?.has(y)||(T.intervalKeys?.add(y),T.intervals.push({start:m,end:w}));};chunkQ4RDWB3U_cjs.za(e,c=>{let p=Yt(t,c);!p||!i.has(p)||chunkQ4RDWB3U_cjs.Ca(c.host,(g,x)=>{let u=x.textboxDepth>0?"textbox":c.story,m=x.textboxPath.map(b=>b.drawingNodeId),w=[];for(let b of g.lines){for(let S of b.spans)w.push(S.range);for(let S of b.drawings??[])w.push({paragraphId:S.paragraphId,start:S.start,end:S.start+1});}w.length===0&&w.push({paragraphId:g.range.paragraphId,start:g.range.start,end:g.range.end});for(let{paragraphId:b,start:S,end:R}of w)h(p,c,u,m,b,S,R);});}),chunkQ4RDWB3U_cjs.Ba(e,c=>{let p=c.drawing.ownerPartName;c.drawing.accessibility.hidden||!i.has(p)||h(p,c.root,c.story,c.textboxPath.map(g=>g.drawingNodeId),c.drawing.paragraphId,c.drawing.start,c.drawing.start+1);});for(let c of s.values())for(let p of c.values())for(let g of p){g.intervals.sort((u,m)=>u.start-m.start||u.end-m.end);let x=[];for(let u of g.intervals){let m=x.at(-1);m&&u.start<=m.end?m.end=Math.max(m.end,u.end):x.push({...u});}g.intervals.splice(0,g.intervals.length,...x),g.intervalKeys=void 0;}let f=new Map;for(let[c,p]of s){let g=a.get(c);if(!g)continue;let x=[];for(let[u,m]of p){let w=g.get(u);w!==void 0&&x.push({paragraphId:u,position:w,laneKeys:new Set(m.map(({laneKey:b})=>b))});}x.sort((u,m)=>u.position-m.position),f.set(c,x);}return {byPart:s,orderByPart:a,visibleByPart:f}}function gt(e,t){let r=0,n=e.length;for(;r<n;){let o=r+n>>>1;e[o].position<t?r=o+1:n=o;}return r}function Jt(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let r=t.orderByPart.get(e.partName),n=t.visibleByPart.get(e.partName),o=r?.get(e.start.paragraphId),a=r?.get(e.end.paragraphId);if(!r||!n||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),d=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:c})=>c)??[]),h=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:c})=>c)??[]),f=new Set([...d].filter(c=>h.has(c)));return f.size===0?[e.start.paragraphId,e.end.paragraphId]:n.slice(gt(n,i),gt(n,s+1)).filter(c=>[...c.laneKeys].some(p=>f.has(p))).map(c=>c.paragraphId)}function Qt(e,t,r,n){return n?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,r)};return a.end>a.start?[a]:[]})}function Zt(e,t){let r=Number.NEGATIVE_INFINITY;for(let n of e)for(let o of n.intervals)r=Math.max(r,o.end);return t!==r?new Set:new Set(e.filter(n=>n.intervals.some(o=>o.end===r)))}function ht(e,t,r){let n=[],o=new Set;for(let[a,i]of e.entries()){let s=r===void 0?void 0:r===null?"neutral":a<r?"replaced":"replacement";for(let d of Jt(i,t)){let h=t.byPart.get(i.partName)?.get(d)??[],c=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,p=d===i.start.paragraphId?i.start.offset:0,g=d===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,x=c?Zt(h,p):new Set;for(let u of h){let m=Qt(u,p,g,c);c&&m.length===0&&x.has(u)&&(m=[{start:p,end:p}]);for(let w of m){let b=`${u.pageIndex}\0${u.story}\0${u.noteScopeId??""}\0${u.noteAreaKind??""}\0${u.textboxPath.join("\0")}\0${i.partName}\0${d}\0${w.start}\0${w.end}\0${s??""}`;o.has(b)||(o.add(b),n.push({pageIndex:u.pageIndex,physicalPageNumber:u.pageIndex+1,story:u.story,rootStory:u.rootStory,textboxPath:u.textboxPath,noteScopeId:u.noteScopeId,noteAreaKind:u.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:d,offset:w.start},end:{paragraphId:d,offset:w.end}}}));}}}}return n}function wt(e,t){let r=2166136261,n=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);r=Math.imul(r^a,16777619)>>>0,n=Math.imul(n^a+o,2246822507)>>>0,n^=n>>>13;}return `${e}_${t.length.toString(36)}_${r.toString(36)}_${n.toString(36)}`}function xt(e,t,r=wt){let n=new Map;for(let a of t){let i=r(e,a),s=n.get(i)??new Set;s.add(a),n.set(i,s);}let o=new Map;for(let[a,i]of n){let s=[...i].sort();for(let[d,h]of s.entries())o.set(h,s.length===1?a:`${a}_${d.toString(36)}`);}return o}function er(e){let t=new Set,r=new Set;for(let n of e){if(n.kind==="comment"){t.add(n.id),n.parentId!==void 0&&t.add(n.parentId),n.parentRevisionId!==void 0&&r.add(n.parentRevisionId);for(let o of n.replyIds)t.add(o);}if(n.kind==="revision"){r.add(n.id),n.pairedWith!==void 0&&r.add(n.pairedWith);for(let o of n.replyIds)t.add(o);}}return {comment:xt("comment",t),revision:xt("change",r)}}function B(e,t,r){return e.get(r)??wt(t,r)}function tr(e,t,r){return e.kind==="revision"?{kind:"tracked-change",id:B(r.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:e.text,replacedText:e.replacedText,nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:B(r.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),occurrences:t?ht(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:B(r.comment,"comment",e.id),author:e.comment.author,initials:chunkT7RGKBCE_cjs.ua(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:chunkT7RGKBCE_cjs.ta(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:B(r.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:B(r.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),orphaned:e.orphaned,occurrences:t&&e.range?ht([e.range],t):[]}}function bt(e,t){let r=t.parts.get(t.mainDocumentPart);if(!r)return [];let n=Gt(t,r),o=[r,...n],a=t.parts.get(chunkT7RGKBCE_cjs.Z(t,r.name));if(!Ut(o,a))return [];let i=yt(),s=i.collectReviewItems({storyPart:r,furnitureParts:n,commentsPart:a,commentsExtendedPart:t.parts.get(chunkT7RGKBCE_cjs._(t,r.name))});if(s.length===0)return [];let d=s.flatMap(c=>chunkT7RGKBCE_cjs.na(c)),h=d.length>0?qt(e,t,o,d,i.deepParagraphOrderOfPart):null,f=er(s);return s.map(c=>tr(c,h,f)).filter(c=>c!==null)}var rr=new Set(["part","validatedHandle"]);function Pt(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Y(e,t,r,n,o){if(!(n!==void 0&&rr.has(n))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(r.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),r.add(e);try{if(Array.isArray(e)){for(let a of e)Y(a,t,r,void 0,o);Object.freeze(e);return}if(!Pt(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");Y(i.value,t,r,a,o);}}Object.freeze(e);}finally{r.delete(e);}}}}}function St(e){if(!Pt(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let n of e.pages)if(!(n===null||typeof n!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(n,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),Y(i,new Set,s,o),t.add(i);}let r=(n,o)=>{let a=new Set;for(let i of n){let s=new Set;s.add(e),Y(i,a,s,void 0,o);}Object.freeze(n);};for(let n of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,n);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(n==="pages"&&Array.isArray(o.value)){r(o.value,t);continue}if(n==="reviewArtifacts"&&Array.isArray(o.value)){r(o.value);continue}let a=new Set;a.add(e),Y(o.value,new Set,a,n);}return Object.freeze(e),e}var nr=Object.freeze([]),k=class extends Error{constructor(r,n,o){super(n,o);this.code=r;this.name="ExportResourceError";}code};function or(e){try{return e instanceof k}catch{return false}}function ar(e){try{return e instanceof chunkQ4RDWB3U_cjs.Zd}catch{return false}}function ir(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function sr(e){if(or(e))return e;let t=ar(e),r=ir(e),n=r?`: ${r}`:"",o=new k(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${n}`:`Export layout failed${n}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function cr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function vt(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var dr=50,ue=64;function ur(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function lr(e){let t=false;return chunkQ4RDWB3U_cjs.Ba(e,({drawing:r})=>{ur(r.resource)&&(t=true);}),t}function It(e){return !ArrayBuffer.isView(e)}function kn(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let r=vt(t.displayMode??chunkQ4RDWB3U_cjs.Ra),n=It(e),o=It(e)?{ok:true,view:e}:chunkT7RGKBCE_cjs.Ka(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??n,s=cr(t.resourceTimeoutMs),d=t.measurer??chunkQ4RDWB3U_cjs.fa(),h=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),f=chunkQ4RDWB3U_cjs.fb({retainAcrossPasses:i}),c=0,p=new Set,g=()=>{c+=1;for(let y of p)y();p.clear();},x=chunkQ4RDWB3U_cjs.jd({session:a,decodePort:t.imageDecodePort??rt(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:g}),u={view:a,measurer:d,paragraphCache:f,sessions:new Map,completed:new Map,inFlight:new Map,styles:chunkQ4RDWB3U_cjs.id(a),fieldLinks:new Map,links:chunkQ4RDWB3U_cjs.ee(a),drawingBundle:x,furniture:new Map},m=new AbortController,w=t.signal,b=false,S=()=>b?new k("aborted","Export resource settlement was aborted"):new k("disposed","Export session has been disposed"),R=()=>{b=true,V();};function V(){let y=u;if(y){u=null,w?.removeEventListener("abort",R),m.abort(w?.reason),y.drawingBundle.dispose(),y.paragraphCache.clear();for(let P of y.completed.values())chunkQ4RDWB3U_cjs.Zc(P.internal),chunkQ4RDWB3U_cjs.ge(P.internal);for(let P of y.fieldLinks.values())P.registry.clear();y.fieldLinks.clear(),y.completed.clear(),y.inFlight.clear(),y.furniture.clear(),y.sessions.clear(),g();}}w?.addEventListener("abort",R,{once:true}),w?.aborted&&R();let j=()=>{if(!u)throw S();if(m.signal.aborted)throw new k("aborted","Export resource settlement was aborted")},X=(y,P,D,l)=>c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D?Promise.resolve():(j(),new Promise((_,O)=>{let M=false,C,E=A=>{M||(M=true,C!==void 0&&clearTimeout(C),p.delete(L),m.signal.removeEventListener("abort",$),A?O(A):_());},L=()=>E(),$=()=>E(new k("aborted","Export resource settlement was aborted")),U=()=>{if(u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}let A=l-Date.now();if(A<=0){E(new k("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(U,Math.min(dr,A));};if(p.add(L),m.signal.addEventListener("abort",$,{once:true}),c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}U();})),H=async(y,P=0,D=Date.now()+s)=>{if(j(),Date.now()>=D)throw new k("timedOut",`Export layout did not stabilize within ${s}ms`);let l=u,_=D,O=l.view.packageRevision(),M=l.view.currentPackage(),C=l.completed.get(y);if(C&&C.revision===O&&C.pkg===M)return C.published;let E=()=>{if(l.view.packageRevision()===O&&l.view.currentPackage()===M)return null;if(P>=ue-1)throw new k("nonConvergent","Document revision did not stabilize during export layout");return H(y,P+1,_)},L=l.fieldLinks.get(y);if(!L||L.revision!==O||L.pkg!==M){let I=L?.registry??chunkQ4RDWB3U_cjs.fe();I.clear(),L={revision:O,pkg:M,registry:I},l.fieldLinks.set(y,L),l.furniture.delete(y);}let $=L.registry,U=l.sessions.get(y)??chunkQ4RDWB3U_cjs.Ge();l.sessions.set(y,U);let A=l.furniture.get(y);A||(A=chunkQ4RDWB3U_cjs.be({view:l.view,measurer:l.measurer,producer:h,cache:l.paragraphCache,styleCascade:l.styles.styleCascade,numberingIndex:l.styles.numberingIndex,defaultTabStopPt:l.styles.defaultTabStopPt,compatibilityMode:l.styles.compatibilityMode,displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false,inlineDrawingLayoutForPart:I=>l.drawingBundle.contextForPart(I),drawingLayoutTokenForPart:I=>l.drawingBundle.cacheTokenForPart(I),drawingTokenForParagraphForPart:(I,ne)=>l.drawingBundle.drawingTokenForParagraph(ne,I),linkProjectors:l.links,projectFieldLink:I=>$.project(I)}),l.furniture.set(y,A));for(let I=0;I<ue;I+=1){let ne=c;l.drawingBundle.sync(l.view);let le=E();if(le)return le;let N=st({view:l.view,revision:l.view.packageRevision(),measurer:l.measurer,cache:l.paragraphCache,session:U,producer:h,styleCascade:l.styles.styleCascade,defaultTabStopPt:l.styles.defaultTabStopPt,numberingIndex:l.styles.numberingIndex,furniture:A,compatibilityMode:l.styles.compatibilityMode,linkProjectors:l.links,projectFieldLink:v=>$.project(v),inlineDrawingLayout:l.drawingBundle.bodyContext,inlineDrawingLayoutForPart:v=>l.drawingBundle.contextForPart(v),drawingTokenForParagraph:v=>l.drawingBundle.drawingTokenForParagraph(v,l.view.part().name),drawingTokenForParagraphForPart:(v,q)=>l.drawingBundle.drawingTokenForParagraph(q,v),drawingLayoutEpoch:l.drawingBundle.cacheTokenForPart(l.view.part().name),drawingLayoutEpochForPart:v=>l.drawingBundle.cacheTokenForPart(v),displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false});if(!lr(N)){let v=E();if(v)return v;i||(chunkQ4RDWB3U_cjs.Zc(N),chunkQ4RDWB3U_cjs.ge(N),l.paragraphCache.clear(),l.sessions.delete(y),l.furniture.delete(y));let q=bt(N,M),Rt=q.length===0?nr:Object.freeze(ft(N,q)),Ot=tt(l.view,N),kt={...N,...Ot,contentWarnings:it(l.view),reviewArtifacts:Rt},fe=St(kt);return l.completed.set(y,{revision:O,pkg:M,internal:N,published:fe}),fe}let pe=ne;for(;l.drawingBundle.pendingResourceCount()>0;){await X(pe,O,M,_),pe=c,j();let v=E();if(v)return v}j();let me=E();if(me)return me}throw new k("nonConvergent",`Image resources did not reach quiescence after ${ue} layout passes`)},W=y=>{let P;try{P=vt(y);}catch(O){return Promise.reject(O)}if(!u)return Promise.reject(S());let D=u,l=D.inFlight.get(P);if(l)return l;let _=H(P).catch(O=>{throw sr(O)}).finally(()=>D.inFlight.delete(P));return D.inFlight.set(P,_),_};return {ok:true,session:{layout:()=>W(r),layoutFor:W,validatedImageBytes(y){let P=u;return !P||y.resource.kind!=="ready"?null:P.drawingBundle.mintValidatedBytes(y.resource.validatedHandle,y.resource.contentId)?.slice()??null},dispose:V}}}exports.a=st;exports.b=yr;exports.c=rt;exports.d=k;exports.e=kn;
@@ -0,0 +1,5 @@
1
+ 'use strict';var chunk6KA3L3FR_cjs=require('./chunk-6KA3L3FR.cjs'),fflate=require('fflate');var pd=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],fd=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,gd=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function bi(e){return fd.test(e)||gd.test(e)}function Mn(e,t){if(!bi(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 hd=/^(\d+)\.(\d+)\.(\d+)$/;function it(e){let t=hd.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 Dn(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 An(e,t){let n=it(e),r=t.trim();if(r==="*")return true;if(r.startsWith("^")){let o=it(r.slice(1));return Dn(n,o)<0?false:o.major>0?n.major===o.major:o.minor>0?n.major===0&&n.minor===o.minor:n.major===0&&n.minor===0}if(r.includes(" ")){let o=r.split(/\s+/);if(o.length!==2)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let i=true;for(let a of o){let s=a.startsWith(">=")?">=":a.startsWith("<")?"<":null;if(!s)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let l=it(a.slice(s.length)),d=Dn(n,l);s===">="?i=i&&d>=0:i=i&&d<0;}return i}return Dn(n,it(r))===0}var ye=class extends Error{constructor(n,r,o=[]){super(r);this.code=n;this.responsible=o;this.name="RegistryError";}code;responsible},Dr=(e,t)=>`${e}:${t}`;function yd(e,t={}){let n=new Map;for(let d of e){if(Mn(d.id,"extension"),Si(d.version,d.id),n.has(d.id))throw new ye("duplicate-extension",`duplicate extension id ${d.id}`,[d.id]);n.set(d.id,d);for(let c of d.contributions)Mn(c.id,c.kind),Si(c.version,`${d.id} \u2192 ${c.id}`),c.replaces&&Rd(c.replaces.targetRange,`${d.id} \u2192 replaces ${c.replaces.targetId}`);}for(let d of e){for(let c of d.dependencies??[])if(!n.has(c))throw new ye("missing-dependency",`${d.id} requires missing extension ${c}`,[d.id,c]);for(let c of d.conflicts??[])if(n.has(c)){let u=[d.id,c].sort();throw new ye("conflict",`extensions ${u[0]} and ${u[1]} conflict`,u)}}kd(n);let r=new Set(t.availablePorts??[]);for(let d of e)for(let c of d.contributions)c.kind==="runtimePort"&&r.add(c.id);for(let d of e)for(let c of d.requiredPorts??[])if(!r.has(c))throw new ye("missing-port",`${d.id} requires unavailable port ${c}`,[d.id,c]);let o=new Map,i=new Map,a=new Map;for(let d of e)for(let c of d.contributions){let u=Dr(c.kind,c.id);if(c.replaces){let p=Dr(c.kind,c.replaces.targetId),R=a.get(p)??[];R.push({ext:d.id,c}),a.set(p,R);continue}if(i.has(u)){let p=[o.get(u),d.id].sort();throw new ye("id-collision",`${c.kind} id ${c.id} registered by both ${p[0]} and ${p[1]}`,p)}i.set(u,c),o.set(u,d.id);}let s=new Map(i);for(let[d,c]of a){let u=i.get(d);if(!u){let m=c[0];throw new ye("replacement-target-missing",`${m.ext} replaces missing target ${m.c.replaces.targetId}`,[m.ext,m.c.replaces.targetId])}let p=u.replaceable??{kind:"none"};for(let{ext:m,c:h}of c){if(!An(u.version,h.replaces.targetRange))throw new ye("replacement-version-mismatch",`${m} replaces ${h.replaces.targetId}@${u.version} outside range ${h.replaces.targetRange}`,[m,h.replaces.targetId]);if(p.kind==="none")throw new ye("unauthorized-replacement",`${h.replaces.targetId} does not authorize replacement (attempted by ${m})`,[m,h.replaces.targetId])}let R=xd(u,c);s.set(d,R);}return {extensions:n,contributions:s,get:(d,c)=>s.get(Dr(d,c))}}function xd(e,t){let n=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(n.kind==="priority"){let o=[...t].sort((s,l)=>(l.c.replaces.priority??0)-(s.c.replaces.priority??0)),i=o[0].c.replaces.priority??0,a=o.filter(s=>(s.c.replaces.priority??0)===i);if(a.length>1){let s=a.map(l=>l.ext).sort();throw new ye("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${i}: ${s.join(", ")}`,s)}return o[0].c}let r=t.map(o=>o.ext).sort();throw new ye("ambiguous-replacement",`multiple replacers of ${e.id}: ${r.join(", ")}`,r)}function kd(e){let o=new Map,i=[],a=s=>{o.set(s,1),i.push(s);let l=[...e.get(s)?.dependencies??[]].sort();for(let d of l){let c=o.get(d)??0;if(c===1){let u=i.indexOf(d),p=[...i.slice(u),d];throw new ye("dependency-cycle",`dependency cycle: ${p.join(" -> ")}`,p)}c===0&&a(d);}i.pop(),o.set(s,2);};for(let s of [...e.keys()].sort())(o.get(s)??0)===0&&a(s);}function Si(e,t){try{it(e);}catch{throw new ye("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function Rd(e,t){try{An("0.0.0",e);}catch{throw new ye("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var st=class extends Error{constructor(t){super(t),this.name="BudgetError";}},zt=class e{constructor(t,n){this.label=t;this.capacity=n;this.used=new chunk6KA3L3FR_cjs.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,r=this;return {amount:t,get released(){return n},release(){n||(n=true,r.used.release(t),r.activeReservations-=1);}}}child(t,n){this.assertLive(),this.used.add(n);let r=new e(t,n);return r.parent=this,r.carveAmount=n,this.children.add(r),r}onRelease(t){this.assertLive(),this.cleanups.push(t);}dispose(){if(this.disposed)return;if(this.children.size>0)throw new st(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new st(`${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(r){t.push(r);}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 st(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new st(`${this.label}: budget already released`)}};var _n=class extends Error{constructor(n,r){super(r?`cancelled: ${r}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},Kt=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 _n(t.derivedOnly,t._reason)}}}};var Fn=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},Ar=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 Fn(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(chunk6KA3L3FR_cjs.f.clock)}identity(){return this.resolve(chunk6KA3L3FR_cjs.f.identity)}},_r=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}},Fr=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function Pd(e){let t=chunk6KA3L3FR_cjs.k(e.limits),n=Object.freeze({...e.config??{}}),r=e.capacity??t.maxDecompressedBytes,o=e.id??"op",i={id:o,limits:t,config:n,ports:e.ports,budget:new zt(`op:${o}`,r),cancellation:new Kt};return Object.freeze(i)}function vd(e){e.budget.dispose();}var $r=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"}}),wi=Object.keys($r);function Od(e,t){return new chunk6KA3L3FR_cjs.p(`${$r[t].phase}:${t}`,e[t])}var Lr=class{counter;current=0;peak=0;constructor(t){this.counter=new chunk6KA3L3FR_cjs.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 Id(){for(let e of wi){let t=chunk6KA3L3FR_cjs.j[e],n=chunk6KA3L3FR_cjs.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 Gt(e,t=new Set){let n=new WeakSet,r=[],o=i=>{if(i===null)return "null";let a=typeof i;if(a==="boolean")return i?"true":"false";if(a==="number"){let l=i;if(!Number.isFinite(l))throw new Error(`non-finite number is not comparable: ${l}`);return Object.is(l,-0)?"0":String(l)}if(a==="string")return JSON.stringify(i);if(a==="bigint")return `${i.toString()}n`;if(Array.isArray(i))return `[${i.map((l,d)=>{r.push(d);try{return o(l)}finally{r.pop();}}).join(",")}]`;if(a==="object"){let l=i;if(n.has(l))throw new Error("cannot canonicalize a cyclic structure");n.add(l);let c=Object.keys(l).filter(u=>!t.has(u)).sort().map(u=>{r.push(u);try{return `${JSON.stringify(u)}:${o(l[u])}`}finally{r.pop();}}).join(",");return n.delete(l),`{${c}}`}let s=r.length>0?` at ${r.map(String).join(".")}`:"";throw new Error(`unsupported value type in comparator input: ${a}${s}`)};return o(e)}function Ur(e,t){return bd(Gt(e,t))}function bd(e){let t=3421674724,n=2216829733;for(let r=0;r<e.length;r++){n=(n^e.charCodeAt(r))>>>0;let o=n*435,i=Math.floor(o/4294967296);t=Math.imul(t,435)+Math.imul(n,256)+i>>>0,n=o>>>0;}return t.toString(16).padStart(8,"0")+n.toString(16).padStart(8,"0")}var $e="dev.docx-editor.core.comparator",Br={authoredState:{id:`${$e}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${$e}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${$e}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${$e}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${$e}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${$e}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${$e}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${$e}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${$e}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${$e}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function jr(e,t,n,r={}){let o=Br[e];switch(o.mode){case "sync-optimization-only":throw new Error(`${o.id} is not an equivalence basis (${o.note})`);case "tolerance":{if(r.epsilon===void 0)throw new Error(`${o.id} requires an explicit epsilon`);return {equal:Ni(t,n,r.epsilon)}}case "exact":case "canonical-exact":{let i=o.mode==="canonical-exact"?new Set(o.ephemera):new Set,a=Gt(t,i),s=Gt(n,i);return a===s?{equal:true}:{equal:false,left:a,right:s}}}}function Hr(e,t){let n=Br[e];if(n.mode==="tolerance"||n.mode==="sync-optimization-only")throw new Error(`${n.id} has no canonical fingerprint (${n.mode})`);let r=n.mode==="canonical-exact"?new Set(n.ephemera):void 0;return Ur(t,r)}function Ni(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((r,o)=>Ni(r,t[o],n)):false}var Ti=new Set([...chunk6KA3L3FR_cjs.c,...chunk6KA3L3FR_cjs.d]),Ei=/^[0-9a-f]{16}$/,Sd=/^[0-9a-f]*$/;function Vr(e){let t=[],n=o=>t.push(o);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 r=-1;e.steps.forEach((o,i)=>{let a=`step[${i}]`;Ti.has(o.origin)||n(`${a}: unknown origin ${o.origin}`),(!Number.isInteger(o.baseRevision)||o.baseRevision<0)&&n(`${a}: baseRevision must be a non-negative integer`),o.baseRevision<r&&n(`${a}: baseRevision regressed below ${r}`);let s=o.expect;s.outcome==="applied"?(s.committedRevision===void 0?n(`${a}: applied step needs committedRevision`):s.committedRevision<=o.baseRevision?n(`${a}: committedRevision ${s.committedRevision} must exceed baseRevision ${o.baseRevision}`):r=s.committedRevision,s.modelChange&&wd(s.modelChange,a,n)):(s.committedRevision!==void 0&&n(`${a}: ${s.outcome} step must not commit a revision`),s.authoredStateHash!==void 0&&n(`${a}: ${s.outcome} step must not change authored state`)),s.authoredStateHash!==void 0&&!Ei.test(s.authoredStateHash)&&n(`${a}: authoredStateHash must be 16-hex`),s.outputHash!==void 0&&!Ei.test(s.outputHash)&&n(`${a}: outputHash must be 16-hex`);});for(let o of [...e.snapshots??[],...e.updates??[]])o.documentId!==e.documentId&&n(`envelope documentId ${o.documentId} != ${e.documentId}`),Sd.test(o.bytesHex)||n("envelope bytesHex must be hex"),o.bytesHex.length!==o.byteLength*2&&n(`envelope byteLength ${o.byteLength} disagrees with ${o.bytesHex.length/2} decoded bytes`);return {valid:t.length===0,errors:t}}function wd(e,t,n){Ti.has(e.origin)||n(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&n(`${t}: modelChange revision must advance`);}function Nd(e,t){let n=Vr(e);if(!n.valid)return {ok:false,mismatches:n.errors};let r=[];return t.init(e),e.steps.forEach((o,i)=>{let a=`step[${i}]`,s=t.applyStep(o),l=o.expect;if(s.outcome!==l.outcome){r.push(`${a}: outcome ${s.outcome} != expected ${l.outcome}`);return}if(l.outcome==="applied"&&(s.committedRevision!==l.committedRevision&&r.push(`${a}: revision ${s.committedRevision} != expected ${l.committedRevision}`),l.authoredStateHash!==void 0))if(s.authoredState===void 0)r.push(`${a}: store returned no authored state to hash`);else {jr("authoredState",s.authoredState,s.authoredState).equal||r.push(`${a}: authored state is not self-consistent`);let c=Ci(s.authoredState);c!==l.authoredStateHash&&r.push(`${a}: authoredStateHash ${c} != expected ${l.authoredStateHash}`);}}),{ok:r.length===0,mismatches:r}}function Ci(e){return Hr("authoredState",e)}function Xt(e){let t=[...e];for(;t.length;){let n=t.pop();if(n.kind!=="textValue"){if(n.namespaceUri===chunk6KA3L3FR_cjs.da&&n.localName==="object")return true;for(let r of n.children)t.push(r);}}return false}var lt="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Ed="http://schemas.openxmlformats.org/package/2006/relationships",Td="http://schemas.openxmlformats.org/drawingml/2006/main",Ai="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",_i="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",Fi="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Li="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",$i="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",Wr="application/vnd.openxmlformats-package.relationships+xml",zr=`${lt}/styles`,Kr=`${lt}/numbering`,Ui=`${lt}/footnotes`,Bi=`${lt}/endnotes`,ji=`${lt}/officeDocument`,Cd=`${lt}/theme`;function _e(e){return e.kind!=="textValue"}function Mi(e,t){return {...e,children:t}}function qe(e,t){if(t(e),e.kind!=="textValue")for(let n of e.children)qe(n,t);}var Md=new Set(["pStyle","rStyle","tblStyle"]);function Gr(e,t){for(let n of e)qe(n,r=>{if(r.kind!=="textValue"&&Md.has(r.localName)&&r.namespaceUri===chunk6KA3L3FR_cjs.da){let o=chunk6KA3L3FR_cjs.Se(r,"val");o&&t.add(o);}});}function Xr(e,t){for(let n of e)qe(n,r=>{if(r.kind!=="textValue"&&r.localName==="numId"&&r.namespaceUri===chunk6KA3L3FR_cjs.da){let o=chunk6KA3L3FR_cjs.Se(r,"val");o&&t.add(o);}});}function Yr(e){let t=new Set;return Yt(e,t),t}function Yt(e,t){for(let n of e)qe(n,r=>{if(r.kind!=="textValue")for(let o of r.attributes)o.namespaceUri===lt&&o.value.length>0&&t.add(o.value);});}function Ce(e){return /^\d+$/.test(e)?e.replace(/^0+(?=\d)/,""):e}function $n(e,t){let n={footnote:new Set,endnote:new Set},r=[],o=i=>{for(let a of i)qe(a,s=>{if(s.kind!=="noteReference")return;let l=s.localName==="footnoteReference"?"footnote":"endnote",d=chunk6KA3L3FR_cjs.Se(s,"id");if(d===void 0)return;let c=Ce(d);n[l].has(c)||(n[l].add(c),r.push({kind:l,id:c}));});};for(o(e);r.length>0;){let i=r.pop(),a=t(i.kind,i.id);a!==null&&o([a]);}return n}function Jr(e,t,n){if(e.kind==="textValue")return e;let r=[],o=false;for(let i of e.children){if(i.kind!=="textValue"&&i.namespaceUri===chunk6KA3L3FR_cjs.da&&(i.localName==="footnoteReference"||i.localName==="endnoteReference")){let l=i.localName==="footnoteReference"?t:n,d=chunk6KA3L3FR_cjs.Se(i,"id");if(i.kind!=="noteReference"||d===void 0||!l.has(Ce(d))){o=true;continue}}let s=Jr(i,t,n);s!==i&&(o=true),r.push(s);}return o?{...e,children:r}:e}function Dd(e,t){for(let n of chunk6KA3L3FR_cjs.Md(e,t)){if(n.type!==zr||n.targetMode==="External")continue;let r=chunk6KA3L3FR_cjs.w(n.ownerPart,n.rawTarget);if(r.ok)return e.parts.get(r.partName)??null}return e.parts.get("/word/styles.xml")??null}function Hi(e,t,n){for(let r of chunk6KA3L3FR_cjs.Md(e,t)){if(r.type!==n||r.targetMode==="External")continue;let o=chunk6KA3L3FR_cjs.w(r.ownerPart,r.rawTarget);if(o.ok)return e.parts.get(o.partName)??null}return null}function Vi(e,t){let n=Dd(e,t),r=new Map,o=[],i=null;if(n&&_e(n.root))for(let a of n.root.children){if(!_e(a))continue;if(a.localName==="docDefaults"&&a.namespaceUri===chunk6KA3L3FR_cjs.da){i=a;continue}if(a.localName!=="style"||a.namespaceUri!==chunk6KA3L3FR_cjs.da)continue;let s=chunk6KA3L3FR_cjs.Se(a,"styleId");s&&r.set(s,a),(chunk6KA3L3FR_cjs.Se(a,"default")==="1"||chunk6KA3L3FR_cjs.Se(a,"default")==="true")&&o.push(a);}return {part:n,byId:r,defaults:o,docDefaults:i}}var Ad=new Set(["basedOn","link","next"]);function Wi(e,t){let n=new Set,r=[...t];for(let a of e.defaults){let s=chunk6KA3L3FR_cjs.Se(a,"styleId");s&&r.push(s);}let o=[];for(;r.length>0;){let a=r.pop();if(n.has(a))continue;n.add(a);let s=e.byId.get(a);if(s){o.push(s);for(let l of s.children)if(_e(l)&&Ad.has(l.localName)&&l.namespaceUri===chunk6KA3L3FR_cjs.da){let d=chunk6KA3L3FR_cjs.Se(l,"val");d&&r.push(d);}}}if(!e.part||!_e(e.part.root))return o;let i=new Map;return e.part.root.children.forEach((a,s)=>i.set(a,s)),o.sort((a,s)=>(i.get(a)??0)-(i.get(s)??0))}function qr(e,t,n){let r=Hi(e,t,Kr)??e.parts.get("/word/numbering.xml")??null;if(!r||!_e(r.root)||n.size===0)return {part:r,nums:[],abstracts:[]};let o=[],i=new Set;for(let s of r.root.children){if(!_e(s)||s.localName!=="num"||s.namespaceUri!==chunk6KA3L3FR_cjs.da)continue;let l=chunk6KA3L3FR_cjs.Se(s,"numId");if(!(!l||!n.has(l))){o.push(s);for(let d of s.children)if(_e(d)&&d.localName==="abstractNumId"){let c=chunk6KA3L3FR_cjs.Se(d,"val");c&&i.add(c);}}}let a=[];for(let s of r.root.children){if(!_e(s)||s.localName!=="abstractNum"||s.namespaceUri!==chunk6KA3L3FR_cjs.da)continue;let l=chunk6KA3L3FR_cjs.Se(s,"abstractNumId");l&&i.has(l)&&a.push(s);}return {part:r,nums:o,abstracts:a}}var Ln={latin:null,eastAsia:null,cs:null};function zi(e,t){let n=Hi(e,t,Cd);if(!n)return {major:Ln,minor:Ln};let r={major:{...Ln},minor:{...Ln}};return qe(n.root,o=>{if(o.kind==="textValue"||o.namespaceUri!==Td||o.localName!=="majorFont"&&o.localName!=="minorFont")return;let i=o.localName==="majorFont"?r.major:r.minor;for(let a of o.children){if(!_e(a))continue;let s=chunk6KA3L3FR_cjs.Se(a,"typeface");s&&(a.localName==="latin"?i.latin=s:a.localName==="ea"?i.eastAsia=s:a.localName==="cs"&&(i.cs=s));}}),{major:r.major,minor:r.minor}}function _d(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 Fd=[["asciiTheme","ascii"],["hAnsiTheme","hAnsi"],["eastAsiaTheme","eastAsia"],["cstheme","cs"]],Di=new Set(["themeColor","themeTint","themeShade","themeFill","themeFillTint","themeFillShade"]);function Qe(e,t){if(e.kind==="textValue")return e;let n=e.attributes;if(e.localName==="rFonts"&&e.namespaceUri===chunk6KA3L3FR_cjs.da){let i=[],a=new Map;for(let s of e.attributes){let l=Fd.find(([d])=>d===s.localName);if(l&&s.namespaceUri===chunk6KA3L3FR_cjs.da){let d=_d(t,s.value);d&&a.set(l[1],d);continue}i.push(s);}for(let[s,l]of a)i.some(d=>d.localName===s)||i.push({kind:"genericExtension",namespaceUri:chunk6KA3L3FR_cjs.da,localName:s,prefix:"w",value:l});n=i;}else e.attributes.some(i=>Di.has(i.localName)&&i.namespaceUri===chunk6KA3L3FR_cjs.da&&e.attributes.some(a=>a.localName==="val"))&&(n=e.attributes.filter(i=>!(Di.has(i.localName)&&i.namespaceUri===chunk6KA3L3FR_cjs.da)));let r=e.children.map(i=>Qe(i,t)),o=r.some((i,a)=>i!==e.children[a]);return n===e.attributes&&!o?e:{...e,attributes:n,children:r}}function Ki(e,t,n){return {id:e,name:e,contentType:t,root:n}}function Gi(e,t){if(e.root.kind==="document"){let r=e.root.children.find(i=>i.kind==="body"),o=r&&_e(r)?Mi(r,t):{id:"fragment#body",kind:"body",namespaceUri:chunk6KA3L3FR_cjs.da,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return Mi(e.root,[o])}let n={id:"fragment#body",kind:"body",namespaceUri:chunk6KA3L3FR_cjs.da,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return {id:"fragment#document",kind:"document",namespaceUri:chunk6KA3L3FR_cjs.da,localName:"document",prefix:"w",namespaceBindings:_e(e.root)?e.root.namespaceBindings:[],attributes:[],children:[n]}}function Jt(e){let t=e.map(n=>{let r=n.targetMode==="External"?' TargetMode="External"':"";return `<Relationship Id="${chunk6KA3L3FR_cjs.N(n.id)}" Type="${chunk6KA3L3FR_cjs.N(n.type)}" Target="${chunk6KA3L3FR_cjs.N(n.rawTarget)}"${r}/>`}).join("");return `<Relationships xmlns="${Ed}">${t}</Relationships>`}function Xi(e,t){let n=t;for(;e.has(`rId${n}`);)n+=1;return `rId${n}`}function Yi(e){let t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}function Un(e,t){return {...e,children:t}}function Bn(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunk6KA3L3FR_cjs.da}function qt(e,t=[]){if(e.kind==="textValue")return t;e.kind==="paragraph"&&t.push(e.id);for(let n of e.children)qt(n,t);return t}function Ji(e,t){if(e.kind==="textValue")return null;if(e.kind==="paragraph"&&e.id===t)return e;for(let n of e.children){let r=Ji(n,t);if(r)return r}return null}function Ld(e){let t=(n,r)=>{if(n.kind==="textValue")return n;if(r&&Bn(n,"vMerge")){if(chunk6KA3L3FR_cjs.Se(n,"val")==="restart")return n;let i=[...n.attributes.filter(a=>!(a.localName==="val"&&a.namespaceUri===chunk6KA3L3FR_cjs.da)),{kind:"wmlVal",namespaceUri:chunk6KA3L3FR_cjs.da,localName:"val",prefix:"w",value:"restart"}];return {...n,attributes:i}}if(n.kind==="paragraph"||n.kind==="table")return n;let o=r||Bn(n,"tc");return Un(n,n.children.map(i=>t(i,o)))};return Un(e,e.children.map(n=>t(n,false)))}function qi(e,t){if(!(e.kind==="textValue"||e.kind==="table")){if(Bn(e,"tr")){t.push(e);return}for(let n of e.children)qi(n,t);}}function Qi(e,t,n){if(e.kind==="textValue"||e.kind==="table")return {node:e,hadRows:false,keptRows:false};if(Bn(e,"tr")){if(!t.has(e))return {node:null,hadRows:true,keptRows:false};let a=n.value?Ld(e):e;return n.value=false,{node:a,hadRows:true,keptRows:true}}let r=false,o=false,i=[];for(let a of e.children){let s=Qi(a,t,n);r||=s.hadRows,o||=s.keptRows,s.node!==null&&i.push(s.node);}return r?{node:o?Un(e,i):null,hadRows:true,keptRows:o}:{node:e,hadRows:false,keptRows:false}}function Zi(e,t,n){let r=[];for(let l of e.children)qi(l,r);let o=new Set(qt(e).filter(l=>t.inRange.has(l)));if(o.size===0)return;let i=r.filter(l=>{let d=qt(l);return d.length>0&&d.every(c=>t.covered.has(c))}),a=new Set(i.flatMap(l=>qt(l)));if(i.length>0&&o.size===a.size&&[...o].every(l=>a.has(l))){let l={value:true},d=new Set(i),c=[];for(let u of e.children){let p=Qi(u,d,l);p.node!==null&&c.push(p.node);}n.push(Un(e,c));return}for(let l of qt(e)){if(!t.inRange.has(l))continue;let d=Ji(e,l);d&&n.push(d);}}var $d="http://schemas.openxmlformats.org/package/2006/content-types",Ud=5e4;function ze(e){return e.kind!=="textValue"}function es(e,t=[]){if(e.kind==="textValue")return t;e.kind==="paragraph"&&t.push(e.id);for(let n of e.children)es(n,t);return t}function Qr(e,t){if(e.kind==="textValue")return null;if(e.kind==="paragraph"&&e.id===t)return e;for(let n of e.children){let r=Qr(n,t);if(r)return r}return null}function We(e,t){return {...e,children:t}}function Bd(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunk6KA3L3FR_cjs.da}function jd(e){if(e.root.kind==="document"){let t=e.root.children.find(n=>n.kind==="body");return t&&ze(t)?t:null}return ze(e.root)?e.root:null}function Hd(e,t){return es(e).some(n=>t.has(n))}function Zr(e,t,n){for(let r of e)if(ze(r)){if(r.kind==="paragraph"){t.inRange.has(r.id)&&n.push(r);continue}if(t.fullBlocks.has(r.id)){n.push(r);continue}if(r.kind==="table"){Zi(r,t,n);continue}if(r.kind==="contentControl"){let o=r.children.find(i=>i.kind==="contentControlContent");o&&ze(o)&&Zr(o.children,t,n);continue}Hd(r,t.inRange)&&Zr(r.children,t,n);}}var Vd=new Set(["commentRangeStart","commentRangeEnd"]);function Wd(e){return e.kind==="run"&&e.children.some(t=>t.kind==="commentReference")}function eo(e){if(e.kind==="textValue")return e;if(Vd.has(e.localName)&&e.namespaceUri===chunk6KA3L3FR_cjs.da||Wd(e)||Bd(e,"sectPr"))return null;let t=false,n=[];for(let r of e.children){let o=eo(r);if(o===null){t=true;continue}o!==r&&(t=true),n.push(o);}return t?We(e,n):e}function zd(e){let t=[],n=l=>{if(l.kind!=="textValue"){if(l.kind==="run"){for(let d of l.children)if(d.kind==="fldChar"){let c=chunk6KA3L3FR_cjs.Se(d,"fldCharType");t.push({nodeId:d.id,type:c==="separate"||c==="end"?c:"begin"});}else d.kind==="instrText"&&t.push({nodeId:d.id,type:"instr"});return}for(let d of l.children)n(d);}};for(let l of e)n(l);if(t.length===0)return e;let r=new Set,o=[],i=null,a=[];for(let l of t){if(l.type==="begin"){o.push({beginId:l.nodeId,separateId:null,instrIds:[]});continue}if(l.type==="separate"){let c=o[o.length-1];c?c.separateId=l.nodeId:i=l.nodeId;continue}if(l.type==="instr"){let c=o[o.length-1];c?c.instrIds.push(l.nodeId):i===null&&a.push(l.nodeId);continue}if(!o.pop()){r.add(l.nodeId),i!==null&&r.add(i);for(let c of a)r.add(c);i=null,a=[];}}for(let l of o){r.add(l.beginId),l.separateId!==null&&r.add(l.separateId);for(let d of l.instrIds)r.add(d);}i!==null&&r.add(i);for(let l of a)r.add(l);if(r.size===0)return e;let s=l=>{if(l.kind==="textValue")return l;if(r.has(l.id))return null;let d=[],c=false;for(let u of l.children){let p=s(u);if(p===null){c=true;continue}p!==u&&(c=true),d.push(p);}return c?We(l,d):l};return e.map(l=>s(l)).filter(l=>l!==null)}function to(e){if(e.kind==="textValue")return e.value.length;let t=0;for(let n of e.children)t+=to(n);return t}function Kd(e,t){let n=[];for(let r of e.children){if(r.kind!=="contentControl"){n.push(r);continue}let o=t.get(r.id),i=to(r);if(o===void 0||i>=o){n.push(r);continue}if(i===0)continue;let a=r.children.find(s=>s.kind==="contentControlContent");a&&ze(a)?n.push(...a.children):n.push(r);}return We(e,n)}function Gd(e){let t=new Set,n=new Set,r=a=>{if(a.kind!=="textValue"){if(a.kind==="bookmarkStart"){let s=chunk6KA3L3FR_cjs.Se(a,"id");s!==void 0&&t.add(s);}if(a.kind==="bookmarkEnd"){let s=chunk6KA3L3FR_cjs.Se(a,"id");s!==void 0&&n.add(s);}for(let s of a.children)r(s);}};for(let a of e)r(a);let o=new Set([...t].filter(a=>n.has(a)));if(o.size===t.size&&o.size===n.size)return e;let i=a=>{if(a.kind==="textValue")return a;if(a.kind==="bookmarkStart"||a.kind==="bookmarkEnd"){let d=chunk6KA3L3FR_cjs.Se(a,"id");return d!==void 0&&o.has(d)?a:null}let s=[],l=false;for(let d of a.children){let c=i(d);if(c===null){l=true;continue}c!==d&&(l=true),s.push(c);}return l?We(a,s):a};return e.map(a=>i(a)??a)}function Xd(e,t,n){let r=e.parts.get(t.partName);if(!r)return {ok:false,reason:"unknown-part"};if(t.paragraphIds.length===0)return {ok:false,reason:"empty-range"};let o=t.paragraphIds[0],i=t.paragraphIds[t.paragraphIds.length-1],a=new Map;for(let S of [o,i]){let L=Qr(r.root,S);if(!L)return {ok:false,reason:"empty-range"};for(let H of L.children)H.kind==="contentControl"&&a.set(H.id,to(H));}let s=r,l=Qr(s.root,i);if(!l)return {ok:false,reason:"empty-range"};let d=chunk6KA3L3FR_cjs.ff(l);if(t.endOffset<d){let S=chunk6KA3L3FR_cjs.qj(s,{op:"deleteText",paragraphId:i,start:t.endOffset,end:d},{deferValidation:true});if(!S.ok)return {ok:false,reason:"trim-refused"};s=S.part;}if(t.startOffset>0){let S=chunk6KA3L3FR_cjs.qj(s,{op:"deleteText",paragraphId:o,start:0,end:t.startOffset},{deferValidation:true});if(!S.ok)return {ok:false,reason:"trim-refused"};s=S.part;}let c=jd(s);if(!c)return {ok:false,reason:"unknown-part"};let u={inRange:new Set(t.paragraphIds),covered:new Set(t.coveredParagraphIds),fullBlocks:new Set(t.fullyCoveredBlockIds)},p=[];if(Zr(c.children,u,p),p.length===0)return {ok:false,reason:"empty-range"};if(p.length>Ud)return {ok:false,reason:"resource-limit"};let R=p.map(S=>eo(S)).filter(S=>S!==null).map(S=>S.kind!=="paragraph"||S.id!==o&&S.id!==i?S:Kd(S,a));R=[...zd(R)],R=[...Gd(R)];let m=chunk6KA3L3FR_cjs.bg(e,"footnote"),h=chunk6KA3L3FR_cjs.bg(e,"endnote"),g=(S,L)=>ze(S)&&S.namespaceUri===chunk6KA3L3FR_cjs.da&&S.localName===L,k=$n(R,(S,L)=>{let H=S==="footnote"?m:h;if(!H||!ze(H.root))return null;for(let Q of H.root.children){if(!g(Q,S))continue;let ae=chunk6KA3L3FR_cjs.Se(Q,"id");if(ae!==void 0&&Ce(ae)===L)return Q}return null}),f=k.footnote,v=k.endnote;f.size===0&&(m=null),v.size===0&&(h=null);let O=(S,L,H)=>{if(!S||!ze(S.root))return [];let Q=[];for(let ae of S.root.children){if(!g(ae,L))continue;let q=chunk6KA3L3FR_cjs.Se(ae,"id"),et=chunk6KA3L3FR_cjs.Se(ae,"type");if(et==="separator"||et==="continuationSeparator"){Q.push(ae);continue}if(q!==void 0&&H.has(Ce(q))){let ht=eo(ae);ht&&ze(ht)&&Q.push(ht);}}return Q},P=O(m,"footnote",f),y=O(h,"endnote",v),T=[...P,...y];if(Xt(R)||Xt(T))return {ok:false,reason:"unsupported-content"};let N=[...R,...T],j=new Set;Gr(N,j);let z=Vi(e,e.mainDocumentPart),ee=new Set;Xr(N,ee);let X=[],_=qr(e,e.mainDocumentPart,ee);for(;;){let S=j.size,L=ee.size;X=Wi(z,j),Xr(X,ee),_=qr(e,e.mainDocumentPart,ee);let H=[..._.nums,..._.abstracts];Gr(H,j);for(let Q of H)qe(Q,ae=>{if(ae.kind!=="textValue"&&(ae.localName==="styleLink"||ae.localName==="numStyleLink")&&ae.namespaceUri===chunk6KA3L3FR_cjs.da){let q=chunk6KA3L3FR_cjs.Se(ae,"val");q&&j.add(q);}});if(j.size===S&&ee.size===L)break}let B=zi(e,e.mainDocumentPart),ie=X.map(S=>Qe(S,B)),be=z.docDefaults?Qe(z.docDefaults,B):null;R=R.map(S=>Qe(S,B));let $=P.map(S=>Qe(S,B)),U=y.map(S=>Qe(S,B)),Y=new Set;Yt(R,Y);let w=chunk6KA3L3FR_cjs.Md(e,r.name).filter(S=>Y.has(S.id)),I=new Map,D=0,K=S=>{let L=new Set;for(let H of S){if(H.targetMode==="External")continue;let Q=chunk6KA3L3FR_cjs.w(H.ownerPart,H.rawTarget);if(!Q.ok){L.add(H.id);continue}if((chunk6KA3L3FR_cjs.Nd(e,Q.partName)??"").toLowerCase().startsWith("image/")&&n?.omitMedia!==true){let q=e.partBytes.get(Q.partName)??e.partBytes.get(Q.partName.replace(/^\//,""));q?(I.set(Q.partName,q),D+=q.byteLength):L.add(H.id);continue}L.add(H.id);}return L},te=K(w),se=(S,L)=>{if(S.kind==="textValue")return S;if(S.kind==="drawing"||S.namespaceUri===chunk6KA3L3FR_cjs.da&&(S.localName==="pict"||S.localName==="object")){let ae=new Set;Yt([S],ae);for(let q of ae)if(L.has(q))return null;return S}let H=[],Q=false;for(let ae of S.children){let q=se(ae,L);if(q===null){Q=true;continue}q!==ae&&(Q=true),H.push(q);}return Q?We(S,H):S};te.size>0&&(R=R.map(S=>se(S,te)).filter(S=>S!==null));let G=w.filter(S=>!te.has(S.id)),Ue=(S,L)=>{if(!S)return [];let H=new Set;Yt(L,H);let Q=chunk6KA3L3FR_cjs.Md(e,S.name).filter(q=>H.has(q.id)),ae=K(Q);if(ae.size>0)for(let q=0;q<L.length;q+=1){let et=se(L[q],ae);et!==null&&(L[q]=et);}return Q.filter(q=>!ae.has(q.id))},ge=Ue(m,$),ln=Ue(h,U),Ne=new Map,ft=[],Ft=new Map,gt=(S,L,H)=>{let Q=Ki(S,L,H);Ne.set(S.slice(1),chunk6KA3L3FR_cjs.Sa(chunk6KA3L3FR_cjs.qa(Q))),ft.push([S,L]),Ft.set(S,Q);},Lt=(S,L)=>S.map(H=>{if(H.targetMode==="External")return {...H,ownerPart:L};let Q=chunk6KA3L3FR_cjs.w(H.ownerPart,H.rawTarget);return {...H,ownerPart:L,rawTarget:Q.ok?Q.partName:H.rawTarget}}),b=Lt(G,"/word/document.xml"),M=Lt(ge,"/word/footnotes.xml"),C=Lt(ln,"/word/endnotes.xml"),F=new Set(b.map(S=>S.id)),W=9001,J=(S,L)=>{let H=Xi(F,W);W+=1,F.add(H),b.push({ownerPart:"/word/document.xml",id:H,type:S,rawTarget:L,targetMode:"Internal",order:b.length});},ce=Gi(s,R);if(gt("/word/document.xml",Ai,ce),z.part&&(ie.length>0||be)){let S=We(z.part.root,[...be?[be]:[],...ie]);gt("/word/styles.xml",_i,S),J(zr,"styles.xml");}if(_.part&&(_.nums.length>0||_.abstracts.length>0)){let S=We(_.part.root,[..._.abstracts.map(L=>Qe(L,B)),..._.nums]);gt("/word/numbering.xml",Fi,S),J(Kr,"numbering.xml");}m&&$.length>0&&(gt("/word/footnotes.xml",Li,We(m.root,$)),J(Ui,"footnotes.xml"),M.length>0&&Ne.set("word/_rels/footnotes.xml.rels",chunk6KA3L3FR_cjs.Sa(Jt(M)))),h&&U.length>0&&(gt("/word/endnotes.xml",$i,We(h.root,U)),J(Bi,"endnotes.xml"),C.length>0&&Ne.set("word/_rels/endnotes.xml.rels",chunk6KA3L3FR_cjs.Sa(Jt(C))));let pe=new Map;for(let[S,L]of I){Ne.set(S.slice(1),L);let H=Yi(S);H&&!pe.has(H)&&pe.set(H,chunk6KA3L3FR_cjs.Nd(e,S)??"application/octet-stream");}let V={ownerPart:"/",id:"rId1",type:ji,rawTarget:"word/document.xml",targetMode:"Internal",order:0};Ne.set("word/_rels/document.xml.rels",chunk6KA3L3FR_cjs.Sa(Jt(b))),Ne.set("_rels/.rels",chunk6KA3L3FR_cjs.Sa(Jt([V])));let de=[`<Default Extension="rels" ContentType="${Wr}"/>`,'<Default Extension="xml" ContentType="application/xml"/>',...[...pe].map(([S,L])=>`<Default Extension="${chunk6KA3L3FR_cjs.N(S)}" ContentType="${chunk6KA3L3FR_cjs.N(L)}"/>`)].join(""),Se=ft.map(([S,L])=>`<Override PartName="${chunk6KA3L3FR_cjs.N(S)}" ContentType="${chunk6KA3L3FR_cjs.N(L)}"/>`).join("");Ne.set("[Content_Types].xml",chunk6KA3L3FR_cjs.Sa(`<Types xmlns="${$d}">${de}${Se}</Types>`));let le=new Map;le.set("/",[V]),le.set("/word/document.xml",b),M.length>0&&le.set("/word/footnotes.xml",M),C.length>0&&le.set("/word/endnotes.xml",C);let Ee=[];for(let S of le.values())for(let L of S)L.targetMode==="External"&&Ee.push({ownerPart:L.ownerPart,id:L.id,type:L.type,rawTarget:L.rawTarget,sinkSafe:chunk6KA3L3FR_cjs.x(L.rawTarget).ok});let ne=new Map;ne.set("rels",Wr),ne.set("xml","application/xml");for(let[S,L]of pe)ne.set(S,L);let me={defaults:ne,overrides:new Map(ft)},he=new Map;for(let[S,L]of Ne)he.set(S.startsWith("/")?S:`/${S}`,L);return {ok:true,bytes:chunk6KA3L3FR_cjs.Ra(Ne),package:Object.freeze({parts:Ft,partBytes:he,relationships:le,externalTargets:Ee,contentTypes:me,mainDocumentPart:"/word/document.xml"}),lastMarkCovered:t.lastMarkCovered,blockCount:R.length,mediaBytes:D}}function xe(e){return e.kind!=="textValue"}function re(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunk6KA3L3FR_cjs.da}function Fe(e,t){for(let n of e)t(n),n.kind!=="textValue"&&Fe(n.children,t);}function Ke(e){if(e.kind==="textValue")return `T(${e.value})`;if(e.namespaceUri===chunk6KA3L3FR_cjs.da&&e.localName.startsWith("rsid"))return "";let t=e.attributes.filter(r=>!r.localName.startsWith("rsid")&&!(r.namespaceUri===chunk6KA3L3FR_cjs.ga&&(r.localName==="paraId"||r.localName==="textId"))).map(r=>`${r.namespaceUri}|${r.localName}=${r.value}`).sort().join(","),n=e.children.map(Ke).join("");return `E(${e.namespaceUri}:${e.localName}[${t}]{${n}})`}function Qt(e){return `S[${e.attributes.filter(n=>n.localName!=="styleId").map(n=>`${n.localName}=${n.value}`).sort().join(",")}]${e.children.map(Ke).join("")}`}function Vn(e){let t=[],n=new Map,r=new Set,o=null;if(e&&xe(e.root))for(let i of e.root.children){if(!xe(i))continue;if(re(i,"docDefaults")){o=i;continue}if(!re(i,"style"))continue;t.push(i);let a=chunk6KA3L3FR_cjs.Se(i,"styleId");a&&n.set(a,i);let s=i.children.find(d=>re(d,"name")),l=s?chunk6KA3L3FR_cjs.Se(s,"val"):void 0;l&&r.add(l);}return {part:e,styles:t,docDefaults:o,byId:n,names:r}}function jn(e,t,n){let r=new Map;if(!e)return r;let o=e.children.find(a=>re(a,t));if(!o||!xe(o))return r;let i=o.children.find(a=>re(a,n));if(!i||!xe(i))return r;for(let a of i.children)a.kind!=="textValue"&&r.set(a.localName,a);return r}function no(e,t,n,r){let o=t;for(let i=0;i<16&&o;i+=1){let a=e.byId.get(o);if(!a)return false;let s=a.children.find(d=>re(d,n));if(s&&xe(s)&&s.children.some(d=>d.kind!=="textValue"&&d.localName===r))return true;let l=a.children.find(d=>re(d,"basedOn"));o=l?chunk6KA3L3FR_cjs.Se(l,"val"):void 0;}return false}function Yd(e,t){for(let n of e.styles){if(chunk6KA3L3FR_cjs.Se(n,"type")!==t)continue;let r=chunk6KA3L3FR_cjs.Se(n,"default");if(r==="1"||r==="true")return chunk6KA3L3FR_cjs.Se(n,"styleId")}}function Hn(e,t){let n=e.children.find(r=>re(r,t));return n&&xe(n)?n:null}var Jd=new Map(["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"].map((e,t)=>[e,t])),qd=new Map(["rStyle","rFonts","b","bCs","i","iCs","caps","smallCaps","strike","dstrike","outline","shadow","emboss","imprint","noProof","snapToGrid","vanish","webHidden","color","spacing","w","kern","position","sz","szCs","highlight","u","effect","bdr","shd","fitText","vertAlign","rtl","cs","em","lang","eastAsianLayout","specVanish","oMath","rPrChange"].map((e,t)=>[e,t]));function ro(e,t,n){let r=jn(t.docDefaults,"rPrDefault","rPr"),o=jn(n.docDefaults,"rPrDefault","rPr"),i=jn(t.docDefaults,"pPrDefault","pPr"),a=jn(n.docDefaults,"pPrDefault","pPr"),s=(g,x,k)=>{let f=Yd(g,"paragraph"),v=f?g.byId.get(f):void 0;if(!v)return f;for(let[O,P]of [["rPr",x],["pPr",k]]){let y=Hn(v,O);if(y)for(let T of y.children)T.kind!=="textValue"&&P.set(T.localName,T);}return f};s(t,r,i),s(n,o,a);let l=new Map;for(let[g,x]of r){let k=o.get(g);(!k||Ke(k)!==Ke(x))&&l.set(g,x);}let d=new Map;for(let[g,x]of i){if(g==="sectPr")continue;let k=a.get(g);(!k||Ke(k)!==Ke(x))&&d.set(g,x);}if(l.size===0&&d.size===0)return e;let c=0,u=()=>`fragment#materialized-${c++}`,p=g=>{let x=k=>k.kind==="textValue"?{id:u(),kind:"textValue",value:k.value}:{...k,id:u(),children:k.children.map(x)};return x(g)},R=(g,x,k)=>{if(k.length===0)return g;let f=Hn(g,x);if(f){let O=x==="rPr"?qd:Jd,P=[...f.children];for(let T of k){let N=T.kind==="textValue"?Number.MAX_SAFE_INTEGER:O.get(T.localName)??Number.MAX_SAFE_INTEGER,j=P.length;for(let z=0;z<P.length;z+=1){let ee=P[z];if(ee.kind==="textValue")continue;let X=O.get(ee.localName);if(X!==void 0&&X>N){j=z;break}}P.splice(j,0,T);}let y={...f,children:P};return {...g,children:g.children.map(T=>T===f?y:T)}}let v={id:u(),kind:x==="rPr"?"runProperties":"paragraphProperties",namespaceUri:chunk6KA3L3FR_cjs.da,localName:x,prefix:"w",namespaceBindings:[],attributes:[],children:k};return {...g,children:[v,...g.children]}},m=g=>{let x=Hn(g,"pPr"),k=x?.children.find(y=>re(y,"pStyle")),f=k?chunk6KA3L3FR_cjs.Se(k,"val"):void 0,v=[];for(let[y,T]of d)x?.children.some(j=>j.kind!=="textValue"&&j.localName===y)||f&&no(t,f,"pPr",y)||v.push(p(T));let O=y=>{if(y.kind==="textValue")return y;if(y.kind==="run"){let N=Hn(y,"rPr"),j=N?.children.find(X=>re(X,"rStyle")),z=j?chunk6KA3L3FR_cjs.Se(j,"val"):void 0,ee=[];for(let[X,_]of l)N?.children.some(ie=>ie.kind!=="textValue"&&ie.localName===X)||z&&no(t,z,"rPr",X)||f&&no(t,f,"rPr",X)||ee.push(p(_));return R(y,"rPr",ee)}if(y.kind==="paragraphProperties"||y.kind==="runProperties")return y;let T=y.children.map(O);return T.some((N,j)=>N!==y.children[j])?{...y,children:T}:y};return O(R(g,"pPr",v))},h=g=>{if(g.kind==="textValue")return g;if(g.kind==="paragraph")return m(g);let x=g.children.map(h);return x.some((k,f)=>k!==g.children[f])?{...g,children:x}:g};return e.map(h)}var ts="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function Re(e,t,n,r){return {...e,attributes:e.attributes.map(o=>o.localName===n&&o.namespaceUri===t?{...o,value:r}:o)}}var Qd=new Set(["pStyle","rStyle","tblStyle","basedOn","link","next","styleLink","numStyleLink"]),oo=chunk6KA3L3FR_cjs.kg,Ge=new Map;function wt(e,t){let n=t.styleIds??Ge,r=t.numIds??Ge,o=t.relIds??Ge,i=t.footnoteIds??Ge,a=t.endnoteIds??Ge,s=t.bookmarkIds??Ge,l=t.sdtIds??Ge,d=t.revisionIds??Ge,c=t.docPrIds??Ge,u=(p,R)=>{if(p.kind==="textValue")return p;let m=p;if(p.namespaceUri===chunk6KA3L3FR_cjs.da&&Qd.has(p.localName)){let k=chunk6KA3L3FR_cjs.Se(p,"val"),f=k!==void 0?n.get(k):void 0;f!==void 0&&(m=Re(m,chunk6KA3L3FR_cjs.da,"val",f));}if(re(p,"numId")){let k=chunk6KA3L3FR_cjs.Se(p,"val"),f=k!==void 0?r.get(k):void 0;f!==void 0&&(m=Re(m,chunk6KA3L3FR_cjs.da,"val",f));}if(p.kind==="noteReference"){let k=p.localName==="footnoteReference"?i:a,f=chunk6KA3L3FR_cjs.Se(p,"id"),v=f!==void 0?k.get(Ce(f)):void 0;v!==void 0&&(m=Re(m,chunk6KA3L3FR_cjs.da,"id",v));}if(p.kind==="bookmarkStart"||p.kind==="bookmarkEnd"){let k=chunk6KA3L3FR_cjs.Se(p,"id"),f=k!==void 0?s.get(k):void 0;f!==void 0&&(m=Re(m,chunk6KA3L3FR_cjs.da,"id",f));}if(re(p,"id")&&R==="sdtPr"){let k=chunk6KA3L3FR_cjs.Se(p,"val"),f=k!==void 0?l.get(k):void 0;f!==void 0&&(m=Re(m,chunk6KA3L3FR_cjs.da,"val",f));}if(oo(p)){let k=chunk6KA3L3FR_cjs.Se(p,"id"),f=k!==void 0?d.get(k):void 0;f!==void 0&&(m=Re(m,chunk6KA3L3FR_cjs.da,"id",f));}if(p.kind==="drawingDocPr"){let k=p.attributes.find(v=>v.localName==="id"&&v.namespaceUri==="")?.value,f=k!==void 0?c.get(k):void 0;f!==void 0&&(m=Re(m,"","id",f));}for(let k of m.attributes){if(k.namespaceUri!==ts)continue;let f=o.get(k.value);f!==void 0&&f!==k.value&&(m=Re(m,ts,k.localName,f));}let h=p.localName,g=m.children.map(k=>u(k,h));return m!==p||g.some((k,f)=>k!==m.children[f])?{...m,children:g}:p};return u(e,"")}function ns(e,t,n){let r=e,o=n.get(e)??2;for(;t.has(r);)r=`${e}${o}`,o+=1;return n.set(e,o),r}function rs(e,t,n){let r=`${e} (pasted)`,o=n.get(e)??2;for(;t.has(r);)r=`${e} (pasted ${o})`,o+=1;return n.set(e,o),r}var Zd=1e5;function os(e){let t=chunk6KA3L3FR_cjs.hb(),n=ec(e,t),r=tc(e,t),o=nc(e,t);return !n||!r||!o?null:{bookmarkIds:n,revisionIds:r,docPrIds:o}}function ao(e,t,n,r){if(e)return chunk6KA3L3FR_cjs.jb(t,e,r);let o=n;return ()=>String(o++)}function as(e,t){if(e.add(t),!/^\d{1,10}$/.test(t))return;let n=Number(t);n<=chunk6KA3L3FR_cjs.fb&&e.add(String(n));}function is(e,t){if(t===void 0)return e;let n=Number(t);return Number.isInteger(n)&&n>e?n:e}function ec(e,t){let n=new Map;if(e.fragmentBookmarkIds.length===0)return n;let r=0,o=new Set;for(let a of [e.ownerPart,...e.notesParts])Fe([a.root],s=>{if(s.kind!=="bookmarkStart"&&s.kind!=="bookmarkEnd")return;let l=chunk6KA3L3FR_cjs.Se(s,"id");l!==void 0&&(as(o,l),s.kind==="bookmarkStart"&&(r=is(r,l)));});let i=ao(t,o,r+1,chunk6KA3L3FR_cjs.fb);for(let a of e.fragmentBookmarkIds){if(n.has(a))continue;let s=i();if(s===null)return null;n.set(a,s);}return n}function tc(e,t){let n=new Map;if(!e.hasRevision)return n;let r=0,o=new Set;for(let s of [e.ownerPart,...e.notesParts]){let l=s===e.ownerPart;Fe([s.root],d=>{if(!chunk6KA3L3FR_cjs.kg(d))return;let c=chunk6KA3L3FR_cjs.Se(d,"id");c!==void 0&&as(o,c),l&&(r=is(r,c));});}let i=ao(t,o,r+1,chunk6KA3L3FR_cjs.fb),a=false;return Fe(e.travelling,s=>{if(a||!chunk6KA3L3FR_cjs.kg(s))return;let l=chunk6KA3L3FR_cjs.Se(s,"id");if(l===void 0||n.has(l))return;let d=i();d===null?a=true:n.set(l,d);}),a?null:n}function nc(e,t){let n=new Map;if(!e.hasDocPr)return n;let{used:r}=chunk6KA3L3FR_cjs.ud(e.pkg),o=Zd;if(!t){let s=chunk6KA3L3FR_cjs.vd(e.pkg);s.ok&&(o=s.id);}let i=ao(t,r,o,chunk6KA3L3FR_cjs.td),a=false;return Fe(e.travelling,s=>{if(a||s.kind==="textValue"||s.kind!=="drawingDocPr")return;let l=s.attributes.find(c=>c.localName==="id"&&c.namespaceUri==="")?.value;if(l===void 0||n.has(l))return;let d=i();d===null?a=true:n.set(l,d);}),a?null:n}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/relationships",rc=`${Nt}/hyperlink`,ss=`${Nt}/image`,Wn=`${Nt}/numbering`,io=`${Nt}/styles`,ls="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",ds="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function Zt(e,t,n,r){for(let o of chunk6KA3L3FR_cjs.Md(e,t)){if(o.type!==n||o.targetMode==="External")continue;let i=chunk6KA3L3FR_cjs.w(o.ownerPart,o.rawTarget);if(i.ok){let a=e.parts.get(i.partName);if(a)return a}}return e.parts.get(r)??null}function so(e,t){let n=0;return Fe([e],r=>{let o=t(r);if(o===void 0)return;let i=Number(o);Number.isInteger(i)&&i>n&&(n=i);}),n}function zn(e,t,n,r){if(n.length===0)return e;let o=chunk6KA3L3FR_cjs.Fa(t,"paste"),i=n.map(d=>chunk6KA3L3FR_cjs.Xe(d,o)),a=chunk6KA3L3FR_cjs.oj(t,i),s=r??a.root.children.length,l=chunk6KA3L3FR_cjs.La(a,a.root.id,s,i,{deferValidation:true});return l.ok?chunk6KA3L3FR_cjs.Kd(e,l.part):null}function cs(e,t){if(t.size===0)return [...e];let n=o=>{if(o.kind==="textValue")return o;if(o.kind==="drawing"||re(o,"pict")||re(o,"object")){let a=false;return Fe([o],s=>{if(s.kind!=="textValue")for(let l of s.attributes)l.namespaceUri===Nt&&t.has(l.value)&&(a=true);}),a?null:o}if(o.kind==="hyperlink"){let a=o.attributes.find(s=>s.namespaceUri===Nt)?.value;if(a!==void 0&&t.has(a))return r(o.children)}let i=r(o.children);return i.length===o.children.length&&i.every((a,s)=>a===o.children[s])?o:{...o,children:i}};function r(o){let i=[];for(let a of o){let s=n(a);s!==null&&(Array.isArray(s)?i.push(...s):i.push(s));}return i}return r(e)}var oc=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),ms={"image/jpg":"image/jpeg","image/x-ms-bmp":"image/bmp","image/x-bmp":"image/bmp"};function ac(e,t){let n=chunk6KA3L3FR_cjs.jd(e);return n==="unknown"||(Object.hasOwn(ms,t)?ms[t]:t)!==n||oc.has(n)&&!chunk6KA3L3FR_cjs.wd(e,n)?null:n}function lo(e,t,n){for(let b of t.parts.values())if(Xt([b.root]))return {ok:false,reason:"unsupported-content"};let r=t.parts.get(t.mainDocumentPart);if(!r)return {ok:false,reason:"no-fragment-document"};if(!e.parts.has(n))return {ok:false,reason:"no-target-part"};let o=r.root.kind==="document"?r.root.children.find(b=>b.kind==="body"):null;if(!o||!xe(o))return {ok:false,reason:"no-fragment-document"};let i=chunk6KA3L3FR_cjs.pj(o.children.filter(b=>b.kind==="paragraph"||b.kind==="table"||b.kind==="contentControl"));if(i.length===0)return {ok:false,reason:"no-fragment-document"};let a=e,s=Zt(t,t.mainDocumentPart,Wn,"/word/numbering.xml"),l=new Map,d=[],c=[];if(s&&xe(s.root)){let b=new Map,M=[];for(let V of s.root.children)if(xe(V))if(re(V,"abstractNum")){let de=chunk6KA3L3FR_cjs.Se(V,"abstractNumId");de&&b.set(de,V);}else re(V,"num")&&M.push(V);let C=Zt(a,a.mainDocumentPart,Wn,"/word/numbering.xml"),F=new Map,W=new Map;if(C&&xe(C.root)){for(let V of C.root.children)if(xe(V)&&re(V,"abstractNum")){let de=chunk6KA3L3FR_cjs.Se(V,"abstractNumId");de&&W.set(de,V);}for(let V of C.root.children){if(!xe(V)||!re(V,"num"))continue;let de=chunk6KA3L3FR_cjs.Se(V,"numId");if(!de)continue;let Se=V.children.find(ne=>re(ne,"abstractNumId")),le=Se?chunk6KA3L3FR_cjs.Se(Se,"val"):void 0,Ee=le?W.get(le):void 0;F.set(`${Ee?Qt(Ee):"none"}::${V.children.filter(ne=>re(ne,"lvlOverride")).map(Ke).join("")}`,de);}}let J=(C?so(C.root,V=>V.kind!=="textValue"&&re(V,"abstractNum")?chunk6KA3L3FR_cjs.Se(V,"abstractNumId"):void 0):0)+1,ce=(C?so(C.root,V=>V.kind!=="textValue"&&re(V,"num")?chunk6KA3L3FR_cjs.Se(V,"numId"):void 0):0)+1,pe=new Map;for(let V of M){let de=chunk6KA3L3FR_cjs.Se(V,"numId");if(!de)continue;let Se=V.children.find(H=>re(H,"abstractNumId")),le=Se?chunk6KA3L3FR_cjs.Se(Se,"val"):void 0,Ee=le?b.get(le):void 0,ne=`${Ee?Qt(Ee):"none"}::${V.children.filter(H=>re(H,"lvlOverride")).map(Ke).join("")}`,me=F.get(ne);if(me!==void 0){l.set(de,me);continue}let he=le?pe.get(le):void 0;he===void 0&&Ee&&le&&(he=String(J++),pe.set(le,he),c.push(Re(Ee,chunk6KA3L3FR_cjs.da,"abstractNumId",he)));let S=String(ce++);l.set(de,S);let L=Re(V,chunk6KA3L3FR_cjs.da,"numId",S);if(he!==void 0){let H=L.children.map(Q=>re(Q,"abstractNumId")?Re(Q,chunk6KA3L3FR_cjs.da,"val",he):Q);L={...L,children:H};}d.push(L),F.set(ne,S);}}let u=Vn(Zt(t,t.mainDocumentPart,io,"/word/styles.xml")),p=Zt(a,a.mainDocumentPart,io,"/word/styles.xml"),R=Vn(p),m=new Map,h=[],g=new Set(R.byId.keys()),x=new Set(R.names),k=new Map,f=new Map,v=new Map,O=(b,M)=>{let C=v.get(b);return C===void 0&&(C=Qt(M),v.set(b,C)),C},P=b=>({...b,attributes:b.attributes.filter(M=>!(M.localName==="default"&&M.namespaceUri===chunk6KA3L3FR_cjs.da))});for(let b of u.styles){let M=chunk6KA3L3FR_cjs.Se(b,"styleId");if(!M)continue;let C=R.byId.get(M),F=Qt(wt(b,{styleIds:m,numIds:l}));if(C&&O(M,C)===F){m.set(M,M);continue}if(!C){m.set(M,M),g.add(M),h.push(P(b));continue}let W=ns(`${M}Pasted`,g,k);g.add(W),m.set(M,W),h.push(P(Re(b,chunk6KA3L3FR_cjs.da,"styleId",W)));}let y=h.map(b=>{let M=b.children.find(J=>re(J,"name")),C=M?chunk6KA3L3FR_cjs.Se(M,"val"):void 0;if(!C||!x.has(C))return C&&x.add(C),b;let F=rs(C,x,f);x.add(F);let W=b.children.map(J=>re(J,"name")?Re(J,chunk6KA3L3FR_cjs.da,"val",F):J);return {...b,children:W}}),T=null,N=1,j=()=>{if(T)return T;let b=new Map;for(let[M,C]of a.partBytes){let F=M.startsWith("/")?M:`/${M}`;if(!F.startsWith("/word/media/"))continue;b.set(chunk6KA3L3FR_cjs.a(C),F);let W=/\/image(\d+)\./.exec(F);W&&(N=Math.max(N,Number(W[1])+1));}return T=b,b},z=new Map,ee=b=>{let M=z.get(b);if(!M){M=new Map;for(let C of chunk6KA3L3FR_cjs.Md(a,b)){if(C.targetMode==="External"||C.type!==ss)continue;let F=chunk6KA3L3FR_cjs.w(C.ownerPart,C.rawTarget);F.ok&&M.set(F.partName,C.id);}z.set(b,M);}return M},X=(b,M)=>{let C=b.lastIndexOf("."),F=C===-1?"":b.slice(C+1);return /^[A-Za-z0-9]{1,8}$/.test(F)?F.toLowerCase():M==="image/jpeg"?"jpeg":M==="image/gif"?"gif":"png"},_=(b,M,C)=>{let F=new Map,W=new Set,J=ee(M),ce=[],pe=new Set,V=[],de=[],Se=new Map,le=[],Ee=t.relationships.get(b)??[];for(let ne of Ee){if(!C.has(ne.id))continue;if(ne.targetMode==="External"){if(ne.type===rc){let yt=chunk6KA3L3FR_cjs.Gf(a,ne.rawTarget,M);yt?(a=yt.pkg,F.set(ne.id,yt.relationshipId)):W.add(ne.id);}else W.add(ne.id);continue}let me=chunk6KA3L3FR_cjs.w(ne.ownerPart,ne.rawTarget);if(!me.ok){W.add(ne.id);continue}let he=t.partBytes.get(me.partName)??t.partBytes.get(me.partName.replace(/^\//,"")),S=(chunk6KA3L3FR_cjs.Nd(t,me.partName)??"").toLowerCase();if(!he||!S.startsWith("image/")){W.add(ne.id);continue}let L=ac(he,S);if(L===null){W.add(ne.id);continue}let H=L,Q=j(),ae=chunk6KA3L3FR_cjs.a(he),q=Q.get(ae);if(!q){let yt=X(me.partName,H),ud=cn=>a.partBytes.has(cn)||a.partBytes.has(cn.slice(1))||a.parts.has(cn)||pe.has(cn),or=`/word/media/image${N}.${yt}`;for(;ud(or);)N+=1,or=`/word/media/image${N}.${yt}`;N+=1,q=or,ce.push({partName:q,bytes:he,contentType:H}),pe.add(q),Q.set(ae,q);}let et=q.startsWith("/word/")?q.slice(6):q,ht=J.get(q);if(ht!==void 0){F.set(ne.id,ht);continue}let dn=Se.get(q);dn===void 0&&(dn=V.length,Se.set(q,dn),V.push(et),de.push(q)),le.push({recordId:ne.id,index:dn});}if(ce.length>0&&(a=chunk6KA3L3FR_cjs.Ad(a,ce)),V.length>0){let ne=chunk6KA3L3FR_cjs.Qd(chunk6KA3L3FR_cjs.Rd(a,M),M,V.map(me=>[ss,me]));if(ne.ok){a=ne.pkg,ne.ids.forEach((me,he)=>{J.set(de[he],me);});for(let me of le)F.set(me.recordId,ne.ids[me.index]);}else for(let me of le)W.add(me.recordId);}return {relIdMap:F,dropRelIds:W}},B=_(t.mainDocumentPart,n,Yr(i));i=cs(i,B.dropRelIds);let ie=new Map,be=new Map,$=[],U=(b,M)=>xe(b)&&b.namespaceUri===chunk6KA3L3FR_cjs.da&&b.localName===M,Y={},w=$n(i,(b,M)=>{let C=Y[b];if(C===void 0){C=new Map,Y[b]=C;let F=chunk6KA3L3FR_cjs.bg(t,b);if(F&&xe(F.root))for(let W of F.root.children){if(!U(W,b))continue;let J=chunk6KA3L3FR_cjs.Se(W,"id");if(J===void 0)continue;let ce=Ce(J);C.has(ce)||C.set(ce,W);}}return C.get(M)??null});for(let b of ["footnote","endnote"]){let M=b==="footnote"?ie:be,C=w[b];if(C.size===0)continue;let F=chunk6KA3L3FR_cjs.bg(t,b);if(!F||!xe(F.root))continue;let W=chunk6KA3L3FR_cjs.Sg(a,b);if(!W.ok||!W.package)return {ok:false,reason:"merge-refused"};a=W.package;let J=chunk6KA3L3FR_cjs.bg(a,b);if(!J)return {ok:false,reason:"merge-refused"};let ce=so(J.root,V=>U(V,b)?chunk6KA3L3FR_cjs.Se(V,"id"):void 0)+1,pe=[];for(let V of F.root.children){if(!U(V,b))continue;let de=chunk6KA3L3FR_cjs.Se(V,"id"),Se=chunk6KA3L3FR_cjs.Se(V,"type");if(Se==="separator"||Se==="continuationSeparator"||de===void 0||!C.has(Ce(de))||M.has(Ce(de)))continue;let le=String(ce++);M.set(Ce(de),le),pe.push(Re(V,chunk6KA3L3FR_cjs.da,"id",le));}pe.length>0&&$.push({kind:b,fragmentPartName:F.name,bodies:chunk6KA3L3FR_cjs.pj(pe)});}let I=a.parts.get(n),D=[...i,...$.flatMap(b=>b.bodies)],K=[],te=new Set,se=false,G=false,Ue=new Map;Fe(D,b=>{if(b.kind!=="textValue"){if(b.kind==="bookmarkStart"||b.kind==="bookmarkEnd"){let M=chunk6KA3L3FR_cjs.Se(b,"id");if(M!==void 0&&K.push(M),b.kind==="bookmarkStart"){let C=chunk6KA3L3FR_cjs.Se(b,"name");C&&te.add(C);}return}if(oo(b)){se=true;return}if(b.kind==="drawingDocPr"){G=true;return}if(b.kind==="contentControlProperties")for(let M of b.children){if(!re(M,"id"))continue;let C=chunk6KA3L3FR_cjs.Se(M,"val");if(C!==void 0&&!Ue.has(C)){let F=0,W=`${C}:${Ue.size}`;for(let J=0;J<W.length;J+=1)F=F*31+W.charCodeAt(J)>>>0;Ue.set(C,String(F%2147483647||1));}}}});let ge=os({pkg:a,ownerPart:I,notesParts:$.map(b=>chunk6KA3L3FR_cjs.bg(a,b.kind)).filter(b=>b!==null),travelling:D,fragmentBookmarkIds:K,hasRevision:se,hasDocPr:G});if(!ge)return {ok:false,reason:"merge-refused"};let ln=ge.bookmarkIds,Ne=ge.revisionIds,ft=ge.docPrIds;if(te.size>0){let b=new Set;if(Fe([I.root],M=>{if(M.kind!=="textValue"&&M.kind==="bookmarkStart"){let C=chunk6KA3L3FR_cjs.Se(M,"name"),F=chunk6KA3L3FR_cjs.Se(M,"id");C&&F!==void 0&&te.has(C)&&b.add(F);}}),b.size>0){let M=F=>{if(F.kind==="textValue")return F;let W=[],J=false;for(let ce of F.children){if((ce.kind==="bookmarkStart"||ce.kind==="bookmarkEnd")&&b.has(chunk6KA3L3FR_cjs.Se(ce,"id")??"")){J=true;continue}let pe=M(ce);pe!==ce&&(J=true),W.push(pe);}return J?{...F,children:W}:F},C=M(I.root);C!==I.root&&(chunk6KA3L3FR_cjs.Ja(I.root,C),a=chunk6KA3L3FR_cjs.Kd(a,{...I,root:C}));}}let Ft=b=>Jr(b,ie,be);for(let b of $){b.bodies=b.bodies.map(Ft);let M=chunk6KA3L3FR_cjs.bg(a,b.kind);if(!M)return {ok:false,reason:"merge-refused"};let C=_(b.fragmentPartName,M.name,Yr(b.bodies)),F=cs(b.bodies,C.dropRelIds);F=[...ro(F,u,R)],F=F.map(J=>wt(J,{styleIds:m,numIds:l,relIds:C.relIdMap,footnoteIds:ie,endnoteIds:be,bookmarkIds:ln,sdtIds:Ue,revisionIds:Ne,docPrIds:ft}));let W=zn(a,a.parts.get(M.name),F);if(!W)return {ok:false,reason:"merge-refused"};a=W;}if(y.length>0){let b=y.map(C=>wt(C,{styleIds:m,numIds:l}));if(!p){let C=chunk6KA3L3FR_cjs.xa(`<w:styles xmlns:w="${chunk6KA3L3FR_cjs.da}"></w:styles>`,{name:"/word/styles.xml",contentType:ds});if(!C.ok)return {ok:false,reason:"merge-refused"};a=chunk6KA3L3FR_cjs.Td(a,"/word/styles.xml",C.part.root,ds);let F=chunk6KA3L3FR_cjs.Sd(chunk6KA3L3FR_cjs.Rd(a,a.mainDocumentPart),a.mainDocumentPart,io,"styles.xml");if(!F.ok)return {ok:false,reason:"merge-refused"};a=F.pkg,p=a.parts.get("/word/styles.xml")??null;}if(!p)return {ok:false,reason:"merge-refused"};let M=zn(a,a.parts.get(p.name),b);if(!M)return {ok:false,reason:"merge-refused"};a=M,R=Vn(a.parts.get(p.name)??null);}if(c.length>0||d.length>0){let b=Zt(a,a.mainDocumentPart,Wn,"/word/numbering.xml");if(!b){let J=chunk6KA3L3FR_cjs.xa(`<w:numbering xmlns:w="${chunk6KA3L3FR_cjs.da}"></w:numbering>`,{name:"/word/numbering.xml",contentType:ls});if(!J.ok)return {ok:false,reason:"merge-refused"};a=chunk6KA3L3FR_cjs.Td(a,"/word/numbering.xml",J.part.root,ls);let ce=chunk6KA3L3FR_cjs.Sd(chunk6KA3L3FR_cjs.Rd(a,a.mainDocumentPart),a.mainDocumentPart,Wn,"numbering.xml");if(!ce.ok)return {ok:false,reason:"merge-refused"};a=ce.pkg,b=a.parts.get("/word/numbering.xml")??null;}if(!b)return {ok:false,reason:"merge-refused"};let M=a.parts.get(b.name),C=M.root.children.findIndex(J=>re(J,"num")),F=c.map(J=>wt(J,{styleIds:m,numIds:l})),W=zn(a,M,F,C===-1?void 0:C);if(!W)return {ok:false,reason:"merge-refused"};if(a=W,W=zn(a,a.parts.get(b.name),d),!W)return {ok:false,reason:"merge-refused"};a=W;}let Lt=[...ro(i,u,R)].map(Ft).map(b=>wt(b,{styleIds:m,numIds:l,relIds:B.relIdMap,footnoteIds:ie,endnoteIds:be,bookmarkIds:ln,sdtIds:Ue,revisionIds:Ne,docPrIds:ft}));return {ok:true,pkg:a,blocks:Lt}}var us=16*1024*1024;function ic(e){let t=e.parts.get(e.mainDocumentPart);if(!t||t.root.kind!=="document")return false;let n=t.root.children.find(i=>i.kind==="body");if(!n||n.kind!=="body"||n.children.length>chunk6KA3L3FR_cjs.kj)return false;let r=0,o=(i,a,s)=>{if(a>s||(r+=1,r>chunk6KA3L3FR_cjs.mj))return false;if(i.kind==="textValue")return true;for(let l of i.children)if(!o(l,a+1,s))return false;return true};for(let i of n.children)if(!o(i,1,chunk6KA3L3FR_cjs.lj))return false;for(let[i,a]of e.parts)if(i!==e.mainDocumentPart&&/\/(styles|numbering|footnotes|endnotes)\.xml$/.test(i)&&!o(a.root,1,chunk6KA3L3FR_cjs.lj*4))return false;return true}function co(e,t,n){if(n.fragmentBytes.byteLength>us)return {ok:false,reason:"invalidArgs",detail:"fragment-too-large"};let r=chunk6KA3L3FR_cjs.Id(n.fragmentBytes);if(!r.ok)return {ok:false,reason:"invalidArgs",detail:`fragment-read:${r.reason}`};let o=r.package;if(!ic(o))return {ok:false,reason:"invalidArgs",detail:"fragment-over-budget"};let i=e.resolveStory(t);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let{store:a,story:s}=i;if(a.compositionActive||e.compositionSessionOpen())return {ok:false,reason:"invalidArgs",detail:"ime-composition-active"};let l=e.currentPackage(),d=a.checkpoint(),c=0,u="";return chunk6KA3L3FR_cjs.Ca(e,()=>{let p=a.transact(m=>{for(let k of n.priorOps??[])if(!m.apply(k))return;let h=null,g=m.applyPackage(k=>(h=lo(k,o,s.partName),h.ok?h.pkg:k)),x=h;if(!x||!x.ok){u=`fragment-merge:${x?x.reason:"no-merge"}`,m.apply({op:"insertText",paragraphId:"\0fragment-abort",offset:0,text:"x"});return}g&&(c=x.blocks.length,m.apply({op:"insertFragment",paragraphId:n.paragraphId,offset:n.offset,blocks:x.blocks,lastMarkCovered:n.lastMarkCovered}));},{story:s,...n.actorId?{actorId:n.actorId}:{}});return u.length>0?{ok:false,reason:"invalidArgs",detail:u}:p.ok?p.change?{ok:true,change:e.promoteStoryTransactionToPackageUnit(l,a,d),blockCount:c}:{ok:true,change:null,blockCount:c}:{ok:false,reason:p.reason,...p.detail?{detail:p.detail}:{}}},p=>chunk6KA3L3FR_cjs.Da(p))}function ps(){let e=null;return (t,n,r)=>{let o=e;if(e=null,!chunk6KA3L3FR_cjs.Mi(n)||!("paragraphId"in r)||!chunk6KA3L3FR_cjs.Oi(t,r.paragraphId))return r;if(r.op==="insertText"&&!r.revision&&r.inside===void 0&&o&&o.partName===t.name&&o.paragraphId===r.paragraphId&&o.offset===r.offset)return {...r,inside:o.controlId};if(r.op!=="deleteText"||r.revision||r.start>=r.end)return r;let i=chunk6KA3L3FR_cjs.Ha(t,r.paragraphId);if(i?.kind!=="paragraph")return r;let a=chunk6KA3L3FR_cjs.Ti(t,chunk6KA3L3FR_cjs.Si(r));if(a.unprotected.length)return r;let s=chunk6KA3L3FR_cjs.cf(i);for(let l of a.touches){let d=s.spanOf(l.control);d&&d.start<=r.start&&d.end>=r.end&&(e={partName:t.name,paragraphId:r.paragraphId,offset:r.start,controlId:l.control.id});}return r}}var fs=new WeakSet;function sc(e){return fs.add(e),e}function gs(e){return fs.has(e)}function en(e){return {...e,applyPackage:t=>e.applyPackage(sc(t))}}var lc=new Set(["insertText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertDrawing","deleteText"]),hs=new Set(["insertDrawing"]);function dc(e){if(!(e===null||e.start!==e.end))return e}var Et={"text-local":0,"paragraph-local":1,"flow-structural":2,global:3};function cc(e){return Object.freeze({parts:new Map([[e.name,e]]),partBytes:new Map,relationships:new Map,externalTargets:[],contentTypes:{defaults:new Map,overrides:new Map([[e.name.toLowerCase(),e.contentType]])},mainDocumentPart:e.name})}var dt=class{current;storyPartName;rev=0;commitCounter=0;undoStack=[];redoStack=[];subscribers=new Set;historyLimit;settingsPartOverride;storyRef=null;composition=null;constructor(t,n,r={}){let o="root"in t,i=typeof n=="string"?n:void 0,a=typeof n=="object"&&n!==null?n:r;this.current=o?cc(t):t,this.storyPartName=i??(o?t.name:t.mainDocumentPart),this.historyLimit=a.historyLimit??200,this.settingsPartOverride=a.settingsPart;}setStoryRef(t){this.storyRef=t;}get part(){let t=this.current.parts.get(this.storyPartName);if(!t)throw new Error(`story part missing: ${this.storyPartName}`);return t}get package(){return this.current}get revision(){return this.rev}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get historyDepth(){return this.undoStack.length}get compositionActive(){return this.composition!==null}graftPackage(t){this.current=t(this.current);}replacePart(t){let n=this.current.parts.get(t.name);t!==n&&(this.current=chunk6KA3L3FR_cjs.Kd(this.current,t),this.rev+=1);}checkpoint(){return {pkg:this.current,revision:this.rev,undoStack:this.undoStack.slice(),redoStack:this.redoStack.slice(),composition:this.composition?{entry:{...this.composition.entry},committed:this.composition.committed}:null}}restoreCheckpoint(t){this.current=t.pkg,this.rev=t.revision,this.undoStack.length=0,this.undoStack.push(...t.undoStack),this.redoStack.length=0,this.redoStack.push(...t.redoStack),this.composition=t.composition?{entry:{...t.composition.entry},committed:t.composition.committed}:null;}restoreHistoryStacks(t){this.undoStack.length=0,this.undoStack.push(...t.undoStack),this.redoStack.length=0,this.redoStack.push(...t.redoStack);}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}transact(t,n={}){return chunk6KA3L3FR_cjs.gb(n.actorId,()=>this.commitTransaction(t,n))}commitTransaction(t,n){let r=n.origin??chunk6KA3L3FR_cjs.b.mutationHuman,o=n.recordsHistory??(r!==chunk6KA3L3FR_cjs.b.projection&&r!==chunk6KA3L3FR_cjs.b.awareness),i=this.undoStack[this.undoStack.length-1];o&&!this.composition&&i?.group!==n.historyGroup&&this.closeHistoryGroup();let a=this.current,s=this.rev,l=this.current,d=null,c=0,u=new Set,p=new Set,R=new Set,m=new Set,h=new Set,g=[],x=n.minimumImpact??"text-local",k=null,f=false,v=null,O=null,P=new Map,y=new Map,T=$=>{let U=y.get($.name);U||(U={mint:null,written:new Set},y.set($.name,U));let Y=U;return {mint:()=>(Y.mint??=chunk6KA3L3FR_cjs.jg($))(),wrote:w=>{Y.written.add(w);},wroteUnder:w=>Y.written.has(w)}},N=()=>{for(let $ of y.values())$.mint=null;},j=($,U)=>{let Y=chunk6KA3L3FR_cjs.ni.get($.op);if(Y===void 0)return P.clear(),null;let w=`${U.name}\0${Y}`,I=P.get(w);I||(I={id:null},P.set(w,I));let D=I;return ()=>D.id??=T(U).mint()},z=($,U)=>{let Y=lc.has($.op);return !Y&&chunk6KA3L3FR_cjs.ni.get($.op)!==void 0?null:((!Y||hs.has($.op))&&N(),Y?T(U):null)},ee=ps(),X=null,_=($,U)=>{if(d)return false;let Y=l.parts.get($);if(!Y)return d={reason:"unknown-part",detail:$},false;U=ee(Y,this.settingsPartOverride?.()??chunk6KA3L3FR_cjs.Sf(l),U);let w=chunk6KA3L3FR_cjs.Li(this.settingsPartOverride?.()??chunk6KA3L3FR_cjs.Sf(l),U)??chunk6KA3L3FR_cjs.Ui(Y,this.settingsPartOverride?.()??chunk6KA3L3FR_cjs.Sf(l),U,X?.partName===$&&"paragraphId"in U&&X.paragraphId===U.paragraphId?X.fieldNodeId:void 0);if(w)return d={reason:w},false;let I=j(U,Y),D=z(U,Y),K=this.settingsPartOverride?.()??chunk6KA3L3FR_cjs.Sf(l),te=chunk6KA3L3FR_cjs.Mi(K)&&"paragraphId"in U&&chunk6KA3L3FR_cjs.Oi(Y,U.paragraphId)?chunk6KA3L3FR_cjs.Th(Y,U,X?.partName===$&&X.paragraphId===U.paragraphId?X.fieldNodeId:void 0):null;X=te&&"paragraphId"in U?{partName:$,paragraphId:U.paragraphId,fieldNodeId:te.fieldNodeId}:null;let se={deferValidation:true,...I?{revisionIds:I}:{},...D?{trackedRevisionIds:D}:{}},G=te?chunk6KA3L3FR_cjs.Zh(Y,U,te,se):chunk6KA3L3FR_cjs.qj(Y,U,se);if(!G.ok)return d={reason:G.reason,...G.detail?{detail:G.detail}:{}},false;if(hs.has(U.op)&&N(),l=chunk6KA3L3FR_cjs.Kd(l,G.part),G.part===Y&&G.effect.dirty.length===0&&G.effect.created.length===0&&G.effect.deleted.length===0&&G.effect.split===void 0&&(G.effect.splits===void 0||G.effect.splits.length===0)&&G.effect.join===void 0&&G.effect.caret===void 0)return true;u.add($),c+=1;for(let ge of G.effect.dirty)p.add(ge);for(let ge of G.effect.created)R.add(ge);for(let ge of G.effect.deleted)m.add(ge);for(let ge of G.effect.dependencyKeys)h.add(ge);G.effect.split&&g.push({split:G.effect.split});for(let ge of G.effect.splits??[])g.push({split:ge});return G.effect.join&&g.push({join:G.effect.join}),Et[G.effect.impact]>Et[x]&&(x=G.effect.impact),G.effect.caret&&(O={paragraphId:G.effect.caret.paragraphId,start:0,end:0}),true};if(t({apply:$=>_(this.storyPartName,$),applyTo:($,U)=>_($,U),applyPackage:$=>{if(d)return false;let U=this.settingsPartOverride?.()??chunk6KA3L3FR_cjs.Sf(l),Y=gs($)?chunk6KA3L3FR_cjs.Ki(U,{op:"comment"}):chunk6KA3L3FR_cjs.Li(U);if(Y)return d={reason:Y},false;P.clear(),N();let w=$(l);if(w===l)return true;for(let[I,D]of w.parts)l.parts.get(I)!==D&&u.add(I);return l=w,c+=1,Et["flow-structural"]>Et[x]&&(x="flow-structural"),true},selectionBefore:$=>{k=$;},selectionAfter:$=>{f=true,v=$;}}),d){let $=d;return {ok:false,reason:$.reason,...$.detail?{detail:$.detail}:{}}}if(c===0)return {ok:true,change:null};let B=f?v:O,ie=f?dc(v):O??void 0;for(let $ of u){let U=a.parts.get($),Y=l.parts.get($);if(Y===void 0)continue;let w=U?chunk6KA3L3FR_cjs.va(U,Y):chunk6KA3L3FR_cjs.va(Y,Y);if(!w.ok)return {ok:false,reason:"tree-invariant",detail:JSON.stringify(w.issues)}}let be=chunk6KA3L3FR_cjs.Ud(l);if(!be.ok)return {ok:false,reason:"package-invariant",detail:JSON.stringify(be.issues)};if(o)if(this.composition)chunk6KA3L3FR_cjs.Aj(n.historyGroup,"split","composition"),this.composition.committed=true,this.composition={...this.composition,entry:{...this.composition.entry,selectionAfter:B}};else {let $=n.historyGroup,U=this.undoStack[this.undoStack.length-1];$!==void 0&&U!==void 0&&U.group===$?this.undoStack[this.undoStack.length-1]={...U,selectionAfter:B??U.selectionAfter}:this.pushUndo({pkg:a,revision:s,selectionBefore:k,selectionAfter:B,group:$}),chunk6KA3L3FR_cjs.Aj($,U?.group===$?"extended":"started"),this.redoStack.length=0;}return this.current=l,this.rev+=1,n.story&&(this.storyRef=n.story),n.minimumImpact&&Et[n.minimumImpact]>Et[x]&&(x=n.minimumImpact),{ok:true,change:this.publish(r,s,{dirty:p,created:R,deleted:m,dependencyKeys:h,splitJoin:g,impact:x,caret:ie},n.story??this.storyRef??void 0,n.actorId,n.operationId)}}beginComposition(t=null){this.composition||(this.composition={entry:{pkg:this.current,revision:this.rev,selectionBefore:t,selectionAfter:null},committed:false});}endComposition(){let t=this.composition;this.composition=null,!(!t||!t.committed)&&(this.pushUndo(t.entry),this.redoStack.length=0);}cancelComposition(){this.composition=null;}closeHistoryGroup(){let t=this.undoStack[this.undoStack.length-1];t===void 0||t.group===void 0||(this.undoStack[this.undoStack.length-1]={...t,group:void 0});}undo(){let t=this.undoStack.pop();if(!t)return null;this.closeHistoryGroup();let n=this.rev;return this.redoStack.push({pkg:this.current,revision:this.rev,selectionBefore:t.selectionBefore,selectionAfter:t.selectionAfter}),this.current=t.pkg,this.rev+=1,this.publish(chunk6KA3L3FR_cjs.b.mutationUndo,n,null,this.storyRef??void 0)}redo(){let t=this.redoStack.pop();if(!t)return null;this.closeHistoryGroup();let n=this.rev;return this.undoStack.push({pkg:this.current,revision:this.rev,selectionBefore:t.selectionBefore,selectionAfter:t.selectionAfter}),this.current=t.pkg,this.rev+=1,this.publish(chunk6KA3L3FR_cjs.b.mutationRedo,n,null,this.storyRef??void 0)}selectionForUndo(){return this.undoStack[this.undoStack.length-1]?.selectionBefore??null}selectionForRedo(){return this.redoStack[this.redoStack.length-1]?.selectionAfter??null}pushUndo(t){this.undoStack.push(t),this.undoStack.length>this.historyLimit&&this.undoStack.shift();}publish(t,n,r,o,i,a){this.commitCounter+=1;let s={change:"model-change",fromRevision:n,toRevision:this.rev,commitId:`commit-${this.commitCounter}`,origin:t,...i?{actorId:i}:{},...a?{operationId:a}:{},dirty:r?[...r.dirty]:[],created:r?[...r.created]:[],deleted:r?[...r.deleted]:[],splitJoin:r?r.splitJoin:[],dependencyKeys:r?[...r.dependencyKeys]:[],impact:r?r.impact:o?.kind==="headerFooter"?"global":"flow-structural",...r?.caret?{caret:r.caret}:{},...o?{story:o}:{}};for(let l of this.subscribers)l(s);return s}};function mo(e,t,n,r){if(!e)return null;if(e.kind==="package")return (r==="undo"?e.selectionBefore:e.selectionAfter)??null;let o=e.partName===t.part.name?t:n.get(e.partName);return (r==="undo"?o?.selectionForUndo():o?.selectionForRedo())??null}function ys(e){let t=null,n;return {context:{selectionBefore(r){t=r,e.selectionBefore(r);},selectionAfter(r){n=r,e.selectionAfter(r);}},snapshot(r){return {selectionBefore:t,selectionAfter:n===void 0?r??null:n}}}}function uo(e,t){return [...e.values()].map(n=>n.part).filter(n=>t.parts.has(n.name))}function xs(e,t){return uo(e,t).map(n=>n.name).sort().join(",")}function ks(e,t,n){if(e.relationships!==t.relationships||e.contentTypes!==t.contentTypes||e.partBytes!==t.partBytes||e.externalTargets!==t.externalTargets||e.mainDocumentPart!==t.mainDocumentPart)return true;if(e.parts===t.parts)return false;if(e.parts.size!==t.parts.size)return true;for(let[r,o]of t.parts)if(r!==n&&e.parts.get(r)!==o)return true;return false}var Gn="http://schemas.openxmlformats.org/wordprocessingml/2006/main",mc="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function Tt(e,t){for(let n of e.children)if(n.kind!=="textValue"&&n.namespaceUri===Gn&&n.localName===t)return n;return null}function Kn(e,t){return e.attributes.find(n=>n.namespaceUri===Gn&&n.localName===t)?.value}function uc(e){let t=Kn(e,"val");return t===void 0||t==="1"||t==="true"||t==="on"}function Ps(e,t){return e.kind==="textValue"?Object.freeze({...e,id:t()}):Object.freeze({...e,id:t(),children:e.children.map(n=>Ps(n,t))})}function pc(e){let t=chunk6KA3L3FR_cjs.xa(`<w:styles xmlns:w="${Gn}"><w:style w:type="paragraph" w:styleId="ListParagraph"><w:pPr><w:contextualSpacing/></w:pPr></w:style></w:styles>`,{name:e.name,contentType:mc});if(!t.ok)return null;let n=Tt(t.part.root,"style"),r=n?Tt(n,"pPr"):null;return r?Ps(r,chunk6KA3L3FR_cjs.Fa(e)):null}var Rs=["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"];function fc(e,t){let n=Rs.indexOf(t),r=0;return e.forEach((o,i)=>{if(o.kind==="textValue")return;let a=Rs.indexOf(o.localName);a!==-1&&a<=n&&(r=i+1);}),r}function vs(e,t){let n=chunk6KA3L3FR_cjs.Ac(e);if(!n)return null;let r=null;for(let d of n.root.children)if(d.kind!=="textValue"&&d.namespaceUri===Gn&&d.localName==="style"&&Kn(d,"type")==="paragraph"&&Kn(d,"styleId")===t){r=d;break}if(!r)return null;let o=Tt(r,"name");if(o&&Kn(o,"val")?.trim().toLowerCase()!=="list paragraph"&&t!=="ListParagraph")return null;let i=pc(n);if(!i)return null;let a=Tt(i,"contextualSpacing");if(!a)return null;let s=Tt(r,"pPr"),l;if(s){let d=Tt(s,"contextualSpacing");if(d&&uc(d))return e;l=d?chunk6KA3L3FR_cjs.Ma(n,d.id,a):chunk6KA3L3FR_cjs.La(n,s.id,fc(s.children,"contextualSpacing"),[a]);}else {let d=r.children.findIndex(c=>c.kind!=="textValue"&&["rPr","tblPr","tcPr","tblStylePr"].includes(c.localName));l=chunk6KA3L3FR_cjs.La(n,r.id,d===-1?r.children.length:d,[i]);}return l.ok?Object.freeze({...e,parts:new Map([...e.parts,[n.name,l.part]])}):null}var Ss="http://schemas.openxmlformats.org/package/2006/relationships",ws="application/vnd.openxmlformats-package.relationships+xml",yc="http://schemas.openxmlformats.org/package/2006/content-types",Os="/[Content_Types].xml",ct="/word/numbering.xml",Is="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",tn="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",xc=`<Override PartName="${ct}" ContentType="${tn}"/>`;function Xn(e){return `${e.ownerPart}\0${e.id}`}function Ns(e,t,n){let r=new Set(t.externalTargets.filter(s=>s.type===chunk6KA3L3FR_cjs.Nc).map(Xn)),o=n.externalTargets.filter(s=>s.type===chunk6KA3L3FR_cjs.Nc&&!r.has(Xn(s)));if(o.length===0)return e;let i=new Set(e.map(Xn)),a=o.filter(s=>!i.has(Xn(s)));return a.length===0?e:Object.freeze([...e,...a])}function Es(e,t,n){let r=e.filter(o=>o.ownerPart===n||t.has(o.ownerPart));return r.length===e.length?e:Object.freeze(r)}function Ts(e,t,n=[],r=false){if(e===t)return e;let o=kc(e,t,r);return o=Pc(o,t,n),o}function Cs(e,t){let n=new Set;for(let o of e.externalTargets)o.type===chunk6KA3L3FR_cjs.Nc&&o.ownerPart!==e.mainDocumentPart&&(e.parts.has(o.ownerPart)||t.has(o.ownerPart)||n.add(o.ownerPart));for(let o of e.parts.keys()){let i=bc(o);!i||i===e.mainDocumentPart||e.parts.has(i)||t.has(i)||e.externalTargets.some(a=>a.ownerPart===i)||n.add(i);}if(n.size===0)return e;let r=e;for(let o of n)r=Sc(r,o);return r}function kc(e,t,n){let r=t.parts.get(ct);if(!r)return e;let o=e.parts.get(ct),i=n&&o?Rc(o,r):r,a=chunk6KA3L3FR_cjs.Kd(e,i),s=(t.relationships.get(t.mainDocumentPart)??[]).find(d=>d.type===Is),l=a.relationships.get(a.mainDocumentPart)??[];if(s&&!l.some(d=>d.type===Is)&&!l.some(d=>d.id===s.id)){let d=Oc(a,{...s,ownerPart:a.mainDocumentPart});d&&(a=d);}if(a.contentTypes.overrides.get(chunk6KA3L3FR_cjs.u(ct))!==tn){let d=wc(a);d&&(a=d);}return a}function Rc(e,t){let n="http://schemas.openxmlformats.org/wordprocessingml/2006/main",r=l=>{if(l.kind==="textValue"||l.namespaceUri!==n)return null;let d=l.localName==="abstractNum"?"abstractNumId":l.localName==="num"?"numId":l.localName==="numPicBullet"?"numPicBulletId":null;if(!d)return null;let c=l.attributes.find(u=>u.namespaceUri===n&&u.localName===d)?.value;return c===void 0?null:`${l.localName}:${c}`},o=new Set(e.root.children.map(r).filter(Boolean)),i=chunk6KA3L3FR_cjs.Fa(e),a=["numPicBullet","abstractNum","num","numIdMacAtCleanup"],s=e;for(let l of t.root.children){let d=r(l);if(!d||o.has(d)||l.kind==="textValue")continue;let c=a.indexOf(l.localName),u=s.root.children.findIndex(R=>R.kind!=="textValue"&&R.namespaceUri===n&&a.indexOf(R.localName)>c),p=chunk6KA3L3FR_cjs.La(s,s.root.id,u<0?s.root.children.length:u,[po(l,i)]);p.ok&&(s=p.part,o.add(d));}return s}function Pc(e,t,n){let r=n.filter(i=>i.type===chunk6KA3L3FR_cjs.Nc);if(r.length===0)return e;let o=e;for(let i of r){let a=vc(e,t,i.ownerPart);if(!a||o.externalTargets.some(d=>d.ownerPart===a&&d.id===i.id)||new Set((o.relationships.get(a)??[]).map(d=>d.id)).has(i.id))continue;let l=Ic(o,{ownerPart:a,id:i.id,type:chunk6KA3L3FR_cjs.Nc,rawTarget:i.rawTarget,sinkSafe:i.sinkSafe},a);l&&(o=l);}return o}function vc(e,t,n){return n===t.mainDocumentPart?e.mainDocumentPart:typeof n!="string"||n.length===0?null:n}function Oc(e,t){let n=e.mainDocumentPart,r=fo(n),o=e.parts.get(r),i=chunk6KA3L3FR_cjs.xa(`<Relationships xmlns="${Ss}"><Relationship Id="${chunk6KA3L3FR_cjs.P(t.id,"relationship id")}" Type="${chunk6KA3L3FR_cjs.P(t.type,"relationship type")}" Target="${chunk6KA3L3FR_cjs.P(t.rawTarget,"relationship target")}"/></Relationships>`,{name:r,contentType:ws});if(!i.ok)return null;let a=e.relationships.get(n)??[];if(a.some(d=>d.id===t.id))return null;let s={...t,ownerPart:n,order:a.reduce((d,c)=>Math.max(d,c.order),-1)+1},l=new Map([...e.relationships,[n,[...a,s]]]);return o?Ms(e,o,i.part.root.children[0],l):Object.freeze({...e,parts:new Map([...e.parts,[r,i.part]]),relationships:l})}function Ic(e,t,n=e.mainDocumentPart){let r=n;if(typeof r!="string"||r.length===0)return null;let o=fo(r),i=e.parts.get(o),a=chunk6KA3L3FR_cjs.xa(`<Relationships xmlns="${Ss}"><Relationship Id="${chunk6KA3L3FR_cjs.P(t.id,"relationship id")}" Type="${chunk6KA3L3FR_cjs.Nc}" Target="${chunk6KA3L3FR_cjs.P(t.rawTarget,"relationship target")}" TargetMode="External"/></Relationships>`,{name:o,contentType:ws});if(!a.ok)return null;let s=[...e.externalTargets,t];if(!i)return Object.freeze({...e,parts:new Map([...e.parts,[o,a.part]]),externalTargets:s});let l=Ms(e,i,a.part.root.children[0],e.relationships);return l?Object.freeze({...l,externalTargets:s}):null}function Ms(e,t,n,r){if(!n)return null;let o=chunk6KA3L3FR_cjs.Fa(t),i=chunk6KA3L3FR_cjs.La(t,t.root.id,t.root.children.length,[po(n,o)]);return i.ok?Object.freeze({...e,parts:new Map([...e.parts,[t.name,i.part]]),relationships:r}):null}function po(e,t){return e.kind==="textValue"?{...e,id:t()}:{...e,id:t(),children:e.children.map(n=>po(n,t))}}function fo(e){let t=e.lastIndexOf("/");return `${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function bc(e){let t=/^(.*)\/_rels\/([^/]+)\.rels$/.exec(e);if(!t)return null;let n=t[1],r=t[2];return n===""||r===""?null:`${n}/${r}`}function Sc(e,t){let n=fo(t),r=new Map(e.parts);r.delete(n);let o=new Map(e.partBytes);o.delete(n);let i=new Map(e.relationships);i.delete(t);let a=Object.freeze(e.externalTargets.filter(s=>s.ownerPart!==t));return Object.freeze({...e,parts:r,partBytes:o,relationships:i,externalTargets:a})}function wc(e){let t=e.contentTypes.overrides.get(chunk6KA3L3FR_cjs.u(ct));if(t===tn)return e;if(t!==void 0)return null;let n=e.partBytes.get(Os);if(!n)return null;let r=fflate.strFromU8(n),o=bs(r);if(!o)return null;let i=r.lastIndexOf(`</${o.rootName}>`);if(i===-1)return null;let a=r.slice(0,i)+xc+r.slice(i),s=bs(a);if(!s||s.rootName!==o.rootName)return null;let l=[...o.children,Ds("Override",{PartName:ct,ContentType:tn})];return s.children.length!==l.length||s.children.some((d,c)=>d!==l[c])?null:Object.freeze({...e,partBytes:new Map([...e.partBytes,[Os,fflate.strToU8(a)]]),contentTypes:Object.freeze({defaults:e.contentTypes.defaults,overrides:new Map([...e.contentTypes.overrides,[chunk6KA3L3FR_cjs.u(ct),tn]])})})}function bs(e){let t=chunk6KA3L3FR_cjs.X(e);if(!t.ok)return null;let n=t.nodes.filter(s=>s.type==="element");if(n.length!==1)return null;let r=n[0],o=r.name.indexOf(":"),i=o===-1?"":r.name.slice(0,o);if(r.name.slice(o+1)!=="Types"||r.attributes[i?`xmlns:${i}`:"xmlns"]!==yc)return null;let a=[];for(let s of r.children)s.type==="element"&&a.push(Ds(s.name,s.attributes));return {rootName:r.name,children:a}}function Ds(e,t){let n=Object.entries(t).map(([r,o])=>`${r}=${o}`).sort();return [e,...n].join("")}var As=4e3,_s=64;function Fs(e){return chunk6KA3L3FR_cjs.bg(e,"footnote")!==null||chunk6KA3L3FR_cjs.bg(e,"endnote")!==null}function Ls(e,t,n,r){if(!Fs(e))return false;if(r.has(n.paragraphId))return true;r.add(n.paragraphId);let o=chunk6KA3L3FR_cjs.Ha(t,n.paragraphId);return !o||o.kind!=="paragraph"?true:chunk6KA3L3FR_cjs.af(o).some(i=>i.node.kind==="noteReference"&&i.start<n.end&&i.end>n.start)}function $s(e,t,n,r){if(!Fs(e))return false;if(r.has(n.blockId))return true;r.add(n.blockId);let o=chunk6KA3L3FR_cjs.Ha(t,n.blockId);if(!o||o.kind==="textValue")return true;let i=0,a=(s,l)=>{if(i>=As||l>_s)return true;if(i+=1,s.kind==="textValue")return false;if(s.kind==="paragraph")return chunk6KA3L3FR_cjs.af(s).some(d=>d.node.kind==="noteReference");for(let d of s.children)if(a(d,l+1))return true;return false};return a(o,0)}function Us(e,t,n){if(n.count>=As||t>_s)return true;if(n.count+=1,e.kind==="textValue")return false;if(e.kind==="commentRangeStart"||e.kind==="commentRangeEnd"||e.kind==="commentReference")return true;for(let r of e.children)if(Us(r,t+1,n))return true;return false}function Bs(e,t,n,r){if(!chunk6KA3L3FR_cjs.ch(e))return false;let o=n.op==="deleteText"?n.paragraphId:n.blockId;if(r.has(o))return true;r.add(o);let i=chunk6KA3L3FR_cjs.Ha(t,o);return !i||i.kind==="textValue"?true:Us(i,0,{count:0})}var go="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",ho="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";function js(e,t){let r=(e.relationships.get(e.mainDocumentPart)??[]).find(o=>o.id===t);return r?r.type!==go&&r.type!==ho?{ok:false,reason:"wrong-relationship-type",detail:r.type}:Nc(e,r):{ok:false,reason:"dangling-relationship",detail:t}}function Nc(e,t){let n=chunk6KA3L3FR_cjs.E(t);if(n.mode==="External")return {ok:false,reason:"external-relationship",detail:t.id};if(!n.target.ok)return {ok:false,reason:"bad-relationship-target",detail:n.target.reason};let r=e.parts.get(n.target.partName);if(!r)return {ok:false,reason:"missing-part",detail:n.target.partName};let o=r.root.localName;return o!=="hdr"&&o!=="ftr"?{ok:false,reason:"not-a-story-part",detail:o||r.name}:{ok:true,partName:r.name,part:r}}function mt(e,t){return t.compositionActive||e.compositionSessionOpen()?{ok:false,reason:"invalidArgs",detail:"ime-composition-active"}:null}function Hs(e,t){let n=chunk6KA3L3FR_cjs.Ha(e,t);return !n||n.kind!=="drawing"?null:n.children.find(o=>o.kind==="inlineDrawing"||o.kind==="anchoredDrawing")??null}function Vs(e,t,n){let r=e.parts.get(t);if(!r)return null;let o=chunk6KA3L3FR_cjs.Ha(r,n);return !o||o.kind!=="drawing"?null:chunk6KA3L3FR_cjs.bd(o,{ownerPartName:t,supportedMcRequires:chunk6KA3L3FR_cjs.Wc,limits:chunk6KA3L3FR_cjs.Vc,resolveRelationship:chunk6KA3L3FR_cjs.Yc(e,t)})}function Ws(e,t,n){let r=chunk6KA3L3FR_cjs.F(e.relationships.get(t)??[],t,n);return r.mode==="internal"?r.partName:null}function Ct(e,t,n,r){let o=e.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let i=mt(e,o.store);if(i)return i;let{store:a,story:s}=o;return chunk6KA3L3FR_cjs.Ca(e,()=>Ec(e,a,s,n,r),l=>chunk6KA3L3FR_cjs.Da(l))}function Ec(e,t,n,r,o){let i=n.partName,a=e.currentPackage(),s=t.checkpoint(),l=null,d=false,c=false,u=t.transact(m=>{if(o?.commitGuard?.()===false){c=true;return}if(o?.expectedPackageRevision!==void 0&&e.packageRevision!==o.expectedPackageRevision){d=true;return}let h=r(m,i);if(h===null){m.apply({op:"insertText",paragraphId:"\0task12-abort",offset:0,text:"x"});return}l=h;},{story:n,...o?.actorId?{actorId:o.actorId}:{},...n.kind==="headerFooter"||n.kind==="notesPart"?{minimumImpact:"global"}:{}});if(c)return {ok:false,reason:"invalidArgs",detail:"stale drawing selection"};if(d)return {ok:false,reason:"invalidArgs",detail:"stale-package-epoch"};if(!u.ok)return {ok:false,reason:u.reason,...u.detail?{detail:u.detail}:{}};if(!u.change)return {ok:true,change:null};let p=u.change.created.find(m=>{let h=t.part;return chunk6KA3L3FR_cjs.Ha(h,m)?.kind==="drawing"});return p&&(l=p),{ok:true,change:e.promoteStoryTransactionToPackageUnit(a,t,s),...l?{drawingNodeId:l}:{}}}function zs(e,t,n){let r=e.parts.get(t);if(!r)return null;let o=Hs(r,n);return o?chunk6KA3L3FR_cjs.gj(o):null}function yo(e,t,n,r){let o=false;return e.applyPackage(i=>{let a=i.parts.get(t);if(!a)return i;let s=chunk6KA3L3FR_cjs.Ha(a,n);if(!s||s.kind!=="drawing")return i;let l=Hs(a,n);if(!l)return i;let d=chunk6KA3L3FR_cjs.hj(l,r),c=Tc(s,d),u=chunk6KA3L3FR_cjs.Ma(a,s.id,c,{deferValidation:true});return u.ok?(o=true,chunk6KA3L3FR_cjs.Kd(i,u.part)):i}),o}function Tc(e,t){return {...e,children:e.children.map(n=>n.id===t.id?t:n)}}async function Ks(e,t,n){let r=chunk6KA3L3FR_cjs.Cd(n.widthPoints),o=chunk6KA3L3FR_cjs.Cd(n.heightPoints);if(r===null||o===null)return {ok:false,reason:"invalidArgs",detail:"invalid-dimensions"};let i=e.resolveStory(t);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let a=mt(e,i.store);if(a)return a;let s=i.story.partName,l=await chunk6KA3L3FR_cjs.xd(n.decodePort,n.bytes,n.mime);if(!l.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let d=l.bytes,c=chunk6KA3L3FR_cjs.zd(e.currentPackage(),s,{bytes:d,mime:n.mime});if(!c.ok)return {ok:false,reason:"invalidArgs",detail:c.reason==="invalid-image"?"invalid-image":c.reason};let u=c.partName,p=Ct(e,t,(R,m)=>{let h=e.currentPackage(),g=chunk6KA3L3FR_cjs.zd(h,m,{bytes:d,mime:n.mime});if(!g.ok)return null;h=g.pkg,u=g.partName;let x;if(n.hyperlink){let f=chunk6KA3L3FR_cjs.Gf(h,n.hyperlink,m);if(!f)return null;h=f.pkg,x=f.relationshipId;}if(!R.applyPackage(()=>h))return null;let k=chunk6KA3L3FR_cjs.Dd({docPrId:g.docPrId,relationshipId:g.relationshipId,extentEmu:{cx:r,cy:o},...n.title!==void 0?{title:n.title}:{},...n.description!==void 0?{description:n.description}:{},...x?{hyperlinkRelationshipId:x}:{}});return R.apply({op:"insertDrawing",paragraphId:n.paragraphId,offset:n.offset,drawing:k,...n.revision?{revision:n.revision}:{}})?k.id:null},{expectedPackageRevision:n.expectedPackageRevision,...n.commitGuard?{commitGuard:n.commitGuard}:{},...n.actorId?{actorId:n.actorId}:{}});return p.ok?p.change?{...p,mediaPartName:u}:{ok:true,change:null,mediaPartName:u}:p}async function xo(e,t,n,r,o,i,a){let s=e.resolveStory(t);if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};let l=mt(e,s.store);if(l)return l;let d=s.story.partName,c=await chunk6KA3L3FR_cjs.xd(i,r,o);if(!c.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let u=c.bytes,p=chunk6KA3L3FR_cjs.zd(e.currentPackage(),d,{bytes:u,mime:o});return p.ok?Ct(e,t,(R,m)=>{let h=e.currentPackage(),g=Vs(h,d,n),x=g?.picture?.embeddedRelationshipId??null,k=g?.picture?.linkedRelationshipId??null,f=x??k;if(!f)return null;let v=x!==null?Ws(h,d,x):null,O=h,P=chunk6KA3L3FR_cjs.zd(O,m,{bytes:u,mime:o});return !P.ok||(O=P.pkg,!R.applyPackage(()=>O))||!R.apply({op:"replaceDrawingResource",drawingNodeId:n,relationshipId:P.relationshipId})?null:(R.applyPackage(y=>chunk6KA3L3FR_cjs.Fd(y,m,v,f)),n)},{expectedPackageRevision:a.expectedPackageRevision,...a.commitGuard?{commitGuard:a.commitGuard}:{},...a.actorId?{actorId:a.actorId}:{}}):{ok:false,reason:"invalidArgs",detail:p.reason==="invalid-image"?"invalid-image":p.reason}}function Gs(e,t,n){let r=e.resolveStory(t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let o=mt(e,r.store);if(o)return o;let i=r.story.partName,a=e.currentPackage(),s=Vs(a,i,n);if(!s)return {ok:false,reason:"unknown-drawing"};let l=s.picture?.embeddedRelationshipId??null,d=s.picture?.linkedRelationshipId??null,c=l??d,u=l!==null?Ws(a,i,l):null;return Ct(e,t,(p,R)=>p.apply({op:"deleteDrawing",drawingNodeId:n})?(p.applyPackage(m=>chunk6KA3L3FR_cjs.Fd(m,R,u,c)),n):null)}function Cc(e,t){let n=null,r=i=>{let a=false,s=false,l=(d,c)=>{if(a||d.kind==="textValue")return;if(d.id===t){a=true,s=c;return}let u=c||d.kind==="revisionDelete"||d.kind==="revisionMoveFrom";for(let p of d.children)l(p,u);};return l(i,false),s},o=i=>{if(!(n!==null||i.kind==="textValue")){if(i.kind==="paragraph"){let a=chunk6KA3L3FR_cjs.cf(i).spanOf(t);if(a!==null&&a.end>a.start){let s=chunk6KA3L3FR_cjs.Ha(e,t);if(!s||s.kind!=="drawing"&&!chunk6KA3L3FR_cjs.Zc(s))return;n={paragraphId:i.id,start:a.start,end:a.end,alreadyDeleted:r(i)};}return}for(let a of i.children)o(a);}};return o(e.root),n}function Xs(e,t,n,r){let o=e.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let i=mt(e,o.store);if(i)return i;let a=e.currentPackage().parts.get(o.story.partName);if(!a)return {ok:false,reason:"unknown-drawing"};let s=Cc(a,n);return s?s.alreadyDeleted?{ok:true,change:null}:Ct(e,t,l=>l.apply({op:"deleteText",paragraphId:s.paragraphId,start:s.start,end:s.end,revision:r})?n:null):{ok:false,reason:"unknown-drawing"}}async function Ys(e,t,n,r,o,i,a,s){let l=await chunk6KA3L3FR_cjs.Gd(o,r,i,void 0,a);return l.ok?xo(e,t,n,l.bytes,l.mime,a,{expectedPackageRevision:e.packageRevision,...s?{actorId:s}:{}}):{ok:false,reason:"invalidArgs",detail:`${l.reason}${l.detail?`:${l.detail}`:""}`}}function Js(e,t,n,r,o,i){let a=e.resolveStory(t);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let s=mt(e,a.store);return s||Ct(e,t,(l,d)=>{let c=zs(e.currentPackage(),d,n),u=null;if(i!==null){let R=chunk6KA3L3FR_cjs.Gf(e.currentPackage(),i,d);if(!R||!l.applyPackage(()=>R.pkg))return null;u=R.relationshipId;}if(!l.apply({op:"setDrawingMetadata",drawingNodeId:n,title:r,description:o,...i===null?{hyperlink:null}:{}}))return null;if(i!==null&&u!==null){if(!yo(l,d,n,u))return null}else if(i===null&&!yo(l,d,n,null))return null;let p=false;return l.applyPackage(R=>{let m=chunk6KA3L3FR_cjs.If(R,d,c);return m===null?(p=true,R):m}),p?null:n})}function qs(e,t,n){let r=e.resolveStory(t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let o=mt(e,r.store);return o||Ct(e,t,(i,a)=>{let s=zs(e.currentPackage(),a,n.drawingNodeId),l=null;if(n.hyperlink!==null){let c=chunk6KA3L3FR_cjs.Gf(e.currentPackage(),n.hyperlink,a);if(!c||!i.applyPackage(()=>c.pkg))return null;l=c.relationshipId;}for(let c of n.ops)if(!i.apply(c))return null;if(!yo(i,a,n.drawingNodeId,n.hyperlink===null?null:l))return null;let d=false;return i.applyPackage(c=>{let u=chunk6KA3L3FR_cjs.If(c,a,s);return u===null?(d=true,c):u}),d?null:n.drawingNodeId})}function Mc(e,t){if(e===t)return true;if(e.byteLength!==t.byteLength)return false;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return false;return true}function Qs(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e)if(t.get(n)!==r)return false;return true}function Dc(e,t){return e===t||e.ownerPart===t.ownerPart&&e.id===t.id&&e.type===t.type&&e.rawTarget===t.rawTarget&&e.targetMode===t.targetMode&&e.order===t.order}function Ac(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e){let o=t.get(n);if(!o||o.length!==r.length||o!==r&&r.some((i,a)=>!Dc(i,o[a])))return false}return true}function _c(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let o=t[r];return n===o||n.ownerPart===o.ownerPart&&n.id===o.id&&n.type===o.type&&n.rawTarget===o.rawTarget&&n.sinkSafe===o.sinkSafe})}function Fc(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e){let o=t.get(n);if(!o||!Mc(r,o))return false}return true}function Lc(e,t){return e.contentTypes===t.contentTypes||Qs(e.contentTypes.defaults,t.contentTypes.defaults)&&Qs(e.contentTypes.overrides,t.contentTypes.overrides)}var Yn=Object.freeze({equal:true,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"}),Jn=Object.freeze({equal:false,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"});function Zs(e){for(let[t,n]of e)if(!chunk6KA3L3FR_cjs.sa(t,n))return Jn;return Yn}function $c(e,t){if(e===t)return Yn;if(e.mainDocumentPart!==t.mainDocumentPart||e.parts.size!==t.parts.size||!Fc(e.partBytes,t.partBytes)||!Ac(e.relationships,t.relationships)||!_c(e.externalTargets,t.externalTargets)||!Lc(e,t))return Jn;let n=[];for(let[a,s]of e.parts){let l=t.parts.get(a);if(!l)return Jn;s!==l&&n.push([s,l]);}if(n.length===0)return Yn;let[r,o]=n[0];if(n.length>1||r.name!==e.mainDocumentPart)return Zs(n);let i=chunk6KA3L3FR_cjs.ta(o.root,r.root);return i.undecided?Zs(n):i.equal?Yn:!i.idsPreserved||i.reach==="outside-paragraph"||i.paragraphIds.length===0?Jn:{equal:false,dirty:i.paragraphIds,dependencyKeys:[chunk6KA3L3FR_cjs.g.story],impact:i.reach==="paragraph-text"?"text-local":"flow-structural"}}function ko(e){return {ok:false,reason:"package-invariant",detail:e}}function Uc(e,t){if(!e.parts.get(e.mainDocumentPart))return ko("no-main-document");for(let[r,o]of e.parts){let i=t?.parts.get(r);if(i===o)continue;let a=i?chunk6KA3L3FR_cjs.va(i,o):chunk6KA3L3FR_cjs.ua(o);if(!a.ok)return ko(`invalid-part:${r}:${a.issues[0]?.code??"invalid"}`)}let n=chunk6KA3L3FR_cjs.Ud(e);return n.ok?null:ko(n.issues[0]?.code??"package-invariant")}function el(e,t,n){let r=e.currentPackage(),o=$c(t,r);if(o.equal)return {ok:true,change:null};let i=Uc(t,r);if(i)return i;let a=e.bodyStore().part.name,s=o.impact!=="global"&&t.mainDocumentPart===a;return chunk6KA3L3FR_cjs.Ca(e,()=>{let l=e.packageRevision;return e.installAuthoritativePackageSnapshot(t),{ok:true,change:e.publishStoryWrite({change:"model-change",fromRevision:l,toRevision:l+1,commitId:`pkg-remote-${l+1}`,origin:n.origin,...n.actorId?{actorId:n.actorId}:{},...n.operationId?{operationId:n.operationId}:{},dirty:s?o.dirty:[],created:[],deleted:[],splitJoin:[],dependencyKeys:s?o.dependencyKeys:[],impact:s?o.impact:"global",story:{kind:"body",partName:a}})}},()=>false)}function rl(e,t,n,r){let o=[...t],i=new Set;for(let a of o)e.parts.has(a)&&i.add(a);for(let a of n)tl(a,o,i);for(let a of r)tl(a,o,i);return i}function ol(e,t,n,r,o){let i=new Set(e);i.add(t),i.add(n);for(let a of r)nl(a,i);for(let a of o)nl(a,i);return i}function tl(e,t,n){if(e.kind==="story"){n.add(e.partName);return}for(let r of t)(e.before.parts.has(r)||e.after.parts.has(r))&&n.add(r);}function nl(e,t){if(e.kind==="story"){t.add(e.partName);return}for(let n of e.before.parts.keys())t.add(n);for(let n of e.after.parts.keys())t.add(n);}var al=new Set(["acceptRevision","rejectRevision","acceptAllRevisions","rejectAllRevisions"]),il=new Set(["authorTable","deleteTableRow","deleteTableColumn","removeContentControl","removeRepeatingSectionItem"]),sl=64,nn=class{pkg;packageRev=0;body;stories=new Map;rIdToPartName=new Map;undoOrder=[];redoOrder=[];subscribers=new Set;historyLimit;maxEditableStoryParts;cascadeNoteReferences;lastChange=null;shellHyperlinks=Object.freeze([]);compositionSession=null;commitCounter=0;currentPackageMemo=null;constructor(t,n,r={}){this.pkg=chunk6KA3L3FR_cjs.Kd(t,n),this.historyLimit=r.historyLimit??200,this.maxEditableStoryParts=r.maxEditableStoryParts??sl,this.cascadeNoteReferences=r.cascadeDeletedNoteReferences??chunk6KA3L3FR_cjs.Rg,this.body=new dt(this.pkg,n.name,{historyLimit:this.historyLimit,settingsPart:()=>chunk6KA3L3FR_cjs.Sf(this.pkg)}),this.body.setStoryRef({kind:"body",partName:n.name});}get packageRevision(){return this.packageRev}get canUndo(){return this.undoOrder.length>0}get canRedo(){return this.redoOrder.length>0}get lastModelChange(){return this.lastChange}bodyStore(){return this.body}currentPackage(){let t=this.currentPackageMemo;if(t&&t.pkg===this.pkg&&t.bodyPart===this.body.part){let o=0,i=true;for(let a of this.stories.values()){if(t.storyParts[o]!==a.part){i=false;break}o+=1;}if(i&&o===t.storyParts.length)return t.result}let n=chunk6KA3L3FR_cjs.Kd(this.pkg,this.body.part),r=[];for(let o of this.stories.values())r.push(o.part),this.pkg.parts.has(o.part.name)&&(n=chunk6KA3L3FR_cjs.Kd(n,o.part));return this.currentPackageMemo={pkg:this.pkg,bodyPart:this.body.part,storyParts:r,result:n},n}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}resolveStory(t){return t.kind==="body"?{ok:true,story:{kind:"body",partName:this.body.part.name},store:this.body}:t.kind==="notesPart"?t.noteKind!=="footnote"&&t.noteKind!=="endnote"?{ok:false,reason:"unknown-scope",detail:String(t.noteKind)}:this.openNotesPartStore(t.noteKind):t.kind!=="headerFooter"||typeof t.rId!="string"||t.rId.length===0?{ok:false,reason:"unknown-scope",detail:String(t.kind)}:this.openHeaderFooterStore(t.rId)}partFor(t){let n=this.resolveStory(t);return n.ok?n.store.part:null}revisionFor(t){let n=this.resolveStory(t);return n.ok?n.store.revision:null}transact(t,n,r={}){return chunk6KA3L3FR_cjs.Ca(this,()=>this.commitStoryTransaction(t,n,r),chunk6KA3L3FR_cjs.Da,r.historyGroup)}commitStoryTransaction(t,n,r={}){let o=this.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let{store:i,story:a}=o,s=this.currentPackage(),l=i.historyDepth,d=i.compositionActive,c=i.checkpoint(),u=false,p=new Set,R=false,m=new Set,h=false,g,x=false,k;i.graftPackage(()=>this.currentPackage());let f=i.transact(P=>{k=ys(P),n({...P,applyTo:(y,T)=>{let N=P.applyTo(y,T);return N&&y!==a.partName&&(x=true),N},applyPackage:y=>P.applyPackage(T=>{let N=y(T);return N!==T&&!x&&(x=ks(T,N,a.partName)),N}),apply:y=>(y.op==="setListNumbering"&&y.numId!==null&&(h=true),y.op==="setParagraphProperties"&&(g??=y.properties.find(T=>T.localName==="pStyle")?.attributes?.val),u||(y.op==="deleteText"&&Ls(this.pkg,i.part,y,p)||y.op==="deleteBlock"&&$s(this.pkg,i.part,y,p)||al.has(y.op)||il.has(y.op))&&(u=true),R||(y.op==="deleteText"||y.op==="deleteBlock"?R=Bs(this.pkg,i.part,y,m):(al.has(y.op)||il.has(y.op))&&(R=true)),P.apply(y)),...k.context});},{...r,story:a,...a.kind==="headerFooter"||a.kind==="notesPart"?{minimumImpact:"global"}:{}});if(!f.ok)return {ok:false,reason:f.reason,...f.detail?{detail:f.detail}:{}};this.syncPackageFromStore(i);let v=false;if(f.change&&x&&(this.installPackageSnapshotInternal(i.package,false),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),v=true),h&&g){let P=vs(this.pkg,g);P&&this.replacePackageShell(P);}let O=false;if(f.change&&u){let P=this.currentPackage(),y=this.cascadeNoteReferences(s,P);if(y===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"note-cascade-failed"};y!==P&&(this.installPackageSnapshotInternal(y),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),O=true);}if(f.change&&R){let P=this.currentPackage(),y=chunk6KA3L3FR_cjs.gh(s,P,{storyPartName:a.partName});if(y===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"comment-cascade-failed"};y!==P&&(this.installPackageSnapshotInternal(y),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),O=true);}if(f.change){this.packageRev+=1;let P=O||v;P&&chunk6KA3L3FR_cjs.Aj(r.historyGroup,"split","package-unit"),!d&&r.recordsHistory!==false&&(i.historyDepth>l||P)&&(P?this.pushUndoPointer({kind:"package",before:s,after:this.currentPackage(),...k?.snapshot(f.change.caret)}):this.pushUndoPointer({kind:"story",partName:a.partName,story:a}));let y=P?this.publishSynthetic(f.change.origin,"global",a,f.change.created):f.change;return P||this.publish(y),{ok:true,change:y}}return {ok:true,change:f.change}}compositionSessionOpen(){return this.compositionSession!==null}beginComposition(t,n=null){let r=this.resolveStory(t);return !r.ok||this.compositionSession&&this.compositionSession.partName!==r.story.partName&&(this.endComposition(),r=this.resolveStory(t),!r.ok)?false:(this.compositionSession||(this.compositionSession={partName:r.story.partName,beforePackage:this.currentPackage(),storyCheckpoint:r.store.checkpoint(),packageWideEffects:false}),r.store.beginComposition(n),true)}endComposition(){let t=this.compositionSession;if(this.compositionSession=null,!t){this.body.endComposition();return}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return;let r=n.historyDepth;if(n.endComposition(),t.packageWideEffects){n.restoreHistoryStacks(t.storyCheckpoint),this.syncPackageFromStore(n),this.pushUndoPointer({kind:"package",before:t.beforePackage,after:this.currentPackage()});return}if(n.historyDepth>r){let o=t.partName===this.body.part.name?{kind:"body",partName:t.partName}:this.storyRefForPart(t.partName);o&&this.pushUndoPointer({kind:"story",partName:t.partName,story:o});}this.syncPackageFromStore(n);}cancelComposition(){let t=this.compositionSession;if(this.compositionSession=null,!t){this.body.cancelComposition();return}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(t.packageWideEffects){n&&n.restoreCheckpoint(t.storyCheckpoint),this.installPackageSnapshotInternal(t.beforePackage),this.packageRev+=1;let r=t.partName===this.body.part.name?{kind:"body",partName:t.partName}:this.storyRefForPart(t.partName);this.publishSynthetic(chunk6KA3L3FR_cjs.b.mutationHuman,"global",r??{kind:"body",partName:this.body.part.name},[]);return}n?.cancelComposition();}applyLifecycleOp(t){return chunk6KA3L3FR_cjs.Ca(this,()=>this.commitLifecycleOp(t),chunk6KA3L3FR_cjs.Da)}commitLifecycleOp(t){let n=this.currentPackage(),r=chunk6KA3L3FR_cjs.Ki(chunk6KA3L3FR_cjs.Sf(n),t);if(r)return {ok:false,reason:r};if(chunk6KA3L3FR_cjs.Pg(t)){let s=chunk6KA3L3FR_cjs.Qg(n,t);if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};if(s.package===n)return {ok:true,change:null};this.installPackageSnapshotInternal(s.package),this.pushUndoPointer({kind:"package",before:n,after:s.package}),this.packageRev+=1;let l={kind:"body",partName:this.body.part.name},d=this.publishSynthetic(chunk6KA3L3FR_cjs.b.mutationHuman,s.impact,l,s.createdPartName?[s.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:d}}if(!chunk6KA3L3FR_cjs.Lf(t))return {ok:false,reason:"invalidArgs",detail:"not-lifecycle-op"};let o=chunk6KA3L3FR_cjs.Mf(n,t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};this.installPackageSnapshotInternal(o.package),this.pushUndoPointer({kind:"package",before:n,after:o.package}),this.packageRev+=1;let i={kind:"body",partName:this.body.part.name},a=this.publishSynthetic(chunk6KA3L3FR_cjs.b.mutationHuman,o.impact,i,o.createdPartName?[o.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:a}}undo(){let t=this.undoOrder.pop();if(!t)return null;if(chunk6KA3L3FR_cjs.yj(this.body,this.stories,null),t.kind==="package"){this.installPackageSnapshotInternal(t.before,true,t.restoreNumbering),this.redoOrder.push(t),this.packageRev+=1;let o=this.publishSynthetic(chunk6KA3L3FR_cjs.b.mutationUndo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),o}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return null;let r=n.undo();return r?(this.redoOrder.push(t),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}redo(){let t=this.redoOrder.pop();if(!t)return null;if(chunk6KA3L3FR_cjs.yj(this.body,this.stories,null),t.kind==="package"){this.installPackageSnapshotInternal(t.after,true,t.restoreNumbering),this.undoOrder.push(t),this.packageRev+=1;let o=this.publishSynthetic(chunk6KA3L3FR_cjs.b.mutationRedo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),o}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return null;let r=n.redo();return r?(this.undoOrder.push(t),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}selectionForUndo(){return mo(this.undoOrder.at(-1),this.body,this.stories,"undo")}selectionForRedo(){return mo(this.redoOrder.at(-1),this.body,this.stories,"redo")}openStoryParts(){return uo(this.stories,this.pkg)}openedStoryCount(){return 1+this.stories.size}openStoryToken(){return xs(this.stories,this.pkg)}insertImage(t,n){return Ks(this,t,n)}applyFragmentPaste(t,n){return co(this,t,n)}replaceImage(t,n,r,o,i,a){return xo(this,t,n,r,o,i,a)}deleteImage(t,n){return Gs(this,t,n)}deleteImageTracked(t,n,r){return Xs(this,t,n,r)}embedExternalImage(t,n,r,o,i,a,s){return Ys(this,t,n,r,o,i,a,s)}setDrawingMetadataWithHyperlink(t,n,r,o,i){return Js(this,t,n,r,o,i)}applyImageProperties(t,n){return qs(this,t,n)}promoteStoryTransactionToPackageUnit(t,n,r,o){this.installPackageSnapshotInternal(n.package),n.restoreHistoryStacks(r),this.pushUndoPointer({kind:"package",before:t,after:this.currentPackage()}),this.packageRev+=1;let i=n.part.name===this.body.part.name?{kind:"body",partName:n.part.name}:this.storyRefForPart(n.part.name);return this.publishSynthetic(chunk6KA3L3FR_cjs.b.mutationHuman,i?.kind==="headerFooter"?"global":"flow-structural",i??{kind:"body",partName:this.body.part.name},[])}publishStoryWrite(t){return t?(this.packageRev+=1,this.publish(t),t):null}adoptPackageUnit(t){let n=this.currentPackage();t!==n&&this.pushUndoPointer({kind:"package",before:t,after:n});}installPackageSnapshot(t){this.installPackageSnapshotInternal(t);}installAuthoritativePackageSnapshot(t){this.installPackageSnapshotInternal(t,false);}publishRemotePackage(t,n){return el(this,t,n)}replacePackageShell(t){this.shellHyperlinks=Ns(this.shellHyperlinks,this.pkg,t);let n=t;n=chunk6KA3L3FR_cjs.Kd(n,this.body.part);for(let r of this.stories.values())t.parts.has(r.part.name)&&(n=chunk6KA3L3FR_cjs.Kd(n,r.part));this.pkg=n;}installPackageSnapshotInternal(t,n=true,r=false){let o=n?Ts(t,this.pkg,this.shellHyperlinks,r):t,i=o.parts.get(o.mainDocumentPart);if(!i)return;this.body.replacePart(i);for(let[s,l]of this.stories){let d=o.parts.get(s);d&&l.replacePart(d);}this.rIdToPartName.clear();let a=o.relationships.get(o.mainDocumentPart)??[];for(let s of a){if(s.type!==go&&s.type!==ho)continue;let l=chunk6KA3L3FR_cjs.E(s);l.mode!=="Internal"||!l.target.ok||this.stories.has(l.target.partName)&&o.parts.has(l.target.partName)&&this.rIdToPartName.set(s.id,l.target.partName);}this.pkg=o,this.pkg=chunk6KA3L3FR_cjs.Kd(this.pkg,this.body.part);for(let s of this.stories.values())this.pkg.parts.has(s.part.name)&&(this.pkg=chunk6KA3L3FR_cjs.Kd(this.pkg,s.part));}openNotesPartStore(t){let n=chunk6KA3L3FR_cjs.bg(this.currentPackage(),t);if(!n)return {ok:false,reason:"missing-part",detail:t};let r=this.stories.get(n.name);if(r)return {ok:true,story:{kind:"notesPart",partName:n.name,noteKind:t},store:r};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let o=chunk6KA3L3FR_cjs.eb(n),i=new dt(o,{historyLimit:this.historyLimit,settingsPart:()=>chunk6KA3L3FR_cjs.Sf(this.pkg)}),a={kind:"notesPart",partName:o.name,noteKind:t};return i.setStoryRef(a),this.stories.set(o.name,i),o!==n&&(this.pkg=chunk6KA3L3FR_cjs.Kd(this.pkg,o)),{ok:true,story:a,store:i}}openHeaderFooterStore(t){let n=this.rIdToPartName.get(t);if(n){let l=this.stories.get(n);if(l)return {ok:true,story:{kind:"headerFooter",partName:n,rId:t},store:l}}let r=js(this.currentPackage(),t);if(!r.ok)return r;let o=this.stories.get(r.partName);if(o)return this.rIdToPartName.set(t,r.partName),{ok:true,story:{kind:"headerFooter",partName:r.partName,rId:t},store:o};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let i=chunk6KA3L3FR_cjs.eb(r.part),a=new dt(i,{historyLimit:this.historyLimit,settingsPart:()=>chunk6KA3L3FR_cjs.Sf(this.pkg)}),s={kind:"headerFooter",partName:i.name,rId:t};return a.setStoryRef(s),this.stories.set(i.name,a),this.rIdToPartName.set(t,i.name),i!==r.part&&(this.pkg=chunk6KA3L3FR_cjs.Kd(this.pkg,i)),{ok:true,story:s,store:a}}storyRefForPart(t){if(t===this.body.part.name)return {kind:"body",partName:t};for(let[r,o]of this.rIdToPartName)if(o===t)return {kind:"headerFooter",partName:t,rId:r};let n=this.currentPackage().parts.get(t);return n?.root.localName==="footnotes"?{kind:"notesPart",partName:t,noteKind:"footnote"}:n?.root.localName==="endnotes"?{kind:"notesPart",partName:t,noteKind:"endnote"}:null}syncPackageFromStore(t){this.pkg=chunk6KA3L3FR_cjs.Kd(this.pkg,t.part);}pushUndoPointer(t){chunk6KA3L3FR_cjs.yj(this.body,this.stories,t),t.kind==="package"&&t.before.parts.get("/word/numbering.xml")!==t.after.parts.get("/word/numbering.xml")&&(t={...t,restoreNumbering:true}),this.undoOrder.push(t),this.redoOrder.length=0,this.undoOrder.length>this.historyLimit&&this.undoOrder.shift(),this.evictUnreachableStories();}evictUnreachableStories(){let t=rl(this.pkg,this.stories.keys(),this.undoOrder,this.redoOrder);for(let[o]of [...this.stories])if(!t.has(o)){this.stories.delete(o);for(let[i,a]of [...this.rIdToPartName])a===o&&this.rIdToPartName.delete(i);}let n=ol(t,this.pkg.mainDocumentPart,this.body.part.name,this.undoOrder,this.redoOrder),r=Cs(this.pkg,n);r!==this.pkg&&(this.pkg=r),this.shellHyperlinks=Es(this.shellHyperlinks,n,this.pkg.mainDocumentPart);}publish(t){this.lastChange=t;for(let n of this.subscribers)n(t);}publishSynthetic(t,n,r,o){this.commitCounter+=1;let i=this.packageRev-1,a={change:"model-change",fromRevision:i<0?0:i,toRevision:this.packageRev,commitId:`pkg-commit-${this.commitCounter}`,origin:t,dirty:[],created:[...o],deleted:[],splitJoin:[],dependencyKeys:[],impact:n,story:r};return this.publish(a),a}};var Bc=256,jc=65535,ll=64;function qn(e,t){return e.length>t}function dl(e){return typeof e!="string"||e.trim().length===0?"invalid-author":qn(e,Bc)?"resource-limit":chunk6KA3L3FR_cjs.O(e)?null:"invalid-author"}function cl(e){return typeof e!="string"||e.length===0?"invalid-text":qn(e,jc)?"resource-limit":chunk6KA3L3FR_cjs.O(e)?null:"invalid-text"}function Ro(e){if(typeof e!="string")return {ok:false,rejection:"invalid-date"};let t=e.trim();if(qn(t,ll))return {ok:false,rejection:"resource-limit"};if(!chunk6KA3L3FR_cjs.O(t))return {ok:false,rejection:"invalid-date"};let n=chunk6KA3L3FR_cjs.Ve(t);return n===null?{ok:false,rejection:"invalid-date"}:qn(n,ll)?{ok:false,rejection:"resource-limit"}:{ok:true,value:n}}function Xg(e){if(e===void 0)return null;let t=Ro(e);return t.ok?null:t.rejection}function Po(e){switch(e){case "invalid-author":return "invalid-author";case "invalid-text":return "invalid-text";case "invalid-date":return "invalid-property-value";case "resource-limit":return "resource-limit"}}function Hc(e,t,n){for(let r of e.attributes)if(r.localName===n&&r.namespaceUri===t)return r.value}function vo(e,t){if(!e){let a=chunk6KA3L3FR_cjs.hb(t);return a?chunk6KA3L3FR_cjs.ib(new Set,a,chunk6KA3L3FR_cjs.fb):"0"}let n=-1,r=new Set,o=a=>{if(a.kind!=="textValue"){if(a.kind==="comment"){let s=Hc(a,chunk6KA3L3FR_cjs.da,"id");if(s!==void 0&&/^\d{1,10}$/.test(s)){let l=Number(s);Number.isSafeInteger(l)&&l<=chunk6KA3L3FR_cjs.fb&&(r.add(String(l)),l>n&&(n=l));}}for(let s of a.children)o(s);}};o(e.root);let i=chunk6KA3L3FR_cjs.hb(t);return i?chunk6KA3L3FR_cjs.ib(r,i,chunk6KA3L3FR_cjs.fb):String(n+1)}function ml(e,t){if(e.kind==="textValue")return e;let n=t.get(e.id);if(n!==void 0)return n;let r=false,o=[];for(let i of e.children){let a=ml(i,t);a!==i&&(r=true),o.push(a);}return r?{...e,children:o}:e}function zc(e,t,n){let r=ml(e.root,t);if(r.kind==="textValue")return {ok:false,issues:[{code:"known-node-invariant",path:e.root.id,nodeId:e.root.id}]};let o=n===null?r:{...r,namespaceBindings:[...r.namespaceBindings,{prefix:n,namespaceUri:chunk6KA3L3FR_cjs.ga}]};return chunk6KA3L3FR_cjs.Ma(e,e.root.id,o,{deferValidation:true})}function ul(e,t,n){let r=new Map;for(let i of t){if(i.stampParagraph===null)continue;let a=r.get(i.commentsPartName);a||(a=new Map,r.set(i.commentsPartName,a)),a.set(i.stampParagraph.id,{paragraph:i.stampParagraph,paraId:i.paraId});}let o=e;for(let[i,a]of r){let s=o.parts.get(i);if(!s)return null;let l=chunk6KA3L3FR_cjs.cb(s.root),d=l??"w14",c=new Map;for(let p of a.values())c.set(p.paragraph.id,n(p.paragraph,p.paraId,d));let u=zc(s,c,l===null?d:null);if(!u.ok)return null;o=chunk6KA3L3FR_cjs.Kd(o,u.part);}return o}function pl(e,t,n){let r=e.root.children.map(o=>o.kind==="textValue"?o:t.get(o.id)??o);return chunk6KA3L3FR_cjs.Ka(e,e.root.id,[...r,...n],{deferValidation:true})}var hl="/word/comments.xml",yl="/word/commentsExtended.xml",wo="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",No="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Kc=[No,"application/vnd.ms-word.commentsExtended+xml"],xl="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Eo="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",Ze="http://schemas.microsoft.com/office/word/2012/wordml";function on(e,t,n){for(let r of e.attributes)if(r.localName===n&&r.namespaceUri===t)return r.value}function Mt(e,t){return {kind:"genericExtension",namespaceUri:chunk6KA3L3FR_cjs.da,localName:e,prefix:"w",value:t}}function Xe(e,t,n,r,o,i,a,s=[]){return {id:e,kind:t,namespaceUri:n,localName:o,prefix:r,namespaceBindings:s,attributes:i,children:a}}function kl(e,t,n,r,o){let i=t===e.mainDocumentPart?[t]:[t,e.mainDocumentPart];for(let a of i)for(let s of chunk6KA3L3FR_cjs.Md(e,a)){if(s.type!==n)continue;let l=chunk6KA3L3FR_cjs.w(a,s.rawTarget);if(!l.ok)continue;if(!e.parts.has(l.partName))return l.partName;let d=chunk6KA3L3FR_cjs.Nd(e,l.partName);if(d!==null&&(typeof r=="string"?d===r:r.includes(d)))return l.partName}return o}function Oo(e,t,n){let r=e.mainDocumentPart;for(let i of chunk6KA3L3FR_cjs.Md(e,r)){if(i.type!==t)continue;let a=chunk6KA3L3FR_cjs.w(r,i.rawTarget);if(a.ok&&a.partName===n)return e}let o=chunk6KA3L3FR_cjs.Rd(e,r);return chunk6KA3L3FR_cjs.Sd(o,r,t,chunk6KA3L3FR_cjs.th(r,n)).pkg}function To(e,t){return kl(e,t,xl,wo,hl)}function Rl(e,t){let n=chunk6KA3L3FR_cjs.Ug(e,t),r=chunk6KA3L3FR_cjs.Vg(e,t,n).extended;return r!==null?r:kl(e,t,Eo,Kc,yl)}function fl(e){let t=new Set;for(let n of e.parts.values())for(let r of chunk6KA3L3FR_cjs.bb(n.root))t.add(r);return t}function Gc(e,t){if(!e)return null;let n=null,r=o=>{if(!(n!==null||o.kind==="textValue")){if(o.kind==="comment"&&on(o,chunk6KA3L3FR_cjs.da,"id")===t){for(let i=o.children.length-1;i>=0;i-=1){let a=o.children[i];if(a.kind!=="paragraph")continue;let s=on(a,chunk6KA3L3FR_cjs.ga,"paraId");s!==void 0&&chunk6KA3L3FR_cjs.Za(s)&&(n=s.toUpperCase());return}return}for(let i of o.children)r(i);}};return r(e.root),n}function Xc(e,t){if(!e)return null;let n=null,r=o=>{if(!(n!==null||o.kind==="textValue")){if(o.kind==="comment"&&on(o,chunk6KA3L3FR_cjs.da,"id")===t){for(let i=o.children.length-1;i>=0;i-=1){let a=o.children[i];if(a.kind==="paragraph"){n=a;return}}return}for(let i of o.children)r(i);}};return r(e.root),n}function Pl(e){let t=chunk6KA3L3FR_cjs.cb(e.root);if(t!==null)return {part:e,prefix:t};let n={...e.root,namespaceBindings:[...e.root.namespaceBindings,{prefix:"w14",namespaceUri:chunk6KA3L3FR_cjs.ga}]},r=chunk6KA3L3FR_cjs.Ma(e,e.root.id,n,{deferValidation:true});return r.ok?{part:r.part,prefix:"w14"}:(chunk6KA3L3FR_cjs.Ja(e.root,n),{part:{...e,root:n},prefix:"w14"})}function vl(e,t,n){return Xe(e.id,"paragraph",e.namespaceUri,e.prefix??"w",e.localName,[...e.attributes.filter(r=>!(r.namespaceUri===chunk6KA3L3FR_cjs.ga&&r.localName==="paraId")),{kind:"genericExtension",namespaceUri:chunk6KA3L3FR_cjs.ga,localName:"paraId",prefix:n,value:t}],e.children,e.namespaceBindings)}function Yc(e,t,n,r){let o=e.parts.get(t);if(!o)return e;let i=Pl(o),a=chunk6KA3L3FR_cjs.Ha(i.part,n);if(!a||a.kind!=="paragraph")return chunk6KA3L3FR_cjs.Kd(e,i.part);let s=chunk6KA3L3FR_cjs.Ma(i.part,a.id,vl(a,r,i.prefix),{deferValidation:true});return chunk6KA3L3FR_cjs.Kd(e,s.ok?s.part:i.part)}function Jc(e,t,n,r){let o=`${hl}#comment-${e}`,i=n.text!==n.text.trim(),a=Xe(`${o}.t`,"text",chunk6KA3L3FR_cjs.da,"w","t",i?[{kind:"xmlSpace",namespaceUri:chunk6KA3L3FR_cjs.ea,localName:"space",prefix:"xml",value:"preserve"}]:[],[{id:`${o}.tv`,kind:"textValue",value:n.text}]),s=Xe(`${o}.rPr`,"runProperties",chunk6KA3L3FR_cjs.da,"w","rPr",[],[Xe(`${o}.rStyle`,"generic",chunk6KA3L3FR_cjs.da,"w","rStyle",[Mt("val","CommentReference")],[])]),l=Xe(`${o}.r`,"run",chunk6KA3L3FR_cjs.da,"w","r",[],[s,a]),d=Xe(`${o}.pPr`,"paragraphProperties",chunk6KA3L3FR_cjs.da,"w","pPr",[],[Xe(`${o}.pStyle`,"generic",chunk6KA3L3FR_cjs.da,"w","pStyle",[Mt("val","CommentText")],[])]),c=Xe(`${o}.p`,"paragraph",chunk6KA3L3FR_cjs.da,"w","p",[{kind:"genericExtension",namespaceUri:chunk6KA3L3FR_cjs.ga,localName:"paraId",prefix:r,value:t}],[d,l]);return Xe(o,"comment",chunk6KA3L3FR_cjs.da,"w","comment",[Mt("id",e),Mt("author",n.author),...n.initials===void 0?[]:[Mt("initials",n.initials)],...n.date===void 0?[]:[Mt("date",n.date)]],[c])}function Io(e,t){let n=chunk6KA3L3FR_cjs.xa(t,{name:e,contentType:"application/xml"});return n.ok?n.part.root:null}function Co(e,t){for(let x of [dl(t.author),cl(t.text)])if(x)return {ok:false,reason:Po(x)};let n;if(t.date!==void 0){let x=Ro(t.date);if(!x.ok)return {ok:false,reason:Po(x.rejection)};n=x.value;}let r={...t,...n===void 0?{}:{date:n}},o=e.package,i=e.part.name,a=To(o,i),s=Rl(o,i),l=o.parts.get(a),d=vo(l,r.actorId),c=chunk6KA3L3FR_cjs.ab(`${a}#${d}`,fl(o)),u=t.replyToCommentId===void 0?null:Gc(l,t.replyToCommentId),p=t.replyToCommentId!==void 0&&u===null?Xc(l,t.replyToCommentId):null;if(t.replyToCommentId!==void 0&&u===null&&!p)return {ok:false,reason:"unknown-revision"};let R=p?chunk6KA3L3FR_cjs.ab(`${a}#parent-${t.replyToCommentId}`,new Set([...fl(o),c])):null,m=u??R,h=t.anchor.endParagraphId??t.anchor.paragraphId,g=e.transact(x=>{let k=en(x);k.applyPackage(f=>{let v=f.parts.has(a)?f:(()=>{let O=Io(a,`<w:comments xmlns:w="${chunk6KA3L3FR_cjs.da}"/>`);return O?chunk6KA3L3FR_cjs.Td(f,a,O,wo):null})();return v===null?f:Oo(v,xl,a)}),p&&R&&k.applyPackage(f=>Yc(f,a,p.id,R)),k.applyPackage(f=>{let v=f.parts.get(a);if(!v)return f;let O=Pl(v),P=chunk6KA3L3FR_cjs.La(O.part,O.part.root.id,O.part.root.children.length,[Jc(d,c,r,O.prefix)],{deferValidation:true});return P.ok?chunk6KA3L3FR_cjs.Kd(f,P.part):f}),m!==null&&(k.applyPackage(f=>{let v=f.parts.has(s)?f:(()=>{let O=Io(s,`<w15:commentsEx xmlns:w15="${Ze}"/>`);return O?chunk6KA3L3FR_cjs.Td(f,s,O,No):null})();return v===null?f:Oo(v,Eo,s)}),k.applyPackage(f=>{let v=f.parts.get(s);if(!v)return f;let P=[...qc(v).has(m.toUpperCase())?[]:[So(`${s}#ex-${m}`,m,void 0,false)],So(`${s}#ex-${c}`,c,m,false)],y=chunk6KA3L3FR_cjs.La(v,v.root.id,v.root.children.length,P,{deferValidation:true});return y.ok?chunk6KA3L3FR_cjs.Kd(f,y.part):f})),k.applyTo(i,{op:"insertCommentMarker",paragraphId:h,offset:t.anchor.end,commentId:d,marker:"reference"}),k.applyTo(i,{op:"insertCommentMarker",paragraphId:h,offset:t.anchor.end,commentId:d,marker:"end"}),k.applyTo(i,{op:"insertCommentMarker",paragraphId:t.anchor.paragraphId,offset:t.anchor.start,commentId:d,marker:"start"});},r.actorId===void 0?{}:{actorId:r.actorId});return g.ok?{ok:true,commentId:d,change:g.change}:{ok:false,reason:g.reason}}function bo(e){for(let t=e.children.length-1;t>=0;t-=1){let n=e.children[t];if(n.kind==="paragraph")return n}return null}function gl(e){let t=bo(e);if(!t)return null;let n=on(t,chunk6KA3L3FR_cjs.ga,"paraId");return n!==void 0&&chunk6KA3L3FR_cjs.Za(n)?n.toUpperCase():null}function qc(e){let t=new Map;if(!e)return t;let n=r=>{if(r.kind!=="textValue"){if(r.namespaceUri===Ze&&r.localName==="commentEx"){let o=on(r,Ze,"paraId");o!==void 0&&chunk6KA3L3FR_cjs.Za(o)&&t.set(o.toUpperCase(),r);}for(let o of r.children)n(o);}};return n(e.root),t}function rn(e,t){return {kind:"genericExtension",namespaceUri:Ze,localName:e,prefix:"w15",value:t}}function Qc(e,t){return {id:e.id,kind:"generic",namespaceUri:e.namespaceUri,localName:e.localName,...e.prefix===void 0?{}:{prefix:e.prefix},namespaceBindings:e.namespaceBindings,attributes:t,children:e.children}}function Zc(e,t,n){let r=[],o=false,i=false;for(let a of e.attributes){if(a.namespaceUri===Ze&&a.localName==="done"){o=true,r.push({kind:"genericExtension",namespaceUri:a.namespaceUri,localName:a.localName,...a.prefix===void 0?{}:{prefix:a.prefix},value:n?"1":"0"});continue}a.namespaceUri===Ze&&a.localName==="paraIdParent"&&(i=true),r.push(a);}return !i&&t!==void 0&&r.push(rn("paraIdParent",t)),o||r.push(rn("done",n?"1":"0")),Qc(e,r)}function So(e,t,n,r){return {id:e,kind:"generic",namespaceUri:Ze,localName:"commentEx",prefix:"w15",namespaceBindings:[],attributes:[rn("paraId",t),...n===void 0?[]:[rn("paraIdParent",n)],rn("done",r?"1":"0")],children:[]}}function Mo(e,t,n){return em(e,t,n,chunk6KA3L3FR_cjs.Tg())}function em(e,t,n,r){let o=e.package,i=e.part.name;if(chunk6KA3L3FR_cjs.Ug(o,i)===null)return {ok:false,reason:"unknown-comment"};let s=chunk6KA3L3FR_cjs.Xg(o,t,{storyPartName:i},r);if(!s.ok)return {ok:false,reason:"unknown-comment"};let l=chunk6KA3L3FR_cjs.Wg(o,r);if(l.truncated||r.truncated)return {ok:false,reason:"unknown-comment"};let d=l.used,c=new Map,u=[];for(let h of s.ids){let g=s.records.get(h);if(!g)return {ok:false,reason:"unknown-comment"};if(!bo(g.node))return {ok:false,reason:"unknown-comment"};let k=gl(g.node),f=k??chunk6KA3L3FR_cjs.ab(`${g.partName}#done-${h}`,d);k===null&&d.add(f),c.set(h,f);}for(let h of s.ids){let g=s.records.get(h),x=bo(g.node),k=c.get(h),f=gl(g.node),v=s.parentCommentIdByChildId.get(h),O=s.parentParaIdByCommentId.get(h)??(v===void 0?void 0:c.get(v)),P=s.commentExByParaId.get(k);u.push({paraId:k,stampParagraph:f===null?x:null,commentsPartName:g.partName,parentParaId:O,existing:P?.node,existingParentParaId:P?.parentParaId,existingDone:P?.done??false});}if(u.length===0)return {ok:false,reason:"unknown-comment"};if(u.every(h=>h.existingDone===n))return {ok:true,changed:false,change:null};let p=s.extendedPartName??yl,R=s.extendedPartName===null,m=e.transact(h=>{en(h).applyPackage(x=>{let k=ul(x,u,vl);if(k===null)return x;let f=k;if(!f.parts.has(p)){let T=Io(p,`<w15:commentsEx xmlns:w15="${Ze}"/>`);if(!T)return x;let N=chunk6KA3L3FR_cjs.Td(f,p,T,No);f=R?Oo(N,Eo,p):N;}let v=f.parts.get(p);if(!v)return x;let O=new Map,P=[];for(let T of u){let N=T.existingParentParaId??T.parentParaId;T.existing?O.set(T.existing.id,Zc(T.existing,N,n)):P.push(So(`${p}#done-${T.paraId}`,T.paraId,N,n));}let y=pl(v,O,P);return y.ok?chunk6KA3L3FR_cjs.Kd(f,y.part):x});});return m.ok?{ok:true,changed:true,change:m.change}:{ok:false,reason:m.reason}}function tm(e,t){let n=To(e,t);return e.parts.has(n)&&chunk6KA3L3FR_cjs.Nd(e,n)===wo}function nm(e,t){return To(e,t)}function rm(e,t){return Rl(e,t)}var Ol={kind:"body"};function om(e,t,n=Ol){let r=n.kind==="body"?null:e.resolveStory(n),o=r?.ok?r.store:e.bodyStore(),i=e.currentPackage(),a=o.checkpoint();return o.graftPackage(()=>e.currentPackage()),chunk6KA3L3FR_cjs.Ca(e,()=>{let s=Co(o,t);return s.ok&&(o.restoreHistoryStacks(a),e.replacePackageShell(o.package),e.adoptPackageUnit(i),e.publishStoryWrite(s.change)),s},s=>chunk6KA3L3FR_cjs.Da(s))}function am(e,t,n){let r=e.bodyStore(),o=e.currentPackage(),i=chunk6KA3L3FR_cjs.Ki(chunk6KA3L3FR_cjs.Sf(o),{op:"setCommentResolved"});if(i)return {ok:false,reason:i};let a=r.checkpoint();return r.graftPackage(()=>e.currentPackage()),chunk6KA3L3FR_cjs.Ca(e,()=>{let s=Mo(r,t,n);return !s.ok||!s.changed||(r.restoreHistoryStacks(a),e.replacePackageShell(r.package),e.adoptPackageUnit(o),e.publishStoryWrite(s.change)),s},s=>s.ok&&s.changed)}function im(e,t,n=Ol,r){if(t.length===0||chunk6KA3L3FR_cjs.Ki(chunk6KA3L3FR_cjs.Sf(e.currentPackage()),{op:"deleteComments"}))return false;let o=n.kind==="body"?e.bodyStore().part:e.partFor(n);if(!o)return false;let i={storyPartName:o.name,...r===void 0?{}:{noteId:r}},a=e.bodyStore(),s=e.currentPackage(),l=a.checkpoint();return a.graftPackage(()=>e.currentPackage()),chunk6KA3L3FR_cjs.Ca(e,()=>{let d=false,c=false,u=a.transact(p=>{en(p).applyPackage(m=>{let h=m;for(let g of t){let x=g.parentCommentId===void 0?chunk6KA3L3FR_cjs.eh(h,g.commentId,i):chunk6KA3L3FR_cjs.fh(h,g.commentId,g.parentCommentId,i);if(x===null)return d=true,m;c||=x!==h,h=x;}return h});});return d||!u.ok||!c?false:(a.restoreHistoryStacks(l),e.installPackageSnapshot(a.package),e.adoptPackageUnit(s),e.publishStoryWrite(u.change),true)},d=>d)}var bl=256*1024,Sl=4096;function Do(e,t,n){let r=t.payload,o=e.part.name,i=n??o;if(r){if(r.data.length>bl)return {ok:false,reason:"payload-too-large",detail:"data"};if(r.label.length>Sl)return {ok:false,reason:"payload-too-large",detail:"label"}}let a=new Set(chunk6KA3L3FR_cjs.yb(e.part.root).map(p=>p.node.id)),s=t.replaceControlId===void 0?[]:wl(e,o,t.replaceControlId),l=null,d,c=e.transact(p=>{if(t.replaceControlId!==void 0){p.apply({op:"removeContentControl",controlId:t.replaceControlId,keepContent:false});for(let h of s)p.applyPackage(g=>chunk6KA3L3FR_cjs.Bh(g,h.partName,h.nodeId));}let R=t.replaceUntil;if(R!==void 0&&R<=t.offset){l="invalid-range",d="replaceUntil must be past offset";return}if(R!==void 0&&p.apply({op:"deleteText",paragraphId:t.paragraphId,start:t.offset,end:R}),!r){p.apply({op:"insertInlineContentControl",paragraphId:t.paragraphId,offset:t.offset,tag:t.tag,text:t.text,...t.alias===void 0?{}:{alias:t.alias},...t.lock===void 0?{}:{lock:t.lock}});return}let m=null;p.applyPackage(h=>{let g=chunk6KA3L3FR_cjs.wh(h,i,r.namespaceUri,r.rootLocalName);if(!g.part)return l="store-not-authored",d=`no customXml store could be created for ${r.namespaceUri}. The namespace must be free of control characters and quotes, the root name must be an XML name, and a store this document already carries for that namespace must use the same root name (${r.rootLocalName})`,h;if(m=chunk6KA3L3FR_cjs.Gh(g.part,r.rootLocalName,r.nodeId),!m)return l="unaddressable-payload",d=`the node id ${JSON.stringify(r.nodeId)} or the namespace ${JSON.stringify(r.namespaceUri)} cannot be written into an XPath. Ids and root names must match [A-Za-z_][\\w.-]{0,127}; a namespace may not contain a quote, an angle bracket or an ampersand`,h;let x=chunk6KA3L3FR_cjs.Ah(g.pkg,g.part.partName,{id:r.nodeId,label:r.label,data:r.data});return chunk6KA3L3FR_cjs.zh(x,g.part.partName,r.nodeId)?x:(l="store-not-authored",d="the payload node could not be written into the store",h)}),!(l!==null||!m)&&p.apply({op:"insertInlineContentControl",paragraphId:t.paragraphId,offset:t.offset,tag:t.tag,text:t.text,...t.alias===void 0?{}:{alias:t.alias},...t.lock===void 0?{}:{lock:t.lock},dataBinding:m});});if(l!==null)return {ok:false,reason:l,...d===void 0?{}:{detail:d}};if(!c.ok)return {ok:false,reason:c.reason,...c.detail===void 0?{}:{detail:c.detail}};let u=sm(e,a);return {ok:true,change:c.change,...u===void 0?{}:{nodeId:u}}}function sm(e,t){for(let n of chunk6KA3L3FR_cjs.yb(e.part.root))if(!t.has(n.node.id))return n.node.id}function wl(e,t,n){let r=chunk6KA3L3FR_cjs.yb(e.part.root).find(i=>i.node.id===n);if(!r)return [];let o=[];for(let i of chunk6KA3L3FR_cjs.uh(e.package,t)){let a=chunk6KA3L3FR_cjs.Jh(r.node,i.itemId);a!==null&&o.push({partName:i.partName,nodeId:a});}return o}function Ao(e,t){let n=e.part.name,r=wl(e,n,t),o=e.transact(i=>{i.apply({op:"removeContentControl",controlId:t,keepContent:false});for(let a of r)i.applyPackage(s=>chunk6KA3L3FR_cjs.Bh(s,a.partName,a.nodeId));});return o.ok?{ok:true,change:o.change}:{ok:false,reason:o.reason,...o.detail===void 0?{}:{detail:o.detail}}}function lm(e,t,n){if(!e.parts.has(t)||n.length===0)return {ok:true,pkg:e,removed:[]};let r=e,o=[];for(let i of n){let a=chunk6KA3L3FR_cjs.vh(r,t,i);if(!a)continue;let s=chunk6KA3L3FR_cjs.Ih(r,a.itemId),l=chunk6KA3L3FR_cjs.Ch(r,a.partName,s);if(l.pkg===r&&chunk6KA3L3FR_cjs.yh(r,a.partName).some(d=>!s.has(d.id)))return {ok:false,reason:`the payload store for ${i} refused the sweep`};r=l.pkg,o.push(...l.removed);}return {ok:true,pkg:r,removed:o}}var Il=new WeakMap;function dm(e,t){let n=Il.get(e);n||(n=new Map,Il.set(e,n));let r=n.get(t);if(r)return r;let o=chunk6KA3L3FR_cjs.uh(e,t).map(i=>({itemId:i.itemId,nodes:new Map(chunk6KA3L3FR_cjs.yh(e,i.partName).map(a=>[a.id,a]))}));return n.set(t,o),o}function cm(e,t,n=t){let r=new Map,o=e.parts.get(t);if(!o)return r;let i=dm(e,n);if(i.length===0)return r;for(let a of chunk6KA3L3FR_cjs.yb(o.root))for(let s of i){let l=chunk6KA3L3FR_cjs.Jh(a.node,s.itemId);if(l===null)continue;let d=s.nodes.get(l);if(d){r.set(a.node.id,{nodeId:l,label:d.label,data:d.data});break}}return r}function mm(e,t,n){let r=new Map,o=chunk6KA3L3FR_cjs.vh(e,t,n);if(!o)return r;for(let i of chunk6KA3L3FR_cjs.yh(e,o.partName))r.set(i.id,{label:i.label,data:i.data});return r}var Nl={kind:"body"};function El(e,t,n){let r=t.kind==="body"?null:e.resolveStory(t),o=r?.ok?r.store:e.bodyStore(),i=e.currentPackage(),a=o.checkpoint();return o.graftPackage(()=>e.currentPackage()),chunk6KA3L3FR_cjs.Ca(e,()=>{let s=n(o);return s.ok&&(o.restoreHistoryStacks(a),e.replacePackageShell(o.package),e.adoptPackageUnit(i),e.publishStoryWrite(s.change)),s},s=>chunk6KA3L3FR_cjs.Da(s))}function um(e,t,n=Nl){return El(e,n,r=>Do(r,t,e.bodyStore().part.name))}function pm(e,t,n=Nl){return El(e,n,r=>Ao(r,t))}var Cl=new WeakMap;function Ie(e,t){return Cl.set(e,t),e}function Z(e){return Cl.get(e)??[]}function an(e){return `${e.kind}-${e.id}`}function _o(e){return e.kind==="revision"?e.ranges:e.range?[e.range]:[]}function Ml(e){return _o(e)[0]??null}function Dt(e,t){let n=Ml(e);if(!n)return Number.MAX_SAFE_INTEGER;let r=t.get(n.start.paragraphId);return r===void 0?Number.MAX_SAFE_INTEGER:r*1e6+Math.min(n.start.offset,999999)}function fm(e,t){let n=t.get(e.start.paragraphId),r=t.get(e.end.paragraphId);return n===void 0||r===void 0?Number.MAX_SAFE_INTEGER:(r-n)*1e6+(e.end.offset-e.start.offset)}var gm=0,hm=1,ym=2;function xm(e,t,n){let r=n.get(t.paragraphId),o=n.get(e.start.paragraphId),i=n.get(e.end.paragraphId);return r===void 0||o===void 0||i===void 0||r<o||r>i||r===o&&t.offset<e.start.offset||r===i&&t.offset>e.end.offset?null:o===i&&e.start.offset===e.end.offset?gm:r===i&&t.offset===e.end.offset?ym:hm}function km(e,t,n){let r=null;for(let o of _o(e)){let i=xm(o,t,n);if(i===null)continue;let a=fm(o,n);(r===null||i<r.grip||i===r.grip&&a<r.width)&&(r={grip:i,width:a});}return r}var Tl={comment:0,custom:1,revision:2};function Rm(e,t,n){let r=[];for(let o of e){let i=km(o,t,n);i!==null&&r.push({item:o,grip:i.grip,width:i.width});}return r.sort((o,i)=>o.grip!==i.grip?o.grip-i.grip:o.width!==i.width?o.width-i.width:o.item.kind!==i.item.kind?Tl[o.item.kind]-Tl[i.item.kind]:o.item.kind==="revision"&&i.item.kind==="revision"?i.item.nesting-o.item.nesting:0).map(o=>o.item)}function Lh(e,t,n){let o=Rm(e,t,n).filter(i=>!(i.kind==="comment"&&i.resolved))[0];return o?o.kind==="comment"?Dl(e,o):o:null}function $h(e,t){return Dl(e,t)}function Dl(e,t){let n=new Map,r=new Map;for(let a of e)a.kind==="comment"?n.set(a.id,a):a.kind==="revision"&&r.set(a.id,a);let o=new Set([t.id]),i=t;for(;i.parentId!==void 0;){let a=n.get(i.parentId);if(!a||o.has(a.id))break;o.add(a.id),i=a;}if(i.parentRevisionId!==void 0){let a=r.get(i.parentRevisionId);if(a)return a}return i}function Al(e){let t=[],n=r=>{if(r.kind==="textValue"){t.push(r.value);return}for(let o of r.children)n(o);};for(let r of e.blocks)n(r);return t.join("")}function _l(e){if(e.initials&&e.initials.trim().length>0)return e.initials.trim();let t=e.author.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function ut(e){if(e.kind==="textValue")return e.value;if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunk6KA3L3FR_cjs.Xa(e);if(chunk6KA3L3FR_cjs.ne(e))return "";let t="";for(let n of e.children)t+=ut(n);return t}var At=(e,t)=>e.kind!=="textValue"&&e.namespaceUri===chunk6KA3L3FR_cjs.da&&e.localName===t;function Fl(e,t,n){let r=new Set(["tcPrChange","trPrChange","tblPrExChange","tblGridChange","tblPrChange"]),o=new Map(n.filter(h=>h.propertyChange&&r.has(h.node.localName)).map(h=>[h.node.id,h]));if(!o.size)return [...t];let i=chunk6KA3L3FR_cjs.ii(e,n).tableHistories,a=[],s=new Map,l=h=>h.node.attributes.find(g=>g.namespaceUri===chunk6KA3L3FR_cjs.da&&g.localName==="author")?.value??"",d=(h,g)=>{if(h.kind==="textValue"||At(h,"tbl"))return;let x=o.get(h.id);x&&g.push(x);for(let k of h.children)d(k,g);},c=h=>{if(h.kind!=="textValue"){if(At(h,"tbl")){let g,x=[],k=[],f=[],v=false;for(let P of h.children){if(At(P,"tblGrid")&&d(P,k),At(P,"tblPr")&&d(P,f),!At(P,"tr"))continue;let y=[];if(d(P,y),v||=y.some(N=>N.refused),!y.length||y.some(N=>N.refused)){g=void 0;continue}let T=l(y[y.length-1]);(!g||g.author!==T)&&(g={ids:new Set,author:T,tableId:h.id},a.push(g),x.push(g));for(let N of y)g.ids.add(N.node.id);}let O=x.at(-1);if(O&&!v&&k.every(P=>!P.refused)){for(let P of k)O.ids.add(P.node.id);if(x.length===1&&k.length>0)for(let P of f){let y=P.node.children.find(T=>At(T,"tblPr"));!P.refused&&P.parent?.kind==="tableProperties"&&y&&l(P)===O.author&&(i.has(P.node.id)||chunk6KA3L3FR_cjs.sa({...P.parent,children:P.parent.children.filter(T=>T.id!==P.node.id)},y))&&O.ids.add(P.node.id);}}}for(let g of h.children)c(g);}};c(e.root);for(let h of a)for(let g of h.ids)s.set(g,h);let u=new Set;for(let h of t){let x=Z(h).map(k=>s.get(k));if(x.some(k=>k!==x[0]))for(let k of x)k&&u.add(k.tableId);}for(let h of a)if(u.has(h.tableId))for(let g of h.ids)o.get(g)?.node.localName==="tblGridChange"&&(h.ids.delete(g),s.delete(g));let p=new Map;for(let h of t){let g=Z(h),x=g.length?s.get(g[0]):void 0;if(!x||h.readOnly||h.revisionKind!=="format"||!g.every(f=>s.get(f)===x))continue;let k=p.get(x)??[];k.push(h),p.set(x,k);}let R=new Map,m=new Set;for(let h of a){let g=p.get(h)??[],x=g.find(y=>!["tblGridChange","tblPrChange"].includes(y.formattingKind??""))??g[0],k=x?[x,...g.filter(y=>y!==x)]:[],f=k.flatMap(Z),v=new Set(f);if(!x||k.length<2||![...h.ids].every(y=>v.has(y)))continue;let O=[...new Map(k.flatMap(y=>y.addresses).map(y=>[JSON.stringify([y.id,y.author,y.date??null]),y])).values()],P=[...new Map(k.filter(y=>!["tblGridChange","tblPrChange"].includes(y.formattingKind??"")).flatMap(y=>y.ranges).map(y=>[JSON.stringify(y),y])).values()];R.set(x,Ie({...x,author:h.author,addresses:O,ranges:P,text:[...new Set(k.map(y=>y.text).filter(Boolean))].join(`
2
+ `)},f));for(let y of k.slice(1))m.add(y);}return t.filter(h=>!m.has(h)).map(h=>R.get(h)??h)}var $l=e=>e.kind==="textValue"?e.value:[e.namespaceUri,e.localName,e.attributes.map(t=>[t.namespaceUri,t.localName,t.value]).sort((t,n)=>JSON.stringify(t).localeCompare(JSON.stringify(n))),e.children.map($l)],Ll=e=>new Map(e.children.filter(t=>t.kind!=="textValue"&&!(t.namespaceUri===chunk6KA3L3FR_cjs.da&&t.localName==="rPrChange")).map(t=>t.kind==="textValue"?["",""]:[JSON.stringify([t.namespaceUri,t.localName]),JSON.stringify($l(t))]));function Pm(e){if(e.node.localName!=="rPrChange"||!e.parent||e.paragraphMark||e.refused)return;let t=e.node.children.find(i=>i.kind!=="textValue"&&i.namespaceUri===chunk6KA3L3FR_cjs.da&&i.localName==="rPr");if(!t||t.kind==="textValue")return;let n=Ll(t),r=Ll(e.parent),o=[...new Set([...n.keys(),...r.keys()])].sort().filter(i=>n.get(i)!==r.get(i)).map(i=>[i,r.get(i)??null]);return o.length?JSON.stringify(o):void 0}function Ul(e,t){let n=new Map(t.map(s=>[s.node.id,Pm(s)])),r=new Map;for(let s of e){if(s.revisionKind!=="format"||s.formattingKind!=="rPrChange"||s.readOnly||s.ranges.length!==1)continue;let l=s.ranges[0];if(l.start.paragraphId!==l.end.paragraphId||l.start.offset===l.end.offset)continue;let d=Z(s),c=d.length?n.get(d[0]):void 0;if(!c||!d.every(R=>n.get(R)===c))continue;let u=JSON.stringify([s.author,l.partName,l.start.paragraphId,c]),p=r.get(u)??[];p.push(s),r.set(u,p);}let o=new Set,i=new Map,a=s=>{if(s.length<2)return;let l=s[0],d=[...new Map(s.flatMap(c=>c.addresses).map(c=>[JSON.stringify([c.id,c.author,c.date??null]),c])).values()];i.set(l,Ie({...l,addresses:d,ranges:s.flatMap(c=>c.ranges),text:s.map(c=>c.text).join("")},s.flatMap(Z)));for(let c of s.slice(1))o.add(c);};for(let s of r.values()){s.sort((d,c)=>d.ranges[0].start.offset-c.ranges[0].start.offset);let l=[];for(let d of s)l.length&&l[l.length-1].ranges[0].end.offset!==d.ranges[0].start.offset&&(a(l),l=[]),l.push(d);a(l);}return e.filter(s=>!o.has(s)).map(s=>i.get(s)??s)}var ue=(e,t)=>e.kind!=="textValue"&&e.namespaceUri===chunk6KA3L3FR_cjs.da&&e.localName===t,sn=(e,t)=>e.attributes.find(n=>n.namespaceUri===chunk6KA3L3FR_cjs.da&&n.localName===t)?.value;function vm(e,t,n){let r=e.children.filter(o=>ue(o,"tc"));return r.length>0&&r.every(o=>{if(o.kind==="textValue")return false;let i=o.children.filter(a=>a.kind==="paragraph");return i.length>0&&i.every(a=>{if(a.kind==="textValue")return false;let s=a.children.find(u=>ue(u,"pPr")),l=s?.kind!=="textValue"?s?.children.find(u=>ue(u,"rPr")):void 0,d=l?.kind!=="textValue"?l?.children.filter(u=>ue(u,"ins")||ue(u,"del")):void 0,c=d?.length===1?d[0]:void 0;return !!c&&c.kind!=="textValue"&&c.localName===t&&sn(c,"author")===n})})}function Om(e,t,n,r){let o=new Map(n.filter(f=>f.parent?.localName==="trPr"&&(f.node.localName==="ins"||f.node.localName==="del")).map(f=>[f.node.id,f]));if(o.size===0)return [...t];let i=new Map(n.map(f=>[f.node.id,f])),a=new Map;for(let f of r.values())a.set(f.paragraphId,Math.max(a.get(f.paragraphId)??0,f.end));let s=[],l=new Map,d=new Set,c=new Map,u=(f,v)=>{if(f.kind==="textValue"||ue(f,"tbl"))return;let O=i.get(f.id),P=o.has(f.id);O&&!O.propertyChange&&f.localName===v.direction&&!O.refused&&(P?sn(f,"author")===v.author:O.paragraphMark||f.kind==="revisionInsert"||f.kind==="revisionDelete")&&(c.set(f.id,v),P&&v.markerIds.add(f.id));for(let y of f.children)u(y,v);},p=(f,v=0)=>{if(f.kind!=="textValue"){if(ue(f,"tr")&&v>1){let O=f.children.find(P=>ue(P,"trPr"));if(O&&O.kind!=="textValue")for(let P of O.children)o.has(P.id)&&l.set(P.id,f);}if(ue(f,"tbl")){let O;for(let P of f.children){if(P.kind==="textValue"||!ue(P,"tr")){O=void 0;continue}let y=P.children.find(ee=>ue(ee,"trPr")),T=y?.kind!=="textValue"?y?.children.filter(ee=>o.has(ee.id))??[]:[],N=T.length===1?T[0]:void 0,j=N&&N.kind!=="textValue"?sn(N,"author"):void 0;if(!N||N.kind==="textValue"||j===void 0||o.get(N.id)?.refused){O=void 0;continue}let z=N.localName;if(v>0){if(!vm(P,z,j)){O=void 0;continue}d.add(P.id);}(!O||O.author!==j||O.direction!==z)&&(O={markerIds:new Set,rows:[],author:j,direction:z,followingText:[]},s.push(O)),O.rows.push(P),O.markerIds.add(N.id),u(P,O);}}for(let O of f.children)p(O,v+(ue(f,"tbl")?1:0));}};p(e.root);let R,m=new Set(s.flatMap(f=>f.rows.map(v=>v.id))),h=(f,v=0,O=false)=>{if(f.kind==="textValue")return;d.has(f.id)&&(R=void 0);let P=v+(ue(f,"tbl")?1:0),y=O||m.has(f.id);if(f.kind==="run"&&!y&&(R=void 0),R&&(f.kind==="revisionInsert"||f.kind==="revisionDelete")){let T=R;R=void 0;let N=i.get(f.id),j=sn(T.marker,"author");if(N&&!N.refused&&j!==void 0&&f.localName===T.marker.localName&&sn(f,"author")===j&&(c.get(f.id)?.author??j)===j){let z=c.get(f.id);z||(z={markerIds:new Set,rows:[T.row],author:j,direction:T.marker.localName,followingText:[ut(f)],rowEndOnly:true},s.push(z),c.set(f.id,z)),z.markerIds.add(T.marker.id),c.set(T.marker.id,z);}}for(let T of f.children)h(T,P,y);if((ue(f,"tc")||f.kind==="paragraph"&&!y)&&(R=void 0),ue(f,"tr")&&(R=void 0,P>1&&!d.has(f.id))){let T=f.children.find(z=>ue(z,"trPr")),N=T&&T.kind!=="textValue"?T.children.filter(z=>o.has(z.id)):[],j=N.length===1?N[0]:void 0;j&&j.kind!=="textValue"&&!o.get(j.id)?.refused&&(R={marker:j,row:f});}};h(e.root),t=t.map(f=>{let v=Z(f);if(f.revisionKind!=="structural"||!v.length||!v.every(P=>l.has(P)))return f;let O=[];for(let P of v){let y,T=N=>{if(!(N.kind==="textValue"||ue(N,"tbl")))if(N.kind==="paragraph")y=N;else for(let j of N.children)T(j);};if(T(l.get(P)),y){let N={paragraphId:y.id,offset:a.get(y.id)??0};O.push({partName:e.name,start:N,end:N});}}return O.length?Ie({...f,ranges:O},v):f});let g=new Map;for(let f of t){let v=Z(f),O=v.length?c.get(v[0]):void 0;if(!O||f.readOnly||!v.every(y=>c.get(y)===O))continue;let P=g.get(O)??[];P.push(f),g.set(O,P);}let x=new Set,k=new Map;for(let f of s){let v=g.get(f)??[],O=v.find(_=>Z(_).some(B=>f.markerIds.has(B))),P=new Set(v.flatMap(Z));if(!O||![...f.markerIds].every(_=>P.has(_)))continue;let y=[O,...v.filter(_=>_!==O)],T=y.flatMap(_=>_.addresses),N=[],j=[],z=_=>{if(!(_.kind==="textValue"||ue(_,"tbl"))){if(_.kind==="paragraph"){N.push({partName:e.name,start:{paragraphId:_.id,offset:0},end:{paragraphId:_.id,offset:a.get(_.id)??0}}),j.push(ut(_));return}for(let B of _.children)z(B);}};for(let _ of f.rows)z(_);if(f.rowEndOnly&&N.length){let _=N[N.length-1];N.splice(0,N.length,{..._,start:_.end});}let ee=new Set(N.map(_=>_.start.paragraphId));for(let _ of y)if(!(_.revisionKind==="structural"&&Z(_).some(B=>!l.has(B))))for(let B of _.ranges)ee.has(B.start.paragraphId)||N.push(B);j.push(...f.followingText);let X=Ie({...O,addresses:[...new Map(T.map(_=>[JSON.stringify([_.id,_.author,_.date??null]),_])).values()],ranges:N.length?N:y.flatMap(_=>_.ranges),text:j.join(`
3
+ `),nesting:y.reduce((_,B)=>Math.min(_,B.nesting),O.nesting)},y.flatMap(Z));k.set(O,X);for(let _ of v)_!==O&&x.add(_);}return t.filter(f=>!x.has(f)).map(f=>k.get(f)??f)}function Bl(e,t,n,r,o){let i=Ul(Fl(e,Om(e,t,n,r),n),n),a=new Set(n.filter(s=>s.node.kind==="moveFromRangeStart"||s.node.kind==="moveToRangeStart").map(s=>s.node.id));return a.size>0||n.some(s=>s.parent?.localName==="trPr"&&["ins","del"].includes(s.node.localName))?i.sort((s,l)=>Dt(s,o)-Dt(l,o)||Number(Z(l).some(d=>a.has(d)))-Number(Z(s).some(d=>a.has(d)))):i}function jl(e){if(e.parent?.localName==="trPr"){if(e.node.localName==="ins")return "rowInsert";if(e.node.localName==="del")return "rowDelete"}if(e.parent?.localName==="tcPr"){if(e.node.localName==="cellIns")return "cellInsert";if(e.node.localName==="cellDel")return "cellDelete";if(e.node.localName==="cellMerge")return "cellMerge"}if(e.parent?.localName==="numPr"&&e.node.localName==="ins")return "numberingInsert"}function Hl(e,t,n,r){if(!e.some(m=>m.revisionKind==="paragraphMark"))return e;let o=new Map,i=(m,h)=>{if(!(m.kind==="textValue"||h>64))for(let g=0;g<m.children.length;g+=1){let x=m.children[g],k=m.children[g+1];x.kind==="paragraph"&&k?.kind==="paragraph"&&o.set(x.id,k.id),i(x,h+1);}};i(t.root,0);let a=e.map((m,h)=>h),s=m=>{for(;a[m]!==m;)a[m]=a[a[m]],m=a[m];return m},l=new Map,d=new Map,c=(m,h,g)=>JSON.stringify([m.revisionKind==="paragraphMark"?m.markDirection:m.revisionKind,m.author,m.nesting,h,g]),u=(m,h,g)=>{let x=m.get(h);x?x.push(g):m.set(h,[g]);};e.forEach((m,h)=>{if(!(m.readOnly||!["insert","delete","paragraphMark"].includes(m.revisionKind)))for(let g of m.ranges)u(l,c(m,g.start.paragraphId,g.start.offset),h),u(d,c(m,g.end.paragraphId,g.end.offset),h);});let p=(m,h)=>{for(let g of h){let x=e[m].date,k=e[g].date;x!==void 0&&k!==void 0&&!chunk6KA3L3FR_cjs.ng(x,k)||(a[s(g)]=s(m));}};e.forEach((m,h)=>{if(!(m.readOnly||m.revisionKind!=="paragraphMark"||!["insert","delete"].includes(m.markDirection??"")))for(let g of m.ranges){p(h,d.get(c(m,g.start.paragraphId,g.start.offset))??[]);let x=o.get(g.end.paragraphId);x&&p(h,l.get(c(m,x,0))??[]);}});let R=new Map;return e.forEach((m,h)=>{let g=s(h),x=R.get(g);x?x.push(m):R.set(g,[m]);}),[...R.values()].map(m=>{if(m.length===1)return m[0];let h=m.flatMap(v=>v.ranges).sort((v,O)=>n.get(v.start.paragraphId)-n.get(O.start.paragraphId)||v.start.offset-O.start.offset),g=m.flatMap(v=>Z(v)).flatMap(v=>{let O=r.get(v);return O?[O]:[]}).sort((v,O)=>n.get(v.range.start.paragraphId)-n.get(O.range.start.paragraphId)||v.range.start.offset-O.range.start.offset),x=m[0],k=m.find(v=>v.revisionKind!=="paragraphMark"),f=[...new Map(m.flatMap(v=>v.addresses).map(v=>[JSON.stringify(v),v])).values()];return Ie({...x,id:m.map(v=>v.id).join("+"),revisionKind:k?.revisionKind??"paragraphMark",...k?{markDirection:void 0}:{},addresses:f,ranges:h,text:k?g.map(v=>v.text).join(""):""},m.flatMap(v=>Z(v)))})}function Fo(e){if(!e.propertyChange||!e.parent)return [];let t=(o,i)=>{let a=o?.children.find(s=>s.kind!=="textValue"&&s.namespaceUri===chunk6KA3L3FR_cjs.da&&s.localName==="lang");return a&&a.kind!=="textValue"?a.attributes.find(s=>s.namespaceUri===chunk6KA3L3FR_cjs.da&&s.localName===i)?.value:void 0},n=e.node.children.find(o=>o.kind!=="textValue"&&o.localName===e.parent.localName),r=[];for(let o of ["val","eastAsia","bidi"]){let i=t(e.parent,o),a=t(n?.kind!=="textValue"?n:void 0,o);i&&i!==a&&!r.includes(i)&&r.push(i);}return r}var Im=[{property:"bold",element:"b",attribute:"val",kind:"toggle"},{property:"italic",element:"i",attribute:"val",kind:"toggle"},{property:"underline",element:"u",attribute:"val"},{property:"strike",element:"strike",attribute:"val",kind:"toggle"},{property:"fontFamily",element:"rFonts",attribute:"ascii"},{property:"fontSize",element:"sz",attribute:"val",kind:"halfPoints"},{property:"color",element:"color",attribute:"val"},{property:"alignment",element:"jc",attribute:"val"},{property:"leftIndent",element:"ind",attribute:"left",kind:"twips"},{property:"rightIndent",element:"ind",attribute:"right",kind:"twips"},{property:"firstLineIndent",element:"ind",attribute:"firstLine",kind:"twips"},{property:"hangingIndent",element:"ind",attribute:"hanging",kind:"twips"},{property:"spaceBefore",element:"spacing",attribute:"before",kind:"twips"},{property:"spaceAfter",element:"spacing",attribute:"after",kind:"twips"}];function Lo(e){if(!e.propertyChange||!e.parent)return [];let t=e.node.children.find(r=>r.kind!=="textValue"&&r.namespaceUri===chunk6KA3L3FR_cjs.da&&r.localName===e.parent.localName),n=[];for(let r of Im){let o=a=>{let s=a?.children.find(d=>d.kind!=="textValue"&&d.namespaceUri===chunk6KA3L3FR_cjs.da&&d.localName===r.element);if(!s||s.kind==="textValue")return null;let l=s.attributes.find(d=>d.namespaceUri===chunk6KA3L3FR_cjs.da&&d.localName===r.attribute)?.value;if(r.kind==="toggle")return l==="0"||l==="false"||l==="off"?"false":"true";if(l===void 0)return null;if(r.kind==="halfPoints"||r.kind==="twips"){let d=Number(l);return Number.isFinite(d)?String(d/(r.kind==="halfPoints"?2:20)):l}return l},i=o(e.parent);i!==o(t?.kind!=="textValue"?t:void 0)&&n.push({property:r.property,value:i});}return n}function Zn(e){return Kl(e,true)}function my(e){return Kl(e,false)}function Kl(e,t){let n=t?Wl.get(e.root):void 0;if(n)return n;let r=new Map,o=s=>{let l=t?Vl.get(s):void 0;if(l){for(let[c,u]of l)r.set(c,u);return}let d=new Map;Sm(s,d,t),t&&Vl.set(s,d);for(let[c,u]of d)r.set(c,u);},i=(s,l)=>{if(!(s.kind==="textValue"||l>64)){if(s.kind==="paragraph"){o(s);return}for(let d of s.children)i(d,l+1);}};i(e.root,0);let a=(s,l)=>{if(!(s.kind==="textValue"||l>64)){if(s.kind==="paragraph"){let d=t?zl.get(s):void 0;if(!d){let c=[];Gl(s,0,c,t),d=c,t&&zl.set(s,d);}for(let[c,u]of d)r.set(c,u);return}if(s.kind==="table"||s.kind==="tableRow"||s.kind==="tableCell"){let d=t?Qn.get(s):void 0;d||(d=Xl(s),t&&Qn.set(s,d));for(let[c,u]of d)r.set(c,u);}for(let d of s.children)a(d,l+1);}};return a(e.root,0),t&&Wl.set(e.root,r),r}function Gl(e,t,n,r){if(!(e.kind==="textValue"||t>64)){if(e.kind==="table"||e.kind==="tableRow"||e.kind==="tableCell"){let o=r?Qn.get(e):void 0;o||(o=Xl(e),r&&Qn.set(e,o));for(let i of o)n.push(i);}for(let o of e.children)Gl(o,t+1,n,r);}}function Xl(e){let t=null,n=(i,a)=>{if(!(t||i.kind==="textValue"||a>64)){if(i.kind==="paragraph"){t=i;return}for(let s of i.children)n(s,a+1);}};if(n(e,0),!t)return bm;let r={paragraphId:t.id,start:0,end:0},o=[];if(e.kind==="textValue")return o;for(let i of e.children)if(!(i.kind==="textValue"||!["tblPr","tblGrid","tblPrEx","trPr","tcPr"].includes(i.localName)))for(let a of i.children){if(a.kind==="textValue")continue;(a.localName===`${i.localName}Change`||i.localName==="trPr"&&["ins","del"].includes(a.localName)||i.localName==="tcPr"&&["cellIns","cellDel","cellMerge"].includes(a.localName))&&o.push([a.id,r]);}return o}var bm=[],Vl=new WeakMap,Wl=chunk6KA3L3FR_cjs.Yg(8),Qn=new WeakMap,zl=new WeakMap;function Sm(e,t,n){let r=n?chunk6KA3L3FR_cjs.cf(e):chunk6KA3L3FR_cjs.ef(e),o=(s,l,d,c)=>{if(!(s.kind==="textValue"||c>64)){t.set(s.id,{paragraphId:e.id,start:l,end:d});for(let u of s.children)o(u,l,d,c+1);}},i=(s,l)=>{if(s.kind==="textValue"||l>64)return;let d=r.spanOf(s);if(s.kind==="fldSimple"&&d){o(s,d.start,d.end,l);return}if(s.kind==="run"){if(!d)return;t.set(s.id,{paragraphId:e.id,start:d.start,end:d.end});for(let c of s.children)c.kind==="runProperties"&&o(c,d.start,d.end,l+1);return}d&&t.set(s.id,{paragraphId:e.id,start:d.start,end:d.end});for(let c of s.children)i(c,l+1);};for(let s of e.children)s.kind!=="paragraphProperties"&&i(s,0);let a=e.children.find(s=>s.kind==="paragraphProperties");a&&o(a,r.length,r.length,0);}var Nm={ins:"insert",del:"delete",moveFrom:"moveFrom",moveTo:"moveTo"};function er(e,t){for(let n of e.attributes)if(n.localName===t&&n.namespaceUri===chunk6KA3L3FR_cjs.da)return n.value}function $o(e){return `${e.id}\0${e.author}\0${e.date??""}`}var Em={revisionInsert:"insert",revisionDelete:"delete",revisionMoveFrom:"moveFrom",revisionMoveTo:"moveTo",moveFromRangeStart:"moveFrom",moveToRangeStart:"moveTo"},ql={retainRevisionItems:true,revisionSites:chunk6KA3L3FR_cjs.vi,locations:Zn,commentAnchors:chunk6KA3L3FR_cjs._g,deepOrder:chunk6KA3L3FR_cjs.Ji};function tr(e){return Ql(e,ql)}function Ql(e,t){let n=e.root.kind!=="paragraph";if(n&&t.retainRevisionItems){let o=Yl.get(e.root);if(o&&o.name===e.name)return o.items}let r=Tm(e,t);return n&&t.retainRevisionItems&&Yl.set(e.root,{name:e.name,items:r}),r}var Yl=chunk6KA3L3FR_cjs.Yg(8);function Tm(e,t){let n=t.revisionSites(e);if(n.length===0)return [];let r=t.locations(e),o=new Map(chunk6KA3L3FR_cjs.ji(e.root).map(m=>[m.start.id,m])),i=chunk6KA3L3FR_cjs.li(e.root),a=n.some(m=>m.paragraphMark),s=new Map,l=new Map,d=chunk6KA3L3FR_cjs.hi(e,n);for(let m of n){if(d.has(m.node.id))continue;let h=o.get(m.node.id),g=h?h.content.map(ut).join(""):ut(m.node),x=er(m.node,"id"),k=x??`missing-${m.node.id}`,f=er(m.node,"author")??"",v=er(m.node,"author")===void 0&&m.node.localName!=="tblGridChange",O=er(m.node,"date"),P=O===void 0?{id:k,author:f}:{id:k,author:f,date:O},y=i.has(m.node.id)?"insert":m.propertyChange?"format":m.paragraphMark?"paragraphMark":Em[m.node.kind]??"structural",T=m.paragraphMark?Nm[m.node.localName]:void 0,N=y==="structural"?jl(m):void 0,j=r.get(m.node.id),z=h?.end&&r.get(h.end.id),ee=j&&z&&j.paragraphId===z.paragraphId?{...j,end:z.end}:j,X=ee?{partName:e.name,start:{paragraphId:ee.paragraphId,offset:ee.start},end:{paragraphId:ee.paragraphId,offset:ee.end}}:null;a&&X&&(y==="paragraphMark"||y==="insert"||y==="delete")&&s.set(m.node.id,{range:X,text:y==="paragraphMark"?`
4
+ `:g});let _=y==="structural"?`structural\0${$o(P)}`:`${y}\0${m.node.localName}\0${$o(P)}`,B=l.get(_);if(B){B.siteNodeIds.push(m.node.id),N&&!B.structuralChanges?.includes(N)&&(B.structuralChanges??=[]).push(N),m.propertyChange&&(B.formattingLanguages=[...new Set([...B.formattingLanguages??[],...Fo(m)])],B.formattingChanges=[...new Map([...B.formattingChanges??[],...Lo(m)].map(ie=>[JSON.stringify(ie),ie])).values()]),X&&!B.ranges.some(ie=>ie.partName===X.partName&&ie.start.paragraphId===X.start.paragraphId&&ie.start.offset===X.start.offset&&ie.end.paragraphId===X.end.paragraphId&&ie.end.offset===X.end.offset)&&B.ranges.push(X),y!=="structural"&&B.revisionKind==="structural"&&(B.revisionKind=y),(y==="insert"&&B.revisionKind==="delete"||y==="delete"&&B.revisionKind==="insert"||B.revisionKind==="replace")&&(B.revisionKind="replace"),B.readOnly||=m.refused||v,m.nesting>B.nesting&&(B.nesting=m.nesting),y==="delete"||y==="moveFrom"?B.deletedText+=g:y!=="format"&&y!=="paragraphMark"&&(B.text+=g);continue}l.set(_,{address:P,localName:m.node.localName,...N?{structuralChanges:[N]}:{},...m.propertyChange?{formattingLanguages:Fo(m),formattingChanges:Lo(m)}:{},revisionKind:y,...T?{markDirection:T}:{},author:f,...O===void 0?{}:{date:O},text:y==="format"||y==="paragraphMark"||y==="delete"||y==="moveFrom"?"":g,deletedText:y==="delete"||y==="moveFrom"?g:"",ranges:X?[X]:[],siteNodeIds:[m.node.id],nesting:m.nesting,readOnly:m.refused||v||x===void 0});}let c=[...l.values()].map(m=>Ie({kind:"revision",id:`${m.revisionKind}${m.revisionKind==="format"||m.revisionKind==="paragraphMark"?`-${m.localName}`:""}-${e.name}\0${$o(m.address)}`,address:m.address,addresses:[m.address],revisionKind:m.revisionKind,...m.revisionKind==="format"?{formattingKind:m.localName}:{},...m.structuralChanges?.length?{structuralChanges:m.structuralChanges}:{},...m.formattingChanges?.length?{formattingChanges:m.formattingChanges}:{},...m.formattingLanguages?.length?{formattingLanguages:m.formattingLanguages}:{},...m.markDirection?{markDirection:m.markDirection}:{},author:m.author,...m.date===void 0?{}:{date:m.date},text:m.revisionKind==="replace"?m.text:m.text||m.deletedText,replacedText:m.revisionKind==="replace"?m.deletedText:"",ranges:m.ranges,nesting:m.nesting,readOnly:m.readOnly,replyIds:[]},m.siteNodeIds)),u=t.deepOrder(e),p=Bl(e,c,n,r,u),R=Zl(p,u);return Cm(Hl(R,e,u,s),u)}function Cm(e,t){let n=Zl(e,t),r=n.filter(l=>(l.revisionKind==="insert"||l.revisionKind==="delete")&&!l.readOnly&&l.ranges.length>0),o=new Set,i=new Map,a=new Map;for(let l of r){if(l.revisionKind!=="insert")continue;let d=l.ranges[0].start,c=`${d.paragraphId}\0${d.offset}`,u=a.get(c);u?u.push(l):a.set(c,[l]);}for(let l of r){if(l.revisionKind!=="delete"||o.has(l.id))continue;let d=l.ranges[l.ranges.length-1].end,c=a.get(`${d.paragraphId}\0${d.offset}`)??[],u=c.length>1?[...c].sort((p,R)=>(p.text.length>0?0:1)-(R.text.length>0?0:1)):c;for(let p of u){if(o.has(p.id)||p.author!==l.author)continue;o.add(l.id),o.add(p.id);let R=Lm(l.ranges[0],p.ranges[0],t)?l:p,m=Fm(l.date,p.date);i.set(l.id,Ie({...R,id:`replace-${l.id}-${p.id}`,revisionKind:"replace",...m===void 0?{}:{date:m},addresses:_m([...l.addresses,...p.addresses]),text:p.text,replacedText:l.text,ranges:[...l.ranges,...p.ranges],replacedRangeCount:l.ranges.length,readOnly:l.readOnly||p.readOnly},[...Z(l),...Z(p)]));break}}let s=[];for(let l of n){let d=i.get(l.id);if(d){s.push(d);continue}o.has(l.id)||s.push(l);}return s}function Zl(e,t){let n=e.filter(d=>(d.revisionKind==="insert"||d.revisionKind==="delete")&&!d.readOnly&&d.ranges.length>0);if(n.length<2)return e;let r=d=>`${d.paragraphId}\0${d.offset}`,o=new Map;for(let d of n){let c=`${d.revisionKind}\0${d.author}`,u=o.get(c);u?u.push(d):o.set(c,[d]);}let i=(d,c)=>{let u=d.ranges[0].start,p=c.ranges[0].start,R=(t.get(u.paragraphId)??0)-(t.get(p.paragraphId)??0);return R!==0?R:u.offset-p.offset};for(let d of o.values()){let c=true;for(let u=1;u<d.length&&c;u+=1)c=i(d[u-1],d[u])<=0;c||d.sort(i);}let a=new Set,s=new Map;for(let d of o.values()){let c=[],u="",p=()=>{if(c.length>1){s.set(c[0].id,Dm(c));for(let R=1;R<c.length;R+=1)a.add(c[R].id);}c=[];};for(let R of d){let m=r(R.ranges[0].start);c.length>0&&m!==u&&p();let h=c.length===0;c.push(R),(h||Mm(R))&&(u=r(R.ranges[R.ranges.length-1].end));}p();}if(s.size===0)return e;let l=[];for(let d of e)a.has(d.id)||l.push(s.get(d.id)??d);return l}function Mm(e){return e.ranges.some(t=>t.start.paragraphId!==t.end.paragraphId||t.start.offset!==t.end.offset)}function Dm(e){let t=e[0],n=[...t.addresses],r=[...t.ranges],o=[...Z(t)],i=t.text,a=t.date;for(let s of e.slice(1)){for(let l of s.addresses)n.some(d=>ed(d,l))||n.push(l);for(let l of s.ranges)r.push(l);for(let l of Z(s))o.push(l);i+=s.text,a=Am(a,s.date);}return Ie({...t,id:e.map(s=>s.id).join("+"),addresses:n,ranges:r,text:i,...a===void 0?{}:{date:a}},o)}function Am(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?e:r>n?t:e}function _m(e){let t=[];for(let n of e)t.some(r=>ed(r,n))||t.push(n);return t}function ed(e,t){return e.id===t.id&&e.author===t.author&&(e.date??"")===(t.date??"")}function Fm(e,t){if(t===void 0)return e;if(e===void 0)return t;let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?t:n>r?e:t}function Lm(e,t,n){let r=n.get(e.start.paragraphId)??0,o=n.get(t.start.paragraphId)??0;return r!==o?r<o:e.start.offset<=t.start.offset}function td(e,t,n){let r=new Map(t.map(c=>[c.commentId,c])),o=new Map,i=new Map;for(let c of e)c.paraId&&o.set(c.paraId.toUpperCase(),c),i.set(c.id,c);let a=new Map,s=new Map;for(let c of e){let u=r.get(c.id);if(!u||u.orphaned||u.start.paragraphId===u.end.paragraphId&&u.start.offset===u.end.offset)continue;let p=`${u.start.paragraphId}:${u.start.offset}|${u.end.paragraphId}:${u.end.offset}`;a.has(p)?s.set(c.id,a.get(p)):a.set(p,c.id);}let l=new Map;for(let c of e){let u=c.paraId?n.get(c.paraId.toUpperCase()):void 0,p=u?.parentParaId?o.get(u.parentParaId):void 0,R=c.parentCommentId?i.get(c.parentCommentId):void 0,m=u===void 0?s.get(c.id):void 0,h=m?i.get(m):void 0,g=p??R??h;g&&g.id!==c.id&&l.set(c.id,g.id);}for(let c of [...l.keys()]){let u=new Set([c]),p=l.get(c);for(;p!==void 0;){if(u.has(p)){l.delete(c);break}u.add(p),p=l.get(p);}}let d=new Map;for(let[c,u]of l){let p=d.get(u);p?p.push(c):d.set(u,[c]);}return e.map(c=>{let u=r.get(c.id),p=c.paraId?n.get(c.paraId.toUpperCase()):void 0,R=l.get(c.id);return {kind:"comment",id:c.id,comment:c,range:u?{partName:u.partName,start:u.start,end:u.end}:null,resolved:p?.done??false,...R===void 0?{}:{parentId:R},replyIds:d.get(c.id)??[],orphaned:u===void 0||u.orphaned}})}function $m(e){return Um(e,ql)}function Um(e,t){let n=[e.storyPart],r=new Set([e.storyPart.name]);for(let c of [...e.furnitureParts??[],...e.stylesPart?[e.stylesPart]:[]])r.has(c.name)||(r.add(c.name),n.push(c));let o=e.commentsPart?chunk6KA3L3FR_cjs.ah(e.commentsPart):[],i=e.commentsExtendedPart?chunk6KA3L3FR_cjs.bh(e.commentsExtendedPart):new Map,a=[],s=[],l=n.length===1?t.deepOrder(n[0]):new Map;for(let c of n){for(let R of Ql(c,t))a.push(R);for(let R of t.commentAnchors(c))s.push(R);if(n.length===1)continue;let u=l,p=u.size;for(let[R,m]of t.deepOrder(c))u.has(R)||u.set(R,p+m);}return nd([...a,...td(o,s,i)]).sort((c,u)=>Dt(c,l)-Dt(u,l))}function Bm(e,t){if(e.kind!=="comment")return e;let n=e.replyIds??[],r=n.filter(i=>t.has(i)),o=e.parentId!==void 0&&!t.has(e.parentId);if(!o&&r.length===n.length)return e;if(o){let{parentId:i,parentRevisionId:a,...s}=e;return r.length===n.length?s:{...s,replyIds:r}}return {...e,replyIds:r}}function Jl(e){return `${e.partName}\0${e.start.paragraphId}:${e.start.offset}|${e.end.paragraphId}:${e.end.offset}`}function nd(e){let t=new Set;for(let l of e)l.kind==="comment"&&t.add(l.id);let n=e.map(l=>Bm(l,t)),r=new Map;for(let l of n)if(l.kind==="revision")for(let d of l.ranges??[]){if(d.start.paragraphId===d.end.paragraphId&&d.start.offset===d.end.offset)continue;let c=Jl(d),u=l.nesting??0,p=r.get(c);(p===void 0||u>p.nesting)&&r.set(c,{id:l.id,nesting:u});}let o=new Map;for(let l of n)l.kind==="comment"&&l.replyIds&&l.replyIds.length>0&&o.set(l.id,l.replyIds);let i=l=>{let d=[],c=new Set([l]),u=[...o.get(l)??[]];for(;u.length>0;){let p=u.shift();c.has(p)||(c.add(p),d.push(p),u.push(...o.get(p)??[]));}return d},a=new Map,s=new Map;for(let l of n){if(l.kind!=="comment"||l.parentId!==void 0||l.orphaned||!l.range)continue;let d=r.get(Jl(l.range))?.id;if(d===void 0)continue;let c=[l.id,...i(l.id)];for(let p of c)s.set(p,d);let u=a.get(d);u?u.push(...c):a.set(d,c);}return n.map(l=>{if(l.kind==="revision"){let d=a.get(l.id)??[];return d.length===0&&(l.replyIds??[]).length===0?l:Ie({...l,replyIds:d},Z(l))}if(l.kind==="comment"){let d=s.get(l.id);if(d===void 0){if(l.parentRevisionId===void 0)return l;let{parentRevisionId:c,...u}=l;return u}return l.parentRevisionId===d?l:{...l,parentRevisionId:d}}return l})}var jm=256,Hm=2e3,rd=/[\p{L}\p{N}_]/u;function Uo(e){let t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(let r=0;r<e.length;r+=1){let o=e[r],i=o.toLowerCase();n+=i.length===1?i:o;}return n}function od(e,t,n){let r=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return !(r!==void 0&&rd.test(r)||o!==void 0&&rd.test(o))}function ad(e){return typeof e=="string"&&e.length>0&&e.length<=256}function Vm(e,t,n,r={}){let o={matches:[],truncated:false};if(!ad(t)||e.length===0||n<=0)return o;let i=r.matchCase===true,a=r.wholeWord===true,s=i?t:Uo(t),l=i?e:Uo(e),d=Math.max(0,r.from??0),c=Math.min(e.length,r.to??e.length),u=[],p=l.indexOf(s,d);for(;p>=0;){let R=p+s.length;if(R>c)return {matches:u,truncated:false};if(!a||od(e,p,R)){if(u.length>=n)return {matches:u,truncated:true};u.push({start:p,length:s.length});}p=l.indexOf(s,R);}return {matches:u,truncated:false}}var Wm=new Set(["plainText","richText","date","dropDownList","comboBox","docPartList"]),zm=96;function Bo(e,t){return e.kind!=="textValue"&&e.namespaceUri===chunk6KA3L3FR_cjs.da&&e.localName===t}function Km(e){return e.kind==="textValue"&&e.value.trim()===""}function Gm(e){let t=[],n=(r,o,i)=>{if(r.kind==="textValue"||i>zm)return;if(chunk6KA3L3FR_cjs.Pe(r)){let s=chunk6KA3L3FR_cjs.Re(r),l=chunk6KA3L3FR_cjs.wb(r);if(s&&l&&s.children.every(Km)&&Wm.has(l.type)){t.push({control:r,content:s,kind:l.type,docPart:l.placeholderDocPart,inline:o});return}}let a=o||r.kind==="paragraph"||Bo(r,"p");for(let s of r.children)n(s,a,i+1);};return n(e,false,0),t}function Xm(e){return chunk6KA3L3FR_cjs.Vi(e,"rPr",{kind:"runProperties",children:[chunk6KA3L3FR_cjs.Vi(e,"rStyle",{attributes:[["val","PlaceholderText"]]})]})}function Ym(e){let t=e.find(r=>r.kind==="paragraph"||Bo(r,"p"));if(!t||t.kind==="textValue")return null;let n=t.children.filter(r=>r.kind!=="paragraphProperties"&&!Bo(r,"pPr"));return n.length>0?n:null}function jo(e,t){let n=Gm(t.root);if(n.length===0)return t;let r=null,o=d=>{if(d!==void 0)return r??=chunk6KA3L3FR_cjs.Cf(e),r.find(c=>c.name===d)},i=chunk6KA3L3FR_cjs.Fa(t,"paste"),a=new Set(chunk6KA3L3FR_cjs.bb(t.root)),s={value:0},l=t;for(let[d,c]of n.entries()){let u=o(c.docPart),p=null;if(u){let x=u.blocks.map((k,f)=>chunk6KA3L3FR_cjs.nj(chunk6KA3L3FR_cjs.Xe(k,i),a,`${c.control.id}:placeholder:${d}:${f}`,s));p=c.inline?Ym(x):x;}if(!p){let x=chunk6KA3L3FR_cjs.Wi(i,chunk6KA3L3FR_cjs.Qi(c.kind),Xm(i));p=c.inline?[x]:[chunk6KA3L3FR_cjs.Vi(i,"p",{kind:"paragraph",children:[x]})];}let R=chunk6KA3L3FR_cjs.Xi(chunk6KA3L3FR_cjs.Qe(c.control),{showingPlaceholder:true},i),m={...c.content,children:p},h=c.control.children.map(x=>x.id===c.content.id?m:x.kind!=="textValue"&&x.localName==="sdtPr"?R:x),g=chunk6KA3L3FR_cjs.Ka(l,c.control.id,h);g.ok&&(l=g.part);}return l}function id(e,t,n){let r=t.filter(a=>a.node.localName==="tblGridChange"&&n.has(a.node.id));if(!r.length)return new Set;let o=new Map;for(let a of t){if(!["trPrChange","tcPrChange","tblPrExChange"].includes(a.node.localName))continue;let s=a.parent;for(;s&&s.kind!=="table";)s=chunk6KA3L3FR_cjs.Ia(e,s.id);if(!s)continue;let l=o.get(s.id)??[];l.push(a.node.id),o.set(s.id,l);}let i=new Set;for(let a of r){let s=a.parent&&chunk6KA3L3FR_cjs.Ia(e,a.parent.id),l=s&&o.get(s.id);l?.some(d=>n.has(d))&&l.some(d=>!n.has(d))&&i.add(a.node.id);}return i}function Jm(e,t,n,r){let o=r??e.root,i=o.kind==="textValue"?e:{...e,root:o},a=tr(i),s=n===void 0?[...chunk6KA3L3FR_cjs.hi(i,chunk6KA3L3FR_cjs.vi(i))]:[],l=s.length?[{op:"acceptAllRevisions",siteNodeIds:s,...r?{scopeRootId:r.id}:{}}]:[];if(n?.length===0||a.length===0)return {ops:l,result:{resolved:[],skipped:[...new Set(n??[])].map(w=>({key:w,reason:"unknown-revision"})),remaining:a.length}};let d=new Set(n??a.map(an)),c=new Map(a.map(w=>[an(w),w])),u=new Set;for(let w of d){let I=c.get(w);if(I)for(let D of Z(I))u.add(D);}let p=chunk6KA3L3FR_cjs.vi(i),R=chunk6KA3L3FR_cjs.ki(o,p,u,t);for(let w of R.selected)u.add(w);for(let w of a){let I=Z(w);I.length&&I.every(D=>u.has(D))&&d.add(an(w));}let m=chunk6KA3L3FR_cjs.yi(o,p),h=new Map(p.map((w,I)=>[w.node.id,I])),g=p.map((w,I)=>I),x=w=>{for(;g[w]!==w;)g[w]=g[g[w]],w=g[w];return w},k=(w,I)=>{g[x(I)]=x(w);};for(let w of R.dependencies){let I=w.flatMap(D=>h.has(D)?[h.get(D)]:[]);for(let D of I)k(I[0],D);}let f=new Map;for(let w of a){let I=Z(w).flatMap(D=>{let K=h.get(D);return K===void 0?[]:[K]});for(let D of I)k(I[0],D);}let v=p.filter(w=>u.has(w.node.id)),O=new Set(chunk6KA3L3FR_cjs.pi(e,v,t).keys()),P=new Map;for(let[w,I]of p.entries()){if(t==="reject"&&I.propertyChange&&I.parent&&u.has(I.node.id))for(let K of I.parent.children)chunk6KA3L3FR_cjs.mi(I.node.localName,K)||f.set(K.id,w);let D=t==="accept"?I.node.localName==="del"||I.node.localName==="moveFrom":I.node.localName==="ins"||I.node.localName==="moveTo";if(I.paragraphMark&&I.parent&&D&&!m.has(I.node.id)&&u.has(I.node.id)){let K=chunk6KA3L3FR_cjs.Ia(e,I.parent.id),te=K&&chunk6KA3L3FR_cjs.Ia(e,K.id),se=te&&chunk6KA3L3FR_cjs.Ia(e,te.id);if(K&&te&&se){let G=P.get(se.id);G||(G=chunk6KA3L3FR_cjs.ti(se.children,O),P.set(se.id,G)),G.has(te.id)&&f.set(K.id,w);}}if(u.has(I.node.id)&&chunk6KA3L3FR_cjs.qi(e,I,t)){let K=chunk6KA3L3FR_cjs.qi(e,I,t);K&&!I.refused&&f.set(K.id,w);}}for(let[w,I]of chunk6KA3L3FR_cjs.ri(e,v,t)){let D=chunk6KA3L3FR_cjs.Ha(e,w),K=h.get(I[0]);if(!(D?.kind!=="tableCell"||K===void 0))for(let te of D.children)te.localName==="tcPr"&&f.set(te.id,K);}let y=(w,I)=>{let D=h.get(w.id),K=f.get(w.id);D!==void 0&&K!==void 0&&k(K,D);let te=D??K;te!==void 0&&I!==void 0&&k(I,te);let se=te??I;if(w.kind!=="textValue")for(let G of w.children)y(G,se);};y(o);for(let w of chunk6KA3L3FR_cjs.xi(o).values()){let I=w.wrappers.flatMap(D=>{let K=h.get(D.id);return K===void 0?[]:[K]});for(let D of I)k(I[0],D);}for(let w of p.some(I=>I.node.localName==="cellMerge")?chunk6KA3L3FR_cjs.si(i):[]){let I=w.flatMap(D=>{let K=h.get(D);return K===void 0?[]:[K]});for(let D of I)k(I[0],D);}let T=new Map;for(let[w,I]of p.entries()){let D=x(w),K=T.get(D)??[];K.push(I),T.set(D,K);}let N=new Map;for(let[w,I]of T)I.some(D=>D.refused||t==="reject"&&D.propertyChange&&chunk6KA3L3FR_cjs.oi(D.node)===null)?N.set(w,"unsupported-revision"):I.some(D=>!u.has(D.node.id))&&N.set(w,"incomplete-group");for(let w of a)if(w.readOnly)for(let I of Z(w)){let D=h.get(I);D!==void 0&&N.set(x(D),"unsupported-revision");}let j=p.filter((w,I)=>u.has(w.node.id)&&!N.has(x(I))),z=false,ee=chunk6KA3L3FR_cjs.pi(e,j,t);for(let[w,I]of ee){if(f.has(w))continue;let D=h.get(I[0]);D!==void 0&&(f.set(w,D),z=true);}if(z){y(o);for(let[w,I]of [...N]){let D=x(w);N.get(D)!=="unsupported-revision"&&N.set(D,I);}}let X=[],_=[],B=new Set,ie=new Set(chunk6KA3L3FR_cjs.gi(e,p,t));for(let w of ie){let I=chunk6KA3L3FR_cjs.Ia(e,w);for(;I;){if(ee.has(I.id)){ie.delete(w);break}I=chunk6KA3L3FR_cjs.Ia(e,I.id);}}for(let w of d){let I=c.get(w);if(!I){_.push({key:w,reason:"unknown-revision"});continue}let D={key:w,author:I.author,partName:e.name,revisionKind:I.revisionKind},K=Z(I),te;for(let se of K){let G=h.get(se);if(te=G===void 0?"incomplete-group":N.get(x(G)),te)break}if(K.length||(te="unsupported-revision"),te)_.push({key:w,reason:te,revision:D});else {K.some(se=>ie.has(se))?_.push({key:w,reason:"retained-structure",revision:D}):X.push(D);for(let se of K)ie.has(se)||B.add(se);}}let be=id(e,p,B),$=new Set;for(let w of a){let I=Z(w);if(w.formattingKind!=="tblGridChange"&&I.length>1)for(let D of I)be.has(D)&&$.add(D);}let U=[...B].filter(w=>!R.implicit.has(w)&&!$.has(w)),Y=a.length-X.length;if(Y>0&&U.length){let w={...e,root:{...e.root}},I=chunk6KA3L3FR_cjs.zi(w,t,void 0,{siteNodeIds:U,...r?{scopeRootId:r.id}:{}});if(I.ok&&I.part){let D=r?chunk6KA3L3FR_cjs.Ha(I.part,r.id):I.part.root;Y=D&&D.kind!=="textValue"?tr({...I.part,root:D}).length:0;}}return {ops:B.size?[...l,{op:t==="accept"?"acceptAllRevisions":"rejectAllRevisions",siteNodeIds:U,...r?{scopeRootId:r.id}:{}}]:l,result:{resolved:X,skipped:_,remaining:Y}}}function Ho(e){return e.kind!=="textValue"}function nr(e,t){for(let n of e.children)if(Ho(n)&&n.localName===t)return n;return null}function qm(e,t){let n=[e];for(;n.length>0;){let r=n.pop();if(Ho(r)){if(r.localName===t)return r;for(let o=r.children.length-1;o>=0;o-=1)n.push(r.children[o]);}}return null}var cd=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function _t(e,t,n){let r=nr(e,t),i=(r?nr(r,n):null)?.attributes.find(a=>a.localName==="typeface")?.value;return i!==void 0&&cd.test(i)?i:null}var sd=new WeakMap;function Qm(e){let t=e?sd.get(e):void 0;if(t)return t;let n=e?qm(e,"fontScheme"):null;if(!n)return md;let r=Object.freeze({major:_t(n,"majorFont","latin"),minor:_t(n,"minorFont","latin"),majorEastAsia:_t(n,"majorFont","ea"),minorEastAsia:_t(n,"minorFont","ea"),majorBidi:_t(n,"majorFont","cs"),minorBidi:_t(n,"minorFont","cs"),...nu(n)});return e&&sd.set(e,r),r}var ld=new WeakMap,md=Object.freeze({major:null,minor:null,majorEastAsia:null,minorEastAsia:null});function Vo(e,t=null){let n=e?Qm(e):md,r=t?nr(t,"themeFontLang"):null;if(!r||!t)return n;let o=ld.get(t);o||ld.set(t,o=new WeakMap);let i=o.get(n);if(i)return i;let a=R=>r.attributes.find(m=>m.localName===R)?.value,s=dd(a("val")),l=dd(a("bidi")),d=a("eastAsia"),c=rr(d),u=(R,m,h)=>m&&(R?n.majorSupplemental:n.minorSupplemental)?.[m]||h||null,p=Object.freeze({major:u(true,s,n.major),minor:u(false,s,n.minor),majorEastAsia:u(true,c,n.majorEastAsia),minorEastAsia:u(false,c,n.minorEastAsia),majorBidi:u(true,l,n.majorBidi),minorBidi:u(false,l,n.minorBidi),...d===void 0?{majorSupplemental:n.majorSupplemental,minorSupplemental:n.minorSupplemental}:{}});return o.set(n,p),p}var Zm=new Map([["minorAscii",e=>e.minor],["minorHAnsi",e=>e.minor],["majorAscii",e=>e.major],["majorHAnsi",e=>e.major],["minorEastAsia",e=>e.minorEastAsia??null],["majorEastAsia",e=>e.majorEastAsia??null],["minorBidi",e=>e.minorBidi??null],["majorBidi",e=>e.majorBidi??null]]);function uk(e,t,n){if(e===void 0)return null;let r=Zm.get(e)?.(t)??null;if(r!==null)return r;let o=rr(n);return o?(e==="majorEastAsia"?t.majorSupplemental:e==="minorEastAsia"?t.minorSupplemental:void 0)?.[o]??null:null}function rr(e){if(!e||e.length>85)return null;let t=e.toLowerCase().split("-");return t[0]==="ja"?"Jpan":t[0]==="ko"?"Hang":t[0]!=="zh"?null:t.includes("hant")?"Hant":t.includes("hans")?"Hans":t.some(n=>["tw","hk","mo"].includes(n))?"Hant":"Hans"}var eu=new Map([["ar","Arab"],["fa","Arab"],["ur","Arab"],["ps","Arab"],["he","Hebr"],["yi","Hebr"],["dv","Thaa"],["syr","Syrc"]]);function dd(e){if(!e||e.length>85)return null;let t=e.toLowerCase().split("-");return t[1]&&/^[a-z]{4}$/.test(t[1])?t[1][0].toUpperCase()+t[1].slice(1):rr(e)??eu.get(t[0])??null}var tu=new Map([["Hans","SimSun"],["Hant","PMingLiU"],["Jpan","MS Mincho"],["Hang","Batang"]]);function pk(e){return tu.get(rr(e)??"")??null}function nu(e){let t={};for(let[n,r]of [["majorFont","majorSupplemental"],["minorFont","minorSupplemental"]]){let o=Object.create(null);for(let i of nr(e,n)?.children??[]){if(!Ho(i)||i.localName!=="font")continue;let a=i.attributes.find(l=>l.localName==="script")?.value,s=i.attributes.find(l=>l.localName==="typeface")?.value;a&&/^[A-Z][a-z]{3}$/.test(a)&&s&&cd.test(s)&&(o[a]=s);}Object.keys(o).length&&(t[r]=Object.freeze(o));}return t}var pt=Object.freeze({styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",numbering:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",settings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",coreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",extendedProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"});function Wo(e,t,n,r){let o=(e.relationships.get(t)??[]).find(i=>i.type===n);if(o){let i=chunk6KA3L3FR_cjs.E(o);if(i.mode==="Internal"&&i.target.ok){let a=e.parts.get(i.target.partName);if(a)return a}}return e.parts.get(r)}function Ik(e){let t=chunk6KA3L3FR_cjs.Id(e);if(!t.ok)return {ok:false,reason:t.reason,...t.detail?{detail:t.detail}:{}};let n=t.package.parts.get(t.package.mainDocumentPart);if(!n)return {ok:false,reason:"no-main-document-tree",detail:t.package.mainDocumentPart};let r=new nn(t.package,jo(t.package,chunk6KA3L3FR_cjs.eb(n)));return {ok:true,view:ru(r)}}function ru(e){let t=()=>e.currentPackage(),n=()=>e.bodyStore().part,r=(d,c)=>Wo(t(),t().mainDocumentPart,d,c)?.root??null,o=Object.freeze(Vo(null)),i=null,a=chunk6KA3L3FR_cjs.lh,s=null;return Object.freeze({part:n,currentPackage:t,packageRevision:()=>e.packageRevision,stylesRoot:()=>r(pt.styles,"/word/styles.xml"),numberingRoot:()=>r(pt.numbering,"/word/numbering.xml"),settingsRoot:()=>r(pt.settings,"/word/settings.xml"),documentThemeFonts(){let d=t();return i!==d&&(o=Object.freeze(Vo(r(pt.theme,"/word/theme/theme1.xml"),r(pt.settings,"/word/settings.xml"))),i=d),o},documentProperties(){let d=t();if(s!==d){let c=Wo(d,"/",pt.coreProperties,"/docProps/core.xml"),u=Wo(d,"/",pt.extendedProperties,"/docProps/app.xml");a=chunk6KA3L3FR_cjs.mh(c?.root??null,u?.root??null),s=d;}return a},headerFooterPartsBySection:()=>chunk6KA3L3FR_cjs.de(t()),headerFooterResolutionBySection:()=>chunk6KA3L3FR_cjs.ce(t()),relationshipTarget:d=>chunk6KA3L3FR_cjs.Hf(t(),n().name,d)})}
5
+ exports.$=om;exports.A=Gt;exports.Aa=Um;exports.B=Ur;exports.Ba=nd;exports.C=bd;exports.Ca=jm;exports.D=Br;exports.Da=Hm;exports.E=jr;exports.Ea=Uo;exports.F=Hr;exports.Fa=od;exports.G=Vr;exports.Ga=ad;exports.H=Nd;exports.Ha=Vm;exports.I=Ci;exports.Ia=jo;exports.J=Xt;exports.Ja=Jm;exports.K=Xd;exports.Ka=Ik;exports.L=lo;exports.La=ru;exports.M=us;exports.N=co;exports.O=dt;exports.P=sl;exports.Q=nn;exports.R=dl;exports.S=cl;exports.T=Ro;exports.U=Xg;exports.V=vo;exports.W=Co;exports.X=Mo;exports.Y=tm;exports.Z=nm;exports._=rm;exports.a=Vo;exports.aa=am;exports.b=uk;exports.ba=im;exports.c=pk;exports.ca=bl;exports.d=pd;exports.da=Sl;exports.e=bi;exports.ea=Do;exports.f=Mn;exports.fa=Ao;exports.g=it;exports.ga=lm;exports.h=Dn;exports.ha=cm;exports.i=An;exports.ia=mm;exports.j=ye;exports.ja=um;exports.k=yd;exports.ka=pm;exports.l=st;exports.la=Z;exports.m=zt;exports.ma=an;exports.n=_n;exports.na=_o;exports.o=Kt;exports.oa=Ml;exports.p=Fn;exports.pa=Dt;exports.q=Ar;exports.qa=Rm;exports.r=_r;exports.ra=Lh;exports.s=Fr;exports.sa=$h;exports.t=Pd;exports.ta=Al;exports.u=vd;exports.ua=_l;exports.v=$r;exports.va=Zn;exports.w=wi;exports.wa=my;exports.x=Od;exports.xa=tr;exports.y=Lr;exports.ya=td;exports.z=Id;exports.za=$m;