@docx-editor.dev/core 2.21.1 → 2.22.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 +11 -5
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +10 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/{chunk-BF2TOG2V.js → chunk-5RKCJ5DF.js} +1 -1
- package/dist/chunk-65GJRSZ5.cjs +18 -0
- package/dist/chunk-6TBRG6SA.cjs +20 -0
- package/dist/chunk-A72MJGY7.cjs +4 -0
- package/dist/chunk-AZ7QSAXH.js +4 -0
- package/dist/chunk-BL57VQ7E.js +1 -0
- package/dist/chunk-CB6RQ3GD.cjs +11 -0
- package/dist/chunk-GG4IAKFI.js +5 -0
- package/dist/chunk-HJYLFMLX.js +2 -0
- package/dist/chunk-HL6NO7IH.cjs +2 -0
- package/dist/chunk-HZQFGB2X.cjs +5 -0
- package/dist/{chunk-FPDIJ4RF.js → chunk-IWAUA732.js} +1 -1
- package/dist/chunk-OZXBAEWW.js +2 -0
- package/dist/{chunk-4TYA4RLP.cjs → chunk-P5PWSRNW.cjs} +1 -1
- package/dist/{chunk-DZYKU2HG.js → chunk-PD5XKBJA.js} +1 -1
- package/dist/{chunk-7N77EN2Z.cjs → chunk-REMFTPDL.cjs} +1 -1
- package/dist/{chunk-T5B4NMKF.cjs → chunk-RLKX7BIP.cjs} +1 -1
- package/dist/chunk-UGLO2GA5.cjs +1 -0
- package/dist/chunk-UOQONZVQ.js +11 -0
- package/dist/chunk-VD2MWTR6.js +20 -0
- package/dist/chunk-VIXH2OVP.js +1 -0
- package/dist/chunk-W2JIZ5JH.js +18 -0
- package/dist/chunk-W5H62AWM.cjs +1 -0
- package/dist/{chunk-E5OUYRNM.cjs → chunk-X2LJDR53.cjs} +5 -5
- package/dist/chunk-YQXY6TQ3.js +5 -0
- package/dist/{chunk-RA2TDTEQ.cjs → chunk-YYFBYVW4.cjs} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.d.ts +6 -6
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-CncR6KfC.d.ts → custom-node-writes-Ck6eOiJ3.d.ts} +2 -2
- package/dist/{document-protection-DM6mA8Rf.d.ts → document-protection-CMPEonQc.d.ts} +1 -1
- package/dist/{editor-BRh7GuZF.d.ts → editor-BKDVqXyk.d.ts} +70 -49
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +188 -26
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +31 -14
- package/dist/export.js +2 -2
- package/dist/{font-resolver-DwuQYj3P.d.ts → font-resolver-PBc8Vuxs.d.ts} +1 -1
- package/dist/{headless-document-view-C3fc_jV0.d.ts → headless-document-view-9wjJT20Y.d.ts} +2 -2
- package/dist/{image-resources-DxF-SN_8.d.ts → image-resources-B0v-XaTM.d.ts} +2 -2
- package/dist/{index-3pNnG4z4.d.ts → index-DQA53aR1.d.ts} +134 -16
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-_GGjhhVc.d.ts → layout-shaping-Dyr0ZSOI.d.ts} +5 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +376 -33
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CjT31AuP.d.ts → note-properties-D_lmG9xx.d.ts} +1 -1
- package/dist/{omml-equation-Bk3OP1fv.d.ts → omml-equation-CfTm3jOK.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +7 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-CrbTIW2Z.d.ts → protocol-CkVDxyQ3.d.ts} +2 -2
- package/dist/{review-paragraph-order-D3KZohIL.d.ts → review-paragraph-order-BjUs-tDd.d.ts} +1 -1
- package/dist/{revision-projection-kVd7p6Wd.d.ts → revision-projection-DDVBYTIG.d.ts} +1 -1
- package/dist/{semantic-cell-selection-CkSsZHDL.d.ts → semantic-cell-selection-DW6qsmoC.d.ts} +4 -4
- package/dist/{semantic-interaction-Z2Xa68U5.d.ts → semantic-interaction-BNiYSBcB.d.ts} +1 -1
- package/dist/{semantic-paint-BHKprI9P.d.ts → semantic-paint-DE236npp.d.ts} +2 -2
- package/dist/{semantic-records-StH-AnHK.d.ts → semantic-records-C5OeXnaL.d.ts} +545 -569
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +13 -13
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-CpEV1gl3.d.ts → tree-package-fragment-DBb97w3F.d.ts} +2 -2
- package/dist/{tree-session-contract-CTT9nM7Z.d.ts → tree-session-contract-BYat3RKx.d.ts} +5 -5
- package/dist/{types-barrel-PwcfEkaX.d.ts → types-barrel-ChGvWjkO.d.ts} +3 -1
- package/package.json +2 -2
- package/dist/chunk-25OQBAKA.js +0 -2
- package/dist/chunk-3B3DQMSL.js +0 -11
- package/dist/chunk-3P3DNJYM.js +0 -5
- package/dist/chunk-3PA64KPK.js +0 -5
- package/dist/chunk-AGWWNVIJ.cjs +0 -1
- package/dist/chunk-DFTVN25X.cjs +0 -5
- package/dist/chunk-DGONGMAV.js +0 -2
- package/dist/chunk-F4H3LC6M.cjs +0 -2
- package/dist/chunk-IUTTOBQW.cjs +0 -20
- package/dist/chunk-IYCXQAFT.cjs +0 -4
- package/dist/chunk-JL3SI5SZ.js +0 -18
- package/dist/chunk-OFWUHH52.js +0 -20
- package/dist/chunk-OKY6JRJL.js +0 -4
- package/dist/chunk-P24FHMQW.cjs +0 -1
- package/dist/chunk-QBKAOSVF.cjs +0 -18
- package/dist/chunk-U5GUJKTS.js +0 -1
- package/dist/chunk-XRYSPKKC.js +0 -1
- package/dist/chunk-ZZRCVDQU.cjs +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk65GJRSZ5_cjs=require('./chunk-65GJRSZ5.cjs'),chunkHZQFGB2X_cjs=require('./chunk-HZQFGB2X.cjs'),chunkCB6RQ3GD_cjs=require('./chunk-CB6RQ3GD.cjs');var wt=Object.freeze({}),xt=Object.freeze([]);function bt(e){let t=Object.keys(e);if(t.length===0)return wt;let r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=o);}return Object.freeze(r)}function Pt(e){let t=new Map(chunkCB6RQ3GD_cjs.df(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,p]of chunkCB6RQ3GD_cjs.df(i))t.has(s)||t.set(s,p);}let n=e.currentPackage();for(let o of ["footnote","endnote"]){let a=chunkCB6RQ3GD_cjs.$f(n,o);if(!(!a||r.has(a))){r.add(a);for(let[i,s]of chunkCB6RQ3GD_cjs.df(a))t.has(i)||t.set(i,s);}}return t}function vt(e,t){let r=chunk65GJRSZ5_cjs.ue(e,t);if(!r)return null;let n=e.pages[r.pageIndex];if(!n)return null;let o=chunk65GJRSZ5_cjs.oe(n),a=chunk65GJRSZ5_cjs.qe(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 St(e,t){let r=[];for(let n of t.values()){let o=vt(e,n);o&&r.push(o);}return r.length===0?xt:Object.freeze(r)}function Ue(e,t){return {documentMetadata:bt(e.documentProperties()),destinations:St(t,Pt(e))}}function ar(e,t){let r=e.destinations;if(r){for(let n of r)if(n.anchor.name===t)return n}}function Ye(e={}){return Object.freeze({async decode(t,r,n){let o=chunkCB6RQ3GD_cjs.Eb(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 Xe=new WeakMap,It=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function Rt(e){let t=Xe.get(e.root);if(t)return t;let r=new Set,n=[{node:e.root,scope:chunkCB6RQ3GD_cjs.$a(),depth:0,mcSelected:false}],o=0;for(;n.length;){let{node:i,scope:s,depth:p,mcSelected:h}=n.pop();if(++o>chunkCB6RQ3GD_cjs.lb||p>chunkCB6RQ3GD_cjs.W){r.add("scan-limit");break}if(i.kind==="textValue")continue;if(o+n.length+i.children.length>chunkCB6RQ3GD_cjs.lb){r.add("scan-limit");break}let y=chunkCB6RQ3GD_cjs._a(s,i),c=chunkCB6RQ3GD_cjs.Za(i)?i:void 0;if(c){if(chunkCB6RQ3GD_cjs.pb(c,y).drawing)continue;let l=chunkCB6RQ3GD_cjs.ob(c,y);l.refused&&r.add("scan-limit"),l.branch&&n.push({node:l.branch,scope:y,depth:p+1,mcSelected:true});continue}if(!(!h&&chunkCB6RQ3GD_cjs.Ya(i))){if(i.namespaceUri==="urn:schemas-microsoft-com:vml"&&i.localName==="textbox"){r.add("legacy-textbox");continue}i.namespaceUri==="urn:schemas-microsoft-com:vml"&&It.has(i.localName)&&!i.children.some(l=>l.kind!=="textValue"&&l.namespaceUri==="urn:schemas-microsoft-com:vml"&&l.localName==="textbox")&&r.add("legacy-drawing");for(let l of i.children)n.push({node:l,scope:y,depth:p+1,mcSelected:h});}}let a=Object.freeze([...r]);return Xe.set(e.root,a),a}function qe(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=chunkCB6RQ3GD_cjs.$f(e.currentPackage(),r);n&&t.add(n);}return Object.freeze([...t].flatMap(r=>Rt(r).map(n=>Object.freeze({code:n,partName:r.name}))))}function Je(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=chunk65GJRSZ5_cjs.xd(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(),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 chunk65GJRSZ5_cjs.ee(a.view.part(),a.revision,i)}var Ot=65536;function et(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function kt(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function Dt(e,t,r){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===r:true}function Mt(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let r=null;return chunk65GJRSZ5_cjs.ea(e,n=>{if(r||!Dt(t,n.story,n.noteScopeId))return;let o=n.story==="header"||n.story==="footer"?a=>chunk65GJRSZ5_cjs.$(a,n.origin,{x:e.box.x,y:e.box.y}):void 0;chunk65GJRSZ5_cjs.ia(n.host,(a,i)=>{if(r||i.textboxDepth===0)return;let s=i.textboxPath.map(p=>p.drawingNodeId);kt(s,t.textboxPath)&&(r=et(e,i.storyOrigin));},n.origin,o);}),r}function Et(e,t){if(t.story==="textbox")return Mt(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?chunk65GJRSZ5_cjs.pe(e,e.header.box):{x:0,y:0};case "footer":return e.footer?chunk65GJRSZ5_cjs.pe(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?chunk65GJRSZ5_cjs.pe(e,n.box):{x:0,y:0}}case "note-separator":{let r=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes;return r?.separator?chunk65GJRSZ5_cjs.pe(e,r.separator.box):{x:0,y:0}}default:return {x:0,y:0}}}function tt(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function rt(e,t){let r=chunk65GJRSZ5_cjs.oe(e);return Object.freeze({x:r.x+t.x,y:r.y+t.y,width:t.width,height:t.height})}function Lt(e,t){let r=chunk65GJRSZ5_cjs.ue(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=Et(n,t),a=Object.freeze([tt({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=>rt(n,i)))})}function At(e,t,r){let n=r.filter(i=>i.pageIndex===t.pageIndex);if(n.length===0)return nt(t)?Lt(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(n.map(i=>tt(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>rt(o,i)))})}function nt(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function Ze(e,t){return `${e}\0${t}`}function Ft(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 Tt(e,t){let r=new Map,n=new Map,o=new Set,a=0;let i=(s,p)=>{if(a>=Ot)return false;a+=1;let h=Ze(s.pageIndex,p),y=n.get(h);return y?y.push(s):n.set(h,[s]),true};for(let[s,p]of t.entries())for(let[h,y]of p.occurrences.entries()){if(nt(y)||y.source.start.paragraphId!==y.source.end.paragraphId)continue;o.add(y.pageIndex);let c=`${s}\0${h}`,l={paragraphId:y.source.start.paragraphId,offset:y.source.start.offset},f={paragraphId:y.source.end.paragraphId,offset:y.source.end.offset},w=l.offset<=f.offset?{from:l,to:f}:{from:f,to:l};i({key:c,from:w.from,to:w.to,pageIndex:y.pageIndex},w.from.paragraphId);}if(n.size===0)return r;for(let s of e.pages)o.has(s.index)&&chunk65GJRSZ5_cjs.ea(s,p=>{let h=p.story==="header"||p.story==="footer"?y=>chunk65GJRSZ5_cjs.$(y,p.origin,{x:s.box.x,y:s.box.y}):void 0;chunk65GJRSZ5_cjs.ia(p.host,(y,c)=>{let l=et(s,c.storyOrigin);for(let f of y.lines)for(let w of chunk65GJRSZ5_cjs.pa(f)){let u=n.get(Ze(s.index,w.paragraphId));if(u)for(let g of u){let x=Ft(w,g.from,g.to);if(!x)continue;let b=chunk65GJRSZ5_cjs.ke(f,x.start,void 0,w),v=chunk65GJRSZ5_cjs.ke(f,x.end,void 0,w),R=r.get(g.key)??[];R.push({pageIndex:s.index,x:Math.min(b,v)+l.x,y:f.box.y+l.y,width:Math.abs(v-b),height:f.box.height}),r.set(g.key,R);}}},p.origin,h);});return r}function ot(e,t){let r=false;for(let o of t)if(o.occurrences.length!==0){r=true;break}if(!r)return t;let n=Tt(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,p)=>{let h=`${a}\0${p}`,y=At(e,s,n.get(h)??[]);return y?{...s,geometry:y}:s});return {...o,occurrences:Object.freeze(i)}})}function Ct(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 at(){let e=new Map,t=n=>{let o=e.get(n.root);if(o)return o;let a=Ct(n);return e.set(n.root,a),a},r={retainRevisionItems:false,revisionSites:chunkCB6RQ3GD_cjs.Zh,locations:chunkHZQFGB2X_cjs.Oa,commentAnchors:chunkCB6RQ3GD_cjs.Cg,deepOrder:t};return Object.freeze({collectReviewItems:n=>chunkHZQFGB2X_cjs.Sa(n,r),deepParagraphOrderOfPart:t})}function jt(e,t){if(t)return true;let r=e.map(n=>n.root);for(;r.length>0;){let n=r.pop();if(chunkCB6RQ3GD_cjs.Xh(n))return true;if(n.kind!=="textValue")for(let o of n.children)r.push(o);}return false}function Nt(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 chunkCB6RQ3GD_cjs.Vd(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(chunkCB6RQ3GD_cjs.$f(e,"footnote")),o(chunkCB6RQ3GD_cjs.$f(e,"endnote")),r}function _t(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return chunkCB6RQ3GD_cjs.$f(e,"footnote")?.name??null;case "endnote":return chunkCB6RQ3GD_cjs.$f(e,"endnote")?.name??null;case "note-separator":return chunkCB6RQ3GD_cjs.$f(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function Bt(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),p=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??p,p)});}return r}function Vt(e,t,r,n,o){let a=new Map(r.map(c=>[c.name,o(c)])),i=Bt(n,a),s=new Map,p=new Map,h=(c,l,f,w,u,g,x)=>{let b=a.get(c)?.get(u),v=i.get(c);if(b===void 0||!v||b<v.lower||b>v.upper)return;let R=s.get(c)??new Map;s.set(c,R);let V=p.get(c)??new Map;p.set(c,V);let N=JSON.stringify([l.story,l.noteScopeId,l.noteAreaKind]),Y=f==="textbox"?JSON.stringify([N,"textbox",w]):N,K=R.get(u)??[],z=`${u}\0${l.page.index}\0${Y}`,T=V.get(z);T||(T={pageIndex:l.page.index,story:f,rootStory:l.story,textboxPath:w,noteScopeId:l.noteScopeId,noteAreaKind:l.noteAreaKind,laneKey:Y,intervals:[],intervalKeys:new Set},V.set(z,T),K.push(T),R.set(u,K));let m=`${g}\0${x}`;T.intervalKeys?.has(m)||(T.intervalKeys?.add(m),T.intervals.push({start:g,end:x}));};chunk65GJRSZ5_cjs.fa(e,c=>{let l=_t(t,c);!l||!i.has(l)||chunk65GJRSZ5_cjs.ia(c.host,(f,w)=>{let u=w.textboxDepth>0?"textbox":c.story,g=w.textboxPath.map(b=>b.drawingNodeId),x=[];for(let b of f.lines){for(let v of b.spans)x.push(v.range);for(let v of b.drawings??[])x.push({paragraphId:v.paragraphId,start:v.start,end:v.start+1});}x.length===0&&x.push({paragraphId:f.range.paragraphId,start:f.range.start,end:f.range.end});for(let{paragraphId:b,start:v,end:R}of x)h(l,c,u,g,b,v,R);});}),chunk65GJRSZ5_cjs.ha(e,c=>{let l=c.drawing.ownerPartName;i.has(l)&&h(l,c.root,c.story,c.textboxPath.map(f=>f.drawingNodeId),c.drawing.paragraphId,c.drawing.start,c.drawing.start+1);});for(let c of s.values())for(let l of c.values())for(let f of l){f.intervals.sort((u,g)=>u.start-g.start||u.end-g.end);let w=[];for(let u of f.intervals){let g=w.at(-1);g&&u.start<=g.end?g.end=Math.max(g.end,u.end):w.push({...u});}f.intervals.splice(0,f.intervals.length,...w),f.intervalKeys=void 0;}let y=new Map;for(let[c,l]of s){let f=a.get(c);if(!f)continue;let w=[];for(let[u,g]of l){let x=f.get(u);x!==void 0&&w.push({paragraphId:u,position:x,laneKeys:new Set(g.map(({laneKey:b})=>b))});}w.sort((u,g)=>u.position-g.position),y.set(c,w);}return {byPart:s,orderByPart:a,visibleByPart:y}}function it(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 Kt(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),p=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)??[]),y=new Set([...p].filter(c=>h.has(c)));return y.size===0?[e.start.paragraphId,e.end.paragraphId]:n.slice(it(n,i),it(n,s+1)).filter(c=>[...c.laneKeys].some(l=>y.has(l))).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 Wt(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 st(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 p of Kt(i,t)){let h=t.byPart.get(i.partName)?.get(p)??[],c=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,l=p===i.start.paragraphId?i.start.offset:0,f=p===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,w=c?Wt(h,l):new Set;for(let u of h){let g=zt(u,l,f,c);c&&g.length===0&&w.has(u)&&(g=[{start:l,end:l}]);for(let x of g){let b=`${u.pageIndex}\0${u.story}\0${u.noteScopeId??""}\0${u.noteAreaKind??""}\0${u.textboxPath.join("\0")}\0${i.partName}\0${p}\0${x.start}\0${x.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:p,offset:x.start},end:{paragraphId:p,offset:x.end}}}));}}}}return n}function dt(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 ct(e,t,r=dt){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[p,h]of s.entries())o.set(h,s.length===1?a:`${a}_${p.toString(36)}`);}return o}function $t(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:ct("comment",t),revision:ct("change",r)}}function B(e,t,r){return e.get(r)??dt(t,r)}function Ht(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:e.text,replacedText: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?st(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:chunkHZQFGB2X_cjs.Ma(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:chunkHZQFGB2X_cjs.La(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?st([e.range],t):[]}}function ut(e,t){let r=t.parts.get(t.mainDocumentPart);if(!r)return [];let n=Nt(t,r),o=[r,...n],a=t.parts.get(chunkHZQFGB2X_cjs.Y(t,r.name));if(!jt(o,a))return [];let i=at(),s=i.collectReviewItems({storyPart:r,furnitureParts:n,commentsPart:a,commentsExtendedPart:t.parts.get(chunkHZQFGB2X_cjs.Z(t,r.name))});if(s.length===0)return [];let p=s.flatMap(c=>chunkHZQFGB2X_cjs.Fa(c)),h=p.length>0?Vt(e,t,o,p,i.deepParagraphOrderOfPart):null,y=$t(s);return s.map(c=>Ht(c,h,y)).filter(c=>c!==null)}var Gt=new Set(["part","validatedHandle"]);function lt(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function U(e,t,r,n,o){if(!(n!==void 0&&Gt.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)U(a,t,r,void 0,o);Object.freeze(e);return}if(!lt(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");U(i.value,t,r,a,o);}}Object.freeze(e);}finally{r.delete(e);}}}}}function pt(e){if(!lt(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),U(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),U(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),U(o.value,new Set,a,n);}return Object.freeze(e),e}var Ut=Object.freeze([]),k=class extends Error{constructor(r,n,o){super(n,o);this.code=r;this.name="ExportResourceError";}code};function Yt(e){try{return e instanceof k}catch{return false}}function Xt(e){try{return e instanceof chunk65GJRSZ5_cjs.sd}catch{return false}}function qt(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function Jt(e){if(Yt(e))return e;let t=Xt(e),r=qt(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 Qt(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 mt(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var Zt=50,se=64;function er(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function tr(e){let t=false;return chunk65GJRSZ5_cjs.ha(e,({drawing:r})=>{er(r.resource)&&(t=true);}),t}function yt(e){return !ArrayBuffer.isView(e)}function nn(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let r=mt(t.displayMode??chunk65GJRSZ5_cjs.xa),n=yt(e),o=yt(e)?{ok:true,view:e}:chunkHZQFGB2X_cjs.ab(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??n,s=Qt(t.resourceTimeoutMs),p=t.measurer??chunk65GJRSZ5_cjs.N(),h=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),y=chunk65GJRSZ5_cjs.Ka({retainAcrossPasses:i}),c=0,l=new Set,f=()=>{c+=1;for(let m of l)m();l.clear();},w=chunk65GJRSZ5_cjs.Gc({session:a,decodePort:t.imageDecodePort??Ye(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:f}),u={view:a,measurer:p,paragraphCache:y,sessions:new Map,completed:new Map,inFlight:new Map,styles:chunk65GJRSZ5_cjs.Fc(a),fieldLinks:new Map,links:chunk65GJRSZ5_cjs.zd(a),drawingBundle:w,furniture:new Map},g=new AbortController,x=t.signal,b=false,v=()=>b?new k("aborted","Export resource settlement was aborted"):new k("disposed","Export session has been disposed"),R=()=>{b=true,V();};function V(){let m=u;if(m){u=null,x?.removeEventListener("abort",R),g.abort(x?.reason),m.drawingBundle.dispose(),m.paragraphCache.clear();for(let P of m.completed.values())chunk65GJRSZ5_cjs.uc(P.internal),chunk65GJRSZ5_cjs.Ed(P.internal);for(let P of m.fieldLinks.values())P.registry.clear();m.fieldLinks.clear(),m.completed.clear(),m.inFlight.clear(),m.furniture.clear(),m.sessions.clear(),f();}}x?.addEventListener("abort",R,{once:true}),x?.aborted&&R();let N=()=>{if(!u)throw v();if(g.signal.aborted)throw new k("aborted","Export resource settlement was aborted")},Y=(m,P,D,d)=>c!==m||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D?Promise.resolve():(N(),new Promise((_,O)=>{let M=false,C,E=A=>{M||(M=true,C!==void 0&&clearTimeout(C),l.delete(L),g.signal.removeEventListener("abort",W),A?O(A):_());},L=()=>E(),W=()=>E(new k("aborted","Export resource settlement was aborted")),$=()=>{if(u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}let A=d-Date.now();if(A<=0){E(new k("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout($,Math.min(Zt,A));};if(l.add(L),g.signal.addEventListener("abort",W,{once:true}),c!==m||u?.view.packageRevision()!==P||u?.view.currentPackage()!==D){E();return}$();})),K=async(m,P=0,D=Date.now()+s)=>{if(N(),Date.now()>=D)throw new k("timedOut",`Export layout did not stabilize within ${s}ms`);let d=u,_=D,O=d.view.packageRevision(),M=d.view.currentPackage(),C=d.completed.get(m);if(C&&C.revision===O&&C.pkg===M)return C.published;let E=()=>{if(d.view.packageRevision()===O&&d.view.currentPackage()===M)return null;if(P>=se-1)throw new k("nonConvergent","Document revision did not stabilize during export layout");return K(m,P+1,_)},L=d.fieldLinks.get(m);if(!L||L.revision!==O||L.pkg!==M){let I=L?.registry??chunk65GJRSZ5_cjs.Ad();I.clear(),L={revision:O,pkg:M,registry:I},d.fieldLinks.set(m,L),d.furniture.delete(m);}let W=L.registry,$=d.sessions.get(m)??chunk65GJRSZ5_cjs.de();d.sessions.set(m,$);let A=d.furniture.get(m);A||(A=chunk65GJRSZ5_cjs.wd({view:d.view,measurer:d.measurer,producer:h,cache:d.paragraphCache,styleCascade:d.styles.styleCascade,numberingIndex:d.styles.numberingIndex,defaultTabStopPt:d.styles.defaultTabStopPt,compatibilityMode:d.styles.compatibilityMode,displayMode:m,revisionAuthorFilter:void 0,showFieldCodes:false,inlineDrawingLayoutForPart:I=>d.drawingBundle.contextForPart(I),drawingLayoutTokenForPart:I=>d.drawingBundle.cacheTokenForPart(I),drawingTokenForParagraphForPart:(I,ee)=>d.drawingBundle.drawingTokenForParagraph(ee,I),linkProjectors:d.links,projectFieldLink:I=>W.project(I)}),d.furniture.set(m,A));for(let I=0;I<se;I+=1){let ee=c;d.drawingBundle.sync(d.view);let ce=E();if(ce)return ce;let j=Je({view:d.view,revision:d.view.packageRevision(),measurer:d.measurer,cache:d.paragraphCache,session:$,producer:h,styleCascade:d.styles.styleCascade,defaultTabStopPt:d.styles.defaultTabStopPt,numberingIndex:d.styles.numberingIndex,furniture:A,compatibilityMode:d.styles.compatibilityMode,linkProjectors:d.links,projectFieldLink:S=>W.project(S),inlineDrawingLayout:d.drawingBundle.bodyContext,inlineDrawingLayoutForPart:S=>d.drawingBundle.contextForPart(S),drawingTokenForParagraph:S=>d.drawingBundle.drawingTokenForParagraph(S,d.view.part().name),drawingTokenForParagraphForPart:(S,X)=>d.drawingBundle.drawingTokenForParagraph(X,S),drawingLayoutEpoch:d.drawingBundle.cacheTokenForPart(d.view.part().name),drawingLayoutEpochForPart:S=>d.drawingBundle.cacheTokenForPart(S),displayMode:m,revisionAuthorFilter:void 0,showFieldCodes:false});if(!tr(j)){let S=E();if(S)return S;i||(chunk65GJRSZ5_cjs.uc(j),chunk65GJRSZ5_cjs.Ed(j),d.paragraphCache.clear(),d.sessions.delete(m),d.furniture.delete(m));let X=ut(j,M),ft=X.length===0?Ut:Object.freeze(ot(j,X)),gt=Ue(d.view,j),ht={...j,...gt,contentWarnings:qe(d.view),reviewArtifacts:ft},le=pt(ht);return d.completed.set(m,{revision:O,pkg:M,internal:j,published:le}),le}let de=ee;for(;d.drawingBundle.pendingResourceCount()>0;){await Y(de,O,M,_),de=c,N();let S=E();if(S)return S}N();let ue=E();if(ue)return ue}throw new k("nonConvergent",`Image resources did not reach quiescence after ${se} layout passes`)},z=m=>{let P;try{P=mt(m);}catch(O){return Promise.reject(O)}if(!u)return Promise.reject(v());let D=u,d=D.inFlight.get(P);if(d)return d;let _=K(P).catch(O=>{throw Jt(O)}).finally(()=>D.inFlight.delete(P));return D.inFlight.set(P,_),_};return {ok:true,session:{layout:()=>z(r),layoutFor:z,validatedImageBytes(m){let P=u;return !P||m.resource.kind!=="ready"?null:P.drawingBundle.mintValidatedBytes(m.resource.validatedHandle,m.resource.contentId)?.slice()??null},dispose:V}}}exports.a=Je;exports.b=ar;exports.c=Ye;exports.d=k;exports.e=nn;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
`:n.kind==="pageBreak"?e+=
|
|
3
|
-
`?(P(),a.push({op:"insertHardBreak",paragraphId:t,offset:c}),c+=1):b===
|
|
4
|
-
`)}var _o=64,Dn=new WeakMap;function Xe(t,e=0){if(e>_o)return false;let n=Dn.get(t);if(n!==void 0)return n;let o=false;for(let s of t.children)if(s.kind!=="textValue"&&(s.kind==="commentRangeStart"||s.kind==="commentReference"||Xe(s,e+1))){o=true;break}return Dn.set(t,o),o}function jo(t,e){let n=t.kind==="revision"?t.ranges[0]??null:t.range;if(!n)return null;let o=e.get(n.start.paragraphId);return o===void 0?null:o}function Fn(t,e,n){for(let s of e)if(s.ranges.length===0)return false;let o=new Set;for(let s of t)s.kind!=="revision"||s.ranges.length>0||Ln(s,n)||o.add(chunkDFTVN25X_cjs.Da(s));for(let s of e)if(o.has(chunkDFTVN25X_cjs.Da(s)))return false;return true}function Bn(t,e,n,o){let s=e.get(n);if(s===void 0)return [...t];let a=[],r=null;for(let d of t){if(d.kind==="revision"&&Ln(d,n)){r===null&&(r=a.length);continue}if(r===null){let u=jo(d,e);u!==null&&u>s&&(r=a.length);}a.push(d);}if(r===null&&(r=a.length),o.length>0){let d=o.length<2?[...o]:[...o].sort((u,m)=>chunkDFTVN25X_cjs.Ga(u,e)-chunkDFTVN25X_cjs.Ga(m,e));a.splice(r,0,...d);}return chunkDFTVN25X_cjs.Sa(a)}function Ln(t,e){return t.ranges.length>0&&t.ranges.every(n=>n.start.paragraphId===e&&n.end.paragraphId===e)}function Ho(t,e){return t.range?t.range.start.paragraphId===e||t.range.end.paragraphId===e:false}function $o(t,e){return t.revisionKind==="structural"&&t.ranges.some(n=>n.start.paragraphId===e||n.end.paragraphId===e)}function zo(t,e){return t.ranges.length===0||!t.ranges.some(o=>o.start.paragraphId===e||o.end.paragraphId===e)?false:!t.ranges.every(o=>o.start.paragraphId===e&&o.end.paragraphId===e)}function _n(t,e,n,o,s,a,r){if(t.fromRevision!==e.bodyRevision||r!==e.packageRevision+1||t.story!==void 0&&t.story.kind!=="body"||t.impact!=="text-local"||t.dirty.length!==1||t.created.length>0||t.deleted.length>0||t.splitJoin.length>0||e.commentsPart!==s||e.commentsExtendedPart!==a)return null;let d=t.dirty[0],u=chunkZZRCVDQU_cjs.Ha(o,d);if(!u||u.kind!=="paragraph")return null;let m=chunkZZRCVDQU_cjs.Ia(o,d);if(m){let f=m.children.findIndex(y=>y.id===d),x=m.children[f-1];if(x?.kind==="paragraph"&&chunkZZRCVDQU_cjs.Th({...o,root:x}).some(y=>y.paragraphMark))return null}for(let f of n){if(f.kind==="comment"){if(Ho(f,d))return null;continue}if(f.kind==="custom"){if(f.range?.start.paragraphId===d)return null;continue}if($o(f,d)||zo(f,d))return null}return d}var $n=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Wo=["ascii","hAnsi","cs","eastAsia"],Yo=["asciiTheme","hAnsiTheme","cstheme","eastAsiaTheme"],Jo=128,Uo=/[\u0000-\u001F\u007F-\u009F]/;function C(t){return t.kind!=="textValue"}function V(t,e){return t.attributes.find(n=>n.localName===e)?.value}function zn(t,e){let n=new Map;for(let s of t)for(let a of s.children)if(C(a))for(let[r,d]of Jn(a,e))n.has(r)||n.set(r,d);let o=[...n.values()];return o.sort((s,a)=>s<a?-1:s>a?1:0),o}var Ve=new WeakMap,Wn=16,Yn=32;function Jn(t,e,n=0){let o=e?.major??null,s=e?.minor??null,a=e?.majorEastAsia??null,r=e?.minorEastAsia??null,d=e?.majorBidi??null,u=e?.minorBidi??null,m=Ve.get(t);if(m&&m.major===o&&m.minor===s&&m.majorEastAsia===a&&m.minorEastAsia===r&&m.majorBidi===d&&m.minorBidi===u)return m.byFold;if(t.children.length>=Wn&&n<Yn&&t.localName!=="rFonts"){let c=new Map;for(let h of t.children)if(C(h))for(let[P,b]of Jn(h,e,n+1))c.has(P)||c.set(P,b);return Ve.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:d,minorBidi:u,byFold:c}),c}let f=new Map,x=c=>{if(!c||!$n.test(c))return;let h=c.toLowerCase();f.has(h)||f.set(h,c);},y=[t];for(;y.length>0;){let c=y.pop();if(C(c)){if(c.localName==="rFonts"){for(let h of Wo)x(V(c,h));if(e)for(let h of Yo)x(chunkDFTVN25X_cjs.b(V(c,h),e));}for(let h=c.children.length-1;h>=0;h-=1)y.push(c.children[h]);}}return Ve.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:d,minorBidi:u,byFold:f}),f}function Un(t){let e=new Map;for(let o of t)for(let s of o.children)if(C(s))for(let[a,r]of Gn(s))e.has(a)||e.set(a,r);let n=[...e.values()];return n.sort((o,s)=>o<s?-1:o>s?1:0),n}var jn=new WeakMap,Go=new Map;function Gn(t,e=0){let n=jn.get(t);if(n)return n;let o=r=>{let d=r.size===0?Go:r;return jn.set(t,d),d},s=new Map;if(t.children.length>=Wn&&e<Yn&&t.localName!=="sym"){for(let r of t.children)if(C(r))for(let[d,u]of Gn(r,e+1))s.has(d)||s.set(d,u);return o(s)}let a=[t];for(;a.length>0;){let r=a.pop();if(C(r)){if(r.localName==="sym"&&r.namespaceUri===chunkZZRCVDQU_cjs.da){let d=r.attributes.find(m=>m.localName==="font"&&(m.namespaceUri===chunkZZRCVDQU_cjs.da||m.namespaceUri===""))?.value,u=chunkT5B4NMKF_cjs.b(d);u!==null&&!s.has(u.toLowerCase())&&s.set(u.toLowerCase(),u);}for(let d=r.children.length-1;d>=0;d-=1)a.push(r.children[d]);}}return o(s)}function Kn(t){let e=[...t];for(;e.length>0;){let n=e.pop();if(C(n)){if(n.localName==="t"&&n.namespaceUri===chunkZZRCVDQU_cjs.da){for(let o of n.children)if(!C(o)&&o.value.length>0)return true;continue}for(let o of n.children)e.push(o);}}return false}var Ko=new Set(["paragraph","character","table","numbering"]),Xo=/^[0-9A-Fa-f]{6}$/,Vo=16,Hn=new Map([["normal",0],["title",1],["subtitle",2],["heading 1",11],["heading 2",12],["heading 3",13],["heading 4",14],["heading 5",15],["heading 6",16],["heading 7",17],["heading 8",18],["heading 9",19]]);function Xn(t){return t.children}function Qe(t,e){for(let n of Xn(t))if(C(n)&&n.localName===e)return n}function Qo(t){return Hn.get(t.name.toLowerCase())??Hn.get(t.styleId.toLowerCase())??Number.MAX_SAFE_INTEGER}function Ze(t){return t===void 0||t.length===0||t.length>Jo||Uo.test(t)?null:t}function Vn(t,e){if(!t)return [];let n=new Map;for(let a of t.children){if(!C(a)||a.localName!=="style")continue;let r=Ze(V(a,"styleId"));r!==null&&!n.has(r)&&n.set(r,a);}let o=a=>{let r=false,d=false,u=null,m=false,f=false,x=new Set,y=a;for(let P=0;P<Vo&&y!==null&&!x.has(y);P+=1){x.add(y);let b=n.get(y);if(!b)break;let R=Qe(b,"rPr");for(let v of R?Xn(R):[]){if(!C(v))continue;let T=V(v,"val"),D=T!=="0"&&T!=="false"&&T!=="off";v.localName==="b"&&!m?(r=D,m=true):v.localName==="i"&&!f?(d=D,f=true):v.localName==="color"&&u===null&&T&&Xo.test(T)&&(u=T);}let O=Qe(b,"basedOn");y=O?Ze(V(O,"val")):null;}let c=e?.(a),h=c?.fontFamily??null;return {fontFamily:h!==null&&$n.test(h)?h:null,fontSizePt:c?.fontSizeHalfPoints!=null&&c.fontSizeHalfPoints>0?c.fontSizeHalfPoints/2:null,bold:r,italic:d,color:u}},s=[];for(let[a,r]of n){let d=V(r,"type");if(d===void 0||!Ko.has(d))continue;let u=Qe(r,"name"),m=Ze(u?V(u,"val"):void 0);s.push({styleId:a,name:m??a,type:d,preview:o(a)});}return s.map((a,r)=>({entry:a,index:r,rank:Qo(a)})).sort((a,r)=>a.rank-r.rank||a.index-r.index).map(a=>a.entry)}var Zo=128,qo=/[\u0000-\u001F\u007F-\u009F]/,er=/[\u0000-\u001F\u007F-\u009F]/g,tr=200;function et(t){return t.kind!=="textValue"}function Qn(t,e){for(let n of t.children)if(et(n)&&n.localName===e)return n}function qe(t,e){return t.attributes.find(n=>n.localName===e)?.value}function nr(t){let e=new Map;if(!t)return e;for(let n of t.children){if(!et(n)||n.localName!=="style"||qe(n,"type")!=="paragraph")continue;let o=qe(n,"styleId");if(o===void 0||o.length===0||o.length>Zo||qo.test(o))continue;let s=chunkFGBADUSK_cjs.a(n);s!==null&&e.set(o,s);}return e}function tt(t){let e=Qn(t,"pPr"),n=e?Qn(e,"pStyle"):void 0;return n?qe(n,"val"):void 0}function Zn(t,e){let n=nr(e);if(n.size===0)return [];let o=[];for(let s of ne(t)){if(!et(s))continue;let a=tt(s);if(a===void 0)continue;let r=n.get(a);if(r===void 0)continue;let u=(chunkZZRCVDQU_cjs.Pi(t,s.id)??"").replace(er," ").trim().slice(0,tr);u.length!==0&&o.push({text:u,level:r,blockId:s.id});}return o}function or(t,e,n){let o=new Map,s=n(t);for(let a of s){let r=o.get(a.hostParagraphId);r?r.push(a):o.set(a.hostParagraphId,[a]);}return o}function rr(t,e,n){let o=[];for(let s of chunkZZRCVDQU_cjs.Bd(t.root)){let a=e.get(s.id);if(a)for(let r of a)o.push(r);}return o}function qn(t,e,n=chunkZZRCVDQU_cjs.Lg){let o=[],s=new Map;for(let a of t){if(o.push(a),a.scope?.kind==="note")continue;let r=s.get(a.part);r||(r=or(a.part,e,n),s.set(a.part,r));for(let d of rr(a,r)){let u=a.scope;o.push({part:a.part,root:d.root,scope:{kind:"frame",id:d.root.id,drawingNodeId:d.drawingNodeId,hostParagraphId:d.hostParagraphId,...u?.kind==="headerFooter"?{owner:u}:{}}});}}return o}var Ie=48,ar=/[\u0000-\u001F\u007F-\u009F]/g;function sr(t){let e=[],n=chunkZZRCVDQU_cjs.Ue(t),o=new Map;for(let s of n.segments)chunkZZRCVDQU_cjs.fe(s.node)&&o.set(s.node.id,s.formatRunIds??[]);return chunkZZRCVDQU_cjs.Ld(t.children,0,s=>{if(s.kind==="run"){e.push({id:s.id,start:n.spanOf(s)?.start??0});return}if(chunkZZRCVDQU_cjs.fe(s))for(let a of o.get(s.id)??[]){let r=n.spanOf(a);r&&e.push({id:a,start:r.start});}},{descendRevisions:true}),e}function ir(t){let e=chunkZZRCVDQU_cjs.Ad(t);return e?[{part:t,root:e}]:[]}function lr(t,e){let n=[];for(let o of ["header","footer"])for(let s of t){let a=o==="header"?s.headers:s.footers;for(let[r,d]of a){if(!chunkZZRCVDQU_cjs.Md(s,r)||e.has(d.part))continue;e.add(d.part);let u=chunkZZRCVDQU_cjs.yd(d.part).find(m=>m.kind===o);u&&n.push({part:d.part,root:u.root,scope:{kind:"headerFooter",rId:d.rId}});}}return n}function eo(t,e,n){if(!t)return [];let o=[];for(let s of chunkZZRCVDQU_cjs.ud(t.root)){let a=chunkZZRCVDQU_cjs.id(s);!chunkZZRCVDQU_cjs.kd(s)||a===null||!n.has(a)||o.push({part:t,root:s,scope:{kind:"note",id:chunkZZRCVDQU_cjs._c(e,a)}});}return o}function dr(t,e){let n=ir(t);if(e){let o=new Set;for(let s of lr(e.headerFooterBySection,o))n.push(s);for(let s of eo(e.footnotes,"footnote",e.referencedNoteIds.footnote))n.push(s);for(let s of eo(e.endnotes,"endnote",e.referencedNoteIds.endnote))n.push(s);}return qn(n)}function to(t,e){if(t.length===0)return {index:0,offset:e};for(let n=t.length-1;n>=0;n-=1){let o=t[n].start;if(e>=o)return {index:n,offset:e-o}}return {index:0,offset:e}}function cr(t,e,n){let o=t.findIndex(s=>s.id===e);return o<0?null:{index:o,offset:n}}function nt(t,e){return t.replace(ar," ").slice(0,e)}function no(t,e,n={},o){let s={matches:[],truncated:false};if(!chunkDFTVN25X_cjs.Xa(e))return s;let a=n.limit!==void 0&&Number.isInteger(n.limit)&&n.limit>0?Math.min(n.limit,2e3):2e3,r={...n.matchCase===void 0?{}:{matchCase:n.matchCase},...n.wholeWord===void 0?{}:{wholeWord:n.wholeWord}},d=[],u=n.stories==="body"?void 0:o;for(let m of dr(t,u)){let f=0;for(let x of chunkZZRCVDQU_cjs.Bd(m.root)){if(x.kind!=="paragraph")continue;let y=f;f+=1;let c=chunkZZRCVDQU_cjs.Pi(m.part,x.id)??"",h=chunkRA2TDTEQ_cjs.d(x,c);if(h.text.length===0)continue;let P=a-d.length,b=h.findOccurrences(e,Math.max(P,1),r);if(P===0&&b.matches.length>0)return {matches:d,truncated:true};let R=null;for(let O of b.matches){let v=O.start+O.length;R??=sr(x);let T=h.resultRunAddressAt(O.start),D=T?cr(R,T.runId,T.offset)??to(R,O.rawStart):to(R,O.rawStart);d.push({blockId:x.id,start:O.rawStart,length:O.rawEnd-O.rawStart,paragraphIndex:y,runIndex:D.index,runOffset:D.offset,...m.scope?{scope:m.scope}:{},text:nt(h.text.slice(O.start,v),256),contextBefore:nt(h.text.slice(Math.max(0,O.start-Ie),O.start),Ie),contextAfter:nt(h.text.slice(v,v+Ie),Ie)});}if(b.truncated)return {matches:d,truncated:true}}}return {matches:d,truncated:false}}var ur=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"];function oe(t,e=null){return chunkDFTVN25X_cjs.a(t,e)}function oo(t){let e=chunkZZRCVDQU_cjs.bb(t),n=[];for(let o of ur){let s=e.get(o);if(!s)return [];n.push({slot:o,hex:s});}return n}var ro=new WeakMap;function rt(t){let e=ro.get(t);if(e!==void 0)return e;let n=chunkZZRCVDQU_cjs.Fb(t),o=n===null||!chunkZZRCVDQU_cjs.Eb(n)?null:n;return ro.set(t,o),o}var ot=class{#e;#t;constructor(e,n){this.#e=e,this.#t=n;}get size(){return this.#e.size}get(e){if(this.#e.has(e))return this.#t.find(n=>e.startsWith(`${n.name}#`))}has(e){return this.get(e)!==void 0}*entries(){for(let e of this.#e.keys()){let n=this.get(e);n&&(yield [e,n]);}}keys(){return this.#e.keys()}*values(){for(let[,e]of this.entries())yield e;}[Symbol.iterator](){return this.entries()}forEach(e,n){for(let[o,s]of this.entries())e.call(n,s,o,this);}};function ao(t,e){return Object.freeze({...t,partByNode:new ot(t.ordinalByNode,e)})}function so(t){let e=new Map,n=new Map,o=new Map,s=new Set,a=new Map,r=new Map,d=0;for(let u of t)for(let m of F(u)){o.set(m.id,d),a.set(m.id,u),d+=1;let f=rt(m);if(f===null)continue;e.set(m.id,f);let x=f.toUpperCase(),y=r.get(x);y?(y.push(m.id),s.add(x)):(r.set(x,[m.id]),n.set(x,m.id));}return Object.freeze({paraIdByNode:e,nodeByParaId:n,ordinalByNode:o,ambiguousParaIds:s,partByNode:a,claimantsByParaId:r})}function io(t,e){let n=t.indexOf("#");if(n<=0)return null;let o=t.slice(0,n),s=e.body.name===o?e.body:void 0;s??=e.openStories.find(d=>d.name===o);let a=s?void 0:e.otherStories.find(d=>d.name===o);if(s??=a?e.normalize(a):void 0,!s)return null;let r=chunkZZRCVDQU_cjs.Ha(s,t);return r?.kind==="paragraph"?rt(r):null}var lo={committed:false,rejected:false,opCount:0};function _(t,e){return e===void 0?{committed:false,rejected:true,opCount:t}:{committed:false,rejected:true,opCount:t,reason:e}}function co(t,e,n={}){let o=e.filter(f=>f.ops.length>0),s=n.partOps??[],a=[...o,...s].reduce((f,x)=>f+x.ops.length,0);if(a===0)return n.packageEdits?.length?_(0,"invalidArgs"):lo;if([...o,...s].some(f=>f.ops.some(chunkZZRCVDQU_cjs.Ef))||[...o,...s].some(f=>f.ops.some(chunkZZRCVDQU_cjs.lg)))return _(a,"invalidArgs");let[r,...d]=o,u=[];for(let f of d){let x=t.partFor(f.scope);if(!x)return _(a,"unknown-part");u.push({partName:x.name,ops:f.ops});}let m=t.transact(r?.scope??{kind:"body"},f=>{for(let x of n.packageEdits??[])f.applyPackage(x);for(let x of r?.ops??[])f.apply(x);for(let x of u)for(let y of x.ops)f.applyTo(x.partName,y);for(let x of s)for(let y of x.ops)f.applyTo(x.partName,y);},n);return m.ok?{committed:true,rejected:false,opCount:a}:_(a,m.reason)}function uo(t,e,n,o,s,a){let r=a.partOps??[],d=e.length+r.reduce((x,y)=>x+y.ops.length,0);if(d===0&&!a.packageEdits?.length)return lo;if(r.some(x=>x.ops.some(y=>chunkZZRCVDQU_cjs.Ef(y)||chunkZZRCVDQU_cjs.lg(y))))return _(d,"invalidArgs");let u=e.filter(x=>chunkZZRCVDQU_cjs.Ef(x)||chunkZZRCVDQU_cjs.lg(x)).length;if(u>0){if(r.length||a.packageEdits?.length||u!==e.length||e.length!==1)return _(e.length,"invalidArgs");let x=chunkZZRCVDQU_cjs.Nb(a.actorId,()=>t.applyLifecycleOp(e[0]));return x.ok?{committed:true,rejected:false,opCount:1}:_(1,x.detail??x.reason)}let m=a.recordsHistory===false&&a.actorId&&a.operationId?t.partFor(s)?.name:void 0,f=t.transact(s,x=>{n!==void 0&&x.selectionBefore(n),o!==void 0&&x.selectionAfter(o);for(let y of a.packageEdits??[])x.applyPackage(y);for(let y of e)x.apply(y);for(let y of r)for(let c of y.ops)x.applyTo(y.partName,c);m&&x.applyPackage(y=>chunk4TYA4RLP_cjs.a(y,m,e));},a);return f.ok?{committed:true,rejected:false,opCount:d}:_(d,f.reason)}var pr=Object.freeze([]);function fr(t,e={}){let n=chunkZZRCVDQU_cjs.ec(t);if(!n.ok)return {ok:false,reason:n.reason,...n.detail?{detail:n.detail}:{}};let o=n.package,s=o.parts.get(o.mainDocumentPart);if(!s)return {ok:false,reason:"no-main-document-tree",detail:o.mainDocumentPart};let a=chunkZZRCVDQU_cjs.Lb(s),r=new chunkDFTVN25X_cjs.O(o,chunkDFTVN25X_cjs.Za(o,a)),d=null,u=null,m=null,f=null,x=null;r.subscribe(i=>{f=i,x=r.currentPackage();});let y=()=>r.bodyStore(),c=()=>r.currentPackage(),h=Cn(),P=Object.freeze({kind:"body"}),b=(i,l)=>{let p=l?.find(k=>k.type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");if(!p)return;let g=chunkZZRCVDQU_cjs.E(p);return g.mode==="Internal"&&g.target.ok?i.parts.get(g.target.partName):void 0},R=(i,l,p)=>{if(i.mainRelationships!==p||i.settingsPart!==b(l,p))return false;for(let g of i.resolution)for(let k of [g.headers,g.footers])for(let S of k.values())if(l.parts.get(S.partName)!==S.part)return false;return true},O=()=>{let i=c(),l=i.relationships.get(i.mainDocumentPart);if(d&&f&&x===i&&R(d,i,l)&&d.packageRevision===f.fromRevision&&r.packageRevision===f.toRevision&&f.story?.kind==="body"&&f.impact==="text-local"&&f.created.length===0&&f.deleted.length===0&&f.splitJoin.length===0&&(d={...d,packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:b(i,l)}),!d||d.packageRevision!==r.packageRevision||d.pkg!==i){let p=chunkZZRCVDQU_cjs.Pd(i);d={packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:b(i,l),resolution:p,parts:chunkZZRCVDQU_cjs.Od(p)};}return d},v="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",T="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",D=null,j=()=>{let i=c(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===v),p;if(l){let k=chunkZZRCVDQU_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/styles.xml");let g=p?.root??null;return g!==D&&(D=g,ie=null,G=null),D},J=null,B=null,Ee=()=>{let i=c();if(J===i)return B;J=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(g=>g.type===T),p;if(l){let g=chunkZZRCVDQU_cjs.E(l);g.mode==="Internal"&&g.target.ok&&(p=i.parts.get(g.target.partName));}return p??=i.parts.get("/word/numbering.xml"),B=p?.root??null,B},fo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",at=null,ue=null,U=()=>{let i=c();if(at===i)return ue;at=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===fo),p;if(l){let k=chunkZZRCVDQU_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/settings.xml");let g=p?.root??null;return g!==ue&&(ue=g,me=null,ie=null,G=null),ue},mo="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",go="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",st=(i,l)=>{let p=c(),g=(p.relationships.get("/")??[]).find(S=>S.type===i),k;if(g){let S=chunkZZRCVDQU_cjs.E(g);S.mode==="Internal"&&S.target.ok&&(k=p.parts.get(S.target.partName));}return k??p.parts.get(l)},it=null,Me=chunkZZRCVDQU_cjs.Jg,yo=()=>{let i=c();if(it===i)return Me;it=i;let l=st(mo,"/docProps/core.xml"),p=st(go,"/docProps/app.xml");return Me=chunkZZRCVDQU_cjs.Kg(l?.root??null,p?.root??null),Me},ho="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",lt=null,pe=null,Q=()=>{let i=c();if(lt===i)return pe;lt=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===ho),p;if(l){let k=chunkZZRCVDQU_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/theme/theme1.xml");let g=p?.root??null;return g!==pe&&(pe=g,me=null,we=null,ie=null,G=null),pe},xo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",fe=null,ko=()=>{if(fe)return fe;let i=c(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(g=>g.type===xo),p;if(l){let g=chunkZZRCVDQU_cjs.E(l);g.mode==="Internal"&&g.target.ok&&(p=i.parts.get(g.target.partName));}return p??=i.parts.get("/word/fontTable.xml"),fe=Object.freeze(chunkZZRCVDQU_cjs.Td(i,p)),fe},re=null,Z=null,ae=null,se=null,ie=null,we=null,me=null,dt=()=>{let i=[y().part.root],l=new Set;for(let p of H())l.has(p)||(l.add(p),i.push(p.root));return i},Ce=()=>{let i=dt(),l=j();return l&&i.splice(1,0,l),i},G=null,ge=null,le=null,de=null,q=null,ct=new WeakMap,ye=null,ut=i=>{let l=ct.get(i);if(l)return l;let p=chunkZZRCVDQU_cjs.Lb(i);return ct.set(i,p),p},pt=()=>{let i=r.packageRevision,l=r.openStoryToken();if(!q||q.revision!==i||q.openStories!==l){let p=r.openStoryParts(),g=new Set(p.map(M=>M.name)),k=H().filter(M=>!g.has(M.name)).map(ut),S=[y().part,...p,...k],N=q,I=N!==null&&f!==null&&N.openStories===l&&N.revision===f.fromRevision&&i===f.toRevision&&f.impact==="text-local"&&f.created.length===0&&f.deleted.length===0&&f.splitJoin.length===0&&N.parts.length===S.length&&N.parts.every((M,ee)=>M.name===S[ee]?.name);q={revision:i,openStories:l,parts:S,index:I&&N?ao(N.index,S):so(S)};}return q.index},ft=()=>{let i=y().part.name,l=new Map;for(let p of [y().part,...H()])for(let[g,k]of chunkDFTVN25X_cjs.fa(c(),p.name,i))l.set(g,k);return l},Po=()=>[y().part,...H()],H=()=>{let i=[],l=new Set;for(let g of O().parts)for(let k of [g.headers,g.footers])for(let S of k.values())l.has(S)||(l.add(S),i.push(S));let p=c();for(let g of ["footnote","endnote"]){let k=chunkZZRCVDQU_cjs.Wf(p,g);!k||l.has(k)||(l.add(k),i.push(k));}return i};return {ok:true,session:{editable:F(y().part).length>0,paragraphIds:()=>F(y().part).map(i=>i.id),paragraphIdsIn(i=P){let l=r.partFor(i);return l?F(l).map(p=>p.id):[]},part:()=>y().part,partFor:i=>r.partFor(i),currentPackage:c,collaborationPort:i=>chunk4TYA4RLP_cjs.b(r,{documentId:i}),applyTreeOps(i,l,p,g=P,k={}){return uo(r,i,l,p,g,k)},applyTreeOpsAtomic(i,l={}){return co(r,i,l)},projectDoc:()=>X(y().part),reconcile:i=>Ke(i,y().part,f),lastCommitWasStructural:()=>f!==null&&(f.created.length>0||f.deleted.length>0||f.splitJoin.length>0||f.impact==="global"),applyPmDoc(i){let l=y(),p=Ge(l.part,i);if(!p.ok)return {committed:false,rejected:true,opCount:0,reason:p.reason};if(p.ops.length===0)return {committed:false,rejected:false,opCount:0};let g=r.transact(P,k=>{for(let S of p.ops)k.apply(S);});return g.ok?{committed:true,rejected:false,opCount:p.ops.length}:{committed:false,rejected:true,opCount:p.ops.length,reason:g.reason}},storyParts:Po,bodyText:()=>An(y().part),storyText(i){let l=r.partFor(i);return l?F(l).map(p=>chunkZZRCVDQU_cjs.Pi(l,p.id)??"").join(`
|
|
5
|
-
`):null},revision:()=>y().revision,revisionFor:i=>r.revisionFor(i),packageRevision:()=>r.packageRevision,canUndo:()=>r.canUndo,canRedo:()=>r.canRedo,undo:()=>{let i=r.selectionForUndo();return r.undo()===null?null:i},redo:()=>{let i=r.selectionForRedo();return r.redo()===null?null:i},beginComposition:(i=P)=>{r.beginComposition(i);},endComposition:()=>r.endComposition(),subscribe(i){return r.subscribe(i)},save(){return h(c())},headerFooterParts:()=>{let i=O().parts;return i[i.length-1]??
|
|
1
|
+
'use strict';var chunkRLKX7BIP_cjs=require('./chunk-RLKX7BIP.cjs'),chunkYYFBYVW4_cjs=require('./chunk-YYFBYVW4.cjs'),chunkFGBADUSK_cjs=require('./chunk-FGBADUSK.cjs'),chunkHZQFGB2X_cjs=require('./chunk-HZQFGB2X.cjs'),chunkP5PWSRNW_cjs=require('./chunk-P5PWSRNW.cjs'),chunkCB6RQ3GD_cjs=require('./chunk-CB6RQ3GD.cjs'),prosemirrorModel=require('prosemirror-model'),prosemirrorState=require('prosemirror-state'),prosemirrorView=require('prosemirror-view'),prosemirrorKeymap=require('prosemirror-keymap'),prosemirrorCommands=require('prosemirror-commands');function Y(t){return t.attributes?.val}function W(t){let e=Y(t);return e===void 0||!(e==="0"||e==="false"||e==="off")}var Oo=/^[0-9A-Fa-f]{6}$/,ve=/^\d{1,6}$/,So=/^-?\d{1,6}$/;function Ye(t){return t===void 0||t==="auto"?null:Oo.test(t)?`#${t}`:null}var bo={single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"},Ro={black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"};function vo(t){return !t||!/^[\w \-.+]{1,64}$/.test(t)?null:`"${t}"`}function K(t,e=false){return t===void 0||!(e?So:ve).test(t)?null:`${Number(t)/20}pt`}function Rn(t){let e=[],n=[],o=null,s=null;for(let a of t)switch(a.localName){case "b":e.push(`font-weight:${W(a)?"bold":"normal"}`);break;case "i":e.push(`font-style:${W(a)?"italic":"normal"}`);break;case "u":{let r=Y(a)??"single";if(r==="none"||!W(a))break;n.push("underline"),o=bo[r]??"solid",s=Ye(a.attributes?.color);break}case "strike":W(a)&&n.push("line-through");break;case "dstrike":W(a)&&n.push("line-through");break;case "caps":W(a)&&e.push("text-transform:uppercase");break;case "smallCaps":W(a)&&e.push("font-variant:small-caps");break;case "vertAlign":{let r=Y(a);r==="superscript"?e.push("vertical-align:super","font-size:0.75em"):r==="subscript"&&e.push("vertical-align:sub","font-size:0.75em");break}case "color":{let r=Ye(Y(a));r&&e.push(`color:${r}`);break}case "highlight":{let r=Ro[Y(a)??""];r&&e.push(`background-color:${r}`);break}case "sz":{let r=Y(a);r!==void 0&&ve.test(r)&&e.push(`font-size:${Number(r)/2}pt`);break}case "rFonts":{let r=vo(a.attributes?.ascii??a.attributes?.hAnsi);r&&e.push(`font-family:${r}`);break}case "spacing":{let r=K(Y(a),true);r&&e.push(`letter-spacing:${r}`);break}}return n.length>0&&(e.push(`text-decoration-line:${[...new Set(n)].join(" ")}`),o&&e.push(`text-decoration-style:${o}`),s&&e.push(`text-decoration-color:${s}`)),e.join(";")}var To={left:"left",start:"left",right:"right",end:"right",center:"center",both:"justify",distribute:"justify"};function vn(t){let e=[];for(let n of t)switch(n.localName){case "jc":{let o=To[Y(n)??""];o&&e.push(`text-align:${o}`);break}case "ind":{let o=K(n.attributes?.left??n.attributes?.start,true),s=K(n.attributes?.right??n.attributes?.end,true),a=K(n.attributes?.firstLine),r=K(n.attributes?.hanging);o&&e.push(`margin-left:${o}`),s&&e.push(`margin-right:${s}`),a?e.push(`text-indent:${a}`):r&&e.push(`text-indent:-${r}`);break}case "spacing":{let o=K(n.attributes?.before),s=K(n.attributes?.after);o&&e.push(`margin-top:${o}`),s&&e.push(`margin-bottom:${s}`);let a=n.attributes?.line,r=n.attributes?.lineRule;a!==void 0&&ve.test(a)&&r!=="exact"&&r!=="atLeast"?e.push(`line-height:${(Number(a)/240).toFixed(3)}`):a!==void 0&&ve.test(a)&&e.push(`line-height:${Number(a)/20}pt`);break}case "shd":{let o=Ye(n.attributes?.fill);o&&e.push(`background-color:${o}`);break}case "pageBreakBefore":W(n)&&e.push("break-before:page");break;}return e.join(";")}var E=new prosemirrorModel.Schema({nodes:{doc:{content:"paragraph+"},paragraph:{content:"inline*",group:"block",attrs:{nodeId:{default:null},props:{default:[]}},toDOM:t=>{let e=vn(t.attrs.props??[]);return ["p",{"data-node-id":String(t.attrs.nodeId??""),...e?{style:e}:{}},0]},parseDOM:[{tag:"p",getAttrs:t=>typeof t=="string"?null:{nodeId:t.getAttribute("data-node-id")||null,props:[]}}]},text:{group:"inline"},tab:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"tab",class:"docx-tab"},"\u2192"],parseDOM:[{tag:'span[data-token="tab"]'}]},hardBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["br"],parseDOM:[{tag:"br"}]},pageBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"page-break",class:"docx-page-break"}],parseDOM:[{tag:'span[data-token="page-break"]'}]},unknownInline:{inline:true,group:"inline",atom:true,selectable:false,draggable:false,attrs:{nodeId:{default:null},label:{default:""}},toDOM:t=>["span",{"data-token":"unknown","data-node-id":String(t.attrs.nodeId??""),contenteditable:"false",class:"docx-unknown-inline",title:String(t.attrs.label||"Content this editor cannot edit yet. It is preserved.")}],parseDOM:[{tag:'span[data-token="unknown"]',getAttrs:t=>typeof t=="string"?false:{nodeId:t.getAttribute("data-node-id")||null,label:""}}]}},marks:{runProps:{attrs:{props:{default:[]}},excludes:"runProps",toDOM:t=>{let e=t.attrs.props??[],n=Rn(e);return ["span",{"data-run-props":Io(e),...n?{style:n}:{}},0]},parseDOM:[{tag:"span[data-run-props]",getAttrs:t=>{if(typeof t=="string")return false;let e=Eo(t.getAttribute("data-run-props"));return e?{props:e}:false}}]}}});function Io(t){return JSON.stringify(Array.isArray(t)?t:[])}function Eo(t){if(!t)return null;try{let e=JSON.parse(t);if(!Array.isArray(e))return null;let n=[];for(let o of e){if(typeof o!="object"||o===null)return null;let s=o;if(typeof s.localName!="string"||s.attributes!==void 0&&(typeof s.attributes!="object"||s.attributes===null))return null;n.push(s.attributes===void 0?{localName:s.localName}:{localName:s.localName,attributes:s.attributes});}return n}catch{return null}}function Je(t){for(let e of t.marks)if(e.type.name==="runProps")return e.attrs.props??[];return []}function Te(t,e){return JSON.stringify(Ne(t))===JSON.stringify(Ne(e))}function Ne(t){return [...t].map(e=>({localName:e.localName,attributes:Object.fromEntries(Object.entries(e.attributes??{}).sort(([n],[o])=>n<o?-1:1))})).sort((e,n)=>e.localName<n.localName?-1:1)}function Ue(t){if(!t||t.kind==="textValue")return [];let e=[];for(let n of t.children){if(n.kind==="textValue"||n.localName==="rPrChange"||n.localName==="pPrChange")continue;let o={};for(let s of n.attributes)o[s.localName]=s.value;e.push(Object.keys(o).length>0?{localName:n.localName,attributes:o}:{localName:n.localName});}return e}function Tn(t){return t.kind==="textValue"?"":`${{drawing:"Picture",pict:"Picture",object:"Embedded object",fldSimple:"Field",hyperlink:"Hyperlink",sdt:"Content control",tbl:"Table"}[t.localName]??t.localName} \u2014 preserved, not editable yet`}function A(t){if(t.kind==="textValue")return [];let e=[],n=a=>{if(a.kind!=="run")return;let r=a.children.find(u=>u.kind==="runProperties"),d=Ue(r);for(let u of a.children)if(u.kind!=="runProperties"){if(u.kind==="tab"){e.push({kind:"tab"});continue}if(u.kind==="hardBreak"){e.push(chunkCB6RQ3GD_cjs.$d(u)?{kind:"pageBreak"}:{kind:"hardBreak"});continue}if(u.kind==="text"){let m="";for(let f of u.children)f.kind==="textValue"&&(m+=f.value);m.length>0&&e.push({kind:"text",text:m,props:d});continue}e.push({kind:"unknown",nodeId:u.id,label:Tn(u),modelLength:u.kind==="drawing"||chunkCB6RQ3GD_cjs.nb(u)||chunkCB6RQ3GD_cjs.Ya(u)?1:0});}},o=a=>{if(a.kind==="run"){n(a);return}e.push({kind:"unknown",nodeId:a.id,label:Tn(a),modelLength:0});},s=(a,r)=>{for(let d of a)if(!(d.kind==="textValue"||d.kind==="paragraphProperties")&&!(r>=chunkCB6RQ3GD_cjs.la)){if(chunkCB6RQ3GD_cjs.na(d)&&!chunkCB6RQ3GD_cjs.ka(d.kind)&&r<chunkCB6RQ3GD_cjs.la){s(d.children.filter(u=>!chunkCB6RQ3GD_cjs.gg(d,u)),chunkCB6RQ3GD_cjs.ma(d,r));continue}if(chunkCB6RQ3GD_cjs.Jd(d)){let u=chunkCB6RQ3GD_cjs.Ld(d);u&&s(u,chunkCB6RQ3GD_cjs.ma(d,r));continue}o(d);}};return s(t.children,0),e}function ne(t){let e=[],n=o=>{if(o.kind!=="textValue"){if(o.kind==="body"){for(let s of o.children)s.kind==="paragraph"&&e.push(s);return}for(let s of o.children)n(s);}};return n(t.root),e}var Nn=chunkCB6RQ3GD_cjs.zg(16),In=new WeakMap;function Mo(t,e){let n=In.get(t);if(!n){let o=[];chunkCB6RQ3GD_cjs.Hd([t],o,0),n=Object.freeze(o),In.set(t,n);}for(let o of n)e.push(o);}function F(t){let e=Nn.get(t);if(e)return e;let n=[];for(let o of chunkCB6RQ3GD_cjs.Dd(t))if(o.root.kind!=="textValue")for(let s of o.root.children)Mo(s,n);return Nn.set(t,n),n}function X(t){let e=ne(t).map(n=>{let o=n.kind==="textValue"?void 0:n.children.find(a=>a.kind==="paragraphProperties"),s=A(n).map(a=>{switch(a.kind){case "text":return E.text(a.text,a.props.length>0?[E.marks.runProps.create({props:a.props})]:[]);case "tab":return E.node("tab");case "hardBreak":return E.node("hardBreak");case "pageBreak":return E.node("pageBreak");default:return E.node("unknownInline",{nodeId:a.nodeId,label:a.label})}});return E.node("paragraph",{nodeId:n.id,props:Ue(o)},s)});return E.node("doc",null,e.length>0?e:[E.node("paragraph")])}function wo(t,e){let n=[];return t.forEach(o=>{if(o.isText&&o.text){n.push({kind:"text",text:o.text,props:Je(o)});return}o.type.name==="tab"?n.push({kind:"tab"}):o.type.name==="hardBreak"?n.push({kind:"hardBreak"}):o.type.name==="pageBreak"?n.push({kind:"pageBreak"}):o.type.name==="unknownInline"&&n.push({kind:"unknown",nodeId:String(o.attrs.nodeId??""),label:String(o.attrs.label??""),modelLength:e.has(String(o.attrs.nodeId??""))?1:0});}),n}function w(t){let e="";for(let n of t)n.kind==="text"?e+=n.text:n.kind==="tab"?e+=" ":n.kind==="hardBreak"?e+=`
|
|
2
|
+
`:n.kind==="pageBreak"?e+=chunkCB6RQ3GD_cjs.Zd:n.modelLength===1&&(e+=chunkCB6RQ3GD_cjs.ce);return e}function L(t){let e=[],n=0;for(let o of t)o.kind==="text"?n+=o.text.length:o.kind==="tab"||o.kind==="hardBreak"||o.kind==="pageBreak"?n+=1:(e.push(`${o.nodeId}@${n}`),n+=o.modelLength);return e}function Co(t,e){if(t===e)return null;let n=0,o=Math.min(t.length,e.length);for(;n<o&&t[n]===e[n];)n+=1;let s=t.length,a=e.length;for(;s>n&&a>n&&t[s-1]===e[a-1];)s-=1,a-=1;return {start:n,endBefore:s,endAfter:a}}function En(t){let e=[];for(let n of t)if(n.kind==="text")for(let o=0;o<n.text.length;o+=1)e.push(n.props);else n.kind==="tab"||n.kind==="hardBreak"||n.kind==="pageBreak"?e.push(e[e.length-1]??[]):n.kind==="unknown"&&n.modelLength===1&&e.push([]);return e}function Do(t,e,n,o,s){let a=[],r=w(e),d=w(n),u=Co(r,d),m=[],f=0,x=false;for(let y of e){if(y.kind!=="unknown"){f+=y.kind==="text"?y.text.length:1;continue}let c=f;y.modelLength===1&&u&&(u.start<f+1&&u.endBefore>f&&(x=true),u.endBefore<=f&&(c+=u.endAfter-u.endBefore)),m.push(`${y.nodeId}@${c}`),f+=y.modelLength;}if(x||JSON.stringify(m)!==JSON.stringify(L(n)))return {ok:false,reason:"unknown-content-moved",detail:t};if(Te(o,s)||a.push({op:"setParagraphProperties",paragraphId:t,properties:Ne(s)}),u&&(u.endBefore>u.start&&a.push({op:"deleteText",paragraphId:t,start:u.start,end:u.endBefore}),u.endAfter>u.start)){let y=d.slice(u.start,u.endAfter),c=u.start,h="",P=()=>{h.length!==0&&(a.push({op:"insertText",paragraphId:t,offset:c,text:h}),c+=h.length,h="");};for(let b of y)b===" "?(P(),a.push({op:"insertTab",paragraphId:t,offset:c}),c+=1):b===`
|
|
3
|
+
`?(P(),a.push({op:"insertHardBreak",paragraphId:t,offset:c}),c+=1):b===chunkCB6RQ3GD_cjs.Zd?(P(),a.push({op:"insertPageBreak",paragraphId:t,offset:c}),c+=1):h+=b;P();}if(!u){let y=En(e),c=En(n),h=0;for(;h<c.length;){if(Te(y[h]??[],c[h])){h+=1;continue}let P=h,b=c[h];for(;h<c.length&&Te(c[h],b)&&!Te(y[h]??[],c[h]);)h+=1;a.push({op:"setRunProperties",paragraphId:t,start:P,end:h,properties:Ne(b)});}}return {ok:true,ops:a}}function Ge(t,e){let n=ne(t),o=new Set;for(let d of n)for(let u of A(d))u.kind==="unknown"&&u.modelLength===1&&o.add(u.nodeId);let s=d=>wo(d,o),a=[];if(e.forEach(d=>{d.type.name==="paragraph"&&a.push(d);}),a.length!==e.childCount)return {ok:false,reason:"unsupported-node"};let r=a.length-n.length;if(r===0){let d=[];for(let[u,m]of a.entries()){let f=n[u];if(m.attrs.nodeId!==f.id)return {ok:false,reason:"paragraph-reordered",detail:String(m.attrs.nodeId)};let x=Do(f.id,A(f),s(m),Ue(f.kind==="textValue"?void 0:f.children.find(y=>y.kind==="paragraphProperties")),m.attrs.props??[]);if(!x.ok)return x;d.push(...x.ops);}return {ok:true,ops:d}}return r===1?Ao(n,a,s):r===-1?Fo(n,a,s):{ok:false,reason:"paragraph-count-unexplained",detail:String(r)}}function Ao(t,e,n){for(let o=0;o<t.length;o+=1){let s=t[o],a=e[o],r=e[o+1];if(!a||!r||a.attrs.nodeId!==s.id)continue;let d=r.attrs.nodeId;if(d!==null&&d!==s.id)continue;let u=n(a),m=n(r),f=A(s),x=w(u);if(x+w(m)===w(f)&&JSON.stringify(L([...u,...m]))===JSON.stringify(L(f))&&Mn(t,e,o,n)&&wn(t,e,o+1,o+2,n))return {ok:true,ops:[{op:"splitParagraph",paragraphId:s.id,offset:x.length}]}}return {ok:false,reason:"split-not-clean"}}function Fo(t,e,n){for(let o=0;o+1<t.length;o+=1){let s=t[o],a=t[o+1],r=e[o];if(!r||r.attrs.nodeId!==s.id)continue;let d=[...A(s),...A(a)],u=n(r);if(w(u)===w(d)&&JSON.stringify(L(u))===JSON.stringify(L(d))&&Mn(t,e,o,n)&&wn(t,e,o+2,o+1,n))return {ok:true,ops:[{op:"joinParagraphs",firstId:s.id,secondId:a.id}]}}return {ok:false,reason:"join-not-clean"}}function Mn(t,e,n,o){for(let s=0;s<n;s+=1){let a=e[s],r=t[s];if(!a||a.attrs.nodeId!==r.id||w(o(a))!==w(A(r))||JSON.stringify(L(o(a)))!==JSON.stringify(L(A(r))))return false}return true}function wn(t,e,n,o,s){for(let a=0;n+a<t.length;a+=1){let r=t[n+a],d=e[o+a];if(!d||d.attrs.nodeId!==r.id||w(s(d))!==w(A(r))||JSON.stringify(L(s(d)))!==JSON.stringify(L(A(r))))return false}return true}function Bo(t,e){return chunkCB6RQ3GD_cjs.Ha(t,e)!==null}function Ke(t,e,n){if(!n||n.created.length>0||n.deleted.length>0||n.splitJoin.length>0)return X(e);let o=new Map;t.forEach(u=>{let m=u.attrs.nodeId;typeof m=="string"&&o.set(m,u);});let s=new Set(n.dirty),a=ne(e);if(a.length!==t.childCount)return X(e);let r=X(e),d=[];for(let[u,m]of a.entries()){let f=o.get(m.id);d.push(f&&!s.has(m.id)?f:r.child(u));}return E.node("doc",null,d)}var Lo=8*1024*1024;function Cn(){let t=new WeakMap;return e=>{let n=t.get(e);if(n)return n.slice();let o=chunkCB6RQ3GD_cjs.kc(e);return t=new WeakMap,o.byteLength<=Lo&&t.set(e,o.slice()),o}}function An(t){return F(t).map(e=>chunkCB6RQ3GD_cjs.Ui(t,e.id)??"").join(`
|
|
4
|
+
`)}var _o=64,Dn=new WeakMap;function Xe(t,e=0){if(e>_o)return false;let n=Dn.get(t);if(n!==void 0)return n;let o=false;for(let s of t.children)if(s.kind!=="textValue"&&(s.kind==="commentRangeStart"||s.kind==="commentReference"||Xe(s,e+1))){o=true;break}return Dn.set(t,o),o}function jo(t,e){let n=t.kind==="revision"?t.ranges[0]??null:t.range;if(!n)return null;let o=e.get(n.start.paragraphId);return o===void 0?null:o}function Fn(t,e,n){for(let s of e)if(s.ranges.length===0)return false;let o=new Set;for(let s of t)s.kind!=="revision"||s.ranges.length>0||Ln(s,n)||o.add(chunkHZQFGB2X_cjs.Ea(s));for(let s of e)if(o.has(chunkHZQFGB2X_cjs.Ea(s)))return false;return true}function Bn(t,e,n,o){let s=e.get(n);if(s===void 0)return [...t];let a=[],r=null;for(let d of t){if(d.kind==="revision"&&Ln(d,n)){r===null&&(r=a.length);continue}if(r===null){let u=jo(d,e);u!==null&&u>s&&(r=a.length);}a.push(d);}if(r===null&&(r=a.length),o.length>0){let d=o.length<2?[...o]:[...o].sort((u,m)=>chunkHZQFGB2X_cjs.Ha(u,e)-chunkHZQFGB2X_cjs.Ha(m,e));a.splice(r,0,...d);}return chunkHZQFGB2X_cjs.Ta(a)}function Ln(t,e){return t.ranges.length>0&&t.ranges.every(n=>n.start.paragraphId===e&&n.end.paragraphId===e)}function Ho(t,e){return t.range?t.range.start.paragraphId===e||t.range.end.paragraphId===e:false}function $o(t,e){return t.revisionKind==="structural"&&t.ranges.some(n=>n.start.paragraphId===e||n.end.paragraphId===e)}function zo(t,e){return t.ranges.length===0||!t.ranges.some(o=>o.start.paragraphId===e||o.end.paragraphId===e)?false:!t.ranges.every(o=>o.start.paragraphId===e&&o.end.paragraphId===e)}function _n(t,e,n,o,s,a,r){if(t.fromRevision!==e.bodyRevision||r!==e.packageRevision+1||t.story!==void 0&&t.story.kind!=="body"||t.impact!=="text-local"||t.dirty.length!==1||t.created.length>0||t.deleted.length>0||t.splitJoin.length>0||e.commentsPart!==s||e.commentsExtendedPart!==a)return null;let d=t.dirty[0],u=chunkCB6RQ3GD_cjs.Ha(o,d);if(!u||u.kind!=="paragraph")return null;let m=chunkCB6RQ3GD_cjs.Ia(o,d);if(m){let f=m.children.findIndex(y=>y.id===d),x=m.children[f-1];if(x?.kind==="paragraph"&&chunkCB6RQ3GD_cjs.Yh({...o,root:x}).some(y=>y.paragraphMark))return null}for(let f of n){if(f.kind==="comment"){if(Ho(f,d))return null;continue}if(f.kind==="custom"){if(f.range?.start.paragraphId===d)return null;continue}if($o(f,d)||zo(f,d))return null}return d}var $n=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Wo=["ascii","hAnsi","cs","eastAsia"],Yo=["asciiTheme","hAnsiTheme","cstheme","eastAsiaTheme"],Jo=128,Uo=/[\u0000-\u001F\u007F-\u009F]/;function C(t){return t.kind!=="textValue"}function V(t,e){return t.attributes.find(n=>n.localName===e)?.value}function zn(t,e){let n=new Map;for(let s of t)for(let a of s.children)if(C(a))for(let[r,d]of Jn(a,e))n.has(r)||n.set(r,d);let o=[...n.values()];return o.sort((s,a)=>s<a?-1:s>a?1:0),o}var Ve=new WeakMap,Wn=16,Yn=32;function Jn(t,e,n=0){let o=e?.major??null,s=e?.minor??null,a=e?.majorEastAsia??null,r=e?.minorEastAsia??null,d=e?.majorBidi??null,u=e?.minorBidi??null,m=Ve.get(t);if(m&&m.major===o&&m.minor===s&&m.majorEastAsia===a&&m.minorEastAsia===r&&m.majorBidi===d&&m.minorBidi===u)return m.byFold;if(t.children.length>=Wn&&n<Yn&&t.localName!=="rFonts"){let c=new Map;for(let h of t.children)if(C(h))for(let[P,b]of Jn(h,e,n+1))c.has(P)||c.set(P,b);return Ve.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:d,minorBidi:u,byFold:c}),c}let f=new Map,x=c=>{if(!c||!$n.test(c))return;let h=c.toLowerCase();f.has(h)||f.set(h,c);},y=[t];for(;y.length>0;){let c=y.pop();if(C(c)){if(c.localName==="rFonts"){for(let h of Wo)x(V(c,h));if(e)for(let h of Yo)x(chunkHZQFGB2X_cjs.b(V(c,h),e));}for(let h=c.children.length-1;h>=0;h-=1)y.push(c.children[h]);}}return Ve.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:d,minorBidi:u,byFold:f}),f}function Un(t){let e=new Map;for(let o of t)for(let s of o.children)if(C(s))for(let[a,r]of Gn(s))e.has(a)||e.set(a,r);let n=[...e.values()];return n.sort((o,s)=>o<s?-1:o>s?1:0),n}var jn=new WeakMap,Go=new Map;function Gn(t,e=0){let n=jn.get(t);if(n)return n;let o=r=>{let d=r.size===0?Go:r;return jn.set(t,d),d},s=new Map;if(t.children.length>=Wn&&e<Yn&&t.localName!=="sym"){for(let r of t.children)if(C(r))for(let[d,u]of Gn(r,e+1))s.has(d)||s.set(d,u);return o(s)}let a=[t];for(;a.length>0;){let r=a.pop();if(C(r)){if(r.localName==="sym"&&r.namespaceUri===chunkCB6RQ3GD_cjs.da){let d=r.attributes.find(m=>m.localName==="font"&&(m.namespaceUri===chunkCB6RQ3GD_cjs.da||m.namespaceUri===""))?.value,u=chunkRLKX7BIP_cjs.b(d);u!==null&&!s.has(u.toLowerCase())&&s.set(u.toLowerCase(),u);}for(let d=r.children.length-1;d>=0;d-=1)a.push(r.children[d]);}}return o(s)}function Kn(t){let e=[...t];for(;e.length>0;){let n=e.pop();if(C(n)){if(n.localName==="t"&&n.namespaceUri===chunkCB6RQ3GD_cjs.da){for(let o of n.children)if(!C(o)&&o.value.length>0)return true;continue}for(let o of n.children)e.push(o);}}return false}var Ko=new Set(["paragraph","character","table","numbering"]),Xo=/^[0-9A-Fa-f]{6}$/,Vo=16,Hn=new Map([["normal",0],["title",1],["subtitle",2],["heading 1",11],["heading 2",12],["heading 3",13],["heading 4",14],["heading 5",15],["heading 6",16],["heading 7",17],["heading 8",18],["heading 9",19]]);function Xn(t){return t.children}function Qe(t,e){for(let n of Xn(t))if(C(n)&&n.localName===e)return n}function Qo(t){return Hn.get(t.name.toLowerCase())??Hn.get(t.styleId.toLowerCase())??Number.MAX_SAFE_INTEGER}function Ze(t){return t===void 0||t.length===0||t.length>Jo||Uo.test(t)?null:t}function Vn(t,e){if(!t)return [];let n=new Map;for(let a of t.children){if(!C(a)||a.localName!=="style")continue;let r=Ze(V(a,"styleId"));r!==null&&!n.has(r)&&n.set(r,a);}let o=a=>{let r=false,d=false,u=null,m=false,f=false,x=new Set,y=a;for(let P=0;P<Vo&&y!==null&&!x.has(y);P+=1){x.add(y);let b=n.get(y);if(!b)break;let R=Qe(b,"rPr");for(let v of R?Xn(R):[]){if(!C(v))continue;let T=V(v,"val"),D=T!=="0"&&T!=="false"&&T!=="off";v.localName==="b"&&!m?(r=D,m=true):v.localName==="i"&&!f?(d=D,f=true):v.localName==="color"&&u===null&&T&&Xo.test(T)&&(u=T);}let O=Qe(b,"basedOn");y=O?Ze(V(O,"val")):null;}let c=e?.(a),h=c?.fontFamily??null;return {fontFamily:h!==null&&$n.test(h)?h:null,fontSizePt:c?.fontSizeHalfPoints!=null&&c.fontSizeHalfPoints>0?c.fontSizeHalfPoints/2:null,bold:r,italic:d,color:u}},s=[];for(let[a,r]of n){let d=V(r,"type");if(d===void 0||!Ko.has(d))continue;let u=Qe(r,"name"),m=Ze(u?V(u,"val"):void 0);s.push({styleId:a,name:m??a,type:d,preview:o(a)});}return s.map((a,r)=>({entry:a,index:r,rank:Qo(a)})).sort((a,r)=>a.rank-r.rank||a.index-r.index).map(a=>a.entry)}var Zo=128,qo=/[\u0000-\u001F\u007F-\u009F]/,er=/[\u0000-\u001F\u007F-\u009F]/g,tr=200;function et(t){return t.kind!=="textValue"}function Qn(t,e){for(let n of t.children)if(et(n)&&n.localName===e)return n}function qe(t,e){return t.attributes.find(n=>n.localName===e)?.value}function nr(t){let e=new Map;if(!t)return e;for(let n of t.children){if(!et(n)||n.localName!=="style"||qe(n,"type")!=="paragraph")continue;let o=qe(n,"styleId");if(o===void 0||o.length===0||o.length>Zo||qo.test(o))continue;let s=chunkFGBADUSK_cjs.a(n);s!==null&&e.set(o,s);}return e}function tt(t){let e=Qn(t,"pPr"),n=e?Qn(e,"pStyle"):void 0;return n?qe(n,"val"):void 0}function Zn(t,e){let n=nr(e);if(n.size===0)return [];let o=[];for(let s of ne(t)){if(!et(s))continue;let a=tt(s);if(a===void 0)continue;let r=n.get(a);if(r===void 0)continue;let u=(chunkCB6RQ3GD_cjs.Ui(t,s.id)??"").replace(er," ").trim().slice(0,tr);u.length!==0&&o.push({text:u,level:r,blockId:s.id});}return o}function or(t,e,n){let o=new Map,s=n(t);for(let a of s){let r=o.get(a.hostParagraphId);r?r.push(a):o.set(a.hostParagraphId,[a]);}return o}function rr(t,e,n){let o=[];for(let s of chunkCB6RQ3GD_cjs.Gd(t.root)){let a=e.get(s.id);if(a)for(let r of a)o.push(r);}return o}function qn(t,e,n=chunkCB6RQ3GD_cjs.Qg){let o=[],s=new Map;for(let a of t){if(o.push(a),a.scope?.kind==="note")continue;let r=s.get(a.part);r||(r=or(a.part,e,n),s.set(a.part,r));for(let d of rr(a,r)){let u=a.scope;o.push({part:a.part,root:d.root,scope:{kind:"frame",id:d.root.id,drawingNodeId:d.drawingNodeId,hostParagraphId:d.hostParagraphId,...u?.kind==="headerFooter"?{owner:u}:{}}});}}return o}var Ie=48,ar=/[\u0000-\u001F\u007F-\u009F]/g;function sr(t){let e=[],n=chunkCB6RQ3GD_cjs.Ze(t),o=new Map;for(let s of n.segments)chunkCB6RQ3GD_cjs.ke(s.node)&&o.set(s.node.id,s.formatRunIds??[]);return chunkCB6RQ3GD_cjs.Qd(t.children,0,s=>{if(s.kind==="run"){e.push({id:s.id,start:n.spanOf(s)?.start??0});return}if(chunkCB6RQ3GD_cjs.ke(s))for(let a of o.get(s.id)??[]){let r=n.spanOf(a);r&&e.push({id:a,start:r.start});}},{descendRevisions:true}),e}function ir(t){let e=chunkCB6RQ3GD_cjs.Fd(t);return e?[{part:t,root:e}]:[]}function lr(t,e){let n=[];for(let o of ["header","footer"])for(let s of t){let a=o==="header"?s.headers:s.footers;for(let[r,d]of a){if(!chunkCB6RQ3GD_cjs.Rd(s,r)||e.has(d.part))continue;e.add(d.part);let u=chunkCB6RQ3GD_cjs.Dd(d.part).find(m=>m.kind===o);u&&n.push({part:d.part,root:u.root,scope:{kind:"headerFooter",rId:d.rId}});}}return n}function eo(t,e,n){if(!t)return [];let o=[];for(let s of chunkCB6RQ3GD_cjs.zd(t.root)){let a=chunkCB6RQ3GD_cjs.nd(s);!chunkCB6RQ3GD_cjs.pd(s)||a===null||!n.has(a)||o.push({part:t,root:s,scope:{kind:"note",id:chunkCB6RQ3GD_cjs.dd(e,a)}});}return o}function dr(t,e){let n=ir(t);if(e){let o=new Set;for(let s of lr(e.headerFooterBySection,o))n.push(s);for(let s of eo(e.footnotes,"footnote",e.referencedNoteIds.footnote))n.push(s);for(let s of eo(e.endnotes,"endnote",e.referencedNoteIds.endnote))n.push(s);}return qn(n)}function to(t,e){if(t.length===0)return {index:0,offset:e};for(let n=t.length-1;n>=0;n-=1){let o=t[n].start;if(e>=o)return {index:n,offset:e-o}}return {index:0,offset:e}}function cr(t,e,n){let o=t.findIndex(s=>s.id===e);return o<0?null:{index:o,offset:n}}function nt(t,e){return t.replace(ar," ").slice(0,e)}function no(t,e,n={},o){let s={matches:[],truncated:false};if(!chunkHZQFGB2X_cjs.Ya(e))return s;let a=n.limit!==void 0&&Number.isInteger(n.limit)&&n.limit>0?Math.min(n.limit,2e3):2e3,r={...n.matchCase===void 0?{}:{matchCase:n.matchCase},...n.wholeWord===void 0?{}:{wholeWord:n.wholeWord}},d=[],u=n.stories==="body"?void 0:o;for(let m of dr(t,u)){let f=0;for(let x of chunkCB6RQ3GD_cjs.Gd(m.root)){if(x.kind!=="paragraph")continue;let y=f;f+=1;let c=chunkCB6RQ3GD_cjs.Ui(m.part,x.id)??"",h=chunkYYFBYVW4_cjs.d(x,c);if(h.text.length===0)continue;let P=a-d.length,b=h.findOccurrences(e,Math.max(P,1),r);if(P===0&&b.matches.length>0)return {matches:d,truncated:true};let R=null;for(let O of b.matches){let v=O.start+O.length;R??=sr(x);let T=h.resultRunAddressAt(O.start),D=T?cr(R,T.runId,T.offset)??to(R,O.rawStart):to(R,O.rawStart);d.push({blockId:x.id,start:O.rawStart,length:O.rawEnd-O.rawStart,paragraphIndex:y,runIndex:D.index,runOffset:D.offset,...m.scope?{scope:m.scope}:{},text:nt(h.text.slice(O.start,v),256),contextBefore:nt(h.text.slice(Math.max(0,O.start-Ie),O.start),Ie),contextAfter:nt(h.text.slice(v,v+Ie),Ie)});}if(b.truncated)return {matches:d,truncated:true}}}return {matches:d,truncated:false}}var ur=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"];function oe(t,e=null){return chunkHZQFGB2X_cjs.a(t,e)}function oo(t){let e=chunkCB6RQ3GD_cjs.gb(t),n=[];for(let o of ur){let s=e.get(o);if(!s)return [];n.push({slot:o,hex:s});}return n}var ro=new WeakMap;function rt(t){let e=ro.get(t);if(e!==void 0)return e;let n=chunkCB6RQ3GD_cjs.Kb(t),o=n===null||!chunkCB6RQ3GD_cjs.Jb(n)?null:n;return ro.set(t,o),o}var ot=class{#e;#t;constructor(e,n){this.#e=e,this.#t=n;}get size(){return this.#e.size}get(e){if(this.#e.has(e))return this.#t.find(n=>e.startsWith(`${n.name}#`))}has(e){return this.get(e)!==void 0}*entries(){for(let e of this.#e.keys()){let n=this.get(e);n&&(yield [e,n]);}}keys(){return this.#e.keys()}*values(){for(let[,e]of this.entries())yield e;}[Symbol.iterator](){return this.entries()}forEach(e,n){for(let[o,s]of this.entries())e.call(n,s,o,this);}};function ao(t,e){return Object.freeze({...t,partByNode:new ot(t.ordinalByNode,e)})}function so(t){let e=new Map,n=new Map,o=new Map,s=new Set,a=new Map,r=new Map,d=0;for(let u of t)for(let m of F(u)){o.set(m.id,d),a.set(m.id,u),d+=1;let f=rt(m);if(f===null)continue;e.set(m.id,f);let x=f.toUpperCase(),y=r.get(x);y?(y.push(m.id),s.add(x)):(r.set(x,[m.id]),n.set(x,m.id));}return Object.freeze({paraIdByNode:e,nodeByParaId:n,ordinalByNode:o,ambiguousParaIds:s,partByNode:a,claimantsByParaId:r})}function io(t,e){let n=t.indexOf("#");if(n<=0)return null;let o=t.slice(0,n),s=e.body.name===o?e.body:void 0;s??=e.openStories.find(d=>d.name===o);let a=s?void 0:e.otherStories.find(d=>d.name===o);if(s??=a?e.normalize(a):void 0,!s)return null;let r=chunkCB6RQ3GD_cjs.Ha(s,t);return r?.kind==="paragraph"?rt(r):null}var lo={committed:false,rejected:false,opCount:0};function _(t,e){return e===void 0?{committed:false,rejected:true,opCount:t}:{committed:false,rejected:true,opCount:t,reason:e}}function co(t,e,n={}){let o=e.filter(f=>f.ops.length>0),s=n.partOps??[],a=[...o,...s].reduce((f,x)=>f+x.ops.length,0);if(a===0)return n.packageEdits?.length?_(0,"invalidArgs"):lo;if([...o,...s].some(f=>f.ops.some(chunkCB6RQ3GD_cjs.Jf))||[...o,...s].some(f=>f.ops.some(chunkCB6RQ3GD_cjs.qg)))return _(a,"invalidArgs");let[r,...d]=o,u=[];for(let f of d){let x=t.partFor(f.scope);if(!x)return _(a,"unknown-part");u.push({partName:x.name,ops:f.ops});}let m=t.transact(r?.scope??{kind:"body"},f=>{for(let x of n.packageEdits??[])f.applyPackage(x);for(let x of r?.ops??[])f.apply(x);for(let x of u)for(let y of x.ops)f.applyTo(x.partName,y);for(let x of s)for(let y of x.ops)f.applyTo(x.partName,y);},n);return m.ok?{committed:true,rejected:false,opCount:a}:_(a,m.reason)}function uo(t,e,n,o,s,a){let r=a.partOps??[],d=e.length+r.reduce((x,y)=>x+y.ops.length,0);if(d===0&&!a.packageEdits?.length)return lo;if(r.some(x=>x.ops.some(y=>chunkCB6RQ3GD_cjs.Jf(y)||chunkCB6RQ3GD_cjs.qg(y))))return _(d,"invalidArgs");let u=e.filter(x=>chunkCB6RQ3GD_cjs.Jf(x)||chunkCB6RQ3GD_cjs.qg(x)).length;if(u>0){if(r.length||a.packageEdits?.length||u!==e.length||e.length!==1)return _(e.length,"invalidArgs");let x=chunkCB6RQ3GD_cjs.Sb(a.actorId,()=>t.applyLifecycleOp(e[0]));return x.ok?{committed:true,rejected:false,opCount:1}:_(1,x.detail??x.reason)}let m=a.recordsHistory===false&&a.actorId&&a.operationId?t.partFor(s)?.name:void 0,f=t.transact(s,x=>{n!==void 0&&x.selectionBefore(n),o!==void 0&&x.selectionAfter(o);for(let y of a.packageEdits??[])x.applyPackage(y);for(let y of e)x.apply(y);for(let y of r)for(let c of y.ops)x.applyTo(y.partName,c);m&&x.applyPackage(y=>chunkP5PWSRNW_cjs.a(y,m,e));},a);return f.ok?{committed:true,rejected:false,opCount:d}:_(d,f.reason)}var pr=Object.freeze([]);function fr(t,e={}){let n=chunkCB6RQ3GD_cjs.jc(t);if(!n.ok)return {ok:false,reason:n.reason,...n.detail?{detail:n.detail}:{}};let o=n.package,s=o.parts.get(o.mainDocumentPart);if(!s)return {ok:false,reason:"no-main-document-tree",detail:o.mainDocumentPart};let a=chunkCB6RQ3GD_cjs.Qb(s),r=new chunkHZQFGB2X_cjs.P(o,chunkHZQFGB2X_cjs._a(o,a)),d=null,u=null,m=null,f=null,x=null;r.subscribe(i=>{f=i,x=r.currentPackage();});let y=()=>r.bodyStore(),c=()=>r.currentPackage(),h=Cn(),P=Object.freeze({kind:"body"}),b=(i,l)=>{let p=l?.find(k=>k.type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");if(!p)return;let g=chunkCB6RQ3GD_cjs.E(p);return g.mode==="Internal"&&g.target.ok?i.parts.get(g.target.partName):void 0},R=(i,l,p)=>{if(i.mainRelationships!==p||i.settingsPart!==b(l,p))return false;for(let g of i.resolution)for(let k of [g.headers,g.footers])for(let S of k.values())if(l.parts.get(S.partName)!==S.part)return false;return true},O=()=>{let i=c(),l=i.relationships.get(i.mainDocumentPart);if(d&&f&&x===i&&R(d,i,l)&&d.packageRevision===f.fromRevision&&r.packageRevision===f.toRevision&&f.story?.kind==="body"&&f.impact==="text-local"&&f.created.length===0&&f.deleted.length===0&&f.splitJoin.length===0&&(d={...d,packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:b(i,l)}),!d||d.packageRevision!==r.packageRevision||d.pkg!==i){let p=chunkCB6RQ3GD_cjs.Ud(i);d={packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:b(i,l),resolution:p,parts:chunkCB6RQ3GD_cjs.Td(p)};}return d},v="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",T="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",D=null,j=()=>{let i=c(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===v),p;if(l){let k=chunkCB6RQ3GD_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/styles.xml");let g=p?.root??null;return g!==D&&(D=g,ie=null,G=null),D},J=null,B=null,Ee=()=>{let i=c();if(J===i)return B;J=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(g=>g.type===T),p;if(l){let g=chunkCB6RQ3GD_cjs.E(l);g.mode==="Internal"&&g.target.ok&&(p=i.parts.get(g.target.partName));}return p??=i.parts.get("/word/numbering.xml"),B=p?.root??null,B},fo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",at=null,ue=null,U=()=>{let i=c();if(at===i)return ue;at=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===fo),p;if(l){let k=chunkCB6RQ3GD_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/settings.xml");let g=p?.root??null;return g!==ue&&(ue=g,me=null,ie=null,G=null),ue},mo="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",go="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",st=(i,l)=>{let p=c(),g=(p.relationships.get("/")??[]).find(S=>S.type===i),k;if(g){let S=chunkCB6RQ3GD_cjs.E(g);S.mode==="Internal"&&S.target.ok&&(k=p.parts.get(S.target.partName));}return k??p.parts.get(l)},it=null,Me=chunkCB6RQ3GD_cjs.Og,yo=()=>{let i=c();if(it===i)return Me;it=i;let l=st(mo,"/docProps/core.xml"),p=st(go,"/docProps/app.xml");return Me=chunkCB6RQ3GD_cjs.Pg(l?.root??null,p?.root??null),Me},ho="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",lt=null,pe=null,Q=()=>{let i=c();if(lt===i)return pe;lt=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===ho),p;if(l){let k=chunkCB6RQ3GD_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/theme/theme1.xml");let g=p?.root??null;return g!==pe&&(pe=g,me=null,we=null,ie=null,G=null),pe},xo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",fe=null,ko=()=>{if(fe)return fe;let i=c(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(g=>g.type===xo),p;if(l){let g=chunkCB6RQ3GD_cjs.E(l);g.mode==="Internal"&&g.target.ok&&(p=i.parts.get(g.target.partName));}return p??=i.parts.get("/word/fontTable.xml"),fe=Object.freeze(chunkCB6RQ3GD_cjs.Yd(i,p)),fe},re=null,Z=null,ae=null,se=null,ie=null,we=null,me=null,dt=()=>{let i=[y().part.root],l=new Set;for(let p of H())l.has(p)||(l.add(p),i.push(p.root));return i},Ce=()=>{let i=dt(),l=j();return l&&i.splice(1,0,l),i},G=null,ge=null,le=null,de=null,q=null,ct=new WeakMap,ye=null,ut=i=>{let l=ct.get(i);if(l)return l;let p=chunkCB6RQ3GD_cjs.Qb(i);return ct.set(i,p),p},pt=()=>{let i=r.packageRevision,l=r.openStoryToken();if(!q||q.revision!==i||q.openStories!==l){let p=r.openStoryParts(),g=new Set(p.map(M=>M.name)),k=H().filter(M=>!g.has(M.name)).map(ut),S=[y().part,...p,...k],N=q,I=N!==null&&f!==null&&N.openStories===l&&N.revision===f.fromRevision&&i===f.toRevision&&f.impact==="text-local"&&f.created.length===0&&f.deleted.length===0&&f.splitJoin.length===0&&N.parts.length===S.length&&N.parts.every((M,ee)=>M.name===S[ee]?.name);q={revision:i,openStories:l,parts:S,index:I&&N?ao(N.index,S):so(S)};}return q.index},ft=()=>{let i=y().part.name,l=new Map;for(let p of [y().part,...H()])for(let[g,k]of chunkHZQFGB2X_cjs.ga(c(),p.name,i))l.set(g,k);return l},Po=()=>[y().part,...H()],H=()=>{let i=[],l=new Set;for(let g of O().parts)for(let k of [g.headers,g.footers])for(let S of k.values())l.has(S)||(l.add(S),i.push(S));let p=c();for(let g of ["footnote","endnote"]){let k=chunkCB6RQ3GD_cjs.$f(p,g);!k||l.has(k)||(l.add(k),i.push(k));}return i};return {ok:true,session:{editable:F(y().part).length>0,paragraphIds:()=>F(y().part).map(i=>i.id),paragraphIdsIn(i=P){let l=r.partFor(i);return l?F(l).map(p=>p.id):[]},part:()=>y().part,partFor:i=>r.partFor(i),currentPackage:c,collaborationPort:i=>chunkP5PWSRNW_cjs.b(r,{documentId:i}),applyTreeOps(i,l,p,g=P,k={}){return uo(r,i,l,p,g,k)},applyTreeOpsAtomic(i,l={}){return co(r,i,l)},projectDoc:()=>X(y().part),reconcile:i=>Ke(i,y().part,f),lastCommitWasStructural:()=>f!==null&&(f.created.length>0||f.deleted.length>0||f.splitJoin.length>0||f.impact==="global"),applyPmDoc(i){let l=y(),p=Ge(l.part,i);if(!p.ok)return {committed:false,rejected:true,opCount:0,reason:p.reason};if(p.ops.length===0)return {committed:false,rejected:false,opCount:0};let g=r.transact(P,k=>{for(let S of p.ops)k.apply(S);});return g.ok?{committed:true,rejected:false,opCount:p.ops.length}:{committed:false,rejected:true,opCount:p.ops.length,reason:g.reason}},storyParts:Po,bodyText:()=>An(y().part),storyText(i){let l=r.partFor(i);return l?F(l).map(p=>chunkCB6RQ3GD_cjs.Ui(l,p.id)??"").join(`
|
|
5
|
+
`):null},revision:()=>y().revision,revisionFor:i=>r.revisionFor(i),packageRevision:()=>r.packageRevision,canUndo:()=>r.canUndo,canRedo:()=>r.canRedo,undo:()=>{let i=r.selectionForUndo();return r.undo()===null?null:i},redo:()=>{let i=r.selectionForRedo();return r.redo()===null?null:i},beginComposition:(i=P)=>{r.beginComposition(i);},endComposition:()=>r.endComposition(),subscribe(i){return r.subscribe(i)},save(){return h(c())},headerFooterParts:()=>{let i=O().parts;return i[i.length-1]??chunkCB6RQ3GD_cjs.Wd(c())},headerFooterPartsBySection:()=>O().parts,headerFooterResolutionBySection:()=>O().resolution,documentFonts(){return re&&re.revision===r.packageRevision||(re={revision:r.packageRevision,fonts:zn(Ce(),oe(Q(),U()))}),re.fonts},symbolFontFamilies(){return ae&&ae.revision===r.packageRevision||(ae={revision:r.packageRevision,fonts:Un(Ce())}),ae.fonts},renderedFontFamilies(){let i=j();return Z&&Z.revision===r.packageRevision&&Z.styles===i||(Z={revision:r.packageRevision,styles:i,families:chunkRLKX7BIP_cjs.e(dt(),i,oe(Q(),U()))}),Z.families},rendersText(){return se&&se.revision===r.packageRevision||(se={revision:r.packageRevision,rendersText:Kn(Ce())}),se.rendersText},documentStyles(){let i=j(),l=Q(),p=U();G??=chunkRLKX7BIP_cjs.c(i,oe(l,p));let g=G;return ie??=Vn(i,k=>g(k)),ie},stylesRoot:()=>j(),documentThemeFonts(){let i=Q(),l=U();return me??=oe(i,l),me},numberingRoot:()=>Ee(),settingsRoot:()=>U(),documentProperties:()=>yo(),trackingSettings:()=>chunkCB6RQ3GD_cjs.Lg(U()),documentThemeColors(){let i=Q();return we??=oo(i),we},effectiveRunDefaults(i,l){let p=j(),g=Q(),k=U();G??=chunkRLKX7BIP_cjs.c(p,oe(g,k));let S=y();if(!ge||ge.revision!==S.revision){let N=new Map;for(let I of F(S.part))I.kind!=="textValue"&&N.set(I.id,tt(I)??null);ge={revision:S.revision,byId:N};}return G(ge.byId.get(i)??null,l)},documentOutline(){let i=y();return le&&le.revision===i.revision||(le={revision:i.revision,outline:Zn(i.part,j())}),le.outline},findText(i,l){let p=y(),g=r.packageRevision,k=`${l?.matchCase===true?"c":""}${l?.wholeWord===true?"w":""}${l?.limit??""}:${l?.stories??"all"}\0${i}`;if(de&&de.revision===g&&de.key===k)return de.result;let S=c(),N={footnote:new Set,endnote:new Set};for(let M of chunkCB6RQ3GD_cjs.ag(p.part))N[M.noteKind].add(M.noteId);let I=no(p.part,i,l??{},{headerFooterBySection:O().resolution,footnotes:chunkCB6RQ3GD_cjs.$f(S,"footnote")??null,endnotes:chunkCB6RQ3GD_cjs.$f(S,"endnote")??null,referencedNoteIds:N});return de={revision:g,key:k,result:I},I},embeddedFonts:ko,paragraphAnchors:pt,paraIdOf:i=>io(i,{body:y().part,openStories:r.openStoryParts(),otherStories:H(),normalize:ut}),nodeIdOf:i=>pt().nodeByParaId.get(i.toUpperCase())??null,relationshipTarget:(i,l=P)=>{let p=c(),g=r.partFor(l);return g?chunkCB6RQ3GD_cjs.Ff(p,g.name,i):null},bookmarks:()=>{let i=r.packageRevision;if(!ye||ye.revision!==i){let l=new Map(chunkCB6RQ3GD_cjs.df(y().part));for(let p of H())for(let[g,k]of chunkCB6RQ3GD_cjs.df(p))l.has(g)||l.set(g,k);ye={revision:i,index:l};}return ye.index},ensureHyperlinkRelationship(i,l=P){let p=r.partFor(l);return p?chunkCB6RQ3GD_cjs.Ca(r,()=>{let g=c(),k=chunkCB6RQ3GD_cjs.Ef(g,i,p.name);return k?(k.pkg!==g&&r.replacePackageShell(k.pkg),k.relationshipId):null},g=>g!==null):null},reviewItems(){let i=e.reviewModel;if(!i)return pr;let l=y(),p=`${r.packageRevision}:${l.revision}`;if(u&&u.revisionKey===p)return u.items;let g=c(),k=g.parts.get(chunkHZQFGB2X_cjs.Y(g,l.part.name)),S=g.parts.get(chunkHZQFGB2X_cjs.Z(g,l.part.name)),N=H(),I=u&&f?_n(f,u,u.items,l.part,k,S,r.packageRevision):null,M,ee;if(I&&u){let mt=i.revisionItemsOfParagraph(l.part,I);Fn(u.items,mt,I)?(M=Bn(u.items,u.paragraphOrder,I,mt),ee=u.paragraphOrder):(ee=chunkCB6RQ3GD_cjs.ji(l.part),M=i.collectReviewItems({storyPart:l.part,furnitureParts:N,stylesPart:chunkCB6RQ3GD_cjs.sf(g),commentsPart:k,commentsExtendedPart:S,customNodePayloads:ft()}));}else ee=chunkCB6RQ3GD_cjs.ji(l.part),M=i.collectReviewItems({storyPart:l.part,furnitureParts:N,stylesPart:chunkCB6RQ3GD_cjs.sf(g),commentsPart:k,commentsExtendedPart:S,customNodePayloads:ft()});return u={revisionKey:p,bodyRevision:l.revision,packageRevision:r.packageRevision,items:M,paragraphOrder:ee,commentsPart:k,commentsExtendedPart:S},u.items},hasReviewContent(){let i=r.packageRevision;if(!m||m.revision!==i){let l=chunkCB6RQ3GD_cjs.sf(c()),p=[y().part,...H(),...l?[l]:[]];m={revision:i,present:p.some(g=>chunkCB6RQ3GD_cjs.Yh(g).length>0||Xe(g.root))};}return m.present},replyToComment(i,l,p,g,k,S=P,N){let I=chunkHZQFGB2X_cjs._(r,{anchor:{paragraphId:l.paragraphId,start:l.start,end:l.end,...l.endParagraphId===void 0?{}:{endParagraphId:l.endParagraphId}},author:g,text:p,...k===void 0?{}:{date:k},...i===null?{}:{replyToCommentId:i},...N===void 0?{}:{actorId:N}},S);return I.ok?I.commentId:null},setCommentResolved(i,l){return chunkHZQFGB2X_cjs.$(r,i,l).ok},deleteComment(i,l=P,p){return this.deleteComments([{commentId:i}],l,p)},deleteComments(i,l=P,p){return chunkHZQFGB2X_cjs.aa(r,i,l,p)},insertCustomNode(i,l=P){return chunkHZQFGB2X_cjs.ia(r,i,l)},removeCustomNode(i,l=P){return chunkHZQFGB2X_cjs.ja(r,i,l)},sweepCustomNodePayloads(i){return chunkCB6RQ3GD_cjs.Ca(r,()=>{let l=y(),p=chunkHZQFGB2X_cjs.fa(r.currentPackage(),l.part.name,i);return p.ok?p.removed.length===0?{ok:true,removed:[]}:(r.replacePackageShell(p.pkg),{ok:true,removed:p.removed}):{ok:false,reason:p.reason}},l=>l.ok&&l.removed.length>0)},ensureListDefinition(i){return chunkCB6RQ3GD_cjs.Ca(r,()=>{let l=chunkCB6RQ3GD_cjs.xf(c(),i);return l?(r.replacePackageShell(l.pkg),J=null,B=null,l.numId):null},l=>l!==null)},ensureNumberingLevel(i,l,p){return chunkCB6RQ3GD_cjs.Ca(r,()=>{let g=c(),k=chunkCB6RQ3GD_cjs.yf(g,i,l,p);return k?k!==g?(r.replacePackageShell(k),J=null,B=null,{ok:true,changed:true}):{ok:true,changed:false}:{ok:false,changed:false}},g=>g.changed).ok},insertImage(i,l){return r.insertImage(i,l)},replaceImage(i,l,p,g,k,S){return r.replaceImage(i,l,p,g,k,S)},deleteImage(i,l){return r.deleteImage(i,l)},deleteImageTracked(i,l,p){return r.deleteImageTracked(i,l,p)},applyImageProperties(i,l){return r.applyImageProperties(i,l)},applyFragmentPaste(i,l){return r.applyFragmentPaste(i,l)}}}}var mr=chunkCB6RQ3GD_cjs.b.projection;function vr(t,e,n){let o=t.filter(s=>s.localName!==e);return o.length!==t.length?o:[...o,n?{localName:e,attributes:n}:{localName:e}]}function Tr(t,e,n={}){let o=null,s=false,a=()=>n.onChange?.(r()),r=()=>({revision:e.revision(),canUndo:e.canUndo(),canRedo:e.canRedo(),lastRejection:o}),d=c=>{s=true;let h=m.state.tr.replaceWith(0,m.state.doc.content.size,c.content);h.setMeta("addToHistory",false),m.dispatch(h),s=false;},u=c=>()=>(c()&&(d(e.projectDoc()),a()),true),m=new prosemirrorView.EditorView(t,{state:prosemirrorState.EditorState.create({doc:e.projectDoc(),plugins:[prosemirrorKeymap.keymap({...prosemirrorCommands.baseKeymap,Home:prosemirrorCommands.selectTextblockStart,End:prosemirrorCommands.selectTextblockEnd,"Mod-z":u(()=>e.undo()!==null),"Mod-y":u(()=>e.redo()!==null),"Shift-Mod-z":u(()=>e.redo()!==null),"Mod-b":(c,h)=>y(c,h,"b"),"Mod-i":(c,h)=>y(c,h,"i"),"Mod-u":(c,h)=>y(c,h,"u",{val:"single"})})]}),editable:()=>e.editable,handleDOMEvents:{keydown:c=>(f(c),false),beforeinput:(c,h)=>{let P=h;if(c.composing)return false;f(c);let b=P.inputType;if(b==="insertText"&&P.data!=null){P.preventDefault();let{from:R,to:O}=c.state.selection;return c.dispatch(c.state.tr.insertText(P.data,R,O)),true}if(b==="deleteContentBackward"){P.preventDefault();let{from:R,empty:O}=c.state.selection;return O?R>0?c.dispatch(c.state.tr.delete(R-1,R)):prosemirrorCommands.joinBackward(c.state,c.dispatch):prosemirrorCommands.deleteSelection(c.state,c.dispatch),true}if(b==="deleteContentForward"){P.preventDefault();let{from:R,to:O,empty:v}=c.state.selection;return v?O<c.state.doc.content.size?c.dispatch(c.state.tr.delete(R,R+1)):prosemirrorCommands.joinForward(c.state,c.dispatch):prosemirrorCommands.deleteSelection(c.state,c.dispatch),true}return b==="insertParagraph"?(P.preventDefault(),prosemirrorCommands.splitBlock(c.state,c.dispatch),true):false},compositionstart:()=>(e.beginComposition(),false),compositionend:()=>(e.endComposition(),a(),false)},dispatchTransaction(c){let h=m.state.apply(c);if(s||!c.docChanged){m.updateState(h);return}let P=e.applyPmDoc(h.doc);if(P.rejected){o=String(P.reason??"rejected"),m.updateState(h),d(e.projectDoc()),a();return}o=null,m.updateState(P.committed&&e.lastCommitWasStructural()?x(h):h),a();}});function f(c){if(c.composing||s)return;let h=c.dom.ownerDocument.getSelection(),P=h?.anchorNode,b=h?.focusNode;if(!(!h||!P||!b)&&!(!c.dom.contains(P)||!c.dom.contains(b)))try{let R=c.posAtDOM(P,h.anchorOffset),O=c.posAtDOM(b,h.focusOffset),v=c.state.selection;if(v.anchor===R&&v.head===O)return;let T=prosemirrorState.TextSelection.create(c.state.doc,R,O);c.dispatch(c.state.tr.setSelection(T).setMeta("addToHistory",!1));}catch{}}function x(c){let h=e.paragraphIds(),P=c.tr,b=false,R=0;return c.doc.forEach((O,v)=>{let T=h[R];R+=1,!(O.type.name!=="paragraph"||T===void 0)&&O.attrs.nodeId!==T&&(P=P.setNodeMarkup(v,void 0,{...O.attrs,nodeId:T}),b=true);}),b?c.apply(P.setMeta("addToHistory",false)):c}function y(c,h,P,b){let R=E.marks.runProps;if(!h)return true;let{from:O,to:v,empty:T}=c.selection;if(T)return true;let j=c.doc.resolve(O).marks().find(Ee=>Ee.type===R)?.attrs.props??[],J=vr(j,P,b),B=c.tr;return B.removeMark(O,v,R),J.length>0&&B.addMark(O,v,R.create({props:J})),h(B),true}return {view:m,state:r,undo:()=>u(()=>e.undo()!==null)(),redo:()=>u(()=>e.redo()!==null)(),toggleRunProperty(c,h){y(m.state,m.dispatch.bind(m),c,h);},destroy:()=>m.destroy()}}exports.a=E;exports.b=Je;exports.c=ne;exports.d=F;exports.e=X;exports.f=Ge;exports.g=Bo;exports.h=Ke;exports.i=tt;exports.j=fr;exports.k=mr;exports.l=Tr;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {c,e,b as b$2}from'./chunk-IWAUA732.js';import {d}from'./chunk-PD5XKBJA.js';import {a as a$2}from'./chunk-VP7SDFCM.js';import {P,_a,fa,ja,ia,aa,$,_ as _$1,Y as Y$1,Z,ga,Ya,a,Ea,Ha as Ha$1,Ta,b as b$3}from'./chunk-GG4IAKFI.js';import {b as b$1,a as a$1}from'./chunk-5RKCJ5DF.js';import {zg,b,Dd,Ha,jc,Qb,Ca,yf,xf,sf,Yh,ji,Ef,df,Ff,ag,$f,Lg,Wd,Ui,Ud,Td,E as E$1,Og,Pg,Yd,Hd,Zd,ce,Gd,gb,da,Jf,qg,Sb,kc,Ia,la,na,ka,ma,gg,Jd,Ld,Kb,Jb,Qg,Ze as Ze$1,ke,Qd,Fd,Rd,zd,nd,pd,dd,$d,nb,Ya as Ya$1}from'./chunk-UOQONZVQ.js';import {Schema}from'prosemirror-model';import {EditorState,TextSelection}from'prosemirror-state';import {EditorView}from'prosemirror-view';import {keymap}from'prosemirror-keymap';import {joinBackward,deleteSelection,joinForward,splitBlock,selectTextblockEnd,selectTextblockStart,baseKeymap}from'prosemirror-commands';function Y(t){return t.attributes?.val}function W(t){let e=Y(t);return e===void 0||!(e==="0"||e==="false"||e==="off")}var Oo=/^[0-9A-Fa-f]{6}$/,ve=/^\d{1,6}$/,So=/^-?\d{1,6}$/;function Ye(t){return t===void 0||t==="auto"?null:Oo.test(t)?`#${t}`:null}var bo={single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"},Ro={black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"};function vo(t){return !t||!/^[\w \-.+]{1,64}$/.test(t)?null:`"${t}"`}function K(t,e=false){return t===void 0||!(e?So:ve).test(t)?null:`${Number(t)/20}pt`}function Rn(t){let e=[],n=[],o=null,s=null;for(let a of t)switch(a.localName){case "b":e.push(`font-weight:${W(a)?"bold":"normal"}`);break;case "i":e.push(`font-style:${W(a)?"italic":"normal"}`);break;case "u":{let r=Y(a)??"single";if(r==="none"||!W(a))break;n.push("underline"),o=bo[r]??"solid",s=Ye(a.attributes?.color);break}case "strike":W(a)&&n.push("line-through");break;case "dstrike":W(a)&&n.push("line-through");break;case "caps":W(a)&&e.push("text-transform:uppercase");break;case "smallCaps":W(a)&&e.push("font-variant:small-caps");break;case "vertAlign":{let r=Y(a);r==="superscript"?e.push("vertical-align:super","font-size:0.75em"):r==="subscript"&&e.push("vertical-align:sub","font-size:0.75em");break}case "color":{let r=Ye(Y(a));r&&e.push(`color:${r}`);break}case "highlight":{let r=Ro[Y(a)??""];r&&e.push(`background-color:${r}`);break}case "sz":{let r=Y(a);r!==void 0&&ve.test(r)&&e.push(`font-size:${Number(r)/2}pt`);break}case "rFonts":{let r=vo(a.attributes?.ascii??a.attributes?.hAnsi);r&&e.push(`font-family:${r}`);break}case "spacing":{let r=K(Y(a),true);r&&e.push(`letter-spacing:${r}`);break}}return n.length>0&&(e.push(`text-decoration-line:${[...new Set(n)].join(" ")}`),o&&e.push(`text-decoration-style:${o}`),s&&e.push(`text-decoration-color:${s}`)),e.join(";")}var To={left:"left",start:"left",right:"right",end:"right",center:"center",both:"justify",distribute:"justify"};function vn(t){let e=[];for(let n of t)switch(n.localName){case "jc":{let o=To[Y(n)??""];o&&e.push(`text-align:${o}`);break}case "ind":{let o=K(n.attributes?.left??n.attributes?.start,true),s=K(n.attributes?.right??n.attributes?.end,true),a=K(n.attributes?.firstLine),r=K(n.attributes?.hanging);o&&e.push(`margin-left:${o}`),s&&e.push(`margin-right:${s}`),a?e.push(`text-indent:${a}`):r&&e.push(`text-indent:-${r}`);break}case "spacing":{let o=K(n.attributes?.before),s=K(n.attributes?.after);o&&e.push(`margin-top:${o}`),s&&e.push(`margin-bottom:${s}`);let a=n.attributes?.line,r=n.attributes?.lineRule;a!==void 0&&ve.test(a)&&r!=="exact"&&r!=="atLeast"?e.push(`line-height:${(Number(a)/240).toFixed(3)}`):a!==void 0&&ve.test(a)&&e.push(`line-height:${Number(a)/20}pt`);break}case "shd":{let o=Ye(n.attributes?.fill);o&&e.push(`background-color:${o}`);break}case "pageBreakBefore":W(n)&&e.push("break-before:page");break;}return e.join(";")}var E=new Schema({nodes:{doc:{content:"paragraph+"},paragraph:{content:"inline*",group:"block",attrs:{nodeId:{default:null},props:{default:[]}},toDOM:t=>{let e=vn(t.attrs.props??[]);return ["p",{"data-node-id":String(t.attrs.nodeId??""),...e?{style:e}:{}},0]},parseDOM:[{tag:"p",getAttrs:t=>typeof t=="string"?null:{nodeId:t.getAttribute("data-node-id")||null,props:[]}}]},text:{group:"inline"},tab:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"tab",class:"docx-tab"},"\u2192"],parseDOM:[{tag:'span[data-token="tab"]'}]},hardBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["br"],parseDOM:[{tag:"br"}]},pageBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"page-break",class:"docx-page-break"}],parseDOM:[{tag:'span[data-token="page-break"]'}]},unknownInline:{inline:true,group:"inline",atom:true,selectable:false,draggable:false,attrs:{nodeId:{default:null},label:{default:""}},toDOM:t=>["span",{"data-token":"unknown","data-node-id":String(t.attrs.nodeId??""),contenteditable:"false",class:"docx-unknown-inline",title:String(t.attrs.label||"Content this editor cannot edit yet. It is preserved.")}],parseDOM:[{tag:'span[data-token="unknown"]',getAttrs:t=>typeof t=="string"?false:{nodeId:t.getAttribute("data-node-id")||null,label:""}}]}},marks:{runProps:{attrs:{props:{default:[]}},excludes:"runProps",toDOM:t=>{let e=t.attrs.props??[],n=Rn(e);return ["span",{"data-run-props":Io(e),...n?{style:n}:{}},0]},parseDOM:[{tag:"span[data-run-props]",getAttrs:t=>{if(typeof t=="string")return false;let e=Eo(t.getAttribute("data-run-props"));return e?{props:e}:false}}]}}});function Io(t){return JSON.stringify(Array.isArray(t)?t:[])}function Eo(t){if(!t)return null;try{let e=JSON.parse(t);if(!Array.isArray(e))return null;let n=[];for(let o of e){if(typeof o!="object"||o===null)return null;let s=o;if(typeof s.localName!="string"||s.attributes!==void 0&&(typeof s.attributes!="object"||s.attributes===null))return null;n.push(s.attributes===void 0?{localName:s.localName}:{localName:s.localName,attributes:s.attributes});}return n}catch{return null}}function Je(t){for(let e of t.marks)if(e.type.name==="runProps")return e.attrs.props??[];return []}function Te(t,e){return JSON.stringify(Ne(t))===JSON.stringify(Ne(e))}function Ne(t){return [...t].map(e=>({localName:e.localName,attributes:Object.fromEntries(Object.entries(e.attributes??{}).sort(([n],[o])=>n<o?-1:1))})).sort((e,n)=>e.localName<n.localName?-1:1)}function Ue(t){if(!t||t.kind==="textValue")return [];let e=[];for(let n of t.children){if(n.kind==="textValue"||n.localName==="rPrChange"||n.localName==="pPrChange")continue;let o={};for(let s of n.attributes)o[s.localName]=s.value;e.push(Object.keys(o).length>0?{localName:n.localName,attributes:o}:{localName:n.localName});}return e}function Tn(t){return t.kind==="textValue"?"":`${{drawing:"Picture",pict:"Picture",object:"Embedded object",fldSimple:"Field",hyperlink:"Hyperlink",sdt:"Content control",tbl:"Table"}[t.localName]??t.localName} \u2014 preserved, not editable yet`}function A(t){if(t.kind==="textValue")return [];let e=[],n=a=>{if(a.kind!=="run")return;let r=a.children.find(u=>u.kind==="runProperties"),d=Ue(r);for(let u of a.children)if(u.kind!=="runProperties"){if(u.kind==="tab"){e.push({kind:"tab"});continue}if(u.kind==="hardBreak"){e.push($d(u)?{kind:"pageBreak"}:{kind:"hardBreak"});continue}if(u.kind==="text"){let m="";for(let f of u.children)f.kind==="textValue"&&(m+=f.value);m.length>0&&e.push({kind:"text",text:m,props:d});continue}e.push({kind:"unknown",nodeId:u.id,label:Tn(u),modelLength:u.kind==="drawing"||nb(u)||Ya$1(u)?1:0});}},o=a=>{if(a.kind==="run"){n(a);return}e.push({kind:"unknown",nodeId:a.id,label:Tn(a),modelLength:0});},s=(a,r)=>{for(let d of a)if(!(d.kind==="textValue"||d.kind==="paragraphProperties")&&!(r>=la)){if(na(d)&&!ka(d.kind)&&r<la){s(d.children.filter(u=>!gg(d,u)),ma(d,r));continue}if(Jd(d)){let u=Ld(d);u&&s(u,ma(d,r));continue}o(d);}};return s(t.children,0),e}function ne(t){let e=[],n=o=>{if(o.kind!=="textValue"){if(o.kind==="body"){for(let s of o.children)s.kind==="paragraph"&&e.push(s);return}for(let s of o.children)n(s);}};return n(t.root),e}var Nn=zg(16),In=new WeakMap;function Mo(t,e){let n=In.get(t);if(!n){let o=[];Hd([t],o,0),n=Object.freeze(o),In.set(t,n);}for(let o of n)e.push(o);}function F(t){let e=Nn.get(t);if(e)return e;let n=[];for(let o of Dd(t))if(o.root.kind!=="textValue")for(let s of o.root.children)Mo(s,n);return Nn.set(t,n),n}function X(t){let e=ne(t).map(n=>{let o=n.kind==="textValue"?void 0:n.children.find(a=>a.kind==="paragraphProperties"),s=A(n).map(a=>{switch(a.kind){case "text":return E.text(a.text,a.props.length>0?[E.marks.runProps.create({props:a.props})]:[]);case "tab":return E.node("tab");case "hardBreak":return E.node("hardBreak");case "pageBreak":return E.node("pageBreak");default:return E.node("unknownInline",{nodeId:a.nodeId,label:a.label})}});return E.node("paragraph",{nodeId:n.id,props:Ue(o)},s)});return E.node("doc",null,e.length>0?e:[E.node("paragraph")])}function wo(t,e){let n=[];return t.forEach(o=>{if(o.isText&&o.text){n.push({kind:"text",text:o.text,props:Je(o)});return}o.type.name==="tab"?n.push({kind:"tab"}):o.type.name==="hardBreak"?n.push({kind:"hardBreak"}):o.type.name==="pageBreak"?n.push({kind:"pageBreak"}):o.type.name==="unknownInline"&&n.push({kind:"unknown",nodeId:String(o.attrs.nodeId??""),label:String(o.attrs.label??""),modelLength:e.has(String(o.attrs.nodeId??""))?1:0});}),n}function w(t){let e="";for(let n of t)n.kind==="text"?e+=n.text:n.kind==="tab"?e+=" ":n.kind==="hardBreak"?e+=`
|
|
2
|
+
`:n.kind==="pageBreak"?e+=Zd:n.modelLength===1&&(e+=ce);return e}function L(t){let e=[],n=0;for(let o of t)o.kind==="text"?n+=o.text.length:o.kind==="tab"||o.kind==="hardBreak"||o.kind==="pageBreak"?n+=1:(e.push(`${o.nodeId}@${n}`),n+=o.modelLength);return e}function Co(t,e){if(t===e)return null;let n=0,o=Math.min(t.length,e.length);for(;n<o&&t[n]===e[n];)n+=1;let s=t.length,a=e.length;for(;s>n&&a>n&&t[s-1]===e[a-1];)s-=1,a-=1;return {start:n,endBefore:s,endAfter:a}}function En(t){let e=[];for(let n of t)if(n.kind==="text")for(let o=0;o<n.text.length;o+=1)e.push(n.props);else n.kind==="tab"||n.kind==="hardBreak"||n.kind==="pageBreak"?e.push(e[e.length-1]??[]):n.kind==="unknown"&&n.modelLength===1&&e.push([]);return e}function Do(t,e,n,o,s){let a=[],r=w(e),d=w(n),u=Co(r,d),m=[],f=0,x=false;for(let y of e){if(y.kind!=="unknown"){f+=y.kind==="text"?y.text.length:1;continue}let c=f;y.modelLength===1&&u&&(u.start<f+1&&u.endBefore>f&&(x=true),u.endBefore<=f&&(c+=u.endAfter-u.endBefore)),m.push(`${y.nodeId}@${c}`),f+=y.modelLength;}if(x||JSON.stringify(m)!==JSON.stringify(L(n)))return {ok:false,reason:"unknown-content-moved",detail:t};if(Te(o,s)||a.push({op:"setParagraphProperties",paragraphId:t,properties:Ne(s)}),u&&(u.endBefore>u.start&&a.push({op:"deleteText",paragraphId:t,start:u.start,end:u.endBefore}),u.endAfter>u.start)){let y=d.slice(u.start,u.endAfter),c=u.start,h="",P=()=>{h.length!==0&&(a.push({op:"insertText",paragraphId:t,offset:c,text:h}),c+=h.length,h="");};for(let b of y)b===" "?(P(),a.push({op:"insertTab",paragraphId:t,offset:c}),c+=1):b===`
|
|
3
|
+
`?(P(),a.push({op:"insertHardBreak",paragraphId:t,offset:c}),c+=1):b===Zd?(P(),a.push({op:"insertPageBreak",paragraphId:t,offset:c}),c+=1):h+=b;P();}if(!u){let y=En(e),c=En(n),h=0;for(;h<c.length;){if(Te(y[h]??[],c[h])){h+=1;continue}let P=h,b=c[h];for(;h<c.length&&Te(c[h],b)&&!Te(y[h]??[],c[h]);)h+=1;a.push({op:"setRunProperties",paragraphId:t,start:P,end:h,properties:Ne(b)});}}return {ok:true,ops:a}}function Ge(t,e){let n=ne(t),o=new Set;for(let d of n)for(let u of A(d))u.kind==="unknown"&&u.modelLength===1&&o.add(u.nodeId);let s=d=>wo(d,o),a=[];if(e.forEach(d=>{d.type.name==="paragraph"&&a.push(d);}),a.length!==e.childCount)return {ok:false,reason:"unsupported-node"};let r=a.length-n.length;if(r===0){let d=[];for(let[u,m]of a.entries()){let f=n[u];if(m.attrs.nodeId!==f.id)return {ok:false,reason:"paragraph-reordered",detail:String(m.attrs.nodeId)};let x=Do(f.id,A(f),s(m),Ue(f.kind==="textValue"?void 0:f.children.find(y=>y.kind==="paragraphProperties")),m.attrs.props??[]);if(!x.ok)return x;d.push(...x.ops);}return {ok:true,ops:d}}return r===1?Ao(n,a,s):r===-1?Fo(n,a,s):{ok:false,reason:"paragraph-count-unexplained",detail:String(r)}}function Ao(t,e,n){for(let o=0;o<t.length;o+=1){let s=t[o],a=e[o],r=e[o+1];if(!a||!r||a.attrs.nodeId!==s.id)continue;let d=r.attrs.nodeId;if(d!==null&&d!==s.id)continue;let u=n(a),m=n(r),f=A(s),x=w(u);if(x+w(m)===w(f)&&JSON.stringify(L([...u,...m]))===JSON.stringify(L(f))&&Mn(t,e,o,n)&&wn(t,e,o+1,o+2,n))return {ok:true,ops:[{op:"splitParagraph",paragraphId:s.id,offset:x.length}]}}return {ok:false,reason:"split-not-clean"}}function Fo(t,e,n){for(let o=0;o+1<t.length;o+=1){let s=t[o],a=t[o+1],r=e[o];if(!r||r.attrs.nodeId!==s.id)continue;let d=[...A(s),...A(a)],u=n(r);if(w(u)===w(d)&&JSON.stringify(L(u))===JSON.stringify(L(d))&&Mn(t,e,o,n)&&wn(t,e,o+2,o+1,n))return {ok:true,ops:[{op:"joinParagraphs",firstId:s.id,secondId:a.id}]}}return {ok:false,reason:"join-not-clean"}}function Mn(t,e,n,o){for(let s=0;s<n;s+=1){let a=e[s],r=t[s];if(!a||a.attrs.nodeId!==r.id||w(o(a))!==w(A(r))||JSON.stringify(L(o(a)))!==JSON.stringify(L(A(r))))return false}return true}function wn(t,e,n,o,s){for(let a=0;n+a<t.length;a+=1){let r=t[n+a],d=e[o+a];if(!d||d.attrs.nodeId!==r.id||w(s(d))!==w(A(r))||JSON.stringify(L(s(d)))!==JSON.stringify(L(A(r))))return false}return true}function Bo(t,e){return Ha(t,e)!==null}function Ke(t,e,n){if(!n||n.created.length>0||n.deleted.length>0||n.splitJoin.length>0)return X(e);let o=new Map;t.forEach(u=>{let m=u.attrs.nodeId;typeof m=="string"&&o.set(m,u);});let s=new Set(n.dirty),a=ne(e);if(a.length!==t.childCount)return X(e);let r=X(e),d=[];for(let[u,m]of a.entries()){let f=o.get(m.id);d.push(f&&!s.has(m.id)?f:r.child(u));}return E.node("doc",null,d)}var Lo=8*1024*1024;function Cn(){let t=new WeakMap;return e=>{let n=t.get(e);if(n)return n.slice();let o=kc(e);return t=new WeakMap,o.byteLength<=Lo&&t.set(e,o.slice()),o}}function An(t){return F(t).map(e=>Ui(t,e.id)??"").join(`
|
|
4
|
+
`)}var _o=64,Dn=new WeakMap;function Xe(t,e=0){if(e>_o)return false;let n=Dn.get(t);if(n!==void 0)return n;let o=false;for(let s of t.children)if(s.kind!=="textValue"&&(s.kind==="commentRangeStart"||s.kind==="commentReference"||Xe(s,e+1))){o=true;break}return Dn.set(t,o),o}function jo(t,e){let n=t.kind==="revision"?t.ranges[0]??null:t.range;if(!n)return null;let o=e.get(n.start.paragraphId);return o===void 0?null:o}function Fn(t,e,n){for(let s of e)if(s.ranges.length===0)return false;let o=new Set;for(let s of t)s.kind!=="revision"||s.ranges.length>0||Ln(s,n)||o.add(Ea(s));for(let s of e)if(o.has(Ea(s)))return false;return true}function Bn(t,e,n,o){let s=e.get(n);if(s===void 0)return [...t];let a=[],r=null;for(let d of t){if(d.kind==="revision"&&Ln(d,n)){r===null&&(r=a.length);continue}if(r===null){let u=jo(d,e);u!==null&&u>s&&(r=a.length);}a.push(d);}if(r===null&&(r=a.length),o.length>0){let d=o.length<2?[...o]:[...o].sort((u,m)=>Ha$1(u,e)-Ha$1(m,e));a.splice(r,0,...d);}return Ta(a)}function Ln(t,e){return t.ranges.length>0&&t.ranges.every(n=>n.start.paragraphId===e&&n.end.paragraphId===e)}function Ho(t,e){return t.range?t.range.start.paragraphId===e||t.range.end.paragraphId===e:false}function $o(t,e){return t.revisionKind==="structural"&&t.ranges.some(n=>n.start.paragraphId===e||n.end.paragraphId===e)}function zo(t,e){return t.ranges.length===0||!t.ranges.some(o=>o.start.paragraphId===e||o.end.paragraphId===e)?false:!t.ranges.every(o=>o.start.paragraphId===e&&o.end.paragraphId===e)}function _n(t,e,n,o,s,a,r){if(t.fromRevision!==e.bodyRevision||r!==e.packageRevision+1||t.story!==void 0&&t.story.kind!=="body"||t.impact!=="text-local"||t.dirty.length!==1||t.created.length>0||t.deleted.length>0||t.splitJoin.length>0||e.commentsPart!==s||e.commentsExtendedPart!==a)return null;let d=t.dirty[0],u=Ha(o,d);if(!u||u.kind!=="paragraph")return null;let m=Ia(o,d);if(m){let f=m.children.findIndex(y=>y.id===d),x=m.children[f-1];if(x?.kind==="paragraph"&&Yh({...o,root:x}).some(y=>y.paragraphMark))return null}for(let f of n){if(f.kind==="comment"){if(Ho(f,d))return null;continue}if(f.kind==="custom"){if(f.range?.start.paragraphId===d)return null;continue}if($o(f,d)||zo(f,d))return null}return d}var $n=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Wo=["ascii","hAnsi","cs","eastAsia"],Yo=["asciiTheme","hAnsiTheme","cstheme","eastAsiaTheme"],Jo=128,Uo=/[\u0000-\u001F\u007F-\u009F]/;function C(t){return t.kind!=="textValue"}function V(t,e){return t.attributes.find(n=>n.localName===e)?.value}function zn(t,e){let n=new Map;for(let s of t)for(let a of s.children)if(C(a))for(let[r,d]of Jn(a,e))n.has(r)||n.set(r,d);let o=[...n.values()];return o.sort((s,a)=>s<a?-1:s>a?1:0),o}var Ve=new WeakMap,Wn=16,Yn=32;function Jn(t,e,n=0){let o=e?.major??null,s=e?.minor??null,a=e?.majorEastAsia??null,r=e?.minorEastAsia??null,d=e?.majorBidi??null,u=e?.minorBidi??null,m=Ve.get(t);if(m&&m.major===o&&m.minor===s&&m.majorEastAsia===a&&m.minorEastAsia===r&&m.majorBidi===d&&m.minorBidi===u)return m.byFold;if(t.children.length>=Wn&&n<Yn&&t.localName!=="rFonts"){let c=new Map;for(let h of t.children)if(C(h))for(let[P,b]of Jn(h,e,n+1))c.has(P)||c.set(P,b);return Ve.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:d,minorBidi:u,byFold:c}),c}let f=new Map,x=c=>{if(!c||!$n.test(c))return;let h=c.toLowerCase();f.has(h)||f.set(h,c);},y=[t];for(;y.length>0;){let c=y.pop();if(C(c)){if(c.localName==="rFonts"){for(let h of Wo)x(V(c,h));if(e)for(let h of Yo)x(b$3(V(c,h),e));}for(let h=c.children.length-1;h>=0;h-=1)y.push(c.children[h]);}}return Ve.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:d,minorBidi:u,byFold:f}),f}function Un(t){let e=new Map;for(let o of t)for(let s of o.children)if(C(s))for(let[a,r]of Gn(s))e.has(a)||e.set(a,r);let n=[...e.values()];return n.sort((o,s)=>o<s?-1:o>s?1:0),n}var jn=new WeakMap,Go=new Map;function Gn(t,e=0){let n=jn.get(t);if(n)return n;let o=r=>{let d=r.size===0?Go:r;return jn.set(t,d),d},s=new Map;if(t.children.length>=Wn&&e<Yn&&t.localName!=="sym"){for(let r of t.children)if(C(r))for(let[d,u]of Gn(r,e+1))s.has(d)||s.set(d,u);return o(s)}let a=[t];for(;a.length>0;){let r=a.pop();if(C(r)){if(r.localName==="sym"&&r.namespaceUri===da){let d=r.attributes.find(m=>m.localName==="font"&&(m.namespaceUri===da||m.namespaceUri===""))?.value,u=b$2(d);u!==null&&!s.has(u.toLowerCase())&&s.set(u.toLowerCase(),u);}for(let d=r.children.length-1;d>=0;d-=1)a.push(r.children[d]);}}return o(s)}function Kn(t){let e=[...t];for(;e.length>0;){let n=e.pop();if(C(n)){if(n.localName==="t"&&n.namespaceUri===da){for(let o of n.children)if(!C(o)&&o.value.length>0)return true;continue}for(let o of n.children)e.push(o);}}return false}var Ko=new Set(["paragraph","character","table","numbering"]),Xo=/^[0-9A-Fa-f]{6}$/,Vo=16,Hn=new Map([["normal",0],["title",1],["subtitle",2],["heading 1",11],["heading 2",12],["heading 3",13],["heading 4",14],["heading 5",15],["heading 6",16],["heading 7",17],["heading 8",18],["heading 9",19]]);function Xn(t){return t.children}function Qe(t,e){for(let n of Xn(t))if(C(n)&&n.localName===e)return n}function Qo(t){return Hn.get(t.name.toLowerCase())??Hn.get(t.styleId.toLowerCase())??Number.MAX_SAFE_INTEGER}function Ze(t){return t===void 0||t.length===0||t.length>Jo||Uo.test(t)?null:t}function Vn(t,e){if(!t)return [];let n=new Map;for(let a of t.children){if(!C(a)||a.localName!=="style")continue;let r=Ze(V(a,"styleId"));r!==null&&!n.has(r)&&n.set(r,a);}let o=a=>{let r=false,d=false,u=null,m=false,f=false,x=new Set,y=a;for(let P=0;P<Vo&&y!==null&&!x.has(y);P+=1){x.add(y);let b=n.get(y);if(!b)break;let R=Qe(b,"rPr");for(let v of R?Xn(R):[]){if(!C(v))continue;let T=V(v,"val"),D=T!=="0"&&T!=="false"&&T!=="off";v.localName==="b"&&!m?(r=D,m=true):v.localName==="i"&&!f?(d=D,f=true):v.localName==="color"&&u===null&&T&&Xo.test(T)&&(u=T);}let O=Qe(b,"basedOn");y=O?Ze(V(O,"val")):null;}let c=e?.(a),h=c?.fontFamily??null;return {fontFamily:h!==null&&$n.test(h)?h:null,fontSizePt:c?.fontSizeHalfPoints!=null&&c.fontSizeHalfPoints>0?c.fontSizeHalfPoints/2:null,bold:r,italic:d,color:u}},s=[];for(let[a,r]of n){let d=V(r,"type");if(d===void 0||!Ko.has(d))continue;let u=Qe(r,"name"),m=Ze(u?V(u,"val"):void 0);s.push({styleId:a,name:m??a,type:d,preview:o(a)});}return s.map((a,r)=>({entry:a,index:r,rank:Qo(a)})).sort((a,r)=>a.rank-r.rank||a.index-r.index).map(a=>a.entry)}var Zo=128,qo=/[\u0000-\u001F\u007F-\u009F]/,er=/[\u0000-\u001F\u007F-\u009F]/g,tr=200;function et(t){return t.kind!=="textValue"}function Qn(t,e){for(let n of t.children)if(et(n)&&n.localName===e)return n}function qe(t,e){return t.attributes.find(n=>n.localName===e)?.value}function nr(t){let e=new Map;if(!t)return e;for(let n of t.children){if(!et(n)||n.localName!=="style"||qe(n,"type")!=="paragraph")continue;let o=qe(n,"styleId");if(o===void 0||o.length===0||o.length>Zo||qo.test(o))continue;let s=a$2(n);s!==null&&e.set(o,s);}return e}function tt(t){let e=Qn(t,"pPr"),n=e?Qn(e,"pStyle"):void 0;return n?qe(n,"val"):void 0}function Zn(t,e){let n=nr(e);if(n.size===0)return [];let o=[];for(let s of ne(t)){if(!et(s))continue;let a=tt(s);if(a===void 0)continue;let r=n.get(a);if(r===void 0)continue;let u=(Ui(t,s.id)??"").replace(er," ").trim().slice(0,tr);u.length!==0&&o.push({text:u,level:r,blockId:s.id});}return o}function or(t,e,n){let o=new Map,s=n(t);for(let a of s){let r=o.get(a.hostParagraphId);r?r.push(a):o.set(a.hostParagraphId,[a]);}return o}function rr(t,e,n){let o=[];for(let s of Gd(t.root)){let a=e.get(s.id);if(a)for(let r of a)o.push(r);}return o}function qn(t,e,n=Qg){let o=[],s=new Map;for(let a of t){if(o.push(a),a.scope?.kind==="note")continue;let r=s.get(a.part);r||(r=or(a.part,e,n),s.set(a.part,r));for(let d of rr(a,r)){let u=a.scope;o.push({part:a.part,root:d.root,scope:{kind:"frame",id:d.root.id,drawingNodeId:d.drawingNodeId,hostParagraphId:d.hostParagraphId,...u?.kind==="headerFooter"?{owner:u}:{}}});}}return o}var Ie=48,ar=/[\u0000-\u001F\u007F-\u009F]/g;function sr(t){let e=[],n=Ze$1(t),o=new Map;for(let s of n.segments)ke(s.node)&&o.set(s.node.id,s.formatRunIds??[]);return Qd(t.children,0,s=>{if(s.kind==="run"){e.push({id:s.id,start:n.spanOf(s)?.start??0});return}if(ke(s))for(let a of o.get(s.id)??[]){let r=n.spanOf(a);r&&e.push({id:a,start:r.start});}},{descendRevisions:true}),e}function ir(t){let e=Fd(t);return e?[{part:t,root:e}]:[]}function lr(t,e){let n=[];for(let o of ["header","footer"])for(let s of t){let a=o==="header"?s.headers:s.footers;for(let[r,d]of a){if(!Rd(s,r)||e.has(d.part))continue;e.add(d.part);let u=Dd(d.part).find(m=>m.kind===o);u&&n.push({part:d.part,root:u.root,scope:{kind:"headerFooter",rId:d.rId}});}}return n}function eo(t,e,n){if(!t)return [];let o=[];for(let s of zd(t.root)){let a=nd(s);!pd(s)||a===null||!n.has(a)||o.push({part:t,root:s,scope:{kind:"note",id:dd(e,a)}});}return o}function dr(t,e){let n=ir(t);if(e){let o=new Set;for(let s of lr(e.headerFooterBySection,o))n.push(s);for(let s of eo(e.footnotes,"footnote",e.referencedNoteIds.footnote))n.push(s);for(let s of eo(e.endnotes,"endnote",e.referencedNoteIds.endnote))n.push(s);}return qn(n)}function to(t,e){if(t.length===0)return {index:0,offset:e};for(let n=t.length-1;n>=0;n-=1){let o=t[n].start;if(e>=o)return {index:n,offset:e-o}}return {index:0,offset:e}}function cr(t,e,n){let o=t.findIndex(s=>s.id===e);return o<0?null:{index:o,offset:n}}function nt(t,e){return t.replace(ar," ").slice(0,e)}function no(t,e,n={},o){let s={matches:[],truncated:false};if(!Ya(e))return s;let a=n.limit!==void 0&&Number.isInteger(n.limit)&&n.limit>0?Math.min(n.limit,2e3):2e3,r={...n.matchCase===void 0?{}:{matchCase:n.matchCase},...n.wholeWord===void 0?{}:{wholeWord:n.wholeWord}},d$1=[],u=n.stories==="body"?void 0:o;for(let m of dr(t,u)){let f=0;for(let x of Gd(m.root)){if(x.kind!=="paragraph")continue;let y=f;f+=1;let c=Ui(m.part,x.id)??"",h=d(x,c);if(h.text.length===0)continue;let P=a-d$1.length,b=h.findOccurrences(e,Math.max(P,1),r);if(P===0&&b.matches.length>0)return {matches:d$1,truncated:true};let R=null;for(let O of b.matches){let v=O.start+O.length;R??=sr(x);let T=h.resultRunAddressAt(O.start),D=T?cr(R,T.runId,T.offset)??to(R,O.rawStart):to(R,O.rawStart);d$1.push({blockId:x.id,start:O.rawStart,length:O.rawEnd-O.rawStart,paragraphIndex:y,runIndex:D.index,runOffset:D.offset,...m.scope?{scope:m.scope}:{},text:nt(h.text.slice(O.start,v),256),contextBefore:nt(h.text.slice(Math.max(0,O.start-Ie),O.start),Ie),contextAfter:nt(h.text.slice(v,v+Ie),Ie)});}if(b.truncated)return {matches:d$1,truncated:true}}}return {matches:d$1,truncated:false}}var ur=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"];function oe(t,e=null){return a(t,e)}function oo(t){let e=gb(t),n=[];for(let o of ur){let s=e.get(o);if(!s)return [];n.push({slot:o,hex:s});}return n}var ro=new WeakMap;function rt(t){let e=ro.get(t);if(e!==void 0)return e;let n=Kb(t),o=n===null||!Jb(n)?null:n;return ro.set(t,o),o}var ot=class{#e;#t;constructor(e,n){this.#e=e,this.#t=n;}get size(){return this.#e.size}get(e){if(this.#e.has(e))return this.#t.find(n=>e.startsWith(`${n.name}#`))}has(e){return this.get(e)!==void 0}*entries(){for(let e of this.#e.keys()){let n=this.get(e);n&&(yield [e,n]);}}keys(){return this.#e.keys()}*values(){for(let[,e]of this.entries())yield e;}[Symbol.iterator](){return this.entries()}forEach(e,n){for(let[o,s]of this.entries())e.call(n,s,o,this);}};function ao(t,e){return Object.freeze({...t,partByNode:new ot(t.ordinalByNode,e)})}function so(t){let e=new Map,n=new Map,o=new Map,s=new Set,a=new Map,r=new Map,d=0;for(let u of t)for(let m of F(u)){o.set(m.id,d),a.set(m.id,u),d+=1;let f=rt(m);if(f===null)continue;e.set(m.id,f);let x=f.toUpperCase(),y=r.get(x);y?(y.push(m.id),s.add(x)):(r.set(x,[m.id]),n.set(x,m.id));}return Object.freeze({paraIdByNode:e,nodeByParaId:n,ordinalByNode:o,ambiguousParaIds:s,partByNode:a,claimantsByParaId:r})}function io(t,e){let n=t.indexOf("#");if(n<=0)return null;let o=t.slice(0,n),s=e.body.name===o?e.body:void 0;s??=e.openStories.find(d=>d.name===o);let a=s?void 0:e.otherStories.find(d=>d.name===o);if(s??=a?e.normalize(a):void 0,!s)return null;let r=Ha(s,t);return r?.kind==="paragraph"?rt(r):null}var lo={committed:false,rejected:false,opCount:0};function _(t,e){return e===void 0?{committed:false,rejected:true,opCount:t}:{committed:false,rejected:true,opCount:t,reason:e}}function co(t,e,n={}){let o=e.filter(f=>f.ops.length>0),s=n.partOps??[],a=[...o,...s].reduce((f,x)=>f+x.ops.length,0);if(a===0)return n.packageEdits?.length?_(0,"invalidArgs"):lo;if([...o,...s].some(f=>f.ops.some(Jf))||[...o,...s].some(f=>f.ops.some(qg)))return _(a,"invalidArgs");let[r,...d]=o,u=[];for(let f of d){let x=t.partFor(f.scope);if(!x)return _(a,"unknown-part");u.push({partName:x.name,ops:f.ops});}let m=t.transact(r?.scope??{kind:"body"},f=>{for(let x of n.packageEdits??[])f.applyPackage(x);for(let x of r?.ops??[])f.apply(x);for(let x of u)for(let y of x.ops)f.applyTo(x.partName,y);for(let x of s)for(let y of x.ops)f.applyTo(x.partName,y);},n);return m.ok?{committed:true,rejected:false,opCount:a}:_(a,m.reason)}function uo(t,e,n,o,s,a){let r=a.partOps??[],d=e.length+r.reduce((x,y)=>x+y.ops.length,0);if(d===0&&!a.packageEdits?.length)return lo;if(r.some(x=>x.ops.some(y=>Jf(y)||qg(y))))return _(d,"invalidArgs");let u=e.filter(x=>Jf(x)||qg(x)).length;if(u>0){if(r.length||a.packageEdits?.length||u!==e.length||e.length!==1)return _(e.length,"invalidArgs");let x=Sb(a.actorId,()=>t.applyLifecycleOp(e[0]));return x.ok?{committed:true,rejected:false,opCount:1}:_(1,x.detail??x.reason)}let m=a.recordsHistory===false&&a.actorId&&a.operationId?t.partFor(s)?.name:void 0,f=t.transact(s,x=>{n!==void 0&&x.selectionBefore(n),o!==void 0&&x.selectionAfter(o);for(let y of a.packageEdits??[])x.applyPackage(y);for(let y of e)x.apply(y);for(let y of r)for(let c of y.ops)x.applyTo(y.partName,c);m&&x.applyPackage(y=>a$1(y,m,e));},a);return f.ok?{committed:true,rejected:false,opCount:d}:_(d,f.reason)}var pr=Object.freeze([]);function fr(t,e$1={}){let n=jc(t);if(!n.ok)return {ok:false,reason:n.reason,...n.detail?{detail:n.detail}:{}};let o=n.package,s=o.parts.get(o.mainDocumentPart);if(!s)return {ok:false,reason:"no-main-document-tree",detail:o.mainDocumentPart};let a=Qb(s),r=new P(o,_a(o,a)),d=null,u=null,m=null,f=null,x=null;r.subscribe(i=>{f=i,x=r.currentPackage();});let y=()=>r.bodyStore(),c$1=()=>r.currentPackage(),h=Cn(),P$1=Object.freeze({kind:"body"}),b=(i,l)=>{let p=l?.find(k=>k.type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");if(!p)return;let g=E$1(p);return g.mode==="Internal"&&g.target.ok?i.parts.get(g.target.partName):void 0},R=(i,l,p)=>{if(i.mainRelationships!==p||i.settingsPart!==b(l,p))return false;for(let g of i.resolution)for(let k of [g.headers,g.footers])for(let S of k.values())if(l.parts.get(S.partName)!==S.part)return false;return true},O=()=>{let i=c$1(),l=i.relationships.get(i.mainDocumentPart);if(d&&f&&x===i&&R(d,i,l)&&d.packageRevision===f.fromRevision&&r.packageRevision===f.toRevision&&f.story?.kind==="body"&&f.impact==="text-local"&&f.created.length===0&&f.deleted.length===0&&f.splitJoin.length===0&&(d={...d,packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:b(i,l)}),!d||d.packageRevision!==r.packageRevision||d.pkg!==i){let p=Ud(i);d={packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:b(i,l),resolution:p,parts:Td(p)};}return d},v="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",T="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",D=null,j=()=>{let i=c$1(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===v),p;if(l){let k=E$1(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/styles.xml");let g=p?.root??null;return g!==D&&(D=g,ie=null,G=null),D},J=null,B=null,Ee=()=>{let i=c$1();if(J===i)return B;J=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(g=>g.type===T),p;if(l){let g=E$1(l);g.mode==="Internal"&&g.target.ok&&(p=i.parts.get(g.target.partName));}return p??=i.parts.get("/word/numbering.xml"),B=p?.root??null,B},fo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",at=null,ue=null,U=()=>{let i=c$1();if(at===i)return ue;at=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===fo),p;if(l){let k=E$1(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/settings.xml");let g=p?.root??null;return g!==ue&&(ue=g,me=null,ie=null,G=null),ue},mo="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",go="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",st=(i,l)=>{let p=c$1(),g=(p.relationships.get("/")??[]).find(S=>S.type===i),k;if(g){let S=E$1(g);S.mode==="Internal"&&S.target.ok&&(k=p.parts.get(S.target.partName));}return k??p.parts.get(l)},it=null,Me=Og,yo=()=>{let i=c$1();if(it===i)return Me;it=i;let l=st(mo,"/docProps/core.xml"),p=st(go,"/docProps/app.xml");return Me=Pg(l?.root??null,p?.root??null),Me},ho="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",lt=null,pe=null,Q=()=>{let i=c$1();if(lt===i)return pe;lt=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===ho),p;if(l){let k=E$1(l);k.mode==="Internal"&&k.target.ok&&(p=i.parts.get(k.target.partName));}p??=i.parts.get("/word/theme/theme1.xml");let g=p?.root??null;return g!==pe&&(pe=g,me=null,we=null,ie=null,G=null),pe},xo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",fe=null,ko=()=>{if(fe)return fe;let i=c$1(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(g=>g.type===xo),p;if(l){let g=E$1(l);g.mode==="Internal"&&g.target.ok&&(p=i.parts.get(g.target.partName));}return p??=i.parts.get("/word/fontTable.xml"),fe=Object.freeze(Yd(i,p)),fe},re=null,Z$1=null,ae=null,se=null,ie=null,we=null,me=null,dt=()=>{let i=[y().part.root],l=new Set;for(let p of H())l.has(p)||(l.add(p),i.push(p.root));return i},Ce=()=>{let i=dt(),l=j();return l&&i.splice(1,0,l),i},G=null,ge=null,le=null,de=null,q=null,ct=new WeakMap,ye=null,ut=i=>{let l=ct.get(i);if(l)return l;let p=Qb(i);return ct.set(i,p),p},pt=()=>{let i=r.packageRevision,l=r.openStoryToken();if(!q||q.revision!==i||q.openStories!==l){let p=r.openStoryParts(),g=new Set(p.map(M=>M.name)),k=H().filter(M=>!g.has(M.name)).map(ut),S=[y().part,...p,...k],N=q,I=N!==null&&f!==null&&N.openStories===l&&N.revision===f.fromRevision&&i===f.toRevision&&f.impact==="text-local"&&f.created.length===0&&f.deleted.length===0&&f.splitJoin.length===0&&N.parts.length===S.length&&N.parts.every((M,ee)=>M.name===S[ee]?.name);q={revision:i,openStories:l,parts:S,index:I&&N?ao(N.index,S):so(S)};}return q.index},ft=()=>{let i=y().part.name,l=new Map;for(let p of [y().part,...H()])for(let[g,k]of ga(c$1(),p.name,i))l.set(g,k);return l},Po=()=>[y().part,...H()],H=()=>{let i=[],l=new Set;for(let g of O().parts)for(let k of [g.headers,g.footers])for(let S of k.values())l.has(S)||(l.add(S),i.push(S));let p=c$1();for(let g of ["footnote","endnote"]){let k=$f(p,g);!k||l.has(k)||(l.add(k),i.push(k));}return i};return {ok:true,session:{editable:F(y().part).length>0,paragraphIds:()=>F(y().part).map(i=>i.id),paragraphIdsIn(i=P$1){let l=r.partFor(i);return l?F(l).map(p=>p.id):[]},part:()=>y().part,partFor:i=>r.partFor(i),currentPackage:c$1,collaborationPort:i=>b$1(r,{documentId:i}),applyTreeOps(i,l,p,g=P$1,k={}){return uo(r,i,l,p,g,k)},applyTreeOpsAtomic(i,l={}){return co(r,i,l)},projectDoc:()=>X(y().part),reconcile:i=>Ke(i,y().part,f),lastCommitWasStructural:()=>f!==null&&(f.created.length>0||f.deleted.length>0||f.splitJoin.length>0||f.impact==="global"),applyPmDoc(i){let l=y(),p=Ge(l.part,i);if(!p.ok)return {committed:false,rejected:true,opCount:0,reason:p.reason};if(p.ops.length===0)return {committed:false,rejected:false,opCount:0};let g=r.transact(P$1,k=>{for(let S of p.ops)k.apply(S);});return g.ok?{committed:true,rejected:false,opCount:p.ops.length}:{committed:false,rejected:true,opCount:p.ops.length,reason:g.reason}},storyParts:Po,bodyText:()=>An(y().part),storyText(i){let l=r.partFor(i);return l?F(l).map(p=>Ui(l,p.id)??"").join(`
|
|
5
|
+
`):null},revision:()=>y().revision,revisionFor:i=>r.revisionFor(i),packageRevision:()=>r.packageRevision,canUndo:()=>r.canUndo,canRedo:()=>r.canRedo,undo:()=>{let i=r.selectionForUndo();return r.undo()===null?null:i},redo:()=>{let i=r.selectionForRedo();return r.redo()===null?null:i},beginComposition:(i=P$1)=>{r.beginComposition(i);},endComposition:()=>r.endComposition(),subscribe(i){return r.subscribe(i)},save(){return h(c$1())},headerFooterParts:()=>{let i=O().parts;return i[i.length-1]??Wd(c$1())},headerFooterPartsBySection:()=>O().parts,headerFooterResolutionBySection:()=>O().resolution,documentFonts(){return re&&re.revision===r.packageRevision||(re={revision:r.packageRevision,fonts:zn(Ce(),oe(Q(),U()))}),re.fonts},symbolFontFamilies(){return ae&&ae.revision===r.packageRevision||(ae={revision:r.packageRevision,fonts:Un(Ce())}),ae.fonts},renderedFontFamilies(){let i=j();return Z$1&&Z$1.revision===r.packageRevision&&Z$1.styles===i||(Z$1={revision:r.packageRevision,styles:i,families:e(dt(),i,oe(Q(),U()))}),Z$1.families},rendersText(){return se&&se.revision===r.packageRevision||(se={revision:r.packageRevision,rendersText:Kn(Ce())}),se.rendersText},documentStyles(){let i=j(),l=Q(),p=U();G??=c(i,oe(l,p));let g=G;return ie??=Vn(i,k=>g(k)),ie},stylesRoot:()=>j(),documentThemeFonts(){let i=Q(),l=U();return me??=oe(i,l),me},numberingRoot:()=>Ee(),settingsRoot:()=>U(),documentProperties:()=>yo(),trackingSettings:()=>Lg(U()),documentThemeColors(){let i=Q();return we??=oo(i),we},effectiveRunDefaults(i,l){let p=j(),g=Q(),k=U();G??=c(p,oe(g,k));let S=y();if(!ge||ge.revision!==S.revision){let N=new Map;for(let I of F(S.part))I.kind!=="textValue"&&N.set(I.id,tt(I)??null);ge={revision:S.revision,byId:N};}return G(ge.byId.get(i)??null,l)},documentOutline(){let i=y();return le&&le.revision===i.revision||(le={revision:i.revision,outline:Zn(i.part,j())}),le.outline},findText(i,l){let p=y(),g=r.packageRevision,k=`${l?.matchCase===true?"c":""}${l?.wholeWord===true?"w":""}${l?.limit??""}:${l?.stories??"all"}\0${i}`;if(de&&de.revision===g&&de.key===k)return de.result;let S=c$1(),N={footnote:new Set,endnote:new Set};for(let M of ag(p.part))N[M.noteKind].add(M.noteId);let I=no(p.part,i,l??{},{headerFooterBySection:O().resolution,footnotes:$f(S,"footnote")??null,endnotes:$f(S,"endnote")??null,referencedNoteIds:N});return de={revision:g,key:k,result:I},I},embeddedFonts:ko,paragraphAnchors:pt,paraIdOf:i=>io(i,{body:y().part,openStories:r.openStoryParts(),otherStories:H(),normalize:ut}),nodeIdOf:i=>pt().nodeByParaId.get(i.toUpperCase())??null,relationshipTarget:(i,l=P$1)=>{let p=c$1(),g=r.partFor(l);return g?Ff(p,g.name,i):null},bookmarks:()=>{let i=r.packageRevision;if(!ye||ye.revision!==i){let l=new Map(df(y().part));for(let p of H())for(let[g,k]of df(p))l.has(g)||l.set(g,k);ye={revision:i,index:l};}return ye.index},ensureHyperlinkRelationship(i,l=P$1){let p=r.partFor(l);return p?Ca(r,()=>{let g=c$1(),k=Ef(g,i,p.name);return k?(k.pkg!==g&&r.replacePackageShell(k.pkg),k.relationshipId):null},g=>g!==null):null},reviewItems(){let i=e$1.reviewModel;if(!i)return pr;let l=y(),p=`${r.packageRevision}:${l.revision}`;if(u&&u.revisionKey===p)return u.items;let g=c$1(),k=g.parts.get(Y$1(g,l.part.name)),S=g.parts.get(Z(g,l.part.name)),N=H(),I=u&&f?_n(f,u,u.items,l.part,k,S,r.packageRevision):null,M,ee;if(I&&u){let mt=i.revisionItemsOfParagraph(l.part,I);Fn(u.items,mt,I)?(M=Bn(u.items,u.paragraphOrder,I,mt),ee=u.paragraphOrder):(ee=ji(l.part),M=i.collectReviewItems({storyPart:l.part,furnitureParts:N,stylesPart:sf(g),commentsPart:k,commentsExtendedPart:S,customNodePayloads:ft()}));}else ee=ji(l.part),M=i.collectReviewItems({storyPart:l.part,furnitureParts:N,stylesPart:sf(g),commentsPart:k,commentsExtendedPart:S,customNodePayloads:ft()});return u={revisionKey:p,bodyRevision:l.revision,packageRevision:r.packageRevision,items:M,paragraphOrder:ee,commentsPart:k,commentsExtendedPart:S},u.items},hasReviewContent(){let i=r.packageRevision;if(!m||m.revision!==i){let l=sf(c$1()),p=[y().part,...H(),...l?[l]:[]];m={revision:i,present:p.some(g=>Yh(g).length>0||Xe(g.root))};}return m.present},replyToComment(i,l,p,g,k,S=P$1,N){let I=_$1(r,{anchor:{paragraphId:l.paragraphId,start:l.start,end:l.end,...l.endParagraphId===void 0?{}:{endParagraphId:l.endParagraphId}},author:g,text:p,...k===void 0?{}:{date:k},...i===null?{}:{replyToCommentId:i},...N===void 0?{}:{actorId:N}},S);return I.ok?I.commentId:null},setCommentResolved(i,l){return $(r,i,l).ok},deleteComment(i,l=P$1,p){return this.deleteComments([{commentId:i}],l,p)},deleteComments(i,l=P$1,p){return aa(r,i,l,p)},insertCustomNode(i,l=P$1){return ia(r,i,l)},removeCustomNode(i,l=P$1){return ja(r,i,l)},sweepCustomNodePayloads(i){return Ca(r,()=>{let l=y(),p=fa(r.currentPackage(),l.part.name,i);return p.ok?p.removed.length===0?{ok:true,removed:[]}:(r.replacePackageShell(p.pkg),{ok:true,removed:p.removed}):{ok:false,reason:p.reason}},l=>l.ok&&l.removed.length>0)},ensureListDefinition(i){return Ca(r,()=>{let l=xf(c$1(),i);return l?(r.replacePackageShell(l.pkg),J=null,B=null,l.numId):null},l=>l!==null)},ensureNumberingLevel(i,l,p){return Ca(r,()=>{let g=c$1(),k=yf(g,i,l,p);return k?k!==g?(r.replacePackageShell(k),J=null,B=null,{ok:true,changed:true}):{ok:true,changed:false}:{ok:false,changed:false}},g=>g.changed).ok},insertImage(i,l){return r.insertImage(i,l)},replaceImage(i,l,p,g,k,S){return r.replaceImage(i,l,p,g,k,S)},deleteImage(i,l){return r.deleteImage(i,l)},deleteImageTracked(i,l,p){return r.deleteImageTracked(i,l,p)},applyImageProperties(i,l){return r.applyImageProperties(i,l)},applyFragmentPaste(i,l){return r.applyFragmentPaste(i,l)}}}}var mr=b.projection;function vr(t,e,n){let o=t.filter(s=>s.localName!==e);return o.length!==t.length?o:[...o,n?{localName:e,attributes:n}:{localName:e}]}function Tr(t,e,n={}){let o=null,s=false,a=()=>n.onChange?.(r()),r=()=>({revision:e.revision(),canUndo:e.canUndo(),canRedo:e.canRedo(),lastRejection:o}),d=c=>{s=true;let h=m.state.tr.replaceWith(0,m.state.doc.content.size,c.content);h.setMeta("addToHistory",false),m.dispatch(h),s=false;},u=c=>()=>(c()&&(d(e.projectDoc()),a()),true),m=new EditorView(t,{state:EditorState.create({doc:e.projectDoc(),plugins:[keymap({...baseKeymap,Home:selectTextblockStart,End:selectTextblockEnd,"Mod-z":u(()=>e.undo()!==null),"Mod-y":u(()=>e.redo()!==null),"Shift-Mod-z":u(()=>e.redo()!==null),"Mod-b":(c,h)=>y(c,h,"b"),"Mod-i":(c,h)=>y(c,h,"i"),"Mod-u":(c,h)=>y(c,h,"u",{val:"single"})})]}),editable:()=>e.editable,handleDOMEvents:{keydown:c=>(f(c),false),beforeinput:(c,h)=>{let P=h;if(c.composing)return false;f(c);let b=P.inputType;if(b==="insertText"&&P.data!=null){P.preventDefault();let{from:R,to:O}=c.state.selection;return c.dispatch(c.state.tr.insertText(P.data,R,O)),true}if(b==="deleteContentBackward"){P.preventDefault();let{from:R,empty:O}=c.state.selection;return O?R>0?c.dispatch(c.state.tr.delete(R-1,R)):joinBackward(c.state,c.dispatch):deleteSelection(c.state,c.dispatch),true}if(b==="deleteContentForward"){P.preventDefault();let{from:R,to:O,empty:v}=c.state.selection;return v?O<c.state.doc.content.size?c.dispatch(c.state.tr.delete(R,R+1)):joinForward(c.state,c.dispatch):deleteSelection(c.state,c.dispatch),true}return b==="insertParagraph"?(P.preventDefault(),splitBlock(c.state,c.dispatch),true):false},compositionstart:()=>(e.beginComposition(),false),compositionend:()=>(e.endComposition(),a(),false)},dispatchTransaction(c){let h=m.state.apply(c);if(s||!c.docChanged){m.updateState(h);return}let P=e.applyPmDoc(h.doc);if(P.rejected){o=String(P.reason??"rejected"),m.updateState(h),d(e.projectDoc()),a();return}o=null,m.updateState(P.committed&&e.lastCommitWasStructural()?x(h):h),a();}});function f(c){if(c.composing||s)return;let h=c.dom.ownerDocument.getSelection(),P=h?.anchorNode,b=h?.focusNode;if(!(!h||!P||!b)&&!(!c.dom.contains(P)||!c.dom.contains(b)))try{let R=c.posAtDOM(P,h.anchorOffset),O=c.posAtDOM(b,h.focusOffset),v=c.state.selection;if(v.anchor===R&&v.head===O)return;let T=TextSelection.create(c.state.doc,R,O);c.dispatch(c.state.tr.setSelection(T).setMeta("addToHistory",!1));}catch{}}function x(c){let h=e.paragraphIds(),P=c.tr,b=false,R=0;return c.doc.forEach((O,v)=>{let T=h[R];R+=1,!(O.type.name!=="paragraph"||T===void 0)&&O.attrs.nodeId!==T&&(P=P.setNodeMarkup(v,void 0,{...O.attrs,nodeId:T}),b=true);}),b?c.apply(P.setMeta("addToHistory",false)):c}function y(c,h,P,b){let R=E.marks.runProps;if(!h)return true;let{from:O,to:v,empty:T}=c.selection;if(T)return true;let j=c.doc.resolve(O).marks().find(Ee=>Ee.type===R)?.attrs.props??[],J=vr(j,P,b),B=c.tr;return B.removeMark(O,v,R),J.length>0&&B.addMark(O,v,R.create({props:J})),h(B),true}return {view:m,state:r,undo:()=>u(()=>e.undo()!==null)(),redo:()=>u(()=>e.redo()!==null)(),toggleRunProperty(c,h){y(m.state,m.dispatch.bind(m),c,h);},destroy:()=>m.destroy()}}export{E as a,Je as b,ne as c,F as d,X as e,Ge as f,Bo as g,Ke as h,tt as i,fr as j,mr as k,Tr as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkHZQFGB2X_cjs=require('./chunk-HZQFGB2X.cjs'),chunkCB6RQ3GD_cjs=require('./chunk-CB6RQ3GD.cjs');var _=4096,L=chunkCB6RQ3GD_cjs.ue*16;function I(){return {out:[],runs:[],length:0}}function D(e,n,s,t){if(n.length===0||s===t)return;let o=e.runs[e.runs.length-1];if(o?.runId===n&&o.end===s){e.runs[e.runs.length-1]={runId:n,start:o.start,end:t};return}e.runs.push({runId:n,start:s,end:t});}function M(e,n,s,t){if(n.length>t.left)return false;if(t.left-=n.length,n.length>0){let o=e.length;e.out.push(n),e.length+=n.length,D(e,s,o,e.length);}return true}function v(e,n){let s=e.length;n.text.length>0&&e.out.push(n.text),e.length+=n.text.length;for(let t of n.runs)D(e,t.runId,s+t.start,s+t.end);}function O(e){return {text:e.out.join(""),runs:e.runs}}function j(){return {text:chunkCB6RQ3GD_cjs.ce,runs:[]}}function W(e){for(let n of e)if(!n.separated)return false;return true}function H(e,n=0,s=e.length,t){let o=new Set,l=new Map,r=new Map,d=t?[t]:[];t&&o.add(t);for(let a=n;a<s;a+=1){let i=e[a].node;if(chunkCB6RQ3GD_cjs.he(i,"begin")){d.push(i.id);continue}if(chunkCB6RQ3GD_cjs.he(i,"separate")){let u=d[d.length-1];u&&(o.add(u),l.set(i.id,u));continue}if(chunkCB6RQ3GD_cjs.he(i,"end")){let u=d.pop();u&&(o.add(u),r.set(i.id,u));}}return {activeBegins:o,separateBegin:l,endBegin:r}}function z(e,n,s){if(chunkCB6RQ3GD_cjs.he(s,"begin"))return n.activeBegins.has(s.id)&&e.push({beginId:s.id,separated:false}),true;if(chunkCB6RQ3GD_cjs.he(s,"separate")){let t=n.separateBegin.get(s.id),o=e[e.length-1];return t&&o?.beginId===t&&(o.separated=true),true}if(chunkCB6RQ3GD_cjs.he(s,"end")){let t=n.endBegin.get(s.id),o=e[e.length-1];return t&&o?.beginId===t&&e.pop(),true}return false}function J(e,n,s,t){let o=[];if(!chunkCB6RQ3GD_cjs.te(e,o,s))return null;let l=o.reverse(),r=I();for(;l.length>0;){let d=l.pop();if(n==="original"&&d.hiddenInOriginal)continue;if(chunkCB6RQ3GD_cjs.ke(d.node)){let i=[];if(!chunkCB6RQ3GD_cjs.te(d.node,i,s))return null;for(let u=i.length-1;u>=0;u-=1)l.push(i[u]);continue}if(chunkCB6RQ3GD_cjs.ie(d.node))continue;let a=chunkCB6RQ3GD_cjs.se(d.node);if(!M(r,a,d.runId,t))return null}return O(r)}function K(e,n,s,t,o){let l=I(),r=[],d=H(e);for(let a of e){let i=a.node;if(z(r,d,i)||chunkCB6RQ3GD_cjs.ie(i)||!W(r)||n==="original"&&a.hiddenInOriginal)continue;if(chunkCB6RQ3GD_cjs.ke(i)){let c=o>=chunkCB6RQ3GD_cjs.ve?J(i,n,s,t):X(i,n,s,t,o+1);if(c===null)return null;v(l,c);continue}let u=chunkCB6RQ3GD_cjs.se(i);if(!M(l,u,a.runId,t))return null}return O(l)}function X(e,n,s,t,o){let l=[];return chunkCB6RQ3GD_cjs.te(e,l,s)?K(l,n,s,t,o):null}function Y(e,n,s){let t=n.node;if(e.owned.has(t.id)&&(e.nodesLeft-=1,e.nodesLeft<0&&(e.overflow=true)),chunkCB6RQ3GD_cjs.he(t,"begin"))return t.id!==e.span.node.id&&e.markers.activeBegins.has(t.id)&&e.states.push({beginId:t.id,separated:false}),false;if(chunkCB6RQ3GD_cjs.he(t,"separate")){let l=e.markers.separateBegin.get(t.id),r=e.states[e.states.length-1];return l&&r?.beginId===l&&(r.separated=true),false}if(chunkCB6RQ3GD_cjs.he(t,"end")){if(t.id===e.endId)return true;let l=e.markers.endBegin.get(t.id),r=e.states[e.states.length-1];return l&&r?.beginId===l&&e.states.pop(),false}if(e.overflow||chunkCB6RQ3GD_cjs.ie(t)||chunkCB6RQ3GD_cjs.ke(t)||!e.owned.has(t.id)||!W(e.states)||s==="original"&&n.hiddenInOriginal)return false;let o=chunkCB6RQ3GD_cjs.se(t);return M(e.result,o,n.runId,e.chars)||(e.overflow=true),false}function U(e,n,s="allMarkup"){let t=new Map,o=new Map,l=new Map;for(let i of n)i.kind==="complex"?o.set(i.node.id,i):l.set(i.node.id,i);let r=[];chunkCB6RQ3GD_cjs.te(e,r);let d=new Map;for(let i=0;i<r.length;i+=1)d.set(r[i].node.id,i);let a=null;for(let i=0;i<r.length;i+=1){let u=r[i],c=l.get(u.node.id);if(c){let f={left:_},p={left:L},g=X(c.node,s,f,p,0);t.set(c.node.id,g??j());}if(a===null){let f=o.get(u.node.id);if(!f)continue;let p=new Set(f.removeNodeIds),g=-1;for(let R=f.removeNodeIds.length-1;R>=0;R-=1){let m=d.get(f.removeNodeIds[R]);if(!(m===void 0||m<=i)&&chunkCB6RQ3GD_cjs.he(r[m].node,"end")){g=m;break}}let x=r[g];if(!x){t.set(f.node.id,j());continue}a={span:f,owned:p,states:[{beginId:f.node.id,separated:false}],markers:H(r,i+1,g,f.node.id),endId:x.node.id,result:I(),chars:{left:L},nodesLeft:_,overflow:false};}Y(a,u,s)&&(t.set(a.span.node.id,a.overflow?j():O(a.result)),a=null);}return a!==null&&t.set(a.span.node.id,j()),t}function Z(e){let n=[],s=0;for(let t of e){let o=s+t.text.length;t.resultRuns?n.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,resultRuns:t.resultRuns,projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}):n.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}),s=o;}return n}function $(e,n){return n<=e.rawStart?e.projectedStart:n>=e.rawEnd?e.projectedEnd:e.expansion?e.projectedStart:e.projectedStart+n-e.rawStart}function G(e,n){return e.expansion?e.rawStart:e.rawStart+n-e.projectedStart}function Q(e,n){return e.expansion?e.rawEnd:e.rawStart+n-e.projectedStart}function B(e){let n=Z(e),s="";for(let t of e)s+=t.text;return {text:s,projectedOffset(t){let o=0;for(let l of n){if(t<=l.rawEnd)return $(l,t);o=l.projectedEnd;}return o},rawRange(t,o){if(t<0||t>=o||o>s.length)return null;let l=n.find(d=>t>=d.projectedStart&&t<d.projectedEnd),r=n.find(d=>o>d.projectedStart&&o<=d.projectedEnd);return !l||!r?null:{start:G(l,t),end:Q(r,o)}},sliceRaw(t,o){if(t>=o)return "";let l="";for(let r of n){if(r.expansion){t<=r.rawStart&&o>=r.rawEnd&&(l+=r.text);continue}let d=Math.max(t,r.rawStart),a=Math.min(o,r.rawEnd);d<a&&(l+=r.text.slice(d-r.rawStart,a-r.rawStart));}return l},resultRunAddressAt(t){let o=n.find(r=>r.resultRuns!==void 0&&t>=r.projectedStart&&t<r.projectedEnd);if(!o?.resultRuns)return null;let l=t-o.projectedStart;for(let r of o.resultRuns)if(l>=r.start&&l<r.end)return {runId:r.runId,offset:l-r.start};return null},findOccurrences(t,o,l={}){let r=[];if(o<=0||!chunkHZQFGB2X_cjs.Ya(t)||s.length===0)return {matches:r,truncated:false};let d=l.matchCase===true,a=l.wholeWord===true,i=d?t:chunkHZQFGB2X_cjs.Wa(t),u=d?s:chunkHZQFGB2X_cjs.Wa(s),c=Math.min(s.length,l.to??s.length),f=new Set,p=u.indexOf(i,Math.max(0,l.from??0));for(;p>=0;){let g=p+i.length;if(g>c)return {matches:r,truncated:false};if(!a||chunkHZQFGB2X_cjs.Xa(s,p,g)){let x=n.find(b=>p>=b.projectedStart&&p<b.projectedEnd),R=n.find(b=>g>b.projectedStart&&g<=b.projectedEnd);if(!x||!R)return {matches:r,truncated:false};let m=x===R&&x.expansion?x:null;if(!m||!f.has(m)){if(r.length>=o)return {matches:r,truncated:true};r.push({start:p,length:i.length,rawStart:G(x,p),rawEnd:Q(R,g)}),m&&f.add(m);}}p=u.indexOf(i,g);}return {matches:r,truncated:false}}}}function q(e){return e.length===0?B([]):B([{text:e,rawStart:0,rawEnd:e.length}])}function ee(e,n,s="allMarkup"){if(!n.includes(chunkCB6RQ3GD_cjs.ce))return n.length===0?[]:[{text:n,rawStart:0,rawEnd:n.length}];let t=chunkCB6RQ3GD_cjs.xe(e),o=chunkCB6RQ3GD_cjs.Ye(e,t),l=U(e,t,s),r=new Map;for(let i of t)r.set(i.node.id,i);let d=[],a=0;for(let i of o){let u=r.get(i.node.id);if(!u)continue;a<i.start&&d.push({text:n.slice(a,i.start),rawStart:a,rawEnd:i.start});let c=l.get(u.node.id);u.kind==="simple"&&c?d.push({text:c.text,rawStart:i.start,rawEnd:i.end,resultRuns:c.runs}):d.push({text:c?.text??chunkCB6RQ3GD_cjs.ce,rawStart:i.start,rawEnd:i.end}),a=i.end;}return a<n.length&&d.push({text:n.slice(a),rawStart:a,rawEnd:n.length}),d}function le(e,n,s="allMarkup"){return n.includes(chunkCB6RQ3GD_cjs.ce)?B(ee(e,n,s)):q(n)}exports.a=B;exports.b=q;exports.c=ee;exports.d=le;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkP5PWSRNW_cjs=require('../chunk-P5PWSRNW.cjs'),chunkCB6RQ3GD_cjs=require('../chunk-CB6RQ3GD.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunkP5PWSRNW_cjs.b}});Object.defineProperty(exports,"historyGroupOfJournal",{enumerable:true,get:function(){return chunkCB6RQ3GD_cjs.ya}});Object.defineProperty(exports,"reportHistoryGroup",{enumerable:true,get:function(){return chunkCB6RQ3GD_cjs.bj}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as HistoryGroup, T as TreePackageStore, c as TreeModelChange } from '../tree-package-fragment-
|
|
2
|
-
export { r as reportHistoryGroup } from '../tree-package-fragment-
|
|
3
|
-
import { a1 as OoxmlElement, j as OoxmlPackage } from '../types-barrel-
|
|
4
|
-
import '../image-resources-
|
|
1
|
+
import { b as HistoryGroup, T as TreePackageStore, c as TreeModelChange } from '../tree-package-fragment-DBb97w3F.js';
|
|
2
|
+
export { r as reportHistoryGroup } from '../tree-package-fragment-DBb97w3F.js';
|
|
3
|
+
import { a1 as OoxmlElement, j as OoxmlPackage } from '../types-barrel-ChGvWjkO.js';
|
|
4
|
+
import '../image-resources-B0v-XaTM.js';
|
|
5
5
|
import '../editor-scope-OHPwVQ5l.js';
|
|
6
6
|
|
|
7
7
|
/** Attribute name as the journal addresses it. Prefix is authored fidelity, not identity. @public */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as createCollaborationDocumentPort}from'../chunk-
|
|
1
|
+
export{b as createCollaborationDocumentPort}from'../chunk-5RKCJ5DF.js';export{ya as historyGroupOfJournal,bj as reportHistoryGroup}from'../chunk-UOQONZVQ.js';
|
package/dist/collaboration.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as StoryScope } from './tree-package-fragment-
|
|
2
|
-
import { W as TreeDocOp } from './types-barrel-
|
|
1
|
+
import { S as StoryScope } from './tree-package-fragment-DBb97w3F.js';
|
|
2
|
+
import { W as TreeDocOp } from './types-barrel-ChGvWjkO.js';
|
|
3
3
|
import { CollaborationDocumentPort } from './collaboration/replication.js';
|
|
4
4
|
import { C as CollaborationStatus, a as CollaborationStatusSnapshot, b as CollaborationFailureCode } from './failure-DNNmwsgD.js';
|
|
5
5
|
export { c as CollaborationFailure, d as createCollaborationStatusTracker, i as isCollaborationFailureCode } from './failure-DNNmwsgD.js';
|
|
6
|
-
import './image-resources-
|
|
6
|
+
import './image-resources-B0v-XaTM.js';
|
|
7
7
|
import './editor-scope-OHPwVQ5l.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DocxDocument, E as ExecResult, k as ContentControlType, l as DocTarget, m as RunFormatting, n as Extent, I as InsertableContentControlType, o as ContainerRef, p as ContentControlFilter, q as DocRange, r as Revision, s as DocComment, S as StyleDefinitions } from '../types-barrel-
|
|
2
|
-
export { B as Block, t as ColorValue, u as ContentControl, v as DocAnchor, w as DocAnchorRange, x as DocLocation, y as DocumentBody, z as ExecErrorCode, H as HeaderFooterSet, A as IndentFormatting, P as Paragraph, F as ParagraphFlags, G as ParagraphTabStop, J as RevisionType, K as Section, L as SectionProperties, M as StyleDefinition, T as Table, N as Theme, Q as ThemeColorScheme } from '../types-barrel-
|
|
1
|
+
import { D as DocxDocument, E as ExecResult, k as ContentControlType, l as DocTarget, m as RunFormatting, n as Extent, I as InsertableContentControlType, o as ContainerRef, p as ContentControlFilter, q as DocRange, r as Revision, s as DocComment, S as StyleDefinitions } from '../types-barrel-ChGvWjkO.js';
|
|
2
|
+
export { B as Block, t as ColorValue, u as ContentControl, v as DocAnchor, w as DocAnchorRange, x as DocLocation, y as DocumentBody, z as ExecErrorCode, H as HeaderFooterSet, A as IndentFormatting, P as Paragraph, F as ParagraphFlags, G as ParagraphTabStop, J as RevisionType, K as Section, L as SectionProperties, M as StyleDefinition, T as Table, N as Theme, Q as ThemeColorScheme } from '../types-barrel-ChGvWjkO.js';
|
|
3
3
|
import '../editor-scope-OHPwVQ5l.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorSelection, d as EditorSnapshot, a as FontConfiguration, F as FontFaceRequest, b as FontSource, c as FontSourceSubstitution, R as FormatPainterLevel, U as FormatPainterMode, o as FormatPainterSurfaceState, V as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, _ as NoteKind, $ as NotePropertiesSide, a0 as NotePropertiesState, a1 as PageSetup, a2 as ResolveReviewChangesOptions, a3 as ResolvedNoteNumbering, a4 as ReviewActivationOptions, a5 as ReviewCommentPlacement, a6 as ReviewCustomPlacement, a7 as ReviewItemPlacement, a8 as ReviewItemPlacementBase, a9 as ReviewItemQuery, aa as ReviewRevisionPlacement, S as SelectedImageState, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ab as TableBorderTarget, ac as TableCellVerticalAlignment, ad as TableColumnDividerResizeTarget, ae as TableColumnOccurrenceTarget, t as TableContext, af as TableRightEdgeResizeTarget, ag as TableRowOccurrenceTarget, ah as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, ai as ZoomFitTarget, Z as ZoomMode } from '../editor-
|
|
2
|
-
import '../revision-projection-
|
|
3
|
-
export { B as Block, t as ColorValue, C as CommentRecord, o as ContainerRef, u as ContentControl, p as ContentControlFilter, k as ContentControlType, v as DocAnchor, w as DocAnchorRange, s as DocComment, x as DocLocation, q as DocRange, l as DocTarget, y as DocumentBody, D as DocxDocument,
|
|
1
|
+
export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorSelection, d as EditorSnapshot, a as FontConfiguration, F as FontFaceRequest, b as FontSource, c as FontSourceSubstitution, R as FormatPainterLevel, U as FormatPainterMode, o as FormatPainterSurfaceState, V as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, _ as NoteKind, $ as NotePropertiesSide, a0 as NotePropertiesState, a1 as PageSetup, a2 as ResolveReviewChangesOptions, a3 as ResolvedNoteNumbering, a4 as ReviewActivationOptions, a5 as ReviewCommentPlacement, a6 as ReviewCustomPlacement, a7 as ReviewItemPlacement, a8 as ReviewItemPlacementBase, a9 as ReviewItemQuery, aa as ReviewRevisionPlacement, S as SelectedImageState, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ab as TableBorderTarget, ac as TableCellVerticalAlignment, ad as TableColumnDividerResizeTarget, ae as TableColumnOccurrenceTarget, t as TableContext, af as TableRightEdgeResizeTarget, ag as TableRowOccurrenceTarget, ah as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, ai as ZoomFitTarget, Z as ZoomMode } from '../editor-BKDVqXyk.js';
|
|
2
|
+
import '../revision-projection-DDVBYTIG.js';
|
|
3
|
+
export { B as Block, t as ColorValue, C as CommentRecord, o as ContainerRef, u as ContentControl, p as ContentControlFilter, k as ContentControlType, v as DocAnchor, w as DocAnchorRange, s as DocComment, x as DocLocation, q as DocRange, l as DocTarget, y as DocumentBody, D as DocxDocument, ai as DocxDocumentJSON, aj as DrawingHorizontalReferenceFrame, a9 as DrawingKind, ac as DrawingLocks, ab as DrawingPositionInput, ak as DrawingVerticalReferenceFrame, z as ExecErrorCode, E as ExecResult, n as Extent, al as FontDefinition, H as HeaderFooterSet, aa as ImageWrapTarget, A as IndentFormatting, I as InsertableContentControlType, am as NumberingRef, an as PageMargins, P as Paragraph, ao as ParagraphDisagreements, F as ParagraphFlags, ad as ParagraphFormatCommand, G as ParagraphTabStop, ap as Point, af as Rect, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind, r as Revision, h as RevisionAddress, _ as RevisionBatchResult, J as RevisionType, aq as Run, m as RunFormatting, K as Section, L as SectionProperties, ag as SelectionPin, M as StyleDefinition, S as StyleDefinitions, T as Table, ar as TableCell, as as TableRow, N as Theme, Q as ThemeColorScheme, ah as Unsubscribe, ae as Watermark } from '../types-barrel-ChGvWjkO.js';
|
|
4
4
|
export { ContentControlSummary, DocEdits, DocQueries, DocQueryResults, ParagraphSummary } from './document.js';
|
|
5
5
|
export { b as EditorExecOptions, E as EditorScope, H as HistoryDiagnostic, a as HistoryGroup, c as HistoryGroupOutcome, V as ViewScope } from '../editor-scope-OHPwVQ5l.js';
|
|
6
6
|
export { InteractionAffinity, InteractionOutcome, InteractionOutcomeCode, SemanticIdentity, SemanticTarget } from './interaction.js';
|
|
7
|
-
export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-
|
|
8
|
-
export {
|
|
9
|
-
import '../document-protection-
|
|
7
|
+
export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-BNiYSBcB.js';
|
|
8
|
+
export { b as ImageResourceState, P as PreservedImageMime, R as RenderableImageMime, S as SupportedImageMime, V as ValidatedImageBytesHandle, c as VectorImageMime } from '../image-resources-B0v-XaTM.js';
|
|
9
|
+
import '../document-protection-CMPEonQc.js';
|
|
10
10
|
import '../failure-DNNmwsgD.js';
|
|
11
|
-
import '../semantic-records-
|
|
12
|
-
import '../omml-equation-
|
|
11
|
+
import '../semantic-records-C5OeXnaL.js';
|
|
12
|
+
import '../omml-equation-CfTm3jOK.js';
|