@docx-editor.dev/core 2.6.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automation.cjs +1 -1
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +7 -7
- package/dist/binding.d.ts +7 -7
- package/dist/binding.js +1 -1
- package/dist/chunk-32HTRN7R.js +10 -0
- package/dist/chunk-42PRWWVE.js +2 -0
- package/dist/chunk-BRBRYJKE.cjs +2 -0
- package/dist/{chunk-SFMAIFEN.cjs → chunk-DTR64XCS.cjs} +2 -2
- package/dist/chunk-EMQSFPJO.cjs +15 -0
- package/dist/chunk-GBK7Z6F4.cjs +5 -0
- package/dist/{chunk-SMRD66T5.js → chunk-GPJXQDHC.js} +2 -2
- package/dist/chunk-JLSB6KNZ.js +5 -0
- package/dist/chunk-LEV2X47E.cjs +18 -0
- package/dist/chunk-NDTLLSG7.js +1 -0
- package/dist/chunk-O4VILLOM.cjs +1 -0
- package/dist/chunk-OB6JFVYA.js +15 -0
- package/dist/chunk-QTUZFJ4O.js +18 -0
- package/dist/chunk-UE7KTQLK.js +2 -0
- package/dist/chunk-WC3LI6FC.cjs +10 -0
- package/dist/chunk-XRDTD4X3.cjs +2 -0
- package/dist/contracts/editor.d.cts +6 -6
- package/dist/contracts/editor.d.ts +6 -6
- package/dist/contracts/interaction.d.cts +6 -6
- package/dist/contracts/interaction.d.ts +6 -6
- package/dist/contracts/modules.d.cts +3 -3
- package/dist/contracts/modules.d.ts +3 -3
- package/dist/contracts/types.d.cts +9 -1
- package/dist/contracts/types.d.ts +9 -1
- package/dist/{custom-node-writes-tJw8U9MO.d.ts → custom-node-writes-BpOBjNzo.d.ts} +3 -9
- package/dist/{custom-node-writes-D9G3GKQ7.d.cts → custom-node-writes-C_AlNvds.d.cts} +3 -9
- package/dist/{editor-D2zOJztO.d.ts → editor-C--WWCBA.d.ts} +14 -14
- package/dist/{editor-BZEJL3vv.d.cts → editor-CXaGlcUa.d.cts} +14 -14
- package/dist/editor.cjs +1 -1
- package/dist/editor.d.cts +19 -19
- package/dist/editor.d.ts +19 -19
- package/dist/editor.js +1 -1
- package/dist/{image-resources-Cl5_cNi9.d.ts → image-resources-BWd5u-op.d.ts} +1 -1
- package/dist/{image-resources-BaHz4QAd.d.cts → image-resources-Bkmu1Jei.d.cts} +1 -1
- package/dist/{index-D8L8WrNF.d.ts → index-DW0TsrYl.d.ts} +11 -11
- package/dist/{index-_xF7n_z0.d.cts → index-QsE1xXyT.d.cts} +11 -11
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +86 -17
- package/dist/layout.d.ts +86 -17
- package/dist/layout.js +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +5 -5
- package/dist/output.d.ts +5 -5
- package/dist/output.js +1 -1
- package/dist/{review-reads-HDvoQXK2.d.ts → review-reads-C5E7u-pt.d.ts} +1 -1
- package/dist/{review-reads-Dr0CpW6u.d.cts → review-reads-ChgUq41I.d.cts} +1 -1
- package/dist/{review-support-D4ZBdUXa.d.ts → review-support-Cr2n7f1-.d.ts} +1 -1
- package/dist/{review-support-T-riLz4Y.d.cts → review-support-oQrX6Xu3.d.cts} +1 -1
- package/dist/{semantic-cell-selection-B5vfPz4Q.d.ts → semantic-cell-selection-C8RC0VnN.d.ts} +2 -2
- package/dist/{semantic-cell-selection-BTQFpN0S.d.cts → semantic-cell-selection-CQOgvtbT.d.cts} +2 -2
- package/dist/{semantic-interaction-lvpzZRpA.d.ts → semantic-interaction-C45D_oG2.d.ts} +1 -1
- package/dist/{semantic-interaction-CDNEU_Tx.d.cts → semantic-interaction-f4GyBQ_1.d.cts} +1 -1
- package/dist/{semantic-paint-IjbL-4CT.d.cts → semantic-paint-BUt0ePEW.d.cts} +8 -2
- package/dist/{semantic-paint-BBPL3u5w.d.ts → semantic-paint-DUkGLJ_L.d.ts} +8 -2
- package/dist/{semantic-records-DEOs3_tE.d.cts → semantic-records-CuT3Wsd-.d.cts} +18 -11
- package/dist/{semantic-records-CdQvpUj1.d.ts → semantic-records-DoW_xNgJ.d.ts} +18 -11
- package/dist/{shaped-measurer-C2SJAjV0.d.cts → shaped-measurer-CDcHzjhf.d.cts} +1 -1
- package/dist/{shaped-measurer-l4o5ITJ0.d.ts → shaped-measurer-CakZ7g1s.d.ts} +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +43 -9
- package/dist/store.d.ts +43 -9
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-CUCwPWjT.d.cts → tree-op-types-QujrzgCz.d.cts} +8 -0
- package/dist/{tree-op-types-D0fTNBVW.d.ts → tree-op-types-fZgbrR5F.d.ts} +8 -0
- package/dist/{tree-session-CH1oA75f.d.ts → tree-session--6LDTNjR.d.ts} +5 -5
- package/dist/{tree-session-b7bggR-S.d.cts → tree-session-5UWKAQ41.d.cts} +5 -5
- package/dist/{tree-store-BqgeCa1Q.d.cts → tree-store-DhYIACNE.d.cts} +1 -1
- package/dist/{tree-store-CIKASRHk.d.ts → tree-store-Dy9FZ1pa.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-4GQXAXTZ.js +0 -5
- package/dist/chunk-DGUHCJPF.cjs +0 -18
- package/dist/chunk-DY3QVCWC.cjs +0 -10
- package/dist/chunk-E7BXJ4BF.js +0 -1
- package/dist/chunk-F7Z6PWAZ.cjs +0 -2
- package/dist/chunk-IJ4V3LGV.cjs +0 -2
- package/dist/chunk-JEMP5YI5.cjs +0 -15
- package/dist/chunk-JZXK4DKV.cjs +0 -1
- package/dist/chunk-NIGGABAA.js +0 -15
- package/dist/chunk-OPKOTVQQ.js +0 -18
- package/dist/chunk-R75OLPL6.js +0 -10
- package/dist/chunk-SKWYEZCO.cjs +0 -5
- package/dist/chunk-UVIUNAQ6.js +0 -2
- package/dist/chunk-WAVN7MAT.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var k="http://schemas.microsoft.com/office/word/2012/wordml";function A(e){return `${e.kind}-${e.id}`}function M(e){let a=[],t=n=>{if(n.kind==="textValue"){a.push(n.value);return}for(let o of n.children)t(o);};for(let n of e.blocks)t(n);return a.join("")}function C(e){if(e.initials&&e.initials.trim().length>0)return e.initials.trim();let a=e.author.trim().split(/\s+/).filter(Boolean);return a.length===0?"?":a.slice(0,2).map(t=>t[0].toUpperCase()).join("")}function m(e){return e.kind==="revision"?e.ranges:e.range?[e.range]:[]}function y(e){return m(e)[0]??null}function T(e,a){let t=y(e);if(!t)return Number.MAX_SAFE_INTEGER;let n=a.get(t.start.paragraphId);return n===void 0?Number.MAX_SAFE_INTEGER:n*1e6+Math.min(t.start.offset,999999)}function p(e,a){let t=a.get(e.start.paragraphId),n=a.get(e.end.paragraphId);return t===void 0||n===void 0?Number.MAX_SAFE_INTEGER:(n-t)*1e6+(e.end.offset-e.start.offset)}var c=0,f=1,R=2;function v(e,a,t){let n=t.get(a.paragraphId),o=t.get(e.start.paragraphId),r=t.get(e.end.paragraphId);return n===void 0||o===void 0||r===void 0||n<o||n>r||n===o&&a.offset<e.start.offset||n===r&&a.offset>e.end.offset?null:o===r&&e.start.offset===e.end.offset?c:n===r&&a.offset===e.end.offset?R:f}function I(e,a,t){let n=null;for(let o of m(e)){let r=v(o,a,t);if(r===null)continue;let i=p(o,t);(n===null||r<n.grip||r===n.grip&&i<n.width)&&(n={grip:r,width:i});}return n}var s={comment:0,custom:1,revision:2};function w(e,a,t){let n=[];for(let o of e){let r=I(o,a,t);r!==null&&n.push({item:o,grip:r.grip,width:r.width});}return n.sort((o,r)=>o.grip!==r.grip?o.grip-r.grip:o.width!==r.width?o.width-r.width:o.item.kind!==r.item.kind?s[o.item.kind]-s[r.item.kind]:o.item.kind==="revision"&&r.item.kind==="revision"?r.item.nesting-o.item.nesting:0).map(o=>o.item)}function N(e,a,t){let o=w(e,a,t).filter(r=>!(r.kind==="comment"&&r.resolved))[0];return o?o.kind==="comment"?g(e,o):o:null}function _(e,a){return g(e,a)}function g(e,a){let t=new Map,n=new Map;for(let i of e)i.kind==="comment"?t.set(i.id,i):i.kind==="revision"&&n.set(i.id,i);let o=new Set([a.id]),r=a;for(;r.parentId!==void 0;){let i=t.get(r.parentId);if(!i||o.has(i.id))break;o.add(i.id),r=i;}if(r.parentRevisionId!==void 0){let i=n.get(r.parentRevisionId);if(i)return i}return r}function h(e,a,t){let n=e.lines?.find(o=>{let r=o.spans;if(!r)return t<o.range.end;let i=r.filter(d=>d.range.paragraphId===a);return i.length===r.length?t<o.range.end:i.length>0&&t<i[i.length-1].range.end});return n?n.box.y:e.fragmentY}function E(e,a){let t=new Map;for(let n of e.pages)for(let[o,r]of x(n,a))t.has(o)||t.set(o,r);return t}var l=new WeakMap;function x(e,a){let t=l.get(a);t||(t=new WeakMap,l.set(a,t));let n=t.get(e);if(n)return n;let o=new Map;for(let r of a(e)){let i=new Set([r.paragraphId]);for(let d of r.lines??[])for(let u of d.spans??[])i.add(u.range.paragraphId);for(let d of i)o.has(d)||o.set(d,{pageIndex:e.index,contentY:e.contentBox.y,fragmentY:r.box.y,...r.lines?{lines:r.lines}:{}});}return t.set(e,o),o}function O(e,a){let t=y(e);if(!t)return null;let n=a.get(t.start.paragraphId);return n?{pageIndex:n.pageIndex,y:n.contentY+h(n,t.start.paragraphId,t.start.offset)}:null}
|
|
2
|
+
export{k as a,A as b,M as c,C as d,m as e,y as f,T as g,w as h,N as i,_ as j,h as k,E as l,O as m};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkLEV2X47E_cjs=require('./chunk-LEV2X47E.cjs');var $=8,Qe=["color","background","spanClassName","avatarUrl"],et=["color","background","spanClassName"],tt=new Set(["http","https","data","blob"]),nt=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function ot(t){let e=t.replace(/[\u0000-\u0020\u007f]/g,"");if(e.length===0)return;let n=nt.exec(e);if(n)return !tt.has(n[1].toLowerCase())||/^data:/i.test(e)&&!/^data:image\/(?!svg)/i.test(e)?void 0:e;let o=a=>e[a]==="/"||e[a]==="\\";return o(0)&&o(1)?void 0:e}function rt(t){if(typeof t=="string")return t.length>0?{color:t}:null;if(t===null||typeof t!="object")return null;let e={},n=Object.prototype.hasOwnProperty;for(let o of Qe){if(!n.call(t,o))continue;let a=t[o];if(!(typeof a!="string"||a.length===0)){if(o==="avatarUrl"){let r=ot(a);r!==void 0&&(e.avatarUrl=r);continue}e[o]=a;}}return Object.keys(e).length>0?e:null}function z(t){return `var(--doc-review-author-${t%$})`}function he(t){let e=new Map;if(t===void 0||t==="kind"||t==="author")return e;for(let[n,o]of Object.entries(t.authors)){let a=rt(o);a&&e.set(n,a);}return e}function fn(t,e){let n=he(e);return [...t].map(([o,a])=>{let r=n.get(o);return {author:o,slot:a,color:r?.color??z(a),...r?{style:r}:{}}})}var at=128;function O(t,e,n=at){let o=e.length<n?e.length:n,a=t;for(let r=0;r<o;r+=1)a=Math.imul(a^e.charCodeAt(r),16777619);return Math.imul(a^e.length,16777619)}function it(t,e,n){let o=O(2166136261,n);for(let a of t.keys())o=O(o,a);for(let[a,r]of e){o=O(o,a);for(let i of et)o=O(o,r[i]??"",1/0);}return `${t.size}.${e.size}.${(o>>>0).toString(36)}`}function fe(t){return t===null?"kind":t.key}var G=new WeakMap;function pe(t,e){if(t==="kind")return null;let n=G.get(e);if(n&&n.option===t)return n.context;let o=he(t),a=t===void 0||t==="author"?"author":t.others??"author";if(o.size===0&&a==="kind")return G.set(e,{option:t,context:null}),null;let r=lt(e),i=new Map;for(let[l,d]of o){if(!d.spanClassName)continue;let u=d.spanClassName.split(/\s+/).filter(c=>c.length>0);u.length>0&&i.set(l,u);}let s={authorSlots:r,styles:o,classTokens:i,others:a,key:it(r,o,a)};return G.set(e,{option:t,context:s}),s}var ue=new WeakMap;function st(t){let e=ue.get(t);if(e)return e;let n=[],o=new Set,a=r=>{r===""||o.has(r)||(o.add(r),n.push(r));};for(let r of chunkLEV2X47E_cjs.T(t)){for(let s of r.lines)for(let l of s.spans){let d=l.revisions;if(d!==void 0)for(let u=0;u<d.length;u+=1)a(d[u].author);for(let u of l.props){if(u.localName!=="rPrChange"&&u.localName!=="pPrChange")continue;let c=u.attributes?.author;a(c??"");break}}let i=r.markRevisions;if(i)for(let s=0;s<i.length;s+=1)a(i[s].author);}return ue.set(t,n),n}var ye=new WeakMap;function lt(t){let e=ye.get(t);if(e)return e;let n=new Map,o=a=>{for(let r of st(a))n.has(r)||n.set(r,n.size);};for(let a of t.pages){o(a.fragments),a.header&&o(a.header.fragments),a.footer&&o(a.footer.fragments);for(let r of [a.footnotes,a.endnotes])if(r){r.separator&&o(r.separator.fragments);for(let i of r.notes)o(i.fragments);}for(let r of [a.anchoredDrawings,a.header?.anchoredDrawings,a.footer?.anchoredDrawings])if(r)for(let i of r)i.textboxStory&&o(i.textboxStory.fragments);}return ye.set(t,n),n}function pn(t,e){let n=null;for(let o of e)o===""||t.has(o)||(n===null&&(n=new Map(t)),n.has(o)||n.set(o,n.size));return n??t}function ge(t,e,n){if(t===void 0||t.length===0)return null;let o=t[t.length-1],a=t.some(s=>s.kind==="delete"||s.kind==="moveFrom"),r=o.kind,i=r==="delete"||r==="moveFrom"?"line-through":r==="insert"||r==="moveTo"?"underline":null;return {attribution:o,line:a&&i==="underline"?"line-through":i,decorationStyle:r==="moveFrom"||r==="moveTo"?"double":r==="insert"?"dashed":"solid",color:a?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",authorColor:n?.get(o.author)?.color??z(e?.get(o.author)??0),deleted:a}}function xe(t,e,n,o,a,r){for(let i of [n.footnotes,n.endnotes])i&&e.append(dt(t,n,i,o,a,r));}function dt(t,e,n,o,a,r){let i=t.createElement("div");if(i.className="docx-notes",i.dataset.docxNotes=n.kind,i.dataset.docxNotesPlacement=n.placement,i.style.position="absolute",i.style.left=`${(n.box.x-e.box.x)*o.scale}px`,i.style.top=`${(n.box.y-e.box.y)*o.scale}px`,i.style.width=`${n.box.width*o.scale}px`,i.style.height=`${n.box.height*o.scale}px`,n.separator){let s=t.createElement("div");s.className="docx-note-separator",s.dataset.docxNoteSeparator=n.separator.kind,s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(n.separator.box.x-n.box.x)*o.scale}px`,s.style.top=`${(n.separator.box.y-n.box.y)*o.scale}px`,s.style.width=`${n.separator.box.width*o.scale}px`,s.style.height=`${Math.max(n.separator.box.height,.75)*o.scale}px`;let l=n.separator.ruleStyle;if(l||n.separator.synthetic||n.separator.fragments.length===0)ct(s,t,l??"single",o.scale);else for(let d of n.separator.fragments)s.append(d.kind==="table"?r(t,d,o):a(t,d,o));i.append(s);}for(let s of n.notes){let l=t.createElement("div");l.className="docx-note",l.dataset.docxNote=s.noteKind,l.dataset.docxNoteId=String(s.noteId),l.dataset.docxNoteScope=s.scopeId,s.mark!==null&&(l.dataset.docxNoteMark=s.mark),s.continuation&&(l.dataset.docxNoteContinuation=""),l.setAttribute("role","doc-footnote"),l.style.position="absolute",l.style.left=`${(s.box.x-n.box.x)*o.scale}px`,l.style.top=`${(s.box.y-n.box.y)*o.scale}px`,l.style.width=`${s.box.width*o.scale}px`,l.style.height=`${s.box.height*o.scale}px`;for(let d of s.fragments)l.append(d.kind==="table"?r(t,d,o):a(t,d,o));i.append(l);}return i}function ct(t,e,n,o){t.dataset.docxNoteRule=n;let a=Math.max(1,o*.75);if(n==="single"){t.style.borderTop=`${a}px solid currentColor`,t.style.opacity="0.85";return}t.style.opacity="0.85";let r=Math.max(1,o*1.25);for(let i of [0,a+r]){let s=e.createElement("div");s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top=`${i}px`,s.style.height="0",s.style.borderTop=`${a}px solid currentColor`,t.append(s);}}function U(t,e,n){return !!n.activeHeaderFooterRId&&!!t.rId&&n.activeHeaderFooterRId===t.rId&&(n.activeHeaderFooterPageIndex===void 0||n.activeHeaderFooterPageIndex===e)}function W(t,e,n){return n?t.kind==="footer"?Math.max(t.box.height,e.box.y+e.box.height-t.box.y):Math.max(t.box.height,e.contentBox.y-t.box.y):t.box.height}function me(t,e){for(let{record:n,element:o,materialized:a}of t){if(!a)continue;let r=o.querySelector(":scope > .docx-page-content");r&&(e.activeHeaderFooterRId?r.setAttribute("contenteditable","false"):r.removeAttribute("contenteditable"));for(let i of o.querySelectorAll(":scope > .docx-hf:not(.docx-hf--placeholder)")){let s=ut(n,i);if(!s)continue;let l=U(s,n.index,e);yt(i,n,s,l,e.scale);}for(let i of o.querySelectorAll(":scope > [data-docx-hf-front]")){let s=be(n,i.dataset.docxHfFront);ve(i,!!s&&U(s,n.index,e));}}}function ut(t,e){return be(t,e.dataset.docxHf)}function be(t,e){if(e==="header")return t.header;if(e==="footer")return t.footer}function yt(t,e,n,o,a){o?(t.dataset.docxHfActive="",t.setAttribute("contenteditable","true")):(delete t.dataset.docxHfActive,t.setAttribute("contenteditable","false")),t.style.height=`${W(n,e,o)*a}px`,ve(t,o);}function ve(t,e){let n=t.querySelectorAll(t instanceof Element&&t.classList.contains("docx-drawing-layer")?":scope > *":":scope > .docx-drawing-layer > *");for(let o of n){o.style.pointerEvents=e?"auto":"none";for(let a of o.querySelectorAll(".docx-drawing"))a.style.pointerEvents=e?"auto":"none";}}var Re=Object.freeze({"image/svg+xml":"SVG","image/tiff":"TIFF","image/x-emf":"EMF","image/x-wmf":"WMF",unknown:"Unknown"}),_=new WeakMap,V=new WeakMap,ht=256;function we(t,e){let n=_.get(t);if(n)return n;let o=new Map,a=new Map;return n=Object.freeze({urlForReady(r,i){let s=o.get(r.resourceKey);if(s)return s;let l=e.create(r,i);return o.set(r.resourceKey,l),l},imageFor(r,i,s){let l=a.get(r);if(l&&l.resourceKey===i)return l.element;let d=s.createElement("img");return a.size<ht&&a.set(r,{element:d,resourceKey:i,...l?.readyElement?{readyElement:l.readyElement}:{}}),d},imageForPending(r){return a.get(r)?.element??null},readyElementFor(r){return a.get(r)?.readyElement??null},rememberReadyElement(r,i){let s=a.get(r);s&&a.set(r,{...s,readyElement:i});},reconcile(r,i){for(let[s,l]of o)r.has(s)||(e.revoke(l),o.delete(s));for(let[s,l]of a)i.has(s)||(l.element.removeAttribute("src"),a.delete(s));},revokeAll(){for(let r of o.values())e.revoke(r);o.clear();for(let r of a.values())r.element.removeAttribute("src");a.clear();}}),_.set(t,n),n}function X(t,e){return `${e.paintInstance??""}|${t.drawingNodeId}`}function Rn(t){_.get(t)?.revokeAll(),_.delete(t);}function E(t){return Number.isFinite(t)?String(t):"0"}function ke(t,e){if(t.length<3||e.width<=0||e.height<=0)return null;let n=[];for(let o of t){if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return null;let a=(o.x-e.x)/e.width*100,r=(o.y-e.y)/e.height*100;n.push(`${E(a)}% ${E(r)}%`);}return `polygon(${n.join(", ")})`}function Ae(t){let e=t.geometry.contentBounds;return chunkLEV2X47E_cjs.rb({transform:t.transform,contentWidth:e.width,contentHeight:e.height})}function Ee(t){let{effects:e}=t,n=[];if(e.grayscale&&n.push("grayscale(1)"),e.brightness!==0&&Number.isFinite(e.brightness)){let o=1+e.brightness/100;Number.isFinite(o)&&n.push(`brightness(${E(Math.max(0,o))})`);}if(e.contrast!==0&&Number.isFinite(e.contrast)){let o=1+e.contrast/100;Number.isFinite(o)&&n.push(`contrast(${E(Math.max(0,o))})`);}return n.length>0?n.join(" "):void 0}function Pe(t,e){let{crop:n}=t,o=Math.max(0,Math.min(1,n.left)),a=Math.max(0,Math.min(1,n.top)),r=Math.max(0,Math.min(1,n.right)),i=Math.max(0,Math.min(1,n.bottom)),s=Math.max(1e-4,1-o-r),l=Math.max(1e-4,1-a-i);return Object.freeze({width:`${E(1/s*100)}%`,height:`${E(1/l*100)}%`,left:`${E(-o/s*100)}%`,top:`${E(-a/l*100)}%`})}function ft(t,e){let{resource:n}=t;switch(n.kind){case "external":return e.externalResource;case "missing":return e.missingResource;case "pending":return e.pendingResource;case "unrenderable":switch(n.reason){case "unsupported-format":return e.unsupportedFormat(Re[n.mime]??Re.unknown);case "non-picture-graphic":return e.nonPictureGraphic(t.placeholderGraphicKind??"graphic");case "signature-mismatch":return e.contentMismatch;case "decode-failed":return e.decodeFailed;case "resource-limit":return e.resourceLimit;default:return e.invalidResource}default:return e.invalidResource}}function T(t,e,n){let{accessibility:o}=e;o.hidden||(t.setAttribute("role",n?"link":"img"),o.label?t.setAttribute("aria-label",o.label):n||t.setAttribute("aria-hidden","true"));}function C(t,e,n,o){let a=o?.x??0,r=o?.y??0;t.style.position="absolute",t.style.left=`${(e.x-a)*n}px`,t.style.top=`${(e.y-r)*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`,t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.pointerEvents="auto";}function pt(t,e,n,o,a){let r=t.paintBounds,i=t.geometry.contentBounds,s=Pe(t);return [o,n.scale,a?.x??0,a?.y??0,r.x,r.y,r.width,r.height,i.x,i.y,i.width,i.height,ke(t.geometry.clipPolygon??[],r)??"",Ee(t)??"",Ae(t)??"",s.width,s.height,s.left,s.top,n.inertLinks?"":t.hyperlinkHref??"",t.accessibility.label??""].join("|")}function F(t,e,n,o){let a=t.createElement("div");a.className="docx-drawing docx-drawing-placeholder",a.dataset.drawingNodeId=e.drawingNodeId,C(a,e.paintBounds,n.scale,o);let r=t.createElement("div");r.className="docx-drawing-placeholder-card";let i=t.createElement("span");return i.className="docx-drawing-placeholder-label",i.textContent=ft(e,n.strings),r.append(i),a.append(r),e.hyperlinkHref&&!n.inertLinks?(a.dataset.docxDrawingLink=e.drawingNodeId,a.dataset.docxDrawingLinkKind="external",a.dataset.docxDrawingLinkHref=e.hyperlinkHref,a.setAttribute("tabindex","-1"),T(a,e,true)):T(a,e,false),a}function gt(t,e,n,o,a,r){let i=e.resource;if(i.kind!=="ready")return F(t,e,n,r);let s=X(e,n),l=a?.readyElementFor?.(s)??t.createElement("div"),d=pt(e,i,n,o,r);if(V.get(l)===d)return l;l.className="docx-drawing docx-drawing-ready",l.style.cssText="",l.dataset.drawingNodeId=e.drawingNodeId,delete l.dataset.docxDrawingLink,delete l.dataset.docxDrawingLinkKind,delete l.dataset.docxDrawingLinkHref,l.removeAttribute("aria-hidden"),l.removeAttribute("aria-label"),l.removeAttribute("role"),l.removeAttribute("tabindex"),C(l,e.paintBounds,n.scale,r);let u=ke(e.geometry.clipPolygon??[],e.paintBounds);u&&(l.style.clipPath=u);let c=t.createElement("div");c.className="docx-drawing-image-frame",c.style.position="absolute";let y=e.geometry.contentBounds,p=e.paintBounds;c.style.left=`${(y.x-p.x)*n.scale}px`,c.style.top=`${(y.y-p.y)*n.scale}px`,c.style.width=`${y.width*n.scale}px`,c.style.height=`${y.height*n.scale}px`;let h=Ee(e);h&&(c.style.filter=h);let g=t.createElement("div");g.className="docx-drawing-transform-stage",g.style.position="relative",g.style.width="100%",g.style.height="100%";let k=Ae(e);k&&(g.style.transform=k,g.style.transformOrigin="0 0");let S=t.createElement("div");S.className="docx-drawing-crop-viewport",S.style.position="relative",S.style.width="100%",S.style.height="100%",S.style.overflow="hidden";let v=a?.imageFor?.(s,i.resourceKey,t)??t.createElement("img");v.className="docx-drawing-image",v.setAttribute("draggable","false"),v.getAttribute("src")!==o&&v.setAttribute("src",o),v.setAttribute("alt","");let w=Pe(e);return v.style.position="absolute",v.style.width=w.width,v.style.height=w.height,v.style.left=w.left,v.style.top=w.top,v.style.maxWidth="none",v.style.maxHeight="none",S.append(v),g.append(S),c.append(g),l.replaceChildren(c),e.hyperlinkHref&&!n.inertLinks?(l.dataset.docxDrawingLink=e.drawingNodeId,l.dataset.docxDrawingLinkKind="external",l.dataset.docxDrawingLinkHref=e.hyperlinkHref,l.setAttribute("tabindex","-1"),T(l,e,true)):T(l,e,false),a?.rememberReadyElement?.(s,l),V.set(l,d),l}var Se="http://www.w3.org/2000/svg";function xt(t,e,n,o){let a=e.vectorShape,r=t.createElement("div");r.className="docx-drawing docx-drawing-shape",r.dataset.drawingNodeId=e.drawingNodeId,C(r,e.paintBounds,n.scale,o);let i=e.geometry.contentBounds,s=e.paintBounds,l=t.createElement("div");l.className="docx-drawing-image-frame",l.style.position="absolute",l.style.left=`${(i.x-s.x)*n.scale}px`,l.style.top=`${(i.y-s.y)*n.scale}px`,l.style.width=`${i.width*n.scale}px`,l.style.height=`${i.height*n.scale}px`;let d=t.createElementNS(Se,"svg");d.setAttribute("viewBox",`0 0 ${E(Math.max(1,a.extentEmu.cx))} ${E(Math.max(1,a.extentEmu.cy))}`),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.style.display="block";let u=t.createElementNS(Se,"path"),c=a.subpathsEmu.map(y=>`M${y.map(p=>`${E(p.x)} ${E(p.y)}`).join("L")}Z`).join("");return u.setAttribute("d",c),u.setAttribute("fill",a.fillHex!==null?`#${a.fillHex}`:"none"),u.setAttribute("fill-rule","evenodd"),a.strokeHex!==null&&(u.setAttribute("stroke",`#${a.strokeHex}`),u.setAttribute("stroke-width",E(Math.max(1,a.strokeWidthEmu)))),d.append(u),l.append(d),r.append(l),e.hyperlinkHref&&!n.inertLinks?(r.dataset.docxDrawingLink=e.drawingNodeId,r.dataset.docxDrawingLinkKind="external",r.dataset.docxDrawingLinkHref=e.hyperlinkHref,r.setAttribute("tabindex","-1"),T(r,e,true)):T(r,e,false),r}function mt(t,e,n,o,a){let r=o.scale,i=t.createElement("div");i.className="docx-drawing docx-drawing-textbox",i.dataset.drawingNodeId=e.drawingNodeId,i.setAttribute("contenteditable","false"),C(i,e.paintBounds,o.scale,a),i.style.overflow="hidden";let s=(e.x-e.paintBounds.x)*r,l=(e.y-e.paintBounds.y)*r;if(n.fillHex!==null||n.strokeHex!==null){let u=t.createElement("div");u.className="docx-drawing-textbox-box",u.style.position="absolute",u.style.left=`${s}px`,u.style.top=`${l}px`,u.style.width=`${e.width*r}px`,u.style.height=`${e.height*r}px`,u.style.boxSizing="border-box",n.fillHex!==null&&(u.style.backgroundColor=`#${n.fillHex}`),n.strokeHex!==null&&(u.style.border=`${Math.max(n.strokeWidthPt*r,.5)}px solid #${n.strokeHex}`),i.append(u);}let d=t.createElement("div");d.className="docx-drawing-textbox-content",d.style.position="absolute",d.style.left=`${s+n.contentOffset.x*r}px`,d.style.top=`${l+n.contentOffset.y*r}px`,d.style.width=`${n.contentWidth*r}px`,d.style.height=`${Math.max(0,n.contentHeight)*r}px`,d.style.overflow="hidden";for(let u of n.fragments)d.append(o.paintStoryFragment(t,u));for(let u of d.querySelectorAll("[data-paragraph-id]"))delete u.dataset.paragraphId;return i.append(d),T(i,e,false),i}function Le(t,e,n,o,a){if(e.accessibility.hidden||e.paintBounds.width<=0||e.paintBounds.height<=0)return null;if(e.kind==="anchoredDrawing"&&e.textboxStory!==void 0&&n.paintStoryFragment!==void 0)return mt(t,e,e.textboxStory,n,a);if(e.vectorShape&&e.vectorShape.subpathsEmu.length>0)return xt(t,e,n,a);let{resource:r}=e;if(r.kind==="ready"){if(!n.imageUrlPort||!o)return F(t,e,n,a);let i=o.urlForReady(r.validatedHandle,r.mime);return i?gt(t,e,n,i,o,a):F(t,e,n,a)}if(r.kind==="pending"){let i=o?.readyElementFor?.(X(e,n))??o?.imageForPending?.(X(e,n))?.closest(".docx-drawing-ready");return i?(V.delete(i),i.dataset.drawingNodeId=e.drawingNodeId,C(i,e.paintBounds,n.scale,a),i):F(t,e,n,a)}return F(t,e,n,a)}function $e(t,e,n,o,a){let r=[];for(let i of e.drawings??[]){let s=Le(t,i,n,o,a);s&&r.push(s);}return Object.freeze(r)}function Te(t,e,n,o,a,r){let i=[];for(let s of e){if(chunkLEV2X47E_cjs.sb(s)!==n)continue;let l=Le(t,s,o,a,r);l&&(l.dataset.drawingLayer=n,i.push(l));}return Object.freeze(i)}function Me(t){let e=new Set,n=i=>{i.resource.kind==="ready"&&e.add(i.resource.resourceKey);},o=i=>{for(let s of i.drawings??[])n(s);},a=i=>{for(let s of i.lines)o(s);},r=i=>{if(i.kind==="table"){for(let s of i.rows)for(let l of s.cells)for(let d of l.blocks)r(d);return}a(i);};for(let i of t.pages){for(let s of i.anchoredDrawings??[])n(s);for(let s of i.fragments)r(s);for(let s of [i.header,i.footer])if(s){for(let l of s.anchoredDrawings??[])n(l);for(let l of s.fragments)r(l);}}return e}function He(t){let e=new Set,n=(a,r)=>{e.add(`p${a}|${r.drawingNodeId}`);},o=(a,r)=>{if(r.kind==="table"){for(let i of r.rows)for(let s of i.cells)for(let l of s.blocks)o(a,l);return}for(let i of r.lines)for(let s of i.drawings??[])n(a,s);};for(let a of t.pages){for(let r of a.anchoredDrawings??[])n(a.index,r);for(let r of a.fragments)o(a.index,r);for(let r of [a.header,a.footer])if(r){for(let i of r.anchoredDrawings??[])n(a.index,i);for(let i of r.fragments)o(a.index,i);}}return e}function Ie(t){return [t.missingResource,t.externalResource,t.invalidResource,t.contentMismatch,t.decodeFailed,t.resourceLimit,t.pendingResource,t.unsupportedFormat("probe"),t.nonPictureGraphic("probe")].join("\0")}var Y=Object.freeze({unsupportedFormat:t=>`Unsupported image format (${t})`,nonPictureGraphic:t=>`Unsupported graphic (${t})`,missingResource:"Image missing",externalResource:"External image not loaded",invalidResource:"Invalid image",contentMismatch:"Image content does not match its type",decodeFailed:"Image could not be decoded",resourceLimit:"Image exceeds size limits",pendingResource:"Loading image"});function Sn(t){return Object.freeze({unsupportedFormat:e=>t("image.unsupportedFormat",{format:e}),nonPictureGraphic:e=>t("image.nonPictureGraphic",{kind:e}),missingResource:t("image.missingResource"),externalResource:t("image.externalResource"),invalidResource:t("image.invalidResource"),contentMismatch:t("image.contentMismatch"),decodeFailed:t("image.decodeFailed"),resourceLimit:t("image.resourceLimit"),pendingResource:t("image.pendingResource")})}var bt=/^[0-9A-Fa-f]{6}$/;function vt(t){switch(t){case "dashed":return "dashed";case "dotted":return "dotted";case "double":case "triple":return "solid";default:return "solid"}}function De(t){return t&&bt.test(t)?t:"000000"}function q(t,e){let n=t.createElement("div");return n.className=e,n.setAttribute("aria-hidden","true"),n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.right="0",n.style.bottom="0",n.style.overflow="visible",n.style.pointerEvents="none",n.style.boxSizing="border-box",n}function j(t,e,n,o){if(!n)return;let a=`#${De(n.color)}`,r=`${Math.max(0,n.widthPt*o)}px`;if(t.style[`border${e}Width`]=r,t.style[`border${e}Color`]=a,n.style==="double"||n.style==="triple"){t.style[`border${e}Style`]="none";return}t.style[`border${e}Style`]=vt(n.style);}function Z(t,e,n,o,a){let r=t.createElement("div");r.className=a,r.dataset.edge=n.side,r.dataset.stroke=n.role,r.style.position="absolute",r.style.left=`${n.x*o}px`,r.style.top=`${n.y*o}px`,r.style.width=`${n.width*o}px`,r.style.height=`${n.height*o}px`,r.style.pointerEvents="none",r.style.backgroundColor=`#${De(n.color)}`,n.cssStyle!=="solid"&&(r.dataset.cssStyle=n.cssStyle),e.append(r);}function Rt(t){let e=new Set;for(let n of t)e.add(`${n.side}\0${n.role}`);return e}function St(t,e,n,o){let a=Rt(n),r=y=>a.has(`${y}\0middle`),i=q(t,"docx-table-border-double"),s=q(t,"docx-table-border-triple"),l=q(t,"docx-table-border-edge"),d=false,u=false,c=false;for(let y of n){if(y.role==="edge"){c=true,Z(t,l,y,o,"docx-table-border-edge-stroke");continue}if(r(y.side)){u=true,Z(t,s,y,o,"docx-table-border-triple-stroke");continue}(y.role==="outer"||y.role==="inner")&&(d=true,Z(t,i,y,o,"docx-table-border-double-stroke"));}d&&e.append(i),u&&e.append(s),c&&e.append(l);}function Fe(t,e,n,o){j(e,"Top",n?.top,o),j(e,"Right",n?.right,o),j(e,"Bottom",n?.bottom,o),j(e,"Left",n?.left,o),n?.strokes&&n.strokes.length>0&&St(t,e,n.strokes,o);}var J="when-selected",Ce=new WeakMap,Be=0;function wt(t){let e=Ce.get(t);return e||(Be+=1,e=`alias${Be}`,Ce.set(t,e)),e}function We(t){return {...t,drawingStrings:t.drawingStrings??Y,urlRegistry:t.urlRegistry??null}}function kt(t){let e={...t,inertLinks:true};return Object.freeze({scale:t.scale,strings:t.drawingStrings,...t.imageUrlPort?{imageUrlPort:t.imageUrlPort}:{},...t.inertLinks?{inertLinks:true}:{},...t.paintInstance?{paintInstance:t.paintInstance}:{},paintStoryFragment:(n,o)=>o.kind==="table"?I(n,o,e):H(n,o,e)})}function Ve(t){return Object.freeze({ctx:kt(t),urlRegistry:t.urlRegistry})}function Ne(t,e,n,o,a,r){K(t,e,chunkLEV2X47E_cjs.V(n),o,a,r);}function K(t,e,n,o,a,r,i=true,s){if(n.length===0)return;let l=Ve(o),d=t.createElement("div");d.className=r==="behind"?"docx-drawing-layer docx-drawing-layer-behind":"docx-drawing-layer docx-drawing-layer-front",d.style.position="absolute",d.style.inset="0",d.style.pointerEvents="none",s&&(d.dataset.docxHfFront=s);for(let u of Te(t,n,r,l.ctx,l.urlRegistry,a)){if(u.style.pointerEvents=i?"auto":"none",!i)for(let c of u.querySelectorAll(".docx-drawing"))c.style.pointerEvents="none";d.append(u);}d.childElementCount>0&&e.append(d);}function Xe(t){return t.horizontalFrame==="page"||t.verticalFrame==="page"}function Ye(t,e,n){let o=e.paintBounds,a=e.horizontalFrame==="page"?n.x+(o.x-e.horizontalFrameOrigin):t.box.x+o.x,r=e.verticalFrame==="page"?n.y+(o.y-e.verticalFrameOrigin):t.box.y+o.y,i=a-o.x,s=r-o.y,l=d=>Object.freeze({x:d.x+i,y:d.y+s,width:d.width,height:d.height});return Object.freeze({...e,x:e.x+i,y:e.y+s,paintBounds:l(o),hitBounds:l(e.hitBounds),geometry:Object.freeze({...e.geometry,contentBounds:l(e.geometry.contentBounds),paintBounds:l(e.geometry.paintBounds),...e.geometry.clipPolygon?{clipPolygon:Object.freeze(e.geometry.clipPolygon.map(d=>Object.freeze({x:d.x+i,y:d.y+s})))}:{}})})}function At(t,e,n,o,a,r){let i=o.map(l=>Ye(n,l,r)),s=t.createElement("div");s.className="docx-hf-behind-layer",s.dataset.docxHfBehind=n.kind,s.setAttribute("contenteditable","false"),s.style.position="absolute",s.style.inset="0",s.style.overflow="hidden",s.style.pointerEvents="none",K(t,s,i,a,r,"behind",false),s.childElementCount>0&&e.append(s);}function Et(t,e,n,o,a,r,i,s=false){let l=o.filter(Xe).map(d=>Ye(n,d,r));K(t,e,l,a,r,i,s,n.kind);}var D=/^[0-9A-Fa-f]{6}$/,Oe=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Pt=new Map(Object.entries({single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"})),Lt=new Map(Object.entries({black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"}));function $t(t){return t.doubleStrike?"double":t.strike?"single":"none"}function Tt(t){return t==="thick"||t.endsWith("Heavy")}function qe(t){if(!t.underline)return null;let e=t.underline.color&&D.test(t.underline.color)?t.underline.color:null;return {cssStyle:Pt.get(t.underline.variant)??"solid",color:e,heavy:Tt(t.underline.variant)}}function Ze(t,e,n,o){t.textDecorationLine=e,t.textDecorationStyle=n,o.color&&(t.textDecorationColor=`#${o.color}`),o.heavy&&(t.textDecorationThickness=`max(${2*o.scale}px, 0.12em)`);}function ze(t,e,n){e!=="none"&&Ze(t,"line-through",e==="double"?"double":"solid",{scale:n});}function Ue(t,e,n){Ze(t,"underline",e.cssStyle,{color:e.color,heavy:e.heavy,scale:n});}function Mt(t,e,n){let o=e.color?`#${e.color}`:"currentColor";t.borderBottomWidth=`${(e.heavy?2:1)*n}px`,t.borderBottomStyle=e.cssStyle==="wavy"?"solid":e.cssStyle,t.borderBottomColor=o;}function Q(t,e,n){let o=t.style,a=n.scale,r=e.verticalAlign==="baseline"?1:.75;o.fontSize=`${e.fontSizePt*r*a}px`,e.bold&&(o.fontWeight="bold"),e.italic&&(o.fontStyle="italic");let i=e.fontFamily&&Oe.test(e.fontFamily)?e.fontFamily:n.defaultFontFamily&&Oe.test(n.defaultFontFamily)?n.defaultFontFamily:null;if(i){let d=n.fontAlias?.(i);o.fontFamily=d?`"${d}", "${i}", ${chunkLEV2X47E_cjs.sd}`:`"${i}", ${chunkLEV2X47E_cjs.sd}`;}e.color&&D.test(e.color)&&(o.color=`#${e.color}`);let s=e.highlight?Lt.get(e.highlight):void 0;s?(o.backgroundColor=s,t.dataset.highlight=e.highlight??""):e.shading&&D.test(e.shading)&&(o.backgroundColor=`#${e.shading}`),e.caps&&(o.textTransform="uppercase"),e.smallCaps&&(o.fontVariant="small-caps");let l=chunkLEV2X47E_cjs.db(e);l!==0&&(o.position="relative",o.top=`${-l*a}px`),e.characterSpacingPt!==0&&(o.letterSpacing=`${e.characterSpacingPt*a}px`),e.horizontalScalePercent!==100&&(o.transformOrigin="left",o.transform=`scaleX(${e.horizontalScalePercent/100})`);}function Je(t,e,n,o,a){let r=n===" "?null:qe(o),i=$t(o),s=e;if(r&&i!=="none"){let l=t.createElement("span");l.dataset.docxDeco="underline",Ue(l.style,r,a);let d=t.createElement("span");d.dataset.docxDeco="strike",ze(d.style,i,a),l.append(d),e.append(l),s=d;}else r?Ue(e.style,r,a):i!=="none"&&ze(e.style,i,a);s.textContent=n;}function L(t,e,n,o){let a=t.createElement(e);return a.style.position="absolute",a.style.left=`${n.x*o}px`,a.style.top=`${n.y*o}px`,a.style.width=`${n.width*o}px`,a.style.height=`${n.height*o}px`,a}function Ht(t,e,n){let o=e.fieldAtom;!o||(t.dataset.fieldAtom=o.formField?"form":"field",!(o.formField?n.shadeFormFields!==false:(n.fieldShading??J)!=="never"))||(t.classList.add("docx-field-atom"),(o.formField||(n.fieldShading??J)==="always")&&t.classList.add("docx-field-atom--shaded"));}function It(t,e,n){let o=chunkLEV2X47E_cjs.lb(e.props),a=n.revisionStyles,r=ge(e.revisions,a?.authorSlots,a?.styles);if(!(!r&&!o)){if(r){let{attribution:i}=r;t.classList.add("docx-revision",`docx-revision-${i.kind}`),t.dataset.revisionKind=i.kind,t.dataset.revisionId=i.id,i.author!==""&&(t.dataset.reviewAuthor=i.author),i.date!==void 0&&(t.dataset.revisionDate=i.date);let s=a?.styles.get(i.author);if(a){t.dataset.reviewAuthorSlot=String((a.authorSlots.get(i.author)??0)%$);let u=a.classTokens.get(i.author);if(u)for(let c=0;c<u.length;c+=1)t.classList.add(u[c]);}let d=a!==void 0&&(s?.color!==void 0||a.others==="author")?r.authorColor:r.color;t.style.color=d,t.style.backgroundColor=s?.background??(r.deleted?"var(--doc-revision-deletion-wash)":"var(--doc-revision-insertion-wash)"),r.line&&(t.style.textDecorationLine=r.line,t.style.textDecorationStyle=r.decorationStyle,t.style.textDecorationColor=d);return}if(t.classList.add("docx-revision","docx-revision-format"),t.dataset.revisionKind="format",t.dataset.revisionId=o.id,o.author!==""&&(t.dataset.reviewAuthor=o.author),o.date!==void 0&&(t.dataset.revisionDate=o.date),a){let i=a.styles.get(o.author);t.dataset.reviewAuthorSlot=String((a.authorSlots.get(o.author)??0)%$);let s=a.classTokens.get(o.author);if(s)for(let l=0;l<s.length;l+=1)t.classList.add(s[l]);i?.color!==void 0&&(t.style.color=i.color),i?.background!==void 0&&(t.style.backgroundColor=i.background);}}}function Dt(t,e,n,o){let a=chunkLEV2X47E_cjs.ib(e),r=t.createElement("span");r.className=`docx-revision-pmark docx-revision-pmark-${a.kind}`,r.setAttribute("aria-hidden","true"),r.contentEditable="false",r.dataset.revisionKind=a.kind,r.dataset.revisionId=a.id,a.author!==""&&(r.dataset.reviewAuthor=a.author),r.dataset.revisionIds=e.map(d=>d.id).join(" "),r.dataset.revisionKinds=e.map(d=>d.kind).join(" "),r.textContent="\xB6",r.style.position="absolute",r.style.pointerEvents="none",r.style.marginLeft=`${2*n}px`;let i=chunkLEV2X47E_cjs.jb(a),s=o?.styles.get(a.author),l=o?(o.authorSlots.get(a.author)??0)%$:0;if(o){r.dataset.reviewAuthorSlot=String(l);let d=o.classTokens.get(a.author);if(d)for(let u=0;u<d.length;u+=1)r.classList.add(d[u]);}return r.style.color=s?.color??(o?.others==="author"?z(l):i?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)"),i&&(r.style.textDecorationLine="line-through"),r}function Ft(t,e,n){let o=[],a=e.lines[e.lines.length-1];for(let i of e.lines){let s=[...i.spans.flatMap(y=>y.revisions??[]),...i===a?e.markRevisions??[]:[]];if(s.length===0)continue;let l=s.some(y=>y.kind==="delete"||y.kind==="moveFrom"),d=i.box.y-e.box.y,u=d+i.box.height,c=o[o.length-1];if(c&&c.deleted===l&&d<=c.bottom+.5){c.bottom=Math.max(c.bottom,u);continue}o.push({top:d,bottom:u,deleted:l});}if(o.length===0)return null;let r=t.createElement("div");r.className="docx-change-bars",r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.inset="0",r.style.pointerEvents="none";for(let i of o){let s=t.createElement("div");s.className=`docx-change-bar docx-change-bar-${i.deleted?"deletion":"insertion"}`,s.style.position="absolute",s.style.top=`${i.top*n}px`,s.style.height=`${(i.bottom-i.top)*n}px`,s.style.left=`${(-e.box.x-Ct)*n}px`,s.style.width=`${Bt*n}px`,s.style.pointerEvents="none",s.style.backgroundColor=i.deleted?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",r.append(s);}return r}var Ct=7.5,Bt=1.5;function Nt(t,e,n,o,a){let r=t.createElement("span");if(r.className="layout-run layout-run-text",r.style.display="inline-block",r.style.verticalAlign="baseline",r.style.boxSizing="border-box",r.style.height=`${o*n.scale}px`,r.style.paddingTop=`${a*n.scale}px`,r.style.lineHeight=`${(o-a)*n.scale}px`,e.range.end>e.range.start?(r.dataset.paragraphId=e.range.paragraphId,r.dataset.start=String(e.range.start),r.dataset.end=String(e.range.end)):(r.setAttribute("aria-hidden","true"),r.contentEditable="false"),Q(r,e.style,n),Ht(r,e,n),It(r,e,n),(e.style.horizontalScalePercent!==100||e.text===" ")&&(r.style.width=`${e.box.width*n.scale}px`),e.text===" "){r.style.overflow="hidden",r.style.verticalAlign="top";let i=qe(e.style);i&&(r.dataset.docxTabUnderline="",Mt(r.style,i,n.scale));}return Je(t,r,e.text,e.style,n.scale),e.projected&&(r.dataset.docxField="",r.setAttribute("contenteditable","false"),e.noteNav?(r.style.userSelect="none",e.noteNav.direction==="to-note"?(r.dataset.docxNoteRef="",r.dataset.docxNoteScope=e.noteNav.scopeId,e.text.length>0&&r.setAttribute("aria-description",e.text)):(r.dataset.docxNoteMarkBack="",r.dataset.docxNoteScope=e.noteNav.scopeId)):(r.style.pointerEvents="none",r.style.userSelect="none")),r}function _e(t,e,n){let o=t.createElement("a");return o.className="docx-hyperlink",o.dataset.docxLink=e.id,o.dataset.docxLinkKind=e.kind,o.setAttribute("tabindex","-1"),!n.inertLinks&&e.href&&(o.setAttribute("href",e.href),e.kind==="external"&&o.setAttribute("rel","noopener noreferrer")),e.tooltip&&o.setAttribute("title",e.tooltip),o.style.display="inline-block",o.style.verticalAlign="baseline",o.style.textDecoration="none",o.style.color="inherit",o}function Ot(t,e,n){let o=n.scale,a=t.createElement("div");a.className="docx-line layout-line",a.dataset.lineId=e.id,a.dataset.paragraphId=e.range.paragraphId,a.style.position="absolute",a.style.top=`${e.box.y*o}px`,a.style.left=`${e.contentX*o}px`,a.style.height=`${e.box.height*o}px`,a.style.fontSize="0",a.style.whiteSpace="pre",a.style.overflow="visible";let r=e.leading??0,i=Math.min(Math.max(r,...e.spans.map(x=>x.box.height+r),e.spans.length===0?e.box.height-(e.trailingSpacing??0):0),e.box.height),s=Math.max(0,e.box.height-i);a.style.boxSizing="border-box",a.style.paddingBottom=`${s*o}px`,a.style.lineHeight=`${(e.box.height-s)*o}px`;let l=null,d=null,u=null,c=new Map;for(let[x,m]of chunkLEV2X47E_cjs.jc(e).entries())c.set(m.paragraphId,x);let y=x=>c.get(x)??0,p=[...e.drawings??[]].sort((x,m)=>y(x.paragraphId)-y(m.paragraphId)||x.start-m.start),h=0,g=(x,m)=>{for(;h<p.length&&(y(p[h].paragraphId)<y(x)||y(p[h].paragraphId)===y(x)&&p[h].start<m);){let f=p[h],b=Math.max(0,f.advanceEnd-f.advanceStart),R=t.createElement("span");R.className="docx-inline-drawing-advance",R.dataset.docxMarker="",R.setAttribute("contenteditable","false"),R.setAttribute("aria-hidden","true"),R.style.display="inline-block",R.style.width=`${b*o}px`,R.style.height=`${f.baselineOffset*o}px`,R.style.lineHeight="0",R.style.pointerEvents="none",R.style.verticalAlign="baseline",a.append(R),h+=1,l=null,d=null;}},k=x=>{let m=x.wrapAdvanceBefore??0;if(m<=.001)return;let f=t.createElement("span");f.className="docx-wrap-advance",f.dataset.docxMarker="",f.setAttribute("contenteditable","false"),f.setAttribute("aria-hidden","true"),f.style.display="inline-block",f.style.width=`${m*o}px`,f.style.height="0",f.style.lineHeight="0",f.style.pointerEvents="none",f.style.verticalAlign="baseline",a.append(f),l=null,d=null;},S=0,v=false;for(let[x,m]of e.spans.entries()){g(m.range.paragraphId,m.range.start),k(m);let f=Math.min(m.box.height+r,e.box.height),b=Nt(t,m,n,f,r);S>0&&!v&&(b.style.marginLeft=`${S*o}px`);let R=e.spans[x+1],P=zt(e,x+1,y);v=P>0&&R!==void 0&&_t(m,R),v&&(b.style.wordSpacing=`${P*o}px`),S=P;let A=m.link;if(!A){l=null,d=null,u=null,a.append(b);continue}if(m.fieldAtom){l!==null&&d===A.id&&u===m.range.start||(l=_e(t,A,n),d=A.id,u=m.range.start,a.append(l)),l.append(b);continue}(!l||d!==A.id||u!==null)&&(l=_e(t,A,n),d=A.id,u=null,a.append(l)),l.append(b);}if(g(chunkLEV2X47E_cjs.jc(e)[chunkLEV2X47E_cjs.jc(e).length-1]?.paragraphId??e.range.paragraphId,Number.POSITIVE_INFINITY),e.spans.length===0){let x=t.createElement("br");x.style.lineHeight=`${e.box.height*o}px`,a.append(x);}let w=Object.freeze({x:e.contentX,y:e.box.y,width:e.box.width,height:e.box.height}),M=Ve(We(n));if(e.drawings&&e.drawings.length>0)for(let x of $e(t,e,M.ctx,M.urlRegistry,w))a.append(x);return a}function zt(t,e,n){if(e<=0||e>=t.spans.length)return 0;let o=t.spans[e-1],a=t.spans[e],r=n(o.range.paragraphId),i=n(a.range.paragraphId);if(t.drawings?.some(d=>{let u=n(d.paragraphId),c=u>r||u===r&&d.start>=o.range.start,y=u<i||u===i&&d.start<a.range.start;return c&&y}))return 0;let l=a.box.x-(o.box.x+o.box.width)-(a.wrapAdvanceBefore??0);return l>.25?l:0}var Ut=/[\t\n\r \u00A0\u1361\u{10100}-\u{10102}\u{1039F}\u{1091F}]/u;function _t(t,e){return !t.text.endsWith(" ")||t.style.horizontalScalePercent!==100||!jt(t,e)||(e.wrapAdvanceBefore??0)>.001?false:!Ut.test(t.text.slice(0,-1))}function jt(t,e){return !t.link&&!e.link?true:!t.link||!e.link||t.link.id!==e.link.id||!!t.fieldAtom!=!!e.fieldAtom?false:!t.fieldAtom||t.range.start===e.range.start}function H(t,e,n){let o=n.scale,a=L(t,"div",e.box,o);a.className="docx-paragraph-fragment layout-paragraph",a.dataset.paragraphId=e.paragraphId,a.dataset.fragmentIndex=String(e.fragmentIndex),n.readOnlyParagraphIds?.has(e.paragraphId)&&(a.classList.add("docx-generated-region"),a.dataset.docxReadOnly="",a.setAttribute("contenteditable","false"),a.setAttribute("aria-readonly","true")),n.emptyTocPlaceholderIds?.has(e.paragraphId)&&(a.classList.add("docx-toc-empty-placeholder"),a.dataset.docxTocEmpty=""),e.shading&&D.test(e.shading)&&e.shadingBox&&a.append(Vt(t,e,o)),e.marker&&a.append(Kt(t,e,n));for(let i of e.lines)for(let s of i.spans){if(!s.tabLeader)continue;let l=Wt(t,e,i,s,n);l&&a.append(l);}let r=Ft(t,e,o);if(r&&a.append(r),e.markRevisions&&e.markRevisions.length>0){let i=Dt(t,e.markRevisions,o,n.revisionStyles),s=e.lines[e.lines.length-1];if(s){let l=s.spans[s.spans.length-1];i.style.top=`${(s.box.y-e.box.y)*o}px`,i.style.left=`${((l?l.box.x+l.box.width:s.contentX)-e.box.x)*o}px`,a.append(i);}}for(let i of e.lines){let s=Ot(t,i,n);s.style.top=`${(i.box.y-e.box.y)*o}px`,s.style.left=`${(i.contentX-e.box.x)*o}px`,a.append(s);}if(e.borders)for(let i of e.borders)a.append(je(t,e,i,o));else e.bottomBorder&&a.append(je(t,e,{side:"bottom",edge:e.bottomBorder.edge,box:e.bottomBorder.box},o));return a}function Kt(t,e,n){let o=e.marker,a=n.scale,r=e.lines[0]?.leading??0,i=L(t,"span",o.box,a);i.className="docx-list-marker",i.dataset.docxMarker="",i.setAttribute("contenteditable","false"),i.setAttribute("aria-hidden","true"),i.style.left=`${(o.box.x-e.box.x)*a}px`,i.style.top=`${(o.box.y-e.box.y)*a}px`,i.style.display="block",i.style.overflow="visible",i.style.whiteSpace="pre";let s=e.lines[0],l=s?Math.max(r,...s.spans.map(y=>y.box.height+r),s.spans.length===0?s.box.height-(s.trailingSpacing??0):0):o.box.height,d=Math.min(l,o.box.height),u=Math.max(0,o.box.height-d);i.style.fontSize="0",i.style.boxSizing="border-box",i.style.paddingBottom=`${u*a}px`,i.style.lineHeight=`${d*a}px`;let c=t.createElement("span");return c.style.display="inline-block",c.style.verticalAlign="baseline",c.style.boxSizing="border-box",c.style.height=`${d*a}px`,c.style.paddingTop=`${r*a}px`,c.style.lineHeight=`${(d-r)*a}px`,Q(c,o.style,n),Je(t,c,o.text,o.style,a),i.append(c),i}var Gt=512;function Wt(t,e,n,o,a){let r=o.tabLeader?chunkLEV2X47E_cjs.Fa.get(o.tabLeader):void 0;if(!r||o.box.width<=0)return null;let i=a.scale,s=t.createElement("div");s.className="docx-tab-leader",s.dataset.docxTabLeader="",s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(o.box.x-e.box.x)*i}px`,s.style.top=`${(n.box.y-e.box.y)*i}px`,s.style.width=`${o.box.width*i}px`,s.style.height=`${n.box.height*i}px`,s.style.overflow="hidden",s.style.whiteSpace="pre",s.style.pointerEvents="none",s.style.userSelect="none";let l=n.leading??0,d=Math.min(o.box.height+l,n.box.height),u=Math.max(0,n.box.height-d);s.style.fontSize="0",s.style.boxSizing="border-box",s.style.paddingBottom=`${u*i}px`,s.style.lineHeight=`${(n.box.height-u)*i}px`;let c=t.createElement("span");c.style.display="inline-block",c.style.verticalAlign="baseline",Q(c,o.style,a),c.style.boxSizing="border-box",c.style.height=`${d*i}px`,c.style.paddingTop=`${l*i}px`,c.style.lineHeight=`${(d-l)*i}px`,o.tabLeader==="heavy"&&(c.style.fontWeight="bold");let y=o.tabLeaderAdvancePt&&o.tabLeaderAdvancePt>0?o.tabLeaderAdvancePt:Math.max(.5,o.style.fontSizePt*.2),p=Math.min(Gt,Math.max(1,Math.floor(o.box.width/y)+2));return c.textContent=r.repeat(p),c.style.letterSpacing="0",s.append(c),s}function Vt(t,e,n){let o=e.shadingBox,a=L(t,"div",o,n);return a.className="docx-paragraph-shading",a.setAttribute("aria-hidden","true"),a.style.left=`${(o.x-e.box.x)*n}px`,a.style.top=`${(o.y-e.box.y)*n}px`,a.style.backgroundColor=`#${e.shading}`,a}function je(t,e,n,o){let a=L(t,"div",n.box,o);a.className=`docx-paragraph-border docx-paragraph-border-${n.side}`,a.setAttribute("aria-hidden","true");let r=(n.box.x-e.box.x)*o,i=(n.box.y-e.box.y)*o,s=n.side==="left"||n.side==="right"||n.side==="bar",l=(s?n.box.width:n.box.height)*o,u=Xt(n.edge.val)?l:Math.max(1,l);a.style.left=`${n.side==="right"?r-(u-l):r}px`,a.style.top=`${n.side==="bottom"?i-(u-l):i}px`,s?a.style.width=`${u}px`:a.style.height=`${u}px`;let c=n.edge.color&&D.test(n.edge.color)?n.edge.color:"000000";return a.style.backgroundColor=`#${c}`,Yt(a,n.edge.val,c,s,u,o),a}function Xt(t){return t==="double"||t==="triple"||t==="doubleWave"||t.startsWith("thinThick")||t.startsWith("thickThin")}function Yt(t,e,n,o,a,r){switch(e){case "dashed":case "dashSmallGap":case "dotDash":case "dotDotDash":case "dashDotStroked":{let i=Math.max(4,4*r);t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 60%, transparent 60%)`,t.style.backgroundSize=o?`100% ${i}px`:`${i}px 100%`;return}case "dotted":{let i=Math.max(3,3*r);t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 35%, transparent 35%)`,t.style.backgroundSize=o?`100% ${i}px`:`${i}px 100%`;return}case "double":case "doubleWave":case "triple":case "thinThickSmallGap":case "thickThinSmallGap":case "thinThickThinSmallGap":case "thinThickMediumGap":case "thickThinMediumGap":case "thinThickThinMediumGap":case "thinThickLargeGap":case "thickThinLargeGap":case "thinThickThinLargeGap":{let i=Math.max(1,a/3);t.style.backgroundColor="transparent",o?(t.style.borderLeft=`${i}px solid #${n}`,t.style.borderRight=`${i}px solid #${n}`):(t.style.borderTop=`${i}px solid #${n}`,t.style.borderBottom=`${i}px solid #${n}`),t.style.boxSizing="border-box";return}case "threeDEmboss":case "ridge":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px ridge #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "threeDEngrave":case "groove":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px groove #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "inset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px inset #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "outset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px outset #${n}`,o?t.style.width="0px":t.style.height="0px";return}default:return}}function qt(t,e,n,o){let a=o.scale,r=L(t,"div",e.box,a);if(r.className="docx-table-cell",r.style.left=`${(e.box.x-n.x)*a}px`,r.style.top=`${(e.box.y-n.y)*a}px`,r.style.boxSizing="border-box",r.style.overflow="visible",r.dataset.cellId=e.id,r.dataset.gridColumn=String(e.gridColumn),r.dataset.gridSpan=String(e.gridSpan),e.rowSpan&&e.rowSpan>1&&(r.dataset.rowSpan=String(e.rowSpan)),e.paintInert||e.vMergeContinue)return r.dataset.vMergeContinue="true",r.style.border="none",r.style.backgroundColor="transparent",r;r.style.border="none",Fe(t,r,e.borders,a),e.shading&&D.test(e.shading)&&(r.style.backgroundColor=`#${e.shading}`);for(let i of e.blocks){let s=i.kind==="table"?I(t,i,o):H(t,i,o);s.style.left=`${(i.box.x-e.box.x)*a}px`,s.style.top=`${(i.box.y-e.box.y)*a}px`,r.append(s);}return r}function I(t,e,n){let o=n.scale,a=L(t,"div",e.box,o);a.className="docx-table-fragment layout-table",a.dataset.tableId=e.tableId,a.dataset.fragmentIndex=String(e.fragmentIndex),a.style.overflow="visible";for(let r of e.rows){let i=L(t,"div",r.box,o);i.className="docx-table-row",r.revisionKind&&(i.classList.add("docx-table-row--revision",r.revisionKind==="insert"?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionKind=r.revisionKind,r.revisionId!==void 0&&(i.dataset.revisionId=r.revisionId),r.revisionAuthor!==void 0&&(i.dataset.reviewAuthor=r.revisionAuthor),r.revisionDate!==void 0&&(i.dataset.revisionDate=r.revisionDate)),i.dataset.rowId=r.id,r.isHeaderRepeat&&(i.dataset.headerRepeat="true"),i.style.left=`${(r.box.x-e.box.x)*o}px`,i.style.top=`${(r.box.y-e.box.y)*o}px`,i.style.overflow="visible";for(let s of r.cells)i.append(qt(t,s,r.box,n));a.append(i);}return a}function Zt(t,e,n,o,a){let r={...n,paintInstance:`p${e.index}`},i=L(t,"div",e.box,r.scale);if(i.className="docx-page",i.style.fontFamily=chunkLEV2X47E_cjs.sd,i.dataset.pageIndex=String(e.index),r.ariaHidden&&(i.setAttribute("aria-hidden","true"),i.setAttribute("role","presentation")),i.dataset.materialized=String(o),!o)return i;let s=Object.freeze({x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height}),l=Object.freeze({x:-(e.contentBox.x-e.box.x),y:-(e.contentBox.y-e.box.y),width:e.box.width,height:e.box.height});Ne(t,i,e,r,l,"behind");for(let c of [e.header,e.footer])c?.anchoredDrawings?.length&&At(t,i,c,c.anchoredDrawings,r,{x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height});let d=t.createElement("div");d.className="docx-page-content",d.style.position="absolute",d.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,d.style.top=`${(e.contentBox.y-e.box.y)*r.scale}px`,d.style.width=`${e.contentBox.width*r.scale}px`,d.style.height=`${e.contentBox.height*r.scale}px`,r.activeHeaderFooterRId&&d.setAttribute("contenteditable","false");for(let c of e.columnSeparators??[]){let y=t.createElement("div");y.className="docx-column-separator",y.setAttribute("contenteditable","false"),y.style.position="absolute",y.style.left=`${c.x*r.scale}px`,y.style.top=`${c.y*r.scale}px`,y.style.width=`${c.width*r.scale}px`,y.style.height=`${c.height*r.scale}px`,y.style.backgroundColor="currentColor",y.style.pointerEvents="none",d.append(y);}let u=a?new Map:null;for(let c of e.fragments){let y=c.kind==="table"?I(t,c,r):H(t,c,r);u?.set(c,y),d.append(y);}a&&u&&(a.content=d,a.blocks=u),i.append(d),Ne(t,i,e,r,l,"inFront"),xe(t,i,e,r,H,I);for(let c of ["header","footer"]){if(e[c])continue;let y=t.createElement("div");y.className="docx-hf docx-hf--placeholder",y.dataset.docxHf=c,y.setAttribute("contenteditable","false");let p=c==="header"?e.contentBox.y-e.box.y:e.box.y+e.box.height-(e.contentBox.y+e.contentBox.height),h=Math.min(p,Jt);if(h<=0)continue;let g=Math.max(0,Math.min(Qt,p-h)),k=c==="header"?g:e.box.height-g-h;y.style.position="absolute",y.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,y.style.top=`${k*r.scale}px`,y.style.width=`${e.contentBox.width*r.scale}px`,y.style.height=`${h*r.scale}px`,i.append(y);}for(let c of [e.header,e.footer]){if(!c)continue;let y=c.anchoredDrawings??[],p=U(c,e.index,r),h=t.createElement("div");h.className="docx-hf",h.dataset.docxHf=c.kind,c.rId&&(h.dataset.docxRId=c.rId),p?(h.dataset.docxHfActive="",h.setAttribute("contenteditable","true")):h.setAttribute("contenteditable","false"),h.style.position="absolute",h.style.left=`${(c.box.x-e.box.x)*r.scale}px`,h.style.top=`${(c.box.y-e.box.y)*r.scale}px`,h.style.width=`${c.box.width*r.scale}px`;let g=W(c,e,p);h.style.height=`${g*r.scale}px`,h.style.overflow="visible";let k=(e.box.x-c.box.x)*r.scale,S=(e.box.y-c.box.y)*r.scale,v=k+e.box.width*r.scale,w=S+e.box.height*r.scale;h.style.clipPath=`polygon(${k}px ${S}px, ${v}px ${S}px, ${v}px ${w}px, ${k}px ${w}px)`;let M=Object.freeze({x:0,y:0,width:c.box.width,height:c.box.height}),x=y.filter(b=>!Xe(b)),m={...r,inertLinks:true};for(let b of c.fragments)h.append(b.kind==="table"?I(t,b,m):H(t,b,m));K(t,h,x,We(r),M,"inFront",p),i.append(h);let f=t.createElement("div");f.className="docx-hf-edit-hint",f.dataset.docxHfHint=c.kind,f.setAttribute("contenteditable","false"),f.style.position="absolute",f.style.left=h.style.left,f.style.width=h.style.width,f.style.top=c.kind==="header"?`${(c.box.y+c.box.height-e.box.y)*r.scale}px`:`${(c.box.y-e.box.y)*r.scale}px`,c.kind==="footer"&&(f.style.transform="translateY(-100%)"),i.append(f),Et(t,i,c,y,r,s,"inFront",p);}return nn(t,i,e,r),i}var Jt=30,Qt=36,en=16,tn=new Set(["dropdown","comboBox","date","checkbox"]);function nn(t,e,n,o){let a=o.contentControlChrome,r=a?.suppressedIds,i=(n.contentControls??[]).filter(y=>r?.has(y.id)!==true),s=[...i,...(a?.additionalBoundaries??[]).filter(y=>r?.has(y.id)!==true&&!i.some(p=>p.id===y.id))];if(s.length===0)return;let l=a?.showAll===true,d=a?.activeIds,u=a?.hoverIds,c=a?.tocControlIds;for(let y of s){let p=c?.has(y.id)===true,h=!p&&d?.has(y.id)===true,g=u?.has(y.id)===true;e.append(on(t,n,y,o.scale,h,g,l||h||p&&g,a?.checkedIds?.has(y.id),p,a?.readOnly===true));}}function on(t,e,n,o,a,r,i,s,l,d){let u=t.createElement("div");u.className="docx-content-control-chrome",u.dataset.docxContentControl=n.id,u.dataset.docxMarker="",u.dataset.controlType=n.controlType,u.dataset.lock=n.effectiveLock,n.bound&&(u.dataset.bound=""),n.placeholder&&(u.dataset.placeholder=""),l&&(u.dataset.docxToc=""),d&&(u.dataset.readOnly=""),a&&(u.dataset.active=""),r&&(u.dataset.hover=""),i&&(u.dataset.boundaryVisible=""),u.setAttribute("contenteditable","false"),u.setAttribute("role","group"),n.alias&&(u.dataset.alias=n.alias),n.tag&&(u.dataset.tag=n.tag),n.alias&&u.setAttribute("aria-label",n.alias),u.style.position="absolute",u.style.inset="0",u.style.pointerEvents="none",u.style.zIndex="2";let c=e.contentBox.x-e.box.x,y=e.contentBox.y-e.box.y;for(let h of n.fragments){if(h.pageIndex!==e.index)continue;let g=t.createElement("div");g.className="docx-content-control-boundary",g.dataset.docxMarker="",g.setAttribute("contenteditable","false"),g.setAttribute("aria-hidden","true"),g.style.position="absolute",g.style.left=`${(c+h.box.x)*o}px`,g.style.top=`${(y+h.box.y)*o}px`,g.style.width=`${Math.max(h.box.width,1)*o}px`,g.style.height=`${Math.max(h.box.height,1)*o}px`,g.style.pointerEvents="none",u.append(g);}let p=n.fragments.find(h=>h.pageIndex===e.index);if(p&&n.alias){let h=t.createElement("div");h.className="docx-content-control-label",h.dataset.docxMarker="",h.setAttribute("contenteditable","false"),h.setAttribute("aria-hidden","true"),h.textContent=n.alias,h.style.position="absolute",h.style.left=`${(c+p.box.x)*o}px`,h.style.top=`${Math.max(0,(y+p.box.y)*o-en)}px`,h.style.pointerEvents="none",u.append(h);}if(p&&tn.has(n.controlType)){let h=t.createElement("button");h.type="button",h.className="docx-content-control-widget",h.dataset.docxMarker="",h.dataset.docxCcWidget=n.controlType,h.dataset.docxCcId=n.id,h.setAttribute("contenteditable","false"),h.setAttribute("tabindex","-1"),n.controlType==="checkbox"?h.setAttribute("role","checkbox"):n.controlType==="dropdown"||n.controlType==="comboBox"?h.setAttribute("role","listbox"):n.controlType==="date"&&h.setAttribute("role","button"),n.alias&&(h.dataset.name=n.alias),n.alias&&h.setAttribute("aria-label",n.alias),n.controlType==="checkbox"&&(h.setAttribute("data-checked",s?"true":"false"),h.setAttribute("aria-checked",s?"true":"false"));let g=n.effectiveLock==="contentLocked"||n.effectiveLock==="sdtContentLocked";(d||g||n.bound)&&(h.disabled=true,h.dataset.disabledReason=d?"readOnly":n.bound?"bound":"locked",h.setAttribute("aria-disabled","true")),h.style.position="absolute",h.style.left=`${(c+p.box.x+p.box.width)*o-18}px`,h.style.top=`${(y+p.box.y)*o}px`,h.style.width="16px",h.style.height="16px",h.style.pointerEvents="auto",h.style.padding="0",h.style.margin="0",h.style.cursor=h.disabled?"not-allowed":"pointer",u.append(h);}return u}var Ke=new WeakMap;function rn(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function an(t,e){let n=Object.keys(t);if(n.length!==Object.keys(e).length)return false;for(let o of n){let a=t[o],r=e[o];if(a!==r)return false}return true}function sn(t,e){if(t.length!==e.length)return false;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return false;return true}function ln(t,e){if(t===e)return false;let n=new Set([...Object.keys(t),...Object.keys(e)]);for(let o of n){if(o==="fragments")continue;let a=t[o],r=e[o];if(a!==r&&!(Array.isArray(a)&&Array.isArray(r)&&sn(a,r))&&!(typeof a=="object"&&typeof r=="object"&&a!==null&&r!==null&&!Array.isArray(a)&&!Array.isArray(r)&&an(a,r)))return false}return true}var Ge="docx-column-separator";function dn(t,e,n,o){let a=e.content,r=e.blocks;if(!a||!r||a.parentElement!==e.element)return null;let i={...o,paintInstance:`p${n.index}`},s=new Map,l=[];for(let y of n.fragments){let p=r.get(y)??(y.kind==="table"?I(t,y,i):H(t,y,i));s.set(y,p),l.push(p);}let d=new Set(l),u=a.firstChild;for(;u;){let y=u.nextSibling,p=u;!d.has(p)&&p.classList?.contains(Ge)!==true&&u.remove(),u=y;}let c=a.firstChild;for(;c&&c.classList?.contains(Ge);)c=c.nextSibling;for(let y of l){if(y===c){c=c.nextSibling;continue}a.insertBefore(y,c);}return {record:n,materialized:true,element:e.element,content:a,blocks:s}}function cn(t,e,n,o){let a=t.element;return !t.materialized&&rn(t.record.box,e.box)&&a.style.left===`${e.box.x*n}px`&&a.style.top===`${e.box.y*n}px`&&a.style.width===`${e.box.width*n}px`&&a.style.height===`${e.box.height*n}px`&&a.getAttribute("aria-hidden")===(o?"true":null)}function un(t,e,n={}){let o=n.contentControlChrome,a=o?`${o.showAll===true?"1":"0"}:${o.activeIds?[...o.activeIds].sort().join(","):""}:${o.checkedIds?[...o.checkedIds].sort().join(","):""}:${o.tocControlIds?[...o.tocControlIds].sort().join(","):""}:${o.suppressedIds?[...o.suppressedIds].sort().join(","):""}:${o.readOnly===true?"ro":""}`:"",r=n.drawingStrings??Y,i=n.imageUrlPort!==void 0?we(t,n.imageUrlPort):null,s=o?.additionalBoundaries?o.additionalBoundaries.flatMap(f=>f.fragments.map(b=>`${f.id}:${b.pageIndex}:${b.box.x}:${b.box.y}:${b.box.width}:${b.box.height}`)).sort().join(","):"",l=n.readOnlyParagraphIds?[...n.readOnlyParagraphIds].sort().join(","):"",d=n.emptyTocPlaceholderIds?[...n.emptyTocPlaceholderIds].sort().join(","):"",u=o?.tocControlIds?[...o.tocControlIds].sort().join(","):"",c=pe(n.revisionStyles,e),y={scale:n.scale??96/72,ariaHidden:n.ariaHidden??true,drawingStrings:r,urlRegistry:i,...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.readOnlyParagraphIds?{readOnlyParagraphIds:n.readOnlyParagraphIds}:{},...n.emptyTocPlaceholderIds?{emptyTocPlaceholderIds:n.emptyTocPlaceholderIds}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},...n.fieldShading?{fieldShading:n.fieldShading}:{},...n.shadeFormFields!==void 0?{shadeFormFields:n.shadeFormFields}:{},...c?{revisionStyles:c}:{},...n.imageUrlPort?{imageUrlPort:n.imageUrlPort}:{},...n.activeHeaderFooterRId?{activeHeaderFooterRId:n.activeHeaderFooterRId}:{},...n.activeHeaderFooterPageIndex!==void 0?{activeHeaderFooterPageIndex:n.activeHeaderFooterPageIndex}:{},...o?{contentControlChrome:o}:{}},p=t.ownerDocument,h=`${y.scale}|${y.ariaHidden}|${y.fontAlias?wt(y.fontAlias):""}|${y.defaultFontFamily??""}|cc:${a}:${s}|toc:${u}|ro:${l}|tocEmpty:${d}|${n.imageUrlPort?"url":""}|${Ie(r)}|rev:${fe(c)}`,g=Ke.get(t),k=g?.parameters===h,S=k?new Map(g.pages.map(f=>[f.record,f])):null,v=g?new Map(g.pages.map(f=>[f.record.index,f])):null,w=e.pages.map(f=>{let b=n.materialize?.has(f.index)??true,R=S?.get(f);if(R&&R.materialized===b)return R;let P=v?.get(f.index);if(!b&&P&&cn(P,f,y.scale,y.ariaHidden))return {record:f,materialized:false,element:P.element};if(k&&b&&P?.materialized&&ln(P.record,f)){let te=dn(p,P,f,y);if(te)return te}let A={},ee=Zt(p,f,y,b,A);return {record:f,materialized:b,element:ee,...A.content?{content:A.content}:{},...A.blocks?{blocks:A.blocks}:{}}});Ke.set(t,{parameters:h,pages:w}),t.dataset.revision=String(e.revision),i&&i.reconcile(Me(e),He(e));let M=new Set(w.map(f=>f.element)),x=t.firstChild;for(;x;){let f=x.nextSibling;M.has(x)||x.remove(),x=f;}let m=t.firstChild;for(let f of w){if(f.element===m){m=m.nextSibling;continue}t.insertBefore(f.element,m);}me(w,y);}function yn(t,e,n,o){let a=t.ownerDocument,r=o.scale,i=[];for(let s of n){let l=e.pages[s.pageIndex];if(!l)continue;let d=a.createElement("div");d.className=s.className??o.className??"docx-cell-selection-rect",d.style.position="absolute";let u=o.pageOffsetX?.get(s.pageIndex)??0;d.style.left=`${(l.contentBox.x+s.x+u)*r}px`,d.style.top=`${(l.contentBox.y+s.y)*r}px`,d.style.width=`${s.width*r}px`,d.style.height=`${s.height*r}px`,s.reviewAuthor&&(d.dataset.reviewAuthor=s.reviewAuthor.author,d.dataset.reviewAuthorSlot=String(s.reviewAuthor.slot%$),d.style.setProperty("--doc-review-author-current",s.reviewAuthor.color)),i.push(d);}t.replaceChildren(...i);}
|
|
2
|
+
exports.a=he;exports.b=fn;exports.c=lt;exports.d=pn;exports.e=Rn;exports.f=Y;exports.g=Sn;exports.h=J;exports.i=un;exports.j=yn;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkDY3QVCWC_cjs=require('./chunk-DY3QVCWC.cjs'),fflate=require('fflate');var Ft=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],Lt=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,Bt=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function ot(e){return Lt.test(e)||Bt.test(e)}function J(e,t){if(!ot(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 Ut=/^(\d+)\.(\d+)\.(\d+)$/;function S(e){let t=Ut.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 q(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 Q(e,t){let n=S(e),r=t.trim();if(r==="*")return true;if(r.startsWith("^")){let o=S(r.slice(1));return q(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 s=true;for(let a of o){let i=a.startsWith(">=")?">=":a.startsWith("<")?"<":null;if(!i)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let d=S(a.slice(i.length)),l=q(n,d);i===">="?s=s&&l>=0:s=s&&l<0;}return s}return q(n,S(r))===0}var h=class extends Error{constructor(n,r,o=[]){super(r);this.code=n;this.responsible=o;this.name="RegistryError";}code;responsible},$e=(e,t)=>`${e}:${t}`;function Ht(e,t={}){let n=new Map;for(let l of e){if(J(l.id,"extension"),it(l.version,l.id),n.has(l.id))throw new h("duplicate-extension",`duplicate extension id ${l.id}`,[l.id]);n.set(l.id,l);for(let c of l.contributions)J(c.id,c.kind),it(c.version,`${l.id} \u2192 ${c.id}`),c.replaces&&Xt(c.replaces.targetRange,`${l.id} \u2192 replaces ${c.replaces.targetId}`);}for(let l of e){for(let c of l.dependencies??[])if(!n.has(c))throw new h("missing-dependency",`${l.id} requires missing extension ${c}`,[l.id,c]);for(let c of l.conflicts??[])if(n.has(c)){let p=[l.id,c].sort();throw new h("conflict",`extensions ${p[0]} and ${p[1]} conflict`,p)}}jt(n);let r=new Set(t.availablePorts??[]);for(let l of e)for(let c of l.contributions)c.kind==="runtimePort"&&r.add(c.id);for(let l of e)for(let c of l.requiredPorts??[])if(!r.has(c))throw new h("missing-port",`${l.id} requires unavailable port ${c}`,[l.id,c]);let o=new Map,s=new Map,a=new Map;for(let l of e)for(let c of l.contributions){let p=$e(c.kind,c.id);if(c.replaces){let u=$e(c.kind,c.replaces.targetId),m=a.get(u)??[];m.push({ext:l.id,c}),a.set(u,m);continue}if(s.has(p)){let u=[o.get(p),l.id].sort();throw new h("id-collision",`${c.kind} id ${c.id} registered by both ${u[0]} and ${u[1]}`,u)}s.set(p,c),o.set(p,l.id);}let i=new Map(s);for(let[l,c]of a){let p=s.get(l);if(!p){let f=c[0];throw new h("replacement-target-missing",`${f.ext} replaces missing target ${f.c.replaces.targetId}`,[f.ext,f.c.replaces.targetId])}let u=p.replaceable??{kind:"none"};for(let{ext:f,c:y}of c){if(!Q(p.version,y.replaces.targetRange))throw new h("replacement-version-mismatch",`${f} replaces ${y.replaces.targetId}@${p.version} outside range ${y.replaces.targetRange}`,[f,y.replaces.targetId]);if(u.kind==="none")throw new h("unauthorized-replacement",`${y.replaces.targetId} does not authorize replacement (attempted by ${f})`,[f,y.replaces.targetId])}let m=Vt(p,c);i.set(l,m);}return {extensions:n,contributions:i,get:(l,c)=>i.get($e(l,c))}}function Vt(e,t){let n=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(n.kind==="priority"){let o=[...t].sort((i,d)=>(d.c.replaces.priority??0)-(i.c.replaces.priority??0)),s=o[0].c.replaces.priority??0,a=o.filter(i=>(i.c.replaces.priority??0)===s);if(a.length>1){let i=a.map(d=>d.ext).sort();throw new h("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${s}: ${i.join(", ")}`,i)}return o[0].c}let r=t.map(o=>o.ext).sort();throw new h("ambiguous-replacement",`multiple replacers of ${e.id}: ${r.join(", ")}`,r)}function jt(e){let o=new Map,s=[],a=i=>{o.set(i,1),s.push(i);let d=[...e.get(i)?.dependencies??[]].sort();for(let l of d){let c=o.get(l)??0;if(c===1){let p=s.indexOf(l),u=[...s.slice(p),l];throw new h("dependency-cycle",`dependency cycle: ${u.join(" -> ")}`,u)}c===0&&a(l);}s.pop(),o.set(i,2);};for(let i of [...e.keys()].sort())(o.get(i)??0)===0&&a(i);}function it(e,t){try{S(e);}catch{throw new h("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function Xt(e,t){try{Q("0.0.0",e);}catch{throw new h("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var v=class extends Error{constructor(t){super(t),this.name="BudgetError";}},B=class e{constructor(t,n){this.label=t;this.capacity=n;this.used=new chunkDY3QVCWC_cjs.H(`${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 v(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new v(`${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 v(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new v(`${this.label}: budget already released`)}};var Z=class extends Error{constructor(n,r){super(r?`cancelled: ${r}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},U=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 Z(t.derivedOnly,t._reason)}}}};var ee=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},De=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 ee(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(chunkDY3QVCWC_cjs.x.clock)}identity(){return this.resolve(chunkDY3QVCWC_cjs.x.identity)}},Me=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}},Fe=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function Kt(e){let t=chunkDY3QVCWC_cjs.C(e.limits),n=Object.freeze({...e.config??{}}),r=e.capacity??t.maxDecompressedBytes,o=e.id??"op",s={id:o,limits:t,config:n,ports:e.ports,budget:new B(`op:${o}`,r),cancellation:new U};return Object.freeze(s)}function Gt(e){e.budget.dispose();}var Be=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"}}),at=Object.keys(Be);function zt(e,t){return new chunkDY3QVCWC_cjs.H(`${Be[t].phase}:${t}`,e[t])}var Le=class{counter;current=0;peak=0;constructor(t){this.counter=new chunkDY3QVCWC_cjs.H("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 Wt(){for(let e of at){let t=chunkDY3QVCWC_cjs.B[e],n=chunkDY3QVCWC_cjs.A[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 H(e,t=new Set){let n=new WeakSet,r=o=>{if(o===null)return "null";let s=typeof o;if(s==="boolean")return o?"true":"false";if(s==="number"){let a=o;if(!Number.isFinite(a))throw new Error(`non-finite number is not comparable: ${a}`);return Object.is(a,-0)?"0":String(a)}if(s==="string")return JSON.stringify(o);if(s==="bigint")return `${o.toString()}n`;if(Array.isArray(o))return `[${o.map(r).join(",")}]`;if(s==="object"){let a=o;if(n.has(a))throw new Error("cannot canonicalize a cyclic structure");n.add(a);let d=Object.keys(a).filter(l=>!t.has(l)).sort().map(l=>`${JSON.stringify(l)}:${r(a[l])}`).join(",");return n.delete(a),`{${d}}`}throw new Error(`unsupported value type in comparator input: ${s}`)};return r(e)}function Ue(e,t){let n=H(e,t),r=0xcbf29ce484222325n,o=0x100000001b3n,s=0xffffffffffffffffn;for(let a=0;a<n.length;a++)r^=BigInt(n.charCodeAt(a)),r=r*o&s;return r.toString(16).padStart(16,"0")}var R="dev.docx-editor.core.comparator",He={authoredState:{id:`${R}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${R}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${R}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${R}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${R}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${R}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${R}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${R}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${R}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${R}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function Ve(e,t,n,r={}){let o=He[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:st(t,n,r.epsilon)}}case "exact":case "canonical-exact":{let s=o.mode==="canonical-exact"?new Set(o.ephemera):new Set,a=H(t,s),i=H(n,s);return a===i?{equal:true}:{equal:false,left:a,right:i}}}}function je(e,t){let n=He[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 Ue(t,r)}function st(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)=>st(r,t[o],n)):false}var ct=new Set([...chunkDY3QVCWC_cjs.u,...chunkDY3QVCWC_cjs.v]),lt=/^[0-9a-f]{16}$/,Yt=/^[0-9a-f]*$/;function Xe(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,s)=>{let a=`step[${s}]`;ct.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 i=o.expect;i.outcome==="applied"?(i.committedRevision===void 0?n(`${a}: applied step needs committedRevision`):i.committedRevision<=o.baseRevision?n(`${a}: committedRevision ${i.committedRevision} must exceed baseRevision ${o.baseRevision}`):r=i.committedRevision,i.modelChange&&Jt(i.modelChange,a,n)):(i.committedRevision!==void 0&&n(`${a}: ${i.outcome} step must not commit a revision`),i.authoredStateHash!==void 0&&n(`${a}: ${i.outcome} step must not change authored state`)),i.authoredStateHash!==void 0&&!lt.test(i.authoredStateHash)&&n(`${a}: authoredStateHash must be 16-hex`),i.outputHash!==void 0&&!lt.test(i.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}`),Yt.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 Jt(e,t,n){ct.has(e.origin)||n(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&n(`${t}: modelChange revision must advance`);}function qt(e,t){let n=Xe(e);if(!n.valid)return {ok:false,mismatches:n.errors};let r=[];return t.init(e),e.steps.forEach((o,s)=>{let a=`step[${s}]`,i=t.applyStep(o),d=o.expect;if(i.outcome!==d.outcome){r.push(`${a}: outcome ${i.outcome} != expected ${d.outcome}`);return}if(d.outcome==="applied"&&(i.committedRevision!==d.committedRevision&&r.push(`${a}: revision ${i.committedRevision} != expected ${d.committedRevision}`),d.authoredStateHash!==void 0))if(i.authoredState===void 0)r.push(`${a}: store returned no authored state to hash`);else {Ve("authoredState",i.authoredState,i.authoredState).equal||r.push(`${a}: authored state is not self-consistent`);let c=dt(i.authoredState);c!==d.authoredStateHash&&r.push(`${a}: authoredStateHash ${c} != expected ${d.authoredStateHash}`);}}),{ok:r.length===0,mismatches:r}}function dt(e){return je("authoredState",e)}var Qt=new Map([["embedRegular","regular"],["embedBold","bold"],["embedItalic","italic"],["embedBoldItalic","boldItalic"]]),Zt=32;function mt(e,t){let n=t.replace(/[^0-9a-fA-F]/g,"");if(n.length!==32)return null;let r=new Uint8Array(16);for(let a=0;a<16;a+=1){let i=Number.parseInt(n.slice(a*2,a*2+2),16);if(Number.isNaN(i))return null;r[15-a]=i;}let o=new Uint8Array(e),s=Math.min(Zt,o.length);for(let a=0;a<s;a+=1)o[a]=o[a]^r[a%16];return o}var Ke=(e,t)=>{if(!(e.kind==="textValue"||!("attributes"in e))){for(let n of e.attributes??[])if(n.localName===t)return n.value}},pt=e=>e.kind==="textValue"?[]:e.children??[],ut=e=>e.kind==="textValue"||!("localName"in e)?"":e.localName;function en(e,t,n){for(let r of e.relationships.get(t)??[]){if(r.id!==n)continue;if(r.targetMode==="External")return null;let o=chunkDY3QVCWC_cjs.r(t,r.rawTarget);return o.ok?o.partName:null}return null}function tn(e,t,n={}){if(!t)return [];let r=n.maxFontBytes??16*1024*1024,o=n.maxFonts??64,s=[],a=new Map,i=d=>{if(!(s.length>=o)){if(ut(d)==="font"){let l=Ke(d,"name");if(l&&l.length<=128)for(let c of pt(d)){if(s.length>=o)return;let p=Qt.get(ut(c));if(!p)continue;let u=Ke(c,"id"),m=Ke(c,"fontKey");if(!u||!m)continue;let f=en(e,t.name,u);if(!f)continue;let y=e.partBytes.get(f);if(!y||y.length===0||y.length>r)continue;let g=a.get(f);if(g){s.push({family:l,style:p,bytes:g,partName:f});continue}let O=mt(y,m);O&&(a.set(f,O),s.push({family:l,style:p,bytes:O,partName:f}));}}for(let l of pt(d))i(l);}};return i(t.root),s}function ft(e){if(e.kind!=="textValue")for(let t of e.children){if(t.kind==="textValue")continue;if(t.kind==="hyperlink"){let r=chunkDY3QVCWC_cjs.Sa(t);if(r!==void 0&&r.length>0)return r}let n=ft(t);if(n!==void 0)return n}}function nn(e){let t="",n=false,r=o=>{if(!(n||o.kind==="textValue")){if(o.kind==="tab"||o.localName==="ptab"||o.localName==="tab"){n=true;return}if(o.kind==="text"||o.localName==="t"){for(let s of o.children)s.kind==="textValue"&&(t+=s.value);return}for(let s of o.children)r(s);}};return r(e),chunkDY3QVCWC_cjs.Hc(t)}function rn(e,t,n,r){let o=n.filter(d=>{if(r.has(d.blockId))return false;let l=d.level+1;return l>=t.instruction.outlineStart&&l<=t.instruction.outlineEnd}),s=new Set(o.map(d=>d.blockId)),a=chunkDY3QVCWC_cjs.Cc(e),i=new Map;for(let d of o){let l=chunkDY3QVCWC_cjs.Hc(d.text),c=i.get(l);c?c.push(d.blockId):i.set(l,[d.blockId]);}return t.resultParagraphIds.map(d=>{let l=chunkDY3QVCWC_cjs.Fa(e,d);if(!l||l.kind==="textValue")return null;let c=ft(l),p=c===void 0?void 0:a.get(c);if(p&&s.has(p.paragraphId)){let f=i.get(chunkDY3QVCWC_cjs.Hc(o.find(g=>g.blockId===p.paragraphId)?.text??"")),y=f?.indexOf(p.paragraphId)??-1;return f&&y>=0&&f.splice(y,1),p.paragraphId}let u=nn(l);if(u.length===0)return null;let m=i.get(u);return !m||m.length===0?null:m.shift()??null})}function C(e){return e.namespaceUri===chunkDY3QVCWC_cjs.ma?e.localName:`{${e.namespaceUri}}${e.localName}`}function I(e){let t=[];for(let n of e.attributes)t.push(n.namespaceUri===""||n.namespaceUri===chunkDY3QVCWC_cjs.ma?`${n.localName}=${n.value}`:`{${n.namespaceUri}}${n.localName}=${n.value}`);return t.sort(),t}function gt(e,t){let n=I(e),r=n.length>0?`${C(e)}(${n.join(",")})`:C(e);if(t>=chunkDY3QVCWC_cjs.ca)return r;let o=[];for(let s of e.children){if(s.kind==="textValue"){s.value!==""&&o.push(`#${s.value}`);continue}o.push(gt(s,t+1));}return o.sort(),o.length>0?`${r}[${o.join(",")}]`:r}function yt(e){if(!e)return [];let t=[];for(let n of e.children)n.namespaceUri===chunkDY3QVCWC_cjs.ma&&t.push(gt(n,1));return t.sort(),t}function Ge(e){if(e.kind==="textValue")return e.value;if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkDY3QVCWC_cjs._b(e);if(e.kind==="drawing")return chunkDY3QVCWC_cjs.mc();if(e.kind==="runProperties"||e.kind==="paragraphProperties"||e.kind==="generic")return "";if(e.kind==="hyperlink"||chunkDY3QVCWC_cjs.Lb(e)){let n="",r=e.kind==="hyperlink"?e.children:chunkDY3QVCWC_cjs.Nb(e)??[];for(let o of r)n+=Ge(o);return n}let t="";for(let n of e.children)t+=Ge(n);return t}function x(e,t){let n=new Map(e);for(let r of t.namespaceBindings)n.set(r.prefix,r.namespaceUri);return n}function V(e,t){try{return chunkDY3QVCWC_cjs.wa(e,t)}catch(n){if(n instanceof chunkDY3QVCWC_cjs.qa&&n.reason==="undeclared-prefix")return `generic-refusal:undeclared-prefix:{${e.namespaceUri}}${e.localName}`;throw n}}function ze(e,t,n=chunkDY3QVCWC_cjs.va){if(e.kind==="textValue")return;if(e.kind==="runProperties"||e.kind==="paragraphProperties"){let o=x(n,e),s=[];for(let a of e.children)a.namespaceUri!==chunkDY3QVCWC_cjs.ma&&s.push(V(a,o));s.sort(),t.push(...s);return}if(e.kind==="generic"){t.push(V(e,n));return}if(chunkDY3QVCWC_cjs.Lb(e)){t.push(chunkDY3QVCWC_cjs.xa(e));return}if(e.kind==="bookmarkStart"||e.kind==="bookmarkEnd"){t.push(chunkDY3QVCWC_cjs.wa(e,n));return}if(e.kind==="drawing"){t.push(ht(e));return}if(chunkDY3QVCWC_cjs.la(e.kind))return;let r=x(n,e);for(let o of e.children)ze(o,t,r);}function on(e){return `hyperlink(${e.attributes.map(n=>`${n.namespaceUri}|${n.localName}=${n.value}`).sort().join(",")})`}function an(e){for(let t of e.children)if(t.kind==="pictureBlipFill")for(let n of t.children){if(n.kind!=="pictureBlip")continue;let r=n.attributes.find(s=>s.localName==="embed"&&s.namespaceUri===chunkDY3QVCWC_cjs.pa)?.value,o=n.attributes.find(s=>s.localName==="link"&&s.namespaceUri===chunkDY3QVCWC_cjs.pa)?.value;if(r!==void 0)return `embed=${r}`;if(o!==void 0)return `link=${o}`}}function te(e,t,n){if(e.kind==="textValue")return `#${e.value}`;if(t>=chunkDY3QVCWC_cjs.ca)return C(e);let r=x(n,e);if(e.kind==="generic")return V(e,r);let o=I(e),s=o.length>0?`${C(e)}(${o.join(",")})`:C(e),a=[];for(let i of e.children)i.kind!=="textValue"&&a.push(te(i,t+1,r));return a.sort(),a.length>0?`${s}[${a.join(",")}]`:s}function sn(e,t,n){let r=x(n,e),o=[];for(let s of e.children)if(s.kind!=="textValue"){if(s.kind==="pictureBlipFill"){let a=s.children,i=a.find(l=>l.kind==="pictureBlip"),d=a.filter(l=>l.kind!=="pictureBlip").map(l=>te(l,t+1,r));if(d.sort(),i&&i.kind==="pictureBlip"){let l=I(i),c=l.length>0?`pictureBlip(${l.join(",")})`:"pictureBlip";o.push(d.length>0?`${c}[${d.join(",")}]`:c);}else for(let l of a)o.push(te(l,t+1,r));continue}o.push(te(s,t+1,r));}return o.sort(),o}function We(e,t,n){if(e.kind==="textValue")return `#${e.value}`;if(t>=chunkDY3QVCWC_cjs.ca)return C(e);let r=x(n,e);if(e.kind==="drawingDocPr"){let i=I(e);return i.length>0?`docPr(${i.join(",")})`:"docPr"}if(e.kind==="picture"){let i=an(e),d=sn(e,t+1,r),l=i===void 0?"picture":`picture(${i})`;return d.length>0?`${l}[${d.join(",")}]`:l}let o=I(e),s=o.length>0?`${C(e)}(${o.join(",")})`:C(e),a=[];for(let i of e.children){if(i.kind==="picture"){a.push(We(i,t+1,r));continue}if(i.kind==="generic"){a.push(V(i,r));continue}i.kind!=="textValue"&&a.push(We(i,t+1,r));}return a.length>0?`${s}[${a.join(",")}]`:s}function ht(e){let t=x(chunkDY3QVCWC_cjs.va,e),n=e.children.find(i=>i.kind==="inlineDrawing"||i.kind==="anchoredDrawing");if(!n||n.kind==="textValue")return `drawing(${I(e).join(",")})`;let r=x(t,n),o=I(n),s=o.length>0?`${n.kind}(${o.join(",")})`:n.kind,a=[];for(let i of n.children){if(i.kind==="generic"){a.push(V(i,r));continue}i.kind!=="textValue"&&a.push(We(i,1,r));}return a.length>0?`drawing[${s};${a.join(";")}]`:`drawing[${s}]`}function ln(e,t,n){let r=e.children.find(c=>c.kind==="paragraphProperties"),o=[],s="",a=[],i=x(chunkDY3QVCWC_cjs.va,e),d=(c,p)=>{if(c.kind==="run"){let u=x(p,c),m=c.children.find(f=>f.kind==="runProperties");o.push(yt(m)),s+=Ge(c);for(let f of c.children)ze(f,a,u);return}if(c.kind==="drawing"){a.push(ht(c));return}if(c.kind==="hyperlink"){a.push(on(c));let u=x(p,c);for(let m of c.children)d(m,u);return}if(c.kind==="contentControl"){a.push(chunkDY3QVCWC_cjs.xa({...c,children:c.children.filter(m=>m.kind!=="contentControlContent")}));let u=x(p,c);for(let m of c.children){if(m.kind!=="contentControlContent")continue;let f=x(u,m);for(let y of m.children)d(y,f);}return}ze(c,a,p);};for(let c of e.children)d(c,i);let l=chunkDY3QVCWC_cjs.Oc(e);return {ordinal:t,path:n,paraId:l===null?null:l.toUpperCase(),text:s,paragraphProperties:yt(r),runProperties:o,genericStructure:a}}function cn(e){if(e.localName==="hdr"||e.localName==="ftr"||e.kind==="body")return e;for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="body"||t.localName==="hdr"||t.localName==="ftr"))return t;return e}function xt(e,t,n,r,o,s){if(s>chunkDY3QVCWC_cjs.ca)return;let a=0;for(let i of e.children){if(i.kind==="textValue"){i.value.trim()!==""&&o.push(`${t}/#text ${i.value}`);continue}let d=t===""?String(a):`${t}/${a}`;if(a+=1,i.kind==="paragraph"){n.push(i),r.push(d),o.push(`${d} p`);continue}let l=I(i);o.push(l.length>0?`${d} ${C(i)}(${l.join(",")})`:`${d} ${C(i)}`),xt(i,d,n,r,o,s+1);}}function Nt(e){let t=cn(e.root),n=[],r=[],o=[];xt(t,"",n,r,o,0);let s=n.map((a,i)=>ln(a,i,r[i]));return {partName:e.name,paragraphs:s,structure:o}}function dn(e){let t=[];for(let n of e){let r=Nt(n);r&&t.push(r);}return {stories:t}}function pn(e,t){let n=[],r=(s,a,i)=>{n.push({path:s,before:JSON.stringify(a)??"undefined",after:JSON.stringify(i)??"undefined"});};e.stories.length!==t.stories.length&&r("stories.length",e.stories.length,t.stories.length);let o=Math.min(e.stories.length,t.stories.length);for(let s=0;s<o;s+=1){let a=e.stories[s],i=t.stories[s],d=p=>`${a.partName}${p}`;a.paragraphs.length!==i.paragraphs.length&&r(d(".paragraphs.length"),a.paragraphs.length,i.paragraphs.length);let l=Math.min(a.paragraphs.length,i.paragraphs.length);for(let p=0;p<l;p+=1){let u=a.paragraphs[p],m=i.paragraphs[p];u.text!==m.text&&r(d(`.p[${p}].text`),u.text,m.text),u.path!==m.path&&r(d(`.p[${p}].path`),u.path,m.path),u.paraId!==m.paraId&&r(d(`.p[${p}].paraId`),u.paraId,m.paraId),JSON.stringify(u.paragraphProperties)!==JSON.stringify(m.paragraphProperties)&&r(d(`.p[${p}].paragraphProperties`),u.paragraphProperties,m.paragraphProperties),JSON.stringify(u.runProperties)!==JSON.stringify(m.runProperties)&&r(d(`.p[${p}].runProperties`),u.runProperties,m.runProperties),JSON.stringify(u.genericStructure)!==JSON.stringify(m.genericStructure)&&r(d(`.p[${p}].genericStructure`),u.genericStructure,m.genericStructure);}a.structure.length!==i.structure.length&&r(d(".structure.length"),a.structure.length,i.structure.length);let c=Math.min(a.structure.length,i.structure.length);for(let p=0;p<c;p+=1)a.structure[p]!==i.structure[p]&&r(d(`.structure[${p}]`),a.structure[p],i.structure[p]);}return n}var j="http://schemas.openxmlformats.org/wordprocessingml/2006/main",fn="http://schemas.openxmlformats.org/package/2006/relationships",Ot="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",_="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",yn="application/vnd.openxmlformats-package.relationships+xml",gn="http://schemas.openxmlformats.org/package/2006/content-types",Rt="/[Content_Types].xml",E="/word/numbering.xml",Ct=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}],bt=["decimal","lowerLetter","lowerRoman"],Ye=9;function St(e,t){let n=720*(t+1),r='<w:start w:val="1"/>';if(e==="bullet"){let a=Ct[t%Ct.length];return `<w:lvl w:ilvl="${t}">${r}<w:numFmt w:val="bullet"/><w:lvlText w:val="${a.text}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${n}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${a.font}" w:hAnsi="${a.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=bt[t%bt.length],s=o==="lowerRoman";return `<w:lvl w:ilvl="${t}">${r}<w:numFmt w:val="${o}"/><w:lvlText w:val="%${t+1}."/><w:lvlJc w:val="${s?"right":"left"}"/><w:pPr><w:ind w:left="${n}" w:hanging="${s?180:360}"/></w:pPr></w:lvl>`}function hn(e,t){let n=Array.from({length:Ye},(r,o)=>St(e,o)).join("");return `<w:abstractNum w:abstractNumId="${t}"><w:multiLevelType w:val="${e==="bullet"?"hybridMultilevel":"multilevel"}"/>${n}</w:abstractNum>`}function xn(){let e=chunkDY3QVCWC_cjs.Ba(`<w:numbering xmlns:w="${j}"></w:numbering>`,{name:E,contentType:_});return e.ok?e.part:null}var b=(e,t)=>{let n=[];for(let r of e.children)r.kind==="textValue"||r.localName!==t||r.namespaceUri===j&&n.push(r);return n},N=(e,t)=>e.attributes.find(n=>n.localName===t)?.value;function vt(e,t){let n=chunkDY3QVCWC_cjs.Ba(`<w:numbering xmlns:w="${j}">${e}</w:numbering>`,{name:E,contentType:_});if(!n.ok)return null;let r=[];for(let o of n.part.root.children)o.kind!=="textValue"&&r.push(o);if(r.length!==t.length)return null;for(let o=0;o<t.length;o+=1){let s=r[o],a=t[o];if(s.namespaceUri!==j||s.localName!==a.localName||a.attribute&&N(s,a.attribute.localName)!==a.attribute.value)return null}return r}var Et=["numPicBullet","abstractNum","num","numIdMacAtCleanup"];function Pt(e,t,n){let r=t.indexOf(n);if(r===-1)return e.length;let o=0;return e.forEach((s,a)=>{if(s.kind==="textValue")return;let i=t.indexOf(s.localName);i!==-1&&i<=r&&(o=a+1);}),o}function It(e,t){let n=0;for(let r of e){let o=N(r,t);!o||!/^\d{1,9}$/.test(o)||(n=Math.max(n,Number(o)));}return n+1}function Nn(e,t){let n=e.parts.get(E),r=n??xn();if(!r)return null;let o=r.root,s=b(o,"abstractNum"),a=b(o,"num"),i=t==="bullet"?"bullet":"decimal";for(let O of a){let $=N(O,"numId"),qe=b(O,"abstractNumId")[0],Qe=qe?N(qe,"val"):void 0;if(!$||!Qe)continue;let Ze=s.find(X=>N(X,"abstractNumId")===Qe);if(!Ze)continue;let et=b(Ze,"lvl").find(X=>N(X,"ilvl")==="0"||N(X,"ilvl")===void 0),tt=et?b(et,"numFmt")[0]:void 0;if(tt&&N(tt,"val")===i)return {pkg:e,numId:$}}let d=It(s,"abstractNumId"),l=It(a,"numId"),c=vt(hn(t,d)+`<w:num w:numId="${l}"><w:abstractNumId w:val="${d}"/></w:num>`,[{localName:"abstractNum",attribute:{localName:"abstractNumId",value:String(d)}},{localName:"num",attribute:{localName:"numId",value:String(l)}}]);if(!c)return null;let p=chunkDY3QVCWC_cjs.Da(r),[u,m]=c.map(O=>ne(O,p));if(!u||!m)return null;let f=chunkDY3QVCWC_cjs.Ia(r,o.id,Pt(o.children,Et,"abstractNum"),[u]);if(!f.ok)return null;let y=chunkDY3QVCWC_cjs.Ia(f.part,o.id,Pt(f.part.root.children,Et,"num"),[m]);if(!y.ok)return null;let g=Object.freeze({...e,parts:new Map([...e.parts,[E,y.part]])});if(!n){let O=bn(g);if(!O)return null;let $=kn(O);if(!$)return null;g=$;}return {pkg:g,numId:String(l)}}var On=["nsid","multiLevelType","tmpl","name","styleLink","numStyleLink","lvl"];function Tt(e){let t=N(e,"ilvl");return t===void 0||!/^\d{1,9}$/.test(t)?null:Number(t)}function Rn(e,t){let n=0;return e.forEach((r,o)=>{if(r.kind!=="textValue"){if(r.localName==="lvl"&&r.namespaceUri===j){(Tt(r)??0)<t&&(n=o+1);return}On.includes(r.localName)&&(n=o+1);}}),n}function Cn(e,t,n,r){if(!Number.isInteger(n)||n<0||n>=Ye||t.length===0||t.length>64)return null;let o=e.parts.get(E);if(!o)return null;let s=o.root,a=b(s,"num").find(f=>N(f,"numId")===t),i=a?b(a,"abstractNumId")[0]:void 0,d=i?N(i,"val"):void 0;if(!d)return null;let l=b(s,"abstractNum").find(f=>N(f,"abstractNumId")===d);if(!l||b(l,"numStyleLink").length>0)return null;let c=b(l,"lvl");if(c.some(f=>Tt(f)===n))return e;if(c.length>=Ye)return null;let p=vt(St(r,n),[{localName:"lvl",attribute:{localName:"ilvl",value:String(n)}}]);if(!p)return null;let u=chunkDY3QVCWC_cjs.Da(o),m=chunkDY3QVCWC_cjs.Ia(o,l.id,Rn(l.children,n),[ne(p[0],u)]);return m.ok?Object.freeze({...e,parts:new Map([...e.parts,[E,m.part]])}):null}function ne(e,t){return e.kind==="textValue"?{...e,id:t()}:{...e,id:t(),children:e.children.map(n=>ne(n,t))}}function bn(e){let t=e.mainDocumentPart,n=En(t),r=e.parts.get(n),o=Pn(e),s=chunkDY3QVCWC_cjs.Ba(`<Relationships xmlns="${fn}"><Relationship Id="${o}" Type="${Ot}" Target="numbering.xml"/></Relationships>`,{name:n,contentType:yn});if(!s.ok)return null;let a=e.relationships.get(t)??[],i={ownerPart:t,id:o,type:Ot,rawTarget:"numbering.xml",targetMode:"Internal",order:a.reduce((u,m)=>Math.max(u,m.order),-1)+1},d=new Map([...e.relationships,[t,[...a,i]]]);if(!r)return Object.freeze({...e,parts:new Map([...e.parts,[n,s.part]]),relationships:d});let l=chunkDY3QVCWC_cjs.Da(r),c=s.part.root.children[0];if(!c)return null;let p=chunkDY3QVCWC_cjs.Ia(r,r.root.id,r.root.children.length,[ne(c,l)]);return p.ok?Object.freeze({...e,parts:new Map([...e.parts,[n,p.part]]),relationships:d}):null}function En(e){let t=e.lastIndexOf("/");return `${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function Pn(e){let t=0;for(let n of e.relationships.values())for(let r of n){let o=/^rId(\d{1,9})$/.exec(r.id);o&&(t=Math.max(t,Number(o[1])));}for(let n of e.externalTargets){let r=/^rId(\d{1,9})$/.exec(n.id);r&&(t=Math.max(t,Number(r[1])));}return `rId${t+1}`}var In=`<Override PartName="${E}" ContentType="${_}"/>`;function kn(e){let t=e.contentTypes.overrides.get(chunkDY3QVCWC_cjs.p(E));if(t===_)return e;if(t!==void 0)return null;let n=e.partBytes.get(Rt);if(!n)return null;let r=fflate.strFromU8(n),o=kt(r);if(!o)return null;let s=r.lastIndexOf(`</${o.rootName}>`);if(s===-1)return null;let a=r.slice(0,s)+In+r.slice(s),i=kt(a);if(!i||i.rootName!==o.rootName)return null;let d=[...o.children,wt("Override",{PartName:E,ContentType:_})];return i.children.length!==d.length||i.children.some((l,c)=>l!==d[c])?null:Object.freeze({...e,partBytes:new Map([...e.partBytes,[Rt,fflate.strToU8(a)]]),contentTypes:Object.freeze({defaults:e.contentTypes.defaults,overrides:new Map([...e.contentTypes.overrides,[chunkDY3QVCWC_cjs.p(E),_]])})})}function kt(e){let t=chunkDY3QVCWC_cjs.da(e);if(!t.ok)return null;let n=t.nodes.filter(i=>i.type==="element");if(n.length!==1)return null;let r=n[0],o=r.name.indexOf(":"),s=o===-1?"":r.name.slice(0,o);if(r.name.slice(o+1)!=="Types"||r.attributes[s?`xmlns:${s}`:"xmlns"]!==gn)return null;let a=[];for(let i of r.children)i.type==="element"&&a.push(wt(i.name,i.attributes));return {rootName:r.name,children:a}}function wt(e,t){let n=Object.entries(t).map(([r,o])=>`${r}=${o}`).sort();return [e,...n].join("")}function re(e){return e!=null&&e.kind!=="textValue"}function Je(e,t){for(let n of e.children)if(n.kind!=="textValue"&&n.namespaceUri===chunkDY3QVCWC_cjs.ma&&n.localName===t)return n;return null}function oe(e,t){for(let n of e.attributes)if(n.namespaceUri===chunkDY3QVCWC_cjs.ma&&n.localName===t)return n.value}function A(e,t){let n=Je(e,t);if(!n)return false;let r=oe(n,"val");return r===void 0?true:r!=="0"&&r!=="false"&&r!=="off"}var _t=Object.freeze({trackRevisions:false,restrictedToTrackedChanges:false,doNotTrackMoves:false,doNotTrackFormatting:false});function Sn(e){if(!re(e))return _t;let t=Je(e,"documentProtection"),n=t===null?void 0:oe(t,"enforcement"),r=n!==void 0&&n!=="0"&&n!=="false"&&n!=="off";return {trackRevisions:A(e,"trackRevisions"),restrictedToTrackedChanges:r&&t!==null&&oe(t,"edit")==="trackedChanges",doNotTrackMoves:A(e,"doNotTrackMoves"),doNotTrackFormatting:A(e,"doNotTrackFormatting")}}var At=Object.freeze({doNotShadeFormData:false});function vn(e){return re(e)?{doNotShadeFormData:A(e,"doNotShadeFormData")}:At}function Tn(e,t){let n=e.parts.get(t.storyPartName);if(!n)return {ok:false,reason:`no story part named ${t.storyPartName}`};let r=[];for(let d of chunkDY3QVCWC_cjs.te(n.root)){let l=chunkDY3QVCWC_cjs.re(d.node).tag;if(l===void 0||l.length===0)continue;let c=t.decide(l);c!=="keep"&&r.push({nodeId:d.node.id,policy:c});}let o=n,s=0,a=0;for(let{nodeId:d,policy:l}of r){let c=chunkDY3QVCWC_cjs.Ga(o,d);if(!c)continue;if(l==="remove"){let g=chunkDY3QVCWC_cjs.Ka(o,d,{deferValidation:true});if(!g.ok)return {ok:false,reason:`a node could not be removed: ${$t(g)}`};o=g.part,a+=1;continue}let p=c.children.find(g=>g.id===d);if(!p)continue;let u=chunkDY3QVCWC_cjs.pe(p),m=u?u.children:[],f=c.children.flatMap(g=>g.id===d?m:[g]),y=chunkDY3QVCWC_cjs.Ha(o,c.id,f,{deferValidation:true});if(!y.ok)return {ok:false,reason:`a node could not be unwrapped: ${$t(y)}`};o=y.part,s+=1;}let i=o===n?e:chunkDY3QVCWC_cjs.Ab(e,o);if(!i.parts.has(t.storyPartName))return {ok:false,reason:"the story went missing during the export"};for(let d of t.namespaces)for(let l of _n(i,t.storyPartName,d)){let c=chunkDY3QVCWC_cjs.if(i,l.itemId),p=chunkDY3QVCWC_cjs.cf(i,l.partName,c);if(p.pkg===i&&p.removed.length===0&&!wn(i,l.partName,c))return {ok:false,reason:`the payloads in ${d} could not be removed`};if(i=p.pkg,c.size>0)continue;let u=An(i,l);if(!u.ok)return {ok:false,reason:`the payload store for ${d} could not be removed`};i=u.pkg;}return {ok:true,pkg:i,unwrapped:s,removed:a}}function wn(e,t,n){return chunkDY3QVCWC_cjs._e(e,t).every(r=>n.has(r.id))}function $t(e){return e.issues.map(t=>t.code).join(", ")||"the edit was refused"}function _n(e,t,n){return chunkDY3QVCWC_cjs.We(e,t).filter(r=>r.namespaceUri===n)}function An(e,t){let n=chunkDY3QVCWC_cjs.Gb(e,t.partName);if(!n.ok)return {pkg:e,ok:false};let r=chunkDY3QVCWC_cjs.Gb(n.pkg,t.propsPartName);return r.ok?{pkg:r.pkg,ok:true}:{pkg:e,ok:false}}var ie="http://purl.org/dc/elements/1.1/",Dt="http://schemas.openxmlformats.org/package/2006/metadata/core-properties",Mt="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";var sp=Object.freeze({});function k(e,t,n){if(e.kind!=="textValue")for(let r of e.children){if(r.kind==="textValue"||r.namespaceUri!==t||r.localName!==n)continue;let o=r.children.find(a=>a.kind==="textValue");if(!o||o.kind!=="textValue")return;let s=o.value.trim();return s.length===0?void 0:s.length>4096?s.slice(0,4096):s}}function lp(e,t){let n={};if(e&&e.kind!=="textValue"){let r=k(e,ie,"title");r!==void 0&&(n.title=r);let o=k(e,ie,"creator");o!==void 0&&(n.creator=o);let s=k(e,ie,"subject");s!==void 0&&(n.subject=s);let a=k(e,ie,"description");a!==void 0&&(n.description=a);let i=k(e,Dt,"keywords");i!==void 0&&(n.keywords=i);let d=k(e,Dt,"lastModifiedBy");d!==void 0&&(n.lastModifiedBy=d);}if(t&&t.kind!=="textValue"){let r=k(t,Mt,"Company");r!==void 0&&(n.company=r);let o=k(t,Mt,"Manager");o!==void 0&&(n.manager=o);}return n}
|
|
2
|
-
exports.A=Ve;exports.B=je;exports.C=Xe;exports.D=qt;exports.E=dt;exports.F=mt;exports.G=tn;exports.H=rn;exports.I=Nt;exports.J=dn;exports.K=pn;exports.L=Nn;exports.M=Cn;exports.N=_t;exports.O=Sn;exports.P=At;exports.Q=vn;exports.R=
|
|
1
|
+
'use strict';var chunkWC3LI6FC_cjs=require('./chunk-WC3LI6FC.cjs'),fflate=require('fflate');var Ft=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],Lt=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,Bt=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function ot(e){return Lt.test(e)||Bt.test(e)}function J(e,t){if(!ot(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 Ut=/^(\d+)\.(\d+)\.(\d+)$/;function S(e){let t=Ut.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 q(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 Q(e,t){let n=S(e),r=t.trim();if(r==="*")return true;if(r.startsWith("^")){let o=S(r.slice(1));return q(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 s=true;for(let a of o){let i=a.startsWith(">=")?">=":a.startsWith("<")?"<":null;if(!i)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let d=S(a.slice(i.length)),l=q(n,d);i===">="?s=s&&l>=0:s=s&&l<0;}return s}return q(n,S(r))===0}var h=class extends Error{constructor(n,r,o=[]){super(r);this.code=n;this.responsible=o;this.name="RegistryError";}code;responsible},$e=(e,t)=>`${e}:${t}`;function Ht(e,t={}){let n=new Map;for(let l of e){if(J(l.id,"extension"),it(l.version,l.id),n.has(l.id))throw new h("duplicate-extension",`duplicate extension id ${l.id}`,[l.id]);n.set(l.id,l);for(let c of l.contributions)J(c.id,c.kind),it(c.version,`${l.id} \u2192 ${c.id}`),c.replaces&&Xt(c.replaces.targetRange,`${l.id} \u2192 replaces ${c.replaces.targetId}`);}for(let l of e){for(let c of l.dependencies??[])if(!n.has(c))throw new h("missing-dependency",`${l.id} requires missing extension ${c}`,[l.id,c]);for(let c of l.conflicts??[])if(n.has(c)){let p=[l.id,c].sort();throw new h("conflict",`extensions ${p[0]} and ${p[1]} conflict`,p)}}jt(n);let r=new Set(t.availablePorts??[]);for(let l of e)for(let c of l.contributions)c.kind==="runtimePort"&&r.add(c.id);for(let l of e)for(let c of l.requiredPorts??[])if(!r.has(c))throw new h("missing-port",`${l.id} requires unavailable port ${c}`,[l.id,c]);let o=new Map,s=new Map,a=new Map;for(let l of e)for(let c of l.contributions){let p=$e(c.kind,c.id);if(c.replaces){let u=$e(c.kind,c.replaces.targetId),m=a.get(u)??[];m.push({ext:l.id,c}),a.set(u,m);continue}if(s.has(p)){let u=[o.get(p),l.id].sort();throw new h("id-collision",`${c.kind} id ${c.id} registered by both ${u[0]} and ${u[1]}`,u)}s.set(p,c),o.set(p,l.id);}let i=new Map(s);for(let[l,c]of a){let p=s.get(l);if(!p){let f=c[0];throw new h("replacement-target-missing",`${f.ext} replaces missing target ${f.c.replaces.targetId}`,[f.ext,f.c.replaces.targetId])}let u=p.replaceable??{kind:"none"};for(let{ext:f,c:y}of c){if(!Q(p.version,y.replaces.targetRange))throw new h("replacement-version-mismatch",`${f} replaces ${y.replaces.targetId}@${p.version} outside range ${y.replaces.targetRange}`,[f,y.replaces.targetId]);if(u.kind==="none")throw new h("unauthorized-replacement",`${y.replaces.targetId} does not authorize replacement (attempted by ${f})`,[f,y.replaces.targetId])}let m=Vt(p,c);i.set(l,m);}return {extensions:n,contributions:i,get:(l,c)=>i.get($e(l,c))}}function Vt(e,t){let n=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(n.kind==="priority"){let o=[...t].sort((i,d)=>(d.c.replaces.priority??0)-(i.c.replaces.priority??0)),s=o[0].c.replaces.priority??0,a=o.filter(i=>(i.c.replaces.priority??0)===s);if(a.length>1){let i=a.map(d=>d.ext).sort();throw new h("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${s}: ${i.join(", ")}`,i)}return o[0].c}let r=t.map(o=>o.ext).sort();throw new h("ambiguous-replacement",`multiple replacers of ${e.id}: ${r.join(", ")}`,r)}function jt(e){let o=new Map,s=[],a=i=>{o.set(i,1),s.push(i);let d=[...e.get(i)?.dependencies??[]].sort();for(let l of d){let c=o.get(l)??0;if(c===1){let p=s.indexOf(l),u=[...s.slice(p),l];throw new h("dependency-cycle",`dependency cycle: ${u.join(" -> ")}`,u)}c===0&&a(l);}s.pop(),o.set(i,2);};for(let i of [...e.keys()].sort())(o.get(i)??0)===0&&a(i);}function it(e,t){try{S(e);}catch{throw new h("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function Xt(e,t){try{Q("0.0.0",e);}catch{throw new h("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var v=class extends Error{constructor(t){super(t),this.name="BudgetError";}},B=class e{constructor(t,n){this.label=t;this.capacity=n;this.used=new chunkWC3LI6FC_cjs.H(`${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 v(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new v(`${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 v(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new v(`${this.label}: budget already released`)}};var Z=class extends Error{constructor(n,r){super(r?`cancelled: ${r}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},U=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 Z(t.derivedOnly,t._reason)}}}};var ee=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},De=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 ee(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(chunkWC3LI6FC_cjs.x.clock)}identity(){return this.resolve(chunkWC3LI6FC_cjs.x.identity)}},Me=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}},Fe=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function Kt(e){let t=chunkWC3LI6FC_cjs.C(e.limits),n=Object.freeze({...e.config??{}}),r=e.capacity??t.maxDecompressedBytes,o=e.id??"op",s={id:o,limits:t,config:n,ports:e.ports,budget:new B(`op:${o}`,r),cancellation:new U};return Object.freeze(s)}function Gt(e){e.budget.dispose();}var Be=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"}}),at=Object.keys(Be);function zt(e,t){return new chunkWC3LI6FC_cjs.H(`${Be[t].phase}:${t}`,e[t])}var Le=class{counter;current=0;peak=0;constructor(t){this.counter=new chunkWC3LI6FC_cjs.H("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 Wt(){for(let e of at){let t=chunkWC3LI6FC_cjs.B[e],n=chunkWC3LI6FC_cjs.A[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 H(e,t=new Set){let n=new WeakSet,r=o=>{if(o===null)return "null";let s=typeof o;if(s==="boolean")return o?"true":"false";if(s==="number"){let a=o;if(!Number.isFinite(a))throw new Error(`non-finite number is not comparable: ${a}`);return Object.is(a,-0)?"0":String(a)}if(s==="string")return JSON.stringify(o);if(s==="bigint")return `${o.toString()}n`;if(Array.isArray(o))return `[${o.map(r).join(",")}]`;if(s==="object"){let a=o;if(n.has(a))throw new Error("cannot canonicalize a cyclic structure");n.add(a);let d=Object.keys(a).filter(l=>!t.has(l)).sort().map(l=>`${JSON.stringify(l)}:${r(a[l])}`).join(",");return n.delete(a),`{${d}}`}throw new Error(`unsupported value type in comparator input: ${s}`)};return r(e)}function Ue(e,t){let n=H(e,t),r=0xcbf29ce484222325n,o=0x100000001b3n,s=0xffffffffffffffffn;for(let a=0;a<n.length;a++)r^=BigInt(n.charCodeAt(a)),r=r*o&s;return r.toString(16).padStart(16,"0")}var R="dev.docx-editor.core.comparator",He={authoredState:{id:`${R}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${R}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${R}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${R}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${R}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${R}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${R}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${R}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${R}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${R}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function Ve(e,t,n,r={}){let o=He[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:st(t,n,r.epsilon)}}case "exact":case "canonical-exact":{let s=o.mode==="canonical-exact"?new Set(o.ephemera):new Set,a=H(t,s),i=H(n,s);return a===i?{equal:true}:{equal:false,left:a,right:i}}}}function je(e,t){let n=He[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 Ue(t,r)}function st(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)=>st(r,t[o],n)):false}var ct=new Set([...chunkWC3LI6FC_cjs.u,...chunkWC3LI6FC_cjs.v]),lt=/^[0-9a-f]{16}$/,Yt=/^[0-9a-f]*$/;function Xe(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,s)=>{let a=`step[${s}]`;ct.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 i=o.expect;i.outcome==="applied"?(i.committedRevision===void 0?n(`${a}: applied step needs committedRevision`):i.committedRevision<=o.baseRevision?n(`${a}: committedRevision ${i.committedRevision} must exceed baseRevision ${o.baseRevision}`):r=i.committedRevision,i.modelChange&&Jt(i.modelChange,a,n)):(i.committedRevision!==void 0&&n(`${a}: ${i.outcome} step must not commit a revision`),i.authoredStateHash!==void 0&&n(`${a}: ${i.outcome} step must not change authored state`)),i.authoredStateHash!==void 0&&!lt.test(i.authoredStateHash)&&n(`${a}: authoredStateHash must be 16-hex`),i.outputHash!==void 0&&!lt.test(i.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}`),Yt.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 Jt(e,t,n){ct.has(e.origin)||n(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&n(`${t}: modelChange revision must advance`);}function qt(e,t){let n=Xe(e);if(!n.valid)return {ok:false,mismatches:n.errors};let r=[];return t.init(e),e.steps.forEach((o,s)=>{let a=`step[${s}]`,i=t.applyStep(o),d=o.expect;if(i.outcome!==d.outcome){r.push(`${a}: outcome ${i.outcome} != expected ${d.outcome}`);return}if(d.outcome==="applied"&&(i.committedRevision!==d.committedRevision&&r.push(`${a}: revision ${i.committedRevision} != expected ${d.committedRevision}`),d.authoredStateHash!==void 0))if(i.authoredState===void 0)r.push(`${a}: store returned no authored state to hash`);else {Ve("authoredState",i.authoredState,i.authoredState).equal||r.push(`${a}: authored state is not self-consistent`);let c=dt(i.authoredState);c!==d.authoredStateHash&&r.push(`${a}: authoredStateHash ${c} != expected ${d.authoredStateHash}`);}}),{ok:r.length===0,mismatches:r}}function dt(e){return je("authoredState",e)}var Qt=new Map([["embedRegular","regular"],["embedBold","bold"],["embedItalic","italic"],["embedBoldItalic","boldItalic"]]),Zt=32;function mt(e,t){let n=t.replace(/[^0-9a-fA-F]/g,"");if(n.length!==32)return null;let r=new Uint8Array(16);for(let a=0;a<16;a+=1){let i=Number.parseInt(n.slice(a*2,a*2+2),16);if(Number.isNaN(i))return null;r[15-a]=i;}let o=new Uint8Array(e),s=Math.min(Zt,o.length);for(let a=0;a<s;a+=1)o[a]=o[a]^r[a%16];return o}var Ke=(e,t)=>{if(!(e.kind==="textValue"||!("attributes"in e))){for(let n of e.attributes??[])if(n.localName===t)return n.value}},pt=e=>e.kind==="textValue"?[]:e.children??[],ut=e=>e.kind==="textValue"||!("localName"in e)?"":e.localName;function en(e,t,n){for(let r of e.relationships.get(t)??[]){if(r.id!==n)continue;if(r.targetMode==="External")return null;let o=chunkWC3LI6FC_cjs.r(t,r.rawTarget);return o.ok?o.partName:null}return null}function tn(e,t,n={}){if(!t)return [];let r=n.maxFontBytes??16*1024*1024,o=n.maxFonts??64,s=[],a=new Map,i=d=>{if(!(s.length>=o)){if(ut(d)==="font"){let l=Ke(d,"name");if(l&&l.length<=128)for(let c of pt(d)){if(s.length>=o)return;let p=Qt.get(ut(c));if(!p)continue;let u=Ke(c,"id"),m=Ke(c,"fontKey");if(!u||!m)continue;let f=en(e,t.name,u);if(!f)continue;let y=e.partBytes.get(f);if(!y||y.length===0||y.length>r)continue;let g=a.get(f);if(g){s.push({family:l,style:p,bytes:g,partName:f});continue}let O=mt(y,m);O&&(a.set(f,O),s.push({family:l,style:p,bytes:O,partName:f}));}}for(let l of pt(d))i(l);}};return i(t.root),s}function ft(e){if(e.kind!=="textValue")for(let t of e.children){if(t.kind==="textValue")continue;if(t.kind==="hyperlink"){let r=chunkWC3LI6FC_cjs.Sa(t);if(r!==void 0&&r.length>0)return r}let n=ft(t);if(n!==void 0)return n}}function nn(e){let t="",n=false,r=o=>{if(!(n||o.kind==="textValue")){if(o.kind==="tab"||o.localName==="ptab"||o.localName==="tab"){n=true;return}if(o.kind==="text"||o.localName==="t"){for(let s of o.children)s.kind==="textValue"&&(t+=s.value);return}for(let s of o.children)r(s);}};return r(e),chunkWC3LI6FC_cjs.Hc(t)}function rn(e,t,n,r){let o=n.filter(d=>{if(r.has(d.blockId))return false;let l=d.level+1;return l>=t.instruction.outlineStart&&l<=t.instruction.outlineEnd}),s=new Set(o.map(d=>d.blockId)),a=chunkWC3LI6FC_cjs.Cc(e),i=new Map;for(let d of o){let l=chunkWC3LI6FC_cjs.Hc(d.text),c=i.get(l);c?c.push(d.blockId):i.set(l,[d.blockId]);}return t.resultParagraphIds.map(d=>{let l=chunkWC3LI6FC_cjs.Fa(e,d);if(!l||l.kind==="textValue")return null;let c=ft(l),p=c===void 0?void 0:a.get(c);if(p&&s.has(p.paragraphId)){let f=i.get(chunkWC3LI6FC_cjs.Hc(o.find(g=>g.blockId===p.paragraphId)?.text??"")),y=f?.indexOf(p.paragraphId)??-1;return f&&y>=0&&f.splice(y,1),p.paragraphId}let u=nn(l);if(u.length===0)return null;let m=i.get(u);return !m||m.length===0?null:m.shift()??null})}function C(e){return e.namespaceUri===chunkWC3LI6FC_cjs.ma?e.localName:`{${e.namespaceUri}}${e.localName}`}function I(e){let t=[];for(let n of e.attributes)t.push(n.namespaceUri===""||n.namespaceUri===chunkWC3LI6FC_cjs.ma?`${n.localName}=${n.value}`:`{${n.namespaceUri}}${n.localName}=${n.value}`);return t.sort(),t}function gt(e,t){let n=I(e),r=n.length>0?`${C(e)}(${n.join(",")})`:C(e);if(t>=chunkWC3LI6FC_cjs.ca)return r;let o=[];for(let s of e.children){if(s.kind==="textValue"){s.value!==""&&o.push(`#${s.value}`);continue}o.push(gt(s,t+1));}return o.sort(),o.length>0?`${r}[${o.join(",")}]`:r}function yt(e){if(!e)return [];let t=[];for(let n of e.children)n.namespaceUri===chunkWC3LI6FC_cjs.ma&&t.push(gt(n,1));return t.sort(),t}function Ge(e){if(e.kind==="textValue")return e.value;if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkWC3LI6FC_cjs._b(e);if(e.kind==="drawing")return chunkWC3LI6FC_cjs.mc();if(e.kind==="runProperties"||e.kind==="paragraphProperties"||e.kind==="generic")return "";if(e.kind==="hyperlink"||chunkWC3LI6FC_cjs.Lb(e)){let n="",r=e.kind==="hyperlink"?e.children:chunkWC3LI6FC_cjs.Nb(e)??[];for(let o of r)n+=Ge(o);return n}let t="";for(let n of e.children)t+=Ge(n);return t}function x(e,t){let n=new Map(e);for(let r of t.namespaceBindings)n.set(r.prefix,r.namespaceUri);return n}function V(e,t){try{return chunkWC3LI6FC_cjs.wa(e,t)}catch(n){if(n instanceof chunkWC3LI6FC_cjs.qa&&n.reason==="undeclared-prefix")return `generic-refusal:undeclared-prefix:{${e.namespaceUri}}${e.localName}`;throw n}}function ze(e,t,n=chunkWC3LI6FC_cjs.va){if(e.kind==="textValue")return;if(e.kind==="runProperties"||e.kind==="paragraphProperties"){let o=x(n,e),s=[];for(let a of e.children)a.namespaceUri!==chunkWC3LI6FC_cjs.ma&&s.push(V(a,o));s.sort(),t.push(...s);return}if(e.kind==="generic"){t.push(V(e,n));return}if(chunkWC3LI6FC_cjs.Lb(e)){t.push(chunkWC3LI6FC_cjs.xa(e));return}if(e.kind==="bookmarkStart"||e.kind==="bookmarkEnd"){t.push(chunkWC3LI6FC_cjs.wa(e,n));return}if(e.kind==="drawing"){t.push(ht(e));return}if(chunkWC3LI6FC_cjs.la(e.kind))return;let r=x(n,e);for(let o of e.children)ze(o,t,r);}function on(e){return `hyperlink(${e.attributes.map(n=>`${n.namespaceUri}|${n.localName}=${n.value}`).sort().join(",")})`}function an(e){for(let t of e.children)if(t.kind==="pictureBlipFill")for(let n of t.children){if(n.kind!=="pictureBlip")continue;let r=n.attributes.find(s=>s.localName==="embed"&&s.namespaceUri===chunkWC3LI6FC_cjs.pa)?.value,o=n.attributes.find(s=>s.localName==="link"&&s.namespaceUri===chunkWC3LI6FC_cjs.pa)?.value;if(r!==void 0)return `embed=${r}`;if(o!==void 0)return `link=${o}`}}function te(e,t,n){if(e.kind==="textValue")return `#${e.value}`;if(t>=chunkWC3LI6FC_cjs.ca)return C(e);let r=x(n,e);if(e.kind==="generic")return V(e,r);let o=I(e),s=o.length>0?`${C(e)}(${o.join(",")})`:C(e),a=[];for(let i of e.children)i.kind!=="textValue"&&a.push(te(i,t+1,r));return a.sort(),a.length>0?`${s}[${a.join(",")}]`:s}function sn(e,t,n){let r=x(n,e),o=[];for(let s of e.children)if(s.kind!=="textValue"){if(s.kind==="pictureBlipFill"){let a=s.children,i=a.find(l=>l.kind==="pictureBlip"),d=a.filter(l=>l.kind!=="pictureBlip").map(l=>te(l,t+1,r));if(d.sort(),i&&i.kind==="pictureBlip"){let l=I(i),c=l.length>0?`pictureBlip(${l.join(",")})`:"pictureBlip";o.push(d.length>0?`${c}[${d.join(",")}]`:c);}else for(let l of a)o.push(te(l,t+1,r));continue}o.push(te(s,t+1,r));}return o.sort(),o}function We(e,t,n){if(e.kind==="textValue")return `#${e.value}`;if(t>=chunkWC3LI6FC_cjs.ca)return C(e);let r=x(n,e);if(e.kind==="drawingDocPr"){let i=I(e);return i.length>0?`docPr(${i.join(",")})`:"docPr"}if(e.kind==="picture"){let i=an(e),d=sn(e,t+1,r),l=i===void 0?"picture":`picture(${i})`;return d.length>0?`${l}[${d.join(",")}]`:l}let o=I(e),s=o.length>0?`${C(e)}(${o.join(",")})`:C(e),a=[];for(let i of e.children){if(i.kind==="picture"){a.push(We(i,t+1,r));continue}if(i.kind==="generic"){a.push(V(i,r));continue}i.kind!=="textValue"&&a.push(We(i,t+1,r));}return a.length>0?`${s}[${a.join(",")}]`:s}function ht(e){let t=x(chunkWC3LI6FC_cjs.va,e),n=e.children.find(i=>i.kind==="inlineDrawing"||i.kind==="anchoredDrawing");if(!n||n.kind==="textValue")return `drawing(${I(e).join(",")})`;let r=x(t,n),o=I(n),s=o.length>0?`${n.kind}(${o.join(",")})`:n.kind,a=[];for(let i of n.children){if(i.kind==="generic"){a.push(V(i,r));continue}i.kind!=="textValue"&&a.push(We(i,1,r));}return a.length>0?`drawing[${s};${a.join(";")}]`:`drawing[${s}]`}function ln(e,t,n){let r=e.children.find(c=>c.kind==="paragraphProperties"),o=[],s="",a=[],i=x(chunkWC3LI6FC_cjs.va,e),d=(c,p)=>{if(c.kind==="run"){let u=x(p,c),m=c.children.find(f=>f.kind==="runProperties");o.push(yt(m)),s+=Ge(c);for(let f of c.children)ze(f,a,u);return}if(c.kind==="drawing"){a.push(ht(c));return}if(c.kind==="hyperlink"){a.push(on(c));let u=x(p,c);for(let m of c.children)d(m,u);return}if(c.kind==="contentControl"){a.push(chunkWC3LI6FC_cjs.xa({...c,children:c.children.filter(m=>m.kind!=="contentControlContent")}));let u=x(p,c);for(let m of c.children){if(m.kind!=="contentControlContent")continue;let f=x(u,m);for(let y of m.children)d(y,f);}return}ze(c,a,p);};for(let c of e.children)d(c,i);let l=chunkWC3LI6FC_cjs.Oc(e);return {ordinal:t,path:n,paraId:l===null?null:l.toUpperCase(),text:s,paragraphProperties:yt(r),runProperties:o,genericStructure:a}}function cn(e){if(e.localName==="hdr"||e.localName==="ftr"||e.kind==="body")return e;for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="body"||t.localName==="hdr"||t.localName==="ftr"))return t;return e}function xt(e,t,n,r,o,s){if(s>chunkWC3LI6FC_cjs.ca)return;let a=0;for(let i of e.children){if(i.kind==="textValue"){i.value.trim()!==""&&o.push(`${t}/#text ${i.value}`);continue}let d=t===""?String(a):`${t}/${a}`;if(a+=1,i.kind==="paragraph"){n.push(i),r.push(d),o.push(`${d} p`);continue}let l=I(i);o.push(l.length>0?`${d} ${C(i)}(${l.join(",")})`:`${d} ${C(i)}`),xt(i,d,n,r,o,s+1);}}function Nt(e){let t=cn(e.root),n=[],r=[],o=[];xt(t,"",n,r,o,0);let s=n.map((a,i)=>ln(a,i,r[i]));return {partName:e.name,paragraphs:s,structure:o}}function dn(e){let t=[];for(let n of e){let r=Nt(n);r&&t.push(r);}return {stories:t}}function pn(e,t){let n=[],r=(s,a,i)=>{n.push({path:s,before:JSON.stringify(a)??"undefined",after:JSON.stringify(i)??"undefined"});};e.stories.length!==t.stories.length&&r("stories.length",e.stories.length,t.stories.length);let o=Math.min(e.stories.length,t.stories.length);for(let s=0;s<o;s+=1){let a=e.stories[s],i=t.stories[s],d=p=>`${a.partName}${p}`;a.paragraphs.length!==i.paragraphs.length&&r(d(".paragraphs.length"),a.paragraphs.length,i.paragraphs.length);let l=Math.min(a.paragraphs.length,i.paragraphs.length);for(let p=0;p<l;p+=1){let u=a.paragraphs[p],m=i.paragraphs[p];u.text!==m.text&&r(d(`.p[${p}].text`),u.text,m.text),u.path!==m.path&&r(d(`.p[${p}].path`),u.path,m.path),u.paraId!==m.paraId&&r(d(`.p[${p}].paraId`),u.paraId,m.paraId),JSON.stringify(u.paragraphProperties)!==JSON.stringify(m.paragraphProperties)&&r(d(`.p[${p}].paragraphProperties`),u.paragraphProperties,m.paragraphProperties),JSON.stringify(u.runProperties)!==JSON.stringify(m.runProperties)&&r(d(`.p[${p}].runProperties`),u.runProperties,m.runProperties),JSON.stringify(u.genericStructure)!==JSON.stringify(m.genericStructure)&&r(d(`.p[${p}].genericStructure`),u.genericStructure,m.genericStructure);}a.structure.length!==i.structure.length&&r(d(".structure.length"),a.structure.length,i.structure.length);let c=Math.min(a.structure.length,i.structure.length);for(let p=0;p<c;p+=1)a.structure[p]!==i.structure[p]&&r(d(`.structure[${p}]`),a.structure[p],i.structure[p]);}return n}var j="http://schemas.openxmlformats.org/wordprocessingml/2006/main",fn="http://schemas.openxmlformats.org/package/2006/relationships",Ot="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",_="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",yn="application/vnd.openxmlformats-package.relationships+xml",gn="http://schemas.openxmlformats.org/package/2006/content-types",Rt="/[Content_Types].xml",E="/word/numbering.xml",Ct=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}],bt=["decimal","lowerLetter","lowerRoman"],Ye=9;function St(e,t){let n=720*(t+1),r='<w:start w:val="1"/>';if(e==="bullet"){let a=Ct[t%Ct.length];return `<w:lvl w:ilvl="${t}">${r}<w:numFmt w:val="bullet"/><w:lvlText w:val="${a.text}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${n}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${a.font}" w:hAnsi="${a.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=bt[t%bt.length],s=o==="lowerRoman";return `<w:lvl w:ilvl="${t}">${r}<w:numFmt w:val="${o}"/><w:lvlText w:val="%${t+1}."/><w:lvlJc w:val="${s?"right":"left"}"/><w:pPr><w:ind w:left="${n}" w:hanging="${s?180:360}"/></w:pPr></w:lvl>`}function hn(e,t){let n=Array.from({length:Ye},(r,o)=>St(e,o)).join("");return `<w:abstractNum w:abstractNumId="${t}"><w:multiLevelType w:val="${e==="bullet"?"hybridMultilevel":"multilevel"}"/>${n}</w:abstractNum>`}function xn(){let e=chunkWC3LI6FC_cjs.Ba(`<w:numbering xmlns:w="${j}"></w:numbering>`,{name:E,contentType:_});return e.ok?e.part:null}var b=(e,t)=>{let n=[];for(let r of e.children)r.kind==="textValue"||r.localName!==t||r.namespaceUri===j&&n.push(r);return n},N=(e,t)=>e.attributes.find(n=>n.localName===t)?.value;function vt(e,t){let n=chunkWC3LI6FC_cjs.Ba(`<w:numbering xmlns:w="${j}">${e}</w:numbering>`,{name:E,contentType:_});if(!n.ok)return null;let r=[];for(let o of n.part.root.children)o.kind!=="textValue"&&r.push(o);if(r.length!==t.length)return null;for(let o=0;o<t.length;o+=1){let s=r[o],a=t[o];if(s.namespaceUri!==j||s.localName!==a.localName||a.attribute&&N(s,a.attribute.localName)!==a.attribute.value)return null}return r}var Et=["numPicBullet","abstractNum","num","numIdMacAtCleanup"];function Pt(e,t,n){let r=t.indexOf(n);if(r===-1)return e.length;let o=0;return e.forEach((s,a)=>{if(s.kind==="textValue")return;let i=t.indexOf(s.localName);i!==-1&&i<=r&&(o=a+1);}),o}function It(e,t){let n=0;for(let r of e){let o=N(r,t);!o||!/^\d{1,9}$/.test(o)||(n=Math.max(n,Number(o)));}return n+1}function Nn(e,t){let n=e.parts.get(E),r=n??xn();if(!r)return null;let o=r.root,s=b(o,"abstractNum"),a=b(o,"num"),i=t==="bullet"?"bullet":"decimal";for(let O of a){let $=N(O,"numId"),qe=b(O,"abstractNumId")[0],Qe=qe?N(qe,"val"):void 0;if(!$||!Qe)continue;let Ze=s.find(X=>N(X,"abstractNumId")===Qe);if(!Ze)continue;let et=b(Ze,"lvl").find(X=>N(X,"ilvl")==="0"||N(X,"ilvl")===void 0),tt=et?b(et,"numFmt")[0]:void 0;if(tt&&N(tt,"val")===i)return {pkg:e,numId:$}}let d=It(s,"abstractNumId"),l=It(a,"numId"),c=vt(hn(t,d)+`<w:num w:numId="${l}"><w:abstractNumId w:val="${d}"/></w:num>`,[{localName:"abstractNum",attribute:{localName:"abstractNumId",value:String(d)}},{localName:"num",attribute:{localName:"numId",value:String(l)}}]);if(!c)return null;let p=chunkWC3LI6FC_cjs.Da(r),[u,m]=c.map(O=>ne(O,p));if(!u||!m)return null;let f=chunkWC3LI6FC_cjs.Ia(r,o.id,Pt(o.children,Et,"abstractNum"),[u]);if(!f.ok)return null;let y=chunkWC3LI6FC_cjs.Ia(f.part,o.id,Pt(f.part.root.children,Et,"num"),[m]);if(!y.ok)return null;let g=Object.freeze({...e,parts:new Map([...e.parts,[E,y.part]])});if(!n){let O=bn(g);if(!O)return null;let $=kn(O);if(!$)return null;g=$;}return {pkg:g,numId:String(l)}}var On=["nsid","multiLevelType","tmpl","name","styleLink","numStyleLink","lvl"];function Tt(e){let t=N(e,"ilvl");return t===void 0||!/^\d{1,9}$/.test(t)?null:Number(t)}function Rn(e,t){let n=0;return e.forEach((r,o)=>{if(r.kind!=="textValue"){if(r.localName==="lvl"&&r.namespaceUri===j){(Tt(r)??0)<t&&(n=o+1);return}On.includes(r.localName)&&(n=o+1);}}),n}function Cn(e,t,n,r){if(!Number.isInteger(n)||n<0||n>=Ye||t.length===0||t.length>64)return null;let o=e.parts.get(E);if(!o)return null;let s=o.root,a=b(s,"num").find(f=>N(f,"numId")===t),i=a?b(a,"abstractNumId")[0]:void 0,d=i?N(i,"val"):void 0;if(!d)return null;let l=b(s,"abstractNum").find(f=>N(f,"abstractNumId")===d);if(!l||b(l,"numStyleLink").length>0)return null;let c=b(l,"lvl");if(c.some(f=>Tt(f)===n))return e;if(c.length>=Ye)return null;let p=vt(St(r,n),[{localName:"lvl",attribute:{localName:"ilvl",value:String(n)}}]);if(!p)return null;let u=chunkWC3LI6FC_cjs.Da(o),m=chunkWC3LI6FC_cjs.Ia(o,l.id,Rn(l.children,n),[ne(p[0],u)]);return m.ok?Object.freeze({...e,parts:new Map([...e.parts,[E,m.part]])}):null}function ne(e,t){return e.kind==="textValue"?{...e,id:t()}:{...e,id:t(),children:e.children.map(n=>ne(n,t))}}function bn(e){let t=e.mainDocumentPart,n=En(t),r=e.parts.get(n),o=Pn(e),s=chunkWC3LI6FC_cjs.Ba(`<Relationships xmlns="${fn}"><Relationship Id="${o}" Type="${Ot}" Target="numbering.xml"/></Relationships>`,{name:n,contentType:yn});if(!s.ok)return null;let a=e.relationships.get(t)??[],i={ownerPart:t,id:o,type:Ot,rawTarget:"numbering.xml",targetMode:"Internal",order:a.reduce((u,m)=>Math.max(u,m.order),-1)+1},d=new Map([...e.relationships,[t,[...a,i]]]);if(!r)return Object.freeze({...e,parts:new Map([...e.parts,[n,s.part]]),relationships:d});let l=chunkWC3LI6FC_cjs.Da(r),c=s.part.root.children[0];if(!c)return null;let p=chunkWC3LI6FC_cjs.Ia(r,r.root.id,r.root.children.length,[ne(c,l)]);return p.ok?Object.freeze({...e,parts:new Map([...e.parts,[n,p.part]]),relationships:d}):null}function En(e){let t=e.lastIndexOf("/");return `${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function Pn(e){let t=0;for(let n of e.relationships.values())for(let r of n){let o=/^rId(\d{1,9})$/.exec(r.id);o&&(t=Math.max(t,Number(o[1])));}for(let n of e.externalTargets){let r=/^rId(\d{1,9})$/.exec(n.id);r&&(t=Math.max(t,Number(r[1])));}return `rId${t+1}`}var In=`<Override PartName="${E}" ContentType="${_}"/>`;function kn(e){let t=e.contentTypes.overrides.get(chunkWC3LI6FC_cjs.p(E));if(t===_)return e;if(t!==void 0)return null;let n=e.partBytes.get(Rt);if(!n)return null;let r=fflate.strFromU8(n),o=kt(r);if(!o)return null;let s=r.lastIndexOf(`</${o.rootName}>`);if(s===-1)return null;let a=r.slice(0,s)+In+r.slice(s),i=kt(a);if(!i||i.rootName!==o.rootName)return null;let d=[...o.children,wt("Override",{PartName:E,ContentType:_})];return i.children.length!==d.length||i.children.some((l,c)=>l!==d[c])?null:Object.freeze({...e,partBytes:new Map([...e.partBytes,[Rt,fflate.strToU8(a)]]),contentTypes:Object.freeze({defaults:e.contentTypes.defaults,overrides:new Map([...e.contentTypes.overrides,[chunkWC3LI6FC_cjs.p(E),_]])})})}function kt(e){let t=chunkWC3LI6FC_cjs.da(e);if(!t.ok)return null;let n=t.nodes.filter(i=>i.type==="element");if(n.length!==1)return null;let r=n[0],o=r.name.indexOf(":"),s=o===-1?"":r.name.slice(0,o);if(r.name.slice(o+1)!=="Types"||r.attributes[s?`xmlns:${s}`:"xmlns"]!==gn)return null;let a=[];for(let i of r.children)i.type==="element"&&a.push(wt(i.name,i.attributes));return {rootName:r.name,children:a}}function wt(e,t){let n=Object.entries(t).map(([r,o])=>`${r}=${o}`).sort();return [e,...n].join("")}function re(e){return e!=null&&e.kind!=="textValue"}function Je(e,t){for(let n of e.children)if(n.kind!=="textValue"&&n.namespaceUri===chunkWC3LI6FC_cjs.ma&&n.localName===t)return n;return null}function oe(e,t){for(let n of e.attributes)if(n.namespaceUri===chunkWC3LI6FC_cjs.ma&&n.localName===t)return n.value}function A(e,t){let n=Je(e,t);if(!n)return false;let r=oe(n,"val");return r===void 0?true:r!=="0"&&r!=="false"&&r!=="off"}var _t=Object.freeze({trackRevisions:false,restrictedToTrackedChanges:false,doNotTrackMoves:false,doNotTrackFormatting:false});function Sn(e){if(!re(e))return _t;let t=Je(e,"documentProtection"),n=t===null?void 0:oe(t,"enforcement"),r=n!==void 0&&n!=="0"&&n!=="false"&&n!=="off";return {trackRevisions:A(e,"trackRevisions"),restrictedToTrackedChanges:r&&t!==null&&oe(t,"edit")==="trackedChanges",doNotTrackMoves:A(e,"doNotTrackMoves"),doNotTrackFormatting:A(e,"doNotTrackFormatting")}}var At=Object.freeze({doNotShadeFormData:false});function vn(e){return re(e)?{doNotShadeFormData:A(e,"doNotShadeFormData")}:At}function Tn(e,t){let n=e.parts.get(t.storyPartName);if(!n)return {ok:false,reason:`no story part named ${t.storyPartName}`};let r=[];for(let d of chunkWC3LI6FC_cjs.te(n.root)){let l=chunkWC3LI6FC_cjs.re(d.node).tag;if(l===void 0||l.length===0)continue;let c=t.decide(l);c!=="keep"&&r.push({nodeId:d.node.id,policy:c});}let o=n,s=0,a=0;for(let{nodeId:d,policy:l}of r){let c=chunkWC3LI6FC_cjs.Ga(o,d);if(!c)continue;if(l==="remove"){let g=chunkWC3LI6FC_cjs.Ka(o,d,{deferValidation:true});if(!g.ok)return {ok:false,reason:`a node could not be removed: ${$t(g)}`};o=g.part,a+=1;continue}let p=c.children.find(g=>g.id===d);if(!p)continue;let u=chunkWC3LI6FC_cjs.pe(p),m=u?u.children:[],f=c.children.flatMap(g=>g.id===d?m:[g]),y=chunkWC3LI6FC_cjs.Ha(o,c.id,f,{deferValidation:true});if(!y.ok)return {ok:false,reason:`a node could not be unwrapped: ${$t(y)}`};o=y.part,s+=1;}let i=o===n?e:chunkWC3LI6FC_cjs.Ab(e,o);if(!i.parts.has(t.storyPartName))return {ok:false,reason:"the story went missing during the export"};for(let d of t.namespaces)for(let l of _n(i,t.storyPartName,d)){let c=chunkWC3LI6FC_cjs.if(i,l.itemId),p=chunkWC3LI6FC_cjs.cf(i,l.partName,c);if(p.pkg===i&&p.removed.length===0&&!wn(i,l.partName,c))return {ok:false,reason:`the payloads in ${d} could not be removed`};if(i=p.pkg,c.size>0)continue;let u=An(i,l);if(!u.ok)return {ok:false,reason:`the payload store for ${d} could not be removed`};i=u.pkg;}return {ok:true,pkg:i,unwrapped:s,removed:a}}function wn(e,t,n){return chunkWC3LI6FC_cjs._e(e,t).every(r=>n.has(r.id))}function $t(e){return e.issues.map(t=>t.code).join(", ")||"the edit was refused"}function _n(e,t,n){return chunkWC3LI6FC_cjs.We(e,t).filter(r=>r.namespaceUri===n)}function An(e,t){let n=chunkWC3LI6FC_cjs.Gb(e,t.partName);if(!n.ok)return {pkg:e,ok:false};let r=chunkWC3LI6FC_cjs.Gb(n.pkg,t.propsPartName);return r.ok?{pkg:r.pkg,ok:true}:{pkg:e,ok:false}}var ie="http://purl.org/dc/elements/1.1/",Dt="http://schemas.openxmlformats.org/package/2006/metadata/core-properties",Mt="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";var dp=Object.freeze({});function k(e,t,n){if(e.kind!=="textValue")for(let r of e.children){if(r.kind==="textValue"||r.namespaceUri!==t||r.localName!==n)continue;let o=r.children.find(a=>a.kind==="textValue");if(!o||o.kind!=="textValue")return;let s=o.value.trim();return s.length===0?void 0:s.length>4096?s.slice(0,4096):s}}function pp(e,t){let n={};if(e&&e.kind!=="textValue"){let r=k(e,ie,"title");r!==void 0&&(n.title=r);let o=k(e,ie,"creator");o!==void 0&&(n.creator=o);let s=k(e,ie,"subject");s!==void 0&&(n.subject=s);let a=k(e,ie,"description");a!==void 0&&(n.description=a);let i=k(e,Dt,"keywords");i!==void 0&&(n.keywords=i);let d=k(e,Dt,"lastModifiedBy");d!==void 0&&(n.lastModifiedBy=d);}if(t&&t.kind!=="textValue"){let r=k(t,Mt,"Company");r!==void 0&&(n.company=r);let o=k(t,Mt,"Manager");o!==void 0&&(n.manager=o);}return n}
|
|
2
|
+
exports.A=Ve;exports.B=je;exports.C=Xe;exports.D=qt;exports.E=dt;exports.F=mt;exports.G=tn;exports.H=rn;exports.I=Nt;exports.J=dn;exports.K=pn;exports.L=Nn;exports.M=Cn;exports.N=_t;exports.O=Sn;exports.P=At;exports.Q=vn;exports.R=dp;exports.S=pp;exports.T=Tn;exports.a=Ft;exports.b=ot;exports.c=J;exports.d=S;exports.e=q;exports.f=Q;exports.g=h;exports.h=Ht;exports.i=v;exports.j=B;exports.k=Z;exports.l=U;exports.m=ee;exports.n=De;exports.o=Me;exports.p=Fe;exports.q=Kt;exports.r=Gt;exports.s=Be;exports.t=at;exports.u=zt;exports.v=Le;exports.w=Wt;exports.x=H;exports.y=Ue;exports.z=He;
|