@silurus/ooxml 0.82.1 → 0.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +72 -3
  2. package/dist/assets/{render-worker-Cy-QsDge.js → render-worker-Bu31cf1J.js} +4 -4
  3. package/dist/assets/render-worker-DuztdEcX.js +11 -0
  4. package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
  5. package/dist/{comment-ui-runtime-C1RV_3iu.js → comment-ui-runtime-BelHJt73.js} +2 -2
  6. package/dist/{comment-ui-runtime-DgCZpPR0.js → comment-ui-runtime-DD5a3x3k.js} +2 -2
  7. package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
  8. package/dist/{document-pull-client-B1WOjA0z.js → document-pull-client-BAhqoTmm.js} +4508 -3952
  9. package/dist/docx-Dg73PGgC.js +2707 -0
  10. package/dist/docx.mjs +6 -6
  11. package/dist/docx_parser_bg.wasm +0 -0
  12. package/dist/dom-interaction-boundary-CepOlXt6.js +217 -0
  13. package/dist/index.mjs +4 -4
  14. package/dist/line-distribute-D7A_wnJg.js +1003 -0
  15. package/dist/{line-metrics-B3syvDn2.js → line-metrics-Bpn7OeZD.js} +616 -616
  16. package/dist/node.mjs +308 -308
  17. package/dist/pptx-BcUCETmQ.js +2990 -0
  18. package/dist/pptx.mjs +5 -5
  19. package/dist/pptx_parser_bg.wasm +0 -0
  20. package/dist/{render-BC8p7vZQ.js → render-CL-7V3E8.js} +1 -1
  21. package/dist/{render-worker-host-DhnkTyjj.js → render-worker-host-DDZo0feh.js} +1 -1
  22. package/dist/{render-worker-host-BNnXCtAu.js → render-worker-host-FJ19-fUI.js} +1 -1
  23. package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
  24. package/dist/{session-Da7LEQUB.js → session-BjydZEDF.js} +107 -94
  25. package/dist/{slide-pull-client-Bg9DusLX.js → slide-pull-client-CwvvncPA.js} +1158 -935
  26. package/dist/types/docx.d.ts +98 -8
  27. package/dist/types/index.d.ts +184 -13
  28. package/dist/types/node.d.ts +2 -2
  29. package/dist/types/pptx.d.ts +94 -5
  30. package/dist/types/xlsx.d.ts +2 -2
  31. package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
  32. package/dist/{xlsx-DMWeXT-c.js → xlsx-BibrHQ52.js} +476 -476
  33. package/dist/xlsx.mjs +5 -5
  34. package/dist/xlsx_parser_bg.wasm +0 -0
  35. package/package.json +3 -1
  36. package/dist/assets/render-worker-aHayzR7v.js +0 -11
  37. package/dist/docx-HoZXZUPA.js +0 -2162
  38. package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
  39. package/dist/line-distribute-iXsUCIH-.js +0 -1003
  40. package/dist/pptx-DEUP4Yq5.js +0 -2432
  41. /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-X54si2ob.js} +0 -0
  42. /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-Hes0z_Mj.js} +0 -0
@@ -1275,7 +1275,7 @@ interface ChartRegionMapRenderer {
1275
1275
  render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
1276
1276
  }
1277
1277
  //#endregion
1278
- //#region dist/.types-work/hyperlink-CZoV-4B8.d.ts
1278
+ //#region dist/.types-work/hyperlink-Bk5fiM_m.d.ts
1279
1279
  type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
1280
1280
  type OoxmlErrorStage = 'container' | 'decompression' | 'parsing' | 'serialization' | 'layout' | 'rendering' | 'worker';
1281
1281
  declare class OoxmlError extends Error {
@@ -1348,6 +1348,14 @@ interface OoxmlResourceLimits {
1348
1348
  maxTotalInflatedBytes?: OoxmlResourceLimit;
1349
1349
  maxArchiveEntries?: OoxmlResourceLimit;
1350
1350
  }
1351
+ interface ProgressiveLayoutProgress {
1352
+ committedUnits: number;
1353
+ }
1354
+ interface ProgressiveLayoutPartial {
1355
+ availableUnits: number;
1356
+ totalUnits?: number;
1357
+ exact: boolean;
1358
+ }
1351
1359
  interface LoadOptions$1 {
1352
1360
  useGoogleFonts?: boolean;
1353
1361
  password?: string;
@@ -1704,7 +1712,7 @@ interface PictureElement {
1704
1712
  sp3d?: Sp3d;
1705
1713
  }
1706
1714
  //#endregion
1707
- //#region dist/.types-work/pptx-CZHOWYdz.d.ts
1715
+ //#region dist/.types-work/pptx-Btl3_eEe.d.ts
1708
1716
  interface PptxTextRunInfo {
1709
1717
  elementIndex?: number;
1710
1718
  origin?: SlideElementOrigin;
@@ -1829,6 +1837,10 @@ interface PptxElementBounds {
1829
1837
  type PptxSelectionContext = PptxTextSelectionContext | PptxCommentSelectionContext | PptxElementContext;
1830
1838
  type LoadOptions = LoadOptions$1 & {
1831
1839
  mode?: 'main' | 'worker';
1840
+ progressiveLayout?: boolean;
1841
+ onLayoutProgress?: (progress: Readonly<ProgressiveLayoutProgress>) => void;
1842
+ onLayoutPartial?: (progress: Readonly<ProgressiveLayoutPartial>) => void;
1843
+ onLayoutComplete?: (error?: unknown) => void;
1832
1844
  };
1833
1845
  interface RenderSlideToBitmapOptions {
1834
1846
  width?: number;
@@ -1851,13 +1863,27 @@ declare class PptxPresentation {
1851
1863
  private readonly _worker;
1852
1864
  private readonly _bridge;
1853
1865
  private _mode;
1866
+ private _bootstrap;
1854
1867
  private _preflight;
1868
+ private _availableSlideCount;
1869
+ private readonly _layoutLifecycle;
1870
+ private readonly _layoutObservers;
1871
+ private _layoutCompletion;
1872
+ private _parseRequestId;
1873
+ private _progressive;
1874
+ private _progressiveWatchdog;
1875
+ private _progressiveWatchdogMs;
1876
+ private readonly _layoutWaiters;
1855
1877
  private _slides;
1856
1878
  private _slidePullClient;
1857
1879
  private _resourceFailure;
1858
1880
  private _slidePartIndex;
1859
1881
  private readonly _rawParts;
1860
1882
  private _googleFontFaces;
1883
+ private _embeddedFontFaces;
1884
+ private _embeddedFontAliases;
1885
+ private _embeddedFontAuthoredFamilies;
1886
+ private _destroyed;
1861
1887
  private readonly _fetchImage;
1862
1888
  private readonly _fetchMedia;
1863
1889
  private _math;
@@ -1869,7 +1895,22 @@ declare class PptxPresentation {
1869
1895
  private _rethrowWithResourceFailure;
1870
1896
  static load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<PptxPresentation>;
1871
1897
  private _parse;
1898
+ private _parseMainProgressively;
1899
+ private _parseWorkerProgressively;
1900
+ private _createSlidePullClient;
1901
+ private _onWorkerLayoutPush;
1902
+ private _applyProgressivePrefix;
1903
+ private _finishProgressiveLayout;
1904
+ private _failProgressiveLayout;
1905
+ private _wakeLayoutWaiters;
1906
+ private _rearmProgressiveWatchdog;
1907
+ private _clearProgressiveWatchdog;
1908
+ private _waitForSlide;
1909
+ private _assertSlideIndex;
1872
1910
  get slideCount(): number;
1911
+ get availableSlideCount(): number;
1912
+ get layoutComplete(): boolean;
1913
+ waitUntilLayoutComplete(): Promise<void>;
1873
1914
  get slideWidth(): number;
1874
1915
  get slideHeight(): number;
1875
1916
  get mode(): 'main' | 'worker';
@@ -1888,6 +1929,7 @@ declare class PptxPresentation {
1888
1929
  getMedia(mediaPath: string): Promise<Blob>;
1889
1930
  private _findMimeTypeForPath;
1890
1931
  getImage(imagePath: string, mimeType: string): Promise<Blob>;
1932
+ private getFontBytes;
1891
1933
  getResourceMetrics(): Promise<OoxmlResourceMetrics>;
1892
1934
  toMarkdown(): Promise<string>;
1893
1935
  presentSlide(canvas: HTMLCanvasElement, slideIndex: number, opts?: PresentSlideOptions): Promise<PresentationHandle>;
@@ -1895,7 +1937,7 @@ declare class PptxPresentation {
1895
1937
  }
1896
1938
  type HiddenSlideMode = 'show' | 'skip' | 'dim';
1897
1939
  interface PptxViewerOptions extends Pick<RenderOptions, 'width' | 'dpr'>, LoadOptions {
1898
- onSlideChange?: (index: number, total: number) => void;
1940
+ onSlideChange?: (index: number, total: number, layoutComplete: boolean) => void;
1899
1941
  onError?: (err: Error) => void;
1900
1942
  zoomMin?: number;
1901
1943
  zoomMax?: number;
@@ -1921,6 +1963,7 @@ declare class PptxViewer implements ZoomableViewer {
1921
1963
  private highlightLayer;
1922
1964
  private elementLayer;
1923
1965
  private _find;
1966
+ private _findGeneration;
1924
1967
  private _measureCtx;
1925
1968
  private readonly presentationOwner;
1926
1969
  private get engine();
@@ -1928,6 +1971,7 @@ declare class PptxViewer implements ZoomableViewer {
1928
1971
  private readonly hostWindow;
1929
1972
  private readonly opts;
1930
1973
  private currentSlide;
1974
+ private _renderedSlide;
1931
1975
  private _hiddenMode;
1932
1976
  private handle;
1933
1977
  private readonly _mode;
@@ -1941,10 +1985,21 @@ declare class PptxViewer implements ZoomableViewer {
1941
1985
  private elementContext;
1942
1986
  private elementHitGeneration;
1943
1987
  private readonly elementHitTolerance;
1988
+ private readonly _loadingLayer;
1989
+ private _layoutUnsubscribe;
1990
+ private readonly _layoutWaiters;
1991
+ private _layoutFailed;
1992
+ private _navigationGeneration;
1993
+ private _renderProgressGeneration;
1994
+ private _lastReportedSlide;
1995
+ private _lastReportedTotal;
1996
+ private _lastReportedAvailable;
1997
+ private _lastReportedLayoutComplete;
1944
1998
  static fromPresentation(canvas: HTMLCanvasElement, presentation: PptxPresentation, opts?: Omit<PptxViewerOptions, keyof LoadOptions>): Omit<PptxViewer, 'load'>;
1945
1999
  constructor(canvas: HTMLCanvasElement, opts?: PptxViewerOptions);
1946
2000
  load(source: string | ArrayBuffer): Promise<void>;
1947
2001
  goToSlide(index: number): Promise<void>;
2002
+ private _goToSlide;
1948
2003
  nextSlide(): Promise<void>;
1949
2004
  prevSlide(): Promise<void>;
1950
2005
  private _step;
@@ -1955,6 +2010,9 @@ declare class PptxViewer implements ZoomableViewer {
1955
2010
  get visibleSlideCount(): number;
1956
2011
  get slideIndex(): number;
1957
2012
  get slideCount(): number;
2013
+ get availableSlideCount(): number;
2014
+ get layoutComplete(): boolean;
2015
+ waitUntilLayoutComplete(): Promise<void>;
1958
2016
  getNotes(slideIndex: number): string | null;
1959
2017
  get canvasElement(): HTMLCanvasElement;
1960
2018
  private _naturalWidthPx;
@@ -1969,6 +2027,14 @@ declare class PptxViewer implements ZoomableViewer {
1969
2027
  fitPage(): Promise<void>;
1970
2028
  private _fit;
1971
2029
  private renderCurrentSlide;
2030
+ private _bindLayoutPresentation;
2031
+ private _unbindLayoutPresentation;
2032
+ private _beginNavigation;
2033
+ private _onLayoutPublication;
2034
+ private _waitForSlide;
2035
+ private _wakeLayoutWaiters;
2036
+ private _emitSlideChange;
2037
+ private _setLoading;
1972
2038
  private _buildHighlightLayer;
1973
2039
  private _measureForFont;
1974
2040
  private _collectSlideRuns;
@@ -1976,6 +2042,7 @@ declare class PptxViewer implements ZoomableViewer {
1976
2042
  findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
1977
2043
  findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
1978
2044
  clearFind(): void;
2045
+ private _invalidateFind;
1979
2046
  private _activateMatch;
1980
2047
  private _redrawHighlights;
1981
2048
  private _buildTextLayer;
@@ -2023,7 +2090,7 @@ interface PptxScrollViewerOptions extends Pick<RenderSlideOptions, 'width' | 'dp
2023
2090
  refitOnResize?: boolean;
2024
2091
  background?: string;
2025
2092
  pageShadow?: string | false;
2026
- onVisibleSlideChange?: (topIndex: number, total: number) => void;
2093
+ onVisibleSlideChange?: (topIndex: number, total: number, layoutComplete: boolean) => void;
2027
2094
  onScaleChange?: (scale: number) => void;
2028
2095
  onError?: (err: Error) => void;
2029
2096
  onHyperlinkClick?: (target: HyperlinkTarget) => void;
@@ -2034,6 +2101,7 @@ declare class PptxScrollViewer implements ZoomableViewer {
2034
2101
  private get _pres();
2035
2102
  private readonly _borrowed;
2036
2103
  private readonly _opts;
2104
+ private readonly _errorRouter;
2037
2105
  private readonly _container;
2038
2106
  private readonly _wrapper;
2039
2107
  private readonly _scrollHost;
@@ -2047,6 +2115,9 @@ declare class PptxScrollViewer implements ZoomableViewer {
2047
2115
  private _uniformSlideHeight;
2048
2116
  private _lastRange;
2049
2117
  private _lastTopIndex;
2118
+ private _lastReportedTotal;
2119
+ private _lastReportedLayoutComplete;
2120
+ private _layoutUnsubscribe;
2050
2121
  private _scrollListener;
2051
2122
  private _selectionChangeListener;
2052
2123
  private _selectionContextKey;
@@ -2062,6 +2133,10 @@ declare class PptxScrollViewer implements ZoomableViewer {
2062
2133
  private _commentGeometryFrame;
2063
2134
  private readonly _pendingCommentGeometry;
2064
2135
  private _hasComments;
2136
+ private _reviewOriginPx;
2137
+ private _commentScanFrontier;
2138
+ private readonly _layoutWaiters;
2139
+ private _layoutFailed;
2065
2140
  private _elementHitGeneration;
2066
2141
  private readonly _elementHitTolerance;
2067
2142
  private _destroyed;
@@ -2075,12 +2150,16 @@ declare class PptxScrollViewer implements ZoomableViewer {
2075
2150
  private _lastFitWidth;
2076
2151
  private readonly _pageShadow;
2077
2152
  private readonly _find;
2153
+ private _findGeneration;
2078
2154
  private _findActive;
2079
2155
  private _findMeasureCtx;
2080
2156
  static fromPresentation(container: HTMLElement, presentation: PptxPresentation, opts?: Omit<PptxScrollViewerOptions, keyof LoadOptions>): Omit<PptxScrollViewer, 'load'>;
2081
2157
  constructor(container: HTMLElement, opts?: PptxScrollViewerOptions);
2082
2158
  load(source: string | ArrayBuffer): Promise<void>;
2083
2159
  get slideCount(): number;
2160
+ get availableSlideCount(): number;
2161
+ get layoutComplete(): boolean;
2162
+ waitUntilLayoutComplete(): Promise<void>;
2084
2163
  private _slideWidthPx;
2085
2164
  private _slideHeightPx;
2086
2165
  private _fitWidthPx;
@@ -2091,7 +2170,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
2091
2170
  private _commentsOptions;
2092
2171
  private _commentSide;
2093
2172
  private _syncCommentMarginGeometry;
2094
- private _presentationHasComments;
2173
+ private _scanAvailableComments;
2174
+ private _refreshDiscoveredComments;
2095
2175
  private _baseScale;
2096
2176
  relayout(): void;
2097
2177
  private _relayout;
@@ -2117,6 +2197,14 @@ declare class PptxScrollViewer implements ZoomableViewer {
2117
2197
  private _positionSlot;
2118
2198
  private _dpr;
2119
2199
  private _renderSlot;
2200
+ private _trackSlotLoading;
2201
+ private _bindLayoutPresentation;
2202
+ private _unbindLayoutPresentation;
2203
+ private _onLayoutPublication;
2204
+ private _wakeLayoutWaiters;
2205
+ private _beginCommentNavigation;
2206
+ private _waitForSlideMetadata;
2207
+ private _emitVisibleSlideChange;
2120
2208
  private _renderInteractiveSlot;
2121
2209
  private _syncMediaPlayback;
2122
2210
  private _reportRenderError;
@@ -2146,6 +2234,7 @@ declare class PptxScrollViewer implements ZoomableViewer {
2146
2234
  findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
2147
2235
  findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
2148
2236
  clearFind(): void;
2237
+ private _invalidateFind;
2149
2238
  private _activateMatch;
2150
2239
  private _collectSlideRuns;
2151
2240
  private _redrawHighlights;
@@ -1081,7 +1081,7 @@ interface ChartRegionMapRenderer {
1081
1081
  render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
1082
1082
  }
1083
1083
  //#endregion
1084
- //#region dist/.types-work/hyperlink-CZoV-4B8.d.ts
1084
+ //#region dist/.types-work/hyperlink-Bk5fiM_m.d.ts
1085
1085
  type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
1086
1086
  type OoxmlErrorStage = 'container' | 'decompression' | 'parsing' | 'serialization' | 'layout' | 'rendering' | 'worker';
1087
1087
  declare class OoxmlError extends Error {
@@ -1984,7 +1984,7 @@ interface XlsxRenderViewportOptions {
1984
1984
  } | null;
1985
1985
  }
1986
1986
  //#endregion
1987
- //#region dist/.types-work/xlsx-_-beyOtw.d.ts
1987
+ //#region dist/.types-work/xlsx-BjLUPERo.d.ts
1988
1988
  type ResolvedList = {
1989
1989
  kind: 'values';
1990
1990
  values: string[];
@@ -1,8 +1,8 @@
1
- import { $ as e, F as t, I as n, N as r, P as i, Q as a, X as o, Y as s, Yt as c, Z as l, et as u, nt as d, ot as f, rt as p, tt as m } from "./line-metrics-B3syvDn2.js";
2
- import { n as h, r as g, t as _ } from "./resource-measurement-CsW4_eYt.js";
1
+ import { F as e, Gt as t, I as n, Jt as r, K as i, Kt as a, N as o, P as s, Qt as c, U as l, Ut as u, Wt as d, Xt as f, Yt as p, qt as m } from "./line-metrics-Bpn7OeZD.js";
2
+ import { n as h, r as g, t as _ } from "./resource-measurement-DuiFWzam.js";
3
3
  import { t as v } from "./transfer-R6NjgBKD.js";
4
4
  //#region packages/xlsx/src/worksheet-resource-limits.ts
5
- var y = d, b = e, x = u, S = m, C = a, w = s, T = o, E = l, D = Object.freeze({
5
+ var y = f, b = m, x = r, S = p, C = a, w = u, T = d, E = t, D = Object.freeze({
6
6
  archiveEntryCount: 0,
7
7
  declaredInflatedBytes: 0,
8
8
  distinctInflatedBytes: 0,
@@ -159,7 +159,7 @@ var z = 64 * 1024 * 1024, B = class {
159
159
  get pendingOpenCount() {
160
160
  return this.pendingOpens.size;
161
161
  }
162
- async open(e, n, r) {
162
+ async open(t, n, r) {
163
163
  if (this.resourceFailure) throw this.resourceFailure;
164
164
  let i = this.pendingOpens.get(r.sessionId);
165
165
  if (!i || i.identity.operationId !== r.operationId || i.identity.generation !== r.generation) throw Error("worksheet pull session open reservation is stale or missing");
@@ -167,12 +167,12 @@ var z = 64 * 1024 * 1024, B = class {
167
167
  a = e;
168
168
  }), s = this.operationTail.then(() => this.coordinator.enqueue(async () => {
169
169
  if (i.canceled) throw Error("worksheet pull session open was canceled");
170
- this.executeArchive((t) => t.open_sheet_cursor(e, n));
170
+ this.executeArchive((e) => e.open_sheet_cursor(t, n));
171
171
  let o = [], s = {
172
172
  rows: 0,
173
173
  cells: 0,
174
174
  ownedUtf8Bytes: 0
175
- }, l, u = !1, d = new t({
175
+ }, l, u = !1, d = new e({
176
176
  ...r,
177
177
  maxByteCredit: z,
178
178
  coordinator: this.coordinator,
@@ -202,7 +202,7 @@ var z = 64 * 1024 * 1024, B = class {
202
202
  measureChunk: ({ payload: e }) => e.byteLength,
203
203
  acknowledge: () => {
204
204
  if (!u) return;
205
- let t, n;
205
+ let e, n;
206
206
  try {
207
207
  if (this.acceptWorksheet) {
208
208
  if (!l) throw Error("worksheet terminal payload is missing");
@@ -213,12 +213,12 @@ var z = 64 * 1024 * 1024, B = class {
213
213
  ownedUtf8Bytes: 0
214
214
  } : s, i = k(l, r), a = this.readResourceUsage();
215
215
  N(i, "get-worksheet-worker", void 0, a), P(i.jsonBytes, "get-worksheet-worker", void 0, a);
216
- let c = this.acceptWorksheet(e, l, i, a);
217
- typeof c == "function" ? t = c : c && ({rollback: t, commit: n} = c);
216
+ let c = this.acceptWorksheet(t, l, i, a);
217
+ typeof c == "function" ? e = c : c && ({rollback: e, commit: n} = c);
218
218
  }
219
219
  this.executeArchive((e) => e.acknowledge_sheet_cursor_terminal()), n?.();
220
- } catch (e) {
221
- throw t?.(), e instanceof c && (this.resourceFailure ??= e), e;
220
+ } catch (t) {
221
+ throw e?.(), t instanceof c && (this.resourceFailure ??= t), t;
222
222
  }
223
223
  u = !1, this.sessions.delete(r.sessionId), a();
224
224
  },
@@ -268,7 +268,7 @@ var z = 64 * 1024 * 1024, B = class {
268
268
  if (r && (e.kind === "cancel" || e.kind === "close")) {
269
269
  let n = r.identity.operationId === e.operationId && r.identity.generation === e.generation;
270
270
  return n && (r.canceled = !0), t(n ? {
271
- protocol: i,
271
+ protocol: s,
272
272
  kind: "accepted",
273
273
  sessionId: e.sessionId,
274
274
  operationId: e.operationId,
@@ -276,7 +276,7 @@ var z = 64 * 1024 * 1024, B = class {
276
276
  requestId: e.requestId,
277
277
  command: e.kind
278
278
  } : {
279
- protocol: i,
279
+ protocol: s,
280
280
  kind: "error",
281
281
  sessionId: e.sessionId,
282
282
  operationId: e.operationId,
@@ -290,7 +290,7 @@ var z = 64 * 1024 * 1024, B = class {
290
290
  }), Promise.resolve();
291
291
  }
292
292
  return e.kind === "cancel" || e.kind === "close" ? (t({
293
- protocol: i,
293
+ protocol: s,
294
294
  kind: "accepted",
295
295
  sessionId: e.sessionId,
296
296
  operationId: e.operationId,
@@ -298,13 +298,13 @@ var z = 64 * 1024 * 1024, B = class {
298
298
  requestId: e.requestId,
299
299
  command: e.kind
300
300
  }), Promise.resolve()) : (t({
301
- protocol: i,
301
+ protocol: s,
302
302
  kind: "error",
303
303
  sessionId: e.sessionId,
304
304
  operationId: e.operationId,
305
305
  generation: e.generation,
306
306
  requestId: e.requestId,
307
- error: f(/* @__PURE__ */ Error("worksheet pull session is not open"))
307
+ error: i(/* @__PURE__ */ Error("worksheet pull session is not open"))
308
308
  }), Promise.resolve());
309
309
  }
310
310
  async dispatchSafely(e, t) {
@@ -313,13 +313,13 @@ var z = 64 * 1024 * 1024, B = class {
313
313
  } catch (n) {
314
314
  try {
315
315
  t({
316
- protocol: i,
316
+ protocol: s,
317
317
  kind: "error",
318
318
  sessionId: e.sessionId,
319
319
  operationId: e.operationId,
320
320
  generation: e.generation,
321
321
  requestId: e.requestId,
322
- error: f(n)
322
+ error: i(n)
323
323
  });
324
324
  } catch {}
325
325
  }
@@ -337,7 +337,7 @@ var z = 64 * 1024 * 1024, B = class {
337
337
  for (let e of this.pendingOpens.values()) e.canceled = !0;
338
338
  let e = 1;
339
339
  for (let { host: t, identity: n } of [...this.sessions.values()]) await t.dispatch({
340
- protocol: i,
340
+ protocol: s,
341
341
  kind: "close",
342
342
  ...n,
343
343
  requestId: e++
@@ -353,7 +353,7 @@ var z = 64 * 1024 * 1024, B = class {
353
353
  let t = this.sessions.get(e.sessionId);
354
354
  if (t) {
355
355
  await t.host.dispatch({
356
- protocol: i,
356
+ protocol: s,
357
357
  kind: "close",
358
358
  ...e,
359
359
  requestId: 1
@@ -365,7 +365,7 @@ var z = 64 * 1024 * 1024, B = class {
365
365
  }
366
366
  readResourceUsage() {
367
367
  try {
368
- return p(this.executeArchive((e) => e.sheet_cursor_resource_usage()));
368
+ return l(this.executeArchive((e) => e.sheet_cursor_resource_usage()));
369
369
  } catch (e) {
370
370
  if (String(e).includes("worksheet cursor usage is unavailable")) return;
371
371
  throw e;
@@ -381,24 +381,24 @@ var z = 64 * 1024 * 1024, B = class {
381
381
  if (!Number.isSafeInteger(e) || e < 0) throw RangeError("sheetIndex must be a non-negative safe integer");
382
382
  if (!t) throw TypeError("sheetName must be non-empty");
383
383
  W(n);
384
- let i = this.nextSessionId++, a = {
385
- sessionId: i,
386
- operationId: i,
384
+ let r = this.nextSessionId++, i = {
385
+ sessionId: r,
386
+ operationId: r,
387
387
  generation: this.options.generation ?? 1
388
- }, o = new r(this.options.transport, {
389
- ...a,
388
+ }, a = new o(this.options.transport, {
389
+ ...i,
390
390
  maxByteCredit: z,
391
391
  timeoutMs: this.options.timeoutMs,
392
392
  disposeTransferred: this.options.disposeTransferred
393
393
  });
394
- this.active.add(o);
394
+ this.active.add(a);
395
395
  let s = !1, c;
396
396
  try {
397
- for (await this.options.open(e, t, a, this.options.timeoutMs);;) {
397
+ for (await this.options.open(e, t, i, this.options.timeoutMs);;) {
398
398
  W(n);
399
- let e = await o.pull(z, { signal: n });
399
+ let e = await a.pull(z, { signal: n });
400
400
  try {
401
- let t = e.usage ?? o.usageCheckpoint;
401
+ let t = e.usage ?? a.usageCheckpoint;
402
402
  t && this.options.onUsage?.(t);
403
403
  let r = R(e.payload, e.done, this.options.sharedStrings);
404
404
  if (yield r.kind === "rows" ? {
@@ -426,11 +426,11 @@ var z = 64 * 1024 * 1024, B = class {
426
426
  } finally {
427
427
  let e;
428
428
  try {
429
- s || await o.cancel(U(c));
429
+ s || await a.cancel(U(c));
430
430
  } catch (t) {
431
431
  e = t;
432
432
  } finally {
433
- this.active.delete(o);
433
+ this.active.delete(a);
434
434
  }
435
435
  if (c === void 0 && e !== void 0) throw e;
436
436
  }