@silurus/ooxml 0.89.6 → 0.89.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/render-worker-Ck21oePL.js +16 -0
- package/dist/assets/render-worker-DJiGqgi0.js +15 -0
- package/dist/assets/render-worker-hPLJ82d2.js +35 -0
- package/dist/{bounded-raw-part-cache-B8t03tSP.js → bounded-raw-part-cache-B5a6cGKO.js} +1713 -1515
- package/dist/{canvas-viewer-mechanics-DI38gHNV.js → canvas-viewer-mechanics-BsqaoYgK.js} +2 -2
- package/dist/{cfb-guard-BIaHdonq.js → cfb-guard-DzYlucez.js} +1 -1
- package/dist/chart-ex.mjs +367 -367
- package/dist/{comment-overlay-controller-Crm5Syhx.js → comment-overlay-controller-B7AoyoDK.js} +18 -18
- package/dist/{comment-ui-runtime-hfewTmVJ.js → comment-ui-runtime-C5eWtZSW.js} +3 -3
- package/dist/{comment-ui-runtime-BfEPgl5r.js → comment-ui-runtime-CV0I9faV.js} +3 -3
- package/dist/{document-model-source-BUTSwkyP.js → document-model-source-90ext13g.js} +37 -37
- package/dist/{document-pull-client-C_D779tO.js → document-pull-client-DSYpUET2.js} +17525 -13847
- package/dist/{document-pull-worker-Bkewz-So.js → document-pull-worker-hMKJ5RdB.js} +14 -14
- package/dist/{docx-BfLZeiwa.js → docx-DCCDnwrG.js} +593 -593
- package/dist/{docx-BC2HQtjg.js → docx-G7pt7ajR.js} +33 -33
- package/dist/{docx-model-source-IjrOZgnl.js → docx-model-source-Beon3BD5.js} +6 -6
- package/dist/docx.mjs +4 -4
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{drawingml-shape-BcXkRayC.js → drawingml-shape-B1_kg4BV.js} +55 -55
- package/dist/{duotone-BI7CoghW.js → duotone-GK4Hqn7f.js} +1 -1
- package/dist/{emf-DgUBx9BU.js → emf--QWY-UlT.js} +50 -50
- package/dist/{font-preload-demand-B6HPFxDp.js → font-preload-demand-NqcVKIpX.js} +2 -2
- package/dist/{grid-geometry-CqTDvpDr.js → grid-geometry-DpMAiSZb.js} +1 -1
- package/dist/{host-layout-measure-DJvccDI3.js → host-layout-measure-Z2fIsmDw.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal-companion.mjs +2 -2
- package/dist/{line-distribute-DR9Qwd3u.js → line-distribute-CwtditQo.js} +31 -25
- package/dist/{model-source-DcI3vC00.js → model-source-Cch44xsb.js} +2 -2
- package/dist/{model-source-session-BlQWNyj2.js → model-source-session-ClNCRDOg.js} +21 -21
- package/dist/{model-source-session-D0LF49Ve.js → model-source-session-DRcqFGfM.js} +2 -2
- package/dist/{model-source-session-BCteVilS.js → model-source-session-DSABX94B.js} +2 -2
- package/dist/node.mjs +5 -5
- package/dist/{plot-area-frame-D3JtHvov.js → plot-area-frame-DNYMd9Pf.js} +1914 -1890
- package/dist/{pptx-SmjDGyub.js → pptx-C1CiFW1D.js} +35 -33
- package/dist/{pptx-CfCiVlNB.js → pptx-Ci1Y9SS_.js} +261 -259
- package/dist/{pptx-model-source-B2Irk68a.js → pptx-model-source-C9TuBisH.js} +18 -12
- package/dist/pptx-parsed-slides-BMGr4khe.js +8 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{presentation-model-source-DL6duh5l.js → presentation-model-source-3N7xLtmI.js} +6 -6
- package/dist/region-map.mjs +39 -39
- package/dist/{render-CMUEAeHp.js → render-Bf_Gywxw.js} +32 -30
- package/dist/{render-worker-host-CtlBbau5.js → render-worker-host-BZoh-wqR.js} +1 -1
- package/dist/{render-worker-host-D_0g-TQ2.js → render-worker-host-BmVeB_mR.js} +1 -1
- package/dist/{render-worker-host-DjBotZNL.js → render-worker-host-CVr53kg0.js} +1 -1
- package/dist/{renderer-IFuBkPvF.js → renderer-CCA_bQB8.js} +777 -707
- package/dist/renderer-DpTePxGq.js +5887 -0
- package/dist/{resource-measurement-D2bu0Qfx.js → resource-measurement-CfJtbwiR.js} +129 -129
- package/dist/{session-KIWcCCP2.js → session-DPXK_lpI.js} +64 -64
- package/dist/{slide-pull-client-BUuJQQVE.js → slide-pull-client-3g6TxaKa.js} +1421 -1421
- package/dist/{three-d-ByHGsYrX.js → three-d-BfMZVR0w.js} +98 -98
- package/dist/three-d.mjs +678 -678
- package/dist/types/chart-ex.d.ts +5 -2
- package/dist/types/docx.d.ts +29 -7
- package/dist/types/index.d.ts +34 -11
- package/dist/types/node.d.ts +27 -5
- package/dist/types/pptx.d.ts +11 -7
- package/dist/types/region-map.d.ts +5 -2
- package/dist/types/three-d.d.ts +5 -2
- package/dist/types/xlsx.d.ts +10 -7
- package/dist/{wasm-runtime-generation-BLweKv8r.js → wasm-runtime-generation-D97yoAXz.js} +17 -17
- package/dist/{workbook-model-source-DBfVsWj7.js → workbook-model-source-BHR8shXr.js} +6 -6
- package/dist/{worksheet-pull-client-Du0MuIro.js → worksheet-pull-client-BudfclVl.js} +84 -84
- package/dist/{xlsx-CD1VeDIg.js → xlsx-7aY3Pbvh.js} +44 -44
- package/dist/{xlsx-CCMRAxPB.js → xlsx-DTtDjzFq.js} +299 -299
- package/dist/{xlsx-model-source-udh7Q4WB.js → xlsx-model-source-DXKvb90T.js} +36 -36
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-B5HWxkbU.js +0 -16
- package/dist/assets/render-worker-Ba4LYMJd.js +0 -15
- package/dist/assets/render-worker-DkqinUC6.js +0 -35
- package/dist/renderer-xdugdcMd.js +0 -5769
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as e } from "./chunk-D5OxutzX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as v, t as y } from "./cfb-guard-
|
|
4
|
-
import {
|
|
5
|
-
import { f as
|
|
6
|
-
import { L as
|
|
7
|
-
import { i as
|
|
8
|
-
import { C as
|
|
9
|
-
import { A as
|
|
10
|
-
import { n as
|
|
11
|
-
import { _ as
|
|
2
|
+
import { Co as t, Er as n, Fa as r, Ia as i, Pa as a, Tr as o, Yn as s, a as c, c as l, d as u, h as d, m as f, o as p, r as m, u as h, wo as g, wr as _ } from "./plot-area-frame-DNYMd9Pf.js";
|
|
3
|
+
import { n as v, t as y } from "./cfb-guard-DzYlucez.js";
|
|
4
|
+
import { $ as b, $t as x, An as S, F as C, I as w, L as T, P as E, Q as D, Qt as O, St as k, W as A, Xt as j, at as M, bt as ee, ft as N, ht as P, it as te, jn as F, lt as ne, ot as re, p as I, t as ie, ut as L, vn as R, xt as ae, yt as oe } from "./bounded-raw-part-cache-B5a6cGKO.js";
|
|
5
|
+
import { f as z, u as se } from "./pixel-budget-DI82Hn3R.js";
|
|
6
|
+
import { L as ce, R as le, V as ue, n as de, t as fe } from "./renderer-DpTePxGq.js";
|
|
7
|
+
import { i as pe, t as me } from "./tiff-contract-DEd8CGuz.js";
|
|
8
|
+
import { C as he, D as ge, E as _e, S as ve, T as ye, _ as be, a as xe, b as Se, d as Ce, f as we, g as Te, h as Ee, m as De, o as Oe, p as ke, t as Ae, u as je, w as Me, x as Ne, y as Pe } from "./canvas-viewer-mechanics-BsqaoYgK.js";
|
|
9
|
+
import { A as Fe, B as Ie, C as Le, D as Re, E as ze, F as Be, H as Ve, I as He, L as Ue, M as B, N as We, O as Ge, P as Ke, R as qe, S as Je, T as Ye, V as Xe, _ as Ze, b as Qe, c as $e, d as et, f as tt, g as nt, h as rt, i as it, j as at, k as ot, l as st, m as ct, n as lt, o as ut, p as dt, r as ft, s as V, t as pt, u as mt, v as ht, w as gt, x as _t, y as vt, z as yt } from "./renderer-CCA_bQB8.js";
|
|
10
|
+
import { n as bt } from "./renderer-module-contract-BuTx2FWJ.js";
|
|
11
|
+
import { _ as xt, a as St, b as H, c as Ct, d as wt, f as Tt, g as Et, h as Dt, l as Ot, m as kt, n as At, o as jt, p as Mt, s as Nt, t as Pt, u as Ft, v as U, y as It } from "./worksheet-pull-client-BudfclVl.js";
|
|
12
12
|
import { n as Lt, r as Rt, t as zt } from "./visible-index-vN-4BNn7.js";
|
|
13
|
-
import { a as Bt, c as Vt, d as Ht, f as Ut, l as W, n as G, o as Wt, p as Gt, r as K, t as q, u as Kt } from "./grid-geometry-
|
|
13
|
+
import { a as Bt, c as Vt, d as Ht, f as Ut, l as W, n as G, o as Wt, p as Gt, r as K, t as q, u as Kt } from "./grid-geometry-DpMAiSZb.js";
|
|
14
14
|
var qt = "var e=(e,t)=>()=>(e&&(t=e(e=0)),t);function t(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var n,r,i=e((()=>{n=class e extends Error{code;details;constructor(t,n,r){super(n),this.name=`OoxmlError`,this.code=t,t===`unsupported-content`&&r&&(this.details=Object.freeze({format:r.format,reason:r.reason})),Object.setPrototypeOf(this,e.prototype)}},r=class e extends Error{code=`ooxml-resource-limit`;details;constructor(t,n){super(t),this.name=`OoxmlResourceLimitError`;let r=n.violation,i=Object.freeze({format:r.format,operation:r.operation,resource:r.resource,metric:r.metric,...r.part===void 0?{}:{part:r.part},limit:r.limit,observed:r.observed,configurable:r.configurable,usage:Object.freeze({archiveEntryCount:r.usage.archiveEntryCount,declaredInflatedBytes:r.usage.declaredInflatedBytes,...r.usage.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:r.usage.largestInflatedEntryBytes},distinctInflatedBytes:r.usage.distinctInflatedBytes,operationInflatedBytes:r.usage.operationInflatedBytes})});this.details=Object.freeze({stage:n.stage,violation:i}),Object.setPrototypeOf(this,e.prototype)}}}));function a(e){return e===`image-dimension`||e===`image-pixels`||e===`active-decoded-bytes`||e===`image-effect-count`||e===`image-effect-work`||e===`tiff-lzw-work`||e===`metafile-path-commands`||e===`metafile-record-points`||e===`metafile-record-polygons`||e===`metafile-record-rectangles`||e===`metafile-record-text-units`}function o(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function s(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,r=t.metric,i=t.limit,s=t.observed;return n!==`ooxml-decoded-image-limit`||!a(r)||!o(i)||!o(s)||s<=i?void 0:{metric:r,limit:i,observed:s}}catch{return}}var c,l,u,d,ee,te=e((()=>{c=1<<25,l=1<<27,c*4,l*4,u=Math.floor(c/4),d=l,d/u,ee=class e extends RangeError{metric;limit;observed;code=`ooxml-decoded-image-limit`;constructor(t,n,r){super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`),this.metric=t,this.limit=n,this.observed=r,this.name=`OoxmlDecodedImageLimitError`,Object.setPrototypeOf(this,e.prototype)}}}));function ne(e){if(!(typeof e!=`object`||!e))try{let t=e,n=t.code,r=t.message;return n===`ooxml-tiff-decode`&&typeof r==`string`?{message:r}:void 0}catch{return}}var re=e((()=>{}));function f(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function ie(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return f(t.requiredBytes)&&f(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var p=class e extends RangeError{code=`ooxml-insufficient-credit`;requiredBytes;offeredBytes;constructor(t){super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`),this.name=`PullSessionInsufficientCreditError`,this.requiredBytes=t.requiredBytes,this.offeredBytes=t.offeredBytes,Object.setPrototypeOf(this,e.prototype)}};function ae(e){if(e instanceof p)return e;let t=e instanceof Error?e.message:String(e);if(!t.startsWith(`OOXML_INSUFFICIENT_CREDIT:`))return;let n;try{n=JSON.parse(t.slice(26))}catch{return}if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n;if(!(r.code!==`ooxml-insufficient-credit`||!ie(r)))return new p(r)}i(),te(),re();const m=`OOXML_RESOURCE_LIMIT:`;function h(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function oe(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return h(t.archiveEntryCount)&&h(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||h(t.largestInflatedEntryBytes))&&h(t.distinctInflatedBytes)&&h(t.operationInflatedBytes)}function g(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{throw TypeError(`OOXML resource usage checkpoint is not valid JSON`)}if(!oe(t))throw TypeError(`OOXML resource usage checkpoint is invalid`);return t}function se(e){return e===`docx`||e===`xlsx`||e===`pptx`}function ce(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function _(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function v(e){return _(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function le(e){return!_(e,4096)||e.startsWith(`/`)||e.startsWith(`\\\\`)||e.includes(`\\\\`)||e.includes(`?`)||e.includes(`#`)||e.includes(`://`)||/^[a-z]:/iu.test(e)?!1:e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}const y=new Map([[`archive-entry:declared-inflated-bytes`,{stage:`container`,part:`required`}],[`archive-entry:actual-inflated-bytes`,{stage:`decompression`,part:`required`}],[`archive:entry-count`,{stage:`container`,part:`forbidden`}],[`archive:central-directory-bytes`,{stage:`container`,part:`forbidden`,configurable:!1}],[`archive:distinct-inflated-bytes`,{stage:`decompression`,part:`required`}],[`xml-event:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-context:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`image-effect:work`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:elements`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-cache:points`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`numbering-marker:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-style-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-custom-number-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-number-format-bytes:bytes`,{stage:`parsing`,part:`required`,configurable:!1}],[`xml-tree:depth`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-row:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-shell:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`theme-style-reparse:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`style-inheritance:depth`,{stage:`parsing`,part:`required`,configurable:!1}],[`complex-field:depth`,{stage:`parsing`,part:`forbidden`,configurable:!1}]]),ue=new Set([...y.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),de=new Set([...y.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function fe(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!se(t.format)||!_(t.operation,256)||!v(t.resource)||!v(t.metric)||!h(t.limit)||!h(t.observed)||typeof t.configurable!=`boolean`||!oe(t.usage)?!1:!(`part`in t)||le(t.part)}function b(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!ce(t.stage)||!fe(t.violation))return!1;let n=t.violation,r=y.get(`${n.resource}:${n.metric}`);return r?t.stage!==r.stage||r.configurable===!1&&n.configurable!==!1?!1:r.part===`required`?n.part!==void 0:r.part===`forbidden`?n.part===void 0:!0:!(ue.has(n.resource)&&de.has(n.metric))}function pe(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function me(e){if(!b(e))return;let t=e.violation,n={stage:e.stage,violation:{format:t.format,operation:t.operation,resource:t.resource,metric:t.metric,...t.part===void 0?{}:{part:t.part},limit:t.limit,observed:t.observed,configurable:t.configurable,usage:pe(t.usage)}};return b(n)?n:void 0}function x(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``} (${t.resource}, ${e.stage}): ${t.metric} ${t.observed} > ${t.limit}`}function S(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(m))return;let n;try{n=JSON.parse(t.slice(21))}catch{return}if(!n||typeof n!=`object`)return;let i=n;if(!(i.code!==`ooxml-resource-limit`||!b(i.details)))return new r(x(i.details),i.details)}function he(e){try{return e()}catch(e){throw e instanceof r||typeof e!=`string`&&!(e instanceof Error)?e:S(e)??e}}function ge(e){let t=e instanceof Error?e.message:String(e);if(t.startsWith(`OOXML_NOT_OOXML:`))return new n(`not-ooxml`,`This file is not an Office Open XML document: ${t.slice(16)}`)}function C(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.format,r=t.reason;if(!(!v(n)||r!==`source-subset`))return{format:n,reason:r}}function _e(e){return new n(`unsupported-content`,`Input is outside the source’s supported subset.`,e)}function ve(e){let t=typeof e==`string`?e:e instanceof Error?e.message:``;if(!(!t.startsWith(`MODEL_SOURCE_UNSUPPORTED:`)||t.length>1024))try{let e=C(JSON.parse(t.slice(25)));return e?_e(e):void 0}catch{return}}function ye(e){return e===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`||e instanceof Error&&e.message===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`?new n(`unsupported-encryption`,`The configured source cannot decrypt this input.`):ve(e)??S(e)??ge(e)}function be(e){let t=s(e);if(t){let e=new ee(t.metric,t.limit,t.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:t}}let i=ne(e);if(i)return{message:i.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let a=ae(e);if(a)return{message:a.message,errorName:a.name,code:a.code,insufficientCredit:{requiredBytes:a.requiredBytes,offeredBytes:a.offeredBytes}};let o=e instanceof n||e instanceof r?e:ye(e),c=o??e;if(o instanceof r||c&&typeof c==`object`&&c.code===`ooxml-resource-limit`){let e=c,t=me(e.details);return t?{message:typeof e.message==`string`?e.message:x(t),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:t}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(c&&typeof c==`object`&&c.code===`unsupported-content`){let e=C(c.details);return e?{message:_e(e).message,code:`unsupported-content`,unsupportedContent:e}:{message:`Invalid unsupported-content error payload`,errorName:`Error`}}if(o instanceof n)return{message:typeof o.message==`string`?o.message:String(o.message),errorName:_(o.name,128)?o.name:`OoxmlError`,...v(o.code)?{code:o.code}:{}};let l=e instanceof Error?e.message:String(e);if(typeof l==`string`&&l.startsWith(m))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let u=e instanceof Error?e:Error(l),d=u;return{message:typeof u.message==`string`?u.message:String(u.message),errorName:_(u.name,128)?u.name:`Error`,...typeof d.code==`string`?{code:d.code}:{}}}function w(e){try{return be(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}var xe=class{initialize;reinitialize;normalizeFailure;state=`uninitialized`;generationValue=0;readiness;poisonListeners=new Set;constructor(e,t,n){this.initialize=e,this.reinitialize=t,this.normalizeFailure=n}get generation(){return this.generationValue}get poisoned(){return this.state===`poisoned`}onPoison(e){return this.poisonListeners.add(e),()=>this.poisonListeners.delete(e)}async ensureReady(){if(this.state!==`ready`){if(!this.readiness){let e=this.state===`uninitialized`?this.initialize:this.reinitialize;this.readiness=Promise.resolve().then(e).then(()=>{this.generationValue+=1,this.state=`ready`,this.readiness=void 0},e=>{throw this.readiness=void 0,e})}await this.readiness}}run(e){try{return e()}catch(e){let t=this.normalizeFailure(e);throw t?(this.poison(t),t):e}}tryRunReady(e){if(this.state!==`ready`)return{current:!1};let t=this.generationValue,n=this.run(e);return this.state!==`ready`||t!==this.generationValue?{current:!1}:{current:!0,generation:t,value:n}}poison(e){this.state=`poisoned`,this.readiness=void 0;for(let t of this.poisonListeners)t(e)}assertCurrent(e){if(this.state!==`ready`||e!==this.generationValue)throw Error(`WASM archive session belongs to a discarded runtime generation`)}},T=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function Se(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function Ce(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}function we(e,t){return e({module_or_path:t})}var Te=class{init;options;runtime;wasmInput=null;currentArchive=null;constructor(e,t={}){this.init=e,this.options=t,this.runtime=new xe(()=>this.invokeConfigured(this.init),()=>this.invokeConfigured(this.options.reinit??this.init),Ee),this.runtime.onPoison(()=>this.dropPoisonedArchive())}setWasmInput(e){this.wasmInput=e,this.runtime.ensureReady().catch(()=>void 0)}setWasmUrl(e){this.setWasmInput(e)}get archive(){return this.currentArchive}setArchive(e){this.freeArchive(),this.currentArchive=e}disposeArchive(){this.freeArchive()}get poisoned(){return this.runtime.poisoned}async ensureReady(){await this.runtime.ensureReady()}run(e){return he(()=>this.runtime.run(e))}poison(){this.runtime.poison(new T(`WASM parser was recycled`))}invokeConfigured(e){return this.wasmInput===null?Promise.reject(Error(`WasmParserHost: setWasmInput was never called`)):we(e,this.wasmInput)}freeArchive(){this.currentArchive!==null&&this.options.freeArchive&&this.options.freeArchive(this.currentArchive),this.currentArchive=null}dropPoisonedArchive(){let e=this.currentArchive;this.currentArchive=null,Ce(e)}};function Ee(e){return Se(e)?new T(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`):null}function De(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer instanceof ArrayBuffer?e.buffer:e.slice().buffer}Object.freeze({maxArchiveEntryBytes:134217728,maxTotalInflatedBytes:268435456,maxArchiveEntries:4096});function Oe(e){return[e.maxArchiveEntryBytes===null?0n:BigInt(e.maxArchiveEntryBytes),e.maxTotalInflatedBytes===null?0n:BigInt(e.maxTotalInflatedBytes),e.maxArchiveEntries===null?0n:BigInt(e.maxArchiveEntries)]}const E=`ooxml-pull-v1`;function D(e,t){if(!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} must be a positive safe integer`)}function ke(e){if(!(typeof e==`string`&&e.length>0||typeof e==`number`&&Number.isSafeInteger(e)&&e>0))throw RangeError(`session id must be a non-empty string or positive safe integer`)}var Ae=class{owner;queue=Promise.resolve();leases=new Map;retainedBytes=0;retainedCount=0;maxRetainedBytes;maxRetainedCount;cleanups=new Set;pendingFatalCleanups=[];poisonRunning=!1;fatal;constructor(e){this.maxRetainedBytes=e?.maxRetainedBytes??64*1024*1024,this.maxRetainedCount=e?.maxRetainedCount??256,D(this.maxRetainedBytes,`max retained lease bytes`),D(this.maxRetainedCount,`max retained lease count`)}enqueue(e){let t=this.queue.then(e,e);return this.queue=t.then(()=>void 0,()=>void 0),t}acquire(e){return this.owner===void 0?(this.owner=e,!0):this.owner===e}release(e){this.owner===e&&(this.owner=void 0)}retainLease(e,t,n){if(!Number.isSafeInteger(n)||n<0)throw RangeError(`retained lease bytes are invalid`);let r=this.leases.get(e)??new Map;if(r.has(t))throw Error(`driver returned a duplicate lease id`);if(this.retainedCount+1>this.maxRetainedCount)throw RangeError(`retained lease count exceeds limit`);if(this.retainedBytes+n>this.maxRetainedBytes)throw RangeError(`retained lease bytes exceed limit`);r.set(t,n),this.leases.set(e,r),this.retainedCount++,this.retainedBytes+=n}releaseLease(e,t){let n=this.leases.get(e),r=n?.get(t);r!==void 0&&(n?.delete(t),n?.size===0&&this.leases.delete(e),this.retainedCount--,this.retainedBytes-=r)}registerCleanup(e){return this.fatal?(this.poisonRunning?this.pendingFatalCleanups.push(e):this.enqueue(e).catch(()=>void 0),()=>void 0):(this.cleanups.add(e),()=>this.cleanups.delete(e))}get fatalError(){return this.fatal}get registeredHostCount(){return this.cleanups.size}async poison(e){if(this.fatal??=e,this.poisonRunning)return this.fatal;this.poisonRunning=!0,this.pendingFatalCleanups.push(...this.cleanups);try{let e;for(;(e=this.pendingFatalCleanups.shift())!==void 0;)await e().catch(()=>void 0)}finally{this.poisonRunning=!1}return this.fatal}},je=class{options;coordinator;coordinatorOwner=Symbol(`pull-session-host`);unregisterCleanup;sequence=0;unacked;leases=new Map;activeDriverLeases=new Set;nextWireLeaseId;cancelRequested=!1;cancelComplete=!1;closeRequested=!1;closeComplete=!1;driverCancelComplete=!1;driverCloseComplete=!1;completed=!1;constructor(e){ke(e.sessionId),D(e.operationId,`operation id`),D(e.generation,`generation`),D(e.maxByteCredit,`max byte credit`),e.wireLeaseIdStart!==void 0&&D(e.wireLeaseIdStart,`wire lease id start`),this.options=e,this.coordinator=e.coordinator,this.nextWireLeaseId=e.wireLeaseIdStart??1,this.unregisterCleanup=this.coordinator.registerCleanup(()=>this.forceFatalCleanup())}dispatch(e,t){return this.coordinator.enqueue(async()=>{let n=await this.execute(e);try{t(n.response,n.transfer)}catch(e){throw await this.rollbackFailedPost(n),e}})}async rollbackFailedPost(e){let t=e.response;if(t.kind===`chunk`){let n=t.leaseId===void 0?void 0:this.leases.get(t.leaseId);try{await this.options.driver.disposeInvalidChunk?.({payload:t.payload,byteLength:t.byteLength,done:t.done,leaseId:n?.driverLeaseId,retainedBytes:n?.retainedBytes,transfer:e.transfer})}catch{}}this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);for(let[e,t]of[...this.leases])try{await this.options.driver.releaseLease?.(t.driverLeaseId)}catch{}finally{this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e)}if(this.cancelRequested=!0,!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch{}this.unregisterCleanup()}async execute(e){try{if(this.isStaleLifecycle(e)){let t=e.kind===`cancel`?`cancel`:`close`;return this.sameOperationIdentity(e)?{response:this.accepted(e,t,!0)}:{response:this.errorResponse(e,{message:`stale lifecycle targets another session or operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`})}}this.validateCommandIdentity(e);let t=this.coordinator.fatalError;if(t)return e.kind===`pull`?{response:this.errorResponse(e,t)}:(e.kind===`cancel`?await this.cancel():e.kind===`close`?await this.close():e.kind===`release`&&await this.release(e.leaseId),{response:this.accepted(e,e.kind)});switch(e.kind){case`pull`:return await this.pull(e);case`ack`:return await this.ack(e.sequence),{response:this.accepted(e,`ack`)};case`release`:return await this.release(e.leaseId),{response:this.accepted(e,`release`)};case`cancel`:return await this.cancel(),{response:this.accepted(e,`cancel`)};case`close`:return await this.close(),{response:this.accepted(e,`close`)}}}catch(t){let n=w(t);return n.code===`ooxml-resource-limit`&&(n=await this.coordinator.poison(n)),{response:this.errorResponse(e,n)}}}async pull(e){if(this.closeRequested||this.cancelRequested||this.completed)throw Error(`pull session is closed`);if(this.unacked)throw Error(`previous chunk is not acknowledged`);if(!Number.isSafeInteger(e.sequence)||e.sequence<0||e.sequence!==this.sequence)throw Error(`pull command sequence mismatch`);if(this.validateHostCredit(e.byteCredit),!this.coordinator.acquire(this.coordinatorOwner))throw Error(`another operation has an unacknowledged package chunk`);let t;try{t=await this.options.driver.pull(e.byteCredit)}catch(e){throw this.coordinator.release(this.coordinatorOwner),e}let n=!1,r=!1,i,a;try{let o=this.options.driver.measureChunk(t),s=this.arrayBufferTransferBytes(t.transfer);if(o<s)throw RangeError(`measured chunk bytes are below ArrayBuffer transfer bytes`);if(a=Math.max(o,s),t.leaseId!==void 0){if(D(t.leaseId,`lease id`),t.retainedBytes===void 0)throw Error(`retained lease bytes are required`);if(this.activeDriverLeases.has(t.leaseId))throw r=!0,Error(`driver returned an active duplicate lease id`);i=this.allocateWireLeaseId(),this.coordinator.retainLease(this.coordinatorOwner,i,t.retainedBytes),this.leases.set(i,{driverLeaseId:t.leaseId,retainedBytes:t.retainedBytes}),this.activeDriverLeases.add(t.leaseId),n=!0}else if(t.retainedBytes!==void 0)throw Error(`retained lease bytes require a lease id`);if(!Number.isSafeInteger(a)||a<0)throw RangeError(`host chunk byte length must be a non-negative safe integer`);if(a>e.byteCredit)throw RangeError(`host chunk exceeds byte credit`)}catch(e){let a;try{await this.options.driver.disposeInvalidChunk?.(t)}catch(e){a=e}if(n&&i!==void 0)try{await this.release(i)}catch(e){a??=e}else if(t.leaseId!==void 0&&!r)try{await this.options.driver.releaseLease?.(t.leaseId)}catch(e){a??=e}if(r)try{await this.cancel()}catch(e){a??=e}throw this.coordinator.release(this.coordinatorOwner),a||e}return this.unacked={sequence:this.sequence,done:t.done},{response:{kind:`chunk`,protocol:E,...this.identity(),requestId:e.requestId,sequence:this.sequence,byteLength:a,done:t.done,payload:t.payload,leaseId:i,usage:this.resourceUsage()},transfer:t.transfer}}async ack(e){if(!Number.isSafeInteger(e)||e<0)throw RangeError(`invalid ack sequence`);if(e<this.sequence)return;if(!this.unacked||e!==this.sequence)throw Error(`ack sequence mismatch`);let t=this.unacked.done;await this.options.driver.acknowledge?.(e),this.unacked=void 0,this.coordinator.release(this.coordinatorOwner),this.sequence++,t&&(this.completed=!0,this.maybeUnregisterCompleted())}async release(e){D(e,`wire lease id`);let t=this.leases.get(e);t&&(await this.options.driver.releaseLease?.(t.driverLeaseId),this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e),this.maybeUnregisterCompleted())}async cancel(){if(this.cancelComplete)return;this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.cancelComplete=!0,this.unregisterCleanup()}async close(){if(this.closeComplete)return;this.closeRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCloseComplete)try{await this.options.driver.close?.(),this.driverCloseComplete=!0}catch(t){e??=t}if(e)throw e;this.closeComplete=!0,this.unregisterCleanup()}async releaseAllLeases(){let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(e)throw e}validateCommandIdentity(e){if(e.protocol!==`ooxml-pull-v1`||e.sessionId!==this.options.sessionId||e.operationId!==this.options.operationId||e.generation!==this.options.generation||!Number.isSafeInteger(e.requestId)||e.requestId<=0)throw Error(`stale or mismatched pull session command`)}validateHostCredit(e){if(D(e,`byte credit`),e>this.options.maxByteCredit)throw RangeError(`byte credit exceeds host maximum`)}accepted(e,t,n=!1){return{kind:`accepted`,protocol:E,...n?{sessionId:e.sessionId,operationId:e.operationId,generation:e.generation}:this.identity(),requestId:e.requestId,command:t,usage:this.resourceUsage()}}identity(){return{sessionId:this.options.sessionId,operationId:this.options.operationId,generation:this.options.generation}}isStaleLifecycle(e){return(e.kind===`cancel`||e.kind===`close`)&&e.protocol===`ooxml-pull-v1`&&Number.isSafeInteger(e.requestId)&&e.requestId>0&&Number.isSafeInteger(e.generation)&&e.generation>0&&e.generation<this.options.generation}sameOperationIdentity(e){return e.sessionId===this.options.sessionId&&e.operationId===this.options.operationId}errorResponse(e,t){return{kind:`error`,protocol:E,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:t,usage:this.errorResourceUsage()}}async forceFatalCleanup(){this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.unregisterCleanup()}allocateWireLeaseId(){if(!Number.isSafeInteger(this.nextWireLeaseId)||this.nextWireLeaseId<=0)throw RangeError(`wire lease id space exhausted`);return this.nextWireLeaseId++}arrayBufferTransferBytes(e){let t=0;for(let n of e??[])if(n instanceof ArrayBuffer&&(t+=n.byteLength,!Number.isSafeInteger(t)))throw RangeError(`ArrayBuffer transfer bytes overflow`);return t}maybeUnregisterCompleted(){this.completed&&this.leases.size===0&&this.unregisterCleanup()}resourceUsage(){return this.options.driver.resourceUsage?.()}errorResourceUsage(){try{return this.resourceUsage()}catch{return}}};const O=2**53-1-1;function k(e){return Object.freeze({maxRows:e.maxRows,maxCells:e.maxCells,maxOwnedUtf8Bytes:e.maxOwnedUtf8Bytes,maxJsonBytes:e.maxJsonBytes})}const A=Object.freeze({worksheet:k({maxRows:1e5,maxCells:25e4,maxOwnedUtf8Bytes:33554432,maxJsonBytes:67108864}),cache:k({maxRows:2e5,maxCells:5e5,maxOwnedUtf8Bytes:67108864,maxJsonBytes:134217728}),maxCoordinateIndexEntries:25e4});function j(e,t){let n=e[t];if(n===void 0)return A.worksheet[t];if(typeof n!=`number`)throw TypeError(`xlsxWorksheetLimits.${t} must be a number`);if(!Number.isSafeInteger(n)||n<=0||n>O)throw RangeError(`xlsxWorksheetLimits.${t} must be a positive safe integer no greater than ${O}`);return n}function Me(e={}){let t=e.xlsxWorksheetLimits,n={};if(t!==void 0){if(typeof t!=`object`||!t||Array.isArray(t))throw TypeError(`xlsxWorksheetLimits must be a non-null, non-array object`);n=t}let r=k({maxRows:j(n,`maxRows`),maxCells:j(n,`maxCells`),maxOwnedUtf8Bytes:j(n,`maxOwnedUtf8Bytes`),maxJsonBytes:j(n,`maxJsonBytes`)}),i=A,a=k({maxRows:Math.max(i.cache.maxRows,r.maxRows),maxCells:Math.max(i.cache.maxCells,r.maxCells),maxOwnedUtf8Bytes:Math.max(i.cache.maxOwnedUtf8Bytes,r.maxOwnedUtf8Bytes),maxJsonBytes:Math.max(i.cache.maxJsonBytes,r.maxJsonBytes)});return Object.freeze({worksheet:r,cache:a,maxCoordinateIndexEntries:Math.max(i.maxCoordinateIndexEntries,r.maxCells)})}function Ne(e){let{worksheet:t}=e;return[BigInt(t.maxRows),BigInt(t.maxCells),BigInt(t.maxOwnedUtf8Bytes),BigInt(t.maxJsonBytes)]}var M=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),e}free(){let e=this.__destroy_into_raw();K.__wbg_xlsxarchive_free(e,0)}acknowledge_sheet_cursor_terminal(){let e=K.xlsxarchive_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);if(e[1])throw V(e[0])}assert_healthy(){let e=K.xlsxarchive_assert_healthy(this.__wbg_ptr);if(e[1])throw V(e[0])}cancel_sheet_cursor(){K.xlsxarchive_cancel_sheet_cursor(this.__wbg_ptr)}close_sheet_cursor(){K.xlsxarchive_close_sheet_cursor(this.__wbg_ptr)}extract_image(e){let t=B(e,K.__wbindgen_malloc,K.__wbindgen_realloc),n=G,r=K.xlsxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw V(r[2]);var i=P(r[0],r[1]).slice();return K.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t,n,r){let i=Ie(e,K.__wbindgen_malloc),a=G,o=K.xlsxarchive_new(i,a,!z(t),z(t)?BigInt(0):t,!z(n),z(n)?BigInt(0):n,!z(r),z(r)?BigInt(0):r);if(o[2])throw V(o[1]);return this.__wbg_ptr=o[0]>>>0,N.register(this,this.__wbg_ptr,this),this}open_sheet_cursor(e,t){let n=B(t,K.__wbindgen_malloc,K.__wbindgen_realloc),r=G,i=K.xlsxarchive_open_sheet_cursor(this.__wbg_ptr,e,n,r);if(i[1])throw V(i[0])}parse(){let e=K.xlsxarchive_parse(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}pull_sheet_cursor(e){let t=K.xlsxarchive_pull_sheet_cursor(this.__wbg_ptr,e);if(t[3])throw V(t[2]);var n=P(t[0],t[1]).slice();return K.__wbindgen_free(t[0],t[1]*1,1),n}resource_usage(){let e=K.xlsxarchive_resource_usage(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}set_worksheet_limits(e,t,n,r){let i=K.xlsxarchive_set_worksheet_limits(this.__wbg_ptr,e,t,n,r);if(i[1])throw V(i[0])}sheet_cursor_pull_finished(){return K.xlsxarchive_sheet_cursor_pull_finished(this.__wbg_ptr)!==0}sheet_cursor_resource_usage(){let e=K.xlsxarchive_sheet_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=K.xlsxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,V(i[2]);return e=n,t=r,I(n,r)}finally{K.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(M.prototype[Symbol.dispose]=M.prototype.free);function Pe(){return{__proto__:null,\"./xlsx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(I(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(I(e,t))}finally{K.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=B(n,K.__wbindgen_malloc,K.__wbindgen_realloc),i=G;Fe().setInt32(e+4,i,!0),Fe().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return I(e,t)},__wbindgen_init_externref_table:function(){let e=K.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const N=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>K.__wbg_xlsxarchive_free(e>>>0,1));function P(e,t){return e>>>=0,R().subarray(e/1,e/1+t)}let F=null;function Fe(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==K.memory.buffer)&&(F=new DataView(K.memory.buffer)),F}function I(e,t){return e>>>=0,Le(e,t)}let L=null;function R(){return(L===null||L.byteLength===0)&&(L=new Uint8Array(K.memory.buffer)),L}function z(e){return e==null}function Ie(e,t){let n=t(e.length*1,1)>>>0;return R().set(e,n/1),G=e.length,n}function B(e,t,n){if(n===void 0){let n=W.encode(e),r=t(n.length,1)>>>0;return R().subarray(r,r+n.length).set(n),G=n.length,r}let r=e.length,i=t(r,1)>>>0,a=R(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=R().subarray(i+o,i+r),a=W.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return G=o,i}function V(e){let t=K.__wbindgen_externrefs.get(e);return K.__externref_table_dealloc(e),t}let H=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});H.decode();let U=0;function Le(e,t){return U+=t,U>=2146435072&&(H=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),H.decode(),U=t),H.decode(R().subarray(e,e+t))}const W=new TextEncoder;`encodeInto`in W||(W.encodeInto=function(e,t){let n=W.encode(e);return t.set(n),{read:e.length,written:n.length}});let G=0,K;function Re(e,t){return K=e.exports,F=null,L=null,K.__wbindgen_start(),K}async function ze(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function Be(e){if(K!==void 0)return K;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let t=Pe();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await ze(await e,t);return Re(n,r)}async function Ve(e){return K=void 0,F=null,L=null,Be(e)}function He(e,t){return{workbook:e(),usage:g(t())}}function Ue(e,t){for(let n of e)for(let e of n.cells){let n=e.value;if(n.type===`shared`){let r=t[n.si];if(r){let t={type:`text`,text:r.text};r.runs!==void 0&&(t.runs=r.runs),r.phoneticRuns!==void 0&&(t.phoneticRuns=r.phoneticRuns),r.phoneticPr!==void 0&&(t.phoneticPr=r.phoneticPr),e.value=t}else e.value={type:`text`,text:``}}}return e}const We=new Set([`outline`,`merge`,`conditional-format`,`ancillary-content`,`metadata-unavailable`,`unordered-rows`]);function Ge(e,t,n,r){let i=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=JSON.parse(new TextDecoder().decode(i));if(!a||typeof a!=`object`||!(`kind`in a))throw Error(`worksheet cursor returned an invalid unit`);let o=a;if(t!==(o.kind===`finished`))throw Error(`worksheet cursor terminal marker mismatch`);if(o.kind===`rows`){if(!Array.isArray(o.rows))throw Error(`worksheet row unit is missing rows`);return n&&Ue(o.rows,n),r?.(o.rows),{kind:`rows`,rows:o.rows}}if(o.kind===`preview`){if(!Number.isSafeInteger(o.maxRow)||!Number.isSafeInteger(o.maxCol)||o.maxRow<0||o.maxCol<0||o.worksheet===null==(o.reason===null)||o.worksheet!==null&&(typeof o.worksheet!=`object`||Array.isArray(o.worksheet))||o.reason!==null&&!We.has(o.reason))throw Error(`worksheet preview unit is invalid`);return o.worksheet&&(o.worksheet.rows=[]),o}if(o.kind===`finished`){if(!o.worksheet||typeof o.worksheet!=`object`)throw Error(`worksheet terminal unit is missing its worksheet`);return o.worksheet.rows=[],{kind:`finished`,worksheet:o.worksheet}}throw Error(`worksheet cursor returned an unknown unit kind`)}const Ke=new WeakMap;function qe(e,t){Ke.set(e,t)}function q(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function J(e,t,n){return q(e,`resource measurement`),q(t,`resource measurement`),q(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function Je(e,t=2**53-1){q(t,`resource measurement limit`);let n=0;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=3}else a=3;if(n=J(n,a,t),n>t)return n}return n}function Ye(e,t=2**53-1){q(t,`resource measurement limit`);let n=J(0,2,t);if(n>t)return n;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i===34||i===92||i===8||i===9||i===10||i===12||i===13)a=2;else if(i<=31)a=6;else if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=6}else a=i>=55296&&i<=57343?6:3;if(n=J(n,a,t),n>t)return n}return n}function Y(e,t){return J(0,e,t)}function X(e,t=2**53-1,n=!1){if(q(t,`resource measurement limit`),e===null)return{jsonBytes:Y(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:Ye(e,t),stringValueUtf8Bytes:Je(e,t)};if(typeof e==`boolean`)return{jsonBytes:Y(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:Y((Number.isFinite(e)?String(Object.is(e,-0)?0:e):`null`).length,t),stringValueUtf8Bytes:0};if(typeof e==`bigint`)throw TypeError(`BigInt values cannot be serialized to JSON`);if(Array.isArray(e)){let n=Y(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=J(n,1,t));let a=X(e[i],t,!0);n=J(n,a.jsonBytes,t),r=J(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=Y(2,t),r=0,i=0;for(let[a,o]of Object.entries(e)){if(o===void 0||typeof o==`function`||typeof o==`symbol`)continue;i++!==0&&(n=J(n,1,t)),n=J(n,Ye(a,t),t),n=J(n,1,t);let e=X(o,t);n=J(n,e.jsonBytes,t),r=J(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?Y(4,t):0,stringValueUtf8Bytes:0}}i();const Xe=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function Ze(e,t=A){let{maxCells:n,maxOwnedUtf8Bytes:r}=t.worksheet,i=e.reduce((e,t)=>J(e,t.cells.length,n),0);return{rows:e.length,cells:i,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=X(t.value,r).stringValueUtf8Bytes;return J(e,J(n,t.formula===void 0?0:Je(t.formula,r),r),r)},e),0)}}function Qe(e,t,n=A){let r=X(e,n.worksheet.maxJsonBytes);return{...t,jsonBytes:r.jsonBytes}}function $e(e,t,n=A){let r=n.worksheet;return{rows:J(e.rows,t.rows,r.maxRows),cells:J(e.cells,t.cells,r.maxCells),ownedUtf8Bytes:J(e.ownedUtf8Bytes,t.ownedUtf8Bytes,r.maxOwnedUtf8Bytes)}}function et(e,t,n,i,a,o,s,c=n!==`delimited-text-source`){let l=n===`worksheet-json`?`serialization`:`parsing`;return new r(x({stage:l,violation:{part:t,resource:n,metric:i,observed:o,limit:a}}),{stage:l,violation:{format:`xlsx`,operation:e,resource:n,metric:i,...t===void 0?{}:{part:t},limit:a,observed:Math.min(o,a+1),configurable:c,usage:s??Xe}})}function tt(e,t,n,r,i=A){let a=i.worksheet,o=[[`rows`,e.rows,a.maxRows],[`cells`,e.cells,a.maxCells],[`owned-utf8-bytes`,e.ownedUtf8Bytes,a.maxOwnedUtf8Bytes]];for(let[e,i,a]of o)if(i>a)throw et(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,a,i,r)}function nt(e,t,n,r,i=A){let a=i.worksheet.maxJsonBytes;if(e>a)throw et(t,n,`worksheet-json`,`bytes`,a,e,r)}i();var rt=class{archive;acceptWorksheet;executeArchive;prepareRows;provisional;worksheetPolicy;coordinator=new Ae;sessions=new Map;operationTail=Promise.resolve();pendingOpens=new Map;resourceFailure;constructor(e,t,n=e=>e(this.requireArchive()),r,i,a=()=>A){this.archive=e,this.acceptWorksheet=t,this.executeArchive=n,this.prepareRows=r,this.provisional=i,this.worksheetPolicy=a}reserveOpen(e){this.pendingOpens.set(e.sessionId,{identity:e,canceled:!1})}abandonOpen(e){this.pendingOpens.delete(e)}get pendingOpenCount(){return this.pendingOpens.size}runDuringPull(e){return this.sessions.size===0?this.run(e):this.coordinator.enqueue(async()=>{if(this.resourceFailure)throw this.resourceFailure;try{return e()}catch(e){throw e instanceof r&&(this.resourceFailure??=e),e}})}async open(e,t,n){if(this.resourceFailure)throw this.resourceFailure;let i=this.pendingOpens.get(n.sessionId);if(!i||i.identity.operationId!==n.operationId||i.identity.generation!==n.generation)throw Error(`worksheet pull session open reservation is stale or missing`);let a=this.worksheetPolicy(),o,s=new Promise(e=>{o=e}),c=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(i.canceled)throw Error(`worksheet pull session open was canceled`);this.executeArchive(n=>n.open_sheet_cursor(e,t));let s=[],c={rows:0,cells:0,ownedUtf8Bytes:0},l,u=!1,d=new je({...n,maxByteCredit:67108864,coordinator:this.coordinator,driver:{pull:()=>{let t=this.executeArchive(e=>e.pull_sheet_cursor(128)),n=this.executeArchive(e=>e.sheet_cursor_pull_finished());if(this.acceptWorksheet){let i=Ge(t,n,void 0,this.prepareRows);try{if(i.kind===`preview`)i.worksheet&&(i.worksheet.rows=s,qe(i.worksheet,a),this.provisional?.preview(e,i.worksheet));else if(i.kind===`rows`){let e=$e(c,Ze(i.rows,a),a);tt(e,`get-worksheet-worker`,void 0,this.readResourceUsage(),a),s.push(...i.rows),c=e}else i.kind===`finished`&&(l=i.worksheet)}catch(e){throw e instanceof r&&(this.resourceFailure??=e),e}}u=n;let i=De(t);return{payload:i,byteLength:i.byteLength,done:n,transfer:[i]}},measureChunk:({payload:e})=>e.byteLength,acknowledge:()=>{if(!u)return;let t,i;try{if(this.acceptWorksheet){if(!l)throw Error(`worksheet terminal payload is missing`);l.rows=l.parseError?[]:s;let n=l.parseError?{rows:0,cells:0,ownedUtf8Bytes:0}:c,r=Qe(l,n,a),o=this.readResourceUsage();tt(r,`get-worksheet-worker`,void 0,o,a),nt(r.jsonBytes,`get-worksheet-worker`,void 0,o,a),qe(l,a);let u=this.acceptWorksheet(e,l,r,o);typeof u==`function`?t=u:u&&({rollback:t,commit:i}=u)}this.executeArchive(e=>e.acknowledge_sheet_cursor_terminal()),i?.()}catch(e){throw t?.(),e instanceof r&&(this.resourceFailure??=e),e}u=!1,this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()},cancel:()=>{try{this.archive()&&this.executeArchive(e=>e.cancel_sheet_cursor())}finally{this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()}},close:()=>{try{this.archive()&&this.executeArchive(e=>e.close_sheet_cursor())}finally{this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()}},resourceUsage:()=>this.readResourceUsage()}});this.sessions.set(n.sessionId,{host:d,identity:n}),this.pendingOpens.delete(n.sessionId)}));this.operationTail=c.then(()=>s,()=>void 0);try{await c}catch(e){throw this.pendingOpens.delete(n.sessionId),o(),e}}async postOpenedSafely(e,t,n){try{t()}catch(t){await this.closeIdentity(e);try{n(t)}catch{}}}dispatch(e,t){let n=this.sessions.get(e.sessionId);if(n)return n.host.dispatch(e,t);let r=this.pendingOpens.get(e.sessionId);if(r&&(e.kind===`cancel`||e.kind===`close`)){let n=r.identity.operationId===e.operationId&&r.identity.generation===e.generation;return n&&(r.canceled=!0),t(n?{protocol:E,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}:{protocol:E,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:{message:`stale lifecycle targets another pending worksheet operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`}}),Promise.resolve()}return e.kind===`cancel`||e.kind===`close`?(t({protocol:E,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}),Promise.resolve()):(t({protocol:E,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:w(Error(`worksheet pull session is not open`))}),Promise.resolve())}async dispatchSafely(e,t){try{await this.dispatch(e,t)}catch(n){try{t({protocol:E,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:w(n)})}catch{}}}run(e){let t=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(this.resourceFailure)throw this.resourceFailure;return e()})).catch(e=>{throw e instanceof r&&(this.resourceFailure??=e),e});return this.operationTail=t.then(()=>void 0,()=>void 0),t}async reset(){for(let e of this.pendingOpens.values())e.canceled=!0;let e=1;for(let{host:t,identity:n}of[...this.sessions.values()])await t.dispatch({protocol:E,kind:`close`,...n,requestId:e++},()=>void 0);this.sessions.clear(),await this.operationTail,this.pendingOpens.clear(),this.resourceFailure=void 0}requireArchive(){let e=this.archive();if(!e)throw Error(`Workbook not loaded`);return e}async closeIdentity(e){let t=this.sessions.get(e.sessionId);if(t){await t.host.dispatch({protocol:E,kind:`close`,...e,requestId:1},()=>void 0);return}let n=this.pendingOpens.get(e.sessionId);n&&n.identity.operationId===e.operationId&&n.identity.generation===e.generation&&(n.canceled=!0)}readResourceUsage(){return g(this.executeArchive(e=>e.sheet_cursor_resource_usage()))}};function it(e){return!!e&&typeof e==`object`&&e.protocol===`ooxml-pull-v1`}const Z=new Te(Be,{freeArchive:e=>e.free(),reinit:Ve});let Q=A;const $=new rt(()=>Z.archive,void 0,e=>{let t=Z.archive;if(!t)throw Error(`Workbook not loaded`);return Z.run(()=>e(t))},void 0,void 0,()=>Q);self.onmessage=async e=>{let n=e.data;if(it(n)){await $.dispatchSafely(n,(e,t)=>self.postMessage(e,t));return}if(n.type===`init`){Z.setWasmInput(t(n.wasmUrl)??n.wasmUrl);return}let r=n.id;n.type===`openSheetSession`&&$.reserveOpen(n);try{let e=n.type===`parse`?Me({xlsxWorksheetLimits:n.worksheetPolicy?.worksheet}):void 0;if(n.type===`openSheetSession`){await Z.ensureReady(),Z.archive&&Z.run(()=>Z.archive?.assert_healthy()),await $.open(n.sheetIndex,n.sheetName,n),await $.postOpenedSafely(n,()=>self.postMessage({type:`sheetSessionOpened`,id:r,sessionId:n.sessionId,operationId:n.operationId,generation:n.generation}),e=>self.postMessage({type:`error`,id:r,...w(e)}));return}n.type===`parse`&&await $.reset(),await(n.type===`extractImage`?$.runDuringPull:$.run).call($,async()=>{if(await Z.ensureReady(),n.type!==`parse`&&Z.archive){let e=Z.archive;Z.run(()=>e.assert_healthy())}if(n.type===`parse`){let[t,i,a]=Oe(n.resourcePolicy),o=new Uint8Array(n.data);Q=e??A;let s=Ne(Q),{workbook:c,usage:l}=He(()=>Z.run(()=>{let e=new M(o,t,i,a);return Z.setArchive(e),e.set_worksheet_limits(...s),e.parse()}),()=>Z.run(()=>Z.archive.resource_usage())),u=c.buffer,d={type:`parsed`,id:r,workbookJson:u,usage:l};self.postMessage(d,[u]);return}let t=Z.archive;if(n.type===`extractImage`){if(!t)throw Error(`No xlsx loaded`);let e=Z.run(()=>t.extract_image(n.path).buffer),i={type:`imageExtracted`,id:r,bytes:e};self.postMessage(i,[e]);return}if(n.type===`resourceUsage`){if(!t)throw Error(`No xlsx loaded`);let e=Z.run(()=>g(t.resource_usage()));self.postMessage({type:`resourceUsage`,id:r,usage:e});return}if(n.type===`toMarkdown`){if(!t)throw Error(`No xlsx loaded`);let e={type:`markdownRendered`,id:r,markdown:Z.run(()=>t.to_markdown())};self.postMessage(e);return}})}catch(e){n.type===`openSheetSession`&&$.abandonOpen(n.sessionId);let t={type:`error`,id:r,...w(e)};try{self.postMessage(t)}catch{}}};", Jt = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", qt], { type: "text/javascript;charset=utf-8" });
|
|
15
15
|
function Yt(e) {
|
|
16
16
|
let t;
|
|
@@ -74,7 +74,7 @@ function an(e, t, n) {
|
|
|
74
74
|
e.set(t, r ? rn(r, n) : n);
|
|
75
75
|
}
|
|
76
76
|
function on(e, t, n, r) {
|
|
77
|
-
let { col: i, row: a } = (n ??
|
|
77
|
+
let { col: i, row: a } = (n ?? V(t)).axesAtScale(r), o = Fe(t, e, i, a, r);
|
|
78
78
|
return o.width > 0 && o.height > 0 ? {
|
|
79
79
|
width: o.width,
|
|
80
80
|
height: o.height
|
|
@@ -100,9 +100,9 @@ function ln(e, t) {
|
|
|
100
100
|
}
|
|
101
101
|
function un(e, t, n, r, i, a = sn) {
|
|
102
102
|
if (!n || a === null) return e.anchorTag === void 0 || on(e, t, r, i?.scale ?? 1) !== null;
|
|
103
|
-
let o = r ??
|
|
103
|
+
let o = r ?? V(t), s = i?.scale ?? 1, { col: c, row: l } = o.axesAtScale(s), u = Fe(t, e, c, l, s);
|
|
104
104
|
if (u.width <= 0 || u.height <= 0) return !1;
|
|
105
|
-
let d = u.width * a.x, f = u.height * a.y, p =
|
|
105
|
+
let d = u.width * a.x, f = u.height * a.y, p = Le({
|
|
106
106
|
x: u.x - d,
|
|
107
107
|
y: u.y - f,
|
|
108
108
|
width: u.width + 2 * d,
|
|
@@ -128,63 +128,63 @@ async function dn(e, t, r, i, a = 0, o = 0, s = null, c = null, l, u = !1, d, f,
|
|
|
128
128
|
let h = t === "image/svg+xml", v = c && "effects" in c ? s && !n(s) ? null : {
|
|
129
129
|
widthPt: a,
|
|
130
130
|
heightPt: o
|
|
131
|
-
} :
|
|
131
|
+
} : _(t, s, a, o);
|
|
132
132
|
if (!v) return null;
|
|
133
|
-
let y = () =>
|
|
133
|
+
let y = () => te(e, t, c, i, {
|
|
134
134
|
widthPt: v.widthPt,
|
|
135
135
|
heightPt: v.heightPt,
|
|
136
136
|
offscreenFactory: l,
|
|
137
137
|
failClosedOnDuotoneFailure: u,
|
|
138
138
|
tiff: d,
|
|
139
|
-
svgDecoder: p ?? (typeof Image < "u" ?
|
|
139
|
+
svgDecoder: p ?? (typeof Image < "u" ? ee : void 0),
|
|
140
140
|
...f ?? {},
|
|
141
141
|
...m ? { maxRetainedPixels: m } : {}
|
|
142
142
|
}), b = {
|
|
143
143
|
svgImagePath: r,
|
|
144
144
|
srcRect: s
|
|
145
145
|
};
|
|
146
|
-
if (!c &&
|
|
147
|
-
return await
|
|
146
|
+
if (!c && M(b)) try {
|
|
147
|
+
return await L(b.svgImagePath, i, {
|
|
148
148
|
...f,
|
|
149
149
|
maxRetainedPixels: m,
|
|
150
150
|
workerDecoder: p
|
|
151
151
|
});
|
|
152
152
|
} catch (t) {
|
|
153
|
-
if (t instanceof
|
|
154
|
-
return h ?
|
|
153
|
+
if (t instanceof g || z(t)) throw t;
|
|
154
|
+
return h ? L(e, i, {
|
|
155
155
|
...f,
|
|
156
156
|
maxRetainedPixels: m,
|
|
157
157
|
workerDecoder: p
|
|
158
158
|
}) : y();
|
|
159
159
|
}
|
|
160
|
-
return h && c ? y() : h ?
|
|
160
|
+
return h && c ? y() : h ? L(e, i, {
|
|
161
161
|
...f,
|
|
162
162
|
maxRetainedPixels: m,
|
|
163
163
|
workerDecoder: p
|
|
164
164
|
}) : y();
|
|
165
165
|
}
|
|
166
|
-
async function fn(e, n,
|
|
167
|
-
if (n.clear(),
|
|
168
|
-
let v =
|
|
169
|
-
width:
|
|
170
|
-
height:
|
|
171
|
-
scale:
|
|
172
|
-
freezeRows:
|
|
173
|
-
freezeCols:
|
|
166
|
+
async function fn(e, n, s, _) {
|
|
167
|
+
if (n.clear(), gt(n), !s) return;
|
|
168
|
+
let v = s, y = /* @__PURE__ */ new Map(), b = _?.viewport ? V(e) : void 0, x = _?.viewport && _.width !== void 0 && _.height !== void 0 ? {
|
|
169
|
+
width: _.width,
|
|
170
|
+
height: _.height,
|
|
171
|
+
scale: _.cellScale ?? 1,
|
|
172
|
+
freezeRows: _.freezeRows ?? e.freezeRows ?? 0,
|
|
173
|
+
freezeCols: _.freezeCols ?? e.freezeCols ?? 0
|
|
174
174
|
} : void 0;
|
|
175
|
-
if (e.images) for (let
|
|
176
|
-
if (!un(
|
|
177
|
-
let
|
|
178
|
-
an(y,
|
|
179
|
-
imagePath:
|
|
180
|
-
mimeType:
|
|
181
|
-
svgImagePath:
|
|
182
|
-
widthPt:
|
|
183
|
-
heightPt:
|
|
184
|
-
srcRect:
|
|
185
|
-
duotone:
|
|
175
|
+
if (e.images) for (let t of e.images) {
|
|
176
|
+
if (!un(t, e, _?.viewport, b, x, ((e) => cn(t.blipEffects, e.cx, e.cy, e.cx, e.cy))(mt(t)))) continue;
|
|
177
|
+
let n = on(t, e, b, _?.cellScale ?? 1), i = mt(t), s = tt(t, i), c = t.blipEffects?.length ? it(i) : null;
|
|
178
|
+
an(y, et(t.imagePath, s, i), {
|
|
179
|
+
imagePath: t.imagePath,
|
|
180
|
+
mimeType: t.mimeType,
|
|
181
|
+
svgImagePath: t.svgImagePath,
|
|
182
|
+
widthPt: c ? c.widthPt : t.anchorTag === void 0 ? t.nativeExtCx > 0 ? t.nativeExtCx / a : 0 : (n?.width ?? 0) * (r / a),
|
|
183
|
+
heightPt: c ? c.heightPt : t.anchorTag === void 0 ? t.nativeExtCy > 0 ? t.nativeExtCy / a : 0 : (n?.height ?? 0) * (r / a),
|
|
184
|
+
srcRect: t.srcRect ?? null,
|
|
185
|
+
duotone: s,
|
|
186
186
|
...(() => {
|
|
187
|
-
let e =
|
|
187
|
+
let e = n && _?.effectiveDpr ? o(n.width * _.effectiveDpr, n.height * _.effectiveDpr, t.srcRect) : null;
|
|
188
188
|
return e ? {
|
|
189
189
|
targetWidthPx: e.width,
|
|
190
190
|
targetHeightPx: e.height
|
|
@@ -193,19 +193,19 @@ async function fn(e, n, i, g) {
|
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
if (e.shapeGroups) {
|
|
196
|
-
for (let
|
|
197
|
-
for (let
|
|
198
|
-
let
|
|
199
|
-
an(y,
|
|
200
|
-
imagePath:
|
|
201
|
-
mimeType:
|
|
202
|
-
svgImagePath:
|
|
203
|
-
widthPt:
|
|
204
|
-
heightPt:
|
|
205
|
-
srcRect:
|
|
206
|
-
duotone:
|
|
196
|
+
for (let t of e.shapeGroups) if (un(t, e, _?.viewport, b, x, t.shapes.reduce((e, n) => n.geom?.type === "image" ? ln(e, cn(n.geom.blipEffects, t.nativeExtCx * n.w, t.nativeExtCy * n.h, t.nativeExtCx, t.nativeExtCy)) : e, sn))) {
|
|
197
|
+
for (let n of t.shapes) if (n.geom.type === "image") {
|
|
198
|
+
let i = on(t, e, b, _?.cellScale ?? 1), s = $e(t, n), c = tt(n.geom, s), l = n.geom.blipEffects?.length ? it(s) : null;
|
|
199
|
+
an(y, et(n.geom.imagePath, c, s), {
|
|
200
|
+
imagePath: n.geom.imagePath,
|
|
201
|
+
mimeType: n.geom.mimeType,
|
|
202
|
+
svgImagePath: n.geom.svgImagePath,
|
|
203
|
+
widthPt: l ? l.widthPt : t.anchorTag === void 0 ? t.nativeExtCx > 0 ? t.nativeExtCx * n.w / a : 0 : (i?.width ?? 0) * n.w * (r / a),
|
|
204
|
+
heightPt: l ? l.heightPt : t.anchorTag === void 0 ? t.nativeExtCy > 0 ? t.nativeExtCy * n.h / a : 0 : (i?.height ?? 0) * n.h * (r / a),
|
|
205
|
+
srcRect: n.geom.srcRect ?? null,
|
|
206
|
+
duotone: c,
|
|
207
207
|
...(() => {
|
|
208
|
-
let e =
|
|
208
|
+
let e = i && _?.effectiveDpr ? o(i.width * n.w * _.effectiveDpr, i.height * n.h * _.effectiveDpr, n.geom.srcRect) : null;
|
|
209
209
|
return e ? {
|
|
210
210
|
targetWidthPx: e.width,
|
|
211
211
|
targetHeightPx: e.height
|
|
@@ -215,41 +215,41 @@ async function fn(e, n, i, g) {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
let S = e.charts ?? [], C = S.length > 0 ? b ??
|
|
219
|
-
for (let
|
|
220
|
-
if (!un(
|
|
221
|
-
let
|
|
222
|
-
if (!
|
|
223
|
-
let i =
|
|
224
|
-
widthPt:
|
|
225
|
-
heightPt:
|
|
226
|
-
targetWidthPx:
|
|
227
|
-
targetHeightPx:
|
|
228
|
-
},
|
|
218
|
+
let S = e.charts ?? [], C = S.length > 0 ? b ?? V(e) : b, w = [];
|
|
219
|
+
for (let t of S) {
|
|
220
|
+
if (!un(t, e, _?.viewport, C, x)) continue;
|
|
221
|
+
let n = on(t, e, C, _?.cellScale ?? 1);
|
|
222
|
+
if (!n || !Number.isFinite(n.width) || !Number.isFinite(n.height) || n.width <= 0 || n.height <= 0) continue;
|
|
223
|
+
let i = f(t.chart), o = {
|
|
224
|
+
widthPt: n.width * (r / a),
|
|
225
|
+
heightPt: n.height * (r / a),
|
|
226
|
+
targetWidthPx: _?.effectiveDpr === void 0 ? void 0 : n.width * _.effectiveDpr,
|
|
227
|
+
targetHeightPx: _?.effectiveDpr === void 0 ? void 0 : n.height * _.effectiveDpr
|
|
228
|
+
}, s = [], c = !0;
|
|
229
229
|
for (let e of i) {
|
|
230
|
-
let t =
|
|
230
|
+
let t = u(e, o);
|
|
231
231
|
if (!t) {
|
|
232
232
|
c = !1;
|
|
233
233
|
break;
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
s.push({
|
|
236
236
|
usage: e,
|
|
237
237
|
size: t
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
c && w.push({
|
|
241
|
-
chart:
|
|
242
|
-
frame:
|
|
243
|
-
usages:
|
|
244
|
-
displayWidth:
|
|
245
|
-
displayHeight:
|
|
241
|
+
chart: t,
|
|
242
|
+
frame: o,
|
|
243
|
+
usages: s,
|
|
244
|
+
displayWidth: n.width,
|
|
245
|
+
displayHeight: n.height
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
|
-
let T =
|
|
248
|
+
let T = d(w.map(({ chart: e }) => e.chart), (e, t) => u(e, w[t].frame) != null), E = /* @__PURE__ */ new Map();
|
|
249
249
|
for (let e of T) {
|
|
250
250
|
let { fill: t } = e;
|
|
251
|
-
if (
|
|
252
|
-
let n =
|
|
251
|
+
if (p(t)) continue;
|
|
252
|
+
let n = m(t);
|
|
253
253
|
E.set(n, {
|
|
254
254
|
fill: t,
|
|
255
255
|
widthPt: 0,
|
|
@@ -258,32 +258,32 @@ async function fn(e, n, i, g) {
|
|
|
258
258
|
hasSourceCrop: e.hasSourceCrop
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
|
-
let D = new Set(T.map(({ fill: e }) =>
|
|
262
|
-
let t = [], n =
|
|
263
|
-
for (let r of w) for (let { fill:
|
|
261
|
+
let D = new Set(T.map(({ fill: e }) => c(e))), O = (e) => {
|
|
262
|
+
let t = [], n = _?.cellScale ?? 1;
|
|
263
|
+
for (let r of w) for (let { fill: a, occurrence: o } of de(r.chart.chart, {
|
|
264
264
|
x: 0,
|
|
265
265
|
y: 0,
|
|
266
266
|
w: r.displayWidth / n,
|
|
267
267
|
h: r.displayHeight / n
|
|
268
|
-
},
|
|
269
|
-
if (!D.has(a
|
|
270
|
-
let e =
|
|
268
|
+
}, i, 0, _?.threeD, _?.regionMap, _?.chartEx, e)) {
|
|
269
|
+
if (!D.has(c(a))) continue;
|
|
270
|
+
let e = m(a, void 0, o);
|
|
271
271
|
E.has(e) || (E.set(e, {
|
|
272
|
-
fill:
|
|
272
|
+
fill: a,
|
|
273
273
|
widthPt: o.widthPt,
|
|
274
274
|
heightPt: o.heightPt,
|
|
275
275
|
preserveNaturalSize: !0,
|
|
276
|
-
hasSourceCrop:
|
|
276
|
+
hasSourceCrop: a.srcRect != null,
|
|
277
277
|
renderedSize: o
|
|
278
278
|
}), t.push(e));
|
|
279
279
|
}
|
|
280
|
-
return
|
|
280
|
+
return fe(E.size), t;
|
|
281
281
|
};
|
|
282
282
|
O();
|
|
283
283
|
for (let e of w) for (let { usage: t, size: n } of e.usages) {
|
|
284
284
|
let { fill: e } = t;
|
|
285
|
-
if (
|
|
286
|
-
let r =
|
|
285
|
+
if (p(e)) continue;
|
|
286
|
+
let r = m(e), i = E.get(r);
|
|
287
287
|
if (!i) continue;
|
|
288
288
|
let a = i.preserveNaturalSize || t.preserveNaturalSize;
|
|
289
289
|
E.set(r, {
|
|
@@ -296,46 +296,46 @@ async function fn(e, n, i, g) {
|
|
|
296
296
|
hasSourceCrop: i.hasSourceCrop || t.hasSourceCrop
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
let
|
|
300
|
-
let { fill: n, widthPt: r, heightPt: i, targetWidthPx: a, targetHeightPx:
|
|
299
|
+
let A = (e, t) => {
|
|
300
|
+
let { fill: n, widthPt: r, heightPt: i, targetWidthPx: a, targetHeightPx: o, hasSourceCrop: s, renderedSize: c } = t;
|
|
301
301
|
an(y, e, {
|
|
302
302
|
imagePath: n.imagePath,
|
|
303
303
|
mimeType: n.mimeType,
|
|
304
304
|
svgImagePath: n.svgImagePath,
|
|
305
|
-
widthPt:
|
|
306
|
-
heightPt:
|
|
307
|
-
srcRect:
|
|
305
|
+
widthPt: c ? c.widthPt : n.blipEffects?.length ? 0 : r,
|
|
306
|
+
heightPt: c ? c.heightPt : n.blipEffects?.length ? 0 : i,
|
|
307
|
+
srcRect: s ? {
|
|
308
308
|
l: 0,
|
|
309
309
|
t: 0,
|
|
310
310
|
r: 0,
|
|
311
311
|
b: 0
|
|
312
312
|
} : null,
|
|
313
|
-
duotone:
|
|
313
|
+
duotone: l(n, void 0, c),
|
|
314
314
|
failClosedOnDuotoneFailure: !0,
|
|
315
|
-
...a &&
|
|
315
|
+
...a && o && !n.blipEffects?.length ? {
|
|
316
316
|
targetWidthPx: a,
|
|
317
|
-
targetHeightPx:
|
|
317
|
+
targetHeightPx: o
|
|
318
318
|
} : {}
|
|
319
319
|
});
|
|
320
320
|
};
|
|
321
|
-
for (let [e, t] of E)
|
|
321
|
+
for (let [e, t] of E) A(e, t);
|
|
322
322
|
if (y.size === 0) return;
|
|
323
|
-
let
|
|
324
|
-
if (!t.targetWidthPx || !t.targetHeightPx || t.mimeType === "image/svg+xml" || t.duotone || !t.duotone &&
|
|
323
|
+
let j = ae(_?.imageResources), ee = k((await Promise.all([...y].map(async ([e, t]) => {
|
|
324
|
+
if (!t.targetWidthPx || !t.targetHeightPx || t.mimeType === "image/svg+xml" || t.duotone || !t.duotone && M({
|
|
325
325
|
svgImagePath: t.svgImagePath,
|
|
326
326
|
srcRect: t.srcRect
|
|
327
327
|
})) return null;
|
|
328
|
-
if (
|
|
328
|
+
if (ce(t.mimeType) && (j.resolution === "display" || j.strategy === "adaptive")) return {
|
|
329
329
|
key: e,
|
|
330
330
|
targetWidthPx: t.targetWidthPx,
|
|
331
331
|
targetHeightPx: t.targetHeightPx,
|
|
332
332
|
retainedSurfaceCount: 1
|
|
333
333
|
};
|
|
334
|
-
let n = await
|
|
335
|
-
if (e instanceof
|
|
334
|
+
let n = await P(t.imagePath, t.mimeType, v).catch((e) => {
|
|
335
|
+
if (e instanceof g || z(e)) throw e;
|
|
336
336
|
return null;
|
|
337
337
|
});
|
|
338
|
-
return !n?.dimensions || !
|
|
338
|
+
return !n?.dimensions || !le(n.format, _?.tiff !== void 0) ? null : {
|
|
339
339
|
key: e,
|
|
340
340
|
targetWidthPx: t.targetWidthPx,
|
|
341
341
|
targetHeightPx: t.targetHeightPx,
|
|
@@ -343,64 +343,64 @@ async function fn(e, n, i, g) {
|
|
|
343
343
|
sourceHeightPx: n.dimensions.height,
|
|
344
344
|
retainedSurfaceCount: 1
|
|
345
345
|
};
|
|
346
|
-
}))).filter((e) => e !== null),
|
|
346
|
+
}))).filter((e) => e !== null), j);
|
|
347
347
|
for (let [e, t] of y) {
|
|
348
|
-
if (t.mimeType === "image/svg+xml" || !t.duotone &&
|
|
348
|
+
if (t.mimeType === "image/svg+xml" || !t.duotone && M({
|
|
349
349
|
svgImagePath: t.svgImagePath,
|
|
350
350
|
srcRect: t.srcRect
|
|
351
351
|
})) continue;
|
|
352
|
-
let n =
|
|
352
|
+
let n = ee.targets.get(e);
|
|
353
353
|
t.targetWidthPx = n?.width, t.targetHeightPx = n?.height, t.plannedPixelLimit = n?.maxRetainedPixels;
|
|
354
354
|
}
|
|
355
|
-
let
|
|
355
|
+
let N = async ([e, r]) => {
|
|
356
356
|
try {
|
|
357
|
-
let
|
|
358
|
-
targetWidthPx:
|
|
359
|
-
targetHeightPx:
|
|
360
|
-
} : void 0,
|
|
361
|
-
n.set(e,
|
|
362
|
-
} catch (
|
|
363
|
-
if (
|
|
364
|
-
n.set(e, null),
|
|
357
|
+
let t = await dn(r.imagePath, r.mimeType, r.svgImagePath, v, r.widthPt, r.heightPt, r.srcRect, r.duotone, _?.offscreenFactory, r.failClosedOnDuotoneFailure ?? !1, _?.tiff, r.targetWidthPx && r.targetHeightPx ? {
|
|
358
|
+
targetWidthPx: r.targetWidthPx,
|
|
359
|
+
targetHeightPx: r.targetHeightPx
|
|
360
|
+
} : void 0, _?.svgDecoder, r.plannedPixelLimit);
|
|
361
|
+
n.set(e, t);
|
|
362
|
+
} catch (r) {
|
|
363
|
+
if (ue(r, "tiff") || pe(r)) {
|
|
364
|
+
n.set(e, null), Ye(n, e, "tiff");
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
if (
|
|
367
|
+
if (r instanceof g || z(r) || r instanceof t && r.code === "unsupported-image-effect") throw r;
|
|
368
368
|
n.delete(e);
|
|
369
369
|
}
|
|
370
370
|
};
|
|
371
|
-
for (await Promise.all([...y.entries()].map(
|
|
372
|
-
let e = O(
|
|
371
|
+
for (await Promise.all([...y.entries()].map(N));;) {
|
|
372
|
+
let e = O(h(n, void 0, !1));
|
|
373
373
|
if (e.length === 0) break;
|
|
374
|
-
for (let t of e)
|
|
375
|
-
await Promise.all(e.map((e) =>
|
|
374
|
+
for (let t of e) A(t, E.get(t));
|
|
375
|
+
await Promise.all(e.map((e) => N([e, y.get(e)])));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
var pn = /* @__PURE__ */ new WeakMap();
|
|
379
379
|
function mn(e, t, n, r) {
|
|
380
|
-
if (
|
|
381
|
-
let i =
|
|
382
|
-
if (a && a.sourceGeometry === i &&
|
|
380
|
+
if (st(t)) return t;
|
|
381
|
+
let i = V(t), a = pn.get(t);
|
|
382
|
+
if (a && a.sourceGeometry === i && xt(a.projection) === xt(t)) return a.projection;
|
|
383
383
|
let o = {
|
|
384
384
|
...t,
|
|
385
385
|
rowHeights: { ...t.rowHeights }
|
|
386
386
|
};
|
|
387
|
-
Wt(t, o),
|
|
387
|
+
Wt(t, o), dt(t, o);
|
|
388
388
|
let s = i.maximumDigitWidth;
|
|
389
|
-
return q.forWorksheet(o, s),
|
|
389
|
+
return q.forWorksheet(o, s), pt(e, o, n, r), q.forWorksheet(o, s), pn.set(t, {
|
|
390
390
|
projection: o,
|
|
391
391
|
sourceGeometry: i
|
|
392
392
|
}), o;
|
|
393
393
|
}
|
|
394
394
|
async function hn(e, t, n, r = {}, i) {
|
|
395
|
-
let a = () => gn(e, t, n, r, i), o = !e.ws.isDialogSheet && ((e.ws.images?.length ?? 0) > 0 || (e.ws.shapeGroups?.some((e) => e.shapes.some((e) => e.geom.type === "image")) ?? !1) ||
|
|
396
|
-
return r.fetchImage && o ?
|
|
395
|
+
let a = () => gn(e, t, n, r, i), o = !e.ws.isDialogSheet && ((e.ws.images?.length ?? 0) > 0 || (e.ws.shapeGroups?.some((e) => e.shapes.some((e) => e.geom.type === "image")) ?? !1) || d((e.ws.charts ?? []).map((e) => e.chart)).length > 0);
|
|
396
|
+
return r.fetchImage && o ? oe(r.fetchImage, r.imageResources, a) : a();
|
|
397
397
|
}
|
|
398
|
-
async function gn(e, t, n, r = {},
|
|
398
|
+
async function gn(e, t, n, r = {}, i) {
|
|
399
399
|
if (r[Qt]?.() === !1) return;
|
|
400
|
-
let
|
|
401
|
-
if (!
|
|
402
|
-
|
|
403
|
-
let c = e.ws.isDialogSheet ? e.ws : mn(
|
|
400
|
+
let a = e.styles, o = t.getContext("2d");
|
|
401
|
+
if (!o) throw Error("XLSX render target does not provide a 2-D canvas context");
|
|
402
|
+
lt(o, e.ws, r.officeFontRoutes, r.googleSubstitutes === !0), nt(e.ws, r.authoritativeMdw);
|
|
403
|
+
let c = e.ws.isDialogSheet ? e.ws : mn(o, e.ws, a, e.cjkFallback), l = b(t) ? t.clientWidth || 800 : t.width, u = b(t) ? t.clientHeight || 600 : t.height, d = r.width ?? l, f = r.height ?? u, p = r.dpr ?? D(), m = s(d * p, f * p), h = m.clamped ? p * m.scale : p, g = /* @__PURE__ */ new Map();
|
|
404
404
|
if (c.isDialogSheet || await fn(c, g, r.fetchImage, {
|
|
405
405
|
viewport: n,
|
|
406
406
|
width: d,
|
|
@@ -410,14 +410,14 @@ async function gn(e, t, n, r = {}, a) {
|
|
|
410
410
|
freezeCols: r.freezeCols,
|
|
411
411
|
tiff: e.tiff,
|
|
412
412
|
effectiveDpr: h,
|
|
413
|
-
svgDecoder:
|
|
413
|
+
svgDecoder: i,
|
|
414
414
|
imageResources: r.imageResources,
|
|
415
415
|
threeD: e.threeD,
|
|
416
416
|
regionMap: e.regionMap,
|
|
417
417
|
chartEx: e.chartEx
|
|
418
|
-
}), !c.isDialogSheet && e.math &&
|
|
418
|
+
}), !c.isDialogSheet && e.math && _t(c) && await Ze(c, e.math), r[Qt]?.() === !1) return;
|
|
419
419
|
let _ = m.width, v = m.height;
|
|
420
|
-
if (t.width !== _ && (t.width = _), t.height !== v && (t.height = v),
|
|
420
|
+
if (t.width !== _ && (t.width = _), t.height !== v && (t.height = v), b(t)) {
|
|
421
421
|
let e = `${d}px`, n = `${f}px`;
|
|
422
422
|
t.style.width !== e && (t.style.width = e), t.style.height !== n && (t.style.height = n);
|
|
423
423
|
}
|
|
@@ -430,7 +430,7 @@ async function gn(e, t, n, r = {}, a) {
|
|
|
430
430
|
_n(y, d, f);
|
|
431
431
|
return;
|
|
432
432
|
}
|
|
433
|
-
|
|
433
|
+
ht(y, c, a, n, {
|
|
434
434
|
...r,
|
|
435
435
|
dpr: h,
|
|
436
436
|
loadedImages: g,
|
|
@@ -477,9 +477,9 @@ function yn(e) {
|
|
|
477
477
|
let e = t.slice(0, i);
|
|
478
478
|
e.startsWith("'") && e.endsWith("'") && e.length >= 2 && (e = e.slice(1, -1).replace(/''/g, "'")), n = e, r = t.slice(i + 1);
|
|
479
479
|
}
|
|
480
|
-
let [a, o] = r.split(":"), s =
|
|
480
|
+
let [a, o] = r.split(":"), s = B(a ?? "");
|
|
481
481
|
if (s) {
|
|
482
|
-
let e = o ?
|
|
482
|
+
let e = o ? B(o) : s;
|
|
483
483
|
if (e) {
|
|
484
484
|
let t = {
|
|
485
485
|
row: Math.min(s.row, e.row),
|
|
@@ -548,7 +548,7 @@ function wn(e, t) {
|
|
|
548
548
|
}
|
|
549
549
|
function Tn(e, t) {
|
|
550
550
|
let n = { ...e };
|
|
551
|
-
return t && (n.rowHeights = { ...e.rowHeights }, n.colWidths = { ...e.colWidths }),
|
|
551
|
+
return t && (n.rowHeights = { ...e.rowHeights }, n.colWidths = { ...e.colWidths }), Xe(e, n), U(e, n), Wt(e, n), Cn(n, t), n;
|
|
552
552
|
}
|
|
553
553
|
var En = Symbol("xlsx-viewer-render-context");
|
|
554
554
|
function Dn(e, t, n) {
|
|
@@ -571,9 +571,9 @@ function On(e) {
|
|
|
571
571
|
projection: t.projection
|
|
572
572
|
} : { opts: n };
|
|
573
573
|
}
|
|
574
|
-
var kn = "load-delimited-text", J =
|
|
574
|
+
var kn = "load-delimited-text", J = jt;
|
|
575
575
|
function An(e) {
|
|
576
|
-
if (e > J) throw
|
|
576
|
+
if (e > J) throw Dt(kn, void 0, "delimited-text-source", "bytes", J, e);
|
|
577
577
|
}
|
|
578
578
|
Object.freeze({
|
|
579
579
|
fonts: [Object.freeze({
|
|
@@ -731,7 +731,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
731
731
|
metrics = null;
|
|
732
732
|
bridge = null;
|
|
733
733
|
delimitedTextBacked = !1;
|
|
734
|
-
japaneseCellFonts =
|
|
734
|
+
japaneseCellFonts = Ve();
|
|
735
735
|
parsedWorkbook = null;
|
|
736
736
|
sheetCache = /* @__PURE__ */ new Map();
|
|
737
737
|
sheetCacheUsage = /* @__PURE__ */ new Map();
|
|
@@ -741,7 +741,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
741
741
|
sheetPreviews = /* @__PURE__ */ new Map();
|
|
742
742
|
rawParts = new ie({
|
|
743
743
|
maxEntries: 64,
|
|
744
|
-
maxBytes:
|
|
744
|
+
maxBytes: R
|
|
745
745
|
});
|
|
746
746
|
queuedImageLoads = /* @__PURE__ */ new Map();
|
|
747
747
|
_fetchImage = (e, t) => this.getImageWithinArchiveOperation(e, t);
|
|
@@ -770,11 +770,11 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
770
770
|
};
|
|
771
771
|
resourceFailure = null;
|
|
772
772
|
constructor(e, t, n, r = !0) {
|
|
773
|
-
if (this._mode = t, e && (this.bridge = new
|
|
773
|
+
if (this._mode = t, e && (this.bridge = new _e(e, {
|
|
774
774
|
correlate: (e) => "protocol" in e && e.protocol === "ooxml-pull-v1" ? e.requestId : "id" in e ? e.id : void 0,
|
|
775
|
-
toError: (e) => "type" in e && e.type === "error" ?
|
|
775
|
+
toError: (e) => "type" in e && e.type === "error" ? A(e) : void 0,
|
|
776
776
|
onUnsolicited: (t) => {
|
|
777
|
-
|
|
777
|
+
Me((t, n) => e.postMessage(t, n), t);
|
|
778
778
|
}
|
|
779
779
|
}), r)) {
|
|
780
780
|
let e = new URL(n ?? Xt, location.href).href;
|
|
@@ -793,15 +793,15 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
793
793
|
throw TypeError("Unsupported XlsxSheetViewer source format");
|
|
794
794
|
}
|
|
795
795
|
static async loadDelimitedText(t, n, r) {
|
|
796
|
-
let i =
|
|
796
|
+
let i = H(n);
|
|
797
797
|
n = {
|
|
798
798
|
...n,
|
|
799
799
|
xlsxWorksheetLimits: i.worksheet
|
|
800
800
|
}, n = {
|
|
801
801
|
...n,
|
|
802
|
-
cjkFallback:
|
|
802
|
+
cjkFallback: j(n.cjkFallback)
|
|
803
803
|
};
|
|
804
|
-
let a = jn(r), o =
|
|
804
|
+
let a = jn(r), o = w(n), s = n.mode ?? "main", c = new E({
|
|
805
805
|
enabled: !0,
|
|
806
806
|
format: "xlsx",
|
|
807
807
|
mode: s,
|
|
@@ -819,29 +819,29 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
819
819
|
i = await Mn(e);
|
|
820
820
|
} else i = t;
|
|
821
821
|
An(i.byteLength), c.setSourceBytes(i.byteLength), c.checkpoint("source ready");
|
|
822
|
-
let o = s === "worker" ? (await import("./render-worker-host-
|
|
822
|
+
let o = s === "worker" ? (await import("./render-worker-host-BZoh-wqR.js")).createRenderWorker() : (await import("./delimited-text-worker-host-RwvuSsP2.js")).createDelimitedTextWorker(), l;
|
|
823
823
|
try {
|
|
824
824
|
let t = new e(o, s, void 0, !1);
|
|
825
825
|
return l = t, t.metrics = c, await t._loadDelimitedText(r === i ? i.slice(0) : i, n, a), s === "main" && (t.bridge?.terminate(), t.bridge = null), c.checkpoint("worksheet ready"), c.succeed({ sheets: 1 }), t;
|
|
826
826
|
} catch (e) {
|
|
827
827
|
let t = l;
|
|
828
|
-
throw
|
|
828
|
+
throw ye(o, t ? () => t.destroy() : void 0), e;
|
|
829
829
|
}
|
|
830
830
|
} catch (e) {
|
|
831
831
|
throw c.fail(e), e;
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
static async load(t, n = {}) {
|
|
835
|
-
let r =
|
|
835
|
+
let r = H(n);
|
|
836
836
|
if (n = {
|
|
837
837
|
...n,
|
|
838
838
|
xlsxWorksheetLimits: r.worksheet
|
|
839
|
-
}, n.legacyXls !== void 0) return (await import("./workbook-model-source-
|
|
839
|
+
}, n.legacyXls !== void 0) return (await import("./workbook-model-source-BHR8shXr.js")).loadXlsxModelSource(t, n, e);
|
|
840
840
|
n = {
|
|
841
841
|
...n,
|
|
842
|
-
cjkFallback:
|
|
842
|
+
cjkFallback: j(n.cjkFallback)
|
|
843
843
|
};
|
|
844
|
-
let i =
|
|
844
|
+
let i = w(n), a = n.mode ?? "main", o = new E({
|
|
845
845
|
enabled: !0,
|
|
846
846
|
format: "xlsx",
|
|
847
847
|
mode: a,
|
|
@@ -861,26 +861,26 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
861
861
|
s = v(await y(s, n.password));
|
|
862
862
|
let c = s === r;
|
|
863
863
|
o.setSourceBytes(s.byteLength), o.checkpoint("container ready");
|
|
864
|
-
let l = a === "worker" ? (await import("./render-worker-host-
|
|
864
|
+
let l = a === "worker" ? (await import("./render-worker-host-BZoh-wqR.js")).createRenderWorker() : new Yt(), u;
|
|
865
865
|
try {
|
|
866
866
|
return u = new e(l, a, n.wasmUrl), u.metrics = o, await u._load(s, n, i.policy, (e) => o.observeUsage(e), c), o.checkpoint("workbook index ready"), o.succeed({ sheets: u.sheetCount }), u;
|
|
867
867
|
} catch (e) {
|
|
868
868
|
let t = u;
|
|
869
|
-
throw
|
|
869
|
+
throw ye(l, t ? () => t.destroy() : void 0), e;
|
|
870
870
|
}
|
|
871
871
|
} catch (e) {
|
|
872
872
|
throw o.fail(e), e;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
async _load(e, t = {}, n =
|
|
876
|
-
let a =
|
|
875
|
+
async _load(e, t = {}, n = T(t), r, i = !1) {
|
|
876
|
+
let a = H(t), o = this.requireBridge();
|
|
877
877
|
this.worksheetPolicy = a, this.resourceFailure = null, this.retainedSheetUsage = {
|
|
878
878
|
rows: 0,
|
|
879
879
|
cells: 0,
|
|
880
880
|
ownedUtf8Bytes: 0,
|
|
881
881
|
jsonBytes: 0
|
|
882
|
-
}, this.sheetCache.clear(), this.sheetCacheUsage.clear(), this.sheetLeases.clear(), this.completePendingEvictions(), await this.worksheetPullClient?.cancelAll("closed"), this.worksheetPullClient = null, this.generation = (this.generation ?? 0) + 1, this.workerTimeoutMs = t.workerTimeoutMs, this.googleSubstitutes = t.useGoogleFonts === !0, this.cjkFallback =
|
|
883
|
-
let s = this._mode === "worker" ?
|
|
882
|
+
}, this.sheetCache.clear(), this.sheetCacheUsage.clear(), this.sheetLeases.clear(), this.completePendingEvictions(), await this.worksheetPullClient?.cancelAll("closed"), this.worksheetPullClient = null, this.generation = (this.generation ?? 0) + 1, this.workerTimeoutMs = t.workerTimeoutMs, this.googleSubstitutes = t.useGoogleFonts === !0, this.cjkFallback = j(t.cjkFallback), this.math = this._mode === "worker" ? void 0 : t.math, this.threeD = this._mode === "worker" ? void 0 : t.threeD, this.regionMap = this._mode === "worker" ? void 0 : t.regionMap, this.chartEx = this._mode === "worker" ? void 0 : t.chartEx, this.tiff = this._mode === "worker" ? void 0 : t.tiff;
|
|
883
|
+
let s = this._mode === "worker" ? bt(t) : void 0;
|
|
884
884
|
t.math && this._mode === "worker" && !s?.math && console.warn("[ooxml] a custom math renderer cannot cross the worker boundary; equations will be skipped in mode: 'worker'. Use the math renderer from @silurus/ooxml/math."), t.threeD && this._mode === "worker" && !s?.threeD && console.warn("[ooxml] a custom 3-D chart renderer cannot cross the worker boundary; charts use their 2-D family fallback in mode: 'worker'. Use the renderer from @silurus/ooxml/three-d."), t.regionMap && this._mode === "worker" && !s?.regionMap && console.warn("[ooxml] a custom Region Map renderer cannot cross the worker boundary; geospatial charts use the unsupported-chart placeholder in mode: 'worker'. Use the renderer from @silurus/ooxml/region-map."), t.chartEx && this._mode === "worker" && !s?.chartEx && console.warn("[ooxml] a custom ChartEx renderer cannot cross the worker boundary; ChartEx charts use the unsupported-chart placeholder in mode: 'worker'. Use the renderer from @silurus/ooxml/chart-ex."), t.tiff && this._mode === "worker" && !s?.tiff && console.warn("[ooxml] a custom TIFF codec cannot cross the worker boundary; recognized TIFF images will use an unavailable-image placeholder in mode: 'worker'. Use the codec from @silurus/ooxml/tiff to display them.");
|
|
885
885
|
let c = i ? e.slice(0) : e, l = await o.request((e) => this._mode === "worker" ? {
|
|
886
886
|
type: "parse",
|
|
@@ -908,14 +908,14 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
908
908
|
}
|
|
909
909
|
let u = this.parsedWorkbook;
|
|
910
910
|
if (!u) throw Error("XLSX worker returned no workbook metadata");
|
|
911
|
-
this.cjkFallback =
|
|
911
|
+
this.cjkFallback = Be(u, this.cjkFallback), this.ensureWorksheetPullClient();
|
|
912
912
|
let d = u.workbook.parseError;
|
|
913
|
-
d && console.warn(`[ooxml] xlsx opened with a degraded part: ${d}`), this.officeFontRequests =
|
|
913
|
+
d && console.warn(`[ooxml] xlsx opened with a degraded part: ${d}`), this.officeFontRequests = Ue(u), t.useGoogleFonts && (this.googleFontNames = [...He(u, this.cjkFallback)]), typeof document < "u" && document.fonts && await this.retainFontsInSet(document.fonts);
|
|
914
914
|
}
|
|
915
915
|
async _loadDelimitedText(e, t, n) {
|
|
916
|
-
let r =
|
|
917
|
-
this.worksheetPolicy = r, this.delimitedTextBacked = !0, this.workerTimeoutMs = t.workerTimeoutMs, this.googleSubstitutes = t.useGoogleFonts === !0, this.cjkFallback =
|
|
918
|
-
let a = this._mode === "worker" ?
|
|
916
|
+
let r = H(t), i = this.requireBridge();
|
|
917
|
+
this.worksheetPolicy = r, this.delimitedTextBacked = !0, this.workerTimeoutMs = t.workerTimeoutMs, this.googleSubstitutes = t.useGoogleFonts === !0, this.cjkFallback = j(t.cjkFallback), this.generation++, this.math = this._mode === "worker" ? void 0 : t.math, this.threeD = this._mode === "worker" ? void 0 : t.threeD, this.regionMap = this._mode === "worker" ? void 0 : t.regionMap, this.chartEx = this._mode === "worker" ? void 0 : t.chartEx, this.tiff = this._mode === "worker" ? void 0 : t.tiff;
|
|
918
|
+
let a = this._mode === "worker" ? bt(t) : void 0, o = await i.request((i) => ({
|
|
919
919
|
type: "parseDelimitedText",
|
|
920
920
|
japaneseCellFonts: this.japaneseCellFonts,
|
|
921
921
|
id: i,
|
|
@@ -926,14 +926,14 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
926
926
|
cjkFallback: this.cjkFallback,
|
|
927
927
|
renderers: a
|
|
928
928
|
}), [e], { timeoutMs: t.workerTimeoutMs }), s = JSON.parse(new TextDecoder().decode(o.worksheetJson));
|
|
929
|
-
|
|
929
|
+
Et(s, r), Ie(s, this.japaneseCellFonts);
|
|
930
930
|
let c = o.workbook.workbook.sheets;
|
|
931
931
|
if (c.length !== 1 || c[0]?.name !== s.name) throw Error("Delimited text worker returned inconsistent worksheet metadata");
|
|
932
|
-
let l =
|
|
933
|
-
if (
|
|
932
|
+
let l = kt(s, r);
|
|
933
|
+
if (wt(l, "load-delimited-text", void 0, void 0, r), Ft(l.jsonBytes, "load-delimited-text", void 0, void 0, r), Ot(l, "load-delimited-text", void 0, void 0, r), this.parsedWorkbook = o.workbook, this.cjkFallback = Be(o.workbook, this.cjkFallback), this.sheetCache.set(0, s), this.sheetCacheUsage.set(0, l), this.retainedSheetUsage = l, this.officeFontRequests = Ue(o.workbook), t.useGoogleFonts && (this.googleFontNames = [...He(o.workbook, this.cjkFallback)]), typeof document < "u" && document.fonts) {
|
|
934
934
|
await this.retainFontsInSet(document.fonts), await this.retainWorksheetOfficeFonts(s);
|
|
935
935
|
let e = this.retainedFontSets.get(document.fonts)?.loaded?.office;
|
|
936
|
-
|
|
936
|
+
ft(s, e?.routes, this.googleSubstitutes);
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
async retainFontsInSet(e) {
|
|
@@ -941,7 +941,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
941
941
|
let t = this.retainedFontSets.get(e);
|
|
942
942
|
if (t) t.refs++;
|
|
943
943
|
else {
|
|
944
|
-
let n = Promise.all([
|
|
944
|
+
let n = Promise.all([S(this.googleFontNames, Ke, e), O(this.officeFontRequests, e)]).then(([e, t]) => ({
|
|
945
945
|
google: e,
|
|
946
946
|
office: t
|
|
947
947
|
}));
|
|
@@ -950,7 +950,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
950
950
|
loaded: null,
|
|
951
951
|
loading: n
|
|
952
952
|
}, this.retainedFontSets.set(e, t), n.then((e) => {
|
|
953
|
-
t.loaded = e, this.fontsDestroyed && (
|
|
953
|
+
t.loaded = e, this.fontsDestroyed && (F(e.google), x(e.office.faces));
|
|
954
954
|
});
|
|
955
955
|
}
|
|
956
956
|
await t.loading;
|
|
@@ -959,16 +959,16 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
959
959
|
if (n) return;
|
|
960
960
|
n = !0;
|
|
961
961
|
let r = this.retainedFontSets.get(e);
|
|
962
|
-
r === t && (r.refs--, !(r.refs > 0) && (this.retainedFontSets.delete(e), r.loaded ? (
|
|
963
|
-
|
|
962
|
+
r === t && (r.refs--, !(r.refs > 0) && (this.retainedFontSets.delete(e), r.loaded ? (F(r.loaded.google), x(r.loaded.office.faces)) : r.loading.then((e) => {
|
|
963
|
+
F(e.google), x(e.office.faces);
|
|
964
964
|
})));
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
967
|
async retainWorksheetOfficeFonts(e) {
|
|
968
|
-
let t =
|
|
968
|
+
let t = qe(e).filter((e) => !this.officeFontRequests.some((t) => yt(t) === yt(e)));
|
|
969
969
|
t.length !== 0 && (this.officeFontRequests.push(...t), await Promise.all([...this.retainedFontSets].map(async ([e, n]) => {
|
|
970
|
-
let r = await n.loading, i = await
|
|
971
|
-
if (this.fontsDestroyed || this.retainedFontSets.get(e) !== n || n.refs <= 0)
|
|
970
|
+
let r = await n.loading, i = await O(t, e);
|
|
971
|
+
if (this.fontsDestroyed || this.retainedFontSets.get(e) !== n || n.refs <= 0) x(i.faces);
|
|
972
972
|
else {
|
|
973
973
|
r.office.faces.push(...i.faces);
|
|
974
974
|
let e = new Set(r.office.checked);
|
|
@@ -982,8 +982,8 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
982
982
|
}
|
|
983
983
|
[Bn](e, t) {
|
|
984
984
|
if (!this.parsedWorkbook) return;
|
|
985
|
-
let n =
|
|
986
|
-
|
|
985
|
+
let n = b(t.canvas) ? t.canvas.ownerDocument.fonts : null;
|
|
986
|
+
lt(t, e, n ? this.retainedFontSets.get(n)?.loaded?.office.routes : void 0, this.googleSubstitutes), V(e), pt(t, e, this.parsedWorkbook.styles, this.cjkFallback);
|
|
987
987
|
}
|
|
988
988
|
get sheetNames() {
|
|
989
989
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.name) ?? [];
|
|
@@ -1093,7 +1093,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1093
1093
|
if (!t) throw Error("OOXML resource metrics are not ready");
|
|
1094
1094
|
return t;
|
|
1095
1095
|
}
|
|
1096
|
-
return
|
|
1096
|
+
return C(e, async (e) => (await this.requireBridge().request((e) => ({
|
|
1097
1097
|
type: "resourceUsage",
|
|
1098
1098
|
id: e
|
|
1099
1099
|
}), void 0, { timeoutMs: e })).usage);
|
|
@@ -1113,47 +1113,47 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1113
1113
|
try {
|
|
1114
1114
|
for await (let u of i.stream(e, t)) {
|
|
1115
1115
|
if (u.kind === "preview") {
|
|
1116
|
-
if (u.worksheet && (
|
|
1116
|
+
if (u.worksheet && (Et(u.worksheet, r), Ie(u.worksheet, this.japaneseCellFonts)), n.preview(u.worksheet, u.reason, u.maxRow, u.maxCol), u.worksheet) {
|
|
1117
1117
|
In(u.worksheet, {
|
|
1118
1118
|
maxRow: u.maxRow,
|
|
1119
1119
|
maxCol: u.maxCol
|
|
1120
1120
|
}), await this.retainWorksheetOfficeFonts(u.worksheet);
|
|
1121
1121
|
let e = typeof document < "u" ? this.retainedFontSets.get(document.fonts)?.loaded?.office : void 0;
|
|
1122
|
-
|
|
1122
|
+
ft(u.worksheet, e?.routes, this.googleSubstitutes);
|
|
1123
1123
|
}
|
|
1124
1124
|
continue;
|
|
1125
1125
|
}
|
|
1126
1126
|
if (u.kind === "rows") {
|
|
1127
|
-
let e =
|
|
1128
|
-
|
|
1127
|
+
let e = Ct(o, Mt(u.rows, r), r);
|
|
1128
|
+
wt(e, "get-worksheet", void 0, u.usage, r), n.append(u.rows), o = e;
|
|
1129
1129
|
continue;
|
|
1130
1130
|
}
|
|
1131
1131
|
let e = u.worksheet;
|
|
1132
|
-
|
|
1133
|
-
let t =
|
|
1132
|
+
Et(e, r), Ie(e, this.japaneseCellFonts), e.rows = e.parseError ? [] : a;
|
|
1133
|
+
let t = Tt(e, e.parseError ? {
|
|
1134
1134
|
rows: 0,
|
|
1135
1135
|
cells: 0,
|
|
1136
1136
|
ownedUtf8Bytes: 0
|
|
1137
1137
|
} : o, r);
|
|
1138
|
-
|
|
1139
|
-
let i = this.retainedSheetUsage, d =
|
|
1138
|
+
wt(t, "get-worksheet", void 0, u.usage, r), Ft(t.jsonBytes, "get-worksheet", void 0, u.usage, r);
|
|
1139
|
+
let i = this.retainedSheetUsage, d = Nt(i, t, {}, r), f = [];
|
|
1140
1140
|
for (let [e] of this.sheetCache) {
|
|
1141
1141
|
try {
|
|
1142
|
-
|
|
1142
|
+
Ot(d, "get-worksheet", void 0, u.usage, r);
|
|
1143
1143
|
break;
|
|
1144
1144
|
} catch (e) {
|
|
1145
|
-
if (!(e instanceof
|
|
1145
|
+
if (!(e instanceof g)) throw e;
|
|
1146
1146
|
}
|
|
1147
1147
|
if ((this.sheetLeases.get(e) ?? 0) > 0) continue;
|
|
1148
1148
|
let n = this.sheetCacheUsage.get(e);
|
|
1149
|
-
n && (i =
|
|
1149
|
+
n && (i = Nt(i, {
|
|
1150
1150
|
rows: 0,
|
|
1151
1151
|
cells: 0,
|
|
1152
1152
|
ownedUtf8Bytes: 0,
|
|
1153
1153
|
jsonBytes: 0
|
|
1154
|
-
}, n, r), d =
|
|
1154
|
+
}, n, r), d = Nt(i, t, {}, r), f.push(e));
|
|
1155
1155
|
}
|
|
1156
|
-
|
|
1156
|
+
Ot(d, "get-worksheet", void 0, u.usage, r);
|
|
1157
1157
|
let p;
|
|
1158
1158
|
if (f.length && this._mode === "worker") {
|
|
1159
1159
|
let e;
|
|
@@ -1187,7 +1187,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1187
1187
|
if (u = !0, !s || !c || !l) throw Error(`XLSX worksheet ${e} did not produce a terminal model`);
|
|
1188
1188
|
this.retainedSheetUsage = c, this.sheetCache.set(e, s), this.sheetCacheUsage.set(e, l), await this.retainWorksheetOfficeFonts(s);
|
|
1189
1189
|
let d = typeof document < "u" ? this.retainedFontSets.get(document.fonts)?.loaded?.office : void 0;
|
|
1190
|
-
return
|
|
1190
|
+
return ft(s, d?.routes, this.googleSubstitutes), n.finish(s), s;
|
|
1191
1191
|
} catch (e) {
|
|
1192
1192
|
throw this._mode === "worker" && s && !u && this.destroy(), this.latchFatalResourceFailure(e), n.fail(e), e;
|
|
1193
1193
|
}
|
|
@@ -1195,9 +1195,9 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1195
1195
|
ensureWorksheetPullClient() {
|
|
1196
1196
|
if (this.worksheetPullClient) return this.worksheetPullClient;
|
|
1197
1197
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
1198
|
-
return this.worksheetPullClient = new
|
|
1198
|
+
return this.worksheetPullClient = new Pt({
|
|
1199
1199
|
generation: this.generation || 1,
|
|
1200
|
-
transport: this.requireBridge().transport(
|
|
1200
|
+
transport: this.requireBridge().transport(At),
|
|
1201
1201
|
sharedStrings: this.parsedWorkbook.sharedStrings,
|
|
1202
1202
|
timeoutMs: this.workerTimeoutMs,
|
|
1203
1203
|
open: async (e, t, n, r) => {
|
|
@@ -1269,14 +1269,14 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1269
1269
|
for (let t of e.rows) for (let e of t.cells) r.set(`${e.row}:${e.col}`, e);
|
|
1270
1270
|
return bn(n, (n, i) => {
|
|
1271
1271
|
let a = r.get(`${n}:${i}`);
|
|
1272
|
-
return a ?
|
|
1272
|
+
return a ? We(a, t, null, e.date1904) : null;
|
|
1273
1273
|
});
|
|
1274
1274
|
} finally {
|
|
1275
1275
|
i.release();
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
1278
|
cellText(e, t) {
|
|
1279
|
-
return this.parsedWorkbook ?
|
|
1279
|
+
return this.parsedWorkbook ? We(t, this.parsedWorkbook.styles, null, e.date1904) : "";
|
|
1280
1280
|
}
|
|
1281
1281
|
async renderViewport(e, t, n, r = {}) {
|
|
1282
1282
|
if (this.assertResourceHealthy(), n = {
|
|
@@ -1286,7 +1286,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1286
1286
|
cols: n.cols
|
|
1287
1287
|
}, this._mode === "worker") throw Error("renderViewport(canvas) is unavailable in mode: 'worker'; use renderViewportToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
1288
1288
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
1289
|
-
let i = this.parsedWorkbook.styles, a = On(r), { sizeOverrides: o, ...s } = a.opts, c =
|
|
1289
|
+
let i = this.parsedWorkbook.styles, a = On(r), { sizeOverrides: o, ...s } = a.opts, c = b(e) ? e.ownerDocument.fonts : typeof document < "u" ? document.fonts : null, l = this.sheetPreviews?.get(t);
|
|
1290
1290
|
if (l?.worksheet && a.worksheet) {
|
|
1291
1291
|
await l.waitFor(Math.max(n.row + n.rows - 1, s.freezeRows ?? 0)), this.assertResourceHealthy();
|
|
1292
1292
|
let t = a.worksheet;
|
|
@@ -1310,7 +1310,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1310
1310
|
}
|
|
1311
1311
|
return this.withWorksheetArchiveOperation(t, (t) => {
|
|
1312
1312
|
let r = a.worksheet ?? wn(t, o);
|
|
1313
|
-
return r !== t &&
|
|
1313
|
+
return r !== t && dt(t, r), hn({
|
|
1314
1314
|
ws: r,
|
|
1315
1315
|
styles: i,
|
|
1316
1316
|
cjkFallback: this.cjkFallback,
|
|
@@ -1337,7 +1337,7 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1337
1337
|
};
|
|
1338
1338
|
let r = On(n), i = {
|
|
1339
1339
|
...r.opts,
|
|
1340
|
-
dpr: n.dpr ??
|
|
1340
|
+
dpr: n.dpr ?? D()
|
|
1341
1341
|
};
|
|
1342
1342
|
if (this._mode === "worker") {
|
|
1343
1343
|
if (!Number.isInteger(e) || e < 0 || e >= this.sheetCount) throw Error(`Sheet index ${e} out of range (count: ${this.sheetCount})`);
|
|
@@ -1408,14 +1408,14 @@ var zn = Symbol("retain-xlsx-viewer-fonts"), Bn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1408
1408
|
}, this.sheetLoads.clear();
|
|
1409
1409
|
for (let e of this.sheetPreviews?.values() ?? []) e.fail(/* @__PURE__ */ Error("XLSX workbook has been destroyed"));
|
|
1410
1410
|
this.sheetPreviews?.clear(), this.fontsDestroyed = !0;
|
|
1411
|
-
for (let e of this.retainedFontSets.values()) e.loaded && (
|
|
1411
|
+
for (let e of this.retainedFontSets.values()) e.loaded && (F(e.loaded.google), x(e.loaded.office.faces));
|
|
1412
1412
|
this.retainedFontSets.clear(), this.googleFontNames = [], this.googleSubstitutes = !1, this.officeFontRequests = [], N(this._fetchImage), ne(this._fetchImage), this.rawParts.clear(), this.queuedImageLoads?.clear();
|
|
1413
1413
|
}
|
|
1414
1414
|
assertResourceHealthy() {
|
|
1415
1415
|
if (this.resourceFailure) throw this.resourceFailure;
|
|
1416
1416
|
}
|
|
1417
1417
|
latchFatalResourceFailure(e) {
|
|
1418
|
-
e instanceof
|
|
1418
|
+
e instanceof g && e.details.violation.resource !== "worksheet-cache" && (this.resourceFailure ??= e);
|
|
1419
1419
|
}
|
|
1420
1420
|
requireBridge() {
|
|
1421
1421
|
if (!this.bridge) throw Error("This operation requires an active workbook worker");
|
|
@@ -1461,11 +1461,11 @@ function Zn(e, t, n) {
|
|
|
1461
1461
|
return t < 1 ? null : Yn(e, 1, t, n) ? "drawing-dependency" : null;
|
|
1462
1462
|
}
|
|
1463
1463
|
function Qn(e, t) {
|
|
1464
|
-
let n =
|
|
1464
|
+
let n = Fe(t.worksheet, e, t.colAxis, t.rowAxis, t.scale), { width: r, height: i } = n;
|
|
1465
1465
|
if (r <= 0 || i <= 0) return null;
|
|
1466
1466
|
let a = t.colAxis.offsetOf(t.startCol), o = t.rowAxis.offsetOf(t.startRow);
|
|
1467
1467
|
return {
|
|
1468
|
-
x:
|
|
1468
|
+
x: Qe(t.scrollAreaX + (n.x - a) - t.scrollOffsetX, r, t.canvasWidth, t.rtl),
|
|
1469
1469
|
y: t.scrollAreaY + (n.y - o) - t.scrollOffsetY,
|
|
1470
1470
|
width: r,
|
|
1471
1471
|
height: i
|
|
@@ -1475,15 +1475,15 @@ function $n(e, t) {
|
|
|
1475
1475
|
return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height;
|
|
1476
1476
|
}
|
|
1477
1477
|
function er(e, t) {
|
|
1478
|
-
let n =
|
|
1478
|
+
let n = Qe(t.scrollAreaX, t.scrollAreaW, t.canvasWidth, t.rtl);
|
|
1479
1479
|
return e.x + e.width >= n && e.x <= n + t.scrollAreaW && e.y + e.height >= t.scrollAreaY && e.y <= t.scrollAreaY + t.scrollAreaH;
|
|
1480
1480
|
}
|
|
1481
1481
|
function tr(e, t) {
|
|
1482
|
-
let n =
|
|
1482
|
+
let n = Qe(t.scrollAreaX, t.scrollAreaW, t.canvasWidth, t.rtl);
|
|
1483
1483
|
return e.x >= n && e.x <= n + t.scrollAreaW && e.y >= t.scrollAreaY && e.y <= t.scrollAreaY + t.scrollAreaH;
|
|
1484
1484
|
}
|
|
1485
1485
|
function nr(e, t) {
|
|
1486
|
-
let n =
|
|
1486
|
+
let n = V(e), r = t.cellScale, { col: i, row: a } = n.axesAtScale(r), o = Math.round(50 * r), s = Math.round(22 * r), c = i.bandsToCover(1, t.freezeCols, Math.max(0, t.width - o)), l = a.bandsToCover(1, t.freezeRows, Math.max(0, t.height - s)), u = c.reduce((e, t) => e + t.size, 0), d = l.reduce((e, t) => e + t.size, 0);
|
|
1487
1487
|
return {
|
|
1488
1488
|
worksheet: e,
|
|
1489
1489
|
colAxis: i,
|
|
@@ -1515,7 +1515,7 @@ function rr(e, t, n) {
|
|
|
1515
1515
|
height: r.h * o.height
|
|
1516
1516
|
}, a = r.rot);
|
|
1517
1517
|
}
|
|
1518
|
-
let s =
|
|
1518
|
+
let s = Qe(r.scrollAreaX, r.scrollAreaW, r.canvasWidth, r.rtl);
|
|
1519
1519
|
return {
|
|
1520
1520
|
rect: o,
|
|
1521
1521
|
clip: {
|
|
@@ -1558,7 +1558,7 @@ function ar(e, t) {
|
|
|
1558
1558
|
n.push("\n"), r++;
|
|
1559
1559
|
}
|
|
1560
1560
|
for (let e of o.runs) {
|
|
1561
|
-
let a = e.type === "text" ? e.text : e.type === "break" ? "\n" : "[equation]", o =
|
|
1561
|
+
let a = e.type === "text" ? e.text : e.type === "break" ? "\n" : "[equation]", o = ke(a, Math.max(0, t - r));
|
|
1562
1562
|
if (n.push(o), r += o.length, o.length < a.length) {
|
|
1563
1563
|
i = !0;
|
|
1564
1564
|
break;
|
|
@@ -1592,7 +1592,7 @@ function sr(e, t, n, r, i) {
|
|
|
1592
1592
|
for (let a = e.charts.length - 1; a >= 0; a--) {
|
|
1593
1593
|
let o = e.charts[a], s = Qn(o, r);
|
|
1594
1594
|
if (!s || !er(s, r) || !$n(n, s)) continue;
|
|
1595
|
-
let c =
|
|
1595
|
+
let c = we(o.chart, i);
|
|
1596
1596
|
return {
|
|
1597
1597
|
...or(e, t, "chart", a, o, c.text, c.truncated, c.maxTextCharacters),
|
|
1598
1598
|
seriesCount: o.chart.series.length
|
|
@@ -1638,23 +1638,23 @@ function lr(e, t, n, r, i) {
|
|
|
1638
1638
|
function ur(e, t, n, r, i) {
|
|
1639
1639
|
for (let a = e.images.length - 1; a >= 0; a--) {
|
|
1640
1640
|
let o = e.images[a], s = Qn(o, r);
|
|
1641
|
-
if (s && er(
|
|
1641
|
+
if (s && er(Le(s, o.rotation), r) && $n(Je(n, s, o.rotation, o.flipH, o.flipV), s)) return {
|
|
1642
1642
|
...or(e, t, "image", a, o, void 0, !1, i),
|
|
1643
1643
|
mimeType: o.svgImagePath ? "image/svg+xml" : o.mimeType
|
|
1644
1644
|
};
|
|
1645
1645
|
}
|
|
1646
1646
|
return null;
|
|
1647
1647
|
}
|
|
1648
|
-
function dr(e, t, n, r, i =
|
|
1648
|
+
function dr(e, t, n, r, i = Ce) {
|
|
1649
1649
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) throw RangeError("XLSX hit-test point must contain finite coordinates.");
|
|
1650
1650
|
if (!Number.isFinite(i) || i < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
1651
|
-
let a = Math.min(
|
|
1651
|
+
let a = Math.min(Ce, Math.floor(i)), o = nr(e, r);
|
|
1652
1652
|
return tr(n, o) ? sr(e, t, n, o, a) ?? lr(e, t, n, o, a) ?? ur(e, t, n, o, a) : null;
|
|
1653
1653
|
}
|
|
1654
1654
|
function fr(e, t) {
|
|
1655
1655
|
let n = t ?? e.maxTextCharacters;
|
|
1656
1656
|
if (!Number.isFinite(n) || n < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
1657
|
-
let r = Math.min(
|
|
1657
|
+
let r = Math.min(Ce, Math.floor(n)), i = e.text === void 0 ? void 0 : ke(e.text, r), a = e.truncated || e.text !== void 0 && i.length < e.text.length;
|
|
1658
1658
|
return {
|
|
1659
1659
|
...structuredClone(e),
|
|
1660
1660
|
...i === void 0 ? {} : { text: i },
|
|
@@ -1785,7 +1785,7 @@ function xr(e) {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
let i = t.split(":");
|
|
1787
1787
|
if (i.length > 2) return null;
|
|
1788
|
-
let a =
|
|
1788
|
+
let a = B(i[0]), o = i.length === 2 ? B(i[1]) : a;
|
|
1789
1789
|
if (!a || !o) return null;
|
|
1790
1790
|
let s = {
|
|
1791
1791
|
kind: "cells",
|
|
@@ -1938,7 +1938,7 @@ var wr = class {
|
|
|
1938
1938
|
return this.sizeOverrideStore.get(e)?.revision ?? 0;
|
|
1939
1939
|
}
|
|
1940
1940
|
syncAutomaticRowOverrides(e, t) {
|
|
1941
|
-
let n = new Map(
|
|
1941
|
+
let n = new Map(ut(t)), r = this.sizeOverrideStore.get(e);
|
|
1942
1942
|
!r && n.size === 0 || (r || (r = {
|
|
1943
1943
|
rows: /* @__PURE__ */ new Map(),
|
|
1944
1944
|
automaticRows: /* @__PURE__ */ new Map(),
|
|
@@ -2209,7 +2209,7 @@ var Z = class {
|
|
|
2209
2209
|
u.setTransform(l, 0, 0, l, 0, 0), u.clearRect(0, 0, s, c), u.fillStyle = r.background ?? "#f5f5f5", u.fillRect(0, 0, s, c);
|
|
2210
2210
|
let d = 19 * n;
|
|
2211
2211
|
u.strokeStyle = r.border ?? "#808080", u.lineWidth = 1, u.fillStyle = r.text ?? "#404040";
|
|
2212
|
-
let f =
|
|
2212
|
+
let f = V(t), p = f.effectiveFrozenBands({
|
|
2213
2213
|
scale: n,
|
|
2214
2214
|
width: this.host.canvasArea.clientWidth,
|
|
2215
2215
|
height: this.host.canvasArea.clientHeight,
|
|
@@ -2554,13 +2554,13 @@ function Xr(e, t, n) {
|
|
|
2554
2554
|
if (!e) return !1;
|
|
2555
2555
|
for (let r of e.split(/\s+/)) {
|
|
2556
2556
|
if (!r) continue;
|
|
2557
|
-
let [e, i] = r.split(":"), a =
|
|
2557
|
+
let [e, i] = r.split(":"), a = B(e);
|
|
2558
2558
|
if (!a) continue;
|
|
2559
2559
|
if (!i) {
|
|
2560
2560
|
if (a.row === t && a.col === n) return !0;
|
|
2561
2561
|
continue;
|
|
2562
2562
|
}
|
|
2563
|
-
let o =
|
|
2563
|
+
let o = B(i);
|
|
2564
2564
|
if (!o) continue;
|
|
2565
2565
|
let s = Math.min(a.row, o.row), c = Math.max(a.row, o.row), l = Math.min(a.col, o.col), u = Math.max(a.col, o.col);
|
|
2566
2566
|
if (t >= s && t <= c && n >= l && n <= u) return !0;
|
|
@@ -2710,7 +2710,7 @@ function ti(e) {
|
|
|
2710
2710
|
}
|
|
2711
2711
|
function ni(e, t, n) {
|
|
2712
2712
|
let r = ei(e), i = r >= 0 ? ti(e.slice(0, r)) : void 0, a = (r >= 0 ? e.slice(r + 1) : e).split(":", 1)[0]?.trim() ?? "";
|
|
2713
|
-
if (!
|
|
2713
|
+
if (!B(a)) return null;
|
|
2714
2714
|
let o = t;
|
|
2715
2715
|
if (i !== void 0) {
|
|
2716
2716
|
let e = i.toLocaleLowerCase("en-US");
|
|
@@ -2763,7 +2763,7 @@ var ii = class {
|
|
|
2763
2763
|
};
|
|
2764
2764
|
else return !1;
|
|
2765
2765
|
let r = this.host.onHyperlinkClick();
|
|
2766
|
-
return r ? (r(n), !0) : (n.kind === "external" ?
|
|
2766
|
+
return r ? (r(n), !0) : (n.kind === "external" ? I(n.url, void 0, this.host.hostWindow) : this.navigateInternal(n.ref).catch((e) => this.host.reportError(e)), !0);
|
|
2767
2767
|
}
|
|
2768
2768
|
async navigateInternal(e) {
|
|
2769
2769
|
let t = ri(e, this.host.currentSheet(), this.host.sheetNames(), this.host.definedNames());
|
|
@@ -2805,7 +2805,7 @@ var ii = class {
|
|
|
2805
2805
|
return t ? {
|
|
2806
2806
|
sheet: t.sheet,
|
|
2807
2807
|
sheetName: t.sheetName,
|
|
2808
|
-
ref:
|
|
2808
|
+
ref: at(t.row, t.col),
|
|
2809
2809
|
row: t.row,
|
|
2810
2810
|
col: t.col
|
|
2811
2811
|
} : null;
|
|
@@ -2835,7 +2835,7 @@ var ii = class {
|
|
|
2835
2835
|
if (n !== this._generation) return [];
|
|
2836
2836
|
let o = this._sheetName(a);
|
|
2837
2837
|
for (let n of r) {
|
|
2838
|
-
let r =
|
|
2838
|
+
let r = be(Te([{ text: n.text }]), e, t);
|
|
2839
2839
|
for (let e of r) {
|
|
2840
2840
|
let t = e.slices[0], r = n.text.slice(t.start, t.end);
|
|
2841
2841
|
i.push({
|
|
@@ -2851,10 +2851,10 @@ var ii = class {
|
|
|
2851
2851
|
return n === this._generation ? (this._matches = i, this._active = -1, this.matches()) : [];
|
|
2852
2852
|
}
|
|
2853
2853
|
next() {
|
|
2854
|
-
return this._active =
|
|
2854
|
+
return this._active = De(this._active, this._matches.length), this._activePublic();
|
|
2855
2855
|
}
|
|
2856
2856
|
prev() {
|
|
2857
|
-
return this._active =
|
|
2857
|
+
return this._active = Ee(this._active, this._matches.length), this._activePublic();
|
|
2858
2858
|
}
|
|
2859
2859
|
_activePublic() {
|
|
2860
2860
|
let e = this._locationAt(this._active);
|
|
@@ -2905,7 +2905,7 @@ var li = class {
|
|
|
2905
2905
|
e.clearFind();
|
|
2906
2906
|
let t = this.host.worksheet();
|
|
2907
2907
|
if (!t) return;
|
|
2908
|
-
let n = this.host.scale(), r = (e) => Math.round(e * n), i = r(50), a = r(22), o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c =
|
|
2908
|
+
let n = this.host.scale(), r = (e) => Math.round(e * n), i = r(50), a = r(22), o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c = V(t).roundedFrozenExtent(n), l = i + c.width, u = a + c.height, d = this.host.highlightColors(), f = ci(!1, d), p = ci(!0, d);
|
|
2909
2909
|
for (let t of this.controller.sheetHighlights(this.host.currentSheet())) {
|
|
2910
2910
|
let n = this.host.cellRect(t.row, t.col);
|
|
2911
2911
|
if (!n) continue;
|
|
@@ -3100,7 +3100,7 @@ var Si = class {
|
|
|
3100
3100
|
let i = this.host.scale(), a = this.host.canvasArea.getBoundingClientRect(), o = this.host.screenX(e - a.left, 0), s = t - a.top, c = Math.round(50 * i), l = Math.round(22 * i), u = o < c, d = s < l;
|
|
3101
3101
|
if (!u && !d) return null;
|
|
3102
3102
|
if (u && d) return { kind: "corner" };
|
|
3103
|
-
let f =
|
|
3103
|
+
let f = V(r), p = n === "logical" ? {
|
|
3104
3104
|
x: this.host.scrollLeft(),
|
|
3105
3105
|
y: this.host.scrollTop()
|
|
3106
3106
|
} : this.host.displayedViewportOffset();
|
|
@@ -3124,7 +3124,7 @@ var Si = class {
|
|
|
3124
3124
|
getResizeTarget(e, t) {
|
|
3125
3125
|
let n = this.host.worksheet();
|
|
3126
3126
|
if (!n) return null;
|
|
3127
|
-
let r = this.host.scale(), i = this.host.canvasArea.getBoundingClientRect(), a = this.host.screenX(e - i.left, 0), o = t - i.top, s = Math.round(50 * r), c = Math.round(22 * r), l =
|
|
3127
|
+
let r = this.host.scale(), i = this.host.canvasArea.getBoundingClientRect(), a = this.host.screenX(e - i.left, 0), o = t - i.top, s = Math.round(50 * r), c = Math.round(22 * r), l = V(n), u = l.maximumDigitWidth, d = l.axesAtScale(r);
|
|
3128
3128
|
if (o <= c && a > s) {
|
|
3129
3129
|
let n = this.getHeaderHit(e, t);
|
|
3130
3130
|
if (n?.kind !== "col") return null;
|
|
@@ -3177,7 +3177,7 @@ var Si = class {
|
|
|
3177
3177
|
t && e[0] <= t[1] + 1 ? t[1] = Math.max(t[1], e[1]) : i.push([...e]);
|
|
3178
3178
|
}
|
|
3179
3179
|
if (i.reduce((e, [t, n]) => e + n - t + 1, 0) > bi) throw RangeError(`A resize gesture may affect at most ${bi} selected bands.`);
|
|
3180
|
-
let a =
|
|
3180
|
+
let a = V(n), o = e === "col" ? a.col : a.row, s = [];
|
|
3181
3181
|
for (let [e, t] of i) for (let n = e; n <= t; n++) o.sizeOf(n) > 0 && s.push(n);
|
|
3182
3182
|
return s;
|
|
3183
3183
|
}
|
|
@@ -3199,7 +3199,7 @@ var Si = class {
|
|
|
3199
3199
|
}
|
|
3200
3200
|
if (!t && !Vt(n).length && i.reduce((e, t) => e + t.last - t.first + 1, 0) <= bi) return;
|
|
3201
3201
|
let a = [], o = 0;
|
|
3202
|
-
for (let e of
|
|
3202
|
+
for (let e of V(n).row.positiveRanges()) {
|
|
3203
3203
|
for (; o < i.length && i[o].last < e.first;) o++;
|
|
3204
3204
|
for (let t = o; t < i.length && i[t].first <= e.last; t++) {
|
|
3205
3205
|
let n = Math.max(e.first, i[t].first), r = Math.min(e.last, i[t].last);
|
|
@@ -3550,7 +3550,7 @@ var Si = class {
|
|
|
3550
3550
|
this.host.zoomAt(Number.isFinite(t) && Number.isFinite(n) ? {
|
|
3551
3551
|
x: t,
|
|
3552
3552
|
y: n
|
|
3553
|
-
} : null,
|
|
3553
|
+
} : null, he(this.host.scale(), e.deltaY, e.deltaMode));
|
|
3554
3554
|
}, { passive: !1 }), this.on("pointerleave", (e) => {
|
|
3555
3555
|
let t = e.relatedTarget;
|
|
3556
3556
|
t && this.host.comments.contains(t) || this.host.hideCommentPopup();
|
|
@@ -3571,7 +3571,7 @@ var Si = class {
|
|
|
3571
3571
|
col: 1
|
|
3572
3572
|
};
|
|
3573
3573
|
e.preventDefault(), this.host.hideCommentPopup();
|
|
3574
|
-
let a =
|
|
3574
|
+
let a = at(i.row, i.col);
|
|
3575
3575
|
this.host.setSelection(a), this.host.scrollCellIntoView(i.row, i.col), this.host.updateSelectionOverlay(), this.host.updateFindOverlay(), this.host.emitViewportChange();
|
|
3576
3576
|
} else if (e.key === "Escape" && this.resizeDrag?.rowPreview) e.preventDefault(), this.finishResize(this.resizeDrag.pointerId, !1, !0);
|
|
3577
3577
|
else if (e.key === "Escape" && this.host.validation.isOpen()) this.host.hideValidationPanel();
|
|
@@ -3653,7 +3653,7 @@ var Ei = 0, Di = class {
|
|
|
3653
3653
|
if (!e) return;
|
|
3654
3654
|
let t = this.host.scale(), n = this.host.worksheet();
|
|
3655
3655
|
if (!n) return;
|
|
3656
|
-
let r = (e) => Math.round(e * t), i = r(50), a = r(22), o = this.host.canvasArea.clientWidth, s = this.host.canvasArea.clientHeight, c =
|
|
3656
|
+
let r = (e) => Math.round(e * t), i = r(50), a = r(22), o = this.host.canvasArea.clientWidth, s = this.host.canvasArea.clientHeight, c = V(n), l = c.effectiveFrozenBands({
|
|
3657
3657
|
scale: t,
|
|
3658
3658
|
width: o,
|
|
3659
3659
|
height: s,
|
|
@@ -3737,28 +3737,28 @@ var Ei = 0, Di = class {
|
|
|
3737
3737
|
if (!u || !d) continue;
|
|
3738
3738
|
let f = u.x, p = u.y, m = d.x + d.w, _ = d.y + d.h, v = Math.max(f, r.start), S = Math.max(p, n.start), C = Math.min(m, r.end), w = Math.min(_, n.end), T = C - v, E = w - S;
|
|
3739
3739
|
if (T <= 0 || E <= 0) continue;
|
|
3740
|
-
let D = t.kind === "columns" && n === g[0], O = t.kind === "columns" && n === g.at(-1), k = t.kind === "rows" && r === h[0], A = t.kind === "rows" && r === h.at(-1),
|
|
3741
|
-
|
|
3740
|
+
let D = t.kind === "columns" && n === g[0], O = t.kind === "columns" && n === g.at(-1), k = t.kind === "rows" && r === h[0], A = t.kind === "rows" && r === h.at(-1), j = D || e.topEdge && i === e.top && p >= n.start, M = O || e.bottomEdge && a === e.bottom && _ <= n.end, ee = k || e.leftEdge && c === e.left && f >= r.start, N = A || e.rightEdge && l === e.right && m <= r.end, P = this.host.screenX(v, T), te = this.host.isRtl() ? N : ee, F = this.host.isRtl() ? ee : N, ne = [
|
|
3741
|
+
P,
|
|
3742
3742
|
S,
|
|
3743
3743
|
T,
|
|
3744
3744
|
E,
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3745
|
+
j,
|
|
3746
|
+
F,
|
|
3747
|
+
M,
|
|
3748
|
+
te
|
|
3749
3749
|
].join("|");
|
|
3750
|
-
if (y.has(
|
|
3751
|
-
y.add(
|
|
3752
|
-
let re = Math.min(1, T / 2), I = Math.min(1, E / 2), ie = this.host.isRtl() ? A : k,
|
|
3750
|
+
if (y.has(ne)) continue;
|
|
3751
|
+
y.add(ne), b.push(`M${P} ${S}h${T}v${E}h${-T}Z`);
|
|
3752
|
+
let re = Math.min(1, T / 2), I = Math.min(1, E / 2), ie = this.host.isRtl() ? A : k, L = this.host.isRtl() ? k : A, R = (e, t) => e <= 0 || e >= t, ae = P + (ie && R(P, o) ? re : 0), oe = P + T - (L && R(P + T, o) ? re : 0), z = S + (D && R(S, s) ? I : 0), se = w - (O && R(w, s) ? I : 0);
|
|
3753
3753
|
x.push({
|
|
3754
|
-
x:
|
|
3755
|
-
y:
|
|
3756
|
-
width:
|
|
3757
|
-
height:
|
|
3758
|
-
top:
|
|
3759
|
-
right:
|
|
3760
|
-
bottom:
|
|
3761
|
-
left:
|
|
3754
|
+
x: ae,
|
|
3755
|
+
y: z,
|
|
3756
|
+
width: oe - ae,
|
|
3757
|
+
height: se - z,
|
|
3758
|
+
top: j,
|
|
3759
|
+
right: F,
|
|
3760
|
+
bottom: M,
|
|
3761
|
+
left: te
|
|
3762
3762
|
});
|
|
3763
3763
|
}
|
|
3764
3764
|
}
|
|
@@ -3893,7 +3893,7 @@ function Ni(e, t) {
|
|
|
3893
3893
|
}
|
|
3894
3894
|
var Pi = 1 * 1024 * 1024, Fi = 65536;
|
|
3895
3895
|
function Ii(e, t) {
|
|
3896
|
-
return
|
|
3896
|
+
return ke(e, Math.max(0, t));
|
|
3897
3897
|
}
|
|
3898
3898
|
var Li = class {
|
|
3899
3899
|
rows = /* @__PURE__ */ new WeakMap();
|
|
@@ -4088,7 +4088,7 @@ var Gi = 150;
|
|
|
4088
4088
|
function Ki(e) {
|
|
4089
4089
|
let t = /* @__PURE__ */ new Map();
|
|
4090
4090
|
for (let n of e) {
|
|
4091
|
-
let e =
|
|
4091
|
+
let e = B(n.cellRef);
|
|
4092
4092
|
e && t.set(`${e.row}:${e.col}`, n);
|
|
4093
4093
|
}
|
|
4094
4094
|
return t;
|
|
@@ -4207,7 +4207,7 @@ var qi = class {
|
|
|
4207
4207
|
this.resizeObserver?.disconnect(), this.resizeObserver = null, this.hide(), this.commentMap.clear();
|
|
4208
4208
|
}
|
|
4209
4209
|
}, Ji = class {
|
|
4210
|
-
owner = new
|
|
4210
|
+
owner = new Oe("SheetAcquisition");
|
|
4211
4211
|
get current() {
|
|
4212
4212
|
return this.owner.current;
|
|
4213
4213
|
}
|
|
@@ -4228,7 +4228,7 @@ function Yi(e) {
|
|
|
4228
4228
|
rowHeights: { ...e.rowHeights },
|
|
4229
4229
|
colWidths: { ...e.colWidths }
|
|
4230
4230
|
};
|
|
4231
|
-
return e.colCollapsed && (t.colCollapsed = { ...e.colCollapsed }),
|
|
4231
|
+
return e.colCollapsed && (t.colCollapsed = { ...e.colCollapsed }), Xe(e, t), Ln(e, t), U(e, t), Wt(e, t), t;
|
|
4232
4232
|
}
|
|
4233
4233
|
var Xi = class {
|
|
4234
4234
|
scaleValue;
|
|
@@ -4290,7 +4290,7 @@ var Xi = class {
|
|
|
4290
4290
|
this.frameScheduler = typeof r.requestAnimationFrame == "function" && typeof r.cancelAnimationFrame == "function" ? {
|
|
4291
4291
|
requestAnimationFrame: (e) => r.requestAnimationFrame(e),
|
|
4292
4292
|
cancelAnimationFrame: (e) => r.cancelAnimationFrame(e)
|
|
4293
|
-
} : null, this.staticDispatcher = e ? new
|
|
4293
|
+
} : null, this.staticDispatcher = e ? new xe(e, t) : null;
|
|
4294
4294
|
}
|
|
4295
4295
|
begin() {
|
|
4296
4296
|
return this.staticDispatcher ? this.staticDispatcher.begin() : ++this.generation;
|
|
@@ -4724,7 +4724,7 @@ var fa = class {
|
|
|
4724
4724
|
if (!r) throw Error("XlsxViewer requires a document with an active Window");
|
|
4725
4725
|
this.hostWindow = r, this.opts = t, this.gridExtent = da(t), this._mountKind = n.kind, this._nativeScrollbars = t.showScrollbars ?? !0;
|
|
4726
4726
|
let i = t[ta];
|
|
4727
|
-
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode :
|
|
4727
|
+
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode : je("XlsxViewer", t.mode, i), this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.viewport = new Xi(t.cellScale ?? 1), this.wrapper = this.hostDocument.createElement("div"), this.wrapper.style.cssText = `position:relative;width:100%;height:100%;background:${n.kind === "composite" ? "var(--ooxml-xlsx-chrome-surface,#fff)" : "transparent"};box-sizing:border-box;font-family:sans-serif;display:flex;flex-direction:column;`, this.gridRegion = this.hostDocument.createElement("div"), this.gridRegion.style.cssText = "position:relative;flex:1;min-height:0;overflow:hidden;", this.canvasArea = this.hostDocument.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = n.kind === "sheet" ? n.canvas : this.hostDocument.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this.renderDispatcher = new Zi(this.canvas, this._mode === "worker", this.hostWindow), this.scrollHost = this.hostDocument.createElement("div"), this.scrollHost.setAttribute("data-xlsx-viewport-input", n.kind), this.scrollHost.setAttribute("role", "region"), this.scrollHost.setAttribute("aria-label", "Spreadsheet viewport. Use Arrow keys to move the selected cell. Press Enter to show its comment."), this.scrollHost.tabIndex = 0, this.scrollHost.style.cssText = `position:absolute;inset:0;overflow:${this._nativeScrollbars ? "auto" : "clip"};z-index:2;background:transparent;scrollbar-color:var(--ooxml-xlsx-chrome-scrollbar-color,auto);`, this.spacer = this.hostDocument.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this._nativeScrollbars && this.scrollHost.appendChild(this.spacer), this.surface = new $i(this.canvas, this.canvasArea, this.scrollHost), this.overlayHost = new ea(this.canvasArea, this.canvas, this.scrollHost, {
|
|
4728
4728
|
commentMaxWidth: 280,
|
|
4729
4729
|
commentMaxHeight: 200,
|
|
4730
4730
|
validationMaxWidth: ra,
|
|
@@ -4956,13 +4956,13 @@ var fa = class {
|
|
|
4956
4956
|
i = u.worksheet, a = u.release;
|
|
4957
4957
|
let d = () => this.isCurrentSheetRequest(t, n) ? !1 : (a?.(), a = void 0, !0);
|
|
4958
4958
|
if (d()) return;
|
|
4959
|
-
let f = u.partial, p = this.sheetViews.get(e), m = this.initialAnchorReferenceFor(n, e), h = m === void 0 ?
|
|
4959
|
+
let f = u.partial, p = this.sheetViews.get(e), m = this.initialAnchorReferenceFor(n, e), h = m === void 0 ? Ge(i) : void 0, g = h !== void 0;
|
|
4960
4960
|
if (g && (p !== void 0 && !p.parseError || this.viewEdits.hasViewEdits(e))) throw Error(`XLSX viewer cannot establish the initial size of editAs="oneCell" anchors on sheet ${e} after view edits.`);
|
|
4961
4961
|
let _ = (t) => {
|
|
4962
4962
|
let n = t.parseError || p?.parseError ? void 0 : p, r = n ?? this.createVisibleSheetView(t);
|
|
4963
|
-
return (n || u.partial) && (r.rows = t.rows), n || (m && !t.parseError &&
|
|
4963
|
+
return (n || u.partial) && (r.rows = t.rows), n || (m && !t.parseError && ze(r, m), this.viewEdits.restoreSheetViewState(e, r)), r;
|
|
4964
4964
|
}, v = (r, i) => {
|
|
4965
|
-
i &&
|
|
4965
|
+
i && ct(r);
|
|
4966
4966
|
let a = n[Bn];
|
|
4967
4967
|
if (typeof a == "function") {
|
|
4968
4968
|
let e = this.hostDocument.createElement("canvas").getContext("2d");
|
|
@@ -4971,8 +4971,8 @@ var fa = class {
|
|
|
4971
4971
|
this.isCurrentSheetRequest(t, n) && this.viewEdits.syncAutomaticRowOverrides(e, r);
|
|
4972
4972
|
}, y = (e) => {
|
|
4973
4973
|
if (!g || e.parseError || !this.isCurrentSheetRequest(t, n)) return;
|
|
4974
|
-
let r =
|
|
4975
|
-
return r &&
|
|
4974
|
+
let r = Re(e, V(e), this.viewport.scale) ?? null;
|
|
4975
|
+
return r && ze(e, r), r;
|
|
4976
4976
|
};
|
|
4977
4977
|
if (r = _(i), u.partial) {
|
|
4978
4978
|
let e = {
|
|
@@ -4981,7 +4981,7 @@ var fa = class {
|
|
|
4981
4981
|
scale: this.viewport.scale
|
|
4982
4982
|
};
|
|
4983
4983
|
s = e;
|
|
4984
|
-
let t = () =>
|
|
4984
|
+
let t = () => V(r).visibleRange({
|
|
4985
4985
|
width: e.width,
|
|
4986
4986
|
height: e.height,
|
|
4987
4987
|
scale: e.scale,
|
|
@@ -5013,11 +5013,11 @@ var fa = class {
|
|
|
5013
5013
|
} else v(r, !1), c = y(r);
|
|
5014
5014
|
o = f ? u.completion : null;
|
|
5015
5015
|
} catch (e) {
|
|
5016
|
-
if (a?.(), c &&
|
|
5016
|
+
if (a?.(), c && ot(c), !this.isCurrentSheetRequest(t, n)) return;
|
|
5017
5017
|
throw await this.restoreDisplayedWorksheetLease(n, t), e;
|
|
5018
5018
|
}
|
|
5019
5019
|
if (!this.isCurrentSheetRequest(t, n)) {
|
|
5020
|
-
a?.(), c &&
|
|
5020
|
+
a?.(), c && ot(c);
|
|
5021
5021
|
return;
|
|
5022
5022
|
}
|
|
5023
5023
|
this.selectionInput.clearSheetGestures(), this.viewEdits.restoreRowResizeRanges(e, r), c !== void 0 && this.installInitialAnchorReference(n, e, c), this.currentAutoRowHeightsPrepared = l, this.releaseCurrentWorksheet?.(), this.releaseCurrentWorksheet = a ?? null, this.sheetViews.clear(), this.sheetViews.set(e, r), this.currentSheet = e, this.displayedViewport = null, this.currentWorksheet = r, this.previewCompletion = o, this.firstPreviewRender = o !== null, this.previewPreparedViewport = s, o && o.then((i) => {
|
|
@@ -5026,11 +5026,11 @@ var fa = class {
|
|
|
5026
5026
|
let a = !!i.parseError;
|
|
5027
5027
|
this.selectionInput.clearSheetGestures();
|
|
5028
5028
|
let o = this.createVisibleSheetView(i), s = a ? void 0 : this.initialAnchorReferenceFor(n, e);
|
|
5029
|
-
if (s &&
|
|
5029
|
+
if (s && ze(o, s), this.viewEdits.restoreSheetViewState(e, o), this.displayedViewport = null, this.currentWorksheet = o, this.sheetViews.set(e, o), a) {
|
|
5030
5030
|
this.currentSourceComments = [], this.sourceCommentMap.clear(), this.selectionController.reset(), this.emitSelectionChange(), this.updateSelectionOverlay(), this.buildCommentMap(o), this.buildHyperlinkMap(o), this.buildOutline(o), this.layoutGutters(), this.updateSpacerSize(o), this.scheduleRender();
|
|
5031
5031
|
return;
|
|
5032
5032
|
}
|
|
5033
|
-
|
|
5033
|
+
rt(r), ct(r);
|
|
5034
5034
|
let c = this.hostDocument.createElement("canvas").getContext("2d");
|
|
5035
5035
|
c && (n[Bn](o, c), this.currentAutoRowHeightsPrepared = !0), this.viewEdits.syncAutomaticRowOverrides(e, o), this.currentSourceComments = i.comments ?? [], this.sourceCommentMap = Ki(this.currentSourceComments), this.buildCommentMap(o), this.buildHyperlinkMap(o), this.buildOutline(o), this.layoutGutters(), this.updateSpacerSize(o), this.scheduleRender(), this.scheduleSelectionContextNotification();
|
|
5036
5036
|
}).catch((e) => {
|
|
@@ -5063,7 +5063,7 @@ var fa = class {
|
|
|
5063
5063
|
this.initialAnchorWorkbook !== e && (this.releaseInitialAnchorReferences(), this.initialAnchorWorkbook = e), this.initialAnchorReferences.has(t) || this.initialAnchorReferences.set(t, n);
|
|
5064
5064
|
}
|
|
5065
5065
|
releaseInitialAnchorReferences() {
|
|
5066
|
-
for (let e of this.initialAnchorReferences.values()) e &&
|
|
5066
|
+
for (let e of this.initialAnchorReferences.values()) e && ot(e);
|
|
5067
5067
|
this.initialAnchorReferences.clear(), this.initialAnchorWorkbook = null;
|
|
5068
5068
|
}
|
|
5069
5069
|
async restoreDisplayedWorksheetLease(e, t) {
|
|
@@ -5083,7 +5083,7 @@ var fa = class {
|
|
|
5083
5083
|
scrollOutlineSummaryToStart(e, t) {
|
|
5084
5084
|
let n = this.currentWorksheet;
|
|
5085
5085
|
if (!n) return;
|
|
5086
|
-
let r = this.viewport.scale, i =
|
|
5086
|
+
let r = this.viewport.scale, i = V(n).scrollOffsetForCell(e === "row" ? t : 1, e === "col" ? t : 1, {
|
|
5087
5087
|
scale: r,
|
|
5088
5088
|
viewportWidth: this.canvasArea.clientWidth,
|
|
5089
5089
|
viewportHeight: this.canvasArea.clientHeight,
|
|
@@ -5146,7 +5146,7 @@ var fa = class {
|
|
|
5146
5146
|
this.viewport.setOffset(e, this.viewport.y), this._nativeScrollbars && (this.scrollHost.scrollLeft = this.isRtl ? Math.max(0, this.maxScrollLeft - this.viewport.x) : this.viewport.x);
|
|
5147
5147
|
}
|
|
5148
5148
|
screenX(e, t) {
|
|
5149
|
-
return this.isRtl ?
|
|
5149
|
+
return this.isRtl ? vt(e, t, this.canvasArea.clientWidth) : e;
|
|
5150
5150
|
}
|
|
5151
5151
|
resetHorizontalScroll() {
|
|
5152
5152
|
this.viewport.setOffset(0, this.viewport.y), this._nativeScrollbars && (this.scrollHost.scrollLeft = this.isRtl ? this.maxScrollLeft : 0);
|
|
@@ -5200,7 +5200,7 @@ var fa = class {
|
|
|
5200
5200
|
this.reanchorHorizontalScroll(), this.layoutGutters(), this.currentWorksheet && this.updateSpacerSize(this.currentWorksheet), await this.renderCurrentSheet(), this.updateSelectionOverlay(), this.updateFindOverlay();
|
|
5201
5201
|
}
|
|
5202
5202
|
async scrollToCell(e, t = {}) {
|
|
5203
|
-
let n =
|
|
5203
|
+
let n = B(e);
|
|
5204
5204
|
!n || !this.currentWorksheet || (this.previewCompletion && await this.previewCompletion, this._scrollCellIntoView(n.row, n.col, t.align ?? "nearest"), await this.renderCurrentSheet(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.emitViewportChange());
|
|
5205
5205
|
}
|
|
5206
5206
|
_stepSheet(e) {
|
|
@@ -5229,7 +5229,7 @@ var fa = class {
|
|
|
5229
5229
|
x: this.effectiveScrollLeft,
|
|
5230
5230
|
y: this.viewportTop
|
|
5231
5231
|
} : this.displayedViewportOffset();
|
|
5232
|
-
return
|
|
5232
|
+
return V(r).cellAt(u, d, {
|
|
5233
5233
|
scrollX: f.x,
|
|
5234
5234
|
scrollY: f.y,
|
|
5235
5235
|
scale: i
|
|
@@ -5240,7 +5240,7 @@ var fa = class {
|
|
|
5240
5240
|
if (!e) return null;
|
|
5241
5241
|
let t = this.canvasArea.clientWidth, n = this.canvasArea.clientHeight;
|
|
5242
5242
|
if (t <= 0 || n <= 0) return null;
|
|
5243
|
-
let r = this.viewport.scale, i =
|
|
5243
|
+
let r = this.viewport.scale, i = V(e).visibleRange({
|
|
5244
5244
|
width: t,
|
|
5245
5245
|
height: n,
|
|
5246
5246
|
scale: r,
|
|
@@ -5275,7 +5275,7 @@ var fa = class {
|
|
|
5275
5275
|
let n = this.currentWorksheet;
|
|
5276
5276
|
if (!n) return null;
|
|
5277
5277
|
let r = this.viewport.scale;
|
|
5278
|
-
return
|
|
5278
|
+
return V(n).cellRect(e, t, {
|
|
5279
5279
|
scale: r,
|
|
5280
5280
|
scrollX: this.displayedViewportOffset().x,
|
|
5281
5281
|
scrollY: this.displayedViewportOffset().y,
|
|
@@ -5285,7 +5285,7 @@ var fa = class {
|
|
|
5285
5285
|
}
|
|
5286
5286
|
getCellViewportRect(e) {
|
|
5287
5287
|
if (this._destroyed) return null;
|
|
5288
|
-
let t = typeof e == "string" ?
|
|
5288
|
+
let t = typeof e == "string" ? B(e) : e;
|
|
5289
5289
|
if (!t || t.row < 1 || t.col < 1) return null;
|
|
5290
5290
|
let n = this._cellRect(t.row, t.col);
|
|
5291
5291
|
return n ? Object.freeze({
|
|
@@ -5299,12 +5299,12 @@ var fa = class {
|
|
|
5299
5299
|
return this.assertOpen(), structuredClone(this.currentSourceComments);
|
|
5300
5300
|
}
|
|
5301
5301
|
async goToComment(e, t, n) {
|
|
5302
|
-
let r =
|
|
5302
|
+
let r = B(t), i = this.wb;
|
|
5303
5303
|
if (!r || !i || !Number.isInteger(e) || e < 0 || e >= i.sheetCount) return !1;
|
|
5304
5304
|
let a = ++this.commentNavigationGeneration, o = e === this.currentSheet && this.currentWorksheet !== null ? this.currentSourceComments : await i.getComments(e);
|
|
5305
5305
|
if (this._destroyed) throw this.destroyedError();
|
|
5306
5306
|
if (a !== this.commentNavigationGeneration || i !== this.wb || !o.some((e) => {
|
|
5307
|
-
let t =
|
|
5307
|
+
let t = B(e.cellRef);
|
|
5308
5308
|
return t?.row === r.row && t.col === r.col;
|
|
5309
5309
|
})) return !1;
|
|
5310
5310
|
if (e !== this.currentSheet || this.currentWorksheet === null) {
|
|
@@ -5349,7 +5349,7 @@ var fa = class {
|
|
|
5349
5349
|
refitAutoRowsAfterColumnResize() {
|
|
5350
5350
|
let e = this.currentWorksheet, t = this.preparedWorkbook;
|
|
5351
5351
|
if (!e || !t) return;
|
|
5352
|
-
|
|
5352
|
+
ct(e, this.viewEdits.manualRows(this.currentSheet));
|
|
5353
5353
|
let n = t[Bn];
|
|
5354
5354
|
if (typeof n != "function") return;
|
|
5355
5355
|
let r = this.hostDocument.createElement("canvas").getContext("2d");
|
|
@@ -5393,7 +5393,7 @@ var fa = class {
|
|
|
5393
5393
|
_scrollCellIntoView(e, t, n = "nearest") {
|
|
5394
5394
|
let r = this.currentWorksheet;
|
|
5395
5395
|
if (!r) return;
|
|
5396
|
-
let i = this.viewport.scale, a =
|
|
5396
|
+
let i = this.viewport.scale, a = V(r).scrollOffsetForCell(e, t, {
|
|
5397
5397
|
scale: i,
|
|
5398
5398
|
viewportWidth: this.canvasArea.clientWidth,
|
|
5399
5399
|
viewportHeight: this.canvasArea.clientHeight,
|
|
@@ -5419,7 +5419,7 @@ var fa = class {
|
|
|
5419
5419
|
commentRefs: [],
|
|
5420
5420
|
comments: []
|
|
5421
5421
|
};
|
|
5422
|
-
return
|
|
5422
|
+
return Xe(t, e), Ln(t, e), U(t, e), e;
|
|
5423
5423
|
}
|
|
5424
5424
|
if ((typeof this.opts.comments == "object" ? this.opts.comments : void 0)?.includeResolved !== !1) return t;
|
|
5425
5425
|
let n = new Set((t.comments ?? []).filter((e) => e.resolved === !0).map((e) => e.cellRef));
|
|
@@ -5429,7 +5429,7 @@ var fa = class {
|
|
|
5429
5429
|
commentRefs: t.commentRefs?.filter((e) => !n.has(e)),
|
|
5430
5430
|
comments: t.comments?.filter((e) => !n.has(e.cellRef))
|
|
5431
5431
|
};
|
|
5432
|
-
return
|
|
5432
|
+
return Xe(t, r), Ln(t, r), U(t, r), r;
|
|
5433
5433
|
}
|
|
5434
5434
|
buildHyperlinkMap(e) {
|
|
5435
5435
|
this.hyperlinks.build(e);
|
|
@@ -5449,8 +5449,8 @@ var fa = class {
|
|
|
5449
5449
|
if (this.viewport.setScale(i), this.zoomControl?.sync(i, r, t, n), this.currentWorksheet) {
|
|
5450
5450
|
let e = this.effectiveScrollLeft, t = this.viewportTop;
|
|
5451
5451
|
if (this.layoutGutters(), this.updateSpacerSize(this.currentWorksheet), o) {
|
|
5452
|
-
this.viewportTop =
|
|
5453
|
-
let n = this.screenX(o.x, 0), r = this.maxScrollLeft, s =
|
|
5452
|
+
this.viewportTop = ve(t, o.y, a, i, { maxScroll: this.maxScrollTop });
|
|
5453
|
+
let n = this.screenX(o.x, 0), r = this.maxScrollLeft, s = ve(e, n, a, i, { maxScroll: r });
|
|
5454
5454
|
this.setViewportLeft(s);
|
|
5455
5455
|
} else this.setViewportLeft(e);
|
|
5456
5456
|
}
|
|
@@ -5461,10 +5461,10 @@ var fa = class {
|
|
|
5461
5461
|
return this.viewport.scale;
|
|
5462
5462
|
}
|
|
5463
5463
|
zoomIn() {
|
|
5464
|
-
this.setScale(
|
|
5464
|
+
this.setScale(Se(this.getScale()));
|
|
5465
5465
|
}
|
|
5466
5466
|
zoomOut() {
|
|
5467
|
-
this.setScale(
|
|
5467
|
+
this.setScale(Ne(this.getScale()));
|
|
5468
5468
|
}
|
|
5469
5469
|
fitWidth() {
|
|
5470
5470
|
this._fit("width");
|
|
@@ -5475,7 +5475,7 @@ var fa = class {
|
|
|
5475
5475
|
_fit(e) {
|
|
5476
5476
|
let t = this.currentWorksheet;
|
|
5477
5477
|
if (!t) return;
|
|
5478
|
-
let { width: n, height: r } = this._naturalContentExtent(t), i =
|
|
5478
|
+
let { width: n, height: r } = this._naturalContentExtent(t), i = Pe({
|
|
5479
5479
|
contentWidth: n,
|
|
5480
5480
|
contentHeight: r,
|
|
5481
5481
|
containerWidth: this.canvasArea.clientWidth,
|
|
@@ -5485,12 +5485,12 @@ var fa = class {
|
|
|
5485
5485
|
}
|
|
5486
5486
|
_naturalContentExtent(e) {
|
|
5487
5487
|
let { maxRow: t, maxCol: n } = Rn(e, this.gridExtent);
|
|
5488
|
-
return
|
|
5488
|
+
return V(e).logicalContentExtent(t, n, 50, 22);
|
|
5489
5489
|
}
|
|
5490
5490
|
updateSpacerSize(e) {
|
|
5491
5491
|
let t = this.viewport.scale, { maxRow: n, maxCol: r } = Rn(e, this.gridExtent);
|
|
5492
5492
|
n += this.gridExtent.marginRows, r += this.gridExtent.marginCols;
|
|
5493
|
-
let i =
|
|
5493
|
+
let i = V(e).roundedContentExtent(n, r, t, 50, 22), a = i.width, o = i.height;
|
|
5494
5494
|
this.spacer.style.width = `${a}px`, this.spacer.style.height = `${o}px`, this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.viewport.setExtent(a, o), this.setViewportLeft(this.viewport.x), this.viewportTop = this.viewport.y;
|
|
5495
5495
|
}
|
|
5496
5496
|
scheduleRender(e = !1) {
|
|
@@ -5521,7 +5521,7 @@ var fa = class {
|
|
|
5521
5521
|
}
|
|
5522
5522
|
let t = this.currentWorksheet, n = this.canvasArea.clientWidth, r = this.canvasArea.clientHeight;
|
|
5523
5523
|
if (n <= 0 || r <= 0) return;
|
|
5524
|
-
let i = this.viewport.scale, a = this.surface.dpr, o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c = this.effectiveScrollLeft, l = this.viewportTop, u =
|
|
5524
|
+
let i = this.viewport.scale, a = this.surface.dpr, o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c = this.effectiveScrollLeft, l = this.viewportTop, u = V(t).visibleRange({
|
|
5525
5525
|
width: n,
|
|
5526
5526
|
height: r,
|
|
5527
5527
|
scale: i,
|
|
@@ -5551,7 +5551,7 @@ var fa = class {
|
|
|
5551
5551
|
} : void 0, b = Dn(_ ? {
|
|
5552
5552
|
...g,
|
|
5553
5553
|
sizeOverrides: _.overrides
|
|
5554
|
-
} : g,
|
|
5554
|
+
} : g, V(t).maximumDigitWidth, {
|
|
5555
5555
|
worksheet: t,
|
|
5556
5556
|
projection: y
|
|
5557
5557
|
});
|
|
@@ -5622,8 +5622,8 @@ var fa = class {
|
|
|
5622
5622
|
}
|
|
5623
5623
|
constructor(e, t = {}) {
|
|
5624
5624
|
this.canvasElement = e;
|
|
5625
|
-
let n = t[ta], r =
|
|
5626
|
-
this.canvasMount = new
|
|
5625
|
+
let n = t[ta], r = je("XlsxSheetViewer", t.mode, n), i = e.getBoundingClientRect();
|
|
5626
|
+
this.canvasMount = new Ae(e, {
|
|
5627
5627
|
wrapperCssText: `position:relative;display:inline-block;vertical-align:top;overflow:hidden;width:${e.style.width || `${i.width || e.width}px`};height:${e.style.height || `${i.height || e.height}px`};`,
|
|
5628
5628
|
restoreMode: "style-and-bitmap"
|
|
5629
5629
|
}), this.engine = new fa(this.canvasMount.wrapper, {
|
|
@@ -5798,17 +5798,17 @@ var fa = class {
|
|
|
5798
5798
|
MAX_SELECTION_AREAS: () => 128,
|
|
5799
5799
|
MAX_SELECTION_CONTEXT_CELLS: () => mr,
|
|
5800
5800
|
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () => hr,
|
|
5801
|
-
OoxmlDecodedImageLimitError: () =>
|
|
5802
|
-
OoxmlError: () =>
|
|
5803
|
-
OoxmlResourceLimitError: () =>
|
|
5804
|
-
TiffDecodeError: () =>
|
|
5801
|
+
OoxmlDecodedImageLimitError: () => se,
|
|
5802
|
+
OoxmlError: () => t,
|
|
5803
|
+
OoxmlResourceLimitError: () => g,
|
|
5804
|
+
TiffDecodeError: () => me,
|
|
5805
5805
|
XlsxSheetViewer: () => ma,
|
|
5806
5806
|
XlsxViewer: () => pa,
|
|
5807
5807
|
XlsxWorkbook: () => Un,
|
|
5808
|
-
autoResize: () =>
|
|
5809
|
-
isOoxmlDecodedImageLimitError: () =>
|
|
5810
|
-
isTiffDecodeError: () =>
|
|
5811
|
-
openExternalHyperlink: () =>
|
|
5812
|
-
resolveSharedStrings: () =>
|
|
5808
|
+
autoResize: () => ge,
|
|
5809
|
+
isOoxmlDecodedImageLimitError: () => z,
|
|
5810
|
+
isTiffDecodeError: () => pe,
|
|
5811
|
+
openExternalHyperlink: () => I,
|
|
5812
|
+
resolveSharedStrings: () => St
|
|
5813
5813
|
});
|
|
5814
5814
|
export { mr as a, On as c, pr as i, Dn as l, ma as n, hr as o, pa as r, Un as s, ha as t };
|