@docx-editor.dev/core 2.26.0 → 2.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +14 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/chunk-2GK7YQB2.cjs +2 -0
- package/dist/chunk-4KZ6L5YF.cjs +15 -0
- package/dist/chunk-55AT3MOU.cjs +25 -0
- package/dist/chunk-6ZQMII6V.js +1 -0
- package/dist/chunk-7IGCWG4H.js +2 -0
- package/dist/chunk-7MYITTAH.js +5 -0
- package/dist/chunk-AVKVRU7Z.cjs +5 -0
- package/dist/{chunk-7RJSH72J.cjs → chunk-CWRBFNK5.cjs} +5 -5
- package/dist/chunk-DGPA3TST.cjs +27 -0
- package/dist/{chunk-6SEIXJTX.js → chunk-DNXVNQEO.js} +1 -1
- package/dist/chunk-FQN4KSFL.cjs +7 -0
- package/dist/{chunk-ELQFXMJ5.cjs → chunk-GVUOWHTO.cjs} +1 -1
- package/dist/chunk-GWQJ5774.js +5 -0
- package/dist/{chunk-5BIASAN3.js → chunk-HAQ72KD7.js} +1 -1
- package/dist/{chunk-TKR2MXX4.cjs → chunk-HO5XFO32.cjs} +1 -1
- package/dist/{chunk-LWCI65EL.js → chunk-IGR23DV2.js} +1 -1
- package/dist/{chunk-EEAV3WIN.js → chunk-JSIX2EOH.js} +1 -1
- package/dist/{chunk-CYT3OQFZ.cjs → chunk-K246T47S.cjs} +1 -1
- package/dist/chunk-KAXOGCGA.js +1 -0
- package/dist/{chunk-AGKIHLWQ.cjs → chunk-LZLTN5A3.cjs} +1 -1
- package/dist/chunk-NBCVVZOM.cjs +1 -0
- package/dist/{chunk-AJCCS53D.js → chunk-O5INAWZQ.js} +1 -1
- package/dist/{chunk-LZDI4P6I.cjs → chunk-OHAXVTWG.cjs} +1 -1
- package/dist/chunk-S74GRBNE.js +7 -0
- package/dist/chunk-UBLUVNZR.js +27 -0
- package/dist/chunk-UMRSBLO7.js +15 -0
- package/dist/chunk-VIPMGGUT.js +25 -0
- package/dist/chunk-WG4KMSX2.cjs +2 -0
- package/dist/chunk-WRLKVNNR.cjs +1 -0
- package/dist/chunk-ZU7IVN6G.js +2 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +14 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +20 -31
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-Cy9imOjA.d.ts → custom-node-writes-Vzpq9I8_.d.ts} +2 -2
- package/dist/{document-protection-Bp19Ad4I.d.ts → document-protection-9zpIHWTE.d.ts} +1 -1
- package/dist/{editor-DYUlyKmb.d.ts → editor-B3OBYNrF.d.ts} +29 -34
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +2 -2
- package/dist/editor.d.ts +28 -27
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +26 -14
- package/dist/export.js +1 -1
- package/dist/{font-resolver-u_nE0PI1.d.ts → font-resolver-DN0xNOf_.d.ts} +1 -1
- package/dist/{headless-document-view-R9bzzepb.d.ts → headless-document-view-ICYqNkQ1.d.ts} +2 -2
- package/dist/{image-resources-DfagDguq.d.ts → image-resources-BDFxcu7W.d.ts} +1 -1
- package/dist/{index-Docw8Dcb.d.ts → index-CkQVRJtJ.d.ts} +53 -21
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-DWitwY73.d.ts → layout-shaping-BvZD_VKP.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +32 -196
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CmfvOJsi.d.ts → note-properties-CkAk7g-n.d.ts} +1 -1
- package/dist/{omml-equation-CZ6IG2ja.d.ts → omml-equation-DuczgG5o.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +8 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-DniKeDb8.d.ts → protocol-aKYr8r3u.d.ts} +6 -5
- package/dist/{review-paragraph-order-Dc8Q6tfM.d.ts → review-paragraph-order-Ddj5d6rp.d.ts} +1 -1
- package/dist/{revision-projection-DfWxdBqA.d.ts → revision-projection-CSNFudZY.d.ts} +74 -3
- package/dist/{semantic-cell-selection-Dy_BmmpL.d.ts → semantic-cell-selection-DoqYCz_F.d.ts} +4 -4
- package/dist/{semantic-interaction-CvFAj0GR.d.ts → semantic-interaction-G0bjmmmk.d.ts} +1 -1
- package/dist/{semantic-paint-Bk9wIXdZ.d.ts → semantic-paint-CsMzF8-O.d.ts} +57 -5
- package/dist/semantic-record-queries-1du6lQqS.d.ts +177 -0
- package/dist/{semantic-records-COqi8pjP.d.ts → semantic-records-B9OolWGN.d.ts} +15 -5
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +22 -17
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-YPyYC1aD.d.ts → tree-package-fragment-DYZIk1rY.d.ts} +3 -3
- package/dist/{tree-session-contract-AeY2v0x9.d.ts → tree-session-contract-DQVJOOkv.d.ts} +5 -5
- package/dist/{types-barrel-BO73JqHG.d.ts → types-barrel-BFKR8Pzp.d.ts} +134 -110
- package/package.json +3 -3
- package/dist/chunk-2BK4G4ZN.js +0 -2
- package/dist/chunk-2SJX44PC.cjs +0 -2
- package/dist/chunk-73PG6L2X.js +0 -1
- package/dist/chunk-AN6WM4X4.js +0 -2
- package/dist/chunk-ANZ44KQT.cjs +0 -12
- package/dist/chunk-DDGGSBAN.js +0 -12
- package/dist/chunk-EYK4K2J6.js +0 -1
- package/dist/chunk-JNTETUNZ.cjs +0 -1
- package/dist/chunk-L6V3IJ3S.js +0 -5
- package/dist/chunk-NS22DVWT.cjs +0 -2
- package/dist/chunk-QIE3YTU4.cjs +0 -2
- package/dist/chunk-QVBFPAGO.js +0 -5
- package/dist/chunk-RCCOLZEQ.js +0 -2
- package/dist/chunk-SUN62YU6.cjs +0 -5
- package/dist/chunk-TKQH7BNE.cjs +0 -1
- package/dist/chunk-UJL2GDIM.cjs +0 -25
- package/dist/chunk-WQTADNHK.cjs +0 -27
- package/dist/chunk-XSHXBJ2J.js +0 -25
- package/dist/chunk-YXZEBTDF.js +0 -27
package/dist/chunk-EYK4K2J6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {je,Oe,Ra,ea,hb,od,le as le$1,md,bd,ne,me,Ne,ie,Ba,ee,za,Ca,ya,ta,Ia,Ue,Bc,Gb,df,Ze,$e,zc,_e}from'./chunk-XSHXBJ2J.js';import {ab,ea as ea$1,fa,ua,Ha,Ja,Pa,La}from'./chunk-L6V3IJ3S.js';import {Td,Ig,Oc,Pe,_i,$a,Uf,Sa,cd,qd,W,bd as bd$1,ad,ud,td,$c,Eh,aj,Of,fa as fa$1,sa}from'./chunk-DDGGSBAN.js';var Mt=Object.freeze({}),Et=Object.freeze([]);function Lt(e){let t=Object.keys(e);if(t.length===0)return Mt;let r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=o);}return Object.freeze(r)}function At(e){let t=new Map(Uf(e.part())),r=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!r.has(i)){r.add(i);for(let[s,d]of Uf(i))t.has(s)||t.set(s,d);}let n=e.currentPackage();for(let o of ["footnote","endnote"]){let a=Ig(n,o);if(!(!a||r.has(a))){r.add(a);for(let[i,s]of Uf(a))t.has(i)||t.set(i,s);}}return t}function Ft(e,t){let r=df(e,t);if(!r)return null;let n=e.pages[r.pageIndex];if(!n)return null;let o=Ze(n),a=$e(e,t.paragraphId,r.pageIndex),i=Object.freeze({x:r.x+a.x,y:r.y+a.y,height:r.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:r.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function Tt(e,t){let r=[];for(let n of t.values()){let o=Ft(e,n);o&&r.push(o);}return r.length===0?Et:Object.freeze(r)}function rt(e,t){return {documentMetadata:Lt(e.documentProperties()),destinations:Tt(t,At(e))}}function gr(e,t){let r=e.destinations;if(r){for(let n of r)if(n.anchor.name===t)return n}}function nt(e={}){return Object.freeze({async decode(t,r,n){let o=Td(t,r);if(!o)throw new Error(`Unsupported or malformed ${r} image`);if(o.pixelWidth>n.maxDimension||o.pixelHeight>n.maxDimension||o.pixelWidth>n.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var ot=new WeakMap;function at(e,t){let r=ot.get(e);r||(r=md(e),ot.set(e,r));let n=r.styleCascade(),o=new Set;if(t===e.part())for(let d of Bc(t,void 0,void 0,n,r.numberingIndex()))for(let h of Gb(d)?.slice(0,-1)??[])o.add(h.paragraph.id);let a=d=>{if(d.kind==="textValue")return false;let h=d.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===fa$1&&c.localName==="pPr"),f=h?.kind!=="textValue"?h?.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===fa$1&&c.localName==="rPr"):void 0;return f!==void 0&&sa(f,"vanish")},i=0,s=(d,h)=>{if(++i>qd||h>W||d.kind==="textValue")return false;if(d.kind==="paragraph"&&!o.has(d.id)&&(zc(d,n,false)||a(d))&&Of(d).length>0)return true;for(let f of d.children){if(i>=qd)break;if(s(f,h+1))return true}return false};return s(t.root,0)}var it=new WeakMap,Ct=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function Nt(e,t){let r=it.get(e.root);if(r&&r.stylesPart===t)return r.codes;let n=Sa(t),o=new Set,a=[{node:e.root,scope:cd(),depth:0,mcSelected:false,framed:false}],i=0;for(;a.length;){let{node:d,scope:h,depth:f,mcSelected:c,framed:p}=a.pop();if(++i>qd||f>W){o.add("scan-limit");break}if(d.kind==="textValue")continue;if(i+a.length+d.children.length>qd){o.add("scan-limit");break}let g=bd$1(h,d),x=p||n(d),u=ad(d)?d:void 0;if(u){if(ud(u,g).drawing)continue;let m=td(u,g);m.refused&&o.add("scan-limit"),m.branch&&a.push({node:m.branch,scope:g,depth:f+1,mcSelected:true,framed:x});continue}if(!(!c&&$c(d)&&!(x&&d.localName==="object"))){if(d.namespaceUri==="urn:schemas-microsoft-com:vml"&&d.localName==="textbox"){o.add("legacy-textbox");continue}d.namespaceUri==="urn:schemas-microsoft-com:vml"&&Ct.has(d.localName)&&!d.children.some(m=>m.kind!=="textValue"&&m.namespaceUri==="urn:schemas-microsoft-com:vml"&&m.localName==="textbox")&&o.add("legacy-drawing");for(let m of d.children)a.push({node:m,scope:g,depth:f+1,mcSelected:c,framed:x});}}let s=Object.freeze([...o]);return it.set(e.root,{stylesPart:t,codes:s}),s}function st(e){let t=new Set([e.part()]);for(let r of e.headerFooterPartsBySection())for(let n of [r.headers,r.footers])for(let o of n.values())t.add(o);for(let r of ["footnote","endnote"]){let n=Ig(e.currentPackage(),r);n&&t.add(n);}return Object.freeze([...t].flatMap(r=>[...Nt(r,Oc(e.currentPackage())),...at(e,r)?["unsupported-style-separator"]:[]].map(n=>Object.freeze({code:n,partName:r.name}))))}function ct(e){let t=e.defaultTabStopPt?.(),r=e.view.part().name,n={view:e.view,measurer:e.measurer,producer:e.producer,cache:e.cache,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,compatibilityMode:e.compatibilityMode?.(),inlineDrawingLayoutForPart:e.inlineDrawingLayoutForPart,drawingTokenForParagraphForPart:e.drawingTokenForParagraphForPart,drawingLayoutEpochForPart:e.drawingLayoutEpochForPart,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},o=je(n),a={view:e.view,revision:e.revision,measurer:e.measurer,cache:e.cache,session:e.session,producer:e.producer,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,furniture:e.furniture,compatibilityMode:e.compatibilityMode,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,inlineDrawingLayout:e.inlineDrawingLayout,drawingTokenForParagraph:e.drawingTokenForParagraph,drawingLayoutEpoch:e.drawingLayoutEpoch,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},i={measurer:a.measurer,cache:a.cache,session:a.session,producer:a.producer,styleCascade:a.styleCascade?.(),defaultTabStopPt:a.defaultTabStopPt,compatibilityMode:a.compatibilityMode?.(),numberingIndex:a.numberingIndex?.(),sectionFurniture:a.furniture.sectionFurniture(),furniture:a.furniture.furniture(),evenAndOddHeaders:a.view.headerFooterPartsBySection()[0]?.evenAndOddHeaders===true,projectLink:a.linkProjectors.projectLink,projectFieldLink:a.projectFieldLink,showFieldCodes:a.showFieldCodes,documentProperties:a.view.documentProperties(),inlineDrawingLayout:a.inlineDrawingLayout,drawingTokenForParagraph:a.drawingTokenForParagraph,drawingLayoutEpoch:a.drawingLayoutEpoch,projectionTokenForParagraph:s=>a.linkProjectors.tokenForParagraphForPart(r,s),projectionTokenForTable:s=>a.linkProjectors.tokenForTableForPart(r,s),projectionEpoch:a.linkProjectors.epochForPart(r),notes:o,displayMode:a.displayMode,revisionAuthorFilter:a.revisionAuthorFilter};return Oe(a.view.part(),a.revision,i)}var jt=65536;function lt(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function _t(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function Bt(e,t,r){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===r:true}function Vt(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let r=null;return ya(e,n=>{if(r||!Bt(t,n.story,n.noteScopeId))return;let o=n.story==="header"||n.story==="footer"?a=>ta(a,n.origin,{x:e.box.x,y:e.box.y}):void 0;Ca(n.host,(a,i)=>{if(r||i.textboxDepth===0)return;let s=i.textboxPath.map(d=>d.drawingNodeId);_t(s,t.textboxPath)&&(r=lt(e,i.storyOrigin));},n.origin,o);}),r}function Kt(e,t){if(t.story==="textbox")return Vt(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?_e(e,e.header.box):{x:0,y:0};case "footer":return e.footer?_e(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let n=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return n?_e(e,n.box):{x:0,y:0}}case "note-separator":{let r=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes,n=r?.separator?.box;return r?.continuationNotice&&Ca(r.continuationNotice,o=>{o.paragraphId===t.source.start.paragraphId&&(n=r.continuationNotice.box);}),n?_e(e,n):{x:0,y:0}}default:return {x:0,y:0}}}function pt(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function mt(e,t){let r=Ze(e);return Object.freeze({x:r.x+t.x,y:r.y+t.y,width:t.width,height:t.height})}function zt(e,t){let r=df(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!r||r.pageIndex!==t.pageIndex)return;let n=e.pages[r.pageIndex];if(!n)return;let o=Kt(n,t),a=Object.freeze([pt({x:r.x+o.x,y:r.y+o.y,width:0,height:r.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>mt(n,i)))})}function Ht(e,t,r){let n=r.filter(i=>i.pageIndex===t.pageIndex);if(n.length===0)return ft(t)?zt(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(n.map(i=>pt(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>mt(o,i)))})}function ft(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function ut(e,t){return `${e}\0${t}`}function Wt(e,t,r){let n=Math.max(e.start,t.offset),o=Math.min(e.end,r.offset);return o>n?{start:n,end:o}:null}function $t(e,t){let r=new Map,n=new Map,o=new Set,a=0;let i=(s,d)=>{if(a>=jt)return false;a+=1;let h=ut(s.pageIndex,d),f=n.get(h);return f?f.push(s):n.set(h,[s]),true};for(let[s,d]of t.entries())for(let[h,f]of d.occurrences.entries()){if(ft(f)||f.source.start.paragraphId!==f.source.end.paragraphId)continue;o.add(f.pageIndex);let c=`${s}\0${h}`,p={paragraphId:f.source.start.paragraphId,offset:f.source.start.offset},g={paragraphId:f.source.end.paragraphId,offset:f.source.end.offset},x=p.offset<=g.offset?{from:p,to:g}:{from:g,to:p};i({key:c,from:x.from,to:x.to,pageIndex:f.pageIndex},x.from.paragraphId);}if(n.size===0)return r;for(let s of e.pages)o.has(s.index)&&ya(s,d=>{let h=d.story==="header"||d.story==="footer"?f=>ta(f,d.origin,{x:s.box.x,y:s.box.y}):void 0;Ca(d.host,(f,c)=>{let p=lt(s,c.storyOrigin);for(let g of f.lines)for(let x of Ia(g)){let u=n.get(ut(s.index,x.paragraphId));if(u)for(let m of u){let w=Wt(x,m.from,m.to);if(!w)continue;let b=Ue(g,w.start,void 0,x),S=Ue(g,w.end,void 0,x,w.end>w.start),R=r.get(m.key)??[];R.push({pageIndex:s.index,x:Math.min(b,S)+p.x,y:g.box.y+p.y,width:Math.abs(S-b),height:g.box.height}),r.set(m.key,R);}}},d.origin,h);});return r}function yt(e,t){let r=false;for(let o of t)if(o.occurrences.length!==0){r=true;break}if(!r)return t;let n=$t(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,d)=>{let h=`${a}\0${d}`,f=Ht(e,s,n.get(h)??[]);return f?{...s,geometry:f}:s});return {...o,occurrences:Object.freeze(i)}})}function Ut(e){let t=new Map,r=[{node:e.root,depth:0}];for(;r.length>0;){let{node:n,depth:o}=r.pop();if(!(n.kind==="textValue"||o>64)){n.kind==="paragraph"&&!t.has(n.id)&&t.set(n.id,t.size);for(let a=n.children.length-1;a>=0;a-=1)r.push({node:n.children[a],depth:o+1});}}return t}function gt(){let e=new Map,t=n=>{let o=e.get(n.root);if(o)return o;let a=Ut(n);return e.set(n.root,a),a},r={retainRevisionItems:false,revisionSites:aj,locations:La,commentAnchors:Eh,deepOrder:t};return Object.freeze({collectReviewItems:n=>Pa(n,r),deepParagraphOrderOfPart:t})}function Gt(e,t){if(t)return true;let r=e.map(n=>n.root);for(;r.length>0;){let n=r.pop();if(_i(n))return true;if(n.kind!=="textValue")for(let o of n.children)r.push(o);}return false}function Yt(e,t){let r=[],n=new Set([t.name]),o=a=>{!a||n.has(a.name)||(n.add(a.name),r.push(a));};for(let a of Pe(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(Ig(e,"footnote")),o(Ig(e,"endnote")),r}function Xt(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return Ig(e,"footnote")?.name??null;case "endnote":return Ig(e,"endnote")?.name??null;case "note-separator":return Ig(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function qt(e,t){let r=new Map;for(let n of e){let o=t.get(n.partName),a=o?.get(n.start.paragraphId),i=o?.get(n.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),d=Math.max(a,i),h=r.get(n.partName);r.set(n.partName,{lower:Math.min(h?.lower??s,s),upper:Math.max(h?.upper??d,d)});}return r}function Jt(e,t,r,n,o){let a=new Map(r.map(c=>[c.name,o(c)])),i=qt(n,a),s=new Map,d=new Map,h=(c,p,g,x,u,m,w)=>{let b=a.get(c)?.get(u),S=i.get(c);if(b===void 0||!S||b<S.lower||b>S.upper)return;let R=s.get(c)??new Map;s.set(c,R);let V=d.get(c)??new Map;d.set(c,V);let j=JSON.stringify([p.story,p.noteScopeId,p.noteAreaKind]),X=g==="textbox"?JSON.stringify([j,"textbox",x]):j,H=R.get(u)??[],W=`${u}\0${p.page.index}\0${X}`,T=V.get(W);T||(T={pageIndex:p.page.index,story:g,rootStory:p.story,textboxPath:x,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,laneKey:X,intervals:[],intervalKeys:new Set},V.set(W,T),H.push(T),R.set(u,H));let y=`${m}\0${w}`;T.intervalKeys?.has(y)||(T.intervalKeys?.add(y),T.intervals.push({start:m,end:w}));};za(e,c=>{let p=Xt(t,c);!p||!i.has(p)||Ca(c.host,(g,x)=>{let u=x.textboxDepth>0?"textbox":c.story,m=x.textboxPath.map(b=>b.drawingNodeId),w=[];for(let b of g.lines){for(let S of b.spans)w.push(S.range);for(let S of b.drawings??[])w.push({paragraphId:S.paragraphId,start:S.start,end:S.start+1});}w.length===0&&w.push({paragraphId:g.range.paragraphId,start:g.range.start,end:g.range.end});for(let{paragraphId:b,start:S,end:R}of w)h(p,c,u,m,b,S,R);});}),Ba(e,c=>{let p=c.drawing.ownerPartName;c.drawing.accessibility.hidden||!i.has(p)||h(p,c.root,c.story,c.textboxPath.map(g=>g.drawingNodeId),c.drawing.paragraphId,c.drawing.start,c.drawing.start+1);});for(let c of s.values())for(let p of c.values())for(let g of p){g.intervals.sort((u,m)=>u.start-m.start||u.end-m.end);let x=[];for(let u of g.intervals){let m=x.at(-1);m&&u.start<=m.end?m.end=Math.max(m.end,u.end):x.push({...u});}g.intervals.splice(0,g.intervals.length,...x),g.intervalKeys=void 0;}let f=new Map;for(let[c,p]of s){let g=a.get(c);if(!g)continue;let x=[];for(let[u,m]of p){let w=g.get(u);w!==void 0&&x.push({paragraphId:u,position:w,laneKeys:new Set(m.map(({laneKey:b})=>b))});}x.sort((u,m)=>u.position-m.position),f.set(c,x);}return {byPart:s,orderByPart:a,visibleByPart:f}}function ht(e,t){let r=0,n=e.length;for(;r<n;){let o=r+n>>>1;e[o].position<t?r=o+1:n=o;}return r}function Qt(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let r=t.orderByPart.get(e.partName),n=t.visibleByPart.get(e.partName),o=r?.get(e.start.paragraphId),a=r?.get(e.end.paragraphId);if(!r||!n||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),d=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:c})=>c)??[]),h=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:c})=>c)??[]),f=new Set([...d].filter(c=>h.has(c)));return f.size===0?[e.start.paragraphId,e.end.paragraphId]:n.slice(ht(n,i),ht(n,s+1)).filter(c=>[...c.laneKeys].some(p=>f.has(p))).map(c=>c.paragraphId)}function Zt(e,t,r,n){return n?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,r)};return a.end>a.start?[a]:[]})}function er(e,t){let r=Number.NEGATIVE_INFINITY;for(let n of e)for(let o of n.intervals)r=Math.max(r,o.end);return t!==r?new Set:new Set(e.filter(n=>n.intervals.some(o=>o.end===r)))}function xt(e,t,r){let n=[],o=new Set;for(let[a,i]of e.entries()){let s=r===void 0?void 0:r===null?"neutral":a<r?"replaced":"replacement";for(let d of Qt(i,t)){let h=t.byPart.get(i.partName)?.get(d)??[],c=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,p=d===i.start.paragraphId?i.start.offset:0,g=d===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,x=c?er(h,p):new Set;for(let u of h){let m=Zt(u,p,g,c);c&&m.length===0&&x.has(u)&&(m=[{start:p,end:p}]);for(let w of m){let b=`${u.pageIndex}\0${u.story}\0${u.noteScopeId??""}\0${u.noteAreaKind??""}\0${u.textboxPath.join("\0")}\0${i.partName}\0${d}\0${w.start}\0${w.end}\0${s??""}`;o.has(b)||(o.add(b),n.push({pageIndex:u.pageIndex,physicalPageNumber:u.pageIndex+1,story:u.story,rootStory:u.rootStory,textboxPath:u.textboxPath,noteScopeId:u.noteScopeId,noteAreaKind:u.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:d,offset:w.start},end:{paragraphId:d,offset:w.end}}}));}}}}return n}function bt(e,t){let r=2166136261,n=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);r=Math.imul(r^a,16777619)>>>0,n=Math.imul(n^a+o,2246822507)>>>0,n^=n>>>13;}return `${e}_${t.length.toString(36)}_${r.toString(36)}_${n.toString(36)}`}function wt(e,t,r=bt){let n=new Map;for(let a of t){let i=r(e,a),s=n.get(i)??new Set;s.add(a),n.set(i,s);}let o=new Map;for(let[a,i]of n){let s=[...i].sort();for(let[d,h]of s.entries())o.set(h,s.length===1?a:`${a}_${d.toString(36)}`);}return o}function tr(e){let t=new Set,r=new Set;for(let n of e){if(n.kind==="comment"){t.add(n.id),n.parentId!==void 0&&t.add(n.parentId),n.parentRevisionId!==void 0&&r.add(n.parentRevisionId);for(let o of n.replyIds)t.add(o);}if(n.kind==="revision"){r.add(n.id),n.pairedWith!==void 0&&r.add(n.pairedWith);for(let o of n.replyIds)t.add(o);}}return {comment:wt("comment",t),revision:wt("change",r)}}function B(e,t,r){return e.get(r)??bt(t,r)}function rr(e,t,r){return e.kind==="revision"?{kind:"tracked-change",id:B(r.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:$a(e.text),replacedText:$a(e.replacedText),nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:B(r.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),occurrences:t?xt(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:B(r.comment,"comment",e.id),author:e.comment.author,initials:Ja(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:Ha(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:B(r.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:B(r.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),orphaned:e.orphaned,occurrences:t&&e.range?xt([e.range],t):[]}}function Pt(e,t){let r=t.parts.get(t.mainDocumentPart);if(!r)return [];let n=Yt(t,r),o=[r,...n],a=t.parts.get(ea$1(t,r.name));if(!Gt(o,a))return [];let i=gt(),s=i.collectReviewItems({storyPart:r,furnitureParts:n,commentsPart:a,commentsExtendedPart:t.parts.get(fa(t,r.name))});if(s.length===0)return [];let d=s.flatMap(c=>ua(c)),h=d.length>0?Jt(e,t,o,d,i.deepParagraphOrderOfPart):null,f=tr(s);return s.map(c=>rr(c,h,f)).filter(c=>c!==null)}var nr=new Set(["part","validatedHandle"]);function St(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Y(e,t,r,n,o){if(!(n!==void 0&&nr.has(n))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(r.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),r.add(e);try{if(Array.isArray(e)){for(let a of e)Y(a,t,r,void 0,o);Object.freeze(e);return}if(!St(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");Y(i.value,t,r,a,o);}}Object.freeze(e);}finally{r.delete(e);}}}}}function vt(e){if(!St(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let n of e.pages)if(!(n===null||typeof n!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(n,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),Y(i,new Set,s,o),t.add(i);}let r=(n,o)=>{let a=new Set;for(let i of n){let s=new Set;s.add(e),Y(i,a,s,void 0,o);}Object.freeze(n);};for(let n of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,n);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(n==="pages"&&Array.isArray(o.value)){r(o.value,t);continue}if(n==="reviewArtifacts"&&Array.isArray(o.value)){r(o.value);continue}let a=new Set;a.add(e),Y(o.value,new Set,a,n);}return Object.freeze(e),e}var or=Object.freeze([]),k=class extends Error{constructor(r,n,o){super(n,o);this.code=r;this.name="ExportResourceError";}code};function ar(e){try{return e instanceof k}catch{return false}}function ir(e){try{return e instanceof ee}catch{return false}}function sr(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function cr(e){if(ar(e))return e;let t=ir(e),r=sr(e),n=r?`: ${r}`:"",o=new k(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${n}`:`Export layout failed${n}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function dr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function It(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var ur=50,le=64;function lr(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function pr(e){let t=false;return Ba(e,({drawing:r})=>{lr(r.resource)&&(t=true);}),t}function Rt(e){return !ArrayBuffer.isView(e)}function Mn(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let r=It(t.displayMode??Ra),n=Rt(e),o=Rt(e)?{ok:true,view:e}:ab(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??n,s=dr(t.resourceTimeoutMs),d=t.measurer??ea(),h=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),f=hb({retainAcrossPasses:i}),c=0,p=new Set,g=()=>{c+=1;for(let y of p)y();p.clear();},x=od({session:a,decodePort:t.imageDecodePort??nt(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:g}),u={view:a,measurer:d,paragraphCache:f,sessions:new Map,completed:new Map,inFlight:new Map,styles:md(a),fieldLinks:new Map,links:le$1(a),drawingBundle:x,furniture:new Map},m=new AbortController,w=t.signal,b=false,S=()=>b?new k("aborted","Export resource settlement was aborted"):new k("disposed","Export session has been disposed"),R=()=>{b=true,V();};function V(){let y=u;if(y){u=null,w?.removeEventListener("abort",R),m.abort(w?.reason),y.drawingBundle.dispose(),y.paragraphCache.clear();for(let P of y.completed.values())bd(P.internal),ne(P.internal);for(let P of y.fieldLinks.values())P.registry.clear();y.fieldLinks.clear(),y.completed.clear(),y.inFlight.clear(),y.furniture.clear(),y.sessions.clear(),g();}}w?.addEventListener("abort",R,{once:true}),w?.aborted&&R();let j=()=>{if(!u)throw S();if(m.signal.aborted)throw new k("aborted","Export resource settlement was aborted")},X=(y,P,D,l)=>c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D?Promise.resolve():(j(),new Promise((_,O)=>{let M=false,C,E=A=>{M||(M=true,C!==void 0&&clearTimeout(C),p.delete(L),m.signal.removeEventListener("abort",$),A?O(A):_());},L=()=>E(),$=()=>E(new k("aborted","Export resource settlement was aborted")),U=()=>{if(u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}let A=l-Date.now();if(A<=0){E(new k("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(U,Math.min(ur,A));};if(p.add(L),m.signal.addEventListener("abort",$,{once:true}),c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}U();})),H=async(y,P=0,D=Date.now()+s)=>{if(j(),Date.now()>=D)throw new k("timedOut",`Export layout did not stabilize within ${s}ms`);let l=u,_=D,O=l.view.packageRevision(),M=l.view.currentPackage(),C=l.completed.get(y);if(C&&C.revision===O&&C.pkg===M)return C.published;let E=()=>{if(l.view.packageRevision()===O&&l.view.currentPackage()===M)return null;if(P>=le-1)throw new k("nonConvergent","Document revision did not stabilize during export layout");return H(y,P+1,_)},L=l.fieldLinks.get(y);if(!L||L.revision!==O||L.pkg!==M){let I=L?.registry??me();I.clear(),L={revision:O,pkg:M,registry:I},l.fieldLinks.set(y,L),l.furniture.delete(y);}let $=L.registry,U=l.sessions.get(y)??Ne();l.sessions.set(y,U);let A=l.furniture.get(y);A||(A=ie({view:l.view,measurer:l.measurer,producer:h,cache:l.paragraphCache,styleCascade:l.styles.styleCascade,numberingIndex:l.styles.numberingIndex,defaultTabStopPt:l.styles.defaultTabStopPt,compatibilityMode:l.styles.compatibilityMode,displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false,inlineDrawingLayoutForPart:I=>l.drawingBundle.contextForPart(I),drawingLayoutTokenForPart:I=>l.drawingBundle.cacheTokenForPart(I),drawingTokenForParagraphForPart:(I,ne)=>l.drawingBundle.drawingTokenForParagraph(ne,I),linkProjectors:l.links,projectFieldLink:I=>$.project(I)}),l.furniture.set(y,A));for(let I=0;I<le;I+=1){let ne$1=c;l.drawingBundle.sync(l.view);let pe=E();if(pe)return pe;let N=ct({view:l.view,revision:l.view.packageRevision(),measurer:l.measurer,cache:l.paragraphCache,session:U,producer:h,styleCascade:l.styles.styleCascade,defaultTabStopPt:l.styles.defaultTabStopPt,numberingIndex:l.styles.numberingIndex,furniture:A,compatibilityMode:l.styles.compatibilityMode,linkProjectors:l.links,projectFieldLink:v=>$.project(v),inlineDrawingLayout:l.drawingBundle.bodyContext,inlineDrawingLayoutForPart:v=>l.drawingBundle.contextForPart(v),drawingTokenForParagraph:v=>l.drawingBundle.drawingTokenForParagraph(v,l.view.part().name),drawingTokenForParagraphForPart:(v,q)=>l.drawingBundle.drawingTokenForParagraph(q,v),drawingLayoutEpoch:l.drawingBundle.cacheTokenForPart(l.view.part().name),drawingLayoutEpochForPart:v=>l.drawingBundle.cacheTokenForPart(v),displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false});if(!pr(N)){let v=E();if(v)return v;i||(bd(N),ne(N),l.paragraphCache.clear(),l.sessions.delete(y),l.furniture.delete(y));let q=Pt(N,M),Ot=q.length===0?or:Object.freeze(yt(N,q)),kt=rt(l.view,N),Dt={...N,...kt,contentWarnings:st(l.view),reviewArtifacts:Ot},ye=vt(Dt);return l.completed.set(y,{revision:O,pkg:M,internal:N,published:ye}),ye}let me=ne$1;for(;l.drawingBundle.pendingResourceCount()>0;){await X(me,O,M,_),me=c,j();let v=E();if(v)return v}j();let fe=E();if(fe)return fe}throw new k("nonConvergent",`Image resources did not reach quiescence after ${le} layout passes`)},W=y=>{let P;try{P=It(y);}catch(O){return Promise.reject(O)}if(!u)return Promise.reject(S());let D=u,l=D.inFlight.get(P);if(l)return l;let _=H(P).catch(O=>{throw cr(O)}).finally(()=>D.inFlight.delete(P));return D.inFlight.set(P,_),_};return {ok:true,session:{layout:()=>W(r),layoutFor:W,validatedImageBytes(y){let P=u;return !P||y.resource.kind!=="ready"?null:P.drawingBundle.mintValidatedBytes(y.resource.validatedHandle,y.resource.contentId)?.slice()??null},dispose:V}}}export{ct as a,gr as b,nt as c,k as d,Mn as e};
|
package/dist/chunk-JNTETUNZ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkUJL2GDIM_cjs=require('./chunk-UJL2GDIM.cjs'),chunkSUN62YU6_cjs=require('./chunk-SUN62YU6.cjs'),chunkANZ44KQT_cjs=require('./chunk-ANZ44KQT.cjs');var Mt=Object.freeze({}),Et=Object.freeze([]);function Lt(e){let t=Object.keys(e);if(t.length===0)return Mt;let r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=o);}return Object.freeze(r)}function At(e){let t=new Map(chunkANZ44KQT_cjs.Uf(e.part())),r=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!r.has(i)){r.add(i);for(let[s,d]of chunkANZ44KQT_cjs.Uf(i))t.has(s)||t.set(s,d);}let n=e.currentPackage();for(let o of ["footnote","endnote"]){let a=chunkANZ44KQT_cjs.Ig(n,o);if(!(!a||r.has(a))){r.add(a);for(let[i,s]of chunkANZ44KQT_cjs.Uf(a))t.has(i)||t.set(i,s);}}return t}function Ft(e,t){let r=chunkUJL2GDIM_cjs.df(e,t);if(!r)return null;let n=e.pages[r.pageIndex];if(!n)return null;let o=chunkUJL2GDIM_cjs.Ze(n),a=chunkUJL2GDIM_cjs.$e(e,t.paragraphId,r.pageIndex),i=Object.freeze({x:r.x+a.x,y:r.y+a.y,height:r.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:r.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function Tt(e,t){let r=[];for(let n of t.values()){let o=Ft(e,n);o&&r.push(o);}return r.length===0?Et:Object.freeze(r)}function rt(e,t){return {documentMetadata:Lt(e.documentProperties()),destinations:Tt(t,At(e))}}function gr(e,t){let r=e.destinations;if(r){for(let n of r)if(n.anchor.name===t)return n}}function nt(e={}){return Object.freeze({async decode(t,r,n){let o=chunkANZ44KQT_cjs.Td(t,r);if(!o)throw new Error(`Unsupported or malformed ${r} image`);if(o.pixelWidth>n.maxDimension||o.pixelHeight>n.maxDimension||o.pixelWidth>n.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var ot=new WeakMap;function at(e,t){let r=ot.get(e);r||(r=chunkUJL2GDIM_cjs.md(e),ot.set(e,r));let n=r.styleCascade(),o=new Set;if(t===e.part())for(let d of chunkUJL2GDIM_cjs.Bc(t,void 0,void 0,n,r.numberingIndex()))for(let h of chunkUJL2GDIM_cjs.Gb(d)?.slice(0,-1)??[])o.add(h.paragraph.id);let a=d=>{if(d.kind==="textValue")return false;let h=d.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===chunkANZ44KQT_cjs.fa&&c.localName==="pPr"),f=h?.kind!=="textValue"?h?.children.find(c=>c.kind!=="textValue"&&c.namespaceUri===chunkANZ44KQT_cjs.fa&&c.localName==="rPr"):void 0;return f!==void 0&&chunkANZ44KQT_cjs.sa(f,"vanish")},i=0,s=(d,h)=>{if(++i>chunkANZ44KQT_cjs.qd||h>chunkANZ44KQT_cjs.W||d.kind==="textValue")return false;if(d.kind==="paragraph"&&!o.has(d.id)&&(chunkUJL2GDIM_cjs.zc(d,n,false)||a(d))&&chunkANZ44KQT_cjs.Of(d).length>0)return true;for(let f of d.children){if(i>=chunkANZ44KQT_cjs.qd)break;if(s(f,h+1))return true}return false};return s(t.root,0)}var it=new WeakMap,Ct=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function Nt(e,t){let r=it.get(e.root);if(r&&r.stylesPart===t)return r.codes;let n=chunkANZ44KQT_cjs.Sa(t),o=new Set,a=[{node:e.root,scope:chunkANZ44KQT_cjs.cd(),depth:0,mcSelected:false,framed:false}],i=0;for(;a.length;){let{node:d,scope:h,depth:f,mcSelected:c,framed:p}=a.pop();if(++i>chunkANZ44KQT_cjs.qd||f>chunkANZ44KQT_cjs.W){o.add("scan-limit");break}if(d.kind==="textValue")continue;if(i+a.length+d.children.length>chunkANZ44KQT_cjs.qd){o.add("scan-limit");break}let g=chunkANZ44KQT_cjs.bd(h,d),x=p||n(d),u=chunkANZ44KQT_cjs.ad(d)?d:void 0;if(u){if(chunkANZ44KQT_cjs.ud(u,g).drawing)continue;let m=chunkANZ44KQT_cjs.td(u,g);m.refused&&o.add("scan-limit"),m.branch&&a.push({node:m.branch,scope:g,depth:f+1,mcSelected:true,framed:x});continue}if(!(!c&&chunkANZ44KQT_cjs.$c(d)&&!(x&&d.localName==="object"))){if(d.namespaceUri==="urn:schemas-microsoft-com:vml"&&d.localName==="textbox"){o.add("legacy-textbox");continue}d.namespaceUri==="urn:schemas-microsoft-com:vml"&&Ct.has(d.localName)&&!d.children.some(m=>m.kind!=="textValue"&&m.namespaceUri==="urn:schemas-microsoft-com:vml"&&m.localName==="textbox")&&o.add("legacy-drawing");for(let m of d.children)a.push({node:m,scope:g,depth:f+1,mcSelected:c,framed:x});}}let s=Object.freeze([...o]);return it.set(e.root,{stylesPart:t,codes:s}),s}function st(e){let t=new Set([e.part()]);for(let r of e.headerFooterPartsBySection())for(let n of [r.headers,r.footers])for(let o of n.values())t.add(o);for(let r of ["footnote","endnote"]){let n=chunkANZ44KQT_cjs.Ig(e.currentPackage(),r);n&&t.add(n);}return Object.freeze([...t].flatMap(r=>[...Nt(r,chunkANZ44KQT_cjs.Oc(e.currentPackage())),...at(e,r)?["unsupported-style-separator"]:[]].map(n=>Object.freeze({code:n,partName:r.name}))))}function ct(e){let t=e.defaultTabStopPt?.(),r=e.view.part().name,n={view:e.view,measurer:e.measurer,producer:e.producer,cache:e.cache,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,compatibilityMode:e.compatibilityMode?.(),inlineDrawingLayoutForPart:e.inlineDrawingLayoutForPart,drawingTokenForParagraphForPart:e.drawingTokenForParagraphForPart,drawingLayoutEpochForPart:e.drawingLayoutEpochForPart,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},o=chunkUJL2GDIM_cjs.je(n),a={view:e.view,revision:e.revision,measurer:e.measurer,cache:e.cache,session:e.session,producer:e.producer,styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,defaultTabStopPt:t,furniture:e.furniture,compatibilityMode:e.compatibilityMode,linkProjectors:e.linkProjectors,projectFieldLink:e.projectFieldLink,showFieldCodes:e.showFieldCodes,inlineDrawingLayout:e.inlineDrawingLayout,drawingTokenForParagraph:e.drawingTokenForParagraph,drawingLayoutEpoch:e.drawingLayoutEpoch,displayMode:e.displayMode,revisionAuthorFilter:e.revisionAuthorFilter},i={measurer:a.measurer,cache:a.cache,session:a.session,producer:a.producer,styleCascade:a.styleCascade?.(),defaultTabStopPt:a.defaultTabStopPt,compatibilityMode:a.compatibilityMode?.(),numberingIndex:a.numberingIndex?.(),sectionFurniture:a.furniture.sectionFurniture(),furniture:a.furniture.furniture(),evenAndOddHeaders:a.view.headerFooterPartsBySection()[0]?.evenAndOddHeaders===true,projectLink:a.linkProjectors.projectLink,projectFieldLink:a.projectFieldLink,showFieldCodes:a.showFieldCodes,documentProperties:a.view.documentProperties(),inlineDrawingLayout:a.inlineDrawingLayout,drawingTokenForParagraph:a.drawingTokenForParagraph,drawingLayoutEpoch:a.drawingLayoutEpoch,projectionTokenForParagraph:s=>a.linkProjectors.tokenForParagraphForPart(r,s),projectionTokenForTable:s=>a.linkProjectors.tokenForTableForPart(r,s),projectionEpoch:a.linkProjectors.epochForPart(r),notes:o,displayMode:a.displayMode,revisionAuthorFilter:a.revisionAuthorFilter};return chunkUJL2GDIM_cjs.Oe(a.view.part(),a.revision,i)}var jt=65536;function lt(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function _t(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function Bt(e,t,r){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===r:true}function Vt(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let r=null;return chunkUJL2GDIM_cjs.ya(e,n=>{if(r||!Bt(t,n.story,n.noteScopeId))return;let o=n.story==="header"||n.story==="footer"?a=>chunkUJL2GDIM_cjs.ta(a,n.origin,{x:e.box.x,y:e.box.y}):void 0;chunkUJL2GDIM_cjs.Ca(n.host,(a,i)=>{if(r||i.textboxDepth===0)return;let s=i.textboxPath.map(d=>d.drawingNodeId);_t(s,t.textboxPath)&&(r=lt(e,i.storyOrigin));},n.origin,o);}),r}function Kt(e,t){if(t.story==="textbox")return Vt(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?chunkUJL2GDIM_cjs._e(e,e.header.box):{x:0,y:0};case "footer":return e.footer?chunkUJL2GDIM_cjs._e(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let n=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return n?chunkUJL2GDIM_cjs._e(e,n.box):{x:0,y:0}}case "note-separator":{let r=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes,n=r?.separator?.box;return r?.continuationNotice&&chunkUJL2GDIM_cjs.Ca(r.continuationNotice,o=>{o.paragraphId===t.source.start.paragraphId&&(n=r.continuationNotice.box);}),n?chunkUJL2GDIM_cjs._e(e,n):{x:0,y:0}}default:return {x:0,y:0}}}function pt(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function mt(e,t){let r=chunkUJL2GDIM_cjs.Ze(e);return Object.freeze({x:r.x+t.x,y:r.y+t.y,width:t.width,height:t.height})}function zt(e,t){let r=chunkUJL2GDIM_cjs.df(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!r||r.pageIndex!==t.pageIndex)return;let n=e.pages[r.pageIndex];if(!n)return;let o=Kt(n,t),a=Object.freeze([pt({x:r.x+o.x,y:r.y+o.y,width:0,height:r.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>mt(n,i)))})}function Ht(e,t,r){let n=r.filter(i=>i.pageIndex===t.pageIndex);if(n.length===0)return ft(t)?zt(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(n.map(i=>pt(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>mt(o,i)))})}function ft(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function ut(e,t){return `${e}\0${t}`}function Wt(e,t,r){let n=Math.max(e.start,t.offset),o=Math.min(e.end,r.offset);return o>n?{start:n,end:o}:null}function $t(e,t){let r=new Map,n=new Map,o=new Set,a=0;let i=(s,d)=>{if(a>=jt)return false;a+=1;let h=ut(s.pageIndex,d),f=n.get(h);return f?f.push(s):n.set(h,[s]),true};for(let[s,d]of t.entries())for(let[h,f]of d.occurrences.entries()){if(ft(f)||f.source.start.paragraphId!==f.source.end.paragraphId)continue;o.add(f.pageIndex);let c=`${s}\0${h}`,p={paragraphId:f.source.start.paragraphId,offset:f.source.start.offset},g={paragraphId:f.source.end.paragraphId,offset:f.source.end.offset},x=p.offset<=g.offset?{from:p,to:g}:{from:g,to:p};i({key:c,from:x.from,to:x.to,pageIndex:f.pageIndex},x.from.paragraphId);}if(n.size===0)return r;for(let s of e.pages)o.has(s.index)&&chunkUJL2GDIM_cjs.ya(s,d=>{let h=d.story==="header"||d.story==="footer"?f=>chunkUJL2GDIM_cjs.ta(f,d.origin,{x:s.box.x,y:s.box.y}):void 0;chunkUJL2GDIM_cjs.Ca(d.host,(f,c)=>{let p=lt(s,c.storyOrigin);for(let g of f.lines)for(let x of chunkUJL2GDIM_cjs.Ia(g)){let u=n.get(ut(s.index,x.paragraphId));if(u)for(let m of u){let w=Wt(x,m.from,m.to);if(!w)continue;let b=chunkUJL2GDIM_cjs.Ue(g,w.start,void 0,x),S=chunkUJL2GDIM_cjs.Ue(g,w.end,void 0,x,w.end>w.start),R=r.get(m.key)??[];R.push({pageIndex:s.index,x:Math.min(b,S)+p.x,y:g.box.y+p.y,width:Math.abs(S-b),height:g.box.height}),r.set(m.key,R);}}},d.origin,h);});return r}function yt(e,t){let r=false;for(let o of t)if(o.occurrences.length!==0){r=true;break}if(!r)return t;let n=$t(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,d)=>{let h=`${a}\0${d}`,f=Ht(e,s,n.get(h)??[]);return f?{...s,geometry:f}:s});return {...o,occurrences:Object.freeze(i)}})}function Ut(e){let t=new Map,r=[{node:e.root,depth:0}];for(;r.length>0;){let{node:n,depth:o}=r.pop();if(!(n.kind==="textValue"||o>64)){n.kind==="paragraph"&&!t.has(n.id)&&t.set(n.id,t.size);for(let a=n.children.length-1;a>=0;a-=1)r.push({node:n.children[a],depth:o+1});}}return t}function gt(){let e=new Map,t=n=>{let o=e.get(n.root);if(o)return o;let a=Ut(n);return e.set(n.root,a),a},r={retainRevisionItems:false,revisionSites:chunkANZ44KQT_cjs.aj,locations:chunkSUN62YU6_cjs.La,commentAnchors:chunkANZ44KQT_cjs.Eh,deepOrder:t};return Object.freeze({collectReviewItems:n=>chunkSUN62YU6_cjs.Pa(n,r),deepParagraphOrderOfPart:t})}function Gt(e,t){if(t)return true;let r=e.map(n=>n.root);for(;r.length>0;){let n=r.pop();if(chunkANZ44KQT_cjs._i(n))return true;if(n.kind!=="textValue")for(let o of n.children)r.push(o);}return false}function Yt(e,t){let r=[],n=new Set([t.name]),o=a=>{!a||n.has(a.name)||(n.add(a.name),r.push(a));};for(let a of chunkANZ44KQT_cjs.Pe(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(chunkANZ44KQT_cjs.Ig(e,"footnote")),o(chunkANZ44KQT_cjs.Ig(e,"endnote")),r}function Xt(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return chunkANZ44KQT_cjs.Ig(e,"footnote")?.name??null;case "endnote":return chunkANZ44KQT_cjs.Ig(e,"endnote")?.name??null;case "note-separator":return chunkANZ44KQT_cjs.Ig(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function qt(e,t){let r=new Map;for(let n of e){let o=t.get(n.partName),a=o?.get(n.start.paragraphId),i=o?.get(n.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),d=Math.max(a,i),h=r.get(n.partName);r.set(n.partName,{lower:Math.min(h?.lower??s,s),upper:Math.max(h?.upper??d,d)});}return r}function Jt(e,t,r,n,o){let a=new Map(r.map(c=>[c.name,o(c)])),i=qt(n,a),s=new Map,d=new Map,h=(c,p,g,x,u,m,w)=>{let b=a.get(c)?.get(u),S=i.get(c);if(b===void 0||!S||b<S.lower||b>S.upper)return;let R=s.get(c)??new Map;s.set(c,R);let V=d.get(c)??new Map;d.set(c,V);let j=JSON.stringify([p.story,p.noteScopeId,p.noteAreaKind]),X=g==="textbox"?JSON.stringify([j,"textbox",x]):j,H=R.get(u)??[],W=`${u}\0${p.page.index}\0${X}`,T=V.get(W);T||(T={pageIndex:p.page.index,story:g,rootStory:p.story,textboxPath:x,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,laneKey:X,intervals:[],intervalKeys:new Set},V.set(W,T),H.push(T),R.set(u,H));let y=`${m}\0${w}`;T.intervalKeys?.has(y)||(T.intervalKeys?.add(y),T.intervals.push({start:m,end:w}));};chunkUJL2GDIM_cjs.za(e,c=>{let p=Xt(t,c);!p||!i.has(p)||chunkUJL2GDIM_cjs.Ca(c.host,(g,x)=>{let u=x.textboxDepth>0?"textbox":c.story,m=x.textboxPath.map(b=>b.drawingNodeId),w=[];for(let b of g.lines){for(let S of b.spans)w.push(S.range);for(let S of b.drawings??[])w.push({paragraphId:S.paragraphId,start:S.start,end:S.start+1});}w.length===0&&w.push({paragraphId:g.range.paragraphId,start:g.range.start,end:g.range.end});for(let{paragraphId:b,start:S,end:R}of w)h(p,c,u,m,b,S,R);});}),chunkUJL2GDIM_cjs.Ba(e,c=>{let p=c.drawing.ownerPartName;c.drawing.accessibility.hidden||!i.has(p)||h(p,c.root,c.story,c.textboxPath.map(g=>g.drawingNodeId),c.drawing.paragraphId,c.drawing.start,c.drawing.start+1);});for(let c of s.values())for(let p of c.values())for(let g of p){g.intervals.sort((u,m)=>u.start-m.start||u.end-m.end);let x=[];for(let u of g.intervals){let m=x.at(-1);m&&u.start<=m.end?m.end=Math.max(m.end,u.end):x.push({...u});}g.intervals.splice(0,g.intervals.length,...x),g.intervalKeys=void 0;}let f=new Map;for(let[c,p]of s){let g=a.get(c);if(!g)continue;let x=[];for(let[u,m]of p){let w=g.get(u);w!==void 0&&x.push({paragraphId:u,position:w,laneKeys:new Set(m.map(({laneKey:b})=>b))});}x.sort((u,m)=>u.position-m.position),f.set(c,x);}return {byPart:s,orderByPart:a,visibleByPart:f}}function ht(e,t){let r=0,n=e.length;for(;r<n;){let o=r+n>>>1;e[o].position<t?r=o+1:n=o;}return r}function Qt(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let r=t.orderByPart.get(e.partName),n=t.visibleByPart.get(e.partName),o=r?.get(e.start.paragraphId),a=r?.get(e.end.paragraphId);if(!r||!n||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),d=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:c})=>c)??[]),h=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:c})=>c)??[]),f=new Set([...d].filter(c=>h.has(c)));return f.size===0?[e.start.paragraphId,e.end.paragraphId]:n.slice(ht(n,i),ht(n,s+1)).filter(c=>[...c.laneKeys].some(p=>f.has(p))).map(c=>c.paragraphId)}function Zt(e,t,r,n){return n?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,r)};return a.end>a.start?[a]:[]})}function er(e,t){let r=Number.NEGATIVE_INFINITY;for(let n of e)for(let o of n.intervals)r=Math.max(r,o.end);return t!==r?new Set:new Set(e.filter(n=>n.intervals.some(o=>o.end===r)))}function xt(e,t,r){let n=[],o=new Set;for(let[a,i]of e.entries()){let s=r===void 0?void 0:r===null?"neutral":a<r?"replaced":"replacement";for(let d of Qt(i,t)){let h=t.byPart.get(i.partName)?.get(d)??[],c=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,p=d===i.start.paragraphId?i.start.offset:0,g=d===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,x=c?er(h,p):new Set;for(let u of h){let m=Zt(u,p,g,c);c&&m.length===0&&x.has(u)&&(m=[{start:p,end:p}]);for(let w of m){let b=`${u.pageIndex}\0${u.story}\0${u.noteScopeId??""}\0${u.noteAreaKind??""}\0${u.textboxPath.join("\0")}\0${i.partName}\0${d}\0${w.start}\0${w.end}\0${s??""}`;o.has(b)||(o.add(b),n.push({pageIndex:u.pageIndex,physicalPageNumber:u.pageIndex+1,story:u.story,rootStory:u.rootStory,textboxPath:u.textboxPath,noteScopeId:u.noteScopeId,noteAreaKind:u.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:d,offset:w.start},end:{paragraphId:d,offset:w.end}}}));}}}}return n}function bt(e,t){let r=2166136261,n=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);r=Math.imul(r^a,16777619)>>>0,n=Math.imul(n^a+o,2246822507)>>>0,n^=n>>>13;}return `${e}_${t.length.toString(36)}_${r.toString(36)}_${n.toString(36)}`}function wt(e,t,r=bt){let n=new Map;for(let a of t){let i=r(e,a),s=n.get(i)??new Set;s.add(a),n.set(i,s);}let o=new Map;for(let[a,i]of n){let s=[...i].sort();for(let[d,h]of s.entries())o.set(h,s.length===1?a:`${a}_${d.toString(36)}`);}return o}function tr(e){let t=new Set,r=new Set;for(let n of e){if(n.kind==="comment"){t.add(n.id),n.parentId!==void 0&&t.add(n.parentId),n.parentRevisionId!==void 0&&r.add(n.parentRevisionId);for(let o of n.replyIds)t.add(o);}if(n.kind==="revision"){r.add(n.id),n.pairedWith!==void 0&&r.add(n.pairedWith);for(let o of n.replyIds)t.add(o);}}return {comment:wt("comment",t),revision:wt("change",r)}}function B(e,t,r){return e.get(r)??bt(t,r)}function rr(e,t,r){return e.kind==="revision"?{kind:"tracked-change",id:B(r.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:chunkANZ44KQT_cjs.$a(e.text),replacedText:chunkANZ44KQT_cjs.$a(e.replacedText),nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:B(r.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),occurrences:t?xt(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:B(r.comment,"comment",e.id),author:e.comment.author,initials:chunkSUN62YU6_cjs.Ja(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:chunkSUN62YU6_cjs.Ha(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:B(r.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:B(r.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(n=>B(r.comment,"comment",n)),orphaned:e.orphaned,occurrences:t&&e.range?xt([e.range],t):[]}}function Pt(e,t){let r=t.parts.get(t.mainDocumentPart);if(!r)return [];let n=Yt(t,r),o=[r,...n],a=t.parts.get(chunkSUN62YU6_cjs.ea(t,r.name));if(!Gt(o,a))return [];let i=gt(),s=i.collectReviewItems({storyPart:r,furnitureParts:n,commentsPart:a,commentsExtendedPart:t.parts.get(chunkSUN62YU6_cjs.fa(t,r.name))});if(s.length===0)return [];let d=s.flatMap(c=>chunkSUN62YU6_cjs.ua(c)),h=d.length>0?Jt(e,t,o,d,i.deepParagraphOrderOfPart):null,f=tr(s);return s.map(c=>rr(c,h,f)).filter(c=>c!==null)}var nr=new Set(["part","validatedHandle"]);function St(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Y(e,t,r,n,o){if(!(n!==void 0&&nr.has(n))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(r.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),r.add(e);try{if(Array.isArray(e)){for(let a of e)Y(a,t,r,void 0,o);Object.freeze(e);return}if(!St(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");Y(i.value,t,r,a,o);}}Object.freeze(e);}finally{r.delete(e);}}}}}function vt(e){if(!St(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let n of e.pages)if(!(n===null||typeof n!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(n,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),Y(i,new Set,s,o),t.add(i);}let r=(n,o)=>{let a=new Set;for(let i of n){let s=new Set;s.add(e),Y(i,a,s,void 0,o);}Object.freeze(n);};for(let n of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,n);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(n==="pages"&&Array.isArray(o.value)){r(o.value,t);continue}if(n==="reviewArtifacts"&&Array.isArray(o.value)){r(o.value);continue}let a=new Set;a.add(e),Y(o.value,new Set,a,n);}return Object.freeze(e),e}var or=Object.freeze([]),k=class extends Error{constructor(r,n,o){super(n,o);this.code=r;this.name="ExportResourceError";}code};function ar(e){try{return e instanceof k}catch{return false}}function ir(e){try{return e instanceof chunkUJL2GDIM_cjs.ee}catch{return false}}function sr(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function cr(e){if(ar(e))return e;let t=ir(e),r=sr(e),n=r?`: ${r}`:"",o=new k(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${n}`:`Export layout failed${n}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function dr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function It(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var ur=50,le=64;function lr(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function pr(e){let t=false;return chunkUJL2GDIM_cjs.Ba(e,({drawing:r})=>{lr(r.resource)&&(t=true);}),t}function Rt(e){return !ArrayBuffer.isView(e)}function Mn(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let r=It(t.displayMode??chunkUJL2GDIM_cjs.Ra),n=Rt(e),o=Rt(e)?{ok:true,view:e}:chunkSUN62YU6_cjs.ab(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??n,s=dr(t.resourceTimeoutMs),d=t.measurer??chunkUJL2GDIM_cjs.ea(),h=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),f=chunkUJL2GDIM_cjs.hb({retainAcrossPasses:i}),c=0,p=new Set,g=()=>{c+=1;for(let y of p)y();p.clear();},x=chunkUJL2GDIM_cjs.od({session:a,decodePort:t.imageDecodePort??nt(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:g}),u={view:a,measurer:d,paragraphCache:f,sessions:new Map,completed:new Map,inFlight:new Map,styles:chunkUJL2GDIM_cjs.md(a),fieldLinks:new Map,links:chunkUJL2GDIM_cjs.le(a),drawingBundle:x,furniture:new Map},m=new AbortController,w=t.signal,b=false,S=()=>b?new k("aborted","Export resource settlement was aborted"):new k("disposed","Export session has been disposed"),R=()=>{b=true,V();};function V(){let y=u;if(y){u=null,w?.removeEventListener("abort",R),m.abort(w?.reason),y.drawingBundle.dispose(),y.paragraphCache.clear();for(let P of y.completed.values())chunkUJL2GDIM_cjs.bd(P.internal),chunkUJL2GDIM_cjs.ne(P.internal);for(let P of y.fieldLinks.values())P.registry.clear();y.fieldLinks.clear(),y.completed.clear(),y.inFlight.clear(),y.furniture.clear(),y.sessions.clear(),g();}}w?.addEventListener("abort",R,{once:true}),w?.aborted&&R();let j=()=>{if(!u)throw S();if(m.signal.aborted)throw new k("aborted","Export resource settlement was aborted")},X=(y,P,D,l)=>c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D?Promise.resolve():(j(),new Promise((_,O)=>{let M=false,C,E=A=>{M||(M=true,C!==void 0&&clearTimeout(C),p.delete(L),m.signal.removeEventListener("abort",$),A?O(A):_());},L=()=>E(),$=()=>E(new k("aborted","Export resource settlement was aborted")),U=()=>{if(u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}let A=l-Date.now();if(A<=0){E(new k("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(U,Math.min(ur,A));};if(p.add(L),m.signal.addEventListener("abort",$,{once:true}),c!==y||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}U();})),H=async(y,P=0,D=Date.now()+s)=>{if(j(),Date.now()>=D)throw new k("timedOut",`Export layout did not stabilize within ${s}ms`);let l=u,_=D,O=l.view.packageRevision(),M=l.view.currentPackage(),C=l.completed.get(y);if(C&&C.revision===O&&C.pkg===M)return C.published;let E=()=>{if(l.view.packageRevision()===O&&l.view.currentPackage()===M)return null;if(P>=le-1)throw new k("nonConvergent","Document revision did not stabilize during export layout");return H(y,P+1,_)},L=l.fieldLinks.get(y);if(!L||L.revision!==O||L.pkg!==M){let I=L?.registry??chunkUJL2GDIM_cjs.me();I.clear(),L={revision:O,pkg:M,registry:I},l.fieldLinks.set(y,L),l.furniture.delete(y);}let $=L.registry,U=l.sessions.get(y)??chunkUJL2GDIM_cjs.Ne();l.sessions.set(y,U);let A=l.furniture.get(y);A||(A=chunkUJL2GDIM_cjs.ie({view:l.view,measurer:l.measurer,producer:h,cache:l.paragraphCache,styleCascade:l.styles.styleCascade,numberingIndex:l.styles.numberingIndex,defaultTabStopPt:l.styles.defaultTabStopPt,compatibilityMode:l.styles.compatibilityMode,displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false,inlineDrawingLayoutForPart:I=>l.drawingBundle.contextForPart(I),drawingLayoutTokenForPart:I=>l.drawingBundle.cacheTokenForPart(I),drawingTokenForParagraphForPart:(I,ne)=>l.drawingBundle.drawingTokenForParagraph(ne,I),linkProjectors:l.links,projectFieldLink:I=>$.project(I)}),l.furniture.set(y,A));for(let I=0;I<le;I+=1){let ne=c;l.drawingBundle.sync(l.view);let pe=E();if(pe)return pe;let N=ct({view:l.view,revision:l.view.packageRevision(),measurer:l.measurer,cache:l.paragraphCache,session:U,producer:h,styleCascade:l.styles.styleCascade,defaultTabStopPt:l.styles.defaultTabStopPt,numberingIndex:l.styles.numberingIndex,furniture:A,compatibilityMode:l.styles.compatibilityMode,linkProjectors:l.links,projectFieldLink:v=>$.project(v),inlineDrawingLayout:l.drawingBundle.bodyContext,inlineDrawingLayoutForPart:v=>l.drawingBundle.contextForPart(v),drawingTokenForParagraph:v=>l.drawingBundle.drawingTokenForParagraph(v,l.view.part().name),drawingTokenForParagraphForPart:(v,q)=>l.drawingBundle.drawingTokenForParagraph(q,v),drawingLayoutEpoch:l.drawingBundle.cacheTokenForPart(l.view.part().name),drawingLayoutEpochForPart:v=>l.drawingBundle.cacheTokenForPart(v),displayMode:y,revisionAuthorFilter:void 0,showFieldCodes:false});if(!pr(N)){let v=E();if(v)return v;i||(chunkUJL2GDIM_cjs.bd(N),chunkUJL2GDIM_cjs.ne(N),l.paragraphCache.clear(),l.sessions.delete(y),l.furniture.delete(y));let q=Pt(N,M),Ot=q.length===0?or:Object.freeze(yt(N,q)),kt=rt(l.view,N),Dt={...N,...kt,contentWarnings:st(l.view),reviewArtifacts:Ot},ye=vt(Dt);return l.completed.set(y,{revision:O,pkg:M,internal:N,published:ye}),ye}let me=ne;for(;l.drawingBundle.pendingResourceCount()>0;){await X(me,O,M,_),me=c,j();let v=E();if(v)return v}j();let fe=E();if(fe)return fe}throw new k("nonConvergent",`Image resources did not reach quiescence after ${le} layout passes`)},W=y=>{let P;try{P=It(y);}catch(O){return Promise.reject(O)}if(!u)return Promise.reject(S());let D=u,l=D.inFlight.get(P);if(l)return l;let _=H(P).catch(O=>{throw cr(O)}).finally(()=>D.inFlight.delete(P));return D.inFlight.set(P,_),_};return {ok:true,session:{layout:()=>W(r),layoutFor:W,validatedImageBytes(y){let P=u;return !P||y.resource.kind!=="ready"?null:P.drawingBundle.mintValidatedBytes(y.resource.validatedHandle,y.resource.contentId)?.slice()??null},dispose:V}}}exports.a=ct;exports.b=gr;exports.c=nt;exports.d=k;exports.e=Mn;
|