@docx-editor.dev/core 2.32.0 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +14 -52
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +14 -14
- package/dist/binding.js +1 -1
- package/dist/{chrome-print-CznJ0ucN.d.ts → chrome-print-DY0xsXm_.d.ts} +231 -125
- package/dist/chunk-37IYWENL.cjs +1 -0
- package/dist/chunk-37RNWL45.js +4 -0
- package/dist/chunk-5HUVQXET.cjs +4 -0
- package/dist/chunk-5JP3QQF7.js +7 -0
- package/dist/chunk-5KOLFKOB.cjs +5 -0
- package/dist/chunk-6MF5PN2E.js +236 -0
- package/dist/chunk-77JT2AU7.js +2 -0
- package/dist/{chunk-ETDZFNMI.js → chunk-7FUORGCW.js} +1 -1
- package/dist/chunk-A5BTVPET.cjs +236 -0
- package/dist/chunk-AFXFH2T2.js +3 -0
- package/dist/chunk-AVCYP7OY.js +5 -0
- package/dist/chunk-BL2E4QRA.js +1 -0
- package/dist/chunk-DB7X4Y6O.js +4 -0
- package/dist/chunk-DR6W23TB.cjs +2 -0
- package/dist/chunk-DYLB5U42.js +1 -0
- package/dist/chunk-E5BKDHIP.cjs +1 -0
- package/dist/chunk-IWXBRUPG.cjs +4 -0
- package/dist/{chunk-L5TYBFDB.js → chunk-KCUXXO3Q.js} +1 -1
- package/dist/chunk-KYA4Y2YB.js +1 -0
- package/dist/{chunk-6UDJUI3W.cjs → chunk-L74TCGVH.cjs} +1 -1
- package/dist/chunk-NBSSQSKY.js +30 -0
- package/dist/{chunk-OKMEMSKB.cjs → chunk-NEM774E3.cjs} +1 -1
- package/dist/chunk-NKZVMMHU.cjs +1 -0
- package/dist/chunk-TXIO5WYQ.cjs +32 -0
- package/dist/chunk-UKG2TXWH.cjs +7 -0
- package/dist/chunk-V7CO55DO.cjs +3 -0
- package/dist/chunk-VLQDQNSS.js +1 -0
- package/dist/chunk-VQOAC3VI.cjs +30 -0
- package/dist/chunk-YWJSQA2O.js +32 -0
- package/dist/chunk-ZJ74LCFI.cjs +1 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +13 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +3 -3
- package/dist/contracts/editor.d.ts +10 -10
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.d.ts +12 -12
- package/dist/contracts/types.d.ts +4 -4
- package/dist/{custom-node-writes-CLJKGD9t.d.ts → custom-node-writes-DparEcZK.d.ts} +45 -7
- package/dist/diagnostic-context-CkZKkKvB.d.ts +98 -0
- package/dist/{diagnostic-hints-DK8-V0fk.d.ts → diagnostic-hints-BTyb8yzX.d.ts} +3 -3
- package/dist/{document-protection-NaniLHWF.d.ts → document-protection-DdWxihIN.d.ts} +1 -1
- package/dist/{headless-document-view-Bcz9_Qva.d.ts → drawing-graphic-kind-CK0cMc7H.d.ts} +161 -18
- package/dist/drawing-preview-package-fFjXpOMS.d.ts +115 -0
- package/dist/{editor-DZwOTmlR.d.ts → editor-DDCkWqfD.d.ts} +125 -21
- package/dist/{editor-scope-B3L-1ALc.d.ts → editor-scope-CA6egMaK.d.ts} +5 -1
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +4 -4
- package/dist/editor.d.ts +387 -78
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +47 -12
- package/dist/export.js +2 -2
- package/dist/{font-resolver-BlQNGdvR.d.ts → font-resolver-Bm9XqTNO.d.ts} +14 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +38 -23
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-E5J4Z1Gf.d.ts → layout-shaping-Byj-TwsI.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +434 -199
- package/dist/layout.js +1 -1
- package/dist/metafile-drawing-Ce6TuWLm.d.ts +115 -0
- package/dist/{note-properties-Ds5R2_3F.d.ts → note-properties-BiunaIQa.d.ts} +31 -7
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +77 -13
- package/dist/output.js +1 -1
- package/dist/{protocol-DKa4qt7F.d.ts → protocol-Dn44dL4M.d.ts} +184 -120
- package/dist/{review-paragraph-order-Dc17w_6v.d.ts → review-paragraph-order-BWMXAKuA.d.ts} +1 -1
- package/dist/{revision-projection-Cn6rZJ7H.d.ts → revision-projection-DwFhgIR0.d.ts} +1 -1
- package/dist/{semantic-cell-selection-BaUR0iJ4.d.ts → semantic-cell-selection-DhalxEBH.d.ts} +2 -2
- package/dist/{semantic-interaction-CJoHLoOl.d.ts → semantic-interaction-QeuzEtAk.d.ts} +2 -4
- package/dist/{semantic-paint-BPw_n0li.d.ts → semantic-paint-BYDZbTiY.d.ts} +16 -9
- package/dist/{semantic-record-queries-C0rJ3sB4.d.ts → semantic-record-queries-Bf5bgQL3.d.ts} +1 -1
- package/dist/{semantic-records-BvN-WWst.d.ts → semantic-records-CzZiWMY8.d.ts} +348 -132
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +526 -19
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-C_S2niXW.d.ts → tree-op-types-DKvJSH8T.d.ts} +1024 -501
- package/dist/{tree-package-store-CRHvMyNj.d.ts → tree-package-store-Cl3BkWXF.d.ts} +8 -3
- package/dist/{tree-session-contract-D1awo_dA.d.ts → tree-session-contract-BL50pqs8.d.ts} +15 -8
- package/dist/{unsupported-elements-CVos5cqe.d.ts → unsupported-elements-Bra4QTOM.d.ts} +1 -1
- package/licenses/ECMA-376.md +29 -0
- package/package.json +2 -2
- package/dist/bookmark-names-DDuAra_V.d.ts +0 -37
- package/dist/chunk-25EXMBV2.cjs +0 -5
- package/dist/chunk-3IEXDEFH.cjs +0 -7
- package/dist/chunk-65XBN67F.cjs +0 -2
- package/dist/chunk-6NVZNB7O.cjs +0 -3
- package/dist/chunk-ACLR4DMK.js +0 -1
- package/dist/chunk-B2BEELUE.js +0 -1
- package/dist/chunk-DDFHKQFU.js +0 -30
- package/dist/chunk-E4IAO4CY.cjs +0 -2
- package/dist/chunk-FDSL5OJU.cjs +0 -30
- package/dist/chunk-FS7CMYLT.js +0 -4
- package/dist/chunk-GDS24SZN.js +0 -30
- package/dist/chunk-GIY6NT2X.js +0 -5
- package/dist/chunk-GWM3AKUD.js +0 -18
- package/dist/chunk-HDOXACHP.js +0 -2
- package/dist/chunk-IILEENID.js +0 -1
- package/dist/chunk-MNF2K7NN.cjs +0 -30
- package/dist/chunk-O324RB6R.cjs +0 -1
- package/dist/chunk-QXJKYNYZ.js +0 -1
- package/dist/chunk-RALTVLB6.js +0 -2
- package/dist/chunk-SRVKFUFI.js +0 -3
- package/dist/chunk-TELQ52LG.cjs +0 -1
- package/dist/chunk-TJHE5EET.cjs +0 -1
- package/dist/chunk-UMMRURPE.js +0 -7
- package/dist/chunk-XJYZVGQR.cjs +0 -1
- package/dist/chunk-ZGTIE3QJ.cjs +0 -4
- package/dist/chunk-ZOZI27AW.cjs +0 -18
- package/dist/diagnostic-context-BtDUY3v2.d.ts +0 -31
package/dist/chunk-65XBN67F.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkZOZI27AW_cjs=require('./chunk-ZOZI27AW.cjs'),fflate=require('fflate');var lc=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],cc=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,dc=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function Ei(t){return cc.test(t)||dc.test(t)}function Cn(t,e){if(!Ei(t))throw new Error(`invalid ${e??"registry"} id ${JSON.stringify(t)}: must be reverse-domain (dev.docx-editor.core.x) or package-owned (@scope/pkg#kind/name)`)}var mc=/^(\d+)\.(\d+)\.(\d+)$/;function mt(t){let e=mc.exec(t);if(!e)throw new Error(`invalid semantic version: ${JSON.stringify(t)}`);return {major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3])}}function Mn(t,e){return t.major!==e.major?t.major<e.major?-1:1:t.minor!==e.minor?t.minor<e.minor?-1:1:t.patch!==e.patch?t.patch<e.patch?-1:1:0}function An(t,e){let n=mt(t),r=e.trim();if(r==="*")return true;if(r.startsWith("^")){let o=mt(r.slice(1));return Mn(n,o)<0?false:o.major>0?n.major===o.major:o.minor>0?n.major===0&&n.minor===o.minor:n.major===0&&n.minor===0}if(r.includes(" ")){let o=r.split(/\s+/);if(o.length!==2)throw new Error(`unsupported version range: ${JSON.stringify(e)}`);let i=true;for(let a of o){let s=a.startsWith(">=")?">=":a.startsWith("<")?"<":null;if(!s)throw new Error(`unsupported version range: ${JSON.stringify(e)}`);let l=mt(a.slice(s.length)),c=Mn(n,l);s===">="?i=i&&c>=0:i=i&&c<0;}return i}return Mn(n,mt(r))===0}var ge=class extends Error{constructor(n,r,o=[]){super(r);this.code=n;this.responsible=o;this.name="RegistryError";}code;responsible},Dr=(t,e)=>`${t}:${e}`;function uc(t,e={}){let n=new Map;for(let c of t){if(Cn(c.id,"extension"),Ti(c.version,c.id),n.has(c.id))throw new ge("duplicate-extension",`duplicate extension id ${c.id}`,[c.id]);n.set(c.id,c);for(let d of c.contributions)Cn(d.id,d.kind),Ti(d.version,`${c.id} \u2192 ${d.id}`),d.replaces&&gc(d.replaces.targetRange,`${c.id} \u2192 replaces ${d.replaces.targetId}`);}for(let c of t){for(let d of c.dependencies??[])if(!n.has(d))throw new ge("missing-dependency",`${c.id} requires missing extension ${d}`,[c.id,d]);for(let d of c.conflicts??[])if(n.has(d)){let u=[c.id,d].sort();throw new ge("conflict",`extensions ${u[0]} and ${u[1]} conflict`,u)}}fc(n);let r=new Set(e.availablePorts??[]);for(let c of t)for(let d of c.contributions)d.kind==="runtimePort"&&r.add(d.id);for(let c of t)for(let d of c.requiredPorts??[])if(!r.has(d))throw new ge("missing-port",`${c.id} requires unavailable port ${d}`,[c.id,d]);let o=new Map,i=new Map,a=new Map;for(let c of t)for(let d of c.contributions){let u=Dr(d.kind,d.id);if(d.replaces){let m=Dr(d.kind,d.replaces.targetId),f=a.get(m)??[];f.push({ext:c.id,c:d}),a.set(m,f);continue}if(i.has(u)){let m=[o.get(u),c.id].sort();throw new ge("id-collision",`${d.kind} id ${d.id} registered by both ${m[0]} and ${m[1]}`,m)}i.set(u,d),o.set(u,c.id);}let s=new Map(i);for(let[c,d]of a){let u=i.get(c);if(!u){let h=d[0];throw new ge("replacement-target-missing",`${h.ext} replaces missing target ${h.c.replaces.targetId}`,[h.ext,h.c.replaces.targetId])}let m=u.replaceable??{kind:"none"};for(let{ext:h,c:b}of d){if(!An(u.version,b.replaces.targetRange))throw new ge("replacement-version-mismatch",`${h} replaces ${b.replaces.targetId}@${u.version} outside range ${b.replaces.targetRange}`,[h,b.replaces.targetId]);if(m.kind==="none")throw new ge("unauthorized-replacement",`${b.replaces.targetId} does not authorize replacement (attempted by ${h})`,[h,b.replaces.targetId])}let f=pc(u,d);s.set(c,f);}return {extensions:n,contributions:s,get:(c,d)=>s.get(Dr(c,d))}}function pc(t,e){let n=t.replaceable??{kind:"none"};if(e.length===1)return e[0].c;if(n.kind==="priority"){let o=[...e].sort((s,l)=>(l.c.replaces.priority??0)-(s.c.replaces.priority??0)),i=o[0].c.replaces.priority??0,a=o.filter(s=>(s.c.replaces.priority??0)===i);if(a.length>1){let s=a.map(l=>l.ext).sort();throw new ge("ambiguous-replacement",`multiple replacers of ${t.id} share top priority ${i}: ${s.join(", ")}`,s)}return o[0].c}let r=e.map(o=>o.ext).sort();throw new ge("ambiguous-replacement",`multiple replacers of ${t.id}: ${r.join(", ")}`,r)}function fc(t){let o=new Map,i=[],a=s=>{o.set(s,1),i.push(s);let l=[...t.get(s)?.dependencies??[]].sort();for(let c of l){let d=o.get(c)??0;if(d===1){let u=i.indexOf(c),m=[...i.slice(u),c];throw new ge("dependency-cycle",`dependency cycle: ${m.join(" -> ")}`,m)}d===0&&a(c);}i.pop(),o.set(s,2);};for(let s of [...t.keys()].sort())(o.get(s)??0)===0&&a(s);}function Ti(t,e){try{mt(t);}catch{throw new ge("invalid-version",`invalid version ${JSON.stringify(t)} in ${e}`,[e])}}function gc(t,e){try{An("0.0.0",t);}catch{throw new ge("invalid-version",`invalid version range ${JSON.stringify(t)} in ${e}`,[e])}}var ut=class extends Error{constructor(e){super(e),this.name="BudgetError";}},Vt=class t{constructor(e,n){this.label=e;this.capacity=n;this.used=new chunkZOZI27AW_cjs.u(`${e}.budget`,n);}label;capacity;used;children=new Set;activeReservations=0;cleanups=[];disposed=false;carveAmount=0;parent;get inUse(){return this.used.current}get available(){return this.used.remaining}get isDisposed(){return this.disposed}reserve(e){this.assertLive(),this.used.add(e),this.activeReservations+=1;let n=false,r=this;return {amount:e,get released(){return n},release(){n||(n=true,r.used.release(e),r.activeReservations-=1);}}}child(e,n){this.assertLive(),this.used.add(n);let r=new t(e,n);return r.parent=this,r.carveAmount=n,this.children.add(r),r}onRelease(e){this.assertLive(),this.cleanups.push(e);}dispose(){if(this.disposed)return;if(this.children.size>0)throw new ut(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new ut(`${this.label}: cannot release with ${this.activeReservations} reservation(s) outstanding`);let e=[];for(let n=this.cleanups.length-1;n>=0;n--)try{this.cleanups[n]();}catch(r){e.push(r);}if(this.disposed=true,this.parent&&(this.parent.children.delete(this),this.parent.used.release(this.carveAmount),this.parent=void 0),e.length>0)throw new ut(`${this.label}: ${e.length} cleanup error(s); first: ${String(e[0])}`)}assertLive(){if(this.disposed)throw new ut(`${this.label}: budget already released`)}};var Dn=class extends Error{constructor(n,r){super(r?`cancelled: ${r}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},zt=class{_cancelled=false;_phase="pre-publication";_reason;cancel(e){this._cancelled=true,e!==void 0&&(this._reason=e);}markPublished(){this._phase="post-publication";}get isCancelled(){return this._cancelled}get phase(){return this._phase}get isPublished(){return this._phase==="post-publication"}get derivedOnly(){return this._cancelled&&this._phase==="post-publication"}get token(){let e=this;return {get isCancelled(){return e._cancelled},get phase(){return e._phase},get derivedOnly(){return e.derivedOnly},checkpoint(){if(e._cancelled)throw new Dn(e.derivedOnly,e._reason)}}}};var _n=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},_r=class{ports=new Map;provide(e,n){return this.ports.set(e,n),this}has(e){return this.ports.has(e)}resolve(e){if(!this.ports.has(e))throw new _n(e);return this.ports.get(e)}missing(e){return e.filter(n=>!this.ports.has(n))}availablePorts(){return [...this.ports.keys()]}clock(){return this.resolve(chunkZOZI27AW_cjs.k.clock)}identity(){return this.resolve(chunkZOZI27AW_cjs.k.identity)}},Fr=class{constructor(e=0,n=1){this.step=n;this.t=e;}step;t;now(){let e=this.t;return this.t+=this.step,e}},Lr=class{constructor(e="id"){this.prefix=e;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function hc(t){let e=chunkZOZI27AW_cjs.p(t.limits),n=Object.freeze({...t.config??{}}),r=t.capacity??e.maxDecompressedBytes,o=t.id??"op",i={id:o,limits:e,config:n,ports:t.ports,budget:new Vt(`op:${o}`,r),cancellation:new zt};return Object.freeze(i)}function yc(t){t.budget.dispose();}var Ur=Object.freeze({maxRecursionDepth:{unit:"depth",phase:"xml-parse"},maxElementCount:{unit:"count",phase:"xml-parse"},maxPartCount:{unit:"count",phase:"package-read"},maxDecompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressionRatio:{unit:"ratio",phase:"package-read"},maxChunkBytes:{unit:"bytes",phase:"package-read"},maxPaginationPasses:{unit:"passes",phase:"layout"},maxQueueDepth:{unit:"count",phase:"output"}}),wi=Object.keys(Ur);function xc(t,e){return new chunkZOZI27AW_cjs.u(`${Ur[e].phase}:${e}`,t[e])}var Hr=class{counter;current=0;peak=0;constructor(e){this.counter=new chunkZOZI27AW_cjs.u("memory",e);}allocate(e){this.counter.add(e),this.current+=e,this.current>this.peak&&(this.peak=this.current);}free(e){this.counter.release(e),this.current=Math.max(0,this.current-e);}get currentBytes(){return this.current}get peakBytes(){return this.peak}reset(){this.counter.release(this.current),this.current=0;}};function kc(){for(let t of wi){let e=chunkZOZI27AW_cjs.o[t],n=chunkZOZI27AW_cjs.n[t];if(!Number.isFinite(e)||e<=0)throw new Error(`default ${t} must be finite > 0`);if(!Number.isFinite(n)||n<=0)throw new Error(`ceiling ${t} must be finite > 0`);if(e>n)throw new Error(`default ${t} exceeds ceiling`)}}var De="dev.docx-editor.core.comparator",$r={authoredState:{id:`${De}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${De}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${De}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${De}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${De}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${De}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${De}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${De}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${De}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${De}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function Br(t,e,n,r={}){let o=$r[t];switch(o.mode){case "sync-optimization-only":throw new Error(`${o.id} is not an equivalence basis (${o.note})`);case "tolerance":{if(r.epsilon===void 0)throw new Error(`${o.id} requires an explicit epsilon`);return {equal:Ci(e,n,r.epsilon)}}case "exact":case "canonical-exact":{let i=o.mode==="canonical-exact"?new Set(o.ephemera):new Set,a=chunkZOZI27AW_cjs.v(e,i),s=chunkZOZI27AW_cjs.v(n,i);return a===s?{equal:true}:{equal:false,left:a,right:s}}}}function jr(t,e){let n=$r[t];if(n.mode==="tolerance"||n.mode==="sync-optimization-only")throw new Error(`${n.id} has no canonical fingerprint (${n.mode})`);let r=n.mode==="canonical-exact"?new Set(n.ephemera):void 0;return chunkZOZI27AW_cjs.w(e,r)}function Ci(t,e,n){return typeof t=="number"&&typeof e=="number"?Number.isFinite(t)&&Number.isFinite(e)&&Math.abs(t-e)<=n:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,o)=>Ci(r,e[o],n)):false}var Ai=new Set([...chunkZOZI27AW_cjs.h,...chunkZOZI27AW_cjs.i]),Mi=/^[0-9a-f]{16}$/,Pc=/^[0-9a-f]*$/;function Vr(t){let e=[],n=o=>e.push(o);t.formatVersion!==1&&n(`unsupported formatVersion ${t.formatVersion}`),t.documentId||n("documentId is required"),t.source.kind==="docx"&&!/^[0-9a-f]{64}$/.test(t.source.sha256)&&n("docx source requires a 64-hex sha256");let r=-1;t.steps.forEach((o,i)=>{let a=`step[${i}]`;Ai.has(o.origin)||n(`${a}: unknown origin ${o.origin}`),(!Number.isInteger(o.baseRevision)||o.baseRevision<0)&&n(`${a}: baseRevision must be a non-negative integer`),o.baseRevision<r&&n(`${a}: baseRevision regressed below ${r}`);let s=o.expect;s.outcome==="applied"?(s.committedRevision===void 0?n(`${a}: applied step needs committedRevision`):s.committedRevision<=o.baseRevision?n(`${a}: committedRevision ${s.committedRevision} must exceed baseRevision ${o.baseRevision}`):r=s.committedRevision,s.modelChange&&Oc(s.modelChange,a,n)):(s.committedRevision!==void 0&&n(`${a}: ${s.outcome} step must not commit a revision`),s.authoredStateHash!==void 0&&n(`${a}: ${s.outcome} step must not change authored state`)),s.authoredStateHash!==void 0&&!Mi.test(s.authoredStateHash)&&n(`${a}: authoredStateHash must be 16-hex`),s.outputHash!==void 0&&!Mi.test(s.outputHash)&&n(`${a}: outputHash must be 16-hex`);});for(let o of [...t.snapshots??[],...t.updates??[]])o.documentId!==t.documentId&&n(`envelope documentId ${o.documentId} != ${t.documentId}`),Pc.test(o.bytesHex)||n("envelope bytesHex must be hex"),o.bytesHex.length!==o.byteLength*2&&n(`envelope byteLength ${o.byteLength} disagrees with ${o.bytesHex.length/2} decoded bytes`);return {valid:e.length===0,errors:e}}function Oc(t,e,n){Ai.has(t.origin)||n(`${e}: modelChange origin ${t.origin} unknown`),t.toRevision<=t.fromRevision&&n(`${e}: modelChange revision must advance`);}function bc(t,e){let n=Vr(t);if(!n.valid)return {ok:false,mismatches:n.errors};let r=[];return e.init(t),t.steps.forEach((o,i)=>{let a=`step[${i}]`,s=e.applyStep(o),l=o.expect;if(s.outcome!==l.outcome){r.push(`${a}: outcome ${s.outcome} != expected ${l.outcome}`);return}if(l.outcome==="applied"&&(s.committedRevision!==l.committedRevision&&r.push(`${a}: revision ${s.committedRevision} != expected ${l.committedRevision}`),l.authoredStateHash!==void 0))if(s.authoredState===void 0)r.push(`${a}: store returned no authored state to hash`);else {Br("authoredState",s.authoredState,s.authoredState).equal||r.push(`${a}: authored state is not self-consistent`);let d=Di(s.authoredState);d!==l.authoredStateHash&&r.push(`${a}: authoredStateHash ${d} != expected ${l.authoredStateHash}`);}}),{ok:r.length===0,mismatches:r}}function Di(t){return jr("authoredState",t)}var Sc="urn:schemas-microsoft-com:office:office";function Rc(t){return t.kind==="textValue"||t.namespaceUri!==chunkZOZI27AW_cjs.pa?false:t.localName==="object"?true:t.localName==="pict"&&t.children.some(e=>e.kind!=="textValue"&&e.namespaceUri===Sc&&e.localName==="OLEObject")}function Gt(t){let e=[...t];for(;e.length;){let n=e.pop();if(n.kind!=="textValue"){if(Rc(n))return true;for(let r of n.children)e.push(r);}}return false}var _i=24,Ln=Object.freeze([Object.freeze({localName:"kern",attributes:Object.freeze({val:"2"})}),Object.freeze({localName:"sz",attributes:Object.freeze({val:String(_i)})}),Object.freeze({localName:"szCs",attributes:Object.freeze({val:String(_i)})})]),Hn=Object.freeze([Object.freeze({localName:"spacing",attributes:Object.freeze({after:"160",line:"278",lineRule:"auto"})})]),Li=Object.freeze({run:true,paragraph:true}),Hi=Object.freeze({run:false,paragraph:false});function Ui(t){if(!t)return Li;let e=n=>t.children.some(r=>r.kind!=="textValue"&&r.namespaceUri===chunkZOZI27AW_cjs.pa&&r.localName===n);return {run:!e("rPrDefault"),paragraph:!e("pPrDefault")}}function zr(t,e){return t&&t.namespaceUri!==chunkZOZI27AW_cjs.pa?Hi:Ui(e)}function Lu(t){return t?t.namespaceUri!==chunkZOZI27AW_cjs.pa?Hi:Ui(Ic(t)):Li}function Fn(t,e,n,r){return {id:n,kind:t,namespaceUri:chunkZOZI27AW_cjs.pa,localName:e,prefix:"w",namespaceBindings:[],attributes:[],children:r}}function Fi(t,e){let n=t==="rPr"?Ln:Hn;return Fn(t==="rPr"?"runProperties":"paragraphProperties",t,`${e}-${t}`,n.map(r=>chunkZOZI27AW_cjs.aj(r,`${e}-${t}-${r.localName}`)))}function Ic(t){let e=t.children.find(n=>n.kind!=="textValue"&&n.namespaceUri===chunkZOZI27AW_cjs.pa&&n.localName==="docDefaults");return e&&e.kind!=="textValue"?e:void 0}function $i(t,e,n){let r=zr(t,e);if(!r.run&&!r.paragraph)return e;let o=[];r.run&&o.push(Fn("generic","rPrDefault",`${n}-rPrDefault`,[Fi("rPr",n)])),r.paragraph&&o.push(Fn("generic","pPrDefault",`${n}-pPrDefault`,[Fi("pPr",n)]));let i=r.run?[...o,...e?.children??[]]:[...e?.children??[],...o];return e?{...e,children:i}:Fn("generic","docDefaults",`${n}-docDefaults`,i)}var pt="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Nc="http://schemas.openxmlformats.org/package/2006/relationships",vc="http://schemas.openxmlformats.org/drawingml/2006/main",Vi="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",zi="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",Gi="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Wi="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",Ki="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",Gr="application/vnd.openxmlformats-package.relationships+xml",Wr=`${pt}/styles`,Kr=`${pt}/numbering`,Xi=`${pt}/footnotes`,Yi=`${pt}/endnotes`,qi=`${pt}/officeDocument`,Ec=`${pt}/theme`;function we(t){return t.kind!=="textValue"}function Bi(t,e){return {...t,children:e}}function Je(t,e){if(e(t),t.kind!=="textValue")for(let n of t.children)Je(n,e);}var Tc=new Set(["pStyle","rStyle","tblStyle"]);function Xr(t,e){for(let n of t)Je(n,r=>{if(r.kind!=="textValue"&&Tc.has(r.localName)&&r.namespaceUri===chunkZOZI27AW_cjs.pa){let o=chunkZOZI27AW_cjs.eg(r,"val");o&&e.add(o);}});}function Yr(t,e){for(let n of t)Je(n,r=>{if(r.kind!=="textValue"&&r.localName==="numId"&&r.namespaceUri===chunkZOZI27AW_cjs.pa){let o=chunkZOZI27AW_cjs.eg(r,"val");o&&e.add(o);}});}function qr(t){let e=new Set;return Wt(t,e),e}function Wt(t,e){for(let n of t)Je(n,r=>{if(r.kind!=="textValue")for(let o of r.attributes)o.namespaceUri===pt&&o.value.length>0&&e.add(o.value);});}function Ie(t){return /^\d+$/.test(t)?t.replace(/^0+(?=\d)/,""):t}function $n(t,e){let n={footnote:new Set,endnote:new Set},r=[],o=i=>{for(let a of i)Je(a,s=>{if(s.kind!=="noteReference")return;let l=s.localName==="footnoteReference"?"footnote":"endnote",c=chunkZOZI27AW_cjs.eg(s,"id");if(c===void 0)return;let d=Ie(c);n[l].has(d)||(n[l].add(d),r.push({kind:l,id:d}));});};for(o(t);r.length>0;){let i=r.pop(),a=e(i.kind,i.id);a!==null&&o([a]);}return n}function Jr(t,e,n){if(t.kind==="textValue")return t;let r=[],o=false;for(let i of t.children){if(i.kind!=="textValue"&&i.namespaceUri===chunkZOZI27AW_cjs.pa&&(i.localName==="footnoteReference"||i.localName==="endnoteReference")){let l=i.localName==="footnoteReference"?e:n,c=chunkZOZI27AW_cjs.eg(i,"id");if(i.kind!=="noteReference"||c===void 0||!l.has(Ie(c))){o=true;continue}}let s=Jr(i,e,n);s!==i&&(o=true),r.push(s);}return o?{...t,children:r}:t}function wc(t,e){for(let n of chunkZOZI27AW_cjs.Pe(t,e)){if(n.type!==Wr||n.targetMode==="External")continue;let r=chunkZOZI27AW_cjs.E(n.ownerPart,n.rawTarget);if(r.ok)return t.parts.get(r.partName)??null}return t.parts.get("/word/styles.xml")??null}function Ji(t,e,n){for(let r of chunkZOZI27AW_cjs.Pe(t,e)){if(r.type!==n||r.targetMode==="External")continue;let o=chunkZOZI27AW_cjs.E(r.ownerPart,r.rawTarget);if(o.ok)return t.parts.get(o.partName)??null}return null}function Qi(t,e){let n=wc(t,e),r=new Map,o=[],i=null;if(n&&we(n.root))for(let a of n.root.children){if(!we(a))continue;if(a.localName==="docDefaults"&&a.namespaceUri===chunkZOZI27AW_cjs.pa){i=a;continue}if(a.localName!=="style"||a.namespaceUri!==chunkZOZI27AW_cjs.pa)continue;let s=chunkZOZI27AW_cjs.eg(a,"styleId");s&&r.set(s,a),(chunkZOZI27AW_cjs.eg(a,"default")==="1"||chunkZOZI27AW_cjs.eg(a,"default")==="true")&&o.push(a);}return {part:n,byId:r,defaults:o,docDefaults:i}}var Cc=new Set(["basedOn","link","next"]);function Zi(t,e){let n=new Set,r=[...e];for(let a of t.defaults){let s=chunkZOZI27AW_cjs.eg(a,"styleId");s&&r.push(s);}let o=[];for(;r.length>0;){let a=r.pop();if(n.has(a))continue;n.add(a);let s=t.byId.get(a);if(s){o.push(s);for(let l of s.children)if(we(l)&&Cc.has(l.localName)&&l.namespaceUri===chunkZOZI27AW_cjs.pa){let c=chunkZOZI27AW_cjs.eg(l,"val");c&&r.push(c);}}}if(!t.part||!we(t.part.root))return o;let i=new Map;return t.part.root.children.forEach((a,s)=>i.set(a,s)),o.sort((a,s)=>(i.get(a)??0)-(i.get(s)??0))}function Qr(t,e,n){let r=Ji(t,e,Kr)??t.parts.get("/word/numbering.xml")??null;if(!r||!we(r.root)||n.size===0)return {part:r,nums:[],abstracts:[]};let o=[],i=new Set;for(let s of r.root.children){if(!we(s)||s.localName!=="num"||s.namespaceUri!==chunkZOZI27AW_cjs.pa)continue;let l=chunkZOZI27AW_cjs.eg(s,"numId");if(!(!l||!n.has(l))){o.push(s);for(let c of s.children)if(we(c)&&c.localName==="abstractNumId"){let d=chunkZOZI27AW_cjs.eg(c,"val");d&&i.add(d);}}}let a=[];for(let s of r.root.children){if(!we(s)||s.localName!=="abstractNum"||s.namespaceUri!==chunkZOZI27AW_cjs.pa)continue;let l=chunkZOZI27AW_cjs.eg(s,"abstractNumId");l&&i.has(l)&&a.push(s);}return {part:r,nums:o,abstracts:a}}var Un={latin:null,eastAsia:null,cs:null};function es(t,e){let n=Ji(t,e,Ec);if(!n)return {major:Un,minor:Un};let r={major:{...Un},minor:{...Un}};return Je(n.root,o=>{if(o.kind==="textValue"||o.namespaceUri!==vc||o.localName!=="majorFont"&&o.localName!=="minorFont")return;let i=o.localName==="majorFont"?r.major:r.minor;for(let a of o.children){if(!we(a))continue;let s=chunkZOZI27AW_cjs.eg(a,"typeface");s&&(a.localName==="latin"?i.latin=s:a.localName==="ea"?i.eastAsia=s:a.localName==="cs"&&(i.cs=s));}}),{major:r.major,minor:r.minor}}function Mc(t,e){let n=e.startsWith("major")?t.major:t.minor;return e.endsWith("EastAsia")?n.eastAsia??n.latin:e.endsWith("Bidi")?n.cs??n.latin:n.latin}var Ac=[["asciiTheme","ascii"],["hAnsiTheme","hAnsi"],["eastAsiaTheme","eastAsia"],["cstheme","cs"]],ji=new Set(["themeColor","themeTint","themeShade","themeFill","themeFillTint","themeFillShade"]);function Qe(t,e){if(t.kind==="textValue")return t;let n=t.attributes;if(t.localName==="rFonts"&&t.namespaceUri===chunkZOZI27AW_cjs.pa){let i=[],a=new Map;for(let s of t.attributes){let l=Ac.find(([c])=>c===s.localName);if(l&&s.namespaceUri===chunkZOZI27AW_cjs.pa){let c=Mc(e,s.value);c&&a.set(l[1],c);continue}i.push(s);}for(let[s,l]of a)i.some(c=>c.localName===s)||i.push({kind:"genericExtension",namespaceUri:chunkZOZI27AW_cjs.pa,localName:s,prefix:"w",value:l});n=i;}else t.attributes.some(i=>ji.has(i.localName)&&i.namespaceUri===chunkZOZI27AW_cjs.pa&&t.attributes.some(a=>a.localName==="val"))&&(n=t.attributes.filter(i=>!(ji.has(i.localName)&&i.namespaceUri===chunkZOZI27AW_cjs.pa)));let r=t.children.map(i=>Qe(i,e)),o=r.some((i,a)=>i!==t.children[a]);return n===t.attributes&&!o?t:{...t,attributes:n,children:r}}function ts(t,e,n){return {id:t,name:t,contentType:e,root:n}}function ns(t,e){if(t.root.kind==="document"){let r=t.root.children.find(i=>i.kind==="body"),o=r&&we(r)?Bi(r,e):{id:"fragment#body",kind:"body",namespaceUri:chunkZOZI27AW_cjs.pa,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:e};return Bi(t.root,[o])}let n={id:"fragment#body",kind:"body",namespaceUri:chunkZOZI27AW_cjs.pa,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:e};return {id:"fragment#document",kind:"document",namespaceUri:chunkZOZI27AW_cjs.pa,localName:"document",prefix:"w",namespaceBindings:we(t.root)?t.root.namespaceBindings:[],attributes:[],children:[n]}}function Kt(t){let e=t.map(n=>{let r=n.targetMode==="External"?' TargetMode="External"':"";return `<Relationship Id="${chunkZOZI27AW_cjs.W(n.id)}" Type="${chunkZOZI27AW_cjs.W(n.type)}" Target="${chunkZOZI27AW_cjs.W(n.rawTarget)}"${r}/>`}).join("");return `<Relationships xmlns="${Nc}">${e}</Relationships>`}function rs(t,e){let n=e;for(;t.has(`rId${n}`);)n+=1;return `rId${n}`}function os(t){let e=t.lastIndexOf(".");return e===-1?"":t.slice(e+1).toLowerCase()}function Bn(t,e){return {...t,children:e}}function jn(t,e){return t.kind!=="textValue"&&t.localName===e&&t.namespaceUri===chunkZOZI27AW_cjs.pa}function Xt(t,e=[]){if(t.kind==="textValue")return e;t.kind==="paragraph"&&e.push(t.id);for(let n of t.children)Xt(n,e);return e}function as(t,e){if(t.kind==="textValue")return null;if(t.kind==="paragraph"&&t.id===e)return t;for(let n of t.children){let r=as(n,e);if(r)return r}return null}function Dc(t){let e=(n,r)=>{if(n.kind==="textValue")return n;if(r&&jn(n,"vMerge")){if(chunkZOZI27AW_cjs.eg(n,"val")==="restart")return n;let i=[...n.attributes.filter(a=>!(a.localName==="val"&&a.namespaceUri===chunkZOZI27AW_cjs.pa)),{kind:"wmlVal",namespaceUri:chunkZOZI27AW_cjs.pa,localName:"val",prefix:"w",value:"restart"}];return {...n,attributes:i}}if(n.kind==="paragraph"||n.kind==="table")return n;let o=r||jn(n,"tc");return Bn(n,n.children.map(i=>e(i,o)))};return Bn(t,t.children.map(n=>e(n,false)))}function is(t,e){if(!(t.kind==="textValue"||t.kind==="table")){if(jn(t,"tr")){e.push(t);return}for(let n of t.children)is(n,e);}}function ss(t,e,n){if(t.kind==="textValue"||t.kind==="table")return {node:t,hadRows:false,keptRows:false};if(jn(t,"tr")){if(!e.has(t))return {node:null,hadRows:true,keptRows:false};let a=n.value?Dc(t):t;return n.value=false,{node:a,hadRows:true,keptRows:true}}let r=false,o=false,i=[];for(let a of t.children){let s=ss(a,e,n);r||=s.hadRows,o||=s.keptRows,s.node!==null&&i.push(s.node);}return r?{node:o?Bn(t,i):null,hadRows:true,keptRows:o}:{node:t,hadRows:false,keptRows:false}}function ls(t,e,n){let r=[];for(let l of t.children)is(l,r);let o=new Set(Xt(t).filter(l=>e.inRange.has(l)));if(o.size===0)return;let i=r.filter(l=>{let c=Xt(l);return c.length>0&&c.every(d=>e.covered.has(d))}),a=new Set(i.flatMap(l=>Xt(l)));if(i.length>0&&o.size===a.size&&[...o].every(l=>a.has(l))){let l={value:true},c=new Set(i),d=[];for(let u of t.children){let m=ss(u,c,l);m.node!==null&&d.push(m.node);}n.push(Bn(t,d));return}for(let l of Xt(t)){if(!e.inRange.has(l))continue;let c=as(t,l);c&&n.push(c);}}var _c="http://schemas.openxmlformats.org/package/2006/content-types",Fc=5e4;function _e(t){return t.kind!=="textValue"}function cs(t,e=[]){if(t.kind==="textValue")return e;t.kind==="paragraph"&&e.push(t.id);for(let n of t.children)cs(n,e);return e}function Zr(t,e){if(t.kind==="textValue")return null;if(t.kind==="paragraph"&&t.id===e)return t;for(let n of t.children){let r=Zr(n,e);if(r)return r}return null}function Lc(){return {id:"fragment#styles",kind:"generic",namespaceUri:chunkZOZI27AW_cjs.pa,localName:"styles",prefix:"w",namespaceBindings:[{prefix:"w",namespaceUri:chunkZOZI27AW_cjs.pa}],attributes:[],children:[]}}function Be(t,e){return {...t,children:e}}function Hc(t,e){return t.kind!=="textValue"&&t.localName===e&&t.namespaceUri===chunkZOZI27AW_cjs.pa}function Uc(t){if(t.root.kind==="document"){let e=t.root.children.find(n=>n.kind==="body");return e&&_e(e)?e:null}return _e(t.root)?t.root:null}function $c(t,e){return cs(t).some(n=>e.has(n))}function eo(t,e,n){for(let r of t)if(_e(r)){if(r.kind==="paragraph"){e.inRange.has(r.id)&&n.push(r);continue}if(e.fullBlocks.has(r.id)){n.push(r);continue}if(r.kind==="table"){ls(r,e,n);continue}if(r.kind==="contentControl"){let o=r.children.find(i=>i.kind==="contentControlContent");o&&_e(o)&&eo(o.children,e,n);continue}$c(r,e.inRange)&&eo(r.children,e,n);}}var Bc=new Set(["commentRangeStart","commentRangeEnd"]);function jc(t){return t.kind==="run"&&t.children.some(e=>e.kind==="commentReference")}function to(t){if(t.kind==="textValue")return t;if(Bc.has(t.localName)&&t.namespaceUri===chunkZOZI27AW_cjs.pa||jc(t)||Hc(t,"sectPr"))return null;let e=false,n=[];for(let r of t.children){let o=to(r);if(o===null){e=true;continue}o!==r&&(e=true),n.push(o);}return e?Be(t,n):t}function Vc(t){let e=[],n=l=>{if(l.kind!=="textValue"){if(l.kind==="run"){for(let c of l.children)if(c.kind==="fldChar"){let d=chunkZOZI27AW_cjs.eg(c,"fldCharType");e.push({nodeId:c.id,type:d==="separate"||d==="end"?d:"begin"});}else c.kind==="instrText"&&e.push({nodeId:c.id,type:"instr"});return}for(let c of l.children)n(c);}};for(let l of t)n(l);if(e.length===0)return t;let r=new Set,o=[],i=null,a=[];for(let l of e){if(l.type==="begin"){o.push({beginId:l.nodeId,separateId:null,instrIds:[]});continue}if(l.type==="separate"){let d=o[o.length-1];d?d.separateId=l.nodeId:i=l.nodeId;continue}if(l.type==="instr"){let d=o[o.length-1];d?d.instrIds.push(l.nodeId):i===null&&a.push(l.nodeId);continue}if(!o.pop()){r.add(l.nodeId),i!==null&&r.add(i);for(let d of a)r.add(d);i=null,a=[];}}for(let l of o){r.add(l.beginId),l.separateId!==null&&r.add(l.separateId);for(let c of l.instrIds)r.add(c);}i!==null&&r.add(i);for(let l of a)r.add(l);if(r.size===0)return t;let s=l=>{if(l.kind==="textValue")return l;if(r.has(l.id))return null;let c=[],d=false;for(let u of l.children){let m=s(u);if(m===null){d=true;continue}m!==u&&(d=true),c.push(m);}return d?Be(l,c):l};return t.map(l=>s(l)).filter(l=>l!==null)}function no(t){if(t.kind==="textValue")return t.value.length;let e=0;for(let n of t.children)e+=no(n);return e}function zc(t,e){let n=[];for(let r of t.children){if(r.kind!=="contentControl"){n.push(r);continue}let o=e.get(r.id),i=no(r);if(o===void 0||i>=o){n.push(r);continue}if(i===0)continue;let a=r.children.find(s=>s.kind==="contentControlContent");a&&_e(a)?n.push(...a.children):n.push(r);}return Be(t,n)}function Gc(t){let e=new Set,n=new Set,r=a=>{if(a.kind!=="textValue"){if(a.kind==="bookmarkStart"){let s=chunkZOZI27AW_cjs.eg(a,"id");s!==void 0&&e.add(s);}if(a.kind==="bookmarkEnd"){let s=chunkZOZI27AW_cjs.eg(a,"id");s!==void 0&&n.add(s);}for(let s of a.children)r(s);}};for(let a of t)r(a);let o=new Set([...e].filter(a=>n.has(a)));if(o.size===e.size&&o.size===n.size)return t;let i=a=>{if(a.kind==="textValue")return a;if(a.kind==="bookmarkStart"||a.kind==="bookmarkEnd"){let c=chunkZOZI27AW_cjs.eg(a,"id");return c!==void 0&&o.has(c)?a:null}let s=[],l=false;for(let c of a.children){let d=i(c);if(d===null){l=true;continue}d!==c&&(l=true),s.push(d);}return l?Be(a,s):a};return t.map(a=>i(a)??a)}function Wc(t,e,n){let r=t.parts.get(e.partName);if(!r)return {ok:false,reason:"unknown-part"};if(e.paragraphIds.length===0)return {ok:false,reason:"empty-range"};let o=e.paragraphIds[0],i=e.paragraphIds[e.paragraphIds.length-1],a=new Map;for(let x of [o,i]){let H=Zr(r.root,x);if(!H)return {ok:false,reason:"empty-range"};for(let j of H.children)j.kind==="contentControl"&&a.set(j.id,no(j));}let s=r,l=Zr(s.root,i);if(!l)return {ok:false,reason:"empty-range"};let c=chunkZOZI27AW_cjs.tg(l);if(e.endOffset<c){let x=chunkZOZI27AW_cjs.Ql(s,{op:"deleteText",paragraphId:i,start:e.endOffset,end:c},{deferValidation:true});if(!x.ok)return {ok:false,reason:"trim-refused"};s=x.part;}if(e.startOffset>0){let x=chunkZOZI27AW_cjs.Ql(s,{op:"deleteText",paragraphId:o,start:0,end:e.startOffset},{deferValidation:true});if(!x.ok)return {ok:false,reason:"trim-refused"};s=x.part;}let d=Uc(s);if(!d)return {ok:false,reason:"unknown-part"};let u={inRange:new Set(e.paragraphIds),covered:new Set(e.coveredParagraphIds),fullBlocks:new Set(e.fullyCoveredBlockIds)},m=[];if(eo(d.children,u,m),m.length===0)return {ok:false,reason:"empty-range"};if(m.length>Fc)return {ok:false,reason:"resource-limit"};let f=m.map(x=>to(x)).filter(x=>x!==null).map(x=>x.kind!=="paragraph"||x.id!==o&&x.id!==i?x:zc(x,a));f=[...Vc(f)],f=[...Gc(f)];let h=chunkZOZI27AW_cjs.qh(t,"footnote"),b=chunkZOZI27AW_cjs.qh(t,"endnote"),R=(x,H)=>_e(x)&&x.namespaceUri===chunkZOZI27AW_cjs.pa&&x.localName===H,g=$n(f,(x,H)=>{let j=x==="footnote"?h:b;if(!j||!_e(j.root))return null;for(let Y of j.root.children){if(!R(Y,x))continue;let G=chunkZOZI27AW_cjs.eg(Y,"id");if(G!==void 0&&Ie(G)===H)return Y}return null}),p=g.footnote,P=g.endnote;p.size===0&&(h=null),P.size===0&&(b=null);let M=(x,H,j)=>{if(!x||!_e(x.root))return [];let Y=[];for(let G of x.root.children){if(!R(G,H))continue;let ne=chunkZOZI27AW_cjs.eg(G,"id"),Ke=chunkZOZI27AW_cjs.eg(G,"type");if(Ke==="separator"||Ke==="continuationSeparator"){Y.push(G);continue}if(ne!==void 0&&j.has(Ie(ne))){let Xe=to(G);Xe&&_e(Xe)&&Y.push(Xe);}}return Y},F=M(h,"footnote",p),$=M(b,"endnote",P),w=[...F,...$];if(Gt(f)||Gt(w))return {ok:false,reason:"unsupported-content"};let L=[...f,...w],q=new Set;Xr(L,q);let U=Qi(t,t.mainDocumentPart),J=new Set;Yr(L,J);let ee=[],B=Qr(t,t.mainDocumentPart,J);for(;;){let x=q.size,H=J.size;ee=Zi(U,q),Yr(ee,J),B=Qr(t,t.mainDocumentPart,J);let j=[...B.nums,...B.abstracts];Xr(j,q);for(let Y of j)Je(Y,G=>{if(G.kind!=="textValue"&&(G.localName==="styleLink"||G.localName==="numStyleLink")&&G.namespaceUri===chunkZOZI27AW_cjs.pa){let ne=chunkZOZI27AW_cjs.eg(G,"val");ne&&q.add(ne);}});if(q.size===x&&J.size===H)break}let re=es(t,t.mainDocumentPart),ue=ee.map(x=>Qe(x,re)),le=U.part&&_e(U.part.root)?U.part.root:null,A=$i(le,U.docDefaults,"fragment#doc-defaults"),_=A?Qe(A,re):null;f=f.map(x=>Qe(x,re));let V=F.map(x=>Qe(x,re)),te=$.map(x=>Qe(x,re)),oe=new Set;Wt(f,oe);let de=chunkZOZI27AW_cjs.Pe(t,r.name).filter(x=>oe.has(x.id)),S=new Map,k=0,E=x=>{let H=new Set;for(let j of x){if(j.targetMode==="External")continue;let Y=chunkZOZI27AW_cjs.E(j.ownerPart,j.rawTarget);if(!Y.ok){H.add(j.id);continue}if((chunkZOZI27AW_cjs.Qe(t,Y.partName)??"").toLowerCase().startsWith("image/")&&n?.omitMedia!==true){let ne=t.partBytes.get(Y.partName)??t.partBytes.get(Y.partName.replace(/^\//,""));ne?(S.set(Y.partName,ne),k+=ne.byteLength):H.add(j.id);continue}H.add(j.id);}return H},N=E(de),W=(x,H)=>{if(x.kind==="textValue")return x;if(x.kind==="drawing"||x.namespaceUri===chunkZOZI27AW_cjs.pa&&(x.localName==="pict"||x.localName==="object")){let G=new Set;Wt([x],G);for(let ne of G)if(H.has(ne))return null;return x}let j=[],Y=false;for(let G of x.children){let ne=W(G,H);if(ne===null){Y=true;continue}ne!==G&&(Y=true),j.push(ne);}return Y?Be(x,j):x};N.size>0&&(f=f.map(x=>W(x,N)).filter(x=>x!==null));let Q=de.filter(x=>!N.has(x.id)),ce=(x,H)=>{if(!x)return [];let j=new Set;Wt(H,j);let Y=chunkZOZI27AW_cjs.Pe(t,x.name).filter(ne=>j.has(ne.id)),G=E(Y);if(G.size>0)for(let ne=0;ne<H.length;ne+=1){let Ke=W(H[ne],G);Ke!==null&&(H[ne]=Ke);}return Y.filter(ne=>!G.has(ne.id))},Fe=ce(h,V),rn=ce(b,te),Oe=new Map,yt=[],tr=new Map,nt=(x,H,j)=>{let Y=ts(x,H,j);Oe.set(x.slice(1),chunkZOZI27AW_cjs._d(chunkZOZI27AW_cjs.Fa(Y))),yt.push([x,H]),tr.set(x,Y);},y=(x,H)=>x.map(j=>{if(j.targetMode==="External")return {...j,ownerPart:H};let Y=chunkZOZI27AW_cjs.E(j.ownerPart,j.rawTarget);return {...j,ownerPart:H,rawTarget:Y.ok?Y.partName:j.rawTarget}}),v=y(Q,"/word/document.xml"),T=y(Fe,"/word/footnotes.xml"),D=y(rn,"/word/endnotes.xml"),z=new Set(v.map(x=>x.id)),K=9001,ie=(x,H)=>{let j=rs(z,K);K+=1,z.add(j),v.push({ownerPart:"/word/document.xml",id:j,type:x,rawTarget:H,targetMode:"Internal",order:v.length});},Ne=ns(s,f);if(nt("/word/document.xml",Vi,Ne),ue.length>0||_){let x=Be(le??Lc(),[..._?[_]:[],...ue]);nt("/word/styles.xml",zi,x),ie(Wr,"styles.xml");}if(B.part&&(B.nums.length>0||B.abstracts.length>0)){let x=Be(B.part.root,[...B.abstracts.map(H=>Qe(H,re)),...B.nums]);nt("/word/numbering.xml",Gi,x),ie(Kr,"numbering.xml");}h&&V.length>0&&(nt("/word/footnotes.xml",Wi,Be(h.root,V)),ie(Xi,"footnotes.xml"),T.length>0&&Oe.set("word/_rels/footnotes.xml.rels",chunkZOZI27AW_cjs._d(Kt(T)))),b&&te.length>0&&(nt("/word/endnotes.xml",Ki,Be(b.root,te)),ie(Yi,"endnotes.xml"),D.length>0&&Oe.set("word/_rels/endnotes.xml.rels",chunkZOZI27AW_cjs._d(Kt(D))));let pe=new Map;for(let[x,H]of S){Oe.set(x.slice(1),H);let j=os(x);j&&!pe.has(j)&&pe.set(j,chunkZOZI27AW_cjs.H(chunkZOZI27AW_cjs.Qe(t,x)??"application/octet-stream"));}let Me={ownerPart:"/",id:"rId1",type:qi,rawTarget:"word/document.xml",targetMode:"Internal",order:0};Oe.set("word/_rels/document.xml.rels",chunkZOZI27AW_cjs._d(Kt(v))),Oe.set("_rels/.rels",chunkZOZI27AW_cjs._d(Kt([Me])));let rt=[`<Default Extension="rels" ContentType="${Gr}"/>`,'<Default Extension="xml" ContentType="application/xml"/>',...[...pe].map(([x,H])=>`<Default Extension="${chunkZOZI27AW_cjs.W(x)}" ContentType="${chunkZOZI27AW_cjs.W(H)}"/>`)].join(""),ze=yt.map(([x,H])=>`<Override PartName="${chunkZOZI27AW_cjs.W(x)}" ContentType="${chunkZOZI27AW_cjs.W(H)}"/>`).join("");Oe.set("[Content_Types].xml",chunkZOZI27AW_cjs._d(`<Types xmlns="${_c}">${rt}${ze}</Types>`));let Ge=new Map;Ge.set("/",[Me]),Ge.set("/word/document.xml",v),T.length>0&&Ge.set("/word/footnotes.xml",T),D.length>0&&Ge.set("/word/endnotes.xml",D);let se=[];for(let x of Ge.values())for(let H of x)H.targetMode==="External"&&se.push({ownerPart:H.ownerPart,id:H.id,type:H.type,rawTarget:H.rawTarget,sinkSafe:chunkZOZI27AW_cjs.F(H.rawTarget).ok});let me=new Map;me.set("rels",Gr),me.set("xml","application/xml");for(let[x,H]of pe)me.set(x,H);let We={defaults:me,overrides:new Map(yt)},Dt=new Map;for(let[x,H]of Oe)Dt.set(x.startsWith("/")?x:`/${x}`,H);return {ok:true,bytes:chunkZOZI27AW_cjs.Zd(Oe),package:Object.freeze({parts:tr,partBytes:Dt,relationships:Ge,externalTargets:se,contentTypes:We,mainDocumentPart:"/word/document.xml"}),lastMarkCovered:e.lastMarkCovered,blockCount:f.length,mediaBytes:k}}function ae(t){return t.kind!=="textValue"}function X(t,e){return t.kind!=="textValue"&&t.localName===e&&t.namespaceUri===chunkZOZI27AW_cjs.pa}function Ce(t,e){for(let n of t)e(n),n.kind!=="textValue"&&Ce(n.children,e);}function Ze(t){if(t.kind==="textValue")return `T(${t.value})`;if(t.namespaceUri===chunkZOZI27AW_cjs.pa&&t.localName.startsWith("rsid"))return "";let e=t.attributes.filter(r=>!r.localName.startsWith("rsid")&&!(r.namespaceUri===chunkZOZI27AW_cjs.ua&&(r.localName==="paraId"||r.localName==="textId"))).map(r=>`${r.namespaceUri}|${r.localName}=${r.value}`).sort().join(","),n=t.children.map(Ze).join("");return `E(${t.namespaceUri}:${t.localName}[${e}]{${n}})`}function qt(t){return `S[${t.attributes.filter(n=>n.localName!=="styleId").map(n=>`${n.localName}=${n.value}`).sort().join(",")}]${t.children.map(Ze).join("")}`}function Gn(t){let e=[],n=new Map,r=new Set,o=null;if(t&&ae(t.root))for(let i of t.root.children){if(!ae(i))continue;if(X(i,"docDefaults")){o=i;continue}if(!X(i,"style"))continue;e.push(i);let a=chunkZOZI27AW_cjs.eg(i,"styleId");a&&n.set(a,i);let s=i.children.find(c=>X(c,"name")),l=s?chunkZOZI27AW_cjs.eg(s,"val"):void 0;l&&r.add(l);}return {part:t,styles:e,docDefaults:o,byId:n,names:r}}function Vn(t,e,n){let r=new Map;if(!t)return r;let o=t.children.find(a=>X(a,e));if(!o||!ae(o))return r;let i=o.children.find(a=>X(a,n));if(!i||!ae(i))return r;for(let a of i.children)a.kind!=="textValue"&&r.set(a.localName,a);return r}function ms(t){let e=t.part?.root;return e&&ae(e)?e:null}function ds(t){return zr(ms(t),t.docDefaults)}function zn(t){return new Map(t.map(e=>[e.localName,chunkZOZI27AW_cjs.aj(e,`fragment#application-${e.localName}`)]))}function Kc(t,e){let n=new Set,r=e;for(let o=0;o<16&&r;o+=1){let i=t.byId.get(r);if(!i)break;let s=Yt(i,"pPr")?.children.find(c=>X(c,"spacing"));if(s&&ae(s))for(let c of s.attributes)n.add(c.localName);let l=i.children.find(c=>X(c,"basedOn"));r=l?chunkZOZI27AW_cjs.eg(l,"val"):void 0;}return n}function ro(t,e,n,r){let o=e;for(let i=0;i<16&&o;i+=1){let a=t.byId.get(o);if(!a)return false;let s=a.children.find(c=>X(c,n));if(s&&ae(s)&&s.children.some(c=>c.kind!=="textValue"&&c.localName===r))return true;let l=a.children.find(c=>X(c,"basedOn"));o=l?chunkZOZI27AW_cjs.eg(l,"val"):void 0;}return false}function Xc(t,e){for(let n of t.styles){if(chunkZOZI27AW_cjs.eg(n,"type")!==e)continue;let r=chunkZOZI27AW_cjs.eg(n,"default");if(r==="1"||r==="true")return chunkZOZI27AW_cjs.eg(n,"styleId")}}function Yt(t,e){let n=t.children.find(r=>X(r,e));return n&&ae(n)?n:null}var Yc=new Map(["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"].map((t,e)=>[t,e])),qc=new Map(["rStyle","rFonts","b","bCs","i","iCs","caps","smallCaps","strike","dstrike","outline","shadow","emboss","imprint","noProof","snapToGrid","vanish","webHidden","color","spacing","w","kern","position","sz","szCs","highlight","u","effect","bdr","shd","fitText","vertAlign","rtl","cs","em","lang","eastAsianLayout","specVanish","oMath","rPrChange"].map((t,e)=>[t,e]));function oo(t,e,n){let r=ms(e)?ds(e):null,o=ds(n),i=r?.run?zn(Ln):Vn(e.docDefaults,"rPrDefault","rPr"),a=o.run?zn(Ln):Vn(n.docDefaults,"rPrDefault","rPr"),s=r?.paragraph?zn(Hn):Vn(e.docDefaults,"pPrDefault","pPr"),l=o.paragraph?zn(Hn):Vn(n.docDefaults,"pPrDefault","pPr"),c=(p,P,M)=>{let F=Xc(p,"paragraph"),$=F?p.byId.get(F):void 0;if(!$)return F;for(let[w,L]of [["rPr",P],["pPr",M]]){let q=Yt($,w);if(q)for(let U of q.children)U.kind!=="textValue"&&L.set(U.localName,U);}return F};c(e,i,s),c(n,a,l);let d=new Map;for(let[p,P]of i){let M=a.get(p);(!M||Ze(M)!==Ze(P))&&d.set(p,P);}let u=new Map;for(let[p,P]of s){if(p==="sectPr")continue;let M=l.get(p);(!M||Ze(M)!==Ze(P))&&u.set(p,P);}if(d.size===0&&u.size===0)return t;let m=0,f=()=>`fragment#materialized-${m++}`,h=p=>{let P=M=>M.kind==="textValue"?{id:f(),kind:"textValue",value:M.value}:{...M,id:f(),children:M.children.map(P)};return P(p)},b=(p,P,M)=>{if(M.length===0)return p;let F=Yt(p,P);if(F){let w=P==="rPr"?qc:Yc,L=[...F.children];for(let U of M){let J=U.kind==="textValue"?Number.MAX_SAFE_INTEGER:w.get(U.localName)??Number.MAX_SAFE_INTEGER,ee=L.length;for(let B=0;B<L.length;B+=1){let re=L[B];if(re.kind==="textValue")continue;let ue=w.get(re.localName);if(ue!==void 0&&ue>J){ee=B;break}}L.splice(ee,0,U);}let q={...F,children:L};return {...p,children:p.children.map(U=>U===F?q:U)}}let $={id:f(),kind:P==="rPr"?"runProperties":"paragraphProperties",namespaceUri:chunkZOZI27AW_cjs.pa,localName:P,prefix:"w",namespaceBindings:[],attributes:[],children:M};return {...p,children:[$,...p.children]}},R=(p,P,M,F,$)=>{let w=Kc(e,$),L=P.children.find(B=>X(B,"spacing"));if(L&&ae(L))for(let B of L.attributes)w.add(B.localName);let q=new Map(F&&ae(F)?F.attributes.map(B=>[B.localName,B.value]):[]),U=M.attributes.filter(B=>!w.has(B.localName)&&q.get(B.localName)!==B.value);if(U.length===0)return p;let J=L&&ae(L)?{...L,attributes:[...L.attributes,...U]}:{...M,id:f(),attributes:U,children:[]},ee=L?{...P,children:P.children.map(B=>B===L?J:B)}:b(p,"pPr",[J]).children.find(B=>X(B,"pPr"));return {...p,children:p.children.map(B=>B===P?ee:B)}},O=p=>{let P=Yt(p,"pPr"),M=P?.children.find(U=>X(U,"pStyle")),F=M?chunkZOZI27AW_cjs.eg(M,"val"):void 0,$=[],w=p;for(let[U,J]of u){let ee=P?.children.some(re=>re.kind!=="textValue"&&re.localName===U),B=!!F&&ro(e,F,"pPr",U);U==="spacing"&&(ee||B)&&P!==null&&ae(J)&&(w=R(w,P,J,l.get("spacing"),F)),!(ee||B)&&$.push(h(J));}let L=U=>{if(U.kind==="textValue")return U;if(U.kind==="run"){let ee=Yt(U,"rPr"),B=ee?.children.find(le=>X(le,"rStyle")),re=B?chunkZOZI27AW_cjs.eg(B,"val"):void 0,ue=[];for(let[le,A]of d)ee?.children.some(V=>V.kind!=="textValue"&&V.localName===le)||re&&ro(e,re,"rPr",le)||F&&ro(e,F,"rPr",le)||ue.push(h(A));return b(U,"rPr",ue)}if(U.kind==="paragraphProperties"||U.kind==="runProperties")return U;let J=U.children.map(L);return J.some((ee,B)=>ee!==U.children[B])?{...U,children:J}:U};return L(b(w,"pPr",$))},g=p=>{if(p.kind==="textValue")return p;if(p.kind==="paragraph")return O(p);let P=p.children.map(g);return P.some((M,F)=>M!==p.children[F])?{...p,children:P}:p};return t.map(g)}var us="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function he(t,e,n,r){return {...t,attributes:t.attributes.map(o=>o.localName===n&&o.namespaceUri===e?{...o,value:r}:o)}}var Jc=new Set(["pStyle","rStyle","tblStyle","basedOn","link","next","styleLink","numStyleLink"]),ao=chunkZOZI27AW_cjs.Dh,je=new Map;function It(t,e){let n=e.styleIds??je,r=e.numIds??je,o=e.relIds??je,i=e.footnoteIds??je,a=e.endnoteIds??je,s=e.bookmarkIds??je,l=e.sdtIds??je,c=e.revisionIds??je,d=e.docPrIds??je,u=(m,f)=>{if(m.kind==="textValue")return m;let h=m;if(m.namespaceUri===chunkZOZI27AW_cjs.pa&&Jc.has(m.localName)){let g=chunkZOZI27AW_cjs.eg(m,"val"),p=g!==void 0?n.get(g):void 0;p!==void 0&&(h=he(h,chunkZOZI27AW_cjs.pa,"val",p));}if(X(m,"numId")){let g=chunkZOZI27AW_cjs.eg(m,"val"),p=g!==void 0?r.get(g):void 0;p!==void 0&&(h=he(h,chunkZOZI27AW_cjs.pa,"val",p));}if(m.kind==="noteReference"){let g=m.localName==="footnoteReference"?i:a,p=chunkZOZI27AW_cjs.eg(m,"id"),P=p!==void 0?g.get(Ie(p)):void 0;P!==void 0&&(h=he(h,chunkZOZI27AW_cjs.pa,"id",P));}if(m.kind==="bookmarkStart"||m.kind==="bookmarkEnd"){let g=chunkZOZI27AW_cjs.eg(m,"id"),p=g!==void 0?s.get(g):void 0;p!==void 0&&(h=he(h,chunkZOZI27AW_cjs.pa,"id",p));}if(X(m,"id")&&f==="sdtPr"){let g=chunkZOZI27AW_cjs.eg(m,"val"),p=g!==void 0?l.get(g):void 0;p!==void 0&&(h=he(h,chunkZOZI27AW_cjs.pa,"val",p));}if(ao(m)){let g=chunkZOZI27AW_cjs.eg(m,"id"),p=g!==void 0?c.get(g):void 0;p!==void 0&&(h=he(h,chunkZOZI27AW_cjs.pa,"id",p));}if(m.kind==="drawingDocPr"){let g=m.attributes.find(P=>P.localName==="id"&&P.namespaceUri==="")?.value,p=g!==void 0?d.get(g):void 0;p!==void 0&&(h=he(h,"","id",p));}for(let g of h.attributes){if(g.namespaceUri!==us)continue;let p=o.get(g.value);p!==void 0&&p!==g.value&&(h=he(h,us,g.localName,p));}let b=m.localName,R=h.children.map(g=>u(g,b));return h!==m||R.some((g,p)=>g!==h.children[p])?{...h,children:R}:m};return u(t,"")}function ps(t,e,n){let r=t,o=n.get(t)??2;for(;e.has(r);)r=`${t}${o}`,o+=1;return n.set(t,o),r}function fs(t,e,n){let r=`${t} (pasted)`,o=n.get(t)??2;for(;e.has(r);)r=`${t} (pasted ${o})`,o+=1;return n.set(t,o),r}var Qc=1e5;function gs(t){let e=chunkZOZI27AW_cjs.Mb(),n=Zc(t,e),r=ed(t,e),o=td(t,e);return !n||!r||!o?null:{bookmarkIds:n,revisionIds:r,docPrIds:o}}function io(t,e,n,r){if(t)return chunkZOZI27AW_cjs.Pb(e,t,r);let o=n;return ()=>String(o++)}function hs(t,e){if(t.add(e),!/^\d{1,10}$/.test(e))return;let n=Number(e);n<=chunkZOZI27AW_cjs.Jb&&t.add(String(n));}function ys(t,e){if(e===void 0)return t;let n=Number(e);return Number.isInteger(n)&&n>t?n:t}function Zc(t,e){let n=new Map;if(t.fragmentBookmarkIds.length===0)return n;let r=0,o=new Set;for(let a of [t.ownerPart,...t.notesParts])Ce([a.root],s=>{if(s.kind!=="bookmarkStart"&&s.kind!=="bookmarkEnd")return;let l=chunkZOZI27AW_cjs.eg(s,"id");l!==void 0&&(hs(o,l),s.kind==="bookmarkStart"&&(r=ys(r,l)));});let i=io(e,o,r+1,chunkZOZI27AW_cjs.Jb);for(let a of t.fragmentBookmarkIds){if(n.has(a))continue;let s=i();if(s===null)return null;n.set(a,s);}return n}function ed(t,e){let n=new Map;if(!t.hasRevision)return n;let r=0,o=new Set;for(let s of [t.ownerPart,...t.notesParts]){let l=s===t.ownerPart;Ce([s.root],c=>{if(!chunkZOZI27AW_cjs.Dh(c))return;let d=chunkZOZI27AW_cjs.eg(c,"id");d!==void 0&&hs(o,d),l&&(r=ys(r,d));});}let i=io(e,o,r+1,chunkZOZI27AW_cjs.Jb),a=false;return Ce(t.travelling,s=>{if(a||!chunkZOZI27AW_cjs.Dh(s))return;let l=chunkZOZI27AW_cjs.eg(s,"id");if(l===void 0||n.has(l))return;let c=i();c===null?a=true:n.set(l,c);}),a?null:n}function td(t,e){let n=new Map;if(!t.hasDocPr)return n;let{used:r}=chunkZOZI27AW_cjs.ve(t.pkg),o=Qc;if(!e){let s=chunkZOZI27AW_cjs.we(t.pkg);s.ok&&(o=s.id);}let i=io(e,r,o,chunkZOZI27AW_cjs.ue),a=false;return Ce(t.travelling,s=>{if(a||s.kind==="textValue"||s.kind!=="drawingDocPr")return;let l=s.attributes.find(d=>d.localName==="id"&&d.namespaceUri==="")?.value;if(l===void 0||n.has(l))return;let c=i();c===null?a=true:n.set(l,c);}),a?null:n}function xs(t,e){return `${e?qt(e):"none"}::${t.children.filter(n=>X(n,"lvlOverride")).map(Ze).join("")}`}function ks(t){let e=t.children.find(n=>X(n,"abstractNumId"));return e?chunkZOZI27AW_cjs.eg(e,"val"):void 0}function Ps(t,e,n){let r=new Set(["0"]),o=0;for(let s of t?.root.children??[]){if(!ae(s)||!X(s,e))continue;let l=chunkZOZI27AW_cjs.eg(s,n);if(l===void 0)continue;let c=Number(l);Number.isInteger(c)&&(r.add(String(c)),c>o&&(o=c));}let i=chunkZOZI27AW_cjs.Mb();if(i)return chunkZOZI27AW_cjs.Pb(r,i,chunkZOZI27AW_cjs.Kb);let a=o+1;return ()=>String(a++)}function Os(t,e){let n={numIdMap:new Map,numsToImport:[],abstractsToImport:[]};if(!t||!ae(t.root))return n;let r=new Map,o=[];for(let c of t.root.children)if(ae(c))if(X(c,"abstractNum")){let d=chunkZOZI27AW_cjs.eg(c,"abstractNumId");d&&r.set(d,c);}else X(c,"num")&&o.push(c);let i=new Map;if(e&&ae(e.root)){let c=new Map;for(let d of e.root.children){if(!ae(d)||!X(d,"abstractNum"))continue;let u=chunkZOZI27AW_cjs.eg(d,"abstractNumId");u&&c.set(u,d);}for(let d of e.root.children){if(!ae(d)||!X(d,"num"))continue;let u=chunkZOZI27AW_cjs.eg(d,"numId");if(!u)continue;let m=ks(d),f=m?c.get(m):void 0;i.set(xs(d,f),u);}}let a=Ps(e,"abstractNum","abstractNumId"),s=Ps(e,"num","numId"),l=new Map;for(let c of o){let d=chunkZOZI27AW_cjs.eg(c,"numId");if(!d)continue;let u=ks(c),m=u?r.get(u):void 0,f=xs(c,m),h=i.get(f);if(h!==void 0){n.numIdMap.set(d,h);continue}let b=u?l.get(u):void 0;if(b===void 0&&m&&u){let g=a();if(g===null)return null;b=g,l.set(u,b),n.abstractsToImport.push(he(m,chunkZOZI27AW_cjs.pa,"abstractNumId",b));}let R=s();if(R===null)return null;n.numIdMap.set(d,R);let O=he(c,chunkZOZI27AW_cjs.pa,"numId",R);if(b!==void 0){let g=O.children.map(p=>X(p,"abstractNumId")?he(p,chunkZOZI27AW_cjs.pa,"val",b):p);O={...O,children:g};}n.numsToImport.push(O),i.set(f,R);}return n}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/relationships",nd=`${Nt}/hyperlink`,bs=`${Nt}/image`,Wn=`${Nt}/numbering`,so=`${Nt}/styles`,Ss="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Rs="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function Jt(t,e,n,r){for(let o of chunkZOZI27AW_cjs.Pe(t,e)){if(o.type!==n||o.targetMode==="External")continue;let i=chunkZOZI27AW_cjs.E(o.ownerPart,o.rawTarget);if(i.ok){let a=t.parts.get(i.partName);if(a)return a}}return t.parts.get(r)??null}function rd(t,e){let n=0;return Ce([t],r=>{let o=e(r);if(o===void 0)return;let i=Number(o);Number.isInteger(i)&&i>n&&(n=i);}),n}function Kn(t,e,n,r){if(n.length===0)return t;let o=chunkZOZI27AW_cjs.Va(e,"paste"),i=n.map(c=>chunkZOZI27AW_cjs.jg(c,o)),a=chunkZOZI27AW_cjs.Sk(e,i),s=r??a.root.children.length,l=chunkZOZI27AW_cjs.ab(a,a.root.id,s,i,{deferValidation:true});return l.ok?chunkZOZI27AW_cjs.Ne(t,l.part):null}function Is(t,e){if(e.size===0)return [...t];let n=o=>{if(o.kind==="textValue")return o;if(o.kind==="drawing"||X(o,"pict")||X(o,"object")){let a=false;return Ce([o],s=>{if(s.kind!=="textValue")for(let l of s.attributes)l.namespaceUri===Nt&&e.has(l.value)&&(a=true);}),a?null:o}if(o.kind==="hyperlink"){let a=o.attributes.find(s=>s.namespaceUri===Nt)?.value;if(a!==void 0&&e.has(a))return r(o.children)}let i=r(o.children);return i.length===o.children.length&&i.every((a,s)=>a===o.children[s])?o:{...o,children:i}};function r(o){let i=[];for(let a of o){let s=n(a);s!==null&&(Array.isArray(s)?i.push(...s):i.push(s));}return i}return r(t)}var od=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),Ns={"image/jpg":"image/jpeg","image/x-ms-bmp":"image/bmp","image/x-bmp":"image/bmp"};function ad(t,e){let n=chunkZOZI27AW_cjs.ke(t);if(n==="unknown")return null;let r=chunkZOZI27AW_cjs.H(e);return (Object.hasOwn(Ns,r)?Ns[r]:r)!==n||od.has(n)&&!chunkZOZI27AW_cjs.xe(t,n)?null:n}function lo(t,e,n){for(let y of e.parts.values())if(Gt([y.root]))return {ok:false,reason:"unsupported-content"};let r=e.parts.get(e.mainDocumentPart);if(!r)return {ok:false,reason:"no-fragment-document"};if(!t.parts.has(n))return {ok:false,reason:"no-target-part"};let o=r.root.kind==="document"?r.root.children.find(y=>y.kind==="body"):null;if(!o||!ae(o))return {ok:false,reason:"no-fragment-document"};let i=chunkZOZI27AW_cjs.hl(o.children.filter(y=>y.kind==="paragraph"||y.kind==="table"||y.kind==="contentControl"));if(i.length===0)return {ok:false,reason:"no-fragment-document"};let a=t,s=Os(Jt(e,e.mainDocumentPart,Wn,"/word/numbering.xml"),Jt(a,a.mainDocumentPart,Wn,"/word/numbering.xml"));if(!s)return {ok:false,reason:"merge-refused"};let{numIdMap:l,numsToImport:c,abstractsToImport:d}=s,u=Gn(Jt(e,e.mainDocumentPart,so,"/word/styles.xml")),m=Jt(a,a.mainDocumentPart,so,"/word/styles.xml"),f=Gn(m),h=new Map,b=[],R=new Set(f.byId.keys()),O=new Set(f.names),g=new Map,p=new Map,P=new Map,M=(y,v)=>{let T=P.get(y);return T===void 0&&(T=qt(v),P.set(y,T)),T},F=y=>({...y,attributes:y.attributes.filter(v=>!(v.localName==="default"&&v.namespaceUri===chunkZOZI27AW_cjs.pa))});for(let y of u.styles){let v=chunkZOZI27AW_cjs.eg(y,"styleId");if(!v)continue;let T=f.byId.get(v),D=qt(It(y,{styleIds:h,numIds:l}));if(T&&M(v,T)===D){h.set(v,v);continue}if(!T){h.set(v,v),R.add(v),b.push(F(y));continue}let z=ps(`${v}Pasted`,R,g);R.add(z),h.set(v,z),b.push(F(he(y,chunkZOZI27AW_cjs.pa,"styleId",z)));}let $=b.map(y=>{let v=y.children.find(K=>X(K,"name")),T=v?chunkZOZI27AW_cjs.eg(v,"val"):void 0;if(!T||!O.has(T))return T&&O.add(T),y;let D=fs(T,O,p);O.add(D);let z=y.children.map(K=>X(K,"name")?he(K,chunkZOZI27AW_cjs.pa,"val",D):K);return {...y,children:z}}),w=null,L=1,q=chunkZOZI27AW_cjs.Mb()===void 0?null:chunkZOZI27AW_cjs.Qb(Number.MAX_SAFE_INTEGER),U=()=>{if(w)return w;let y=new Map;for(let[v,T]of a.partBytes){let D=v.startsWith("/")?v:`/${v}`;if(!D.startsWith("/word/media/"))continue;y.set(chunkZOZI27AW_cjs.f(T),D);let z=/\/image(\d+)\./.exec(D);z&&(L=Math.max(L,Number(z[1])+1));}return w=y,y},J=new Map,ee=y=>{let v=J.get(y);if(!v){v=new Map;for(let T of chunkZOZI27AW_cjs.Pe(a,y)){if(T.targetMode==="External"||T.type!==bs)continue;let D=chunkZOZI27AW_cjs.E(T.ownerPart,T.rawTarget);D.ok&&v.set(D.partName,T.id);}J.set(y,v);}return v},B=(y,v)=>{let T=y.lastIndexOf("."),D=T===-1?"":y.slice(T+1);return /^[A-Za-z0-9]{1,8}$/.test(D)?D.toLowerCase():v==="image/jpeg"?"jpeg":v==="image/gif"?"gif":"png"},re=(y,v,T)=>{let D=new Map,z=new Set,K=ee(v),ie=[],Ne=new Set,pe=[],Me=[],rt=new Map,ze=[],Ge=e.relationships.get(y)??[];for(let se of Ge){if(!T.has(se.id))continue;if(se.targetMode==="External"){if(se.type===nd){let ot=chunkZOZI27AW_cjs.Ug(a,se.rawTarget,v);ot?(a=ot.pkg,D.set(se.id,ot.relationshipId)):z.add(se.id);}else z.add(se.id);continue}let me=chunkZOZI27AW_cjs.E(se.ownerPart,se.rawTarget);if(!me.ok){z.add(se.id);continue}let We=e.partBytes.get(me.partName)??e.partBytes.get(me.partName.replace(/^\//,"")),Dt=(chunkZOZI27AW_cjs.Qe(e,me.partName)??"").toLowerCase();if(!We||!Dt.startsWith("image/")){z.add(se.id);continue}let x=ad(We,Dt);if(x===null){z.add(se.id);continue}let H=x,j=U(),Y=chunkZOZI27AW_cjs.f(We),G=j.get(Y);if(!G){let ot=B(me.partName,H),Xo=on=>a.partBytes.has(on)||a.partBytes.has(on.slice(1))||a.parts.has(on)||Ne.has(on),xt;if(q)do xt=`/word/media/image${q.next().value}.${ot}`;while(Xo(xt));else {for(xt=`/word/media/image${L}.${ot}`;Xo(xt);)L+=1,xt=`/word/media/image${L}.${ot}`;L+=1;}G=xt,ie.push({partName:G,bytes:We,contentType:H}),Ne.add(G),j.set(Y,G);}let ne=G.startsWith("/word/")?G.slice(6):G,Ke=K.get(G);if(Ke!==void 0){D.set(se.id,Ke);continue}let Xe=rt.get(G);Xe===void 0&&(Xe=pe.length,rt.set(G,Xe),pe.push(ne),Me.push(G)),ze.push({recordId:se.id,index:Xe});}if(ie.length>0&&(a=chunkZOZI27AW_cjs.Be(a,ie)),pe.length>0){let se=chunkZOZI27AW_cjs.Te(chunkZOZI27AW_cjs.Ve(a,v),v,pe.map(me=>[bs,me]));if(se.ok){a=se.pkg,se.ids.forEach((me,We)=>{K.set(Me[We],me);});for(let me of ze)D.set(me.recordId,se.ids[me.index]);}else for(let me of ze)z.add(me.recordId);}return {relIdMap:D,dropRelIds:z}},ue=re(e.mainDocumentPart,n,qr(i));i=Is(i,ue.dropRelIds);let le=new Map,A=new Map,_=[],V=(y,v)=>ae(y)&&y.namespaceUri===chunkZOZI27AW_cjs.pa&&y.localName===v,te={},oe=$n(i,(y,v)=>{let T=te[y];if(T===void 0){T=new Map,te[y]=T;let D=chunkZOZI27AW_cjs.qh(e,y);if(D&&ae(D.root))for(let z of D.root.children){if(!V(z,y))continue;let K=chunkZOZI27AW_cjs.eg(z,"id");if(K===void 0)continue;let ie=Ie(K);T.has(ie)||T.set(ie,z);}}return T.get(v)??null});for(let y of ["footnote","endnote"]){let v=y==="footnote"?le:A,T=oe[y];if(T.size===0)continue;let D=chunkZOZI27AW_cjs.qh(e,y);if(!D||!ae(D.root))continue;let z=chunkZOZI27AW_cjs.ki(a,y);if(!z.ok||!z.package)return {ok:false,reason:"merge-refused"};a=z.package;let K=chunkZOZI27AW_cjs.qh(a,y);if(!K)return {ok:false,reason:"merge-refused"};let ie=rd(K.root,pe=>V(pe,y)?chunkZOZI27AW_cjs.eg(pe,"id"):void 0)+1,Ne=[];for(let pe of D.root.children){if(!V(pe,y))continue;let Me=chunkZOZI27AW_cjs.eg(pe,"id"),rt=chunkZOZI27AW_cjs.eg(pe,"type");if(rt==="separator"||rt==="continuationSeparator"||Me===void 0||!T.has(Ie(Me))||v.has(Ie(Me)))continue;let ze=String(ie++);v.set(Ie(Me),ze),Ne.push(he(pe,chunkZOZI27AW_cjs.pa,"id",ze));}Ne.length>0&&_.push({kind:y,fragmentPartName:D.name,bodies:chunkZOZI27AW_cjs.hl(Ne)});}let de=a.parts.get(n),S=[...i,..._.flatMap(y=>y.bodies)],k=[],E=new Set,N=false,W=false,Q=new Map;Ce(S,y=>{if(y.kind!=="textValue"){if(y.kind==="bookmarkStart"||y.kind==="bookmarkEnd"){let v=chunkZOZI27AW_cjs.eg(y,"id");if(v!==void 0&&k.push(v),y.kind==="bookmarkStart"){let T=chunkZOZI27AW_cjs.eg(y,"name");T&&E.add(T);}return}if(ao(y)){N=true;return}if(y.kind==="drawingDocPr"){W=true;return}if(y.kind==="contentControlProperties")for(let v of y.children){if(!X(v,"id"))continue;let T=chunkZOZI27AW_cjs.eg(v,"val");if(T!==void 0&&!Q.has(T)){let D=0,z=`${T}:${Q.size}`;for(let K=0;K<z.length;K+=1)D=D*31+z.charCodeAt(K)>>>0;Q.set(T,String(D%2147483647||1));}}}});let ce=gs({pkg:a,ownerPart:de,notesParts:_.map(y=>chunkZOZI27AW_cjs.qh(a,y.kind)).filter(y=>y!==null),travelling:S,fragmentBookmarkIds:k,hasRevision:N,hasDocPr:W});if(!ce)return {ok:false,reason:"merge-refused"};let Fe=ce.bookmarkIds,rn=ce.revisionIds,Oe=ce.docPrIds;if(E.size>0){let y=new Set;if(Ce([de.root],v=>{if(v.kind!=="textValue"&&v.kind==="bookmarkStart"){let T=chunkZOZI27AW_cjs.eg(v,"name"),D=chunkZOZI27AW_cjs.eg(v,"id");T&&D!==void 0&&E.has(T)&&y.add(D);}}),y.size>0){let v=D=>{if(D.kind==="textValue")return D;let z=[],K=false;for(let ie of D.children){if((ie.kind==="bookmarkStart"||ie.kind==="bookmarkEnd")&&y.has(chunkZOZI27AW_cjs.eg(ie,"id")??"")){K=true;continue}let Ne=v(ie);Ne!==ie&&(K=true),z.push(Ne);}return K?{...D,children:z}:D},T=v(de.root);T!==de.root&&(chunkZOZI27AW_cjs.Za(de.root,T),a=chunkZOZI27AW_cjs.Ne(a,{...de,root:T}));}}let yt=y=>Jr(y,le,A);for(let y of _){y.bodies=y.bodies.map(yt);let v=chunkZOZI27AW_cjs.qh(a,y.kind);if(!v)return {ok:false,reason:"merge-refused"};let T=re(y.fragmentPartName,v.name,qr(y.bodies)),D=Is(y.bodies,T.dropRelIds);D=[...oo(D,u,f)],D=D.map(K=>It(K,{styleIds:h,numIds:l,relIds:T.relIdMap,footnoteIds:le,endnoteIds:A,bookmarkIds:Fe,sdtIds:Q,revisionIds:rn,docPrIds:Oe}));let z=Kn(a,a.parts.get(v.name),D);if(!z)return {ok:false,reason:"merge-refused"};a=z;}if($.length>0){let y=$.map(T=>It(T,{styleIds:h,numIds:l}));if(!m){let T=chunkZOZI27AW_cjs.Ma(`<w:styles xmlns:w="${chunkZOZI27AW_cjs.pa}"></w:styles>`,{name:"/word/styles.xml",contentType:Rs});if(!T.ok)return {ok:false,reason:"merge-refused"};a=chunkZOZI27AW_cjs.Xe(a,"/word/styles.xml",T.part.root,Rs);let D=chunkZOZI27AW_cjs.We(chunkZOZI27AW_cjs.Ve(a,a.mainDocumentPart),a.mainDocumentPart,so,"styles.xml");if(!D.ok)return {ok:false,reason:"merge-refused"};a=D.pkg,m=a.parts.get("/word/styles.xml")??null;}if(!m)return {ok:false,reason:"merge-refused"};let v=Kn(a,a.parts.get(m.name),y);if(!v)return {ok:false,reason:"merge-refused"};a=v,f=Gn(a.parts.get(m.name)??null);}if(d.length>0||c.length>0){let y=Jt(a,a.mainDocumentPart,Wn,"/word/numbering.xml");if(!y){let K=chunkZOZI27AW_cjs.Ma(`<w:numbering xmlns:w="${chunkZOZI27AW_cjs.pa}"></w:numbering>`,{name:"/word/numbering.xml",contentType:Ss});if(!K.ok)return {ok:false,reason:"merge-refused"};a=chunkZOZI27AW_cjs.Xe(a,"/word/numbering.xml",K.part.root,Ss);let ie=chunkZOZI27AW_cjs.We(chunkZOZI27AW_cjs.Ve(a,a.mainDocumentPart),a.mainDocumentPart,Wn,"numbering.xml");if(!ie.ok)return {ok:false,reason:"merge-refused"};a=ie.pkg,y=a.parts.get("/word/numbering.xml")??null;}if(!y)return {ok:false,reason:"merge-refused"};let v=a.parts.get(y.name),T=v.root.children.findIndex(K=>X(K,"num")),D=d.map(K=>It(K,{styleIds:h,numIds:l})),z=Kn(a,v,D,T===-1?void 0:T);if(!z)return {ok:false,reason:"merge-refused"};if(a=z,z=Kn(a,a.parts.get(y.name),c),!z)return {ok:false,reason:"merge-refused"};a=z;}let nt=[...oo(i,u,f)].map(yt).map(y=>It(y,{styleIds:h,numIds:l,relIds:ue.relIdMap,footnoteIds:le,endnoteIds:A,bookmarkIds:Fe,sdtIds:Q,revisionIds:rn,docPrIds:Oe}));return {ok:true,pkg:a,blocks:nt}}var vs=16*1024*1024;function id(t){let e=t.parts.get(t.mainDocumentPart);if(!e||e.root.kind!=="document")return false;let n=e.root.children.find(i=>i.kind==="body");if(!n||n.kind!=="body"||n.children.length>chunkZOZI27AW_cjs.Pk)return false;let r=0,o=(i,a,s)=>{if(a>s||(r+=1,r>chunkZOZI27AW_cjs.Rk))return false;if(i.kind==="textValue")return true;for(let l of i.children)if(!o(l,a+1,s))return false;return true};for(let i of n.children)if(!o(i,1,chunkZOZI27AW_cjs.Qk))return false;for(let[i,a]of t.parts)if(i!==t.mainDocumentPart&&/\/(styles|numbering|footnotes|endnotes)\.xml$/.test(i)&&!o(a.root,1,chunkZOZI27AW_cjs.Qk*4))return false;return true}function co(t,e,n){if(n.fragmentBytes.byteLength>vs)return {ok:false,reason:"invalidArgs",detail:"fragment-too-large"};let r=chunkZOZI27AW_cjs.Je(n.fragmentBytes);if(!r.ok)return {ok:false,reason:"invalidArgs",detail:`fragment-read:${r.reason}`};let o=r.package;if(!id(o))return {ok:false,reason:"invalidArgs",detail:"fragment-over-budget"};let i=t.resolveStory(e);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let{store:a,story:s}=i;if(a.compositionActive||t.compositionSessionOpen())return {ok:false,reason:"invalidArgs",detail:"ime-composition-active"};let l=t.currentPackage(),c=a.checkpoint();a.graftPackage(()=>t.currentPackage());let d=0,u="";return chunkZOZI27AW_cjs.Ra(t,()=>{let m=a.transact(h=>{for(let g of n.priorOps??[])if(!h.apply(g))return;let b=null,R=h.applyPackage(g=>(b=lo(g,o,s.partName),b.ok?b.pkg:g)),O=b;if(!O||!O.ok){u=`fragment-merge:${O?O.reason:"no-merge"}`,h.apply({op:"insertText",paragraphId:"\0fragment-abort",offset:0,text:"x"});return}R&&(d=O.blocks.length,h.apply({op:"insertFragment",paragraphId:n.paragraphId,offset:n.offset,blocks:O.blocks,lastMarkCovered:n.lastMarkCovered}));},{story:s,...n.actorId?{actorId:n.actorId}:{}});return u.length>0?{ok:false,reason:"invalidArgs",detail:u}:m.ok?m.change?{ok:true,change:t.promoteStoryTransactionToPackageUnit(l,a,c),blockCount:d}:{ok:true,change:null,blockCount:d}:{ok:false,reason:m.reason,...m.detail?{detail:m.detail}:{}}},m=>chunkZOZI27AW_cjs.Sa(m))}function Es(){let t=null;return (e,n,r)=>{let o=t;if(t=null,!chunkZOZI27AW_cjs.uj(n)||!("paragraphId"in r)||!chunkZOZI27AW_cjs.wj(e,r.paragraphId))return r;if(r.op==="insertText"&&!r.revision&&r.inside===void 0&&o&&o.partName===e.name&&o.paragraphId===r.paragraphId&&o.offset===r.offset)return {...r,inside:o.controlId};if(r.op!=="deleteText"||r.revision||r.start>=r.end)return r;let i=chunkZOZI27AW_cjs.Xa(e,r.paragraphId);if(i?.kind!=="paragraph")return r;let a=chunkZOZI27AW_cjs.Dk(e,chunkZOZI27AW_cjs.Ck(r));if(a.unprotected.length)return r;let s=chunkZOZI27AW_cjs.rg(i);for(let l of a.touches){let c=s.spanOf(l.control);c&&c.start<=r.start&&c.end>=r.end&&(t={partName:e.name,paragraphId:r.paragraphId,offset:r.start,controlId:l.control.id});}return r}}function mo(t,e){for(let[n,r]of e.parts){let o=t.parts.get(n);!o||o.root===r.root||o.root.id!==r.root.id||chunkZOZI27AW_cjs._a(o.root,r.root);}return e}var Ts=new WeakSet;function sd(t){return Ts.add(t),t}function ws(t){return Ts.has(t)}function Qt(t){return {...t,applyPackage:e=>t.applyPackage(sd(e))}}var ld=new Set(["insertText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertComplexField","insertEquation","insertDrawing","deleteText","setParagraphMarkRevision"]),Cs=new Set(["insertDrawing"]);function cd(t){if(!(t===null||t.start!==t.end))return t}var vt={"text-local":0,"paragraph-local":1,"flow-structural":2,global:3};function dd(t){return Object.freeze({parts:new Map([[t.name,t]]),partBytes:new Map,relationships:new Map,externalTargets:[],contentTypes:{defaults:new Map,overrides:new Map([[t.name.toLowerCase(),t.contentType]])},mainDocumentPart:t.name})}var ft=class{current;storyPartName;rev=0;commitCounter=0;undoStack=[];redoStack=[];pushCount=0;subscribers=new Set;historyLimit;settingsPartOverride;contentLockPolicy;storyRef=null;composition=null;constructor(e,n,r={}){let o="root"in e,i=typeof n=="string"?n:void 0,a=typeof n=="object"&&n!==null?n:r;this.current=o?dd(e):e,this.storyPartName=i??(o?e.name:e.mainDocumentPart),this.historyLimit=a.historyLimit??200,this.settingsPartOverride=a.settingsPart,this.contentLockPolicy=chunkZOZI27AW_cjs.pj(a.contentLockPolicy);}setStoryRef(e){this.storyRef=e;}get part(){let e=this.current.parts.get(this.storyPartName);if(!e)throw new Error(`story part missing: ${this.storyPartName}`);return e}get package(){return this.current}get revision(){return this.rev}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get historyDepth(){return this.undoStack.length}get historyPushCount(){return this.pushCount}get compositionActive(){return this.composition!==null}graftPackage(e){this.current=e(this.current);}replacePart(e){let n=this.current.parts.get(e.name);e!==n&&(this.current=chunkZOZI27AW_cjs.Ne(this.current,e),this.rev+=1);}checkpoint(){return {pkg:this.current,revision:this.rev,undoStack:this.undoStack.slice(),redoStack:this.redoStack.slice(),composition:this.composition?{entry:{...this.composition.entry},committed:this.composition.committed}:null}}restoreCheckpoint(e){this.current=e.pkg,this.rev=e.revision,this.undoStack.length=0,this.undoStack.push(...e.undoStack),this.redoStack.length=0,this.redoStack.push(...e.redoStack),this.composition=e.composition?{entry:{...e.composition.entry},committed:e.composition.committed}:null;}restoreHistoryStacks(e){this.undoStack.length=0,this.undoStack.push(...e.undoStack),this.redoStack.length=0,this.redoStack.push(...e.redoStack);}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}transact(e,n={}){return chunkZOZI27AW_cjs.Lb(n.actorId,()=>chunkZOZI27AW_cjs.sf(n.fieldResults,()=>this.commitTransaction(e,n)))}commitTransaction(e,n){let r=n.origin??chunkZOZI27AW_cjs.g.mutationHuman,o=n.recordsHistory??(r!==chunkZOZI27AW_cjs.g.projection&&r!==chunkZOZI27AW_cjs.g.awareness),i=this.undoStack[this.undoStack.length-1];o&&!this.composition&&i?.group!==n.historyGroup&&this.closeHistoryGroup();let a=this.current,s=this.rev,l=this.current,c=null,d=0,u=new Set,m=new Set,f=new Set,h=new Set,b=new Set,R=[],O=n.minimumImpact??"text-local",g=null,p=false,P=null,M=null,F=new Map,$=new Map,w=A=>{let _=$.get(A.name);_||(_={mint:null,written:new Set},$.set(A.name,_));let V=_;return {mint:()=>(V.mint??=chunkZOZI27AW_cjs.Ch(A))(),wrote:te=>{V.written.add(te);},wroteUnder:te=>V.written.has(te)}},L=()=>{for(let A of $.values())A.mint=null;},q=(A,_)=>{let V=chunkZOZI27AW_cjs.dk.get(A.op);if(V===void 0)return F.clear(),null;let te=`${_.name}\0${V}`,oe=F.get(te);oe||(oe={id:null},F.set(te,oe));let de=oe;return ()=>de.id??=w(_).mint()},U=(A,_)=>{let V=ld.has(A.op);return !V&&chunkZOZI27AW_cjs.dk.get(A.op)!==void 0?null:((!V||Cs.has(A.op))&&L(),V?w(_):null)},J=Es(),ee=null,B=(A,_)=>{if(c)return false;let V=l.parts.get(A);if(!V)return c={reason:"unknown-part",detail:A},false;_=J(V,this.settingsPartOverride?.()??chunkZOZI27AW_cjs.fh(l),_);let te=chunkZOZI27AW_cjs.tj(this.settingsPartOverride?.()??chunkZOZI27AW_cjs.fh(l),_)??chunkZOZI27AW_cjs.Ek(V,this.settingsPartOverride?.()??chunkZOZI27AW_cjs.fh(l),_,ee?.partName===A&&"paragraphId"in _&&ee.paragraphId===_.paragraphId?ee.fieldNodeId:void 0);if(te)return c={reason:te},false;let oe=q(_,V),de=U(_,V),S=this.settingsPartOverride?.()??chunkZOZI27AW_cjs.fh(l),k=chunkZOZI27AW_cjs.uj(S)&&"paragraphId"in _&&chunkZOZI27AW_cjs.wj(V,_.paragraphId)?chunkZOZI27AW_cjs.yj(V,_,ee?.partName===A&&ee.paragraphId===_.paragraphId?ee.fieldNodeId:void 0):null;ee=k&&"paragraphId"in _?{partName:A,paragraphId:_.paragraphId,fieldNodeId:k.fieldNodeId}:null;let E={deferValidation:true,...this.contentLockPolicy?{contentLockPolicy:this.contentLockPolicy}:{},...oe?{revisionIds:oe}:{},...de?{trackedRevisionIds:de}:{}},N=k?chunkZOZI27AW_cjs.Ml(V,_,k,E):chunkZOZI27AW_cjs.Rl(V,_,E);if(!N.ok)return c={reason:N.reason,...N.detail?{detail:N.detail}:{}},false;if(Cs.has(_.op)&&L(),l=chunkZOZI27AW_cjs.Ne(l,N.part),N.part===V&&N.effect.dirty.length===0&&N.effect.created.length===0&&N.effect.deleted.length===0&&N.effect.split===void 0&&(N.effect.splits===void 0||N.effect.splits.length===0)&&N.effect.join===void 0&&N.effect.caret===void 0)return true;u.add(A),d+=1;for(let Q of N.effect.dirty)m.add(Q);for(let Q of N.effect.created)f.add(Q);for(let Q of N.effect.deleted)h.add(Q);for(let Q of N.effect.dependencyKeys)b.add(Q);N.effect.split&&R.push({split:N.effect.split});for(let Q of N.effect.splits??[])R.push({split:Q});return N.effect.join&&R.push({join:N.effect.join}),vt[N.effect.impact]>vt[O]&&(O=N.effect.impact),N.effect.caret&&(M={paragraphId:N.effect.caret.paragraphId,start:0,end:0}),true};if(e({apply:A=>B(this.storyPartName,A),applyTo:(A,_)=>B(A,_),applyPackage:A=>{if(c)return false;let _=this.settingsPartOverride?.()??chunkZOZI27AW_cjs.fh(l),V=ws(A)?chunkZOZI27AW_cjs.sj(_,{op:"comment"}):chunkZOZI27AW_cjs.tj(_);if(V)return c={reason:V},false;F.clear(),L();let te;try{te=A(l);}catch(oe){if(!chunkZOZI27AW_cjs.kj(oe))throw oe;return c={reason:oe.reason,detail:oe.message},false}if(te===l)return true;for(let[oe,de]of te.parts)l.parts.get(oe)!==de&&u.add(oe);return l=te,d+=1,vt["flow-structural"]>vt[O]&&(O="flow-structural"),true},selectionBefore:A=>{g=A;},selectionAfter:A=>{p=true,P=A;}}),c){let A=c;return {ok:false,reason:A.reason,...A.detail?{detail:A.detail}:{}}}if(d===0)return {ok:true,change:null};let re=p?P:M,ue=p?cd(P):M??void 0;for(let A of u){let _=a.parts.get(A),V=l.parts.get(A);if(V===void 0)continue;let te=_?chunkZOZI27AW_cjs.Ka(_,V):chunkZOZI27AW_cjs.Ka(V,V);if(!te.ok)return {ok:false,reason:"tree-invariant",detail:JSON.stringify(te.issues)}}let le=chunkZOZI27AW_cjs.Ye(l);if(!le.ok)return {ok:false,reason:"package-invariant",detail:JSON.stringify(le.issues)};if(o)if(this.composition)chunkZOZI27AW_cjs.Ul(n.historyGroup,"split","composition"),this.composition.committed=true,this.composition={...this.composition,entry:{...this.composition.entry,selectionAfter:re}};else {let A=n.historyGroup,_=this.undoStack[this.undoStack.length-1];A!==void 0&&_!==void 0&&_.group===A?this.undoStack[this.undoStack.length-1]={..._,selectionAfter:re??_.selectionAfter}:this.pushUndo({pkg:a,revision:s,selectionBefore:g,selectionAfter:re,group:A}),chunkZOZI27AW_cjs.Ul(A,_?.group===A?"extended":"started"),this.redoStack.length=0;}return this.current=l,this.rev+=1,n.story&&(this.storyRef=n.story),n.minimumImpact&&vt[n.minimumImpact]>vt[O]&&(O=n.minimumImpact),{ok:true,change:this.publish(r,s,{dirty:m,created:f,deleted:h,dependencyKeys:b,splitJoin:R,impact:O,caret:ue},n.story??this.storyRef??void 0,n.actorId,n.operationId)}}beginComposition(e=null){this.composition||(this.composition={entry:{pkg:this.current,revision:this.rev,selectionBefore:e,selectionAfter:null},committed:false});}endComposition(){let e=this.composition;this.composition=null,!(!e||!e.committed)&&(this.pushUndo(e.entry),this.redoStack.length=0);}cancelComposition(){this.composition=null;}closeHistoryGroup(){let e=this.undoStack[this.undoStack.length-1];e===void 0||e.group===void 0||(this.undoStack[this.undoStack.length-1]={...e,group:void 0});}undo(){let e=this.undoStack.pop();if(!e)return null;this.closeHistoryGroup();let n=this.rev;return this.redoStack.push({pkg:this.current,revision:this.rev,selectionBefore:e.selectionBefore,selectionAfter:e.selectionAfter}),this.current=mo(this.current,e.pkg),this.rev+=1,this.publish(chunkZOZI27AW_cjs.g.mutationUndo,n,null,this.storyRef??void 0)}redo(){let e=this.redoStack.pop();if(!e)return null;this.closeHistoryGroup();let n=this.rev;return this.undoStack.push({pkg:this.current,revision:this.rev,selectionBefore:e.selectionBefore,selectionAfter:e.selectionAfter}),this.current=mo(this.current,e.pkg),this.rev+=1,this.publish(chunkZOZI27AW_cjs.g.mutationRedo,n,null,this.storyRef??void 0)}selectionForUndo(){return this.undoStack[this.undoStack.length-1]?.selectionBefore??null}selectionForRedo(){return this.redoStack[this.redoStack.length-1]?.selectionAfter??null}discardNewestUndoEntry(){let e=this.undoStack.pop();return e?{selectionBefore:e.selectionBefore,selectionAfter:e.selectionAfter}:null}pushUndo(e){this.pushCount+=1,this.undoStack.push(e),this.undoStack.length>this.historyLimit&&this.undoStack.shift();}publish(e,n,r,o,i,a){this.commitCounter+=1;let s={change:"model-change",fromRevision:n,toRevision:this.rev,commitId:`commit-${this.commitCounter}`,origin:e,...i?{actorId:i}:{},...a?{operationId:a}:{},dirty:r?[...r.dirty]:[],created:r?[...r.created]:[],deleted:r?[...r.deleted]:[],splitJoin:r?r.splitJoin:[],dependencyKeys:r?[...r.dependencyKeys]:[],impact:r?r.impact:o?.kind==="headerFooter"?"global":"flow-structural",...r?.caret?{caret:r.caret}:{},...o?{story:o}:{}};return chunkZOZI27AW_cjs.sf("atomic",()=>{for(let l of this.subscribers)l(s);}),s}};function uo(t,e,n,r){if(!t)return null;if(t.kind==="package")return (r==="undo"?t.selectionBefore:t.selectionAfter)??null;let o=t.partName===e.part.name?e:n.get(t.partName);return (r==="undo"?o?.selectionForUndo():o?.selectionForRedo())??null}function Ms(t){let e=null,n;return {context:{selectionBefore(r){e=r,t.selectionBefore(r);},selectionAfter(r){n=r,t.selectionAfter(r);}},snapshot(r){return {selectionBefore:e,selectionAfter:n===void 0?r??null:n}}}}function po(t,e){return [...t.values()].map(n=>n.part).filter(n=>e.parts.has(n.name))}function As(t,e){return po(t,e).map(n=>n.name).sort().join(",")}function Ds(t,e,n){if(t.relationships!==e.relationships||t.contentTypes!==e.contentTypes||t.partBytes!==e.partBytes||t.externalTargets!==e.externalTargets||t.mainDocumentPart!==e.mainDocumentPart)return true;if(t.parts===e.parts)return false;if(t.parts.size!==e.parts.size)return true;for(let[r,o]of e.parts)if(r!==n&&t.parts.get(r)!==o)return true;return false}var _s="/word/numbering.xml";function Et(t,e){return t===void 0?void 0:{group:t,before:e}}function fo(t){return t.kind==="package"&&t.before.parts.get(_s)!==t.after.parts.get(_s)?{...t,restoreNumbering:true}:t}var Xn=class{open=null;close(){this.open=null;}admit(e,n,r,o,i){let a=this.open;if(n===void 0)return this.open=null,fo(e);if(a===null||a.group!==n.group||r.at(-1)!==a.pointer){let m=fo(e);return this.open={group:n.group,before:n.before,pointer:m},chunkZOZI27AW_cjs.Ul(n.group,"started"),m}r.pop();let s=e.kind==="story"?o(e.partName):null,l=a.pointer.kind==="story"?o(a.pointer.partName):null,c=a.pointer.kind==="package"?a.pointer.selectionAfter??null:null,d={kind:"package",before:a.before,after:i(),selectionBefore:a.pointer.kind==="package"?a.pointer.selectionBefore??null:l?.selectionBefore??null,selectionAfter:(e.kind==="package"?e.selectionAfter:s?.selectionAfter)??c},u=fo(d);return this.open={...a,pointer:u},chunkZOZI27AW_cjs.Ul(n.group,"extended"),u}};var qn="http://schemas.openxmlformats.org/wordprocessingml/2006/main",md="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function Tt(t,e){for(let n of t.children)if(n.kind!=="textValue"&&n.namespaceUri===qn&&n.localName===e)return n;return null}function Yn(t,e){return t.attributes.find(n=>n.namespaceUri===qn&&n.localName===e)?.value}function ud(t){let e=Yn(t,"val");return e===void 0||e==="1"||e==="true"||e==="on"}function Ls(t,e){return t.kind==="textValue"?Object.freeze({...t,id:e()}):Object.freeze({...t,id:e(),children:t.children.map(n=>Ls(n,e))})}function pd(t){let e=chunkZOZI27AW_cjs.Ma(`<w:styles xmlns:w="${qn}"><w:style w:type="paragraph" w:styleId="ListParagraph"><w:pPr><w:contextualSpacing/></w:pPr></w:style></w:styles>`,{name:t.name,contentType:md});if(!e.ok)return null;let n=Tt(e.part.root,"style"),r=n?Tt(n,"pPr"):null;return r?Ls(r,chunkZOZI27AW_cjs.Va(t)):null}var Fs=["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"];function fd(t,e){let n=Fs.indexOf(e),r=0;return t.forEach((o,i)=>{if(o.kind==="textValue")return;let a=Fs.indexOf(o.localName);a!==-1&&a<=n&&(r=i+1);}),r}function Hs(t,e){let n=chunkZOZI27AW_cjs.fd(t);if(!n)return null;let r=null;for(let c of n.root.children)if(c.kind!=="textValue"&&c.namespaceUri===qn&&c.localName==="style"&&Yn(c,"type")==="paragraph"&&Yn(c,"styleId")===e){r=c;break}if(!r)return null;let o=Tt(r,"name");if(o&&Yn(o,"val")?.trim().toLowerCase()!=="list paragraph"&&e!=="ListParagraph")return null;let i=pd(n);if(!i)return null;let a=Tt(i,"contextualSpacing");if(!a)return null;let s=Tt(r,"pPr"),l;if(s){let c=Tt(s,"contextualSpacing");if(c&&ud(c))return t;l=c?chunkZOZI27AW_cjs.bb(n,c.id,a):chunkZOZI27AW_cjs.ab(n,s.id,fd(s.children,"contextualSpacing"),[a]);}else {let c=r.children.findIndex(d=>d.kind!=="textValue"&&["rPr","tblPr","tcPr","tblStylePr"].includes(d.localName));l=chunkZOZI27AW_cjs.ab(n,r.id,c===-1?r.children.length:c,[i]);}return l.ok?Object.freeze({...t,parts:new Map([...t.parts,[n.name,l.part]])}):null}var js="http://schemas.openxmlformats.org/package/2006/relationships",Vs="application/vnd.openxmlformats-package.relationships+xml",yd="http://schemas.openxmlformats.org/package/2006/content-types",Us="/[Content_Types].xml",gt="/word/numbering.xml",$s="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",Zt="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",xd=`<Override PartName="${gt}" ContentType="${Zt}"/>`;function Jn(t){return `${t.ownerPart}\0${t.id}`}function zs(t,e,n){let r=new Set(e.externalTargets.filter(s=>s.type===chunkZOZI27AW_cjs.Ed).map(Jn)),o=n.externalTargets.filter(s=>s.type===chunkZOZI27AW_cjs.Ed&&!r.has(Jn(s)));if(o.length===0)return t;let i=new Set(t.map(Jn)),a=o.filter(s=>!i.has(Jn(s)));return a.length===0?t:Object.freeze([...t,...a])}function Gs(t,e,n){let r=t.filter(o=>o.ownerPart===n||e.has(o.ownerPart));return r.length===t.length?t:Object.freeze(r)}function Ws(t,e,n=[],r=false){if(t===e)return t;let o=kd(t,e,r);return o=Od(o,e,n),o}function Ks(t,e){let n=new Set;for(let o of t.externalTargets)o.type===chunkZOZI27AW_cjs.Ed&&o.ownerPart!==t.mainDocumentPart&&(t.parts.has(o.ownerPart)||e.has(o.ownerPart)||n.add(o.ownerPart));for(let o of t.parts.keys()){let i=Id(o);!i||i===t.mainDocumentPart||t.parts.has(i)||e.has(i)||t.externalTargets.some(a=>a.ownerPart===i)||n.add(i);}if(n.size===0)return t;let r=t;for(let o of n)r=Nd(r,o);return r}function kd(t,e,n){let r=e.parts.get(gt);if(!r)return t;let o=t.parts.get(gt),i=n&&o?Pd(o,r):r,a=chunkZOZI27AW_cjs.Ne(t,i),s=(e.relationships.get(e.mainDocumentPart)??[]).find(c=>c.type===$s),l=a.relationships.get(a.mainDocumentPart)??[];if(s&&!l.some(c=>c.type===$s)&&!l.some(c=>c.id===s.id)){let c=Sd(a,{...s,ownerPart:a.mainDocumentPart});c&&(a=c);}if(a.contentTypes.overrides.get(chunkZOZI27AW_cjs.C(gt))!==Zt){let c=vd(a);c&&(a=c);}return a}function Pd(t,e){let n="http://schemas.openxmlformats.org/wordprocessingml/2006/main",r=l=>{if(l.kind==="textValue"||l.namespaceUri!==n)return null;let c=l.localName==="abstractNum"?"abstractNumId":l.localName==="num"?"numId":l.localName==="numPicBullet"?"numPicBulletId":null;if(!c)return null;let d=l.attributes.find(u=>u.namespaceUri===n&&u.localName===c)?.value;return d===void 0?null:`${l.localName}:${d}`},o=new Set(t.root.children.map(r).filter(Boolean)),i=chunkZOZI27AW_cjs.Va(t),a=["numPicBullet","abstractNum","num","numIdMacAtCleanup"],s=t;for(let l of e.root.children){let c=r(l);if(!c||o.has(c)||l.kind==="textValue")continue;let d=a.indexOf(l.localName),u=s.root.children.findIndex(f=>f.kind!=="textValue"&&f.namespaceUri===n&&a.indexOf(f.localName)>d),m=chunkZOZI27AW_cjs.ab(s,s.root.id,u<0?s.root.children.length:u,[go(l,i)]);m.ok&&(s=m.part,o.add(c));}return s}function Od(t,e,n){let r=n.filter(i=>i.type===chunkZOZI27AW_cjs.Ed);if(r.length===0)return t;let o=t;for(let i of r){let a=bd(t,e,i.ownerPart);if(!a||o.externalTargets.some(c=>c.ownerPart===a&&c.id===i.id)||new Set((o.relationships.get(a)??[]).map(c=>c.id)).has(i.id))continue;let l=Rd(o,{ownerPart:a,id:i.id,type:chunkZOZI27AW_cjs.Ed,rawTarget:i.rawTarget,sinkSafe:i.sinkSafe},a);l&&(o=l);}return o}function bd(t,e,n){return n===e.mainDocumentPart?t.mainDocumentPart:typeof n!="string"||n.length===0?null:n}function Sd(t,e){let n=t.mainDocumentPart,r=ho(n),o=t.parts.get(r),i=chunkZOZI27AW_cjs.Ma(`<Relationships xmlns="${js}"><Relationship Id="${chunkZOZI27AW_cjs.Y(e.id,"relationship id")}" Type="${chunkZOZI27AW_cjs.Y(e.type,"relationship type")}" Target="${chunkZOZI27AW_cjs.Y(e.rawTarget,"relationship target")}"/></Relationships>`,{name:r,contentType:Vs});if(!i.ok)return null;let a=t.relationships.get(n)??[];if(a.some(c=>c.id===e.id))return null;let s={...e,ownerPart:n,order:a.reduce((c,d)=>Math.max(c,d.order),-1)+1},l=new Map([...t.relationships,[n,[...a,s]]]);return o?Xs(t,o,i.part.root.children[0],l):Object.freeze({...t,parts:new Map([...t.parts,[r,i.part]]),relationships:l})}function Rd(t,e,n=t.mainDocumentPart){let r=n;if(typeof r!="string"||r.length===0)return null;let o=ho(r),i=t.parts.get(o),a=chunkZOZI27AW_cjs.Ma(`<Relationships xmlns="${js}"><Relationship Id="${chunkZOZI27AW_cjs.Y(e.id,"relationship id")}" Type="${chunkZOZI27AW_cjs.Ed}" Target="${chunkZOZI27AW_cjs.Y(e.rawTarget,"relationship target")}" TargetMode="External"/></Relationships>`,{name:o,contentType:Vs});if(!a.ok)return null;let s=[...t.externalTargets,e];if(!i)return Object.freeze({...t,parts:new Map([...t.parts,[o,a.part]]),externalTargets:s});let l=Xs(t,i,a.part.root.children[0],t.relationships);return l?Object.freeze({...l,externalTargets:s}):null}function Xs(t,e,n,r){if(!n)return null;let o=chunkZOZI27AW_cjs.Va(e),i=chunkZOZI27AW_cjs.ab(e,e.root.id,e.root.children.length,[go(n,o)]);return i.ok?Object.freeze({...t,parts:new Map([...t.parts,[e.name,i.part]]),relationships:r}):null}function go(t,e){return t.kind==="textValue"?{...t,id:e()}:{...t,id:e(),children:t.children.map(n=>go(n,e))}}function ho(t){let e=t.lastIndexOf("/");return `${t.slice(0,e)}/_rels/${t.slice(e+1)}.rels`}function Id(t){let e=/^(.*)\/_rels\/([^/]+)\.rels$/.exec(t);if(!e)return null;let n=e[1],r=e[2];return n===""||r===""?null:`${n}/${r}`}function Nd(t,e){let n=ho(e),r=new Map(t.parts);r.delete(n);let o=new Map(t.partBytes);o.delete(n);let i=new Map(t.relationships);i.delete(e);let a=Object.freeze(t.externalTargets.filter(s=>s.ownerPart!==e));return Object.freeze({...t,parts:r,partBytes:o,relationships:i,externalTargets:a})}function vd(t){let e=t.contentTypes.overrides.get(chunkZOZI27AW_cjs.C(gt));if(e===Zt)return t;if(e!==void 0)return null;let n=t.partBytes.get(Us);if(!n)return null;let r=fflate.strFromU8(n),o=Bs(r);if(!o)return null;let i=r.lastIndexOf(`</${o.rootName}>`);if(i===-1)return null;let a=r.slice(0,i)+xd+r.slice(i),s=Bs(a);if(!s||s.rootName!==o.rootName)return null;let l=[...o.children,Ys("Override",{PartName:gt,ContentType:Zt})];return s.children.length!==l.length||s.children.some((c,d)=>c!==l[d])?null:Object.freeze({...t,partBytes:new Map([...t.partBytes,[Us,fflate.strToU8(a)]]),contentTypes:Object.freeze({defaults:t.contentTypes.defaults,overrides:new Map([...t.contentTypes.overrides,[chunkZOZI27AW_cjs.C(gt),Zt]])})})}function Bs(t){let e=chunkZOZI27AW_cjs.ea(t);if(!e.ok)return null;let n=e.nodes.filter(s=>s.type==="element");if(n.length!==1)return null;let r=n[0],o=r.name.indexOf(":"),i=o===-1?"":r.name.slice(0,o);if(r.name.slice(o+1)!=="Types"||r.attributes[i?`xmlns:${i}`:"xmlns"]!==yd)return null;let a=[];for(let s of r.children)s.type==="element"&&a.push(Ys(s.name,s.attributes));return {rootName:r.name,children:a}}function Ys(t,e){let n=Object.entries(e).map(([r,o])=>`${r}=${o}`).sort();return [t,...n].join("")}var qs=4e3,Js=64;function Qs(t){return chunkZOZI27AW_cjs.qh(t,"footnote")!==null||chunkZOZI27AW_cjs.qh(t,"endnote")!==null}function Zs(t,e,n,r){if(!Qs(t))return false;if(r.has(n.paragraphId))return true;r.add(n.paragraphId);let o=chunkZOZI27AW_cjs.Xa(e,n.paragraphId);return !o||o.kind!=="paragraph"?true:chunkZOZI27AW_cjs.pg(o).some(i=>i.node.kind==="noteReference"&&i.start<n.end&&i.end>n.start)}function el(t,e,n,r){if(!Qs(t))return false;if(r.has(n.blockId))return true;r.add(n.blockId);let o=chunkZOZI27AW_cjs.Xa(e,n.blockId);if(!o||o.kind==="textValue")return true;let i=0,a=(s,l)=>{if(i>=qs||l>Js)return true;if(i+=1,s.kind==="textValue")return false;if(s.kind==="paragraph")return chunkZOZI27AW_cjs.pg(s).some(c=>c.node.kind==="noteReference");for(let c of s.children)if(a(c,l+1))return true;return false};return a(o,0)}function tl(t,e,n){if(n.count>=qs||e>Js)return true;if(n.count+=1,t.kind==="textValue")return false;if(t.kind==="commentRangeStart"||t.kind==="commentRangeEnd"||t.kind==="commentReference")return true;for(let r of t.children)if(tl(r,e+1,n))return true;return false}function nl(t,e,n,r){if(!t())return false;let o=n.op==="deleteText"?n.paragraphId:n.blockId;if(r.has(o))return true;r.add(o);let i=chunkZOZI27AW_cjs.Xa(e,o);return !i||i.kind==="textValue"?true:tl(i,0,{count:0})}var yo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",xo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";function rl(t,e){let r=(t.relationships.get(t.mainDocumentPart)??[]).find(o=>o.id===e);return r?r.type!==yo&&r.type!==xo?{ok:false,reason:"wrong-relationship-type",detail:r.type}:Ed(t,r):{ok:false,reason:"dangling-relationship",detail:e}}function Ed(t,e){let n=chunkZOZI27AW_cjs.N(e);if(n.mode==="External")return {ok:false,reason:"external-relationship",detail:e.id};if(!n.target.ok)return {ok:false,reason:"bad-relationship-target",detail:n.target.reason};let r=t.parts.get(n.target.partName);if(!r)return {ok:false,reason:"missing-part",detail:n.target.partName};let o=r.root.localName;return o!=="hdr"&&o!=="ftr"?{ok:false,reason:"not-a-story-part",detail:o||r.name}:{ok:true,partName:r.name,part:r}}var ko=new Set(["acceptRevision","rejectRevision","acceptAllRevisions","rejectAllRevisions"]),Po=new Set(["authorTable","deleteTableRow","deleteTableColumn","mergeTableCells","removeContentControl","removeRepeatingSectionItem"]);function ht(t,e){return e.compositionActive||t.compositionSessionOpen()?{ok:false,reason:"invalidArgs",detail:"ime-composition-active"}:null}function ol(t,e){let n=chunkZOZI27AW_cjs.Xa(t,e);return !n||n.kind!=="drawing"?null:n.children.find(o=>o.kind==="inlineDrawing"||o.kind==="anchoredDrawing")??null}function al(t,e,n){let r=t.parts.get(e);if(!r)return null;let o=chunkZOZI27AW_cjs.Xa(r,n);return !o||o.kind!=="drawing"?null:chunkZOZI27AW_cjs.Ud(o,{ownerPartName:e,supportedMcRequires:chunkZOZI27AW_cjs.Nd,limits:chunkZOZI27AW_cjs.Md,resolveRelationship:chunkZOZI27AW_cjs.Pd(t,e)})}function il(t,e,n){let r=chunkZOZI27AW_cjs.O(t.relationships.get(e)??[],e,n);return r.mode==="internal"?r.partName:null}function wt(t,e,n,r){let o=t.resolveStory(e);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let i=ht(t,o.store);if(i)return i;let{store:a,story:s}=o;return chunkZOZI27AW_cjs.Ra(t,()=>Td(t,a,s,n,r),l=>chunkZOZI27AW_cjs.Sa(l))}function Td(t,e,n,r,o){let i=n.partName,a=t.currentPackage(),s=e.checkpoint();e.graftPackage(()=>t.currentPackage());let l=null,c=false,d=false,u=e.transact(h=>{if(o?.commitGuard?.()===false){d=true;return}if(o?.expectedPackageRevision!==void 0&&t.packageRevision!==o.expectedPackageRevision){c=true;return}let b=r(h,i);if(b===null){h.apply({op:"insertText",paragraphId:"\0task12-abort",offset:0,text:"x"});return}l=b;},{story:n,...o?.actorId?{actorId:o.actorId}:{},...n.kind==="headerFooter"||n.kind==="notesPart"?{minimumImpact:"global"}:{}});if(d)return {ok:false,reason:"invalidArgs",detail:"stale drawing selection"};if(c)return {ok:false,reason:"invalidArgs",detail:"stale-package-epoch"};if(!u.ok)return {ok:false,reason:u.reason,...u.detail?{detail:u.detail}:{}};if(!u.change)return {ok:true,change:null};let m=u.change.created.find(h=>{let b=e.part;return chunkZOZI27AW_cjs.Xa(b,h)?.kind==="drawing"});return m&&(l=m),{ok:true,change:t.promoteStoryTransactionToPackageUnit(a,e,s),...l?{drawingNodeId:l}:{}}}function sl(t,e,n){let r=t.parts.get(e);if(!r)return null;let o=ol(r,n);return o?chunkZOZI27AW_cjs.Dl(o):null}function Oo(t,e,n,r){let o=false;return t.applyPackage(i=>{let a=i.parts.get(e);if(!a)return i;let s=chunkZOZI27AW_cjs.Xa(a,n);if(!s||s.kind!=="drawing")return i;let l=ol(a,n);if(!l)return i;let c=chunkZOZI27AW_cjs.El(l,r),d=wd(s,c),u=chunkZOZI27AW_cjs.bb(a,s.id,d,{deferValidation:true});return u.ok?(o=true,chunkZOZI27AW_cjs.Ne(i,u.part)):i}),o}function wd(t,e){return {...t,children:t.children.map(n=>n.id===e.id?e:n)}}async function ll(t,e,n){let r=chunkZOZI27AW_cjs.De(n.widthPoints),o=chunkZOZI27AW_cjs.De(n.heightPoints);if(r===null||o===null)return {ok:false,reason:"invalidArgs",detail:"invalid-dimensions"};let i=t.resolveStory(e);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let a=ht(t,i.store);if(a)return a;let s=i.story.partName,l=await chunkZOZI27AW_cjs.ye(n.decodePort,n.bytes,n.mime);if(!l.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let c=l.bytes,d=chunkZOZI27AW_cjs.Ae(t.currentPackage(),s,{bytes:c,mime:n.mime});if(!d.ok)return {ok:false,reason:"invalidArgs",detail:d.reason==="invalid-image"?"invalid-image":d.reason};let u=d.partName,m=wt(t,e,(f,h)=>{let b=t.currentPackage(),R=chunkZOZI27AW_cjs.Ae(b,h,{bytes:c,mime:n.mime});if(!R.ok)return null;b=R.pkg,u=R.partName;let O;if(n.hyperlink){let p=chunkZOZI27AW_cjs.Ug(b,n.hyperlink,h);if(!p)return null;b=p.pkg,O=p.relationshipId;}if(!f.applyPackage(()=>b))return null;let g=chunkZOZI27AW_cjs.Ee({docPrId:R.docPrId,relationshipId:R.relationshipId,extentEmu:{cx:r,cy:o},...n.title!==void 0?{title:n.title}:{},...n.description!==void 0?{description:n.description}:{},...O?{hyperlinkRelationshipId:O}:{}});return f.apply({op:"insertDrawing",paragraphId:n.paragraphId,offset:n.offset,drawing:g,...n.revision?{revision:n.revision}:{}})?g.id:null},{expectedPackageRevision:n.expectedPackageRevision,...n.commitGuard?{commitGuard:n.commitGuard}:{},...n.actorId?{actorId:n.actorId}:{}});return m.ok?m.change?{...m,mediaPartName:u}:{ok:true,change:null,mediaPartName:u}:m}async function bo(t,e,n,r,o,i,a){let s=t.resolveStory(e);if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};let l=ht(t,s.store);if(l)return l;let c=s.story.partName,d=await chunkZOZI27AW_cjs.ye(i,r,o);if(!d.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let u=d.bytes,m=chunkZOZI27AW_cjs.Ae(t.currentPackage(),c,{bytes:u,mime:o});return m.ok?wt(t,e,(f,h)=>{let b=t.currentPackage(),R=al(b,c,n),O=R?.picture?.embeddedRelationshipId??null,g=R?.picture?.linkedRelationshipId??null,p=O??g;if(!p)return null;let P=O!==null?il(b,c,O):null,M=b,F=chunkZOZI27AW_cjs.Ae(M,h,{bytes:u,mime:o});return !F.ok||(M=F.pkg,!f.applyPackage(()=>M))||!f.apply({op:"replaceDrawingResource",drawingNodeId:n,relationshipId:F.relationshipId})?null:(f.applyPackage($=>chunkZOZI27AW_cjs.Ge($,h,P,p)),n)},{expectedPackageRevision:a.expectedPackageRevision,...a.commitGuard?{commitGuard:a.commitGuard}:{},...a.actorId?{actorId:a.actorId}:{}}):{ok:false,reason:"invalidArgs",detail:m.reason==="invalid-image"?"invalid-image":m.reason}}function cl(t,e,n){let r=t.resolveStory(e);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let o=ht(t,r.store);if(o)return o;let i=r.story.partName,a=t.currentPackage(),s=a.parts.get(i),l=al(a,i,n)??(s?chunkZOZI27AW_cjs.ul(s,n):null);if(!l)return {ok:false,reason:"unknown-drawing"};let c=l.picture?.embeddedRelationshipId??null,d=l.picture?.linkedRelationshipId??null,u=c??d,m=c!==null?il(a,i,c):null;return wt(t,e,(f,h)=>f.apply({op:"deleteDrawing",drawingNodeId:n})?(f.applyPackage(b=>chunkZOZI27AW_cjs.Ge(b,h,m,u)),n):null)}function Cd(t,e){let n=null,r=i=>{let a=false,s=false,l=(c,d)=>{if(a||c.kind==="textValue")return;if(c.id===e){a=true,s=d;return}let u=d||c.kind==="revisionDelete"||c.kind==="revisionMoveFrom";for(let m of c.children)l(m,u);};return l(i,false),s},o=i=>{if(!(n!==null||i.kind==="textValue")){if(i.kind==="paragraph"){let a=chunkZOZI27AW_cjs.rg(i).spanOf(e);if(a!==null&&a.end>a.start){let s=chunkZOZI27AW_cjs.Xa(t,e);if(!s||s.kind!=="drawing"&&!chunkZOZI27AW_cjs.Qd(s))return;n={paragraphId:i.id,start:a.start,end:a.end,alreadyDeleted:r(i)};}return}for(let a of i.children)o(a);}};return o(t.root),n}function dl(t,e,n,r){let o=t.resolveStory(e);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let i=ht(t,o.store);if(i)return i;let a=t.currentPackage().parts.get(o.story.partName);if(!a)return {ok:false,reason:"unknown-drawing"};let s=Cd(a,n);return s?s.alreadyDeleted?{ok:true,change:null}:wt(t,e,l=>l.apply({op:"deleteText",paragraphId:s.paragraphId,start:s.start,end:s.end,revision:r})?n:null):{ok:false,reason:"unknown-drawing"}}async function ml(t,e,n,r,o,i,a,s){let l=await chunkZOZI27AW_cjs.He(o,r,i,void 0,a);return l.ok?bo(t,e,n,l.bytes,l.mime,a,{expectedPackageRevision:t.packageRevision,...s?{actorId:s}:{}}):{ok:false,reason:"invalidArgs",detail:`${l.reason}${l.detail?`:${l.detail}`:""}`}}function ul(t,e,n,r,o,i){let a=t.resolveStory(e);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let s=ht(t,a.store);return s||wt(t,e,(l,c)=>{let d=sl(t.currentPackage(),c,n),u=null;if(i!==null){let f=chunkZOZI27AW_cjs.Ug(t.currentPackage(),i,c);if(!f||!l.applyPackage(()=>f.pkg))return null;u=f.relationshipId;}if(!l.apply({op:"setDrawingMetadata",drawingNodeId:n,title:r,description:o,...i===null?{hyperlink:null}:{}}))return null;if(i!==null&&u!==null){if(!Oo(l,c,n,u))return null}else if(i===null&&!Oo(l,c,n,null))return null;let m=false;return l.applyPackage(f=>{let h=chunkZOZI27AW_cjs.Wg(f,c,d);return h===null?(m=true,f):h}),m?null:n})}function pl(t,e,n){let r=t.resolveStory(e);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let o=ht(t,r.store);return o||wt(t,e,(i,a)=>{let s=sl(t.currentPackage(),a,n.drawingNodeId),l=null;if(n.hyperlink!==null){let d=chunkZOZI27AW_cjs.Ug(t.currentPackage(),n.hyperlink,a);if(!d||!i.applyPackage(()=>d.pkg))return null;l=d.relationshipId;}for(let d of n.ops)if(!i.apply(d))return null;if(!Oo(i,a,n.drawingNodeId,n.hyperlink===null?null:l))return null;let c=false;return i.applyPackage(d=>{let u=chunkZOZI27AW_cjs.Wg(d,a,s);return u===null?(c=true,d):u}),c?null:n.drawingNodeId})}function Md(t,e){if(t===e)return true;if(t.byteLength!==e.byteLength)return false;for(let n=0;n<t.byteLength;n+=1)if(t[n]!==e[n])return false;return true}function fl(t,e){if(t===e)return true;if(t.size!==e.size)return false;for(let[n,r]of t)if(e.get(n)!==r)return false;return true}function Ad(t,e){return t===e||t.ownerPart===e.ownerPart&&t.id===e.id&&t.type===e.type&&t.rawTarget===e.rawTarget&&t.targetMode===e.targetMode&&t.order===e.order}function Dd(t,e){if(t===e)return true;if(t.size!==e.size)return false;for(let[n,r]of t){let o=e.get(n);if(!o||o.length!==r.length||o!==r&&r.some((i,a)=>!Ad(i,o[a])))return false}return true}function _d(t,e){return t===e?true:t.length!==e.length?false:t.every((n,r)=>{let o=e[r];return n===o||n.ownerPart===o.ownerPart&&n.id===o.id&&n.type===o.type&&n.rawTarget===o.rawTarget&&n.sinkSafe===o.sinkSafe})}function Fd(t,e){if(t===e)return true;if(t.size!==e.size)return false;for(let[n,r]of t){let o=e.get(n);if(!o||!Md(r,o))return false}return true}function Ld(t,e){return t.contentTypes===e.contentTypes||fl(t.contentTypes.defaults,e.contentTypes.defaults)&&fl(t.contentTypes.overrides,e.contentTypes.overrides)}var Qn=Object.freeze({equal:true,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"}),Ct=Object.freeze({equal:false,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"});function gl(t){for(let[e,n]of t)if(!chunkZOZI27AW_cjs.Ha(e,n)||!chunkZOZI27AW_cjs.Ia(n.root,e.root).idsPreserved)return Ct;return Qn}function Hd(t,e){if(t===e)return Qn;if(t.mainDocumentPart!==e.mainDocumentPart||t.parts.size!==e.parts.size||!Fd(t.partBytes,e.partBytes)||!Dd(t.relationships,e.relationships)||!_d(t.externalTargets,e.externalTargets)||!Ld(t,e))return Ct;let n=[];for(let[a,s]of t.parts){let l=e.parts.get(a);if(!l)return Ct;s!==l&&n.push([s,l]);}if(n.length===0)return Qn;let[r,o]=n[0];if(n.length>1||r.name!==t.mainDocumentPart)return gl(n);let i=chunkZOZI27AW_cjs.Ia(o.root,r.root);return i.undecided?gl(n):i.equal&&i.idsPreserved?Qn:i.equal?i.renamedOutsideParagraphs||i.renamedParagraphIds.length===0?Ct:{equal:false,dirty:i.renamedParagraphIds,dependencyKeys:[chunkZOZI27AW_cjs.l.story],impact:"text-local"}:!i.idsPreserved||i.reach==="outside-paragraph"||i.paragraphIds.length===0?Ct:{equal:false,dirty:i.paragraphIds,dependencyKeys:[chunkZOZI27AW_cjs.l.story],impact:i.reach==="paragraph-text"?"text-local":"flow-structural"}}function So(t){return {ok:false,reason:"package-invariant",detail:t}}function Ud(t,e){if(!t.parts.get(t.mainDocumentPart))return So("no-main-document");for(let[r,o]of t.parts){let i=e?.parts.get(r);if(i===o)continue;let a=i?chunkZOZI27AW_cjs.Ka(i,o):chunkZOZI27AW_cjs.Ja(o);if(!a.ok)return So(`invalid-part:${r}:${a.issues[0]?.code??"invalid"}`)}let n=chunkZOZI27AW_cjs.Ye(t);return n.ok?null:So(n.issues[0]?.code??"package-invariant")}function hl(t,e,n){let r=t.currentPackage(),o=Hd(e,r);if(o.equal)return {ok:true,change:null};let i=Ud(e,r);if(i)return i;let a=t.bodyStore().part.name,s=o.impact!=="global"&&e.mainDocumentPart===a;return chunkZOZI27AW_cjs.Ra(t,()=>{let l=t.packageRevision;return t.installAuthoritativePackageSnapshot(e),{ok:true,change:t.publishStoryWrite({change:"model-change",fromRevision:l,toRevision:l+1,commitId:`pkg-remote-${l+1}`,origin:n.origin,...n.actorId?{actorId:n.actorId}:{},...n.operationId?{operationId:n.operationId}:{},dirty:s?o.dirty:[],created:[],deleted:[],splitJoin:[],dependencyKeys:s?o.dependencyKeys:[],impact:s?o.impact:"global",story:{kind:"body",partName:a}})}},()=>false)}function $d(t,e,n,r){let o=[...e],i=new Set;for(let a of o)t.parts.has(a)&&i.add(a);for(let a of n)yl(a,o,i);for(let a of r)yl(a,o,i);return i}function Bd(t,e,n,r,o){let i=new Set(t);i.add(e),i.add(n);for(let a of r)xl(a,i);for(let a of o)xl(a,i);return i}function yl(t,e,n){if(t.kind==="story"){n.add(t.partName);return}for(let r of e)(t.before.parts.has(r)||t.after.parts.has(r))&&n.add(r);}function xl(t,e){if(t.kind==="story"){e.add(t.partName);return}for(let n of t.before.parts.keys())e.add(n);for(let n of t.after.parts.keys())e.add(n);}function kl(t){let{stories:e,rIdToPartName:n,undoOrder:r,redoOrder:o}=t,i=$d(t.pkg,e.keys(),r,o);for(let[l]of [...e])if(!i.has(l)){e.delete(l);for(let[c,d]of [...n])d===l&&n.delete(c);}let a=Bd(i,t.pkg.mainDocumentPart,t.bodyPartName,r,o),s=Ks(t.pkg,a);return {pkg:s,shellHyperlinks:Gs(t.shellHyperlinks,a,s.mainDocumentPart)}}function Pl(t,e,n,r,o,i){return {change:"model-change",fromRevision:Math.max(0,e-1),toRevision:e,commitId:`pkg-commit-${t}`,origin:n,dirty:[],created:[...i],deleted:[],splitJoin:[],dependencyKeys:[],impact:r,story:o}}var Ol=64,en=class{pkg;packageRev=0;body;stories=new Map;rIdToPartName=new Map;undoOrder=[];redoOrder=[];historyGroups=new Xn;subscribers=new Set;historyLimit;contentLockPolicy;maxEditableStoryParts;cascadeNoteReferences;lastChange=null;shellHyperlinks=Object.freeze([]);compositionSession=null;commitCounter=0;currentPackageMemo=null;storyStoreOptions(){return {historyLimit:this.historyLimit,settingsPart:()=>chunkZOZI27AW_cjs.fh(this.pkg),...this.contentLockPolicy?{contentLockPolicy:this.contentLockPolicy}:{}}}constructor(e,n,r={}){this.pkg=chunkZOZI27AW_cjs.Ne(e,n),this.historyLimit=r.historyLimit??200,this.contentLockPolicy=chunkZOZI27AW_cjs.pj(r.contentLockPolicy),this.maxEditableStoryParts=r.maxEditableStoryParts??Ol,this.cascadeNoteReferences=r.cascadeDeletedNoteReferences??chunkZOZI27AW_cjs.ji,this.body=new ft(this.pkg,n.name,this.storyStoreOptions()),this.body.setStoryRef({kind:"body",partName:n.name}),chunkZOZI27AW_cjs.Vl(this,{current:()=>this.undoOrder.at(-1)??null,split:()=>{this.closeHistoryGroups(),this.redoOrder.length=0;}});}get packageRevision(){return this.packageRev}get canUndo(){return this.undoOrder.length>0}get canRedo(){return this.redoOrder.length>0}get lastModelChange(){return this.lastChange}bodyStore(){return this.body}currentPackage(){let e=this.currentPackageMemo;if(e&&e.pkg===this.pkg&&e.bodyPart===this.body.part){let o=0,i=true;for(let a of this.stories.values()){if(e.storyParts[o]!==a.part){i=false;break}o+=1;}if(i&&o===e.storyParts.length)return e.result}let n=chunkZOZI27AW_cjs.Ne(this.pkg,this.body.part),r=[];for(let o of this.stories.values())r.push(o.part),this.pkg.parts.has(o.part.name)&&(n=chunkZOZI27AW_cjs.Ne(n,o.part));return this.currentPackageMemo={pkg:this.pkg,bodyPart:this.body.part,storyParts:r,result:n},n}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}resolveStory(e){return e.kind==="body"?{ok:true,story:{kind:"body",partName:this.body.part.name},store:this.body}:e.kind==="notesPart"?e.noteKind!=="footnote"&&e.noteKind!=="endnote"?{ok:false,reason:"unknown-scope",detail:String(e.noteKind)}:this.openNotesPartStore(e.noteKind):e.kind!=="headerFooter"||typeof e.rId!="string"||e.rId.length===0?{ok:false,reason:"unknown-scope",detail:String(e.kind)}:this.openHeaderFooterStore(e.rId)}partFor(e){let n=this.resolveStory(e);return n.ok?n.store.part:null}revisionFor(e){let n=this.resolveStory(e);return n.ok?n.store.revision:null}transact(e,n,r={}){return chunkZOZI27AW_cjs.Ra(this,()=>this.commitStoryTransaction(e,n,r),chunkZOZI27AW_cjs.Sa,r.historyGroup)}commitStoryTransaction(e,n,r={}){let o=this.resolveStory(e);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let{store:i,story:a}=o,s=this.currentPackage(),l=i.historyPushCount,c=i.compositionActive,d=i.checkpoint(),u=false,m=new Set,f=false,h,b=new Set,R=false,O,g=false,p;i.graftPackage(()=>this.currentPackage());let P=i.transact($=>{p=Ms($),n({...$,applyTo:(w,L)=>{let q=$.applyTo(w,L);return q&&w!==a.partName&&(g=true),q},applyPackage:w=>$.applyPackage(L=>{let q=w(L);return q!==L&&!g&&(g=Ds(L,q,a.partName)),q}),apply:w=>(w.op==="setListNumbering"&&w.numId!==null&&(R=true),w.op==="setParagraphProperties"&&(O??=w.properties.find(L=>L.localName==="pStyle")?.attributes?.val),u||(w.op==="deleteText"&&Zs(this.pkg,i.part,w,m)||w.op==="deleteBlock"&&el(this.pkg,i.part,w,m)||ko.has(w.op)||Po.has(w.op))&&(u=true),f||(w.op==="deleteText"||w.op==="deleteBlock"?f=nl(()=>h??=chunkZOZI27AW_cjs.si(this.pkg),i.part,w,b):(ko.has(w.op)||Po.has(w.op))&&(f=true)),$.apply(w)),...p.context});},{...r,story:a,...a.kind==="headerFooter"||a.kind==="notesPart"?{minimumImpact:"global"}:{}});if(!P.ok)return {ok:false,reason:P.reason,...P.detail?{detail:P.detail}:{}};this.syncPackageFromStore(i);let M=false;if(P.change&&g&&(this.installPackageSnapshotInternal(i.package,false),c?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(d),M=true),R&&O){let $=Hs(this.pkg,O);$&&this.replacePackageShell($);}let F=false;if(P.change&&u){let $=this.currentPackage(),w=this.cascadeNoteReferences(s,$);if(w===null)return i.restoreCheckpoint(d),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"note-cascade-failed"};w!==$&&(this.installPackageSnapshotInternal(w),c?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(d),F=true);}if(P.change&&f){let $=this.currentPackage(),w=chunkZOZI27AW_cjs.wi(s,$,{storyPartName:a.partName});if(w===null)return i.restoreCheckpoint(d),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"comment-cascade-failed"};w!==$&&(this.installPackageSnapshotInternal(w),c?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(d),F=true);}if(P.change){this.packageRev+=1;let $=F||M;if(!c&&r.recordsHistory!==false&&(i.historyPushCount>l||$))if($)this.pushUndoPointer({kind:"package",before:s,after:this.currentPackage(),...p?.snapshot(P.change.caret)},Et(r.historyGroup,s));else {let L=Et(r.historyGroup,s);this.pushUndoPointer({kind:"story",partName:a.partName,story:a},L);}let w=$?this.publishSynthetic(P.change.origin,"global",a,P.change.created):P.change;return $||this.publish(w),{ok:true,change:w}}return {ok:true,change:P.change}}compositionSessionOpen(){return this.compositionSession!==null}beginComposition(e,n=null){let r=this.resolveStory(e);return !r.ok||this.compositionSession&&this.compositionSession.partName!==r.story.partName&&(this.endComposition(),r=this.resolveStory(e),!r.ok)?false:(this.compositionSession||(this.compositionSession={partName:r.story.partName,beforePackage:this.currentPackage(),storyCheckpoint:r.store.checkpoint(),packageWideEffects:false}),r.store.beginComposition(n),true)}endComposition(){let e=this.compositionSession;if(this.compositionSession=null,!e){this.body.endComposition();return}let n=e.partName===this.body.part.name?this.body:this.stories.get(e.partName);if(!n)return;let r=n.historyPushCount;if(n.endComposition(),e.packageWideEffects){n.restoreHistoryStacks(e.storyCheckpoint),this.syncPackageFromStore(n),this.pushUndoPointer({kind:"package",before:e.beforePackage,after:this.currentPackage()});return}if(n.historyPushCount>r){let o=e.partName===this.body.part.name?{kind:"body",partName:e.partName}:this.storyRefForPart(e.partName);o&&this.pushUndoPointer({kind:"story",partName:e.partName,story:o});}this.syncPackageFromStore(n);}cancelComposition(){let e=this.compositionSession;if(this.compositionSession=null,!e){this.body.cancelComposition();return}let n=e.partName===this.body.part.name?this.body:this.stories.get(e.partName);if(e.packageWideEffects){n&&n.restoreCheckpoint(e.storyCheckpoint),this.installPackageSnapshotInternal(e.beforePackage),this.packageRev+=1;let r=e.partName===this.body.part.name?{kind:"body",partName:e.partName}:this.storyRefForPart(e.partName);this.publishSynthetic(chunkZOZI27AW_cjs.g.mutationHuman,"global",r??{kind:"body",partName:this.body.part.name},[]);return}n?.cancelComposition();}applyLifecycleOp(e,n={}){let r=()=>this.commitLifecycleOp(e,n.historyGroup);return chunkZOZI27AW_cjs.Lb(n.actorId,()=>chunkZOZI27AW_cjs.Ra(this,r,chunkZOZI27AW_cjs.Sa,n.historyGroup))}commitLifecycleOp(e,n){let r=this.currentPackage(),o=chunkZOZI27AW_cjs.sj(chunkZOZI27AW_cjs.fh(r),e);if(o)return {ok:false,reason:o};if(chunkZOZI27AW_cjs.hi(e)){let c=chunkZOZI27AW_cjs.ii(r,e);if(!c.ok)return {ok:false,reason:c.reason,...c.detail?{detail:c.detail}:{}};if(c.package===r)return {ok:true,change:null};this.installPackageSnapshotInternal(c.package);let d=Et(n,r);this.pushUndoPointer({kind:"package",before:r,after:c.package},d),this.packageRev+=1;let u={kind:"body",partName:this.body.part.name},m=this.publishSynthetic(chunkZOZI27AW_cjs.g.mutationHuman,c.impact,u,c.createdPartName?[c.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:m}}if(!chunkZOZI27AW_cjs._g(e))return {ok:false,reason:"invalidArgs",detail:"not-lifecycle-op"};let i=chunkZOZI27AW_cjs.$g(r,e);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};this.installPackageSnapshotInternal(i.package);let a=Et(n,r);this.pushUndoPointer({kind:"package",before:r,after:i.package},a),this.packageRev+=1;let s={kind:"body",partName:this.body.part.name},l=this.publishSynthetic(chunkZOZI27AW_cjs.g.mutationHuman,i.impact,s,i.createdPartName?[i.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:l}}undo(){let e=this.undoOrder.pop();if(!e)return null;if(this.closeHistoryGroups(),e.kind==="package"){this.installPackageSnapshotInternal(e.before,true,e.restoreNumbering),this.redoOrder.push(e),this.packageRev+=1;let o=this.publishSynthetic(chunkZOZI27AW_cjs.g.mutationUndo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),o}let n=e.partName===this.body.part.name?this.body:this.stories.get(e.partName);if(!n)return null;let r=n.undo();return r?(this.redoOrder.push(e),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}redo(){let e=this.redoOrder.pop();if(!e)return null;if(this.closeHistoryGroups(),e.kind==="package"){this.installPackageSnapshotInternal(e.after,true,e.restoreNumbering),this.undoOrder.push(e),this.packageRev+=1;let o=this.publishSynthetic(chunkZOZI27AW_cjs.g.mutationRedo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),o}let n=e.partName===this.body.part.name?this.body:this.stories.get(e.partName);if(!n)return null;let r=n.redo();return r?(this.undoOrder.push(e),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}selectionForUndo(){return uo(this.undoOrder.at(-1),this.body,this.stories,"undo")}selectionForRedo(){return uo(this.redoOrder.at(-1),this.body,this.stories,"redo")}openStoryParts(){return po(this.stories,this.pkg)}openedStoryCount(){return 1+this.stories.size}openStoryToken(){return As(this.stories,this.pkg)}insertImage(e,n){return ll(this,e,n)}applyFragmentPaste(e,n){return co(this,e,n)}replaceImage(e,n,r,o,i,a){return bo(this,e,n,r,o,i,a)}deleteImage(e,n){return cl(this,e,n)}deleteImageTracked(e,n,r){return dl(this,e,n,r)}embedExternalImage(e,n,r,o,i,a,s){return ml(this,e,n,r,o,i,a,s)}setDrawingMetadataWithHyperlink(e,n,r,o,i){return ul(this,e,n,r,o,i)}applyImageProperties(e,n){return pl(this,e,n)}promoteStoryTransactionToPackageUnit(e,n,r,o){this.installPackageSnapshotInternal(n.package,false),n.restoreHistoryStacks(r),this.pushUndoPointer({kind:"package",before:e,after:this.currentPackage()}),this.packageRev+=1;let i=n.part.name===this.body.part.name?{kind:"body",partName:n.part.name}:this.storyRefForPart(n.part.name);return this.publishSynthetic(chunkZOZI27AW_cjs.g.mutationHuman,i?.kind==="headerFooter"?"global":"flow-structural",i??{kind:"body",partName:this.body.part.name},[])}publishStoryWrite(e){return e?(this.packageRev+=1,this.publish(e),e):null}adoptPackageUnit(e){this.adoptGroupedPackageUnit(e,void 0);}adoptGroupedPackageUnit(e,n){let r=this.currentPackage();e!==r&&this.pushUndoPointer({kind:"package",before:e,after:r},Et(n,e));}installPackageSnapshot(e){this.installPackageSnapshotInternal(e);}installAuthoritativePackageSnapshot(e){this.installPackageSnapshotInternal(e,false);}publishRemotePackage(e,n){return hl(this,e,n)}replacePackageShell(e){this.shellHyperlinks=zs(this.shellHyperlinks,this.pkg,e);let n=e;n=chunkZOZI27AW_cjs.Ne(n,this.body.part);for(let r of this.stories.values())e.parts.has(r.part.name)&&(n=chunkZOZI27AW_cjs.Ne(n,r.part));this.pkg=n;}installPackageSnapshotInternal(e,n=true,r=false){let o=n?Ws(e,this.pkg,this.shellHyperlinks,r):e,i=o.parts.get(o.mainDocumentPart);if(!i)return;this.body.replacePart(i);for(let[s,l]of this.stories){let c=o.parts.get(s);c&&l.replacePart(c);}this.rIdToPartName.clear();let a=o.relationships.get(o.mainDocumentPart)??[];for(let s of a){if(s.type!==yo&&s.type!==xo)continue;let l=chunkZOZI27AW_cjs.N(s);l.mode!=="Internal"||!l.target.ok||this.stories.has(l.target.partName)&&o.parts.has(l.target.partName)&&this.rIdToPartName.set(s.id,l.target.partName);}this.pkg=o,this.pkg=chunkZOZI27AW_cjs.Ne(this.pkg,this.body.part);for(let s of this.stories.values())this.pkg.parts.has(s.part.name)&&(this.pkg=chunkZOZI27AW_cjs.Ne(this.pkg,s.part));}openNotesPartStore(e){let n=chunkZOZI27AW_cjs.qh(this.currentPackage(),e);if(!n)return {ok:false,reason:"missing-part",detail:e};let r=this.stories.get(n.name);if(r)return {ok:true,story:{kind:"notesPart",partName:n.name,noteKind:e},store:r};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let o=chunkZOZI27AW_cjs.Ib(n),i=new ft(o,this.storyStoreOptions()),a={kind:"notesPart",partName:o.name,noteKind:e};return i.setStoryRef(a),this.stories.set(o.name,i),o!==n&&(this.pkg=chunkZOZI27AW_cjs.Ne(this.pkg,o)),{ok:true,story:a,store:i}}openHeaderFooterStore(e){let n=this.rIdToPartName.get(e);if(n){let l=this.stories.get(n);if(l)return {ok:true,story:{kind:"headerFooter",partName:n,rId:e},store:l}}let r=rl(this.currentPackage(),e);if(!r.ok)return r;let o=this.stories.get(r.partName);if(o)return this.rIdToPartName.set(e,r.partName),{ok:true,story:{kind:"headerFooter",partName:r.partName,rId:e},store:o};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let i=chunkZOZI27AW_cjs.Ib(r.part),a=new ft(i,this.storyStoreOptions()),s={kind:"headerFooter",partName:i.name,rId:e};return a.setStoryRef(s),this.stories.set(i.name,a),this.rIdToPartName.set(e,i.name),i!==r.part&&(this.pkg=chunkZOZI27AW_cjs.Ne(this.pkg,i)),{ok:true,story:s,store:a}}storyRefForPart(e){if(e===this.body.part.name)return {kind:"body",partName:e};for(let[r,o]of this.rIdToPartName)if(o===e)return {kind:"headerFooter",partName:e,rId:r};let n=this.currentPackage().parts.get(e);return n?.root.localName==="footnotes"?{kind:"notesPart",partName:e,noteKind:"footnote"}:n?.root.localName==="endnotes"?{kind:"notesPart",partName:e,noteKind:"endnote"}:null}syncPackageFromStore(e){this.pkg=chunkZOZI27AW_cjs.Ne(this.pkg,e.part);}closeHistoryGroups(){chunkZOZI27AW_cjs.Sl(this.body,this.stories,null),this.historyGroups.close();}pushUndoPointer(e,n){e=this.historyGroups.admit(e,n,this.undoOrder,r=>(r===this.body.part.name?this.body:this.stories.get(r))?.discardNewestUndoEntry()??null,()=>this.currentPackage()),chunkZOZI27AW_cjs.Sl(this.body,this.stories,e),this.undoOrder.push(e),this.redoOrder.length=0,this.undoOrder.length>this.historyLimit&&this.undoOrder.shift(),this.evictUnreachableStories();}evictUnreachableStories(){let e=kl({pkg:this.pkg,stories:this.stories,rIdToPartName:this.rIdToPartName,bodyPartName:this.body.part.name,shellHyperlinks:this.shellHyperlinks,undoOrder:this.undoOrder,redoOrder:this.redoOrder});this.pkg=e.pkg,this.shellHyperlinks=e.shellHyperlinks;}publish(e){this.lastChange=e;for(let n of this.subscribers)n(e);}publishSynthetic(e,n,r,o){this.commitCounter+=1;let i=Pl(this.commitCounter,this.packageRev,e,n,r,o);return this.publish(i),i}};var jd=256,Vd=65535,bl=64;function Zn(t,e){return t.length>e}function Sl(t){return typeof t!="string"||t.trim().length===0?"invalid-author":Zn(t,jd)?"resource-limit":chunkZOZI27AW_cjs.X(t)?null:"invalid-author"}function Rl(t){return typeof t!="string"||t.length===0?"invalid-text":Zn(t,Vd)?"resource-limit":chunkZOZI27AW_cjs.X(t)?null:"invalid-text"}function Ro(t){if(typeof t!="string")return {ok:false,rejection:"invalid-date"};let e=t.trim();if(Zn(e,bl))return {ok:false,rejection:"resource-limit"};if(!chunkZOZI27AW_cjs.X(e))return {ok:false,rejection:"invalid-date"};let n=chunkZOZI27AW_cjs.hg(e);return n===null?{ok:false,rejection:"invalid-date"}:Zn(n,bl)?{ok:false,rejection:"resource-limit"}:{ok:true,value:n}}function rh(t){if(t===void 0)return null;let e=Ro(t);return e.ok?null:e.rejection}function Io(t){switch(t){case "invalid-author":return "invalid-author";case "invalid-text":return "invalid-text";case "invalid-date":return "invalid-property-value";case "resource-limit":return "resource-limit"}}function zd(t,e,n){for(let r of t.attributes)if(r.localName===n&&r.namespaceUri===e)return r.value}function No(t,e){if(!t){let a=chunkZOZI27AW_cjs.Mb(e);return a?chunkZOZI27AW_cjs.Ob(new Set,a,chunkZOZI27AW_cjs.Jb):"0"}let n=-1,r=new Set,o=a=>{if(a.kind!=="textValue"){if(a.kind==="comment"){let s=zd(a,chunkZOZI27AW_cjs.pa,"id");if(s!==void 0&&/^\d{1,10}$/.test(s)){let l=Number(s);Number.isSafeInteger(l)&&l<=chunkZOZI27AW_cjs.Jb&&(r.add(String(l)),l>n&&(n=l));}}for(let s of a.children)o(s);}};o(t.root);let i=chunkZOZI27AW_cjs.Mb(e);return i?chunkZOZI27AW_cjs.Ob(r,i,chunkZOZI27AW_cjs.Jb):String(n+1)}function Il(t,e){if(t.kind==="textValue")return t;let n=e.get(t.id);if(n!==void 0)return n;let r=false,o=[];for(let i of t.children){let a=Il(i,e);a!==i&&(r=true),o.push(a);}return r?{...t,children:o}:t}function Kd(t,e,n){let r=Il(t.root,e);if(r.kind==="textValue")return {ok:false,issues:[{code:"known-node-invariant",path:t.root.id,nodeId:t.root.id}]};let o=n===null?r:{...r,namespaceBindings:[...r.namespaceBindings,{prefix:n,namespaceUri:chunkZOZI27AW_cjs.ua}]};return chunkZOZI27AW_cjs.bb(t,t.root.id,o,{deferValidation:true})}function Nl(t,e,n){let r=new Map;for(let i of e){if(i.stampParagraph===null)continue;let a=r.get(i.commentsPartName);a||(a=new Map,r.set(i.commentsPartName,a)),a.set(i.stampParagraph.id,{paragraph:i.stampParagraph,paraId:i.paraId});}let o=t;for(let[i,a]of r){let s=o.parts.get(i);if(!s)return null;let l=chunkZOZI27AW_cjs.Eb(s.root),c=l??"w14",d=new Map;for(let m of a.values())d.set(m.paragraph.id,n(m.paragraph,m.paraId,c));let u=Kd(s,d,l===null?c:null);if(!u.ok)return null;o=chunkZOZI27AW_cjs.Ne(o,u.part);}return o}function vl(t,e,n){let r=t.root.children.map(o=>o.kind==="textValue"?o:e.get(o.id)??o);return chunkZOZI27AW_cjs.$a(t,t.root.id,[...r,...n],{deferValidation:true})}var wl="/word/comments.xml",Cl="/word/commentsExtended.xml",Co="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",Mo="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Xd=[Mo,"application/vnd.ms-word.commentsExtended+xml"],Ml="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Ao="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",et="http://schemas.microsoft.com/office/word/2012/wordml";function nn(t,e,n){for(let r of t.attributes)if(r.localName===n&&r.namespaceUri===e)return r.value}function Mt(t,e){return {kind:"genericExtension",namespaceUri:chunkZOZI27AW_cjs.pa,localName:t,prefix:"w",value:e}}function Ve(t,e,n,r,o,i,a,s=[]){return {id:t,kind:e,namespaceUri:n,localName:o,prefix:r,namespaceBindings:s,attributes:i,children:a}}function Al(t,e,n,r,o){let i=e===t.mainDocumentPart?[e]:[e,t.mainDocumentPart];for(let a of i)for(let s of chunkZOZI27AW_cjs.Pe(t,a)){if(s.type!==n)continue;let l=chunkZOZI27AW_cjs.E(a,s.rawTarget);if(!l.ok)continue;if(!t.parts.has(l.partName))return l.partName;let c=chunkZOZI27AW_cjs.Qe(t,l.partName);if(c!==null&&(typeof r=="string"?c===r:r.includes(c)))return l.partName}return o}function vo(t,e,n){let r=t.mainDocumentPart;for(let i of chunkZOZI27AW_cjs.Pe(t,r)){if(i.type!==e)continue;let a=chunkZOZI27AW_cjs.E(r,i.rawTarget);if(a.ok&&a.partName===n)return t}let o=chunkZOZI27AW_cjs.Ve(t,r);return chunkZOZI27AW_cjs.We(o,r,e,chunkZOZI27AW_cjs.Ji(r,n)).pkg}function Do(t,e){return Al(t,e,Ml,Co,wl)}function Dl(t,e){let n=chunkZOZI27AW_cjs.ce(t,e),r=chunkZOZI27AW_cjs.de(t,e,n).extended;return r!==null?r:Al(t,e,Ao,Xd,Cl)}function El(t){let e=new Set;for(let n of t.parts.values())for(let r of chunkZOZI27AW_cjs.Db(n.root))e.add(r);return e}function Yd(t,e){if(!t)return null;let n=null,r=o=>{if(!(n!==null||o.kind==="textValue")){if(o.kind==="comment"&&nn(o,chunkZOZI27AW_cjs.pa,"id")===e){for(let i=o.children.length-1;i>=0;i-=1){let a=o.children[i];if(a.kind!=="paragraph")continue;let s=nn(a,chunkZOZI27AW_cjs.ua,"paraId");s!==void 0&&chunkZOZI27AW_cjs.zb(s)&&(n=s.toUpperCase());return}return}for(let i of o.children)r(i);}};return r(t.root),n}function qd(t,e){if(!t)return null;let n=null,r=o=>{if(!(n!==null||o.kind==="textValue")){if(o.kind==="comment"&&nn(o,chunkZOZI27AW_cjs.pa,"id")===e){for(let i=o.children.length-1;i>=0;i-=1){let a=o.children[i];if(a.kind==="paragraph"){n=a;return}}return}for(let i of o.children)r(i);}};return r(t.root),n}function _l(t){let e=chunkZOZI27AW_cjs.Eb(t.root);if(e!==null)return {part:t,prefix:e};let n={...t.root,namespaceBindings:[...t.root.namespaceBindings,{prefix:"w14",namespaceUri:chunkZOZI27AW_cjs.ua}]},r=chunkZOZI27AW_cjs.bb(t,t.root.id,n,{deferValidation:true});return r.ok?{part:r.part,prefix:"w14"}:(chunkZOZI27AW_cjs.Za(t.root,n),{part:{...t,root:n},prefix:"w14"})}function Fl(t,e,n){return Ve(t.id,"paragraph",t.namespaceUri,t.prefix??"w",t.localName,[...t.attributes.filter(r=>!(r.namespaceUri===chunkZOZI27AW_cjs.ua&&r.localName==="paraId")),{kind:"genericExtension",namespaceUri:chunkZOZI27AW_cjs.ua,localName:"paraId",prefix:n,value:e}],t.children,t.namespaceBindings)}function Jd(t,e,n,r){let o=t.parts.get(e);if(!o)return t;let i=_l(o),a=chunkZOZI27AW_cjs.Xa(i.part,n);if(!a||a.kind!=="paragraph")return chunkZOZI27AW_cjs.Ne(t,i.part);let s=chunkZOZI27AW_cjs.bb(i.part,a.id,Fl(a,r,i.prefix),{deferValidation:true});return chunkZOZI27AW_cjs.Ne(t,s.ok?s.part:i.part)}function Qd(t,e,n,r){let o=`${wl}#comment-${t}`,i=n.text!==n.text.trim(),a=Ve(`${o}.t`,"text",chunkZOZI27AW_cjs.pa,"w","t",i?[{kind:"xmlSpace",namespaceUri:chunkZOZI27AW_cjs.qa,localName:"space",prefix:"xml",value:"preserve"}]:[],[{id:`${o}.tv`,kind:"textValue",value:n.text}]),s=Ve(`${o}.rPr`,"runProperties",chunkZOZI27AW_cjs.pa,"w","rPr",[],[Ve(`${o}.rStyle`,"generic",chunkZOZI27AW_cjs.pa,"w","rStyle",[Mt("val","CommentReference")],[])]),l=Ve(`${o}.r`,"run",chunkZOZI27AW_cjs.pa,"w","r",[],[s,a]),c=Ve(`${o}.pPr`,"paragraphProperties",chunkZOZI27AW_cjs.pa,"w","pPr",[],[Ve(`${o}.pStyle`,"generic",chunkZOZI27AW_cjs.pa,"w","pStyle",[Mt("val","CommentText")],[])]),d=Ve(`${o}.p`,"paragraph",chunkZOZI27AW_cjs.pa,"w","p",[{kind:"genericExtension",namespaceUri:chunkZOZI27AW_cjs.ua,localName:"paraId",prefix:r,value:e}],[c,l]);return Ve(o,"comment",chunkZOZI27AW_cjs.pa,"w","comment",[Mt("id",t),Mt("author",n.author),...n.initials===void 0?[]:[Mt("initials",n.initials)],...n.date===void 0?[]:[Mt("date",n.date)]],[d])}function Eo(t,e){let n=chunkZOZI27AW_cjs.Ma(e,{name:t,contentType:"application/xml"});return n.ok?n.part.root:null}function _o(t,e){for(let O of [Sl(e.author),Rl(e.text)])if(O)return {ok:false,reason:Io(O)};let n;if(e.date!==void 0){let O=Ro(e.date);if(!O.ok)return {ok:false,reason:Io(O.rejection)};n=O.value;}let r={...e,...n===void 0?{}:{date:n}},o=t.package,i=t.part.name,a=Do(o,i),s=Dl(o,i),l=o.parts.get(a),c=No(l,r.actorId),d=chunkZOZI27AW_cjs.Cb(`${a}#${c}`,El(o)),u=e.replyToCommentId===void 0?null:Yd(l,e.replyToCommentId),m=e.replyToCommentId!==void 0&&u===null?qd(l,e.replyToCommentId):null;if(e.replyToCommentId!==void 0&&u===null&&!m)return {ok:false,reason:"unknown-revision"};let f=m?chunkZOZI27AW_cjs.Cb(`${a}#parent-${e.replyToCommentId}`,new Set([...El(o),d])):null,h=u??f,b=e.anchor.endParagraphId??e.anchor.paragraphId,R=t.transact(O=>{let g=Qt(O);g.applyPackage(p=>{let P=p.parts.has(a)?p:(()=>{let M=Eo(a,`<w:comments xmlns:w="${chunkZOZI27AW_cjs.pa}"/>`);return M?chunkZOZI27AW_cjs.Xe(p,a,M,Co):null})();return P===null?p:vo(P,Ml,a)}),m&&f&&g.applyPackage(p=>Jd(p,a,m.id,f)),g.applyPackage(p=>{let P=p.parts.get(a);if(!P)return p;let M=_l(P),F=chunkZOZI27AW_cjs.ab(M.part,M.part.root.id,M.part.root.children.length,[Qd(c,d,r,M.prefix)],{deferValidation:true});return F.ok?chunkZOZI27AW_cjs.Ne(p,F.part):p}),h!==null&&(g.applyPackage(p=>{let P=p.parts.has(s)?p:(()=>{let M=Eo(s,`<w15:commentsEx xmlns:w15="${et}"/>`);return M?chunkZOZI27AW_cjs.Xe(p,s,M,Mo):null})();return P===null?p:vo(P,Ao,s)}),g.applyPackage(p=>{let P=p.parts.get(s);if(!P)return p;let F=[...Zd(P).has(h.toUpperCase())?[]:[wo(`${s}#ex-${h}`,h,void 0,false)],wo(`${s}#ex-${d}`,d,h,false)],$=chunkZOZI27AW_cjs.ab(P,P.root.id,P.root.children.length,F,{deferValidation:true});return $.ok?chunkZOZI27AW_cjs.Ne(p,$.part):p})),g.applyTo(i,{op:"insertCommentMarker",paragraphId:b,offset:e.anchor.end,commentId:c,marker:"reference"}),g.applyTo(i,{op:"insertCommentMarker",paragraphId:b,offset:e.anchor.end,commentId:c,marker:"end"}),g.applyTo(i,{op:"insertCommentMarker",paragraphId:e.anchor.paragraphId,offset:e.anchor.start,commentId:c,marker:"start"});},r.actorId===void 0?{}:{actorId:r.actorId});return R.ok?{ok:true,commentId:c,change:R.change}:{ok:false,reason:R.reason}}function To(t){for(let e=t.children.length-1;e>=0;e-=1){let n=t.children[e];if(n.kind==="paragraph")return n}return null}function Tl(t){let e=To(t);if(!e)return null;let n=nn(e,chunkZOZI27AW_cjs.ua,"paraId");return n!==void 0&&chunkZOZI27AW_cjs.zb(n)?n.toUpperCase():null}function Zd(t){let e=new Map;if(!t)return e;let n=r=>{if(r.kind!=="textValue"){if(r.namespaceUri===et&&r.localName==="commentEx"){let o=nn(r,et,"paraId");o!==void 0&&chunkZOZI27AW_cjs.zb(o)&&e.set(o.toUpperCase(),r);}for(let o of r.children)n(o);}};return n(t.root),e}function tn(t,e){return {kind:"genericExtension",namespaceUri:et,localName:t,prefix:"w15",value:e}}function em(t,e){return {id:t.id,kind:"generic",namespaceUri:t.namespaceUri,localName:t.localName,...t.prefix===void 0?{}:{prefix:t.prefix},namespaceBindings:t.namespaceBindings,attributes:e,children:t.children}}function tm(t,e,n){let r=[],o=false,i=false;for(let a of t.attributes){if(a.namespaceUri===et&&a.localName==="done"){o=true,r.push({kind:"genericExtension",namespaceUri:a.namespaceUri,localName:a.localName,...a.prefix===void 0?{}:{prefix:a.prefix},value:n?"1":"0"});continue}a.namespaceUri===et&&a.localName==="paraIdParent"&&(i=true),r.push(a);}return !i&&e!==void 0&&r.push(tn("paraIdParent",e)),o||r.push(tn("done",n?"1":"0")),em(t,r)}function wo(t,e,n,r){return {id:t,kind:"generic",namespaceUri:et,localName:"commentEx",prefix:"w15",namespaceBindings:[],attributes:[tn("paraId",e),...n===void 0?[]:[tn("paraIdParent",n)],tn("done",r?"1":"0")],children:[]}}function Fo(t,e,n){return nm(t,e,n,chunkZOZI27AW_cjs.be())}function nm(t,e,n,r){let o=t.package,i=t.part.name;if(chunkZOZI27AW_cjs.ce(o,i)===null)return {ok:false,reason:"unknown-comment"};let s=chunkZOZI27AW_cjs.li(o,e,{storyPartName:i},r);if(!s.ok)return {ok:false,reason:"unknown-comment"};let l=chunkZOZI27AW_cjs.ee(o,r);if(l.truncated||r.truncated)return {ok:false,reason:"unknown-comment"};let c=l.used,d=new Map,u=[];for(let b of s.ids){let R=s.records.get(b);if(!R)return {ok:false,reason:"unknown-comment"};if(!To(R.node))return {ok:false,reason:"unknown-comment"};let g=Tl(R.node),p=g??chunkZOZI27AW_cjs.Cb(`${R.partName}#done-${b}`,c);g===null&&c.add(p),d.set(b,p);}for(let b of s.ids){let R=s.records.get(b),O=To(R.node),g=d.get(b),p=Tl(R.node),P=s.parentCommentIdByChildId.get(b),M=s.parentParaIdByCommentId.get(b)??(P===void 0?void 0:d.get(P)),F=s.commentExByParaId.get(g);u.push({paraId:g,stampParagraph:p===null?O:null,commentsPartName:R.partName,parentParaId:M,existing:F?.node,existingParentParaId:F?.parentParaId,existingDone:F?.done??false});}if(u.length===0)return {ok:false,reason:"unknown-comment"};if(u.every(b=>b.existingDone===n))return {ok:true,changed:false,change:null};let m=s.extendedPartName??Cl,f=s.extendedPartName===null,h=t.transact(b=>{Qt(b).applyPackage(O=>{let g=Nl(O,u,Fl);if(g===null)return O;let p=g;if(!p.parts.has(m)){let w=Eo(m,`<w15:commentsEx xmlns:w15="${et}"/>`);if(!w)return O;let L=chunkZOZI27AW_cjs.Xe(p,m,w,Mo);p=f?vo(L,Ao,m):L;}let P=p.parts.get(m);if(!P)return O;let M=new Map,F=[];for(let w of u){let L=w.existingParentParaId??w.parentParaId;w.existing?M.set(w.existing.id,tm(w.existing,L,n)):F.push(wo(`${m}#done-${w.paraId}`,w.paraId,L,n));}let $=vl(P,M,F);return $.ok?chunkZOZI27AW_cjs.Ne(p,$.part):O});});return h.ok?{ok:true,changed:true,change:h.change}:{ok:false,reason:h.reason}}function rm(t,e){let n=Do(t,e);return t.parts.has(n)&&chunkZOZI27AW_cjs.Qe(t,n)===Co}function om(t,e){return Do(t,e)}function am(t,e){return Dl(t,e)}var Ll={kind:"body"};function im(t,e,n=Ll,r){let o=n.kind==="body"?null:t.resolveStory(n),i=o?.ok?o.store:t.bodyStore(),a=t.currentPackage(),s=i.checkpoint();return i.graftPackage(()=>t.currentPackage()),chunkZOZI27AW_cjs.Ra(t,()=>{let l=_o(i,e);return l.ok&&(i.restoreHistoryStacks(s),t.replacePackageShell(i.package),t.adoptGroupedPackageUnit(a,r),t.publishStoryWrite(l.change)),l},l=>chunkZOZI27AW_cjs.Sa(l),r)}function sm(t,e,n,r){let o=t.bodyStore(),i=t.currentPackage(),a=chunkZOZI27AW_cjs.sj(chunkZOZI27AW_cjs.fh(i),{op:"setCommentResolved"});if(a)return {ok:false,reason:a};let s=o.checkpoint();return o.graftPackage(()=>t.currentPackage()),chunkZOZI27AW_cjs.Ra(t,()=>{let l=Fo(o,e,n);return !l.ok||!l.changed||(o.restoreHistoryStacks(s),t.replacePackageShell(o.package),t.adoptGroupedPackageUnit(i,r),t.publishStoryWrite(l.change)),l},l=>l.ok&&l.changed,r)}function lm(t,e,n=Ll,r,o){if(e.length===0||chunkZOZI27AW_cjs.sj(chunkZOZI27AW_cjs.fh(t.currentPackage()),{op:"deleteComments"}))return false;let i=n.kind==="body"?t.bodyStore().part:t.partFor(n);if(!i)return false;let a={storyPartName:i.name,...r===void 0?{}:{noteId:r}},s=t.bodyStore(),l=t.currentPackage(),c=s.checkpoint();return s.graftPackage(()=>t.currentPackage()),chunkZOZI27AW_cjs.Ra(t,()=>{let d=false,u=false,m=s.transact(f=>{Qt(f).applyPackage(b=>{let R=b;for(let O of e){let g=O.parentCommentId===void 0?chunkZOZI27AW_cjs.ui(R,O.commentId,a):chunkZOZI27AW_cjs.vi(R,O.commentId,O.parentCommentId,a);if(g===null)return d=true,b;u||=g!==R,R=g;}return R});});return d||!m.ok||!u?false:(s.restoreHistoryStacks(c),t.installPackageSnapshot(s.package),t.adoptGroupedPackageUnit(l,o),t.publishStoryWrite(m.change),true)},d=>d,o)}var Ul=256*1024,$l=4096;function cm(t,e){for(let n=chunkZOZI27AW_cjs.Ya(t.part,e);n;n=chunkZOZI27AW_cjs.Ya(t.part,n.id)){if(n.kind==="paragraph")return false;if(n.kind.startsWith("revision"))return true}return false}function Lo(t,e,n){let r=e.payload,o=t.part.name,i=n??o;if(r){if(r.data.length>Ul)return {ok:false,reason:"payload-too-large",detail:"data"};if(r.label.length>$l)return {ok:false,reason:"payload-too-large",detail:"label"}}if(e.revision&&(e.replaceControlId!==void 0||e.replaceUntil!==void 0))return {ok:false,reason:"unsupported",detail:"tracked custom node wrap or rewrite"};let a=e.revision?{revision:e.revision}:{};if(e.replaceControlId!==void 0&&cm(t,e.replaceControlId))return {ok:false,reason:"unsupported",detail:"custom node inside a pending revision"};let s=new Set(chunkZOZI27AW_cjs.dc(t.part.root).map(f=>f.node.id)),l=e.replaceControlId===void 0?[]:Bl(t,o,e.replaceControlId),c=null,d,u=t.transact(f=>{if(e.replaceControlId!==void 0){f.apply({op:"removeContentControl",controlId:e.replaceControlId,keepContent:false});for(let R of l)f.applyPackage(O=>chunkZOZI27AW_cjs.Ri(O,R.partName,R.nodeId));}let h=e.replaceUntil;if(h!==void 0&&h<=e.offset){c="invalid-range",d="replaceUntil must be past offset";return}if(h!==void 0&&f.apply({op:"deleteText",paragraphId:e.paragraphId,start:e.offset,end:h}),!r){f.apply({op:"insertInlineContentControl",paragraphId:e.paragraphId,offset:e.offset,tag:e.tag,text:e.text,...e.alias===void 0?{}:{alias:e.alias},...e.lock===void 0?{}:{lock:e.lock},...a});return}let b=null;f.applyPackage(R=>{let O=chunkZOZI27AW_cjs.Mi(R,i,r.namespaceUri,r.rootLocalName);if(!O.part)return c="store-not-authored",d=`no customXml store could be created for ${r.namespaceUri}. The namespace must be free of control characters and quotes, the root name must be an XML name, and a store this document already carries for that namespace must use the same root name (${r.rootLocalName})`,R;if(b=chunkZOZI27AW_cjs.Wi(O.part,r.rootLocalName,r.nodeId),!b)return c="unaddressable-payload",d=`the node id ${JSON.stringify(r.nodeId)} or the namespace ${JSON.stringify(r.namespaceUri)} cannot be written into an XPath. Ids and root names must match [A-Za-z_][\\w.-]{0,127}; a namespace may not contain a quote, an angle bracket or an ampersand`,R;let g=chunkZOZI27AW_cjs.Qi(O.pkg,O.part.partName,{id:r.nodeId,label:r.label,data:r.data});return chunkZOZI27AW_cjs.Pi(g,O.part.partName,r.nodeId)?g:(c="store-not-authored",d="the payload node could not be written into the store",R)}),!(c!==null||!b)&&f.apply({op:"insertInlineContentControl",paragraphId:e.paragraphId,offset:e.offset,tag:e.tag,text:e.text,...e.alias===void 0?{}:{alias:e.alias},...e.lock===void 0?{}:{lock:e.lock},dataBinding:b,...a});});if(c!==null)return {ok:false,reason:c,...d===void 0?{}:{detail:d}};if(!u.ok)return {ok:false,reason:u.reason,...u.detail===void 0?{}:{detail:u.detail}};let m=dm(t,s);return {ok:true,change:u.change,...m===void 0?{}:{nodeId:m}}}function dm(t,e){for(let n of chunkZOZI27AW_cjs.dc(t.part.root))if(!e.has(n.node.id))return n.node.id}function Bl(t,e,n){let r=chunkZOZI27AW_cjs.dc(t.part.root).find(i=>i.node.id===n);if(!r)return [];let o=[];for(let i of chunkZOZI27AW_cjs.Ki(t.package,e)){let a=chunkZOZI27AW_cjs.Zi(r.node,i.itemId);a!==null&&o.push({partName:i.partName,nodeId:a});}return o}function Ho(t,e){let n=t.part.name,r=Bl(t,n,e),o=t.transact(i=>{i.apply({op:"removeContentControl",controlId:e,keepContent:false});for(let a of r)i.applyPackage(s=>chunkZOZI27AW_cjs.Ri(s,a.partName,a.nodeId));});return o.ok?{ok:true,change:o.change}:{ok:false,reason:o.reason,...o.detail===void 0?{}:{detail:o.detail}}}function mm(t,e,n){if(!t.parts.has(e)||n.length===0)return {ok:true,pkg:t,removed:[]};let r=t,o=[];for(let i of n){let a=chunkZOZI27AW_cjs.Li(r,e,i);if(!a)continue;let s=chunkZOZI27AW_cjs.Yi(r,a.itemId),l=chunkZOZI27AW_cjs.Si(r,a.partName,s);if(l.pkg===r&&chunkZOZI27AW_cjs.Oi(r,a.partName).some(c=>!s.has(c.id)))return {ok:false,reason:`the payload store for ${i} refused the sweep`};r=l.pkg,o.push(...l.removed);}return {ok:true,pkg:r,removed:o}}var Hl=new WeakMap;function um(t,e){let n=Hl.get(t);n||(n=new Map,Hl.set(t,n));let r=n.get(e);if(r)return r;let o=chunkZOZI27AW_cjs.Ki(t,e).map(i=>({itemId:i.itemId,nodes:new Map(chunkZOZI27AW_cjs.Oi(t,i.partName).map(a=>[a.id,a]))}));return n.set(e,o),o}function pm(t,e,n=e){let r=new Map,o=t.parts.get(e);if(!o)return r;let i=um(t,n);if(i.length===0)return r;for(let a of chunkZOZI27AW_cjs.dc(o.root))for(let s of i){let l=chunkZOZI27AW_cjs.Zi(a.node,s.itemId);if(l===null)continue;let c=s.nodes.get(l);if(c){r.set(a.node.id,{nodeId:l,label:c.label,data:c.data});break}}return r}function fm(t,e,n){let r=new Map,o=chunkZOZI27AW_cjs.Li(t,e,n);if(!o)return r;for(let i of chunkZOZI27AW_cjs.Oi(t,o.partName))r.set(i.id,{label:i.label,data:i.data});return r}var jl={kind:"body"};function Vl(t,e,n,r){let o=e.kind==="body"?null:t.resolveStory(e),i=o?.ok?o.store:t.bodyStore(),a=t.currentPackage(),s=i.checkpoint();return i.graftPackage(()=>t.currentPackage()),chunkZOZI27AW_cjs.Ra(t,()=>{let l=n(i);return l.ok&&(i.restoreHistoryStacks(s),t.replacePackageShell(i.package),t.adoptGroupedPackageUnit(a,r),t.publishStoryWrite(l.change)),l},l=>chunkZOZI27AW_cjs.Sa(l),r)}function gm(t,e,n=jl,r){return Vl(t,n,o=>Lo(o,e,t.bodyStore().part.name),r)}function hm(t,e,n=jl){return Vl(t,n,r=>Ho(r,e))}var ym=256,xm=2e3,zl=/[\p{L}\p{N}_]/u;function Uo(t){let e=t.toLowerCase();if(e.length===t.length)return e;let n="";for(let r=0;r<t.length;r+=1){let o=t[r],i=o.toLowerCase();n+=i.length===1?i:o;}return n}function Gl(t,e,n){let r=e>0?t[e-1]:void 0,o=n<t.length?t[n]:void 0;return !(r!==void 0&&zl.test(r)||o!==void 0&&zl.test(o))}function Wl(t){return typeof t=="string"&&t.length>0&&t.length<=256}function km(t,e,n,r={}){let o={matches:[],truncated:false};if(!Wl(e)||t.length===0||n<=0)return o;let i=r.matchCase===true,a=r.wholeWord===true,s=i?e:Uo(e),l=i?t:Uo(t),c=Math.max(0,r.from??0),d=Math.min(t.length,r.to??t.length),u=[],m=l.indexOf(s,c);for(;m>=0;){let f=m+s.length;if(f>d)return {matches:u,truncated:false};if(!a||Gl(t,m,f)){if(u.length>=n)return {matches:u,truncated:true};u.push({start:m,length:s.length});}m=l.indexOf(s,f);}return {matches:u,truncated:false}}var Pm=new Set(["plainText","richText","date","dropDownList","comboBox","docPartList"]),Om=96;function $o(t,e){return t.kind!=="textValue"&&t.namespaceUri===chunkZOZI27AW_cjs.pa&&t.localName===e}function bm(t){return t.kind==="textValue"&&t.value.trim()===""}function Sm(t){let e=[],n=(r,o,i)=>{if(r.kind==="textValue"||i>Om)return;if(chunkZOZI27AW_cjs.bg(r)){let s=chunkZOZI27AW_cjs.dg(r),l=chunkZOZI27AW_cjs.bc(r);if(s&&l&&s.children.every(bm)&&Pm.has(l.type)){e.push({control:r,content:s,kind:l.type,docPart:l.placeholderDocPart,inline:o});return}}let a=o||r.kind==="paragraph"||$o(r,"p");for(let s of r.children)n(s,a,i+1);};return n(t,false,0),e}function Rm(t){return chunkZOZI27AW_cjs.Fk(t,"rPr",{kind:"runProperties",children:[chunkZOZI27AW_cjs.Fk(t,"rStyle",{attributes:[["val","PlaceholderText"]]})]})}function Im(t){let e=t.find(r=>r.kind==="paragraph"||$o(r,"p"));if(!e||e.kind==="textValue")return null;let n=e.children.filter(r=>r.kind!=="paragraphProperties"&&!$o(r,"pPr"));return n.length>0?n:null}function Bo(t,e){let n=Sm(e.root);if(n.length===0)return e;let r=null,o=c=>{if(c!==void 0)return r??=chunkZOZI27AW_cjs.Qg(t),r.find(d=>d.name===c)},i=chunkZOZI27AW_cjs.Va(e,"paste"),a=new Set(chunkZOZI27AW_cjs.Db(e.root)),s={value:0},l=e;for(let[c,d]of n.entries()){let u=o(d.docPart),m=chunkZOZI27AW_cjs.Fb(e,d.control),f=null;if(u){let g=u.blocks.map((p,P)=>chunkZOZI27AW_cjs.Hb(chunkZOZI27AW_cjs.jg(p,i),a,chunkZOZI27AW_cjs.Nb(`${d.control.id}:placeholder:${c}:${P}`),s,m));f=d.inline?Im(g):g;}if(!f){let g=chunkZOZI27AW_cjs.Gk(i,chunkZOZI27AW_cjs.zk(d.kind),Rm(i));f=d.inline?[g]:[chunkZOZI27AW_cjs.Hb(chunkZOZI27AW_cjs.Fk(i,"p",{kind:"paragraph",children:[g]}),a,chunkZOZI27AW_cjs.Nb(`${d.control.id}:placeholder:${c}`),s,m)];}let h=chunkZOZI27AW_cjs.Hk(chunkZOZI27AW_cjs.cg(d.control),{showingPlaceholder:true},i),b={...d.content,children:f},R=d.control.children.map(g=>g.id===d.content.id?b:g.kind!=="textValue"&&g.localName==="sdtPr"?h:g),O=chunkZOZI27AW_cjs.$a(l,d.control.id,R);O.ok&&(l=O.part);}return l}function Kl(t,e,n){let r=e.filter(a=>a.node.localName==="tblGridChange"&&n.has(a.node.id));if(!r.length)return new Set;let o=new Map;for(let a of e){if(!["trPrChange","tcPrChange","tblPrExChange"].includes(a.node.localName))continue;let s=a.parent;for(;s&&s.kind!=="table";)s=chunkZOZI27AW_cjs.Ya(t,s.id);if(!s)continue;let l=o.get(s.id)??[];l.push(a.node.id),o.set(s.id,l);}let i=new Set;for(let a of r){let s=a.parent&&chunkZOZI27AW_cjs.Ya(t,a.parent.id),l=s&&o.get(s.id);l?.some(c=>n.has(c))&&l.some(c=>!n.has(c))&&i.add(a.node.id);}return i}function Nm(t,e,n,r,o){let i=r??t.root,a=i.kind==="textValue"?t:{...t,root:i},s=chunkZOZI27AW_cjs.sk(a),l=n===void 0?[...chunkZOZI27AW_cjs.Aj(a,chunkZOZI27AW_cjs.lk(a))]:[],c=l.length?[{op:"acceptAllRevisions",siteNodeIds:l,...r?{scopeRootId:r.id}:{}}]:[];if(n?.length===0||s.length===0)return {ops:c,result:{resolved:[],skipped:[...new Set(n??[])].map(S=>({key:S,reason:"unknown-revision"})),remaining:s.length}};let d=new Set(n??s.map(chunkZOZI27AW_cjs.Fj)),u=new Map(s.map(S=>[chunkZOZI27AW_cjs.Fj(S),S])),m=new Set;for(let S of d){let k=u.get(S);if(k)for(let E of chunkZOZI27AW_cjs.Ej(k))m.add(E);}let f=chunkZOZI27AW_cjs.lk(a),h=chunkZOZI27AW_cjs.Cj(i,f,m,e);for(let S of h.selected)m.add(S);for(let S of s){let k=chunkZOZI27AW_cjs.Ej(S);k.length&&k.every(E=>m.has(E))&&d.add(chunkZOZI27AW_cjs.Fj(S));}let b=chunkZOZI27AW_cjs.ok(i,f),R=new Map(f.map((S,k)=>[S.node.id,k])),O=f.map((S,k)=>k),g=S=>{for(;O[S]!==S;)O[S]=O[O[S]],S=O[S];return S},p=(S,k)=>{O[g(k)]=g(S);};for(let S of h.dependencies){let k=S.flatMap(E=>R.has(E)?[R.get(E)]:[]);for(let E of k)p(k[0],E);}let P=new Map;for(let S of s){let k=chunkZOZI27AW_cjs.Ej(S).flatMap(E=>{let N=R.get(E);return N===void 0?[]:[N]});for(let E of k)p(k[0],E);}let M=f.filter(S=>m.has(S.node.id)),F=new Set(chunkZOZI27AW_cjs.fk(t,M,e).keys()),$=new Map;for(let[S,k]of f.entries()){if(e==="reject"&&k.propertyChange&&k.parent&&m.has(k.node.id))for(let N of k.parent.children)chunkZOZI27AW_cjs.ck(k.node.localName,N)||P.set(N.id,S);let E=e==="accept"?k.node.localName==="del"||k.node.localName==="moveFrom":k.node.localName==="ins"||k.node.localName==="moveTo";if(k.paragraphMark&&k.parent&&E&&!b.has(k.node.id)&&m.has(k.node.id)){let N=chunkZOZI27AW_cjs.Ya(t,k.parent.id),W=N&&chunkZOZI27AW_cjs.Ya(t,N.id),Q=W&&chunkZOZI27AW_cjs.Ya(t,W.id);if(N&&W&&Q){let ce=$.get(Q.id);ce||(ce=chunkZOZI27AW_cjs.jk(Q.children,F),$.set(Q.id,ce)),ce.has(W.id)&&P.set(N.id,S);}}if(m.has(k.node.id)&&chunkZOZI27AW_cjs.gk(t,k,e)){let N=chunkZOZI27AW_cjs.gk(t,k,e);N&&!k.refused&&P.set(N.id,S);}}for(let[S,k]of chunkZOZI27AW_cjs.hk(t,M,e)){let E=chunkZOZI27AW_cjs.Xa(t,S),N=R.get(k[0]);if(!(E?.kind!=="tableCell"||N===void 0))for(let W of E.children)W.localName==="tcPr"&&P.set(W.id,N);}let w=chunkZOZI27AW_cjs.$j(a,[...R.keys(),...P.keys()]),L=(S,k)=>{if(!w.has(S.id))return;let E=R.get(S.id),N=P.get(S.id);E!==void 0&&N!==void 0&&p(N,E);let W=E??N;W!==void 0&&k!==void 0&&p(k,W);let Q=W??k;if(S.kind!=="textValue")for(let ce of S.children)L(ce,Q);};L(i);for(let S of chunkZOZI27AW_cjs.nk(i).values()){let k=S.wrappers.flatMap(E=>{let N=R.get(E.id);return N===void 0?[]:[N]});for(let E of k)p(k[0],E);}for(let S of f.some(k=>k.node.localName==="cellMerge")?chunkZOZI27AW_cjs.ik(a):[]){let k=S.flatMap(E=>{let N=R.get(E);return N===void 0?[]:[N]});for(let E of k)p(k[0],E);}let q=new Map;for(let[S,k]of f.entries()){let E=g(S),N=q.get(E)??[];N.push(k),q.set(E,N);}let U=new Map,J=new Map;for(let[S,k]of q){let E=k.find(W=>W.refused),N=e==="reject"&&k.some(W=>W.propertyChange&&chunkZOZI27AW_cjs.ek(W.node)===null);E||N?(U.set(S,"unsupported-revision"),J.set(S,E?.refusal??"unrecorded-properties")):k.some(W=>!m.has(W.node.id))&&U.set(S,"incomplete-group");}for(let S of s)if(S.readOnly)for(let k of chunkZOZI27AW_cjs.Ej(S)){let E=R.get(k);E!==void 0&&(U.set(g(E),"unsupported-revision"),J.has(g(E))||J.set(g(E),"read-only"));}let ee=f.filter((S,k)=>m.has(S.node.id)&&!U.has(g(k))),B=false,re=chunkZOZI27AW_cjs.fk(t,ee,e);for(let[S,k]of re){if(P.has(S))continue;let E=R.get(k[0]);E!==void 0&&(P.set(S,E),B=true);}if(B){L(i);for(let[S,k]of [...U]){let E=g(S);if(U.get(E)!=="unsupported-revision"){U.set(E,k);let N=J.get(S);N&&J.set(E,N);}}}let ue=[],le=[],A=new Set,_=new Set(chunkZOZI27AW_cjs.bk(t,f,e));for(let S of _){let k=chunkZOZI27AW_cjs.Ya(t,S);for(;k;){if(re.has(k.id)){_.delete(S);break}k=chunkZOZI27AW_cjs.Ya(t,k.id);}}for(let S of d){let k=u.get(S);if(!k){le.push({key:S,reason:"unknown-revision"});continue}let E={key:S,author:k.author,partName:t.name,revisionKind:k.revisionKind,...k.formattingKind?{formattingKind:k.formattingKind}:{}},N=chunkZOZI27AW_cjs.Ej(k),W,Q;for(let ce of N){let Fe=R.get(ce);if(W=Fe===void 0?"incomplete-group":U.get(g(Fe)),Q=Fe===void 0?void 0:J.get(g(Fe)),W)break}if(N.length||(W="unsupported-revision",Q="no-sites"),W)le.push({key:S,reason:W,revision:E,...W==="unsupported-revision"&&Q?{detail:Q}:{}});else {N.some(ce=>_.has(ce))?le.push({key:S,reason:"retained-structure",revision:E}):ue.push(E);for(let ce of N)_.has(ce)||A.add(ce);}}let V=Kl(t,f,A),te=new Set;for(let S of s){let k=chunkZOZI27AW_cjs.Ej(S);if(S.formattingKind!=="tblGridChange"&&k.length>1)for(let E of k)V.has(E)&&te.add(E);}let oe=[...A].filter(S=>!h.implicit.has(S)&&!te.has(S)),de=s.length-ue.length;if(de>0&&oe.length&&o?.countRemaining!==false){let S={...t,root:{...t.root}},k=chunkZOZI27AW_cjs.pk(S,e,void 0,{siteNodeIds:oe,...r?{scopeRootId:r.id}:{}});if(k.ok&&k.part){let E=r?chunkZOZI27AW_cjs.Xa(k.part,r.id):k.part.root;de=E&&E.kind!=="textValue"?chunkZOZI27AW_cjs.sk({...k.part,root:E}).length:0;}}return {ops:A.size?[...c,{op:e==="accept"?"acceptAllRevisions":"rejectAllRevisions",siteNodeIds:oe,...r?{scopeRootId:r.id}:{}}]:c,result:{resolved:ue,skipped:le,remaining:de}}}var Kx="Times New Roman",Xx="SimSun",jo="Hans",Yl=Object.freeze({minor:new Map([["Hans","SimSun"],["Hant","PMingLiU"],["Jpan","MS Mincho"],["Hang","Batang"]]),major:new Map([["Hans","SimHei"],["Hant","MingLiU"],["Jpan","MS Gothic"],["Hang","Dotum"]])}),ql=Object.freeze({minor:new Map([["Hans","DengXian"],["Hant","PMingLiU"],["Jpan","Yu Mincho"],["Hang","Malgun Gothic"]]),major:new Map([["Hans","DengXian Light"],["Hant","PMingLiU"],["Jpan","Yu Gothic Light"],["Hang","Malgun Gothic"]])}),Jl=new Set(["simsun","nsimsun","simsun-extb","simhei","kaiti","kaiti_gb2312","fangsong","fangsong_gb2312","microsoft yahei","microsoft yahei ui","microsoft yahei light","microsoft jhenghei","microsoft jhenghei ui","microsoft jhenghei light","mingliu","pmingliu","mingliu_hkscs","mingliu-extb","pmingliu-extb","dfkai-sb","dengxian","dengxian light","lisu","youyuan","stsong","stzhongsong","stfangsong","stkaiti","stheiti","stxihei","stxingkai","stliti","sthupo","stxinwei","pingfang sc","pingfang tc","pingfang hk","songti sc","songti tc","heiti sc","heiti tc","kaiti sc","kaiti tc","\u5B8B\u4F53","\u65B0\u5B8B\u4F53","\u9ED1\u4F53","\u6977\u4F53","\u4EFF\u5B8B","\u5FAE\u8F6F\u96C5\u9ED1","\u5FAE\u8EDF\u6B63\u9ED1\u9AD4","\u7B49\u7EBF","\u7D30\u660E\u9AD4","\u65B0\u7D30\u660E\u9AD4","\u6A19\u6977\u9AD4","\u534E\u6587\u6977\u4F53","\u534E\u6587\u5B8B\u4F53","\u534E\u6587\u9ED1\u4F53","\u534E\u6587\u4EFF\u5B8B","\u534E\u6587\u4E2D\u5B8B","\u534E\u6587\u7EC6\u9ED1"]),Ql=new Set(["arial","arial black","arial narrow","aptos","aptos display","book antiqua","calibri","calibri light","cambria","candara","century gothic","consolas","constantia","corbel","courier new","garamond","georgia","helvetica","helvetica neue","palatino linotype","segoe ui","tahoma","times new roman","trebuchet ms","verdana"]),Zl=new Set(["ms mincho","ms gothic","ms pmincho","ms pgothic","ms ui gothic","meiryo","meiryo ui","yu mincho","yu gothic","yu gothic ui","yu gothic light","yu gothic medium","hiragino mincho pron","hiragino kaku gothic pron","hiragino sans","\uFF4D\uFF53 \u660E\u671D","\uFF4D\uFF53 \u30B4\u30B7\u30C3\u30AF","\u30E1\u30A4\u30EA\u30AA","\u6E38\u660E\u671D","\u6E38\u30B4\u30B7\u30C3\u30AF","malgun gothic","batang","batangche","gulim","gulimche","dotum","dotumche","gungsuh","gungsuhche","apple sd gothic neo","\uB9D1\uC740 \uACE0\uB515","\uBC14\uD0D5","\uAD74\uB9BC","\uB3CB\uC6C0","\uAD81\uC11C"]),vm=new Set(["86","88"]),Em=new Set(["80","81","86","88"]);function Yx(t,e){let n=t?.trim().toLowerCase();return !n||n.startsWith("@")?false:Jl.has(n)?true:Ql.has(n)||Zl.has(n)?false:e?.includes(n)??false}function qx(t,e){let n=t?.trim().toLowerCase();return !n||n.startsWith("@")?false:Jl.has(n)||Zl.has(n)?true:Ql.has(n)?false:e?.includes(n)??false}function Xl(t){return t.kind!=="textValue"}function ec(t){return nc(t,vm)}function tc(t){return nc(t,Em)}function nc(t,e){if(!t)return [];let n=[];for(let r of t.children){if(!Xl(r)||r.localName!=="font")continue;let o=r.attributes.find(i=>i.localName==="name")?.value;if(!(!o||o.length>128)){for(let i of r.children){if(!Xl(i)||i.localName!=="charset")continue;let a=i.attributes.find(s=>s.localName==="val")?.value;a&&e.has(a.toLowerCase())&&n.push(o.trim().toLowerCase());}if(n.length>=256)break}}return Object.freeze(n)}function zo(t){return t.kind!=="textValue"}function er(t,e){for(let n of t.children)if(zo(n)&&n.localName===e)return n;return null}function Tm(t,e){let n=[t];for(;n.length>0;){let r=n.pop();if(zo(r)){if(r.localName===e)return r;for(let o=r.children.length-1;o>=0;o-=1)n.push(r.children[o]);}}return null}var sc=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function At(t,e,n){let r=er(t,e),i=(r?er(r,n):null)?.attributes.find(a=>a.localName==="typeface")?.value;return i!==void 0&&sc.test(i)?i:null}var rc=new WeakMap;function wm(t){let e=t?rc.get(t):void 0;if(e)return e;let n=t?Tm(t,"fontScheme"):null;if(!n)return Vo;let r=Object.freeze({major:At(n,"majorFont","latin"),minor:At(n,"minorFont","latin"),majorEastAsia:At(n,"majorFont","ea"),minorEastAsia:At(n,"minorFont","ea"),majorBidi:At(n,"majorFont","cs"),minorBidi:At(n,"minorFont","cs"),..._m(n)});return t&&rc.set(t,r),r}var oc=new WeakMap,Vo=Object.freeze({major:null,minor:null,majorEastAsia:null,minorEastAsia:null}),Cm=new WeakMap,ac=new WeakMap;function Go(t,e=null,n=null){let r=Mm(t,e);if(!n)return r;let o=ec(n),i=tc(n);if(i.length===0)return r;let a=ac.get(n);a||ac.set(n,a=new WeakMap);let s=a.get(r);if(s)return s;let l=Object.freeze({...r,...o.length>0?{chineseFontTableFaces:o}:{},eastAsianFontTableFaces:i});return a.set(r,l),l}function Mm(t,e){let n=t?wm(t):Vo,r=e?er(e,"themeFontLang"):null,o=Cm;r&&e&&(o=oc.get(e)??new WeakMap,oc.set(e,o));let i=o.get(n);if(i)return i;let a=R=>r?.attributes.find(O=>O.localName===R)?.value,s=ic(a("val")),l=ic(a("bidi")),c=a("eastAsia"),d=Wo(c),u=(R,O,g)=>O&&(R?n.majorSupplemental:n.minorSupplemental)?.[O]||g||null,m=n===Vo?ql:Yl,f=d??jo,h=(R,O)=>(d?u(R,d,O):O||u(R,jo,null))||(R?m.major:m.minor).get(f)||null,b=Object.freeze({major:u(true,s,n.major),minor:u(false,s,n.minor),majorEastAsia:h(true,n.majorEastAsia),minorEastAsia:h(false,n.minorEastAsia),majorBidi:u(true,l,n.majorBidi),minorBidi:u(false,l,n.minorBidi),...c===void 0?{majorSupplemental:n.majorSupplemental,minorSupplemental:n.minorSupplemental}:{}});return o.set(n,b),b}var Am=new Map([["minorAscii",t=>t.minor],["minorHAnsi",t=>t.minor],["majorAscii",t=>t.major],["majorHAnsi",t=>t.major],["minorEastAsia",t=>t.minorEastAsia??null],["majorEastAsia",t=>t.majorEastAsia??null],["minorBidi",t=>t.minorBidi??null],["majorBidi",t=>t.majorBidi??null]]);function Zx(t,e,n){if(t===void 0)return null;let r=Am.get(t)?.(e)??null;if(r!==null)return r;let o=Wo(n);return o?(t==="majorEastAsia"?e.majorSupplemental:t==="minorEastAsia"?e.minorSupplemental:void 0)?.[o]??null:null}function Wo(t){if(!t||t.length>85)return null;let e=t.toLowerCase().split("-");return e[0]==="ja"?"Jpan":e[0]==="ko"?"Hang":e[0]!=="zh"?null:e.includes("hant")?"Hant":e.includes("hans")?"Hans":e.some(n=>["tw","hk","mo"].includes(n))?"Hant":"Hans"}var Dm=new Map([["ar","Arab"],["fa","Arab"],["ur","Arab"],["ps","Arab"],["he","Hebr"],["yi","Hebr"],["dv","Thaa"],["syr","Syrc"]]);function ic(t){if(!t||t.length>85)return null;let e=t.toLowerCase().split("-");return e[1]&&/^[a-z]{4}$/.test(e[1])?e[1][0].toUpperCase()+e[1].slice(1):Wo(t)??Dm.get(e[0])??null}function _m(t){let e={};for(let[n,r]of [["majorFont","majorSupplemental"],["minorFont","minorSupplemental"]]){let o=Object.create(null);for(let i of er(t,n)?.children??[]){if(!zo(i)||i.localName!=="font")continue;let a=i.attributes.find(l=>l.localName==="script")?.value,s=i.attributes.find(l=>l.localName==="typeface")?.value;a&&/^[A-Z][a-z]{3}$/.test(a)&&s&&sc.test(s)&&(o[a]=s);}Object.keys(o).length&&(e[r]=Object.freeze(o));}return e}var tt=Object.freeze({styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",numbering:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",settings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",fontTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",coreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",extendedProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"});function Ko(t,e,n,r){let o=(t.relationships.get(e)??[]).find(i=>i.type===n);if(o){let i=chunkZOZI27AW_cjs.N(o);if(i.mode==="Internal"&&i.target.ok){let a=t.parts.get(i.target.partName);if(a)return a}}return t.parts.get(r)}function dk(t){let e=chunkZOZI27AW_cjs.Je(t);if(!e.ok)return {ok:false,reason:e.reason,...e.detail?{detail:e.detail}:{}};let n=e.package.parts.get(e.package.mainDocumentPart);if(!n)return {ok:false,reason:"no-main-document-tree",detail:e.package.mainDocumentPart};let r=new en(e.package,Bo(e.package,chunkZOZI27AW_cjs.Ib(n)));return {ok:true,view:Fm(r)}}function Fm(t){let e=()=>t.currentPackage(),n=()=>t.bodyStore().part,r=(c,d)=>Ko(e(),e().mainDocumentPart,c,d)?.root??null,o=Object.freeze(Go(null)),i=null,a=chunkZOZI27AW_cjs.Bi,s=null;return Object.freeze({part:n,currentPackage:e,packageRevision:()=>t.packageRevision,stylesRoot:()=>r(tt.styles,"/word/styles.xml"),numberingRoot:()=>r(tt.numbering,"/word/numbering.xml"),settingsRoot:()=>r(tt.settings,"/word/settings.xml"),documentThemeFonts(){let c=e();return i!==c&&(o=Object.freeze(Go(r(tt.theme,"/word/theme/theme1.xml"),r(tt.settings,"/word/settings.xml"),r(tt.fontTable,"/word/fontTable.xml"))),i=c),o},documentProperties(){let c=e();if(s!==c){let d=Ko(c,"/",tt.coreProperties,"/docProps/core.xml"),u=Ko(c,"/",tt.extendedProperties,"/docProps/app.xml");a=chunkZOZI27AW_cjs.Ci(d?.root??null,u?.root??null),s=c;}return a},headerFooterPartsBySection:()=>chunkZOZI27AW_cjs.nf(e()),headerFooterResolutionBySection:()=>chunkZOZI27AW_cjs.mf(e()),relationshipTarget:c=>chunkZOZI27AW_cjs.Vg(e(),n().name,c)})}
|
|
2
|
-
exports.$=im;exports.A=Vr;exports.Aa=Fm;exports.B=bc;exports.C=Di;exports.D=Rc;exports.E=Gt;exports.F=Ln;exports.G=Hn;exports.H=Ui;exports.I=Lu;exports.J=Fi;exports.K=Wc;exports.L=lo;exports.M=vs;exports.N=co;exports.O=ft;exports.P=Ol;exports.Q=en;exports.R=Sl;exports.S=Rl;exports.T=Ro;exports.U=rh;exports.V=No;exports.W=_o;exports.X=Fo;exports.Y=rm;exports.Z=om;exports._=am;exports.a=lc;exports.aa=sm;exports.b=Ei;exports.ba=lm;exports.c=Cn;exports.ca=Ul;exports.d=mt;exports.da=$l;exports.e=Mn;exports.ea=Lo;exports.f=An;exports.fa=Ho;exports.g=ge;exports.ga=mm;exports.h=uc;exports.ha=pm;exports.i=ut;exports.ia=fm;exports.j=Vt;exports.ja=gm;exports.k=Dn;exports.ka=hm;exports.l=zt;exports.la=ym;exports.m=_n;exports.ma=xm;exports.n=_r;exports.na=Uo;exports.o=Fr;exports.oa=Gl;exports.p=Lr;exports.pa=Wl;exports.q=hc;exports.qa=km;exports.r=yc;exports.ra=Bo;exports.s=Ur;exports.sa=Nm;exports.t=wi;exports.ta=Kx;exports.u=xc;exports.ua=Xx;exports.v=Hr;exports.va=Yx;exports.w=kc;exports.wa=qx;exports.x=$r;exports.xa=Go;exports.y=Br;exports.ya=Zx;exports.z=jr;exports.za=dk;
|
package/dist/chunk-6NVZNB7O.cjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkFDSL5OJU_cjs=require('./chunk-FDSL5OJU.cjs'),chunkZOZI27AW_cjs=require('./chunk-ZOZI27AW.cjs');var cr=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,i=o%t;if(n!=="towardZero"){let u=i*2n;(u>t||u===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let c=r?-a:a,s=Number(c);if(!Number.isSafeInteger(s))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return s},et=(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");if(e===0||n===0)return chunkFDSL5OJU_cjs.n(0);let o=e*n;if(Number.isSafeInteger(o)){let a=Math.abs(o),i=a%t,c=(a-i)/t;return r!=="towardZero"&&(i>t-i||i===t-i&&(r==="halfAwayFromZero"||r==="halfToEven"&&c%2!==0))&&(c+=1),chunkFDSL5OJU_cjs.n(c===0?0:o<0?-c:c)}return chunkFDSL5OJU_cjs.n(cr(BigInt(e)*BigInt(n),BigInt(t),r))},Yt=(e,t,n,r)=>{if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("font size must be a positive integer number of half points");if(t>Math.floor(Number.MAX_SAFE_INTEGER/n))throw new RangeError("font size and fixed-point scale product exceeds the safe integer range");let o=t*n,a=e*2;return i=>et(i,a,o,r)},$t=(e,t,n)=>{let r=t*n,o=e*2;return a=>a*r/o};var lr=4096,qt=e=>typeof e=="number"?String(e):JSON.stringify(e)??typeof e,we=class{constructor(t){this.onRestart=t;}onRestart;#e=new Map;keyOf(t,n){let r=chunkFDSL5OJU_cjs.t(n),o=this.#e.get(r);o===void 0&&(this.#e.size>=lr&&(this.#e.clear(),this.onRestart()),o=this.#e.size,this.#e.set(r,o));let a=`${o}\0${qt(t.fontSizeHalfPoints)}\0${qt(t.bidiLevel)}\0`,i=t.context;return !i||i.before===""&&i.after===""?`${a}-${t.text}`:`${a}c${i.before.length},${i.after.length}\0${i.before}${i.after}${t.text}`}clear(){this.#e.clear();}};function te(e){try{let t=new URL(e);return t.username!==""||t.password!==""||t.search!==""||t.hash!==""?`${t.protocol}//${t.host}${t.pathname}\u2026`:e}catch{let t=e.search(/[?#]/);return t===-1?e:`${e.slice(0,t)}\u2026`}}function Zt(e){return e.replace(/[a-z][a-z0-9+.-]*:\/\/[^\s"')]+/gi,t=>te(t))}function pr(e){if(typeof e!="string"&&!(e instanceof URL))throw new TypeError(`setHarfBuzzWasmUrl: expected a string or URL, received ${typeof e}`);if(typeof e=="string"&&e.trim()==="")throw new TypeError("setHarfBuzzWasmUrl: expected a non-empty URL");throw new Error("setHarfBuzzWasmUrl is not supported by the CommonJS build, which loads the shaper from node_modules and finds its binary on disk. Import the ESM build instead.");}function Jt(e){return e instanceof Error&&/process\.getBuiltinModule/.test(e.message)}function Qt(e){return `the text shaper cannot start on this Node version: the ESM build reaches Node builtins through \`process.getBuiltinModule\`, added in Node 20.16.0 and 22.3.0. Upgrade Node; \`setHarfBuzzWasmUrl\` does not apply here. (${Zt(e instanceof Error?e.message:String(e))})`}function en(e){let t=Zt(e instanceof Error?e.message:String(e));return `the HarfBuzz WASM binary could not be loaded from ${"its bundled location"}. If this bundler does not emit \`new URL(..., import.meta.url)\` assets (esbuild, Bun, and library builds that inline dynamic imports), serve \`@docx-editor.dev/core/harfbuzz.wasm\` yourself, point \`setHarfBuzzWasmUrl\` from '@docx-editor.dev/core/layout' at it before creating an editor, and reload the page. (${t})`}function tn(e,t){let n=`expected HarfBuzz ${e}, loaded ${t}`;return `${n}. The bundled binary does not match this build of the engine.`}var Q=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),ue=null,ce=null;function nt(){return ue?Promise.resolve():ce||(ce=import('harfbuzzjs').then(e=>{let t=e.versionString();if(t!==Q.version)throw new B("shapingLibraryMismatch",{diagnostic:tn(Q.version,t)});ue=e;}).catch(e=>{throw ce=null,e instanceof B?e:Jt(e)?new B("unsupportedRuntime",{diagnostic:Qt(e),cause:e}):new B("wasmUnavailable",{diagnostic:en(e),cause:e})}),ce)}function fr(){return ue!==null}function yr(){if(!ue)throw new B("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return ue}var B=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;}},mr=16*1024*1024,hr=1e6,gr=1e6,Sr=1e6,br=4,xr=512,Rr=1024*1024,Fr=16*1024*1024,Cr=32*1024*1024,vr=64*1024*1024,Er=64*1024*1024,Lr=1e6,Br=1e6,Tr=1e6,Or=64,wr=4096,Ir=4*1024*1024,Ar=64*1024*1024,Pr=64*1024*1024,_r=256*1024*1024,Mr=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),nn=["cmap","head","hhea","hmtx","maxp"],zr=(e,t)=>e[t]<<8|e[t+1],kr=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Nr=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?kr(e,12+t*4):0,Dr=(e,t)=>{let n=Nr(e,t),r=zr(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let i=n+12+a*16;o.add(String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]));}return o},Hr=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),Ur=(e,t)=>{let n=chunkFDSL5OJU_cjs.l(e,t);if(!n.valid)return n;let r=Dr(e,t);for(let o of nn)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},rt=Ur,N=(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},Gr=(e,t,n)=>{if(t.length===0)return [];let r=[],o=0;for(;o<t.length;){let a=t[o].cluster,i=o+1,c=t[o].advanceX;for(;i<t.length&&t[i].cluster===a;)c+=t[i].advanceX,i+=1;let s=chunkFDSL5OJU_cjs.n(c);r.push({textStart:a,textEnd:n==="rtl"?t[o-1]?.cluster??e.length:t[i]?.cluster??e.length,glyphStart:o,glyphEnd:i,advance:s,caretEdges:Object.freeze([chunkFDSL5OJU_cjs.n(0),s]),fontSpan:0}),o=i;}return r},U=64,K=8,X=8,rn=32,ot=U+2*K,Wr=U+K+X,Kr=U+K+2*X,Xr=U+K+X,on=U+8*K,an=U+8*X+K,jr=U+6*X+K,Vr=U+3*X+2*K,Yr=U+3*X,de=e=>U+e.length*Uint16Array.BYTES_PER_ELEMENT,at=e=>Xr+de(e),le=e=>rn+e*K,$r=(e,t)=>ot+de(e)+Wr+at(t),qr=e=>on+de(e)+le(e.length)+e.length*an,Zr=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return on+de(e.text)+le(e.glyphs.length)+e.glyphs.length*an+le(e.clusters.length)+e.clusters.length*jr+e.clusters.reduce((n,r)=>n+le(r.caretEdges.length),0)+le(e.fontSpans.length)+e.fontSpans.length*Vr+(e.exactAdvancesX===void 0?0:rn+e.exactAdvancesX.length*X)+Yr+[...t].reduce((n,r)=>n+at(r.path),0)},Jr=(e,t)=>ot+de(e)+Kr+t,tt=class{#e;#p;#f;#y;#m;#R;#h;#l=0;#F;#g;#S;#c;#b;#u;#t;#o=new Map;#i=new Map;#s=new Map;#n=new Map;#C=new we(()=>{this.#n.clear(),this.#r=0,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0}));});#a=0;#r=0;#x=0;#d;constructor(t,n){chunkFDSL5OJU_cjs.p(this),this.#e=t,this.#p=N(n.maxFontBytes??mr,"maximum font bytes",Er),this.#f=N(n.maxInputUtf16??hr,"maximum input UTF-16 code units",Lr),this.#y=N(n.maxCodepoints??gr,"maximum input code points",Br),this.#m=N(n.maxGlyphs??Sr,"maximum shaped glyphs",Tr),this.#h=N(n.maxCachedFontBytes??64*1024*1024,"maximum cached font bytes",64*1024*1024),this.#R=N(n.maxCachedFaces??br,"maximum cached faces",Or),this.#F=N(n.maxCachedShapes??xr,"maximum cached shape results",wr),this.#g=N(n.maxOutlineBytes??Rr,"maximum outline bytes",Ir),this.#S=N(n.maxCachedOutlineBytes??Fr,"maximum cached outline bytes",Ar),this.#c=N(n.maxShapedRunBytes??Cr,"maximum shaped run bytes",Pr),this.#b=N(n.maxCachedShapeBytes??vr,"maximum cached shape bytes",_r),this.#u=n.instrumentation?.onFaceCacheEvent,this.#t=n.instrumentation,this.#d=new this.#e.Buffer;}dispose(){this.#o.clear(),this.#l=0,this.#i.clear(),this.#s.clear(),this.#n.clear(),this.#C.clear(),this.#a=0,this.#r=0,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#d=void 0;}#E(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#u?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=chunkFDSL5OJU_cjs.j(t);for(let l of nn)if(!o.has(l))throw new B("malformedFont",{diagnostic:`missing required ${l} table`});this.#t?.onByteCopy?.();let a=new this.#e.Blob(Hr(n)),i=new this.#e.Face(a,t.faceIndex),c=new this.#e.Font(i),s=c.hExtents();if(!Number.isSafeInteger(i.upem)||i.upem<=0||!Number.isSafeInteger(s.ascender)||!Number.isSafeInteger(s.descender)||!Number.isSafeInteger(s.lineGap))throw new B("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});c.setScale(i.upem,i.upem);let u={identity:t.identity,blob:a,face:i,font:c,unitsPerEm:i.upem,byteLength:n.byteLength};if(n.byteLength<=this.#h){for(;this.#o.size>=this.#R||this.#l+n.byteLength>this.#h;){let l=this.#o.keys().next().value;if(l===void 0)break;this.#l-=this.#o.get(l).byteLength,this.#o.delete(l),this.#u?.(Object.freeze({kind:"evicted",identity:l}));}this.#o.set(t.identity,u),this.#l+=n.byteLength;}return this.#u?.(Object.freeze({kind:"created",identity:t.identity})),u}#L(t,n){let r=this.#i.get(t.identity)?.get(n);if(r)return this.#s.delete(r),this.#s.set(r,void 0),this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#a})),r.outline;this.#t?.onOutlinePathCall?.();let o=t.font.glyphToPath(n),a=at(o);if(a>this.#g)throw new B("outlineOverLimit",{limit:this.#g,actual:a});let i=Object.freeze({path:o,unitsPerEm:t.unitsPerEm}),c=$r(t.identity,o)+3*ot+2*X;if(c>this.#S)return this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#a})),i;for(;this.#a+c>this.#S;){let l=this.#s.keys().next().value;if(l===void 0)break;this.#s.delete(l);let d=this.#i.get(l.identity);d.delete(l.glyphId),d.size===0&&this.#i.delete(l.identity),this.#a-=l.bytes,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#a}));}let s=this.#i.get(t.identity);s||this.#i.set(t.identity,s=new Map);let u={outline:i,bytes:c,identity:t.identity,glyphId:n};return s.set(n,u),this.#s.set(u,void 0),this.#a+=c,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#a})),i}#v(t){if(t.length>this.#f)throw new B("textOverLimit",{limit:this.#f,actual:t.length});let n=0;for(let r=0;r<t.length;){let o=t.codePointAt(r);if(r+=o>65535?2:1,n+=1,n>this.#y)throw new B("codepointsOverLimit",{limit:this.#y,actual:n})}}shape(t){if(!this.#d)throw new B("disposed");if(chunkFDSL5OJU_cjs.k(t.environment.font),t.environment.font.byteLength>this.#p)throw new B("fontOverLimit",{limit:this.#p,actual:t.environment.font.byteLength});this.#v(t.text);let n=qr(t.text);if(n>this.#c)throw new B("shapedRunOverLimit",{limit:this.#c,actual:n});let r=chunkFDSL5OJU_cjs.r(t.environment),o=this.#C.keyOf(t,r),a=this.#n.get(o);if(a)return this.#x-a.stamp>=Math.max(1,this.#n.size>>1)&&(this.#n.delete(o),this.#n.set(o,a),a.stamp=++this.#x),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r.shapingLibrary.name!==Q.name||r.shapingLibrary.version!==Q.version)throw new B("shapingLibraryMismatch");if(r.normalization!=="none")throw new B("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r.direction==="rtl"))throw new B("invalidBidiLevel");if(Object.keys(r.variationAxes).length>0)throw new B("unsupportedVariationAxes");if(r.fallbackOrder.length>0)throw new B("unsupportedFallback");let i=chunkFDSL5OJU_cjs.i(r.font),c=chunkFDSL5OJU_cjs.j(r.font);if([...Mr].some(m=>c.has(m))&&!c.has("glyf")&&!c.has("CFF "))throw new B("unsupportedColorFont");let s=t.text;this.#v(s);let u=t.context?.before??"",l=t.context?.after??"",d=chunkFDSL5OJU_cjs.o,g=Math.max(String(u).length,String(l).length);if(typeof u!="string"||typeof l!="string"||g>d)throw new B("textOverLimit",{limit:d,actual:g});try{let m=this.#E(r.font,i),{face:S,font:x}=m,f=this.#d;f.reset(),u||l?f.addText(u+s+l,u.length,s.length):f.addText(s),f.setDirection(r.direction==="rtl"?this.#e.Direction.RTL:this.#e.Direction.LTR),f.setScript(r.script),f.setLanguage(r.language),f.setClusterLevel(this.#e.ClusterLevel.MONOTONE_CHARACTERS);let h=Object.entries(r.features).map(([I,z])=>new this.#e.Feature(I,z));this.#t?.onShapeCall?.(),this.#e.shape(x,f,h);let b=f.getLength();if(b>this.#m)throw new B("glyphOverLimit",{limit:this.#m,actual:b});let R=f.getGlyphInfos(),F=f.getGlyphPositions(),v=Yt(S.upem,t.fontSizeHalfPoints,r.fixedPointScale,r.roundingMode),w=$t(S.upem,t.fontSizeHalfPoints,r.fixedPointScale),T=[],y=chunkFDSL5OJU_cjs.n(0),p=chunkFDSL5OJU_cjs.n(0),C=new Map,E=R.map((I,z)=>{let W=F[z];T.push(w(W?.xAdvance??0));let bt=v(W?.xAdvance??0),xt=v(W?.yAdvance??0),sr={id:I.codepoint,cluster:I.cluster-u.length,originX:y,originY:p,advanceX:bt,advanceY:xt,offsetX:v(W?.xOffset??0),offsetY:v(W?.yOffset??0),outline:C.get(I.codepoint)??(()=>{let Rt=this.#L(m,I.codepoint);return C.set(I.codepoint,Rt),Rt})()};return y=chunkFDSL5OJU_cjs.n(y+bt),p=chunkFDSL5OJU_cjs.n(p+xt),sr}),L=x.hExtents(),O=chunkFDSL5OJU_cjs.u({text:s,direction:r.direction,bidiLevel:t.bidiLevel,glyphs:E,exactAdvancesX:T,clusters:Gr(s,E,r.direction),fontSpans:E.length===0?[]:[{glyphStart:0,glyphEnd:E.length,font:r.font,fallbackIndex:null}],metrics:{ascent:v(L.ascender),descent:v(-L.descender),lineGap:v(L.lineGap)}},r),M=Zr(O);if(M>this.#c)throw new B("shapedRunOverLimit",{limit:this.#c,actual:M});let A=Jr(o,M);if(A>this.#b)return this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),O;for(;this.#n.size>=this.#F||this.#r+A>this.#b;){let I=this.#n.keys().next().value;if(I===void 0)break;let z=this.#n.get(I);this.#n.delete(I),this.#r-=z.bytes,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o,{run:O,bytes:A,stamp:++this.#x}),this.#r+=A,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),O}catch(m){throw m instanceof B?m:new B("malformedFont",{diagnostic:m instanceof Error?m.message:"HarfBuzz shaping failed"})}}},it=(e={})=>new tt(yr(),e);var st=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:32,maxCachedFontBytes:64*1024*1024,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024}),Ja=Object.freeze({...st,maxCachedShapes:4096});function sn(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:${chunkZOZI27AW_cjs.f(new TextEncoder().encode(JSON.stringify(n)))}`}function cn(e,t=st){let n=e?.maxFontBytes??t.maxFontBytes;if(!Number.isSafeInteger(n)||n<=0||n>chunkFDSL5OJU_cjs.a)throw new RangeError(`Font shaping byte ceiling must be between 1 and ${chunkFDSL5OJU_cjs.a}`);return n===t.maxFontBytes?t:Object.freeze({...t,maxFontBytes:n})}function ln(e,t,n=false){let r=false,o=Object.freeze({shape(a){if(r)throw new B("disposed");let i=a.environment.font;if(chunkFDSL5OJU_cjs.k(i),i.byteLength>t.maxFontBytes)throw new B("fontOverLimit",{limit:t.maxFontBytes,actual:i.byteLength});return e.shape(a)},dispose(){r||(r=true,n&&e.dispose?.());}});return chunkFDSL5OJU_cjs.q(e)?chunkFDSL5OJU_cjs.p(o):o}var Qr=Object.freeze({}),un=chunkFDSL5OJU_cjs.b,eo="16.0.0",to="none",no=1e3,ro="halfToEven",fn="cluster-edges-only",oo="Latn",ao=new Uint8Array(0);var j=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function io(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a=e.substitutions,i=e.defaultFont,c=e.language;if(!Number.isSafeInteger(r)||r<=0||r>chunkFDSL5OJU_cjs.a)throw new j(`Font byte ceiling must not exceed the engine hard maximum of ${chunkFDSL5OJU_cjs.a}`);let s=o.length,u=a?.length??0;if(s===0||s>chunkFDSL5OJU_cjs.b)throw new j(`Font source count must be between 1 and ${chunkFDSL5OJU_cjs.b}`);if(u>un)throw new j(`Font substitution count must not exceed ${un}`);let l=0,d=[];for(let S=0;S<s;S+=1){let x=o[S],f=x.request,h=x.availability,b=x.id,R=x.hash,F=x.faceIndex,v=h==="forbidden",w=v?ao:x.bytes;if(!v){if(typeof b!="string"||b.length===0)throw new TypeError("Resolved font id must not be empty");let T;try{T=chunkFDSL5OJU_cjs.e(w);}catch{throw new j(`Font source ${b} must provide genuine bytes`)}if(T>r)throw new j(`Font source ${b} exceeds the per-font byte ceiling`);if(l+=T,l>chunkFDSL5OJU_cjs.c)throw new j(`Font sources exceed the aggregate byte ceiling of ${chunkFDSL5OJU_cjs.c}`)}d.push(t&&chunkFDSL5OJU_cjs.g(x)!==void 0?x:Object.freeze({request:Object.freeze({family:f.family,weight:f.weight,style:f.style}),id:b,bytes:w,hash:R,faceIndex:F,...h?{availability:h}:{}}));}let g;if(a){g=[];for(let S=0;S<u;S+=1){let x=a[S],f=x.from,h=x.to,b=x.lineMetrics;g.push(Object.freeze({from:Object.freeze({family:f.family,weight:f.weight,style:f.style}),to:Object.freeze({family:h.family,weight:h.weight,style:h.style}),...b?{lineMetrics:Object.freeze({heightEm:b.heightEm,baselineEm:b.baselineEm})}:{}}));}}let m={epoch:n,maxFontBytes:r,sources:Object.freeze(d),substitutions:g?Object.freeze(g):void 0,defaultFont:Object.freeze({family:i.family,sizeHalfPoints:i.sizeHalfPoints}),language:c};return Object.freeze(m)}function dn(e,t){let n=e.map((o,a)=>({value:o,index:a,key:chunkFDSL5OJU_cjs.h(t(o))})),r=new Set;for(let o of n){if(r.has(o.key))return e;r.add(o.key);}return n.sort((o,a)=>o.key<a.key?-1:o.key>a.key?1:o.index-a.index).map(({value:o})=>o)}function so(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function pn(e,t){let n=s=>({family:s.family,weight:s.weight,style:s.style}),r=t?e.sources:dn(e.sources,s=>s.request),o=e.substitutions??[],a=t?o:dn(o,s=>s.from),i={sources:r.map(s=>{let u=s.availability??"available",l={request:n(s.request),availability:u};if(u==="forbidden")return {...l,...t?{id:s.id,faceIndex:s.faceIndex,declaredHash:s.hash}:{}};let d=chunkFDSL5OJU_cjs.g(s);if(d==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...l,...t?{id:s.id}:{},faceIndex:s.faceIndex,declaredHash:s.hash,actualHash:d,byteLength:s.bytes.byteLength}}),substitutions:a.map(s=>({from:n(s.from),to:n(s.to),lineMetrics:s.lineMetrics?{heightEm:s.lineMetrics.heightEm,baselineEm:s.lineMetrics.baselineEm}:null})),defaultFont:so(e.defaultFont,t),language:e.language||"en"},c={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?c:{},...i}}var co=Symbol("prepared-layout-font-configuration"),Ie=new WeakMap;function lo(e){return Ie.has(e)}function uo(e){let t=Ie.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function ui(e){let t=Ie.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function ct(e,t){return yn(e,t,false)}function di(e,t){return yn(e,t,true)}function yn(e,t,n){let r=io(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(d=>n&&chunkFDSL5OJU_cjs.g(d)!==void 0?d:chunkFDSL5OJU_cjs.f(d,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a=new TextEncoder,i=pn(o,true),c=a.encode(JSON.stringify(i)),s=pn(o,false),u=a.encode(JSON.stringify(s)),l=Object.freeze({[co]:true,fingerprint:`font-config:${chunkZOZI27AW_cjs.f(c)}`});return Ie.set(l,{configuration:o,sharedShapingFingerprint:`shared-font-config:${chunkZOZI27AW_cjs.f(u)}`}),l}function po(e){return ct(e).fingerprint}function fo(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:sn(t),ligatureCaretPolicy:fn,fallback:chunkFDSL5OJU_cjs.ja}));return `shaping:${chunkZOZI27AW_cjs.f(n)}`}async function mn(e,t,n,r,o=false){let i=lo(e)?e:ct(e,t),c=uo(i),{epoch:s,maxFontBytes:u,sources:l,substitutions:d,defaultFont:g}=c,m=c.language||"en",S=i.fingerprint,x=chunkFDSL5OJU_cjs.m({epoch:s,maxFontBytes:u,resources:l,substitutions:d,validateFont:rt,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await nt();let f=Object.freeze({script:oo,variationAxes:Object.freeze({}),shapingLibrary:Q,unicodeDataVersion:eo,normalization:to,language:m,features:Qr,...o?{documentLigatures:true}:{},fixedPointScale:no,roundingMode:ro});return Object.freeze({fonts:x,shaper:ln(n??it(r),r,n===void 0),defaultFont:g,environment:f,ligatureCaretPolicy:fn,operation:Object.freeze({resourceEpoch:x.epoch,configEpoch:s,extensionFingerprint:S,shapingHash:fo(f,r),producerVersion:1})})}async function yo(e,t,n){return mn(e,t,void 0,cn(n))}async function pi(e,t,n,r,o=false){return mn(e,r,t,n,o)}function mo(e){e.shaper.dispose?.();}function lt(e){let t=new Set([0,e.text.length]);for(let r of chunkFDSL5OJU_cjs.pa(e.text))t.add(r.utf16From),t.add(r.utf16To);let n=new Set([0,e.text.length]);for(let r of e.clusters)n.add(r.textStart),n.add(r.textEnd);return [...t].filter(r=>n.has(r)).sort((r,o)=>r-o)}function Ae(e,t){return lt(e).includes(t)}function ho(e,t){return Ae(e,t)}function go(e,t,n){return n>=t&&Ae(e,t)&&Ae(e,n)}function So(e){let t=chunkFDSL5OJU_cjs.pa(e.text);return lt(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var dt="und";function bn(){return typeof Intl.Segmenter=="function"}function bo(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${dt})`);return e}function xn(){let e=new(bo())(dt,{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 xo=/^[\p{L}\p{N}']$/u,Ro=/^\s$/u;function hn(e){return xo.test(e)}function gn(e){return Ro.test(e)}function ut(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function Rn(e){let t=chunkFDSL5OJU_cjs.pa(e);if(t.length===0)return [];let n=[],r=0;for(;r<t.length;){let o=t[r];if(gn(o.text)){let a=r+1;for(;a<t.length&&gn(t[a].text);)a+=1;n.push(ut(t,r,a,false)),r=a;continue}if(hn(o.text)){let a=r+1;for(;a<t.length&&hn(t[a].text);)a+=1;n.push(ut(t,r,a,true)),r=a;continue}n.push(ut(t,r,r+1,false)),r+=1;}return n}function Fn(){return {segment:Rn}}function Cn(e={}){let t=e.isIntlAvailable??bn,n=e.createIntlBoundary??xn,r=e.createFallbackBoundary??Fn;if(!t())return r();try{return n()}catch{return r()}}var Sn;function vn(){return Sn??=Cn(),Sn}function Fo(e,t=vn()){return t.segment(e)}function Co(e,t){return t.map(n=>({graphemeFrom:chunkFDSL5OJU_cjs.ta(e,n.utf16From),graphemeTo:chunkFDSL5OJU_cjs.ta(e,n.utf16To),wordLike:n.wordLike}))}var En={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},yt=Object.keys(En),Ln=yt.filter(e=>En[e]==="coarse-gate"),Pe=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},ne=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},vo={resourceEpoch:Pe,configEpoch:Pe,extensionFingerprint:ne,shapingHash:ne,producerVersion:Pe},Eo=(e,t)=>{vo[t](e[t],t);},re=e=>{for(let t of yt)Eo(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},Lo=(e,t)=>{let n=re(e),r=re(t),o=yt.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},pt=e=>{let t=e.map(({key:n,fingerprint:r})=>(ne(n,"resource dependency key"),ne(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)},Bo=e=>(Pe(e.revision,"revision"),ne(e.dependencyFingerprint,"dependencyFingerprint"),ne(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:pt(e.resourceDependencies),...re(e)})),To=(e,t)=>{let n=pt(e),r=pt(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let i=n[a],c=r[a];if(i?.key!==c?.key||i?.fingerprint!==c?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:i?.key??c.key}}return null};function 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=To(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of Ln)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var ft=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:Bo(r)});}evictEpoch(t){let n=re(t),r=0;for(let[o,a]of this.entries){let i=a.provenance;Ln.some(c=>i[c]!==n[c])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=re(t),o=this.evictEpoch(r);for(let[a,i]of this.entries)i.provenance.resourceDependencies.some(s=>n.get(s.key)!==s.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function Bn(e){return e.projected===true?null:e.range}function Io(e,t,n){let{page:r,story:o,host:a,noteScopeId:i,noteAreaKind:c}=e,s=o==="header"||o==="footer"?u=>chunkFDSL5OJU_cjs.za(u,e.origin,{x:r.box.x,y:r.box.y}):void 0;chunkFDSL5OJU_cjs.Ia(a,(u,l)=>{let{textboxDepth:d,textboxOwner:g,textboxPath:m,storyOrigin:S}=l,x=d===0?o:"textbox";for(let f of u.lines){let h=[...chunkFDSL5OJU_cjs.Oa(f)].sort((b,R)=>(t.get(b.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(R.paragraphId)??Number.MAX_SAFE_INTEGER));for(let b of h)for(let R of b.spans)n({page:r,story:x,rootStory:o,root:e,storyOrigin:S,absoluteBox:Object.freeze({x:S.x+R.box.x,y:S.y+R.box.y,width:R.box.width,height:R.box.height}),noteScopeId:i,noteAreaKind:c,textboxDepth:d,textboxOwner:g,textboxPath:m,paragraph:u,paragraphId:b.paragraphId,line:f,span:R,sourceRange:Bn(R)});}},e.origin,s);}function Ao(e,t){let n=new Map(chunkFDSL5OJU_cjs.Va(e).map((r,o)=>[r,o]));chunkFDSL5OJU_cjs.Fa(e,r=>Io(r,n,t));}var _o=1,Tn=4,Y=Object.freeze({top:0,right:0,bottom:0,left:0}),On=new WeakMap;function Mo(e,t){let n=zo(e);return n===Y?t:chunkFDSL5OJU_cjs.Ve(t,n)}function zo(e){let t=e.vectorShape;if(!t)return Y;let{cx:n,cy:r}=t.extentEmu;if(!(n>=0)||!(r>=0)||n===0&&r===0)return Y;let o=On.get(t);if(o||(o=ko(t),On.set(t,o)),o===Y)return Y;let a=e.paintBounds,i=e.geometry.contentBounds;if(!(a.width>0||i.width<=0)||!(a.height>0||i.height<=0))return Y;let c=n>0?i.width/n:i.height/r,s=r>0?i.height/r:i.width/n,u=(d,g,m)=>{if(m<-1e-3)return 0;let S=d*g-Math.max(0,m);return Number.isFinite(S)&&S>0?S:0},l={left:u(o.left,c,i.x-a.x),top:u(o.top,s,i.y-a.y),right:u(o.right,c,a.x+a.width-(i.x+i.width)),bottom:u(o.bottom,s,a.y+a.height-(i.y+i.height))};return l.left||l.top||l.right||l.bottom?Object.freeze(l):Y}function ko(e){let{cx:t,cy:n}=e.extentEmu,r=0,o=0,a=t,i=n,c=(l,d)=>{r=Math.min(r,l),a=Math.max(a,l),o=Math.min(o,d),i=Math.max(i,d);},s=_o,u=l=>l.x>=-s&&l.x<=t+s&&l.y>=-s&&l.y<=n+s;for(let l of e.components){if(l.strokeHex===null||l.strokeInset===true)continue;let d=Math.max(1,chunkFDSL5OJU_cjs.Ue(l.strokeWidthEmu))/2;l.subpathsEmu.forEach((g,m)=>{let S=l.subpathsClosed?.[m]!==false,x=No(g,S),f=S&&x.length>2?x.length:x.length-1,h=[];for(let R=0;R<f;R+=1){let F=x[R],v=x[(R+1)%x.length],w=Math.hypot(v.x-F.x,v.y-F.y),T={x:-(v.y-F.y)/w,y:(v.x-F.x)/w};if(h.push(T),!!Do(F,v,-s,t+s,-s,n+s))for(let y=0;y<2;y+=1){let p=V[y],C=F.x+(v.x-F.x)*p,E=F.y+(v.y-F.y)*p;c(C+T.x*d,E+T.y*d),c(C-T.x*d,E-T.y*d);}}if(!S&&h.length&&(l.strokeCap==="round"||l.strokeCap==="square")){for(let[R,F,v]of [[x[0],h[0],-1],[x[x.length-1],h[h.length-1],1]])if(u(R))if(l.strokeCap==="round")c(R.x-d,R.y-d),c(R.x+d,R.y+d);else {let w=R.x+v*F.y*d,T=R.y-v*F.x*d;c(w+F.x*d,T+F.y*d),c(w-F.x*d,T-F.y*d);}}let b=S&&x.length>2?h.length:h.length-1;for(let R=0;R<b;R+=1){let F=x[(R+1)%x.length];if(!u(F))continue;if(l.strokeJoin==="round"){c(F.x-d,F.y-d),c(F.x+d,F.y+d);continue}if(l.strokeJoin==="bevel")continue;let v=h[R],w=h[(R+1)%h.length],T=1+v.x*w.x+v.y*w.y;if(T<2/(Tn*Tn))continue;let y=v.y*-w.x- -v.x*w.y;if(y===0)continue;let p=y>0?-1:1;c(F.x+p*(v.x+w.x)*d/T,F.y+p*(v.y+w.y)*d/T);}});for(let g of l.arrowheadsEmu??[])if(!(!g[0]||!u(g[0])))for(let m of g)c(m.x,m.y);}return r>=0&&o>=0&&a<=t&&i<=n?Y:Object.freeze({left:-r,top:-o,right:a-t,bottom:i-n})}function No(e,t){let n=[];for(let a of e){let i=n[n.length-1];(!i||i.x!==a.x||i.y!==a.y)&&n.push(a);}let r=n[0],o=n[n.length-1];return t&&n.length>1&&r.x===o.x&&r.y===o.y&&n.pop(),n}var V=new Float64Array(2);function Do(e,t,n,r,o,a){let i=t.x-e.x,c=t.y-e.y;return V[0]=0,V[1]=1,_e(-i,e.x-n)&&_e(i,r-e.x)&&_e(-c,e.y-o)&&_e(c,a-e.y)}function _e(e,t){if(e===0)return t>=0;let n=t/e;return e<0?V[0]=Math.max(V[0],n):V[1]=Math.min(V[1],n),V[0]<=V[1]}var Ho=new Map([["roman","serif"],["swiss","sans"],["modern","mono"]]);function Bi(e,t){return t==="fixed"?"mono":e?Ho.get(e):void 0}var Uo=new Map([["calibri","sans"],["arial","sans"],["helvetica","sans"],["verdana","sans"],["tahoma","sans"],["segoe ui","sans"],["aptos","sans"],["century gothic","sans"],["carlito","sans"],["cambria","serif"],["times new roman","serif"],["georgia","serif"],["garamond","serif"],["book antiqua","serif"],["palatino linotype","serif"],["caladea","serif"],["courier new","mono"],["consolas","mono"]]);function wn(e){let t=e.trim().toLowerCase(),n=Uo.get(t);if(n)return n;let r=t.split(/[\s_-]+/);if(r.includes("mono")||r.includes("monospace")||r.includes("courier"))return "mono";if(r.includes("sans"))return "sans";if(r.includes("serif")||r.includes("roman"))return "serif"}var Ti={serif:"Times New Roman",sans:"Arial",mono:"Courier New"};var mt="Calibri, Carlito, Helvetica, Arial, sans-serif",Go='"Times New Roman", "Liberation Serif", Tinos, serif',Wo='"Courier New", "Liberation Mono", Cousine, monospace';function Ko(e,t=mt){if(!e)return t;let n=wn(e);return n==="serif"?Go:n==="mono"?Wo:t}var Mi=new Map([["calibri","Carlito"]]),Xo=65536,jo=256;function In(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 An(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 Pn=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function _n(e=null){return e!=null&&typeof e.measureText=="function"}function Mn(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??mt,r=e.context??null;if(!_n(r))return null;let o=r,a=An(In(e.maxWidthEntries,Xo)),i=An(In(e.maxMetricsEntries,jo)),c=e.fontAlias,s=l=>{let d=l.fontFamily&&Pn.test(l.fontFamily)?l.fontFamily:null,g=d?c?.(d):void 0,m=g&&Pn.test(g)?g:null,S=Ko(d,n),x=d?m?`"${m}", "${d}", ${S}`:`"${d}", ${S}`:n,f=l.bold?"bold":"normal",h=l.italic?"italic":"normal",b=l.smallCaps?"small-caps":"normal",R=l.fontSizePt*chunkFDSL5OJU_cjs.ia(l)*t;return `${h} ${b} ${f} ${R}px ${x}`},u=(l,d,g)=>l/t*(g.horizontalScalePercent/100)+d.length*g.characterSpacingPt;return {measure(l,d){if(l.length===0)return 0;let g=s(d),m=`${g}\0${chunkFDSL5OJU_cjs.od(d)}\0${l}`,S=a.get(m);if(S!==void 0)return u(S,l,d);o.font=g,"fontKerning"in o&&(o.fontKerning=chunkFDSL5OJU_cjs.od(d)?"normal":"none");let x=o.measureText(l).width;return a.set(m,x),u(x,l,d)},inkBounds(l,d){if(!l||l.length>2||d.shaping?.direction==="rtl"||chunkFDSL5OJU_cjs.pa(l).length!==1)return;o.font=s(d),"fontKerning"in o&&(o.fontKerning=chunkFDSL5OJU_cjs.od(d)?"normal":"none");let g=o.textAlign,m=o.direction,S;try{g!==void 0&&(o.textAlign="left"),m!==void 0&&(o.direction="ltr"),S=o.measureText(l);}finally{g!==void 0&&(o.textAlign=g),m!==void 0&&(o.direction=m);}let x=S.actualBoundingBoxLeft,f=S.actualBoundingBoxRight;if(x===void 0||f===void 0||!Number.isFinite(x)||!Number.isFinite(f))return;let h=d.horizontalScalePercent/(100*t);return {left:-x*h,right:f*h}},textOutline(l,d){if(!l||d.shaping?.direction==="rtl")return;o.font=s(d),"fontKerning"in o&&(o.fontKerning=chunkFDSL5OJU_cjs.od(d)?"normal":"none");let g=o.textAlign,m=o.textBaseline,S;try{g!==void 0&&(o.textAlign="left"),m!==void 0&&(o.textBaseline="alphabetic"),S=o.measureText(l);}finally{g!==void 0&&(o.textAlign=g),m!==void 0&&(o.textBaseline=m);}let x=[-(S.actualBoundingBoxLeft??NaN),-(S.actualBoundingBoxAscent??NaN),S.actualBoundingBoxRight??NaN,S.actualBoundingBoxDescent??NaN].map(F=>F/t);if(x.some(F=>!Number.isFinite(F)))return;let[f,h,b,R]=x;if(!(!(b>f)||!(R>h)))return {path:null,ink:{left:f,top:h,right:b,bottom:R}}},lineMetrics(l){let d=l.fontSizePt*chunkFDSL5OJU_cjs.ia(l),g=s(l),m=i.get(g);if(m)return m;let S=d*1.15,x=d*.8;o.font=g,"fontKerning"in o&&(o.fontKerning=chunkFDSL5OJU_cjs.od(l)?"normal":"none");let f=o.measureText("Hxg"),h=f.fontBoundingBoxAscent,b=f.fontBoundingBoxDescent;if(typeof h=="number"&&Number.isFinite(h)&&h>0&&(x=h/t,typeof b=="number"&&Number.isFinite(b)&&b>=0)){let F=(h+b)/t;F>0&&(S=Math.max(F,S));}S>0||(S=d*1.15);let R={height:S,baseline:x};return i.set(g,R),R}}}function Vo(e=1,t={}){let n=Mn({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:chunkFDSL5OJU_cjs.ka(),producer:"fixed-measurer"}}function Yo(e){let t;return n=>{t===void 0&&(t=chunkFDSL5OJU_cjs.qc(e.pages)?.hosts??null);let r=t?.get(n);return r?chunkFDSL5OJU_cjs.oc(r.pageNumber,r.format):null}}function zn(e,t){let n=chunkFDSL5OJU_cjs.Cd(e,t.displayMode??chunkFDSL5OJU_cjs.ab),r=chunkFDSL5OJU_cjs.Jc({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:chunkZOZI27AW_cjs.qh(t.package,"footnote"),endnotesPart:chunkZOZI27AW_cjs.qh(t.package,"endnote")}:void 0,a=chunkFDSL5OJU_cjs.dd(n,r,o,t.package?chunkFDSL5OJU_cjs.ad(t.package,e,n):void 0,t.displayMode??chunkFDSL5OJU_cjs.ab);return {blocks:n,notes:o,context:a}}function kn(e,t,n,r,o){for(let a of t){if(r.length>=chunkZOZI27AW_cjs.Il)return;if(n.tokenForParagraph(a.id)!==""&&chunkZOZI27AW_cjs.Ll(e,a.id)===null)for(let i of chunkZOZI27AW_cjs.Kl(a)){if(r.length>=chunkZOZI27AW_cjs.Il)return;if(!i.rewritable)continue;let c=chunkFDSL5OJU_cjs.ic(i.instruction);if(c===null)continue;let s=n.liveValueOf(i.fieldNodeId,c);if(s===null&&o&&n.pageRefProjectionOf){let u=n.pageRefProjectionOf(i.fieldNodeId,c);if(u){let l=o(u.targetParagraphId);l!==null&&l.length>0&&chunkFDSL5OJU_cjs.pc(u.calibration,u.cached,l,Number.NaN)&&(s=l);}}s===null||s===i.cachedText||s.length>chunkZOZI27AW_cjs.Jl||s.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:i.fieldNodeId,text:s});}}}function $o(e,t){let{blocks:n,context:r}=zn(e,t);if(r===null)return null;let o=[];return kn(e,chunkFDSL5OJU_cjs.kc(chunkFDSL5OJU_cjs.Dc(n)),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function ji(e,t){let{notes:n,context:r}=zn(e,t);if(r===null||n===void 0)return [];let o=[],a=[{noteKind:"footnote",notesPart:n.footnotesPart},{noteKind:"endnote",notesPart:n.endnotesPart}];for(let{noteKind:i,notesPart:c}of a){if(!c)continue;let s=[];for(let u of chunkFDSL5OJU_cjs.bd(c,t.displayMode??chunkFDSL5OJU_cjs.ab)){if(s.length>=chunkZOZI27AW_cjs.Il)break;kn(c,chunkFDSL5OJU_cjs.kc(chunkFDSL5OJU_cjs.Dc(u)),r,s);}s.length>0&&o.push({noteKind:i,op:{op:"refreshFieldResults",updates:s}});}return o}function qo(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 Zo(e){let t=new Map,n=(o,a,i)=>{if(!(o.kind==="textValue"||i>chunkZOZI27AW_cjs.Rb*4)){for(let c of o.children)if(c.kind!=="textValue"){if(c.kind==="paragraph"){for(let s of r)t.get(s)?.push(c.id);n(c,c.id,i+1);continue}if(c.kind==="contentControl"){t.set(c.id,[]),r.push(c.id);let s=chunkZOZI27AW_cjs.$b(c);s&&n(s,a,i+1),r.pop();let u=t.get(c.id);u&&u.length===0&&a!==null&&u.push(a);continue}n(c,a,i+1);}}},r=[];return n(e,null,0),t}function Jo(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 Qo(e,t){let n=chunkZOZI27AW_cjs.dc(e.root);if(n.length===0)return ea;let r=new Map;t.pages.forEach((i,c)=>{(u=>{for(let l of u){let d=new Set;Nn(l,d);for(let g of d){let m=r.get(g)??[];m.push({pageIndex:c,box:qo(l)}),r.set(g,m);}}})(i.fragments);});let o=Zo(e.root),a=[];for(let i of n){let c=chunkZOZI27AW_cjs.bc(i.node),s=[...i.ancestors.map(g=>chunkZOZI27AW_cjs.bc(g).lock),c.lock],u=o.get(i.node.id)??[],l=new Map;for(let g of u)for(let m of r.get(g)??[]){let S=l.get(m.pageIndex);l.set(m.pageIndex,S?Jo(S,m.box):m.box);}let d=[...l.entries()].sort((g,m)=>g[0]-m[0]).map(([g,m])=>({pageIndex:g,...m}));a.push({controlId:i.node.id,type:c.type,level:chunkZOZI27AW_cjs.cc(i.node),depth:i.depth,lock:c.lock,effectiveLock:chunkZOZI27AW_cjs.gc(s),showingPlaceholder:c.showingPlaceholder,temporary:c.temporary,...c.tag===void 0?{}:{tag:c.tag},...c.alias===void 0?{}:{alias:c.alias},...c.id===void 0?{}:{id:c.id},...c.dataBinding===void 0?{}:{dataBinding:c.dataBinding},paragraphIds:u,fragments:d});}return a}var ea=Object.freeze([]);function Un(e,t,n){for(let r of e.lines??[]){let o=r.spans;if(!o){if(n<r.range.end)return r.box.y;continue}let a=0,i=0;for(let c of o)c.range.paragraphId===t&&(a+=1,i=c.range.end);if(a===o.length?n<r.range.end:a>0&&n<i)return r.box.y}return e.fragmentY}function da(e,t){let n=new Map;for(let r of e.pages)for(let[o,a]of pa(r,t))n.has(o)||n.set(o,a);return n}var Dn=new WeakMap;function pa(e,t){let n=Dn.get(t);n||(n=new WeakMap,Dn.set(t,n));let r=n.get(e);if(r)return r;let o=new Map;for(let a of t(e)){let i=new Set([a.paragraphId]);for(let c of a.lines??[])for(let s of c.spans??[])i.add(s.range.paragraphId);for(let c of i)o.has(c)||o.set(c,{pageIndex:e.index,contentY:e.contentBox.y,fragmentY:a.box.y,...a.lines?{lines:a.lines}:{}});}return n.set(e,o),o}function fa(e,t){let n=chunkZOZI27AW_cjs.Lj(e);if(!n)return null;let r=t.get(n.start.paragraphId);if(!r)return null;let o=Hn.get(e);if(o?.anchor===r)return o.geometry;let a={pageIndex:r.pageIndex,y:r.contentY+Un(r,n.start.paragraphId,n.start.offset)};return Hn.set(e,{anchor:r,geometry:a}),a}var Hn=new WeakMap;var Gn=new WeakMap;function ya(e){let t=Gn.get(e);if(t!==void 0)return t;let n=chunkFDSL5OJU_cjs.i(e),r=new DataView(n.buffer,n.byteOffset,n.byteLength),o=false,a=r.getUint32(0)===1953784678?r.getUint32(12+e.faceIndex*4):0,i=r.getUint16(a+4);for(let c=0;c<i;c++){let s=a+12+c*16;if(r.getUint32(s)!==1330851634)continue;let u=r.getUint32(s+8),l=r.getUint32(s+12);l>=86&&u<=n.byteLength-l&&r.getUint16(u)>=1&&(o=(r.getUint32(u+78)&1966080)!==0);break}return Gn.set(e,o),o}function Wn(e,t,n,r,o){let a=n.height-r;if(Math.abs(a-t)>o||!ya(e))return n;let i=Math.max(n.height,t*1.3),c=n.baseline-r;return {height:i,baseline:c+(i-a)/2}}var ma="abcdefghijklmnopqrstuvwxyz";function D(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function G(e,t,n,r,o){let a=r.shaping?.context;return e.shape({text:o,fontSizeHalfPoints:D(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:ha(t,n,r),...a?{context:a}:{}})}var Kn=new WeakMap;function ha(e,t,n){if(!Object.isFrozen(e)||!Object.isFrozen(e.features)||!Object.isFrozen(e.variationAxes)||!Object.isFrozen(e.shapingLibrary))return Xn(e,t,n);let r=n.shaping?.direction??"ltr",o=n.shaping?.script,a=`${r}|${o??""}|${chunkFDSL5OJU_cjs.od(n)?1:0}|${e.documentLigatures?chunkFDSL5OJU_cjs.G(n):""}|${n.smallCaps?1:0}`,i=Kn.get(e);i||Kn.set(e,i=new WeakMap);let c=i.get(t);c||i.set(t,c=new Map);let s=c.get(a);return s||c.set(a,s=Xn(e,t,n)),s}function Xn(e,t,n){return chunkFDSL5OJU_cjs.r({...e,font:t,direction:n.shaping?.direction??"ltr",script:n.shaping?.script==="Zyyy"?e.script:n.shaping?.script??e.script,features:{...e.features,kern:chunkFDSL5OJU_cjs.od(n)?1:0,...e.documentLigatures?chunkFDSL5OJU_cjs.F(n):{},...n.smallCaps?{smcp:1}:{}},fallbackOrder:[]})}function Me(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let i=true;try{for(let c of ma){let s=G(e,t,n,{...r,smallCaps:!0},c),u=G(e,t,n,{...r,smallCaps:!1},c);if(!(s.glyphs.length!==u.glyphs.length||s.glyphs.some((d,g)=>d.id!==u.glyphs[g]?.id))){i=!1;break}}}catch{i=false;}return o.set(n,i),i}function jn(e,t,n,r,o){let a=new WeakMap;return (i,c)=>{let s=chunkFDSL5OJU_cjs.ia(c),u=a.get(i);u||(u=new Map,a.set(i,u));let l=D(c),d=u.get(l);if(d)return s===1?d:{height:d.height*s,baseline:d.baseline*s};let g,m=true,S=i.substitution?.lineMetrics;if(S){let x=l/2;g={height:S.heightEm*x,baseline:S.baselineEm*x};}else try{let x=G(e,t,i,c,""),f=x.metrics.ascent/t.fixedPointScale,h=x.metrics.descent/t.fixedPointScale,b=l/2,R=f+h,F=b*r,v=R>F?F/R:1,w=R*v,T=Math.min(Math.max(0,x.metrics.lineGap/t.fixedPointScale),w*o),y=w+T;y>0?g=Wn(i,b,{height:y,baseline:f*v+T},T,2/t.fixedPointScale):(g=n.lineMetrics(c),m=!1);}catch{g=n.lineMetrics(c),m=false;}return m?(u.set(l,g),s===1?g:{height:g.height*s,baseline:g.baseline*s}):g}}var ht=2048,ga=32,Sa=new Map([["symbol",{ascent:2059,descent:450,advances:[512,682,1460,1024,1124,1706,1593,899,682,682,1024,1124,512,1124,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,569,569,1124,1124,1124,909,1124,1479,1366,1479,1253,1251,1563,1235,1479,682,1292,1479,1405,1821,1479,1479,1573,1518,1139,1212,1251,1413,899,1573,1321,1628,1251,682,1767,682,1348,1024,1024,1292,1124,1124,1012,899,1067,842,1235,674,1235,1124,1124,1180,1067,1124,1124,1067,1124,1235,899,1180,1460,1405,1010,1405,1012,983,410,983,1124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1270,506,1124,342,1460,1024,1542,1542,1542,1542,2134,2021,1235,2021,1235,819,1124,842,1124,1124,1460,1012,942,1124,1124,1124,1124,2048,1235,2048,1348,1686,1405,1628,2021,1573,1573,1686,1573,1573,1460,1460,1460,1460,1460,1460,1460,1573,1460,1618,1618,1823,1686,1124,512,1460,1235,1235,2134,2021,1235,2021,1235,1012,674,1618,1618,1610,1460,786,786,786,786,786,786,1012,1012,1012,1012,0,674,561,1405,1405,1405,786,786,786,786,786,786,1012,1012,1012,0]}],["wingdings",{ascent:1841,descent:432,advances:[2048,2110,2344,2665,2752,1830,2492,938,2220,1826,2319,2319,2399,2399,2951,2956,2245,2751,1431,1431,1826,1135,1233,2196,1941,2208,1924,1825,1826,1826,1825,1863,1863,1203,1624,1381,1381,1929,1929,1124,1124,1826,1727,1727,1727,2275,1352,1739,2230,1819,1803,1332,1665,1529,1529,1480,1420,1627,1813,1826,1834,1825,2368,2159,1974,2233,1927,1911,1937,2099,1902,2245,2181,1597,2150,2603,1529,1951,1529,1825,1825,1825,1825,937,1529,2020,1825,1183,2171,2171,1825,1826,1826,1086,1086,0,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,2048,2048,2048,2048,2048,2048,2048,2048,641,937,641,1825,1825,1825,1825,1825,1951,937,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2146,2146,2146,2146,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2566,2566,1627,1627,1825,1825,1825,1825,1825,1825,2006,2006,1825,1825,1589,1589,1589,1589,2186,2186,1825,1825,1787,1787,1787,1787,1825,1825,1660,1660,2171,1660,1601,1601,1601,1601,987,789,1301,1609,1826,1826,2119]}],["wingdings 2",{ascent:1727,descent:432,advances:[2048,2110,2090,2073,2086,2344,2045,2220,989,1431,1431,1826,1431,1431,1826,1431,1431,1826,1431,1431,2320,2246,1826,1826,1826,2320,2170,2170,1381,1381,1938,1938,1938,1938,1928,1928,1928,1928,1047,1047,1047,1047,1178,1178,1178,1178,1826,1321,1568,1826,1826,1826,1826,1825,1825,1826,1826,2226,1727,1548,1579,984,1035,864,1018,2048,2048,2048,2048,2048,2048,2048,2048,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,0,1899,1899,1453,1453,1673,1332,1431,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2048,2048,542,740,1135,1825,1825,1825,1825,1825,1825,1825,542,740,1135,1825,1825,1825,1825,1825,1825,1825,1825,1825,624,764,903,1461,2020,2020,2020,2020,2020,542,641,740,1135,1529,1529,1085,1085,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1496,1825,0,0,0,0,0,0]}],["wingdings 3",{ascent:1900,descent:432,advances:[2048,1825,1825,1135,1135,1444,1444,1444,1444,1825,1825,1135,1135,1677,1677,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1825,1825,1455,1455,1455,1455,2010,2010,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2220,1825,1751,1114,1115,1660,1660,1930,1930,1930,1930,1924,1924,1924,1924,1930,1930,1931,1931,1825,1825,1232,1232,1444,1444,1444,1444,1825,1232,2005,2005,2005,2005,1801,1801,1801,1801,1801,1801,1801,1801,1085,1085,1825,0,1825,1825,1825,1825,1825,1627,1627,1825,1825,1825,1825,789,789,1825,1825,987,987,1825,1825,1184,1184,1825,1825,1579,1579,1825,1825,888,888,1825,1825,1381,1381,1825,1825,1875,1875,1825,1825,1825,1825,1825,1825,1825,789,592,493,394,1825,1825,1825,1825,1825,1085,1085,1381,1381,1628,1628,1184,1184,900,900,1825,1825,1019,1019,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1291,1291,1291,1291,1961,1961,1825,1825,1540,1540,1540,1540,2096,2096,1825,1825,1688,1688,1688,1688,2277,2277,1825,1825,1885,1885,1885,1885,543,543,1234,1234,766,766,1234,1234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],["webdings",{ascent:1638,descent:410,advances:[1024,2048,2048,2048,2048,2028,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1100,1100,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1144,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,0,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2500,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1377,1377,2048,1726,1058,2048,2048,2048,2048,877,1240,2048,2048,2048,2048,1357,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2645,2048,2048,2048,2048]}]]);function ba(e){if(chunkZOZI27AW_cjs.b(e))return Sa.get(e.toLowerCase())}function Vn(e,t,n,r){let o=D(r)/2*chunkFDSL5OJU_cjs.ia(r)*(r.horizontalScalePercent/100)/ht,a=[];for(let i=0;i<n.length;i++){let c=chunkZOZI27AW_cjs.c(n.charCodeAt(i),t),s=c===null?0:e.advances[c-ga]??0;if(s===0)return;a.push(s*o+r.characterSpacingPt);}return a}function Yn(e){let t=new WeakMap,n=r=>{let o=t.get(r);return o===void 0&&(o=ba(r.fontFamily)??null,t.set(r,o)),o};return {...e,measure(r,o){let a=n(o),i=a&&Vn(a,o.fontFamily,r,o);if(!i)return e.measure(r,o);let c=0;for(let s of i)c+=s;return c},caretAdvances(r,o){let a=n(o),i=a&&Vn(a,o.fontFamily,r,o);if(!i)return e.caretAdvances?.(r,o);let c=[0];for(let s of i)c.push(c[c.length-1]+s);return c},lineMetrics(r,o){let a=n(r);if(!a)return e.lineMetrics(r,o);let i=D(r)/2*chunkFDSL5OJU_cjs.ia(r);return {height:(a.ascent+a.descent)*i/ht,baseline:a.ascent*i/ht}}}}var xa={M:2,L:2,Q:4,C:6,Z:0},$n=e=>{let t=Math.round(e*1e3)/1e3;return String(Object.is(t,-0)?0:t)};function qn(e,t,n){if(!(t>0)||!(n>0))return;let r=[],o=0,a=1/0,i=-1/0,c=1/0,s=-1/0;for(let u of e.glyphs){if(u.id===0)return;let l=u.outline.path,d=u.outline.unitsPerEm;if(!l)continue;if(!(d>0)||!l.startsWith("M")||/[^MLQCZ0-9eE+.,\s-]/u.test(l))return;let g=t*(u.drawScale??1)/d,m=(u.originX+u.offsetX)/n,S=(u.originY+u.offsetY)/n;for(let x of l.matchAll(/([MLQCZ])([^MLQCZ]*)/gu)){let f=x[1],h=x[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(h.length!==xa[f]||h.some(R=>!Number.isFinite(R)))return;let b=f;for(let R=0;R<h.length;R+=2){let F=m+h[R]*g,v=-(S+h[R+1]*g);a=Math.min(a,F),i=Math.max(i,F),c=Math.min(c,v),s=Math.max(s,v),b+=`${R?" ":""}${$n(F)} ${$n(v)}`;}if(o+=b.length,o>2e6)return;r.push(b);}}if(!(!r.length||!(i>a)||!(s>c)))return Object.freeze({path:r.join(""),ink:Object.freeze({left:a,top:c,right:i,bottom:s})})}var gt=new WeakMap;function Ra(e){let t=gt.get(e);if(t!==void 0)return t??void 0;let n=e.path;if(!n.startsWith("M")||n.length>1e6||/[^MLQCZ0-9eE+.,\s-]/u.test(n))return;let r=1/0,o=-1/0,a=n.matchAll(/([MLQCZ])([^MLQCZ]*)/gu);for(let c of a){let s=c[1]==="Z"?0:c[1]==="C"?6:c[1]==="Q"?4:2,u=c[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(u.length!==s||u.some(l=>!Number.isFinite(l))){gt.set(e,null);return}for(let l=0;l<u.length;l+=2)r=Math.min(r,u[l]),o=Math.max(o,u[l]);}let i=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return gt.set(e,i??null),i}function Zn(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let c of e.glyphs){if(c.id===0)return;let s=Ra(c.outline),u=c.outline.unitsPerEm;if(!s||!(u>0))return;let l=(c.originX+c.offsetX)/n;o=Math.min(o,l+s.left*t*(c.drawScale??1)/u),a=Math.max(a,l+s.right*t*(c.drawScale??1)/u);}let i={left:o*r,right:a*r};return Number.isFinite(i.left)&&Number.isFinite(i.right)?i:void 0}function Fa(e,t,n){if(t<12)return null;if(e.getUint32(0)!==1953784678)return 0;let o=12+(Number.isSafeInteger(n)&&n>0?n:0)*4;if(o+4>t)return null;let a=e.getUint32(o);return a+12<=t?a:null}function Jn(e,t,n,r,o){let a=e.getUint16(n+4);if(a>4096||n+12+a*16>t)return null;for(let i=0;i<a;i+=1){let c=n+12+i*16;if(e.getUint32(c)!==r)continue;let s=e.getUint32(c+8),u=e.getUint32(c+12);return u<o||s+u>t?null:s}return null}function Qn(e,t){let n=e.byteLength,r=new DataView(e.buffer,e.byteOffset,n),o=Fa(r,n,t);if(o===null)return null;let a=Jn(r,n,o,1751474532,54);if(a===null)return null;let i=r.getUint16(a+18);if(i<=0)return null;let c=Jn(r,n,o,1330851634,30);if(c===null)return null;let s=r.getInt16(c+26)/i,u=r.getInt16(c+28)/i;return !(s>0)||s>1||!(Math.abs(u)<=1)?null:{offsetEm:u,thicknessEm:s}}var Ca=.5,va=4,er=4096;function tr(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r,resolveFont:o}=e,a=Yn(e.fallback),i=t??{shapingLibrary:n.shapingLibrary,unicodeDataVersion:n.unicodeDataVersion,script:n?.script??"Latn",fixedPointScale:n?.fixedPointScale??1e3,normalization:n?.normalization??"none",features:n?.features??{},roundingMode:n?.roundingMode??"halfToEven",language:n?.language??"en",variationAxes:{}},c=new WeakMap,s=new WeakMap,u=chunkFDSL5OJU_cjs.q(r),l=jn(r,i,a,va,Ca),d=new WeakMap,g=new WeakMap,m=new Array(er),S=0,x=(y,p,C)=>{let E=m[S];E&&E.cache.delete(E.text),y.set(p,C),m[S]={cache:y,text:p},S=(S+1)%er;},f=y=>{let p=d.get(y);if(p!==void 0)return p;let C=o(y);return d.set(y,C),C},h=(y,p,C)=>{let E=C?s:c,L=E.get(y);L||(L=new Map,E.set(y,L));let O=L.get(p);return O||(O=new Map,L.set(p,O)),O},b=new WeakMap,R=y=>{if(!y.shaping?.wordSpacingPt)return y;let p=b.get(y);return p||(p={...y,shaping:{...y.shaping,wordSpacingPt:void 0}},b.set(y,p)),p},F=(y,p)=>p.shaping?.wordSpacingPt?chunkFDSL5OJU_cjs.Nd(y)*p.shaping.wordSpacingPt:0,v=(y,p)=>a.measure(y,R(p))+F(y,p),w=(y,p)=>{let C=Math.max(0,a.measure(y,R(p))),E=a.caretAdvances?.(y,R(p))??chunkFDSL5OJU_cjs.Ld(y,C);if(!E||E.length!==y.length+1)return chunkFDSL5OJU_cjs.Ld(y,v(y,p));let L=Math.max(0,v(y,p)),O=0,M=0;return E.map((A,I)=>{if(I===0)return 0;y[I-1]===" "&&M++;let z=A+M*(p.shaping?.wordSpacingPt??0);return O=Math.max(O,Math.min(L,Number.isFinite(z)?z:O)),I===y.length?L:O})},T=new WeakMap;return {hasResolvedFont(y){return f(y)!==null},strikeoutMetrics(y){let p=f(y);if(!p)return;let C=T.get(p);if(C===void 0&&(C=Qn(p.bytes,p.faceIndex),T.set(p,C)),!C)return;let E=D(y)/2*chunkFDSL5OJU_cjs.ia(y);return {offsetPt:C.offsetEm*E,thicknessPt:C.thicknessEm*E}},measure(y,p){if(y.length===0)return 0;let C=f(p);if(!C)return v(y,p);let E=h(C,D(p),p.smallCaps),L=p.shaping?.context,O=p.shaping?`1:${JSON.stringify(L?[p.shaping.script,p.shaping.direction,y,L.before,L.after]:[p.shaping.script,p.shaping.direction,y])}`:`0:${y}`,M=`${chunkFDSL5OJU_cjs.od(p)?1:0}:${chunkFDSL5OJU_cjs.G(p)}:${O}`,A=E.get(M);if(A===void 0){let I=0;try{if(p.smallCaps&&!Me(r,i,C,p,g))return v(y,p);let z=G(r,i,C,p,y);if(z.glyphs.some(W=>W.id===0))return v(y,p);for(let W of z.glyphs)I+=W.advanceX;}catch{return v(y,p)}A=I/i.fixedPointScale,x(E,M,A);}return A*chunkFDSL5OJU_cjs.ia(p)*(p.horizontalScalePercent/100)+y.length*p.characterSpacingPt+F(y,p)},inkBounds(y,p){if(!y||y.length>2||p.shaping?.direction==="rtl"||chunkFDSL5OJU_cjs.pa(y).length!==1)return;let C=f(p);if(!C)return a.inkBounds?.(y,p);try{if(p.smallCaps&&!Me(r,i,C,p,g))return a.inkBounds?.(y,p);let E=G(r,i,C,p,y);return Zn(E,D(p)/2,i.fixedPointScale,chunkFDSL5OJU_cjs.ia(p)*p.horizontalScalePercent/100)}catch{return}},textOutline(y,p){let C=f(p);if(!C)return a.textOutline?.(y,p);try{let E=G(r,i,C,p,y);return qn(E,D(p)/2,i.fixedPointScale)??a.textOutline?.(y,p)}catch{return a.textOutline?.(y,p)}},caretAdvances(y,p){let C=f(p);if(!C)return w(y,p);try{if(p.smallCaps&&!Me(r,i,C,p,g))return w(y,p);let E=G(r,i,C,p,y);return E.glyphs.some(L=>L.id===0)?w(y,p):chunkFDSL5OJU_cjs.Md(y,E,chunkFDSL5OJU_cjs.ia(p)*(p.horizontalScalePercent/100)/i.fixedPointScale,p.characterSpacingPt,p.shaping?.wordSpacingPt??0)??chunkFDSL5OJU_cjs.Ld(y,E.glyphs.reduce((L,O)=>L+O.advanceX,0)*chunkFDSL5OJU_cjs.ia(p)*(p.horizontalScalePercent/100)/i.fixedPointScale+y.length*p.characterSpacingPt+F(y,p))}catch{return w(y,p)}},lineMetrics(y,p){let C=f(y);if(!C)return a.lineMetrics(y,p);if(!p||/^[\t\n\r\f ]*$/.test(p))return l(C,y);if(u){let E=l(C,y),L=Math.max(0,E.baseline),O=Math.max(0,E.height-E.baseline);return L+O>0?{height:L+O,baseline:L}:E}try{let E=G(r,i,C,y,p),L=0,O=0;for(let M of E.fontSpans){let A=l(M.font,y);L=Math.max(L,A.baseline),O=Math.max(O,A.height-A.baseline);}if(L+O>0)return {height:L+O,baseline:L}}catch{}return l(C,y)}}}function Ea(e,t){return tr({...t,shaper:e.shaper,environment:e.environment})}function La(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let s of t.pages)r.add(s.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,i=-1,c=-1;for(let s of t.pages){let u=s.box.y;u+s.box.height>=n.top&&u<=a&&(i===-1&&(i=s.index),c=s.index);}if(i===-1){let s=Ba(t,n.top);s!==null&&(i=s,c=s);}if(i!==-1){let s=Math.max(0,i-o),u=Math.min(t.pages.length-1,c+o);for(let l=s;l<=u;l+=1)r.add(l);}for(let s of e.pinnedPages??[])s>=0&&s<t.pages.length&&r.add(s);return r}function Ba(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 nr=["text-local","paragraph-local","flow-structural","global"];function rr(e,t){return nr.indexOf(t)>nr.indexOf(e)?t:e}function Ta(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function Oa(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,i=null,c=null,s=0,u=0;function l(f){let h=e.runCooperatively;if(!h)return t(f);let b=h(f);c=b;try{for(;;){let R=b.step();if(R)return R;if(n()!==f.revision)return b.cancel(),u+=1,null;if(c!==b)return null}}finally{c===b&&(c=null);}}function d(f){let h=m(n());h.impact=rr(h.impact,f.impact),h.structural=h.structural||f.structural;for(let b of f.paragraphIds)h.paragraphIds.add(b);for(let b of f.created)h.created.add(b);for(let b of f.deleted)h.deleted.add(b);for(let b of f.dependencyKeys)h.dependencyKeys.add(b);}let g=f=>({impact:f.impact,paragraphIds:f.paragraphIds,created:f.created,deleted:f.deleted,dependencyKeys:f.dependencyKeys,structural:f.structural,revision:f.revision});function m(f){return a||(a=Ta(f)),a.revision=Math.max(a.revision,f),a}function S(){!o||i||(i=o(()=>{i=null,x();}));}function x(){i&&(i(),i=null),c&&(c.cancel(),c=null,u+=1);let f=a;if(!f)return false;a=null;let h=g(f),b=l(h);return !b||b.revision!==n()?(s+=1,d(h),S(),false):(r(b,h),true)}return {notify(f){let h=m(n());h.impact=rr(h.impact,f.impact);for(let b of f.dirty)h.paragraphIds.add(b);for(let b of f.created)h.created.add(b),h.paragraphIds.add(b);for(let b of f.deleted)h.deleted.add(b),h.paragraphIds.add(b);for(let b of f.dependencyKeys)h.dependencyKeys.add(b);for(let b of f.splitJoin)h.structural=true,"split"in b?(h.paragraphIds.add(b.split.from),h.paragraphIds.add(b.split.tail)):(h.paragraphIds.add(b.join.kept),h.paragraphIds.add(b.join.removed));(f.impact==="flow-structural"||f.impact==="global")&&(h.structural=true),S();},invalidateAll(f,h){let b=m(f);b.impact="flow-structural",b.structural=true,h&&b.dependencyKeys.add(h),S();},flush:x,pending:()=>a?g(a):null,cancel(){i?.(),i=null,c?.cancel(),c=null,a=null;},get staleDiscards(){return s},get cancelledRuns(){return u}}}var or=new WeakMap;function q(e){let t=or.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,i=(s,u,l,d)=>{for(let g of s){if(g.kind==="paragraph")continue;let m=g.tableId;a.set(m,Math.max(a.get(m)??0,(g.columnEdges?.length??1)-1));let S=o.get(m);S||(S=new Map,o.set(m,S),n.set(m,[]),r.set(m,new Map));for(let x of g.rows){let f=S.get(x.id);f===void 0&&(f=S.size,S.set(x.id,f),r.get(m).set(f,x.cells));for(let h of x.cells)n.get(m).push({pageIndex:u,tableId:m,row:x,cell:h,rowIndex:f,isHeaderRepeat:x.isHeaderRepeat,offsetX:l,offsetY:d}),i(h.blocks,u,l,d);}}};for(let s of e.pages){i(s.fragments,s.index,0,0);for(let u of [s.header,s.footer])u&&i(u.fragments,s.index,u.box.x-s.contentBox.x,u.box.y-s.contentBox.y);for(let u of [s.footnotes,s.endnotes])if(u)for(let l of u.notes)i(l.fragments,s.index,l.box.x-s.contentBox.x,l.box.y-s.contentBox.y);}let c=new Map;for(let[s,u]of n)c.set(s,{placed:u,rows:r.get(s)??new Map,columnCount:a.get(s)??0});return or.set(e,c),c}function wa(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,$(r).to+1);return t}var $=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function Ia(e,t,n){if(t.tableId!==n.tableId)return null;let r=q(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),i=Math.min($(t).from,$(n).from),c=Math.max($(t).to,$(n).to),s=m=>{let{from:S,to:x}=$(m);return x>=i&&S<=c},u=m=>(r.rows.get(m)??[]).some(S=>S.vMergeContinue&&s(S)),l=r.rows.size+wa(r)+2;for(let m=0;!(m>l);m+=1){let S=false;for(let[x,f]of r.rows)if(!(x<o||x>a))for(let h of f){if(!s(h))continue;let{from:b,to:R}=$(h);b<i&&(i=b,S=true),R>c&&(c=R,S=true);}for(;o>0&&u(o);)o-=1,S=true;for(;u(a+1);)a+=1,S=true;if(!S)break}let d=[],g=new Set;for(let m of r.placed){if(m.isHeaderRepeat||m.rowIndex<o||m.rowIndex>a)continue;let{from:S,to:x}=$(m.cell);x<i||S>c||g.has(m.cell.id)||(g.add(m.cell.id),d.push(m.cell.id));}return d.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:d,rows:{from:o,to:a},columns:{from:i,to:c},text:Aa(e,t.tableId,d)}}function Ns(e,t){return ir(e,t,true)}function ze(e,t){return ir(e,t,false)}function ir(e,t,n){let r=new Set(t),o=[],a=new Set;for(let i of q(e).values())for(let c of i.placed)if(!(c.isHeaderRepeat||!r.has(c.cell.id)))for(let s of c.cell.blocks)n&&s.kind!=="paragraph"||pe(s,o,a);return o}function pe(e,t,n){if(e.kind==="paragraph"){for(let r of chunkFDSL5OJU_cjs.Sa(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)pe(a,t,n);}function Aa(e,t,n){let r=ze(e,n),o=r[0],a=r[r.length-1];return !o||!a?Pa(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:chunkFDSL5OJU_cjs.Be(e,a).length}}}function Pa(e,t){let n=q(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let c of o.cell.blocks)pe(c,a,new Set);let i=a[0];if(i){let c={paragraphId:i,offset:0};return {anchor:c,head:c}}}for(let o of e.pages)for(let a of chunkFDSL5OJU_cjs.Aa(o)){let i={paragraphId:a.paragraphId,offset:0};return {anchor:i,head:i}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function _a(e){let t=[...chunkFDSL5OJU_cjs.Aa(e)];for(let n of [e.header,e.footer])n&&t.push(...chunkFDSL5OJU_cjs.Ba(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...chunkFDSL5OJU_cjs.Ba(r.fragments));return t}function Ma(e,t){let n=new Set(ze(e,t)),r=[],o=new Set;for(let a of e.pages)for(let i of _a(a))if(n.has(i.paragraphId))for(let c of i.lines)for(let s of c.spans){let u=`${s.range.paragraphId}:${s.range.start}:${s.range.end}`;o.has(u)||(o.add(u),r.push(s));}return r}function za(e,t){let n=new Set(t),r=[];for(let o of q(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 ka(e,t,n=chunkFDSL5OJU_cjs.Be){let r=q(e).get(t.tableId);if(!r)return "";let o=new Set(t.cellIds),a=r.placed.some(s=>s.cell.logicalGridColumn!==void 0),i=new Map,c=new Set;for(let s of r.placed){if(s.isHeaderRepeat||!o.has(s.cell.id)||c.has(s.cell.id))continue;c.add(s.cell.id);let u=ze(e,[s.cell.id]).map(g=>n(e,g)).join(`
|
|
2
|
-
`),l=i.get(s.rowIndex),d=s.cell.gridColumn+(a?Math.max(1,s.cell.gridSpan)-1:0);l?l.set(d,u):i.set(s.rowIndex,new Map([[d,u]]));}return [...i.keys()].sort((s,u)=>s-u).map(s=>{let u=i.get(s),l=[];for(let d=0;d<=t.columns.to-t.columns.from;d+=1){let g=a?t.columns.to-d:t.columns.from+d;l.push(u.get(g)??"");}return l.join(" ")}).join(`
|
|
3
|
-
`)}function St(e,t){return chunkFDSL5OJU_cjs.Qe(e,t)}function Ds(e,t,n){if(n){let a=St(e,t);if(!a||a.tableId!==n.tableId)return null;let i=n.cellIds[0];if(!i)return null;let c=q(e).get(n.tableId);if(!c)return null;for(let s of c.placed)if(s.cell.id===i)return {tableId:n.tableId,rowId:s.row.id,cellId:i,cellIds:n.cellIds,gridColumnIndex:s.cell.logicalGridColumn??s.cell.gridColumn,isHeaderRepeat:s.isHeaderRepeat};return null}let r=St(e,t);if(!r)return null;let o=q(e).get(r.tableId);if(!o)return null;for(let a of o.placed){if(a.isHeaderRepeat)continue;let i=[];for(let c of a.cell.blocks)pe(c,i,new Set);if(i.includes(t))return {tableId:r.tableId,rowId:a.row.id,cellId:a.cell.id,cellIds:[a.cell.id],gridColumnIndex:a.cell.logicalGridColumn??a.cell.gridColumn,isHeaderRepeat:a.row.isHeaderRepeat}}return null}var ar=new WeakMap;function Hs(e,t){let n=ar.get(e);if(n)return n.get(t)??null;let r=new Map;for(let[o,a]of q(e))for(let i of a.placed){if(i.isHeaderRepeat)continue;let c=[];for(let u of i.cell.blocks)pe(u,c,new Set);let s={tableId:o,rowId:i.row.id,cellId:i.cell.id,rowIndex:i.rowIndex,gridColumn:i.cell.gridColumn,gridSpan:i.cell.gridSpan};for(let u of c){let l=r.get(u);l&&l.tableId.length>=o.length||r.set(u,s);}}return ar.set(e,r),r.get(t)??null}function Na(e,t,n){if(![e,t,n].every(Number.isFinite)||t<=0||n<=0)return {offsetPt:0,count:0};let r=Math.ceil(e/n-1e-9)*n;if(!Number.isFinite(r))return {offsetPt:0,count:0};let o=Math.max(0,r-e);return {offsetPt:o,count:Math.min(8192,Math.max(0,Math.floor((t-o)/n+1e-9)))}}exports.$=Qo;exports.A=dt;exports.B=bn;exports.C=xn;exports.D=Rn;exports.E=Fn;exports.F=Cn;exports.G=vn;exports.H=Fo;exports.I=Co;exports.J=re;exports.K=Lo;exports.L=ft;exports.M=Bn;exports.N=Ao;exports.O=Mo;exports.P=Bi;exports.Q=wn;exports.R=Ti;exports.S=mt;exports.T=Ko;exports.U=Mi;exports.V=_n;exports.W=Mn;exports.X=Vo;exports.Y=Yo;exports.Z=$o;exports._=ji;exports.a=et;exports.aa=Un;exports.b=pr;exports.ba=da;exports.c=Q;exports.ca=fa;exports.d=nt;exports.da=G;exports.e=fr;exports.ea=Me;exports.f=B;exports.fa=tr;exports.g=rt;exports.ga=Ea;exports.h=it;exports.ha=La;exports.i=Ja;exports.ia=Oa;exports.j=sn;exports.ja=Ia;exports.k=cn;exports.ka=Ns;exports.l=j;exports.la=ze;exports.m=lo;exports.ma=Ma;exports.n=uo;exports.na=za;exports.o=ui;exports.oa=ka;exports.p=ct;exports.pa=St;exports.q=di;exports.qa=Ds;exports.r=po;exports.ra=Hs;exports.s=yo;exports.sa=Na;exports.t=pi;exports.u=mo;exports.v=lt;exports.w=Ae;exports.x=ho;exports.y=go;exports.z=So;
|
package/dist/chunk-ACLR4DMK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {Mf,Af,vf,Nf,Bf,Df,Of,Lf,ib,Xj}from'./chunk-GWM3AKUD.js';function X(e){return e.kind!=="textValue"}function k(e,t){for(let l of e.children)if(X(l)&&l.localName===t)return l}function j(e,t){return e.attributes.find(l=>l.localName===t)?.value}function q(e){let t=k(e,"pPr"),l=t?k(t,"outlineLvl"):void 0;if(l){let i=j(l,"val");return i!==void 0&&/^[0-8]$/.test(i)?Number(i):null}let n=k(e,"name"),o=n?/^heading\s+([1-9])$/i.exec(j(n,"val")?.trim()??""):null;return o?Number(o[1])-1:null}function h(e,t=0,l=e.length,n){let o=new Set,i=new Map,d=new Map,a=n?[n]:[];n&&o.add(n);for(let s=t;s<l;s+=1){let r=e[s].node;if(Af(r,"begin")){a.push(r.id);continue}if(Af(r,"separate")){let u=a[a.length-1];u&&(o.add(u),i.set(r.id,u));continue}if(Af(r,"end")){let u=a.pop();u&&(o.add(u),d.set(r.id,u));}}return {activeBegins:o,separateBegin:i,endBegin:d}}function b(e,t,l){if(Af(l,"begin"))return t.activeBegins.has(l.id)&&e.push({beginId:l.id,separated:false}),true;if(Af(l,"separate")){let n=t.separateBegin.get(l.id),o=e[e.length-1];return n&&o?.beginId===n&&(o.separated=true),true}if(Af(l,"end")){let n=t.endBegin.get(l.id),o=e[e.length-1];return n&&o?.beginId===n&&e.pop(),true}return false}function g(e){for(let t of e)if(!t.separated)return false;return true}function Q(e,t){let l=[];Mf(e,l,t);let n=h(l),o=[];return {consume:i=>b(o,n,i),visible:()=>g(o)}}function C(e,t){return e==="original"?t.hiddenInOriginal:e==="current"&&t.hiddenInCurrent}var L=4096,v=Nf*16;function O(){return {out:[],runs:[],symbols:[],symbolDisplays:[],length:0}}function V(e,t,l,n){if(t.length===0||l===n)return;let o=e.runs[e.runs.length-1];if(o?.runId===t&&o.end===l){e.runs[e.runs.length-1]={runId:t,start:o.start,end:n};return}e.runs.push({runId:t,start:l,end:n});}function N(e,t,l,n){let o=Lf(t);if(o.length>n.left)return false;if(n.left-=o.length,o.length>0){let i=e.length;ib(t)&&(e.symbols.push(i),e.symbolDisplays.push(Xj(t))),e.out.push(o),e.length+=o.length,V(e,l,i,e.length);}return true}function H(e,t){let l=e.length;t.text.length>0&&e.out.push(t.text),e.length+=t.text.length;for(let n of t.runs)V(e,n.runId,l+n.start,l+n.end);for(let n of t.symbols??[])e.symbols.push(l+n);for(let n of t.symbolDisplays??[])e.symbolDisplays.push(n);}function w(e){let t=e.out.join("");return e.symbols.length>0?{text:t,runs:e.runs,symbols:e.symbols,symbolDisplays:e.symbolDisplays}:{text:t,runs:e.runs}}var $=Object.freeze({text:"",runs:[]});function M(){return {text:vf,runs:[]}}function z(e,t,l,n){let o=[];if(!Mf(e,o,l))return null;let i=o.reverse(),d=O();for(;i.length>0;){let a=i.pop();if(!C(t,a)){if(Df(a.node)){let s=[];if(!Mf(a.node,s,l))return null;for(let r=s.length-1;r>=0;r-=1)i.push(s[r]);continue}if(!Bf(a.node)&&!N(d,a.node,a.runId,n))return null}}return w(d)}function G(e,t,l,n,o){let i=O(),d=[],a=h(e);for(let s of e){let r=s.node;if(!b(d,a,r)&&!Bf(r)&&g(d)&&!C(t,s)){if(Df(r)){let u=o>=Of?z(r,t,l,n):U(r,t,l,n,o+1);if(u===null)return null;H(i,u);continue}if(!N(i,r,s.runId,n))return null}}return w(i)}function U(e,t,l,n,o){let i=[];return Mf(e,i,l)?G(i,t,l,n,o):null}function Y(e,t,l){let n=t.node;return e.owned.has(n.id)&&(e.nodesLeft-=1,e.nodesLeft<0&&(e.overflow=true)),n.id===e.endId?true:(n.id===e.span.node.id||b(e.states,e.markers,n)||e.overflow||Bf(n)||Df(n)||!e.owned.has(n.id)||!g(e.states)||C(l,t)||N(e.result,n,t.runId,e.chars)||(e.overflow=true),false)}function le(e,t,l="allMarkup"){let n=new Map,o=new Map,i=new Map;for(let r of t)r.kind==="complex"?o.set(r.node.id,r):i.set(r.node.id,r);let d=[];Mf(e,d);let a=new Map;for(let r=0;r<d.length;r+=1)a.set(d[r].node.id,r);let s=null;for(let r=0;r<d.length;r+=1){let u=d[r],y=i.get(u.node.id);if(y)if(s!==null&&!g(s.states))n.set(y.node.id,$);else {let f={left:L},I={left:v},m=U(y.node,l,f,I,0);n.set(y.node.id,m??M());}if(s===null){let f=o.get(u.node.id);if(!f)continue;let I=new Set(f.removeNodeIds),m=-1;for(let S=f.removeNodeIds.length-1;S>=0;S-=1){let x=a.get(f.removeNodeIds[S]);if(!(x===void 0||x<=r)&&Af(d[x].node,"end")){m=x;break}}let P=d[m];if(!P){n.set(f.node.id,M());continue}s={span:f,owned:I,states:[{beginId:f.node.id,separated:false}],markers:h(d,r+1,m,f.node.id),endId:P.node.id,result:O(),chars:{left:v},nodesLeft:L,overflow:false};}Y(s,u,l)&&(n.set(s.span.node.id,s.overflow?M():w(s.result)),s=null);}return s!==null&&n.set(s.span.node.id,M()),n}export{q as a,Q as b,L as c,le as d};
|