@betteroffice/docx 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -7
- package/dist/chunk-4V6MDZIK.mjs +1 -0
- package/dist/chunk-6KDV6AIL.mjs +1 -0
- package/dist/chunk-CTBUQRYQ.mjs +1 -0
- package/dist/chunk-GGEGIQRK.mjs +1 -0
- package/dist/chunk-J7LNO6SM.mjs +1 -0
- package/dist/{chunk-IFT6DUJX.mjs → chunk-LTVVQMHB.mjs} +1 -1
- package/dist/chunk-NBSLB77E.mjs +1 -0
- package/dist/chunk-NTSSE5QK.mjs +57 -0
- package/dist/chunk-YTILOUAA.mjs +16 -0
- package/dist/collaboration/index.d.mts +31 -6
- package/dist/collaboration/index.mjs +1 -1
- package/dist/{content-DLFHRQav.d.mts → content-C3sTRz-u.d.mts} +115 -248
- package/dist/core.d.mts +6 -6
- package/dist/core.mjs +1 -1
- package/dist/{displayListQueries-UGc_XBUv.d.mts → displayListQueries-DLzpvJV6.d.mts} +36 -7
- package/dist/docx/index.d.mts +3 -3
- package/dist/docx/index.mjs +1 -1
- package/dist/editor/index.d.mts +7 -6
- package/dist/{fontLoader-aSewHMKF.d.mts → fontLoader-CMH3bZ2Z.d.mts} +127 -2
- package/dist/{formatting-D1EPSaJP.d.mts → formatting-BEkIBePP.d.mts} +77 -203
- package/dist/{rustDisplayList-CX78djsZ.d.mts → frameDelta-B2kC6XiP.d.mts} +5 -274
- package/dist/generated/edit/docx_edit_bg.wasm +0 -0
- package/dist/generated/layout/docx_layout_bg.wasm +0 -0
- package/dist/generated/parse/docx_parse_bg.wasm +0 -0
- package/dist/{index-Bwxm3oiC.d.mts → index-2piKi4gO.d.mts} +147 -8
- package/dist/layout/index.d.mts +8 -6
- package/dist/layout/index.mjs +1 -1
- package/dist/layout/pagination/index.d.mts +4 -4
- package/dist/layout/pagination/index.mjs +1 -1
- package/dist/layout/render/index.d.mts +10 -9
- package/dist/layout/render/index.mjs +1 -1
- package/dist/plugin-api/RenderedDomContext.d.mts +7 -6
- package/dist/plugin-api/index.d.mts +3 -3
- package/dist/plugin-api/resolveItemPositions.d.mts +3 -3
- package/dist/rustDisplayList-B0M2eBkU.d.mts +283 -0
- package/dist/styles/index.d.mts +2 -2
- package/dist/{styles-Dn_o3Vo5.d.mts → styles-BK3Jecxs.d.mts} +1 -1
- package/dist/types/content.d.mts +2 -2
- package/dist/types/document.d.mts +6 -6
- package/dist/{types-DMkDbvEu.d.mts → types-C1rv3KM-.d.mts} +2 -2
- package/dist/utils/comments.d.mts +2 -2
- package/dist/utils/index.d.mts +4 -4
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/stylePreview.d.mts +2 -2
- package/dist/utils/units.d.mts +4 -34
- package/dist/utils/units.mjs +1 -1
- package/dist/wasm-F2ETFAYL.mjs +1 -0
- package/dist/wasm-JE7B3ROD.mjs +1 -0
- package/dist/wasm-edit.d.mts +25 -0
- package/dist/wasm-edit.mjs +1 -1
- package/dist/wasm-layout.d.mts +14 -1
- package/dist/wasm-layout.mjs +1 -1
- package/dist/yrs/index.d.mts +5 -4
- package/dist/yrs/index.mjs +1 -1
- package/dist/yrs/residentEngineWorker.mjs +1 -1
- package/package.json +1 -2
- package/dist/chunk-3UBMCDME.mjs +0 -1
- package/dist/chunk-6NEKRDXF.mjs +0 -1
- package/dist/chunk-AEQOEQJ7.mjs +0 -57
- package/dist/chunk-AZ52IWB6.mjs +0 -16
- package/dist/chunk-CIRN3LZA.mjs +0 -1
- package/dist/chunk-NTQM4EYN.mjs +0 -1
- package/dist/wasm-BGQBTR2J.mjs +0 -1
- package/dist/wasm-SA237OSP.mjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { L as LayoutBlock, B as BlockExtent } from '../../types-
|
|
2
|
-
export { A as AnchoredObjectPositionInput, d as BlockId, e as BorderStyle, C as CellBorderSpec, f as CellBorders, g as ChartBlock, h as ChartExtent, i as ChartFragment, j as ColumnBreakBlock, k as ColumnBreakExtent, l as ColumnLayout, D as DEFAULT_TEXTBOX_MARGINS, m as DEFAULT_TEXTBOX_WIDTH, n as DocumentPosition, o as FieldRun, p as FloatingTablePosition, F as FootnoteContent, q as FootnoteRenderItem, r as Fragment, s as FragmentBase, H as HeaderFooterContent, t as HeaderFooterContentHeights, u as HeaderFooterLayout, v as HitTestResult, w as HyperlinkInfo, I as ImageBlock, x as ImageExtent, y as ImageFragment, z as ImageRun, E as ImageRunPosition, G as InlineSdtWidget, a as Layout, b as LayoutOptions, J as LineBreakRun, K as ListNumPr, N as NoteAreaContract, M as NoteLayoutItem, O as NoteSettingsContract, P as Page, Q as PageBorderContract, S as PageBreakBlock, T as PageBreakExtent, U as PageGeometry, V as PageHeaderFooterRefs, W as PageMargins, X as PageNumberingContract, Y as ParagraphAttrs, Z as ParagraphBlock, _ as ParagraphBorders, $ as ParagraphExtent, a0 as ParagraphFragment, a1 as ParagraphIndent, a2 as ParagraphSpacing, R as ResolvedLine, c as ResolvedSegment, a3 as Run, a4 as RunFontSlots, a5 as RunFormatting, a6 as RunLanguageSlots, a7 as SdtGroup, a8 as SectionBreakBlock, a9 as SectionBreakExtent, aa as ShapeBlock, ab as ShapeBlockFill, ac as ShapeBlockStroke, ad as ShapeBlockTransform, ae as ShapeExtent, af as ShapeFragment, ag as TabAlignment, ah as TabRun, ai as TabStop, aj as TableBlock, ak as TableCell, al as TableCellExtent, am as TableExtent, an as TableFragment, ao as TableRow, ap as TableRowExtent, aq as TextBoxBlock, ar as TextBoxExtent, as as TextBoxFragment, at as TextRun, au as TypesetBidiSlice, av as TypesetClusterAdvance, aw as TypesetRow, ax as TypesetRowSegment, ay as TypesetRunAdvance, az as WrapTextDirection, aA as assertExhaustiveLayoutBlock, aB as isTextWrappingFloatingImageRun, aC as pageGeometryFromPage, aD as resolveAnchoredObjectVerticalTop } from '../../types-
|
|
3
|
-
import '../../content-
|
|
4
|
-
import '../../formatting-
|
|
1
|
+
import { L as LayoutBlock, B as BlockExtent } from '../../types-C1rv3KM-.mjs';
|
|
2
|
+
export { A as AnchoredObjectPositionInput, d as BlockId, e as BorderStyle, C as CellBorderSpec, f as CellBorders, g as ChartBlock, h as ChartExtent, i as ChartFragment, j as ColumnBreakBlock, k as ColumnBreakExtent, l as ColumnLayout, D as DEFAULT_TEXTBOX_MARGINS, m as DEFAULT_TEXTBOX_WIDTH, n as DocumentPosition, o as FieldRun, p as FloatingTablePosition, F as FootnoteContent, q as FootnoteRenderItem, r as Fragment, s as FragmentBase, H as HeaderFooterContent, t as HeaderFooterContentHeights, u as HeaderFooterLayout, v as HitTestResult, w as HyperlinkInfo, I as ImageBlock, x as ImageExtent, y as ImageFragment, z as ImageRun, E as ImageRunPosition, G as InlineSdtWidget, a as Layout, b as LayoutOptions, J as LineBreakRun, K as ListNumPr, N as NoteAreaContract, M as NoteLayoutItem, O as NoteSettingsContract, P as Page, Q as PageBorderContract, S as PageBreakBlock, T as PageBreakExtent, U as PageGeometry, V as PageHeaderFooterRefs, W as PageMargins, X as PageNumberingContract, Y as ParagraphAttrs, Z as ParagraphBlock, _ as ParagraphBorders, $ as ParagraphExtent, a0 as ParagraphFragment, a1 as ParagraphIndent, a2 as ParagraphSpacing, R as ResolvedLine, c as ResolvedSegment, a3 as Run, a4 as RunFontSlots, a5 as RunFormatting, a6 as RunLanguageSlots, a7 as SdtGroup, a8 as SectionBreakBlock, a9 as SectionBreakExtent, aa as ShapeBlock, ab as ShapeBlockFill, ac as ShapeBlockStroke, ad as ShapeBlockTransform, ae as ShapeExtent, af as ShapeFragment, ag as TabAlignment, ah as TabRun, ai as TabStop, aj as TableBlock, ak as TableCell, al as TableCellExtent, am as TableExtent, an as TableFragment, ao as TableRow, ap as TableRowExtent, aq as TextBoxBlock, ar as TextBoxExtent, as as TextBoxFragment, at as TextRun, au as TypesetBidiSlice, av as TypesetClusterAdvance, aw as TypesetRow, ax as TypesetRowSegment, ay as TypesetRunAdvance, az as WrapTextDirection, aA as assertExhaustiveLayoutBlock, aB as isTextWrappingFloatingImageRun, aC as pageGeometryFromPage, aD as resolveAnchoredObjectVerticalTop } from '../../types-C1rv3KM-.mjs';
|
|
3
|
+
import '../../content-C3sTRz-u.mjs';
|
|
4
|
+
import '../../formatting-BEkIBePP.mjs';
|
|
5
5
|
import '../../docx/wrapTypes.mjs';
|
|
6
6
|
|
|
7
7
|
interface MeasuredBlock {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b as b$2,c as c$1}from'../../chunk-OBQGPMPQ.mjs';import {b as b$1}from'../../chunk-
|
|
1
|
+
import {b as b$2,c as c$1}from'../../chunk-OBQGPMPQ.mjs';import {b as b$1}from'../../chunk-CTBUQRYQ.mjs';import'../../chunk-TTRUPDAB.mjs';var c={top:4,bottom:4,left:7,right:7},h=200;function y(e,r){let o=e.kind??"<unknown>";throw new Error(`${r}: unhandled LayoutBlock kind "${o}". Add the case alongside the other LayoutBlock switches (see types.ts).`)}function x(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function f(e,r,o){return l(e,r,o)}function l(e,r,o){let n=e.position?.vertical;if(!n)return r;let t=b(n.relativeTo,r,o);return n.align==="top"?t.base:n.align==="center"?t.size?t.base+(t.size-e.height)/2:r:n.align==="bottom"?t.size?t.base+t.size-e.height:r:n.posOffset!==void 0?t.base+b$1(n.posOffset):n.relativeTo==="paragraph"||n.relativeTo==="line"?r:t.base}function b(e,r,o){let n=o?.pageHeight??0,t=o?.marginTop??0,a=o?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:r,size:0};case "page":return {base:-t,size:n};case "topMargin":return {base:-t,size:t};case "bottomMargin":return {base:a,size:t};default:return {base:0,size:a}}}function k(e){return b$2(e.wrapType)||e.wrapType==="topAndBottom"?false:c$1(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}export{c as DEFAULT_TEXTBOX_MARGINS,h as DEFAULT_TEXTBOX_WIDTH,y as assertExhaustiveLayoutBlock,k as isTextWrappingFloatingImageRun,x as pageGeometryFromPage,f as resolveAnchoredObjectVerticalTop};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { a as DisplayPage, b as DisplayPrimitive, D as DisplayList, G as GlyphRunPrimitive, L as LinePrimitive, T as TextRunPrimitive } from '../../frameDelta-B2kC6XiP.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 } from '../../frameDelta-B2kC6XiP.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-B0M2eBkU.mjs';
|
|
4
|
+
import { a as DisplayListQueries, b as DisplayListRegionHit, D as DisplayListRect } from '../../displayListQueries-DLzpvJV6.mjs';
|
|
5
|
+
export { c as DisplayListHitRegion, d as DisplayListImageGeometry, e as DisplayListImageRegion, f as DisplayListParagraphGeometry, g as DisplayListQuerySourceState, h as DisplayListVerticalMove, i as DisplayListVisualLine, L as LocatedImagePrimitive, R as ResidentDisplayListQueryEngine, j as captureInlinePositionEmuFromDisplayList, k as createDisplayListQueries, l as findImagePrimitiveAtPoint, m as findImagePrimitiveByDocPos, n as isDisplayListQuerySourceDead, o as onDisplayListQuerySourceFailure } from '../../displayListQueries-DLzpvJV6.mjs';
|
|
6
|
+
import { u as YrsLoc, Y as YrsSession, v as YrsRevisionInfo } from '../../index-2piKi4gO.mjs';
|
|
6
7
|
import { TrackedChangeEntry } from '../../utils/comments.mjs';
|
|
7
|
-
import '../../
|
|
8
|
-
import '../../content-
|
|
9
|
-
import '../../formatting-D1EPSaJP.mjs';
|
|
8
|
+
import '../../formatting-BEkIBePP.mjs';
|
|
9
|
+
import '../../content-C3sTRz-u.mjs';
|
|
10
10
|
import '../../docx/wrapTypes.mjs';
|
|
11
|
+
import '../../types-C1rv3KM-.mjs';
|
|
11
12
|
import '../pagination/index.mjs';
|
|
12
13
|
import '../../types/document.mjs';
|
|
13
|
-
import '../../styles-
|
|
14
|
+
import '../../styles-BK3Jecxs.mjs';
|
|
14
15
|
|
|
15
16
|
/** a cached glyph: its outline path (font units) plus the font's units-per-em. */
|
|
16
17
|
interface GlyphOutline {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,c,e,r,s,f}from'../../chunk-6NEKRDXF.mjs';export{o as FRAME_DELTA_HEADER_BYTES,p as FRAME_DELTA_PAGE_OP_BYTES,n as FRAME_DELTA_VERSION,q as FrameDeltaError,a as GlyphCache,s as applyFrameDelta,t as applyFrameDeltaOwned,r as decodeFrameDelta,l as drawDisplayPage,m as drawPrimitive,b as fontSizePxFromShorthand,d as glyphRunRect,e as lineRect,h as presentDisplayPageBackBuffer,i as presentOffscreenPageBackBuffer,k as rasterizeDisplayListPages,g as rasterizeDisplayPageToBackBuffer,j as sizeCanvasForPage,c as textRunRect}from'../../chunk-6NEKRDXF.mjs';export{b as resolveCanvasPoint,a as resolveDisplayPageClientRect}from'../../chunk-WRWRCBLK.mjs';import {c as c$1}from'../../chunk-3UBMCDME.mjs';import {b}from'../../chunk-TTRUPDAB.mjs';var Xe={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 Bt(){return import('../../wasm-SA237OSP.mjs').then(async e=>(await e.preloadLayoutWasm(),e.outlineGlyphJson))}var D={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 Ht(e,t={}){let r=t.document??document,i=t.labels,n={labels:i,noteRefIds:new Set},s=r.createElement("div");s.className=D.page,s.setAttribute("role","document"),i?.page&&s.setAttribute("aria-label",i.page),s.dataset.pageIndex=String(e.pageIndex),e.sectionId!==void 0&&(s.dataset.sectionId=e.sectionId),e.sectionIndex!==void 0&&(s.dataset.sectionIndex=String(e.sectionIndex)),e.sectionPageIndex!==void 0&&(s.dataset.sectionPageIndex=String(e.sectionPageIndex)),e.sectionPageNumber!==void 0&&(s.dataset.sectionPageNumber=String(e.sectionPageNumber)),e.pageLabel!==void 0&&(s.dataset.pageLabel=e.pageLabel),s.style.position="relative",s.style.width=`${e.width}px`,s.style.height=`${e.height}px`,s.style.opacity="0",s.style.pointerEvents="none";let o=r.createElement("div");o.className=D.content,o.style.position="absolute",o.style.left="0",o.style.top="0",o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,s.appendChild(o);for(let a of (e.pageBorders??[]).filter(l=>l.zOrder==="back"))o.appendChild(Je(a,r,0));re(o,e.primitives,r,0,n);for(let a of e.noteAreas??[])o.appendChild(Wt(a,e,r,n));for(let a of [e.header,e.footer])a&&s.appendChild(Gt(a,e,r,n));for(let a of (e.pageBorders??[]).filter(l=>l.zOrder!=="back"))s.appendChild(Je(a,r,0));return s}function Gt(e,t,r,i){let n=r.createElement("div");n.className=e.kind==="header"?D.header:D.footer,n.dataset.hfRid=e.rId;let s=e.kind==="header"?i.labels?.header:i.labels?.footer;return s&&(n.setAttribute("role","region"),n.setAttribute("aria-label",s)),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`,re(n,e.primitives,r,-e.y,i),n}function re(e,t,r,i,n){let s=new Map;for(let o of t){let a=o.kind==="line"?void 0:o.blockKey??o.blockId;if(a===void 0){e.appendChild(ye(o,r,i,n));continue}let l=o.table,c=l?.tableId!==void 0?`table:${l.tableId}#${l.rowStart??0}`:a,d=s.get(c);if(!d){let g=r.createElement("div");g.dataset.blockId=String(l?.tableId??a),g.style.position="absolute",g.style.left="0",g.style.top="0",e.appendChild(g),d={el:g,prims:[]},s.set(c,d);}d.prims.push(o);}for(let o of s.values())Nt(o,r,i,n);Ot(s);}function Nt(e,t,r,i){let{el:n,prims:s}=e;if(!s.some(f=>f.cell!==void 0||f.structuralRevision?.scope==="table"||f.structuralRevision?.scope==="row"||f.structuralRevision?.scope==="cell")){$e(n,s,t,r,i);return}n.className=D.table,n.setAttribute("role","table");let a=s.find(f=>f.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 l=fe(s,"table");l&&pe(n,l),we(n,s.find(f=>f.sdt!==void 0)?.sdt);for(let f of s)f.cell===void 0&&n.appendChild(ye(f,t,r,i));let c=new Map,d=0,g=0;for(let f of s){if(f.cell===void 0)continue;let{row:u,col:h}=f.cell;d=Math.max(d,u+(f.cell.rowSpan??1)),g=Math.max(g,h+(f.cell.colSpan??1));let L=c.get(u);L||(L=new Map,c.set(u,L));let k=L.get(h);k||(k={ref:f.cell,prims:[]},L.set(h,k)),k.prims.push(f);}n.setAttribute("aria-rowcount",String(a?.rowCount??d)),n.setAttribute("aria-colcount",String(a?.columnCount??g));for(let f of [...c.keys()].sort((u,h)=>u-h)){let u=t.createElement("div");u.className=D.tableRow,u.setAttribute("role","row"),u.setAttribute("aria-rowindex",String(f+1));let h=fe(s,"row",f);h&&pe(u,h),u.style.position="absolute",u.style.left="0",u.style.top="0",n.appendChild(u);let L=c.get(f);for(let k of [...L.keys()].sort((v,b)=>v-b)){let v=L.get(k),b=t.createElement("div");b.className=D.tableCell,b.setAttribute("role",v.ref.isHeader?"columnheader":"cell"),b.setAttribute("aria-colindex",String(k+1)),v.ref.cellId&&(b.id=v.ref.cellId),v.ref.headerIds?.length&&b.setAttribute("aria-labelledby",v.ref.headerIds.join(" ")),v.ref.repeatedHeader&&(b.dataset.repeatedHeader="true"),v.ref.noWrap&&(b.dataset.noWrap="true");let M=v.ref.rowSpan??1,C=v.ref.colSpan??1;M>1&&b.setAttribute("aria-rowspan",String(M)),C>1&&b.setAttribute("aria-colspan",String(C));let w=fe(v.prims,"cell",f,k);w&&pe(b,w),v.ref.continuation&&(b.dataset.vmergeContinuation="true"),b.style.position="absolute",b.style.left="0",b.style.top="0";let Y=new Map,ee=[];for(let A of v.prims){let W=A.blockKey??A.blockId;if(W===void 0){ee.push(A);continue}let G=Y.get(W);G?G.push(A):Y.set(W,[A]);}for(let A of ve(ee))b.appendChild(ye(A,t,r,i));for(let[A,W]of Y){let G=t.createElement("div");G.dataset.blockId=String(A),G.style.position="absolute",G.style.left="0",G.style.top="0",$e(G,W,t,r,i),b.appendChild(G);}Yt(b,v.prims),je(b,v.prims),e.cells.push({el:b,bounds:ze(v.prims)}),u.appendChild(b);}}ke(n,s);}function $e(e,t,r,i,n){let s=t.find(c=>c.chart!==void 0)?.chart;e.className=s?`${D.block} ${D.chart}`:D.block,e.setAttribute("role",s?"img":"paragraph"),s?.label&&e.setAttribute("aria-label",s.label);for(let c of ve(t))e.appendChild(ye(c,r,i,n));let o=fe(t,"pmark");o&&pe(e,o),Ft(e,t,r,i),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 l=t.find(c=>c.fromLine!==void 0);l?.fromLine!==void 0&&(e.dataset.fromLine=String(l.fromLine),l.toLine!==void 0&&(e.dataset.toLine=String(l.toLine))),je(e,t),Xt(e,t);}function Ft(e,t,r,i){ke(e,t);let n=Number(e.dataset.docStart),s=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)),l=o.length>0?Math.min(...o):void 0,c=a.length>0?Math.max(...a):void 0,d=l??(Number.isFinite(n)&&n===s&&n>0?n-1:void 0);if(d!==void 0&&(e.dataset.docStart=String(d)),c!==void 0&&(e.dataset.docEnd=String(c)),d!==void 0&&!t.some(g=>g.docStart===d)){let g=ve(t).find(u=>Se(u)!==void 0),f=g?Se(g):void 0;if(f){let u=r.createElement("span");u.className="layout-mirror-structural-anchor",u.dataset.docStart=String(d),u.dataset.docEnd=String(d),j(u,f,i),e.insertBefore(u,e.firstChild);}}}function Yt(e,t){let r=e.querySelectorAll(".layout-paragraph[data-doc-start]"),i=1/0,n=-1/0;for(let s of r){let o=Number(s.dataset.docStart),a=Number(s.dataset.docEnd);Number.isFinite(o)&&(i=Math.min(i,o)),Number.isFinite(a)&&(n=Math.max(n,a));}i!==1/0&&(e.dataset.docStart=String(i)),n!==-1/0&&(e.dataset.docEnd=String(n)),i===1/0&&n===-1/0&&ke(e,t);}function Ot(e){let t=new Map;for(let r of e.values())r.table?.tableId&&t.set(r.table.tableId,r);for(let r of e.values()){let i=r.table?.parentTableId;if(!i)continue;let n=t.get(i),s=ze(r.prims);if(!n?.cells?.length||!s)continue;let o=s.x+s.w/2,a=s.y+s.h/2,l=n.cells.filter(c=>c.bounds&&_t(o,a,c.bounds));l.sort((c,d)=>Ke(c.bounds)-Ke(d.bounds)),l[0]?.el.appendChild(r.el);}}function _t(e,t,r){return e>=r.x&&e<=r.x+r.w&&t>=r.y&&t<=r.y+r.h}function Ke(e){return e.w*e.h}function ze(e){let t;for(let r of e){let i=r.clipGroup?.clip,n=i?.x!==void 0&&i.y!==void 0&&i.w!==void 0&&i.h!==void 0?{x:i.x,y:i.y,w:i.w,h:i.h}:Se(r);if(!n)continue;if(!t){t={...n};continue}let s=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=s-t.x,t.h=o-t.y;}return t}function Se(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 ve(e){let t=e.filter(i=>i.logicalOrder!==void 0).sort((i,n)=>(i.logicalOrder??0)-(n.logicalOrder??0)||(i.docStart??0)-(n.docStart??0));if(t.length<2)return e;let r=0;return e.map(i=>i.logicalOrder===void 0?i:t[r++])}function je(e,t){let r=t.find(s=>s.lang)?.lang;r&&(e.lang=r);let i=t.find(s=>s.bidiLevel!==void 0||"rtl"in s);if(!i)return;let n=i.bidiLevel!==void 0?i.bidiLevel%2===1:"rtl"in i?i.rtl:false;e.dir=n?"rtl":"ltr";}function Xt(e,t){let r=t.find(i=>i.ariaLabel||i.ariaDescription||i.decorative||i.hiddenObject||i.groupId);r&&qe(e,r);}function ke(e,t){let r,i;for(let n of t)n.docStart!==void 0&&(r=r===void 0?n.docStart:Math.min(r,n.docStart)),n.docEnd!==void 0&&(i=i===void 0?n.docEnd:Math.max(i,n.docEnd));r!==void 0&&(e.dataset.docStart=String(r)),i!==void 0&&(e.dataset.docEnd=String(i));}function fe(e,t,r,i){return e.find(n=>{let s=n.structuralRevision;return !(!s||s.scope!==t||r!==void 0&&s.rowIndex!==r||i!==void 0&&s.colIndex!==i)})?.structuralRevision}function ye(e$1,t,r,i){switch(e$1.kind){case "text":{let n=We(t,e$1,i);return n.className=D.text,n.textContent=e$1.text,j(n,c(e$1),r),n.style.font=e$1.font,Qe(n,e$1),Ve(n,e$1),De(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(D.revisionPmarkGlyph),e$1.structuralRevision.kind==="ins"&&n.classList.add(D.revisionPmarkIns),e$1.structuralRevision.kind==="del"&&n.classList.add(D.revisionPmarkDel),n.setAttribute("aria-hidden","true")),e$1.listMarker&&(n.classList.add(D.listMarker),n.setAttribute("aria-hidden","true"),e$1.listMarkerRevision&&(n.style.color=e$1.listMarkerRevision==="ins"?"rgb(46, 125, 50)":"rgb(198, 40, 40)")),ne(n,e$1),n}case "glyphRun":{let n=We(t,e$1,i);return n.className=D.text,n.textContent=e$1.text,j(n,d(e$1),r),n.style.fontSize=`${e$1.size}px`,$t(n,e$1.fallbackFont),Qe(n,e$1),Ve(n,e$1),De(n,e$1.hidden&&e$1.opacity===void 0?.4:e$1.opacity,e$1.rotationDeg,e$1.horizontalScale),ne(n,e$1),n}case "rect":{let n=t.createElement("div");return n.className=D.rect,j(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},r),ne(n,e$1),n}case "line":{let n=t.createElement("div");return n.className=e$1.role==="table-cut"?D.tableCut:D.line,e$1.role&&e$1.role!=="table-cut"&&(n.dataset.role=e$1.role),j(n,e(e$1),r),n.setAttribute("aria-hidden","true"),n}case "image":{let n=e$1.href?t.createElement("a"):t.createElement("div");return n.className=D.image,e$1.decorative?n.setAttribute("aria-hidden","true"):(n.setAttribute("role","img"),e$1.altText&&n.setAttribute("aria-label",e$1.altText)),Ue(n,e$1),n.dataset.relId=e$1.relId,j(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},r),De(n,e$1.opacity,e$1.rotationDeg),e$1.filter&&(n.style.filter=e$1.filter),ne(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=D.shape,e$1.decorative?n.setAttribute("aria-hidden","true"):n.setAttribute("role","img"),j(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},r),Kt(n,e$1.transform),ne(n,e$1),n}case "decoration":{let n=t.createElement("span");return n.className=D.decoration,n.dataset.deco=e$1.deco,j(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},r),ne(n,e$1),n}}}function Je(e,t,r){let i=t.createElement("div");return i.className=D.pageBorder,j(i,{x:e.x,y:e.y,w:e.w,h:e.h},r),i.style.boxSizing="border-box",i.style.pointerEvents="none",i.style.zIndex=e.zOrder==="back"?"0":"20",me(i,"Top",e.top),me(i,"Right",e.right),me(i,"Bottom",e.bottom),me(i,"Left",e.left),i}function j(e,t,r=0){e.style.position="absolute",e.style.left=`${t.x}px`,e.style.top=`${t.y+r}px`,e.style.width=`${t.w}px`,e.style.height=`${t.h}px`;}function We(e,t,r){let i=t.noteRef?.id!==void 0?t.noteRef:void 0,n=t.href||i?e.createElement("a"):e.createElement("span");if(Ue(n,t),i&&!t.href){let s=i.kind??"footnote",o=`oox-${s}-${i.id}`;n.setAttribute("href",`#${o}`),n.setAttribute("role","doc-noteref");let a=`oox-noteref-${s}-${i.id}`;r.noteRefIds.has(a)||(r.noteRefIds.add(a),n.id=a);}return n}function Ue(e,t){let{href:r}=t;if(!r)return;e.setAttribute("href",r),e.dataset.href=r;let i=t.linkTitle??t.tooltip;i&&(e.title=i),t.linkTarget?e.setAttribute("target",t.linkTarget):r.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 $t(e,t){if(t)for(let r of t.split(" ")){if(r.endsWith("px"))break;r==="italic"?e.style.fontStyle="italic":/^[1-9]00$/.test(r)&&r!=="400"&&(e.style.fontWeight=r);}}function Qe(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 me(e,t,r){if(!r)return;let i=e.style;i[`border${t}Width`]=`${r.width}px`,i[`border${t}Style`]=r.style,i[`border${t}Color`]=r.color;}function De(e,t,r,i){t!==void 0&&(e.style.opacity=String(t));let n=[];r&&n.push(`rotate(${r}deg)`),i!==void 0&&i!==100&&n.push(`scaleX(${i/100})`),n.length>0&&(e.style.transform=n.join(" "),e.style.transformOrigin=i!==void 0&&i!==100?"left center":"center center");}function Kt(e,t){if(!t)return;let r=[];t.rotation&&r.push(`rotate(${t.rotation}deg)`),t.flipH&&r.push("scaleX(-1)"),t.flipV&&r.push("scaleY(-1)"),r.length!==0&&(e.style.transform=r.join(" "),e.style.transformOrigin="center center");}function Ve(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 r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",i=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=r,e.style.textEmphasisPosition=i,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=i;}t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function ne(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 r=t.field.type??t.field.category;r&&(e.dataset.fieldType=r),t.field.category&&(e.dataset.fieldCategory=t.field.category),t.field.instruction&&(e.dataset.fieldInstruction=t.field.instruction);let i=t.field.instruction?.trim()||r;i&&e.setAttribute("aria-description",i);}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 r=[t.comment.status,t.comment.authorName??t.comment.authorId,t.comment.date,t.comment.text,...(t.comment.replies??[]).map(i=>[i.authorName,i.text].filter(Boolean).join(": "))].filter(Boolean).join(", ");r&&e.setAttribute("aria-description",r);}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 r=[t.revision.author,t.revision.date].filter(Boolean).join(", ");r&&e.setAttribute("aria-description",r);}t.href&&(e.dataset.href=t.href),Jt(e,t.inlineSdtWidget),we(e,t.sdt),t.sdtPath?.length&&(e.dataset.sdtPath=t.sdtPath.map(r=>r.groupId).join(" ")),t.logicalOrder!==void 0&&(e.dataset.logicalOrder=String(t.logicalOrder)),t.bidiLevel!==void 0&&(e.dataset.bidiLevel=String(t.bidiLevel)),qe(e,t);}function qe(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(D.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 Jt(e,t){if(!t)return;e.classList.add(D.inlineSdtWidget);let r=t.controlKind??t.kind;e.dataset.sdtWidget=r,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)),r==="checkbox"?e.setAttribute("role","checkbox"):r==="dropDownList"||r==="comboBox"?(e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","false")):r==="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 pe(e,t){switch(t.scope){case "pmark":e.classList.add(D.revisionPmark),t.kind==="ins"&&e.classList.add(D.revisionPmarkIns),t.kind==="del"&&e.classList.add(D.revisionPmarkDel);break;case "table":e.classList.add(D.revisionTable,Ie(t.kind));break;case "row":e.classList.add(D.revisionRow,Ie(t.kind));break;case "cell":e.classList.add(D.revisionCell,Ie(t.kind));break}e.dataset.revisionId=t.revisionId,e.dataset.revisionAuthor=t.author,t.date&&(e.dataset.revisionDate=t.date);let r=[t.author,t.date].filter(Boolean).join(", ");r&&e.setAttribute("aria-description",r);}function Ie(e){return e==="ins"?D.revisionIns:e==="del"?D.revisionDel:D.revisionMerge}function Wt(e,t,r,i){let n=r.createElement("section");n.className=D.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 s=new Map;for(let a of e.notes??[])a.id!==void 0&&s.set(a.id,a);re(n,e.separatorPrimitives??[],r,-(e.y??0),i);let o=[...e.primitives??[]];for(let a of e.noteIds??[]){let c=`${e.kind??"footnote"}-${a}`,d=o.filter(u=>u.groupId===c);if(d.length===0)continue;for(let u of d){let h=o.indexOf(u);h>=0&&o.splice(h,1);}let g=r.createElement("aside");g.className=D.note,g.id=`oox-${c}`,g.dataset.noteId=String(a),g.setAttribute("role",e.kind==="endnote"?"doc-endnote":"doc-footnote");let f=s.get(a);if(f&&(f.label!==void 0&&(g.dataset.noteLabel=f.label),f.anchorDocStart!==void 0&&(g.dataset.anchorDocStart=String(f.anchorDocStart)),f.anchorDocEnd!==void 0&&(g.dataset.anchorDocEnd=String(f.anchorDocEnd))),re(g,d,r,-(e.y??0),i),f){let u=r.createElement("a");u.className=D.noteBacklink,u.setAttribute("role","doc-backlink"),u.setAttribute("href",`#oox-noteref-${c}`);let h=i.labels?.noteBacklink??f.label??String(a);u.setAttribute("aria-label",h),g.appendChild(u);}n.appendChild(g);}return o.length>0&&re(n,o,r,-(e.y??0),i),n}function Qt(e,t){for(let r of Array.from(e.querySelectorAll(".layout-canvas-sdt-box[data-sdt-group-id]")))r.classList.toggle("layout-sdt-focused",t.has(r.dataset.sdtGroupId??""));}var Vt=".layout-sdt-widget, .layout-inline-sdt-widget, .layout-sdt-repeat-btn";function zt(e,t={}){let r=t.document??document,i=r.createElement("div");i.className="layout-interactive-overlay",i.dataset.pageIndex=String(e.pageIndex),i.style.position="absolute",i.style.inset="0",i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.pointerEvents="none",i.addEventListener("mousedown",a=>{a.target?.closest?.(Vt)&&(a.preventDefault(),a.stopPropagation());});let n=jt(e),s=Ut(n);for(let a of [...s.values()].sort(Zt))i.appendChild(en(a,r,t.labels));let o=qt(n);for(let a of o.values())i.appendChild(tn(a,r,t.labels));return i}function jt(e){return [...e.primitives,...e.header?.primitives??[],...e.footer?.primitives??[],...(e.noteAreas??[]).flatMap(t=>[...t.separatorPrimitives??[],...t.primitives??[]])]}function Ut(e){let t=new Map;for(let r of e){let i=et(r);if(!i)continue;let n=r.sdtPath?.length?r.sdtPath:r.sdt?[r.sdt]:[];for(let s of n){let o=t.get(s.groupId);o?o.rect=tt(o.rect,i):t.set(s.groupId,{attrs:s,rect:{...i}});}}return t}function qt(e){let t=new Map;for(let r of e){let i=r.inlineSdtWidget,n=et(r);if(!i||!n)continue;let s=`${i.groupId}:${i.pos}:${i.controlKind??i.kind}`,o=t.get(s);o?o.rect=tt(o.rect,n):t.set(s,{attrs:i,rect:{...n}});}return t}function Zt(e,t){return (e.attrs.depth??0)-(t.attrs.depth??0)||e.rect.y-t.rect.y||e.rect.x-t.rect.x}function en(e,t,r){let{attrs:i,rect:n}=e,s=t.createElement("div");s.className="layout-block-sdt-box layout-canvas-sdt-box",sn(s,i),nt(s,n),s.style.pointerEvents="none";let o=i.alias||i.tag;if(o){let c=t.createElement("span");c.className="layout-block-sdt-label",c.textContent=o,s.appendChild(c);}let a=rn(i.sdtType),l=!i.bound&&!on(i.lock);if(a&&l){let c=t.createElement("button");c.type="button",c.className="layout-sdt-widget",c.dataset.sdtWidget=a,c.dataset.sdtGroupId=i.groupId,i.tag&&(c.dataset.sdtTag=i.tag),i.alias&&(c.dataset.sdtAlias=i.alias),(o||r?.control)&&c.setAttribute("aria-label",o||r?.control||""),a==="dropdown"&&c.setAttribute("aria-haspopup","listbox"),a==="date"&&c.setAttribute("aria-haspopup","dialog"),a==="checkbox"&&(c.setAttribute("role","checkbox"),c.setAttribute("aria-checked",String(i.checked??false))),c.textContent=a==="dropdown"?"\u25BE":a==="date"?"\u25A3":i.checked?"\u2612":"\u2610",c.style.pointerEvents="auto",s.appendChild(c);}if(i.repeatingItem&&l){let c=t.createElement("div");c.className="layout-sdt-repeat-controls",c.style.pointerEvents="auto",c.appendChild(Ze(t,i,"add","\uFF0B",r?.addRepeatingItem,o)),c.appendChild(Ze(t,i,"remove","\u2715",r?.removeRepeatingItem,o)),s.appendChild(c);}return s}function Ze(e,t,r,i,n,s){let o=e.createElement("button");return o.type="button",o.className="layout-sdt-repeat-btn",o.dataset.sdtRepeat=r,o.dataset.sdtGroupId=t.groupId,t.tag&&(o.dataset.sdtTag=t.tag),(n||s)&&o.setAttribute("aria-label",n||s||""),o.textContent=i,o}function tn(e,t,r){let{attrs:i,rect:n}=e,s=i.controlKind??i.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=nn(s),o.dataset.sdtGroupId=i.groupId,o.dataset.sdtPos=String(i.pos),i.tag&&(o.dataset.sdtTag=i.tag),i.alias&&(o.dataset.sdtAlias=i.alias),i.controlId!==void 0&&(o.dataset.sdtControlId=String(i.controlId)),i.value!==void 0&&(o.dataset.sdtValue=i.value),i.selectedIndex!==void 0&&(o.dataset.sdtSelectedIndex=String(i.selectedIndex)),i.dateFormat&&(o.dataset.sdtDateFormat=i.dateFormat),i.dateLanguage&&(o.dataset.sdtDateLanguage=i.dateLanguage),i.listItems?.length&&(o.dataset.sdtListItems=JSON.stringify(i.listItems)),(i.alias||i.tag||r?.control)&&o.setAttribute("aria-label",i.alias||i.tag||r?.control||""),s==="checkbox"?(o.setAttribute("role","checkbox"),o.setAttribute("aria-checked",String(i.checked??false))):s==="dropDownList"||s==="comboBox"?(o.setAttribute("aria-haspopup","listbox"),o.setAttribute("aria-expanded","false")):s==="date"&&o.setAttribute("aria-haspopup","dialog"),o.disabled=i.locked===true,o.textContent=s==="checkbox"?i.checked?"\u2612":"\u2610":s==="date"?"\u25A3":s==="picture"?"\u25A7":"\u25BE",nt(o,n),o.style.pointerEvents="auto",o}function nn(e){return e==="dropDownList"||e==="comboBox"?"dropdown":e}function rn(e){return e==="checkbox"?"checkbox":e==="dropDownList"||e==="comboBox"?"dropdown":e==="date"?"date":null}function on(e){return e==="contentLocked"||e==="sdtContentLocked"||e==="sdtLocked"}function sn(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 et(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 tt(e,t){let r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),n=Math.max(e.x+e.w,t.x+t.w),s=Math.max(e.y+e.h,t.y+t.h);return {x:r,y:i,w:n-r,h:s-i}}function nt(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 J=class extends Error{constructor(r,i){let n=i instanceof Error?i.message:String(i);super(`Rust display-list ${r} failed: ${n}`);b(this,"stage");this.name="RustDisplayListSourceError",this.stage=r;}},it=null;function Me(){return it??(it=import('../../wasm-SA237OSP.mjs').then(async e=>(await e.preloadLayoutWasm(),{buildDisplayListJson:e.buildDisplayListJson,hitTestRegionsJson:e.hitTestRegionsJson,rangeRectsJson:e.rangeRectsJson,rangeRectsRegionJson:e.rangeRectsRegionJson,hasRangeRectsRegion:e.hasRangeRectsRegion,hasDisplayListSession:e.hasDisplayListSession,openDisplayList:e.openDisplayList,closeDisplayList:e.closeDisplayList,hitTestRegionsByHandle:e.hitTestRegionsByHandle,rangeRectsByHandle:e.rangeRectsByHandle,rangeRectsRegionByHandle:e.rangeRectsRegionByHandle}))),it}function Pe(){return Me()}function an(e,t){let r=e.measured,i="[";for(let s=0;s<r.length;s++){s>0&&(i+=",");let o=r[s],a=o.measure,l;if(t&&a!==null&&typeof a=="object"){let c=a;l=t.get(c),l===void 0&&(l=JSON.stringify(o.measure),t.set(c,l));}else l=JSON.stringify(o.measure);i+='{"block":'+JSON.stringify(o.block)+',"measure":'+l+"}";}i+="]";let n='{"measured":'+i+',"options":'+JSON.stringify(e.options)+',"layout":'+JSON.stringify(e.layout);return e.contractVersion!==void 0&&(n+=',"contractVersion":'+JSON.stringify(e.contractVersion)),e.headersFooters!==void 0&&(n+=',"headersFooters":'+JSON.stringify(e.headersFooters)),e.fontChains!==void 0&&(n+=',"fontChains":'+JSON.stringify(e.fontChains)),e.noteAreas!==void 0&&(n+=',"noteAreas":'+JSON.stringify(e.noteAreas)),e.resolvedCommentIds!==void 0&&(n+=',"resolvedCommentIds":'+JSON.stringify(e.resolvedCommentIds)),e.commentAuthors!==void 0&&(n+=',"commentAuthors":'+JSON.stringify(e.commentAuthors)),e.commentThreads!==void 0&&(n+=',"commentThreads":'+JSON.stringify(e.commentThreads)),n+="}",n}function rt(e){let t={};return e.contractVersion!==void 0&&(t.contractVersion=e.contractVersion),e.headersFooters!==void 0&&(t.headersFooters=e.headersFooters),e.fontChains!==void 0&&(t.fontChains=e.fontChains),e.noteAreas!==void 0&&(t.noteAreas=e.noteAreas),e.resolvedCommentIds!==void 0&&(t.resolvedCommentIds=e.resolvedCommentIds),e.commentAuthors!==void 0&&(t.commentAuthors=e.commentAuthors),e.commentThreads!==void 0&&(t.commentThreads=e.commentThreads),JSON.stringify(t)}var ln=new WeakMap;async function ot(e,t){let r;try{r=t??await Me();}catch(s){throw new J("load",s)}let i,n;try{i=an(e,ln),n=r.buildDisplayListJson(i);}catch(s){throw new J("build",s)}try{return JSON.parse(n)}catch(s){throw new J("parse",s)}}async function cn(e,t,r$1=null){let i;try{i=t??await Me();}catch(l){throw new J("load",l)}if(!i.buildDisplayListFrame)return {displayList:await ot(e,i),frame:null,transport:"json"};let n=rt(e),s$1;try{s$1=i.buildDisplayListFrame(n,r$1?.frameEpoch??0);}catch(l){throw new J("build",l)}let o;try{o=r(s$1);}catch(l){throw new J("decode",l)}let a;try{a=s(r$1,o);}catch(l){throw new J("apply",l)}return {displayList:a.displayList,frame:a,transport:"frame-delta-v1"}}function st(e,t,r){if(t==="body")return e.primitives.filter(n=>n.kind==="image");let i=t==="header"?e.header:e.footer;return !i||r!==void 0&&i.rId!==r?[]:i.primitives.filter(n=>n.kind==="image")}function Ae(e,t,r="body",i){for(let n of e.pages)for(let s of st(n,r,i))if(s.docStart===t)return {primitive:s,pageIndex:n.pageIndex,...r!=="body"?{region:r,rId:i}:{}};return null}function Ee(e,t,r,i,n="body",s){let o=e.pages[t];if(!o)return null;let a=st(o,n,s);for(let l=a.length-1;l>=0;l--){let c=a[l];if(!(r<c.x||r>c.x+c.w)&&!(i<c.y||i>c.y+c.h))return {primitive:c,pageIndex:o.pageIndex,...n!=="body"?{region:n,rId:s}:{}}}return null}function dn(e,t){let r=e.imageByPos(t);if(!r)return;let i=e.contentBounds(r.pageIndex),n=e.paragraphRects(t).find(s=>s.pageIndex===r.pageIndex);if(!(!i||!n))return {horizontalEmu:Math.round(c$1(r.primitive.x-i.x)),verticalEmu:Math.round(c$1(r.primitive.y-n.y))}}var at=(()=>{let e=globalThis.FinalizationRegistry;return e?new e(t=>t()):null})();function un(e,t){let r=null,i=()=>r??(r=JSON.stringify(e)),n=mn(t)?t:null,s=n?null:t??null,o=null,a,l,c=new Promise((m,p)=>{a=m,l=p;});c.catch(()=>{});let d=null,g=false,f$1=()=>{if(d!==null){try{s?.closeDisplayList?.(d);}catch{}d=null;}},u=()=>{if(!(g||d!==null||!s)&&!(!s.hasDisplayListSession?.()||!s.openDisplayList))try{d=s.openDisplayList(i());}catch(m){d=null,console.warn("[CanvasRenderer] display-list session open failed; using JSON-arg queries",m);}};n?a():s?(u(),a()):Pe().then(m=>{s=m,u(),a(),g&&f$1();},m=>{o=m instanceof Error?m:new Error(String(m)),l(o),console.warn("[CanvasRenderer] display-list query engine failed to load",o);});let h=(m,p,y)=>{if(!s)return null;if(d!==null&&m)try{return m(d)}catch(R){console.warn(`[CanvasRenderer] ${y} session query failed; falling back`,R),f$1();}try{return p()}catch(R){return o=R instanceof Error?R:new Error(String(R)),console.warn(`[CanvasRenderer] ${y} query failed`,R),null}},L=(m,p,y)=>{if(m===null)return p;try{return JSON.parse(m)}catch(R){return o=R instanceof Error?R:new Error(String(R)),console.warn(`[CanvasRenderer] ${y} returned invalid JSON`,R),p}},k=(m,p)=>{try{return m()}catch(y){return o=y instanceof Error?y:new Error(String(y)),console.warn(`[CanvasRenderer] resident ${p} query failed`,y),null}},v=(m,p,y)=>{if(n)return L(k(()=>n.displayHitTestRegionsJson(m,p,y),"hit_test_regions"),null,"hit_test_regions");let R=h(s?.hitTestRegionsByHandle&&(x=>s.hitTestRegionsByHandle(x,m,p,y)),()=>s.hitTestRegionsJson(i(),m,p,y),"hit_test_regions");return L(R,null,"hit_test_regions")},b=(m,p)=>{if(n)return L(k(()=>n.displayRangeRectsJson(m,p),"range_rects"),[],"range_rects");let y=h(s?.rangeRectsByHandle&&(R=>s.rangeRectsByHandle(R,m,p)),()=>s.rangeRectsJson(i(),m,p),"range_rects");return L(y,[],"range_rects")},M=(m,p,y,R)=>{if(n)return L(k(()=>n.displayRangeRectsRegionJson(m,p,y,R),"range_rects_region"),[],"range_rects_region");if(!s||!s.hasRangeRectsRegion?.())return [];let x=h(s.rangeRectsRegionByHandle&&(I=>s.rangeRectsRegionByHandle(I,m,p,y,R)),()=>s.rangeRectsRegionJson(i(),m,p,y,R),"range_rects_region");return L(x,[],"range_rects_region")},C=(m,p,y)=>{let R=M(m,p,y,y+1);if(R.length>0){let x=new Map;for(let I of R)x.has(I.pageIndex)||x.set(I.pageIndex,{pageIndex:I.pageIndex,x:I.x,y:I.y,width:0,height:I.height});return [...x.values()]}if(y>0){let x=M(m,p,y-1,y);if(x.length>0){let I=new Map;for(let S of x)I.set(S.pageIndex,{pageIndex:S.pageIndex,x:S.x+S.width,y:S.y,width:0,height:S.height});return [...I.values()]}}return []},w=m=>{let p=b(m,m+1);if(p.length>0){let y=p[0];return {pageIndex:y.pageIndex,x:y.x,y:y.y,width:0,height:y.height}}if(m>0){let y=b(m-1,m);if(y.length>0){let R=y[y.length-1];return {pageIndex:R.pageIndex,x:R.x+R.width,y:R.y,width:0,height:R.height}}}return null},Y=m=>{let p=b(m,m+2);return p.length>0?p[0]:w(m)},ee=(m,p,y)=>{let R=M(m,p,y,y+2);if(R.length===0)return C(m,p,y);let x=new Map;for(let I of R)x.has(I.pageIndex)||x.set(I.pageIndex,I);return [...x.values()]},A=(m,p)=>({pageIndex:m,x:p.x,y:p.y,width:p.w,height:p.h}),W=m=>{let p=e.pages[m];return p?{pageIndex:p.pageIndex,x:0,y:0,width:p.width,height:p.height}:null},G=m=>{let p=e.pages[m],y=p?.contentBounds;return p&&y?{pageIndex:p.pageIndex,x:y.x,y:y.y,width:y.width,height:y.height}:null},le=m=>{let p=e.pages[m];return p?(p.columnBounds??[]).map(y=>({pageIndex:p.pageIndex,x:y.x,y:y.y,width:y.width,height:y.height})):[]},te=m=>m.paraId?`para:${m.paraId}`:m.blockKey!==void 0?`block-key:${m.blockKey}`:m.blockId!==void 0?`block-id:${m.blockId}`:null,N=m=>m.blockKey??m.blockId,Q=null,E=()=>{if(Q)return Q;let m=new Map;for(let p of e.pages)for(let y of p.primitives){let R=te(y);if(!R||y.docStart===void 0||y.docEnd===void 0)continue;let x=f(y),I=m.get(R);I||(I=new Map,m.set(R,I));let S=I.get(p.pageIndex);if(!S){I.set(p.pageIndex,{...A(p.pageIndex,x),from:y.docStart,to:y.docEnd,blockId:N(y),paraId:y.paraId});continue}let T=Math.min(S.x,x.x),P=Math.min(S.y,x.y),ce=Math.max(S.x+S.width,x.x+x.w),de=Math.max(S.y+S.height,x.y+x.h);S.x=T,S.y=P,S.width=ce-T,S.height=de-P,S.from=Math.min(S.from,y.docStart),S.to=Math.max(S.to,y.docEnd);}return Q=new Map([...m].map(([p,y])=>[p,[...y.values()]])),Q},V=m=>{let p=null;for(let y of e.pages)for(let R of y.primitives){let x=te(R),I=R.docStart,S=R.docEnd;if(!x||I===void 0||S===void 0||m<I||m>S)continue;let T={identity:x,span:Math.max(0,S-I),startsAtPos:I===m};(!p||T.startsAtPos&&!p.startsAtPos||T.startsAtPos===p.startsAtPos&&T.span<p.span)&&(p=T);}return p?E().get(p.identity)??[]:[]},X=1.5,F=null,O=()=>{if(F)return F;let m=[];for(let p of e.pages){let y=[],R=0;for(let x of p.primitives){if(x.kind!=="text"&&x.kind!=="glyphRun"||x.docStart===void 0||x.docEnd===void 0||x.kind==="glyphRun"&&x.glyphs.length===0)continue;let I=x.kind==="text"?x.baselineY:x.glyphs.reduce((ue,gt)=>Math.max(ue,gt.y),-1/0);if(!Number.isFinite(I))continue;let S=te(x)??`anonymous:${R++}`,T=f(x),P=y.find(ue=>ue.identity===S&&Math.abs(ue.baseline-I)<=X);if(!P){y.push({identity:S,...A(p.pageIndex,T),baseline:I,from:x.docStart,to:x.docEnd,blockId:N(x),paraId:x.paraId});continue}let ce=Math.min(P.x,T.x),de=Math.min(P.y,T.y),pt=Math.max(P.x+P.width,T.x+T.w),yt=Math.max(P.y+P.height,T.y+T.h);P.x=ce,P.y=de,P.width=pt-ce,P.height=yt-de,P.from=Math.min(P.from,x.docStart),P.to=Math.max(P.to,x.docEnd);}m.push(...y.map(({identity:x,...I})=>I));}return F=m,F},z=m=>{let p=null;for(let y of O())m<y.from||m>y.to||(!p||y.to-y.from<p.to-p.from)&&(p=y);return p},U=m=>{if(!m)return null;let p=m.primitive.docStart;if(p===void 0)return null;let{primitive:y}=m;return {...m,pos:p,rect:{pageIndex:m.pageIndex,x:y.x,y:y.y,width:y.w,height:y.h}}},q=(m,p,y,R="body",x)=>U(Ee(e,m,p,y,R,x)),he=(m,p="body",y)=>U(Ae(e,m,p,y)),Ye={},Oe={displayList:e,isReady:()=>(n!==null||s!==null)&&o===null,sourceState:()=>o?{status:"error",error:o}:n||s?{status:"ready"}:{status:"loading"},whenReady:()=>c,pageCount:()=>e.pages.length,pageSize:m=>{let p=e.pages[m];return p?{width:p.width,height:p.height}:null},pageBounds:W,contentBounds:G,columnBounds:le,paragraphRects:V,visualLines:O,visualLineAtPosition:z,imageAtPoint:q,imageByPos:he,hitTestRegions:v,rangeRects:b,hfRangeRects:M,hfCaretRects:C,hfAnchorRects:ee,caretRect:w,anchorRect:Y,sidebarAnchorRect:Y,dispose:()=>{g||(g=true,f$1(),at?.unregister(Ye));}};return at?.register(Oe,f$1,Ye),Oe}function mn(e){return typeof e?.displayHitTestRegionsJson=="function"&&typeof e?.displayRangeRectsJson=="function"&&typeof e?.displayRangeRectsRegionJson=="function"}var fn=16,pn=24;function oe(e){let t=[],r=24;for(let i=0;i<e.pageCount();i++)t.push(r),r+=(e.pageSize(i)?.height??0)+16;return t}function yn(){let e=new Map;return t=>{if(!t.startsWith("blob:")&&!t.startsWith("data:"))return null;let r=e.get(t);return r||(r=new Promise(i=>{let n=new Image;n.onload=()=>i(n),n.onerror=()=>i(null),n.src=t;}),e.set(t,r)),r}}function gn(e,t){let r=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,...r?.authorName!==void 0?{commentAuthor:r.authorName}:{},...r?.replyCount!==void 0?{commentReplyCount:r.replyCount}:{}}}function hn(e,t){if(!e)return [];let r=[];return !e.hasSelection&&t.hasSelection&&r.push({key:"selected"}),e.hasSelection&&!t.hasSelection&&r.push({key:"selectionCleared"}),!e.hasComment&&t.hasComment&&r.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&&r.push({key:"trackedInsertion"}),!e.inDeletion&&t.inDeletion&&r.push({key:"trackedDeletion"}),(!e.inList&&t.inList||t.inList&&e.listLevel!==t.listLevel)&&r.push({key:"listItem",vars:{level:t.listLevel+1}}),r}function se(e){let t=Number(e);if(Number.isFinite(t))return t;let r=0xcbf29ce484222325n;for(let i of new TextEncoder().encode(e))r=(r^BigInt(i))*0x100000001b3n,r&=0xffffffffffffffffn;return Number(r&(1n<<53n)-1n)}function ge(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function bn(e){let t=typeof e.story=="string"?[e.story]:[],r=Array.isArray(e.rows)?e.rows:[];for(let i of r){let n=ge(i),s=n&&Array.isArray(n.cells)?n.cells:[];for(let o of s){let a=ge(o)?.story;typeof a=="string"&&t.push(a);}}return t}function xn(e){let t=e.storyIds(),r=new Map,i=new Set;for(let o of t){let a=[];try{for(let l of e.storySegments(o))if(l.kind==="embed")for(let c of bn(l.payload))a.push(c),i.add(c);}catch{}r.set(o,a);}let n=new Map,s=(o,a,l)=>{if(!(l.has(o)||n.has(o))){l.add(o),n.set(o,a);for(let c of r.get(o)??[])s(c,a,l);l.delete(o);}};t.includes("body")&&s("body",{story:"body"},new Set);for(let o of t)!o.startsWith("hf:")||i.has(o)||s(o,{story:o,hfRid:o.slice(3)},new Set);return n}function Rn(e,t,r,i,n){let s=Array.isArray(t.rows)?t.rows:[],o=r+1;for(let a of s){let l=ge(a),c=l&&Array.isArray(l.cells)?l.cells:[],d=o+1;for(let g of c){let f=ge(g),u=typeof f?.story=="string"?f.story:null,h=u?Te(e,u,d+1,i,n):0;d+=h+2;}o=d+1;}return o+1-r}function Te(e,t,r,i,n){if(n.has(t))throw new Error(`recursive yrs story: ${t}`);n.add(t);try{let s=r,o=r,a=0,l=!0;for(let c of e.storySegments(t)){if(c.kind==="text"){a+=c.text.length,l=!1;continue}if(c.kind==="pilcrow"){let d=o+a+2;i.set(c.paraId,{pmStart:o,pmEnd:d}),s=d,o=s,a=0,l=!0;continue}if(c.embedKind==="table"&&l){s+=Rn(e,c.payload,s,i,n),o=s;continue}if(c.embedKind==="blockSdt"&&l){let d=typeof c.payload.story=="string"?c.payload.story:null,g=d?Te(e,d,s+1,i,n):0;s+=g+2,o=s;continue}if(l&&(c.embedKind==="pageBreak"||c.embedKind==="columnBreak")){s+=1,o=s;continue}a+=1,l=!1;}return s-r}finally{n.delete(t);}}function Ln(e){let t=new Map,r=xn(e),i=o=>{let a=r.get(o)?.story;if(!a)return null;if(t.has(a))return t.get(a)??null;try{let l=new Map;return Te(e,a,0,l,new Set),t.set(a,l),l}catch{return t.set(a,null),null}},n=o=>{let a=r.get(o.story);if(!a)return null;let l=i(o.story)?.get(o.paraId);if(!l)return null;let c=Math.max(0,l.pmEnd-l.pmStart-2),d=Math.min(Math.max(0,Math.trunc(o.offset)),c);return {story:o.story,position:l.pmStart+1+d,...a.hfRid?{hfRid:a.hfRid}:{}}};return {locToDisplayPoint:n,storyOffsetToDisplayPoint:(o,a)=>{if(!r.has(o))return null;let l=Math.max(0,Math.trunc(a));try{for(let c of e.paragraphs(o)){let d=e.locateParagraph(o,c.paraId);if(!(l<d.start||l>d.end))return n({story:o,paraId:c.paraId,offset:Math.min(l-d.start,d.end-d.start)})}}catch{return null}return null}}}function Ce(e,t){let{doc:r,schema:i}=e.state,n=i.marks.comment,s=i.marks.insertion,o=i.marks.deletion;!n&&!s&&!o||r.descendants((a,l)=>{let c=a.attrs;if(c){let d=[c.trIns,c.trDel,c.pPrIns,c.pPrDel];for(let h of d){let L=h?.revisionId;typeof L=="number"&&t(`revision-${L}`,l);}let f=c.cellMarker?.info?.revisionId;typeof f=="number"&&t(`revision-${f}`,l);let u=[c.pPrChange,c.trPrChange,c.tcPrChange,c.tblPrChange];for(let h of u)if(Array.isArray(h))for(let L of h){let k=L?.info?.id;typeof k=="number"&&t(`revision-${k}`,l);}}if(a.isInline)for(let d of a.marks){let g=null;n&&d.type===n?g=`comment-${d.attrs.commentId}`:(s&&d.type===s||o&&d.type===o)&&(g=`revision-${d.attrs.revisionId}`),g&&t(g,l);}});}function Dn(e,t,r){let i=new Map;if(!e?.state)return i;let n=oe(t),s=new Set;return Ce(e,(o,a)=>{if(s.has(o))return;s.add(o);let l=t.anchorRect(a);if(!l)return;let c=r?r(l):(n[l.pageIndex]??0)+l.y;c!=null&&i.set(o,c);}),i}function In(e,t,r){if(!e.hfRid)return t.anchorRect(e.position);let i=r?.get(e.hfRid);return i?t.hfAnchorRects(i,e.hfRid,e.position)[0]??null:null}function Sn(e,t,r,i,n,s,o){let a=new Map,l=oe(n),c=(d,g)=>{if(!g||a.has(d))return a.has(d);let f=In(g,n,s);if(!f)return false;let u=o?o(f):(l[f.pageIndex]??0)+f.y;return u==null?false:(a.set(d,u),true)};for(let d of t){let g=`comment-${d}`;try{for(let f of e.resolveComment(String(d)))if(c(g,i.storyOffsetToDisplayPoint(f.story,f.start)))break}catch{}}for(let d of r)c(`revision-${se(d.revisionId)}`,i.locToDisplayPoint({story:d.story,...d.range.start}));return a}function vn(e,t,r,i){let n=oe(t);for(let{region:s,rId:o,view:a}of e)Ce(a,(l,c)=>{if(r.has(l))return;let d=t.hfAnchorRects(s,o,c)[0];if(!d)return;let g=i?i(d):(n[d.pageIndex]??0)+d.y;g!=null&&r.set(l,g);});return r}function kn(e,t){let r=e.map(o=>{let a=t.locToDisplayPoint({story:o.range.story,...o.range.start}),l=t.locToDisplayPoint({story:o.range.story,...o.range.end}),c=a?.position??0,d=Math.max(c,l?.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:d,revisionId:se(o.revisionId),...a?.hfRid?{hfRid:a.hfRid}:{}}}),i=new Map;for(let o of r){let a=i.get(o.revisionId)??[];a.push(o),i.set(o.revisionId,a);}let n=[...i.values()].map(o=>{let a=Math.min(...o.map(u=>u.from)),l=Math.max(...o.map(u=>u.to)),c=o.filter(u=>u.type==="insertion"),d=o.filter(u=>u.type==="deletion");if(c.length>0&&d.length>0)return {...c[0],type:"replacement",text:c.map(h=>h.text).join(""),deletedText:d.map(h=>h.text).join(""),from:a,to:l};let g=o.find(u=>u.type==="insertion"||u.type==="deletion")??o[0],f=o.filter(u=>u.type===g.type).map(u=>u.text).join("");return {...g,text:f,from:a,to:l}}),s=[];for(let o=0;o<n.length;o+=1){let a=n[o],l=n[o+1];a.type==="deletion"&&l?.type==="insertion"&&a.author===l.author&&a.date===l.date&&a.to===l.from&&a.hfRid===l.hfRid?(s.push({type:"replacement",text:l.text,deletedText:a.text,author:a.author,date:a.date,from:a.from,to:l.to,revisionId:a.revisionId,insertionRevisionId:l.revisionId,...a.hfRid?{hfRid:a.hfRid}:{}}),o+=1):s.push(a);}return {entries:s,commentToRevision:new Map}}function wn(e,t){let r=t.kind??"body";if(r==="body")return {kind:r,primitives:e.primitives};let i=r==="header"?e.header:e.footer;return !i||i.kind!==r||t.rId&&i.rId!==t.rId?null:{kind:r,rId:i.rId,primitives:i.primitives}}function Mn(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 Pn(e){let t=Mn(e),r=e.clipGroup?.clip;if(!r)return t;let i=r.x??0,n=r.y??0,s=i+Math.max(0,r.w??0),o=n+Math.max(0,r.h??0),a=Math.max(t.x,i),l=Math.max(t.y,n),c=Math.min(t.x+t.w,s),d=Math.min(t.y+t.h,o);return c<a||d<l?null:{x:a,y:l,w:c-a,h:d-l}}function An(e){return e.kind==="text"||e.kind==="glyphRun"?e.text:e.kind==="image"?e.altText??"":""}function En(e,t,r){return t>=e.x&&t<=e.x+e.w&&r>=e.y&&r<=e.y+e.h}function Tn(e,t,r,i,n={kind:"body"}){let s=e.pages[t];if(!s)return null;let o=wn(s,n);if(!o)return null;for(let a=o.primitives.length-1;a>=0;a--){let l=o.primitives[a];if(l.kind==="line"||!l.href||l.hiddenObject)continue;let c=Pn(l);if(c&&En(c,r,i))return {pageIndex:t,region:o.kind,rId:o.rId,href:l.href,tooltip:l.linkTitle??l.tooltip,displayText:An(l)||l.href,rect:c}}return null}var _=7.5,Z=16,lt=320,Cn=30,Bn=200,Hn=24,Gn=10,Nn=10,Fn=24;function ct(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 r=He(e);return r?Yn(t,r)??{x:r.x,y:r.y,w:0,h:0}:t}function He(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 Yn(e,t){let r=Math.max(e.x,t.x),i=Math.max(e.y,t.y),n=Math.min(e.x+e.w,t.x+t.w),s=Math.min(e.y+e.h,t.y+t.h);return n<r||s<i?null:{x:r,y:i,w:n-r,h:s-i}}function dt(e,t,r){if(e.docStart!=null){let i=t(e.docStart);if(i!=null){let n={tableKey:i,docStartSample:e.docStart};return e.table?.tableId&&!r.has(e.table.tableId)&&r.set(e.table.tableId,n),n}}return e.table?.tableId?r.get(e.table.tableId)??null:null}function ut(e,t,r){let i=e.table?.tableId;if(!i)return null;let n=t.get(i);return n?r.get(n.tableKey)??null:null}function On(e,t,r,i){let n=new Map;for(let o of t){if(o.kind==="line")continue;let a=o.cell;if(!a)continue;let l=dt(o,r,i);if(!l)continue;let{tableKey:c,docStartSample:d}=l,g=ct(o),f=He(o),u=f??g,h=n.get(c);if(h||(h={tableKey:c,docStartSample:d,contentMinX:u.x,contentMinY:u.y,contentMaxX:u.x+u.w,contentMaxY:u.y+u.h,exactLeftX:[],exactBottomY:[],exactClipLeftX:[],exactClipBottomY:[],rows:new Map},n.set(c,h)),d<h.docStartSample&&(h.docStartSample=d),h.contentMinX=Math.min(h.contentMinX,u.x),h.contentMinY=Math.min(h.contentMinY,u.y),h.contentMaxX=Math.max(h.contentMaxX,u.x+u.w),h.contentMaxY=Math.max(h.contentMaxY,u.y+u.h),f&&(h.exactClipLeftX.push(f.x),h.exactClipBottomY.push(f.y+f.h)),!a.continuation){let L=h.rows.get(a.row);L?(L.top=Math.min(L.top,u.y),L.bottom=Math.max(L.bottom,u.y+u.h)):h.rows.set(a.row,{top:u.y,bottom:u.y+u.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=ut(o,i,n);if(!a){let d=(o.x1+o.x2)/2,g=(o.y1+o.y2)/2,f=1/0;for(let u of n.values()){let h=d>=u.contentMinX-Z&&d<=u.contentMaxX+Z,L=g>=u.contentMinY-Z&&g<=u.contentMaxY+Z;if(!h||!L)continue;let k=Math.max(0,u.contentMinX-d,d-u.contentMaxX),v=Math.max(0,u.contentMinY-g,g-u.contentMaxY),b=k+v;b<f&&(f=b,a=u);}}if(!a)continue;let l=Math.abs(o.x1-o.x2)<.5,c=Math.abs(o.y1-o.y2)<.5;l&&a.exactLeftX.push(Math.min(o.x1,o.x2)),c&&a.exactBottomY.push(Math.max(o.y1,o.y2));}let s=[];for(let o of n.values()){if(o.rows.size===0)continue;let a=o.exactLeftX.length>0||o.exactClipLeftX.length>0,l=a?Math.min(...o.exactLeftX,...o.exactClipLeftX):o.contentMinX-_,c=o.exactBottomY.length>0||o.exactClipBottomY.length>0?Math.max(...o.exactBottomY,...o.exactClipBottomY):o.contentMaxY,d=[...o.rows.entries()].map(([g,f])=>({rowIndex:g,top:f.top,bottom:f.bottom})).sort((g,f)=>g.rowIndex-f.rowIndex);s.push({pageIndex:e,tableKey:o.tableKey,docStartSample:o.docStartSample,originX:l,originY:o.contentMinY,bottomY:c,originExact:a,rowBands:d});}return s}function _n(e,t){let r=[],i=Ne(e,t,{kind:"body"});for(let n of e.pages)r.push(...On(n.pageIndex,n.primitives,t,i));return r}function Ge(e,t){let r=t.kind??"body";if(r==="body")return {kind:r,primitives:e.primitives};let i=r==="header"?e.header:e.footer;return !i||i.kind!==r||t.rId&&i.rId!==t.rId?null:{kind:r,rId:i.rId,primitives:i.primitives}}function Ne(e,t,r){let i=new Map;for(let n of e.pages){let s=Ge(n,r);if(s)for(let o of s.primitives){if(!o.cell||!o.table?.tableId||o.docStart==null)continue;let a=t(o.docStart);if(a==null)continue;let l=i.get(o.table.tableId);(!l||o.docStart<l.docStartSample)&&i.set(o.table.tableId,{tableKey:a,docStartSample:o.docStart});}}return i}function Fe(e,t){return `${e}:${t}`}function Xn(e,t,r,i){let n=Fe(t.row,t.col),s=e.cells.get(n);s?(s.minX=Math.min(s.minX,r.x),s.minY=Math.min(s.minY,r.y),s.maxX=Math.max(s.maxX,r.x+r.w),s.maxY=Math.max(s.maxY,r.y+r.h),s.rowSpan=Math.max(s.rowSpan,t.rowSpan),s.colSpan=Math.max(s.colSpan,t.colSpan),i&&(s.exactClip=i)):e.cells.set(n,{row:t.row,col:t.col,rowSpan:t.rowSpan,colSpan:t.colSpan,minX:r.x,minY:r.y,maxX:r.x+r.w,maxY:r.y+r.h,exactClip:i??void 0});}function mt(e,t,r){let i=new Map;for(let n of e){if(n.kind==="line")continue;let s=n.cell;if(!s)continue;let o=dt(n,t,r);if(!o)continue;let a=o.tableKey,l=ct(n),c=i.get(a);c||(c={tableKey:a,contentMinX:l.x,contentMinY:l.y,contentMaxX:l.x+l.w,contentMaxY:l.y+l.h,cells:new Map,verticalLines:[],horizontalLines:[]},i.set(a,c)),c.contentMinX=Math.min(c.contentMinX,l.x),c.contentMinY=Math.min(c.contentMinY,l.y),c.contentMaxX=Math.max(c.contentMaxX,l.x+l.w),c.contentMaxY=Math.max(c.contentMaxY,l.y+l.h),Xn(c,s,l,He(n));}if(i.size===0)return [];for(let n of e){if(n.kind!=="line"||n.role!=="table-border"&&n.role!=="table-cut")continue;let s=Math.abs(n.x1-n.x2)<.5,o=Math.abs(n.y1-n.y2)<.5;if(!s&&!o)continue;let a=Math.min(n.x1,n.x2),l=Math.max(n.x1,n.x2),c=Math.min(n.y1,n.y2),d=Math.max(n.y1,n.y2),g=ut(n,r,i);if(g){s?g.verticalLines.push(a):g.horizontalLines.push(c);continue}for(let f of i.values())if(s){if(!(d>=f.contentMinY-Z&&c<=f.contentMaxY+Z))continue;let h=a;Math.max(0,f.contentMinX-h,h-f.contentMaxX)<=lt&&f.verticalLines.push(h);}else if(o){if(!(l>=f.contentMinX-Z&&a<=f.contentMaxX+Z))continue;let h=c;Math.max(0,f.contentMinY-h,h-f.contentMaxY)<=lt&&f.horizontalLines.push(h);}}return [...i.values()]}function ae(e){let t=[];for(let r of [...e].sort((i,n)=>i-n))(t.length===0||Math.abs(t[t.length-1]-r)>.5)&&t.push(r);return t}function ft(e){let t=ae([...e.cells.values()].map(n=>n.row)),r=ae(e.horizontalLines),i=new Map;if(t.length>0&&r.length>=t.length+1)for(let n=0;n<t.length;n++)i.set(t[n],r[n]),i.set(t[n]+1,r[n+1]);return i}function Be(e){if(!e)return null;if(e.exactClip)return e.exactClip;let t=e.minX-_,r=e.minY-_;return {x:t,y:r,w:Math.max(1,e.maxX-e.minX+_*2),h:Math.max(1,e.maxY-e.minY+_*2)}}function $n(e,t){let r=1/0,i=-1/0;for(let n of e.cells.values())n.row===t&&(r=Math.min(r,n.exactClip?.y??n.minY-_),i=Math.max(i,n.exactClip?n.exactClip.y+n.exactClip.h:n.maxY+_));return !Number.isFinite(r)||!Number.isFinite(i)||i<=r?null:{top:r,bottom:i}}function Kn(e,t,r){let i=Be(e.cells.get(Fe(t,r)));return i?{left:i.x,right:i.x+i.w,top:i.y,bottom:i.y+i.h}:null}function Jn(e,t,r,i={kind:"body"}){if(t.length===0)return [];let n=new Map;for(let a of t){let l=n.get(a.tableKey);l?l.push(a):n.set(a.tableKey,[a]);}let s=[],o=Ne(e,r,i);for(let a of e.pages){let l=Ge(a,i);if(!l)continue;let c=mt(l.primitives,r,o);for(let d of c){let g=n.get(d.tableKey);if(!g)continue;let f=ae(d.verticalLines),u=ft(d);for(let h of g){let L=d.cells.get(Fe(h.row,h.col)),k=f[h.col],v=f[h.col+h.colSpan],b=u.get(h.row),M=u.get(h.row+h.rowSpan),C=true;if(k==null||v==null||v<=k){let w=L?.exactClip??Be(L);if(!w)continue;k=w.x,v=w.x+w.w,C=L?.exactClip!=null;}if(b==null||M==null||M<=b){let w=L?.exactClip??Be(L);if(!w)continue;b=w.y,M=w.y+w.h,C&&(C=L?.exactClip!=null);}s.push({pageIndex:a.pageIndex,tableKey:d.tableKey,row:h.row,col:h.col,rowSpan:h.rowSpan,colSpan:h.colSpan,x:k,y:b,w:Math.max(1,v-k),h:Math.max(1,M-b),exact:C,region:l.kind,rId:l.rId});}}}return s}function Wn(e){let{list:t,pageIndex:r,x:i,y:n,canvasRect:s,pageSize:o,tableKeyOf:a,cellPmPosOf:l,region:c={kind:"body"},edgeProximity:d=Cn}=e,g=t.pages[r];if(!g)return null;let f=Ge(g,c);if(!f)return null;let u=o.width>0?s.width/o.width:1,h=o.height>0?s.height/o.height:1,L=(b,M)=>({clientX:s.left+b*u,clientY:s.top+M*h}),k=Ne(t,a,c),v=mt(f.primitives,a,k);for(let b of v){let M=ae(b.verticalLines),C=ft(b),w=ae([...b.cells.values()].map(N=>N.row));if(w.length===0)continue;let Y=M[0]??b.contentMinX-_,ee=M[M.length-1]??b.contentMaxX+_,A=C.get(w[0])??b.contentMinY-_,W=w[w.length-1],G=C.get(W+1)??b.contentMaxY+_,le=i<Y+d&&i>=Y-d,te=n<A+d&&n>=A-d;if(!(!le&&!te)){if(le&&n>=A-d&&n<=G)for(let N of w){let Q=C.get(N),E=C.get(N+1),V=Q==null||E==null?$n(b,N):null,X=Q??V?.top,F=E??V?.bottom;if(X==null||F==null||F<=X||n<X||n>F)continue;let O=[...b.cells.values()].filter(q=>q.row===N).sort((q,he)=>q.col-he.col)[0];if(!O)continue;let z=l(b.tableKey,N,O.col);if(!z)continue;let U=L(Y,X+(F-X)/2);return {type:"row",clientX:U.clientX-Hn,clientY:U.clientY-Gn,cellPmPos:z}}if(te&&i>=Y-d&&i<=ee){let N=w[0],Q=[...b.cells.values()].filter(E=>E.row===N).sort((E,V)=>E.col-V.col);for(let E of Q){let V=M[E.col],X=M[E.col+E.colSpan],F=V==null||X==null?Kn(b,E.row,E.col):null,O=V??F?.left,z=X??F?.right;if(O==null||z==null||z<=O||i<O||i>z)continue;let U=l(b.tableKey,E.row,E.col);if(!U)continue;let q=L(O+(z-O)/2,A);return {type:"column",clientX:q.clientX-Nn,clientY:q.clientY-Fn,cellPmPos:U}}}}}return null}var Ni=Xe;export{pn as CANVAS_PAGES_PADDING_PX,fn as CANVAS_PAGE_GAP_PX,Bn as DISPLAY_LIST_TABLE_INSERT_HIDE_DELAY_MS,D as MIRROR_CLASS_NAMES,J as RustDisplayListSourceError,Qt as applyInteractiveSdtFocus,zt as buildInteractiveOverlayPage,Ht as buildMirrorPage,cn as buildRustDisplayFrame,ot as buildRustDisplayList,oe as canvasPageTops,dn as captureInlinePositionEmuFromDisplayList,hn as computeA11yAnnouncements,Dn as computeAnchorPositionsFromDisplayList,Sn as computeAnchorPositionsFromYrs,yn as createCanvasImageResolver,un as createDisplayListQueries,Ln as createYrsSidebarProjection,Ni as demoDisplayList,Jn as deriveDisplayListSelectedCellRects,_n as deriveDisplayListTableFragments,Wn as detectDisplayListTableInsertHover,rt as encodeDisplayListFrameExtras,kn as extractTrackedChangesFromYrs,Tn as findDisplayListHyperlinkAtPoint,Ee as findImagePrimitiveAtPoint,Ae as findImagePrimitiveByDocPos,Bt as loadGlyphOutlineProvider,Pe as loadRustDisplayListQueryEngine,vn as mergeHfAnchorPositionsFromDisplayList,gn as snapshotFromSelectionContext,Ce as visitAnchorKeys,se as yrsIdToNumericId};
|
|
1
|
+
import {d,c,e,s,t,v,f}from'../../chunk-GGEGIQRK.mjs';export{p as FRAME_DELTA_HEADER_BYTES,q as FRAME_DELTA_PAGE_OP_BYTES,o as FRAME_DELTA_VERSION,r as FrameDeltaError,a as GlyphCache,t as applyFrameDelta,u as applyFrameDeltaOwned,s as decodeFrameDelta,m as drawDisplayPage,n as drawPrimitive,b as fontSizePxFromShorthand,d as glyphRunRect,e as lineRect,h as presentDisplayPageBackBuffer,i as presentOffscreenPageBackBuffer,l as rasterizeDisplayListPages,g as rasterizeDisplayPageToBackBuffer,k as sizeCanvasForPage,c as textRunRect}from'../../chunk-GGEGIQRK.mjs';export{b as resolveCanvasPoint,a as resolveDisplayPageClientRect}from'../../chunk-WRWRCBLK.mjs';import {c as c$1}from'../../chunk-CTBUQRYQ.mjs';import {b}from'../../chunk-TTRUPDAB.mjs';var Ue={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 Wt(){return import('../../wasm-JE7B3ROD.mjs').then(async e=>(await e.preloadLayoutWasm(),e.outlineGlyphJson))}var D={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 Kt(e,t={}){let r=t.document??document,i=t.labels,n={labels:i,noteRefIds:new Set},s=r.createElement("div");s.className=D.page,s.setAttribute("role","document"),i?.page&&s.setAttribute("aria-label",i.page),s.dataset.pageIndex=String(e.pageIndex),e.sectionId!==void 0&&(s.dataset.sectionId=e.sectionId),e.sectionIndex!==void 0&&(s.dataset.sectionIndex=String(e.sectionIndex)),e.sectionPageIndex!==void 0&&(s.dataset.sectionPageIndex=String(e.sectionPageIndex)),e.sectionPageNumber!==void 0&&(s.dataset.sectionPageNumber=String(e.sectionPageNumber)),e.pageLabel!==void 0&&(s.dataset.pageLabel=e.pageLabel),s.style.position="relative",s.style.width=`${e.width}px`,s.style.height=`${e.height}px`,s.style.opacity="0",s.style.pointerEvents="none";let o=r.createElement("div");o.className=D.content,o.style.position="absolute",o.style.left="0",o.style.top="0",o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,s.appendChild(o);for(let a of (e.pageBorders??[]).filter(l=>l.zOrder==="back"))o.appendChild(et(a,r,0));re(o,e.primitives,r,0,n);for(let a of e.noteAreas??[])o.appendChild(on(a,e,r,n));for(let a of [e.header,e.footer])a&&s.appendChild(Vt(a,e,r,n));for(let a of (e.pageBorders??[]).filter(l=>l.zOrder!=="back"))s.appendChild(et(a,r,0));return s}function Vt(e,t,r,i){let n=r.createElement("div");n.className=e.kind==="header"?D.header:D.footer,n.dataset.hfRid=e.rId;let s=e.kind==="header"?i.labels?.header:i.labels?.footer;return s&&(n.setAttribute("role","region"),n.setAttribute("aria-label",s)),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`,re(n,e.primitives,r,-e.y,i),n}function re(e,t,r,i,n){let s=new Map;for(let o of t){let a=o.kind==="line"?void 0:o.blockKey??o.blockId;if(a===void 0){e.appendChild(be(o,r,i,n));continue}let l=o.table,c=l?.tableId!==void 0?`table:${l.tableId}#${l.rowStart??0}`:a,u=s.get(c);if(!u){let y=r.createElement("div");y.dataset.blockId=String(l?.tableId??a),y.style.position="absolute",y.style.left="0",y.style.top="0",e.appendChild(y),u={el:y,prims:[]},s.set(c,u);}u.prims.push(o);}for(let o of s.values())zt(o,r,i,n);qt(s);}function zt(e,t,r,i){let{el:n,prims:s}=e;if(!s.some(g=>g.cell!==void 0||g.structuralRevision?.scope==="table"||g.structuralRevision?.scope==="row"||g.structuralRevision?.scope==="cell")){qe(n,s,t,r,i);return}n.className=D.table,n.setAttribute("role","table");let a=s.find(g=>g.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 l=ge(s,"table");l&&he(n,l),Be(n,s.find(g=>g.sdt!==void 0)?.sdt);for(let g of s)g.cell===void 0&&n.appendChild(be(g,t,r,i));let c=new Map,u=0,y=0;for(let g of s){if(g.cell===void 0)continue;let{row:m,col:h}=g.cell;u=Math.max(u,m+(g.cell.rowSpan??1)),y=Math.max(y,h+(g.cell.colSpan??1));let R=c.get(m);R||(R=new Map,c.set(m,R));let k=R.get(h);k||(k={ref:g.cell,prims:[]},R.set(h,k)),k.prims.push(g);}n.setAttribute("aria-rowcount",String(a?.rowCount??u)),n.setAttribute("aria-colcount",String(a?.columnCount??y));for(let g of [...c.keys()].sort((m,h)=>m-h)){let m=t.createElement("div");m.className=D.tableRow,m.setAttribute("role","row"),m.setAttribute("aria-rowindex",String(g+1));let h=ge(s,"row",g);h&&he(m,h),m.style.position="absolute",m.style.left="0",m.style.top="0",n.appendChild(m);let R=c.get(g);for(let k of [...R.keys()].sort((I,x)=>I-x)){let I=R.get(k),x=t.createElement("div");x.className=D.tableCell,x.setAttribute("role",I.ref.isHeader?"columnheader":"cell"),x.setAttribute("aria-colindex",String(k+1)),I.ref.cellId&&(x.id=I.ref.cellId),I.ref.headerIds?.length&&x.setAttribute("aria-labelledby",I.ref.headerIds.join(" ")),I.ref.repeatedHeader&&(x.dataset.repeatedHeader="true"),I.ref.noWrap&&(x.dataset.noWrap="true");let P=I.ref.rowSpan??1,T=I.ref.colSpan??1;P>1&&x.setAttribute("aria-rowspan",String(P)),T>1&&x.setAttribute("aria-colspan",String(T));let M=ge(I.prims,"cell",g,k);M&&he(x,M),I.ref.continuation&&(x.dataset.vmergeContinuation="true"),x.style.position="absolute",x.style.left="0",x.style.top="0";let Y=new Map,z=[];for(let w of I.prims){let N=w.blockKey??w.blockId;if(N===void 0){z.push(w);continue}let F=Y.get(N);F?F.push(w):Y.set(N,[w]);}for(let w of Te(z))x.appendChild(be(w,t,r,i));for(let[w,N]of Y){let F=t.createElement("div");F.dataset.blockId=String(w),F.style.position="absolute",F.style.left="0",F.style.top="0",qe(F,N,t,r,i),x.appendChild(F);}Ut(x,I.prims),ot(x,I.prims),e.cells.push({el:x,bounds:rt(I.prims)}),m.appendChild(x);}}Ce(n,s);}function qe(e,t,r,i,n){let s=t.find(c=>c.chart!==void 0)?.chart;e.className=s?`${D.block} ${D.chart}`:D.block,e.setAttribute("role",s?"img":"paragraph"),s?.label&&e.setAttribute("aria-label",s.label);for(let c of Te(t))e.appendChild(be(c,r,i,n));let o=ge(t,"pmark");o&&he(e,o),jt(e,t,r,i),Be(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 l=t.find(c=>c.fromLine!==void 0);l?.fromLine!==void 0&&(e.dataset.fromLine=String(l.fromLine),l.toLine!==void 0&&(e.dataset.toLine=String(l.toLine))),ot(e,t),en(e,t);}function jt(e,t,r,i){Ce(e,t);let n=Number(e.dataset.docStart),s=Number(e.dataset.docEnd),o=t.map(y=>y.fragmentDocStart).filter(y=>Number.isFinite(y)),a=t.map(y=>y.fragmentDocEnd).filter(y=>Number.isFinite(y)),l=o.length>0?Math.min(...o):void 0,c=a.length>0?Math.max(...a):void 0,u=l??(Number.isFinite(n)&&n===s&&n>0?n-1:void 0);if(u!==void 0&&(e.dataset.docStart=String(u)),c!==void 0&&(e.dataset.docEnd=String(c)),u!==void 0&&!t.some(y=>y.docStart===u)){let y=Te(t).find(m=>Ae(m)!==void 0),g=y?Ae(y):void 0;if(g){let m=r.createElement("span");m.className="layout-mirror-structural-anchor",m.dataset.docStart=String(u),m.dataset.docEnd=String(u),U(m,g,i),e.insertBefore(m,e.firstChild);}}}function Ut(e,t){let r=e.querySelectorAll(".layout-paragraph[data-doc-start]"),i=1/0,n=-1/0;for(let s of r){let o=Number(s.dataset.docStart),a=Number(s.dataset.docEnd);Number.isFinite(o)&&(i=Math.min(i,o)),Number.isFinite(a)&&(n=Math.max(n,a));}i!==1/0&&(e.dataset.docStart=String(i)),n!==-1/0&&(e.dataset.docEnd=String(n)),i===1/0&&n===-1/0&&Ce(e,t);}function qt(e){let t=new Map;for(let r of e.values())r.table?.tableId&&t.set(r.table.tableId,r);for(let r of e.values()){let i=r.table?.parentTableId;if(!i)continue;let n=t.get(i),s=rt(r.prims);if(!n?.cells?.length||!s)continue;let o=s.x+s.w/2,a=s.y+s.h/2,l=n.cells.filter(c=>c.bounds&&Zt(o,a,c.bounds));l.sort((c,u)=>Ze(c.bounds)-Ze(u.bounds)),l[0]?.el.appendChild(r.el);}}function Zt(e,t,r){return e>=r.x&&e<=r.x+r.w&&t>=r.y&&t<=r.y+r.h}function Ze(e){return e.w*e.h}function rt(e){let t;for(let r of e){let i=r.clipGroup?.clip,n=i?.x!==void 0&&i.y!==void 0&&i.w!==void 0&&i.h!==void 0?{x:i.x,y:i.y,w:i.w,h:i.h}:Ae(r);if(!n)continue;if(!t){t={...n};continue}let s=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=s-t.x,t.h=o-t.y;}return t}function Ae(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 Te(e){let t=e.filter(i=>i.logicalOrder!==void 0).sort((i,n)=>(i.logicalOrder??0)-(n.logicalOrder??0)||(i.docStart??0)-(n.docStart??0));if(t.length<2)return e;let r=0;return e.map(i=>i.logicalOrder===void 0?i:t[r++])}function ot(e,t){let r=t.find(s=>s.lang)?.lang;r&&(e.lang=r);let i=t.find(s=>s.bidiLevel!==void 0||"rtl"in s);if(!i)return;let n=i.bidiLevel!==void 0?i.bidiLevel%2===1:"rtl"in i?i.rtl:false;e.dir=n?"rtl":"ltr";}function en(e,t){let r=t.find(i=>i.ariaLabel||i.ariaDescription||i.decorative||i.hiddenObject||i.groupId);r&&at(e,r);}function Ce(e,t){let r,i;for(let n of t)n.docStart!==void 0&&(r=r===void 0?n.docStart:Math.min(r,n.docStart)),n.docEnd!==void 0&&(i=i===void 0?n.docEnd:Math.max(i,n.docEnd));r!==void 0&&(e.dataset.docStart=String(r)),i!==void 0&&(e.dataset.docEnd=String(i));}function ge(e,t,r,i){return e.find(n=>{let s=n.structuralRevision;return !(!s||s.scope!==t||r!==void 0&&s.rowIndex!==r||i!==void 0&&s.colIndex!==i)})?.structuralRevision}function be(e$1,t,r,i){switch(e$1.kind){case "text":{let n=tt(t,e$1,i);return n.className=D.text,n.textContent=e$1.text,U(n,c(e$1),r),n.style.font=e$1.font,nt(n,e$1),it(n,e$1),Pe(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(D.revisionPmarkGlyph),e$1.structuralRevision.kind==="ins"&&n.classList.add(D.revisionPmarkIns),e$1.structuralRevision.kind==="del"&&n.classList.add(D.revisionPmarkDel),n.setAttribute("aria-hidden","true")),e$1.listMarker&&(n.classList.add(D.listMarker),n.setAttribute("aria-hidden","true"),e$1.listMarkerRevision&&(n.style.color=e$1.listMarkerRevision==="ins"?"rgb(46, 125, 50)":"rgb(198, 40, 40)")),ne(n,e$1),n}case "glyphRun":{let n=tt(t,e$1,i);return n.className=D.text,n.textContent=e$1.text,U(n,d(e$1),r),n.style.fontSize=`${e$1.size}px`,tn(n,e$1.fallbackFont),nt(n,e$1),it(n,e$1),Pe(n,e$1.hidden&&e$1.opacity===void 0?.4:e$1.opacity,e$1.rotationDeg,e$1.horizontalScale),ne(n,e$1),n}case "rect":{let n=t.createElement("div");return n.className=D.rect,U(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},r),ne(n,e$1),n}case "line":{let n=t.createElement("div");return n.className=e$1.role==="table-cut"?D.tableCut:D.line,e$1.role&&e$1.role!=="table-cut"&&(n.dataset.role=e$1.role),U(n,e(e$1),r),n.setAttribute("aria-hidden","true"),n}case "image":{let n=e$1.href?t.createElement("a"):t.createElement("div");return n.className=D.image,e$1.decorative?n.setAttribute("aria-hidden","true"):(n.setAttribute("role","img"),e$1.altText&&n.setAttribute("aria-label",e$1.altText)),st(n,e$1),n.dataset.relId=e$1.relId,U(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},r),Pe(n,e$1.opacity,e$1.rotationDeg),e$1.filter&&(n.style.filter=e$1.filter),ne(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=D.shape,e$1.decorative?n.setAttribute("aria-hidden","true"):n.setAttribute("role","img"),U(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},r),nn(n,e$1.transform),ne(n,e$1),n}case "decoration":{let n=t.createElement("span");return n.className=D.decoration,n.dataset.deco=e$1.deco,U(n,{x:e$1.x,y:e$1.y,w:e$1.w,h:e$1.h},r),ne(n,e$1),n}}}function et(e,t,r){let i=t.createElement("div");return i.className=D.pageBorder,U(i,{x:e.x,y:e.y,w:e.w,h:e.h},r),i.style.boxSizing="border-box",i.style.pointerEvents="none",i.style.zIndex=e.zOrder==="back"?"0":"20",ye(i,"Top",e.top),ye(i,"Right",e.right),ye(i,"Bottom",e.bottom),ye(i,"Left",e.left),i}function U(e,t,r=0){e.style.position="absolute",e.style.left=`${t.x}px`,e.style.top=`${t.y+r}px`,e.style.width=`${t.w}px`,e.style.height=`${t.h}px`;}function tt(e,t,r){let i=t.noteRef?.id!==void 0?t.noteRef:void 0,n=t.href||i?e.createElement("a"):e.createElement("span");if(st(n,t),i&&!t.href){let s=i.kind??"footnote",o=`oox-${s}-${i.id}`;n.setAttribute("href",`#${o}`),n.setAttribute("role","doc-noteref");let a=`oox-noteref-${s}-${i.id}`;r.noteRefIds.has(a)||(r.noteRefIds.add(a),n.id=a);}return n}function st(e,t){let{href:r}=t;if(!r)return;e.setAttribute("href",r),e.dataset.href=r;let i=t.linkTitle??t.tooltip;i&&(e.title=i),t.linkTarget?e.setAttribute("target",t.linkTarget):r.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 tn(e,t){if(t)for(let r of t.split(" ")){if(r.endsWith("px"))break;r==="italic"?e.style.fontStyle="italic":/^[1-9]00$/.test(r)&&r!=="400"&&(e.style.fontWeight=r);}}function nt(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 ye(e,t,r){if(!r)return;let i=e.style;i[`border${t}Width`]=`${r.width}px`,i[`border${t}Style`]=r.style,i[`border${t}Color`]=r.color;}function Pe(e,t,r,i){t!==void 0&&(e.style.opacity=String(t));let n=[];r&&n.push(`rotate(${r}deg)`),i!==void 0&&i!==100&&n.push(`scaleX(${i/100})`),n.length>0&&(e.style.transform=n.join(" "),e.style.transformOrigin=i!==void 0&&i!==100?"left center":"center center");}function nn(e,t){if(!t)return;let r=[];t.rotation&&r.push(`rotate(${t.rotation}deg)`),t.flipH&&r.push("scaleX(-1)"),t.flipV&&r.push("scaleY(-1)"),r.length!==0&&(e.style.transform=r.join(" "),e.style.transformOrigin="center center");}function it(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 r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",i=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=r,e.style.textEmphasisPosition=i,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=i;}t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function ne(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 r=t.field.type??t.field.category;r&&(e.dataset.fieldType=r),t.field.category&&(e.dataset.fieldCategory=t.field.category),t.field.instruction&&(e.dataset.fieldInstruction=t.field.instruction);let i=t.field.instruction?.trim()||r;i&&e.setAttribute("aria-description",i);}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 r=[t.comment.status,t.comment.authorName??t.comment.authorId,t.comment.date,t.comment.text,...(t.comment.replies??[]).map(i=>[i.authorName,i.text].filter(Boolean).join(": "))].filter(Boolean).join(", ");r&&e.setAttribute("aria-description",r);}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 r=[t.revision.author,t.revision.date].filter(Boolean).join(", ");r&&e.setAttribute("aria-description",r);}t.href&&(e.dataset.href=t.href),rn(e,t.inlineSdtWidget),Be(e,t.sdt),t.sdtPath?.length&&(e.dataset.sdtPath=t.sdtPath.map(r=>r.groupId).join(" ")),t.logicalOrder!==void 0&&(e.dataset.logicalOrder=String(t.logicalOrder)),t.bidiLevel!==void 0&&(e.dataset.bidiLevel=String(t.bidiLevel)),at(e,t);}function at(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 Be(e,t){t&&(e.classList.add(D.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 rn(e,t){if(!t)return;e.classList.add(D.inlineSdtWidget);let r=t.controlKind??t.kind;e.dataset.sdtWidget=r,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)),r==="checkbox"?e.setAttribute("role","checkbox"):r==="dropDownList"||r==="comboBox"?(e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","false")):r==="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 he(e,t){switch(t.scope){case "pmark":e.classList.add(D.revisionPmark),t.kind==="ins"&&e.classList.add(D.revisionPmarkIns),t.kind==="del"&&e.classList.add(D.revisionPmarkDel);break;case "table":e.classList.add(D.revisionTable,Ee(t.kind));break;case "row":e.classList.add(D.revisionRow,Ee(t.kind));break;case "cell":e.classList.add(D.revisionCell,Ee(t.kind));break}e.dataset.revisionId=t.revisionId,e.dataset.revisionAuthor=t.author,t.date&&(e.dataset.revisionDate=t.date);let r=[t.author,t.date].filter(Boolean).join(", ");r&&e.setAttribute("aria-description",r);}function Ee(e){return e==="ins"?D.revisionIns:e==="del"?D.revisionDel:D.revisionMerge}function on(e,t,r,i){let n=r.createElement("section");n.className=D.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 s=new Map;for(let a of e.notes??[])a.id!==void 0&&s.set(a.id,a);re(n,e.separatorPrimitives??[],r,-(e.y??0),i);let o=[...e.primitives??[]];for(let a of e.noteIds??[]){let c=`${e.kind??"footnote"}-${a}`,u=o.filter(m=>m.groupId===c);if(u.length===0)continue;for(let m of u){let h=o.indexOf(m);h>=0&&o.splice(h,1);}let y=r.createElement("aside");y.className=D.note,y.id=`oox-${c}`,y.dataset.noteId=String(a),y.setAttribute("role",e.kind==="endnote"?"doc-endnote":"doc-footnote");let g=s.get(a);if(g&&(g.label!==void 0&&(y.dataset.noteLabel=g.label),g.anchorDocStart!==void 0&&(y.dataset.anchorDocStart=String(g.anchorDocStart)),g.anchorDocEnd!==void 0&&(y.dataset.anchorDocEnd=String(g.anchorDocEnd))),re(y,u,r,-(e.y??0),i),g){let m=r.createElement("a");m.className=D.noteBacklink,m.setAttribute("role","doc-backlink"),m.setAttribute("href",`#oox-noteref-${c}`);let h=i.labels?.noteBacklink??g.label??String(a);m.setAttribute("aria-label",h),y.appendChild(m);}n.appendChild(y);}return o.length>0&&re(n,o,r,-(e.y??0),i),n}function sn(e,t){for(let r of Array.from(e.querySelectorAll(".layout-canvas-sdt-box[data-sdt-group-id]")))r.classList.toggle("layout-sdt-focused",t.has(r.dataset.sdtGroupId??""));}var an=".layout-sdt-widget, .layout-inline-sdt-widget, .layout-sdt-repeat-btn";function ln(e,t={}){let r=t.document??document,i=r.createElement("div");i.className="layout-interactive-overlay",i.dataset.pageIndex=String(e.pageIndex),i.style.position="absolute",i.style.inset="0",i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.pointerEvents="none",i.addEventListener("mousedown",a=>{a.target?.closest?.(an)&&(a.preventDefault(),a.stopPropagation());});let n=cn(e),s=dn(n);for(let a of [...s.values()].sort(pn))i.appendChild(mn(a,r,t.labels));let o=un(n);for(let a of o.values())i.appendChild(fn(a,r,t.labels));return i}function cn(e){return [...e.primitives,...e.header?.primitives??[],...e.footer?.primitives??[],...(e.noteAreas??[]).flatMap(t=>[...t.separatorPrimitives??[],...t.primitives??[]])]}function dn(e){let t=new Map;for(let r of e){let i=ct(r);if(!i)continue;let n=r.sdtPath?.length?r.sdtPath:r.sdt?[r.sdt]:[];for(let s of n){let o=t.get(s.groupId);o?o.rect=dt(o.rect,i):t.set(s.groupId,{attrs:s,rect:{...i}});}}return t}function un(e){let t=new Map;for(let r of e){let i=r.inlineSdtWidget,n=ct(r);if(!i||!n)continue;let s=`${i.groupId}:${i.pos}:${i.controlKind??i.kind}`,o=t.get(s);o?o.rect=dt(o.rect,n):t.set(s,{attrs:i,rect:{...n}});}return t}function pn(e,t){return (e.attrs.depth??0)-(t.attrs.depth??0)||e.rect.y-t.rect.y||e.rect.x-t.rect.x}function mn(e,t,r){let{attrs:i,rect:n}=e,s=t.createElement("div");s.className="layout-block-sdt-box layout-canvas-sdt-box",bn(s,i),ut(s,n),s.style.pointerEvents="none";let o=i.alias||i.tag;if(o){let c=t.createElement("span");c.className="layout-block-sdt-label",c.textContent=o,s.appendChild(c);}let a=gn(i.sdtType),l=!i.bound&&!hn(i.lock);if(a&&l){let c=t.createElement("button");c.type="button",c.className="layout-sdt-widget",c.dataset.sdtWidget=a,c.dataset.sdtGroupId=i.groupId,i.tag&&(c.dataset.sdtTag=i.tag),i.alias&&(c.dataset.sdtAlias=i.alias),(o||r?.control)&&c.setAttribute("aria-label",o||r?.control||""),a==="dropdown"&&c.setAttribute("aria-haspopup","listbox"),a==="date"&&c.setAttribute("aria-haspopup","dialog"),a==="checkbox"&&(c.setAttribute("role","checkbox"),c.setAttribute("aria-checked",String(i.checked??false))),c.textContent=a==="dropdown"?"\u25BE":a==="date"?"\u25A3":i.checked?"\u2612":"\u2610",c.style.pointerEvents="auto",s.appendChild(c);}if(i.repeatingItem&&l){let c=t.createElement("div");c.className="layout-sdt-repeat-controls",c.style.pointerEvents="auto",c.appendChild(lt(t,i,"add","\uFF0B",r?.addRepeatingItem,o)),c.appendChild(lt(t,i,"remove","\u2715",r?.removeRepeatingItem,o)),s.appendChild(c);}return s}function lt(e,t,r,i,n,s){let o=e.createElement("button");return o.type="button",o.className="layout-sdt-repeat-btn",o.dataset.sdtRepeat=r,o.dataset.sdtGroupId=t.groupId,t.tag&&(o.dataset.sdtTag=t.tag),(n||s)&&o.setAttribute("aria-label",n||s||""),o.textContent=i,o}function fn(e,t,r){let{attrs:i,rect:n}=e,s=i.controlKind??i.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=yn(s),o.dataset.sdtGroupId=i.groupId,o.dataset.sdtPos=String(i.pos),i.tag&&(o.dataset.sdtTag=i.tag),i.alias&&(o.dataset.sdtAlias=i.alias),i.controlId!==void 0&&(o.dataset.sdtControlId=String(i.controlId)),i.value!==void 0&&(o.dataset.sdtValue=i.value),i.selectedIndex!==void 0&&(o.dataset.sdtSelectedIndex=String(i.selectedIndex)),i.dateFormat&&(o.dataset.sdtDateFormat=i.dateFormat),i.dateLanguage&&(o.dataset.sdtDateLanguage=i.dateLanguage),i.listItems?.length&&(o.dataset.sdtListItems=JSON.stringify(i.listItems)),(i.alias||i.tag||r?.control)&&o.setAttribute("aria-label",i.alias||i.tag||r?.control||""),s==="checkbox"?(o.setAttribute("role","checkbox"),o.setAttribute("aria-checked",String(i.checked??false))):s==="dropDownList"||s==="comboBox"?(o.setAttribute("aria-haspopup","listbox"),o.setAttribute("aria-expanded","false")):s==="date"&&o.setAttribute("aria-haspopup","dialog"),o.disabled=i.locked===true,o.textContent=s==="checkbox"?i.checked?"\u2612":"\u2610":s==="date"?"\u25A3":s==="picture"?"\u25A7":"\u25BE",ut(o,n),o.style.pointerEvents="auto",o}function yn(e){return e==="dropDownList"||e==="comboBox"?"dropdown":e}function gn(e){return e==="checkbox"?"checkbox":e==="dropDownList"||e==="comboBox"?"dropdown":e==="date"?"date":null}function hn(e){return e==="contentLocked"||e==="sdtContentLocked"||e==="sdtLocked"}function bn(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 ct(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 dt(e,t){let r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),n=Math.max(e.x+e.w,t.x+t.w),s=Math.max(e.y+e.h,t.y+t.h);return {x:r,y:i,w:n-r,h:s-i}}function ut(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=class extends Error{constructor(r,i){let n=i instanceof Error?i.message:String(i);super(`Rust display-list ${r} failed: ${n}`);b(this,"stage");this.name="RustDisplayListSourceError",this.stage=r;}},pt=null;function He(){return pt??(pt=import('../../wasm-JE7B3ROD.mjs').then(async e=>(await e.preloadLayoutWasm(),{buildDisplayListJson:e.buildDisplayListJson,hitTestRegionsJson:e.hitTestRegionsJson,verticalMoveJson:e.verticalMoveJson,rangeRectsJson:e.rangeRectsJson,rangeRectsRegionJson:e.rangeRectsRegionJson,hasRangeRectsRegion:e.hasRangeRectsRegion,hasDisplayListSession:e.hasDisplayListSession,openDisplayList:e.openDisplayList,closeDisplayList:e.closeDisplayList,updateDisplayList:e.updateDisplayList,hasDisplayListUpdate:e.hasDisplayListUpdate,hitTestRegionsByHandle:e.hitTestRegionsByHandle,verticalMoveByHandle:e.verticalMoveByHandle,rangeRectsByHandle:e.rangeRectsByHandle,rangeRectsRegionByHandle:e.rangeRectsRegionByHandle}))),pt}function Ge(){return He()}function xn(e,t){let r=e.measured,i="[";for(let s=0;s<r.length;s++){s>0&&(i+=",");let o=r[s],a=o.measure,l;if(t&&a!==null&&typeof a=="object"){let c=a;l=t.get(c),l===void 0&&(l=JSON.stringify(o.measure),t.set(c,l));}else l=JSON.stringify(o.measure);i+='{"block":'+JSON.stringify(o.block)+',"measure":'+l+"}";}i+="]";let n='{"measured":'+i+',"options":'+JSON.stringify(e.options)+',"layout":'+JSON.stringify(e.layout);return e.contractVersion!==void 0&&(n+=',"contractVersion":'+JSON.stringify(e.contractVersion)),e.headersFooters!==void 0&&(n+=',"headersFooters":'+JSON.stringify(e.headersFooters)),e.fontChains!==void 0&&(n+=',"fontChains":'+JSON.stringify(e.fontChains)),e.noteAreas!==void 0&&(n+=',"noteAreas":'+JSON.stringify(e.noteAreas)),e.resolvedCommentIds!==void 0&&(n+=',"resolvedCommentIds":'+JSON.stringify(e.resolvedCommentIds)),e.commentAuthors!==void 0&&(n+=',"commentAuthors":'+JSON.stringify(e.commentAuthors)),e.commentThreads!==void 0&&(n+=',"commentThreads":'+JSON.stringify(e.commentThreads)),n+="}",n}function mt(e){let t={};return e.contractVersion!==void 0&&(t.contractVersion=e.contractVersion),e.headersFooters!==void 0&&(t.headersFooters=e.headersFooters),e.fontChains!==void 0&&(t.fontChains=e.fontChains),e.noteAreas!==void 0&&(t.noteAreas=e.noteAreas),e.resolvedCommentIds!==void 0&&(t.resolvedCommentIds=e.resolvedCommentIds),e.commentAuthors!==void 0&&(t.commentAuthors=e.commentAuthors),e.commentThreads!==void 0&&(t.commentThreads=e.commentThreads),JSON.stringify(t)}var Ln=new WeakMap;async function ft(e,t){let r;try{r=t??await He();}catch(s){throw new V("load",s)}let i,n;try{i=xn(e,Ln),n=r.buildDisplayListJson(i);}catch(s){throw new V("build",s)}try{return JSON.parse(n)}catch(s){throw new V("parse",s)}}async function Rn(e,t$1,r=null){let i;try{i=t$1??await He();}catch(l){throw new V("load",l)}if(!i.buildDisplayListFrame)return {displayList:await ft(e,i),frame:null,transport:"json"};let n=mt(e),s$1;try{s$1=i.buildDisplayListFrame(n,r?.frameEpoch??0);}catch(l){throw new V("build",l)}let o;try{o=s(s$1);}catch(l){throw new V("decode",l)}let a;try{a=t(r,o);}catch(l){throw new V("apply",l)}return {displayList:a.displayList,frame:a,transport:"frame-delta-v1"}}function yt(e,t,r){if(t==="body")return e.primitives.filter(n=>n.kind==="image");let i=t==="header"?e.header:e.footer;return !i||r!==void 0&&i.rId!==r?[]:i.primitives.filter(n=>n.kind==="image")}function Fe(e,t,r="body",i){for(let n of e.pages)for(let s of yt(n,r,i))if(s.docStart===t)return {primitive:s,pageIndex:n.pageIndex,...r!=="body"?{region:r,rId:i}:{}};return null}function Ne(e,t,r,i,n="body",s){let o=e.pages[t];if(!o)return null;let a=yt(o,n,s);for(let l=a.length-1;l>=0;l--){let c=a[l];if(!(r<c.x||r>c.x+c.w)&&!(i<c.y||i>c.y+c.h))return {primitive:c,pageIndex:o.pageIndex,...n!=="body"?{region:n,rId:s}:{}}}return null}function Dn(e,t){let r=e.imageByPos(t);if(!r)return;let i=e.contentBounds(r.pageIndex),n=e.paragraphRects(t).find(s=>s.pageIndex===r.pageIndex);if(!(!i||!n))return {horizontalEmu:Math.round(c$1(r.primitive.x-i.x)),verticalEmu:Math.round(c$1(r.primitive.y-n.y))}}var xe=(()=>{let e=globalThis.FinalizationRegistry;return e?new e(t=>t()):null})(),Ye=new WeakMap,Re=new WeakSet,Oe=new Set;function vn(e){return e!=null&&Re.has(e)}function In(e){return Oe.add(e),()=>{Oe.delete(e);}}function Le(e){return e instanceof Error?typeof WebAssembly<"u"&&e instanceof WebAssembly.RuntimeError?true:e.name==="RuntimeError":false}function Sn(e,t){let r=new Map;e.list.pages.forEach((s,o)=>r.set(s,o));let i=[],n=[];return t.pages.forEach((s,o)=>{let a=r.get(s);a!==void 0&&v(s)===e.pageRevisions[a]?(i.push([o,a]),r.delete(s)):n.push([o,s]);}),i.length===0?null:JSON.stringify({total:t.pages.length,...t.contractVersion!==void 0?{contractVersion:t.contractVersion}:{},reuse:i,replace:n})}function kn(e,t,r){let i=null,n=()=>i??(i=JSON.stringify(e)),s=wn(t)?t:null,o=s?null:t??null,a=null,l,c,u=new Promise((d,p)=>{l=d,c=p;});u.catch(()=>{});let y=null,g=false,m=false,h=false,R={},k=null;if(r){let d=Ye.get(r);d&&(k=d.hasHandle()?r:d.donor(),d.supersede());}let I=()=>s??o,x=()=>{let d=I();return d!==null&&Re.has(d)},P=(d,p)=>{let f=p instanceof Error?p:new Error(String(p));a=f,y=null,xe?.unregister(R);let b=I();if(!(!b||Re.has(b))){Re.add(b),console.error(`[CanvasRenderer] ${d} trapped in wasm; the session is unusable and must be rebuilt`,f);for(let L of Oe)try{L(f);}catch(v){console.error("[CanvasRenderer] display-list source failure listener threw",v);}}},T=()=>{if(y!==null&&x()){y=null;return}if(y!==null){try{o?.closeDisplayList?.(y);}catch{}y=null;}},M=()=>{let d=k;if(k=null,!d||!o?.updateDisplayList||!o.hasDisplayListUpdate?.())return false;let p=Ye.get(d);if(!p||p.engine()!==o)return false;let f=Sn(p,e);if(!f)return false;let b=p.takeHandle();if(b===null)return false;try{return o.updateDisplayList(b,f),y=b,!0}catch(L){try{o.closeDisplayList?.(b);}catch{}return console.warn("[CanvasRenderer] display-list delta update failed; reopening",L),false}},Y=()=>{if(!(h||m||g||y!==null||!o||x())&&!(!o.hasDisplayListSession?.()||!o.openDisplayList)&&(g=true,!M()))try{y=o.openDisplayList(n());}catch(d){if(y=null,Le(d)){P("display-list session open",d);return}console.warn("[CanvasRenderer] display-list session open failed; using JSON-arg queries",d);}};s||o?l():Ge().then(d=>{o=d,l();},d=>{a=d instanceof Error?d:new Error(String(d)),c(a),console.warn("[CanvasRenderer] display-list query engine failed to load",a);});let z=(d,p,f)=>{if(!o||x())return null;if(y===null&&Y(),y!==null&&d)try{return d(y)}catch(b){if(Le(b))return P(f,b),null;console.warn(`[CanvasRenderer] ${f} session query failed; falling back`,b),T();}try{return p()}catch(b){return Le(b)?(P(f,b),null):(a=b instanceof Error?b:new Error(String(b)),console.warn(`[CanvasRenderer] ${f} query failed`,b),null)}},w=(d,p,f)=>{if(d===null)return p;try{return JSON.parse(d)}catch(b){return a=b instanceof Error?b:new Error(String(b)),console.warn(`[CanvasRenderer] ${f} returned invalid JSON`,b),p}},N=(d,p)=>{if(x())return null;try{return d()}catch(f){return Le(f)?(P(`resident ${p}`,f),null):(a=f instanceof Error?f:new Error(String(f)),console.warn(`[CanvasRenderer] resident ${p} query failed`,f),null)}},F=(d,p,f)=>{if(s)return w(N(()=>s.displayHitTestRegionsJson(d,p,f),"hit_test_regions"),null,"hit_test_regions");let b=z(o?.hitTestRegionsByHandle&&(L=>o.hitTestRegionsByHandle(L,d,p,f)),()=>o.hitTestRegionsJson(n(),d,p,f),"hit_test_regions");return w(b,null,"hit_test_regions")},Z=(d,p)=>{if(s)return w(N(()=>s.displayRangeRectsJson(d,p),"range_rects"),[],"range_rects");let f=z(o?.rangeRectsByHandle&&(b=>o.rangeRectsByHandle(b,d,p)),()=>o.rangeRectsJson(n(),d,p),"range_rects");return w(f,[],"range_rects")},le=(d,p,f)=>{let b=f??Number.NaN;if(s)return w(N(()=>s.displayVerticalMoveJson(d,p,b),"vertical_move"),null,"vertical_move");if(!o?.verticalMoveJson)return null;let L=z(o.verticalMoveByHandle&&(v=>o.verticalMoveByHandle(v,d,p,b)),()=>o.verticalMoveJson(n(),d,p,b),"vertical_move");return w(L,null,"vertical_move")},B=(d,p,f,b)=>{if(s)return w(N(()=>s.displayRangeRectsRegionJson(d,p,f,b),"range_rects_region"),[],"range_rects_region");if(!o||!o.hasRangeRectsRegion?.())return [];let L=z(o.rangeRectsRegionByHandle&&(v=>o.rangeRectsRegionByHandle(v,d,p,f,b)),()=>o.rangeRectsRegionJson(n(),d,p,f,b),"range_rects_region");return w(L,[],"range_rects_region")},ee=(d,p,f)=>{let b=B(d,p,f,f+1);if(b.length>0){let L=new Map;for(let v of b)L.has(v.pageIndex)||L.set(v.pageIndex,{pageIndex:v.pageIndex,x:v.x,y:v.y,width:0,height:v.height});return [...L.values()]}if(f>0){let L=B(d,p,f-1,f);if(L.length>0){let v=new Map;for(let S of L)v.set(S.pageIndex,{pageIndex:S.pageIndex,x:S.x+S.width,y:S.y,width:0,height:S.height});return [...v.values()]}}return []},A=d=>{let p=Z(d,d+1);if(p.length>0){let f=p[0];return {pageIndex:f.pageIndex,x:f.x,y:f.y,width:0,height:f.height}}if(d>0){let f=Z(d-1,d);if(f.length>0){let b=f[f.length-1];return {pageIndex:b.pageIndex,x:b.x+b.width,y:b.y,width:0,height:b.height}}}return null},_=d=>{let p=Z(d,d+2);return p.length>0?p[0]:A(d)},X=(d,p,f)=>{let b=B(d,p,f,f+2);if(b.length===0)return ee(d,p,f);let L=new Map;for(let v of b)L.has(v.pageIndex)||L.set(v.pageIndex,v);return [...L.values()]},$=(d,p)=>({pageIndex:d,x:p.x,y:p.y,width:p.w,height:p.h}),J=d=>{let p=e.pages[d];return p?{pageIndex:p.pageIndex,x:0,y:0,width:p.width,height:p.height}:null},j=d=>{let p=e.pages[d],f=p?.contentBounds;return p&&f?{pageIndex:p.pageIndex,x:f.x,y:f.y,width:f.width,height:f.height}:null},te=d=>{let p=e.pages[d];return p?(p.columnBounds??[]).map(f=>({pageIndex:p.pageIndex,x:f.x,y:f.y,width:f.width,height:f.height})):[]},Q=d=>d.paraId?`para:${d.paraId}`:d.blockKey!==void 0?`block-key:${d.blockKey}`:d.blockId!==void 0?`block-id:${d.blockId}`:null,ce=d=>d.blockKey??d.blockId,de=null,Dt=()=>{if(de)return de;let d=new Map;for(let p of e.pages)for(let f$1 of p.primitives){let b=Q(f$1);if(!b||f$1.docStart===void 0||f$1.docEnd===void 0)continue;let L=f(f$1),v=d.get(b);v||(v=new Map,d.set(b,v));let S=v.get(p.pageIndex);if(!S){v.set(p.pageIndex,{...$(p.pageIndex,L),from:f$1.docStart,to:f$1.docEnd,blockId:ce(f$1),paraId:f$1.paraId});continue}let C=Math.min(S.x,L.x),E=Math.min(S.y,L.y),pe=Math.max(S.x+S.width,L.x+L.w),me=Math.max(S.y+S.height,L.y+L.h);S.x=C,S.y=E,S.width=pe-C,S.height=me-E,S.from=Math.min(S.from,f$1.docStart),S.to=Math.max(S.to,f$1.docEnd);}return de=new Map([...d].map(([p,f])=>[p,[...f.values()]])),de},vt=d=>{let p=null;for(let f of e.pages)for(let b of f.primitives){let L=Q(b),v=b.docStart,S=b.docEnd;if(!L||v===void 0||S===void 0||d<v||d>S)continue;let C={identity:L,span:Math.max(0,S-v),startsAtPos:v===d};(!p||C.startsAtPos&&!p.startsAtPos||C.startsAtPos===p.startsAtPos&&C.span<p.span)&&(p=C);}return p?Dt().get(p.identity)??[]:[]},It=1.5,ue=null,Ve=()=>{if(ue)return ue;let d=[];for(let p of e.pages){let f$1=[],b=0;for(let L of p.primitives){if(L.kind!=="text"&&L.kind!=="glyphRun"||L.docStart===void 0||L.docEnd===void 0||L.kind==="glyphRun"&&L.glyphs.length===0)continue;let v=L.kind==="text"?L.baselineY:L.glyphs.reduce((fe,Mt)=>Math.max(fe,Mt.y),-1/0);if(!Number.isFinite(v))continue;let S=Q(L)??`anonymous:${b++}`,C=f(L),E=f$1.find(fe=>fe.identity===S&&Math.abs(fe.baseline-v)<=It);if(!E){f$1.push({identity:S,...$(p.pageIndex,C),baseline:v,from:L.docStart,to:L.docEnd,blockId:ce(L),paraId:L.paraId});continue}let pe=Math.min(E.x,C.x),me=Math.min(E.y,C.y),kt=Math.max(E.x+E.width,C.x+C.w),wt=Math.max(E.y+E.height,C.y+C.h);E.x=pe,E.y=me,E.width=kt-pe,E.height=wt-me,E.from=Math.min(E.from,L.docStart),E.to=Math.max(E.to,L.docEnd);}d.push(...f$1.map(({identity:L,...v})=>v));}return ue=d,ue},St=d=>{let p=null;for(let f of Ve())d<f.from||d>f.to||(!p||f.to-f.from<p.to-p.from)&&(p=f);return p},ze=d=>{if(!d)return null;let p=d.primitive.docStart;if(p===void 0)return null;let{primitive:f}=d;return {...d,pos:p,rect:{pageIndex:d.pageIndex,x:f.x,y:f.y,width:f.w,height:f.h}}},ve={displayList:e,isReady:()=>(s!==null||o!==null)&&a===null,sourceState:()=>a?{status:"error",error:a}:s||o?{status:"ready"}:{status:"loading"},whenReady:()=>u,pageCount:()=>e.pages.length,pageSize:d=>{let p=e.pages[d];return p?{width:p.width,height:p.height}:null},pageBounds:J,contentBounds:j,columnBounds:te,paragraphRects:vt,visualLines:Ve,visualLineAtPosition:St,imageAtPoint:(d,p,f,b="body",L)=>ze(Ne(e,d,p,f,b,L)),imageByPos:(d,p="body",f)=>ze(Fe(e,d,p,f)),hitTestRegions:F,verticalMove:le,rangeRects:Z,hfRangeRects:B,hfCaretRects:ee,hfAnchorRects:X,caretRect:A,anchorRect:_,sidebarAnchorRect:_,prime:Y,dispose:()=>{h||(h=true,T(),xe?.unregister(R));}};return xe?.register(ve,T,R),Ye.set(ve,{list:e,pageRevisions:e.pages.map(v),engine:()=>o,hasHandle:()=>y!==null,donor:()=>k,supersede:()=>{m=true;},takeHandle:()=>{let d=y;return d!==null&&(y=null,xe?.unregister(R)),d}}),ve}function wn(e){return typeof e?.displayHitTestRegionsJson=="function"&&typeof e?.displayVerticalMoveJson=="function"&&typeof e?.displayRangeRectsJson=="function"&&typeof e?.displayRangeRectsRegionJson=="function"}var Mn=16,Pn=24;function oe(e){let t=[],r=24;for(let i=0;i<e.pageCount();i++)t.push(r),r+=(e.pageSize(i)?.height??0)+16;return t}function En(){let e=new Map;return t=>{if(!t.startsWith("blob:")&&!t.startsWith("data:"))return null;let r=e.get(t);return r||(r=new Promise(i=>{let n=new Image;n.onload=()=>i(n),n.onerror=()=>i(null),n.src=t;}),e.set(t,r)),r}}function An(e,t){let r=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,...r?.authorName!==void 0?{commentAuthor:r.authorName}:{},...r?.replyCount!==void 0?{commentReplyCount:r.replyCount}:{}}}function Tn(e,t){if(!e)return [];let r=[];return !e.hasSelection&&t.hasSelection&&r.push({key:"selected"}),e.hasSelection&&!t.hasSelection&&r.push({key:"selectionCleared"}),!e.hasComment&&t.hasComment&&r.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&&r.push({key:"trackedInsertion"}),!e.inDeletion&&t.inDeletion&&r.push({key:"trackedDeletion"}),(!e.inList&&t.inList||t.inList&&e.listLevel!==t.listLevel)&&r.push({key:"listItem",vars:{level:t.listLevel+1}}),r}function se(e){let t=Number(e);if(Number.isFinite(t))return t;let r=0xcbf29ce484222325n;for(let i of new TextEncoder().encode(e))r=(r^BigInt(i))*0x100000001b3n,r&=0xffffffffffffffffn;return Number(r&(1n<<53n)-1n)}function De(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Cn(e){let t=typeof e.story=="string"?[e.story]:[],r=Array.isArray(e.rows)?e.rows:[];for(let i of r){let n=De(i),s=n&&Array.isArray(n.cells)?n.cells:[];for(let o of s){let a=De(o)?.story;typeof a=="string"&&t.push(a);}}return t}function Bn(e){let t=e.storyIds(),r=new Map,i=new Set;for(let o of t){let a=[];try{for(let l of e.storySegments(o))if(l.kind==="embed")for(let c of Cn(l.payload))a.push(c),i.add(c);}catch{}r.set(o,a);}let n=new Map,s=(o,a,l)=>{if(!(l.has(o)||n.has(o))){l.add(o),n.set(o,a);for(let c of r.get(o)??[])s(c,a,l);l.delete(o);}};t.includes("body")&&s("body",{story:"body"},new Set);for(let o of t)!o.startsWith("hf:")||i.has(o)||s(o,{story:o,hfRid:o.slice(3)},new Set);return n}function Hn(e,t,r,i,n){let s=Array.isArray(t.rows)?t.rows:[],o=r+1;for(let a of s){let l=De(a),c=l&&Array.isArray(l.cells)?l.cells:[],u=o+1;for(let y of c){let g=De(y),m=typeof g?.story=="string"?g.story:null,h=m?_e(e,m,u+1,i,n):0;u+=h+2;}o=u+1;}return o+1-r}function _e(e,t,r,i,n){if(n.has(t))throw new Error(`recursive yrs story: ${t}`);n.add(t);try{let s=r,o=r,a=0,l=!0;for(let c of e.storySegments(t)){if(c.kind==="text"){a+=c.text.length,l=!1;continue}if(c.kind==="pilcrow"){let u=o+a+2;i.set(c.paraId,{pmStart:o,pmEnd:u}),s=u,o=s,a=0,l=!0;continue}if(c.embedKind==="table"&&l){s+=Hn(e,c.payload,s,i,n),o=s;continue}if(c.embedKind==="blockSdt"&&l){let u=typeof c.payload.story=="string"?c.payload.story:null,y=u?_e(e,u,s+1,i,n):0;s+=y+2,o=s;continue}if(l&&(c.embedKind==="pageBreak"||c.embedKind==="columnBreak")){s+=1,o=s;continue}a+=1,l=!1;}return s-r}finally{n.delete(t);}}function Gn(e){let t=new Map,r=Bn(e),i=o=>{let a=r.get(o)?.story;if(!a)return null;if(t.has(a))return t.get(a)??null;try{let l=new Map;return _e(e,a,0,l,new Set),t.set(a,l),l}catch{return t.set(a,null),null}},n=o=>{let a=r.get(o.story);if(!a)return null;let l=i(o.story)?.get(o.paraId);if(!l)return null;let c=Math.max(0,l.pmEnd-l.pmStart-2),u=Math.min(Math.max(0,Math.trunc(o.offset)),c);return {story:o.story,position:l.pmStart+1+u,...a.hfRid?{hfRid:a.hfRid}:{}}};return {locToDisplayPoint:n,storyOffsetToDisplayPoint:(o,a)=>{if(!r.has(o))return null;let l=Math.max(0,Math.trunc(a));try{for(let c of e.paragraphs(o)){let u=e.locateParagraph(o,c.paraId);if(!(l<u.start||l>u.end))return n({story:o,paraId:c.paraId,offset:Math.min(l-u.start,u.end-u.start)})}}catch{return null}return null}}}function Xe(e,t){let{doc:r,schema:i}=e.state,n=i.marks.comment,s=i.marks.insertion,o=i.marks.deletion;!n&&!s&&!o||r.descendants((a,l)=>{let c=a.attrs;if(c){let u=[c.trIns,c.trDel,c.pPrIns,c.pPrDel];for(let h of u){let R=h?.revisionId;typeof R=="number"&&t(`revision-${R}`,l);}let g=c.cellMarker?.info?.revisionId;typeof g=="number"&&t(`revision-${g}`,l);let m=[c.pPrChange,c.trPrChange,c.tcPrChange,c.tblPrChange];for(let h of m)if(Array.isArray(h))for(let R of h){let k=R?.info?.id;typeof k=="number"&&t(`revision-${k}`,l);}}if(a.isInline)for(let u of a.marks){let y=null;n&&u.type===n?y=`comment-${u.attrs.commentId}`:(s&&u.type===s||o&&u.type===o)&&(y=`revision-${u.attrs.revisionId}`),y&&t(y,l);}});}function Fn(e,t,r){let i=new Map;if(!e?.state)return i;let n=oe(t),s=new Set;return Xe(e,(o,a)=>{if(s.has(o))return;s.add(o);let l=t.anchorRect(a);if(!l)return;let c=r?r(l):(n[l.pageIndex]??0)+l.y;c!=null&&i.set(o,c);}),i}function Nn(e,t,r){if(!e.hfRid)return t.anchorRect(e.position);let i=r?.get(e.hfRid);return i?t.hfAnchorRects(i,e.hfRid,e.position)[0]??null:null}function Yn(e,t,r,i,n,s,o){let a=new Map,l=oe(n),c=(u,y)=>{if(!y||a.has(u))return a.has(u);let g=Nn(y,n,s);if(!g)return false;let m=o?o(g):(l[g.pageIndex]??0)+g.y;return m==null?false:(a.set(u,m),true)};for(let u of t){let y=`comment-${u}`;try{for(let g of e.resolveComment(String(u)))if(c(y,i.storyOffsetToDisplayPoint(g.story,g.start)))break}catch{}}for(let u of r)c(`revision-${se(u.revisionId)}`,i.locToDisplayPoint({story:u.story,...u.range.start}));return a}function On(e,t,r,i){let n=oe(t);for(let{region:s,rId:o,view:a}of e)Xe(a,(l,c)=>{if(r.has(l))return;let u=t.hfAnchorRects(s,o,c)[0];if(!u)return;let y=i?i(u):(n[u.pageIndex]??0)+u.y;y!=null&&r.set(l,y);});return r}function _n(e,t){let r=e.map(o=>{let a=t.locToDisplayPoint({story:o.range.story,...o.range.start}),l=t.locToDisplayPoint({story:o.range.story,...o.range.end}),c=a?.position??0,u=Math.max(c,l?.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:u,revisionId:se(o.revisionId),...a?.hfRid?{hfRid:a.hfRid}:{}}}),i=new Map;for(let o of r){let a=i.get(o.revisionId)??[];a.push(o),i.set(o.revisionId,a);}let n=[...i.values()].map(o=>{let a=Math.min(...o.map(m=>m.from)),l=Math.max(...o.map(m=>m.to)),c=o.filter(m=>m.type==="insertion"),u=o.filter(m=>m.type==="deletion");if(c.length>0&&u.length>0)return {...c[0],type:"replacement",text:c.map(h=>h.text).join(""),deletedText:u.map(h=>h.text).join(""),from:a,to:l};let y=o.find(m=>m.type==="insertion"||m.type==="deletion")??o[0],g=o.filter(m=>m.type===y.type).map(m=>m.text).join("");return {...y,text:g,from:a,to:l}}),s=[];for(let o=0;o<n.length;o+=1){let a=n[o],l=n[o+1];a.type==="deletion"&&l?.type==="insertion"&&a.author===l.author&&a.date===l.date&&a.to===l.from&&a.hfRid===l.hfRid?(s.push({type:"replacement",text:l.text,deletedText:a.text,author:a.author,date:a.date,from:a.from,to:l.to,revisionId:a.revisionId,insertionRevisionId:l.revisionId,...a.hfRid?{hfRid:a.hfRid}:{}}),o+=1):s.push(a);}return {entries:s,commentToRevision:new Map}}function Xn(e,t){let r=t.kind??"body";if(r==="body")return {kind:r,primitives:e.primitives};let i=r==="header"?e.header:e.footer;return !i||i.kind!==r||t.rId&&i.rId!==t.rId?null:{kind:r,rId:i.rId,primitives:i.primitives}}function $n(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 Jn(e){let t=$n(e),r=e.clipGroup?.clip;if(!r)return t;let i=r.x??0,n=r.y??0,s=i+Math.max(0,r.w??0),o=n+Math.max(0,r.h??0),a=Math.max(t.x,i),l=Math.max(t.y,n),c=Math.min(t.x+t.w,s),u=Math.min(t.y+t.h,o);return c<a||u<l?null:{x:a,y:l,w:c-a,h:u-l}}function Qn(e){return e.kind==="text"||e.kind==="glyphRun"?e.text:e.kind==="image"?e.altText??"":""}function Wn(e,t,r){return t>=e.x&&t<=e.x+e.w&&r>=e.y&&r<=e.y+e.h}function Kn(e,t,r,i,n={kind:"body"}){let s=e.pages[t];if(!s)return null;let o=Xn(s,n);if(!o)return null;for(let a=o.primitives.length-1;a>=0;a--){let l=o.primitives[a];if(l.kind==="line"||!l.href||l.hiddenObject)continue;let c=Jn(l);if(c&&Wn(c,r,i))return {pageIndex:t,region:o.kind,rId:o.rId,href:l.href,tooltip:l.linkTitle??l.tooltip,displayText:Qn(l)||l.href,rect:c}}return null}var O=7.5,q=16,gt=320,Vn=30,zn=200,jn=24,Un=10,qn=10,Zn=24;function ht(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 r=Je(e);return r?ei(t,r)??{x:r.x,y:r.y,w:0,h:0}:t}function Je(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 ei(e,t){let r=Math.max(e.x,t.x),i=Math.max(e.y,t.y),n=Math.min(e.x+e.w,t.x+t.w),s=Math.min(e.y+e.h,t.y+t.h);return n<r||s<i?null:{x:r,y:i,w:n-r,h:s-i}}function bt(e,t,r){if(e.docStart!=null){let i=t(e.docStart);if(i!=null){let n={tableKey:i,docStartSample:e.docStart};return e.table?.tableId&&!r.has(e.table.tableId)&&r.set(e.table.tableId,n),n}}return e.table?.tableId?r.get(e.table.tableId)??null:null}function xt(e,t,r){let i=e.table?.tableId;if(!i)return null;let n=t.get(i);return n?r.get(n.tableKey)??null:null}function ti(e,t,r,i){let n=new Map;for(let o of t){if(o.kind==="line")continue;let a=o.cell;if(!a)continue;let l=bt(o,r,i);if(!l)continue;let{tableKey:c,docStartSample:u}=l,y=ht(o),g=Je(o),m=g??y,h=n.get(c);if(h||(h={tableKey:c,docStartSample:u,contentMinX:m.x,contentMinY:m.y,contentMaxX:m.x+m.w,contentMaxY:m.y+m.h,exactLeftX:[],exactBottomY:[],exactClipLeftX:[],exactClipBottomY:[],rows:new Map},n.set(c,h)),u<h.docStartSample&&(h.docStartSample=u),h.contentMinX=Math.min(h.contentMinX,m.x),h.contentMinY=Math.min(h.contentMinY,m.y),h.contentMaxX=Math.max(h.contentMaxX,m.x+m.w),h.contentMaxY=Math.max(h.contentMaxY,m.y+m.h),g&&(h.exactClipLeftX.push(g.x),h.exactClipBottomY.push(g.y+g.h)),!a.continuation){let R=h.rows.get(a.row);R?(R.top=Math.min(R.top,m.y),R.bottom=Math.max(R.bottom,m.y+m.h)):h.rows.set(a.row,{top:m.y,bottom:m.y+m.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=xt(o,i,n);if(!a){let u=(o.x1+o.x2)/2,y=(o.y1+o.y2)/2,g=1/0;for(let m of n.values()){let h=u>=m.contentMinX-q&&u<=m.contentMaxX+q,R=y>=m.contentMinY-q&&y<=m.contentMaxY+q;if(!h||!R)continue;let k=Math.max(0,m.contentMinX-u,u-m.contentMaxX),I=Math.max(0,m.contentMinY-y,y-m.contentMaxY),x=k+I;x<g&&(g=x,a=m);}}if(!a)continue;let l=Math.abs(o.x1-o.x2)<.5,c=Math.abs(o.y1-o.y2)<.5;l&&a.exactLeftX.push(Math.min(o.x1,o.x2)),c&&a.exactBottomY.push(Math.max(o.y1,o.y2));}let s=[];for(let o of n.values()){if(o.rows.size===0)continue;let a=o.exactLeftX.length>0||o.exactClipLeftX.length>0,l=a?Math.min(...o.exactLeftX,...o.exactClipLeftX):o.contentMinX-O,c=o.exactBottomY.length>0||o.exactClipBottomY.length>0?Math.max(...o.exactBottomY,...o.exactClipBottomY):o.contentMaxY,u=[...o.rows.entries()].map(([y,g])=>({rowIndex:y,top:g.top,bottom:g.bottom})).sort((y,g)=>y.rowIndex-g.rowIndex);s.push({pageIndex:e,tableKey:o.tableKey,docStartSample:o.docStartSample,originX:l,originY:o.contentMinY,bottomY:c,originExact:a,rowBands:u});}return s}function ni(e,t){let r=[],i=We(e,t,{kind:"body"});for(let n of e.pages)r.push(...ti(n.pageIndex,n.primitives,t,i));return r}function Qe(e,t){let r=t.kind??"body";if(r==="body")return {kind:r,primitives:e.primitives};let i=r==="header"?e.header:e.footer;return !i||i.kind!==r||t.rId&&i.rId!==t.rId?null:{kind:r,rId:i.rId,primitives:i.primitives}}function We(e,t,r){let i=new Map;for(let n of e.pages){let s=Qe(n,r);if(s)for(let o of s.primitives){if(!o.cell||!o.table?.tableId||o.docStart==null)continue;let a=t(o.docStart);if(a==null)continue;let l=i.get(o.table.tableId);(!l||o.docStart<l.docStartSample)&&i.set(o.table.tableId,{tableKey:a,docStartSample:o.docStart});}}return i}function Ke(e,t){return `${e}:${t}`}function ii(e,t,r,i){let n=Ke(t.row,t.col),s=e.cells.get(n);s?(s.minX=Math.min(s.minX,r.x),s.minY=Math.min(s.minY,r.y),s.maxX=Math.max(s.maxX,r.x+r.w),s.maxY=Math.max(s.maxY,r.y+r.h),s.rowSpan=Math.max(s.rowSpan,t.rowSpan),s.colSpan=Math.max(s.colSpan,t.colSpan),i&&(s.exactClip=i)):e.cells.set(n,{row:t.row,col:t.col,rowSpan:t.rowSpan,colSpan:t.colSpan,minX:r.x,minY:r.y,maxX:r.x+r.w,maxY:r.y+r.h,exactClip:i??void 0});}function Lt(e,t,r){let i=new Map;for(let n of e){if(n.kind==="line")continue;let s=n.cell;if(!s)continue;let o=bt(n,t,r);if(!o)continue;let a=o.tableKey,l=ht(n),c=i.get(a);c||(c={tableKey:a,contentMinX:l.x,contentMinY:l.y,contentMaxX:l.x+l.w,contentMaxY:l.y+l.h,cells:new Map,verticalLines:[],horizontalLines:[]},i.set(a,c)),c.contentMinX=Math.min(c.contentMinX,l.x),c.contentMinY=Math.min(c.contentMinY,l.y),c.contentMaxX=Math.max(c.contentMaxX,l.x+l.w),c.contentMaxY=Math.max(c.contentMaxY,l.y+l.h),ii(c,s,l,Je(n));}if(i.size===0)return [];for(let n of e){if(n.kind!=="line"||n.role!=="table-border"&&n.role!=="table-cut")continue;let s=Math.abs(n.x1-n.x2)<.5,o=Math.abs(n.y1-n.y2)<.5;if(!s&&!o)continue;let a=Math.min(n.x1,n.x2),l=Math.max(n.x1,n.x2),c=Math.min(n.y1,n.y2),u=Math.max(n.y1,n.y2),y=xt(n,r,i);if(y){s?y.verticalLines.push(a):y.horizontalLines.push(c);continue}for(let g of i.values())if(s){if(!(u>=g.contentMinY-q&&c<=g.contentMaxY+q))continue;let h=a;Math.max(0,g.contentMinX-h,h-g.contentMaxX)<=gt&&g.verticalLines.push(h);}else if(o){if(!(l>=g.contentMinX-q&&a<=g.contentMaxX+q))continue;let h=c;Math.max(0,g.contentMinY-h,h-g.contentMaxY)<=gt&&g.horizontalLines.push(h);}}return [...i.values()]}function ae(e){let t=[];for(let r of [...e].sort((i,n)=>i-n))(t.length===0||Math.abs(t[t.length-1]-r)>.5)&&t.push(r);return t}function Rt(e){let t=ae([...e.cells.values()].map(n=>n.row)),r=ae(e.horizontalLines),i=new Map;if(t.length>0&&r.length>=t.length+1)for(let n=0;n<t.length;n++)i.set(t[n],r[n]),i.set(t[n]+1,r[n+1]);return i}function $e(e){if(!e)return null;if(e.exactClip)return e.exactClip;let t=e.minX-O,r=e.minY-O;return {x:t,y:r,w:Math.max(1,e.maxX-e.minX+O*2),h:Math.max(1,e.maxY-e.minY+O*2)}}function ri(e,t){let r=1/0,i=-1/0;for(let n of e.cells.values())n.row===t&&(r=Math.min(r,n.exactClip?.y??n.minY-O),i=Math.max(i,n.exactClip?n.exactClip.y+n.exactClip.h:n.maxY+O));return !Number.isFinite(r)||!Number.isFinite(i)||i<=r?null:{top:r,bottom:i}}function oi(e,t,r){let i=$e(e.cells.get(Ke(t,r)));return i?{left:i.x,right:i.x+i.w,top:i.y,bottom:i.y+i.h}:null}function si(e,t,r,i={kind:"body"}){if(t.length===0)return [];let n=new Map;for(let a of t){let l=n.get(a.tableKey);l?l.push(a):n.set(a.tableKey,[a]);}let s=[],o=We(e,r,i);for(let a of e.pages){let l=Qe(a,i);if(!l)continue;let c=Lt(l.primitives,r,o);for(let u of c){let y=n.get(u.tableKey);if(!y)continue;let g=ae(u.verticalLines),m=Rt(u);for(let h of y){let R=u.cells.get(Ke(h.row,h.col)),k=g[h.col],I=g[h.col+h.colSpan],x=m.get(h.row),P=m.get(h.row+h.rowSpan),T=true;if(k==null||I==null||I<=k){let M=R?.exactClip??$e(R);if(!M)continue;k=M.x,I=M.x+M.w,T=R?.exactClip!=null;}if(x==null||P==null||P<=x){let M=R?.exactClip??$e(R);if(!M)continue;x=M.y,P=M.y+M.h,T&&(T=R?.exactClip!=null);}s.push({pageIndex:a.pageIndex,tableKey:u.tableKey,row:h.row,col:h.col,rowSpan:h.rowSpan,colSpan:h.colSpan,x:k,y:x,w:Math.max(1,I-k),h:Math.max(1,P-x),exact:T,region:l.kind,rId:l.rId});}}}return s}function ai(e){let{list:t,pageIndex:r,x:i,y:n,canvasRect:s,pageSize:o,tableKeyOf:a,cellPmPosOf:l,region:c={kind:"body"},edgeProximity:u=Vn}=e,y=t.pages[r];if(!y)return null;let g=Qe(y,c);if(!g)return null;let m=o.width>0?s.width/o.width:1,h=o.height>0?s.height/o.height:1,R=(x,P)=>({clientX:s.left+x*m,clientY:s.top+P*h}),k=We(t,a,c),I=Lt(g.primitives,a,k);for(let x of I){let P=ae(x.verticalLines),T=Rt(x),M=ae([...x.cells.values()].map(B=>B.row));if(M.length===0)continue;let Y=P[0]??x.contentMinX-O,z=P[P.length-1]??x.contentMaxX+O,w=T.get(M[0])??x.contentMinY-O,N=M[M.length-1],F=T.get(N+1)??x.contentMaxY+O,Z=i<Y+u&&i>=Y-u,le=n<w+u&&n>=w-u;if(!(!Z&&!le)){if(Z&&n>=w-u&&n<=F)for(let B of M){let ee=T.get(B),A=T.get(B+1),_=ee==null||A==null?ri(x,B):null,X=ee??_?.top,$=A??_?.bottom;if(X==null||$==null||$<=X||n<X||n>$)continue;let J=[...x.cells.values()].filter(Q=>Q.row===B).sort((Q,ce)=>Q.col-ce.col)[0];if(!J)continue;let j=l(x.tableKey,B,J.col);if(!j)continue;let te=R(Y,X+($-X)/2);return {type:"row",clientX:te.clientX-jn,clientY:te.clientY-Un,cellPmPos:j}}if(le&&i>=Y-u&&i<=z){let B=M[0],ee=[...x.cells.values()].filter(A=>A.row===B).sort((A,_)=>A.col-_.col);for(let A of ee){let _=P[A.col],X=P[A.col+A.colSpan],$=_==null||X==null?oi(x,A.row,A.col):null,J=_??$?.left,j=X??$?.right;if(J==null||j==null||j<=J||i<J||i>j)continue;let te=l(x.tableKey,A.row,A.col);if(!te)continue;let Q=R(J+(j-J)/2,w);return {type:"column",clientX:Q.clientX-qn,clientY:Q.clientY-Zn,cellPmPos:te}}}}}return null}var tr=Ue;export{Pn as CANVAS_PAGES_PADDING_PX,Mn as CANVAS_PAGE_GAP_PX,zn as DISPLAY_LIST_TABLE_INSERT_HIDE_DELAY_MS,D as MIRROR_CLASS_NAMES,V as RustDisplayListSourceError,sn as applyInteractiveSdtFocus,ln as buildInteractiveOverlayPage,Kt as buildMirrorPage,Rn as buildRustDisplayFrame,ft as buildRustDisplayList,oe as canvasPageTops,Dn as captureInlinePositionEmuFromDisplayList,Tn as computeA11yAnnouncements,Fn as computeAnchorPositionsFromDisplayList,Yn as computeAnchorPositionsFromYrs,En as createCanvasImageResolver,kn as createDisplayListQueries,Gn as createYrsSidebarProjection,tr as demoDisplayList,si as deriveDisplayListSelectedCellRects,ni as deriveDisplayListTableFragments,ai as detectDisplayListTableInsertHover,mt as encodeDisplayListFrameExtras,_n as extractTrackedChangesFromYrs,Kn as findDisplayListHyperlinkAtPoint,Ne as findImagePrimitiveAtPoint,Fe as findImagePrimitiveByDocPos,vn as isDisplayListQuerySourceDead,Wt as loadGlyphOutlineProvider,Ge as loadRustDisplayListQueryEngine,On as mergeHfAnchorPositionsFromDisplayList,In as onDisplayListQuerySourceFailure,An as snapshotFromSelectionContext,Xe as visitAnchorKeys,se as yrsIdToNumericId};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { RenderedDomContext, PositionCoordinates } from './index.mjs';
|
|
2
|
-
import { D as DisplayListRect, a as DisplayListQueries } from '../displayListQueries-
|
|
2
|
+
import { D as DisplayListRect, a as DisplayListQueries } from '../displayListQueries-DLzpvJV6.mjs';
|
|
3
3
|
import '../types/document.mjs';
|
|
4
|
-
import '../content-
|
|
5
|
-
import '../formatting-
|
|
4
|
+
import '../content-C3sTRz-u.mjs';
|
|
5
|
+
import '../formatting-BEkIBePP.mjs';
|
|
6
6
|
import '../docx/wrapTypes.mjs';
|
|
7
|
-
import '../styles-
|
|
8
|
-
import '../
|
|
9
|
-
import '../
|
|
7
|
+
import '../styles-BK3Jecxs.mjs';
|
|
8
|
+
import '../frameDelta-B2kC6XiP.mjs';
|
|
9
|
+
import '../rustDisplayList-B0M2eBkU.mjs';
|
|
10
|
+
import '../types-C1rv3KM-.mjs';
|
|
10
11
|
import '../layout/pagination/index.mjs';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Document } from '../types/document.mjs';
|
|
2
|
-
import '../content-
|
|
3
|
-
import '../formatting-
|
|
2
|
+
import '../content-C3sTRz-u.mjs';
|
|
3
|
+
import '../formatting-BEkIBePP.mjs';
|
|
4
4
|
import '../docx/wrapTypes.mjs';
|
|
5
|
-
import '../styles-
|
|
5
|
+
import '../styles-BK3Jecxs.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Framework-Agnostic Plugin Interface for the DOCX Editor
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SidebarItem, RenderedDomContext } from './index.mjs';
|
|
2
2
|
import '../types/document.mjs';
|
|
3
|
-
import '../content-
|
|
4
|
-
import '../formatting-
|
|
3
|
+
import '../content-C3sTRz-u.mjs';
|
|
4
|
+
import '../formatting-BEkIBePP.mjs';
|
|
5
5
|
import '../docx/wrapTypes.mjs';
|
|
6
|
-
import '../styles-
|
|
6
|
+
import '../styles-BK3Jecxs.mjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Pure layout algorithm: given a list of sidebar items + their
|