@docx-editor.dev/core 2.25.0 → 2.26.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/README.md +9 -3
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +20 -9
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.js +1 -1
- package/dist/chunk-2BK4G4ZN.js +2 -0
- package/dist/chunk-2SJX44PC.cjs +2 -0
- package/dist/chunk-5BIASAN3.js +1 -0
- package/dist/{chunk-WVJRO4WY.js → chunk-6SEIXJTX.js} +1 -1
- package/dist/chunk-73PG6L2X.js +1 -0
- package/dist/chunk-7RJSH72J.cjs +5 -0
- package/dist/chunk-AGKIHLWQ.cjs +1 -0
- package/dist/chunk-AN6WM4X4.js +2 -0
- package/dist/chunk-ANZ44KQT.cjs +12 -0
- package/dist/chunk-CYT3OQFZ.cjs +1 -0
- package/dist/chunk-DDGGSBAN.js +12 -0
- package/dist/chunk-EEAV3WIN.js +3 -0
- package/dist/{chunk-MEF2AK5L.cjs → chunk-ELQFXMJ5.cjs} +1 -1
- package/dist/chunk-EYK4K2J6.js +1 -0
- package/dist/chunk-JNTETUNZ.cjs +1 -0
- package/dist/chunk-L6V3IJ3S.js +5 -0
- package/dist/chunk-LWCI65EL.js +1 -0
- package/dist/chunk-LZDI4P6I.cjs +1 -0
- package/dist/chunk-NS22DVWT.cjs +2 -0
- package/dist/chunk-QIE3YTU4.cjs +2 -0
- package/dist/chunk-QVBFPAGO.js +5 -0
- package/dist/chunk-RCCOLZEQ.js +2 -0
- package/dist/chunk-SUN62YU6.cjs +5 -0
- package/dist/chunk-TKR2MXX4.cjs +3 -0
- package/dist/chunk-UJL2GDIM.cjs +25 -0
- package/dist/chunk-WQTADNHK.cjs +27 -0
- package/dist/chunk-XSHXBJ2J.js +25 -0
- package/dist/chunk-YXZEBTDF.js +27 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.js +1 -1
- package/dist/contracts/editor.d.ts +3 -3
- package/dist/{editor-DkfCCTxA.d.ts → editor-DYUlyKmb.d.ts} +1 -1
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +14 -2
- package/dist/editor.d.ts +13 -13
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +5 -5
- package/dist/export.js +2 -2
- package/dist/{font-resolver-C295obND.d.ts → font-resolver-u_nE0PI1.d.ts} +5 -3
- package/dist/{index-3KAxeSic.d.ts → index-Docw8Dcb.d.ts} +6 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-C889tgmj.d.ts → layout-shaping-DWitwY73.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +89 -23
- package/dist/layout.js +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +3 -3
- package/dist/output.js +1 -1
- package/dist/{protocol-BhmenALD.d.ts → protocol-DniKeDb8.d.ts} +28 -1
- package/dist/{review-paragraph-order-BwhRT264.d.ts → review-paragraph-order-Dc8Q6tfM.d.ts} +5 -1
- package/dist/{semantic-cell-selection-CC3NwCtx.d.ts → semantic-cell-selection-Dy_BmmpL.d.ts} +23 -5
- package/dist/{semantic-interaction-BHlV61hK.d.ts → semantic-interaction-CvFAj0GR.d.ts} +1 -1
- package/dist/{semantic-paint-DfWIWUs6.d.ts → semantic-paint-Bk9wIXdZ.d.ts} +1 -1
- package/dist/{semantic-records-DrExlBy-.d.ts → semantic-records-COqi8pjP.d.ts} +77 -70
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +57 -5
- package/dist/store.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-3RMHRNDA.cjs +0 -1
- package/dist/chunk-42N7OV3G.cjs +0 -1
- package/dist/chunk-47ZJEEBT.js +0 -2
- package/dist/chunk-4B3SXBV6.js +0 -4
- package/dist/chunk-5MWFZ7F4.cjs +0 -11
- package/dist/chunk-AS2OC6J4.cjs +0 -26
- package/dist/chunk-B7SYEMZ7.cjs +0 -1
- package/dist/chunk-BME2KUNL.cjs +0 -1
- package/dist/chunk-CDGVVEUK.js +0 -26
- package/dist/chunk-E4RAPI5J.cjs +0 -2
- package/dist/chunk-FZJTQPH4.js +0 -2
- package/dist/chunk-H7XMRUAO.cjs +0 -5
- package/dist/chunk-ILUE2SI5.js +0 -1
- package/dist/chunk-IZT3C23R.js +0 -1
- package/dist/chunk-KJLPVGSX.cjs +0 -4
- package/dist/chunk-LF5LPZOP.cjs +0 -18
- package/dist/chunk-N5WE5O5Q.js +0 -1
- package/dist/chunk-OVDW4XQD.cjs +0 -2
- package/dist/chunk-SNN53UPD.js +0 -1
- package/dist/chunk-V7LBEUVW.js +0 -5
- package/dist/chunk-VE7YBFQD.js +0 -5
- package/dist/chunk-VOVDX7GW.js +0 -18
- package/dist/chunk-VQ33XGNP.cjs +0 -5
- package/dist/chunk-XUJINXW6.js +0 -1
- package/dist/chunk-Y3TPAITU.cjs +0 -1
- package/dist/chunk-Z65JJLLF.js +0 -11
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {f,c,d,e}from'./chunk-RIYSCEFQ.js';import {hf,n,l,j as j$1,k as k$1,p,i,o,s,g,f as f$1,ja,na as na$1,Pa as Pa$1,za,eb,db,ca as ca$1,ea as ea$1,ad,_c,wc,qc,Wc,Ra,A,z,Jd,Id,Ma,ua as ua$1,Kd,r,a as a$1,b,e as e$1,c as c$1,m,Ca,Ia,Bc,yc,Yc,Vc,qb,$c,va as va$1,h,da as da$1,ta as ta$1}from'./chunk-XSHXBJ2J.js';import {va}from'./chunk-L6V3IJ3S.js';import {a,yi,Mb,Kb,Pb,Lb,Ig,Bi,Ai,zi,yb,Ib}from'./chunk-DDGGSBAN.js';var jn=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,i=o%t;if(n!=="towardZero"){let d=i*2n;(d>t||d===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let c=r?-a:a,s=Number(c);if(!Number.isSafeInteger(s))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return s},Ye=(e,t,n$1,r)=>{if(!Number.isSafeInteger(e))throw new RangeError("font units must be a safe integer");if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("fixed-point denominator must be a positive safe integer");if(!Number.isSafeInteger(n$1)||n$1<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");if(e===0||n$1===0)return n(0);let o=e*n$1;if(Number.isSafeInteger(o)){let a=Math.abs(o),i=a%t,c=(a-i)/t;return r!=="towardZero"&&(i>t-i||i===t-i&&(r==="halfAwayFromZero"||r==="halfToEven"&&c%2!==0))&&(c+=1),n(c===0?0:o<0?-c:c)}return n(jn(BigInt(e)*BigInt(n$1),BigInt(t),r))},Ut=(e,t,n,r)=>{if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("font size must be a positive integer number of half points");if(t>Math.floor(Number.MAX_SAFE_INTEGER/n))throw new RangeError("font size and fixed-point scale product exceeds the safe integer range");let o=t*n,a=e*2;return i=>Ye(i,a,o,r)},Wt=(e,t,n)=>{let r=t*n,o=e*2;return a=>a*r/o};var Yn=4096,Kt=e=>typeof e=="number"?String(e):JSON.stringify(e)??typeof e,ve=class{constructor(t){this.onRestart=t;}onRestart;#e=new Map;keyOf(t,n){let r$1=r(n),o=this.#e.get(r$1);o===void 0&&(this.#e.size>=Yn&&(this.#e.clear(),this.onRestart()),o=this.#e.size,this.#e.set(r$1,o));let a=`${o}\0${Kt(t.fontSizeHalfPoints)}\0${Kt(t.bidiLevel)}\0`,i=t.context;return !i||i.before===""&&i.after===""?`${a}-${t.text}`:`${a}c${i.before.length},${i.after.length}\0${i.before}${i.after}${t.text}`}clear(){this.#e.clear();}};var q=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),se=null,ae=null;function qe(){return se?Promise.resolve():ae||(ae=import('./dist-PKZR6RSH.js').then(e=>{let t=e.versionString();if(t!==q.version)throw new I("shapingLibraryMismatch",{diagnostic:f(q.version,t)});se=e;}).catch(e$1=>{throw ae=null,e$1 instanceof I?e$1:c(e$1)?new I("unsupportedRuntime",{diagnostic:d(e$1),cause:e$1}):new I("wasmUnavailable",{diagnostic:e(e$1),cause:e$1})}),ae)}function $n(){return se!==null}function qn(){if(!se)throw new I("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return se}var I=class extends Error{name="HarfBuzzShapingError";code;limit;actual;diagnostic;constructor(t,n={}){super(`HarfBuzz shaping failed (${t})`,{cause:n.cause}),this.code=t,this.limit=n.limit,this.actual=n.actual,this.diagnostic=n.diagnostic;}},Zn=16*1024*1024,Jn=1e6,Qn=1e6,er=1e6,tr=4,nr=512,rr=1024*1024,or=16*1024*1024,ar=32*1024*1024,ir=64*1024*1024,sr=64*1024*1024,cr=1e6,lr=1e6,dr=1e6,ur=64,pr=4096,fr=4*1024*1024,yr=64*1024*1024,mr=64*1024*1024,hr=256*1024*1024,gr=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),Vt=["cmap","head","hhea","hmtx","maxp"],Sr=(e,t)=>e[t]<<8|e[t+1],br=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,xr=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?br(e,12+t*4):0,Rr=(e,t)=>{let n=xr(e,t),r=Sr(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let i=n+12+a*16;o.add(String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]));}return o},Cr=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),Fr=(e,t)=>{let n=l(e,t);if(!n.valid)return n;let r=Rr(e,t);for(let o of Vt)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},Ze=Fr,k=(e,t,n)=>{if(!Number.isSafeInteger(e)||e<=0||e>n)throw new RangeError(`${t} must be a positive safe integer no greater than ${n}`);return e},vr=(e,t,n$1)=>{if(t.length===0)return [];let r=[],o=0;for(;o<t.length;){let a=t[o].cluster,i=o+1,c=t[o].advanceX;for(;i<t.length&&t[i].cluster===a;)c+=t[i].advanceX,i+=1;let s=n(c);r.push({textStart:a,textEnd:n$1==="rtl"?t[o-1]?.cluster??e.length:t[i]?.cluster??e.length,glyphStart:o,glyphEnd:i,advance:s,caretEdges:Object.freeze([n(0),s]),fontSpan:0}),o=i;}return r},N=64,G=8,U=8,Xt=32,Je=N+2*G,Er=N+G+U,Lr=N+G+2*U,Ir=N+G+U,jt=N+8*G,Yt=N+8*U+G,Or=N+6*U+G,Tr=N+3*U+2*G,Br=N+3*U,ce=e=>N+e.length*Uint16Array.BYTES_PER_ELEMENT,Qe=e=>Ir+ce(e),ie=e=>Xt+e*G,wr=(e,t)=>Je+ce(e)+Er+Qe(t),Ar=e=>jt+ce(e)+ie(e.length)+e.length*Yt,Pr=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return jt+ce(e.text)+ie(e.glyphs.length)+e.glyphs.length*Yt+ie(e.clusters.length)+e.clusters.length*Or+e.clusters.reduce((n,r)=>n+ie(r.caretEdges.length),0)+ie(e.fontSpans.length)+e.fontSpans.length*Tr+(e.exactAdvancesX===void 0?0:Xt+e.exactAdvancesX.length*U)+Br+[...t].reduce((n,r)=>n+Qe(r.path),0)},_r=(e,t)=>Je+ce(e)+Lr+t,$e=class{#e;#p;#f;#y;#m;#R;#h;#l=0;#C;#g;#S;#c;#b;#d;#t;#o=new Map;#i=new Map;#s=new Map;#n=new Map;#F=new ve(()=>{this.#n.clear(),this.#r=0,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0}));});#a=0;#r=0;#x=0;#u;constructor(t,n){this.#e=t,this.#p=k(n.maxFontBytes??Zn,"maximum font bytes",sr),this.#f=k(n.maxInputUtf16??Jn,"maximum input UTF-16 code units",cr),this.#y=k(n.maxCodepoints??Qn,"maximum input code points",lr),this.#m=k(n.maxGlyphs??er,"maximum shaped glyphs",dr),this.#h=k(n.maxCachedFontBytes??64*1024*1024,"maximum cached font bytes",64*1024*1024),this.#R=k(n.maxCachedFaces??tr,"maximum cached faces",ur),this.#C=k(n.maxCachedShapes??nr,"maximum cached shape results",pr),this.#g=k(n.maxOutlineBytes??rr,"maximum outline bytes",fr),this.#S=k(n.maxCachedOutlineBytes??or,"maximum cached outline bytes",yr),this.#c=k(n.maxShapedRunBytes??ar,"maximum shaped run bytes",mr),this.#b=k(n.maxCachedShapeBytes??ir,"maximum cached shape bytes",hr),this.#d=n.instrumentation?.onFaceCacheEvent,this.#t=n.instrumentation,this.#u=new this.#e.Buffer;}dispose(){this.#o.clear(),this.#l=0,this.#i.clear(),this.#s.clear(),this.#n.clear(),this.#F.clear(),this.#a=0,this.#r=0,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#u=void 0;}#E(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#d?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=j$1(t);for(let l of Vt)if(!o.has(l))throw new I("malformedFont",{diagnostic:`missing required ${l} table`});this.#t?.onByteCopy?.();let a=new this.#e.Blob(Cr(n)),i=new this.#e.Face(a,t.faceIndex),c=new this.#e.Font(i),s=c.hExtents();if(!Number.isSafeInteger(i.upem)||i.upem<=0||!Number.isSafeInteger(s.ascender)||!Number.isSafeInteger(s.descender)||!Number.isSafeInteger(s.lineGap))throw new I("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});c.setScale(i.upem,i.upem);let d={identity:t.identity,blob:a,face:i,font:c,unitsPerEm:i.upem,byteLength:n.byteLength};if(n.byteLength<=this.#h){for(;this.#o.size>=this.#R||this.#l+n.byteLength>this.#h;){let l=this.#o.keys().next().value;if(l===void 0)break;this.#l-=this.#o.get(l).byteLength,this.#o.delete(l),this.#d?.(Object.freeze({kind:"evicted",identity:l}));}this.#o.set(t.identity,d),this.#l+=n.byteLength;}return this.#d?.(Object.freeze({kind:"created",identity:t.identity})),d}#L(t,n){let r=this.#i.get(t.identity)?.get(n);if(r)return this.#s.delete(r),this.#s.set(r,void 0),this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#a})),r.outline;this.#t?.onOutlinePathCall?.();let o=t.font.glyphToPath(n),a=Qe(o);if(a>this.#g)throw new I("outlineOverLimit",{limit:this.#g,actual:a});let i=Object.freeze({path:o,unitsPerEm:t.unitsPerEm}),c=wr(t.identity,o)+3*Je+2*U;if(c>this.#S)return this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#a})),i;for(;this.#a+c>this.#S;){let l=this.#s.keys().next().value;if(l===void 0)break;this.#s.delete(l);let f=this.#i.get(l.identity);f.delete(l.glyphId),f.size===0&&this.#i.delete(l.identity),this.#a-=l.bytes,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#a}));}let s=this.#i.get(t.identity);s||this.#i.set(t.identity,s=new Map);let d={outline:i,bytes:c,identity:t.identity,glyphId:n};return s.set(n,d),this.#s.set(d,void 0),this.#a+=c,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#a})),i}#v(t){if(t.length>this.#f)throw new I("textOverLimit",{limit:this.#f,actual:t.length});let n=0;for(let r=0;r<t.length;){let o=t.codePointAt(r);if(r+=o>65535?2:1,n+=1,n>this.#y)throw new I("codepointsOverLimit",{limit:this.#y,actual:n})}}shape(t){if(!this.#u)throw new I("disposed");if(k$1(t.environment.font),t.environment.font.byteLength>this.#p)throw new I("fontOverLimit",{limit:this.#p,actual:t.environment.font.byteLength});this.#v(t.text);let n$1=Ar(t.text);if(n$1>this.#c)throw new I("shapedRunOverLimit",{limit:this.#c,actual:n$1});let r=p(t.environment),o$1=this.#F.keyOf(t,r),a=this.#n.get(o$1);if(a)return this.#x-a.stamp>=Math.max(1,this.#n.size>>1)&&(this.#n.delete(o$1),this.#n.set(o$1,a),a.stamp=++this.#x),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r.shapingLibrary.name!==q.name||r.shapingLibrary.version!==q.version)throw new I("shapingLibraryMismatch");if(r.normalization!=="none")throw new I("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r.direction==="rtl"))throw new I("invalidBidiLevel");if(Object.keys(r.variationAxes).length>0)throw new I("unsupportedVariationAxes");if(r.fallbackOrder.length>0)throw new I("unsupportedFallback");let i$1=i(r.font),c=j$1(r.font);if([...gr].some(y=>c.has(y))&&!c.has("glyf")&&!c.has("CFF "))throw new I("unsupportedColorFont");let s$1=t.text;this.#v(s$1);let d=t.context?.before??"",l=t.context?.after??"",f=o,h=Math.max(String(d).length,String(l).length);if(typeof d!="string"||typeof l!="string"||h>f)throw new I("textOverLimit",{limit:f,actual:h});try{let y=this.#E(r.font,i$1),{face:b,font:x}=y,m=this.#u;m.reset(),d||l?m.addText(d+s$1+l,d.length,s$1.length):m.addText(s$1),m.setDirection(r.direction==="rtl"?this.#e.Direction.RTL:this.#e.Direction.LTR),m.setScript(r.script),m.setLanguage(r.language),m.setClusterLevel(this.#e.ClusterLevel.MONOTONE_CHARACTERS);let g=Object.entries(r.features).map(([B,H])=>new this.#e.Feature(B,H));this.#t?.onShapeCall?.(),this.#e.shape(x,m,g);let S=m.getLength();if(S>this.#m)throw new I("glyphOverLimit",{limit:this.#m,actual:S});let C=m.getGlyphInfos(),v=m.getGlyphPositions(),F=Ut(b.upem,t.fontSizeHalfPoints,r.fixedPointScale,r.roundingMode),T=Wt(b.upem,t.fontSizeHalfPoints,r.fixedPointScale),p=[],u=n(0),R=n(0),E=new Map,L=C.map((B,H)=>{let te=v[H];p.push(T(te?.xAdvance??0));let ut=F(te?.xAdvance??0),pt=F(te?.yAdvance??0),Xn={id:B.codepoint,cluster:B.cluster-d.length,originX:u,originY:R,advanceX:ut,advanceY:pt,offsetX:F(te?.xOffset??0),offsetY:F(te?.yOffset??0),outline:E.get(B.codepoint)??(()=>{let ft=this.#L(y,B.codepoint);return E.set(B.codepoint,ft),ft})()};return u=n(u+ut),R=n(R+pt),Xn}),O=x.hExtents(),A=s({text:s$1,direction:r.direction,bidiLevel:t.bidiLevel,glyphs:L,exactAdvancesX:p,clusters:vr(s$1,L,r.direction),fontSpans:L.length===0?[]:[{glyphStart:0,glyphEnd:L.length,font:r.font,fallbackIndex:null}],metrics:{ascent:F(O.ascender),descent:F(-O.descender),lineGap:F(O.lineGap)}},r),w=Pr(A);if(w>this.#c)throw new I("shapedRunOverLimit",{limit:this.#c,actual:w});let M=_r(o$1,w);if(M>this.#b)return this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),A;for(;this.#n.size>=this.#C||this.#r+M>this.#b;){let B=this.#n.keys().next().value;if(B===void 0)break;let H=this.#n.get(B);this.#n.delete(B),this.#r-=H.bytes,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o$1,{run:A,bytes:M,stamp:++this.#x}),this.#r+=M,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),A}catch(y){throw y instanceof I?y:new I("malformedFont",{diagnostic:y instanceof Error?y.message:"HarfBuzz shaping failed"})}}},et=(e={})=>new $e(qn(),e);var tt=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:32,maxCachedFontBytes:64*1024*1024,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024}),Ea=Object.freeze({...tt,maxCachedShapes:4096});function $t(e){let t={maxFontBytes:e.maxFontBytes,maxInputUtf16:e.maxInputUtf16,maxCodepoints:e.maxCodepoints,maxGlyphs:e.maxGlyphs,maxOutlineBytes:e.maxOutlineBytes,maxShapedRunBytes:e.maxShapedRunBytes},n=["docx-editor-layout-harfbuzz-execution-policy",1,Object.entries(t).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>Object.freeze([r,o]))];return `layout-shaper-policy:sha256:${a(new TextEncoder().encode(JSON.stringify(n)))}`}var Mr=Object.freeze({}),qt=b,kr="16.0.0",zr="none",Nr=1e3,Dr="halfToEven",Qt="cluster-edges-only",Hr="Latn",Gr=new Uint8Array(0);var W=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function Ur(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a=e.substitutions,i=e.defaultFont,c=e.language;if(!Number.isSafeInteger(r)||r<=0||r>a$1)throw new W(`Font byte ceiling must not exceed the engine hard maximum of ${a$1}`);let s=o.length,d=a?.length??0;if(s===0||s>b)throw new W(`Font source count must be between 1 and ${b}`);if(d>qt)throw new W(`Font substitution count must not exceed ${qt}`);let l=0,f=[];for(let b=0;b<s;b+=1){let x=o[b],m=x.request,g$1=x.availability,S=x.id,C=x.hash,v=x.faceIndex,F=g$1==="forbidden",T=F?Gr:x.bytes;if(!F){if(typeof S!="string"||S.length===0)throw new TypeError("Resolved font id must not be empty");let p;try{p=e$1(T);}catch{throw new W(`Font source ${S} must provide genuine bytes`)}if(p>r)throw new W(`Font source ${S} exceeds the per-font byte ceiling`);if(l+=p,l>c$1)throw new W(`Font sources exceed the aggregate byte ceiling of ${c$1}`)}f.push(t&&g(x)!==void 0?x:Object.freeze({request:Object.freeze({family:m.family,weight:m.weight,style:m.style}),id:S,bytes:T,hash:C,faceIndex:v,...g$1?{availability:g$1}:{}}));}let h;if(a){h=[];for(let b=0;b<d;b+=1){let x=a[b],m=x.from,g=x.to,S=x.lineMetrics;h.push(Object.freeze({from:Object.freeze({family:m.family,weight:m.weight,style:m.style}),to:Object.freeze({family:g.family,weight:g.weight,style:g.style}),...S?{lineMetrics:Object.freeze({heightEm:S.heightEm,baselineEm:S.baselineEm})}:{}}));}}let y={epoch:n,maxFontBytes:r,sources:Object.freeze(f),substitutions:h?Object.freeze(h):void 0,defaultFont:Object.freeze({family:i.family,sizeHalfPoints:i.sizeHalfPoints}),language:c};return Object.freeze(y)}function Zt(e,t){let n=e.map((o,a)=>({value:o,index:a,key:h(t(o))})),r=new Set;for(let o of n){if(r.has(o.key))return e;r.add(o.key);}return n.sort((o,a)=>o.key<a.key?-1:o.key>a.key?1:o.index-a.index).map(({value:o})=>o)}function Wr(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function Jt(e,t){let n=s=>({family:s.family,weight:s.weight,style:s.style}),r=t?e.sources:Zt(e.sources,s=>s.request),o=e.substitutions??[],a=t?o:Zt(o,s=>s.from),i={sources:r.map(s=>{let d=s.availability??"available",l={request:n(s.request),availability:d};if(d==="forbidden")return {...l,...t?{id:s.id,faceIndex:s.faceIndex,declaredHash:s.hash}:{}};let f=g(s);if(f==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...l,...t?{id:s.id}:{},faceIndex:s.faceIndex,declaredHash:s.hash,actualHash:f,byteLength:s.bytes.byteLength}}),substitutions:a.map(s=>({from:n(s.from),to:n(s.to),lineMetrics:s.lineMetrics?{heightEm:s.lineMetrics.heightEm,baselineEm:s.lineMetrics.baselineEm}:null})),defaultFont:Wr(e.defaultFont,t),language:e.language||"en"},c={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?c:{},...i}}var Kr=Symbol("prepared-layout-font-configuration"),Ee=new WeakMap;function Vr(e){return Ee.has(e)}function Xr(e){let t=Ee.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function wa(e){let t=Ee.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function nt(e,t){return en(e,t,false)}function Aa(e,t){return en(e,t,true)}function en(e,t,n){let r=Ur(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(f=>n&&g(f)!==void 0?f:f$1(f,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a$1=new TextEncoder,i=Jt(o,true),c=a$1.encode(JSON.stringify(i)),s=Jt(o,false),d=a$1.encode(JSON.stringify(s)),l=Object.freeze({[Kr]:true,fingerprint:`font-config:${a(c)}`});return Ee.set(l,{configuration:o,sharedShapingFingerprint:`shared-font-config:${a(d)}`}),l}function jr(e){return nt(e).fingerprint}function Yr(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:$t(t),ligatureCaretPolicy:Qt,fallback:da$1}));return `shaping:${a(n)}`}async function tn(e,t,n,r,o=false){let i=Vr(e)?e:nt(e,t),c=Xr(i),{epoch:s,maxFontBytes:d,sources:l,substitutions:f,defaultFont:h}=c,y=c.language||"en",b=i.fingerprint,x=m({epoch:s,maxFontBytes:d,resources:l,substitutions:f,validateFont:Ze,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await qe();let m$1=Object.freeze({script:Hr,variationAxes:Object.freeze({}),shapingLibrary:q,unicodeDataVersion:kr,normalization:zr,language:y,features:Mr,...o?{documentLigatures:true}:{},fixedPointScale:Nr,roundingMode:Dr});return Object.freeze({fonts:x,shaper:n??et(r),defaultFont:h,environment:m$1,ligatureCaretPolicy:Qt,operation:Object.freeze({resourceEpoch:x.epoch,configEpoch:s,extensionFingerprint:b,shapingHash:Yr(m$1,r),producerVersion:1})})}async function $r(e,t){return tn(e,t,void 0,tt)}async function Pa(e,t,n,r,o=false){return tn(e,r,t,n,o)}function qr(e){e.shaper.dispose?.();}function rt(e){let t=new Set([0,e.text.length]);for(let r of ja(e.text))t.add(r.utf16From),t.add(r.utf16To);let n=new Set([0,e.text.length]);for(let r of e.clusters)n.add(r.textStart),n.add(r.textEnd);return [...t].filter(r=>n.has(r)).sort((r,o)=>r-o)}function Le(e,t){return rt(e).includes(t)}function Zr(e,t){return Le(e,t)}function Jr(e,t,n){return n>=t&&Le(e,t)&&Le(e,n)}function Qr(e){let t=ja(e.text);return rt(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var at="und";function an(){return typeof Intl.Segmenter=="function"}function eo(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${at})`);return e}function sn(){let e=new(eo())(at,{granularity:"word"});return {segment(t){let n=[];for(let r of e.segment(t)){let o=r.index,a=o+r.segment.length;n.push({utf16From:o,utf16To:a,wordLike:r.isWordLike===true});}return n}}}var to=/^[\p{L}\p{N}']$/u,no=/^\s$/u;function nn(e){return to.test(e)}function rn(e){return no.test(e)}function ot(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function cn(e){let t=ja(e);if(t.length===0)return [];let n=[],r=0;for(;r<t.length;){let o=t[r];if(rn(o.text)){let a=r+1;for(;a<t.length&&rn(t[a].text);)a+=1;n.push(ot(t,r,a,false)),r=a;continue}if(nn(o.text)){let a=r+1;for(;a<t.length&&nn(t[a].text);)a+=1;n.push(ot(t,r,a,true)),r=a;continue}n.push(ot(t,r,r+1,false)),r+=1;}return n}function ln(){return {segment:cn}}function dn(e={}){let t=e.isIntlAvailable??an,n=e.createIntlBoundary??sn,r=e.createFallbackBoundary??ln;if(!t())return r();try{return n()}catch{return r()}}var on;function un(){return on??=dn(),on}function ro(e,t=un()){return t.segment(e)}function oo(e,t){return t.map(n=>({graphemeFrom:na$1(e,n.utf16From),graphemeTo:na$1(e,n.utf16To),wordLike:n.wordLike}))}var pn={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},ct=Object.keys(pn),fn=ct.filter(e=>pn[e]==="coarse-gate"),Ie=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},J=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},ao={resourceEpoch:Ie,configEpoch:Ie,extensionFingerprint:J,shapingHash:J,producerVersion:Ie},io=(e,t)=>{ao[t](e[t],t);},Q=e=>{for(let t of ct)io(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},so=(e,t)=>{let n=Q(e),r=Q(t),o=ct.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},it=e=>{let t=e.map(({key:n,fingerprint:r})=>(J(n,"resource dependency key"),J(r,"resource dependency fingerprint"),Object.freeze({key:n,fingerprint:r}))).sort((n,r)=>n.key<r.key?-1:n.key>r.key?1:0);for(let n=1;n<t.length;n+=1)if(t[n-1].key===t[n].key)throw new TypeError(`Duplicate resource dependency: ${t[n].key}`);return Object.freeze(t)},co=e=>(Ie(e.revision,"revision"),J(e.dependencyFingerprint,"dependencyFingerprint"),J(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:it(e.resourceDependencies),...Q(e)})),lo=(e,t)=>{let n=it(e),r=it(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let i=n[a],c=r[a];if(i?.key!==c?.key||i?.fingerprint!==c?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:i?.key??c.key}}return null};function uo(e,t){if(e.dependencyFingerprint!==t.dependencyFingerprint)return {hit:false,reason:"dependency-changed"};if(e.inputFingerprint!==t.inputFingerprint)return {hit:false,reason:"input-changed"};let n=lo(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of fn)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var st=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=uo(r.provenance,n);return o||{hit:true,value:r.value,provenance:r.provenance}}set(t,n,r){this.entries.set(t,{value:n,provenance:co(r)});}evictEpoch(t){let n=Q(t),r=0;for(let[o,a]of this.entries){let i=a.provenance;fn.some(c=>i[c]!==n[c])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=Q(t),o=this.evictEpoch(r);for(let[a,i]of this.entries)i.provenance.resourceDependencies.some(s=>n.get(s.key)!==s.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function yn(e){return e.projected===true?null:e.range}function fo(e,t,n){let{page:r,story:o,host:a,noteScopeId:i,noteAreaKind:c}=e,s=o==="header"||o==="footer"?d=>ta$1(d,e.origin,{x:r.box.x,y:r.box.y}):void 0;Ca(a,(d,l)=>{let{textboxDepth:f,textboxOwner:h,textboxPath:y,storyOrigin:b}=l,x=f===0?o:"textbox";for(let m of d.lines){let g=[...Ia(m)].sort((S,C)=>(t.get(S.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(C.paragraphId)??Number.MAX_SAFE_INTEGER));for(let S of g)for(let C of S.spans)n({page:r,story:x,rootStory:o,root:e,storyOrigin:b,absoluteBox:Object.freeze({x:b.x+C.box.x,y:b.y+C.box.y,width:C.box.width,height:C.box.height}),noteScopeId:i,noteAreaKind:c,textboxDepth:f,textboxOwner:h,textboxPath:y,paragraph:d,paragraphId:S.paragraphId,line:m,span:C,sourceRange:yn(C)});}},e.origin,s);}function yo(e,t){let n=new Map(Pa$1(e).map((r,o)=>[r,o]));za(e,r=>fo(r,n,t));}var ho=1,mn=4,j=Object.freeze({top:0,right:0,bottom:0,left:0}),hn=new WeakMap;function go(e,t){let n=So(e);return n===j?t:eb(t,n)}function So(e){let t=e.vectorShape;if(!t)return j;let{cx:n,cy:r}=t.extentEmu;if(!(n>=0)||!(r>=0)||n===0&&r===0)return j;let o=hn.get(t);if(o||(o=bo(t),hn.set(t,o)),o===j)return j;let a=e.paintBounds,i=e.geometry.contentBounds;if(!(a.width>0||i.width<=0)||!(a.height>0||i.height<=0))return j;let c=n>0?i.width/n:i.height/r,s=r>0?i.height/r:i.width/n,d=(f,h,y)=>{if(y<-1e-3)return 0;let b=f*h-Math.max(0,y);return Number.isFinite(b)&&b>0?b:0},l={left:d(o.left,c,i.x-a.x),top:d(o.top,s,i.y-a.y),right:d(o.right,c,a.x+a.width-(i.x+i.width)),bottom:d(o.bottom,s,a.y+a.height-(i.y+i.height))};return l.left||l.top||l.right||l.bottom?Object.freeze(l):j}function bo(e){let{cx:t,cy:n}=e.extentEmu,r=0,o=0,a=t,i=n,c=(l,f)=>{r=Math.min(r,l),a=Math.max(a,l),o=Math.min(o,f),i=Math.max(i,f);},s=ho,d=l=>l.x>=-s&&l.x<=t+s&&l.y>=-s&&l.y<=n+s;for(let l of e.components){if(l.strokeHex===null||l.strokeInset===true)continue;let f=Math.max(1,db(l.strokeWidthEmu))/2;l.subpathsEmu.forEach((h,y)=>{let b=l.subpathsClosed?.[y]!==false,x=xo(h,b),m=b&&x.length>2?x.length:x.length-1,g=[];for(let C=0;C<m;C+=1){let v=x[C],F=x[(C+1)%x.length],T=Math.hypot(F.x-v.x,F.y-v.y),p={x:-(F.y-v.y)/T,y:(F.x-v.x)/T};if(g.push(p),!!Ro(v,F,-s,t+s,-s,n+s))for(let u=0;u<2;u+=1){let R=K[u],E=v.x+(F.x-v.x)*R,L=v.y+(F.y-v.y)*R;c(E+p.x*f,L+p.y*f),c(E-p.x*f,L-p.y*f);}}let S=b&&x.length>2?g.length:g.length-1;for(let C=0;C<S;C+=1){let v=x[(C+1)%x.length];if(!d(v))continue;let F=g[C],T=g[(C+1)%g.length],p=1+F.x*T.x+F.y*T.y;if(p<2/(mn*mn))continue;let u=F.y*-T.x- -F.x*T.y;if(u===0)continue;let R=u>0?-1:1;c(v.x+R*(F.x+T.x)*f/p,v.y+R*(F.y+T.y)*f/p);}});for(let h of l.arrowheadsEmu??[])if(!(!h[0]||!d(h[0])))for(let y of h)c(y.x,y.y);}return r>=0&&o>=0&&a<=t&&i<=n?j:Object.freeze({left:-r,top:-o,right:a-t,bottom:i-n})}function xo(e,t){let n=[];for(let a of e){let i=n[n.length-1];(!i||i.x!==a.x||i.y!==a.y)&&n.push(a);}let r=n[0],o=n[n.length-1];return t&&n.length>1&&r.x===o.x&&r.y===o.y&&n.pop(),n}var K=new Float64Array(2);function Ro(e,t,n,r,o,a){let i=t.x-e.x,c=t.y-e.y;return K[0]=0,K[1]=1,Oe(-i,e.x-n)&&Oe(i,r-e.x)&&Oe(-c,e.y-o)&&Oe(c,a-e.y)}function Oe(e,t){if(e===0)return t>=0;let n=t/e;return e<0?K[0]=Math.max(K[0],n):K[1]=Math.min(K[1],n),K[0]<=K[1]}function D(e){return (e.kerningEnabled??e.kerningMinPt>0)&&e.kerningMinPt>0&&e.fontSizePt>=e.kerningMinPt}var xn="Calibri, Carlito, Helvetica, Arial, sans-serif",Qa=new Map([["calibri","Carlito"]]),Co=65536,Fo=256;function gn(e,t){return e===void 0?Math.max(1,Math.floor(t)):Number.isFinite(e)&&e>0?Math.max(1,Math.floor(e)):1}function Sn(e){let t=new Map,n=0;return {get(r){let o=t.get(r);if(o!==void 0)return t.delete(r),t.set(r,o),o},set(r,o){for(t.has(r)&&t.delete(r),t.set(r,o);t.size>e;){let a=t.keys().next();if(a.done)break;t.delete(a.value),n+=1;}},get size(){return t.size},get evictions(){return n}}}var bn=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Rn(e=null){return e!=null&&typeof e.measureText=="function"}function Cn(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??xn,r=e.context??null;if(!Rn(r))return null;let o=r,a=Sn(gn(e.maxWidthEntries,Co)),i=Sn(gn(e.maxMetricsEntries,Fo)),c=e.fontAlias,s=l=>{let f=l.fontFamily&&bn.test(l.fontFamily)?l.fontFamily:null,h=f?c?.(f):void 0,y=h&&bn.test(h)?h:null,b=f?y?`"${y}", "${f}", ${n}`:`"${f}", ${n}`:n,x=l.bold?"bold":"normal",m=l.italic?"italic":"normal",g=l.smallCaps?"small-caps":"normal",S=l.fontSizePt*ca$1(l)*t;return `${m} ${g} ${x} ${S}px ${b}`},d=(l,f,h)=>l/t*(h.horizontalScalePercent/100)+f.length*h.characterSpacingPt;return {measure(l,f){if(l.length===0)return 0;let h=s(f),y=`${h}\0${D(f)}\0${l}`,b=a.get(y);if(b!==void 0)return d(b,l,f);o.font=h,"fontKerning"in o&&(o.fontKerning=D(f)?"normal":"none");let x=o.measureText(l).width;return a.set(y,x),d(x,l,f)},inkBounds(l,f){if(!l||l.length>2||f.shaping?.direction==="rtl"||ja(l).length!==1)return;o.font=s(f),"fontKerning"in o&&(o.fontKerning=D(f)?"normal":"none");let h=o.textAlign,y=o.direction,b;try{h!==void 0&&(o.textAlign="left"),y!==void 0&&(o.direction="ltr"),b=o.measureText(l);}finally{h!==void 0&&(o.textAlign=h),y!==void 0&&(o.direction=y);}let x=b.actualBoundingBoxLeft,m=b.actualBoundingBoxRight;if(x===void 0||m===void 0||!Number.isFinite(x)||!Number.isFinite(m))return;let g=f.horizontalScalePercent/(100*t);return {left:-x*g,right:m*g}},lineMetrics(l){let f=l.fontSizePt*ca$1(l),h=s(l),y=i.get(h);if(y)return y;let b=f*1.15,x=f*.8;o.font=h,"fontKerning"in o&&(o.fontKerning=D(l)?"normal":"none");let m=o.measureText("Hxg"),g=m.fontBoundingBoxAscent,S=m.fontBoundingBoxDescent;if(typeof g=="number"&&Number.isFinite(g)&&g>0&&(x=g/t,typeof S=="number"&&Number.isFinite(S)&&S>=0)){let v=(g+S)/t;v>0&&(b=Math.max(v,b));}b>0||(b=f*1.15);let C={height:b,baseline:x};return i.set(h,C),C}}}function vo(e=1,t={}){let n=Cn({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:ea$1(),producer:"fixed-measurer"}}function Eo(e){let t;return n=>{t===void 0&&(t=ad(e.pages)?.hosts??null);let r=t?.get(n);return r?_c(r.pageNumber,r.format):null}}function Fn(e,t){let n=Bc(e,t.displayMode??Ra),r=yc({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:Ig(t.package,"footnote"),endnotesPart:Ig(t.package,"endnote")}:void 0,a=Yc(n,r,o,t.package?Vc(t.package,e,n):void 0,t.displayMode??Ra);return {blocks:n,notes:o,context:a}}function vn(e,t,n,r,o){for(let a of t){if(r.length>=yi)return;if(n.tokenForParagraph(a.id)!==""&&Bi(e,a.id)===null)for(let i of Ai(a)){if(r.length>=yi)return;if(!i.rewritable)continue;let c=qb(i.instruction);if(c===null)continue;let s=n.liveValueOf(i.fieldNodeId,c);if(s===null&&o&&n.pageRefProjectionOf){let d=n.pageRefProjectionOf(i.fieldNodeId,c);if(d){let l=o(d.targetParagraphId);l!==null&&l.length>0&&$c(d.calibration,d.cached,l,Number.NaN)&&(s=l);}}s===null||s===i.cachedText||s.length>zi||s.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:i.fieldNodeId,text:s});}}}function Lo(e,t){let{blocks:n,context:r}=Fn(e,t);if(r===null)return null;let o=[];return vn(e,wc(qc(n)),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function di(e,t){let{notes:n,context:r}=Fn(e,t);if(r===null||n===void 0)return [];let o=[],a=[{noteKind:"footnote",notesPart:n.footnotesPart},{noteKind:"endnote",notesPart:n.endnotesPart}];for(let{noteKind:i,notesPart:c}of a){if(!c)continue;let s=[];for(let d of Wc(c,t.displayMode??Ra)){if(s.length>=yi)break;vn(c,wc(qc(d)),r,s);}s.length>0&&o.push({noteKind:i,op:{op:"refreshFieldResults",updates:s}});}return o}function Io(e){return e.box}function En(e,t){if(e.kind==="paragraph"){t.add(e.paragraphId);return}for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks)En(o,t);}function Oo(e){let t=new Map,n=(o,a,i)=>{if(!(o.kind==="textValue"||i>yb*4)){for(let c of o.children)if(c.kind!=="textValue"){if(c.kind==="paragraph"){for(let s of r)t.get(s)?.push(c.id);n(c,c.id,i+1);continue}if(c.kind==="contentControl"){t.set(c.id,[]),r.push(c.id);let s=Ib(c);s&&n(s,a,i+1),r.pop();let d=t.get(c.id);d&&d.length===0&&a!==null&&d.push(a);continue}n(c,a,i+1);}}},r=[];return n(e,null,0),t}function To(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return {x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function Bo(e,t){let n=Mb(e.root);if(n.length===0)return wo;let r=new Map;t.pages.forEach((i,c)=>{(d=>{for(let l of d){let f=new Set;En(l,f);for(let h of f){let y=r.get(h)??[];y.push({pageIndex:c,box:Io(l)}),r.set(h,y);}}})(i.fragments);});let o=Oo(e.root),a=[];for(let i of n){let c=Kb(i.node),s=[...i.ancestors.map(h=>Kb(h).lock),c.lock],d=o.get(i.node.id)??[],l=new Map;for(let h of d)for(let y of r.get(h)??[]){let b=l.get(y.pageIndex);l.set(y.pageIndex,b?To(b,y.box):y.box);}let f=[...l.entries()].sort((h,y)=>h[0]-y[0]).map(([h,y])=>({pageIndex:h,...y}));a.push({controlId:i.node.id,type:c.type,level:Lb(i.node),depth:i.depth,lock:c.lock,effectiveLock:Pb(s),showingPlaceholder:c.showingPlaceholder,temporary:c.temporary,...c.tag===void 0?{}:{tag:c.tag},...c.alias===void 0?{}:{alias:c.alias},...c.id===void 0?{}:{id:c.id},...c.dataBinding===void 0?{}:{dataBinding:c.dataBinding},paragraphIds:d,fragments:f});}return a}var wo=Object.freeze([]);function In(e,t,n){let r=e.lines?.find(o=>{let a=o.spans;if(!a)return n<o.range.end;let i=a.filter(c=>c.range.paragraphId===t);return i.length===a.length?n<o.range.end:i.length>0&&n<i[i.length-1].range.end});return r?r.box.y:e.fragmentY}function Uo(e,t){let n=new Map;for(let r of e.pages)for(let[o,a]of Wo(r,t))n.has(o)||n.set(o,a);return n}var Ln=new WeakMap;function Wo(e,t){let n=Ln.get(t);n||(n=new WeakMap,Ln.set(t,n));let r=n.get(e);if(r)return r;let o=new Map;for(let a of t(e)){let i=new Set([a.paragraphId]);for(let c of a.lines??[])for(let s of c.spans??[])i.add(s.range.paragraphId);for(let c of i)o.has(c)||o.set(c,{pageIndex:e.index,contentY:e.contentBox.y,fragmentY:a.box.y,...a.lines?{lines:a.lines}:{}});}return n.set(e,o),o}function Ko(e,t){let n=va(e);if(!n)return null;let r=t.get(n.start.paragraphId);return r?{pageIndex:r.pageIndex,y:r.contentY+In(r,n.start.paragraphId,n.start.offset)}:null}var On=new WeakMap;function Vo(e){let t=On.get(e);if(t!==void 0)return t;let n=i(e),r=new DataView(n.buffer,n.byteOffset,n.byteLength),o=false,a=r.getUint32(0)===1953784678?r.getUint32(12+e.faceIndex*4):0,i$1=r.getUint16(a+4);for(let c=0;c<i$1;c++){let s=a+12+c*16;if(r.getUint32(s)!==1330851634)continue;let d=r.getUint32(s+8),l=r.getUint32(s+12);l>=86&&d<=n.byteLength-l&&r.getUint16(d)>=1&&(o=(r.getUint32(d+78)&1966080)!==0);break}return On.set(e,o),o}function Tn(e,t,n,r,o){if(r>o||Math.abs(n.height-t)>o||!Vo(e))return n;let a=t*.3;return {height:n.height+a,baseline:n.baseline+a/2}}var Xo="abcdefghijklmnopqrstuvwxyz";function Z(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function V(e,t,n,r,o){let a=r.shaping?.context;return e.shape({text:o,fontSizeHalfPoints:Z(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:jo(t,n,r),...a?{context:a}:{}})}var Bn=new WeakMap;function jo(e,t,n){if(!Object.isFrozen(e)||!Object.isFrozen(e.features)||!Object.isFrozen(e.variationAxes)||!Object.isFrozen(e.shapingLibrary))return wn(e,t,n);let r=n.shaping?.direction??"ltr",o=n.shaping?.script,a=`${r}|${o??""}|${D(n)?1:0}|${e.documentLigatures?A(n):""}|${n.smallCaps?1:0}`,i=Bn.get(e);i||Bn.set(e,i=new WeakMap);let c=i.get(t);c||i.set(t,c=new Map);let s=c.get(a);return s||c.set(a,s=wn(e,t,n)),s}function wn(e,t,n){return p({...e,font:t,direction:n.shaping?.direction??"ltr",script:n.shaping?.script==="Zyyy"?e.script:n.shaping?.script??e.script,features:{...e.features,kern:D(n)?1:0,...e.documentLigatures?z(n):{},...n.smallCaps?{smcp:1}:{}},fallbackOrder:[]})}function Te(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let i=true;try{for(let c of Xo){let s=V(e,t,n,{...r,smallCaps:!0},c),d=V(e,t,n,{...r,smallCaps:!1},c);if(!(s.glyphs.length!==d.glyphs.length||s.glyphs.some((f,h)=>f.id!==d.glyphs[h]?.id))){i=!1;break}}}catch{i=false;}return o.set(n,i),i}function An(e,t,n,r,o){let a=new WeakMap;return (i,c)=>{let s=ca$1(c),d=a.get(i);d||(d=new Map,a.set(i,d));let l=Z(c),f=d.get(l);if(f)return s===1?f:{height:f.height*s,baseline:f.baseline*s};let h,y=true,b=i.substitution?.lineMetrics;if(b){let x=l/2;h={height:b.heightEm*x,baseline:b.baselineEm*x};}else try{let x=V(e,t,i,c,""),m=x.metrics.ascent/t.fixedPointScale,g=x.metrics.descent/t.fixedPointScale,S=l/2,C=m+g,v=S*r,F=C>v?v/C:1,T=C*F,p=Math.min(Math.max(0,x.metrics.lineGap/t.fixedPointScale),T*o),u=T+p;u>0?h=Tn(i,S,{height:u,baseline:m*F+p},p,2/t.fixedPointScale):(h=n.lineMetrics(c),y=!1);}catch{h=n.lineMetrics(c),y=false;}return y?(d.set(l,h),s===1?h:{height:h.height*s,baseline:h.baseline*s}):h}}var lt=new WeakMap;function Yo(e){let t=lt.get(e);if(t!==void 0)return t??void 0;let n=e.path;if(!n.startsWith("M")||n.length>1e6||/[^MLQCZ0-9eE+.,\s-]/u.test(n))return;let r=1/0,o=-1/0,a=n.matchAll(/([MLQCZ])([^MLQCZ]*)/gu);for(let c of a){let s=c[1]==="Z"?0:c[1]==="C"?6:c[1]==="Q"?4:2,d=c[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(d.length!==s||d.some(l=>!Number.isFinite(l))){lt.set(e,null);return}for(let l=0;l<d.length;l+=2)r=Math.min(r,d[l]),o=Math.max(o,d[l]);}let i=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return lt.set(e,i??null),i}function Pn(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let c of e.glyphs){if(c.id===0)return;let s=Yo(c.outline),d=c.outline.unitsPerEm;if(!s||!(d>0))return;let l=(c.originX+c.offsetX)/n;o=Math.min(o,l+s.left*t*(c.drawScale??1)/d),a=Math.max(a,l+s.right*t*(c.drawScale??1)/d);}let i={left:o*r,right:a*r};return Number.isFinite(i.left)&&Number.isFinite(i.right)?i:void 0}function $o(e,t,n){if(t<12)return null;if(e.getUint32(0)!==1953784678)return 0;let o=12+(Number.isSafeInteger(n)&&n>0?n:0)*4;if(o+4>t)return null;let a=e.getUint32(o);return a+12<=t?a:null}function _n(e,t,n,r,o){let a=e.getUint16(n+4);if(a>4096||n+12+a*16>t)return null;for(let i=0;i<a;i+=1){let c=n+12+i*16;if(e.getUint32(c)!==r)continue;let s=e.getUint32(c+8),d=e.getUint32(c+12);return d<o||s+d>t?null:s}return null}function Mn(e,t){let n=e.byteLength,r=new DataView(e.buffer,e.byteOffset,n),o=$o(r,n,t);if(o===null)return null;let a=_n(r,n,o,1751474532,54);if(a===null)return null;let i=r.getUint16(a+18);if(i<=0)return null;let c=_n(r,n,o,1330851634,30);if(c===null)return null;let s=r.getInt16(c+26)/i,d=r.getInt16(c+28)/i;return !(s>0)||s>1||!(Math.abs(d)<=1)?null:{offsetEm:d,thicknessEm:s}}var qo=.5,Zo=4,kn=4096;function zn(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r,resolveFont:o,fallback:a}=e,i=t??{shapingLibrary:n.shapingLibrary,unicodeDataVersion:n.unicodeDataVersion,script:n?.script??"Latn",fixedPointScale:n?.fixedPointScale??1e3,normalization:n?.normalization??"none",features:n?.features??{},roundingMode:n?.roundingMode??"halfToEven",language:n?.language??"en",variationAxes:{}},c=new WeakMap,s=new WeakMap,d=An(r,i,a,Zo,qo),l=new WeakMap,f=new WeakMap,h=new Array(kn),y=0,b=(p,u,R)=>{let E=h[y];E&&E.cache.delete(E.text),p.set(u,R),h[y]={cache:p,text:u},y=(y+1)%kn;},x=p=>{let u=l.get(p);if(u!==void 0)return u;let R=o(p);return l.set(p,R),R},m=(p,u,R)=>{let E=R?s:c,L=E.get(p);L||(L=new Map,E.set(p,L));let O=L.get(u);return O||(O=new Map,L.set(u,O)),O},g=new WeakMap,S=p=>{if(!p.shaping?.wordSpacingPt)return p;let u=g.get(p);return u||(u={...p,shaping:{...p.shaping,wordSpacingPt:void 0}},g.set(p,u)),u},C=(p,u)=>u.shaping?.wordSpacingPt?Kd(p)*u.shaping.wordSpacingPt:0,v=(p,u)=>a.measure(p,S(u))+C(p,u),F=(p,u)=>{let R=Math.max(0,a.measure(p,S(u))),E=a.caretAdvances?.(p,S(u))??Id(p,R);if(!E||E.length!==p.length+1)return Id(p,v(p,u));let L=Math.max(0,v(p,u)),O=0,A=0;return E.map((w,M)=>{if(M===0)return 0;p[M-1]===" "&&A++;let B=w+A*(u.shaping?.wordSpacingPt??0);return O=Math.max(O,Math.min(L,Number.isFinite(B)?B:O)),M===p.length?L:O})},T=new WeakMap;return {hasResolvedFont(p){return x(p)!==null},strikeoutMetrics(p){let u=x(p);if(!u)return;let R=T.get(u);if(R===void 0&&(R=Mn(u.bytes,u.faceIndex),T.set(u,R)),!R)return;let E=Z(p)/2*ca$1(p);return {offsetPt:R.offsetEm*E,thicknessPt:R.thicknessEm*E}},measure(p,u){if(p.length===0)return 0;let R=x(u);if(!R)return v(p,u);let E=m(R,Z(u),u.smallCaps),L=u.shaping?.context,O=u.shaping?`1:${JSON.stringify(L?[u.shaping.script,u.shaping.direction,p,L.before,L.after]:[u.shaping.script,u.shaping.direction,p])}`:`0:${p}`,A$1=`${D(u)?1:0}:${A(u)}:${O}`,w=E.get(A$1);if(w===void 0){let M=0;try{if(u.smallCaps&&!Te(r,i,R,u,f))return v(p,u);let B=V(r,i,R,u,p);if(B.glyphs.some(H=>H.id===0))return v(p,u);for(let H of B.glyphs)M+=H.advanceX;}catch{return v(p,u)}w=M/i.fixedPointScale,b(E,A$1,w);}return w*ca$1(u)*(u.horizontalScalePercent/100)+p.length*u.characterSpacingPt+C(p,u)},inkBounds(p,u){if(!p||p.length>2||u.shaping?.direction==="rtl"||ja(p).length!==1)return;let R=x(u);if(!R)return a.inkBounds?.(p,u);try{if(u.smallCaps&&!Te(r,i,R,u,f))return a.inkBounds?.(p,u);let E=V(r,i,R,u,p);return Pn(E,Z(u)/2,i.fixedPointScale,ca$1(u)*u.horizontalScalePercent/100)}catch{return}},caretAdvances(p,u){let R=x(u);if(!R)return F(p,u);try{if(u.smallCaps&&!Te(r,i,R,u,f))return F(p,u);let E=V(r,i,R,u,p);return E.glyphs.some(L=>L.id===0)?F(p,u):Jd(p,E,ca$1(u)*(u.horizontalScalePercent/100)/i.fixedPointScale,u.characterSpacingPt,u.shaping?.wordSpacingPt??0)??Id(p,E.glyphs.reduce((L,O)=>L+O.advanceX,0)*ca$1(u)*(u.horizontalScalePercent/100)/i.fixedPointScale+p.length*u.characterSpacingPt+C(p,u))}catch{return F(p,u)}},lineMetrics(p,u){let R=x(p);if(!R)return a.lineMetrics(p,u);if(!u||/^[\t\n\r\f ]*$/.test(u))return d(R,p);try{let E=V(r,i,R,p,u),L=0,O=0;for(let A of E.fontSpans){let w=d(A.font,p);L=Math.max(L,w.baseline),O=Math.max(O,w.height-w.baseline);}if(L+O>0)return {height:L+O,baseline:L}}catch{}return d(R,p)}}}function Jo(e,t){return zn({...t,shaper:e.shaper,environment:e.environment})}function Qo(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let s of t.pages)r.add(s.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,i=-1,c=-1;for(let s of t.pages){let d=s.box.y;d+s.box.height>=n.top&&d<=a&&(i===-1&&(i=s.index),c=s.index);}if(i===-1){let s=ea(t,n.top);s!==null&&(i=s,c=s);}if(i!==-1){let s=Math.max(0,i-o),d=Math.min(t.pages.length-1,c+o);for(let l=s;l<=d;l+=1)r.add(l);}for(let s of e.pinnedPages??[])s>=0&&s<t.pages.length&&r.add(s);return r}function ea(e,t){let n=null,r=Number.POSITIVE_INFINITY;for(let o of e.pages){let a=t<o.box.y?o.box.y-t:t>o.box.y+o.box.height?t-(o.box.y+o.box.height):0;a<r&&(r=a,n=o.index);}return n}var Nn=["text-local","paragraph-local","flow-structural","global"];function Dn(e,t){return Nn.indexOf(t)>Nn.indexOf(e)?t:e}function ta(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function na(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,i=null,c=null,s=0,d=0;function l(m){let g=e.runCooperatively;if(!g)return t(m);let S=g(m);c=S;try{for(;;){let C=S.step();if(C)return C;if(n()!==m.revision)return S.cancel(),d+=1,null;if(c!==S)return null}}finally{c===S&&(c=null);}}function f(m){let g=y(n());g.impact=Dn(g.impact,m.impact),g.structural=g.structural||m.structural;for(let S of m.paragraphIds)g.paragraphIds.add(S);for(let S of m.created)g.created.add(S);for(let S of m.deleted)g.deleted.add(S);for(let S of m.dependencyKeys)g.dependencyKeys.add(S);}let h=m=>({impact:m.impact,paragraphIds:m.paragraphIds,created:m.created,deleted:m.deleted,dependencyKeys:m.dependencyKeys,structural:m.structural,revision:m.revision});function y(m){return a||(a=ta(m)),a.revision=Math.max(a.revision,m),a}function b(){!o||i||(i=o(()=>{i=null,x();}));}function x(){i&&(i(),i=null),c&&(c.cancel(),c=null,d+=1);let m=a;if(!m)return false;a=null;let g=h(m),S=l(g);return !S||S.revision!==n()?(s+=1,f(g),b(),false):(r(S,g),true)}return {notify(m){let g=y(n());g.impact=Dn(g.impact,m.impact);for(let S of m.dirty)g.paragraphIds.add(S);for(let S of m.created)g.created.add(S),g.paragraphIds.add(S);for(let S of m.deleted)g.deleted.add(S),g.paragraphIds.add(S);for(let S of m.dependencyKeys)g.dependencyKeys.add(S);for(let S of m.splitJoin)g.structural=true,"split"in S?(g.paragraphIds.add(S.split.from),g.paragraphIds.add(S.split.tail)):(g.paragraphIds.add(S.join.kept),g.paragraphIds.add(S.join.removed));(m.impact==="flow-structural"||m.impact==="global")&&(g.structural=true),b();},invalidateAll(m,g){let S=y(m);S.impact="flow-structural",S.structural=true,g&&S.dependencyKeys.add(g),b();},flush:x,pending:()=>a?h(a):null,cancel(){i?.(),i=null,c?.cancel(),c=null,a=null;},get staleDiscards(){return s},get cancelledRuns(){return d}}}var Hn=new WeakMap;function X(e){let t=Hn.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,i=(s,d,l,f)=>{for(let h of s){if(h.kind==="paragraph")continue;let y=h.tableId;a.set(y,Math.max(a.get(y)??0,(h.columnEdges?.length??1)-1));let b=o.get(y);b||(b=new Map,o.set(y,b),n.set(y,[]),r.set(y,new Map));for(let x of h.rows){let m=b.get(x.id);m===void 0&&(m=b.size,b.set(x.id,m),r.get(y).set(m,x.cells));for(let g of x.cells)n.get(y).push({pageIndex:d,tableId:y,row:x,cell:g,rowIndex:m,isHeaderRepeat:x.isHeaderRepeat,offsetX:l,offsetY:f}),i(g.blocks,d,l,f);}}};for(let s of e.pages){i(s.fragments,s.index,0,0);for(let d of [s.header,s.footer])d&&i(d.fragments,s.index,d.box.x-s.contentBox.x,d.box.y-s.contentBox.y);for(let d of [s.footnotes,s.endnotes])if(d)for(let l of d.notes)i(l.fragments,s.index,l.box.x-s.contentBox.x,l.box.y-s.contentBox.y);}let c=new Map;for(let[s,d]of n)c.set(s,{placed:d,rows:r.get(s)??new Map,columnCount:a.get(s)??0});return Hn.set(e,c),c}function Kn(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,Y(r).to+1);return t}var Y=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function ra(e,t,n){if(t.tableId!==n.tableId)return null;let r=X(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),i=Math.min(Y(t).from,Y(n).from),c=Math.max(Y(t).to,Y(n).to),s=y=>{let{from:b,to:x}=Y(y);return x>=i&&b<=c},d=y=>(r.rows.get(y)??[]).some(b=>b.vMergeContinue&&s(b)),l=r.rows.size+Kn(r)+2;for(let y=0;!(y>l);y+=1){let b=false;for(let[x,m]of r.rows)if(!(x<o||x>a))for(let g of m){if(!s(g))continue;let{from:S,to:C}=Y(g);S<i&&(i=S,b=true),C>c&&(c=C,b=true);}for(;o>0&&d(o);)o-=1,b=true;for(;d(a+1);)a+=1,b=true;if(!b)break}let f=[],h=new Set;for(let y of r.placed){if(y.isHeaderRepeat||y.rowIndex<o||y.rowIndex>a)continue;let{from:b,to:x}=Y(y.cell);x<i||b>c||h.has(y.cell.id)||(h.add(y.cell.id),f.push(y.cell.id));}return f.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:f,rows:{from:o,to:a},columns:{from:i,to:c},text:oa(e,t.tableId,f)}}function ji(e,t){return Vn(e,t,true)}function Be(e,t){return Vn(e,t,false)}function Vn(e,t,n){let r=new Set(t),o=[],a=new Set;for(let i of X(e).values())for(let c of i.placed)if(!(c.isHeaderRepeat||!r.has(c.cell.id)))for(let s of c.cell.blocks)n&&s.kind!=="paragraph"||ee(s,o,a);return o}function ee(e,t,n){if(e.kind==="paragraph"){for(let r of Ma(e))n.has(r)||(n.add(r),t.push(r));return}for(let r of e.rows)if(!r.isHeaderRepeat)for(let o of r.cells)for(let a of o.blocks)ee(a,t,n);}function oa(e,t,n){let r=Be(e,n),o=r[0],a=r[r.length-1];return !o||!a?aa(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:hf(e,a).length}}}function aa(e,t){let n=X(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let c of o.cell.blocks)ee(c,a,new Set);let i=a[0];if(i){let c={paragraphId:i,offset:0};return {anchor:c,head:c}}}for(let o of e.pages)for(let a of ua$1(o)){let i={paragraphId:a.paragraphId,offset:0};return {anchor:i,head:i}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function ia(e){let t=[...ua$1(e)];for(let n of [e.header,e.footer])n&&t.push(...va$1(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...va$1(r.fragments));return t}function sa(e,t){let n=new Set(Be(e,t)),r=[],o=new Set;for(let a of e.pages)for(let i of ia(a))if(n.has(i.paragraphId))for(let c of i.lines)for(let s of c.spans){let d=`${s.range.paragraphId}:${s.range.start}:${s.range.end}`;o.has(d)||(o.add(d),r.push(s));}return r}function ca(e,t){let n=new Set(t),r=[];for(let o of X(e).values())for(let a of o.placed)n.has(a.cell.id)&&r.push({pageIndex:a.pageIndex,x:a.cell.box.x+a.offsetX,y:a.cell.box.y+a.offsetY,width:a.cell.box.width,height:a.cell.box.height});return r}function la(e,t,n=hf){let r=X(e).get(t.tableId);if(!r)return "";let o=new Set(t.cellIds),a=r.placed.some(s=>s.cell.logicalGridColumn!==void 0),i=new Map,c=new Set;for(let s of r.placed){if(s.isHeaderRepeat||!o.has(s.cell.id)||c.has(s.cell.id))continue;c.add(s.cell.id);let d=Be(e,[s.cell.id]).map(h=>n(e,h)).join(`
|
|
2
|
+
`),l=i.get(s.rowIndex),f=s.cell.gridColumn+(a?Math.max(1,s.cell.gridSpan)-1:0);l?l.set(f,d):i.set(s.rowIndex,new Map([[f,d]]));}return [...i.keys()].sort((s,d)=>s-d).map(s=>{let d=i.get(s),l=[];for(let f=0;f<=t.columns.to-t.columns.from;f+=1){let h=a?t.columns.to-f:t.columns.from+f;l.push(d.get(h)??"");}return l.join(" ")}).join(`
|
|
3
|
+
`)}function dt(e,t){return ua(e).get(t)??null}var Gn=new WeakMap;function da(e){let t=Gn.get(e);if(t)return t;let n=[];for(let r of e.blocks)ee(r,n,new Set);return Gn.set(e,n),n}var Un=new WeakMap;function ua(e){let t=Un.get(e);if(t)return t;let n=new Map;for(let[r,o]of X(e)){let a;for(let i of o.placed)if(!i.isHeaderRepeat)for(let c of da(i.cell)){let s=n.get(c);s&&s.tableId.length>=r.length||(a??=Kn(o),n.set(c,{tableId:r,rows:o.rows.size,columns:a,rowIndex:i.rowIndex,columnIndex:i.cell.logicalGridColumn??i.cell.gridColumn}));}}return Un.set(e,n),n}function Yi(e,t,n){if(n){let a=dt(e,t);if(!a||a.tableId!==n.tableId)return null;let i=n.cellIds[0];if(!i)return null;let c=X(e).get(n.tableId);if(!c)return null;for(let s of c.placed)if(s.cell.id===i)return {tableId:n.tableId,rowId:s.row.id,cellId:i,cellIds:n.cellIds,gridColumnIndex:s.cell.logicalGridColumn??s.cell.gridColumn,isHeaderRepeat:s.isHeaderRepeat};return null}let r=dt(e,t);if(!r)return null;let o=X(e).get(r.tableId);if(!o)return null;for(let a of o.placed){if(a.isHeaderRepeat)continue;let i=[];for(let c of a.cell.blocks)ee(c,i,new Set);if(i.includes(t))return {tableId:r.tableId,rowId:a.row.id,cellId:a.cell.id,cellIds:[a.cell.id],gridColumnIndex:a.cell.logicalGridColumn??a.cell.gridColumn,isHeaderRepeat:a.row.isHeaderRepeat}}return null}var Wn=new WeakMap;function $i(e,t){let n=Wn.get(e);if(n)return n.get(t)??null;let r=new Map;for(let[o,a]of X(e))for(let i of a.placed){if(i.isHeaderRepeat)continue;let c=[];for(let d of i.cell.blocks)ee(d,c,new Set);let s={tableId:o,rowId:i.row.id,cellId:i.cell.id,rowIndex:i.rowIndex,gridColumn:i.cell.gridColumn,gridSpan:i.cell.gridSpan};for(let d of c){let l=r.get(d);l&&l.tableId.length>=o.length||r.set(d,s);}}return Wn.set(e,r),r.get(t)??null}function pa(e,t,n){if(![e,t,n].every(Number.isFinite)||t<=0||n<=0)return {offsetPt:0,count:0};let r=Math.ceil(e/n-1e-9)*n;if(!Number.isFinite(r))return {offsetPt:0,count:0};let o=Math.max(0,r-e);return {offsetPt:o,count:Math.min(8192,Math.max(0,Math.floor((t-o)/n+1e-9)))}}export{zn as $,cn as A,ln as B,dn as C,un as D,ro as E,oo as F,Q as G,so as H,st as I,yn as J,yo as K,go as L,D as M,xn as N,Qa as O,Rn as P,Cn as Q,vo as R,Eo as S,Lo as T,di as U,Bo as V,In as W,Uo as X,Ko as Y,V as Z,Te as _,Ye as a,Jo as aa,q as b,Qo as ba,qe as c,na as ca,$n as d,ra as da,I as e,ji as ea,Ze as f,Be as fa,et as g,sa as ga,Ea as h,ca as ha,W as i,la as ia,Vr as j,dt as ja,Xr as k,Yi as ka,wa as l,$i as la,nt as m,pa as ma,Aa as n,jr as o,$r as p,Pa as q,qr as r,rt as s,Le as t,Zr as u,Jr as v,Qr as w,at as x,an as y,sn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkANZ44KQT_cjs=require('./chunk-ANZ44KQT.cjs');var X=new Set(["document","hdr","ftr","footnotes","endnotes"]),W=24,U=512,E=chunkANZ44KQT_cjs.Bh(W);function z(o){let t=o.root;return t.namespaceUri===chunkANZ44KQT_cjs.fa&&X.has(t.localName)}function $(o){let t=[],e=r=>{if(r.kind!=="textValue"){r.namespaceUri===chunkANZ44KQT_cjs.fa&&r.localName==="p"&&t.push(r);for(let i of r.children)e(i);}};return e(o.root),t}function V(o){let t=chunkANZ44KQT_cjs.qb(o);let e=[],r=new Set;for(let i of $(t)){let n=chunkANZ44KQT_cjs.ib(i);if(!n||!chunkANZ44KQT_cjs.hb(n))continue;let a=n.toUpperCase();if(r.has(a))continue;r.add(a);let s=chunkANZ44KQT_cjs.Zj(t,i.id);s!==null&&e.push(Object.freeze({paragraphId:a,nodeId:i.id,text:s}));}return Object.freeze(e)}function Y(o){let t=E.get(o.root);if(t)return t;let e=chunkANZ44KQT_cjs.qb(o);let r=new Map,i=new Set,n=a=>{if(a.kind!=="textValue"){if(a.namespaceUri===chunkANZ44KQT_cjs.fa&&a.localName==="p"){let s=chunkANZ44KQT_cjs.ib(a);if(s&&chunkANZ44KQT_cjs.hb(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),a.kind==="paragraph"&&r.set(p,a.id));}}for(let s of a.children)n(s);}};return n(e.root),E.set(o.root,r),r}function w(o,t){if(o.length!==t.length)return false;for(let e=0;e<o.length;e+=1)if(o[e].root!==t[e])return false;return true}function B(o){let t=new Map,e=null,r=(n,a,s)=>{for(t.delete(n),t.set(n,{partName:a.name,root:a.root,nodeId:s});t.size>U;){let p=t.keys().next();if(p.done)break;t.delete(p.value);}},i=(n,a)=>{let s=t.get(n);if(!s)return null;let p=a.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=chunkANZ44KQT_cjs.Ka(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=chunkANZ44KQT_cjs.ib(l);return !d||d.toUpperCase()!==n?null:(r(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let a=o(),s=i(n,a);if(s)return s;if(e&&e.ids.has(n)&&w(a,e.roots))return null;for(let p of a){let l=Y(p).get(n);if(l!==void 0)return r(n,p,l),{part:p,nodeId:l}}return (!e||!w(a,e.roots))&&(e={roots:a.map(p=>p.root),ids:new Set}),e.ids.size<U&&e.ids.add(n),null}}function H(o,t){return chunkANZ44KQT_cjs.Ea(o,t)}var q=Object.freeze({kind:"body"}),F=1e6;function b(o,t){if(t<=0||t>=o.length)return false;let e=o.charCodeAt(t-1),r=o.charCodeAt(t);return e>=55296&&e<=56319&&r>=56320&&r<=57343}function Q(o,t,e){if(t===e)return [];let r=0,i=Math.min(t.length,e.length);for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r+=1;for(;r>0&&(b(t,r)||b(e,r));)r-=1;let n=0;for(;n<t.length-r&&n<e.length-r&&t.charCodeAt(t.length-n-1)===e.charCodeAt(e.length-n-1);)n+=1;for(;n>0&&(b(t,t.length-n)||b(e,e.length-n));)n-=1;let a=t.length-r-n,s=e.slice(r,e.length-n),p=[];return a>0&&p.push({op:"deleteText",paragraphId:o,start:r,end:r+a}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:r,text:s}),Object.freeze(p)}function K(o){let t=r=>!!r&&r.kind!=="textValue"&&r.namespaceUri===chunkANZ44KQT_cjs.fa&&r.localName==="t"&&r.attributes.every(i=>i.namespaceUri===chunkANZ44KQT_cjs.ga&&i.localName==="space")&&r.children.every(i=>i.kind==="textValue"),e=[];for(let r of o){let i=e.at(-1);if(!t(i)||!t(r)){e.push(r);continue}let n=i.children.map(a=>a.kind==="textValue"?a.value:"").join("")+r.children.map(a=>a.kind==="textValue"?a.value:"").join("");e[e.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:chunkANZ44KQT_cjs.ga,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return e}function G(o){if(o.kind==="textValue")return o;let t=false,e=o.children.map(r=>{let i=G(r);return i!==r&&(t=true),i});if(o.namespaceUri===chunkANZ44KQT_cjs.fa&&o.localName==="r"){let r=K(e);(r.length!==e.length||r.some((i,n)=>i!==e[n]))&&(e=[...r],t=true);}return t?{...o,children:e}:o}function rr(o,t,e){let r=o.parts.get(t);if(!r)return o;let i=false,n=new Set;for(let a of e)(a.op==="insertText"||a.op==="deleteText")&&!a.revision&&n.add(a.paragraphId);for(let a of n){let s=chunkANZ44KQT_cjs.Ka(r,a);if(!s||s.kind==="textValue")continue;let p=G(s);if(p===s)continue;let l=chunkANZ44KQT_cjs.Pa(r,a,p,{deferValidation:true});l.ok&&(r=l.part,i=true);}return i?chunkANZ44KQT_cjs.ne(o,r):o}function er(o,t){let e=t.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let r=()=>V(o.bodyStore().part),i,a=B(()=>{let l=o.bodyStore().part,d=o.currentPackage();if(i?.pkg===d&&i.body===l)return i.parts;let c=[l];for(let g of d.parts.values())g===l||!z(g)||c.push(g);return i={pkg:d,body:l,parts:Object.freeze(c)},i.parts}),s=(l,d)=>{if(l.length===0)return {ok:true,changed:false};let c=r(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>F)return {ok:false,reason:"collaboration-text-limit"};if(typeof u.paragraphId!="string"||u.paragraphId.length===0||u.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let m=u.paragraphId.toUpperCase();if(g.has(m))return {ok:false,reason:"duplicate-paragraph-id"};g.add(m);let N=c.filter(L=>L.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...Q(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(q,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>rr(m,m.mainDocumentPart,h));},{origin:d.origin,actorId:d.actorId,operationId:d.operationId,recordsHistory:false});return y.ok?{ok:true,changed:y.change!==null}:{ok:false,reason:y.detail??y.reason}};return Object.freeze({documentId:e,paragraphs:r,paragraphByNodeId(l){return r().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=a(d);if(!c)return null;let g=chunkANZ44KQT_cjs.Zj(c.part,c.nodeId);return g===null?null:Object.freeze({paragraphId:d,nodeId:c.nodeId,text:g})},applyParagraphText(l,d,c){return s([{paragraphId:l,text:d}],c)},applyParagraphTexts:s,applyRemotePackage(l,d){let c=o.publishRemotePackage(l,d);return c.ok?{ok:true,changed:c.change!==null}:{ok:false,reason:c.detail??c.reason}},revision:()=>o.packageRevision,subscribe:l=>o.subscribe(l),observePrimitiveJournal:l=>H(o,l),hasPendingJournals:()=>chunkANZ44KQT_cjs.Ca(o),flushPendingJournals:()=>{chunkANZ44KQT_cjs.Da(o);},save:()=>chunkANZ44KQT_cjs.me(o.currentPackage()),binaryPart(l){let d=o.currentPackage();return d.partBytes.get(l)??d.partBytes.get(l.startsWith("/")?l.slice(1):`/${l}`)??null}})}exports.a=rr;exports.b=er;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {je,Oe,Ra,ea,hb,od,le as le$1,md,bd,ne,me,Ne,ie,Ba,ee,za,Ca,ya,ta,Ia,Ue,Bc,Gb,df,Ze,$e,zc,_e}from'./chunk-XSHXBJ2J.js';import {ab,ea as ea$1,fa,ua,Ha,Ja,Pa,La}from'./chunk-L6V3IJ3S.js';import {Td,Ig,Oc,Pe,_i,$a,Uf,Sa,cd,qd,W,bd as bd$1,ad,ud,td,$c,Eh,aj,Of,fa as fa$1,sa}from'./chunk-DDGGSBAN.js';var Mt=Object.freeze({}),Et=Object.freeze([]);function Lt(e){let t=Object.keys(e);if(t.length===0)return Mt;let r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=o);}return Object.freeze(r)}function At(e){let t=new Map(Uf(e.part())),r=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!r.has(i)){r.add(i);for(let[s,d]of Uf(i))t.has(s)||t.set(s,d);}let n=e.currentPackage();for(let o of ["footnote","endnote"]){let a=Ig(n,o);if(!(!a||r.has(a))){r.add(a);for(let[i,s]of Uf(a))t.has(i)||t.set(i,s);}}return t}function Ft(e,t){let r=df(e,t);if(!r)return null;let n=e.pages[r.pageIndex];if(!n)return null;let o=Ze(n),a=$e(e,t.paragraphId,r.pageIndex),i=Object.freeze({x:r.x+a.x,y:r.y+a.y,height:r.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:r.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function Tt(e,t){let r=[];for(let n of t.values()){let o=Ft(e,n);o&&r.push(o);}return r.length===0?Et:Object.freeze(r)}function rt(e,t){return {documentMetadata:Lt(e.documentProperties()),destinations:Tt(t,At(e))}}function gr(e,t){let r=e.destinations;if(r){for(let n of r)if(n.anchor.name===t)return n}}function nt(e={}){return Object.freeze({async decode(t,r,n){let o=Td(t,r);if(!o)throw new Error(`Unsupported or malformed ${r} image`);if(o.pixelWidth>n.maxDimension||o.pixelHeight>n.maxDimension||o.pixelWidth>n.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var ot=new WeakMap;function at(e,t){let r=ot.get(e);r||(r=md(e),ot.set(e,r));let n=r.styleCascade(),o=new Set;if(t===e.part())for(let d of Bc(t,void 0,void 0,n,r.numberingIndex()))for(let h of Gb(d)?.slice(0,-1)??[])o.add(h.paragraph.id);let a=d=>{if(d.kind==="textValue")return false;let h=d.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===fa$1&&c.localName==="pPr"),f=h?.kind!=="textValue"?h?.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===fa$1&&c.localName==="rPr"):void 0;return f!==void 0&&sa(f,"vanish")},i=0,s=(d,h)=>{if(++i>qd||h>W||d.kind==="textValue")return false;if(d.kind==="paragraph"&&!o.has(d.id)&&(zc(d,n,false)||a(d))&&Of(d).length>0)return true;for(let f of d.children){if(i>=qd)break;if(s(f,h+1))return true}return false};return s(t.root,0)}var it=new WeakMap,Ct=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function Nt(e,t){let r=it.get(e.root);if(r&&r.stylesPart===t)return r.codes;let n=Sa(t),o=new Set,a=[{node:e.root,scope:cd(),depth:0,mcSelected:false,framed:false}],i=0;for(;a.length;){let{node:d,scope:h,depth:f,mcSelected:c,framed:p}=a.pop();if(++i>qd||f>W){o.add("scan-limit");break}if(d.kind==="textValue")continue;if(i+a.length+d.children.length>qd){o.add("scan-limit");break}let g=bd$1(h,d),x=p||n(d),u=ad(d)?d:void 0;if(u){if(ud(u,g).drawing)continue;let m=td(u,g);m.refused&&o.add("scan-limit"),m.branch&&a.push({node:m.branch,scope:g,depth:f+1,mcSelected:true,framed:x});continue}if(!(!c&&$c(d)&&!(x&&d.localName==="object"))){if(d.namespaceUri==="urn:schemas-microsoft-com:vml"&&d.localName==="textbox"){o.add("legacy-textbox");continue}d.namespaceUri==="urn:schemas-microsoft-com:vml"&&Ct.has(d.localName)&&!d.children.some(m=>m.kind!=="textValue"&&m.namespaceUri==="urn:schemas-microsoft-com:vml"&&m.localName==="textbox")&&o.add("legacy-drawing");for(let m of d.children)a.push({node:m,scope:g,depth:f+1,mcSelected:c,framed:x});}}let s=Object.freeze([...o]);return it.set(e.root,{stylesPart:t,codes:s}),s}function st(e){let t=new Set([e.part()]);for(let r of e.headerFooterPartsBySection())for(let n of [r.headers,r.footers])for(let o of n.values())t.add(o);for(let r of ["footnote","endnote"]){let n=Ig(e.currentPackage(),r);n&&t.add(n);}return Object.freeze([...t].flatMap(r=>[...Nt(r,Oc(e.currentPackage())),...at(e,r)?["unsupported-style-separator"]:[]].map(n=>Object.freeze({code:n,partName:r.name}))))}function ct(e){let t=e.defaultTabStopPt?.(),r=e.view.part().name,n={view:e.view,measurer:e.measurer,producer:e.producer,cache:e.cache,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,compatibilityMode:e.compatibilityMode?.(),inlineDrawingLayoutForPart:e.inlineDrawingLayoutForPart,drawingTokenForParagraphForPart:e.drawingTokenForParagraphForPart,drawingLayoutEpochForPart:e.drawingLayoutEpochForPart,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},o=je(n),a={view:e.view,revision:e.revision,measurer:e.measurer,cache:e.cache,session:e.session,producer:e.producer,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,furniture:e.furniture,compatibilityMode:e.compatibilityMode,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,inlineDrawingLayout:e.inlineDrawingLayout,drawingTokenForParagraph:e.drawingTokenForParagraph,drawingLayoutEpoch:e.drawingLayoutEpoch,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},i={measurer:a.measurer,cache:a.cache,session:a.session,producer:a.producer,styleCascade:a.styleCascade?.(),defaultTabStopPt:a.defaultTabStopPt,compatibilityMode:a.compatibilityMode?.(),numberingIndex:a.numberingIndex?.(),sectionFurniture:a.furniture.sectionFurniture(),furniture:a.furniture.furniture(),evenAndOddHeaders:a.view.headerFooterPartsBySection()[0]?.evenAndOddHeaders===true,projectLink:a.linkProjectors.projectLink,projectFieldLink:a.projectFieldLink,showFieldCodes:a.showFieldCodes,documentProperties:a.view.documentProperties(),inlineDrawingLayout:a.inlineDrawingLayout,drawingTokenForParagraph:a.drawingTokenForParagraph,drawingLayoutEpoch:a.drawingLayoutEpoch,projectionTokenForParagraph:s=>a.linkProjectors.tokenForParagraphForPart(r,s),projectionTokenForTable:s=>a.linkProjectors.tokenForTableForPart(r,s),projectionEpoch:a.linkProjectors.epochForPart(r),notes:o,displayMode:a.displayMode,revisionAuthorFilter:a.revisionAuthorFilter};return Oe(a.view.part(),a.revision,i)}var jt=65536;function lt(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function _t(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function Bt(e,t,r){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===r:true}function Vt(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let r=null;return ya(e,n=>{if(r||!Bt(t,n.story,n.noteScopeId))return;let o=n.story==="header"||n.story==="footer"?a=>ta(a,n.origin,{x:e.box.x,y:e.box.y}):void 0;Ca(n.host,(a,i)=>{if(r||i.textboxDepth===0)return;let s=i.textboxPath.map(d=>d.drawingNodeId);_t(s,t.textboxPath)&&(r=lt(e,i.storyOrigin));},n.origin,o);}),r}function Kt(e,t){if(t.story==="textbox")return Vt(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?_e(e,e.header.box):{x:0,y:0};case "footer":return e.footer?_e(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let n=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return n?_e(e,n.box):{x:0,y:0}}case "note-separator":{let r=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes,n=r?.separator?.box;return r?.continuationNotice&&Ca(r.continuationNotice,o=>{o.paragraphId===t.source.start.paragraphId&&(n=r.continuationNotice.box);}),n?_e(e,n):{x:0,y:0}}default:return {x:0,y:0}}}function pt(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function mt(e,t){let r=Ze(e);return Object.freeze({x:r.x+t.x,y:r.y+t.y,width:t.width,height:t.height})}function zt(e,t){let r=df(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!r||r.pageIndex!==t.pageIndex)return;let n=e.pages[r.pageIndex];if(!n)return;let o=Kt(n,t),a=Object.freeze([pt({x:r.x+o.x,y:r.y+o.y,width:0,height:r.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>mt(n,i)))})}function Ht(e,t,r){let n=r.filter(i=>i.pageIndex===t.pageIndex);if(n.length===0)return ft(t)?zt(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(n.map(i=>pt(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>mt(o,i)))})}function ft(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function ut(e,t){return `${e}\0${t}`}function Wt(e,t,r){let n=Math.max(e.start,t.offset),o=Math.min(e.end,r.offset);return o>n?{start:n,end:o}:null}function $t(e,t){let r=new Map,n=new Map,o=new Set,a=0;let i=(s,d)=>{if(a>=jt)return false;a+=1;let h=ut(s.pageIndex,d),f=n.get(h);return f?f.push(s):n.set(h,[s]),true};for(let[s,d]of t.entries())for(let[h,f]of d.occurrences.entries()){if(ft(f)||f.source.start.paragraphId!==f.source.end.paragraphId)continue;o.add(f.pageIndex);let c=`${s}\0${h}`,p={paragraphId:f.source.start.paragraphId,offset:f.source.start.offset},g={paragraphId:f.source.end.paragraphId,offset:f.source.end.offset},x=p.offset<=g.offset?{from:p,to:g}:{from:g,to:p};i({key:c,from:x.from,to:x.to,pageIndex:f.pageIndex},x.from.paragraphId);}if(n.size===0)return r;for(let s of e.pages)o.has(s.index)&&ya(s,d=>{let h=d.story==="header"||d.story==="footer"?f=>ta(f,d.origin,{x:s.box.x,y:s.box.y}):void 0;Ca(d.host,(f,c)=>{let p=lt(s,c.storyOrigin);for(let g of f.lines)for(let x of Ia(g)){let u=n.get(ut(s.index,x.paragraphId));if(u)for(let m of u){let w=Wt(x,m.from,m.to);if(!w)continue;let b=Ue(g,w.start,void 0,x),S=Ue(g,w.end,void 0,x,w.end>w.start),R=r.get(m.key)??[];R.push({pageIndex:s.index,x:Math.min(b,S)+p.x,y:g.box.y+p.y,width:Math.abs(S-b),height:g.box.height}),r.set(m.key,R);}}},d.origin,h);});return r}function yt(e,t){let r=false;for(let o of t)if(o.occurrences.length!==0){r=true;break}if(!r)return t;let n=$t(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,d)=>{let h=`${a}\0${d}`,f=Ht(e,s,n.get(h)??[]);return f?{...s,geometry:f}:s});return {...o,occurrences:Object.freeze(i)}})}function Ut(e){let t=new Map,r=[{node:e.root,depth:0}];for(;r.length>0;){let{node:n,depth:o}=r.pop();if(!(n.kind==="textValue"||o>64)){n.kind==="paragraph"&&!t.has(n.id)&&t.set(n.id,t.size);for(let a=n.children.length-1;a>=0;a-=1)r.push({node:n.children[a],depth:o+1});}}return t}function gt(){let e=new Map,t=n=>{let o=e.get(n.root);if(o)return o;let a=Ut(n);return e.set(n.root,a),a},r={retainRevisionItems:false,revisionSites:aj,locations:La,commentAnchors:Eh,deepOrder:t};return Object.freeze({collectReviewItems:n=>Pa(n,r),deepParagraphOrderOfPart:t})}function Gt(e,t){if(t)return true;let r=e.map(n=>n.root);for(;r.length>0;){let n=r.pop();if(_i(n))return true;if(n.kind!=="textValue")for(let o of n.children)r.push(o);}return false}function Yt(e,t){let r=[],n=new Set([t.name]),o=a=>{!a||n.has(a.name)||(n.add(a.name),r.push(a));};for(let a of Pe(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(Ig(e,"footnote")),o(Ig(e,"endnote")),r}function Xt(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return Ig(e,"footnote")?.name??null;case "endnote":return Ig(e,"endnote")?.name??null;case "note-separator":return Ig(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function qt(e,t){let r=new Map;for(let n of e){let o=t.get(n.partName),a=o?.get(n.start.paragraphId),i=o?.get(n.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),d=Math.max(a,i),h=r.get(n.partName);r.set(n.partName,{lower:Math.min(h?.lower??s,s),upper:Math.max(h?.upper??d,d)});}return r}function Jt(e,t,r,n,o){let a=new Map(r.map(c=>[c.name,o(c)])),i=qt(n,a),s=new Map,d=new Map,h=(c,p,g,x,u,m,w)=>{let b=a.get(c)?.get(u),S=i.get(c);if(b===void 0||!S||b<S.lower||b>S.upper)return;let R=s.get(c)??new Map;s.set(c,R);let V=d.get(c)??new Map;d.set(c,V);let j=JSON.stringify([p.story,p.noteScopeId,p.noteAreaKind]),X=g==="textbox"?JSON.stringify([j,"textbox",x]):j,H=R.get(u)??[],W=`${u}\0${p.page.index}\0${X}`,T=V.get(W);T||(T={pageIndex:p.page.index,story:g,rootStory:p.story,textboxPath:x,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,laneKey:X,intervals:[],intervalKeys:new Set},V.set(W,T),H.push(T),R.set(u,H));let y=`${m}\0${w}`;T.intervalKeys?.has(y)||(T.intervalKeys?.add(y),T.intervals.push({start:m,end:w}));};za(e,c=>{let p=Xt(t,c);!p||!i.has(p)||Ca(c.host,(g,x)=>{let u=x.textboxDepth>0?"textbox":c.story,m=x.textboxPath.map(b=>b.drawingNodeId),w=[];for(let b of g.lines){for(let S of b.spans)w.push(S.range);for(let S of b.drawings??[])w.push({paragraphId:S.paragraphId,start:S.start,end:S.start+1});}w.length===0&&w.push({paragraphId:g.range.paragraphId,start:g.range.start,end:g.range.end});for(let{paragraphId:b,start:S,end:R}of w)h(p,c,u,m,b,S,R);});}),Ba(e,c=>{let p=c.drawing.ownerPartName;c.drawing.accessibility.hidden||!i.has(p)||h(p,c.root,c.story,c.textboxPath.map(g=>g.drawingNodeId),c.drawing.paragraphId,c.drawing.start,c.drawing.start+1);});for(let c of s.values())for(let p of c.values())for(let g of p){g.intervals.sort((u,m)=>u.start-m.start||u.end-m.end);let x=[];for(let u of g.intervals){let m=x.at(-1);m&&u.start<=m.end?m.end=Math.max(m.end,u.end):x.push({...u});}g.intervals.splice(0,g.intervals.length,...x),g.intervalKeys=void 0;}let f=new Map;for(let[c,p]of s){let g=a.get(c);if(!g)continue;let x=[];for(let[u,m]of p){let w=g.get(u);w!==void 0&&x.push({paragraphId:u,position:w,laneKeys:new Set(m.map(({laneKey:b})=>b))});}x.sort((u,m)=>u.position-m.position),f.set(c,x);}return {byPart:s,orderByPart:a,visibleByPart:f}}function ht(e,t){let r=0,n=e.length;for(;r<n;){let o=r+n>>>1;e[o].position<t?r=o+1:n=o;}return r}function Qt(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let r=t.orderByPart.get(e.partName),n=t.visibleByPart.get(e.partName),o=r?.get(e.start.paragraphId),a=r?.get(e.end.paragraphId);if(!r||!n||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),d=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:c})=>c)??[]),h=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:c})=>c)??[]),f=new Set([...d].filter(c=>h.has(c)));return f.size===0?[e.start.paragraphId,e.end.paragraphId]:n.slice(ht(n,i),ht(n,s+1)).filter(c=>[...c.laneKeys].some(p=>f.has(p))).map(c=>c.paragraphId)}function Zt(e,t,r,n){return n?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,r)};return a.end>a.start?[a]:[]})}function er(e,t){let r=Number.NEGATIVE_INFINITY;for(let n of e)for(let o of n.intervals)r=Math.max(r,o.end);return t!==r?new Set:new Set(e.filter(n=>n.intervals.some(o=>o.end===r)))}function xt(e,t,r){let n=[],o=new Set;for(let[a,i]of e.entries()){let s=r===void 0?void 0:r===null?"neutral":a<r?"replaced":"replacement";for(let d of Qt(i,t)){let h=t.byPart.get(i.partName)?.get(d)??[],c=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,p=d===i.start.paragraphId?i.start.offset:0,g=d===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,x=c?er(h,p):new Set;for(let u of h){let m=Zt(u,p,g,c);c&&m.length===0&&x.has(u)&&(m=[{start:p,end:p}]);for(let w of m){let b=`${u.pageIndex}\0${u.story}\0${u.noteScopeId??""}\0${u.noteAreaKind??""}\0${u.textboxPath.join("\0")}\0${i.partName}\0${d}\0${w.start}\0${w.end}\0${s??""}`;o.has(b)||(o.add(b),n.push({pageIndex:u.pageIndex,physicalPageNumber:u.pageIndex+1,story:u.story,rootStory:u.rootStory,textboxPath:u.textboxPath,noteScopeId:u.noteScopeId,noteAreaKind:u.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:d,offset:w.start},end:{paragraphId:d,offset:w.end}}}));}}}}return n}function bt(e,t){let r=2166136261,n=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);r=Math.imul(r^a,16777619)>>>0,n=Math.imul(n^a+o,2246822507)>>>0,n^=n>>>13;}return `${e}_${t.length.toString(36)}_${r.toString(36)}_${n.toString(36)}`}function wt(e,t,r=bt){let n=new Map;for(let a of t){let i=r(e,a),s=n.get(i)??new Set;s.add(a),n.set(i,s);}let o=new Map;for(let[a,i]of n){let s=[...i].sort();for(let[d,h]of s.entries())o.set(h,s.length===1?a:`${a}_${d.toString(36)}`);}return o}function tr(e){let t=new Set,r=new Set;for(let n of e){if(n.kind==="comment"){t.add(n.id),n.parentId!==void 0&&t.add(n.parentId),n.parentRevisionId!==void 0&&r.add(n.parentRevisionId);for(let o of n.replyIds)t.add(o);}if(n.kind==="revision"){r.add(n.id),n.pairedWith!==void 0&&r.add(n.pairedWith);for(let o of n.replyIds)t.add(o);}}return {comment:wt("comment",t),revision:wt("change",r)}}function B(e,t,r){return e.get(r)??bt(t,r)}function rr(e,t,r){return e.kind==="revision"?{kind:"tracked-change",id:B(r.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:$a(e.text),replacedText:$a(e.replacedText),nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:B(r.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),occurrences:t?xt(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:B(r.comment,"comment",e.id),author:e.comment.author,initials:Ja(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:Ha(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:B(r.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:B(r.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),orphaned:e.orphaned,occurrences:t&&e.range?xt([e.range],t):[]}}function Pt(e,t){let r=t.parts.get(t.mainDocumentPart);if(!r)return [];let n=Yt(t,r),o=[r,...n],a=t.parts.get(ea$1(t,r.name));if(!Gt(o,a))return [];let i=gt(),s=i.collectReviewItems({storyPart:r,furnitureParts:n,commentsPart:a,commentsExtendedPart:t.parts.get(fa(t,r.name))});if(s.length===0)return [];let d=s.flatMap(c=>ua(c)),h=d.length>0?Jt(e,t,o,d,i.deepParagraphOrderOfPart):null,f=tr(s);return s.map(c=>rr(c,h,f)).filter(c=>c!==null)}var nr=new Set(["part","validatedHandle"]);function St(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Y(e,t,r,n,o){if(!(n!==void 0&&nr.has(n))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(r.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),r.add(e);try{if(Array.isArray(e)){for(let a of e)Y(a,t,r,void 0,o);Object.freeze(e);return}if(!St(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");Y(i.value,t,r,a,o);}}Object.freeze(e);}finally{r.delete(e);}}}}}function vt(e){if(!St(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let n of e.pages)if(!(n===null||typeof n!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(n,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),Y(i,new Set,s,o),t.add(i);}let r=(n,o)=>{let a=new Set;for(let i of n){let s=new Set;s.add(e),Y(i,a,s,void 0,o);}Object.freeze(n);};for(let n of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,n);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(n==="pages"&&Array.isArray(o.value)){r(o.value,t);continue}if(n==="reviewArtifacts"&&Array.isArray(o.value)){r(o.value);continue}let a=new Set;a.add(e),Y(o.value,new Set,a,n);}return Object.freeze(e),e}var or=Object.freeze([]),k=class extends Error{constructor(r,n,o){super(n,o);this.code=r;this.name="ExportResourceError";}code};function ar(e){try{return e instanceof k}catch{return false}}function ir(e){try{return e instanceof ee}catch{return false}}function sr(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function cr(e){if(ar(e))return e;let t=ir(e),r=sr(e),n=r?`: ${r}`:"",o=new k(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${n}`:`Export layout failed${n}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function dr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function It(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var ur=50,le=64;function lr(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function pr(e){let t=false;return Ba(e,({drawing:r})=>{lr(r.resource)&&(t=true);}),t}function Rt(e){return !ArrayBuffer.isView(e)}function Mn(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let r=It(t.displayMode??Ra),n=Rt(e),o=Rt(e)?{ok:true,view:e}:ab(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??n,s=dr(t.resourceTimeoutMs),d=t.measurer??ea(),h=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),f=hb({retainAcrossPasses:i}),c=0,p=new Set,g=()=>{c+=1;for(let y of p)y();p.clear();},x=od({session:a,decodePort:t.imageDecodePort??nt(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:g}),u={view:a,measurer:d,paragraphCache:f,sessions:new Map,completed:new Map,inFlight:new Map,styles:md(a),fieldLinks:new Map,links:le$1(a),drawingBundle:x,furniture:new Map},m=new AbortController,w=t.signal,b=false,S=()=>b?new k("aborted","Export resource settlement was aborted"):new k("disposed","Export session has been disposed"),R=()=>{b=true,V();};function V(){let y=u;if(y){u=null,w?.removeEventListener("abort",R),m.abort(w?.reason),y.drawingBundle.dispose(),y.paragraphCache.clear();for(let P of y.completed.values())bd(P.internal),ne(P.internal);for(let P of y.fieldLinks.values())P.registry.clear();y.fieldLinks.clear(),y.completed.clear(),y.inFlight.clear(),y.furniture.clear(),y.sessions.clear(),g();}}w?.addEventListener("abort",R,{once:true}),w?.aborted&&R();let j=()=>{if(!u)throw S();if(m.signal.aborted)throw new k("aborted","Export resource settlement was aborted")},X=(y,P,D,l)=>c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D?Promise.resolve():(j(),new Promise((_,O)=>{let M=false,C,E=A=>{M||(M=true,C!==void 0&&clearTimeout(C),p.delete(L),m.signal.removeEventListener("abort",$),A?O(A):_());},L=()=>E(),$=()=>E(new k("aborted","Export resource settlement was aborted")),U=()=>{if(u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}let A=l-Date.now();if(A<=0){E(new k("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(U,Math.min(ur,A));};if(p.add(L),m.signal.addEventListener("abort",$,{once:true}),c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}U();})),H=async(y,P=0,D=Date.now()+s)=>{if(j(),Date.now()>=D)throw new k("timedOut",`Export layout did not stabilize within ${s}ms`);let l=u,_=D,O=l.view.packageRevision(),M=l.view.currentPackage(),C=l.completed.get(y);if(C&&C.revision===O&&C.pkg===M)return C.published;let E=()=>{if(l.view.packageRevision()===O&&l.view.currentPackage()===M)return null;if(P>=le-1)throw new k("nonConvergent","Document revision did not stabilize during export layout");return H(y,P+1,_)},L=l.fieldLinks.get(y);if(!L||L.revision!==O||L.pkg!==M){let I=L?.registry??me();I.clear(),L={revision:O,pkg:M,registry:I},l.fieldLinks.set(y,L),l.furniture.delete(y);}let $=L.registry,U=l.sessions.get(y)??Ne();l.sessions.set(y,U);let A=l.furniture.get(y);A||(A=ie({view:l.view,measurer:l.measurer,producer:h,cache:l.paragraphCache,styleCascade:l.styles.styleCascade,numberingIndex:l.styles.numberingIndex,defaultTabStopPt:l.styles.defaultTabStopPt,compatibilityMode:l.styles.compatibilityMode,displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false,inlineDrawingLayoutForPart:I=>l.drawingBundle.contextForPart(I),drawingLayoutTokenForPart:I=>l.drawingBundle.cacheTokenForPart(I),drawingTokenForParagraphForPart:(I,ne)=>l.drawingBundle.drawingTokenForParagraph(ne,I),linkProjectors:l.links,projectFieldLink:I=>$.project(I)}),l.furniture.set(y,A));for(let I=0;I<le;I+=1){let ne$1=c;l.drawingBundle.sync(l.view);let pe=E();if(pe)return pe;let N=ct({view:l.view,revision:l.view.packageRevision(),measurer:l.measurer,cache:l.paragraphCache,session:U,producer:h,styleCascade:l.styles.styleCascade,defaultTabStopPt:l.styles.defaultTabStopPt,numberingIndex:l.styles.numberingIndex,furniture:A,compatibilityMode:l.styles.compatibilityMode,linkProjectors:l.links,projectFieldLink:v=>$.project(v),inlineDrawingLayout:l.drawingBundle.bodyContext,inlineDrawingLayoutForPart:v=>l.drawingBundle.contextForPart(v),drawingTokenForParagraph:v=>l.drawingBundle.drawingTokenForParagraph(v,l.view.part().name),drawingTokenForParagraphForPart:(v,q)=>l.drawingBundle.drawingTokenForParagraph(q,v),drawingLayoutEpoch:l.drawingBundle.cacheTokenForPart(l.view.part().name),drawingLayoutEpochForPart:v=>l.drawingBundle.cacheTokenForPart(v),displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false});if(!pr(N)){let v=E();if(v)return v;i||(bd(N),ne(N),l.paragraphCache.clear(),l.sessions.delete(y),l.furniture.delete(y));let q=Pt(N,M),Ot=q.length===0?or:Object.freeze(yt(N,q)),kt=rt(l.view,N),Dt={...N,...kt,contentWarnings:st(l.view),reviewArtifacts:Ot},ye=vt(Dt);return l.completed.set(y,{revision:O,pkg:M,internal:N,published:ye}),ye}let me=ne$1;for(;l.drawingBundle.pendingResourceCount()>0;){await X(me,O,M,_),me=c,j();let v=E();if(v)return v}j();let fe=E();if(fe)return fe}throw new k("nonConvergent",`Image resources did not reach quiescence after ${le} layout passes`)},W=y=>{let P;try{P=It(y);}catch(O){return Promise.reject(O)}if(!u)return Promise.reject(S());let D=u,l=D.inFlight.get(P);if(l)return l;let _=H(P).catch(O=>{throw cr(O)}).finally(()=>D.inFlight.delete(P));return D.inFlight.set(P,_),_};return {ok:true,session:{layout:()=>W(r),layoutFor:W,validatedImageBytes(y){let P=u;return !P||y.resource.kind!=="ready"?null:P.drawingBundle.mintValidatedBytes(y.resource.validatedHandle,y.resource.contentId)?.slice()??null},dispose:V}}}export{ct as a,gr as b,nt as c,k as d,Mn as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkUJL2GDIM_cjs=require('./chunk-UJL2GDIM.cjs'),chunkSUN62YU6_cjs=require('./chunk-SUN62YU6.cjs'),chunkANZ44KQT_cjs=require('./chunk-ANZ44KQT.cjs');var Mt=Object.freeze({}),Et=Object.freeze([]);function Lt(e){let t=Object.keys(e);if(t.length===0)return Mt;let r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=o);}return Object.freeze(r)}function At(e){let t=new Map(chunkANZ44KQT_cjs.Uf(e.part())),r=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!r.has(i)){r.add(i);for(let[s,d]of chunkANZ44KQT_cjs.Uf(i))t.has(s)||t.set(s,d);}let n=e.currentPackage();for(let o of ["footnote","endnote"]){let a=chunkANZ44KQT_cjs.Ig(n,o);if(!(!a||r.has(a))){r.add(a);for(let[i,s]of chunkANZ44KQT_cjs.Uf(a))t.has(i)||t.set(i,s);}}return t}function Ft(e,t){let r=chunkUJL2GDIM_cjs.df(e,t);if(!r)return null;let n=e.pages[r.pageIndex];if(!n)return null;let o=chunkUJL2GDIM_cjs.Ze(n),a=chunkUJL2GDIM_cjs.$e(e,t.paragraphId,r.pageIndex),i=Object.freeze({x:r.x+a.x,y:r.y+a.y,height:r.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:r.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function Tt(e,t){let r=[];for(let n of t.values()){let o=Ft(e,n);o&&r.push(o);}return r.length===0?Et:Object.freeze(r)}function rt(e,t){return {documentMetadata:Lt(e.documentProperties()),destinations:Tt(t,At(e))}}function gr(e,t){let r=e.destinations;if(r){for(let n of r)if(n.anchor.name===t)return n}}function nt(e={}){return Object.freeze({async decode(t,r,n){let o=chunkANZ44KQT_cjs.Td(t,r);if(!o)throw new Error(`Unsupported or malformed ${r} image`);if(o.pixelWidth>n.maxDimension||o.pixelHeight>n.maxDimension||o.pixelWidth>n.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var ot=new WeakMap;function at(e,t){let r=ot.get(e);r||(r=chunkUJL2GDIM_cjs.md(e),ot.set(e,r));let n=r.styleCascade(),o=new Set;if(t===e.part())for(let d of chunkUJL2GDIM_cjs.Bc(t,void 0,void 0,n,r.numberingIndex()))for(let h of chunkUJL2GDIM_cjs.Gb(d)?.slice(0,-1)??[])o.add(h.paragraph.id);let a=d=>{if(d.kind==="textValue")return false;let h=d.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===chunkANZ44KQT_cjs.fa&&c.localName==="pPr"),f=h?.kind!=="textValue"?h?.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===chunkANZ44KQT_cjs.fa&&c.localName==="rPr"):void 0;return f!==void 0&&chunkANZ44KQT_cjs.sa(f,"vanish")},i=0,s=(d,h)=>{if(++i>chunkANZ44KQT_cjs.qd||h>chunkANZ44KQT_cjs.W||d.kind==="textValue")return false;if(d.kind==="paragraph"&&!o.has(d.id)&&(chunkUJL2GDIM_cjs.zc(d,n,false)||a(d))&&chunkANZ44KQT_cjs.Of(d).length>0)return true;for(let f of d.children){if(i>=chunkANZ44KQT_cjs.qd)break;if(s(f,h+1))return true}return false};return s(t.root,0)}var it=new WeakMap,Ct=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function Nt(e,t){let r=it.get(e.root);if(r&&r.stylesPart===t)return r.codes;let n=chunkANZ44KQT_cjs.Sa(t),o=new Set,a=[{node:e.root,scope:chunkANZ44KQT_cjs.cd(),depth:0,mcSelected:false,framed:false}],i=0;for(;a.length;){let{node:d,scope:h,depth:f,mcSelected:c,framed:p}=a.pop();if(++i>chunkANZ44KQT_cjs.qd||f>chunkANZ44KQT_cjs.W){o.add("scan-limit");break}if(d.kind==="textValue")continue;if(i+a.length+d.children.length>chunkANZ44KQT_cjs.qd){o.add("scan-limit");break}let g=chunkANZ44KQT_cjs.bd(h,d),x=p||n(d),u=chunkANZ44KQT_cjs.ad(d)?d:void 0;if(u){if(chunkANZ44KQT_cjs.ud(u,g).drawing)continue;let m=chunkANZ44KQT_cjs.td(u,g);m.refused&&o.add("scan-limit"),m.branch&&a.push({node:m.branch,scope:g,depth:f+1,mcSelected:true,framed:x});continue}if(!(!c&&chunkANZ44KQT_cjs.$c(d)&&!(x&&d.localName==="object"))){if(d.namespaceUri==="urn:schemas-microsoft-com:vml"&&d.localName==="textbox"){o.add("legacy-textbox");continue}d.namespaceUri==="urn:schemas-microsoft-com:vml"&&Ct.has(d.localName)&&!d.children.some(m=>m.kind!=="textValue"&&m.namespaceUri==="urn:schemas-microsoft-com:vml"&&m.localName==="textbox")&&o.add("legacy-drawing");for(let m of d.children)a.push({node:m,scope:g,depth:f+1,mcSelected:c,framed:x});}}let s=Object.freeze([...o]);return it.set(e.root,{stylesPart:t,codes:s}),s}function st(e){let t=new Set([e.part()]);for(let r of e.headerFooterPartsBySection())for(let n of [r.headers,r.footers])for(let o of n.values())t.add(o);for(let r of ["footnote","endnote"]){let n=chunkANZ44KQT_cjs.Ig(e.currentPackage(),r);n&&t.add(n);}return Object.freeze([...t].flatMap(r=>[...Nt(r,chunkANZ44KQT_cjs.Oc(e.currentPackage())),...at(e,r)?["unsupported-style-separator"]:[]].map(n=>Object.freeze({code:n,partName:r.name}))))}function ct(e){let t=e.defaultTabStopPt?.(),r=e.view.part().name,n={view:e.view,measurer:e.measurer,producer:e.producer,cache:e.cache,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,compatibilityMode:e.compatibilityMode?.(),inlineDrawingLayoutForPart:e.inlineDrawingLayoutForPart,drawingTokenForParagraphForPart:e.drawingTokenForParagraphForPart,drawingLayoutEpochForPart:e.drawingLayoutEpochForPart,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},o=chunkUJL2GDIM_cjs.je(n),a={view:e.view,revision:e.revision,measurer:e.measurer,cache:e.cache,session:e.session,producer:e.producer,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,furniture:e.furniture,compatibilityMode:e.compatibilityMode,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,inlineDrawingLayout:e.inlineDrawingLayout,drawingTokenForParagraph:e.drawingTokenForParagraph,drawingLayoutEpoch:e.drawingLayoutEpoch,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},i={measurer:a.measurer,cache:a.cache,session:a.session,producer:a.producer,styleCascade:a.styleCascade?.(),defaultTabStopPt:a.defaultTabStopPt,compatibilityMode:a.compatibilityMode?.(),numberingIndex:a.numberingIndex?.(),sectionFurniture:a.furniture.sectionFurniture(),furniture:a.furniture.furniture(),evenAndOddHeaders:a.view.headerFooterPartsBySection()[0]?.evenAndOddHeaders===true,projectLink:a.linkProjectors.projectLink,projectFieldLink:a.projectFieldLink,showFieldCodes:a.showFieldCodes,documentProperties:a.view.documentProperties(),inlineDrawingLayout:a.inlineDrawingLayout,drawingTokenForParagraph:a.drawingTokenForParagraph,drawingLayoutEpoch:a.drawingLayoutEpoch,projectionTokenForParagraph:s=>a.linkProjectors.tokenForParagraphForPart(r,s),projectionTokenForTable:s=>a.linkProjectors.tokenForTableForPart(r,s),projectionEpoch:a.linkProjectors.epochForPart(r),notes:o,displayMode:a.displayMode,revisionAuthorFilter:a.revisionAuthorFilter};return chunkUJL2GDIM_cjs.Oe(a.view.part(),a.revision,i)}var jt=65536;function lt(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function _t(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function Bt(e,t,r){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===r:true}function Vt(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let r=null;return chunkUJL2GDIM_cjs.ya(e,n=>{if(r||!Bt(t,n.story,n.noteScopeId))return;let o=n.story==="header"||n.story==="footer"?a=>chunkUJL2GDIM_cjs.ta(a,n.origin,{x:e.box.x,y:e.box.y}):void 0;chunkUJL2GDIM_cjs.Ca(n.host,(a,i)=>{if(r||i.textboxDepth===0)return;let s=i.textboxPath.map(d=>d.drawingNodeId);_t(s,t.textboxPath)&&(r=lt(e,i.storyOrigin));},n.origin,o);}),r}function Kt(e,t){if(t.story==="textbox")return Vt(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?chunkUJL2GDIM_cjs._e(e,e.header.box):{x:0,y:0};case "footer":return e.footer?chunkUJL2GDIM_cjs._e(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let n=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return n?chunkUJL2GDIM_cjs._e(e,n.box):{x:0,y:0}}case "note-separator":{let r=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes,n=r?.separator?.box;return r?.continuationNotice&&chunkUJL2GDIM_cjs.Ca(r.continuationNotice,o=>{o.paragraphId===t.source.start.paragraphId&&(n=r.continuationNotice.box);}),n?chunkUJL2GDIM_cjs._e(e,n):{x:0,y:0}}default:return {x:0,y:0}}}function pt(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function mt(e,t){let r=chunkUJL2GDIM_cjs.Ze(e);return Object.freeze({x:r.x+t.x,y:r.y+t.y,width:t.width,height:t.height})}function zt(e,t){let r=chunkUJL2GDIM_cjs.df(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!r||r.pageIndex!==t.pageIndex)return;let n=e.pages[r.pageIndex];if(!n)return;let o=Kt(n,t),a=Object.freeze([pt({x:r.x+o.x,y:r.y+o.y,width:0,height:r.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>mt(n,i)))})}function Ht(e,t,r){let n=r.filter(i=>i.pageIndex===t.pageIndex);if(n.length===0)return ft(t)?zt(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(n.map(i=>pt(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>mt(o,i)))})}function ft(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function ut(e,t){return `${e}\0${t}`}function Wt(e,t,r){let n=Math.max(e.start,t.offset),o=Math.min(e.end,r.offset);return o>n?{start:n,end:o}:null}function $t(e,t){let r=new Map,n=new Map,o=new Set,a=0;let i=(s,d)=>{if(a>=jt)return false;a+=1;let h=ut(s.pageIndex,d),f=n.get(h);return f?f.push(s):n.set(h,[s]),true};for(let[s,d]of t.entries())for(let[h,f]of d.occurrences.entries()){if(ft(f)||f.source.start.paragraphId!==f.source.end.paragraphId)continue;o.add(f.pageIndex);let c=`${s}\0${h}`,p={paragraphId:f.source.start.paragraphId,offset:f.source.start.offset},g={paragraphId:f.source.end.paragraphId,offset:f.source.end.offset},x=p.offset<=g.offset?{from:p,to:g}:{from:g,to:p};i({key:c,from:x.from,to:x.to,pageIndex:f.pageIndex},x.from.paragraphId);}if(n.size===0)return r;for(let s of e.pages)o.has(s.index)&&chunkUJL2GDIM_cjs.ya(s,d=>{let h=d.story==="header"||d.story==="footer"?f=>chunkUJL2GDIM_cjs.ta(f,d.origin,{x:s.box.x,y:s.box.y}):void 0;chunkUJL2GDIM_cjs.Ca(d.host,(f,c)=>{let p=lt(s,c.storyOrigin);for(let g of f.lines)for(let x of chunkUJL2GDIM_cjs.Ia(g)){let u=n.get(ut(s.index,x.paragraphId));if(u)for(let m of u){let w=Wt(x,m.from,m.to);if(!w)continue;let b=chunkUJL2GDIM_cjs.Ue(g,w.start,void 0,x),S=chunkUJL2GDIM_cjs.Ue(g,w.end,void 0,x,w.end>w.start),R=r.get(m.key)??[];R.push({pageIndex:s.index,x:Math.min(b,S)+p.x,y:g.box.y+p.y,width:Math.abs(S-b),height:g.box.height}),r.set(m.key,R);}}},d.origin,h);});return r}function yt(e,t){let r=false;for(let o of t)if(o.occurrences.length!==0){r=true;break}if(!r)return t;let n=$t(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,d)=>{let h=`${a}\0${d}`,f=Ht(e,s,n.get(h)??[]);return f?{...s,geometry:f}:s});return {...o,occurrences:Object.freeze(i)}})}function Ut(e){let t=new Map,r=[{node:e.root,depth:0}];for(;r.length>0;){let{node:n,depth:o}=r.pop();if(!(n.kind==="textValue"||o>64)){n.kind==="paragraph"&&!t.has(n.id)&&t.set(n.id,t.size);for(let a=n.children.length-1;a>=0;a-=1)r.push({node:n.children[a],depth:o+1});}}return t}function gt(){let e=new Map,t=n=>{let o=e.get(n.root);if(o)return o;let a=Ut(n);return e.set(n.root,a),a},r={retainRevisionItems:false,revisionSites:chunkANZ44KQT_cjs.aj,locations:chunkSUN62YU6_cjs.La,commentAnchors:chunkANZ44KQT_cjs.Eh,deepOrder:t};return Object.freeze({collectReviewItems:n=>chunkSUN62YU6_cjs.Pa(n,r),deepParagraphOrderOfPart:t})}function Gt(e,t){if(t)return true;let r=e.map(n=>n.root);for(;r.length>0;){let n=r.pop();if(chunkANZ44KQT_cjs._i(n))return true;if(n.kind!=="textValue")for(let o of n.children)r.push(o);}return false}function Yt(e,t){let r=[],n=new Set([t.name]),o=a=>{!a||n.has(a.name)||(n.add(a.name),r.push(a));};for(let a of chunkANZ44KQT_cjs.Pe(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(chunkANZ44KQT_cjs.Ig(e,"footnote")),o(chunkANZ44KQT_cjs.Ig(e,"endnote")),r}function Xt(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return chunkANZ44KQT_cjs.Ig(e,"footnote")?.name??null;case "endnote":return chunkANZ44KQT_cjs.Ig(e,"endnote")?.name??null;case "note-separator":return chunkANZ44KQT_cjs.Ig(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function qt(e,t){let r=new Map;for(let n of e){let o=t.get(n.partName),a=o?.get(n.start.paragraphId),i=o?.get(n.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),d=Math.max(a,i),h=r.get(n.partName);r.set(n.partName,{lower:Math.min(h?.lower??s,s),upper:Math.max(h?.upper??d,d)});}return r}function Jt(e,t,r,n,o){let a=new Map(r.map(c=>[c.name,o(c)])),i=qt(n,a),s=new Map,d=new Map,h=(c,p,g,x,u,m,w)=>{let b=a.get(c)?.get(u),S=i.get(c);if(b===void 0||!S||b<S.lower||b>S.upper)return;let R=s.get(c)??new Map;s.set(c,R);let V=d.get(c)??new Map;d.set(c,V);let j=JSON.stringify([p.story,p.noteScopeId,p.noteAreaKind]),X=g==="textbox"?JSON.stringify([j,"textbox",x]):j,H=R.get(u)??[],W=`${u}\0${p.page.index}\0${X}`,T=V.get(W);T||(T={pageIndex:p.page.index,story:g,rootStory:p.story,textboxPath:x,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,laneKey:X,intervals:[],intervalKeys:new Set},V.set(W,T),H.push(T),R.set(u,H));let y=`${m}\0${w}`;T.intervalKeys?.has(y)||(T.intervalKeys?.add(y),T.intervals.push({start:m,end:w}));};chunkUJL2GDIM_cjs.za(e,c=>{let p=Xt(t,c);!p||!i.has(p)||chunkUJL2GDIM_cjs.Ca(c.host,(g,x)=>{let u=x.textboxDepth>0?"textbox":c.story,m=x.textboxPath.map(b=>b.drawingNodeId),w=[];for(let b of g.lines){for(let S of b.spans)w.push(S.range);for(let S of b.drawings??[])w.push({paragraphId:S.paragraphId,start:S.start,end:S.start+1});}w.length===0&&w.push({paragraphId:g.range.paragraphId,start:g.range.start,end:g.range.end});for(let{paragraphId:b,start:S,end:R}of w)h(p,c,u,m,b,S,R);});}),chunkUJL2GDIM_cjs.Ba(e,c=>{let p=c.drawing.ownerPartName;c.drawing.accessibility.hidden||!i.has(p)||h(p,c.root,c.story,c.textboxPath.map(g=>g.drawingNodeId),c.drawing.paragraphId,c.drawing.start,c.drawing.start+1);});for(let c of s.values())for(let p of c.values())for(let g of p){g.intervals.sort((u,m)=>u.start-m.start||u.end-m.end);let x=[];for(let u of g.intervals){let m=x.at(-1);m&&u.start<=m.end?m.end=Math.max(m.end,u.end):x.push({...u});}g.intervals.splice(0,g.intervals.length,...x),g.intervalKeys=void 0;}let f=new Map;for(let[c,p]of s){let g=a.get(c);if(!g)continue;let x=[];for(let[u,m]of p){let w=g.get(u);w!==void 0&&x.push({paragraphId:u,position:w,laneKeys:new Set(m.map(({laneKey:b})=>b))});}x.sort((u,m)=>u.position-m.position),f.set(c,x);}return {byPart:s,orderByPart:a,visibleByPart:f}}function ht(e,t){let r=0,n=e.length;for(;r<n;){let o=r+n>>>1;e[o].position<t?r=o+1:n=o;}return r}function Qt(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let r=t.orderByPart.get(e.partName),n=t.visibleByPart.get(e.partName),o=r?.get(e.start.paragraphId),a=r?.get(e.end.paragraphId);if(!r||!n||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),d=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:c})=>c)??[]),h=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:c})=>c)??[]),f=new Set([...d].filter(c=>h.has(c)));return f.size===0?[e.start.paragraphId,e.end.paragraphId]:n.slice(ht(n,i),ht(n,s+1)).filter(c=>[...c.laneKeys].some(p=>f.has(p))).map(c=>c.paragraphId)}function Zt(e,t,r,n){return n?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,r)};return a.end>a.start?[a]:[]})}function er(e,t){let r=Number.NEGATIVE_INFINITY;for(let n of e)for(let o of n.intervals)r=Math.max(r,o.end);return t!==r?new Set:new Set(e.filter(n=>n.intervals.some(o=>o.end===r)))}function xt(e,t,r){let n=[],o=new Set;for(let[a,i]of e.entries()){let s=r===void 0?void 0:r===null?"neutral":a<r?"replaced":"replacement";for(let d of Qt(i,t)){let h=t.byPart.get(i.partName)?.get(d)??[],c=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,p=d===i.start.paragraphId?i.start.offset:0,g=d===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,x=c?er(h,p):new Set;for(let u of h){let m=Zt(u,p,g,c);c&&m.length===0&&x.has(u)&&(m=[{start:p,end:p}]);for(let w of m){let b=`${u.pageIndex}\0${u.story}\0${u.noteScopeId??""}\0${u.noteAreaKind??""}\0${u.textboxPath.join("\0")}\0${i.partName}\0${d}\0${w.start}\0${w.end}\0${s??""}`;o.has(b)||(o.add(b),n.push({pageIndex:u.pageIndex,physicalPageNumber:u.pageIndex+1,story:u.story,rootStory:u.rootStory,textboxPath:u.textboxPath,noteScopeId:u.noteScopeId,noteAreaKind:u.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:d,offset:w.start},end:{paragraphId:d,offset:w.end}}}));}}}}return n}function bt(e,t){let r=2166136261,n=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);r=Math.imul(r^a,16777619)>>>0,n=Math.imul(n^a+o,2246822507)>>>0,n^=n>>>13;}return `${e}_${t.length.toString(36)}_${r.toString(36)}_${n.toString(36)}`}function wt(e,t,r=bt){let n=new Map;for(let a of t){let i=r(e,a),s=n.get(i)??new Set;s.add(a),n.set(i,s);}let o=new Map;for(let[a,i]of n){let s=[...i].sort();for(let[d,h]of s.entries())o.set(h,s.length===1?a:`${a}_${d.toString(36)}`);}return o}function tr(e){let t=new Set,r=new Set;for(let n of e){if(n.kind==="comment"){t.add(n.id),n.parentId!==void 0&&t.add(n.parentId),n.parentRevisionId!==void 0&&r.add(n.parentRevisionId);for(let o of n.replyIds)t.add(o);}if(n.kind==="revision"){r.add(n.id),n.pairedWith!==void 0&&r.add(n.pairedWith);for(let o of n.replyIds)t.add(o);}}return {comment:wt("comment",t),revision:wt("change",r)}}function B(e,t,r){return e.get(r)??bt(t,r)}function rr(e,t,r){return e.kind==="revision"?{kind:"tracked-change",id:B(r.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:chunkANZ44KQT_cjs.$a(e.text),replacedText:chunkANZ44KQT_cjs.$a(e.replacedText),nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:B(r.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),occurrences:t?xt(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:B(r.comment,"comment",e.id),author:e.comment.author,initials:chunkSUN62YU6_cjs.Ja(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:chunkSUN62YU6_cjs.Ha(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:B(r.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:B(r.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),orphaned:e.orphaned,occurrences:t&&e.range?xt([e.range],t):[]}}function Pt(e,t){let r=t.parts.get(t.mainDocumentPart);if(!r)return [];let n=Yt(t,r),o=[r,...n],a=t.parts.get(chunkSUN62YU6_cjs.ea(t,r.name));if(!Gt(o,a))return [];let i=gt(),s=i.collectReviewItems({storyPart:r,furnitureParts:n,commentsPart:a,commentsExtendedPart:t.parts.get(chunkSUN62YU6_cjs.fa(t,r.name))});if(s.length===0)return [];let d=s.flatMap(c=>chunkSUN62YU6_cjs.ua(c)),h=d.length>0?Jt(e,t,o,d,i.deepParagraphOrderOfPart):null,f=tr(s);return s.map(c=>rr(c,h,f)).filter(c=>c!==null)}var nr=new Set(["part","validatedHandle"]);function St(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Y(e,t,r,n,o){if(!(n!==void 0&&nr.has(n))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(r.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),r.add(e);try{if(Array.isArray(e)){for(let a of e)Y(a,t,r,void 0,o);Object.freeze(e);return}if(!St(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");Y(i.value,t,r,a,o);}}Object.freeze(e);}finally{r.delete(e);}}}}}function vt(e){if(!St(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let n of e.pages)if(!(n===null||typeof n!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(n,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),Y(i,new Set,s,o),t.add(i);}let r=(n,o)=>{let a=new Set;for(let i of n){let s=new Set;s.add(e),Y(i,a,s,void 0,o);}Object.freeze(n);};for(let n of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,n);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(n==="pages"&&Array.isArray(o.value)){r(o.value,t);continue}if(n==="reviewArtifacts"&&Array.isArray(o.value)){r(o.value);continue}let a=new Set;a.add(e),Y(o.value,new Set,a,n);}return Object.freeze(e),e}var or=Object.freeze([]),k=class extends Error{constructor(r,n,o){super(n,o);this.code=r;this.name="ExportResourceError";}code};function ar(e){try{return e instanceof k}catch{return false}}function ir(e){try{return e instanceof chunkUJL2GDIM_cjs.ee}catch{return false}}function sr(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function cr(e){if(ar(e))return e;let t=ir(e),r=sr(e),n=r?`: ${r}`:"",o=new k(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${n}`:`Export layout failed${n}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function dr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function It(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var ur=50,le=64;function lr(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function pr(e){let t=false;return chunkUJL2GDIM_cjs.Ba(e,({drawing:r})=>{lr(r.resource)&&(t=true);}),t}function Rt(e){return !ArrayBuffer.isView(e)}function Mn(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let r=It(t.displayMode??chunkUJL2GDIM_cjs.Ra),n=Rt(e),o=Rt(e)?{ok:true,view:e}:chunkSUN62YU6_cjs.ab(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??n,s=dr(t.resourceTimeoutMs),d=t.measurer??chunkUJL2GDIM_cjs.ea(),h=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),f=chunkUJL2GDIM_cjs.hb({retainAcrossPasses:i}),c=0,p=new Set,g=()=>{c+=1;for(let y of p)y();p.clear();},x=chunkUJL2GDIM_cjs.od({session:a,decodePort:t.imageDecodePort??nt(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:g}),u={view:a,measurer:d,paragraphCache:f,sessions:new Map,completed:new Map,inFlight:new Map,styles:chunkUJL2GDIM_cjs.md(a),fieldLinks:new Map,links:chunkUJL2GDIM_cjs.le(a),drawingBundle:x,furniture:new Map},m=new AbortController,w=t.signal,b=false,S=()=>b?new k("aborted","Export resource settlement was aborted"):new k("disposed","Export session has been disposed"),R=()=>{b=true,V();};function V(){let y=u;if(y){u=null,w?.removeEventListener("abort",R),m.abort(w?.reason),y.drawingBundle.dispose(),y.paragraphCache.clear();for(let P of y.completed.values())chunkUJL2GDIM_cjs.bd(P.internal),chunkUJL2GDIM_cjs.ne(P.internal);for(let P of y.fieldLinks.values())P.registry.clear();y.fieldLinks.clear(),y.completed.clear(),y.inFlight.clear(),y.furniture.clear(),y.sessions.clear(),g();}}w?.addEventListener("abort",R,{once:true}),w?.aborted&&R();let j=()=>{if(!u)throw S();if(m.signal.aborted)throw new k("aborted","Export resource settlement was aborted")},X=(y,P,D,l)=>c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D?Promise.resolve():(j(),new Promise((_,O)=>{let M=false,C,E=A=>{M||(M=true,C!==void 0&&clearTimeout(C),p.delete(L),m.signal.removeEventListener("abort",$),A?O(A):_());},L=()=>E(),$=()=>E(new k("aborted","Export resource settlement was aborted")),U=()=>{if(u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}let A=l-Date.now();if(A<=0){E(new k("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(U,Math.min(ur,A));};if(p.add(L),m.signal.addEventListener("abort",$,{once:true}),c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}U();})),H=async(y,P=0,D=Date.now()+s)=>{if(j(),Date.now()>=D)throw new k("timedOut",`Export layout did not stabilize within ${s}ms`);let l=u,_=D,O=l.view.packageRevision(),M=l.view.currentPackage(),C=l.completed.get(y);if(C&&C.revision===O&&C.pkg===M)return C.published;let E=()=>{if(l.view.packageRevision()===O&&l.view.currentPackage()===M)return null;if(P>=le-1)throw new k("nonConvergent","Document revision did not stabilize during export layout");return H(y,P+1,_)},L=l.fieldLinks.get(y);if(!L||L.revision!==O||L.pkg!==M){let I=L?.registry??chunkUJL2GDIM_cjs.me();I.clear(),L={revision:O,pkg:M,registry:I},l.fieldLinks.set(y,L),l.furniture.delete(y);}let $=L.registry,U=l.sessions.get(y)??chunkUJL2GDIM_cjs.Ne();l.sessions.set(y,U);let A=l.furniture.get(y);A||(A=chunkUJL2GDIM_cjs.ie({view:l.view,measurer:l.measurer,producer:h,cache:l.paragraphCache,styleCascade:l.styles.styleCascade,numberingIndex:l.styles.numberingIndex,defaultTabStopPt:l.styles.defaultTabStopPt,compatibilityMode:l.styles.compatibilityMode,displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false,inlineDrawingLayoutForPart:I=>l.drawingBundle.contextForPart(I),drawingLayoutTokenForPart:I=>l.drawingBundle.cacheTokenForPart(I),drawingTokenForParagraphForPart:(I,ne)=>l.drawingBundle.drawingTokenForParagraph(ne,I),linkProjectors:l.links,projectFieldLink:I=>$.project(I)}),l.furniture.set(y,A));for(let I=0;I<le;I+=1){let ne=c;l.drawingBundle.sync(l.view);let pe=E();if(pe)return pe;let N=ct({view:l.view,revision:l.view.packageRevision(),measurer:l.measurer,cache:l.paragraphCache,session:U,producer:h,styleCascade:l.styles.styleCascade,defaultTabStopPt:l.styles.defaultTabStopPt,numberingIndex:l.styles.numberingIndex,furniture:A,compatibilityMode:l.styles.compatibilityMode,linkProjectors:l.links,projectFieldLink:v=>$.project(v),inlineDrawingLayout:l.drawingBundle.bodyContext,inlineDrawingLayoutForPart:v=>l.drawingBundle.contextForPart(v),drawingTokenForParagraph:v=>l.drawingBundle.drawingTokenForParagraph(v,l.view.part().name),drawingTokenForParagraphForPart:(v,q)=>l.drawingBundle.drawingTokenForParagraph(q,v),drawingLayoutEpoch:l.drawingBundle.cacheTokenForPart(l.view.part().name),drawingLayoutEpochForPart:v=>l.drawingBundle.cacheTokenForPart(v),displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false});if(!pr(N)){let v=E();if(v)return v;i||(chunkUJL2GDIM_cjs.bd(N),chunkUJL2GDIM_cjs.ne(N),l.paragraphCache.clear(),l.sessions.delete(y),l.furniture.delete(y));let q=Pt(N,M),Ot=q.length===0?or:Object.freeze(yt(N,q)),kt=rt(l.view,N),Dt={...N,...kt,contentWarnings:st(l.view),reviewArtifacts:Ot},ye=vt(Dt);return l.completed.set(y,{revision:O,pkg:M,internal:N,published:ye}),ye}let me=ne;for(;l.drawingBundle.pendingResourceCount()>0;){await X(me,O,M,_),me=c,j();let v=E();if(v)return v}j();let fe=E();if(fe)return fe}throw new k("nonConvergent",`Image resources did not reach quiescence after ${le} layout passes`)},W=y=>{let P;try{P=It(y);}catch(O){return Promise.reject(O)}if(!u)return Promise.reject(S());let D=u,l=D.inFlight.get(P);if(l)return l;let _=H(P).catch(O=>{throw cr(O)}).finally(()=>D.inFlight.delete(P));return D.inFlight.set(P,_),_};return {ok:true,session:{layout:()=>W(r),layoutFor:W,validatedImageBytes(y){let P=u;return !P||y.resource.kind!=="ready"?null:P.drawingBundle.mintValidatedBytes(y.resource.validatedHandle,y.resource.contentId)?.slice()??null},dispose:V}}}exports.a=ct;exports.b=gr;exports.c=nt;exports.d=k;exports.e=Mn;
|