@docx-editor.dev/core 2.21.0 → 2.21.1
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 +31 -31
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +10 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/chunk-25OQBAKA.js +2 -0
- package/dist/chunk-3B3DQMSL.js +11 -0
- package/dist/chunk-3P3DNJYM.js +5 -0
- package/dist/chunk-3PA64KPK.js +5 -0
- package/dist/{chunk-4EHMMSFR.cjs → chunk-4TYA4RLP.cjs} +1 -1
- package/dist/chunk-7N77EN2Z.cjs +2 -0
- package/dist/{chunk-TE43S3LX.cjs → chunk-AGWWNVIJ.cjs} +1 -1
- package/dist/{chunk-Q2B6HX3R.js → chunk-BF2TOG2V.js} +1 -1
- package/dist/chunk-DFTVN25X.cjs +5 -0
- package/dist/{chunk-BQXF2PFF.js → chunk-DGONGMAV.js} +1 -1
- package/dist/{chunk-BDAY2ETZ.js → chunk-DZYKU2HG.js} +1 -1
- package/dist/chunk-E5OUYRNM.cjs +5 -0
- package/dist/{chunk-S35UK656.cjs → chunk-F4H3LC6M.cjs} +1 -1
- package/dist/{chunk-X5QNSISI.js → chunk-FPDIJ4RF.js} +1 -1
- package/dist/chunk-IUTTOBQW.cjs +20 -0
- package/dist/{chunk-WQFNWLNY.cjs → chunk-IYCXQAFT.cjs} +2 -2
- package/dist/chunk-JL3SI5SZ.js +18 -0
- package/dist/chunk-OFWUHH52.js +20 -0
- package/dist/chunk-OKY6JRJL.js +4 -0
- package/dist/{chunk-XZY4Q6PJ.cjs → chunk-P24FHMQW.cjs} +1 -1
- package/dist/chunk-QBKAOSVF.cjs +18 -0
- package/dist/{chunk-PYXMAUNR.cjs → chunk-RA2TDTEQ.cjs} +1 -1
- package/dist/{chunk-Z2ETEZRU.cjs → chunk-T5B4NMKF.cjs} +1 -1
- package/dist/{chunk-VUNFWXHF.js → chunk-U5GUJKTS.js} +1 -1
- package/dist/chunk-XRYSPKKC.js +1 -0
- package/dist/chunk-ZZRCVDQU.cjs +11 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.d.ts +6 -6
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-05qS32px.d.ts → custom-node-writes-CncR6KfC.d.ts} +2 -2
- package/dist/{document-protection-Cr59VKLO.d.ts → document-protection-DM6mA8Rf.d.ts} +1 -1
- package/dist/{editor-BsLSz_7y.d.ts → editor-BRh7GuZF.d.ts} +10 -6
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +25 -25
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +12 -12
- package/dist/export.js +1 -1
- package/dist/{font-resolver-CzwdBJDE.d.ts → font-resolver-DwuQYj3P.d.ts} +1 -1
- package/dist/{headless-document-view-B7nAiR7P.d.ts → headless-document-view-C3fc_jV0.d.ts} +2 -2
- package/dist/{image-resources-C4ilLzog.d.ts → image-resources-DxF-SN_8.d.ts} +1 -1
- package/dist/{index-zkvqBQ9o.d.ts → index-3pNnG4z4.d.ts} +19 -18
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-BJKVTI6i.d.ts → layout-shaping-_GGjhhVc.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +19 -17
- package/dist/layout.js +1 -1
- package/dist/{note-properties-MNztEj5s.d.ts → note-properties-CjT31AuP.d.ts} +1 -1
- package/dist/{omml-equation-CbnW9yXd.d.ts → omml-equation-Bk3OP1fv.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +7 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-Co_r0SZQ.d.ts → protocol-CrbTIW2Z.d.ts} +2 -2
- package/dist/{review-paragraph-order-EFaU7TqH.d.ts → review-paragraph-order-D3KZohIL.d.ts} +1 -1
- package/dist/{revision-projection-DEIvpxiq.d.ts → revision-projection-kVd7p6Wd.d.ts} +1 -1
- package/dist/{semantic-cell-selection-DXmfnDCw.d.ts → semantic-cell-selection-CkSsZHDL.d.ts} +6 -4
- package/dist/{semantic-interaction-BLu3M6Nn.d.ts → semantic-interaction-Z2Xa68U5.d.ts} +1 -1
- package/dist/{semantic-paint-CPsihA6k.d.ts → semantic-paint-BHKprI9P.d.ts} +2 -2
- package/dist/{semantic-records-CqD0b5Ex.d.ts → semantic-records-StH-AnHK.d.ts} +11 -8
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +19 -25
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-CwJDixNs.d.ts → tree-package-fragment-CpEV1gl3.d.ts} +2 -2
- package/dist/{tree-session-contract-D9RRWE0C.d.ts → tree-session-contract-CTT9nM7Z.d.ts} +10 -5
- package/dist/{types-barrel-DLB11iSY.d.ts → types-barrel-PwcfEkaX.d.ts} +8 -4
- package/package.json +2 -2
- package/dist/chunk-44LQJIKH.cjs +0 -20
- package/dist/chunk-AFG7Q622.cjs +0 -2
- package/dist/chunk-AYMSP25Q.js +0 -4
- package/dist/chunk-B4KZSKF7.cjs +0 -5
- package/dist/chunk-BNZF6DYC.cjs +0 -18
- package/dist/chunk-GIHKVXEO.js +0 -2
- package/dist/chunk-ITNK6C5M.cjs +0 -3
- package/dist/chunk-MP3K4LC5.js +0 -1
- package/dist/chunk-MXOO7KRI.cjs +0 -11
- package/dist/chunk-NG6IQ4SI.js +0 -11
- package/dist/chunk-Q5JPPUNR.js +0 -5
- package/dist/chunk-VH2DLEZK.js +0 -20
- package/dist/chunk-WZX4UGRQ.js +0 -3
- package/dist/chunk-XS4FOHH6.js +0 -18
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {f,c,d,e}from'./chunk-RIYSCEFQ.js';import {r,v,W as W$1,G as G$1,b,nc,lc,Nb,hc,Y as Y$1,Tc,Sc,T,re as re$1,B,Uc,J as J$1,Q as Q$1,Ha,Pb,jc,gc,qa,mc,C,a as a$1,A as A$1}from'./chunk-JL3SI5SZ.js';import {Fa}from'./chunk-3P3DNJYM.js';import {a,rh,Lc,Jc,Oc,Kc,Wf,uh,th,sh,xc,Hc}from'./chunk-3B3DQMSL.js';var Jn=Symbol("validated-resolved-font"),Qn=4,ee=64*1024*1024,D=256,V=128*1024*1024,j=class extends Error{name="FontResolutionError";request;code;limit;actual;diagnostic;expectedHash;actualHash;constructor(t,n,r={}){super(`Font resolution failed (${t}) for ${W(n)}`),this.code=t,this.request=K(n),this.limit=r.limit,this.actual=r.actual,this.diagnostic=r.diagnostic,this.expectedHash=r.expectedHash,this.actualHash=r.actualHash;}},jt=e=>{if(e.family.trim().length===0)throw new TypeError("Font family must not be empty");if(!Number.isInteger(e.weight)||e.weight<1||e.weight>1e3)throw new RangeError("Font weight must be an integer from 1 through 1000");if(e.style!=="normal"&&e.style!=="italic")throw new TypeError("Font style must be normal or italic")},K=e=>(jt(e),Object.freeze({family:e.family,weight:e.weight,style:e.style})),Ke=e=>{let t={family:e.family,weight:e.weight,style:e.style};return K(t)},Gt=Symbol("prepared-font-resource"),Xe=new WeakMap,er=new Uint8Array(0),Vt=Object.getPrototypeOf(Uint8Array.prototype),tr=Object.getOwnPropertyDescriptor(Vt,"length").get,nr=Object.getOwnPropertyDescriptor(Vt,"byteLength").get;function te(e){if(!ArrayBuffer.isView(e))throw new TypeError("Font bytes must be a genuine byte array");let t,n;try{t=tr.call(e),n=nr.call(e);}catch{throw new TypeError("Font bytes must be a genuine byte array")}if(t!==n)throw new TypeError("Font bytes must use one-byte elements");return n}function Wt(e){let t=new Uint8Array(te(e));return Uint8Array.prototype.set.call(t,e),t}function Kt(e,t){let n=K(e.request);if(e.availability==="forbidden"){let s=Object.freeze({...e,request:n,actualHash:null,[Gt]:true});return Xe.set(s,null),s}let r=Wt(e.bytes);t?.onOwnedByteCopy?.(),t?.onHash?.();let o=a(r),a$1=Object.freeze({...e,request:n,bytes:r,actualHash:o,[Gt]:true});return Xe.set(a$1,o),a$1}function ne(e){return Xe.get(e)}var Xt=e=>{if(!Number.isFinite(e.heightEm)||!Number.isFinite(e.baselineEm)||e.heightEm<=0||e.heightEm>Qn||e.baselineEm<0||e.baselineEm>e.heightEm)throw new RangeError("Font substitution line metrics must fit within a bounded em box");return Object.freeze({heightEm:e.heightEm,baselineEm:e.baselineEm})},W=e=>(jt(e),JSON.stringify([e.family.trim().toLowerCase(),e.weight,e.style])),qe=class{[Jn]=true;id;identity;request;family;byteLength;hash;faceIndex;substitution;constructor(t,n){if(t.id.length===0)throw new TypeError("Resolved font id must not be empty");if(!Number.isInteger(t.faceIndex)||t.faceIndex<0)throw new RangeError("Font face index must be a non-negative integer");this.id=t.id,this.request=K(t.request),this.family=this.request.family,this.hash=t.hash,this.faceIndex=t.faceIndex,this.identity=`${this.hash}#${this.faceIndex}`,this.byteLength=t.byteLength,this.substitution=null,n&&(this.substitution=Object.freeze({requested:K(n.requested),resolved:K(n.resolved),...n.lineMetrics?{lineMetrics:Xt(n.lineMetrics)}:{}})),Object.freeze(this);}get bytes(){return Ee(this).slice()}},qt=new WeakSet,Yt=new WeakMap,$t=new WeakMap,Zt=(e,t,n,r)=>{let o=new qe(e,r);return Yt.set(o,t),$t.set(o,n),qt.add(o),o},Ee=e=>{re(e);let t=Yt.get(e);if(!t)throw new TypeError("Resolved font has no owned byte capability");return t},Ce=e=>{re(e);let t=$t.get(e);if(!t)throw new TypeError("Resolved font has no admitted table metadata");return t},re=e=>{if(typeof e!="object"||e===null||!qt.has(e))throw new TypeError("Shaping requires a validated resolved font")},Jt=(e,t)=>e[t]<<8|e[t+1],Q=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Ut=(e,t)=>{if(t>e.byteLength-12)return {valid:false,diagnostic:"truncated sfnt header"};let n=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if(!(e[t]===0&&e[t+1]===1&&e[t+2]===0&&e[t+3]===0)&&n!=="OTTO"&&n!=="true"&&n!=="typ1")return {valid:false,diagnostic:"unsupported sfnt signature"};let o=Jt(e,t+4),a=t+12+o*16;if(!Number.isSafeInteger(a)||a>e.byteLength)return {valid:false,diagnostic:"truncated sfnt table directory"};for(let s=0;s<o;s+=1){let l=t+12+s*16,i=Q(e,l+8),d=Q(e,l+12);if(i>e.byteLength||d>e.byteLength-i)return {valid:false,diagnostic:"sfnt table range exceeds font bytes"}}return {valid:true}},rr=(e,t)=>{let r=String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?Q(e,12+t*4):0,o=Jt(e,r+4),a=new Set;for(let s=0;s<o;s+=1){let l=r+12+s*16;a.add(String.fromCharCode(e[l],e[l+1],e[l+2],e[l+3]));}return Object.freeze(a)},we=(e,t)=>{if(!Number.isSafeInteger(t)||t<0)return {valid:false,diagnostic:"invalid font face index"};if(e.byteLength<12)return {valid:false,diagnostic:"truncated sfnt header"};if(String.fromCharCode(e[0],e[1],e[2],e[3])!=="ttcf")return t!==0?{valid:false,diagnostic:"standalone sfnt has only face index zero"}:Ut(e,0);let r=Q(e,4);if(r!==65536&&r!==131072)return {valid:false,diagnostic:"unsupported TTC version"};let o=Q(e,8),a=12+o*4;if(o===0||!Number.isSafeInteger(a)||a>e.byteLength||t>=o)return {valid:false,diagnostic:"invalid TTC face directory"};let s=Q(e,12+t*4);return s<a?{valid:false,diagnostic:"invalid TTC face offset"}:Ut(e,s)},or=(e,t,n,r)=>{if(e.availability==="forbidden")return {kind:"forbidden"};let o=te(e.bytes);if(o>t)return {kind:"overLimit",actual:o};let a$1=ne(e),s=a$1===void 0?Wt(e.bytes):e.bytes;a$1===void 0&&r?.onOwnedByteCopy?.(),a$1===void 0&&r?.onHash?.();let l=a$1??a(s);if(e.hash!==l)return {kind:"hashMismatch",expectedHash:e.hash,actualHash:l};let i=we(s,e.faceIndex);if(!i.valid)return {kind:"malformed",diagnostic:i.diagnostic};r?.onTableScan?.();let d=rr(s,e.faceIndex);try{let y=n(s,e.faceIndex);if(!y.valid)return {kind:"malformed",diagnostic:y.diagnostic}}catch(y){return {kind:"malformed",diagnostic:y instanceof Error?y.message:"font validator threw"}}let c={kind:"resolved",font:Zt({...e,byteLength:s.byteLength},s,d)};return r?.onAdmission?.(),c},Ye=e=>{let t=e.epoch,n=e.maxFontBytes,r=e.validateFont,o=e.instrumentation,a=e.resources,s=e.substitutions;if(!Number.isSafeInteger(t)||t<0)throw new RangeError("Font resource epoch must be a non-negative safe integer");if(!Number.isSafeInteger(n)||n<=0||n>ee)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${ee}`);if(typeof r!="function")throw new TypeError("Font snapshot requires a validator");let l=a.length,i=s?.length??0;if(l>D)throw new RangeError(`Font source count must not exceed ${D}`);if(i>D)throw new RangeError(`Font substitution count must not exceed ${D}`);let d=0,c=[];for(let g=0;g<l;g+=1){let u=a[g];if(ne(u)!==void 0){let v=u.availability==="forbidden"?0:te(u.bytes);if(v>V-d)throw new RangeError(`Aggregate font bytes must not exceed ${V}`);d+=v,c.push(u);continue}let m=Ke(u.request),f=u.id,E=u.hash,F=u.faceIndex,T=u.availability,h=T==="forbidden"?er:u.bytes,p=T==="forbidden"?0:te(h);if(p>V-d)throw new RangeError(`Aggregate font bytes must not exceed ${V}`);d+=p,c.push(Object.freeze({request:m,id:f,bytes:h,hash:E,faceIndex:F,...T?{availability:T}:{}}));}let y=[];if(s)for(let g=0;g<i;g+=1){let u=s[g],m=Ke(u.from),f=Ke(u.to),E=u.lineMetrics;y.push(Object.freeze({from:m,to:f,...E?{lineMetrics:Object.freeze({heightEm:E.heightEm,baselineEm:E.baselineEm})}:{}}));}let S=new Map;for(let g of c){let u=W(g.request);S.has(u)||S.set(u,or(g,n,r,o));}let b=new Map;for(let g of y){let u=W(g.from);b.has(u)||b.set(u,Object.freeze({to:K(g.to),...g.lineMetrics?{lineMetrics:Xt(g.lineMetrics)}:{}}));}return Object.freeze({epoch:t,resolve:g=>{let u=K(g),m=W(u),f=b.get(m),E=f?.to??u,F=S.get(W(E));return F?F.kind==="forbidden"?new j("forbidden",u):F.kind==="overLimit"?new j("overLimit",u,{limit:n,actual:F.actual}):F.kind==="malformed"?new j("malformed",u,{diagnostic:F.diagnostic}):F.kind==="hashMismatch"?new j("hashMismatch",u,{expectedHash:F.expectedHash,actualHash:F.actualHash}):f?Zt({request:F.font.request,id:F.font.id,hash:F.font.hash,faceIndex:F.font.faceIndex,byteLength:F.font.byteLength},Ee(F.font),Ce(F.font),{requested:u,resolved:f.to,...f.lineMetrics?{lineMetrics:f.lineMetrics}:{}}):F.font:new j("missing",u)}})};var M=e=>{if(!Number.isSafeInteger(e))throw new RangeError("Fixed-point value must be a safe integer");return e},Oe=(e,t)=>{if(e.trim().length===0||/[\u0000-\u001f\u007f]/.test(e))throw new TypeError(`${t} must be non-blank and contain no control characters`)},ar=(e,t)=>{if(!/^[\x20-\x7e]{4}$/.test(e))throw new TypeError(`${t} must be a four-byte ASCII tag`)},Qt=(e,t,n)=>{let r=Object.entries(e).sort(([a],[s])=>a<s?-1:a>s?1:0),o=Object.create(null);for(let[a,s]of r){if(ar(a,`${t} key`),!Number.isFinite(s)||n&&(!Number.isSafeInteger(s)||s<0))throw new RangeError(`${t} value must be ${n?"a non-negative safe integer":"finite"}`);if(n&&s>4294967295)throw new RangeError(`${t} value must fit an unsigned 32-bit integer`);o[a]=s;}return Object.freeze(o)},$e=e=>Object.freeze({family:e.family,weight:e.weight,style:e.style}),ir=e=>e?Object.freeze({requested:$e(e.requested),resolved:$e(e.resolved),...e.lineMetrics?{lineMetrics:Object.freeze({...e.lineMetrics})}:{}}):void 0,en=new WeakSet,Je=e=>{if(re(e),!en.has(e)){if(e.identity!==`${e.hash}#${e.faceIndex}`)throw new TypeError("Resolved font identity does not match hash and face index");if(!Number.isSafeInteger(e.byteLength)||e.byteLength<0)throw new TypeError("Resolved font byte length is invalid");en.add(e);}},Ze=e=>(Je(e),e),Te=e=>(Je(e),Object.freeze({identity:e.identity,id:e.id,family:e.family,request:$e(e.request),hash:e.hash,faceIndex:e.faceIndex,byteLength:e.byteLength,substitution:ir(e.substitution)??null})),Y=e=>{if(Oe(e.shapingLibrary.name,"shaping library name"),Oe(e.shapingLibrary.version,"shaping library version"),Oe(e.unicodeDataVersion,"Unicode data version"),!/^\d+(?:\.\d+){0,3}(?:[-+][0-9A-Za-z.-]+)?$/.test(e.shapingLibrary.version))throw new TypeError("shaping library version must be a numeric version");if(!/^\d+(?:\.\d+){1,2}$/.test(e.unicodeDataVersion))throw new TypeError("Unicode data version must be a dotted numeric version");if(!/^[A-Z][a-z]{3}$/.test(e.script))throw new TypeError("script must be a four-letter ISO 15924 code");if(Oe(e.language,"language"),!/^(?:und|[A-Za-z]{2,8})(?:-[A-Za-z0-9]{1,8})*$/.test(e.language))throw new TypeError("language must be a BCP 47 language tag");if(e.direction!=="ltr"&&e.direction!=="rtl")throw new TypeError("direction must be ltr or rtl");if(!["none","NFC","NFD","NFKC","NFKD"].includes(e.normalization))throw new TypeError("invalid normalization policy");if(!["halfAwayFromZero","halfToEven","towardZero"].includes(e.roundingMode))throw new TypeError("invalid fixed-point rounding mode");if(!Number.isSafeInteger(e.fixedPointScale)||e.fixedPointScale<=0)throw new RangeError("fixed-point scale must be a positive safe integer");let t=Ze(e.font),n=e.fallbackOrder.map(Ze),r=new Set;for(let o of n){let a=JSON.stringify(Te(o));if(r.has(a))throw new TypeError("fallback order contains a duplicate font");r.add(a);}return Object.freeze({font:t,variationAxes:Qt(e.variationAxes,"variation axis",false),shapingLibrary:Object.freeze({name:e.shapingLibrary.name,version:e.shapingLibrary.version}),unicodeDataVersion:e.unicodeDataVersion,normalization:e.normalization,script:e.script,language:e.language,direction:e.direction,features:Qt(e.features,"OpenType feature",true),fallbackOrder:Object.freeze([...n]),fixedPointScale:e.fixedPointScale,roundingMode:e.roundingMode})},nn=e=>{let t=Y(e);return Object.freeze({font:Te(t.font),variationAxes:Object.freeze(Object.entries(t.variationAxes).map(n=>Object.freeze(n))),shapingLibrary:Object.freeze({name:t.shapingLibrary.name,version:t.shapingLibrary.version}),unicodeDataVersion:t.unicodeDataVersion,normalization:t.normalization,script:t.script,language:t.language,direction:t.direction,features:Object.freeze(Object.entries(t.features).map(n=>Object.freeze(n))),fallbackOrder:Object.freeze(t.fallbackOrder.map(Te)),fixedPointScale:t.fixedPointScale,roundingMode:t.roundingMode})},Qe=e=>JSON.stringify(nn(e)),q=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},A=e=>{try{return M(e)}catch{throw new RangeError("Shaped run contains a non-integer fixed-point value")}},tn=new WeakMap,Ie=e=>{let t=tn.get(e);if(t)return t;Je(e);let n=JSON.stringify({identity:e.identity,id:e.id,family:e.family,request:e.request,hash:e.hash,faceIndex:e.faceIndex,byteLength:e.byteLength,substitution:e.substitution??null});return tn.set(e,n),n},Le=(e,t)=>{let n=Y(t);if(e.direction!=="ltr"&&e.direction!=="rtl")throw new TypeError("Shaped run direction must be ltr or rtl");if(e.direction!==n.direction)throw new TypeError("Shaped run direction does not match shaping environment");if(q(e.bidiLevel,"bidi level"),(e.bidiLevel&1)===1!=(e.direction==="rtl"))throw new TypeError("Shaped run direction does not match bidi level parity");let r=new Map,o=e.glyphs.map(i=>{q(i.id,"glyph id"),q(i.cluster,"glyph cluster");let d=r.get(i.outline);if(!d){if(!Number.isSafeInteger(i.outline.unitsPerEm)||i.outline.unitsPerEm<=0)throw new RangeError("Glyph outline units per em must be a positive safe integer");d=Object.isFrozen(i.outline)?i.outline:Object.freeze({path:i.outline.path,unitsPerEm:i.outline.unitsPerEm}),r.set(i.outline,d);}return Object.freeze({id:i.id,cluster:i.cluster,originX:A(i.originX),originY:A(i.originY),advanceX:A(i.advanceX),advanceY:A(i.advanceY),offsetX:A(i.offsetX),offsetY:A(i.offsetY),outline:d})}),a=e.fontSpans.map(i=>{if(q(i.glyphStart,"font span start"),q(i.glyphEnd,"font span end"),i.glyphEnd<=i.glyphStart||i.glyphEnd>o.length)throw new RangeError("Font span glyph range is invalid");i.fallbackIndex!==null&&q(i.fallbackIndex,"fallback index");let d=Ze(i.font);if(i.fallbackIndex===null){if(Ie(d)!==Ie(n.font))throw new TypeError("Shaped primary font does not match shaping environment")}else {let c=n.fallbackOrder[i.fallbackIndex];if(!c)throw new RangeError("Shaped fallback index is outside fallback order");if(Ie(d)!==Ie(c))throw new TypeError("Shaped fallback font does not match shaping environment provenance")}return Object.freeze({...i,font:d})});for(let i=0;i<a.length;i+=1){let d=i===0?0:a[i-1].glyphEnd;if(a[i].glyphStart!==d)throw new RangeError("Font spans must cover glyphs contiguously")}if(o.length===0&&a.length!==0||o.length>0&&a.at(-1)?.glyphEnd!==o.length)throw new RangeError("Font spans must cover every glyph exactly once");let s=e.clusters.map(i=>{for(let[c,y]of [["cluster text start",i.textStart],["cluster text end",i.textEnd],["cluster glyph start",i.glyphStart],["cluster glyph end",i.glyphEnd],["cluster font span",i.fontSpan]])q(y,c);if(i.textEnd<=i.textStart||i.textEnd>e.text.length||i.glyphEnd<=i.glyphStart||i.glyphEnd>o.length)throw new RangeError("Shaped cluster range is invalid");let d=a[i.fontSpan];if(!d||i.glyphStart<d.glyphStart||i.glyphEnd>d.glyphEnd)throw new RangeError("Shaped cluster does not belong to its declared font span");return Object.freeze({...i,advance:A(i.advance),caretEdges:Object.freeze(i.caretEdges.map(A))})}),l=Object.freeze({ascent:A(e.metrics.ascent),descent:A(e.metrics.descent),lineGap:A(e.metrics.lineGap)});return Object.freeze({text:e.text,direction:e.direction,bidiLevel:e.bidiLevel,glyphs:Object.freeze(o),clusters:Object.freeze(s),fontSpans:Object.freeze(a),metrics:l})},sr=(e,t)=>{let n=Le(e,t);return Object.freeze({text:n.text,direction:n.direction,script:t.script,language:t.language,bidiLevel:n.bidiLevel,glyphs:n.glyphs,clusters:n.clusters,fontSpans:Object.freeze(n.fontSpans.map(r=>Object.freeze({glyphStart:r.glyphStart,glyphEnd:r.glyphEnd,fallbackIndex:r.fallbackIndex,font:Te(r.font)}))),metrics:n.metrics})};var $=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),ce=null,le=null;function tt(){return ce?Promise.resolve():le||(le=import('./dist-PKZR6RSH.js').then(e=>{let t=e.versionString();if(t!==$.version)throw new w("shapingLibraryMismatch",{diagnostic:f($.version,t)});ce=e;}).catch(e$1=>{throw le=null,e$1 instanceof w?e$1:c(e$1)?new w("unsupportedRuntime",{diagnostic:d(e$1),cause:e$1}):new w("wasmUnavailable",{diagnostic:e(e$1),cause:e$1})}),le)}function lr(){return ce!==null}function dr(){if(!ce)throw new w("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return ce}var w=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;}},cr=16*1024*1024,ur=1e6,pr=1e6,yr=1e6,fr=4,hr=512,gr=1024*1024,mr=16*1024*1024,br=32*1024*1024,Sr=64*1024*1024,xr=64*1024*1024,Rr=1e6,Fr=1e6,vr=1e6,Er=64,Cr=4096,wr=4*1024*1024,Or=64*1024*1024,Ir=64*1024*1024,Tr=256*1024*1024,Lr=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),rn=["cmap","head","hhea","hmtx","maxp"],Br=(e,t)=>e[t]<<8|e[t+1],Ar=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Pr=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?Ar(e,12+t*4):0,_r=(e,t)=>{let n=Pr(e,t),r=Br(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let s=n+12+a*16;o.add(String.fromCharCode(e[s],e[s+1],e[s+2],e[s+3]));}return o},Mr=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),zr=(e,t)=>{let n=we(e,t);if(!n.valid)return n;let r=_r(e,t);for(let o of rn)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},nt=zr,z=(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},Nr=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,s=o%t;if(n!=="towardZero"){let d=s*2n;(d>t||d===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let l=r?-a:a,i=Number(l);if(!Number.isSafeInteger(i))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return i},on=(e,t,n,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)||n<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");return M(Nr(BigInt(e)*BigInt(n),BigInt(t),r))},kr=(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 s=>on(s,a,o,r)},Dr=(e,t)=>{if(t.length===0)return [];let n=[...new Set(t.map(s=>s.cluster))].sort((s,l)=>s-l),r=new Map;for(let s=0;s<n.length;s+=1)r.set(n[s],n[s+1]??e.length);let o=[],a=0;for(;a<t.length;){let s=t[a].cluster,l=a+1;for(;l<t.length&&t[l].cluster===s;)l+=1;let i=t.slice(a,l).reduce((c,y)=>c+y.advanceX,0),d=M(i);o.push({textStart:s,textEnd:r.get(s),glyphStart:a,glyphEnd:l,advance:d,caretEdges:Object.freeze([M(0),d]),fontSpan:0}),a=l;}return o},N=64,H=8,Z=8,Hr=32,an=N+2*H,Gr=N+H+Z,Ur=N+H+Z,jr=N+H+Z,sn=N+8*H,ln=N+8*Z+H,Vr=N+6*Z+H,Wr=N+3*Z+2*H,Kr=N+3*Z,ue=e=>N+e.length*Uint16Array.BYTES_PER_ELEMENT,rt=e=>jr+ue(e),de=e=>Hr+e*H,Xr=(e,t)=>an+ue(e)+Gr+rt(t),qr=e=>sn+ue(e)+de(e.length)+e.length*ln,Yr=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return sn+ue(e.text)+de(e.glyphs.length)+e.glyphs.length*ln+de(e.clusters.length)+e.clusters.length*Vr+e.clusters.reduce((n,r)=>n+de(r.caretEdges.length),0)+de(e.fontSpans.length)+e.fontSpans.length*Wr+Kr+[...t].reduce((n,r)=>n+rt(r.path),0)},$r=(e,t)=>an+ue(e)+Ur+t,et=class{#t;#c;#u;#p;#y;#m;#b;#f;#h;#s;#g;#l;#e;#o=new Map;#a=new Map;#n=new Map;#i=0;#r=0;#d;constructor(t,n){this.#t=t,this.#c=z(n.maxFontBytes??cr,"maximum font bytes",xr),this.#u=z(n.maxInputUtf16??ur,"maximum input UTF-16 code units",Rr),this.#p=z(n.maxCodepoints??pr,"maximum input code points",Fr),this.#y=z(n.maxGlyphs??yr,"maximum shaped glyphs",vr),this.#m=z(n.maxCachedFaces??fr,"maximum cached faces",Er),this.#b=z(n.maxCachedShapes??hr,"maximum cached shape results",Cr),this.#f=z(n.maxOutlineBytes??gr,"maximum outline bytes",wr),this.#h=z(n.maxCachedOutlineBytes??mr,"maximum cached outline bytes",Or),this.#s=z(n.maxShapedRunBytes??br,"maximum shaped run bytes",Ir),this.#g=z(n.maxCachedShapeBytes??Sr,"maximum cached shape bytes",Tr),this.#l=n.instrumentation?.onFaceCacheEvent,this.#e=n.instrumentation,this.#d=new this.#t.Buffer;}dispose(){this.#o.clear(),this.#a.clear(),this.#n.clear(),this.#i=0,this.#r=0,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#d=void 0;}#x(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#l?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=Ce(t);for(let c of rn)if(!o.has(c))throw new w("malformedFont",{diagnostic:`missing required ${c} table`});this.#e?.onByteCopy?.();let a=new this.#t.Blob(Mr(n)),s=new this.#t.Face(a,t.faceIndex),l=new this.#t.Font(s),i=l.hExtents();if(!Number.isSafeInteger(s.upem)||s.upem<=0||!Number.isSafeInteger(i.ascender)||!Number.isSafeInteger(i.descender)||!Number.isSafeInteger(i.lineGap))throw new w("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});if(l.setScale(s.upem,s.upem),this.#o.size>=this.#m){let c=this.#o.keys().next().value;c!==void 0&&(this.#o.delete(c),this.#l?.(Object.freeze({kind:"evicted",identity:c})));}let d={identity:t.identity,blob:a,face:s,font:l,unitsPerEm:s.upem};return this.#o.set(t.identity,d),this.#l?.(Object.freeze({kind:"created",identity:t.identity})),d}#R(t,n,r){let o=JSON.stringify([t.identity,t.unitsPerEm,r,n]),a=this.#a.get(o);if(a)return this.#a.delete(o),this.#a.set(o,a),this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#i})),a.outline;this.#e?.onOutlinePathCall?.();let s=t.font.glyphToPath(n),l=rt(s);if(l>this.#f)throw new w("outlineOverLimit",{limit:this.#f,actual:l});let i=Object.freeze({path:s,unitsPerEm:t.unitsPerEm}),d=Xr(o,s);if(d>this.#h)return this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#i})),i;for(;this.#i+d>this.#h;){let c=this.#a.keys().next().value;if(c===void 0)break;let y=this.#a.get(c);this.#a.delete(c),this.#i-=y.bytes,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#i}));}return this.#a.set(o,{outline:i,bytes:d}),this.#i+=d,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#i})),i}#S(t){if(t.length>this.#u)throw new w("textOverLimit",{limit:this.#u,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.#p)throw new w("codepointsOverLimit",{limit:this.#p,actual:n})}}shape(t){if(!this.#d)throw new w("disposed");if(re(t.environment.font),t.environment.font.byteLength>this.#c)throw new w("fontOverLimit",{limit:this.#c,actual:t.environment.font.byteLength});this.#S(t.text);let n=qr(t.text);if(n>this.#s)throw new w("shapedRunOverLimit",{limit:this.#s,actual:n});let r=Y(t.environment),o=JSON.stringify([t.text,t.fontSizeHalfPoints,t.bidiLevel,Qe(r)]),a=this.#n.get(o);if(a)return this.#n.delete(o),this.#n.set(o,a),this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r.shapingLibrary.name!==$.name||r.shapingLibrary.version!==$.version)throw new w("shapingLibraryMismatch");if(r.normalization!=="none")throw new w("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r.direction==="rtl"))throw new w("invalidBidiLevel");if(Object.keys(r.variationAxes).length>0)throw new w("unsupportedVariationAxes");if(r.fallbackOrder.length>0)throw new w("unsupportedFallback");let s=Ee(r.font),l=Ce(r.font);if([...Lr].some(d=>l.has(d)))throw new w("unsupportedColorFont");let i=t.text;this.#S(i);try{let d=this.#x(r.font,s),{face:c,font:y}=d,S=this.#d;S.reset(),S.addText(i),S.setDirection(r.direction==="rtl"?this.#t.Direction.RTL:this.#t.Direction.LTR),S.setScript(r.script),S.setLanguage(r.language),S.setClusterLevel(this.#t.ClusterLevel.MONOTONE_CHARACTERS);let b=Object.entries(r.features).map(([R,C])=>new this.#t.Feature(R,C));this.#e?.onShapeCall?.(),this.#t.shape(y,S,b);let x=S.getGlyphInfosAndPositions();if(x.length>this.#y)throw new w("glyphOverLimit",{limit:this.#y,actual:x.length});let g=kr(c.upem,t.fontSizeHalfPoints,r.fixedPointScale,r.roundingMode),u=M(0),m=M(0),f=new Map,E=JSON.stringify(Object.entries(r.variationAxes).sort(([R],[C])=>R.localeCompare(C))),F=x.map(R=>{let C=g(R.xAdvance??0),O=g(R.yAdvance??0),I={id:R.codepoint,cluster:R.cluster,originX:u,originY:m,advanceX:C,advanceY:O,offsetX:g(R.xOffset??0),offsetY:g(R.yOffset??0),outline:f.get(R.codepoint)??(()=>{let L=this.#R(d,R.codepoint,E);return f.set(R.codepoint,L),L})()};return u=M(u+C),m=M(m+O),I}),T=y.hExtents(),h=Le({text:i,direction:r.direction,bidiLevel:t.bidiLevel,glyphs:F,clusters:Dr(i,F),fontSpans:F.length===0?[]:[{glyphStart:0,glyphEnd:F.length,font:r.font,fallbackIndex:null}],metrics:{ascent:g(T.ascender),descent:g(-T.descender),lineGap:g(T.lineGap)}},r),p=Yr(h);if(p>this.#s)throw new w("shapedRunOverLimit",{limit:this.#s,actual:p});let v=$r(o,p);if(v>this.#g)return this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),h;for(;this.#n.size>=this.#b||this.#r+v>this.#g;){let R=this.#n.keys().next().value;if(R===void 0)break;let C=this.#n.get(R);this.#n.delete(R),this.#r-=C.bytes,this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o,{run:h,bytes:v}),this.#r+=v,this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),h}catch(d){throw d instanceof w?d:new w("malformedFont",{diagnostic:d instanceof Error?d.message:"HarfBuzz shaping failed"})}}},ot=(e={})=>new et(dr(),e);var dn=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:4,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024});function cn(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 Zr=Object.freeze({}),un=D,Jr="16.0.0",Qr="none",eo=1e3,to="halfToEven",fn="cluster-edges-only",no="Latn",ro=new Uint8Array(0);var G=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function oo(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a=e.substitutions,s=e.defaultFont,l=e.language;if(!Number.isSafeInteger(r)||r<=0||r>ee)throw new G(`Font byte ceiling must not exceed the engine hard maximum of ${ee}`);let i=o.length,d=a?.length??0;if(i===0||i>D)throw new G(`Font source count must be between 1 and ${D}`);if(d>un)throw new G(`Font substitution count must not exceed ${un}`);let c=0,y=[];for(let x=0;x<i;x+=1){let g=o[x],u=g.request,m=g.availability,f=g.id,E=g.hash,F=g.faceIndex,T=m==="forbidden",h=T?ro:g.bytes;if(!T){if(typeof f!="string"||f.length===0)throw new TypeError("Resolved font id must not be empty");let p;try{p=te(h);}catch{throw new G(`Font source ${f} must provide genuine bytes`)}if(p>r)throw new G(`Font source ${f} exceeds the per-font byte ceiling`);if(c+=p,c>V)throw new G(`Font sources exceed the aggregate byte ceiling of ${V}`)}y.push(t&&ne(g)!==void 0?g:Object.freeze({request:Object.freeze({family:u.family,weight:u.weight,style:u.style}),id:f,bytes:h,hash:E,faceIndex:F,...m?{availability:m}:{}}));}let S;if(a){S=[];for(let x=0;x<d;x+=1){let g=a[x],u=g.from,m=g.to,f=g.lineMetrics;S.push(Object.freeze({from:Object.freeze({family:u.family,weight:u.weight,style:u.style}),to:Object.freeze({family:m.family,weight:m.weight,style:m.style}),...f?{lineMetrics:Object.freeze({heightEm:f.heightEm,baselineEm:f.baselineEm})}:{}}));}}let b={epoch:n,maxFontBytes:r,sources:Object.freeze(y),substitutions:S?Object.freeze(S):void 0,defaultFont:Object.freeze({family:s.family,sizeHalfPoints:s.sizeHalfPoints}),language:l};return Object.freeze(b)}function pn(e,t){let n=e.map((o,a)=>({value:o,index:a,key:W(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 ao(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function yn(e,t){let n=i=>({family:i.family,weight:i.weight,style:i.style}),r=t?e.sources:pn(e.sources,i=>i.request),o=e.substitutions??[],a=t?o:pn(o,i=>i.from),s={sources:r.map(i=>{let d=i.availability??"available",c={request:n(i.request),availability:d};if(d==="forbidden")return {...c,...t?{id:i.id,faceIndex:i.faceIndex,declaredHash:i.hash}:{}};let y=ne(i);if(y==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...c,...t?{id:i.id}:{},faceIndex:i.faceIndex,declaredHash:i.hash,actualHash:y,byteLength:i.bytes.byteLength}}),substitutions:a.map(i=>({from:n(i.from),to:n(i.to),lineMetrics:i.lineMetrics?{heightEm:i.lineMetrics.heightEm,baselineEm:i.lineMetrics.baselineEm}:null})),defaultFont:ao(e.defaultFont,t),language:e.language||"en"},l={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?l:{},...s}}var io=Symbol("prepared-layout-font-configuration"),Be=new WeakMap;function so(e){return Be.has(e)}function lo(e){let t=Be.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function La(e){let t=Be.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function at(e,t){return hn(e,t,false)}function Ba(e,t){return hn(e,t,true)}function hn(e,t,n){let r=oo(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(y=>n&&ne(y)!==void 0?y:Kt(y,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a$1=new TextEncoder,s=yn(o,true),l=a$1.encode(JSON.stringify(s)),i=yn(o,false),d=a$1.encode(JSON.stringify(i)),c=Object.freeze({[io]:true,fingerprint:`font-config:${a(l)}`});return Be.set(c,{configuration:o,sharedShapingFingerprint:`shared-font-config:${a(d)}`}),c}function co(e){return at(e).fingerprint}function uo(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:cn(t),ligatureCaretPolicy:fn,fallback:a$1}));return `shaping:${a(n)}`}async function gn(e,t,n,r){let a=so(e)?e:at(e,t),s=lo(a),{epoch:l,maxFontBytes:i,sources:d,substitutions:c,defaultFont:y}=s,S=s.language||"en",b=a.fingerprint,x=Ye({epoch:l,maxFontBytes:i,resources:d,substitutions:c,validateFont:nt,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await tt();let g=Object.freeze({script:no,variationAxes:Object.freeze({}),shapingLibrary:$,unicodeDataVersion:Jr,normalization:Qr,language:S,features:Zr,fixedPointScale:eo,roundingMode:to});return Object.freeze({fonts:x,shaper:n??ot(r),defaultFont:y,environment:g,ligatureCaretPolicy:fn,operation:Object.freeze({resourceEpoch:x.epoch,configEpoch:l,extensionFingerprint:b,shapingHash:uo(g,r),producerVersion:1})})}async function po(e,t){return gn(e,t,void 0,dn)}async function Aa(e,t,n,r){return gn(e,r,t,n)}function yo(e){e.shaper.dispose?.();}function it(e){let t=new Set([0,e.text.length]);for(let r$1 of r(e.text))t.add(r$1.utf16From),t.add(r$1.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 Ae(e,t){return it(e).includes(t)}function fo(e,t){return Ae(e,t)}function ho(e,t,n){return n>=t&&Ae(e,t)&&Ae(e,n)}function go(e){let t=r(e.text);return it(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var lt="und";function xn(){return typeof Intl.Segmenter=="function"}function mo(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${lt})`);return e}function Rn(){let e=new(mo())(lt,{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 bo=/^[\p{L}\p{N}']$/u,So=/^\s$/u;function mn(e){return bo.test(e)}function bn(e){return So.test(e)}function st(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function Fn(e){let t=r(e);if(t.length===0)return [];let n=[],r$1=0;for(;r$1<t.length;){let o=t[r$1];if(bn(o.text)){let a=r$1+1;for(;a<t.length&&bn(t[a].text);)a+=1;n.push(st(t,r$1,a,false)),r$1=a;continue}if(mn(o.text)){let a=r$1+1;for(;a<t.length&&mn(t[a].text);)a+=1;n.push(st(t,r$1,a,true)),r$1=a;continue}n.push(st(t,r$1,r$1+1,false)),r$1+=1;}return n}function vn(){return {segment:Fn}}function En(e={}){let t=e.isIntlAvailable??xn,n=e.createIntlBoundary??Rn,r=e.createFallbackBoundary??vn;if(!t())return r();try{return n()}catch{return r()}}var Sn;function Cn(){return Sn??=En(),Sn}function xo(e,t=Cn()){return t.segment(e)}function Ro(e,t){return t.map(n=>({graphemeFrom:v(e,n.utf16From),graphemeTo:v(e,n.utf16To),wordLike:n.wordLike}))}var wn={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},ut=Object.keys(wn),On=ut.filter(e=>wn[e]==="coarse-gate"),Pe=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},oe=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},Fo={resourceEpoch:Pe,configEpoch:Pe,extensionFingerprint:oe,shapingHash:oe,producerVersion:Pe},vo=(e,t)=>{Fo[t](e[t],t);},ae=e=>{for(let t of ut)vo(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},Eo=(e,t)=>{let n=ae(e),r=ae(t),o=ut.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},dt=e=>{let t=e.map(({key:n,fingerprint:r})=>(oe(n,"resource dependency key"),oe(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=>(Pe(e.revision,"revision"),oe(e.dependencyFingerprint,"dependencyFingerprint"),oe(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:dt(e.resourceDependencies),...ae(e)})),wo=(e,t)=>{let n=dt(e),r=dt(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let s=n[a],l=r[a];if(s?.key!==l?.key||s?.fingerprint!==l?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:s?.key??l.key}}return null};function Oo(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=wo(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of On)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var ct=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=Oo(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=ae(t),r=0;for(let[o,a]of this.entries){let s=a.provenance;On.some(l=>s[l]!==n[l])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=ae(t),o=this.evictEpoch(r);for(let[a,s]of this.entries)s.provenance.resourceDependencies.some(i=>n.get(i.key)!==i.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function In(e){return e.projected===true?null:e.range}function To(e,t,n){let{page:r,story:o,host:a,noteScopeId:s,noteAreaKind:l}=e,i=o==="header"||o==="footer"?d=>A$1(d,e.origin,{x:r.box.x,y:r.box.y}):void 0;J$1(a,(d,c)=>{let{textboxDepth:y,textboxOwner:S,textboxPath:b,storyOrigin:x}=c,g=y===0?o:"textbox";for(let u of d.lines){let m=[...Q$1(u)].sort((f,E)=>(t.get(f.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(E.paragraphId)??Number.MAX_SAFE_INTEGER));for(let f of m)for(let E of f.spans)n({page:r,story:g,rootStory:o,root:e,storyOrigin:x,absoluteBox:Object.freeze({x:x.x+E.box.x,y:x.y+E.box.y,width:E.box.width,height:E.box.height}),noteScopeId:s,noteAreaKind:l,textboxDepth:y,textboxOwner:S,textboxPath:b,paragraph:d,paragraphId:f.paragraphId,line:u,span:E,sourceRange:In(E)});}},e.origin,i);}function Lo(e,t){let n=new Map(W$1(e).map((r,o)=>[r,o]));G$1(e,r=>To(r,n,t));}var An="Calibri, Carlito, Helvetica, Arial, sans-serif",Xa=new Map([["calibri","Carlito"]]),Bo=65536,Ao=256;function Tn(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 Ln(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 Pn(e=null){return e!=null&&typeof e.measureText=="function"}function _n(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??An,r$1=e.context??null;if(!Pn(r$1))return null;let o=r$1,a=Ln(Tn(e.maxWidthEntries,Bo)),s=Ln(Tn(e.maxMetricsEntries,Ao)),l=e.fontAlias,i=c=>{let y=c.fontFamily&&Bn.test(c.fontFamily)?c.fontFamily:null,S=y?l?.(y):void 0,b=S&&Bn.test(S)?S:null,x=y?b?`"${b}", "${y}", ${n}`:`"${y}", ${n}`:n,g=c.bold?"bold":"normal",u=c.italic?"italic":"normal",m=c.smallCaps?"small-caps":"normal",f=c.fontSizePt*(c.verticalAlign==="baseline"?1:.75)*t;return `${u} ${m} ${g} ${f}px ${x}`},d=(c,y,S)=>c/t*(S.horizontalScalePercent/100)+y.length*S.characterSpacingPt;return {measure(c,y){if(c.length===0)return 0;let S=i(y),b=`${S}\0${c}`,x=a.get(b);if(x!==void 0)return d(x,c,y);o.font=S;let g=o.measureText(c).width;return a.set(b,g),d(g,c,y)},inkBounds(c,y){if(!c||c.length>2||y.shaping?.direction==="rtl"||r(c).length!==1)return;o.font=i(y);let S=o.textAlign,b=o.direction,x;try{S!==void 0&&(o.textAlign="left"),b!==void 0&&(o.direction="ltr"),x=o.measureText(c);}finally{S!==void 0&&(o.textAlign=S),b!==void 0&&(o.direction=b);}let g=x.actualBoundingBoxLeft,u=x.actualBoundingBoxRight;if(g===void 0||u===void 0||!Number.isFinite(g)||!Number.isFinite(u))return;let m=y.horizontalScalePercent/(100*t);return {left:-g*m,right:u*m}},lineMetrics(c){let y=c.fontSizePt*(c.verticalAlign==="baseline"?1:.75),S=i(c),b=s.get(S);if(b)return b;let x=y*1.15,g=y*.8;o.font=S;let u=o.measureText("Hxg"),m=u.fontBoundingBoxAscent,f=u.fontBoundingBoxDescent;if(typeof m=="number"&&Number.isFinite(m)&&m>0&&(g=m/t,typeof f=="number"&&Number.isFinite(f)&&f>=0)){let F=(m+f)/t;F>0&&(x=Math.max(F,x));}x>0||(x=y*1.15);let E={height:x,baseline:g};return s.set(S,E),E}}}function Po(e=1,t={}){let n=_n({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:b(),producer:"fixed-measurer"}}function _o(e){let t;return n=>{t===void 0&&(t=nc(e.pages)?.hosts??null);let r=t?.get(n);return r?lc(r.pageNumber,r.format):null}}function Mn(e,t){let n=Ha(e,t.displayMode??Y$1),r=Pb({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:Wf(t.package,"footnote"),endnotesPart:Wf(t.package,"endnote")}:void 0,a=jc(n,r,o,t.package?gc(t.package,e,n):void 0,t.displayMode??Y$1);return {blocks:n,notes:o,context:a}}function zn(e,t,n,r,o){for(let a of t){if(r.length>=rh)return;if(n.tokenForParagraph(a.id)!==""&&uh(e,a.id)===null)for(let s of th(a)){if(r.length>=rh)return;if(!s.rewritable)continue;let l=qa(s.instruction);if(l===null)continue;let i=n.liveValueOf(s.fieldNodeId,l);if(i===null&&o&&n.pageRefProjectionOf){let d=n.pageRefProjectionOf(s.fieldNodeId,l);if(d){let c=o(d.targetParagraphId);c!==null&&c.length>0&&mc(d.calibration,d.cached,c,Number.NaN)&&(i=c);}}i===null||i===s.cachedText||i.length>sh||i.includes(`
|
|
2
|
+
`)||i.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:s.fieldNodeId,text:i});}}}function Mo(e,t){let{blocks:n,context:r}=Mn(e,t);if(r===null)return null;let o=[];return zn(e,Nb(n),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function ri(e,t){let{notes:n,context:r}=Mn(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:s,notesPart:l}of a){if(!l)continue;let i=[];for(let d of hc(l,t.displayMode??Y$1)){if(i.length>=rh)break;zn(l,Nb(d),r,i);}i.length>0&&o.push({noteKind:s,op:{op:"refreshFieldResults",updates:i}});}return o}function zo(e){return e.box}function Nn(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)Nn(o,t);}function No(e){let t=new Map,n=(o,a,s)=>{if(!(o.kind==="textValue"||s>xc*4)){for(let l of o.children)if(l.kind!=="textValue"){if(l.kind==="paragraph"){for(let i of r)t.get(i)?.push(l.id);n(l,l.id,s+1);continue}if(l.kind==="contentControl"){t.set(l.id,[]),r.push(l.id);let i=Hc(l);i&&n(i,a,s+1),r.pop();let d=t.get(l.id);d&&d.length===0&&a!==null&&d.push(a);continue}n(l,a,s+1);}}},r=[];return n(e,null,0),t}function ko(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 Do(e,t){let n=Lc(e.root);if(n.length===0)return Ho;let r=new Map;t.pages.forEach((s,l)=>{(d=>{for(let c of d){let y=new Set;Nn(c,y);for(let S of y){let b=r.get(S)??[];b.push({pageIndex:l,box:zo(c)}),r.set(S,b);}}})(s.fragments);});let o=No(e.root),a=[];for(let s of n){let l=Jc(s.node),i=[...s.ancestors.map(S=>Jc(S).lock),l.lock],d=o.get(s.node.id)??[],c=new Map;for(let S of d)for(let b of r.get(S)??[]){let x=c.get(b.pageIndex);c.set(b.pageIndex,x?ko(x,b.box):b.box);}let y=[...c.entries()].sort((S,b)=>S[0]-b[0]).map(([S,b])=>({pageIndex:S,...b}));a.push({controlId:s.node.id,type:l.type,level:Kc(s.node),depth:s.depth,lock:l.lock,effectiveLock:Oc(i),showingPlaceholder:l.showingPlaceholder,temporary:l.temporary,...l.tag===void 0?{}:{tag:l.tag},...l.alias===void 0?{}:{alias:l.alias},...l.id===void 0?{}:{id:l.id},...l.dataBinding===void 0?{}:{dataBinding:l.dataBinding},paragraphIds:d,fragments:y});}return a}var Ho=Object.freeze([]);function Dn(e,t,n){let r=e.lines?.find(o=>{let a=o.spans;if(!a)return n<o.range.end;let s=a.filter(l=>l.range.paragraphId===t);return s.length===a.length?n<o.range.end:s.length>0&&n<s[s.length-1].range.end});return r?r.box.y:e.fragmentY}function Zo(e,t){let n=new Map;for(let r of e.pages)for(let[o,a]of Jo(r,t))n.has(o)||n.set(o,a);return n}var kn=new WeakMap;function Jo(e,t){let n=kn.get(t);n||(n=new WeakMap,kn.set(t,n));let r=n.get(e);if(r)return r;let o=new Map;for(let a of t(e)){let s=new Set([a.paragraphId]);for(let l of a.lines??[])for(let i of l.spans??[])s.add(i.range.paragraphId);for(let l of s)o.has(l)||o.set(l,{pageIndex:e.index,contentY:e.contentBox.y,fragmentY:a.box.y,...a.lines?{lines:a.lines}:{}});}return n.set(e,o),o}function Qo(e,t){let n=Fa(e);if(!n)return null;let r=t.get(n.start.paragraphId);return r?{pageIndex:r.pageIndex,y:r.contentY+Dn(r,n.start.paragraphId,n.start.offset)}:null}var pt=new WeakMap;function ea(e){let t=pt.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 l of a){let i=l[1]==="Z"?0:l[1]==="C"?6:l[1]==="Q"?4:2,d=l[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(d.length!==i||d.some(c=>!Number.isFinite(c))){pt.set(e,null);return}for(let c=0;c<d.length;c+=2)r=Math.min(r,d[c]),o=Math.max(o,d[c]);}let s=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return pt.set(e,s??null),s}function Hn(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let l of e.glyphs){if(l.id===0)return;let i=ea(l.outline),d=l.outline.unitsPerEm;if(!i||!(d>0))return;let c=(l.originX+l.offsetX)/n;o=Math.min(o,c+i.left*t/d),a=Math.max(a,c+i.right*t/d);}let s={left:o*r,right:a*r};return Number.isFinite(s.left)&&Number.isFinite(s.right)?s:void 0}var ta="abcdefghijklmnopqrstuvwxyz";function pe(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function J(e,t,n,r,o){return e.shape({text:o,fontSizeHalfPoints:pe(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:Y({...t,font:n,direction:r.shaping?.direction??"ltr",script:r.shaping?.script==="Zyyy"?t.script:r.shaping?.script??t.script,features:r.smallCaps?{...t.features,smcp:1}:t.features,fallbackOrder:[]})})}function _e(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let s=true;try{for(let l of ta){let i=J(e,t,n,{...r,smallCaps:!0},l),d=J(e,t,n,{...r,smallCaps:!1},l);if(!(i.glyphs.length!==d.glyphs.length||i.glyphs.some((y,S)=>y.id!==d.glyphs[S]?.id))){s=!1;break}}}catch{s=false;}return o.set(n,s),s}var na=.5,ra=4,Gn=4096,ye=e=>e.verticalAlign==="baseline"?1:.75;function Un(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r$1,resolveFont:o,fallback:a}=e,s=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:{}},l=new WeakMap,i=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,S=new Array(Gn),b=0,x=(h,p,v)=>{let R=S[b];R&&R.cache.delete(R.text),h.set(p,v),S[b]={cache:h,text:p},b=(b+1)%Gn;},g=h=>{let p=c.get(h);if(p!==void 0)return p;let v=o(h);return c.set(h,v),v},u=(h,p,v)=>{let R=v?i:l,C=R.get(h);C||(C=new Map,R.set(h,C));let O=C.get(p);return O||(O=new Map,C.set(p,O)),O},m=new WeakMap,f=h=>{if(!h.shaping?.wordSpacingPt)return h;let p=m.get(h);return p||(p={...h,shaping:{...h.shaping,wordSpacingPt:void 0}},m.set(h,p)),p},E=(h,p)=>p.shaping?.wordSpacingPt?Uc(h)*p.shaping.wordSpacingPt:0,F=(h,p)=>a.measure(h,f(p))+E(h,p),T=(h,p)=>{let v=Math.max(0,a.measure(h,f(p))),R=a.caretAdvances?.(h,f(p))??Sc(h,v);if(!R||R.length!==h.length+1)return Sc(h,F(h,p));let C=Math.max(0,F(h,p)),O=0,I=0;return R.map((L,B)=>{if(B===0)return 0;h[B-1]===" "&&I++;let k=L+I*(p.shaping?.wordSpacingPt??0);return O=Math.max(O,Math.min(C,Number.isFinite(k)?k:O)),B===h.length?C:O})};return {measure(h,p){if(h.length===0)return 0;let v=g(p);if(!v)return F(h,p);let R=u(v,pe(p),p.smallCaps),C=p.shaping?`1:${JSON.stringify([p.shaping.script,p.shaping.direction,h])}`:`0:${h}`,O=R.get(C);if(O===void 0){let I=0;try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return F(h,p);let L=J(r$1,s,v,p,h);if(L.glyphs.some(B=>B.id===0))return F(h,p);for(let B of L.glyphs)I+=B.advanceX;}catch{return F(h,p)}O=I/s.fixedPointScale,x(R,C,O);}return O*ye(p)*(p.horizontalScalePercent/100)+h.length*p.characterSpacingPt+E(h,p)},inkBounds(h,p){if(!h||h.length>2||p.shaping?.direction==="rtl"||r(h).length!==1)return;let v=g(p);if(!v)return a.inkBounds?.(h,p);try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return a.inkBounds?.(h,p);let R=J(r$1,s,v,p,h);return Hn(R,pe(p)/2,s.fixedPointScale,ye(p)*p.horizontalScalePercent/100)}catch{return}},caretAdvances(h,p){let v=g(p);if(!v)return T(h,p);try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return T(h,p);let R=J(r$1,s,v,p,h);return R.glyphs.some(C=>C.id===0)?T(h,p):Tc(h,R,ye(p)*(p.horizontalScalePercent/100)/s.fixedPointScale,p.characterSpacingPt,p.shaping?.wordSpacingPt??0)??Sc(h,R.glyphs.reduce((C,O)=>C+O.advanceX,0)*ye(p)*(p.horizontalScalePercent/100)/s.fixedPointScale+h.length*p.characterSpacingPt+E(h,p))}catch{return T(h,p)}},lineMetrics(h){let p=g(h);if(!p)return a.lineMetrics(h);let v=ye(h),R=d.get(p);R||(R=new Map,d.set(p,R));let C=pe(h),O=R.get(C);if(O)return v===1?O:{height:O.height*v,baseline:O.baseline*v};let I,L=true,B=p.substitution?.lineMetrics;if(B){let k=C/2;I={height:B.heightEm*k,baseline:B.baselineEm*k};}else try{let k=J(r$1,s,p,h," "),ft=k.metrics.ascent/s.fixedPointScale,Yn=k.metrics.descent/s.fixedPointScale,$n=C/2,ze=ft+Yn,ht=$n*ra,gt=ze>ht?ht/ze:1,mt=ze*gt,Zn=Math.min(Math.max(0,k.metrics.lineGap/s.fixedPointScale),mt*na),bt=mt+Zn;bt>0?I={height:bt,baseline:ft*gt}:(I=a.lineMetrics(h),L=!1);}catch{I=a.lineMetrics(h),L=false;}return L?(R.set(C,I),v===1?I:{height:I.height*v,baseline:I.baseline*v}):I}}}function oa(e,t){return Un({...t,shaper:e.shaper,environment:e.environment})}function aa(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let i of t.pages)r.add(i.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,s=-1,l=-1;for(let i of t.pages){let d=i.box.y;d+i.box.height>=n.top&&d<=a&&(s===-1&&(s=i.index),l=i.index);}if(s===-1){let i=ia(t,n.top);i!==null&&(s=i,l=i);}if(s!==-1){let i=Math.max(0,s-o),d=Math.min(t.pages.length-1,l+o);for(let c=i;c<=d;c+=1)r.add(c);}for(let i of e.pinnedPages??[])i>=0&&i<t.pages.length&&r.add(i);return r}function ia(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 jn=["text-local","paragraph-local","flow-structural","global"];function Vn(e,t){return jn.indexOf(t)>jn.indexOf(e)?t:e}function sa(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function la(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,s=null,l=null,i=0,d=0;function c(u){let m=e.runCooperatively;if(!m)return t(u);let f=m(u);l=f;try{for(;;){let E=f.step();if(E)return E;if(n()!==u.revision)return f.cancel(),d+=1,null;if(l!==f)return null}}finally{l===f&&(l=null);}}function y(u){let m=b(n());m.impact=Vn(m.impact,u.impact),m.structural=m.structural||u.structural;for(let f of u.paragraphIds)m.paragraphIds.add(f);for(let f of u.created)m.created.add(f);for(let f of u.deleted)m.deleted.add(f);for(let f of u.dependencyKeys)m.dependencyKeys.add(f);}let S=u=>({impact:u.impact,paragraphIds:u.paragraphIds,created:u.created,deleted:u.deleted,dependencyKeys:u.dependencyKeys,structural:u.structural,revision:u.revision});function b(u){return a||(a=sa(u)),a.revision=Math.max(a.revision,u),a}function x(){!o||s||(s=o(()=>{s=null,g();}));}function g(){s&&(s(),s=null),l&&(l.cancel(),l=null,d+=1);let u=a;if(!u)return false;a=null;let m=S(u),f=c(m);return !f||f.revision!==n()?(i+=1,y(m),x(),false):(r(f,m),true)}return {notify(u){let m=b(n());m.impact=Vn(m.impact,u.impact);for(let f of u.dirty)m.paragraphIds.add(f);for(let f of u.created)m.created.add(f),m.paragraphIds.add(f);for(let f of u.deleted)m.deleted.add(f),m.paragraphIds.add(f);for(let f of u.dependencyKeys)m.dependencyKeys.add(f);for(let f of u.splitJoin)m.structural=true,"split"in f?(m.paragraphIds.add(f.split.from),m.paragraphIds.add(f.split.tail)):(m.paragraphIds.add(f.join.kept),m.paragraphIds.add(f.join.removed));(u.impact==="flow-structural"||u.impact==="global")&&(m.structural=true),x();},invalidateAll(u,m){let f=b(u);f.impact="flow-structural",f.structural=true,m&&f.dependencyKeys.add(m),x();},flush:g,pending:()=>a?S(a):null,cancel(){s?.(),s=null,l?.cancel(),l=null,a=null;},get staleDiscards(){return i},get cancelledRuns(){return d}}}var Wn=new WeakMap;function U(e){let t=Wn.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,s=(i,d,c,y)=>{for(let S of i){if(S.kind==="paragraph")continue;let b=S.tableId;a.set(b,Math.max(a.get(b)??0,(S.columnEdges?.length??1)-1));let x=o.get(b);x||(x=new Map,o.set(b,x),n.set(b,[]),r.set(b,new Map));for(let g of S.rows){let u=x.get(g.id);u===void 0&&(u=x.size,x.set(g.id,u),r.get(b).set(u,g.cells));for(let m of g.cells)n.get(b).push({pageIndex:d,tableId:b,row:g,cell:m,rowIndex:u,isHeaderRepeat:g.isHeaderRepeat,offsetX:c,offsetY:y}),s(m.blocks,d,c,y);}}};for(let i of e.pages){s(i.fragments,i.index,0,0);for(let d of [i.header,i.footer])d&&s(d.fragments,i.index,d.box.x-i.contentBox.x,d.box.y-i.contentBox.y);for(let d of [i.footnotes,i.endnotes])if(d)for(let c of d.notes)s(c.fragments,i.index,c.box.x-i.contentBox.x,c.box.y-i.contentBox.y);}let l=new Map;for(let[i,d]of n)l.set(i,{placed:d,rows:r.get(i)??new Map,columnCount:a.get(i)??0});return Wn.set(e,l),l}function Xn(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,X(r).to+1);return t}var X=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function da(e,t,n){if(t.tableId!==n.tableId)return null;let r=U(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),s=Math.min(X(t).from,X(n).from),l=Math.max(X(t).to,X(n).to),i=b=>{let{from:x,to:g}=X(b);return g>=s&&x<=l},d=b=>(r.rows.get(b)??[]).some(x=>x.vMergeContinue&&i(x)),c=r.rows.size+Xn(r)+2;for(let b=0;!(b>c);b+=1){let x=false;for(let[g,u]of r.rows)if(!(g<o||g>a))for(let m of u){if(!i(m))continue;let{from:f,to:E}=X(m);f<s&&(s=f,x=true),E>l&&(l=E,x=true);}for(;o>0&&d(o);)o-=1,x=true;for(;d(a+1);)a+=1,x=true;if(!x)break}let y=[],S=new Set;for(let b of r.placed){if(b.isHeaderRepeat||b.rowIndex<o||b.rowIndex>a)continue;let{from:x,to:g}=X(b.cell);g<s||x>l||S.has(b.cell.id)||(S.add(b.cell.id),y.push(b.cell.id));}return y.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:y,rows:{from:o,to:a},columns:{from:s,to:l},text:ca(e,t.tableId,y)}}function wi(e,t){return qn(e,t,true)}function Me(e,t){return qn(e,t,false)}function qn(e,t,n){let r=new Set(t),o=[],a=new Set;for(let s of U(e).values())for(let l of s.placed)if(!(l.isHeaderRepeat||!r.has(l.cell.id)))for(let i of l.cell.blocks)n&&i.kind!=="paragraph"||ie(i,o,a);return o}function ie(e,t,n){if(e.kind==="paragraph"){for(let r of T(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)ie(a,t,n);}function ca(e,t,n){let r=Me(e,n),o=r[0],a=r[r.length-1];return !o||!a?ua(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:re$1(e,a).length}}}function ua(e,t){let n=U(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let l of o.cell.blocks)ie(l,a,new Set);let s=a[0];if(s){let l={paragraphId:s,offset:0};return {anchor:l,head:l}}}for(let o of e.pages)for(let a of B(o)){let s={paragraphId:a.paragraphId,offset:0};return {anchor:s,head:s}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function pa(e){let t=[...B(e)];for(let n of [e.header,e.footer])n&&t.push(...C(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...C(r.fragments));return t}function ya(e,t){let n=new Set(Me(e,t)),r=[],o=new Set;for(let a of e.pages)for(let s of pa(a))if(n.has(s.paragraphId))for(let l of s.lines)for(let i of l.spans){let d=`${i.range.paragraphId}:${i.range.start}:${i.range.end}`;o.has(d)||(o.add(d),r.push(i));}return r}function fa(e,t){let n=new Set(t),r=[];for(let o of U(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 ha(e,t){let n=U(e).get(t.tableId);if(!n)return "";let r=new Set(t.cellIds),o=n.placed.some(l=>l.cell.logicalGridColumn!==void 0),a=new Map,s=new Set;for(let l of n.placed){if(l.isHeaderRepeat||!r.has(l.cell.id)||s.has(l.cell.id))continue;s.add(l.cell.id);let i=Me(e,[l.cell.id]).map(y=>re$1(e,y)).join(`
|
|
3
|
+
`),d=a.get(l.rowIndex),c=l.cell.gridColumn+(o?Math.max(1,l.cell.gridSpan)-1:0);d?d.set(c,i):a.set(l.rowIndex,new Map([[c,i]]));}return [...a.keys()].sort((l,i)=>l-i).map(l=>{let i=a.get(l),d=[];for(let c=0;c<=t.columns.to-t.columns.from;c+=1){let y=o?t.columns.to-c:t.columns.from+c;d.push(i.get(y)??"");}return d.join(" ")}).join(`
|
|
4
|
+
`)}function yt(e,t){let n=null,r=-1;for(let[o,a]of U(e))for(let s of a.placed){if(s.isHeaderRepeat)continue;let l=[];for(let d of s.cell.blocks)ie(d,l,new Set);if(!l.includes(t))continue;let i=o.length;i<=r||(r=i,n={tableId:o,rows:a.rows.size,columns:Xn(a),rowIndex:s.rowIndex,columnIndex:s.cell.logicalGridColumn??s.cell.gridColumn});}return n}function Oi(e,t,n){if(n){let a=yt(e,t);if(!a||a.tableId!==n.tableId)return null;let s=n.cellIds[0];if(!s)return null;let l=U(e).get(n.tableId);if(!l)return null;for(let i of l.placed)if(i.cell.id===s)return {tableId:n.tableId,rowId:i.row.id,cellId:s,cellIds:n.cellIds,gridColumnIndex:i.cell.logicalGridColumn??i.cell.gridColumn,isHeaderRepeat:i.isHeaderRepeat};return null}let r=yt(e,t);if(!r)return null;let o=U(e).get(r.tableId);if(!o)return null;for(let a of o.placed){if(a.isHeaderRepeat)continue;let s=[];for(let l of a.cell.blocks)ie(l,s,new Set);if(s.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 Kn=new WeakMap;function Ii(e,t){let n=Kn.get(e);if(n)return n.get(t)??null;let r=new Map;for(let[o,a]of U(e))for(let s of a.placed){if(s.isHeaderRepeat)continue;let l=[];for(let d of s.cell.blocks)ie(d,l,new Set);let i={tableId:o,rowId:s.row.id,cellId:s.cell.id,rowIndex:s.rowIndex,gridColumn:s.cell.gridColumn,gridSpan:s.cell.gridSpan};for(let d of l){let c=r.get(d);c&&c.tableId.length>=o.length||r.set(d,i);}}return Kn.set(e,r),r.get(t)??null}export{An as $,lo as A,La as B,at as C,Ba as D,co as E,po as F,Aa as G,yo as H,it as I,Ae as J,fo as K,ho as L,go as M,lt as N,xn as O,Rn as P,Fn as Q,vn as R,En as S,Cn as T,xo as U,Ro as V,ae as W,Eo as X,ct as Y,In as Z,Lo as _,ee as a,Xa as aa,D as b,Pn as ba,V as c,_n as ca,j as d,Po as da,te as e,_o as ea,Kt as f,Mo as fa,W as g,ri as ga,Ee as h,Do as ha,we as i,Dn as ia,Ye as j,Zo as ja,M as k,Qo as ka,Y as l,J as la,nn as m,_e as ma,Qe as n,Un as na,Le as o,oa,sr as p,aa as pa,$ as q,la as qa,tt as r,da as ra,lr as s,wi as sa,w as t,Me as ta,nt as u,ya as ua,on as v,fa as va,ot as w,ha as wa,dn as x,yt as xa,G as y,Oi as ya,so as z,Ii as za};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkWQFNWLNY_cjs=require('./chunk-WQFNWLNY.cjs'),chunkBNZF6DYC_cjs=require('./chunk-BNZF6DYC.cjs'),chunkZ2ETEZRU_cjs=require('./chunk-Z2ETEZRU.cjs'),chunkMXOO7KRI_cjs=require('./chunk-MXOO7KRI.cjs');var Te=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function D(e){let n=new Map;for(let t of e)if(Array.isArray(t)){for(let r of t.slice(0,2048)){if(typeof r!="string"||!Te.test(r))continue;let o=r.toLowerCase();if(n.has(o)||n.set(o,r),n.size===2048)break}if(n.size===2048)break}return Object.freeze([...n.values()])}function Ge(e){let n=e&&"failures"in e?e.failures:void 0;return e==null||(e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&(n===void 0||Array.isArray(n)&&n.length===0)?void 0:e}var We=64,we=Object.freeze({family:"Calibri",sizeHalfPoints:22});function Se(e,...n){let t=[e,...n],r=[],o=new Set;for(let a of t)for(let d of a.sources??[]){let c=chunkWQFNWLNY_cjs.g(d.request);o.has(c)||(o.add(c),r.push(d));}let s=[],i=new Set;for(let a of t)for(let d of a.substitutions??[]){let c=chunkWQFNWLNY_cjs.g(d.from);o.has(c)||i.has(c)||(i.add(c),s.push(d));}let u=D(t.map(a=>a.supportedFamilies));return Object.freeze({...u.length?{supportedFamilies:u}:{},epoch:e.epoch??0,maxFontBytes:e.maxFontBytes??chunkWQFNWLNY_cjs.a,sources:Object.freeze(r),...s.length>0?{substitutions:Object.freeze(s)}:{},defaultFont:e.defaultFont??we,...e.language!==void 0?{language:e.language}:{}})}var Ne=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Ee(e){let n=e?.defaultFont?.family;return n!==void 0&&Ne.test(n)?n:we.family}var Ie="docx-editor.dev/font-resolver",Ce=Symbol.for("docx-editor.dev/font-resolver");function tn(e){let n={value:true,enumerable:false,configurable:true};try{Object.defineProperty(e,Ce,n),Object.defineProperty(e,Ie,n);}catch(t){throw new TypeError("defineFontResolver cannot mark a frozen or sealed function; mark it before freezing, or wrap it in a fresh function and mark that.",{cause:t})}return e}function on(e){return typeof e=="function"&&e[Ce]===true}var X=e=>`${e.family.trim().toLowerCase()} ${e.weight} ${e.style}`;function Me(e,n,t){let r=new Map(e.map(o=>[X(o),o]));for(let[o,s]of n)r.set(o,s);for(let o of t)r.has(X(o.to))&&r.set(X(o.from),o.from);return [...r.values()]}async function rn(e,n,t={}){return ve(e,n,t)}async function sn(e,n,t={}){return ve(e,n,t)}async function ve(e,n,t){let r=e.map(_e),o,s=[],i=[],u=new Map,a=new Set,d=0,c=[],f=new Set,m=[],S=n.resolvedFaces??[],E=n.defaultFamily;for(let b=0;b<e.length;b+=1){ke(n.signal);let k=e[b],I=Me(S,u,c),P;try{let x=r[b],O;if(x){let l=await Re(x,n.signal);if(!l.ok)throw l.cause;O=l.value;}else if(typeof k=="function"){let l=await Re(Promise.resolve(k(Le(n,E,I,d))).then(p=>({ok:!0,value:p}),p=>({ok:!1,cause:p})),n.signal);if(!l.ok)throw l.cause;O=l.value;}else O=k;if(O==null)continue;if(typeof O=="function"){Z(t,k,b,new TypeError("A font origin answered with a function; pass the resolver itself rather than a function returning one"));continue}let R="failures"in O?O.failures:void 0,M=[];if(Array.isArray(R)){let l=Math.min(R.length,chunkWQFNWLNY_cjs.b);for(let p=0;p<l;p++)M.push(R[p]);R.length>l&&M.push(new Error("Additional font-origin failures were omitted"));}else R!==void 0&&M.push(R);let C=Be(O,a,d,f,o?"maxFontBytes"in o&&o.maxFontBytes!==void 0?o.maxFontBytes:chunkWQFNWLNY_cjs.a:void 0,t.reserveOwnedBytes,t.instrumentation);P=C;for(let l of new Set([...C.dropped,...M]))Z(t,k,b,l);let w=C.fragment;w.supportedFamilies&&s.push(w.supportedFamilies),m.push(...M);let $=(w.sources??[]).map(l=>(chunkWQFNWLNY_cjs.g(l.request),[X(l.request),l.request])),y=[...w.substitutions??[]];!o&&"defaultFont"in w&&(E=Ee(w)),o||(o=w);let g=new Set(C.sourceKeys);if(g.size>0){c=c.filter(l=>!g.has(chunkWQFNWLNY_cjs.g(l.from)));for(let l of g)f.delete(l);}i.push(...w.sources??[]);for(let l of C.sourceKeys)a.add(l);d+=C.ownedBytes;for(let[l,p]of $)u.set(l,p);for(let l of y)c.push(l),f.add(chunkWQFNWLNY_cjs.g(l.from));}catch(x){if(P?.releaseOwnedBytes?.(),n.signal?.aborted)throw n.signal.reason??x;if(x instanceof V)throw x.cause;Z(t,k,b,x);continue}}if(!o)return;let{epoch:N,...j}=Se({...o,supportedFamilies:D(s),sources:i,substitutions:c});return m.length===0?j:{...j,failures:Object.freeze(m)}}var V=class extends Error{constructor(t){super("Unable to reserve owned font bytes");this.cause=t;this.name="FontOwnershipReservationError";}cause},Y=class extends RangeError{};async function Re(e,n){if(!n)return e;ke(n);let t,r=new Promise((s,i)=>{t=i;}),o=()=>t?.(n.reason);n.addEventListener("abort",o,{once:true});try{return await Promise.race([e,r])}finally{n.removeEventListener("abort",o);}}function _e(e){if(e===null||typeof e!="object")return;let n;try{n=e.then;}catch(t){return Promise.resolve({ok:false,cause:t})}if(typeof n=="function")return Promise.resolve(e).then(t=>({ok:true,value:t}),t=>({ok:false,cause:t}))}function Be(e,n,t,r,o,s,i){let u=e.sources??[],a=e.substitutions??[],d="maxFontBytes"in e?e.maxFontBytes:void 0,c="defaultFont"in e?e.defaultFont:void 0,f="epoch"in e?e.epoch:void 0,m="language"in e?e.language:void 0;if(!Array.isArray(u)||!Array.isArray(a))throw new TypeError("Font origin sources and substitutions must be arrays");let S=u.length,E=a.length;if(S>chunkWQFNWLNY_cjs.b)throw new RangeError(`Font source count must not exceed ${chunkWQFNWLNY_cjs.b}`);if(E>chunkWQFNWLNY_cjs.b)throw new RangeError(`Font substitution count must not exceed ${chunkWQFNWLNY_cjs.b}`);let N=d??chunkWQFNWLNY_cjs.a;if(!Number.isSafeInteger(N)||N<=0||N>chunkWQFNWLNY_cjs.a)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${chunkWQFNWLNY_cjs.a}`);let j=o??N,b=0,k=[],I=new Set,P=[],x=[];for(let y=0;y<S;y+=1){let g=u[y];try{let l=Q(g.request),p=g.availability,B=g.faceIndex,h=g.hash,A=g.id,L=chunkWQFNWLNY_cjs.g(l);if(p!==void 0&&p!=="available"&&p!=="forbidden")throw new TypeError("Font source availability must be available or forbidden");if(!Number.isSafeInteger(B)||B<0)throw new RangeError("Font face index must be a non-negative safe integer");if(typeof h!="string"||h.length===0)throw new TypeError("Font source hash must be a non-empty string");let K;if(p!=="forbidden"){if(typeof A!="string"||A.length===0)throw new TypeError("Font source id must be a non-empty string");K=g.bytes;let J=chunkWQFNWLNY_cjs.e(K);if(J>j)throw new RangeError("Font source exceeds the effective base byte ceiling");if(n.has(L)||I.has(L))continue;if(t+b+J>chunkWQFNWLNY_cjs.c)throw new RangeError(`Font sources exceed the aggregate byte ceiling of ${chunkWQFNWLNY_cjs.c}`);b+=J;}else K=new Uint8Array(0);if(n.has(L)||I.has(L))continue;if(n.size+I.size>=chunkWQFNWLNY_cjs.b)throw new Y(`Font source count must not exceed ${chunkWQFNWLNY_cjs.b}`);I.add(L),k.push(L),P.push(Object.freeze({request:l,id:A,bytes:K,hash:h,faceIndex:B,...p?{availability:p}:{}}));}catch(l){if(l instanceof Y)throw l;x.push(l);}}let O=new Set,R=[];for(let y=0;y<E;y+=1){let g=a[y];try{let l=Q(g.from),p=Q(g.to);chunkWQFNWLNY_cjs.g(l),chunkWQFNWLNY_cjs.g(p);let B=g.lineMetrics,h=B?Object.freeze({heightEm:B.heightEm,baselineEm:B.baselineEm}):void 0;if(h&&(!Number.isFinite(h.heightEm)||!Number.isFinite(h.baselineEm)||h.heightEm<=0||h.heightEm>4||h.baselineEm<0||h.baselineEm>h.heightEm))throw new RangeError("Font substitution line metrics must fit within a bounded em box");let A=chunkWQFNWLNY_cjs.g(l);if(n.has(A)||I.has(A)||r.has(A)||O.has(A))continue;O.add(A),R.push(Object.freeze({from:l,to:p,...h?{lineMetrics:h}:{}}));}catch(l){x.push(l);}}if((S>0||E>0)&&P.length===0&&R.length===0&&x.length>0)throw x[0];let M=r.size;for(let y of I)r.has(y)&&(M-=1);if(M+O.size>chunkWQFNWLNY_cjs.b)throw new RangeError(`Font substitution count must not exceed ${chunkWQFNWLNY_cjs.b}`);let C;if(c!==void 0){let y=c.family,g=c.sizeHalfPoints;if(chunkWQFNWLNY_cjs.g({family:y,weight:400,style:"normal"}),!Number.isSafeInteger(g)||g<=0)throw new RangeError("Default font size must be a positive safe integer in half-points");C=Object.freeze({family:y,sizeHalfPoints:g});}if(f!==void 0&&(!Number.isSafeInteger(f)||f<0))throw new RangeError("Font configuration epoch must be a non-negative safe integer");if(m!==void 0&&typeof m!="string")throw new TypeError("Font shaping language must be a string");let w;if(b>0&&s)try{w=s(b);}catch(y){throw new V(y)}let $;try{$=P.map(y=>chunkWQFNWLNY_cjs.f(y,i));}catch(y){throw w?.(),y}return {fragment:Object.freeze({supportedFamilies:D([e.supportedFamilies]),sources:Object.freeze($),substitutions:Object.freeze(R),...f!==void 0?{epoch:f}:{},...d!==void 0?{maxFontBytes:d}:{},...C?{defaultFont:C}:{},...m!==void 0?{language:m}:{}}),sourceKeys:Object.freeze(k),ownedBytes:b,dropped:Object.freeze(x),releaseOwnedBytes:w}}function Pe(e){return !Number.isSafeInteger(e)||e<=0?0:e>chunkWQFNWLNY_cjs.c?chunkWQFNWLNY_cjs.c:e}function Le(e,n,t,r){let{committedSourceBytes:o,...s}=e,i=Pe(r);return {...s,defaultFamily:n,...t.length>0?{resolvedFaces:t}:{},...i>0?{committedSourceBytes:i}:{}}}function Q(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function ke(e){if(e?.aborted)throw e.reason??new DOMException("Font resolution was aborted","AbortError")}function Z(e,n,t,r){let o;try{typeof n=="function"&&n.name.length>0&&(o=n.name);}catch{}let s=Object.freeze({originIndex:t,...o!==void 0?{originName:o}:{},cause:r});if(e.onOriginFailure)try{let u=e.onOriginFailure(s);Promise.resolve(u).catch(a=>{console.warn("[fonts] font-origin diagnostic callback failed",a);});return}catch(u){console.warn("[fonts] font-origin diagnostic callback failed",u);}let i="";try{r instanceof Error&&r.message.length>0&&(i=`: ${r.message}`);}catch{}console.warn(`[fonts] a font origin failed and was skipped${i}`,r);}function G(e){let n=new WeakMap;return (t,r)=>{let o=new Set;for(let s of t){let i=[{node:s,context:r,next:0}],u=a=>{i.pop();let d=i.at(-1)?.found??o;for(let c of a)d.add(c);};for(;i.length;){let a=i[i.length-1],d=n.get(a.node);if(d?.key===a.context.key){u(d.families);continue}if(!a.children){let m=e(a.node,a.context);a.children=m.children,a.found=new Set(m.families);}let c=a.children[a.next++];if(c){i.push({...c,next:0});continue}let f=[...a.found];f.length<=256?n.set(a.node,{key:a.context.key,families:f}):n.delete(a.node),u(f);}}return [...o]}}function W(e,n){return e.children.flatMap(t=>t.kind==="textValue"?[]:[{node:t,context:n}])}function qe(e,n){let{styles:t,theme:r,supplementalFamilies:o,depth:s}=n;if(e.kind==="table"){let a=chunkBNZF6DYC_cjs.Rc(e,468,s,t),d=[];for(let c of a?.rows??[])for(let f of c.cells){let m={...n,depth:s+1,cellStyle:f.styleFormatting,key:`${n.baseKey}|${s+1}|${JSON.stringify(f.styleFormatting)}`};for(let S of f.blocks)d.push({node:S,context:m});}return {children:d.reverse()}}let i=new Set;if(e.kind==="paragraph"){let a=e.children.find(c=>c.kind==="paragraphProperties"),d=chunkBNZF6DYC_cjs.Fb(t,a,n.cellStyle).runProperties;for(let c of chunkBNZF6DYC_cjs.tc(e,d,void 0,(f,m)=>chunkBNZF6DYC_cjs.Hb(f,m,t),void 0,void 0,"all-markup",void 0,void 0,r)){if(!c.text||c.fontSlot!=="eastAsia"&&!o.has(c.style.fontFamily??""))continue;let f=chunkZ2ETEZRU_cjs.a((c.fontSlot==="eastAsia"?c.style.fontFamilyEastAsia:c.style.fontFamily)??void 0);f&&i.add(f);}}let u=e.localName==="txbxContent"?{...n,cellStyle:void 0,key:`${n.baseKey}|${s}|undefined`}:n;return {families:[...i],children:W(e,u).reverse()}}function ze(){let e=G(qe),n,t;return (r,o,s)=>{if(!n||t!==o||n.theme!==s){let i=chunkBNZF6DYC_cjs.Eb(o,s);t=o,n={key:`${i.cacheToken}|0|undefined`,baseKey:i.cacheToken,styles:i,theme:s,depth:0,supplementalFamilies:new Set([...Object.values(s.majorSupplemental??{}),...Object.values(s.minorSupplemental??{})])};}return e([...r].reverse(),n)}}function yn(e,n,t){return ze()(e,n,t)}function ee(e,n){return e.attributes.find(t=>t.localName===n)?.value}var De=G((e,n)=>{let t=[];if(e.namespaceUri===chunkMXOO7KRI_cjs.da){if(e.localName==="fldSimple"){let r=chunkBNZF6DYC_cjs.kc(ee(e,"instr")??"")?.font;r&&t.push(r);}if(e.localName==="p")for(let r of je(e))t.push(r);}return {families:t,children:W(e,n)}});function Cn(e){let n=new Map;for(let t of De(e,{key:""})){let r=chunkZ2ETEZRU_cjs.a(t);r!==null&&!n.has(r.toLowerCase())&&n.set(r.toLowerCase(),r);}return [...n.values()]}function je(e){let n=[],t=chunkBNZF6DYC_cjs.ia(),r=[];for(let o=e.children.length-1;o>=0;o-=1){let s=e.children[o];s.kind!=="textValue"&&r.push({node:s,containerDepth:0});}for(;r.length>0;){let{node:o,containerDepth:s}=r.pop();if(s>=chunkMXOO7KRI_cjs.la||o.namespaceUri===chunkMXOO7KRI_cjs.da&&o.localName==="p")continue;if(o.namespaceUri===chunkMXOO7KRI_cjs.da&&o.localName==="fldChar"){let u=ee(o,"fldCharType");u==="begin"?chunkBNZF6DYC_cjs.la(t):u==="separate"?(t.nesting===1&&Ae(t,n),chunkBNZF6DYC_cjs.na(t)):u==="end"&&(t.nesting===1&&Ae(t,n),chunkBNZF6DYC_cjs.oa(t));continue}if(o.namespaceUri===chunkMXOO7KRI_cjs.da&&(o.localName==="instrText"||o.localName==="delInstrText")){chunkBNZF6DYC_cjs.ma(t,$e(o),o.localName==="delInstrText");continue}if(o.namespaceUri===chunkMXOO7KRI_cjs.da&&o.localName==="fldSimple"){let u=chunkBNZF6DYC_cjs.kc(ee(o,"instr")??"");u?.font&&n.push(u.font);}let i=chunkMXOO7KRI_cjs.ma(o,s);for(let u=o.children.length-1;u>=0;u-=1){let a=o.children[u];a.kind!=="textValue"&&r.push({node:a,containerDepth:i});}}return chunkBNZF6DYC_cjs.ja(t),n}function Ae(e,n){let t=chunkBNZF6DYC_cjs.ka(e);if(t.overflow)return;let r=chunkBNZF6DYC_cjs.kc(t.instruction);r?.font&&n.push(r.font);}function $e(e){let n="",t=[...e.children].reverse();for(;t.length>0&&n.length<=256;){let r=t.pop();if(r.kind==="textValue")n+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)t.push(r.children[o]);}return n}function vn(e,n,t,r){if(!n)return [];let o=chunkBNZF6DYC_cjs.wc(n),s=chunkBNZF6DYC_cjs.Eb(t,r),i=new Map;for(let u of e)for(let a of Ke(u)){let d=chunkMXOO7KRI_cjs.Id(a.children),c=f=>{if(f)for(let m of f.values())for(let S of [m.markerStyle.fontFamily,m.markerStyle.fontFamilyEastAsia]){let E=chunkZ2ETEZRU_cjs.a(S??void 0);if(E===null)continue;let N=E.toLowerCase();i.has(N)||i.set(N,E);}};c(chunkBNZF6DYC_cjs.Ob(d,o,s));for(let f of d){let m=chunkBNZF6DYC_cjs.nd(f);for(let S of m.contents)c(chunkBNZF6DYC_cjs.md(S,o,s));}}return [...i.values()].sort((u,a)=>u.localeCompare(a))}function Ke(e){if(e.localName==="document"){for(let n of e.children)if(n.kind!=="textValue"&&n.localName==="body")return [n];return []}if(e.localName==="footnotes"||e.localName==="endnotes"){let n=[];for(let t of e.children)t.kind!=="textValue"&&(t.localName==="footnote"||t.localName==="endnote")&&n.push(t);return n}return [e]}var Ue={regular:{weight:400,style:"normal"},bold:{weight:700,style:"normal"},italic:{weight:400,style:"italic"},boldItalic:{weight:700,style:"italic"}};function Tn(e,n){let t=[],r=[],o=0;for(let s of e){let i=s.bytes.byteLength;if(!Number.isSafeInteger(i)||i>n||i>chunkWQFNWLNY_cjs.a||i>chunkWQFNWLNY_cjs.c-o){r.push(s);continue}o+=i,t.push(s);}return {sources:t,dropped:r}}function Nn(e,n,t){let r=n.reduce((s,i)=>s+i.bytes.byteLength,0),o=new Set(n.filter(s=>s.request.family.trim().length>0).map(s=>chunkWQFNWLNY_cjs.g(s.request)));return He(e,{maxFontBytes:t,aggregateBudget:Math.max(0,chunkWQFNWLNY_cjs.c-r),shadowedRequests:o})}function He(e,n){let t=[],r=[],o=n.aggregateBudget,s=new Set;for(let i of e){let u=Ue[i.style],a=Object.freeze({family:i.family,weight:u.weight,style:u.style});if(i.family.trim().length===0){r.push({request:a,partName:i.partName,reason:"malformed"});continue}let d=chunkWQFNWLNY_cjs.g(a);if(!(n.shadowedRequests?.has(d)||s.has(d))){if(s.add(d),i.bytes.byteLength>n.maxFontBytes||i.bytes.byteLength>o){r.push({request:a,partName:i.partName,reason:"overLimit"});continue}o-=i.bytes.byteLength,t.push({request:a,id:`embedded:${i.partName}#${i.style}`,bytes:i.bytes,hash:chunkMXOO7KRI_cjs.a(i.bytes),faceIndex:0});}}return {sources:t,dropped:r}}exports.a=D;exports.b=Ge;exports.c=We;exports.d=we;exports.e=Se;exports.f=Ee;exports.g=Ie;exports.h=Ce;exports.i=tn;exports.j=on;exports.k=rn;exports.l=sn;exports.m=Tn;exports.n=Nn;exports.o=He;exports.p=G;exports.q=W;exports.r=ze;exports.s=yn;exports.t=Cn;exports.u=je;exports.v=vn;
|
|
1
|
+
'use strict';var chunkIYCXQAFT_cjs=require('./chunk-IYCXQAFT.cjs'),chunkQBKAOSVF_cjs=require('./chunk-QBKAOSVF.cjs'),chunkT5B4NMKF_cjs=require('./chunk-T5B4NMKF.cjs'),chunkZZRCVDQU_cjs=require('./chunk-ZZRCVDQU.cjs');var Te=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function D(e){let n=new Map;for(let t of e)if(Array.isArray(t)){for(let r of t.slice(0,2048)){if(typeof r!="string"||!Te.test(r))continue;let o=r.toLowerCase();if(n.has(o)||n.set(o,r),n.size===2048)break}if(n.size===2048)break}return Object.freeze([...n.values()])}function Ge(e){let n=e&&"failures"in e?e.failures:void 0;return e==null||(e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&(n===void 0||Array.isArray(n)&&n.length===0)?void 0:e}var We=64,we=Object.freeze({family:"Calibri",sizeHalfPoints:22});function Se(e,...n){let t=[e,...n],r=[],o=new Set;for(let a of t)for(let d of a.sources??[]){let c=chunkIYCXQAFT_cjs.g(d.request);o.has(c)||(o.add(c),r.push(d));}let s=[],i=new Set;for(let a of t)for(let d of a.substitutions??[]){let c=chunkIYCXQAFT_cjs.g(d.from);o.has(c)||i.has(c)||(i.add(c),s.push(d));}let u=D(t.map(a=>a.supportedFamilies));return Object.freeze({...u.length?{supportedFamilies:u}:{},epoch:e.epoch??0,maxFontBytes:e.maxFontBytes??chunkIYCXQAFT_cjs.a,sources:Object.freeze(r),...s.length>0?{substitutions:Object.freeze(s)}:{},defaultFont:e.defaultFont??we,...e.language!==void 0?{language:e.language}:{}})}var Ne=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Ee(e){let n=e?.defaultFont?.family;return n!==void 0&&Ne.test(n)?n:we.family}var Ie="docx-editor.dev/font-resolver",Ce=Symbol.for("docx-editor.dev/font-resolver");function tn(e){let n={value:true,enumerable:false,configurable:true};try{Object.defineProperty(e,Ce,n),Object.defineProperty(e,Ie,n);}catch(t){throw new TypeError("defineFontResolver cannot mark a frozen or sealed function; mark it before freezing, or wrap it in a fresh function and mark that.",{cause:t})}return e}function on(e){return typeof e=="function"&&e[Ce]===true}var X=e=>`${e.family.trim().toLowerCase()} ${e.weight} ${e.style}`;function Me(e,n,t){let r=new Map(e.map(o=>[X(o),o]));for(let[o,s]of n)r.set(o,s);for(let o of t)r.has(X(o.to))&&r.set(X(o.from),o.from);return [...r.values()]}async function rn(e,n,t={}){return ve(e,n,t)}async function sn(e,n,t={}){return ve(e,n,t)}async function ve(e,n,t){let r=e.map(_e),o,s=[],i=[],u=new Map,a=new Set,d=0,c=[],f=new Set,m=[],S=n.resolvedFaces??[],E=n.defaultFamily;for(let b=0;b<e.length;b+=1){ke(n.signal);let k=e[b],I=Me(S,u,c),P;try{let x=r[b],O;if(x){let l=await Re(x,n.signal);if(!l.ok)throw l.cause;O=l.value;}else if(typeof k=="function"){let l=await Re(Promise.resolve(k(Le(n,E,I,d))).then(p=>({ok:!0,value:p}),p=>({ok:!1,cause:p})),n.signal);if(!l.ok)throw l.cause;O=l.value;}else O=k;if(O==null)continue;if(typeof O=="function"){Z(t,k,b,new TypeError("A font origin answered with a function; pass the resolver itself rather than a function returning one"));continue}let R="failures"in O?O.failures:void 0,M=[];if(Array.isArray(R)){let l=Math.min(R.length,chunkIYCXQAFT_cjs.b);for(let p=0;p<l;p++)M.push(R[p]);R.length>l&&M.push(new Error("Additional font-origin failures were omitted"));}else R!==void 0&&M.push(R);let C=Be(O,a,d,f,o?"maxFontBytes"in o&&o.maxFontBytes!==void 0?o.maxFontBytes:chunkIYCXQAFT_cjs.a:void 0,t.reserveOwnedBytes,t.instrumentation);P=C;for(let l of new Set([...C.dropped,...M]))Z(t,k,b,l);let w=C.fragment;w.supportedFamilies&&s.push(w.supportedFamilies),m.push(...M);let $=(w.sources??[]).map(l=>(chunkIYCXQAFT_cjs.g(l.request),[X(l.request),l.request])),y=[...w.substitutions??[]];!o&&"defaultFont"in w&&(E=Ee(w)),o||(o=w);let g=new Set(C.sourceKeys);if(g.size>0){c=c.filter(l=>!g.has(chunkIYCXQAFT_cjs.g(l.from)));for(let l of g)f.delete(l);}i.push(...w.sources??[]);for(let l of C.sourceKeys)a.add(l);d+=C.ownedBytes;for(let[l,p]of $)u.set(l,p);for(let l of y)c.push(l),f.add(chunkIYCXQAFT_cjs.g(l.from));}catch(x){if(P?.releaseOwnedBytes?.(),n.signal?.aborted)throw n.signal.reason??x;if(x instanceof V)throw x.cause;Z(t,k,b,x);continue}}if(!o)return;let{epoch:N,...j}=Se({...o,supportedFamilies:D(s),sources:i,substitutions:c});return m.length===0?j:{...j,failures:Object.freeze(m)}}var V=class extends Error{constructor(t){super("Unable to reserve owned font bytes");this.cause=t;this.name="FontOwnershipReservationError";}cause},Y=class extends RangeError{};async function Re(e,n){if(!n)return e;ke(n);let t,r=new Promise((s,i)=>{t=i;}),o=()=>t?.(n.reason);n.addEventListener("abort",o,{once:true});try{return await Promise.race([e,r])}finally{n.removeEventListener("abort",o);}}function _e(e){if(e===null||typeof e!="object")return;let n;try{n=e.then;}catch(t){return Promise.resolve({ok:false,cause:t})}if(typeof n=="function")return Promise.resolve(e).then(t=>({ok:true,value:t}),t=>({ok:false,cause:t}))}function Be(e,n,t,r,o,s,i){let u=e.sources??[],a=e.substitutions??[],d="maxFontBytes"in e?e.maxFontBytes:void 0,c="defaultFont"in e?e.defaultFont:void 0,f="epoch"in e?e.epoch:void 0,m="language"in e?e.language:void 0;if(!Array.isArray(u)||!Array.isArray(a))throw new TypeError("Font origin sources and substitutions must be arrays");let S=u.length,E=a.length;if(S>chunkIYCXQAFT_cjs.b)throw new RangeError(`Font source count must not exceed ${chunkIYCXQAFT_cjs.b}`);if(E>chunkIYCXQAFT_cjs.b)throw new RangeError(`Font substitution count must not exceed ${chunkIYCXQAFT_cjs.b}`);let N=d??chunkIYCXQAFT_cjs.a;if(!Number.isSafeInteger(N)||N<=0||N>chunkIYCXQAFT_cjs.a)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${chunkIYCXQAFT_cjs.a}`);let j=o??N,b=0,k=[],I=new Set,P=[],x=[];for(let y=0;y<S;y+=1){let g=u[y];try{let l=Q(g.request),p=g.availability,B=g.faceIndex,h=g.hash,A=g.id,L=chunkIYCXQAFT_cjs.g(l);if(p!==void 0&&p!=="available"&&p!=="forbidden")throw new TypeError("Font source availability must be available or forbidden");if(!Number.isSafeInteger(B)||B<0)throw new RangeError("Font face index must be a non-negative safe integer");if(typeof h!="string"||h.length===0)throw new TypeError("Font source hash must be a non-empty string");let K;if(p!=="forbidden"){if(typeof A!="string"||A.length===0)throw new TypeError("Font source id must be a non-empty string");K=g.bytes;let J=chunkIYCXQAFT_cjs.e(K);if(J>j)throw new RangeError("Font source exceeds the effective base byte ceiling");if(n.has(L)||I.has(L))continue;if(t+b+J>chunkIYCXQAFT_cjs.c)throw new RangeError(`Font sources exceed the aggregate byte ceiling of ${chunkIYCXQAFT_cjs.c}`);b+=J;}else K=new Uint8Array(0);if(n.has(L)||I.has(L))continue;if(n.size+I.size>=chunkIYCXQAFT_cjs.b)throw new Y(`Font source count must not exceed ${chunkIYCXQAFT_cjs.b}`);I.add(L),k.push(L),P.push(Object.freeze({request:l,id:A,bytes:K,hash:h,faceIndex:B,...p?{availability:p}:{}}));}catch(l){if(l instanceof Y)throw l;x.push(l);}}let O=new Set,R=[];for(let y=0;y<E;y+=1){let g=a[y];try{let l=Q(g.from),p=Q(g.to);chunkIYCXQAFT_cjs.g(l),chunkIYCXQAFT_cjs.g(p);let B=g.lineMetrics,h=B?Object.freeze({heightEm:B.heightEm,baselineEm:B.baselineEm}):void 0;if(h&&(!Number.isFinite(h.heightEm)||!Number.isFinite(h.baselineEm)||h.heightEm<=0||h.heightEm>4||h.baselineEm<0||h.baselineEm>h.heightEm))throw new RangeError("Font substitution line metrics must fit within a bounded em box");let A=chunkIYCXQAFT_cjs.g(l);if(n.has(A)||I.has(A)||r.has(A)||O.has(A))continue;O.add(A),R.push(Object.freeze({from:l,to:p,...h?{lineMetrics:h}:{}}));}catch(l){x.push(l);}}if((S>0||E>0)&&P.length===0&&R.length===0&&x.length>0)throw x[0];let M=r.size;for(let y of I)r.has(y)&&(M-=1);if(M+O.size>chunkIYCXQAFT_cjs.b)throw new RangeError(`Font substitution count must not exceed ${chunkIYCXQAFT_cjs.b}`);let C;if(c!==void 0){let y=c.family,g=c.sizeHalfPoints;if(chunkIYCXQAFT_cjs.g({family:y,weight:400,style:"normal"}),!Number.isSafeInteger(g)||g<=0)throw new RangeError("Default font size must be a positive safe integer in half-points");C=Object.freeze({family:y,sizeHalfPoints:g});}if(f!==void 0&&(!Number.isSafeInteger(f)||f<0))throw new RangeError("Font configuration epoch must be a non-negative safe integer");if(m!==void 0&&typeof m!="string")throw new TypeError("Font shaping language must be a string");let w;if(b>0&&s)try{w=s(b);}catch(y){throw new V(y)}let $;try{$=P.map(y=>chunkIYCXQAFT_cjs.f(y,i));}catch(y){throw w?.(),y}return {fragment:Object.freeze({supportedFamilies:D([e.supportedFamilies]),sources:Object.freeze($),substitutions:Object.freeze(R),...f!==void 0?{epoch:f}:{},...d!==void 0?{maxFontBytes:d}:{},...C?{defaultFont:C}:{},...m!==void 0?{language:m}:{}}),sourceKeys:Object.freeze(k),ownedBytes:b,dropped:Object.freeze(x),releaseOwnedBytes:w}}function Pe(e){return !Number.isSafeInteger(e)||e<=0?0:e>chunkIYCXQAFT_cjs.c?chunkIYCXQAFT_cjs.c:e}function Le(e,n,t,r){let{committedSourceBytes:o,...s}=e,i=Pe(r);return {...s,defaultFamily:n,...t.length>0?{resolvedFaces:t}:{},...i>0?{committedSourceBytes:i}:{}}}function Q(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function ke(e){if(e?.aborted)throw e.reason??new DOMException("Font resolution was aborted","AbortError")}function Z(e,n,t,r){let o;try{typeof n=="function"&&n.name.length>0&&(o=n.name);}catch{}let s=Object.freeze({originIndex:t,...o!==void 0?{originName:o}:{},cause:r});if(e.onOriginFailure)try{let u=e.onOriginFailure(s);Promise.resolve(u).catch(a=>{console.warn("[fonts] font-origin diagnostic callback failed",a);});return}catch(u){console.warn("[fonts] font-origin diagnostic callback failed",u);}let i="";try{r instanceof Error&&r.message.length>0&&(i=`: ${r.message}`);}catch{}console.warn(`[fonts] a font origin failed and was skipped${i}`,r);}function G(e){let n=new WeakMap;return (t,r)=>{let o=new Set;for(let s of t){let i=[{node:s,context:r,next:0}],u=a=>{i.pop();let d=i.at(-1)?.found??o;for(let c of a)d.add(c);};for(;i.length;){let a=i[i.length-1],d=n.get(a.node);if(d?.key===a.context.key){u(d.families);continue}if(!a.children){let m=e(a.node,a.context);a.children=m.children,a.found=new Set(m.families);}let c=a.children[a.next++];if(c){i.push({...c,next:0});continue}let f=[...a.found];f.length<=256?n.set(a.node,{key:a.context.key,families:f}):n.delete(a.node),u(f);}}return [...o]}}function W(e,n){return e.children.flatMap(t=>t.kind==="textValue"?[]:[{node:t,context:n}])}function qe(e,n){let{styles:t,theme:r,supplementalFamilies:o,depth:s}=n;if(e.kind==="table"){let a=chunkQBKAOSVF_cjs.Rc(e,468,s,t),d=[];for(let c of a?.rows??[])for(let f of c.cells){let m={...n,depth:s+1,cellStyle:f.styleFormatting,key:`${n.baseKey}|${s+1}|${JSON.stringify(f.styleFormatting)}`};for(let S of f.blocks)d.push({node:S,context:m});}return {children:d.reverse()}}let i=new Set;if(e.kind==="paragraph"){let a=e.children.find(c=>c.kind==="paragraphProperties"),d=chunkQBKAOSVF_cjs.Fb(t,a,n.cellStyle).runProperties;for(let c of chunkQBKAOSVF_cjs.tc(e,d,void 0,(f,m)=>chunkQBKAOSVF_cjs.Hb(f,m,t),void 0,void 0,"all-markup",void 0,void 0,r)){if(!c.text||c.fontSlot!=="eastAsia"&&!o.has(c.style.fontFamily??""))continue;let f=chunkT5B4NMKF_cjs.a((c.fontSlot==="eastAsia"?c.style.fontFamilyEastAsia:c.style.fontFamily)??void 0);f&&i.add(f);}}let u=e.localName==="txbxContent"?{...n,cellStyle:void 0,key:`${n.baseKey}|${s}|undefined`}:n;return {families:[...i],children:W(e,u).reverse()}}function ze(){let e=G(qe),n,t;return (r,o,s)=>{if(!n||t!==o||n.theme!==s){let i=chunkQBKAOSVF_cjs.Eb(o,s);t=o,n={key:`${i.cacheToken}|0|undefined`,baseKey:i.cacheToken,styles:i,theme:s,depth:0,supplementalFamilies:new Set([...Object.values(s.majorSupplemental??{}),...Object.values(s.minorSupplemental??{})])};}return e([...r].reverse(),n)}}function yn(e,n,t){return ze()(e,n,t)}function ee(e,n){return e.attributes.find(t=>t.localName===n)?.value}var De=G((e,n)=>{let t=[];if(e.namespaceUri===chunkZZRCVDQU_cjs.da){if(e.localName==="fldSimple"){let r=chunkQBKAOSVF_cjs.kc(ee(e,"instr")??"")?.font;r&&t.push(r);}if(e.localName==="p")for(let r of je(e))t.push(r);}return {families:t,children:W(e,n)}});function Cn(e){let n=new Map;for(let t of De(e,{key:""})){let r=chunkT5B4NMKF_cjs.a(t);r!==null&&!n.has(r.toLowerCase())&&n.set(r.toLowerCase(),r);}return [...n.values()]}function je(e){let n=[],t=chunkQBKAOSVF_cjs.ia(),r=[];for(let o=e.children.length-1;o>=0;o-=1){let s=e.children[o];s.kind!=="textValue"&&r.push({node:s,containerDepth:0});}for(;r.length>0;){let{node:o,containerDepth:s}=r.pop();if(s>=chunkZZRCVDQU_cjs.la||o.namespaceUri===chunkZZRCVDQU_cjs.da&&o.localName==="p")continue;if(o.namespaceUri===chunkZZRCVDQU_cjs.da&&o.localName==="fldChar"){let u=ee(o,"fldCharType");u==="begin"?chunkQBKAOSVF_cjs.la(t):u==="separate"?(t.nesting===1&&Ae(t,n),chunkQBKAOSVF_cjs.na(t)):u==="end"&&(t.nesting===1&&Ae(t,n),chunkQBKAOSVF_cjs.oa(t));continue}if(o.namespaceUri===chunkZZRCVDQU_cjs.da&&(o.localName==="instrText"||o.localName==="delInstrText")){chunkQBKAOSVF_cjs.ma(t,$e(o),o.localName==="delInstrText");continue}if(o.namespaceUri===chunkZZRCVDQU_cjs.da&&o.localName==="fldSimple"){let u=chunkQBKAOSVF_cjs.kc(ee(o,"instr")??"");u?.font&&n.push(u.font);}let i=chunkZZRCVDQU_cjs.ma(o,s);for(let u=o.children.length-1;u>=0;u-=1){let a=o.children[u];a.kind!=="textValue"&&r.push({node:a,containerDepth:i});}}return chunkQBKAOSVF_cjs.ja(t),n}function Ae(e,n){let t=chunkQBKAOSVF_cjs.ka(e);if(t.overflow)return;let r=chunkQBKAOSVF_cjs.kc(t.instruction);r?.font&&n.push(r.font);}function $e(e){let n="",t=[...e.children].reverse();for(;t.length>0&&n.length<=256;){let r=t.pop();if(r.kind==="textValue")n+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)t.push(r.children[o]);}return n}function vn(e,n,t,r){if(!n)return [];let o=chunkQBKAOSVF_cjs.wc(n),s=chunkQBKAOSVF_cjs.Eb(t,r),i=new Map;for(let u of e)for(let a of Ke(u)){let d=chunkZZRCVDQU_cjs.Id(a.children),c=f=>{if(f)for(let m of f.values())for(let S of [m.markerStyle.fontFamily,m.markerStyle.fontFamilyEastAsia]){let E=chunkT5B4NMKF_cjs.a(S??void 0);if(E===null)continue;let N=E.toLowerCase();i.has(N)||i.set(N,E);}};c(chunkQBKAOSVF_cjs.Ob(d,o,s));for(let f of d){let m=chunkQBKAOSVF_cjs.nd(f);for(let S of m.contents)c(chunkQBKAOSVF_cjs.md(S,o,s));}}return [...i.values()].sort((u,a)=>u.localeCompare(a))}function Ke(e){if(e.localName==="document"){for(let n of e.children)if(n.kind!=="textValue"&&n.localName==="body")return [n];return []}if(e.localName==="footnotes"||e.localName==="endnotes"){let n=[];for(let t of e.children)t.kind!=="textValue"&&(t.localName==="footnote"||t.localName==="endnote")&&n.push(t);return n}return [e]}var Ue={regular:{weight:400,style:"normal"},bold:{weight:700,style:"normal"},italic:{weight:400,style:"italic"},boldItalic:{weight:700,style:"italic"}};function Tn(e,n){let t=[],r=[],o=0;for(let s of e){let i=s.bytes.byteLength;if(!Number.isSafeInteger(i)||i>n||i>chunkIYCXQAFT_cjs.a||i>chunkIYCXQAFT_cjs.c-o){r.push(s);continue}o+=i,t.push(s);}return {sources:t,dropped:r}}function Nn(e,n,t){let r=n.reduce((s,i)=>s+i.bytes.byteLength,0),o=new Set(n.filter(s=>s.request.family.trim().length>0).map(s=>chunkIYCXQAFT_cjs.g(s.request)));return He(e,{maxFontBytes:t,aggregateBudget:Math.max(0,chunkIYCXQAFT_cjs.c-r),shadowedRequests:o})}function He(e,n){let t=[],r=[],o=n.aggregateBudget,s=new Set;for(let i of e){let u=Ue[i.style],a=Object.freeze({family:i.family,weight:u.weight,style:u.style});if(i.family.trim().length===0){r.push({request:a,partName:i.partName,reason:"malformed"});continue}let d=chunkIYCXQAFT_cjs.g(a);if(!(n.shadowedRequests?.has(d)||s.has(d))){if(s.add(d),i.bytes.byteLength>n.maxFontBytes||i.bytes.byteLength>o){r.push({request:a,partName:i.partName,reason:"overLimit"});continue}o-=i.bytes.byteLength,t.push({request:a,id:`embedded:${i.partName}#${i.style}`,bytes:i.bytes,hash:chunkZZRCVDQU_cjs.a(i.bytes),faceIndex:0});}}return {sources:t,dropped:r}}exports.a=D;exports.b=Ge;exports.c=We;exports.d=we;exports.e=Se;exports.f=Ee;exports.g=Ie;exports.h=Ce;exports.i=tn;exports.j=on;exports.k=rn;exports.l=sn;exports.m=Tn;exports.n=Nn;exports.o=He;exports.p=G;exports.q=W;exports.r=ze;exports.s=yn;exports.t=Cn;exports.u=je;exports.v=vn;
|