@betteroffice/docx 0.4.1 → 0.4.3

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.
Files changed (70) hide show
  1. package/dist/{chunk-2HLVVQIL.mjs → chunk-3RPZ44TT.mjs} +1 -1
  2. package/dist/chunk-5Z22FORG.mjs +1 -0
  3. package/dist/chunk-7ZV6P6NZ.mjs +57 -0
  4. package/dist/{chunk-2QHGQA3V.mjs → chunk-AXFMDV66.mjs} +1 -1
  5. package/dist/{chunk-YLFKV2NT.mjs → chunk-EBYC3CX7.mjs} +1 -1
  6. package/dist/chunk-FK7X7557.mjs +1 -0
  7. package/dist/{chunk-3CYO46ML.mjs → chunk-GKWXOZZH.mjs} +1 -1
  8. package/dist/chunk-HGKSOBXK.mjs +1 -0
  9. package/dist/{chunk-DKWD4P4J.mjs → chunk-LIOWZSE7.mjs} +1 -1
  10. package/dist/chunk-ML6E23W2.mjs +1 -0
  11. package/dist/{chunk-NVN26RHH.mjs → chunk-MLEMGJP7.mjs} +1 -1
  12. package/dist/chunk-QBMNRD5V.mjs +2 -0
  13. package/dist/chunk-SHVHVJUB.mjs +1 -0
  14. package/dist/chunk-UBUTIWXN.mjs +1 -0
  15. package/dist/{chunk-7DDF4RHB.mjs → chunk-VH7P4734.mjs} +1 -1
  16. package/dist/collaboration/index.d.mts +5 -5
  17. package/dist/compareDocx-URPCPAQT.mjs +1 -0
  18. package/dist/{computeLayout-4MNWHE2T.mjs → computeLayout-ZTO6TBWX.mjs} +1 -1
  19. package/dist/{content-BzoC6bSz.d.mts → content-DSb-6a9T.d.mts} +5 -5
  20. package/dist/core.d.mts +3 -3
  21. package/dist/core.mjs +1 -1
  22. package/dist/{displayListQueries-DnHmHUPY.d.mts → displayListQueries-BVBDVXoP.d.mts} +2 -2
  23. package/dist/docx/index.d.mts +1 -1
  24. package/dist/docx/index.mjs +2 -2
  25. package/dist/editor/index.d.mts +10 -6
  26. package/dist/editor/index.mjs +1 -1
  27. package/dist/{frameDelta-ByU7HBuB.d.mts → frameDelta-CLeO7K5z.d.mts} +5 -2
  28. package/dist/generated/edit/docx_edit_bg.wasm +0 -0
  29. package/dist/generated/layout/docx_layout_bg.wasm +0 -0
  30. package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
  31. package/dist/generated/parse/docx_parse_bg.wasm +0 -0
  32. package/dist/{index-yOtBET85.d.mts → index-DzZVJC8-.d.mts} +230 -86
  33. package/dist/layout/index.d.mts +2 -2
  34. package/dist/layout/index.mjs +1 -1
  35. package/dist/layout/pagination/index.d.mts +3 -3
  36. package/dist/layout/render/index.d.mts +9 -9
  37. package/dist/layout/render/index.mjs +1 -1
  38. package/dist/{parseWasm-NLAG22EU.mjs → parseWasm-BESKFFA3.mjs} +1 -1
  39. package/dist/plugin-api/RenderedDomContext.d.mts +5 -5
  40. package/dist/plugin-api/index.d.mts +1 -1
  41. package/dist/plugin-api/resolveItemPositions.d.mts +1 -1
  42. package/dist/{rustDisplayList-DcaA5iok.d.mts → rustDisplayList-B7uPoItK.d.mts} +2 -2
  43. package/dist/types/content.d.mts +1 -1
  44. package/dist/types/document.d.mts +2 -2
  45. package/dist/{types-Buyw6dFd.d.mts → types-Cz7S77Ut.d.mts} +3 -1
  46. package/dist/utils/comments.d.mts +1 -1
  47. package/dist/utils/index.d.mts +1 -1
  48. package/dist/utils/index.mjs +1 -1
  49. package/dist/{wasm-IBCLSJQU.mjs → wasm-JPDPN2B2.mjs} +1 -1
  50. package/dist/wasm-KSZTTO3B.mjs +1 -0
  51. package/dist/wasm-QI7MWC5D.mjs +1 -0
  52. package/dist/wasm-edit.d.mts +27 -2
  53. package/dist/wasm-edit.mjs +1 -1
  54. package/dist/wasm-layout.mjs +1 -1
  55. package/dist/wasm-opc.mjs +1 -1
  56. package/dist/wasm-parse.mjs +1 -1
  57. package/dist/yrs/index.d.mts +4 -4
  58. package/dist/yrs/index.mjs +1 -1
  59. package/dist/yrs/residentEngineWorker.mjs +1 -1
  60. package/package.json +1 -1
  61. package/dist/chunk-3OWET2KZ.mjs +0 -1
  62. package/dist/chunk-4GEXNR7A.mjs +0 -1
  63. package/dist/chunk-4QHAMEAS.mjs +0 -1
  64. package/dist/chunk-6CHGYCFU.mjs +0 -1
  65. package/dist/chunk-C5BX34CG.mjs +0 -2
  66. package/dist/chunk-EIPVFGIC.mjs +0 -1
  67. package/dist/chunk-FMOSOX5V.mjs +0 -57
  68. package/dist/compareDocx-QX2YF3EF.mjs +0 -1
  69. package/dist/wasm-6WSIEYWC.mjs +0 -1
  70. package/dist/wasm-GSI2XMOH.mjs +0 -1
@@ -1,21 +1,21 @@
1
- import { a as DisplayPage, G as GlyphRunPrimitive, L as LinePrimitive, T as TextRunPrimitive, b as DisplayPrimitive, D as DisplayList } from '../../frameDelta-ByU7HBuB.mjs';
2
- export { c as DecodedFrameDelta, d as DecorationPrimitive, e as DisplayBounds, f as DocAttrs, F as FRAME_DELTA_HEADER_BYTES, g as FRAME_DELTA_PAGE_OP_BYTES, h as FRAME_DELTA_VERSION, i as FrameDeltaError, j as FrameDeltaErrorCode, k as FramePageOperation, H as HfRegion, I as ImagePrimitive, P as PositionedGlyph, l as RectPrimitive, R as RetainedFrame, m as RetainedFramePage, n as TableCellRef, o as applyFrameDelta, p as applyFrameDeltaOwned, q as decodeFrameDelta, r as displayPageNoteAnchorRevision, s as displayPageRevision } from '../../frameDelta-ByU7HBuB.mjs';
3
- export { a as DisplayListBuildInputs, D as DisplayListHeadersFooters, b as DisplayListHfVariant, c as DisplayListPictureWatermark, d as DisplayListTextWatermark, e as DisplayListWatermark, f as RustDisplayFrameResult, g as RustDisplayListEngine, R as RustDisplayListQueryEngine, h as RustDisplayListSourceError, i as RustDisplayListSourceErrorStage, j as buildRustDisplayFrame, k as buildRustDisplayList, l as encodeDisplayListFrameExtras, m as loadRustDisplayListQueryEngine } from '../../rustDisplayList-DcaA5iok.mjs';
4
- import { a as DisplayListQueries, b as DisplayListRegionHit, D as DisplayListRect } from '../../displayListQueries-DnHmHUPY.mjs';
5
- export { c as DisplayListHitRegion, d as DisplayListHoverTarget, e as DisplayListImageGeometry, f as DisplayListImageRegion, g as DisplayListParagraphGeometry, h as DisplayListQuerySourceState, i as DisplayListVerticalMove, j as DisplayListVisualLine, L as LocatedImagePrimitive, R as ResidentDisplayListQueryEngine, V as VisualLineExtent, k as captureInlinePositionEmuFromDisplayList, l as createDisplayListQueries, m as endDisplayListQueriesLine, n as findImagePrimitiveAtPoint, o as findImagePrimitiveByDocPos, p as isDisplayListQuerySourceDead, q as onDisplayListQuerySourceFailure } from '../../displayListQueries-DnHmHUPY.mjs';
6
- import { u as YrsLoc, v as YrsStorySegment, Y as YrsSession, w as YrsRevisionInfo } from '../../index-yOtBET85.mjs';
1
+ import { a as DisplayPage, G as GlyphRunPrimitive, L as LinePrimitive, T as TextRunPrimitive, b as DisplayPrimitive, D as DisplayList } from '../../frameDelta-CLeO7K5z.mjs';
2
+ export { c as DecodedFrameDelta, d as DecorationPrimitive, e as DisplayBounds, f as DocAttrs, F as FRAME_DELTA_HEADER_BYTES, g as FRAME_DELTA_PAGE_OP_BYTES, h as FRAME_DELTA_VERSION, i as FrameDeltaError, j as FrameDeltaErrorCode, k as FramePageOperation, H as HfRegion, I as ImagePrimitive, P as PositionedGlyph, l as RectPrimitive, R as RetainedFrame, m as RetainedFramePage, n as TableCellRef, o as applyFrameDelta, p as applyFrameDeltaOwned, q as decodeFrameDelta, r as decodeFrameDeltaSteps, s as displayPageNoteAnchorRevision, t as displayPageRevision } from '../../frameDelta-CLeO7K5z.mjs';
3
+ export { a as DisplayListBuildInputs, D as DisplayListHeadersFooters, b as DisplayListHfVariant, c as DisplayListPictureWatermark, d as DisplayListTextWatermark, e as DisplayListWatermark, f as RustDisplayFrameResult, g as RustDisplayListEngine, R as RustDisplayListQueryEngine, h as RustDisplayListSourceError, i as RustDisplayListSourceErrorStage, j as buildRustDisplayFrame, k as buildRustDisplayList, l as encodeDisplayListFrameExtras, m as loadRustDisplayListQueryEngine } from '../../rustDisplayList-B7uPoItK.mjs';
4
+ import { a as DisplayListQueries, b as DisplayListRegionHit, D as DisplayListRect } from '../../displayListQueries-BVBDVXoP.mjs';
5
+ export { c as DisplayListHitRegion, d as DisplayListHoverTarget, e as DisplayListImageGeometry, f as DisplayListImageRegion, g as DisplayListParagraphGeometry, h as DisplayListQuerySourceState, i as DisplayListVerticalMove, j as DisplayListVisualLine, L as LocatedImagePrimitive, R as ResidentDisplayListQueryEngine, V as VisualLineExtent, k as captureInlinePositionEmuFromDisplayList, l as createDisplayListQueries, m as endDisplayListQueriesLine, n as findImagePrimitiveAtPoint, o as findImagePrimitiveByDocPos, p as isDisplayListQuerySourceDead, q as onDisplayListQuerySourceFailure } from '../../displayListQueries-BVBDVXoP.mjs';
6
+ import { u as YrsLoc, v as YrsStorySegment, Y as YrsSession, w as YrsRevisionInfo } from '../../index-DzZVJC8-.mjs';
7
7
  import { TrackedChangeEntry } from '../../utils/comments.mjs';
8
8
  import '../../formatting-gqLFeJ9X.mjs';
9
- import '../../content-BzoC6bSz.mjs';
9
+ import '../../content-DSb-6a9T.mjs';
10
10
  import '../../docx/wrapTypes.mjs';
11
- import '../../types-Buyw6dFd.mjs';
11
+ import '../../types-Cz7S77Ut.mjs';
12
12
  import '../pagination/index.mjs';
13
13
  import '../../types/document.mjs';
14
14
  import '../../styles-AryxLAhx.mjs';
15
15
  import '../../pagedExport-BmSlEhoP.mjs';
16
16
  import '../../loadWasmAsset-Cr95TImt.mjs';
17
- import '../../rezip-Bxiq4Z_R.mjs';
18
17
  import '../../plugin-api/index.mjs';
18
+ import '../../rezip-Bxiq4Z_R.mjs';
19
19
 
20
20
  /** a cached glyph: its outline path (font units) plus the font's units-per-em. */
21
21
  interface GlyphOutline {
@@ -1 +1 @@
1
- import {f,g,e,d,c,B,x,z}from'../../chunk-4GEXNR7A.mjs';export{r as FRAME_DELTA_HEADER_BYTES,s as FRAME_DELTA_PAGE_OP_BYTES,q as FRAME_DELTA_VERSION,t as FrameDeltaError,a as GlyphCache,A as RustDisplayListSourceError,v as applyFrameDelta,w as applyFrameDeltaOwned,E as buildRustDisplayFrame,D as buildRustDisplayList,u as decodeFrameDelta,y as displayPageNoteAnchorRevision,x as displayPageRevision,o as drawDisplayPage,p as drawPrimitive,C as encodeDisplayListFrameExtras,b as fontSizePxFromShorthand,d as glyphRunRect,e as lineRect,B as loadRustDisplayListQueryEngine,i as presentDisplayPageBackBuffer,j as presentOffscreenPageBackBuffer,n as rasterizeDisplayListPages,h as rasterizeDisplayPageToBackBuffer,m as sizeCanvasForPage,c as textRunRect}from'../../chunk-4GEXNR7A.mjs';import {a}from'../../chunk-DKWD4P4J.mjs';export{b as createYrsSidebarProjection,a as yrsIdToNumericId}from'../../chunk-DKWD4P4J.mjs';export{b as DisplayPageRegistry,c as bindDisplayPageRegistry,e as displayPageCanvas,f as displayPageCanvases,a as effectiveZoom,d as materializeDisplayPages,h as resolveCanvasPoint,g as resolveDisplayPageClientRect}from'../../chunk-AOWJ4WDE.mjs';import {c as c$1}from'../../chunk-CTBUQRYQ.mjs';import'../../chunk-TTRUPDAB.mjs';var yt={pages:[{pageIndex:0,width:816,height:1056,primitives:[{kind:"rect",x:96,y:96,w:624,h:20,fill:"#fff9c4",blockId:0,docStart:1,docEnd:12},{kind:"text",text:"Hello Word",x:96,baselineY:110,width:84.5,font:"700 16px Calibri, sans-serif",color:"#000000",docStart:1,docEnd:11,blockId:0},{kind:"decoration",deco:"underline",x:96,y:113,w:84.5,h:1,color:"#000000",docStart:1,docEnd:11,blockId:0},{kind:"text",text:" \u2014 second run",x:180.5,baselineY:110,width:96.25,font:"400 16px Calibri, sans-serif",color:"#c0392b",docStart:11,docEnd:24,blockId:0},{kind:"line",x1:96,y1:140,x2:720,y2:140,strokeWidth:.75,color:"#666666",role:"table-border"},{kind:"image",relId:"rId7",x:96,y:160,w:200,h:120,docStart:30,docEnd:31,blockId:2}]}]};function $n(){return import('../../wasm-IBCLSJQU.mjs').then(async e=>(await e.preloadLayoutWasm(),e.outlineGlyphJson))}function Qn(e,t){for(let i of Array.from(e.querySelectorAll(".layout-canvas-sdt-box[data-sdt-group-id]")))i.classList.toggle("layout-sdt-focused",t.has(i.dataset.sdtGroupId??""));}var Wn=".layout-sdt-widget, .layout-inline-sdt-widget, .layout-sdt-repeat-btn",He=2,Ge=18,ue=16,Vn=2;function Kn(e,t={}){let i=t.document??document,r=i.createElement("div");r.className="layout-interactive-overlay",r.dataset.pageIndex=String(e.pageIndex),r.style.position="absolute",r.style.inset="0",r.style.width=`${e.width}px`,r.style.height=`${e.height}px`,r.style.pointerEvents="none",r.addEventListener("mousedown",n=>{n.target?.closest?.(Wn)&&(n.preventDefault(),n.stopPropagation());});for(let[n,l]of Ie(e).entries()){for(let o of l.boundaries){let a=ti(o,i,t.labels,l.lowerLayer);a.style.zIndex=String(n),r.appendChild(a);}for(let o of l.widgets){let a=ni(o,i,t.labels);a.style.zIndex=String(n),o.occluded&&fe(a),r.appendChild(a);}}return r}function Ie(e){let t=Un(e),i=t[3];return t.map((r,n)=>{let l=n<3,o=c=>({rect:c,occluded:l&&gt(i,c)}),a=[...qn(r).values()].sort(ei).map(c=>{let{kind:p,repeat:g}=oi(c.attrs),{rect:m}=c,y=m.x+Math.max(1,m.w)-He,h=m.y+Math.max(1,m.h)-He;return {...c,kind:p,widget:p?o({x:y-Ge,y:m.y+He,w:Ge,h:Ge}):void 0,repeats:g?[0,1].map(L=>o({x:y-ue-(1-L)*(ue+Vn),y:h-ue,w:ue,h:ue})):[]}}),s=[...Zn(r).values()].map(c=>({...c,occluded:l&&gt(i,c.rect)}));return {lowerLayer:l,boundaries:a,widgets:s}})}function gt(e,t){let i=t.x+Math.max(1,t.w)/2,r=t.y+Math.max(1,t.h)/2;return e.some(n=>{if("opacity"in n&&n.opacity!==void 0&&n.opacity<=0||n.clipGroup?.clip&&(n.clipGroup.opacity??1)<=0)return false;switch(n.kind){case "text":case "glyphRun":if(!n.text.trim()||Jn(n)||(n.rotationDeg??0)%360!==0||n.horizontalScale!==void 0&&!(n.horizontalScale>=100)||n.kind==="glyphRun"&&!n.glyphs.length)return false;break;case "rect":if(!n.fill||n.fill==="transparent"||n.fill==="none")return false;break;case "shape":{let o=n.fillPaint,a=o?.color??n.fill;if(o?.kind==="none")return false;if(o?.kind==="gradient"||o?.kind==="pattern")break;if(o?.kind==="picture"&&(o.pictureSrc||o.pictureRelId)){if((o.pictureOpacity??1)<=0)return false;let s=o.pictureStretchRect;if([s?.left,s?.top,s?.right,s?.bottom].some(p=>(p??0)>0)||!bt(o.pictureSrcRect))return false;break}if(!a||a==="transparent"||a==="none")return false;break}case "image":break;case "decoration":{let{color:o,style:a,dashed:s,dotted:c}=n;if((a??"solid")!=="solid"||s||c||!o||o==="transparent"||o==="none")return false;break}default:return false}let l=n.kind==="shape"?jn(n):n.kind==="image"?zn(n):f(n);return l!==null&&Number.isFinite(l.w)&&Number.isFinite(l.h)&&l.w>0&&l.h>0&&i>=l.x&&i<=l.x+l.w&&r>=l.y&&r<=l.y+l.h&&g(n,i,r)})}function zn(e){let t=(i,r)=>i!==void 0&&Number.isFinite(i)?i:r;return e.shapeType!==void 0&&e.shapeType!=="rect"||t(e.rotationDeg,0)%180!==0||!bt(e.crop)?null:{x:t(e.contentFrame?.x,e.x),y:t(e.contentFrame?.y,e.y),w:t(e.contentFrame?.w,e.w),h:t(e.contentFrame?.h,e.h)}}function bt(e){if(!e)return true;let t=o=>Number.isFinite(o)?o:0,[i,r,n,l]=[e.left,e.top,e.right,e.bottom].map(t);return i>=0&&r>=0&&n>=0&&l>=0&&i+n<1&&r+l<1}function jn(e){let t=e.transform?.rotation??0;if(!Number.isFinite(t)||t%180!==0)return null;let i=e.geometryPath,r=i.at(-1)?.type==="close"?i.length-1:i.length,n=[];for(let L=0;L<r;L++){let R=i[L];if(R.type!=="move"&&R.type!=="line"||R.type==="move"!=(L===0))return null;n.push([R.x,R.y]);}let l=n[0],o=n.at(-1);if(n.length===5&&l&&o&&l[0]===o[0]&&l[1]===o[1]&&n.pop(),n.length!==4)return null;let a=[...new Set(n.map(([L])=>L))],s=[...new Set(n.map(([,L])=>L))];if(a.length!==2||s.length!==2||new Set(n.map(([L,R])=>`${L},${R}`)).size!==4||!n.every(([L,R],k)=>{let[D,w]=n[(k+1)%4];return L===D!=(R===w)}))return null;let p=Math.min(...a),g=Math.min(...s),m=Math.abs(a[0]-a[1]),y=Math.abs(s[0]-s[1]),h=Math.abs(t%360)===180;return !!e.transform?.flipH!==h&&(p=2*e.x+e.w-p-m),!!e.transform?.flipV!==h&&(g=2*e.y+e.h-g-y),{x:p,y:g,w:m,h:y}}function Jn(e){return e.modernEffects?.textFill?.kind==="none"}function fe(e){e.style.visibility="hidden",e.style.pointerEvents="none",e.tabIndex=-1,e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),e.setAttribute("aria-disabled","true"),e.tagName==="BUTTON"&&(e.disabled=true);}function Un(e){let t=Math.min(e.watermarkPrimitiveCount??0,e.primitives.length);return [e.primitives.slice(0,t),e.header?.primitives??[],e.footer?.primitives??[],e.primitives.slice(t),...(e.noteAreas??[]).map(i=>[...i.separatorPrimitives??[],...i.primitives??[]])]}function qn(e){let t=new Map;for(let i of e){let r=xt(i);if(!r)continue;let n=i.sdtPath?.length?i.sdtPath:i.sdt?[i.sdt]:[];for(let l of n){let o=t.get(l.groupId);o?o.rect=Lt(o.rect,r):t.set(l.groupId,{attrs:l,rect:{...r}});}}return t}function Zn(e){let t=new Map;for(let i of e){let r=i.inlineSdtWidget,n=xt(i);if(!r||!n)continue;let l=`${r.groupId}:${r.pos}:${r.controlKind??r.kind}`,o=t.get(l);o?(o.rect=Lt(o.rect,n),o.primitives.push(i)):t.set(l,{attrs:r,rect:{...n},primitives:[i]});}return t}function ei(e,t){return (e.attrs.depth??0)-(t.attrs.depth??0)||e.rect.y-t.rect.y||e.rect.x-t.rect.x}function ti(e,t,i,r){let{attrs:n,rect:l,kind:o}=e,a=t.createElement("div");a.className="layout-block-sdt-box layout-canvas-sdt-box",li(a,n),vt(a,l),a.style.pointerEvents="none";let s=n.alias||n.tag;if(s){let c=t.createElement("span");c.className="layout-block-sdt-label",c.textContent=s,a.appendChild(c);}if(o){let c=t.createElement("button");c.type="button",c.className="layout-sdt-widget",c.dataset.sdtWidget=o,c.dataset.sdtGroupId=n.groupId,n.tag&&(c.dataset.sdtTag=n.tag),n.alias&&(c.dataset.sdtAlias=n.alias),(s||i?.control)&&c.setAttribute("aria-label",s||i?.control||""),o==="dropdown"&&c.setAttribute("aria-haspopup","listbox"),o==="date"&&c.setAttribute("aria-haspopup","dialog"),o==="checkbox"&&(c.setAttribute("role","checkbox"),c.setAttribute("aria-checked",String(n.checked??false))),c.textContent=o==="dropdown"?"\u25BE":o==="date"?"\u25A3":n.checked?"\u2612":"\u2610",c.style.pointerEvents="auto",e.widget?.occluded&&fe(c),a.appendChild(c);}if(e.repeats.length){let c=t.createElement("div");c.className="layout-sdt-repeat-controls",c.style.pointerEvents=r?"none":"auto";let p=[ht(t,n,"add","\uFF0B",i?.addRepeatingItem,s),ht(t,n,"remove","\u2715",i?.removeRepeatingItem,s)];for(let[g,m]of p.entries()){let y=e.repeats[g];r&&(m.style.pointerEvents="auto"),y.occluded&&fe(m),c.appendChild(m);}a.appendChild(c);}return a}function ht(e,t,i,r,n,l){let o=e.createElement("button");return o.type="button",o.className="layout-sdt-repeat-btn",o.dataset.sdtRepeat=i,o.dataset.sdtGroupId=t.groupId,t.tag&&(o.dataset.sdtTag=t.tag),(n||l)&&o.setAttribute("aria-label",n||l||""),o.textContent=r,o}function ni(e,t,i){let{attrs:r,rect:n}=e,l=r.controlKind??r.kind,o=t.createElement("button");return o.type="button",o.className="layout-sdt-widget layout-inline-sdt-widget layout-canvas-inline-sdt-widget",o.dataset.sdtWidget=ii(l),o.dataset.sdtGroupId=r.groupId,o.dataset.sdtPos=String(r.pos),r.tag&&(o.dataset.sdtTag=r.tag),r.alias&&(o.dataset.sdtAlias=r.alias),r.controlId!==void 0&&(o.dataset.sdtControlId=String(r.controlId)),r.value!==void 0&&(o.dataset.sdtValue=r.value),r.selectedIndex!==void 0&&(o.dataset.sdtSelectedIndex=String(r.selectedIndex)),r.dateFormat&&(o.dataset.sdtDateFormat=r.dateFormat),r.dateLanguage&&(o.dataset.sdtDateLanguage=r.dateLanguage),r.listItems?.length&&(o.dataset.sdtListItems=JSON.stringify(r.listItems)),(r.alias||r.tag||i?.control)&&o.setAttribute("aria-label",r.alias||r.tag||i?.control||""),l==="checkbox"?(o.setAttribute("role","checkbox"),o.setAttribute("aria-checked",String(r.checked??false))):l==="dropDownList"||l==="comboBox"?(o.setAttribute("aria-haspopup","listbox"),o.setAttribute("aria-expanded","false")):l==="date"&&o.setAttribute("aria-haspopup","dialog"),o.disabled=r.locked===true,o.textContent=l==="checkbox"?r.checked?"\u2612":"\u2610":l==="date"?"\u25A3":l==="picture"?"\u25A7":"\u25BE",vt(o,n),o.style.pointerEvents="auto",o}function ii(e){return e==="dropDownList"||e==="comboBox"?"dropdown":e}function ri(e){return e==="checkbox"?"checkbox":e==="dropDownList"||e==="comboBox"?"dropdown":e==="date"?"date":null}function oi(e){let t=!e.bound&&!si(e.lock);return {kind:t?ri(e.sdtType):null,repeat:!!e.repeatingItem&&t}}function ai(e){for(let t of Ie(e)){for(let i of t.boundaries)if(i.widget&&!i.widget.occluded||i.repeats.some(r=>!r.occluded))return true;for(let i of t.widgets)if(!i.occluded&&i.attrs.locked!==true)return true}return false}function si(e){return e==="contentLocked"||e==="sdtContentLocked"||e==="sdtLocked"}function li(e,t){e.dataset.sdtGroupId=t.groupId,e.dataset.sdtType=t.sdtType,t.depth!==void 0&&(e.dataset.sdtDepth=String(t.depth)),t.tag&&(e.dataset.sdtTag=t.tag),t.alias&&(e.dataset.sdtAlias=t.alias),t.lock&&(e.dataset.sdtLock=t.lock),t.checked!==void 0&&(e.dataset.sdtChecked=String(t.checked)),t.bound!==void 0&&(e.dataset.sdtBound=String(t.bound)),t.repeatingItem!==void 0&&(e.dataset.sdtRepeatingItem=String(t.repeatingItem));}function xt(e$1){let t=e$1.clipGroup?.clip;if(t?.x!==void 0&&t.y!==void 0&&t.w!==void 0&&t.h!==void 0)return {x:t.x,y:t.y,w:t.w,h:t.h};switch(e$1.kind){case "text":return c(e$1);case "glyphRun":return d(e$1);case "rect":return {x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h};case "line":return e(e$1);case "image":case "shape":return {x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h};case "decoration":return {x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h}}}function Lt(e,t){let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),n=Math.max(e.x+e.w,t.x+t.w),l=Math.max(e.y+e.h,t.y+t.h);return {x:i,y:r,w:n-i,h:l-r}}function vt(e,t){e.style.position="absolute",e.style.left=`${t.x}px`,e.style.top=`${t.y}px`,e.style.width=`${Math.max(1,t.w)}px`,e.style.height=`${Math.max(1,t.h)}px`;}var v={page:"layout-page layout-page-mirror",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer",block:"layout-paragraph",table:"layout-table",tableRow:"layout-table-row",tableCell:"layout-table-cell",text:"layout-run layout-run-text",rect:"layout-mirror-rect",image:"layout-run layout-run-image",shape:"layout-run layout-run-shape",chart:"layout-run layout-run-chart",decoration:"layout-decoration",line:"layout-mirror-line",pageBorder:"layout-page-border",tableCut:"layout-table-cut-border",blockSdt:"layout-block-sdt",inlineSdtWidget:"layout-inline-sdt-widget",revisionPmark:"layout-revision-pmark",revisionPmarkGlyph:"layout-revision-pmark-glyph",revisionPmarkIns:"layout-revision-ins",revisionPmarkDel:"layout-revision-del",listMarker:"layout-list-marker",revisionTable:"oox-revision-table",revisionRow:"oox-revision-row",revisionCell:"oox-revision-cell",revisionIns:"oox-revision-ins",revisionDel:"oox-revision-del",revisionMerge:"oox-revision-merge",notes:"layout-page-notes",note:"layout-note",noteBacklink:"layout-note-backlink"};function Ye(e){return [...e.primitives,...e.header?.primitives??[],...e.footer?.primitives??[],...(e.noteAreas??[]).flatMap(t=>[...t.separatorPrimitives??[],...t.primitives??[]])]}function ci(e){return e.kind==="image"?!!e.href:(e.kind==="text"||e.kind==="glyphRun")&&(!!e.href||e.noteRef?.id!==void 0)}function Mt(e,t){let i=`${e.kind??"footnote"}-${t}`;return (e.notes??[]).some(r=>r.id===t)&&(e.primitives??[]).some(r=>r.groupId===i)}function di(e){return Ye(e).some(t=>t.cell?.isHeader===true)}function ui(e){return Ye(e).some(ci)||(e.noteAreas??[]).some(t=>(t.noteIds??[]).some(i=>Mt(t,i)))}var Pt=["aria-labelledby","aria-describedby"],fi=Pt.map(e=>`[${e}]`).join(", "),_e=`.${v.tableCell}`,pi=`${_e}[role="columnheader"]`;function Et(e){let t=new Map;for(let o of e.querySelectorAll("[id]"))t.set(o.id,o);let i=o=>{let a=o;for(let s=o.closest(_e);s&&e.contains(s);s=s.parentElement?.closest(_e)??null)a=s;return a},r=new Set,n=new Set([e]),l=Array.from(e.querySelectorAll(`a[href], .${v.note}, ${pi}`));for(;l.length>0;){let o=i(l.pop());if(r.has(o))continue;r.add(o);let a=[o,...o.querySelectorAll(fi)];for(let s=o.parentElement;s&&!n.has(s);s=s.parentElement)n.add(s),a.push(s);for(let s of a)for(let c of Pt)for(let p of s.getAttribute(c)?.split(/\s+/)??[]){let g=t.get(p);g&&!r.has(g)&&l.push(g);}}return {kept:r,onPath:n}}function Tt(e){let{kept:t,onPath:i}=Et(e),r=n=>{for(let l of Array.from(n.childNodes))t.has(l)||(i.has(l)?r(l):l.remove());};return r(e),e}function mi(e,t={}){return Tt(Xe(e,t))}var yi=["layout-page-mirror",v.content,v.header,v.footer,v.block,v.table,v.tableRow,v.tableCell,v.notes,v.blockSdt];function gi(e,t){let i=e.ownerDocument,r=e.getAttribute("lang"),n=e.getAttribute("dir"),l=e.parentElement,o=(s,c)=>c!==null&&l?.closest(`[${s}]`)?.getAttribute(s)!==c;if(!o("lang",r)&&!o("dir",n))return i.createTextNode(t);let a=i.createElement("span");return r&&a.setAttribute("lang",r),n&&a.setAttribute("dir",n),a.textContent=t,a}function At(e){let{kept:t,onPath:i}=Et(e),r=n=>{if(t.has(n))return;if(!i.has(n)||n===e&&t.size===0)for(let o of Array.from(n.attributes))(o.name==="id"||o.name.startsWith("data-"))&&n.removeAttribute(o.name);if(!(n===e||!n.classList.contains("layout-run")&&yi.some(o=>n.classList.contains(o)))&&!i.has(n)){if(n.classList.contains(v.revisionPmarkGlyph)||n.getAttribute("aria-hidden")==="true"||n.hasAttribute("inert")||n.style?.visibility==="hidden"){n.remove();return}let o=n.getAttribute("role")==="img"||!!n.getAttribute("alt"),a=o||!!n.getAttribute("aria-label");if(n.children.length===0){n.textContent&&!o?n.replaceWith(gi(n,n.textContent)):a||n.remove();return}}for(let o of Array.from(n.children))r(o);for(let o of Array.from(n.childNodes))if(o.nodeType===3){for(;o.nextSibling?.nodeType===3;){let a=o.nextSibling;o.textContent=(o.textContent??"")+(a.textContent??""),a.remove();}o.textContent||o.remove();}};return r(e),e.style.contentVisibility="auto",e}function hi(e,t={}){return At(Xe(e,t))}function bi(e,t){let i=/^oox-(footnote|endnote)-(.+)$/.exec(t);if(i){let[,o,a]=i;return (e.noteAreas??[]).some(s=>(s.kind??"footnote")===o&&(s.noteIds??[]).some(c=>String(c)===a)&&(s.primitives??[]).some(c=>c.groupId===`${o}-${a}`))}let r=/^oox-noteref-(footnote|endnote)-(.+)$/.exec(t);if(!r)return false;let[,n,l]=r;return Ye(e).some(o=>(o.kind==="text"||o.kind==="glyphRun")&&!o.href&&o.noteRef?.id!==void 0&&String(o.noteRef.id)===l&&(o.noteRef.kind??"footnote")===n)}function Xe(e,t={}){let i=t.document??document,r=t.labels,n=new Set(Ie(e).flatMap(s=>s.widgets.filter(c=>c.occluded).flatMap(c=>c.primitives))),l={labels:r,noteRefIds:new Set,occludedWidgets:n},o=i.createElement("div");o.className=v.page,o.setAttribute("role","document"),r?.page&&o.setAttribute("aria-label",r.page),o.dataset.pageIndex=String(e.pageIndex),e.sectionId!==void 0&&(o.dataset.sectionId=e.sectionId),e.sectionIndex!==void 0&&(o.dataset.sectionIndex=String(e.sectionIndex)),e.sectionPageIndex!==void 0&&(o.dataset.sectionPageIndex=String(e.sectionPageIndex)),e.sectionPageNumber!==void 0&&(o.dataset.sectionPageNumber=String(e.sectionPageNumber)),e.pageLabel!==void 0&&(o.dataset.pageLabel=e.pageLabel),o.style.position="relative",o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,o.style.opacity="0",o.style.pointerEvents="none";let a=i.createElement("div");a.className=v.content,a.style.position="absolute",a.style.left="0",a.style.top="0",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,o.appendChild(a);for(let s of (e.pageBorders??[]).filter(c=>c.zOrder==="back"))a.appendChild(It(s,i,0));pe(a,e.primitives,i,0,l);for(let s of e.noteAreas??[])a.appendChild(Ei(s,e,i,l));for(let s of [e.header,e.footer])s&&o.appendChild(xi(s,e,i,l));for(let s of (e.pageBorders??[]).filter(c=>c.zOrder!=="back"))o.appendChild(It(s,i,0));return o}function xi(e,t,i,r){let n=i.createElement("div");n.className=e.kind==="header"?v.header:v.footer,n.dataset.hfRid=e.rId;let l=e.kind==="header"?r.labels?.header:r.labels?.footer;return l&&(n.setAttribute("role","region"),n.setAttribute("aria-label",l)),n.style.position="absolute",n.style.left="0",n.style.top=`${e.y}px`,n.style.width=`${t.width}px`,n.style.height=`${e.height}px`,pe(n,e.primitives,i,-e.y,r),n}function pe(e,t,i,r,n){let l=new Map;for(let o of t){let a=o.kind==="line"?void 0:o.blockKey??o.blockId;if(a===void 0){e.appendChild(Me(o,i,r,n));continue}let s=o.table,c=s?.tableId!==void 0?`table:${s.tableId}#${s.rowStart??0}`:a,p=l.get(c);if(!p){let g=i.createElement("div");g.dataset.blockId=String(s?.tableId??a),g.style.position="absolute",g.style.left="0",g.style.top="0",e.appendChild(g),p={el:g,prims:[]},l.set(c,p);}p.prims.push(o);}for(let o of l.values())Li(o,i,r,n);Di(l);}function Li(e,t,i,r){let{el:n,prims:l}=e;if(!l.some(m=>m.cell!==void 0||m.structuralRevision?.scope==="table"||m.structuralRevision?.scope==="row"||m.structuralRevision?.scope==="cell")){Rt(n,l,t,i,r);return}n.className=v.table,n.setAttribute("role","table");let a=l.find(m=>m.table!==void 0)?.table;e.table=a,e.cells=[],a?.tableId!==void 0&&(n.dataset.tableId=a.tableId),a?.rowStart!==void 0&&(n.dataset.rowStart=String(a.rowStart)),a?.rowEnd!==void 0&&(n.dataset.rowEnd=String(a.rowEnd)),a?.headerRowCount!==void 0&&(n.dataset.headerRowCount=String(a.headerRowCount)),a?.parentTableId!==void 0&&(n.dataset.parentTableId=a.parentTableId),a?.caption&&n.setAttribute("aria-label",a.caption),a?.description&&n.setAttribute("aria-description",a.description);let s=ke(l,"table");s&&we(n,s),We(n,l.find(m=>m.sdt!==void 0)?.sdt);for(let m of l)m.cell===void 0&&n.appendChild(Me(m,t,i,r));let c=new Map,p=0,g=0;for(let m of l){if(m.cell===void 0)continue;let{row:y,col:h}=m.cell;p=Math.max(p,y+(m.cell.rowSpan??1)),g=Math.max(g,h+(m.cell.colSpan??1));let L=c.get(y);L||(L=new Map,c.set(y,L));let R=L.get(h);R||(R={ref:m.cell,prims:[]},L.set(h,R)),R.prims.push(m);}n.setAttribute("aria-rowcount",String(a?.rowCount??p)),n.setAttribute("aria-colcount",String(a?.columnCount??g));for(let m of [...c.keys()].sort((y,h)=>y-h)){let y=t.createElement("div");y.className=v.tableRow,y.setAttribute("role","row"),y.setAttribute("aria-rowindex",String(m+1));let h=ke(l,"row",m);h&&we(y,h),y.style.position="absolute",y.style.left="0",y.style.top="0",n.appendChild(y);let L=c.get(m);for(let R of [...L.keys()].sort((k,D)=>k-D)){let k=L.get(R),D=t.createElement("div");D.className=v.tableCell,D.setAttribute("role",k.ref.isHeader?"columnheader":"cell"),D.setAttribute("aria-colindex",String(R+1)),k.ref.cellId&&(D.id=k.ref.cellId),k.ref.headerIds?.length&&D.setAttribute("aria-labelledby",k.ref.headerIds.join(" ")),k.ref.repeatedHeader&&(D.dataset.repeatedHeader="true"),k.ref.noWrap&&(D.dataset.noWrap="true");let w=k.ref.rowSpan??1,A=k.ref.colSpan??1;w>1&&D.setAttribute("aria-rowspan",String(w)),A>1&&D.setAttribute("aria-colspan",String(A));let P=ke(k.prims,"cell",m,R);P&&we(D,P),k.ref.continuation&&(D.dataset.vmergeContinuation="true"),D.style.position="absolute",D.style.left="0",D.style.top="0";let C=new Map,F=[];for(let H of k.prims){let G=H.blockKey??H.blockId;if(G===void 0){F.push(H);continue}let N=C.get(G);N?N.push(H):C.set(G,[H]);}for(let H of $e(F))D.appendChild(Me(H,t,i,r));for(let[H,G]of C){let N=t.createElement("div");N.dataset.blockId=String(H),N.style.position="absolute",N.style.left="0",N.style.top="0",Rt(N,G,t,i,r),D.appendChild(N);}Ri(D,k.prims),Bt(D,k.prims),e.cells.push({el:D,bounds:Ct(k.prims)}),y.appendChild(D);}}Qe(n,l);}function Rt(e,t,i,r,n){let l=t.find(c=>c.chart!==void 0)?.chart;e.className=l?`${v.block} ${v.chart}`:v.block,e.setAttribute("role",l?"img":"paragraph"),l?.label&&e.setAttribute("aria-label",l.label);for(let c of $e(t))e.appendChild(Me(c,i,r,n));let o=ke(t,"pmark");o&&we(e,o),vi(e,t,i,r),We(e,t.find(c=>c.sdt!==void 0)?.sdt);let a=t.find(c=>c.paraId!==void 0)?.paraId;a!==void 0&&(e.dataset.paraId=a);let s=t.find(c=>c.fromLine!==void 0);s?.fromLine!==void 0&&(e.dataset.fromLine=String(s.fromLine),s.toLine!==void 0&&(e.dataset.toLine=String(s.toLine))),Bt(e,t),Si(e,t);}function vi(e,t,i,r){Qe(e,t);let n=Number(e.dataset.docStart),l=Number(e.dataset.docEnd),o=t.map(g=>g.fragmentDocStart).filter(g=>Number.isFinite(g)),a=t.map(g=>g.fragmentDocEnd).filter(g=>Number.isFinite(g)),s=o.length>0?Math.min(...o):void 0,c=a.length>0?Math.max(...a):void 0,p=s??(Number.isFinite(n)&&n===l&&n>0?n-1:void 0);if(p!==void 0&&(e.dataset.docStart=String(p)),c!==void 0&&(e.dataset.docEnd=String(c)),p!==void 0&&!t.some(g=>g.docStart===p)){let g=$e(t).find(y=>Fe(y)!==void 0),m=g?Fe(g):void 0;if(m){let y=i.createElement("span");y.className="layout-mirror-structural-anchor",y.dataset.docStart=String(p),y.dataset.docEnd=String(p),ee(y,m,r),e.insertBefore(y,e.firstChild);}}}function Ri(e,t){let i=e.querySelectorAll(".layout-paragraph[data-doc-start]"),r=1/0,n=-1/0;for(let l of i){let o=Number(l.dataset.docStart),a=Number(l.dataset.docEnd);Number.isFinite(o)&&(r=Math.min(r,o)),Number.isFinite(a)&&(n=Math.max(n,a));}r!==1/0&&(e.dataset.docStart=String(r)),n!==-1/0&&(e.dataset.docEnd=String(n)),r===1/0&&n===-1/0&&Qe(e,t);}function Di(e){let t=new Map;for(let i of e.values())i.table?.tableId&&t.set(i.table.tableId,i);for(let i of e.values()){let r=i.table?.parentTableId;if(!r)continue;let n=t.get(r),l=Ct(i.prims);if(!n?.cells?.length||!l)continue;let o=l.x+l.w/2,a=l.y+l.h/2,s=n.cells.filter(c=>c.bounds&&Ii(o,a,c.bounds));s.sort((c,p)=>Dt(c.bounds)-Dt(p.bounds)),s[0]?.el.appendChild(i.el);}}function Ii(e,t,i){return e>=i.x&&e<=i.x+i.w&&t>=i.y&&t<=i.y+i.h}function Dt(e){return e.w*e.h}function Ct(e){let t;for(let i of e){let r=i.clipGroup?.clip,n=r?.x!==void 0&&r.y!==void 0&&r.w!==void 0&&r.h!==void 0?{x:r.x,y:r.y,w:r.w,h:r.h}:Fe(i);if(!n)continue;if(!t){t={...n};continue}let l=Math.max(t.x+t.w,n.x+n.w),o=Math.max(t.y+t.h,n.y+n.h);t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),t.w=l-t.x,t.h=o-t.y;}return t}function Fe(e){switch(e.kind){case "text":return c(e);case "glyphRun":return d(e);case "rect":return {x:e.x,y:e.y,w:e.w,h:e.h};case "image":case "shape":return {x:e.x,y:e.y,w:e.w,h:e.h};case "decoration":return {x:e.x,y:e.y,w:e.w,h:e.h}}}function $e(e){let t=e.filter(r=>r.logicalOrder!==void 0).sort((r,n)=>(r.logicalOrder??0)-(n.logicalOrder??0)||(r.docStart??0)-(n.docStart??0));if(t.length<2)return e;let i=0;return e.map(r=>r.logicalOrder===void 0?r:t[i++])}function Bt(e,t){let i=t.find(l=>l.lang)?.lang;i&&(e.lang=i);let r=t.find(l=>l.bidiLevel!==void 0||"rtl"in l);if(!r)return;let n=r.bidiLevel!==void 0?r.bidiLevel%2===1:"rtl"in r?r.rtl:false;e.dir=n?"rtl":"ltr";}function Si(e,t){let i=t.find(r=>r.ariaLabel||r.ariaDescription||r.decorative||r.hiddenObject||r.groupId);i&&Gt(e,i);}function Qe(e,t){let i,r;for(let n of t)n.docStart!==void 0&&(i=i===void 0?n.docStart:Math.min(i,n.docStart)),n.docEnd!==void 0&&(r=r===void 0?n.docEnd:Math.max(r,n.docEnd));i!==void 0&&(e.dataset.docStart=String(i)),r!==void 0&&(e.dataset.docEnd=String(r));}function ke(e,t,i,r){return e.find(n=>{let l=n.structuralRevision;return !(!l||l.scope!==t||i!==void 0&&l.rowIndex!==i||r!==void 0&&l.colIndex!==r)})?.structuralRevision}function Me(e,t,i,r){let n=ki(e,t,i,r);return r.occludedWidgets.has(e)&&fe(n),n}function ki(e$1,t,i,r){switch(e$1.kind){case "text":{let n=St(t,e$1,r);return n.className=v.text,n.textContent=e$1.text,ee(n,c(e$1),i),n.style.font=e$1.font,kt(n,e$1),wt(n,e$1),Ne(n,e$1.hidden&&e$1.opacity===void 0?.4:e$1.opacity,e$1.rotationDeg,e$1.horizontalScale),e$1.structuralRevision?.scope==="pmark"&&(n.classList.add(v.revisionPmarkGlyph),e$1.structuralRevision.kind==="ins"&&n.classList.add(v.revisionPmarkIns),e$1.structuralRevision.kind==="del"&&n.classList.add(v.revisionPmarkDel),n.setAttribute("aria-hidden","true")),e$1.listMarker&&(n.classList.add(v.listMarker),n.setAttribute("aria-hidden","true"),e$1.listMarkerRevision&&(n.style.color=e$1.listMarkerRevision==="ins"?"rgb(46, 125, 50)":"rgb(198, 40, 40)")),ae(n,e$1),n}case "glyphRun":{let n=St(t,e$1,r);return n.className=v.text,n.textContent=e$1.text,ee(n,d(e$1),i),n.style.fontSize=`${e$1.size}px`,wi(n,e$1.fallbackFont),kt(n,e$1),wt(n,e$1),Ne(n,e$1.hidden&&e$1.opacity===void 0?.4:e$1.opacity,e$1.rotationDeg,e$1.horizontalScale),ae(n,e$1),n}case "rect":{let n=t.createElement("div");return n.className=v.rect,ee(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},i),ae(n,e$1),n}case "line":{let n=t.createElement("div");return n.className=e$1.role==="table-cut"?v.tableCut:v.line,e$1.role&&e$1.role!=="table-cut"&&(n.dataset.role=e$1.role),ee(n,e(e$1),i),n.setAttribute("aria-hidden","true"),n}case "image":{let n=e$1.href?t.createElement("a"):t.createElement("div");return n.className=v.image,e$1.decorative?n.setAttribute("aria-hidden","true"):(n.setAttribute("role","img"),e$1.altText&&n.setAttribute("aria-label",e$1.altText)),Ht(n,e$1),n.dataset.relId=e$1.relId,ee(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},i),Ne(n,e$1.opacity,e$1.rotationDeg),e$1.filter&&(n.style.filter=e$1.filter),ae(n,e$1),e$1.revision&&(n.style.outline=`2px solid ${e$1.revision.kind==="ins"?"rgb(46, 125, 50)":"rgb(198, 40, 40)"}`),e$1.href||(n.style.pointerEvents="auto"),n}case "shape":{let n=t.createElement("div");return n.className=v.shape,e$1.decorative?n.setAttribute("aria-hidden","true"):n.setAttribute("role","img"),ee(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},i),Mi(n,e$1.transform),ae(n,e$1),n}case "decoration":{let n=t.createElement("span");return n.className=v.decoration,n.dataset.deco=e$1.deco,ee(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},i),ae(n,e$1),n}}}function It(e,t,i){let r=t.createElement("div");return r.className=v.pageBorder,ee(r,{x:e.x,y:e.y,w:e.w,h:e.h},i),r.style.boxSizing="border-box",r.style.pointerEvents="none",r.style.zIndex=e.zOrder==="back"?"0":"20",Se(r,"Top",e.top),Se(r,"Right",e.right),Se(r,"Bottom",e.bottom),Se(r,"Left",e.left),r}function ee(e,t,i=0){e.style.position="absolute",e.style.left=`${t.x}px`,e.style.top=`${t.y+i}px`,e.style.width=`${t.w}px`,e.style.height=`${t.h}px`;}function St(e,t,i){let r=t.noteRef?.id!==void 0?t.noteRef:void 0,n=t.href||r?e.createElement("a"):e.createElement("span");if(Ht(n,t),r&&!t.href){let l=r.kind??"footnote",o=`oox-${l}-${r.id}`;n.setAttribute("href",`#${o}`),n.setAttribute("role","doc-noteref");let a=`oox-noteref-${l}-${r.id}`;i.noteRefIds.has(a)||(i.noteRefIds.add(a),n.id=a);}return n}function Ht(e,t){let{href:i}=t;if(!i)return;e.setAttribute("href",i),e.dataset.href=i;let r=t.linkTitle??t.tooltip;r&&(e.title=r),t.linkTarget?e.setAttribute("target",t.linkTarget):i.startsWith("#")||e.setAttribute("target","_blank"),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer"),t.linkHistory!==void 0&&(e.dataset.linkHistory=String(t.linkHistory)),t.linkDocLocation!==void 0&&(e.dataset.linkDocLocation=t.linkDocLocation);}function wi(e,t){if(t)for(let i of t.split(" ")){if(i.endsWith("px"))break;i==="italic"?e.style.fontStyle="italic":/^[1-9]00$/.test(i)&&i!=="400"&&(e.style.fontWeight=i);}}function kt(e,t){t.lang&&(e.lang=t.lang),t.bidiLevel!==void 0?e.dir=t.bidiLevel%2===1?"rtl":"ltr":t.rtl&&(e.dir="rtl");}function Se(e,t,i){if(!i)return;let r=e.style;r[`border${t}Width`]=`${i.width}px`,r[`border${t}Style`]=i.style,r[`border${t}Color`]=i.color;}function Ne(e,t,i,r){t!==void 0&&(e.style.opacity=String(t));let n=[];i&&n.push(`rotate(${i}deg)`),r!==void 0&&r!==100&&n.push(`scaleX(${r/100})`),n.length>0&&(e.style.transform=n.join(" "),e.style.transformOrigin=r!==void 0&&r!==100?"left center":"center center");}function Mi(e,t){if(!t)return;let i=[];t.rotation&&i.push(`rotate(${t.rotation}deg)`),t.flipH&&i.push("scaleX(-1)"),t.flipV&&i.push("scaleY(-1)"),i.length!==0&&(e.style.transform=i.join(" "),e.style.transformOrigin="center center");}function wt(e,t){if(t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.hidden&&(e.classList.add("docx-hidden"),e.style.textDecoration="underline dotted"),t.textShadow==="emboss"?e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)":t.textShadow==="imprint"?e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)":t.textShadow==="shadow"&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let i=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",r=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=i,e.style.textEmphasisPosition=r,e.style.webkitTextEmphasis=i,e.style.webkitTextEmphasisPosition=r;}t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function ae(e,t){if(t.docStart!==void 0&&(e.dataset.docStart=String(t.docStart)),t.docEnd!==void 0&&(e.dataset.docEnd=String(t.docEnd)),t.commentIds&&t.commentIds.length>0&&(e.dataset.commentId=t.commentIds.join(" ")),t.field){let i=t.field.type??t.field.category;i&&(e.dataset.fieldType=i),t.field.category&&(e.dataset.fieldCategory=t.field.category),t.field.instruction&&(e.dataset.fieldInstruction=t.field.instruction);let r=t.field.instruction?.trim()||i;r&&e.setAttribute("aria-description",r);}if(t.noteRef?.id!==void 0&&(e.dataset.noteRefKind=t.noteRef.kind??"footnote",e.dataset.noteRefId=String(t.noteRef.id)),t.comment){t.comment.status&&(e.dataset.commentStatus=t.comment.status),t.comment.authorId&&(e.dataset.commentAuthorId=t.comment.authorId),t.comment.paletteIndex!==void 0&&(e.dataset.commentPaletteIndex=String(t.comment.paletteIndex)),t.comment.color&&(e.dataset.commentColor=t.comment.color),t.comment.selected!==void 0&&(e.dataset.commentSelected=String(t.comment.selected)),t.comment.authorName&&(e.dataset.commentAuthorName=t.comment.authorName),t.comment.date&&(e.dataset.commentDate=t.comment.date),t.comment.replyCount!==void 0&&(e.dataset.commentReplyCount=String(t.comment.replyCount));let i=[t.comment.status,t.comment.authorName??t.comment.authorId,t.comment.date,t.comment.text,...(t.comment.replies??[]).map(r=>[r.authorName,r.text].filter(Boolean).join(": "))].filter(Boolean).join(", ");i&&e.setAttribute("aria-description",i);}if(t.revision){e.dataset.changeAuthor=t.revision.author,e.dataset.changeDate=t.revision.date,e.dataset.revisionId=t.revision.revisionId,e.classList.add(t.revision.kind==="ins"?"docx-insertion":"docx-deletion"),e.hasAttribute("role")||e.setAttribute("role",t.revision.kind==="ins"?"insertion":"deletion");let i=[t.revision.author,t.revision.date].filter(Boolean).join(", ");i&&e.setAttribute("aria-description",i);}t.href&&(e.dataset.href=t.href),Pi(e,t.inlineSdtWidget),We(e,t.sdt),t.sdtPath?.length&&(e.dataset.sdtPath=t.sdtPath.map(i=>i.groupId).join(" ")),t.logicalOrder!==void 0&&(e.dataset.logicalOrder=String(t.logicalOrder)),t.bidiLevel!==void 0&&(e.dataset.bidiLevel=String(t.bidiLevel)),Gt(e,t);}function Gt(e,t){if(t.groupId&&(e.dataset.groupId=t.groupId),t.decorative||t.hiddenObject){e.setAttribute("aria-hidden","true"),e.removeAttribute("role"),e.removeAttribute("aria-label"),e.removeAttribute("aria-description");return}t.ariaLabel&&e.setAttribute("aria-label",t.ariaLabel),t.ariaDescription&&e.setAttribute("aria-description",t.ariaDescription);}function We(e,t){t&&(e.classList.add(v.blockSdt),e.dataset.sdtGroupId=t.groupId,e.dataset.sdtType=t.sdtType,t.depth!==void 0&&(e.dataset.sdtDepth=String(t.depth)),t.tag!==void 0&&(e.dataset.sdtTag=t.tag),t.alias!==void 0&&(e.dataset.sdtAlias=t.alias),t.lock!==void 0&&(e.dataset.sdtLock=t.lock),t.checked!==void 0&&(e.dataset.sdtChecked=String(t.checked)),t.bound!==void 0&&(e.dataset.sdtBound=String(t.bound)),t.repeatingItem!==void 0&&(e.dataset.sdtRepeatingItem=String(t.repeatingItem)),!e.hasAttribute("aria-label")&&(t.alias||t.tag)&&e.setAttribute("aria-label",t.alias||t.tag||""),t.lock&&e.setAttribute("aria-readonly","true"));}function Pi(e,t){if(!t)return;e.classList.add(v.inlineSdtWidget);let i=t.controlKind??t.kind;e.dataset.sdtWidget=i,e.dataset.sdtGroupId=t.groupId,e.dataset.sdtPos=String(t.pos),t.tag!==void 0&&(e.dataset.sdtTag=t.tag),t.alias!==void 0&&(e.dataset.sdtAlias=t.alias),t.checked!==void 0&&(e.dataset.sdtChecked=String(t.checked),e.setAttribute("aria-checked",String(t.checked))),t.controlId!==void 0&&(e.dataset.sdtControlId=String(t.controlId)),t.value!==void 0&&(e.dataset.sdtValue=t.value),t.selectedIndex!==void 0&&(e.dataset.sdtSelectedIndex=String(t.selectedIndex)),t.dateFormat!==void 0&&(e.dataset.sdtDateFormat=t.dateFormat),t.dateLanguage!==void 0&&(e.dataset.sdtDateLanguage=t.dateLanguage),t.locked!==void 0&&(e.dataset.sdtLocked=String(t.locked)),i==="checkbox"?e.setAttribute("role","checkbox"):i==="dropDownList"||i==="comboBox"?(e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","false")):i==="date"?(e.setAttribute("role","button"),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("role","group"),e.removeAttribute("tabindex"),(t.alias||t.tag)&&e.setAttribute("aria-label",t.alias||t.tag||""),t.locked&&e.setAttribute("aria-disabled","true");}function we(e,t){switch(t.scope){case "pmark":e.classList.add(v.revisionPmark),t.kind==="ins"&&e.classList.add(v.revisionPmarkIns),t.kind==="del"&&e.classList.add(v.revisionPmarkDel);break;case "table":e.classList.add(v.revisionTable,Oe(t.kind));break;case "row":e.classList.add(v.revisionRow,Oe(t.kind));break;case "cell":e.classList.add(v.revisionCell,Oe(t.kind));break}e.dataset.revisionId=t.revisionId,e.dataset.revisionAuthor=t.author,t.date&&(e.dataset.revisionDate=t.date);let i=[t.author,t.date].filter(Boolean).join(", ");i&&e.setAttribute("aria-description",i);}function Oe(e){return e==="ins"?v.revisionIns:e==="del"?v.revisionDel:v.revisionMerge}function Ei(e,t,i,r){let n=i.createElement("section");n.className=v.notes,n.dataset.noteKind=e.kind??"footnote",e.sectionId&&(n.dataset.sectionId=e.sectionId),e.columns!==void 0&&(n.dataset.columns=String(e.columns)),n.style.position="absolute",n.style.left="0",n.style.top=`${e.y??0}px`,n.style.width=`${t.width}px`,n.style.height=`${e.height??0}px`;let l=new Map;for(let a of e.notes??[])a.id!==void 0&&l.set(a.id,a);pe(n,e.separatorPrimitives??[],i,-(e.y??0),r);let o=[...e.primitives??[]];for(let a of e.noteIds??[]){let c=`${e.kind??"footnote"}-${a}`,p=o.filter(y=>y.groupId===c);if(p.length===0)continue;for(let y of p){let h=o.indexOf(y);h>=0&&o.splice(h,1);}let g=i.createElement("aside");g.className=v.note,g.id=`oox-${c}`,g.dataset.noteId=String(a),g.setAttribute("role",e.kind==="endnote"?"doc-endnote":"doc-footnote");let m=l.get(a);if(m&&(m.label!==void 0&&(g.dataset.noteLabel=m.label),m.anchorDocStart!==void 0&&(g.dataset.anchorDocStart=String(m.anchorDocStart)),m.anchorDocEnd!==void 0&&(g.dataset.anchorDocEnd=String(m.anchorDocEnd))),pe(g,p,i,-(e.y??0),r),m&&Mt(e,a)){let y=i.createElement("a");y.className=v.noteBacklink,y.setAttribute("role","doc-backlink"),y.setAttribute("href",`#oox-noteref-${c}`);let h=r.labels?.noteBacklink??m.label??String(a);y.setAttribute("aria-label",h),g.appendChild(y);}n.appendChild(g);}return o.length>0&&pe(n,o,i,-(e.y??0),r),n}function Nt(e,t,i){if(t==="body")return e.primitives.filter(n=>n.kind==="image");let r=t==="header"?e.header:e.footer;return !r||i!==void 0&&r.rId!==i?[]:r.primitives.filter(n=>n.kind==="image")}function Ve(e,t,i="body",r){for(let n of e.pages)for(let l of Nt(n,i,r))if(l.docStart===t)return {primitive:l,pageIndex:n.pageIndex,...i!=="body"?{region:i,rId:r}:{}};return null}function Ke(e,t,i,r,n="body",l){let o=e.pages[t];if(!o)return null;let a=Nt(o,n,l);for(let s=a.length-1;s>=0;s--){let c=a[s];if(!(i<c.x||i>c.x+c.w)&&!(r<c.y||r>c.y+c.h)&&g(c,i,r))return {primitive:c,pageIndex:o.pageIndex,...n!=="body"?{region:n,rId:l}:{}}}return null}function Ti(e,t){let i=e.imageByPos(t);if(!i)return;let r=e.contentBounds(i.pageIndex),n=e.paragraphRects(t).find(l=>l.pageIndex===i.pageIndex);if(!(!r||!n))return {horizontalEmu:Math.round(c$1(i.primitive.x-r.x)),verticalEmu:Math.round(c$1(i.primitive.y-n.y))}}var me=(()=>{let e=globalThis.FinalizationRegistry;return e?new e(t=>t()):null})();function Ai(e){return ()=>{let t=e.handle;if(e.handle=null,!(t===null||!e.eng||he.has(e.eng)))try{e.eng.closeDisplayList?.(t);}catch{}}}var Ot=globalThis.WeakRef;function Ci(e){return Ot?new Ot(e):Bi(e)}function Bi(e){return {deref:()=>e}}var Pe=new WeakMap,je=new WeakMap;function Hi(e){let t=je.get(e);t&&(t.newest=null);}var he=new WeakSet,Je=new Set;function Gi(e){return e!=null&&he.has(e)}function Ni(e){return Je.add(e),()=>{Je.delete(e);}}function ye(e){return e instanceof Error?typeof WebAssembly<"u"&&e instanceof WebAssembly.RuntimeError?true:e.name==="RuntimeError":false}var ge=-1;function Ue(e){return {pageIndex:e.pageIndex,width:e.width,height:e.height,primitives:[]}}function Yt(e){if(e.kind!=="text"&&e.kind!=="glyphRun"||e.docStart===void 0||e.docEnd===void 0||e.kind==="glyphRun"&&e.glyphs.length===0)return null;let t=e.kind==="text"?e.baselineY:e.glyphs.reduce((i,r)=>Math.max(i,r.y),-1/0);return Number.isFinite(t)?t:null}var ze=new WeakMap;function Oi(e){if(ze.has(e))return ze.get(e)??null;let t=1/0,i=-1/0;for(let n of e.primitives){if(Yt(n)===null)continue;let l=f(n);t=Math.min(t,l.y),i=Math.max(i,l.y+l.h);}let r=t<=i?{top:t,bottom:i}:null;return ze.set(e,r),r}function _i(e,t){let i=e.storeRevisions();if(!i)return null;let r=new Map;e.list.pages.forEach((s,c)=>r.set(s,c));let n=[],l=[],o=[],a=[];return t.pages.forEach((s,c)=>{let p=r.get(s);p!==void 0&&r.delete(s);let g=p===void 0?void 0:i[p];if(p===void 0||g===void 0){l.push([c,Ue(s)]),a.push(ge);return}if(g===ge){n.push([c,p]),a.push(ge);return}let m=x(s)===g?[]:z(s,g);if(m===null)l.push([c,Ue(s)]),a.push(ge);else if(m.length===0)n.push([c,p]),a.push(g);else {let y=m.map(h=>h.runs.map(L=>[L.start,L.count,L.changedMask,L.delta]));if(m.some(h=>h.anchors.length>0)){let h=m.map(L=>L.anchors.map(R=>[R.area,R.note,R.start,R.end]));o.push([c,p,y,h]);}else o.push([c,p,y]);a.push(x(s));}}),n.length===0&&o.length===0?null:{json:JSON.stringify({total:t.pages.length,...t.contractVersion!==void 0?{contractVersion:t.contractVersion}:{},reuse:n,replace:l,...o.length>0?{shift:o}:{}}),revisions:a}}var _t=new WeakMap;function Fi(e){let t=x(e),i=_t.get(e);if(i&&i.revision===t)return i;let r=1/0,n=-1/0,l=a=>{typeof a=="number"&&(a<r&&(r=a),a>n&&(n=a));};for(let a of e.primitives)l(a.docStart),l(a.docEnd),l(a.fragmentDocStart),l(a.fragmentDocEnd),l(a.inlineSdtWidget?.pos);let o={revision:t,min:r,max:n};return _t.set(e,o),o}function Ft(e,t,i,r=0){let n=Math.min(t,i)-1,l=Math.max(t,i)+1,o=new Set;return e.pages.forEach((a,s)=>{let c=Fi(a);if(!(c.min>l||c.max<n))for(let p=-r;p<=r;p+=1){let g=s+p;g>=0&&g<e.pages.length&&o.add(g);}}),[...o]}function Yi(e,t,i,r){let n=null,l=()=>(n??(n=JSON.stringify(e)),n),o=null,a=Xi(t)?t:null,s={handle:null,eng:a?null:t??null},c=null,p,g,m=new Promise((d,u)=>{p=d,g=u;});m.catch(()=>{});let y=false,h=false,L=false,R={},k=null,D=i?Pe.get(i):void 0;D&&(k=D.hasHandle()?i:D.donor(),D.supersede()),D&&D.line!==(r??null)&&(D.lineage.newest=null);let w={newest:null};r&&(w=je.get(r)??w,je.set(r,w));let A=()=>a??s.eng,P=()=>{let d=A();return d!==null&&he.has(d)},C=(d,u)=>{let f=u instanceof Error?u:new Error(String(u));c=f,s.handle=null,me?.unregister(R);let b=A();if(!(!b||he.has(b))){he.add(b),console.error(`[CanvasRenderer] ${d} trapped in wasm; the session is unusable and must be rebuilt`,f);for(let x of Je)try{x(f);}catch(S){console.error("[CanvasRenderer] display-list source failure listener threw",S);}}},F=Ai(s),H=()=>{let d=k;if(k=null,!d||!s.eng?.updateDisplayList||!s.eng.hasDisplayListUpdate?.())return false;let u=Pe.get(d);if(!u||u.engine()!==s.eng)return false;let f=_i(u,e);if(!f)return false;let b=u.takeHandle();if(b===null)return false;try{return s.eng.updateDisplayList(b,f.json),s.handle=b,o=f.revisions,!0}catch(x){try{s.eng.closeDisplayList?.(b);}catch{}return console.warn("[CanvasRenderer] display-list delta update failed; reopening",x),false}},G=()=>{if(!(L||h||y||s.handle!==null||!s.eng||P())&&!(!s.eng.hasDisplayListSession?.()||!s.eng.openDisplayList)&&(y=true,!H()))try{s.eng.updateDisplayList&&s.eng.hasDisplayListUpdate?.()?(s.handle=s.eng.openDisplayList(JSON.stringify({...e.contractVersion!==void 0?{contractVersion:e.contractVersion}:{},pages:e.pages.map(Ue)})),o=e.pages.map(()=>ge)):(s.handle=s.eng.openDisplayList(l()),o=e.pages.map(x));}catch(d){if(s.handle=null,ye(d)){C("display-list session open",d);return}console.warn("[CanvasRenderer] display-list session open failed; using JSON-arg queries",d);}},N=d=>{if(s.handle===null||!o||!s.eng?.updateDisplayList)return;let u=o,f=[];for(let b of d){let x$1=e.pages[b];x$1&&u[b]!==x(x$1)&&f.push([b,x$1]);}if(f.length!==0)try{s.eng.updateDisplayList(s.handle,JSON.stringify({total:e.pages.length,...e.contractVersion!==void 0?{contractVersion:e.contractVersion}:{},keep:!0,replace:f}));for(let[b,x$1]of f)u[b]=x(x$1);}catch(b){if(ye(b)){C("display-list page load",b),o=null;return}F(),me?.unregister(R),o=null,console.warn("[CanvasRenderer] display-list page load failed; using JSON-arg queries",b);}},Te=()=>e.pages.map((d,u)=>u);a||s.eng?p():B().then(d=>{s.eng=d,p();},d=>{c=d instanceof Error?d:new Error(String(d)),g(c),console.warn("[CanvasRenderer] display-list query engine failed to load",c);});let re=(d,u,f,b)=>{if(!s.eng||P()||(s.handle===null&&G(),s.handle!==null&&d&&N(b()),P()))return null;if(s.handle!==null&&d)try{return d(s.handle)}catch(x){if(ye(x))return C(f,x),null;console.warn(`[CanvasRenderer] ${f} session query failed; falling back`,x),F();}try{return u()}catch(x){return ye(x)?(C(f,x),null):(c=x instanceof Error?x:new Error(String(x)),console.warn(`[CanvasRenderer] ${f} query failed`,x),null)}},$=(d,u,f)=>{if(d===null)return u;try{return JSON.parse(d)}catch(b){return c=b instanceof Error?b:new Error(String(b)),console.warn(`[CanvasRenderer] ${f} returned invalid JSON`,b),u}},E=()=>{if(a||!h||s.handle!==null||!r)return;let d=w.newest?.deref();return d&&!Pe.get(d)?.disposed()?d:null},O=(d,u)=>(...f)=>{let b=E();return b?u(b,...f):d(...f)},T=(d,u)=>{if(P())return null;try{return d()}catch(f){return ye(f)?(C(`resident ${u}`,f),null):(c=f instanceof Error?f:new Error(String(f)),console.warn(`[CanvasRenderer] resident ${u} query failed`,f),null)}},j=(d,u,f)=>{let b=E();if(b!==void 0)return b?.hitTestRegions(d,u,f)??null;if(a)return $(T(()=>a.displayHitTestRegionsJson(d,u,f),"hit_test_regions"),null,"hit_test_regions");let x=re(s.eng?.hitTestRegionsByHandle&&(S=>s.eng.hitTestRegionsByHandle(S,d,u,f)),()=>s.eng.hitTestRegionsJson(l(),d,u,f),"hit_test_regions",()=>[d]);return $(x,null,"hit_test_regions")},_=(d,u)=>{let f=E();if(f!==void 0)return f?.rangeRects(d,u)??[];if(a)return $(T(()=>a.displayRangeRectsJson(d,u),"range_rects"),[],"range_rects");let b=re(s.eng?.rangeRectsByHandle&&(x=>s.eng.rangeRectsByHandle(x,d,u)),()=>s.eng.rangeRectsJson(l(),d,u),"range_rects",()=>Ft(e,d,u));return $(b,[],"range_rects")},J=(d,u,f)=>{let b=E();if(b!==void 0)return b?.verticalMove(d,u,f)??null;let x=f??Number.NaN;if(a)return $(T(()=>a.displayVerticalMoveJson(d,u,x),"vertical_move"),null,"vertical_move");if(!s.eng?.verticalMoveJson)return null;let S=re(s.eng.verticalMoveByHandle&&(I=>s.eng.verticalMoveByHandle(I,d,u,x)),()=>s.eng.verticalMoveJson(l(),d,u,x),"vertical_move",()=>Ft(e,d,d,1));return $(S,null,"vertical_move")},Q=(d,u,f,b)=>{let x=E();if(x!==void 0)return x?d==="header"||d==="footer"?x.hfRangeRects(d,u,f,b):d==="footnote"||d==="endnote"?x.noteRangeRects(d,Number(u),f,b):[]:[];if(a)return $(T(()=>a.displayRangeRectsRegionJson(d,u,f,b),"range_rects_region"),[],"range_rects_region");if(!s.eng||!s.eng.hasRangeRectsRegion?.())return [];let S=re(s.eng.rangeRectsRegionByHandle&&(I=>s.eng.rangeRectsRegionByHandle(I,d,u,f,b)),()=>s.eng.rangeRectsRegionJson(l(),d,u,f,b),"range_rects_region",Te);return $(S,[],"range_rects_region")},W=(d,u,f,b)=>Q(d,u,f,b),te=(d,u,f,b)=>Q(d,String(u),f,b),U=(d,u)=>{let f=(x,S)=>{let I=new Map;for(let M of x)S&&I.has(M.pageIndex)||I.set(M.pageIndex,{pageIndex:M.pageIndex,x:S?M.x:M.x+M.width,y:M.y,width:0,height:M.height});return [...I.values()]},b=d(u,u+1);if(b.length>0)return f(b,true);if(u>0){let x=d(u-1,u);if(x.length>0)return f(x,false)}return []},Le=(d,u,f)=>U((b,x)=>W(d,u,b,x),f),Jt=(d,u,f)=>U((b,x)=>te(d,u,b,x),f),Ut=d=>{let u=e.pages.filter(M=>{let q=M.unbuilt?M.positionSpan:void 0;return q!==void 0&&d>=q[0]&&d<=q[1]});if(u.length===0)return null;let f=Math.max(...u.map(M=>M.positionSpan[0])),b=Math.min(...u.map(M=>M.positionSpan[1])),x=b>f?(d-f)/(b-f+1):1,S=Math.min(u.length-1,Math.floor(x*u.length)),I=u[S];return {pageIndex:I.pageIndex,x:I.contentBounds?.x??0,y:I.contentBounds?.y??0,width:0,height:0}},it=d=>{let u=E();if(u!==void 0)return u?.caretRect(d)??null;let f=_(d,d+1);if(f.length>0){let x=f[0];return {pageIndex:x.pageIndex,x:x.x,y:x.y,width:0,height:x.height}}let b=Ut(d);if(b)return b;if(d>0){let x=_(d-1,d);if(x.length>0){let S=x[x.length-1];return {pageIndex:S.pageIndex,x:S.x+S.width,y:S.y,width:0,height:S.height}}}return null},rt=d=>{let u=E();if(u!==void 0)return u?.anchorRect(d)??null;let f=_(d,d+2);return f.length>0?f[0]:it(d)},qt=(d,u,f)=>{let b=W(d,u,f,f+2);if(b.length===0)return Le(d,u,f);let x=new Map;for(let S of b)x.has(S.pageIndex)||x.set(S.pageIndex,S);return [...x.values()]},ot=(d,u)=>({pageIndex:d,x:u.x,y:u.y,width:u.w,height:u.h}),Zt=d=>{let u=e.pages[d];return u?{pageIndex:u.pageIndex,x:0,y:0,width:u.width,height:u.height}:null},en=d=>{let u=e.pages[d],f=u?.contentBounds;return u&&f?{pageIndex:u.pageIndex,x:f.x,y:f.y,width:f.width,height:f.height}:null},tn=d=>{let u=e.pages[d];return u?(u.columnBounds??[]).map(f=>({pageIndex:u.pageIndex,x:f.x,y:f.y,width:f.width,height:f.height})):[]},Ae=d=>d.paraId?`para:${d.paraId}`:d.blockKey!==void 0?`block-key:${d.blockKey}`:d.blockId!==void 0?`block-id:${d.blockId}`:null,at=d=>d.blockKey??d.blockId,ve=null,nn=()=>{if(ve)return ve;let d=new Map;for(let u of e.pages)for(let f$1 of u.primitives){let b=Ae(f$1);if(!b||f$1.docStart===void 0||f$1.docEnd===void 0)continue;let x=f(f$1),S=d.get(b);S||(S=new Map,d.set(b,S));let I=S.get(u.pageIndex);if(!I){S.set(u.pageIndex,{...ot(u.pageIndex,x),from:f$1.docStart,to:f$1.docEnd,blockId:at(f$1),paraId:f$1.paraId});continue}let M=Math.min(I.x,x.x),q=Math.min(I.y,x.y),Z=Math.max(I.x+I.width,x.x+x.w),se=Math.max(I.y+I.height,x.y+x.h);I.x=M,I.y=q,I.width=Z-M,I.height=se-q,I.from=Math.min(I.from,f$1.docStart),I.to=Math.max(I.to,f$1.docEnd);}return ve=new Map([...d].map(([u,f])=>[u,[...f.values()]])),ve},rn=d=>{let u=null;for(let f of e.pages)for(let b of f.primitives){let x=Ae(b),S=b.docStart,I=b.docEnd;if(!x||S===void 0||I===void 0||d<S||d>I)continue;let M={identity:x,span:Math.max(0,I-S),startsAtPos:S===d};(!u||M.startsAtPos&&!u.startsAtPos||M.startsAtPos===u.startsAtPos&&M.span<u.span)&&(u=M);}return u?nn().get(u.identity)??[]:[]},on=1.5,st=[],lt=d=>{let u=st[d];if(u)return u;let f$1=e.pages[d];if(!f$1)return [];let b=[],x=new Map,S=0;for(let I of f$1.primitives){let M=Yt(I);if(M===null||I.docStart===void 0||I.docEnd===void 0)continue;let q=Ae(I)??`anonymous:${S++}`,Z=f(I),se=x.get(q),B=se?.find(le=>Math.abs(le.baseline-M)<=on);if(!B){let le={...ot(f$1.pageIndex,Z),baseline:M,from:I.docStart,to:I.docEnd,blockId:at(I),paraId:I.paraId};b.push(le),se?se.push(le):x.set(q,[le]);continue}let ft=Math.min(B.x,Z.x),pt=Math.min(B.y,Z.y),dn=Math.max(B.x+B.width,Z.x+Z.w),un=Math.max(B.y+B.height,Z.y+Z.h);B.x=ft,B.y=pt,B.width=dn-ft,B.height=un-pt,B.from=Math.min(B.from,I.docStart),B.to=Math.max(B.to,I.docEnd);}return st[d]=b,b},ct=null,dt=()=>(ct??(ct=e.pages.flatMap((d,u)=>lt(u))),ct),an=d=>{let u=null;for(let f of dt())d<f.from||d>f.to||(!u||f.to-f.from<u.to-u.from)&&(u=f);return u},ut=d=>{if(!d)return null;let u=d.primitive.docStart;if(u===void 0)return null;let{primitive:f}=d;return {...d,pos:u,rect:{pageIndex:d.pageIndex,x:f.x,y:f.y,width:f.w,height:f.h}}},sn=(d,u,f,b="body",x)=>ut(Ke(e,d,u,f,b,x)),ln=(d,u="body",f)=>ut(Ve(e,d,u,f)),cn=()=>{L||(L=true,F(),me?.unregister(R));},Re={get displayList(){return E()?.displayList??e},isReady:()=>(a!==null||s.eng!==null)&&c===null,sourceState:()=>c?{status:"error",error:c}:a||s.eng?{status:"ready"}:{status:"loading"},whenReady:()=>m,pageCount:()=>{let d=E();return d?d.pageCount():e.pages.length},pageSize:d=>{let u=E();if(u)return u.pageSize(d);let f=e.pages[d];return f?{width:f.width,height:f.height}:null},pageBounds:d=>{let u=E();return u?u.pageBounds(d):Zt(d)},contentBounds:O(en,(d,u)=>d.contentBounds(u)),columnBounds:O(tn,(d,u)=>d.columnBounds(u)),paragraphRects:O(rn,(d,u)=>d.paragraphRects(u)),visualLines:O(dt,d=>d.visualLines()),visualLinesOnPage:d=>{let u=E();return u?u.visualLinesOnPage(d):lt(d)},visualLineExtent:O(d=>{let u=e.pages[d];return u?Oi(u):null},(d,u)=>d.visualLineExtent(u)),visualLineAtPosition:O(an,(d,u)=>d.visualLineAtPosition(u)),imageAtPoint:O(sn,(d,...u)=>d.imageAtPoint(...u)),imageByPos:O(ln,(d,...u)=>d.imageByPos(...u)),hitTestRegions:j,verticalMove:J,rangeRects:_,hfRangeRects:W,noteRangeRects:te,hfCaretRects:Le,noteCaretRects:Jt,hfAnchorRects:qt,caretRect:it,anchorRect:rt,sidebarAnchorRect:rt,prime:G,dispose:cn};return me?.register(Re,F,R),Pe.set(Re,{list:e,storeRevisions:()=>o,engine:()=>s.eng,hasHandle:()=>s.handle!==null,donor:()=>k,supersede:()=>{h=true;},lineage:w,line:r??null,disposed:()=>L,takeHandle:()=>{let d=s.handle;return d!==null&&(s.handle=null,me?.unregister(R)),d}}),w.newest=Ci(Re),Re}function Xi(e){return typeof e?.displayHitTestRegionsJson=="function"&&typeof e?.displayVerticalMoveJson=="function"&&typeof e?.displayRangeRectsJson=="function"&&typeof e?.displayRangeRectsRegionJson=="function"}var $i=16,Qi=24;function be(e){let t=[],i=24;for(let r=0;r<e.pageCount();r++)t.push(i),i+=(e.pageSize(r)?.height??0)+16;return t}var Wi=/^media:(0|[1-9]\d*)$/;function Xt(){let e=typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):typeof document<"u"?Object.assign(document.createElement("canvas"),{width:1,height:1}):null,t=e?.getContext("2d");return !e||!t?null:(t.fillStyle="#e6e6e6",t.fillRect(0,0,1,1),e)}function Vi(e={}){let t=new Map,{media:i,mediaScope:r}=e,n=r?.();return l=>{let o=i&&Wi.test(l);if(!o&&!l.startsWith("blob:")&&!l.startsWith("data:"))return null;r&&r()!==n&&(n=r(),t.clear());let a=t.get(l);return a||(a=new Promise(s=>{let c=l;if(o){let m=i(l);if(!m){s(Xt());return}c=URL.createObjectURL(new Blob([m.bytes],{type:m.mimeType}));}let p=new Image,g=m=>{o&&URL.revokeObjectURL(c),s(m);};p.onload=()=>g(p),p.onerror=()=>g(o?Xt():null),p.src=c;}),t.set(l,a)),a}}function Ki(e,t){let i=e.activeCommentIds.length>0?t?.(e.activeCommentIds):void 0;return {hasSelection:e.hasSelection,inInsertion:e.inInsertion,inDeletion:e.inDeletion,hasComment:e.activeCommentIds.length>0,inList:e.inList,listLevel:e.listLevel??0,...i?.authorName!==void 0?{commentAuthor:i.authorName}:{},...i?.replyCount!==void 0?{commentReplyCount:i.replyCount}:{}}}function zi(e,t){if(!e)return [];let i=[];return !e.hasSelection&&t.hasSelection&&i.push({key:"selected"}),e.hasSelection&&!t.hasSelection&&i.push({key:"selectionCleared"}),!e.hasComment&&t.hasComment&&i.push({key:"commentedText",...t.commentAuthor!==void 0||t.commentReplyCount!==void 0?{vars:{...t.commentAuthor!==void 0?{author:t.commentAuthor}:{},...t.commentReplyCount!==void 0?{replies:t.commentReplyCount}:{}}}:{}}),!e.inInsertion&&t.inInsertion&&i.push({key:"trackedInsertion"}),!e.inDeletion&&t.inDeletion&&i.push({key:"trackedDeletion"}),(!e.inList&&t.inList||t.inList&&e.listLevel!==t.listLevel)&&i.push({key:"listItem",vars:{level:t.listLevel+1}}),i}function qe(e,t){let{doc:i,schema:r}=e.state,n=r.marks.comment,l=r.marks.insertion,o=r.marks.deletion;!n&&!l&&!o||i.descendants((a,s)=>{let c=a.attrs;if(c){let p=[c.trIns,c.trDel,c.pPrIns,c.pPrDel];for(let h of p){let L=h?.revisionId;typeof L=="number"&&t(`revision-${L}`,s);}let m=c.cellMarker?.info?.revisionId;typeof m=="number"&&t(`revision-${m}`,s);let y=[c.pPrChange,c.trPrChange,c.tcPrChange,c.tblPrChange];for(let h of y)if(Array.isArray(h))for(let L of h){let R=L?.info?.id;typeof R=="number"&&t(`revision-${R}`,s);}}if(a.isInline)for(let p of a.marks){let g=null;n&&p.type===n?g=`comment-${p.attrs.commentId}`:(l&&p.type===l||o&&p.type===o)&&(g=`revision-${p.attrs.revisionId}`),g&&t(g,s);}});}function ji(e,t,i){let r=new Map;if(!e?.state)return r;let n=be(t),l=new Set;return qe(e,(o,a)=>{if(l.has(o))return;l.add(o);let s=t.anchorRect(a);if(!s)return;let c=i?i(s):(n[s.pageIndex]??0)+s.y;c!=null&&r.set(o,c);}),r}function Ji(e,t,i){if(!e.hfRid)return t.anchorRect(e.position);let r=i?.get(e.hfRid);return r?t.hfAnchorRects(r,e.hfRid,e.position)[0]??null:null}function Ui(e,t,i,r,n,l,o){let a$1=new Map,s=be(n),c=(p,g)=>{if(!g||a$1.has(p))return a$1.has(p);let m=Ji(g,n,l);if(!m)return false;let y=o?o(m):(s[m.pageIndex]??0)+m.y;return y==null?false:(a$1.set(p,y),true)};for(let p of t){let g=`comment-${p}`;try{for(let m of e.resolveComment(String(p)))if(c(g,r.storyOffsetToDisplayPoint(m.story,m.start)))break}catch{}}for(let p of i)c(`revision-${a(p.revisionId)}`,r.locToDisplayPoint({story:p.story,...p.range.start}));return a$1}function qi(e,t,i,r){let n=be(t);for(let{region:l,rId:o,view:a}of e)qe(a,(s,c)=>{if(i.has(s))return;let p=t.hfAnchorRects(l,o,c)[0];if(!p)return;let g=r?r(p):(n[p.pageIndex]??0)+p.y;g!=null&&i.set(s,g);});return i}var Zi=new Set(["tableInserted","tableDeleted","rowInserted","rowDeleted"]);function er(e,t){let i=e.map(o=>{let a$1=t.locToDisplayPoint({story:o.range.story,...o.range.start}),s=t.locToDisplayPoint({story:o.range.story,...o.range.end}),c=a$1?.position??0,p=Math.max(c,s?.position??c);return {type:o.kind==="pPrIns"?"paragraphMarkInsertion":o.kind==="pPrDel"?"paragraphMarkDeletion":o.kind==="pPrChange"?"paragraphPropertiesChanged":o.kind==="trIns"?"rowInserted":o.kind==="trDel"?"rowDeleted":o.kind==="tableIns"?"tableInserted":o.kind==="tableDel"?"tableDeleted":o.kind,text:o.preview,author:o.author,date:o.date||void 0,from:c,to:p,revisionId:a(o.revisionId),...a$1?.hfRid?{hfRid:a$1.hfRid}:{}}}),r=new Map;for(let o of i){let a=r.get(o.revisionId)??[];a.push(o),r.set(o.revisionId,a);}let n=[...r.values()].map(o=>{let a=Math.min(...o.map(y=>y.from)),s=Math.max(...o.map(y=>y.to)),c=o.filter(y=>y.type==="insertion"),p=o.filter(y=>y.type==="deletion");if(c.length>0&&p.length>0)return {...c[0],type:"replacement",text:c.map(h=>h.text).join(""),deletedText:p.map(h=>h.text).join(""),from:a,to:s};let g=o.find(y=>y.type==="insertion"||y.type==="deletion")??o.find(y=>Zi.has(y.type))??o[0],m=o.filter(y=>y.type===g.type).map(y=>y.text).join("");return {...g,text:m,from:a,to:s}}),l=[];for(let o=0;o<n.length;o+=1){let a=n[o],s=n[o+1];a.type==="deletion"&&s?.type==="insertion"&&a.author===s.author&&a.date===s.date&&a.to===s.from&&a.hfRid===s.hfRid?(l.push({type:"replacement",text:s.text,deletedText:a.text,author:a.author,date:a.date,from:a.from,to:s.to,revisionId:a.revisionId,insertionRevisionId:s.revisionId,...a.hfRid?{hfRid:a.hfRid}:{}}),o+=1):l.push(a);}return {entries:l,commentToRevision:new Map}}function tr(e,t){let i=t.kind??"body";if(i==="body")return {kind:i,primitives:e.primitives};let r=i==="header"?e.header:e.footer;return !r||r.kind!==i||t.rId&&r.rId!==t.rId?null:{kind:i,rId:r.rId,primitives:r.primitives}}function nr(e){switch(e.kind){case "text":return c(e);case "glyphRun":return d(e);case "rect":case "image":case "shape":case "decoration":return {x:e.x,y:e.y,w:e.w,h:e.h};case "line":return {x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)}}}function ir(e){let t=nr(e),i=e.clipGroup?.clip;if(!i)return t;let r=i.x??0,n=i.y??0,l=r+Math.max(0,i.w??0),o=n+Math.max(0,i.h??0),a=Math.max(t.x,r),s=Math.max(t.y,n),c=Math.min(t.x+t.w,l),p=Math.min(t.y+t.h,o);return c<a||p<s?null:{x:a,y:s,w:c-a,h:p-s}}function rr(e){return e.kind==="text"||e.kind==="glyphRun"?e.text:e.kind==="image"?e.altText??"":""}function or(e,t,i){return t>=e.x&&t<=e.x+e.w&&i>=e.y&&i<=e.y+e.h}function ar(e,t,i,r,n={kind:"body"}){let l=e.pages[t];if(!l)return null;let o=tr(l,n);if(!o)return null;for(let a=o.primitives.length-1;a>=0;a--){let s=o.primitives[a];if(s.kind==="line"||!s.href||s.hiddenObject)continue;let c=ir(s);if(c&&or(c,i,r))return {pageIndex:t,region:o.kind,rId:o.rId,href:s.href,tooltip:s.linkTitle??s.tooltip,displayText:rr(s)||s.href,rect:c}}return null}var V=7.5,ie=16,$t=320,sr=30,lr=200,cr=24,dr=10,ur=10,fr=24;function Qt(e){let t;switch(e.kind){case "text":t=c(e);break;case "glyphRun":t=d(e);break;case "rect":case "image":case "shape":case "decoration":t={x:e.x,y:e.y,w:e.w,h:e.h};break;case "line":t={x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)};break}let i=et(e);return i?pr(t,i)??{x:i.x,y:i.y,w:0,h:0}:t}function et(e){let t=e.clipGroup?.clip;return t?{x:t.x??0,y:t.y??0,w:Math.max(0,t.w??0),h:Math.max(0,t.h??0)}:null}function pr(e,t){let i=Math.max(e.x,t.x),r=Math.max(e.y,t.y),n=Math.min(e.x+e.w,t.x+t.w),l=Math.min(e.y+e.h,t.y+t.h);return n<i||l<r?null:{x:i,y:r,w:n-i,h:l-r}}function Wt(e,t,i){if(e.docStart!=null){let r=t(e.docStart);if(r!=null){let n={tableKey:r,docStartSample:e.docStart};return e.table?.tableId&&!i.has(e.table.tableId)&&i.set(e.table.tableId,n),n}}return e.table?.tableId?i.get(e.table.tableId)??null:null}function Vt(e,t,i){let r=e.table?.tableId;if(!r)return null;let n=t.get(r);return n?i.get(n.tableKey)??null:null}function Kt(e,t,i,r){let n=new Map;for(let o of t){if(o.kind==="line")continue;let a=o.cell;if(!a)continue;let s=Wt(o,i,r);if(!s)continue;let{tableKey:c,docStartSample:p}=s,g=Qt(o),m=et(o),y=m??g,h=n.get(c);if(h||(h={tableKey:c,docStartSample:p,contentMinX:y.x,contentMinY:y.y,contentMaxX:y.x+y.w,contentMaxY:y.y+y.h,exactLeftX:[],exactBottomY:[],exactClipLeftX:[],exactClipBottomY:[],rows:new Map},n.set(c,h)),p<h.docStartSample&&(h.docStartSample=p),h.contentMinX=Math.min(h.contentMinX,y.x),h.contentMinY=Math.min(h.contentMinY,y.y),h.contentMaxX=Math.max(h.contentMaxX,y.x+y.w),h.contentMaxY=Math.max(h.contentMaxY,y.y+y.h),m&&(h.exactClipLeftX.push(m.x),h.exactClipBottomY.push(m.y+m.h)),!a.continuation){let L=h.rows.get(a.row);L?(L.top=Math.min(L.top,y.y),L.bottom=Math.max(L.bottom,y.y+y.h)):h.rows.set(a.row,{top:y.y,bottom:y.y+y.h});}}if(n.size===0)return [];for(let o of t){if(o.kind!=="line"||o.role!=="table-border"&&o.role!=="table-cut")continue;let a=Vt(o,r,n);if(!a){let p=(o.x1+o.x2)/2,g=(o.y1+o.y2)/2,m=1/0;for(let y of n.values()){let h=p>=y.contentMinX-ie&&p<=y.contentMaxX+ie,L=g>=y.contentMinY-ie&&g<=y.contentMaxY+ie;if(!h||!L)continue;let R=Math.max(0,y.contentMinX-p,p-y.contentMaxX),k=Math.max(0,y.contentMinY-g,g-y.contentMaxY),D=R+k;D<m&&(m=D,a=y);}}if(!a)continue;let s=Math.abs(o.x1-o.x2)<.5,c=Math.abs(o.y1-o.y2)<.5;s&&a.exactLeftX.push(Math.min(o.x1,o.x2)),c&&a.exactBottomY.push(Math.max(o.y1,o.y2));}let l=[];for(let o of n.values()){if(o.rows.size===0)continue;let a=o.exactLeftX.length>0||o.exactClipLeftX.length>0,s=a?Math.min(...o.exactLeftX,...o.exactClipLeftX):o.contentMinX-V,c=o.exactBottomY.length>0||o.exactClipBottomY.length>0?Math.max(...o.exactBottomY,...o.exactClipBottomY):o.contentMaxY,p=[...o.rows.entries()].map(([g,m])=>({rowIndex:g,top:m.top,bottom:m.bottom})).sort((g,m)=>g.rowIndex-m.rowIndex);l.push({pageIndex:e,tableKey:o.tableKey,docStartSample:o.docStartSample,originX:s,originY:o.contentMinY,bottomY:c,originExact:a,rowBands:p});}return l}function mr(e,t){let i=[],r=Ee(e,t,{kind:"body"});for(let n of e.pages)i.push(...Kt(n.pageIndex,n.primitives,t,r));return i}function yr(e,t,i,r){let n=e.pages.slice(i,r+1),l=new Set,o=false;for(let s of n)for(let c of s.primitives)c.kind!=="line"&&c.cell&&(o=true),c.table?.tableId&&l.add(c.table.tableId);if(!o)return [];let a=Ee(e,t,{kind:"body"},l);return n.flatMap(s=>Kt(s.pageIndex,s.primitives,t,a))}function tt(e,t){let i=t.kind??"body";if(i==="body")return {kind:i,primitives:e.primitives};let r=i==="header"?e.header:e.footer;return !r||r.kind!==i||t.rId&&r.rId!==t.rId?null:{kind:i,rId:r.rId,primitives:r.primitives}}function Ee(e,t,i,r){let n=new Map;for(let l of e.pages){let o=tt(l,i);if(o)for(let a of o.primitives){if(!a.cell||!a.table?.tableId||a.docStart==null||r&&!r.has(a.table.tableId))continue;let s=t(a.docStart);if(s==null)continue;let c=n.get(a.table.tableId);(!c||a.docStart<c.docStartSample)&&n.set(a.table.tableId,{tableKey:s,docStartSample:a.docStart});}}return n}function nt(e,t){return `${e}:${t}`}function gr(e,t,i,r){let n=nt(t.row,t.col),l=e.cells.get(n);l?(l.minX=Math.min(l.minX,i.x),l.minY=Math.min(l.minY,i.y),l.maxX=Math.max(l.maxX,i.x+i.w),l.maxY=Math.max(l.maxY,i.y+i.h),l.rowSpan=Math.max(l.rowSpan,t.rowSpan),l.colSpan=Math.max(l.colSpan,t.colSpan),r&&(l.exactClip=r)):e.cells.set(n,{row:t.row,col:t.col,rowSpan:t.rowSpan,colSpan:t.colSpan,minX:i.x,minY:i.y,maxX:i.x+i.w,maxY:i.y+i.h,exactClip:r??void 0});}function zt(e,t,i){let r=new Map;for(let n of e){if(n.kind==="line")continue;let l=n.cell;if(!l)continue;let o=Wt(n,t,i);if(!o)continue;let a=o.tableKey,s=Qt(n),c=r.get(a);c||(c={tableKey:a,contentMinX:s.x,contentMinY:s.y,contentMaxX:s.x+s.w,contentMaxY:s.y+s.h,cells:new Map,verticalLines:[],horizontalLines:[]},r.set(a,c)),c.contentMinX=Math.min(c.contentMinX,s.x),c.contentMinY=Math.min(c.contentMinY,s.y),c.contentMaxX=Math.max(c.contentMaxX,s.x+s.w),c.contentMaxY=Math.max(c.contentMaxY,s.y+s.h),gr(c,l,s,et(n));}if(r.size===0)return [];for(let n of e){if(n.kind!=="line"||n.role!=="table-border"&&n.role!=="table-cut")continue;let l=Math.abs(n.x1-n.x2)<.5,o=Math.abs(n.y1-n.y2)<.5;if(!l&&!o)continue;let a=Math.min(n.x1,n.x2),s=Math.max(n.x1,n.x2),c=Math.min(n.y1,n.y2),p=Math.max(n.y1,n.y2),g=Vt(n,i,r);if(g){l?g.verticalLines.push(a):g.horizontalLines.push(c);continue}for(let m of r.values())if(l){if(!(p>=m.contentMinY-ie&&c<=m.contentMaxY+ie))continue;let h=a;Math.max(0,m.contentMinX-h,h-m.contentMaxX)<=$t&&m.verticalLines.push(h);}else if(o){if(!(s>=m.contentMinX-ie&&a<=m.contentMaxX+ie))continue;let h=c;Math.max(0,m.contentMinY-h,h-m.contentMaxY)<=$t&&m.horizontalLines.push(h);}}return [...r.values()]}function xe(e){let t=[];for(let i of [...e].sort((r,n)=>r-n))(t.length===0||Math.abs(t[t.length-1]-i)>.5)&&t.push(i);return t}function jt(e){let t=xe([...e.cells.values()].map(n=>n.row)),i=xe(e.horizontalLines),r=new Map;if(t.length>0&&i.length>=t.length+1)for(let n=0;n<t.length;n++)r.set(t[n],i[n]),r.set(t[n]+1,i[n+1]);return r}function Ze(e){if(!e)return null;if(e.exactClip)return e.exactClip;let t=e.minX-V,i=e.minY-V;return {x:t,y:i,w:Math.max(1,e.maxX-e.minX+V*2),h:Math.max(1,e.maxY-e.minY+V*2)}}function hr(e,t){let i=1/0,r=-1/0;for(let n of e.cells.values())n.row===t&&(i=Math.min(i,n.exactClip?.y??n.minY-V),r=Math.max(r,n.exactClip?n.exactClip.y+n.exactClip.h:n.maxY+V));return !Number.isFinite(i)||!Number.isFinite(r)||r<=i?null:{top:i,bottom:r}}function br(e,t,i){let r=Ze(e.cells.get(nt(t,i)));return r?{left:r.x,right:r.x+r.w,top:r.y,bottom:r.y+r.h}:null}function xr(e,t,i,r={kind:"body"}){if(t.length===0)return [];let n=new Map;for(let a of t){let s=n.get(a.tableKey);s?s.push(a):n.set(a.tableKey,[a]);}let l=[],o=Ee(e,i,r);for(let a of e.pages){let s=tt(a,r);if(!s)continue;let c=zt(s.primitives,i,o);for(let p of c){let g=n.get(p.tableKey);if(!g)continue;let m=xe(p.verticalLines),y=jt(p);for(let h of g){let L=p.cells.get(nt(h.row,h.col)),R=m[h.col],k=m[h.col+h.colSpan],D=y.get(h.row),w=y.get(h.row+h.rowSpan),A=true;if(R==null||k==null||k<=R){let P=L?.exactClip??Ze(L);if(!P)continue;R=P.x,k=P.x+P.w,A=L?.exactClip!=null;}if(D==null||w==null||w<=D){let P=L?.exactClip??Ze(L);if(!P)continue;D=P.y,w=P.y+P.h,A&&(A=L?.exactClip!=null);}l.push({pageIndex:a.pageIndex,tableKey:p.tableKey,row:h.row,col:h.col,rowSpan:h.rowSpan,colSpan:h.colSpan,x:R,y:D,w:Math.max(1,k-R),h:Math.max(1,w-D),exact:A,region:s.kind,rId:s.rId});}}}return l}function Lr(e){let{list:t,pageIndex:i,x:r,y:n,canvasRect:l,pageSize:o,tableKeyOf:a,cellPmPosOf:s,region:c={kind:"body"},edgeProximity:p=sr,buttonZoom:g=1}=e,m=t.pages[i];if(!m)return null;let y=tt(m,c);if(!y)return null;let h=o.width>0?l.width/o.width:1,L=o.height>0?l.height/o.height:1,R=(w,A)=>({clientX:l.left+w*h,clientY:l.top+A*L}),k=Ee(t,a,c),D=zt(y.primitives,a,k);for(let w of D){let A=xe(w.verticalLines),P=jt(w),C=xe([...w.cells.values()].map(E=>E.row));if(C.length===0)continue;let F=A[0]??w.contentMinX-V,H=A[A.length-1]??w.contentMaxX+V,G=P.get(C[0])??w.contentMinY-V,N=C[C.length-1],Te=P.get(N+1)??w.contentMaxY+V,re=r<F+p&&r>=F-p,$=n<G+p&&n>=G-p;if(!(!re&&!$)){if(re&&n>=G-p&&n<=Te)for(let E of C){let O=P.get(E),T=P.get(E+1),j=O==null||T==null?hr(w,E):null,_=O??j?.top,J=T??j?.bottom;if(_==null||J==null||J<=_||n<_||n>J)continue;let Q=[...w.cells.values()].filter(U=>U.row===E).sort((U,Le)=>U.col-Le.col)[0];if(!Q)continue;let W=s(w.tableKey,E,Q.col);if(!W)continue;let te=R(F,_+(J-_)/2);return {type:"row",clientX:te.clientX-cr*g,clientY:te.clientY-dr*g,cellPmPos:W}}if($&&r>=F-p&&r<=H){let E=C[0],O=[...w.cells.values()].filter(T=>T.row===E).sort((T,j)=>T.col-j.col);for(let T of O){let j=A[T.col],_=A[T.col+T.colSpan],J=j==null||_==null?br(w,T.row,T.col):null,Q=j??J?.left,W=_??J?.right;if(Q==null||W==null||W<=Q||r<Q||r>W)continue;let te=s(w.tableKey,T.row,T.col);if(!te)continue;let U=R(Q+(W-Q)/2,G);return {type:"column",clientX:U.clientX-ur*g,clientY:U.clientY-fr*g,cellPmPos:te}}}}}return null}var so=yt;export{Qi as CANVAS_PAGES_PADDING_PX,$i as CANVAS_PAGE_GAP_PX,lr as DISPLAY_LIST_TABLE_INSERT_HIDE_DELAY_MS,v as MIRROR_CLASS_NAMES,Qn as applyInteractiveSdtFocus,Kn as buildInteractiveOverlayPage,Xe as buildMirrorPage,mi as buildMirrorPageLinks,hi as buildMirrorPageText,be as canvasPageTops,Ti as captureInlinePositionEmuFromDisplayList,zi as computeA11yAnnouncements,ji as computeAnchorPositionsFromDisplayList,Ui as computeAnchorPositionsFromYrs,Vi as createCanvasImageResolver,Yi as createDisplayListQueries,so as demoDisplayList,xr as deriveDisplayListSelectedCellRects,mr as deriveDisplayListTableFragments,yr as deriveDisplayListTableFragmentsOnPages,Lr as detectDisplayListTableInsertHover,bi as displayPageHoldsMirrorId,Hi as endDisplayListQueriesLine,er as extractTrackedChangesFromYrs,ar as findDisplayListHyperlinkAtPoint,Ke as findImagePrimitiveAtPoint,Ve as findImagePrimitiveByDocPos,ai as interactiveOverlayHasTabStops,Gi as isDisplayListQuerySourceDead,$n as loadGlyphOutlineProvider,qi as mergeHfAnchorPositionsFromDisplayList,di as mirrorPageHasHeaderCells,ui as mirrorPageHasTabStops,Ni as onDisplayListQuerySourceFailure,Tt as reduceMirrorToLinks,At as reduceMirrorToText,Ki as snapshotFromSelectionContext,qe as visitAnchorKeys};
1
+ import {f,g,e,d,c,C,y,A}from'../../chunk-FK7X7557.mjs';export{r as FRAME_DELTA_HEADER_BYTES,s as FRAME_DELTA_PAGE_OP_BYTES,q as FRAME_DELTA_VERSION,t as FrameDeltaError,a as GlyphCache,B as RustDisplayListSourceError,w as applyFrameDelta,x as applyFrameDeltaOwned,F as buildRustDisplayFrame,E as buildRustDisplayList,u as decodeFrameDelta,v as decodeFrameDeltaSteps,z as displayPageNoteAnchorRevision,y as displayPageRevision,o as drawDisplayPage,p as drawPrimitive,D as encodeDisplayListFrameExtras,b as fontSizePxFromShorthand,d as glyphRunRect,e as lineRect,C as loadRustDisplayListQueryEngine,i as presentDisplayPageBackBuffer,j as presentOffscreenPageBackBuffer,n as rasterizeDisplayListPages,h as rasterizeDisplayPageToBackBuffer,m as sizeCanvasForPage,c as textRunRect}from'../../chunk-FK7X7557.mjs';import {a}from'../../chunk-LIOWZSE7.mjs';export{c as createYrsSidebarProjection,a as yrsIdToNumericId}from'../../chunk-LIOWZSE7.mjs';export{b as DisplayPageRegistry,c as bindDisplayPageRegistry,e as displayPageCanvas,f as displayPageCanvases,a as effectiveZoom,d as materializeDisplayPages,h as resolveCanvasPoint,g as resolveDisplayPageClientRect}from'../../chunk-AOWJ4WDE.mjs';import {c as c$1}from'../../chunk-CTBUQRYQ.mjs';import'../../chunk-TTRUPDAB.mjs';var yt={pages:[{pageIndex:0,width:816,height:1056,primitives:[{kind:"rect",x:96,y:96,w:624,h:20,fill:"#fff9c4",blockId:0,docStart:1,docEnd:12},{kind:"text",text:"Hello Word",x:96,baselineY:110,width:84.5,font:"700 16px Calibri, sans-serif",color:"#000000",docStart:1,docEnd:11,blockId:0},{kind:"decoration",deco:"underline",x:96,y:113,w:84.5,h:1,color:"#000000",docStart:1,docEnd:11,blockId:0},{kind:"text",text:" \u2014 second run",x:180.5,baselineY:110,width:96.25,font:"400 16px Calibri, sans-serif",color:"#c0392b",docStart:11,docEnd:24,blockId:0},{kind:"line",x1:96,y1:140,x2:720,y2:140,strokeWidth:.75,color:"#666666",role:"table-border"},{kind:"image",relId:"rId7",x:96,y:160,w:200,h:120,docStart:30,docEnd:31,blockId:2}]}]};function Qn(){return import('../../wasm-JPDPN2B2.mjs').then(async e=>(await e.preloadLayoutWasm(),e.outlineGlyphJson))}function Wn(e,t){for(let i of Array.from(e.querySelectorAll(".layout-canvas-sdt-box[data-sdt-group-id]")))i.classList.toggle("layout-sdt-focused",t.has(i.dataset.sdtGroupId??""));}var Vn=".layout-sdt-widget, .layout-inline-sdt-widget, .layout-sdt-repeat-btn",He=2,Ge=18,ue=16,Kn=2;function zn(e,t={}){let i=t.document??document,r=i.createElement("div");r.className="layout-interactive-overlay",r.dataset.pageIndex=String(e.pageIndex),r.style.position="absolute",r.style.inset="0",r.style.width=`${e.width}px`,r.style.height=`${e.height}px`,r.style.pointerEvents="none",r.addEventListener("mousedown",n=>{n.target?.closest?.(Vn)&&(n.preventDefault(),n.stopPropagation());});for(let[n,l]of Ie(e).entries()){for(let o of l.boundaries){let a=ni(o,i,t.labels,l.lowerLayer);a.style.zIndex=String(n),r.appendChild(a);}for(let o of l.widgets){let a=ii(o,i,t.labels);a.style.zIndex=String(n),o.occluded&&fe(a),r.appendChild(a);}}return r}function Ie(e){let t=qn(e),i=t[3];return t.map((r,n)=>{let l=n<3,o=c=>({rect:c,occluded:l&&gt(i,c)}),a=[...Zn(r).values()].sort(ti).map(c=>{let{kind:p,repeat:g}=ai(c.attrs),{rect:m}=c,y=m.x+Math.max(1,m.w)-He,h=m.y+Math.max(1,m.h)-He;return {...c,kind:p,widget:p?o({x:y-Ge,y:m.y+He,w:Ge,h:Ge}):void 0,repeats:g?[0,1].map(L=>o({x:y-ue-(1-L)*(ue+Kn),y:h-ue,w:ue,h:ue})):[]}}),s=[...ei(r).values()].map(c=>({...c,occluded:l&&gt(i,c.rect)}));return {lowerLayer:l,boundaries:a,widgets:s}})}function gt(e,t){let i=t.x+Math.max(1,t.w)/2,r=t.y+Math.max(1,t.h)/2;return e.some(n=>{if("opacity"in n&&n.opacity!==void 0&&n.opacity<=0||n.clipGroup?.clip&&(n.clipGroup.opacity??1)<=0)return false;switch(n.kind){case "text":case "glyphRun":if(!n.text.trim()||Un(n)||(n.rotationDeg??0)%360!==0||n.horizontalScale!==void 0&&!(n.horizontalScale>=100)||n.kind==="glyphRun"&&!n.glyphs.length)return false;break;case "rect":if(!n.fill||n.fill==="transparent"||n.fill==="none")return false;break;case "shape":{let o=n.fillPaint,a=o?.color??n.fill;if(o?.kind==="none")return false;if(o?.kind==="gradient"||o?.kind==="pattern")break;if(o?.kind==="picture"&&(o.pictureSrc||o.pictureRelId)){if((o.pictureOpacity??1)<=0)return false;let s=o.pictureStretchRect;if([s?.left,s?.top,s?.right,s?.bottom].some(p=>(p??0)>0)||!bt(o.pictureSrcRect))return false;break}if(!a||a==="transparent"||a==="none")return false;break}case "image":break;case "decoration":{let{color:o,style:a,dashed:s,dotted:c}=n;if((a??"solid")!=="solid"||s||c||!o||o==="transparent"||o==="none")return false;break}default:return false}let l=n.kind==="shape"?Jn(n):n.kind==="image"?jn(n):f(n);return l!==null&&Number.isFinite(l.w)&&Number.isFinite(l.h)&&l.w>0&&l.h>0&&i>=l.x&&i<=l.x+l.w&&r>=l.y&&r<=l.y+l.h&&g(n,i,r)})}function jn(e){let t=(i,r)=>i!==void 0&&Number.isFinite(i)?i:r;return e.shapeType!==void 0&&e.shapeType!=="rect"||t(e.rotationDeg,0)%180!==0||!bt(e.crop)?null:{x:t(e.contentFrame?.x,e.x),y:t(e.contentFrame?.y,e.y),w:t(e.contentFrame?.w,e.w),h:t(e.contentFrame?.h,e.h)}}function bt(e){if(!e)return true;let t=o=>Number.isFinite(o)?o:0,[i,r,n,l]=[e.left,e.top,e.right,e.bottom].map(t);return i>=0&&r>=0&&n>=0&&l>=0&&i+n<1&&r+l<1}function Jn(e){let t=e.transform?.rotation??0;if(!Number.isFinite(t)||t%180!==0)return null;let i=e.geometryPath,r=i.at(-1)?.type==="close"?i.length-1:i.length,n=[];for(let L=0;L<r;L++){let R=i[L];if(R.type!=="move"&&R.type!=="line"||R.type==="move"!=(L===0))return null;n.push([R.x,R.y]);}let l=n[0],o=n.at(-1);if(n.length===5&&l&&o&&l[0]===o[0]&&l[1]===o[1]&&n.pop(),n.length!==4)return null;let a=[...new Set(n.map(([L])=>L))],s=[...new Set(n.map(([,L])=>L))];if(a.length!==2||s.length!==2||new Set(n.map(([L,R])=>`${L},${R}`)).size!==4||!n.every(([L,R],k)=>{let[D,w]=n[(k+1)%4];return L===D!=(R===w)}))return null;let p=Math.min(...a),g=Math.min(...s),m=Math.abs(a[0]-a[1]),y=Math.abs(s[0]-s[1]),h=Math.abs(t%360)===180;return !!e.transform?.flipH!==h&&(p=2*e.x+e.w-p-m),!!e.transform?.flipV!==h&&(g=2*e.y+e.h-g-y),{x:p,y:g,w:m,h:y}}function Un(e){return e.modernEffects?.textFill?.kind==="none"}function fe(e){e.style.visibility="hidden",e.style.pointerEvents="none",e.tabIndex=-1,e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),e.setAttribute("aria-disabled","true"),e.tagName==="BUTTON"&&(e.disabled=true);}function qn(e){let t=Math.min(e.watermarkPrimitiveCount??0,e.primitives.length);return [e.primitives.slice(0,t),e.header?.primitives??[],e.footer?.primitives??[],e.primitives.slice(t),...(e.noteAreas??[]).map(i=>[...i.separatorPrimitives??[],...i.primitives??[]])]}function Zn(e){let t=new Map;for(let i of e){let r=xt(i);if(!r)continue;let n=i.sdtPath?.length?i.sdtPath:i.sdt?[i.sdt]:[];for(let l of n){let o=t.get(l.groupId);o?o.rect=Lt(o.rect,r):t.set(l.groupId,{attrs:l,rect:{...r}});}}return t}function ei(e){let t=new Map;for(let i of e){let r=i.inlineSdtWidget,n=xt(i);if(!r||!n)continue;let l=`${r.groupId}:${r.pos}:${r.controlKind??r.kind}`,o=t.get(l);o?(o.rect=Lt(o.rect,n),o.primitives.push(i)):t.set(l,{attrs:r,rect:{...n},primitives:[i]});}return t}function ti(e,t){return (e.attrs.depth??0)-(t.attrs.depth??0)||e.rect.y-t.rect.y||e.rect.x-t.rect.x}function ni(e,t,i,r){let{attrs:n,rect:l,kind:o}=e,a=t.createElement("div");a.className="layout-block-sdt-box layout-canvas-sdt-box",ci(a,n),vt(a,l),a.style.pointerEvents="none";let s=n.alias||n.tag;if(s){let c=t.createElement("span");c.className="layout-block-sdt-label",c.textContent=s,a.appendChild(c);}if(o){let c=t.createElement("button");c.type="button",c.className="layout-sdt-widget",c.dataset.sdtWidget=o,c.dataset.sdtGroupId=n.groupId,n.tag&&(c.dataset.sdtTag=n.tag),n.alias&&(c.dataset.sdtAlias=n.alias),(s||i?.control)&&c.setAttribute("aria-label",s||i?.control||""),o==="dropdown"&&c.setAttribute("aria-haspopup","listbox"),o==="date"&&c.setAttribute("aria-haspopup","dialog"),o==="checkbox"&&(c.setAttribute("role","checkbox"),c.setAttribute("aria-checked",String(n.checked??false))),c.textContent=o==="dropdown"?"\u25BE":o==="date"?"\u25A3":n.checked?"\u2612":"\u2610",c.style.pointerEvents="auto",e.widget?.occluded&&fe(c),a.appendChild(c);}if(e.repeats.length){let c=t.createElement("div");c.className="layout-sdt-repeat-controls",c.style.pointerEvents=r?"none":"auto";let p=[ht(t,n,"add","\uFF0B",i?.addRepeatingItem,s),ht(t,n,"remove","\u2715",i?.removeRepeatingItem,s)];for(let[g,m]of p.entries()){let y=e.repeats[g];r&&(m.style.pointerEvents="auto"),y.occluded&&fe(m),c.appendChild(m);}a.appendChild(c);}return a}function ht(e,t,i,r,n,l){let o=e.createElement("button");return o.type="button",o.className="layout-sdt-repeat-btn",o.dataset.sdtRepeat=i,o.dataset.sdtGroupId=t.groupId,t.tag&&(o.dataset.sdtTag=t.tag),(n||l)&&o.setAttribute("aria-label",n||l||""),o.textContent=r,o}function ii(e,t,i){let{attrs:r,rect:n}=e,l=r.controlKind??r.kind,o=t.createElement("button");return o.type="button",o.className="layout-sdt-widget layout-inline-sdt-widget layout-canvas-inline-sdt-widget",o.dataset.sdtWidget=ri(l),o.dataset.sdtGroupId=r.groupId,o.dataset.sdtPos=String(r.pos),r.tag&&(o.dataset.sdtTag=r.tag),r.alias&&(o.dataset.sdtAlias=r.alias),r.controlId!==void 0&&(o.dataset.sdtControlId=String(r.controlId)),r.value!==void 0&&(o.dataset.sdtValue=r.value),r.selectedIndex!==void 0&&(o.dataset.sdtSelectedIndex=String(r.selectedIndex)),r.dateFormat&&(o.dataset.sdtDateFormat=r.dateFormat),r.dateLanguage&&(o.dataset.sdtDateLanguage=r.dateLanguage),r.listItems?.length&&(o.dataset.sdtListItems=JSON.stringify(r.listItems)),(r.alias||r.tag||i?.control)&&o.setAttribute("aria-label",r.alias||r.tag||i?.control||""),l==="checkbox"?(o.setAttribute("role","checkbox"),o.setAttribute("aria-checked",String(r.checked??false))):l==="dropDownList"||l==="comboBox"?(o.setAttribute("aria-haspopup","listbox"),o.setAttribute("aria-expanded","false")):l==="date"&&o.setAttribute("aria-haspopup","dialog"),o.disabled=r.locked===true,o.textContent=l==="checkbox"?r.checked?"\u2612":"\u2610":l==="date"?"\u25A3":l==="picture"?"\u25A7":"\u25BE",vt(o,n),o.style.pointerEvents="auto",o}function ri(e){return e==="dropDownList"||e==="comboBox"?"dropdown":e}function oi(e){return e==="checkbox"?"checkbox":e==="dropDownList"||e==="comboBox"?"dropdown":e==="date"?"date":null}function ai(e){let t=!e.bound&&!li(e.lock);return {kind:t?oi(e.sdtType):null,repeat:!!e.repeatingItem&&t}}function si(e){for(let t of Ie(e)){for(let i of t.boundaries)if(i.widget&&!i.widget.occluded||i.repeats.some(r=>!r.occluded))return true;for(let i of t.widgets)if(!i.occluded&&i.attrs.locked!==true)return true}return false}function li(e){return e==="contentLocked"||e==="sdtContentLocked"||e==="sdtLocked"}function ci(e,t){e.dataset.sdtGroupId=t.groupId,e.dataset.sdtType=t.sdtType,t.depth!==void 0&&(e.dataset.sdtDepth=String(t.depth)),t.tag&&(e.dataset.sdtTag=t.tag),t.alias&&(e.dataset.sdtAlias=t.alias),t.lock&&(e.dataset.sdtLock=t.lock),t.checked!==void 0&&(e.dataset.sdtChecked=String(t.checked)),t.bound!==void 0&&(e.dataset.sdtBound=String(t.bound)),t.repeatingItem!==void 0&&(e.dataset.sdtRepeatingItem=String(t.repeatingItem));}function xt(e$1){let t=e$1.clipGroup?.clip;if(t?.x!==void 0&&t.y!==void 0&&t.w!==void 0&&t.h!==void 0)return {x:t.x,y:t.y,w:t.w,h:t.h};switch(e$1.kind){case "text":return c(e$1);case "glyphRun":return d(e$1);case "rect":return {x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h};case "line":return e(e$1);case "image":case "shape":return {x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h};case "decoration":return {x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h}}}function Lt(e,t){let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),n=Math.max(e.x+e.w,t.x+t.w),l=Math.max(e.y+e.h,t.y+t.h);return {x:i,y:r,w:n-i,h:l-r}}function vt(e,t){e.style.position="absolute",e.style.left=`${t.x}px`,e.style.top=`${t.y}px`,e.style.width=`${Math.max(1,t.w)}px`,e.style.height=`${Math.max(1,t.h)}px`;}var v={page:"layout-page layout-page-mirror",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer",block:"layout-paragraph",table:"layout-table",tableRow:"layout-table-row",tableCell:"layout-table-cell",text:"layout-run layout-run-text",rect:"layout-mirror-rect",image:"layout-run layout-run-image",shape:"layout-run layout-run-shape",chart:"layout-run layout-run-chart",decoration:"layout-decoration",line:"layout-mirror-line",pageBorder:"layout-page-border",tableCut:"layout-table-cut-border",blockSdt:"layout-block-sdt",inlineSdtWidget:"layout-inline-sdt-widget",revisionPmark:"layout-revision-pmark",revisionPmarkGlyph:"layout-revision-pmark-glyph",revisionPmarkIns:"layout-revision-ins",revisionPmarkDel:"layout-revision-del",listMarker:"layout-list-marker",revisionTable:"oox-revision-table",revisionRow:"oox-revision-row",revisionCell:"oox-revision-cell",revisionIns:"oox-revision-ins",revisionDel:"oox-revision-del",revisionMerge:"oox-revision-merge",notes:"layout-page-notes",note:"layout-note",noteBacklink:"layout-note-backlink"};function Ye(e){return [...e.primitives,...e.header?.primitives??[],...e.footer?.primitives??[],...(e.noteAreas??[]).flatMap(t=>[...t.separatorPrimitives??[],...t.primitives??[]])]}function di(e){return e.kind==="image"?!!e.href:(e.kind==="text"||e.kind==="glyphRun")&&(!!e.href||e.noteRef?.id!==void 0)}function Mt(e,t){let i=`${e.kind??"footnote"}-${t}`;return (e.notes??[]).some(r=>r.id===t)&&(e.primitives??[]).some(r=>r.groupId===i)}function ui(e){return Ye(e).some(t=>t.cell?.isHeader===true)}function fi(e){return Ye(e).some(di)||(e.noteAreas??[]).some(t=>(t.noteIds??[]).some(i=>Mt(t,i)))}var Pt=["aria-labelledby","aria-describedby"],pi=Pt.map(e=>`[${e}]`).join(", "),_e=`.${v.tableCell}`,mi=`${_e}[role="columnheader"]`;function Et(e){let t=new Map;for(let o of e.querySelectorAll("[id]"))t.set(o.id,o);let i=o=>{let a=o;for(let s=o.closest(_e);s&&e.contains(s);s=s.parentElement?.closest(_e)??null)a=s;return a},r=new Set,n=new Set([e]),l=Array.from(e.querySelectorAll(`a[href], .${v.note}, ${mi}`));for(;l.length>0;){let o=i(l.pop());if(r.has(o))continue;r.add(o);let a=[o,...o.querySelectorAll(pi)];for(let s=o.parentElement;s&&!n.has(s);s=s.parentElement)n.add(s),a.push(s);for(let s of a)for(let c of Pt)for(let p of s.getAttribute(c)?.split(/\s+/)??[]){let g=t.get(p);g&&!r.has(g)&&l.push(g);}}return {kept:r,onPath:n}}function Tt(e){let{kept:t,onPath:i}=Et(e),r=n=>{for(let l of Array.from(n.childNodes))t.has(l)||(i.has(l)?r(l):l.remove());};return r(e),e}function yi(e,t={}){return Tt(Xe(e,t))}var gi=["layout-page-mirror",v.content,v.header,v.footer,v.block,v.table,v.tableRow,v.tableCell,v.notes,v.blockSdt];function hi(e,t){let i=e.ownerDocument,r=e.getAttribute("lang"),n=e.getAttribute("dir"),l=e.parentElement,o=(s,c)=>c!==null&&l?.closest(`[${s}]`)?.getAttribute(s)!==c;if(!o("lang",r)&&!o("dir",n))return i.createTextNode(t);let a=i.createElement("span");return r&&a.setAttribute("lang",r),n&&a.setAttribute("dir",n),a.textContent=t,a}function At(e){let{kept:t,onPath:i}=Et(e),r=n=>{if(t.has(n))return;if(!i.has(n)||n===e&&t.size===0)for(let o of Array.from(n.attributes))(o.name==="id"||o.name.startsWith("data-"))&&n.removeAttribute(o.name);if(!(n===e||!n.classList.contains("layout-run")&&gi.some(o=>n.classList.contains(o)))&&!i.has(n)){if(n.classList.contains(v.revisionPmarkGlyph)||n.getAttribute("aria-hidden")==="true"||n.hasAttribute("inert")||n.style?.visibility==="hidden"){n.remove();return}let o=n.getAttribute("role")==="img"||!!n.getAttribute("alt"),a=o||!!n.getAttribute("aria-label");if(n.children.length===0){n.textContent&&!o?n.replaceWith(hi(n,n.textContent)):a||n.remove();return}}for(let o of Array.from(n.children))r(o);for(let o of Array.from(n.childNodes))if(o.nodeType===3){for(;o.nextSibling?.nodeType===3;){let a=o.nextSibling;o.textContent=(o.textContent??"")+(a.textContent??""),a.remove();}o.textContent||o.remove();}};return r(e),e.style.contentVisibility="auto",e}function bi(e,t={}){return At(Xe(e,t))}function xi(e,t){let i=/^oox-(footnote|endnote)-(.+)$/.exec(t);if(i){let[,o,a]=i;return (e.noteAreas??[]).some(s=>(s.kind??"footnote")===o&&(s.noteIds??[]).some(c=>String(c)===a)&&(s.primitives??[]).some(c=>c.groupId===`${o}-${a}`))}let r=/^oox-noteref-(footnote|endnote)-(.+)$/.exec(t);if(!r)return false;let[,n,l]=r;return Ye(e).some(o=>(o.kind==="text"||o.kind==="glyphRun")&&!o.href&&o.noteRef?.id!==void 0&&String(o.noteRef.id)===l&&(o.noteRef.kind??"footnote")===n)}function Xe(e,t={}){let i=t.document??document,r=t.labels,n=new Set(Ie(e).flatMap(s=>s.widgets.filter(c=>c.occluded).flatMap(c=>c.primitives))),l={labels:r,noteRefIds:new Set,occludedWidgets:n},o=i.createElement("div");o.className=v.page,o.setAttribute("role","document"),r?.page&&o.setAttribute("aria-label",r.page),o.dataset.pageIndex=String(e.pageIndex),e.sectionId!==void 0&&(o.dataset.sectionId=e.sectionId),e.sectionIndex!==void 0&&(o.dataset.sectionIndex=String(e.sectionIndex)),e.sectionPageIndex!==void 0&&(o.dataset.sectionPageIndex=String(e.sectionPageIndex)),e.sectionPageNumber!==void 0&&(o.dataset.sectionPageNumber=String(e.sectionPageNumber)),e.pageLabel!==void 0&&(o.dataset.pageLabel=e.pageLabel),o.style.position="relative",o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,o.style.opacity="0",o.style.pointerEvents="none";let a=i.createElement("div");a.className=v.content,a.style.position="absolute",a.style.left="0",a.style.top="0",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,o.appendChild(a);for(let s of (e.pageBorders??[]).filter(c=>c.zOrder==="back"))a.appendChild(It(s,i,0));pe(a,e.primitives,i,0,l);for(let s of e.noteAreas??[])a.appendChild(Ti(s,e,i,l));for(let s of [e.header,e.footer])s&&o.appendChild(Li(s,e,i,l));for(let s of (e.pageBorders??[]).filter(c=>c.zOrder!=="back"))o.appendChild(It(s,i,0));return o}function Li(e,t,i,r){let n=i.createElement("div");n.className=e.kind==="header"?v.header:v.footer,n.dataset.hfRid=e.rId;let l=e.kind==="header"?r.labels?.header:r.labels?.footer;return l&&(n.setAttribute("role","region"),n.setAttribute("aria-label",l)),n.style.position="absolute",n.style.left="0",n.style.top=`${e.y}px`,n.style.width=`${t.width}px`,n.style.height=`${e.height}px`,pe(n,e.primitives,i,-e.y,r),n}function pe(e,t,i,r,n){let l=new Map;for(let o of t){let a=o.kind==="line"?void 0:o.blockKey??o.blockId;if(a===void 0){e.appendChild(Me(o,i,r,n));continue}let s=o.table,c=s?.tableId!==void 0?`table:${s.tableId}#${s.rowStart??0}`:a,p=l.get(c);if(!p){let g=i.createElement("div");g.dataset.blockId=String(s?.tableId??a),g.style.position="absolute",g.style.left="0",g.style.top="0",e.appendChild(g),p={el:g,prims:[]},l.set(c,p);}p.prims.push(o);}for(let o of l.values())vi(o,i,r,n);Ii(l);}function vi(e,t,i,r){let{el:n,prims:l}=e;if(!l.some(m=>m.cell!==void 0||m.structuralRevision?.scope==="table"||m.structuralRevision?.scope==="row"||m.structuralRevision?.scope==="cell")){Rt(n,l,t,i,r);return}n.className=v.table,n.setAttribute("role","table");let a=l.find(m=>m.table!==void 0)?.table;e.table=a,e.cells=[],a?.tableId!==void 0&&(n.dataset.tableId=a.tableId),a?.rowStart!==void 0&&(n.dataset.rowStart=String(a.rowStart)),a?.rowEnd!==void 0&&(n.dataset.rowEnd=String(a.rowEnd)),a?.headerRowCount!==void 0&&(n.dataset.headerRowCount=String(a.headerRowCount)),a?.parentTableId!==void 0&&(n.dataset.parentTableId=a.parentTableId),a?.caption&&n.setAttribute("aria-label",a.caption),a?.description&&n.setAttribute("aria-description",a.description);let s=ke(l,"table");s&&we(n,s),We(n,l.find(m=>m.sdt!==void 0)?.sdt);for(let m of l)m.cell===void 0&&n.appendChild(Me(m,t,i,r));let c=new Map,p=0,g=0;for(let m of l){if(m.cell===void 0)continue;let{row:y,col:h}=m.cell;p=Math.max(p,y+(m.cell.rowSpan??1)),g=Math.max(g,h+(m.cell.colSpan??1));let L=c.get(y);L||(L=new Map,c.set(y,L));let R=L.get(h);R||(R={ref:m.cell,prims:[]},L.set(h,R)),R.prims.push(m);}n.setAttribute("aria-rowcount",String(a?.rowCount??p)),n.setAttribute("aria-colcount",String(a?.columnCount??g));for(let m of [...c.keys()].sort((y,h)=>y-h)){let y=t.createElement("div");y.className=v.tableRow,y.setAttribute("role","row"),y.setAttribute("aria-rowindex",String(m+1));let h=ke(l,"row",m);h&&we(y,h),y.style.position="absolute",y.style.left="0",y.style.top="0",n.appendChild(y);let L=c.get(m);for(let R of [...L.keys()].sort((k,D)=>k-D)){let k=L.get(R),D=t.createElement("div");D.className=v.tableCell,D.setAttribute("role",k.ref.isHeader?"columnheader":"cell"),D.setAttribute("aria-colindex",String(R+1)),k.ref.cellId&&(D.id=k.ref.cellId),k.ref.headerIds?.length&&D.setAttribute("aria-labelledby",k.ref.headerIds.join(" ")),k.ref.repeatedHeader&&(D.dataset.repeatedHeader="true"),k.ref.noWrap&&(D.dataset.noWrap="true");let w=k.ref.rowSpan??1,A=k.ref.colSpan??1;w>1&&D.setAttribute("aria-rowspan",String(w)),A>1&&D.setAttribute("aria-colspan",String(A));let P=ke(k.prims,"cell",m,R);P&&we(D,P),k.ref.continuation&&(D.dataset.vmergeContinuation="true"),D.style.position="absolute",D.style.left="0",D.style.top="0";let C=new Map,F=[];for(let H of k.prims){let G=H.blockKey??H.blockId;if(G===void 0){F.push(H);continue}let N=C.get(G);N?N.push(H):C.set(G,[H]);}for(let H of $e(F))D.appendChild(Me(H,t,i,r));for(let[H,G]of C){let N=t.createElement("div");N.dataset.blockId=String(H),N.style.position="absolute",N.style.left="0",N.style.top="0",Rt(N,G,t,i,r),D.appendChild(N);}Di(D,k.prims),Bt(D,k.prims),e.cells.push({el:D,bounds:Ct(k.prims)}),y.appendChild(D);}}Qe(n,l);}function Rt(e,t,i,r,n){let l=t.find(c=>c.chart!==void 0)?.chart;e.className=l?`${v.block} ${v.chart}`:v.block,e.setAttribute("role",l?"img":"paragraph"),l?.label&&e.setAttribute("aria-label",l.label);for(let c of $e(t))e.appendChild(Me(c,i,r,n));let o=ke(t,"pmark");o&&we(e,o),Ri(e,t,i,r),We(e,t.find(c=>c.sdt!==void 0)?.sdt);let a=t.find(c=>c.paraId!==void 0)?.paraId;a!==void 0&&(e.dataset.paraId=a);let s=t.find(c=>c.fromLine!==void 0);s?.fromLine!==void 0&&(e.dataset.fromLine=String(s.fromLine),s.toLine!==void 0&&(e.dataset.toLine=String(s.toLine))),Bt(e,t),ki(e,t);}function Ri(e,t,i,r){Qe(e,t);let n=Number(e.dataset.docStart),l=Number(e.dataset.docEnd),o=t.map(g=>g.fragmentDocStart).filter(g=>Number.isFinite(g)),a=t.map(g=>g.fragmentDocEnd).filter(g=>Number.isFinite(g)),s=o.length>0?Math.min(...o):void 0,c=a.length>0?Math.max(...a):void 0,p=s??(Number.isFinite(n)&&n===l&&n>0?n-1:void 0);if(p!==void 0&&(e.dataset.docStart=String(p)),c!==void 0&&(e.dataset.docEnd=String(c)),p!==void 0&&!t.some(g=>g.docStart===p)){let g=$e(t).find(y=>Fe(y)!==void 0),m=g?Fe(g):void 0;if(m){let y=i.createElement("span");y.className="layout-mirror-structural-anchor",y.dataset.docStart=String(p),y.dataset.docEnd=String(p),ee(y,m,r),e.insertBefore(y,e.firstChild);}}}function Di(e,t){let i=e.querySelectorAll(".layout-paragraph[data-doc-start]"),r=1/0,n=-1/0;for(let l of i){let o=Number(l.dataset.docStart),a=Number(l.dataset.docEnd);Number.isFinite(o)&&(r=Math.min(r,o)),Number.isFinite(a)&&(n=Math.max(n,a));}r!==1/0&&(e.dataset.docStart=String(r)),n!==-1/0&&(e.dataset.docEnd=String(n)),r===1/0&&n===-1/0&&Qe(e,t);}function Ii(e){let t=new Map;for(let i of e.values())i.table?.tableId&&t.set(i.table.tableId,i);for(let i of e.values()){let r=i.table?.parentTableId;if(!r)continue;let n=t.get(r),l=Ct(i.prims);if(!n?.cells?.length||!l)continue;let o=l.x+l.w/2,a=l.y+l.h/2,s=n.cells.filter(c=>c.bounds&&Si(o,a,c.bounds));s.sort((c,p)=>Dt(c.bounds)-Dt(p.bounds)),s[0]?.el.appendChild(i.el);}}function Si(e,t,i){return e>=i.x&&e<=i.x+i.w&&t>=i.y&&t<=i.y+i.h}function Dt(e){return e.w*e.h}function Ct(e){let t;for(let i of e){let r=i.clipGroup?.clip,n=r?.x!==void 0&&r.y!==void 0&&r.w!==void 0&&r.h!==void 0?{x:r.x,y:r.y,w:r.w,h:r.h}:Fe(i);if(!n)continue;if(!t){t={...n};continue}let l=Math.max(t.x+t.w,n.x+n.w),o=Math.max(t.y+t.h,n.y+n.h);t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),t.w=l-t.x,t.h=o-t.y;}return t}function Fe(e){switch(e.kind){case "text":return c(e);case "glyphRun":return d(e);case "rect":return {x:e.x,y:e.y,w:e.w,h:e.h};case "image":case "shape":return {x:e.x,y:e.y,w:e.w,h:e.h};case "decoration":return {x:e.x,y:e.y,w:e.w,h:e.h}}}function $e(e){let t=e.filter(r=>r.logicalOrder!==void 0).sort((r,n)=>(r.logicalOrder??0)-(n.logicalOrder??0)||(r.docStart??0)-(n.docStart??0));if(t.length<2)return e;let i=0;return e.map(r=>r.logicalOrder===void 0?r:t[i++])}function Bt(e,t){let i=t.find(l=>l.lang)?.lang;i&&(e.lang=i);let r=t.find(l=>l.bidiLevel!==void 0||"rtl"in l);if(!r)return;let n=r.bidiLevel!==void 0?r.bidiLevel%2===1:"rtl"in r?r.rtl:false;e.dir=n?"rtl":"ltr";}function ki(e,t){let i=t.find(r=>r.ariaLabel||r.ariaDescription||r.decorative||r.hiddenObject||r.groupId);i&&Gt(e,i);}function Qe(e,t){let i,r;for(let n of t)n.docStart!==void 0&&(i=i===void 0?n.docStart:Math.min(i,n.docStart)),n.docEnd!==void 0&&(r=r===void 0?n.docEnd:Math.max(r,n.docEnd));i!==void 0&&(e.dataset.docStart=String(i)),r!==void 0&&(e.dataset.docEnd=String(r));}function ke(e,t,i,r){return e.find(n=>{let l=n.structuralRevision;return !(!l||l.scope!==t||i!==void 0&&l.rowIndex!==i||r!==void 0&&l.colIndex!==r)})?.structuralRevision}function Me(e,t,i,r){let n=wi(e,t,i,r);return r.occludedWidgets.has(e)&&fe(n),n}function wi(e$1,t,i,r){switch(e$1.kind){case "text":{let n=St(t,e$1,r);return n.className=v.text,n.textContent=e$1.text,ee(n,c(e$1),i),n.style.font=e$1.font,kt(n,e$1),wt(n,e$1),Ne(n,e$1.hidden&&e$1.opacity===void 0?.4:e$1.opacity,e$1.rotationDeg,e$1.horizontalScale),e$1.structuralRevision?.scope==="pmark"&&(n.classList.add(v.revisionPmarkGlyph),e$1.structuralRevision.kind==="ins"&&n.classList.add(v.revisionPmarkIns),e$1.structuralRevision.kind==="del"&&n.classList.add(v.revisionPmarkDel),n.setAttribute("aria-hidden","true")),e$1.listMarker&&(n.classList.add(v.listMarker),n.setAttribute("aria-hidden","true"),e$1.listMarkerRevision&&(n.style.color=e$1.listMarkerRevision==="ins"?"rgb(46, 125, 50)":"rgb(198, 40, 40)")),ae(n,e$1),n}case "glyphRun":{let n=St(t,e$1,r);return n.className=v.text,n.textContent=e$1.text,ee(n,d(e$1),i),n.style.fontSize=`${e$1.size}px`,Mi(n,e$1.fallbackFont),kt(n,e$1),wt(n,e$1),Ne(n,e$1.hidden&&e$1.opacity===void 0?.4:e$1.opacity,e$1.rotationDeg,e$1.horizontalScale),ae(n,e$1),n}case "rect":{let n=t.createElement("div");return n.className=v.rect,ee(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},i),ae(n,e$1),n}case "line":{let n=t.createElement("div");return n.className=e$1.role==="table-cut"?v.tableCut:v.line,e$1.role&&e$1.role!=="table-cut"&&(n.dataset.role=e$1.role),ee(n,e(e$1),i),n.setAttribute("aria-hidden","true"),n}case "image":{let n=e$1.href?t.createElement("a"):t.createElement("div");return n.className=v.image,e$1.decorative?n.setAttribute("aria-hidden","true"):(n.setAttribute("role","img"),e$1.altText&&n.setAttribute("aria-label",e$1.altText)),Ht(n,e$1),n.dataset.relId=e$1.relId,ee(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},i),Ne(n,e$1.opacity,e$1.rotationDeg),e$1.filter&&(n.style.filter=e$1.filter),ae(n,e$1),e$1.revision&&(n.style.outline=`2px solid ${e$1.revision.kind==="ins"?"rgb(46, 125, 50)":"rgb(198, 40, 40)"}`),e$1.href||(n.style.pointerEvents="auto"),n}case "shape":{let n=t.createElement("div");return n.className=v.shape,e$1.decorative?n.setAttribute("aria-hidden","true"):n.setAttribute("role","img"),ee(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},i),Pi(n,e$1.transform),ae(n,e$1),n}case "decoration":{let n=t.createElement("span");return n.className=v.decoration,n.dataset.deco=e$1.deco,ee(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},i),ae(n,e$1),n}}}function It(e,t,i){let r=t.createElement("div");return r.className=v.pageBorder,ee(r,{x:e.x,y:e.y,w:e.w,h:e.h},i),r.style.boxSizing="border-box",r.style.pointerEvents="none",r.style.zIndex=e.zOrder==="back"?"0":"20",Se(r,"Top",e.top),Se(r,"Right",e.right),Se(r,"Bottom",e.bottom),Se(r,"Left",e.left),r}function ee(e,t,i=0){e.style.position="absolute",e.style.left=`${t.x}px`,e.style.top=`${t.y+i}px`,e.style.width=`${t.w}px`,e.style.height=`${t.h}px`;}function St(e,t,i){let r=t.noteRef?.id!==void 0?t.noteRef:void 0,n=t.href||r?e.createElement("a"):e.createElement("span");if(Ht(n,t),r&&!t.href){let l=r.kind??"footnote",o=`oox-${l}-${r.id}`;n.setAttribute("href",`#${o}`),n.setAttribute("role","doc-noteref");let a=`oox-noteref-${l}-${r.id}`;i.noteRefIds.has(a)||(i.noteRefIds.add(a),n.id=a);}return n}function Ht(e,t){let{href:i}=t;if(!i)return;e.setAttribute("href",i),e.dataset.href=i;let r=t.linkTitle??t.tooltip;r&&(e.title=r),t.linkTarget?e.setAttribute("target",t.linkTarget):i.startsWith("#")||e.setAttribute("target","_blank"),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer"),t.linkHistory!==void 0&&(e.dataset.linkHistory=String(t.linkHistory)),t.linkDocLocation!==void 0&&(e.dataset.linkDocLocation=t.linkDocLocation);}function Mi(e,t){if(t)for(let i of t.split(" ")){if(i.endsWith("px"))break;i==="italic"?e.style.fontStyle="italic":/^[1-9]00$/.test(i)&&i!=="400"&&(e.style.fontWeight=i);}}function kt(e,t){t.lang&&(e.lang=t.lang),t.bidiLevel!==void 0?e.dir=t.bidiLevel%2===1?"rtl":"ltr":t.rtl&&(e.dir="rtl");}function Se(e,t,i){if(!i)return;let r=e.style;r[`border${t}Width`]=`${i.width}px`,r[`border${t}Style`]=i.style,r[`border${t}Color`]=i.color;}function Ne(e,t,i,r){t!==void 0&&(e.style.opacity=String(t));let n=[];i&&n.push(`rotate(${i}deg)`),r!==void 0&&r!==100&&n.push(`scaleX(${r/100})`),n.length>0&&(e.style.transform=n.join(" "),e.style.transformOrigin=r!==void 0&&r!==100?"left center":"center center");}function Pi(e,t){if(!t)return;let i=[];t.rotation&&i.push(`rotate(${t.rotation}deg)`),t.flipH&&i.push("scaleX(-1)"),t.flipV&&i.push("scaleY(-1)"),i.length!==0&&(e.style.transform=i.join(" "),e.style.transformOrigin="center center");}function wt(e,t){if(t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.hidden&&(e.classList.add("docx-hidden"),e.style.textDecoration="underline dotted"),t.textShadow==="emboss"?e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)":t.textShadow==="imprint"?e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)":t.textShadow==="shadow"&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let i=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",r=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=i,e.style.textEmphasisPosition=r,e.style.webkitTextEmphasis=i,e.style.webkitTextEmphasisPosition=r;}t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function ae(e,t){if(t.docStart!==void 0&&(e.dataset.docStart=String(t.docStart)),t.docEnd!==void 0&&(e.dataset.docEnd=String(t.docEnd)),t.commentIds&&t.commentIds.length>0&&(e.dataset.commentId=t.commentIds.join(" ")),t.field){let i=t.field.type??t.field.category;i&&(e.dataset.fieldType=i),t.field.category&&(e.dataset.fieldCategory=t.field.category),t.field.instruction&&(e.dataset.fieldInstruction=t.field.instruction);let r=t.field.instruction?.trim()||i;r&&e.setAttribute("aria-description",r);}if(t.noteRef?.id!==void 0&&(e.dataset.noteRefKind=t.noteRef.kind??"footnote",e.dataset.noteRefId=String(t.noteRef.id)),t.comment){t.comment.status&&(e.dataset.commentStatus=t.comment.status),t.comment.authorId&&(e.dataset.commentAuthorId=t.comment.authorId),t.comment.paletteIndex!==void 0&&(e.dataset.commentPaletteIndex=String(t.comment.paletteIndex)),t.comment.color&&(e.dataset.commentColor=t.comment.color),t.comment.selected!==void 0&&(e.dataset.commentSelected=String(t.comment.selected)),t.comment.authorName&&(e.dataset.commentAuthorName=t.comment.authorName),t.comment.date&&(e.dataset.commentDate=t.comment.date),t.comment.replyCount!==void 0&&(e.dataset.commentReplyCount=String(t.comment.replyCount));let i=[t.comment.status,t.comment.authorName??t.comment.authorId,t.comment.date,t.comment.text,...(t.comment.replies??[]).map(r=>[r.authorName,r.text].filter(Boolean).join(": "))].filter(Boolean).join(", ");i&&e.setAttribute("aria-description",i);}if(t.revision){e.dataset.changeAuthor=t.revision.author,e.dataset.changeDate=t.revision.date,e.dataset.revisionId=t.revision.revisionId,e.classList.add(t.revision.kind==="ins"?"docx-insertion":"docx-deletion"),e.hasAttribute("role")||e.setAttribute("role",t.revision.kind==="ins"?"insertion":"deletion");let i=[t.revision.author,t.revision.date].filter(Boolean).join(", ");i&&e.setAttribute("aria-description",i);}t.href&&(e.dataset.href=t.href),Ei(e,t.inlineSdtWidget),We(e,t.sdt),t.sdtPath?.length&&(e.dataset.sdtPath=t.sdtPath.map(i=>i.groupId).join(" ")),t.logicalOrder!==void 0&&(e.dataset.logicalOrder=String(t.logicalOrder)),t.bidiLevel!==void 0&&(e.dataset.bidiLevel=String(t.bidiLevel)),Gt(e,t);}function Gt(e,t){if(t.groupId&&(e.dataset.groupId=t.groupId),t.decorative||t.hiddenObject){e.setAttribute("aria-hidden","true"),e.removeAttribute("role"),e.removeAttribute("aria-label"),e.removeAttribute("aria-description");return}t.ariaLabel&&e.setAttribute("aria-label",t.ariaLabel),t.ariaDescription&&e.setAttribute("aria-description",t.ariaDescription);}function We(e,t){t&&(e.classList.add(v.blockSdt),e.dataset.sdtGroupId=t.groupId,e.dataset.sdtType=t.sdtType,t.depth!==void 0&&(e.dataset.sdtDepth=String(t.depth)),t.tag!==void 0&&(e.dataset.sdtTag=t.tag),t.alias!==void 0&&(e.dataset.sdtAlias=t.alias),t.lock!==void 0&&(e.dataset.sdtLock=t.lock),t.checked!==void 0&&(e.dataset.sdtChecked=String(t.checked)),t.bound!==void 0&&(e.dataset.sdtBound=String(t.bound)),t.repeatingItem!==void 0&&(e.dataset.sdtRepeatingItem=String(t.repeatingItem)),!e.hasAttribute("aria-label")&&(t.alias||t.tag)&&e.setAttribute("aria-label",t.alias||t.tag||""),t.lock&&e.setAttribute("aria-readonly","true"));}function Ei(e,t){if(!t)return;e.classList.add(v.inlineSdtWidget);let i=t.controlKind??t.kind;e.dataset.sdtWidget=i,e.dataset.sdtGroupId=t.groupId,e.dataset.sdtPos=String(t.pos),t.tag!==void 0&&(e.dataset.sdtTag=t.tag),t.alias!==void 0&&(e.dataset.sdtAlias=t.alias),t.checked!==void 0&&(e.dataset.sdtChecked=String(t.checked),e.setAttribute("aria-checked",String(t.checked))),t.controlId!==void 0&&(e.dataset.sdtControlId=String(t.controlId)),t.value!==void 0&&(e.dataset.sdtValue=t.value),t.selectedIndex!==void 0&&(e.dataset.sdtSelectedIndex=String(t.selectedIndex)),t.dateFormat!==void 0&&(e.dataset.sdtDateFormat=t.dateFormat),t.dateLanguage!==void 0&&(e.dataset.sdtDateLanguage=t.dateLanguage),t.locked!==void 0&&(e.dataset.sdtLocked=String(t.locked)),i==="checkbox"?e.setAttribute("role","checkbox"):i==="dropDownList"||i==="comboBox"?(e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","false")):i==="date"?(e.setAttribute("role","button"),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("role","group"),e.removeAttribute("tabindex"),(t.alias||t.tag)&&e.setAttribute("aria-label",t.alias||t.tag||""),t.locked&&e.setAttribute("aria-disabled","true");}function we(e,t){switch(t.scope){case "pmark":e.classList.add(v.revisionPmark),t.kind==="ins"&&e.classList.add(v.revisionPmarkIns),t.kind==="del"&&e.classList.add(v.revisionPmarkDel);break;case "table":e.classList.add(v.revisionTable,Oe(t.kind));break;case "row":e.classList.add(v.revisionRow,Oe(t.kind));break;case "cell":e.classList.add(v.revisionCell,Oe(t.kind));break}e.dataset.revisionId=t.revisionId,e.dataset.revisionAuthor=t.author,t.date&&(e.dataset.revisionDate=t.date);let i=[t.author,t.date].filter(Boolean).join(", ");i&&e.setAttribute("aria-description",i);}function Oe(e){return e==="ins"?v.revisionIns:e==="del"?v.revisionDel:v.revisionMerge}function Ti(e,t,i,r){let n=i.createElement("section");n.className=v.notes,n.dataset.noteKind=e.kind??"footnote",e.sectionId&&(n.dataset.sectionId=e.sectionId),e.columns!==void 0&&(n.dataset.columns=String(e.columns)),n.style.position="absolute",n.style.left="0",n.style.top=`${e.y??0}px`,n.style.width=`${t.width}px`,n.style.height=`${e.height??0}px`;let l=new Map;for(let a of e.notes??[])a.id!==void 0&&l.set(a.id,a);pe(n,e.separatorPrimitives??[],i,-(e.y??0),r);let o=[...e.primitives??[]];for(let a of e.noteIds??[]){let c=`${e.kind??"footnote"}-${a}`,p=o.filter(y=>y.groupId===c);if(p.length===0)continue;for(let y of p){let h=o.indexOf(y);h>=0&&o.splice(h,1);}let g=i.createElement("aside");g.className=v.note,g.id=`oox-${c}`,g.dataset.noteId=String(a),g.setAttribute("role",e.kind==="endnote"?"doc-endnote":"doc-footnote");let m=l.get(a);if(m&&(m.label!==void 0&&(g.dataset.noteLabel=m.label),m.anchorDocStart!==void 0&&(g.dataset.anchorDocStart=String(m.anchorDocStart)),m.anchorDocEnd!==void 0&&(g.dataset.anchorDocEnd=String(m.anchorDocEnd))),pe(g,p,i,-(e.y??0),r),m&&Mt(e,a)){let y=i.createElement("a");y.className=v.noteBacklink,y.setAttribute("role","doc-backlink"),y.setAttribute("href",`#oox-noteref-${c}`);let h=r.labels?.noteBacklink??m.label??String(a);y.setAttribute("aria-label",h),g.appendChild(y);}n.appendChild(g);}return o.length>0&&pe(n,o,i,-(e.y??0),r),n}function Nt(e,t,i){if(t==="body")return e.primitives.filter(n=>n.kind==="image");let r=t==="header"?e.header:e.footer;return !r||i!==void 0&&r.rId!==i?[]:r.primitives.filter(n=>n.kind==="image")}function Ve(e,t,i="body",r){for(let n of e.pages)for(let l of Nt(n,i,r))if(l.docStart===t)return {primitive:l,pageIndex:n.pageIndex,...i!=="body"?{region:i,rId:r}:{}};return null}function Ke(e,t,i,r,n="body",l){let o=e.pages[t];if(!o)return null;let a=Nt(o,n,l);for(let s=a.length-1;s>=0;s--){let c=a[s];if(!(i<c.x||i>c.x+c.w)&&!(r<c.y||r>c.y+c.h)&&g(c,i,r))return {primitive:c,pageIndex:o.pageIndex,...n!=="body"?{region:n,rId:l}:{}}}return null}function Ai(e,t){let i=e.imageByPos(t);if(!i)return;let r=e.contentBounds(i.pageIndex),n=e.paragraphRects(t).find(l=>l.pageIndex===i.pageIndex);if(!(!r||!n))return {horizontalEmu:Math.round(c$1(i.primitive.x-r.x)),verticalEmu:Math.round(c$1(i.primitive.y-n.y))}}var me=(()=>{let e=globalThis.FinalizationRegistry;return e?new e(t=>t()):null})();function Ci(e){return ()=>{let t=e.handle;if(e.handle=null,!(t===null||!e.eng||he.has(e.eng)))try{e.eng.closeDisplayList?.(t);}catch{}}}var Ot=globalThis.WeakRef;function Bi(e){return Ot?new Ot(e):Hi(e)}function Hi(e){return {deref:()=>e}}var Pe=new WeakMap,je=new WeakMap;function Gi(e){let t=je.get(e);t&&(t.newest=null);}var he=new WeakSet,Je=new Set;function Ni(e){return e!=null&&he.has(e)}function Oi(e){return Je.add(e),()=>{Je.delete(e);}}function ye(e){return e instanceof Error?typeof WebAssembly<"u"&&e instanceof WebAssembly.RuntimeError?true:e.name==="RuntimeError":false}var ge=-1;function Ue(e){return {pageIndex:e.pageIndex,width:e.width,height:e.height,primitives:[]}}function Yt(e){if(e.kind!=="text"&&e.kind!=="glyphRun"||e.docStart===void 0||e.docEnd===void 0||e.kind==="glyphRun"&&e.glyphs.length===0)return null;let t=e.kind==="text"?e.baselineY:e.glyphs.reduce((i,r)=>Math.max(i,r.y),-1/0);return Number.isFinite(t)?t:null}var ze=new WeakMap;function _i(e){if(ze.has(e))return ze.get(e)??null;let t=1/0,i=-1/0;for(let n of e.primitives){if(Yt(n)===null)continue;let l=f(n);t=Math.min(t,l.y),i=Math.max(i,l.y+l.h);}let r=t<=i?{top:t,bottom:i}:null;return ze.set(e,r),r}function Fi(e,t){let i=e.storeRevisions();if(!i)return null;let r=new Map;e.list.pages.forEach((s,c)=>r.set(s,c));let n=[],l=[],o=[],a=[];return t.pages.forEach((s,c)=>{let p=r.get(s);p!==void 0&&r.delete(s);let g=p===void 0?void 0:i[p];if(p===void 0||g===void 0){l.push([c,Ue(s)]),a.push(ge);return}if(g===ge){n.push([c,p]),a.push(ge);return}let m=y(s)===g?[]:A(s,g);if(m===null||m.some(y=>y.spanDelta!==void 0))l.push([c,Ue(s)]),a.push(ge);else if(m.length===0)n.push([c,p]),a.push(g);else {let y$1=m.map(h=>h.runs.map(L=>[L.start,L.count,L.changedMask,L.delta]));if(m.some(h=>h.anchors.length>0)){let h=m.map(L=>L.anchors.map(R=>[R.area,R.note,R.start,R.end]));o.push([c,p,y$1,h]);}else o.push([c,p,y$1]);a.push(y(s));}}),n.length===0&&o.length===0?null:{json:JSON.stringify({total:t.pages.length,...t.contractVersion!==void 0?{contractVersion:t.contractVersion}:{},reuse:n,replace:l,...o.length>0?{shift:o}:{}}),revisions:a}}var _t=new WeakMap;function Yi(e){let t=y(e),i=_t.get(e);if(i&&i.revision===t)return i;let r=1/0,n=-1/0,l=a=>{typeof a=="number"&&(a<r&&(r=a),a>n&&(n=a));};for(let a of e.primitives)l(a.docStart),l(a.docEnd),l(a.fragmentDocStart),l(a.fragmentDocEnd),l(a.inlineSdtWidget?.pos);let o={revision:t,min:r,max:n};return _t.set(e,o),o}function Ft(e,t,i,r=0){let n=Math.min(t,i)-1,l=Math.max(t,i)+1,o=new Set;return e.pages.forEach((a,s)=>{let c=Yi(a);if(!(c.min>l||c.max<n))for(let p=-r;p<=r;p+=1){let g=s+p;g>=0&&g<e.pages.length&&o.add(g);}}),[...o]}function Xi(e,t,i,r){let n=null,l=()=>(n??(n=JSON.stringify(e)),n),o=null,a=$i(t)?t:null,s={handle:null,eng:a?null:t??null},c=null,p,g,m=new Promise((d,u)=>{p=d,g=u;});m.catch(()=>{});let y$1=false,h=false,L=false,R={},k=null,D=i?Pe.get(i):void 0;D&&(k=D.hasHandle()?i:D.donor(),D.supersede()),D&&D.line!==(r??null)&&(D.lineage.newest=null);let w={newest:null};r&&(w=je.get(r)??w,je.set(r,w));let A=()=>a??s.eng,P=()=>{let d=A();return d!==null&&he.has(d)},C$1=(d,u)=>{let f=u instanceof Error?u:new Error(String(u));c=f,s.handle=null,me?.unregister(R);let b=A();if(!(!b||he.has(b))){he.add(b),console.error(`[CanvasRenderer] ${d} trapped in wasm; the session is unusable and must be rebuilt`,f);for(let x of Je)try{x(f);}catch(S){console.error("[CanvasRenderer] display-list source failure listener threw",S);}}},F=Ci(s),H=()=>{let d=k;if(k=null,!d||!s.eng?.updateDisplayList||!s.eng.hasDisplayListUpdate?.())return false;let u=Pe.get(d);if(!u||u.engine()!==s.eng)return false;let f=Fi(u,e);if(!f)return false;let b=u.takeHandle();if(b===null)return false;try{return s.eng.updateDisplayList(b,f.json),s.handle=b,o=f.revisions,!0}catch(x){try{s.eng.closeDisplayList?.(b);}catch{}return console.warn("[CanvasRenderer] display-list delta update failed; reopening",x),false}},G=()=>{if(!(L||h||y$1||s.handle!==null||!s.eng||P())&&!(!s.eng.hasDisplayListSession?.()||!s.eng.openDisplayList)&&(y$1=true,!H()))try{s.eng.updateDisplayList&&s.eng.hasDisplayListUpdate?.()?(s.handle=s.eng.openDisplayList(JSON.stringify({...e.contractVersion!==void 0?{contractVersion:e.contractVersion}:{},pages:e.pages.map(Ue)})),o=e.pages.map(()=>ge)):(s.handle=s.eng.openDisplayList(l()),o=e.pages.map(y));}catch(d){if(s.handle=null,ye(d)){C$1("display-list session open",d);return}console.warn("[CanvasRenderer] display-list session open failed; using JSON-arg queries",d);}},N=d=>{if(s.handle===null||!o||!s.eng?.updateDisplayList)return;let u=o,f=[];for(let b of d){let x=e.pages[b];x&&u[b]!==y(x)&&f.push([b,x]);}if(f.length!==0)try{s.eng.updateDisplayList(s.handle,JSON.stringify({total:e.pages.length,...e.contractVersion!==void 0?{contractVersion:e.contractVersion}:{},keep:!0,replace:f}));for(let[b,x]of f)u[b]=y(x);}catch(b){if(ye(b)){C$1("display-list page load",b),o=null;return}F(),me?.unregister(R),o=null,console.warn("[CanvasRenderer] display-list page load failed; using JSON-arg queries",b);}},Te=()=>e.pages.map((d,u)=>u);a||s.eng?p():C().then(d=>{s.eng=d,p();},d=>{c=d instanceof Error?d:new Error(String(d)),g(c),console.warn("[CanvasRenderer] display-list query engine failed to load",c);});let re=(d,u,f,b)=>{if(!s.eng||P()||(s.handle===null&&G(),s.handle!==null&&d&&N(b()),P()))return null;if(s.handle!==null&&d)try{return d(s.handle)}catch(x){if(ye(x))return C$1(f,x),null;console.warn(`[CanvasRenderer] ${f} session query failed; falling back`,x),F();}try{return u()}catch(x){return ye(x)?(C$1(f,x),null):(c=x instanceof Error?x:new Error(String(x)),console.warn(`[CanvasRenderer] ${f} query failed`,x),null)}},$=(d,u,f)=>{if(d===null)return u;try{return JSON.parse(d)}catch(b){return c=b instanceof Error?b:new Error(String(b)),console.warn(`[CanvasRenderer] ${f} returned invalid JSON`,b),u}},E=()=>{if(a||!h||s.handle!==null||!r)return;let d=w.newest?.deref();return d&&!Pe.get(d)?.disposed()?d:null},O=(d,u)=>(...f)=>{let b=E();return b?u(b,...f):d(...f)},T=(d,u)=>{if(P())return null;try{return d()}catch(f){return ye(f)?(C$1(`resident ${u}`,f),null):(c=f instanceof Error?f:new Error(String(f)),console.warn(`[CanvasRenderer] resident ${u} query failed`,f),null)}},j=(d,u,f)=>{let b=E();if(b!==void 0)return b?.hitTestRegions(d,u,f)??null;if(a)return $(T(()=>a.displayHitTestRegionsJson(d,u,f),"hit_test_regions"),null,"hit_test_regions");let x=re(s.eng?.hitTestRegionsByHandle&&(S=>s.eng.hitTestRegionsByHandle(S,d,u,f)),()=>s.eng.hitTestRegionsJson(l(),d,u,f),"hit_test_regions",()=>[d]);return $(x,null,"hit_test_regions")},_=(d,u)=>{let f=E();if(f!==void 0)return f?.rangeRects(d,u)??[];if(a)return $(T(()=>a.displayRangeRectsJson(d,u),"range_rects"),[],"range_rects");let b=re(s.eng?.rangeRectsByHandle&&(x=>s.eng.rangeRectsByHandle(x,d,u)),()=>s.eng.rangeRectsJson(l(),d,u),"range_rects",()=>Ft(e,d,u));return $(b,[],"range_rects")},J=(d,u,f)=>{let b=E();if(b!==void 0)return b?.verticalMove(d,u,f)??null;let x=f??Number.NaN;if(a)return $(T(()=>a.displayVerticalMoveJson(d,u,x),"vertical_move"),null,"vertical_move");if(!s.eng?.verticalMoveJson)return null;let S=re(s.eng.verticalMoveByHandle&&(I=>s.eng.verticalMoveByHandle(I,d,u,x)),()=>s.eng.verticalMoveJson(l(),d,u,x),"vertical_move",()=>Ft(e,d,d,1));return $(S,null,"vertical_move")},Q=(d,u,f,b)=>{let x=E();if(x!==void 0)return x?d==="header"||d==="footer"?x.hfRangeRects(d,u,f,b):d==="footnote"||d==="endnote"?x.noteRangeRects(d,Number(u),f,b):[]:[];if(a)return $(T(()=>a.displayRangeRectsRegionJson(d,u,f,b),"range_rects_region"),[],"range_rects_region");if(!s.eng||!s.eng.hasRangeRectsRegion?.())return [];let S=re(s.eng.rangeRectsRegionByHandle&&(I=>s.eng.rangeRectsRegionByHandle(I,d,u,f,b)),()=>s.eng.rangeRectsRegionJson(l(),d,u,f,b),"range_rects_region",Te);return $(S,[],"range_rects_region")},W=(d,u,f,b)=>Q(d,u,f,b),te=(d,u,f,b)=>Q(d,String(u),f,b),U=(d,u)=>{let f=(x,S)=>{let I=new Map;for(let M of x)S&&I.has(M.pageIndex)||I.set(M.pageIndex,{pageIndex:M.pageIndex,x:S?M.x:M.x+M.width,y:M.y,width:0,height:M.height});return [...I.values()]},b=d(u,u+1);if(b.length>0)return f(b,true);if(u>0){let x=d(u-1,u);if(x.length>0)return f(x,false)}return []},Le=(d,u,f)=>U((b,x)=>W(d,u,b,x),f),Jt=(d,u,f)=>U((b,x)=>te(d,u,b,x),f),Ut=d=>{let u=e.pages.filter(M=>{let q=M.unbuilt?M.positionSpan:void 0;return q!==void 0&&d>=q[0]&&d<=q[1]});if(u.length===0)return null;let f=Math.max(...u.map(M=>M.positionSpan[0])),b=Math.min(...u.map(M=>M.positionSpan[1])),x=b>f?(d-f)/(b-f+1):1,S=Math.min(u.length-1,Math.floor(x*u.length)),I=u[S];return {pageIndex:I.pageIndex,x:I.contentBounds?.x??0,y:I.contentBounds?.y??0,width:0,height:0}},it=d=>{let u=E();if(u!==void 0)return u?.caretRect(d)??null;let f=_(d,d+1);if(f.length>0){let x=f[0];return {pageIndex:x.pageIndex,x:x.x,y:x.y,width:0,height:x.height}}let b=Ut(d);if(b)return b;if(d>0){let x=_(d-1,d);if(x.length>0){let S=x[x.length-1];return {pageIndex:S.pageIndex,x:S.x+S.width,y:S.y,width:0,height:S.height}}}return null},rt=d=>{let u=E();if(u!==void 0)return u?.anchorRect(d)??null;let f=_(d,d+2);return f.length>0?f[0]:it(d)},qt=(d,u,f)=>{let b=W(d,u,f,f+2);if(b.length===0)return Le(d,u,f);let x=new Map;for(let S of b)x.has(S.pageIndex)||x.set(S.pageIndex,S);return [...x.values()]},ot=(d,u)=>({pageIndex:d,x:u.x,y:u.y,width:u.w,height:u.h}),Zt=d=>{let u=e.pages[d];return u?{pageIndex:u.pageIndex,x:0,y:0,width:u.width,height:u.height}:null},en=d=>{let u=e.pages[d],f=u?.contentBounds;return u&&f?{pageIndex:u.pageIndex,x:f.x,y:f.y,width:f.width,height:f.height}:null},tn=d=>{let u=e.pages[d];return u?(u.columnBounds??[]).map(f=>({pageIndex:u.pageIndex,x:f.x,y:f.y,width:f.width,height:f.height})):[]},Ae=d=>d.paraId?`para:${d.paraId}`:d.blockKey!==void 0?`block-key:${d.blockKey}`:d.blockId!==void 0?`block-id:${d.blockId}`:null,at=d=>d.blockKey??d.blockId,ve=null,nn=()=>{if(ve)return ve;let d=new Map;for(let u of e.pages)for(let f$1 of u.primitives){let b=Ae(f$1);if(!b||f$1.docStart===void 0||f$1.docEnd===void 0)continue;let x=f(f$1),S=d.get(b);S||(S=new Map,d.set(b,S));let I=S.get(u.pageIndex);if(!I){S.set(u.pageIndex,{...ot(u.pageIndex,x),from:f$1.docStart,to:f$1.docEnd,blockId:at(f$1),paraId:f$1.paraId});continue}let M=Math.min(I.x,x.x),q=Math.min(I.y,x.y),Z=Math.max(I.x+I.width,x.x+x.w),se=Math.max(I.y+I.height,x.y+x.h);I.x=M,I.y=q,I.width=Z-M,I.height=se-q,I.from=Math.min(I.from,f$1.docStart),I.to=Math.max(I.to,f$1.docEnd);}return ve=new Map([...d].map(([u,f])=>[u,[...f.values()]])),ve},rn=d=>{let u=null;for(let f of e.pages)for(let b of f.primitives){let x=Ae(b),S=b.docStart,I=b.docEnd;if(!x||S===void 0||I===void 0||d<S||d>I)continue;let M={identity:x,span:Math.max(0,I-S),startsAtPos:S===d};(!u||M.startsAtPos&&!u.startsAtPos||M.startsAtPos===u.startsAtPos&&M.span<u.span)&&(u=M);}return u?nn().get(u.identity)??[]:[]},on=1.5,st=[],lt=d=>{let u=st[d];if(u)return u;let f$1=e.pages[d];if(!f$1)return [];let b=[],x=new Map,S=0;for(let I of f$1.primitives){let M=Yt(I);if(M===null||I.docStart===void 0||I.docEnd===void 0)continue;let q=Ae(I)??`anonymous:${S++}`,Z=f(I),se=x.get(q),B=se?.find(le=>Math.abs(le.baseline-M)<=on);if(!B){let le={...ot(f$1.pageIndex,Z),baseline:M,from:I.docStart,to:I.docEnd,blockId:at(I),paraId:I.paraId};b.push(le),se?se.push(le):x.set(q,[le]);continue}let ft=Math.min(B.x,Z.x),pt=Math.min(B.y,Z.y),dn=Math.max(B.x+B.width,Z.x+Z.w),un=Math.max(B.y+B.height,Z.y+Z.h);B.x=ft,B.y=pt,B.width=dn-ft,B.height=un-pt,B.from=Math.min(B.from,I.docStart),B.to=Math.max(B.to,I.docEnd);}return st[d]=b,b},ct=null,dt=()=>(ct??(ct=e.pages.flatMap((d,u)=>lt(u))),ct),an=d=>{let u=null;for(let f of dt())d<f.from||d>f.to||(!u||f.to-f.from<u.to-u.from)&&(u=f);return u},ut=d=>{if(!d)return null;let u=d.primitive.docStart;if(u===void 0)return null;let{primitive:f}=d;return {...d,pos:u,rect:{pageIndex:d.pageIndex,x:f.x,y:f.y,width:f.w,height:f.h}}},sn=(d,u,f,b="body",x)=>ut(Ke(e,d,u,f,b,x)),ln=(d,u="body",f)=>ut(Ve(e,d,u,f)),cn=()=>{L||(L=true,F(),me?.unregister(R));},Re={get displayList(){return E()?.displayList??e},isReady:()=>(a!==null||s.eng!==null)&&c===null,sourceState:()=>c?{status:"error",error:c}:a||s.eng?{status:"ready"}:{status:"loading"},whenReady:()=>m,pageCount:()=>{let d=E();return d?d.pageCount():e.pages.length},pageSize:d=>{let u=E();if(u)return u.pageSize(d);let f=e.pages[d];return f?{width:f.width,height:f.height}:null},pageBounds:d=>{let u=E();return u?u.pageBounds(d):Zt(d)},contentBounds:O(en,(d,u)=>d.contentBounds(u)),columnBounds:O(tn,(d,u)=>d.columnBounds(u)),paragraphRects:O(rn,(d,u)=>d.paragraphRects(u)),visualLines:O(dt,d=>d.visualLines()),visualLinesOnPage:d=>{let u=E();return u?u.visualLinesOnPage(d):lt(d)},visualLineExtent:O(d=>{let u=e.pages[d];return u?_i(u):null},(d,u)=>d.visualLineExtent(u)),visualLineAtPosition:O(an,(d,u)=>d.visualLineAtPosition(u)),imageAtPoint:O(sn,(d,...u)=>d.imageAtPoint(...u)),imageByPos:O(ln,(d,...u)=>d.imageByPos(...u)),hitTestRegions:j,verticalMove:J,rangeRects:_,hfRangeRects:W,noteRangeRects:te,hfCaretRects:Le,noteCaretRects:Jt,hfAnchorRects:qt,caretRect:it,anchorRect:rt,sidebarAnchorRect:rt,prime:G,dispose:cn};return me?.register(Re,F,R),Pe.set(Re,{list:e,storeRevisions:()=>o,engine:()=>s.eng,hasHandle:()=>s.handle!==null,donor:()=>k,supersede:()=>{h=true;},lineage:w,line:r??null,disposed:()=>L,takeHandle:()=>{let d=s.handle;return d!==null&&(s.handle=null,me?.unregister(R)),d}}),w.newest=Bi(Re),Re}function $i(e){return typeof e?.displayHitTestRegionsJson=="function"&&typeof e?.displayVerticalMoveJson=="function"&&typeof e?.displayRangeRectsJson=="function"&&typeof e?.displayRangeRectsRegionJson=="function"}var Qi=16,Wi=24;function be(e){let t=[],i=24;for(let r=0;r<e.pageCount();r++)t.push(i),i+=(e.pageSize(r)?.height??0)+16;return t}var Vi=/^media:(0|[1-9]\d*)$/;function Xt(){let e=typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):typeof document<"u"?Object.assign(document.createElement("canvas"),{width:1,height:1}):null,t=e?.getContext("2d");return !e||!t?null:(t.fillStyle="#e6e6e6",t.fillRect(0,0,1,1),e)}function Ki(e={}){let t=new Map,{media:i,mediaScope:r}=e,n=r?.();return l=>{let o=i&&Vi.test(l);if(!o&&!l.startsWith("blob:")&&!l.startsWith("data:"))return null;r&&r()!==n&&(n=r(),t.clear());let a=t.get(l);return a||(a=new Promise(s=>{let c=l;if(o){let m=i(l);if(!m){s(Xt());return}c=URL.createObjectURL(new Blob([m.bytes],{type:m.mimeType}));}let p=new Image,g=m=>{o&&URL.revokeObjectURL(c),s(m);};p.onload=()=>g(p),p.onerror=()=>g(o?Xt():null),p.src=c;}),t.set(l,a)),a}}function zi(e,t){let i=e.activeCommentIds.length>0?t?.(e.activeCommentIds):void 0;return {hasSelection:e.hasSelection,inInsertion:e.inInsertion,inDeletion:e.inDeletion,hasComment:e.activeCommentIds.length>0,inList:e.inList,listLevel:e.listLevel??0,...i?.authorName!==void 0?{commentAuthor:i.authorName}:{},...i?.replyCount!==void 0?{commentReplyCount:i.replyCount}:{}}}function ji(e,t){if(!e)return [];let i=[];return !e.hasSelection&&t.hasSelection&&i.push({key:"selected"}),e.hasSelection&&!t.hasSelection&&i.push({key:"selectionCleared"}),!e.hasComment&&t.hasComment&&i.push({key:"commentedText",...t.commentAuthor!==void 0||t.commentReplyCount!==void 0?{vars:{...t.commentAuthor!==void 0?{author:t.commentAuthor}:{},...t.commentReplyCount!==void 0?{replies:t.commentReplyCount}:{}}}:{}}),!e.inInsertion&&t.inInsertion&&i.push({key:"trackedInsertion"}),!e.inDeletion&&t.inDeletion&&i.push({key:"trackedDeletion"}),(!e.inList&&t.inList||t.inList&&e.listLevel!==t.listLevel)&&i.push({key:"listItem",vars:{level:t.listLevel+1}}),i}function qe(e,t){let{doc:i,schema:r}=e.state,n=r.marks.comment,l=r.marks.insertion,o=r.marks.deletion;!n&&!l&&!o||i.descendants((a,s)=>{let c=a.attrs;if(c){let p=[c.trIns,c.trDel,c.pPrIns,c.pPrDel];for(let h of p){let L=h?.revisionId;typeof L=="number"&&t(`revision-${L}`,s);}let m=c.cellMarker?.info?.revisionId;typeof m=="number"&&t(`revision-${m}`,s);let y=[c.pPrChange,c.trPrChange,c.tcPrChange,c.tblPrChange];for(let h of y)if(Array.isArray(h))for(let L of h){let R=L?.info?.id;typeof R=="number"&&t(`revision-${R}`,s);}}if(a.isInline)for(let p of a.marks){let g=null;n&&p.type===n?g=`comment-${p.attrs.commentId}`:(l&&p.type===l||o&&p.type===o)&&(g=`revision-${p.attrs.revisionId}`),g&&t(g,s);}});}function Ji(e,t,i){let r=new Map;if(!e?.state)return r;let n=be(t),l=new Set;return qe(e,(o,a)=>{if(l.has(o))return;l.add(o);let s=t.anchorRect(a);if(!s)return;let c=i?i(s):(n[s.pageIndex]??0)+s.y;c!=null&&r.set(o,c);}),r}function Ui(e,t,i){if(!e.hfRid)return t.anchorRect(e.position);let r=i?.get(e.hfRid);return r?t.hfAnchorRects(r,e.hfRid,e.position)[0]??null:null}function qi(e,t,i,r,n,l,o){let a$1=new Map,s=be(n),c=(p,g)=>{if(!g||a$1.has(p))return a$1.has(p);let m=Ui(g,n,l);if(!m)return false;let y=o?o(m):(s[m.pageIndex]??0)+m.y;return y==null?false:(a$1.set(p,y),true)};for(let p of t){let g=`comment-${p}`;try{for(let m of e.resolveComment(String(p)))if(c(g,r.storyOffsetToDisplayPoint(m.story,m.start)))break}catch{}}for(let p of i)c(`revision-${a(p.revisionId)}`,r.locToDisplayPoint({story:p.story,...p.range.start}));return a$1}function Zi(e,t,i,r){let n=be(t);for(let{region:l,rId:o,view:a}of e)qe(a,(s,c)=>{if(i.has(s))return;let p=t.hfAnchorRects(l,o,c)[0];if(!p)return;let g=r?r(p):(n[p.pageIndex]??0)+p.y;g!=null&&i.set(s,g);});return i}var er=new Set(["tableInserted","tableDeleted","rowInserted","rowDeleted"]);function tr(e,t){let i=e.map(o=>{let a$1=t.locToDisplayPoint({story:o.range.story,...o.range.start}),s=t.locToDisplayPoint({story:o.range.story,...o.range.end}),c=a$1?.position??0,p=Math.max(c,s?.position??c);return {type:o.kind==="pPrIns"?"paragraphMarkInsertion":o.kind==="pPrDel"?"paragraphMarkDeletion":o.kind==="pPrChange"?"paragraphPropertiesChanged":o.kind==="trIns"?"rowInserted":o.kind==="trDel"?"rowDeleted":o.kind==="tableIns"?"tableInserted":o.kind==="tableDel"?"tableDeleted":o.kind,text:o.preview,author:o.author,date:o.date||void 0,from:c,to:p,revisionId:a(o.revisionId),...a$1?.hfRid?{hfRid:a$1.hfRid}:{}}}),r=new Map;for(let o of i){let a=r.get(o.revisionId)??[];a.push(o),r.set(o.revisionId,a);}let n=[...r.values()].map(o=>{let a=Math.min(...o.map(y=>y.from)),s=Math.max(...o.map(y=>y.to)),c=o.filter(y=>y.type==="insertion"),p=o.filter(y=>y.type==="deletion");if(c.length>0&&p.length>0)return {...c[0],type:"replacement",text:c.map(h=>h.text).join(""),deletedText:p.map(h=>h.text).join(""),from:a,to:s};let g=o.find(y=>y.type==="insertion"||y.type==="deletion")??o.find(y=>er.has(y.type))??o[0],m=o.filter(y=>y.type===g.type).map(y=>y.text).join("");return {...g,text:m,from:a,to:s}}),l=[];for(let o=0;o<n.length;o+=1){let a=n[o],s=n[o+1];a.type==="deletion"&&s?.type==="insertion"&&a.author===s.author&&a.date===s.date&&a.to===s.from&&a.hfRid===s.hfRid?(l.push({type:"replacement",text:s.text,deletedText:a.text,author:a.author,date:a.date,from:a.from,to:s.to,revisionId:a.revisionId,insertionRevisionId:s.revisionId,...a.hfRid?{hfRid:a.hfRid}:{}}),o+=1):l.push(a);}return {entries:l,commentToRevision:new Map}}function nr(e,t){let i=t.kind??"body";if(i==="body")return {kind:i,primitives:e.primitives};let r=i==="header"?e.header:e.footer;return !r||r.kind!==i||t.rId&&r.rId!==t.rId?null:{kind:i,rId:r.rId,primitives:r.primitives}}function ir(e){switch(e.kind){case "text":return c(e);case "glyphRun":return d(e);case "rect":case "image":case "shape":case "decoration":return {x:e.x,y:e.y,w:e.w,h:e.h};case "line":return {x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)}}}function rr(e){let t=ir(e),i=e.clipGroup?.clip;if(!i)return t;let r=i.x??0,n=i.y??0,l=r+Math.max(0,i.w??0),o=n+Math.max(0,i.h??0),a=Math.max(t.x,r),s=Math.max(t.y,n),c=Math.min(t.x+t.w,l),p=Math.min(t.y+t.h,o);return c<a||p<s?null:{x:a,y:s,w:c-a,h:p-s}}function or(e){return e.kind==="text"||e.kind==="glyphRun"?e.text:e.kind==="image"?e.altText??"":""}function ar(e,t,i){return t>=e.x&&t<=e.x+e.w&&i>=e.y&&i<=e.y+e.h}function sr(e,t,i,r,n={kind:"body"}){let l=e.pages[t];if(!l)return null;let o=nr(l,n);if(!o)return null;for(let a=o.primitives.length-1;a>=0;a--){let s=o.primitives[a];if(s.kind==="line"||!s.href||s.hiddenObject)continue;let c=rr(s);if(c&&ar(c,i,r))return {pageIndex:t,region:o.kind,rId:o.rId,href:s.href,tooltip:s.linkTitle??s.tooltip,displayText:or(s)||s.href,rect:c}}return null}var V=7.5,ie=16,$t=320,lr=30,cr=200,dr=24,ur=10,fr=10,pr=24;function Qt(e){let t;switch(e.kind){case "text":t=c(e);break;case "glyphRun":t=d(e);break;case "rect":case "image":case "shape":case "decoration":t={x:e.x,y:e.y,w:e.w,h:e.h};break;case "line":t={x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)};break}let i=et(e);return i?mr(t,i)??{x:i.x,y:i.y,w:0,h:0}:t}function et(e){let t=e.clipGroup?.clip;return t?{x:t.x??0,y:t.y??0,w:Math.max(0,t.w??0),h:Math.max(0,t.h??0)}:null}function mr(e,t){let i=Math.max(e.x,t.x),r=Math.max(e.y,t.y),n=Math.min(e.x+e.w,t.x+t.w),l=Math.min(e.y+e.h,t.y+t.h);return n<i||l<r?null:{x:i,y:r,w:n-i,h:l-r}}function Wt(e,t,i){if(e.docStart!=null){let r=t(e.docStart);if(r!=null){let n={tableKey:r,docStartSample:e.docStart};return e.table?.tableId&&!i.has(e.table.tableId)&&i.set(e.table.tableId,n),n}}return e.table?.tableId?i.get(e.table.tableId)??null:null}function Vt(e,t,i){let r=e.table?.tableId;if(!r)return null;let n=t.get(r);return n?i.get(n.tableKey)??null:null}function Kt(e,t,i,r){let n=new Map;for(let o of t){if(o.kind==="line")continue;let a=o.cell;if(!a)continue;let s=Wt(o,i,r);if(!s)continue;let{tableKey:c,docStartSample:p}=s,g=Qt(o),m=et(o),y=m??g,h=n.get(c);if(h||(h={tableKey:c,docStartSample:p,contentMinX:y.x,contentMinY:y.y,contentMaxX:y.x+y.w,contentMaxY:y.y+y.h,exactLeftX:[],exactBottomY:[],exactClipLeftX:[],exactClipBottomY:[],rows:new Map},n.set(c,h)),p<h.docStartSample&&(h.docStartSample=p),h.contentMinX=Math.min(h.contentMinX,y.x),h.contentMinY=Math.min(h.contentMinY,y.y),h.contentMaxX=Math.max(h.contentMaxX,y.x+y.w),h.contentMaxY=Math.max(h.contentMaxY,y.y+y.h),m&&(h.exactClipLeftX.push(m.x),h.exactClipBottomY.push(m.y+m.h)),!a.continuation){let L=h.rows.get(a.row);L?(L.top=Math.min(L.top,y.y),L.bottom=Math.max(L.bottom,y.y+y.h)):h.rows.set(a.row,{top:y.y,bottom:y.y+y.h});}}if(n.size===0)return [];for(let o of t){if(o.kind!=="line"||o.role!=="table-border"&&o.role!=="table-cut")continue;let a=Vt(o,r,n);if(!a){let p=(o.x1+o.x2)/2,g=(o.y1+o.y2)/2,m=1/0;for(let y of n.values()){let h=p>=y.contentMinX-ie&&p<=y.contentMaxX+ie,L=g>=y.contentMinY-ie&&g<=y.contentMaxY+ie;if(!h||!L)continue;let R=Math.max(0,y.contentMinX-p,p-y.contentMaxX),k=Math.max(0,y.contentMinY-g,g-y.contentMaxY),D=R+k;D<m&&(m=D,a=y);}}if(!a)continue;let s=Math.abs(o.x1-o.x2)<.5,c=Math.abs(o.y1-o.y2)<.5;s&&a.exactLeftX.push(Math.min(o.x1,o.x2)),c&&a.exactBottomY.push(Math.max(o.y1,o.y2));}let l=[];for(let o of n.values()){if(o.rows.size===0)continue;let a=o.exactLeftX.length>0||o.exactClipLeftX.length>0,s=a?Math.min(...o.exactLeftX,...o.exactClipLeftX):o.contentMinX-V,c=o.exactBottomY.length>0||o.exactClipBottomY.length>0?Math.max(...o.exactBottomY,...o.exactClipBottomY):o.contentMaxY,p=[...o.rows.entries()].map(([g,m])=>({rowIndex:g,top:m.top,bottom:m.bottom})).sort((g,m)=>g.rowIndex-m.rowIndex);l.push({pageIndex:e,tableKey:o.tableKey,docStartSample:o.docStartSample,originX:s,originY:o.contentMinY,bottomY:c,originExact:a,rowBands:p});}return l}function yr(e,t){let i=[],r=Ee(e,t,{kind:"body"});for(let n of e.pages)i.push(...Kt(n.pageIndex,n.primitives,t,r));return i}function gr(e,t,i,r){let n=e.pages.slice(i,r+1),l=new Set,o=false;for(let s of n)for(let c of s.primitives)c.kind!=="line"&&c.cell&&(o=true),c.table?.tableId&&l.add(c.table.tableId);if(!o)return [];let a=Ee(e,t,{kind:"body"},l);return n.flatMap(s=>Kt(s.pageIndex,s.primitives,t,a))}function tt(e,t){let i=t.kind??"body";if(i==="body")return {kind:i,primitives:e.primitives};let r=i==="header"?e.header:e.footer;return !r||r.kind!==i||t.rId&&r.rId!==t.rId?null:{kind:i,rId:r.rId,primitives:r.primitives}}function Ee(e,t,i,r){let n=new Map;for(let l of e.pages){let o=tt(l,i);if(o)for(let a of o.primitives){if(!a.cell||!a.table?.tableId||a.docStart==null||r&&!r.has(a.table.tableId))continue;let s=t(a.docStart);if(s==null)continue;let c=n.get(a.table.tableId);(!c||a.docStart<c.docStartSample)&&n.set(a.table.tableId,{tableKey:s,docStartSample:a.docStart});}}return n}function nt(e,t){return `${e}:${t}`}function hr(e,t,i,r){let n=nt(t.row,t.col),l=e.cells.get(n);l?(l.minX=Math.min(l.minX,i.x),l.minY=Math.min(l.minY,i.y),l.maxX=Math.max(l.maxX,i.x+i.w),l.maxY=Math.max(l.maxY,i.y+i.h),l.rowSpan=Math.max(l.rowSpan,t.rowSpan),l.colSpan=Math.max(l.colSpan,t.colSpan),r&&(l.exactClip=r)):e.cells.set(n,{row:t.row,col:t.col,rowSpan:t.rowSpan,colSpan:t.colSpan,minX:i.x,minY:i.y,maxX:i.x+i.w,maxY:i.y+i.h,exactClip:r??void 0});}function zt(e,t,i){let r=new Map;for(let n of e){if(n.kind==="line")continue;let l=n.cell;if(!l)continue;let o=Wt(n,t,i);if(!o)continue;let a=o.tableKey,s=Qt(n),c=r.get(a);c||(c={tableKey:a,contentMinX:s.x,contentMinY:s.y,contentMaxX:s.x+s.w,contentMaxY:s.y+s.h,cells:new Map,verticalLines:[],horizontalLines:[]},r.set(a,c)),c.contentMinX=Math.min(c.contentMinX,s.x),c.contentMinY=Math.min(c.contentMinY,s.y),c.contentMaxX=Math.max(c.contentMaxX,s.x+s.w),c.contentMaxY=Math.max(c.contentMaxY,s.y+s.h),hr(c,l,s,et(n));}if(r.size===0)return [];for(let n of e){if(n.kind!=="line"||n.role!=="table-border"&&n.role!=="table-cut")continue;let l=Math.abs(n.x1-n.x2)<.5,o=Math.abs(n.y1-n.y2)<.5;if(!l&&!o)continue;let a=Math.min(n.x1,n.x2),s=Math.max(n.x1,n.x2),c=Math.min(n.y1,n.y2),p=Math.max(n.y1,n.y2),g=Vt(n,i,r);if(g){l?g.verticalLines.push(a):g.horizontalLines.push(c);continue}for(let m of r.values())if(l){if(!(p>=m.contentMinY-ie&&c<=m.contentMaxY+ie))continue;let h=a;Math.max(0,m.contentMinX-h,h-m.contentMaxX)<=$t&&m.verticalLines.push(h);}else if(o){if(!(s>=m.contentMinX-ie&&a<=m.contentMaxX+ie))continue;let h=c;Math.max(0,m.contentMinY-h,h-m.contentMaxY)<=$t&&m.horizontalLines.push(h);}}return [...r.values()]}function xe(e){let t=[];for(let i of [...e].sort((r,n)=>r-n))(t.length===0||Math.abs(t[t.length-1]-i)>.5)&&t.push(i);return t}function jt(e){let t=xe([...e.cells.values()].map(n=>n.row)),i=xe(e.horizontalLines),r=new Map;if(t.length>0&&i.length>=t.length+1)for(let n=0;n<t.length;n++)r.set(t[n],i[n]),r.set(t[n]+1,i[n+1]);return r}function Ze(e){if(!e)return null;if(e.exactClip)return e.exactClip;let t=e.minX-V,i=e.minY-V;return {x:t,y:i,w:Math.max(1,e.maxX-e.minX+V*2),h:Math.max(1,e.maxY-e.minY+V*2)}}function br(e,t){let i=1/0,r=-1/0;for(let n of e.cells.values())n.row===t&&(i=Math.min(i,n.exactClip?.y??n.minY-V),r=Math.max(r,n.exactClip?n.exactClip.y+n.exactClip.h:n.maxY+V));return !Number.isFinite(i)||!Number.isFinite(r)||r<=i?null:{top:i,bottom:r}}function xr(e,t,i){let r=Ze(e.cells.get(nt(t,i)));return r?{left:r.x,right:r.x+r.w,top:r.y,bottom:r.y+r.h}:null}function Lr(e,t,i,r={kind:"body"}){if(t.length===0)return [];let n=new Map;for(let a of t){let s=n.get(a.tableKey);s?s.push(a):n.set(a.tableKey,[a]);}let l=[],o=Ee(e,i,r);for(let a of e.pages){let s=tt(a,r);if(!s)continue;let c=zt(s.primitives,i,o);for(let p of c){let g=n.get(p.tableKey);if(!g)continue;let m=xe(p.verticalLines),y=jt(p);for(let h of g){let L=p.cells.get(nt(h.row,h.col)),R=m[h.col],k=m[h.col+h.colSpan],D=y.get(h.row),w=y.get(h.row+h.rowSpan),A=true;if(R==null||k==null||k<=R){let P=L?.exactClip??Ze(L);if(!P)continue;R=P.x,k=P.x+P.w,A=L?.exactClip!=null;}if(D==null||w==null||w<=D){let P=L?.exactClip??Ze(L);if(!P)continue;D=P.y,w=P.y+P.h,A&&(A=L?.exactClip!=null);}l.push({pageIndex:a.pageIndex,tableKey:p.tableKey,row:h.row,col:h.col,rowSpan:h.rowSpan,colSpan:h.colSpan,x:R,y:D,w:Math.max(1,k-R),h:Math.max(1,w-D),exact:A,region:s.kind,rId:s.rId});}}}return l}function vr(e){let{list:t,pageIndex:i,x:r,y:n,canvasRect:l,pageSize:o,tableKeyOf:a,cellPmPosOf:s,region:c={kind:"body"},edgeProximity:p=lr,buttonZoom:g=1}=e,m=t.pages[i];if(!m)return null;let y=tt(m,c);if(!y)return null;let h=o.width>0?l.width/o.width:1,L=o.height>0?l.height/o.height:1,R=(w,A)=>({clientX:l.left+w*h,clientY:l.top+A*L}),k=Ee(t,a,c),D=zt(y.primitives,a,k);for(let w of D){let A=xe(w.verticalLines),P=jt(w),C=xe([...w.cells.values()].map(E=>E.row));if(C.length===0)continue;let F=A[0]??w.contentMinX-V,H=A[A.length-1]??w.contentMaxX+V,G=P.get(C[0])??w.contentMinY-V,N=C[C.length-1],Te=P.get(N+1)??w.contentMaxY+V,re=r<F+p&&r>=F-p,$=n<G+p&&n>=G-p;if(!(!re&&!$)){if(re&&n>=G-p&&n<=Te)for(let E of C){let O=P.get(E),T=P.get(E+1),j=O==null||T==null?br(w,E):null,_=O??j?.top,J=T??j?.bottom;if(_==null||J==null||J<=_||n<_||n>J)continue;let Q=[...w.cells.values()].filter(U=>U.row===E).sort((U,Le)=>U.col-Le.col)[0];if(!Q)continue;let W=s(w.tableKey,E,Q.col);if(!W)continue;let te=R(F,_+(J-_)/2);return {type:"row",clientX:te.clientX-dr*g,clientY:te.clientY-ur*g,cellPmPos:W}}if($&&r>=F-p&&r<=H){let E=C[0],O=[...w.cells.values()].filter(T=>T.row===E).sort((T,j)=>T.col-j.col);for(let T of O){let j=A[T.col],_=A[T.col+T.colSpan],J=j==null||_==null?xr(w,T.row,T.col):null,Q=j??J?.left,W=_??J?.right;if(Q==null||W==null||W<=Q||r<Q||r>W)continue;let te=s(w.tableKey,T.row,T.col);if(!te)continue;let U=R(Q+(W-Q)/2,G);return {type:"column",clientX:U.clientX-fr*g,clientY:U.clientY-pr*g,cellPmPos:te}}}}}return null}var lo=yt;export{Wi as CANVAS_PAGES_PADDING_PX,Qi as CANVAS_PAGE_GAP_PX,cr as DISPLAY_LIST_TABLE_INSERT_HIDE_DELAY_MS,v as MIRROR_CLASS_NAMES,Wn as applyInteractiveSdtFocus,zn as buildInteractiveOverlayPage,Xe as buildMirrorPage,yi as buildMirrorPageLinks,bi as buildMirrorPageText,be as canvasPageTops,Ai as captureInlinePositionEmuFromDisplayList,ji as computeA11yAnnouncements,Ji as computeAnchorPositionsFromDisplayList,qi as computeAnchorPositionsFromYrs,Ki as createCanvasImageResolver,Xi as createDisplayListQueries,lo as demoDisplayList,Lr as deriveDisplayListSelectedCellRects,yr as deriveDisplayListTableFragments,gr as deriveDisplayListTableFragmentsOnPages,vr as detectDisplayListTableInsertHover,xi as displayPageHoldsMirrorId,Gi as endDisplayListQueriesLine,tr as extractTrackedChangesFromYrs,sr as findDisplayListHyperlinkAtPoint,Ke as findImagePrimitiveAtPoint,Ve as findImagePrimitiveByDocPos,si as interactiveOverlayHasTabStops,Ni as isDisplayListQuerySourceDead,Qn as loadGlyphOutlineProvider,Zi as mergeHfAnchorPositionsFromDisplayList,ui as mirrorPageHasHeaderCells,fi as mirrorPageHasTabStops,Oi as onDisplayListQuerySourceFailure,Tt as reduceMirrorToLinks,At as reduceMirrorToText,zi as snapshotFromSelectionContext,qe as visitAnchorKeys};
@@ -1 +1 @@
1
- import'./chunk-LT2GCWZ3.mjs';export{h as decodeTiffImage,b as parseDocxS9Wire,c as parseRelationshipsXmlWire,a as preloadParseWasm,d as serializeDocxS10Wire,e as serializeDocxS11Wire,f as serializeDocxS12Wire,g as writeDocxS13Wire}from'./chunk-3CYO46ML.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-TTRUPDAB.mjs';
1
+ import'./chunk-LT2GCWZ3.mjs';export{h as decodeTiffImage,b as parseDocxS9Wire,c as parseRelationshipsXmlWire,a as preloadParseWasm,d as serializeDocxS10Wire,e as serializeDocxS11Wire,f as serializeDocxS12Wire,g as writeDocxS13Wire}from'./chunk-GKWXOZZH.mjs';import'./chunk-HGKSOBXK.mjs';import'./chunk-TTRUPDAB.mjs';
@@ -1,13 +1,13 @@
1
1
  import { RenderedDomContext, PositionCoordinates, PointPosition } from './index.mjs';
2
- import { D as DisplayListRect, a as DisplayListQueries } from '../displayListQueries-DnHmHUPY.mjs';
2
+ import { D as DisplayListRect, a as DisplayListQueries } from '../displayListQueries-BVBDVXoP.mjs';
3
3
  import '../types/document.mjs';
4
- import '../content-BzoC6bSz.mjs';
4
+ import '../content-DSb-6a9T.mjs';
5
5
  import '../formatting-gqLFeJ9X.mjs';
6
6
  import '../docx/wrapTypes.mjs';
7
7
  import '../styles-AryxLAhx.mjs';
8
- import '../frameDelta-ByU7HBuB.mjs';
9
- import '../rustDisplayList-DcaA5iok.mjs';
10
- import '../types-Buyw6dFd.mjs';
8
+ import '../frameDelta-CLeO7K5z.mjs';
9
+ import '../rustDisplayList-B7uPoItK.mjs';
10
+ import '../types-Cz7S77Ut.mjs';
11
11
  import '../layout/pagination/index.mjs';
12
12
 
13
13
  /**
@@ -1,5 +1,5 @@
1
1
  import { Document } from '../types/document.mjs';
2
- import '../content-BzoC6bSz.mjs';
2
+ import '../content-DSb-6a9T.mjs';
3
3
  import '../formatting-gqLFeJ9X.mjs';
4
4
  import '../docx/wrapTypes.mjs';
5
5
  import '../styles-AryxLAhx.mjs';
@@ -1,6 +1,6 @@
1
1
  import { SidebarItem, RenderedDomContext } from './index.mjs';
2
2
  import '../types/document.mjs';
3
- import '../content-BzoC6bSz.mjs';
3
+ import '../content-DSb-6a9T.mjs';
4
4
  import '../formatting-gqLFeJ9X.mjs';
5
5
  import '../docx/wrapTypes.mjs';
6
6
  import '../styles-AryxLAhx.mjs';
@@ -1,6 +1,6 @@
1
- import { L as Layout } from './types-Buyw6dFd.mjs';
1
+ import { L as Layout } from './types-Cz7S77Ut.mjs';
2
2
  import { MeasuredBlock } from './layout/pagination/index.mjs';
3
- import { D as DisplayList, R as RetainedFrame } from './frameDelta-ByU7HBuB.mjs';
3
+ import { D as DisplayList, R as RetainedFrame } from './frameDelta-CLeO7K5z.mjs';
4
4
 
5
5
  /**
6
6
  * JS seam to the Rust display-list builder.
@@ -1,3 +1,3 @@
1
- export { B as BlockContent, l as BlockSdt, m as BookmarkEnd, n as BookmarkStart, o as BreakContent, d as Chart, p as ChartAxis, q as ChartContent, t as ChartLegend, x as ChartSeries, y as ChartType, z as Column, e as Comment, J as CommentRangeEnd, K as CommentRangeStart, M as ComplexField, Q as DEFAULT_WATERMARK_PRESETS, T as Deletion, g as DocumentBody, U as DrawingContent, j as Endnote, X as EndnotePosition, E as EndnoteProperties, Y as Field, Z as FieldCharContent, a0 as FieldType, a1 as FooterReference, i as Footnote, a2 as FootnotePosition, F as FootnoteProperties, H as HeaderFooter, a3 as HeaderFooterType, a4 as HeaderReference, a6 as Hyperlink, a8 as Image, a9 as ImageCrop, ac as ImagePadding, ad as ImagePosition, af as ImageSize, ag as ImageTransform, ah as ImageWrap, aj as InlineSdt, ak as Insertion, al as InstrTextContent, an as LineNumberRestart, aq as MathEquation, ar as MoveFrom, as as MoveFromRangeEnd, at as MoveFromRangeStart, au as MoveTo, av as MoveToRangeEnd, aw as MoveToRangeStart, ax as NoBreakHyphenContent, ay as NoteNumberRestart, az as NoteRefMarkContent, aA as NoteReferenceContent, aF as PageOrientation, P as Paragraph, aG as ParagraphContent, aH as ParagraphPropertyChange, aI as PictureWatermark, aJ as PropertyChangeInfo, bi as RawXml, aK as Run, aL as RunContent, aM as RunPropertyChange, aO as SdtDataBinding, a as SdtProperties, aR as SdtType, aS as Section, f as SectionProperties, aT as SectionStart, aU as SeparatorContent, aV as Shape, aW as ShapeContent, aZ as ShapeTextBody, a_ as SimpleField, a$ as SoftHyphenContent, b2 as SymbolContent, b3 as TabContent, b4 as Table, b5 as TableCell, b6 as TableCellPropertyChange, b7 as TablePropertyChange, b8 as TableRow, b9 as TableRowPropertyChange, ba as TableStructuralChangeInfo, bb as TextBox, bc as TextContent, bd as TextWatermark, be as TrackedChangeInfo, bf as TrackedRunChange, bg as VerticalAlign, W as Watermark, bh as pictureWatermarkDisplayEmu } from '../content-BzoC6bSz.mjs';
1
+ export { B as BlockContent, l as BlockSdt, m as BookmarkEnd, n as BookmarkStart, o as BreakContent, d as Chart, p as ChartAxis, q as ChartContent, t as ChartLegend, x as ChartSeries, y as ChartType, z as Column, e as Comment, J as CommentRangeEnd, K as CommentRangeStart, M as ComplexField, Q as DEFAULT_WATERMARK_PRESETS, T as Deletion, g as DocumentBody, U as DrawingContent, j as Endnote, X as EndnotePosition, E as EndnoteProperties, Y as Field, Z as FieldCharContent, a0 as FieldType, a1 as FooterReference, i as Footnote, a2 as FootnotePosition, F as FootnoteProperties, H as HeaderFooter, a3 as HeaderFooterType, a4 as HeaderReference, a6 as Hyperlink, a8 as Image, a9 as ImageCrop, ac as ImagePadding, ad as ImagePosition, af as ImageSize, ag as ImageTransform, ah as ImageWrap, aj as InlineSdt, ak as Insertion, al as InstrTextContent, an as LineNumberRestart, aq as MathEquation, ar as MoveFrom, as as MoveFromRangeEnd, at as MoveFromRangeStart, au as MoveTo, av as MoveToRangeEnd, aw as MoveToRangeStart, ax as NoBreakHyphenContent, ay as NoteNumberRestart, az as NoteRefMarkContent, aA as NoteReferenceContent, aF as PageOrientation, P as Paragraph, aG as ParagraphContent, aH as ParagraphPropertyChange, aI as PictureWatermark, aJ as PropertyChangeInfo, bi as RawXml, aK as Run, aL as RunContent, aM as RunPropertyChange, aO as SdtDataBinding, a as SdtProperties, aR as SdtType, aS as Section, f as SectionProperties, aT as SectionStart, aU as SeparatorContent, aV as Shape, aW as ShapeContent, aZ as ShapeTextBody, a_ as SimpleField, a$ as SoftHyphenContent, b2 as SymbolContent, b3 as TabContent, b4 as Table, b5 as TableCell, b6 as TableCellPropertyChange, b7 as TablePropertyChange, b8 as TableRow, b9 as TableRowPropertyChange, ba as TableStructuralChangeInfo, bb as TextBox, bc as TextContent, bd as TextWatermark, be as TrackedChangeInfo, bf as TrackedRunChange, bg as VerticalAlign, W as Watermark, bh as pictureWatermarkDisplayEmu } from '../content-DSb-6a9T.mjs';
2
2
  export { k as ShapeFill, l as ShapeOutline, m as ShapeType } from '../formatting-gqLFeJ9X.mjs';
3
3
  import '../docx/wrapTypes.mjs';
@@ -1,5 +1,5 @@
1
- import { F as FootnoteProperties, E as EndnoteProperties, g as DocumentBody, h as NumberingDefinitions, i as Footnote, j as Endnote, H as HeaderFooter, d as Chart, k as BookmarkRange } from '../content-BzoC6bSz.mjs';
2
- export { A as AbstractNumbering, B as BlockContent, l as BlockSdt, m as BookmarkEnd, n as BookmarkStart, o as BreakContent, p as ChartAxis, q as ChartContent, r as ChartDataLabels, s as ChartGrouping, t as ChartLegend, u as ChartPlotGroup, v as ChartPoint, w as ChartPointLabel, x as ChartSeries, y as ChartType, z as Column, e as Comment, G as CommentAnchorRange, I as CommentAuthor, J as CommentRangeEnd, K as CommentRangeStart, L as CommentReferenceContent, M as ComplexField, O as ContentPosition, Q as DEFAULT_WATERMARK_PRESETS, T as Deletion, U as DrawingContent, D as DrawingScene, V as DrawingSceneNode, X as EndnotePosition, Y as Field, Z as FieldCharContent, _ as FieldFormData, $ as FieldInlineContent, a0 as FieldType, a1 as FooterReference, a2 as FootnotePosition, a3 as HeaderFooterType, a4 as HeaderReference, a5 as HorizontalRuleContent, a6 as Hyperlink, a7 as HyperlinkContent, a8 as Image, a9 as ImageCrop, aa as ImageEffect, ab as ImageHyperlink, ac as ImagePadding, ad as ImagePosition, ae as ImageRotationBounds, af as ImageSize, ag as ImageTransform, ah as ImageWrap, ai as ImageWrapPoint, aj as InlineSdt, ak as Insertion, al as InstrTextContent, am as LevelSuffix, an as LineNumberRestart, ao as ListLevel, ap as ListRendering, aq as MathEquation, ar as MoveFrom, as as MoveFromRangeEnd, at as MoveFromRangeStart, au as MoveTo, av as MoveToRangeEnd, aw as MoveToRangeStart, ax as NoBreakHyphenContent, N as NoteKind, ay as NoteNumberRestart, az as NoteRefMarkContent, aA as NoteReferenceContent, aB as NoteSeparatorReference, aC as NumberFormat, aD as NumberingInstance, aE as PageNumberingProperties, aF as PageOrientation, P as Paragraph, aG as ParagraphContent, aH as ParagraphPropertyChange, aI as PictureWatermark, aJ as PropertyChangeInfo, aK as Run, aL as RunContent, aM as RunPropertyChange, aN as SdtCheckboxGlyph, S as SdtControlState, aO as SdtDataBinding, aP as SdtDateState, aQ as SdtGalleryState, a as SdtProperties, aR as SdtType, aS as Section, f as SectionProperties, aT as SectionStart, aU as SeparatorContent, aV as Shape, aW as ShapeContent, b as ShapeEffect, aX as ShapeFillPaint, aY as ShapeStrokePaint, aZ as ShapeTextBody, c as ShapeTextBodyProperties, a_ as SimpleField, a$ as SoftHyphenContent, b0 as StructuredFieldContent, b1 as StructuredFieldTree, b2 as SymbolContent, b3 as TabContent, b4 as Table, b5 as TableCell, b6 as TableCellPropertyChange, b7 as TablePropertyChange, b8 as TableRow, b9 as TableRowPropertyChange, ba as TableStructuralChangeInfo, bb as TextBox, bc as TextContent, bd as TextWatermark, be as TrackedChangeInfo, bf as TrackedRunChange, bg as VerticalAlign, W as Watermark, bh as pictureWatermarkDisplayEmu } from '../content-BzoC6bSz.mjs';
1
+ import { F as FootnoteProperties, E as EndnoteProperties, g as DocumentBody, h as NumberingDefinitions, i as Footnote, j as Endnote, H as HeaderFooter, d as Chart, k as BookmarkRange } from '../content-DSb-6a9T.mjs';
2
+ export { A as AbstractNumbering, B as BlockContent, l as BlockSdt, m as BookmarkEnd, n as BookmarkStart, o as BreakContent, p as ChartAxis, q as ChartContent, r as ChartDataLabels, s as ChartGrouping, t as ChartLegend, u as ChartPlotGroup, v as ChartPoint, w as ChartPointLabel, x as ChartSeries, y as ChartType, z as Column, e as Comment, G as CommentAnchorRange, I as CommentAuthor, J as CommentRangeEnd, K as CommentRangeStart, L as CommentReferenceContent, M as ComplexField, O as ContentPosition, Q as DEFAULT_WATERMARK_PRESETS, T as Deletion, U as DrawingContent, D as DrawingScene, V as DrawingSceneNode, X as EndnotePosition, Y as Field, Z as FieldCharContent, _ as FieldFormData, $ as FieldInlineContent, a0 as FieldType, a1 as FooterReference, a2 as FootnotePosition, a3 as HeaderFooterType, a4 as HeaderReference, a5 as HorizontalRuleContent, a6 as Hyperlink, a7 as HyperlinkContent, a8 as Image, a9 as ImageCrop, aa as ImageEffect, ab as ImageHyperlink, ac as ImagePadding, ad as ImagePosition, ae as ImageRotationBounds, af as ImageSize, ag as ImageTransform, ah as ImageWrap, ai as ImageWrapPoint, aj as InlineSdt, ak as Insertion, al as InstrTextContent, am as LevelSuffix, an as LineNumberRestart, ao as ListLevel, ap as ListRendering, aq as MathEquation, ar as MoveFrom, as as MoveFromRangeEnd, at as MoveFromRangeStart, au as MoveTo, av as MoveToRangeEnd, aw as MoveToRangeStart, ax as NoBreakHyphenContent, N as NoteKind, ay as NoteNumberRestart, az as NoteRefMarkContent, aA as NoteReferenceContent, aB as NoteSeparatorReference, aC as NumberFormat, aD as NumberingInstance, aE as PageNumberingProperties, aF as PageOrientation, P as Paragraph, aG as ParagraphContent, aH as ParagraphPropertyChange, aI as PictureWatermark, aJ as PropertyChangeInfo, aK as Run, aL as RunContent, aM as RunPropertyChange, aN as SdtCheckboxGlyph, S as SdtControlState, aO as SdtDataBinding, aP as SdtDateState, aQ as SdtGalleryState, a as SdtProperties, aR as SdtType, aS as Section, f as SectionProperties, aT as SectionStart, aU as SeparatorContent, aV as Shape, aW as ShapeContent, b as ShapeEffect, aX as ShapeFillPaint, aY as ShapeStrokePaint, aZ as ShapeTextBody, c as ShapeTextBodyProperties, a_ as SimpleField, a$ as SoftHyphenContent, b0 as StructuredFieldContent, b1 as StructuredFieldTree, b2 as SymbolContent, b3 as TabContent, b4 as Table, b5 as TableCell, b6 as TableCellPropertyChange, b7 as TablePropertyChange, b8 as TableRow, b9 as TableRowPropertyChange, ba as TableStructuralChangeInfo, bb as TextBox, bc as TextContent, bd as TextWatermark, be as TrackedChangeInfo, bf as TrackedRunChange, bg as VerticalAlign, W as Watermark, bh as pictureWatermarkDisplayEmu } from '../content-DSb-6a9T.mjs';
3
3
  import { f as Theme, C as ColorValue } from '../formatting-gqLFeJ9X.mjs';
4
4
  export { B as BorderSpec, g as CellMargins, h as ConditionalFormatStyle, E as EmphasisMark, F as FloatingTableProperties, L as LineSpacingRule, i as ParagraphAlignment, a as ParagraphFormatting, R as RunFontHint, j as RunLanguage, S as ShadingProperties, k as ShapeFill, l as ShapeOutline, m as ShapeType, n as TabLeader, o as TabStop, p as TabStopAlignment, q as TableBorders, e as TableCellFormatting, c as TableFormatting, r as TableLook, s as TableMeasurement, d as TableRowFormatting, t as TableStyleCascade, u as TableStyleRegion, v as TableWidthType, w as TextEffect, b as TextFormatting, T as TextModernEffects, x as ThemeColorScheme, y as ThemeColorSlot, z as ThemeFont, A as ThemeFontScheme, U as UnderlineStyle } from '../formatting-gqLFeJ9X.mjs';
5
5
  import { S as StyleDefinitions, F as FontTable, R as RelationshipMap, M as MediaFile } from '../styles-AryxLAhx.mjs';
@@ -1,4 +1,4 @@
1
- import { S as SdtControlState, a as SdtProperties, R as RevisionInfo, C as CellMarker, D as DrawingScene, b as ShapeEffect, c as ShapeTextBodyProperties, d as Chart, W as Watermark, F as FootnoteProperties, E as EndnoteProperties } from './content-BzoC6bSz.mjs';
1
+ import { S as SdtControlState, a as SdtProperties, R as RevisionInfo, C as CellMarker, D as DrawingScene, b as ShapeEffect, c as ShapeTextBodyProperties, d as Chart, W as Watermark, F as FootnoteProperties, E as EndnoteProperties } from './content-DSb-6a9T.mjs';
2
2
  import { T as TextModernEffects, P as PresetGeometryPathCommand, B as BorderSpec } from './formatting-gqLFeJ9X.mjs';
3
3
 
4
4
  /**
@@ -1089,6 +1089,8 @@ type TypesetRow = {
1089
1089
  * as marginTop on the line element; measurement adds it to totalHeight.
1090
1090
  */
1091
1091
  floatSkipBefore?: number;
1092
+ /** Extra first-line indent after a list number overruns its hanging indent. */
1093
+ markerTabOffset?: number;
1092
1094
  /** Exact per-run advances in visual paint order. Undefined = legacy estimation. */
1093
1095
  runAdvances?: TypesetRunAdvance[];
1094
1096
  /** Exact shaped cluster advances. Undefined = legacy estimation. */
@@ -1,4 +1,4 @@
1
- import { P as Paragraph, B as BlockContent, e as Comment } from '../content-BzoC6bSz.mjs';
1
+ import { P as Paragraph, B as BlockContent, e as Comment } from '../content-DSb-6a9T.mjs';
2
2
  import '../formatting-gqLFeJ9X.mjs';
3
3
  import '../docx/wrapTypes.mjs';
4
4
 
@@ -6,7 +6,7 @@ import { F as FontTable } from '../styles-AryxLAhx.mjs';
6
6
  import { Document } from '../types/document.mjs';
7
7
  import { FontOption } from './fontOptions.mjs';
8
8
  export { MIN_CARD_GAP, SIDEBAR_DOCUMENT_SHIFT, SIDEBAR_PAGE_GAP, SIDEBAR_WIDTH } from './sidebarConstants.mjs';
9
- import { e as Comment } from '../content-BzoC6bSz.mjs';
9
+ import { e as Comment } from '../content-DSb-6a9T.mjs';
10
10
  import '../formatting-gqLFeJ9X.mjs';
11
11
  import '../docx/wrapTypes.mjs';
12
12
 
@@ -1 +1 @@
1
- export{d as MIN_CARD_GAP,c as SIDEBAR_DOCUMENT_SHIFT,b as SIDEBAR_PAGE_GAP,a as SIDEBAR_WIDTH}from'../chunk-YUOKI2HB.mjs';export{f as blendColors,r as colorsEqual,o as createRgbColor,n as createThemeColor,d as darkenColor,p as ensureHexPrefix,h as generateThemeTintShadeMatrix,c as getContrastingColor,g as getThemeTintShadeHex,k as isBlack,l as isWhite,e as lightenColor,m as parseColorString,a as resolveColor,b as resolveColorToHex,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'../chunk-LTVVQMHB.mjs';export{a as PIXELS_PER_INCH,e as TWIPS_PER_INCH,p as clamp,n as eighthsToPixels,b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,l as halfPointsToPoints,c as pixelsToEmu,h as pixelsToTwips,m as pointsToHalfPoints,d as pointsToPixels,o as roundPixels,j as twipsToEmu,g as twipsToPixels}from'../chunk-CTBUQRYQ.mjs';import {n,d}from'../chunk-7DDF4RHB.mjs';export{s as FONT_MAPPING,n as canRenderFont,z as createFontLoadScope,c as deobfuscateFont,C as extractEmbeddedFontFaces,x as extractFontsFromDocument,B as getEmbeddedFontFaces,A as getEmbeddedFontFamilies,t as getGoogleFontEquivalent,k as getLoadedFonts,g as isFontLoaded,i as isGoogleFontsEnabled,j as isLoading,b as isValidFontKey,y as loadDocumentFonts,E as loadEmbeddedFontFamilies,D as loadEmbeddedFonts,e as loadFont,r as loadFontDefinitions,o as loadFontFromBuffer,q as loadFontFromUrl,u as loadFontWithMapping,f as loadFonts,v as loadFontsWithMapping,m as onFontError,l as onFontsLoaded,w as preloadCommonFonts,p as registerDocumentFaces,h as setGoogleFontsEnabled,a as toArrayBuffer}from'../chunk-7DDF4RHB.mjs';import'../chunk-YLFKV2NT.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-2QHGQA3V.mjs';import'../chunk-3CYO46ML.mjs';import'../chunk-6CHGYCFU.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-TTRUPDAB.mjs';function H(e){let t=new Set,o=e.package;if(o.theme&&st(o.theme,t),o.styles&&it(o.styles,t),o.document)for(let n of o.document.content)T(n,t);if(o.headers)for(let n of o.headers.values())O(n,t);if(o.footers)for(let n of o.footers.values())O(n,t);if(o.footnotes)for(let n of o.footnotes)gt(n,t);if(o.endnotes)for(let n of o.endnotes)ht(n,t);return Array.from(t).sort()}function st(e,t){let o=e.fontScheme;o&&(o.majorFont&&_(o.majorFont,t),o.minorFont&&_(o.minorFont,t));}function _(e,t){if(e.latin&&t.add(e.latin),e.ea&&t.add(e.ea),e.cs&&t.add(e.cs),e.fonts)for(let o of Object.values(e.fonts))o&&t.add(o);}function it(e,t){e.docDefaults&&(e.docDefaults.rPr&&h(e.docDefaults.rPr,t),e.docDefaults.pPr?.runProperties&&h(e.docDefaults.pPr.runProperties,t));for(let o of e.styles)o.rPr&&h(o.rPr,t),o.pPr?.runProperties&&h(o.pPr.runProperties,t);}function h(e,t){let o=e.fontFamily;o&&(o.ascii&&t.add(o.ascii),o.hAnsi&&t.add(o.hAnsi),o.eastAsia&&t.add(o.eastAsia),o.cs&&t.add(o.cs));}function lt(e,t){e.runProperties&&h(e.runProperties,t);}function T(e,t){e.type==="paragraph"?ct(e,t):e.type==="table"&&ut(e,t);}function ct(e,t){e.formatting&&lt(e.formatting,t);for(let o of e.content)ft(o,t);}function ft(e,t){if(e.type==="run")b(e,t);else if(e.type==="hyperlink")dt(e,t);else if(e.type==="simpleField"||e.type==="complexField"){if("content"in e)for(let o of e.content)o.type==="run"&&b(o,t);if("fieldResult"in e)for(let o of e.fieldResult)b(o,t);}}function b(e,t){e.formatting&&h(e.formatting,t);}function dt(e,t){for(let o of e.children)o.type==="run"&&b(o,t);}function ut(e,t){for(let o of e.rows)mt(o,t);}function mt(e,t){for(let o of e.cells)pt(o,t);}function pt(e,t){for(let o of e.content)T(o,t);}function O(e,t){for(let o of e.content)T(o,t);}function gt(e,t){for(let o of e.content)T(o,t);}function ht(e,t){for(let o of e.content)T(o,t);}var xt=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui"]);function L(e,t={}){let o=t.canRender??n,n$1=new Set;for(let i of t.exclude??[])n$1.add(i.trim().toLowerCase());let r=new Set;for(let i of t.embeddedFamilies??[])r.add(i.trim().toLowerCase());let s=[],a=new Set;for(let i of e){let c=i.trim(),f=c.toLowerCase();!c||xt.has(f)||n$1.has(f)||a.has(f)||!r.has(f)&&!o(c)||(a.add(f),s.push({name:c,fontFamily:d(c).cssFallback,category:"other"}));}return s}function Ft(e,t={}){return L(H(e),t)}function Tt(e,t){if(!e||e.length===0)return [];let o=new Set;for(let s of t)o.add(s.trim().toLowerCase());let n=new Set,r=[];for(let s of e){let a=s.name.trim().toLowerCase();o.has(a)||n.has(a)||(n.add(a),r.push(s));}return r}function bt(e){let t=[];return e.descendants((o,n)=>{if(o.type.name==="paragraph"){let r=o.attrs.outlineLevel,s=o.attrs.styleId,a=r;if(a==null&&s){let i=s.match(/^[Hh]eading(\d)$/);i&&(a=parseInt(i[1],10)-1);}if(a!=null&&a>=0&&a<=8){let i="";o.forEach(c=>{c.isText&&(i+=c.text||"");}),i.trim()&&t.push({text:i.trim(),level:a,pmPos:n});}}}),t}var N="rgba(255, 235, 59, 0.55)",yt=1200,y="docx-paragraph-flash",S=new WeakMap;function Ct(e){let t=globalThis;return typeof t.CSS?.escape=="function"?t.CSS.escape(e):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function At(e){return e?.color?.trim()||N}function St(e){let t=e?.durationMs;return t==null||!Number.isFinite(t)||t<0?1200:t}function k(e,t){if(!t||!t.trim())return [];let o=Ct(t);return Array.from(e.querySelectorAll(`.layout-paragraph[data-para-id="${o}"]`))}function W(e,t){let o=0,n=At(t),r=St(t);for(let s of e){o++;let a=S.get(s);a!==void 0&&clearTimeout(a),s.classList.remove(y),s.offsetWidth,s.style.setProperty("--docx-paragraph-flash-color",n),s.style.setProperty("--docx-paragraph-flash-duration",`${r}ms`),s.classList.add(y);let i=setTimeout(()=>{s.classList.remove(y),s.style.removeProperty("--docx-paragraph-flash-color"),s.style.removeProperty("--docx-paragraph-flash-duration"),S.delete(s);},r);S.set(s,i);}return o}function Et(e,t,o){let n=k(e,t);return W(n,o)>0}function B(e,t,o){let n=0;for(let r=t;r<t+o&&r<e.length;r++)n+=e[r];return n}function wt(e,t,o,n){let r=B(e,t,o),s=Math.floor(r/Math.max(n,1)),a=r-s*n,i=Array.from({length:n},(c,f)=>s+(f<a?1:0));return [...e.slice(0,t),...i,...e.slice(t+o)]}function Pt(e,t,o,n,r,s){let a=o-t.rowspan,i=n-t.colspan,c=r+a,f=t.row+t.rowspan,F=t.col+t.colspan,p=[];for(let l of e){if(l===t)continue;let g=l.row+l.rowspan,C=l.col+l.colspan,I=l.row<f&&g>t.row,v=l.col<F&&C>t.col;p.push({data:l.data,row:l.row>=f?l.row+a:l.row,col:l.col>=F?l.col+i:l.col,rowspan:l.rowspan+(a>0&&I&&!v?a:0),colspan:l.colspan+(i>0&&v&&!I?i:0)});}for(let l=0;l<o;l++)for(let g=0;g<n;g++){let C=l===0&&g===0;p.push({data:s(C,l,g),row:t.row+l,col:t.col+g,rowspan:1,colspan:1});}return {anchors:p,deltaRows:a,deltaCols:i,newRowCount:c}}function Rt(e){let t=new Map,o=new Map;for(let n of e){t.set(`${n.row}-${n.col}`,n);for(let r=n.row;r<n.row+n.rowspan;r++)for(let s=n.col;s<n.col+n.colspan;s++)o.set(`${r}-${s}`,n);}return {byStart:t,byCoveredSlot:o}}function Dt(e,t){let o=e>1||t>1;return {minRows:e,minCols:t,initialRows:e,initialCols:o?t:t+1}}var It=/[\p{L}\p{N}\p{M}_''\-]/u,vt=/\s/;function E(e){return !e||e.length===0?false:It.test(e)}function w(e){return !e||e.length===0?false:vt.test(e)}function m(e,t){if(!e||e.length===0)return [0,0];t=Math.max(0,Math.min(t,e.length-1));let o=e[t];if(w(o)){let n=t,r=t;for(;n>0&&w(e[n-1]);)n--;for(;r<e.length&&w(e[r]);)r++;return [n,r]}if(E(o)){let n=t,r=t;for(;n>0&&E(e[n-1]);)n--;for(;r<e.length&&E(e[r]);)r++;return [n,r]}return [t,t+1]}function Mt(e,t){let[o,n]=m(e,t);return e.slice(o,n)}function _t(e,t){let[o,n]=m(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function D(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType===Node.TEXT_NODE){let n=o.textContent||"",r=t.startOffset,[s,a]=m(n,r);if(a>s)return t.setStart(o,s),t.setEnd(o,a),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=G(n);if(r.length>0){let s=t.startOffset,a=null,i=s;if(s<n.childNodes.length){let c=n.childNodes[s];if(c.nodeType===Node.TEXT_NODE)a=c,i=0;else if(c instanceof Element){let f=G(c);f.length>0&&(a=f[0],i=0);}}if(!a&&r.length>0&&(a=r[0],i=0),a){let c=a.textContent||"",[f,F]=m(c,i);if(F>f){let p=document.createRange();return p.setStart(a,f),p.setEnd(a,F),e.removeAllRanges(),e.addRange(p),true}}}}return false}function Ot(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,s]=m(n,t);if(s>r){let a=document.createRange();return a.setStart(e,r),a.setEnd(e,s),o.removeAllRanges(),o.addRange(a),true}return false}function Ht(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return D();let o=t.startContainer,n=t.endContainer,r=t.startOffset,s=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let a=o.textContent||"",[i]=m(a,t.startOffset);r=i;}if(n.nodeType===Node.TEXT_NODE){let a=n.textContent||"",i=Math.max(0,t.endOffset-1),[,c]=m(a,i);s=c;}try{return t.setStart(o,r),t.setEnd(n,s),e.removeAllRanges(),e.addRange(t),!0}catch(a){return console.warn("Could not expand selection to word boundaries:",a),false}}function X(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=Lt(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function Lt(e){if(!e)return null;let t=e;for(;t;){if(t instanceof Element&&t.hasAttribute("data-paragraph-index"))return t;t=t.parentNode;}return null}function G(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n;for(;n=o.nextNode();)n.nodeType===Node.TEXT_NODE&&t.push(n);return t}var P=0,x=null,R=null,Nt=500;function U(){P=0,R=null,x&&(clearTimeout(x),x=null);}function K(e){return e.target!==R&&U(),P++,R=e.target,x&&clearTimeout(x),x=setTimeout(U,Nt),Math.min(P,3)}function kt(){return e=>{e.ctrlKey||e.metaKey||e.altKey||D();}}function Wt(){return e=>{if(K(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;X();}}}async function Bt(e){let t=e.target;if(!t||!t.files)return null;let o=t.files[0];return t.value="",o?{buffer:await o.arrayBuffer(),name:o.name.replace(/\.docx$/i,"")}:null}var $="(prefers-color-scheme: dark)";function z(){return typeof window<"u"&&typeof window.matchMedia=="function"}function Gt(){return z()?window.matchMedia($).matches:false}function Ut(e,t){return e==="dark"||e==="system"&&t}function Xt(e){if(!z())return ()=>{};let t=window.matchMedia($);e(t.matches);let o=n=>e(n.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)}var Kt=-1;function $t(){let e=1;return {next:()=>e++,seedAbove(t){t>=e&&(e=t+1);}}}function zt(e,t,o,n){return {id:e.next(),author:o,date:new Date().toISOString(),content:[{type:"paragraph",formatting:{},content:[{type:"run",formatting:{},content:[{type:"text",text:t}]}]}],...n!==void 0&&{parentId:n}}}var jt=/^[a-z][a-z0-9+.-]*:/i,qt=/^(https?|mailto|tel|ftp):/i;function Qt(e){if(!e)return;let t=e.replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");if(t)return jt.test(t)?qt.test(t)?e:void 0:e}export{N as DEFAULT_PARAGRAPH_FLASH_COLOR,yt as DEFAULT_PARAGRAPH_FLASH_DURATION_MS,y as PARAGRAPH_FLASH_CLASS_NAME,Kt as PENDING_COMMENT_ID,Rt as buildAnchorMaps,bt as collectHeadings,Dt as computeSplitDialogDefaults,Pt as computeSplitLayout,zt as createComment,$t as createCommentIdAllocator,kt as createDoubleClickWordSelector,Wt as createTripleClickParagraphSelector,Tt as excludeFontsByName,Ht as expandSelectionToWordBoundaries,k as findParagraphFragmentsByParaId,_t as findWordAt,m as findWordBoundaries,W as flashParagraphElements,Et as flashParagraphFragmentsByParaId,Ft as getRenderableDocumentFonts,Mt as getWordAt,K as handleClickForMultiClick,Gt as prefersColorSchemeDark,Bt as readDocxFileFromInput,wt as redistributeColumnWidths,Ut as resolveIsDark,Qt as sanitizeHref,X as selectParagraphAtCursor,L as selectRenderableFonts,D as selectWordAtCursor,Ot as selectWordInTextNode,Xt as subscribeSystemDark,B as sumColumnWidths};
1
+ export{d as MIN_CARD_GAP,c as SIDEBAR_DOCUMENT_SHIFT,b as SIDEBAR_PAGE_GAP,a as SIDEBAR_WIDTH}from'../chunk-YUOKI2HB.mjs';export{f as blendColors,r as colorsEqual,o as createRgbColor,n as createThemeColor,d as darkenColor,p as ensureHexPrefix,h as generateThemeTintShadeMatrix,c as getContrastingColor,g as getThemeTintShadeHex,k as isBlack,l as isWhite,e as lightenColor,m as parseColorString,a as resolveColor,b as resolveColorToHex,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'../chunk-LTVVQMHB.mjs';export{a as PIXELS_PER_INCH,e as TWIPS_PER_INCH,p as clamp,n as eighthsToPixels,b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,l as halfPointsToPoints,c as pixelsToEmu,h as pixelsToTwips,m as pointsToHalfPoints,d as pointsToPixels,o as roundPixels,j as twipsToEmu,g as twipsToPixels}from'../chunk-CTBUQRYQ.mjs';import {n,d}from'../chunk-VH7P4734.mjs';export{s as FONT_MAPPING,n as canRenderFont,z as createFontLoadScope,c as deobfuscateFont,C as extractEmbeddedFontFaces,x as extractFontsFromDocument,B as getEmbeddedFontFaces,A as getEmbeddedFontFamilies,t as getGoogleFontEquivalent,k as getLoadedFonts,g as isFontLoaded,i as isGoogleFontsEnabled,j as isLoading,b as isValidFontKey,y as loadDocumentFonts,E as loadEmbeddedFontFamilies,D as loadEmbeddedFonts,e as loadFont,r as loadFontDefinitions,o as loadFontFromBuffer,q as loadFontFromUrl,u as loadFontWithMapping,f as loadFonts,v as loadFontsWithMapping,m as onFontError,l as onFontsLoaded,w as preloadCommonFonts,p as registerDocumentFaces,h as setGoogleFontsEnabled,a as toArrayBuffer}from'../chunk-VH7P4734.mjs';import'../chunk-EBYC3CX7.mjs';import {a}from'../chunk-UBUTIWXN.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-AXFMDV66.mjs';import'../chunk-GKWXOZZH.mjs';import'../chunk-HGKSOBXK.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-TTRUPDAB.mjs';function L(e){let t=new Set,o=e.package;if(o.theme&&it(o.theme,t),o.styles&&lt(o.styles,t),o.document)for(let n of o.document.content)y(n,t);if(o.headers)for(let n of o.headers.values())H(n,t);if(o.footers)for(let n of o.footers.values())H(n,t);if(o.footnotes)for(let n of o.footnotes)ht(n,t);if(o.endnotes)for(let n of o.endnotes)xt(n,t);return Array.from(t).sort()}function it(e,t){let o=e.fontScheme;o&&(o.majorFont&&O(o.majorFont,t),o.minorFont&&O(o.minorFont,t));}function O(e,t){if(e.latin&&t.add(e.latin),e.ea&&t.add(e.ea),e.cs&&t.add(e.cs),e.fonts)for(let o of Object.values(e.fonts))o&&t.add(o);}function lt(e,t){e.docDefaults&&(e.docDefaults.rPr&&x(e.docDefaults.rPr,t),e.docDefaults.pPr?.runProperties&&x(e.docDefaults.pPr.runProperties,t));for(let o of e.styles)o.rPr&&x(o.rPr,t),o.pPr?.runProperties&&x(o.pPr.runProperties,t);}function x(e,t){let o=e.fontFamily;o&&(o.ascii&&t.add(o.ascii),o.hAnsi&&t.add(o.hAnsi),o.eastAsia&&t.add(o.eastAsia),o.cs&&t.add(o.cs));}function ct(e,t){e.runProperties&&x(e.runProperties,t);}function y(e,t){e.type==="paragraph"?ft(e,t):e.type==="table"&&mt(e,t);}function ft(e,t){e.formatting&&ct(e.formatting,t);for(let o of e.content)dt(o,t);}function dt(e,t){if(e.type==="run")h(e,t);else if(e.type==="hyperlink")ut(e,t),a(e,o=>{o.type==="run"&&h(o,t);});else if(e.type==="inlineSdt"||e.type==="insertion"||e.type==="deletion"||e.type==="moveFrom"||e.type==="moveTo")a(e,o=>{o.type==="run"&&h(o,t);});else if(e.type==="simpleField"||e.type==="complexField"){if("content"in e)for(let o of e.content)o.type==="run"&&h(o,t);if("fieldResult"in e)for(let o of e.fieldResult)h(o,t);a(e,o=>{o.type==="run"&&h(o,t);});}}function h(e,t){e.formatting&&x(e.formatting,t);}function ut(e,t){for(let o of e.children)o.type==="run"&&h(o,t);}function mt(e,t){for(let o of e.rows)pt(o,t);}function pt(e,t){for(let o of e.cells)gt(o,t);}function gt(e,t){for(let o of e.content)y(o,t);}function H(e,t){for(let o of e.content)y(o,t);}function ht(e,t){for(let o of e.content)y(o,t);}function xt(e,t){for(let o of e.content)y(o,t);}var Ft=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui"]);function N(e,t={}){let o=t.canRender??n,n$1=new Set;for(let i of t.exclude??[])n$1.add(i.trim().toLowerCase());let r=new Set;for(let i of t.embeddedFamilies??[])r.add(i.trim().toLowerCase());let s=[],a=new Set;for(let i of e){let c=i.trim(),f=c.toLowerCase();!c||Ft.has(f)||n$1.has(f)||a.has(f)||!r.has(f)&&!o(c)||(a.add(f),s.push({name:c,fontFamily:d(c).cssFallback,category:"other"}));}return s}function Tt(e,t={}){return N(L(e),t)}function yt(e,t){if(!e||e.length===0)return [];let o=new Set;for(let s of t)o.add(s.trim().toLowerCase());let n=new Set,r=[];for(let s of e){let a=s.name.trim().toLowerCase();o.has(a)||n.has(a)||(n.add(a),r.push(s));}return r}function bt(e){let t=[];return e.descendants((o,n)=>{if(o.type.name==="paragraph"){let r=o.attrs.outlineLevel,s=o.attrs.styleId,a=r;if(a==null&&s){let i=s.match(/^[Hh]eading(\d)$/);i&&(a=parseInt(i[1],10)-1);}if(a!=null&&a>=0&&a<=8){let i="";o.forEach(c=>{c.isText&&(i+=c.text||"");}),i.trim()&&t.push({text:i.trim(),level:a,pmPos:n});}}}),t}var k="rgba(255, 235, 59, 0.55)",Ct=1200,C="docx-paragraph-flash",E=new WeakMap;function At(e){let t=globalThis;return typeof t.CSS?.escape=="function"?t.CSS.escape(e):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function St(e){return e?.color?.trim()||k}function Et(e){let t=e?.durationMs;return t==null||!Number.isFinite(t)||t<0?1200:t}function W(e,t){if(!t||!t.trim())return [];let o=At(t);return Array.from(e.querySelectorAll(`.layout-paragraph[data-para-id="${o}"]`))}function B(e,t){let o=0,n=St(t),r=Et(t);for(let s of e){o++;let a=E.get(s);a!==void 0&&clearTimeout(a),s.classList.remove(C),s.offsetWidth,s.style.setProperty("--docx-paragraph-flash-color",n),s.style.setProperty("--docx-paragraph-flash-duration",`${r}ms`),s.classList.add(C);let i=setTimeout(()=>{s.classList.remove(C),s.style.removeProperty("--docx-paragraph-flash-color"),s.style.removeProperty("--docx-paragraph-flash-duration"),E.delete(s);},r);E.set(s,i);}return o}function wt(e,t,o){let n=W(e,t);return B(n,o)>0}function G(e,t,o){let n=0;for(let r=t;r<t+o&&r<e.length;r++)n+=e[r];return n}function Pt(e,t,o,n){let r=G(e,t,o),s=Math.floor(r/Math.max(n,1)),a=r-s*n,i=Array.from({length:n},(c,f)=>s+(f<a?1:0));return [...e.slice(0,t),...i,...e.slice(t+o)]}function Rt(e,t,o,n,r,s){let a=o-t.rowspan,i=n-t.colspan,c=r+a,f=t.row+t.rowspan,T=t.col+t.colspan,p=[];for(let l of e){if(l===t)continue;let g=l.row+l.rowspan,A=l.col+l.colspan,I=l.row<f&&g>t.row,M=l.col<T&&A>t.col;p.push({data:l.data,row:l.row>=f?l.row+a:l.row,col:l.col>=T?l.col+i:l.col,rowspan:l.rowspan+(a>0&&I&&!M?a:0),colspan:l.colspan+(i>0&&M&&!I?i:0)});}for(let l=0;l<o;l++)for(let g=0;g<n;g++){let A=l===0&&g===0;p.push({data:s(A,l,g),row:t.row+l,col:t.col+g,rowspan:1,colspan:1});}return {anchors:p,deltaRows:a,deltaCols:i,newRowCount:c}}function Dt(e){let t=new Map,o=new Map;for(let n of e){t.set(`${n.row}-${n.col}`,n);for(let r=n.row;r<n.row+n.rowspan;r++)for(let s=n.col;s<n.col+n.colspan;s++)o.set(`${r}-${s}`,n);}return {byStart:t,byCoveredSlot:o}}function vt(e,t){let o=e>1||t>1;return {minRows:e,minCols:t,initialRows:e,initialCols:o?t:t+1}}var It=/[\p{L}\p{N}\p{M}_''\-]/u,Mt=/\s/;function w(e){return !e||e.length===0?false:It.test(e)}function P(e){return !e||e.length===0?false:Mt.test(e)}function m(e,t){if(!e||e.length===0)return [0,0];t=Math.max(0,Math.min(t,e.length-1));let o=e[t];if(P(o)){let n=t,r=t;for(;n>0&&P(e[n-1]);)n--;for(;r<e.length&&P(e[r]);)r++;return [n,r]}if(w(o)){let n=t,r=t;for(;n>0&&w(e[n-1]);)n--;for(;r<e.length&&w(e[r]);)r++;return [n,r]}return [t,t+1]}function _t(e,t){let[o,n]=m(e,t);return e.slice(o,n)}function Ot(e,t){let[o,n]=m(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function v(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType===Node.TEXT_NODE){let n=o.textContent||"",r=t.startOffset,[s,a]=m(n,r);if(a>s)return t.setStart(o,s),t.setEnd(o,a),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=U(n);if(r.length>0){let s=t.startOffset,a=null,i=s;if(s<n.childNodes.length){let c=n.childNodes[s];if(c.nodeType===Node.TEXT_NODE)a=c,i=0;else if(c instanceof Element){let f=U(c);f.length>0&&(a=f[0],i=0);}}if(!a&&r.length>0&&(a=r[0],i=0),a){let c=a.textContent||"",[f,T]=m(c,i);if(T>f){let p=document.createRange();return p.setStart(a,f),p.setEnd(a,T),e.removeAllRanges(),e.addRange(p),true}}}}return false}function Ht(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,s]=m(n,t);if(s>r){let a=document.createRange();return a.setStart(e,r),a.setEnd(e,s),o.removeAllRanges(),o.addRange(a),true}return false}function Lt(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return v();let o=t.startContainer,n=t.endContainer,r=t.startOffset,s=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let a=o.textContent||"",[i]=m(a,t.startOffset);r=i;}if(n.nodeType===Node.TEXT_NODE){let a=n.textContent||"",i=Math.max(0,t.endOffset-1),[,c]=m(a,i);s=c;}try{return t.setStart(o,r),t.setEnd(n,s),e.removeAllRanges(),e.addRange(t),!0}catch(a){return console.warn("Could not expand selection to word boundaries:",a),false}}function K(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=Nt(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function Nt(e){if(!e)return null;let t=e;for(;t;){if(t instanceof Element&&t.hasAttribute("data-paragraph-index"))return t;t=t.parentNode;}return null}function U(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n;for(;n=o.nextNode();)n.nodeType===Node.TEXT_NODE&&t.push(n);return t}var R=0,F=null,D=null,kt=500;function X(){R=0,D=null,F&&(clearTimeout(F),F=null);}function $(e){return e.target!==D&&X(),R++,D=e.target,F&&clearTimeout(F),F=setTimeout(X,kt),Math.min(R,3)}function Wt(){return e=>{e.ctrlKey||e.metaKey||e.altKey||v();}}function Bt(){return e=>{if($(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;K();}}}async function Gt(e){let t=e.target;if(!t||!t.files)return null;let o=t.files[0];return t.value="",o?{buffer:await o.arrayBuffer(),name:o.name.replace(/\.docx$/i,"")}:null}var z="(prefers-color-scheme: dark)";function j(){return typeof window<"u"&&typeof window.matchMedia=="function"}function Ut(){return j()?window.matchMedia(z).matches:false}function Xt(e,t){return e==="dark"||e==="system"&&t}function Kt(e){if(!j())return ()=>{};let t=window.matchMedia(z);e(t.matches);let o=n=>e(n.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)}var $t=-1;function zt(){let e=1;return {next:()=>e++,seedAbove(t){t>=e&&(e=t+1);}}}function jt(e,t,o,n){return {id:e.next(),author:o,date:new Date().toISOString(),content:[{type:"paragraph",formatting:{},content:[{type:"run",formatting:{},content:[{type:"text",text:t}]}]}],...n!==void 0&&{parentId:n}}}var qt=/^[a-z][a-z0-9+.-]*:/i,Qt=/^(https?|mailto|tel|ftp):/i;function Vt(e){if(!e)return;let t=e.replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");if(t)return qt.test(t)?Qt.test(t)?e:void 0:e}export{k as DEFAULT_PARAGRAPH_FLASH_COLOR,Ct as DEFAULT_PARAGRAPH_FLASH_DURATION_MS,C as PARAGRAPH_FLASH_CLASS_NAME,$t as PENDING_COMMENT_ID,Dt as buildAnchorMaps,bt as collectHeadings,vt as computeSplitDialogDefaults,Rt as computeSplitLayout,jt as createComment,zt as createCommentIdAllocator,Wt as createDoubleClickWordSelector,Bt as createTripleClickParagraphSelector,yt as excludeFontsByName,Lt as expandSelectionToWordBoundaries,W as findParagraphFragmentsByParaId,Ot as findWordAt,m as findWordBoundaries,B as flashParagraphElements,wt as flashParagraphFragmentsByParaId,Tt as getRenderableDocumentFonts,_t as getWordAt,$ as handleClickForMultiClick,Ut as prefersColorSchemeDark,Gt as readDocxFileFromInput,Pt as redistributeColumnWidths,Xt as resolveIsDark,Vt as sanitizeHref,K as selectParagraphAtCursor,N as selectRenderableFonts,v as selectWordAtCursor,Ht as selectWordInTextNode,Kt as subscribeSystemDark,G as sumColumnWidths};